Programming :: Continuously Polling A Specified Key?

Nov 23, 2010

In a lot of programs I write, I would love the option to simply hit a key without disturbing the data, and have some other action take place.

An example loop would be,

Code:
for(some var = 0; some var != infinity; some var++){
if(poll(left mouse button)){ stop doing this stuff; }
.
.
.
doing other stuff, because the left mouse button wasn't pressed
}

but, I don't want the loop to pause for more than a the tiniest fraction of a second, and I certainly don't want it to sit there waiting for me to do, or not do, something.

What is it I'm looking for?

(Oh, and if you haven't guessed, c/c++ are the languages of choice for this operation - I don't care which you might have in mind when submitting an answer -- in fact, it need not be either of those languages.)

View 2 Replies


ADVERTISEMENT

Programming :: How To Run The Threads Continuously

Dec 1, 2010

I have two threads & i want to run it continuously ,with while(1) it is possible . Is there any other way to run the threads continuously

View 12 Replies View Related

Programming :: Resident Set Size Increasing Continuously

Jun 13, 2010

I am working on a C++ application, using the latest Slax as distro and CodeBlocks 8.02 as IDE.

I have a problem that is really biting me hard... And i'm sorry if my questions will sound trivial: i'm still a C++ noob...
Basically,looking with KSysGuard i can notice a constant increment of the VmRss parameter,i.e. the resident set size of my program.

While stepping with the debugger i noticed that the VmRss parameter increases by 4 (KB?) when i push_back into some STL vectors (i have this problem in various parts of the code).

While i analyze the problem with KSysGuard i'm also looking at the /proc/statm file of my process. When KSysGuard shows a VmRss increment by 4, i can actually see an increment (by 1) in the 2nd parameter of that file (which is the resident set size) but not in the 1st parameter (which is the total program size).

What surprises me most is that the VmRss is reported in KB and i really am not pushing 4 KB inside the vector all at once...

So i ask:

1)Is this a memory leak?

2)Why the total program size doesn't increase?

3)To me, it looks like VmRss increases "cumulatively" only after several insertions in the various vectors.

View 3 Replies View Related

Programming :: Getting A Script To Continuously Monitor Appended Data To A Log File?

Oct 13, 2010

Code:

if ! [ -f ${PATH}/myfile.txt ];then
echo $(date +%Y%m%d"_"%H%M%S)": Nu am gasit fisierul ${PATH}/myfile.txt"
ps -fxu pin | grep "/usr/local/coreutils/bin/tail -f ${LOG_PATH}/x.log$" | awk '{system("kill "$2)}'
cat ${LOG_PATH}/x.log | sed -n -e '/LONG/{x;1!p;g;;}' -e h > ${PATH}/myfile.txt

[code]....

I have a continuously growing log file (x.log) in which i have to look for certain lines that contain "Long". The line above each line containing the word "Long" it contains a time stamp. I want to extract each line containing the time stamp into myfile.txt and check the difference between time stamps. Whenever there is a difference i need to run another script (${CAL_PATH}/${APP_NAME}), then sleep 1, then continue searching. Lines with "Long" do not appear continuously, but in blasts. The script runs fine until the first pause encountered. Starting with the first pause, tail -f doesn't write in myfile.txt anymore. Can someone help me understand why "tail -f" it stops writing into myfile.txt? Or does someone know an alternative to "tail -f" of achieving the initial scope of the script?

View 5 Replies View Related

Slackware :: Disable Dhcp Polling For Eth0 At Boot Up?

Apr 20, 2010

During installation I set eth0 to use dhcp to get an IP address. I then installed gnome and networkmanger which handles my interfaces and works fine. But during bootup the system pauses for 5 seconds or so while it polls for dhcp. It then times out and gives me a 169.254.xx which is then replaced when networkmanager starts up at the end of bootup.

How do I stop the polling to cut out the 5 seconds?

View 14 Replies View Related

OpenSUSE :: Kwrite Continuously Crashes In SU?

Aug 26, 2010

I need to change attributes in my /etc/fstab file.

I cant change my fstab file because apparently Kwrite only crashes when accessed by Konsole in SU mode.

I type this input/output:

linux-mg28:/home/me # kdesu kwrite /etc/fstab
kdesu(13370): Session bus not found
KCrash: Application 'kdesu' crashing...
sock_file=/root/.kde4/socket-linux-mg28/kdeinit4__0

[Code]....

I have a dual XP/suse11.3 system. I even removed my old Suse along with all its partitions, leaving only the NTFS XP, re-downloaded the 11.3 ISO image, burned a new fresh install disk and reinstalled 11.3. I updated the software in YaST.

I still can't modify my fstab file. But I can locate the file in Dolphin and click it to open in a Kwrite window. Read only of course.

View 9 Replies View Related

General :: Ssh: Continuously Synchronize Files, One Way?

Aug 1, 2011

Scenario: An IDE is set up on a Linux desktop box, editing PHP files locally. Every time I save a file, I want this change to appear on the linux server where Apache is running. The server has ssh (and samba and nfs for that matter).As a reference, when I edited files on Windows, I finally came over WinSCP as the exact tool I needed - WinSCP have just this feature present, with initial synch and then continuous update, using the filesystem watch service: "Keep Remote Directory up to Date".

On Linux, one could argue that sshfs could be employed to sidestep the need for synchronization entirely. On windows, a samba-share would do the same. However, I want the IDE to work with local files (on a SSD disk!), not having to go over the network to do PHP indexing and whatnots, which takes ages.But sshfs might be a part of the solution nevertheless - so that the continuous synchronization just needed to be done between two local directories.

View 5 Replies View Related

Ubuntu :: Laptop Fan Runs Continuously?

Nov 18, 2010

I have an IBM ThinkPad T43 on which I run Ubuntu 10.10. Everything works fairly smoothly except that I notice my laptop fan runs continuously. When I turn on the machine it revs up until boot-up is complete, then it shuts off for a few minutes, and then it comes back on and never turns off until I'm through working.Is this strictly a hardware problem, or is there something about Linux that causes the computer to run hot and so causes the fan to work hard? Is there a setting that I could check to see if the fan is working properly? I don't use any exotic programs or run video intensive games, so there's no reason why the computer should run especially hot

View 1 Replies View Related

OpenSUSE :: HDD Working Continuously And System Running Hot

Feb 17, 2010

With what software I can slow down my HDD. With Power Manager if i change from Performance to Aggressive Powersave my HDD still working all the time and it's hot all the time on my laptop.

View 1 Replies View Related

General :: CPU Fan Running Continuously On A Laptop / Is It A Problem?

Sep 13, 2010

I have dual boot on my machine - Windows Vista and Fedora 12.

I have noticed that while I am on Vista, the fan runs only intermittently, but while I am on Fedora, it runs continuously. I have tried to tweak the power and CPU settings for Fedora, but did not get anywhere.

Should I be worried that the fan is running continuously? Or is it okay, the fan is just doing its job?

View 4 Replies View Related

Ubuntu Servers :: Server Restarts Continuously?

Jan 31, 2010

Recently, I updated the kernel to the latest version and also installed Ruby and the Passenger module for Apache. The server was fine for a few days.However, today, it's been restarting randomly (usually a minute after I can log in).I tried booting with recover mode so I could view the logs for a longer period of time, but that caused it to restart before even allowing me to log in. Now, all boot modes will just cause the server to restart right after the GRUB messages appear.Our server setup complicates things. We have a RAID-1 mirroring for the /boot partition and a RAID-5 (software) for the / partition

View 1 Replies View Related

Ubuntu :: Continuously Resume A Session From Hibernate

Apr 13, 2010

So I'm having this weird problem where my computer wants to continuously resume a session from hibernate no matter how I shut it down. I think it started when I tried to hibernate my computer with the battery really low. Somehow it messed it up. In any case, it can't resume properly, but gets stuck somewhere in the middle (I think when it's trying to sort out the resume image). Each time I power it on I have to boot it, restart in the middle of the boot so the boot menu comes up as it starts up again, edit commands before boot and add the "noresume" option so it will boot up normally.

View 2 Replies View Related

Red Hat / Fedora :: Firefox Continuously Opens Windows?

Jan 28, 2010

Truthfully, I don't know if this is a Firefox bug or not, but I've only experienced this on my Fedora machine.

There doesn't seem to be any particular pattern, and it's happened in trusted sites when clicking on various links (like this one for instance), but Firefox will suddenly go mad and just start opening window after window.

The only way I can get out of it is 'ps -ef' 'ing for the firefox process and killing it.

This has happened under both 10 and 12.

Submitted a forum post on mozilla's support site here: Firefox Opens 'Infinite' Windows During a Session

View 9 Replies View Related

Networking :: Testing The Ethernet Connection Continuously?

Nov 2, 2009

My program is working. However, I would like to add in some features. Let see my code first

Code:

if (returnresult<=0)
{
printf("Connecting....
");

[code]....

When the ethernet network connected, it will go into the else loop at line no. 13. The system will send status and display the status at control panel screen. If at this point, the ethernet disconnected, it will go back to the if loop at line 1. The system will keep trying to connect to the network and keep loop the if loop until it is connected.

Question now is I need the system to test the connection too after going into the operation loop that is start from the line no. 47. If the system went into the for (int c=0;c<cCOL;c++), it will need to do all the operations as indicated by cCOL times before it exit that loop and go into the previous loop.

I need the system to detect connection everytime an operation is going to happen or ended and if there is no connection, it will trying to connect. Before it is connected, it will not continue the operations. I tried to put the function "Connect (szPort, szAddress)" into each loop. Yes, the operation stop everytime the network disconnected. However, it shows on control panel screen "New Connection...." everytime it execute the statement. In fact, the network never disconnected.

I tried to look at the Connect function code, it is as below, I cannot figure out any statement that can stop the appearance of that "New Connection...". It may be hidden at the library source code, it is too hard for a beginner to modify the library code.

Code:

int Connect (char *szPort, char *szAddress)
{
/* Set the remote port */
int port; /* port number */

[code]....

View 1 Replies View Related

Software :: Produce A Video That Loops Continuously?

Mar 15, 2010

I have an AVI which I produced on Blender in which a camera revolves around a model.

I want the camera to continuously circle the model over and over again.

I know I can do this in a GIF file format, but are there other formats that will do this?

What software can I use that would accomplish this?

View 14 Replies View Related

Debian :: Uninterpretable Apps Continuously Crash Computer?

Mar 15, 2011

I was wondering what is happening to my computer. It runs perfectly fine, until out of nowhere my CPU load goes up to 100% for no reason, and in the System Monitor, the process that I think is responsible is the "uninterruptible process". It's so far been chrome, firefox-bin, and now gnome-netstatus-applet.

Is this a hardware problem or buggy software? Because I honestly don't know what it is. I've even reinstalled the programs and rebooted several times, most of the reboots were because of my computer crashing every time!

View 13 Replies View Related

Fedora X86/64bit :: Services Fail To Start Continuously

Aug 22, 2010

I have installed fedora 13 , 86_64. and was working fine until now. The problem was that JEXEC service Froze while booting. So I removed it /etc/init.d. The next time when I booted ATD service Froze, so I removed it by the same way. Next it was the turn of CROND followed by KSM , KSMTUNED. Then came ABRT-DAEMON which I had to type a #yum erase abrt* command. Finally it came to the turn of SM-CLIENT. I don't know where it is or what it is. Didn't find quality posts on the internet. What the heck should I do and I dont want to do a reinstall.

View 14 Replies View Related

General :: Utility To Continuously Monitor An Arbitrary Command?

Mar 18, 2010

I seem to recall there exists a small UNIX tool to repeatedly execute and display the output of another command at a given interval.

Kind of like "top" works by default but then for any other command.

Does anybody know such utility?

View 1 Replies View Related

Ubuntu Networking :: LAN - Connect Using DC++ But Connection Just Continuously Times Out

Feb 20, 2010

I recently started attending University and there is a filesharing hub set up throughout the dorms. I want to connect to it using LinuxDC++ but the connection just continuously times out. I have used DC++ before on Windows and never had any troubles so I am thinking it is something to do with networking in Linux (I have only been using Ubuntu for about a month).

View 2 Replies View Related

Ubuntu Networking :: Linksys WUSB54Gv4 Continuously Disconnects?

Jun 9, 2010

I've recently downloaded, installed Ubuntu 10.04 (june 5 2010)

As title suggests, this is about my USB wireless adapter Linksys WUSB54G ver.4 periodically failing. Now, the exact problem AND solution was posted on this thread:

[URL]

Essentially, I have to try a new kernel or something. I downloaded the kernel 2.6.34 at http://kernel.org/ which is supposed to solve my networking problem. But above thread suggests building my own kernel somehow [URL] and some of its steps are unfortunately not straightforward as copy-and-paste and i'm afraid i can't go on after trying to mimic command prompts a few times.

I tried referring to other sites, like

[URL]

but their suggested steps aren't exactly the same, or maybe they are really but i'm too dumb to see it.

I think I managed to copy the config file (i hope i chose the right one) and put it to the extracted folder of new kernel I just downloaded, but "Build the linux-image and linux-header .deb files" ?

View 5 Replies View Related

Ubuntu Installation :: Live CD Screen Flickers Continuously On 10.04.1

Aug 28, 2010

As the title says, when I select the install option on the liveCD, the Ubuntu logo is shown, and the flickering starts. I've tried the vga=XXX option, but no luck. Any experiences? It doesnt' happen with the 9.10 live CD...

View 3 Replies View Related

Ubuntu :: 10.10 Continuously Checking Empty CDROM Drive?

Nov 25, 2010

I've just installed Ubuntu desktop 10.10 (32 bit). No matter what programs I run, the CD-ROM (DVD-ROM) drive is checking for a new CD/DVD every 5 seconds or so (even if no applications are running). It is quite annoying because of its robotic noise. The drive is empty. How could this be turned off? Is the media manager misconfigured by default?

View 1 Replies View Related

Ubuntu Networking :: Wireless Box Disconnects / Reconnects Continuously

Jan 11, 2011

After the last system update (few days ago) the wireless box disconnects and reconnects continuously (every 60-90 secs). This is the pertinent /var/log/messages when it disconnects:
Code:
Jan 11 16:16:24 ibm kernel: [ 8073.320442] -->RTUSBVenderReset
Jan 11 16:16:24 ibm kernel: [ 8073.321453] <--RTUSBVenderReset
Jan 11 16:16:26 ibm kernel: [ 8075.624596] Key1Str is Invalid key length(0) or Type(0)
Jan 11 16:16:26 ibm kernel: [ 8075.624632] Key2Str is Invalid key length(0) or Type(0)
Jan 11 16:16:26 ibm kernel: [ 8075.624668] Key3Str is Invalid key length(0) or Type(0)
Jan 11 16:16:26 ibm kernel: [ 8075.624705] Key4Str is Invalid key length(0) or Type(0)
Jan 11 16:16:26 ibm kernel: [ 8075.625355] 1. Phy Mode = 0
Jan 11 16:16:26 ibm kernel: [ 8075.625358] 2. Phy Mode = 0
Jan 11 16:16:26 ibm kernel: [ 8075.741083] 3. Phy Mode = 0
Jan 11 16:16:26 ibm kernel: [ 8075.780107] MCS Set = 00 00 00 00 00
Jan 11 16:16:26 ibm kernel: [ 8075.795195] <==== rt28xx_init, Status=0
Jan 11 16:16:26 ibm kernel: [ 8075.807107] 0x1300 = 000a4200
Jan 11 16:16:28 ibm kernel: [ 8077.937015] pci 0000:02:1d.0: wake-up capability enabled by ACPI
Jan 11 16:16:28 ibm kernel: [ 8077.960539] pci 0000:02:1d.0: wake-up capability disabled by ACPI
Jan 11 16:16:28 ibm kernel: [ 8077.977291] tg3 0000:03:01.0: BAR 0: set to [mem 0xfb100000-0xfb10ffff 64bit] (PCI address [0xfb100000-0xfb10ffff]
Jan 11 16:16:29 ibm kernel: [ 8078.097571] ADDRCONF(NETDEV_UP): eth1: link is not ready

And this when manually reconnected:
Code:
Jan 11 16:16:37 ibm kernel: [ 8086.167522] -->RTUSBVenderReset
Jan 11 16:16:37 ibm kernel: [ 8086.168530] <--RTUSBVenderReset
Jan 11 16:16:39 ibm kernel: [ 8088.464724] Key1Str is Invalid key length(0) or Type(0)
Jan 11 16:16:39 ibm kernel: [ 8088.464760] Key2Str is Invalid key length(0) or Type(0)
Jan 11 16:16:39 ibm kernel: [ 8088.464796] Key3Str is Invalid key length(0) or Type(0)
Jan 11 16:16:39 ibm kernel: [ 8088.464833] Key4Str is Invalid key length(0) or Type(0)
Jan 11 16:16:39 ibm kernel: [ 8088.465510] 1. Phy Mode = 0
Jan 11 16:16:39 ibm kernel: [ 8088.465513] 2. Phy Mode = 0
Jan 11 16:16:39 ibm kernel: [ 8088.581175] 3. Phy Mode = 0
Jan 11 16:16:39 ibm kernel: [ 8088.621207] MCS Set = 00 00 00 00 00
Jan 11 16:16:39 ibm kernel: [ 8088.636185] <==== rt28xx_init, Status=0
Jan 11 16:16:39 ibm kernel: [ 8088.648150] 0x1300 = 000a4200
Jan 11 16:16:39 ibm kernel: [ 8088.751141] ERROR!!! RTMPSetTimer failed, Halt in Progress!
What is going on?

View 9 Replies View Related

Debian :: Keyboard Skipping Letters And Continuously Typing Same Letter

Jan 30, 2016

I recently built my first computer which has Debian Jessie running on it.

Everything was running great until I updated the computer a few days ago. After doing that and turning it on a few hours later, the keyboard started missing letters (as in it wouldn't register every key click) and was also typing some letters over and over again. It seems that it doesn't matter what key I press, the same problem occurs.

I tried using the keyboard on my laptop; it worked perfectly. I also tried connecting up another keyboard I had laying around and that seemed to have the same issue. Both keyboards are mechanical.

View 7 Replies View Related

Fedora Security :: System Is Continuously Hang When Log To Yahoo Webpage?

Dec 6, 2009

i am afraid that some one palying in my fedora 12 system , " hacked " first i got this message when i log to my broadband internet provider

Quote: You have asked Firefox to connect securely to ******, but we can't confirm that your connection is secure. Normally, when you try to connect securely, sites will present trusted identification to prove that you are going to the right place. However, this site's identity can't be verified What Should I Do?

If you usually connect to this site without problems, this error could mean that someone is trying to impersonate the site, and you shouldn't continue.

[Code]...

then when i log to yahoo mail , my system hang for a while then continue. how do i know that my system is secure ? what are the steps i should follow to secure my system ? i am still newbie and i dont have time to spend it in search in google or reading blogs

View 2 Replies View Related

Fedora Installation :: HP Pavilion ZE5570US - 12 - Screen Continuously Flashes

Mar 3, 2010

I was running Fedora 10 I belive- no issues - did an update to 12 via DVD and now the screen continuously flashes... I see posts about Nvidia issues - but this laptop uses ATI based on HP's website.

View 6 Replies View Related

Fedora :: Kernel: Imklog Continuously Generating Error Messages

Oct 4, 2010

I am using latest updated Fedora 13 (presently kernel-2.6.34.7-56.fc13.i686).

kernel imklog error messages fills my hard disk again and again, /var/log/messages file becomes more than 5Gb daily.

the /var/log/messages file contains following entries:

Sep 27 10:35:09 arun kernel: imklog 4.4.2, log source = /proc/kmsg started.
Sep 27 10:35:09 arun rsyslogd: [origin software="rsyslogd" swVersion="4.4.2" x-pid="1083" x-info="http://www.rsyslog.com"] (re)start
Sep 27 10:35:09 arun atd[19007]: File a0000b0145c567 is in wrong format - aborting

[Code]....

I think, I can stop kernel logging from /etc/rsyslog.conf, but I wanted to know the real problem.

View 2 Replies View Related

OpenSUSE Hardware :: Printing System Continuously Prints Same File?

Apr 1, 2010

I made a BIG mistake and tried to print a PDF document from Evince 2.28.2. Evince sends a garbage filled print job to the queue that results in nothing but garbage being printed. I noted the problem an tried to kill the print job but could not because it does not show up in the print queue. It appears that the printer sent an error back to the print system and the print system now continues to print the job forever - that is, anytime openSUSE is running, even after reboots.

Note that printing the test page works and that the printer also works fine with gedit and OpenOffice.

If I go to Control Center -> Printing then right click on the icon for the printer and click View Print Queue, the print queue is empty.

In YaST Control Center -> Printer -> Policies the "Specify error policy" is set to "abort and delete the job and proceed with the next job." The "Apply this error policy to all local printer configurations" checkbox was checked when this policy was set. If this is what should have ultimately killed the job it did not work.

how to stop the print system from trying to print this garbaged print job. It has been trying to print the same garbaged print job for the last five days!

View 7 Replies View Related

Ubuntu :: Get The Mouse To Continuously Click Automatically After A Set Time Interval?

Mar 21, 2010

not sure if this goes here, but is there a way to get the mouse to continuously click automatically after a set time interval? (eg, 2 seconds) i've googled and found plenty of auto-clicking software for windows, but no luck for linux.

View 2 Replies View Related

Ubuntu :: 11 - Desktop Is Continuously Flickering The Purple Splash Screen

May 10, 2011

Ok so just updated 10.10 to 11 and I can't do anything, the desktop is continuously flickering the purple ubuntu splash screen behind it and if I click anything it will open but flashaswell, I did have nova desktop which changes my wallpaper automatically but I uninstalled it as I thought that may be thebprovlem

Is there anything I can do? Or will I have to copy the home folder to USB and then do a clean install?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved