Taking something that can't be done, and then doing it.

by Jiří {x2} Činčura

UDP packets not sent from ESP-8266 - solved

Published 20 Apr 2016 in .NET, Arduino, C#, ESP-8266, IoT, and Network

I’m now playing with ESP-8266, Wemos D1 mini to be precise. One think I’m now using for fun/debugging/communication is broadcasting UDP packets. For some reason the packets were not coming lately.

You might say: “Jiri, it’s UDP. Packets will get lost.”. True. But my packets were lost in 99% cases, on my home network. Something is going on.

Directed broadcast address

Published 13 Apr 2016 in .NET, Arduino, C#, ESP-8266, IoT, and Network

Although I can make it out of the TCP/IP woods almost always, sometimes I find edge cases that are interesting. More often than not these are result of security hacks in last 20 or so years and my knowledge is based on “regular/happy” case.

Checking for "TODO" comment with Roslyn

Published 19 Feb 2016 in C# and Roslyn

This week I was speaking at a local user group and got a fairly interesting question for Roslyn analyzers - search for // TODO: something comments and do something with it. I think it’s a great idea, because the comment is not a code exactly, but still Roslyn processes it. And to make it bit more interesting I decided not to sketch some analyzer for Visual Studio, but create just a raw console application that reports these comments, so anybody can tweak it for own needs (or eventually create a full blown analyzer from it, it’s just a few lines of code).

WUG: Asynchronní a paralelní programování v .NETu (Ostrava)

Published 18 Feb 2016 in Multithreading/Parallelism/Asynchronous/Concurrency and Presentations & Speaking

Paralelizmus, souběžnost, zamykání atp. Baví mě to. A rád o tom povídám. Rád o těchto problémech přemýšlím. Tentokrát se budu snažit natlačit něco z mé hlavy do hlavy všem zájemcům v Ostravě.

Asynchronní proramování nabralo za posledních pár let na obrátkách a dostalo se do povědomí mnoha vývojářů. Ačkoli ve své podstatě se nejedná o nic nového, alespoň v systému Windows. Nicméně příchod C# 5 a, jistě nyní známých, klíčových slov async a await umožnil použití asynchronní programování bez dřiny.

Pokud vás zajímají detaily od křemíku až po kód, přijďte 25.2.2016 od 17:00 na WUG do Ostravy.

Timer working with absolute - wall clock - time

Published 17 Feb 2016 in .NET, C#, and Windows

From time to time I need to create some kind of scheduler for recurring stuff in application. As long as it’s based on interval I can use the Timer. But when you need to trigger the action on specific time - wall clock time - it’s not smooths sailing. There’s a bunch of ways to tackle the problem and each presents different obstacles (like time changes due to NTP synchronization). But this is already solved in Windows kernel. Windows allow you to use timers with either absolute time or intervals.

My Bash like prompt in PowerShell

Published 24 Jan 2016 in Bash and PowerShell

It all started with this tweet:

Pimped up my #PowerShell prompt a little. More bash-like style. #geek

And was asked what I did. It’s actually nothing special, just few things I really like while working via ssh in Bash, which is my default shell wherever possible.

So what I actually did? I just really played little bit with formatting. But the whole prompt for me is like this.

C# 6 refactoring

Published 8 Jan 2016 in C# and Programming in general

Speaking last year on MS Fest in Prague about C# 6 I got feedback I showed all the features in funny way and mostly in edge cases which were far from real world usage. And kind of questioning the usefulness of the features.

And I probably did. I tried to show the feature and also abuse it a little. So to show the features are actually useful in real world, here’s a refactoring I did yesterday evening on a few lines of code. The code was fine. But with C# 6 it’s even more fine (I think).

Open Safari tabs in background (iOS)

Published 7 Jan 2016 in Apple iPhone/iPad/iPod

When I’m browsing on my phone I either click on a link and open it in current tab or I want to open to it in background tab. There’s maybe .1% occurrence when I don’t want background tab. And ever since I remember tabs on iOS in Safari it was foreground tab. And I thought it’s given.