tabs ↹ over ␣ ␣ ␣ spaces

by Jiří {x2} Činčura

WUG: C# 7, 7.1, 7.2, 7.3 a 8.0 (Zlín)

18 Oct 2018 C#, Presentations & Speaking

Máte rádi C#? A ztrácíte se v aktuální rychlé kadenci verzí? Mám pro vás řešení – WUG 25.10.2018 od 17:30 ve Zlíně. Všechno dáme do kupy a srovnáme si to v hlavě.

C# v poslední době velmi rychle přidává nové funkce. Malé funkce v minor verzích, ale připravuji se i velké změny do major verze (verzí). Co je tedy dostupné v C# 7, 7.1, 7.2, 7.3 a jak to začít používat. A co nás čeká dál a hlavně ve verzi 8.0?

WUG: Asynchrónne a paralelné programovanie v .NET-e (Košice)

3 Oct 2018 Presentations & Speaking

Tak to vypadá, že se podívám do Košic. Na WUGu si povíme něco o asynchronních a parallelních věcech a jak to celé do sebe zapadá a co je “pod tím”.

Naposledy jsem tam byl na maratonu v roce 2012 a poměrně dobře si pamatuju segment 30. – 35. km. “Lehce” 😃 jsem potkal “zeď”. Naštestí jsem to do cíle “dotlačil”. Tak snad WUG zvládnu lépe. 😃 Určitě přijďte.

DotNET Talks, vol.1

30 Sep 2018 Entity Framework Core, Presentations & Speaking

Už příští týden se uskuteční nová akce s názvem DotNET Talks. Moje přednáška “Unit Testing s Entity Framework Core” se podívá na to jak “unit” testovat kód, který využívá Entity Framework Core. Díky “čerstvosti” Entity Frameworku Core jsou možnosti o poznání lepší než tomu bylo u Entity Frameworku 6. Jak to vypadá, tak ještě pár míst můžete urvat, tak neváhejte…

Step into a specific call when debugging in Visual Studio

24 Sep 2018 Keyboard, Visual Studio

Last week, as we were wrapping the first day of .NET Developer Days conference, I was sitting in the “Ask The Expert” area quietly by myself, reading the poems, waiting for questions with Kendra Havens chatting about Visual Studio shortcuts and enjoying the pre-party beer. As it turned out, there’s one super handy shortcut for debugging that most people – Kendra included 😉 – are not aware of (and which I wasn’t able to cover in my 60 minutes of allotted time). Thus, I must spread the word.

Exploring .NET’s – Java inspired – “synchronized” methods

13 Aug 2018 .NET, .NET Core, Java, JIT, Multithreading/Parallelism/Asynchronous/Concurrency, RyuJIT

I was recently talking about first versions of .NET, C# and the world of development technologies of that time. As I briefly touched J# (anybody remembers?) I realized there’s one Java feature that was added to C# because of inspiration by Java and I wanted to explore it. It’s not much used or even known in C#, but it’s still there. And because it’s about “threading and synchronization” I couldn’t resist and immediately jumped in. It’s synchronized methods.

.NET DeveloperDays 2018

27 Jul 2018 Presentations & Speaking

In less than two months the .NET DeveloperDays 2018 conference will happen. According to the organizers it’s “the biggest event in Central and Eastern Europe dedicated exclusively to application development on the .NET platform” and I’m excited to speak there together with other great speakers.

How is Thread.SpinWait actually implemented?

17 Jul 2018 .NET, .NET Core, JIT, Multithreading/Parallelism/Asynchronous/Concurrency, RyuJIT

I’m always drawn into disassembling stuff and learning how something works under the hood. The Thread.SpinWait is something I’m going to explore. Because .NET Core is open source I can attack this from side of both sources as well as pure disassembly.

WUG: Entity Framework Core 2.1 (Ostrava + Praha)

12 Jul 2018 Entity Framework Core, Presentations & Speaking

Ačkoli jsou prázdniny klidnější období v IT, WUG Ostrava a Praha nezahálí a frčí na vlně Entity Frameworku Core 2.1. Já tu vlnu ještě víc zvednu 19.7.2018 od 17:00 v Ostravě a 21.8.2018 od 17:30 v Praze. Takže doufám, že bude hnusně a dorazíte. 😃

Současně s novou verzí .NET Core 2.1 byla uvolněna i nová verze EF Core 2.1. Co je tedy v EF Core 2.1 nového? Proč všichni o 2.1. mluví? Da se již 2.1 reálné použít nebo jsou ještě oblasti, které pokulhávají?

ConfigureAwait(false) analyzer with improved “brain” (v2.0)

10 Jul 2018 .NET, C#, Multithreading/Parallelism/Asynchronous/Concurrency, Roslyn

The original ConfigureAwaitChecker tool I wrote was just a concept and I knew it had a lots of limitations. Luckily it idea was not completely dumb (even Jon Skeet thinks so) and hence when ideas for improvements came in, I was not skipping on these. And because these improvements become quite big, I’m releasing today version 2.0.

Introducing FirebirdDbComparer – library for comparing Firebird databases to create alter scripts

9 Jul 2018 .NET, .NET Core, Databases in general, Firebird

When I first heard the idea of writing library for comparing databases’ structures and producing alter scripts I thought it was a joke. I believed it would take months of work to get it into production quality, handling all the different cases and often also bugs or limitations in Firebird. That was 2015. It’s 2018 now and I’m here, ready to introduce it.

Penny pinching Azure Append Blobs

5 Jul 2018 Application Insights, Azure, Azure Storage

I was going through some reports in Application Insights for a small website I’m running and I saw a lot of 409 errors when writing to Append Blobs. As I was sorting this out, I also realized I can do the whole logic more “efficient” and save some pennies.

Start always the right project with this simple secret in Visual Studio

11 Jun 2018 Visual Studio

You know that feeling. You’re working in a project, hammering awesome code line after line. And then you hit F5 to see the magnificence, …, and a wrong project starts. Or you’re testing multiple applications and always clicking Set as Startup Project. Not anymore. I’ll show you a small little secret that will make this pain a history (or at least will eliminate portion of it).

WUG: Entity Framework Core 2.0/2.1 (Zlín)

5 Jun 2018 Entity Framework Core, Presentations & Speaking

Ještě před prázdninami, než začne v IT klidnější období, se můžete přijít podívat na novinky v Entity Frameworku Core 2.0 a 2.1 na WUG 12.6.2018 od 17:30 ve Zlíně. Na všechny “fičury” se detailně podíváme a zjistíme co a jak.

Entity Framework Core 2.0 a 2.1 byl představen nedávno společně s .NET Core 2.0 a 2.1. Co nového přináší? Jaké jsou změny oproti verzi 1.0/1.1? Má smysl verzi 2.1 používat? Jaké jsou pokročilejší features, jaká jsou omezení… A co například použití s jinými databázemi než jen MS SQL Server?

Easier GetHashCode implementation in .NET Core 2.1

5 Jun 2018 .NET, .NET Core, .NET Standard, C#

Writing correct GetHashCode implementation is difficult. I know you’ve written it before and simple xor-ing looks fine. But trust me, it’s more than that. Especially if you want your implementation to be solid and useful for hash-tables etc. And .NET was not helping in any way. Until now.

How I fixed and improved connection pooling by not working on connection resiliency.

24 May 2018 .NET, .NET Standard, ADO.NET, C#, Network

For a long time, I had a ticket with “Connection resiliency” title in the issue tracker. My idea was to provide a functionality to be able to recover from a broken connection. Why? Because when I reimplemented (and fixed) connection pool sometime around 4.x version I removed one questionable (to put it lightly) feature. That, and also because I introduced a small bug, surfaced a problem people had/have in the code.

Entity Framework Core 2.0 provider second beta (and FirebirdClient 6.0)

24 May 2018 .NET, .NET Standard, C#, Databases in general, Entity Framework Core, Firebird, LINQ, SQL, Visual Studio

It has been a while since I posted new version/beta of FirebirdClient 6.0 and the Entity Framework Core 2.0 (and newer) support. Although I’d like to spend more time on all the providers, my free time is limited (although occasionally somebody sponsors some feature or bux fix), thus the progress is what it is.

Update Days: Legacy aplikace

21 May 2018 C#, Presentations & Speaking

Zanedlouho, konkrétně 28.5.-29.5., se uskuteční zajímavá konference nazvaná ”Update Days: Legacy aplikace“. Proč zajímavá? Protože často se na konferencích řeší novinky, fičurky atp., ale ne na každém projektu je čas a prostředky na implementaci posledních výstřelků (které ještě případně po dvou letech upadnou v zapomnění) a tato konference není o novinkách; je o tom co dělat s existující aplikací, jak ji posunout dál, co funguje a má smysl.

Gopas TechEd 2018

30 Apr 2018 Presentations & Speaking

Web hlásí vyprodáno, takže budu asi lákat především ty, kteří si vstup už urvali. Na letošní TechEd jsem připravil dvě přednášky:

  • IDisposable – implementace a mýty
  • Co je nového v Entity Frameworku Core 2.0 a 2.1

Getting the state of load management switch on budget

26 Apr 2018 Domoticz, IoT, Z-Wave

My house has a load management switch (we call it HDO here), which means the company managing the electricity grid can turn on and off some devices, like water heater, when the demand is low or high. And in exchange I get cheaper electricity (when switched on). And although the schedule is known in advance, I was interested whether the switching happens also at unscheduled times (aka to get a little peek into what’s happening in the grid) and maybe also switch automatically other devices I have when the electricity is cheap. I could ask an electrician to install another contactor on my fuse board and connect “something” to it, but I was not into doing anything permanent and expensive, in case I’d change my mind about all of this in the future etc. I also wanted to get this information into my home automation system (Domoticz). Here’s my cheap solution I hacked together.

WUG: C# 7, 7.1, 7.2 a 7.3/8.0 (Olomouc)

25 Apr 2018 C#, Presentations & Speaking

Máte rádi C#? A ztrácíte se v aktuální rychlé kadenci verzí? Mám pro vás řešení – WUG 2.5.2018 od 17:00 v Olomouci. Všechno dáme do kupy a srovnáme si to v hlavě.

C# v poslední době velmi rychle přidává nové funkce. Malé funkce v minor verzích, ale připravuji se i velké změny do major verze (verzí). Co je tedy dostupné v C# 7, 7.1, 7.2 a jak to začít používat. A co nás ceká v 7.3 a hlavně ve verzi 8.0?

Simple caching interceptor (aspect) for Castle Windsor

23 Apr 2018 .NET, Aspect Oriented Programming (AOP), Caching, Castle Windsor, Inversion of Control (IoC)

I needed to cache value from method. Simple. I know there’s at least dozen of ready-made solutions, but I eventually decided to write my own interceptor, because the whole project is already using Castle Windsor and it seemed like a fun stuff to explore. There isn’t really anything special about this code and I originally didn’t want to blog about it, but people on Twitter changed my mind.

Fun with C#’s local functions – part 2

19 Apr 2018 C#

I was speaking about new features in C# 7.x and 8 some days ago and as the questions came in, some were really good small brainstorming, basically trying where C# compiler limits are. And that’s always interesting to me.

From this brainstorming I have two interesting pieces. This is the other one and the first one is here.

Fun with C#’s local functions – part 1

19 Apr 2018 C#

I was speaking about new features in C# 7.x and 8 some days ago and as the questions came in, some were really good small brainstorming, basically trying where C# compiler limits are. And that’s always interesting to me.

From this brainstorming I have two interesting pieces. This is the first one and the other one is here.

Global Azure Bootcamp 2018

11 Apr 2018 Azure, CDN, Presentations & Speaking

Global Azure Bootcamp 2018. Jeden den, Azure po celém světě. A taky v Čechách, v Praze. I já přispěju svojí troškou do mlýna a povím vám něco o Azure CDN v přednášce “Azure CDN a jak ji začít rozumně používat”.

Glowing filament of halogen bulb

4 Apr 2018 Electronics

I was testing dimmer during the weekend and I used halogen lamp in my garage. The dimmer worked great, but that’s not what I want to talk about now. When I played with the dimming I realized I can dim the 8000-9000 lumens halogen bulb down to one percent and see the glowing filament with my own eyes. So I did.

WUG Days 2018

30 Mar 2018 C#, Entity Framework Core, Presentations & Speaking, Programming in general

Víkend 7.-8.4. se v Brně koná nabitá konference WUG Days 2018. Celkem je připraveno 48 přednášek. Na dva dny masakr.

Hlasováním byly vybrány 3 moje přednášky. A sice:

WUG: C# 7, 7.1, 7.2 a 7.3/8.0 (Praha)

29 Mar 2018 C#, Presentations & Speaking

Máte rádi C#? A ztrácíte se v aktuální rychlé kadenci verzí? Mám pro vás řešení – WUG 5.4.2018 od 18:00 v Praze. Všechno dáme do kupy a srovnáme si to v hlavě.

C# v poslední době velmi rychle přidává nové funkce. Malé funkce v minor verzích, ale připravuji se i velké změny do major verze (verzí). Co je tedy dostupné v C# 7, 7.1, 7.2 a jak to začít používat. A co nás ceká v 7.3 a hlavně ve verzi 8.0?

Video

Using value converter for custom encryption of field on Entity Framework Core 2.1

20 Mar 2018 Encryption, Entity Framework Core, Security

In February I wrote Custom encryption of field with Entity Framework Core post, which in turn was building on idea for Entity Framework 6. Both are easy, but not absolutely straightforward. And another problem is that the encrypted value needs to fit into the datatype of unencrypted value. Finally, the querying is inconvenient. Luckily Entity Framework Core 2.1 (currently in preview) has a solution.

True and false operators in C#

15 Mar 2018 C#

Few days ago, I learned new thing about C#. Apparently, there are “true” and “false” operators and you can overload these. But I also wanted to know what are these good for, given I’ve never heard about these.

Named locks (using Monitor) in .NET: Implementation

19 Feb 2018 .NET, Multithreading/Parallelism/Asynchronous/Concurrency

The Monitor class in .NET might be the most often used “locking” mechanism in C#, mostly because the lock keyword is making it so easy. One thing you might face is unknown number of locks you’re going to need and how to solve this. This is often called named locks or named Monitors, because the lock is bound to some name (or similar value).

How I got my machine back, patiently, after overloading it

7 Feb 2018 Disaster recovery, Lessons learned, Life, Operating systems, Windows

At the moment, one of my explorations is how the system (Windows) handles more-than-number-of-CPUs threads (all ready to run) under full load (from these threads). And because I’m out of office, I access my workstation remotely (using TeamViewer, in case you’re wondering).

Custom encryption of field with Entity Framework Core

5 Feb 2018 Encryption, Entity Framework Core, Security

Almost exactly 5 years ago (yes, that’s 2013) I wrote about Custom encryption of field with Entity Framework. At that time, it was using few tricks to make it work and although it might have looked like magic first time you saw it, it was actually very easy. With Entity Framework Core nowadays we have far more options how the entity can look like and hence how the whole solution can be plugged together. Let’s revisit the topic.

ShowIT 2018 a G2B•TechEd 2018

27 Jan 2018 Presentations & Speaking

Příští týden se konají po roce opět konference ShowIT (Bratislava) a G2B•TechEd (Brno) a myslím, že ještě nějaké místo urvat můžete. Aby se ani jedno město necítilo ochuzené, budu mít na stejné přednášky na obou. Povíme si něco o Azure CosmosDB.

Azure CosmosDB je databáze s globálním škálováním a dostupností. Podporuje několik modelů ukládání a konzistence. Má garantovanou dobu odezvy bez ohledu na data. A to vše jako služba v Azure. Wow! Je to opravdu tak přímočaré? Nebo je nadšení třeba krotit? Vysvětlím vám, jak CosmosDB funguje, na co se dá použít a uvidíme jestli je nadšení podloženo daty (třeba i těmi uvnitř DB 😉).

Tuples goodness in .NET 4.7.1 (.NET Core 2.0 included)

24 Jan 2018 .NET, .NET Core, .NET Standard, C#

One of the few things I was missing when tuples were introduced was some way to generically work with unknown tuples. Mostly to be able to identify tuples, instead of using plain object and also work with items using index of some sort. Luckily, I was probably not the only one and starting .NET 4.7.1 new interesting interface – ITuple – was added (also available in .NET Core 2.0).

About mentoring

26 Dec 2017 Career, Life, Programming in general

Recently in my social bubble, mostly on Twitter, there has been a lot of talking about mentoring. Senior developers mentoring juniors and so on. Although I’m not, by any means, saying mentoring is bad and juniors should leave seniors alone, I’d like to also share my opinion. Shedding some light into this seemingly black-and-white problem.

Entity Framework Core 2.0 provider for Firebird now in beta

11 Dec 2017 .NET, .NET Standard, C#, Databases in general, Entity Framework Core, Firebird, LINQ, SQL, Visual Studio

As I’m sweeping the corners, the work is less glamorous (read: close to zero outside contributions) and every move is harder and harder. But despite all of that, I’m glad to move one step closer to the RTM version of Entity Framework Core 2.0 provider for Firebird and jump to the beta phase.

WUG: Entity Framework Core 2.0 (Olomouc)

5 Dec 2017 Entity Framework, Presentations & Speaking

WUGy v Olomouci opět oživly a můžeme se tedy podívat společně na Entity Framework Core 2.0.

Entity Framework Core 2.0 byl představen nedávno společně s .NET Core 2 a ASP.NET Core 2. Co nového přináší? Jaké jsou změny oproti verzi 1.0 / 1.1? Má smysl verzi 2.0 používat? Jaké jsou pokročilejší features, jaká jsou její omezení… A co například použití s jinými databázemi než jen MS SQL Server?

Těším se na vás 12.12.2017 od 17:00 v Olomouci.

Changing paths in PDB files for source files (and PDB file path in DLL as well)

2 Dec 2017 .NET Core, Roslyn

Although you can disable PDB files generation altogether, it’s good idea to have these. Debugging without PDB files later is so much harder, like if debugging isn’t hard enough already. One thing that might be bothering you, is the source files location that is stored in PDB files. You might want to change these paths – build servers often use random directory names or you might want to simply hide that the project directory on your hard drive has some weird name. 😃

Are static methods faster in execution compared to instance methods (.NET)?

27 Nov 2017 .NET, .NET Core, JIT, RyuJIT

Couple days ago, fellow MVP and colleague @RobertHaken tweeted from frustration about a refactoring (in this case not a good refactoring) into static methods. And I immediately started thinking about scenario where the static method might have some tangible benefits compared to instance method. What a better way to improve method execution than speeding it up? Could this be the case?

Do not await what does not need to be awaited

17 Nov 2017 .NET, C#, Multithreading/Parallelism/Asynchronous/Concurrency

As the usage of await seeps more and more into general C# code, I’m finding some small “leaks” that make me sad sometimes. This one is pretty simple. Looks like that every time somebody uses XxxAsync method, he or she also awaits it. Makes sense, or does it?