That didn't take long.Quote:
(gravel driveway - about to get it paved...).
I like the brick-work edging too.
Printable View
That didn't take long.Quote:
(gravel driveway - about to get it paved...).
I like the brick-work edging too.
Instead of paving, you should use yellow paver stones.
Ever spent weeks on something that turns out to be a remarkably stupid oversight on your part?
I've been using the Reactive Extensions for .NET (Rx) a lot lately. It's a framework that works sort of like "What if instead of events, we had IEnumerables that added an item every time the event was raised?" I'm using it because I'm doing a lot of tasks that involve gathering data coming in at different rates, merging it, and processing it on a myriad of threads.
So I have this guy right here I wanted to test:
Items come in at a high rate, Buffer() collects all of them into a List for 10 seconds, then pushes that batch to my ProcessBatch method, and DefaultScheduler means ProcessBatch() is getting called on a worker thread. Whew.Code:_dataSource.Buffer(TimeSpan.FromSeconds(10))
.ObserveOn(DefaultScheduler.Instance)
.Subscribe(ProcessBatch)
I don't want my tests to take 10 seconds per test, so I was going to cheat. Things that work with time can take an IScheduler. There is a TestScheduler that lets you control the clock. So with a slight change, "10 seconds" passes when I say it does:
The way to test it looks something like:Code:dataSource.Buffer(TimeSpan.FromSeconds(10), scheduler)
...
I've revisited this test in my free time for a few weeks. Every time I tried it, the test failed with no data. I was stumped.Code:Dim scheduler = New TestScheduler()
_dataSource = scheduler.CreateHotObservable(
OnNext(10, <data>),
OnNext(20, <data>),
...)
' ...set up code so it uses that data source and the scheduler.
' Advance by 10 seconds
scheduler.AdvanceBy(10000)
' Test side effects of ProcessBatch()
It was only this week I got the bright idea to comment out the Buffer() call to see if I got data at all. And I replaced the "test" observable with Observable.Interval, which behaves like a timer. So I set it to have a 1s period and expected 10 data points.
I got 0 data points. What?
I hacked at it for 10 minutes until, out of anger, I changed AdvanceBy() to use "999999999" instead of 10000. I got some results. What?
Then it hit me. The name of the parameter that takes a time offset is 'ticks'. Ticks are NOT milliseconds. Whoops.
So....you were ticked off?
Or are you just clocking a tick talk?
He is stubbing his tick tack.
Looks like I dropped in too late for this thread's 17th birthday. Oh well, maybe next year.
What's a handful of days! It's never too late in Post Race anyway!
I hate PHP.
Yeah its not like we are in a race or anything.... What wait, we are? no one told me !!!Quote:
What's a handful of days! It's never too late in Post Race anyway!
We forgot....long ago.
Sup guys! Finally finished pulling weeds in my backyard few weeks ago and already are growing back :(
Ugh, just had a windscreen repair. It was supposed to take 1 hour, turned into 3. And the light sensor's now not working. Total waste of an afternoon.
It's California. There's lots of weed to pull out there.
We need a drum kit rim shot for moments like this!
https://www.youtube.com/watch?v=ql1m8p8aGQ0
I had an appointment 2 hours away, only for the person to back out while I was pulling up in their driveway.