timer

Detecting if the garbage collector was invoked (.Net)

When using SqlConnection, it's important to always close it when used - either by .Close() or placing the SqlConnection in a "using". Unfurtunately, people, including myself, tend to forgot that and this is where the garbage collectors rescues me for a while until i've forgot to close my connections too many times or the number of people...

Critical Problem with Sharepoint Timer Job Properties

Some minutes ago I tried to create a time job A added some properties like this.Properties.Add("fileName", fileName); this.Properties.Add("username", new NetworkCredential("username", "passworD"); After updating the job a get a critical error in the Timer Job list of the Central Administration occured. The platform does not know how...

Sharepoint Timer Job process doesnt release file (IOException)

I created a timer job (via Feature Deployment) that creates a file in hostserver´s filesystem. private static void myMethod(Byte[] results, string fileName) { using (FileStream stream = File.OpenWrite(fileName)) { stream.Write(results, 0, results.Length); stream.Close(); stream.Dispose(); } } als...

Force a Timer to cycle in a set time [C#]

Hello all. I'm rewriting a VB 6.0 program in C# .Net for an internship. It measures incoming data from a precision grinding machine and gives a readout on its accuracy. A lot of the meat of the program is done within a Timer object, with an interval of 10. The program is unfinished, so it has yet to be tested on an actual machine, but ...

Flex app behaves differently on Chrome, Firefox

My Flex app seems to have different frame rates in Chrome and Firefox. I have a preloader that is essentially a splash screen that fades away with a Timer, and it is this part that has the noticeable frame rate difference--it fades away faster in Firefox. The odd thing is that any Timers I'm using in the rest of the app seem to behave un...

Arrival-time handling with wrap around in C

I´m currently writing a software in Ansi-C and are struggling to get one of the basic functionality to work. The software will receive messages over a CAN-network and when these messages arrive, I need to make sure that they are delivered before a expected time and after the previous message. Only unsigned variables are allowed to be u...

Timed windows service crashing due to multiple threads running

Hi, I'm working on a simple web service which exports data from some data store into the database. The service runs every 20 seconds (testing interval). Intervals are implemented through System.Timers.Timer class. What is happening at the moment is: Service starts Timer starts 20 seconds pass and service starts the export Export do...

Best strategy to implement this behavior in Android app?

In my Android app, I have some data that needs to be synced daily but also needs to be updated every hour when a user is inside the app. I have already implemented a service that gets called from an alarm for the daily update. Im having a problem with developing a strategy to do the hourly sync. I could use an hourly alarm too and fire ...

Android - Timed UI events (with pause/resume)

I am looking to create timed events which trigger UI changes (like a Toast) on Android. I already know you can do this with a Handler object's postDelayed(runnable, timeDelay) method (see this page for a great example). Here is the twist: I also need to be able to pause and resume the countdown for these events. So when a user pauses th...

Easiest way to repeatedly call a custom function in Jquery while hovering?

I have a function called goRight() which does some stuff when I click a div called "goright". I want to make it so that when I hover over the div "goright" it will call the function repeatedly (with a small delay) for as long as I'm hovering, and then do nothing and stop once i move the mouse away. I have experimented with setInterval ...

Cocos2D iPhone Repeating Buttons

Hello. Using Cocos2D, is it possible to create a button which constantly triggers when being touched, instead of triggering just once? I'm happy to have a timer which does the repeat trigger, so I guess another question is can I use a touch removed with a Cocos2D menu button? Cheers. :-) ...

Counting down the days - iPhone Count Down Timer

Hi Everyone, I’m trying to make a counter which shows the number of days until we leave on a trip to Europe. It’s only about 70 days (as of today) so I don’t believe that I should have to worry about astronomically large numbers or anything, but I really am stumped - I’ve attached the code that some friends have given me, which don’t wo...

What is the point of using Storyboard as timer?

I've seen some examples of code where StoryBoard is used as Timer, such as: void Update() { if (_sb == null) { _sb = new Storyboard(); _sb.Completed += _sb_Completed; _sb.Duration = new Duration(TimeSpan.FromSeconds(1)); } if (_sb_completed) { _s...

Create an interval to change image in jQuery?

Hello I have a working script like this: jQuery(document).ready(function(){ $('.video-thumb img').bind('mouseover',function(){ var new = $(this).attr('src').replace(/default.jpg/,'1.jpg'); $(this).attr('src',new); }).bind('mouseout',function(){ var default = $(this).attr('src').replace(/[0-9].jpg/,'defa...

Timer not firing in an event handler containing two adjacent 'if' blocks!

when i'am calling timer1.Start() func in an event handler that contains two adjacent if blocks, its tick events doesn't fire and the code following it also doesnt get executed. on the othr hand, using an if-else pair instead solves the problem. why it can be so?? ...

WPF Timer problem... Cannot get correct millisecond tick.

Hi, I have a basic question regarding timers. My timer is acting very strange. I am trying to make the tick occur every millisecond to update my data. I can get it to work with seconds, it seems, but not milliseconds.. I am using WPF and am wondering why the following is not functioning correctly. It appears that the "second" countdow...

Is it possible to stop a function's execution within a specified time in Java?

Hi I want to know how to stop a specified function's execution within a specified time in java. For example: I may call a function called print_data(). If it takes more time to execute, I will have to stop that function's execution. Is it possible to stop the execution like this? Thanks in advance ...

Timer events are clogged and triggered all at once in AS3

Hey there I've experience this problem in many forms. public function startTimer() { timer = new Timer(3000); timer.addEventListener(TimerEvent.TIMER, timerTick, false, 0, true); timer.start(); } private function timerTick(e:TimerEvent) { var bubble = new Bubble(); this.addChild(bubble); } Bubble gets removed from the disp...

How to solve this Timer issue in java?

Hi Im developing the java Email application with Timer, I have a two arraylists named ActiveProcesses,InActiveProcesses. If I start the Timer it will send the Email with InActiveProcesses list values for every seconds. But the problem is the timer is sent the Email if the InActiveProcesses list values is same.For Example the InActive...

How to do event driven programming in C#.NET?

How do you make a event-driven program where the execution of the main flow is suspended whenever an event is raised and handled, until the event handler finishes? I created the following program using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Timers; namespace EventTest { class P...