RE: How To do something every so often

2010-05-20 Thread Tiang Cheng
Have you patented this comparison technique? :P From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Greg Harris Sent: Thursday, 20 May 2010 1:22 PM To: ozDotNet Subject: Re: How To do something every so often Hi Everyone, I think that this shows that we all

Re: How To do something every so often

2010-05-20 Thread Les Hughes
silky wrote: I still think Bill's answer was superior, as it also accounts for multiple threads/etc (although, not required in this case). Second to that would be a (if blah rah; print thing; blah = 0) ...as your tests indicated. You are crazy. Reality can seem that way to some.

Re: How To do something every so often

2010-05-20 Thread Stephen Price
In summary; if (silky.IsRight DateTime.Now.DayOfWeek != DayOfWeek.Friday) { var Bill = 1 / 0; } else { programmersWithTooMuchTime++; ozDotNetList++; GregHarrisExceptionalTestMethod(); } I'm sure this could be refactored into the number 42. Also probably needs to be in some kind of

RE: How To do something every so often

2010-05-20 Thread Tiang Cheng
Thursdays. The new Fridays. From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Stephen Price Sent: Thursday, 20 May 2010 2:57 PM To: ozDotNet Subject: Re: How To do something every so often In summary; if (silky.IsRight DateTime.Now.DayOfWeek

Re: How To do something every so often

2010-05-20 Thread silky
On Thu, May 20, 2010 at 4:57 PM, Stephen Price step...@littlevoices.com wrote: In summary; if (silky.IsRight DateTime.Now.DayOfWeek != DayOfWeek.Friday) { You have a strange naming-convention for constants :P    var Bill = 1 / 0; } else {  programmersWithTooMuchTime++;  ozDotNetList++;  

Re: How To do something every so often

2010-05-20 Thread mike smith
On 20 May 2010 15:54, silky michaelsli...@gmail.com wrote: On Thu, May 20, 2010 at 3:54 PM, David Burela david.bur...@gmail.com wrote: But would one of them be easier to implement with the .Net 4.0 parallel extensions? I see what's happened here. I've somehow subscribed to the ironic humour

RE: How To do something every so often

2010-05-20 Thread Greg Keogh
You are crazy. Please stop feeding the tactless socially retarded troll. Greg

Re: How To do something every so often

2010-05-19 Thread Greg Harris
Hi Everyone, I think that this shows that we all have too much time on our hands! Our modern machines are so fast that this is an irrelevant question for all but the most compute intensive applications. The standard well known design pattern is to use the modulus (%) function. if ( (i %

Re: How To do something every so often

2010-05-19 Thread silky
On Thu, May 20, 2010 at 3:47 PM, Les Hughes l...@datarev.com.au wrote: Greg Harris wrote: Hi Everyone, I think that this shows that we all have too much time on our hands! You especially... but we appreciate it :) As about 80% of development cost is in maintenance, then keep it

RE: How To do something every so often

2010-05-19 Thread David Burela
To: ozDotNet Subject: Re: How To do something every so often Greg Harris wrote: Hi Everyone, I think that this shows that we all have too much time on our hands! You especially... but we appreciate it :) As about 80% of development cost is in maintenance, then keep it simple

Re: How To do something every so often

2010-05-18 Thread mike smith
. -Original Message- From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of DotNet Dude Sent: Tuesday, 18 May 2010 2:12 PM To: ozDotNet Subject: Re: How To do something every so often Dylan never said it was multithreaded... that would have been a critical

RE: How To do something every so often

2010-05-17 Thread Bill McCarthy
Inline |-Original Message- |From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet- |boun...@ozdotnet.com] On Behalf Of silky |Sent: Monday, 17 May 2010 5:44 PM |To: ozDotNet |Subject: Re: How To do something every so often | |On Mon, May 17, 2010 at 3:17 PM, Bill McCarthy b

Re: How To do something every so often

2010-05-17 Thread silky
On Mon, May 17, 2010 at 6:10 PM, Bill McCarthy b...@totalenviro.com wrote: Inline [...] | By resetting you also don't need to worry about integer overflows etc. | |This is of arguable value *IN FACT* no it is not of arguable value; you may choose to argue it (no surprises there),

Re: How To do something every so often

2010-05-17 Thread DotNet Dude
Wouldn't this be enough? counter+=1; ... if (counter == 1) { ... counter = 0; } On Mon, May 17, 2010 at 1:30 PM, Dylan Tusler dylan.tus...@sunshinecoast.qld.gov.au wrote: I was just writing a very simple little console app to move data from one file to another (under certain

RE: How To do something every so often

2010-05-17 Thread Dylan Tusler
That's what I love about this group... -Original Message- From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of DotNet Dude Sent: Tuesday, 18 May 2010 1:21 PM To: ozDotNet Subject: Re: How To do something every so often Wouldn't this be enough

RE: How To do something every so often

2010-05-17 Thread Bill McCarthy
[mailto:ozdotnet- |boun...@ozdotnet.com] On Behalf Of DotNet Dude |Sent: Tuesday, 18 May 2010 1:21 PM |To: ozDotNet |Subject: Re: How To do something every so often | |Wouldn't this be enough? | |counter+=1; |... |if (counter == 1) { | ... | counter = 0; |} | | |On Mon, May 17, 2010 at 1:30 PM, Dylan Tusler

Re: How To do something every so often

2010-05-17 Thread DotNet Dude
...@ozdotnet.com] On Behalf Of DotNet Dude |Sent: Tuesday, 18 May 2010 1:21 PM |To: ozDotNet |Subject: Re: How To do something every so often | |Wouldn't this be enough? | |counter+=1; |... |if (counter == 1) { |  ... |  counter = 0; |} | | |On Mon, May 17, 2010 at 1:30 PM, Dylan Tusler

Re: How To do something every so often

2010-05-17 Thread silky
On Tue, May 18, 2010 at 2:04 PM, Bill McCarthy b...@totalenviro.com wrote: Possibly, but if you make the code multithreaded you'd have to use an interlocked increment. Use of a = or a higher order bit bit-mask means you don't have to lock as such (if you aren't worried about the exact count)

RE: How To do something every so often

2010-05-17 Thread Dylan Tusler
Is = slower than by itself? Dylan. -Original Message- From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of DotNet Dude Sent: Tuesday, 18 May 2010 2:12 PM To: ozDotNet Subject: Re: How To do something every so often Dylan never said

RE: How To do something every so often

2010-05-17 Thread Bill McCarthy
, 18 May 2010 2:12 PM |To: ozDotNet |Subject: Re: How To do something every so often | |Dylan never said it was multithreaded... that would have been a |critical piece of info and I'm sure he wouldn't leave it out. He said |very simple little console app which rules out multithreading. :p

RE: How To do something every so often

2010-05-17 Thread Bill McCarthy
| |This is a very strange comment. | |-- |silky | Uh huh

RE: How To do something every so often

2010-05-17 Thread Bill McCarthy
Hi Meski, |-Original Message- |From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet- |boun...@ozdotnet.com] On Behalf Of mike smith |Sent: Tuesday, 18 May 2010 12:51 PM |To: ozDotNet |Subject: Re: How To do something every so often | |On 17 May 2010 18:10, Bill McCarthy b

RE: How To do something every so often

2010-05-16 Thread Bill McCarthy
. |-Original Message- |From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet- |boun...@ozdotnet.com] On Behalf Of Dylan Tusler |Sent: Monday, 17 May 2010 3:05 PM |To: 'ozDotNet' |Subject: RE: How To do something every so often | |Doh! | |Yes, in a previous life I would have used (excuse my VB

Re: How To do something every so often

2010-05-16 Thread Les Hughes
Bill McCarthy wrote: I'd guess that in a tight loop it would probably be slightly faster to reset the counter rather than continually get the modulus, eg: counter+=1 If (counter And H2000) = H2000 Then ' every 8192 counter = 0 End If By resetting you also don't need to worry about