Click here to Skip to main content
15,901,205 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Thought of the day Pin
PhilLenoir16-Mar-15 9:05
professionalPhilLenoir16-Mar-15 9:05 
GeneralMessage Closed Pin
16-Mar-15 15:21
reallyjust4fun16-Mar-15 15:21 
GeneralRe: Thought of the day Pin
OriginalGriff16-Mar-15 21:09
mveOriginalGriff16-Mar-15 21:09 
GeneralRe: Thought of the day Pin
Johnny J.16-Mar-15 21:16
professionalJohnny J.16-Mar-15 21:16 
GeneralRe: Thought of the day Pin
OriginalGriff16-Mar-15 21:34
mveOriginalGriff16-Mar-15 21:34 
GeneralRe: Thought of the day Pin
grralph117-Mar-15 0:55
grralph117-Mar-15 0:55 
GeneralRe: Thought of the day Pin
ZurdoDev17-Mar-15 2:30
professionalZurdoDev17-Mar-15 2:30 
GeneralOver-engineering Pin
#realJSOP16-Mar-15 5:33
professional#realJSOP16-Mar-15 5:33 
Well, I've been running tests on my sql agent stuff, and have realized that my FileSystemWatcherEx code is somewhat flawed. Sometimes I get double events, and sometimes I don't when a file changes. After sitting there cussing for a while, I think I've managed to come up with something that might work all the time.

I created a class that creates filesystemwatcher for each of the change NotifyFilters, and an event queue (for each watcher) that manages the events as they happen. This event queue will only allow an event to be added one time for a given file. So, if you get two LastWrite change events, only the first one is added to the queue. The object that instantiates the watchers and queues sets up parallel tasks (one for each file watcher) to monitor that watcher's queue, and pumps events to subscribers (the WatcherEx class) which then bubbles the event to its subscriber(s).

The reason I call it "over-engineered" is that so far, it's taken almost 1000 lines of code to implement.

Testing begins.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013


GeneralRe: Over-engineering Pin
Kevin Marois16-Mar-15 5:42
professionalKevin Marois16-Mar-15 5:42 
GeneralRe: Over-engineering Pin
#realJSOP16-Mar-15 5:46
professional#realJSOP16-Mar-15 5:46 
GeneralRe: Over-engineering Pin
R. Giskard Reventlov16-Mar-15 5:53
R. Giskard Reventlov16-Mar-15 5:53 
GeneralRe: Over-engineering Pin
OriginalGriff16-Mar-15 5:55
mveOriginalGriff16-Mar-15 5:55 
GeneralRe: Over-engineering Pin
Mark_Wallace16-Mar-15 10:13
Mark_Wallace16-Mar-15 10:13 
GeneralRe: Over-engineering Pin
R. Giskard Reventlov16-Mar-15 10:21
R. Giskard Reventlov16-Mar-15 10:21 
GeneralRe: Over-engineering Pin
manchanx16-Mar-15 6:01
professionalmanchanx16-Mar-15 6:01 
QuestionRe: Over-engineering Pin
Slacker00716-Mar-15 6:00
professionalSlacker00716-Mar-15 6:00 
AnswerRe: Over-engineering Pin
Tim Carmichael16-Mar-15 9:05
Tim Carmichael16-Mar-15 9:05 
GeneralRe: Over-engineering Pin
Slacker00716-Mar-15 9:08
professionalSlacker00716-Mar-15 9:08 
GeneralRe: Over-engineering Pin
Brady Kelly16-Mar-15 9:26
Brady Kelly16-Mar-15 9:26 
GeneralRe: Over-engineering Pin
TheGreatAndPowerfulOz16-Mar-15 9:43
TheGreatAndPowerfulOz16-Mar-15 9:43 
GeneralRe: Over-engineering Pin
Brady Kelly16-Mar-15 10:06
Brady Kelly16-Mar-15 10:06 
GeneralRe: Over-engineering Pin
TheGreatAndPowerfulOz16-Mar-15 10:21
TheGreatAndPowerfulOz16-Mar-15 10:21 
GeneralRe: Over-engineering Pin
Brady Kelly16-Mar-15 10:36
Brady Kelly16-Mar-15 10:36 
GeneralRe: Over-engineering Pin
Daniel Pfeffer17-Mar-15 0:31
professionalDaniel Pfeffer17-Mar-15 0:31 
GeneralAm I right or am I right? Pin
xiecsuk16-Mar-15 4:40
xiecsuk16-Mar-15 4:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   502 votes