![]() |
|
|
|
|
|
|
how to sleepSleep Forum - Questions & AnswersHow to clear my mind and go to sleep quickly?Question: I have always had a hard time going to sleep... Whether I fall asleep watching t.v. Or just in the dark I still lay here for hours. I can go from being exsausted to wide awake the second I lay down... How do I just clear my mind of everything and just fall asleep quickly.Answer: Learn how to do the body scan from mindfulness meditation from a video on youtube. The longer the better, it'll help you focus and relax. ![]() How to not sleep all day?Question: This is a bit of an odd question, but its something I struggle with on weekends and school vacations. I sleep all day. No, unlike my other counterparts its not that im nocturnal, but all I want to do is sleep. To a point I blame this on my restless sleeping during busy parts of my life;I could just be catching up, but I know that's not the entire reason. My problem is that while I could be doing enjoyable things like painting, drawing, reading they just exhaust me. Sometimes I feel guilty doing them because I know I'm proxcrastinating on a lot of projects I need to do (these projects are long term, but important. For example, I go to a tech school and in order to graduate you have to do a huge project related to your vocation. I am in the media and design program so I'm making a three minute animation complete with sound. It is a frame by frame animation so for every second there are 24 colored, shaded drawings. I'm having fun doing it but its always hanging over my head) Unless I'm doing anything school or work related I'm sleeping or mindlessly surfing the web. I have great ideas but i never carry them out because im "tired". Sometimes I wonder if its in my head but I really cant get any energy. So, my question is how do i gather the energy to do pleasent events?Answer: maybe you can learn to power nap: http://en.wikipedia.org/wiki/Power_nap -->"A power nap is a short sleep which terminates before the occurrence of deep sleep or slow-wave sleep (SWS), intended to quickly revitalize the subject. The power nap is thought to maximize the benefits of sleep versus time. It is used to supplement normal sleep, especially when a sleeper has accumulated a sleep deficit. Various durations are recommended for power naps, which are very short compared to regular sleep. The short duration of a power nap is designed to prevent nappers from sleeping so long that they enter a normal sleep cycle without being able to complete it. Entering a normal sleep cycle, but failing to complete it, can result in a phenomenon known as sleep inertia, where one feels groggy, disoriented, and even more sleepy than before beginning the nap. In order to attain maximum post-nap performance, it is critical that a power nap be limited to the beginning of a sleep cycle, specifically sleep stages I and II. Scientific experiments and anecdotal evidence suggest that an average power nap duration of around 15–30 minutes is most effective. Any more time, and the body enters into its usual sleep cycle. People who regularly take power naps may develop a good idea of what duration works best for them, as well as what tools, environment, position, and associated factors help induce the best results. Others may prefer to take power naps regularly even if their schedules allow a full night's sleep. Mitsuo Hayashi, PhD and Tadao Hori, PhD have demonstrated that a nap improves mental performance even after a full night's sleep. New sleep sensors and sleep timers available on several mobile devices allow advocates of power naps to sleep for exactly as long as they'd like to."<-- even better if you can plan your naps. use your cell phone to set your alarm for a half hour. first have a small snack then go lay down and try to nap. then when the cell alarm rings, get up and have a cup of coffee or tea, a coke or one of those 5 hour energy drinks (which really work well). if you do this at the same time every day, you will start to fall asleep quickly. make yourself get up even if you're still sleepy and have a cup of coffee or something. the body likes habits and you should be able to form this one pretty quick. ![]() Is it regular to not remember dreams no mater how much sleep I get?Question: But when I look around I remember that moment in my dream if I could manage to remember anything that happened :/Answer: that's completely normal. it doesnt matter how much sleep you get, you're lucky to remeber a dream you had. some people havent had dreams in months but they sleep a good 10 hours a day. the best time to remember your dream is the second you wake up from it, the longer you're up the less you remember. ![]() How to make a timer behave like Thread.Sleep C#?Question: I'm writing an animation code in Winforms in C#, that simulates the dropping of a piece into a slot of a Connect 4 board - the animation, frame by frame, updates the location of the slot, dropping it one slot at a time until it reaches the bottom. The problem is, the animation requires stopping the program for a short while so that the drawing code can be run properly, with the user seeing it, of course. It's not working at all. Originally I wrote my code like this: for (int g = 0; g < h; g++) { slots[i, g].Occupy(player); slots[i, g].Draw(); Thread.Sleep(100); slots[i, g].Unoccupy(); } But thanks to the help of a Yahoo! Answers volunteer, I found out that the Thread.Sleep code was blocking my drawing function from processing properly; he recommended I use timers. But I'm having an extremely difficult time working with them. Here's the code segment: System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); timer.Interval = 100; timer.Tick += new EventHandler(this.Test); //Animate for (int g = 0; g < h; g++) { slots[i, g].Occupy(player); slots[i, g].Draw(); timer.Start(); timer.Enabled = true; slots[i, g].Unoccupy(); } this.Test refers to the following function: void Test(object source, EventArgs e) { } It's empty because I wasn't sure how/what I was supposed to put in there. I've used timers before, but never like this, and I fear that the lack of performance is a result of my lack of knowledge. Please, if anyone can help, I've been stuck on this annoying little bug for over 2 days now; all I want is for my animation to work :(. I reread my question and I'm not sure if I made it clear enough; I want the timer to pause the execution of the program temporarily so that the Draw function of the slot can execute and appear properly.Answer: You have to stop trying to use a for loop. You can't anymore. What you need to do in the timer is execute 1 iteration of the loop, then wait for the next timer tick. But you can't execute it in quite the order you do now. You want to start out calling Occupy when you start the timer. Then when the timer fires, call Unoccupy, Then call Occupy for the next iteration. Then get out of the timer routine and wait for it to happen again. When g == h, you can stop. But now you have a problem: i, g and h are probably local variables, right? You will need to keep those someplace else, such as a class member variable. Someplace your timer code can find them. Not sure what i and h are. But the timer loop needs to figure it out somehow. (There are better ways than using class member variables, but start there and get it working). ![]() |