I was up working on SEO until 5 am last night, and now it's 4:30 and I'm coding away. Does anyone have any good tips to help with insomnia? I tend to work late into the evenings, and I get such an adrenaline rush from coding (I'm a nerd, I know) that I have a hard time winding down. Then, when I finally do, my mind tends to wander while I'm trying to fall asleep, and I keep thinking of things I can implement and, well, there's no time like the present! I try to put them off until morning …

Member Avatar
Member Avatar
+1 forum 23

Hello, I do not know a lot about computers, so I know this is a long shot. However I really need advice! I have just got a new computer tower (its second hand) and a monitor from a family member. Both monitor and tower were in full working order before I brought them home. However, I attatched my own monitor and my partner altered the resolution, this worked fine. However, when I next turned my computer on a message comes up on the computer saying `monitor is going to sleep` this happens on both monitors, and I have no idea …

Member Avatar
Member Avatar
+0 forum 7

This is a basic CPP sleep fuction. As you can see CPP libs do not come with a time sleep/wait fuction to use in your code/loop. So due to boring jurney to Saint Petersburg, i decided to write something/code to give anyone who has been wondering why CPP does not consist of that function. The idea is nice because there are at least 5 ways to achieve this results. I always like the easy and straight forward ones. Have a look at the code below. I will starting a QT GUI full tutorials in the next few days. Everything QT …

Member Avatar
Member Avatar
+0 forum 12

I have a Microsoft Windows XP Media Center Edition 2005 HP desktop PC when I power the computer on I got Vga input: no input signal and the monitor went back to sleep. If you do you think that is a problem with the video card it is attached to the motherboard. I also don't know that much about computers so please try to keep the answer simple.

Member Avatar
Member Avatar
+0 forum 17

I'm adding sound to a simple matching game. I have a sound for a flipping a card, a match, and no match. The problem I am having is when 2 cards are match, the flip and match sounds play simultaneous. So I tried calling Sleep at line 146, which gives me the correct behaviour for the sounds, however it delays turning the 2nd card over. I have also tried Sleep in other portions of the code. Perhaps calling Sleep is not the best approach? Not a huge deal, just trying to selfteach. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; …

Member Avatar
Member Avatar
+0 forum 9

Hey all - I have searched the internet with no luck, so I finally resorted to here to ask for information. I am trying to find a way to find the time it takes to shut down, sleep, and wake from sleep for a Windows 7 install. I understand that there are solutions (BootRacer, Soluto, even the Windows Event Viewer) to find out the boot time for Windows, but I cannot find out how to time the rest of these! Thanks in advance.

Member Avatar
Member Avatar
+0 forum 5

Is there a sleep function for so many seconds in HTML or am I gonna have to use JavaScript

Member Avatar
Member Avatar
+0 forum 6

Very recently, I let my laptop (HP) battery get too low, and it died on me. Usually, upon plugging in the adaptor, everything starts right back up again. However, this time, the laptop runs, but all I can see is a black screen. I can even hear the little chime when windows starts (vista), but all I can see is black. I don't think it's a backlight issue, as I the black screen still emits a sort of "glow". I know I need a new battery, but as long as it's plugged into the power supply, shouldn't it work fine? …

Member Avatar
Member Avatar
+0 forum 5

As far as i know, for desktop, sleep transitions to hibernation(hybrid mode) so even if power is suddenly cut off. All running documents or processes are saved and will continue running when the desktop is turned back on. Now for Laptops. If the laptop is put to sleep and suddenly it loses power. Does it also make an auto hibernate mode? or any running applications are lost in the process?

Member Avatar
Member Avatar
+0 forum 2

I have a customized computer intel core i3 Ati Radeon 5673 Intel dh67vr 1 TB hardrive I updated my bios it completed sucessfully but when it reboooted my monitor keeps on saying no input then goes to sleep. Please help!

Member Avatar
Member Avatar
+0 forum 1

Hello there, i'm having trouble that my computer get wake up after i put on sleep mode. Sometime it wake up in 10 min sometime pretty quick like in couple of minutes. Any idea how to reslove this issue. Regards Shahid

Member Avatar
Member Avatar
+0 forum 4

I have an ACER 7741Z. THe screen just went black on me. I unplugged it over night, took battery out, help start button 60 seconds then restarted it. Screen still is black after I type in my security code. After a period of time the computer goes into sleep mode and runs my pictures perfectly like it ahould. What should I do????

Member Avatar
+0 forum 0

Program wont run error says 1>c:\users\owner\documents\visual studio 2008\projects\ia\ia\jb bakery.c(16) : warning C4013: 'sleep' undefined; assuming extern returning int 1>Linking... 1>JB Bakery.obj : error LNK2019: unresolved external symbol _sleep referenced in function _welcome 1>C:\Users\Owner\Documents\Visual Studio 2008\Projects\IA\Debug\IA.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://c:\Users\Owner\Documents\Visual Studio 2008\Projects\IA\IA\Debug\BuildLog.htm" 1>IA - 2 error(s), 2 warning(s) [CODE]#include<stdio.h> #include<conio.h> #include<time.h> void welcome(); int main() { welcome(); getch(); } void welcome() { printf("\nWELCOME"); sleep (1000); printf("JB Bakery Interface"); }[/CODE]

Member Avatar
Member Avatar
+0 forum 7

I want to make a bash script that will run every time my computer wakes up from sleep. I will be leaving it on and logged in all the time, so a login script would be useless. Is there a certain file name I can give it or something?

Member Avatar
Member Avatar
+0 forum 1

how can I sleep my program without sleeping others (or making them slower)? I am using a windows application. here is a fragment of my code: [CODE] //#includes... int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, char * cmdParam, int cmdShow) { MSG msg; int status; Window myWind(SW_SHOW,"Name",150,120,500,0); for(int i=0;i<550;i++){ myWind.setLocation(i,i); //here is my problem //is there another way (like a thread)? Sleep(100); } while ((status = GetMessage (& msg, 0, 0, 0)) != 0) { if (status == -1) { return -1; } DispatchMessage (& msg); } return msg.wParam; } [/CODE]

Member Avatar
Member Avatar
+0 forum 2

Guys help me please, the equation on 2/3 is giving the waterTemp to 0; how come it is not changing? and also, if the nWaterTemp reached 20.00or somewhere 20.00 to 21.00; it is supposed to print that "THe kettle is now on "Help please [CODE]#include<stdio.h> #include<stdlib.h> #include<cstdlib> #include<time.h> void wait ( int seconds ){ clock_t endwait; endwait = clock () + seconds * CLOCKS_PER_SEC ; while (clock() < endwait) { } } void behaviourOn(){ double nWaterTemp = 0; int counter = 0; while(nWaterTemp <=100.0){ counter++; printf("Ticking! %d\n",counter); wait(1); if(nWaterTemp >=20.0 && counter%2==0){ nWaterTemp+=0.75; printf("The water temp is %f\n",nWaterTemp); }else if(counter%3==0){ …

Member Avatar
Member Avatar
+0 forum 3

So i recently dug my dad's old computer out of the garage and fired it up. Since i didn't have a monitor yet, i borrowed the one off my dad's current computer the first few times. Everything was working just fine and no problems. Then 2 days later, i got an older monitor from my brother for free. I tried using it, but it kept going into sleep mode. I did a little tinkering around and figured out that the computer doesn't even need to boot up for this to happen. The second i plug the monitor into the computer, …

Member Avatar
Member Avatar
+0 forum 3

I was looking around the time module. The time.sleep(no_of_seconds) sleeps the program for no_of_seconds seconds. I don't think this is busy wait. It must be scheduling the process at a later time. Just curious of how this is working.! :)

Member Avatar
Member Avatar
+0 forum 4

I'm working on a CyberPet assignment and I'm not sure how to do the following: 'Then write an [ICODE]encounter ( CyberPet )[/ICODE] method that allows one CyberPet to encounter another and will describe the encounter by returning a String data type. Note that the method should take a CyberPet parameter. If a small pet encounters a big pet, the method should return, “See yah!” If a large pet encounters a small pet, the method should return, “I’m going to eat you!” If they are the same size, the method should return, “Let’s go to McDonalds!” For example: if pet 1 …

Member Avatar
Member Avatar
+0 forum 8

I am using a) Linux b) Pthreads I want to write a program, with two pthreads, to cater for two queues of people. People arrive at each queue at a random interval of 1 - 10 seconds. Each time a person arrives, print out the number of people in each queue to the screen. Apparently sleep() pauses the whole program, how can a pause one particular thread??

Member Avatar
Member Avatar
+0 forum 4

hi everyone so I am trying to do something after waiting a random number of seconds in a while loop.I have python22 installed and I am working on windows xp. The problem is that it time.sleep works fine the first time but returns the following error after that. I dont understand why that could be. Traceback (most recent call last): File "testing.py", line 11, in ? time.sleep(wait) AttributeError: 'unicode' object has no attribute 'sleep' [CODE] import feedparser, string, os, time, smtplib,platform,random timeholder = '' while 1: wait = random.uniform(60, 121) time.sleep(wait) print "fetching now" # do something # If new …

Member Avatar
Member Avatar
+0 forum 1

Hello, I am new to the community (well my first thread anyway). I was just wondering which programming language would be the most effective to run a light weight process watcher, and when it detects a particular process to start a another wait loop, which, when the process ends it will force the computer to sleep. (Another requirement is to do this again upon waking up) So the general layout of the process: [CODE] wait(){ [INDENT]if(ProcessName is running){ [INDENT]wait(){ [INDENT]if(Processname is no longer running){ Tell Computer to sleep break to the outside wait loop }[/INDENT] }[/INDENT] }[/INDENT] } [/CODE] Any …

Member Avatar
Member Avatar
+0 forum 1

Several weeks ago I installed Win 7 over Vista on a 64-bit HP desktop. Now after a routine reboot atempt machine acts as if it were dead except the green light on the back showing power on. What now? To make maters worse I had the same problem and found an easy solution but now I don't remember what it was. Help! Thank you

Member Avatar
Member Avatar
+0 forum 1

For a project i'm working on now, i need to create a function that is in the format Hours:Minutes: seconds: Fraction where fraction is 1/10th of a second. It should print out every one tenth of a second. I have no idea where to start or how to do this, and am fairly new to python. it has to be as simple as possible and use time and time.sleep. I know time.sleep has to be time.sleep(.1), and to import time, but I dont know how to use nested loops with this. Some help would be greatly appreciated :)

Member Avatar
Member Avatar
+0 forum 9

Hi. I want to run some shell commands on linux machine with python Popen, for ex. "ping". How I can terminate the process, if it isn't finished normally in a given time? I've tried write some code, can anybody improve it or give some better idea? Any suggestions appreciated. Thanx. [CODE] wait_sec = 10 import time import subprocess wForceKill = True res = subprocess.Popen(self.command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) for i in range(wait_sec): time.sleep(1.0) res.poll() if res.returncode != None: wForceKill = False break if wForceKill: res.terminate() print("Subprocess was killed!") res_out = res.communicate()[0] [/CODE]

Member Avatar
Member Avatar
+0 forum 1

So I'm writing a bit of code for use in an IRC bot. I tried to use scheduler to get around the barbaric-ness of calling time.sleep() every time I want the bot to delay for a few seconds. In scheduler you can choose the delay function "for example time.sleep()"-- but I haven't found any mention of other delay functions anywhere on the net. Being an IRC bot it's important that it can receive pings and distribute pongs when necessary. time.sleep(), however, pauses the entire .py, rendering the ping/pong lines irrelevant and ultimately leading to a ping timeout. [CODE]import time import …

Member Avatar
Member Avatar
+0 forum 2

hello everyone i was wondering if anyone would be able to help me in an program i have to do. the program wants me to use my initials A and G and plot them on using gotoxy() function to make some thing that look like the picture in the link [url]http://i205.photobucket.com/albums/bb311/superchica840/example.jpg[/url] so basically i need to use the same letter to make the letter i know i need to use for loops, not sure if nested loops, basically i just don't know what i have to do with it. Would really appreciative the help, thanks to anyone who can. also …

Member Avatar
Member Avatar
-1 forum 2

Hi, I will try and make this brief and to the point. My home built system (which has been running smoothly for 2 years now), has just recently experienced some major difficulties. I had been running Windows 7, and put the computer to "sleep." The screen went blank, but the computer continued to run. I then manually shut the computer down. Upon starting the computer back up again, the computer would boot on, but the display would not register an input. So i have no access to BIOS etc. When i turn the computer on, the lights on the front …

Member Avatar
Member Avatar
+0 forum 1

Hey :) I have written this code, but it seems that theres an error in it, that i can't find. When i try to compile it i get this error: Call to undefined function 'sleep' in function main(). I know it has something to do with that sleep function, because when i remove it, it works. Someone help me plz :) [CODE] #include <iostream.h> #include <windows.h> int test; int main(void) { cin >> test; if(test == 123) { cout << "Venter nu 5 sekunder!"; sleep(5000); cout << "Der er nu gaaet 5 sekunder!"; } else { cout << "Her er …

Member Avatar
Member Avatar
+1 forum 4

Hello I am very, very new to this C++, and i have been working on something that could help us with something, but thats a long story... Anyways, i want the program to first delete a file then wait some time, and then delete another file. I got it to delete the files i wanted it to delete, but only if the files are in the same directory as the exe. I can't get it to wait either, i have been looking all around the internet, but i can't find anything that works. Can anyone help me plz? thx :)

Member Avatar
Member Avatar
+0 forum 2

The End.