tabs ↹ over ␣ ␣ ␣ spaces

by Jiří {x2} Činčura

Installing DDEX provider for Firebird into Visual Studio 2017

Published 25 Mar 2017 in .NET, Databases in general, Firebird, and Visual Studio

Visual Studio hit the shelves few weeks ago and it would be nice to install DDEX provider into it, isn’t it? Sadly, with the revamped setup experience some changes in configuration inside also came. Thus it’s going to be manual process for now. I know there’s an installer program for DDEX, but it’s going to take some time before it’s updated - I’m doing this in my free time and it’s all about priorities (unless somebody with $$$ prioritizes its own request). Let’s get into it.

Closing Visual Studio solution and deleting the code (extension)

Published 20 Mar 2017 in Visual Studio

During my day and over a week I fire Visual Studio countless times. Well over half of these is because I need to test something, prototype some idea, try some API or library and so on. This is really throw away code that survives only one opening (OK, maybe few times I go back to this code later in the day/week). It’s basically this flow: Open Visual Studio, create new application, write some code, close Visual Studio, delete the folder. Especially the last two steps seemed very tedious last, well, years. Thus I decided to do something with it.

Decimal tearing example on .NET/.NET Core

Published 19 Mar 2017 in .NET, .NET Core, and C#

I realized I have some pieces of code to show some specific behavior, mostly around threading and synchronization, all over my notes. Some of these pieces may be 10+ years old. I use these pieces during my “threading/parallel/async” course, but why not to share it publicly. Maybe I’ll stumble on it after some years, maybe .NET will be history, and it will be interesting to re-read and re-think the code. The code isn’t unique or something where I’m the first to realize it. It’s really just an example code.

Here’s the most recent one. I wanted to show torn reads happening. So I took a decimal value, because it is 128-bit value it will not be atomic in any way, and started looping using plain reads and writes.

MS Fest (Brno)

Published 14 Mar 2017 in Presentations & Speaking

Z Brna se stává konferenční hub. Je to jasný. Tedy alespoň v mé sociální bublině. To máme WUG Days, G2B•TechEd, teď MS Fest v rychlém časovém sledu. A to je teprve březen. Až uvidíte co se ještě chystá…

Letošní MS Fest v Brně proběhne 18.-19.3. s podobným programem jako v Praze. Hned první dva sloty v sobotu dopoledne se můžeme potkat. Připraveno jest:

  • Tasky a async od základů
  • Entity Framework Core - vo co de

Pokud vás něco z těchto dvou témat nebo věcí příbuzných zajímá, rád vás uvidím. Na dotazy bude také čas.

How to download bunch of URLs efficiently (asynchronously)?

Published 13 Mar 2017 in .NET, C#, and Multithreading/Parallelism/Asynchronous/Concurrency

I’m getting such question fairly often when teaching my “parallel/async/threading” course. It’s always about a collection of URLs and downloading these efficiently. Everybody needs that.

Of course efficiently means different thing in different scenarios. In the following text I’m considering efficient as “in parallel” and “with intelligent use of resources used for the IO” (except memory used for storing the results as I’m going to return the result as a whole). Also I’m focusing on straightforward, readable code (not every byte or millisecond saved). Your needs may vary.

Phone (life)hack for better sleep

Published 9 Mar 2017 in Lifehack

I’m charging my phone overnight on the floor next to my bed. Nothing special. Sometimes while slowly fading into sleep some email or something comes in, the screen lights up and in the dark room it’s fairly noticeable. And I, being curious, check what’s that and often also reply or do something. And I don’t like it.

WUG: Nejčastější chyby při použití O/R mapperu (Brno)

Published 28 Feb 2017 in Entity Framework and Presentations & Speaking

O/R mappery jsou výborný sluha, ale špatný pán. Abych tak trochu parafrázoval známé přísloví. David Gešvindr dobře zachytil, že v rámci různých Entity Framework přednášek apod. trousím, často i jako odpovědi na otázky z davu, různá doporcučení co nedělat (nebo co naopak dělat). Drobečky jsou fajn, ale dát to trochu do kupy a celkově sjednotit není od věci. A o tom je tato přednáška.

Handling a dollar sign in a username for deploying Azure Web App via FTP on GitLab CI

Published 26 Feb 2017 in Azure and GitLab

As usual the easiest things take a lot of time - or luck - to debug. Last few days I was trying to deploy this blog to a Azure Web App from GitLab’s CI via good old FTP. The problem is the FTP username on Web App is always in the form of web_app_name\$web_app_name. So the backslash and dollar cannot be avoided i.e. by regenerating publishing credentials. And I don’t have to explain to you these characters are often, in various environments, handled specifically.

My Injinji socks hack

Published 21 Feb 2017 in Running

I like Injinji socks. I race in these as well as use them for every training run or outing I do. I like the fit and no chafing or blisters, so why try something else? But there’s a problem with these. And I finally found a solution.

ShowIT 2017 a G2B•TechEd 2017

Published 18 Jan 2017 in Presentations & Speaking

Hned ze začátku roku se konají dvě zajímavé konference. ShowIT 2017 v Bratislavě a G2B TechEd v Brně. Aby se ani jedno město necítilo ochuzené, budu mít na stejné přednášky na obou. Konkrétně Entity Framework Core 1.0 a 1.1.

Ačkoli první verze “nového” Entity Frameworku již byla uvolněna s .NET Core 1.0, rozhodně nebyla kompletní. Verze 1.1 se snaží největší nedodělky zacelit a posunout se dál. A samozřejmě stále tu máme srovnání s Entity Frameworkem 6, který není “odepsaný”. Zajímá-li vás tedy co nového je ve verzi 1.1 a jak případně naložit s přechodem z Entity Frameworku 6, přijměte mé pozvání.

ConcurrentDictionary<T, T> is slow. Or is it?

Published 23 Dec 2016 in .NET, .NET Core, and Multithreading/Parallelism/Asynchronous/Concurrency

On this year’s MS Fest Jarda Jirava had a presentation about Akka.Net. I was interested in this topic, because the actor model is one way (out if many - sadly no silver bullet yet) to tackle concurrency and parallelism problems.

While showing some actor demos there was a nice comparison with home made solutions. So you don’t have to go to full framework to try thinking in actors. The demo was just storing some key and value into a hashtable. The hand made was first using just plain old Dictionary<int, int> with lock/Monitor and then using ConcurrentDictionary<int, int>. To mine (and Jarda’s surprise too) the ConcurrentDictionary<int, int> was slower. So I started digging into it and looking for a reason. Because I was confident the ConcurrentDictionary<int, int> should be faster compared to only single Monitor.

.NET types that can be read and written atomically without the risk of tearing

Published 12 Dec 2016 in .NET, .NET Core, and Multithreading/Parallelism/Asynchronous/Concurrency

I’m currently digging deep into memory models, processor architectures, kernels and so on. It’s a fun stuff. I’m learning so much and my brain is working so hard. With that I’m also digging into some “concurrent” internals in .NET, in last few days the ConcurrentDictionary<TKey, TValue> class. As I was there I found something helpful.

ADO.NET provider for Firebird is ready

Published 12 Dec 2016 in .NET, C#, Databases in general, Entity Framework, Entity SQL, Firebird, LINQ, SQL, and Visual Studio

New version of ADO.NET provider for Firebird is ready for download. The previous one added .NET Core support and although on the outside not much changed, there was quite a storm inside. As you can guess some bugs slipped into the version. The is thus full of bugfixes inside, without any visible changes outside.

Breakpoint that breaks only on selected thread or task

Published 9 Dec 2016 in .NET, .NET Core, Multithreading/Parallelism/Asynchronous/Concurrency, and Visual Studio

Few weeks ago on my “parallel-async-threading” deep dive course somebody asked a question whether it’s possible to make breakpoint work only on a specific thread. That’s a pretty valid request, especially if we talk about running the same algorithm on a huge amount of data. Let’s have a look at it.