Being Cellfish

Stuff I wished I've found in some blog (and sometimes did)

Browse by Tags

Tagged Content List
  • Blog Post: Not really a robot, but...

    Remember the Great Ball Contraption from earlier this year ? There has been an update and it is awesome! My favourite part is the ball throwing one...
  • Blog Post: The smart trash can

    When I think of robots I think about autonomous robots. Robots that move around on their own and that do not need interaction with other devices to function. This is a very hard problem to solve but impressive when done well. More commonly robots are remote controlled and may even have sensors around...
  • Blog Post: Lego Robots revisited

    About a year ago (when I was still on the robotics team) I got a good work assignment; build and program a lego robot for a sumo competition event (picture on the right). That was fun, but I forgot about the fun for a while. until a few weeks ago when a new collegue on my current team asked for advice...
  • Blog Post: TPL Dataflow and async/await vs CCR - part 6

    Same co-worker as the other day pointed out an important difference between how CCR and TPL data flow deals with exclusive schedulers as described in the end of part 4 . To illustrate, assume you have the following test code: 1: [TestMethod] 2: public void TestExclusiveExecution() 3: { 4...
  • Blog Post: TPL Dataflow and async/await vs CCR - part 5

    I got a tip from a co-worker that your choice of waiting for a scatter gather operation as described in part 3 may have a huge performance impact. I made three version of the FibonacciAsync, one that awaits on the return statement, one that uses the Task.WaitAll method and one that just awaits each call...
  • Blog Post: TPL Dataflow and async/await vs CCR - summary

    As you have seen there is really much less to cover when doing "CCR tips & tricks for TPL data-flow" probably mostly because the latter is about seven years younger and designed with a latest and greatest in mind. While you tend to need to do a lot of work yourself with CCR for certain scenarios...
  • Blog Post: TPL Dataflow and async/await vs CCR - part 4

    Today I wanted to show a number of simple examples of how to do things with TPL data-flow compared to CCR. Creating a CCR port and posting and then receiving on it asynchronously is one fundamental scenario in CCR. This is what it looks like with TPL data-flow: 1: var port = new BufferBlock<...
  • Blog Post: TPL Dataflow and async/await vs CCR - part 3

    While you could use TPL data-flow for scatter/gather patterns in much the same way as CCR async/await is actually enough for you once again. The only thing you need to do is to create a number of tasks and then wait for them all either by using the Task.WaitAll method (or Task.WaitAny if you're only...
  • Blog Post: TPL Dataflow and async/await vs CCR - part 2

    Dealing with asynchronous APIs will also be much easier than with CCR . First of all you can expect most (if not all) classes in the .Net framework to have another method added to them that is declared async. For example the Stream object used to have a synchronous Read method and then BeginRead and...
  • Blog Post: TPL Dataflow and async/await vs CCR - part 1

    As when working with CCR , working with async/await you need to have good tools for writing tests and execute the asynchronous code synchronously. I wish it was this easy: 1: [TestMethod] 2: public async void WithAsync() 3: { 4: Assert.AreEqual(42, await DoSomething()); 5: } Unfortunately...
  • Blog Post: TPL Dataflow and async/await vs CCR - Introduction

    In the .Net framework 4.5 developer preview there are two new great additions; TPL data-flow classes and async/await keywords . If you're familiar with CCR you'll notice that TPL data-flow looks and feels a lot like CCR. The new async/await keywords also make asynchronous programming very easy. So I...
  • Blog Post: CCR tips and tricks - part 25

    In the very first CCR tips and tricks I gave you a utility to essentially make CCR code synchronous to make unit testing simpler. Well, with the release of RDS4 beta there is a nice addition in the IO.Adapters assembly. The synchronous arbiter essentially does the job of the PortUtility you've previously...
  • Blog Post: RDS 4 Beta now available

    This weekend we announced the availability of Robotics Developer Studio 4 Beta . I would say that the most interesting parts are the new reference platform and the competition . UPDATE: There is now a video of the reference platform available:
  • Blog Post: Robot news

    One of my collegues got tired of searching for news related to robotics so he put together a little tool that you can help improve by submitting more links and do some voting.
  • Blog Post: CCR tips and tricks - summary

    So it turned out to be an advent calendar in the middle of the summer... Here is an overview: Prologue 1 , 2 , 24 , 25 - writing unit tests for CCR 3 , 4 , 21 - causalities 5 - SuccessFailure ports 6 - CCR APIs 7 - 4 ways to receive 8 - scatter gather 9 , 10 - yielding on the right thing 11 - result...
  • Blog Post: CCR tips and tricks - part 24

    Today I'll show you an example of how can use the pattern used in part 23 to make the utilities from part 1 look a little different and also work for any number of branches in a choice. But there is an important consequence of this. 1: public static void CompleteSynchronously( this Choice choice...
  • Blog Post: CCR tips and tricks - part 23

    Sometimes you work with an API that returns a Choice. If you want to add a timeout to any choice we need to extend the set of extension methods I introduced in part 22 with this: 1: public static class ChoiceWithTimeoutExtenstions 2: { 3: private static DispatcherQueue taskQueue = new DispatcherQueue...
  • Blog Post: CCR tips and tricks - part 22

    As mentioned in part 11 there is a good idea to use timeouts when waiting for a result on a result port. But if you're going to do it in a lot of places you want to have a helper to deal with this. Here is a class that adds extension methods that are similar to the regular Choice extension method but...
  • Blog Post: CCR tips and tricks - part 21

    When working with resource ports as in part 19 and 20 there is another thing you may need to do if you rely on causalities. Before reposting the resource (or enqueue a new timer) you should do this: 1: Dispatcher.ClearCausalities(); That call removes all causalities from the current thread...
  • Blog Post: CCR tips and tricks - part 20

    In robotics you sometimes work with a sensor that sends data very often but you really just want to handle one message every X seconds. You also just want to handle the last message received since you last handled a message. This can be achieved in a similar way to the resource port in part 19 together...
  • Blog Post: CCR tips and tricks - part 19

    When you want to throttle execution based on some resource you can do this easily with CCR and also get the benefit of being able to add and remove resources as needed. For example you may want to throttle some computation to two instances at any given time, but under heavy load you want to double the...
  • Blog Post: CCR tips and tricks - part 18

    The CCR interleave is a very powerful construct to create read/write type of locking but on steroids. It allows you to create a concurrent group and an exclusive group of handlers. Concurrent handlers will execute concurrently as long as no exclusive handler is pending. Exclusive handlers will execute...
  • Blog Post: CCR tips and tricks - part 17

    Sometimes when you have a number of things that have to be executed in sequence a common pattern is to have some kind of status variable to track errors and abort the sequence when there is an error. There is however another pattern that works well not only with sequential work but also works for scatter...
  • Blog Post: CCR tips and tricks - part 16

    The pattern used in part 15 can be implemented as a helper method that looks like this: 1: public static void ExecuteUsingClrThreadPool(Action handler) 2: { 3: if (handler == null ) 4: { 5: throw new ArgumentNullException( "handler" ); 6: } 7: 8: if (Thread.CurrentThread.IsThreadPoolThread...
  • Blog Post: CCR tips and tricks - part 15

    In part 14 I showed you how to work with an asynchronous API from CCR. Today we'll handle synchronous code form CCR. Since one of the most common ways to work with CCR is to use a dispatcher with one thread per core you do not want to block one thread by waiting on some synchronous, long running operation...
Page 1 of 2 (47 items) 12