Rx Challenge #2 (Solution)

2015/02/09

the solution of the challenge is, using the Switch operator (line 46): 1: 2: public void AvoidOverlappingStreams_Test() 3: { 4: /****************************************************** 5: * 6: * you start with Stream that create sub stream of string, 7: * each sub stream is built of single char representation. 8: * 9: ...
no comments

Async Transaction Scope on .NET 4.5.1

2015/02/05

even though C# async syntax let can dispose type on different thread with the using statementprivate static async Task RunAsync() { using (var conn = new SqlConnection(/* ... */)) { await conn.OpenAsync(); // ... } } unfortunately Transaction Scope (on .NET 4.5) didn't support completion on different thread. this issue fixed up on .NET 4.51 but instead of fixing it for the default scenario, you have to define it explicitly.using (var scope = new TransactionScope( ...
no comments

Rx Challenge #2

in the next RX Challenge you need to ovoid overlaps of charin the output stream. you start with Stream that create sub stream of string,each sub stream is built of single char representation. --#----------------@----------------*------------------    |                                                       #--##--###--####--#####--######--#######                             |                                                     @--@@--@@@--@@@@--                                                    |                                                    *---**---***--- you should find a way to get output stream wherelisten to the latest sub stream. the output stream should be look like: --#--##--###--@--@@--@@@-*---**---***--- in other words you have to avoid overlapping char. public void AvoidOverlappingStreams_Test() { /****************************************************** * * you start with...
no comments

Rx Challenge – Solution

2015/01/31

last week I was publishing the first RX Challenge. today I post solution for the first challenge.   the last week challenge was to set RX's Buffer that triggered by count, time or manual flushing. the following code present the solution public void Buffer_ShouldBulkOn_CountTimeoutOrFlush_Test() { // produce a buffer that should produce its bulk // as result of one of the following trigger // timeout, count threshold or manual flush request // arrange ISubject<int> source = new Subject<int>(); TimeSpan timeout...
no comments

Rx Challenge

2015/01/27

if you consider yourself RX pro, this challenge is for you. I decided to initiate weekly RX challenge and I let you  one week to solve it before I will publish solution. I will post it in a form of MS Test  method. and I will also post it on http://stackoverflow.com/questions/28176932/rx-challenge-1-by-bnaya-eshet on this challenge you have to make the following test pass by making buffer that triggered on timeout, count or flush request public void Buffer_ShouldBulkOn_CountTimeoutOrFlush_Test() { // produce a buffer that should produce its bulk // as result of one of...
no comments

Union with C#

2014/11/13

this post is about cool, fun yet not so practical capability of C#.actually C# support this capability from its' early days, yet I become aware of It quite recently by my colleague Ofir Makmal. Union is kind of cool thing where you can look at the same address space from different angle. for example: 64 bit can be a long, 2 integer or 8 bytes. the trick is to set the offset of the field within the memory structure.this is done by using and like shown in the following snippet: class StrangeStruct { ...
no comments

Surface Pro 3 tip

2014/10/04

if you own Surface Pro 3 tablet you might notice that the F keys functionality is quit annoying. by default you have to press the Fn key along with the F key. this can be very annoying when trying to work with software like Visual Studio. to overcome this issue all you have to do is to learn single shortcut. Fn + CapLock: this shortcut toggle the Fn functionality between the F keys and the defaults keys (Home, End, etc.)
no comments

Israel at War

2014/07/24

I don't use to write non-technical post, but this isn't regular time at Israel,Israel is under missile attack for more than 2 weeks. we are facing cynical terrorist organization which is hiding behind it's ownlocal population. we do recognize that Palestinian people are suffering,but so are the people of Israel. the south of Israel is under missile attach for more than 14 years, they're having only 15 secondsto find shelter when missile alarms turn on.the terrorist is aiming our civilian population while hiding behind their own civilian population.they fire rockets from schools,  hospitals, mosques and even UN buildings. what...
no comments