tabs ↹ over ␣ ␣ ␣ spaces

by Jiří {x2} Činčura

Gopas TechEd 2017

Published 28 Apr 2017 in Presentations & Speaking

Včera jsem zahlédl na Facebooku k TechEdu, že je ještě 20 míst volných. Pokud již registraci máte nebo se vám podaří některé z těch 20 míst ukořistit, mám tu nabídku mých přednášek.

  • Migrace EF6 na EF Core
  • Python pro C# vývojáře

DevDays 2017 (Bratislava)

Published 27 Apr 2017 in Presentations & Speaking

DevDays letos nabídnou kromě klasických přednášek i možnost sledovat keynote //build/ konference ve čtvrtek. Podobná akce proběhne i v Praze. Škoda, že se ani na jedno místo nestihnu dostavit. Ale na sobotní konferenci to už stihnu a připravil jsem si jednu přednášku na téma “IDisposable - implementace a mýty”. Možná trochu netradičně se týká nečeho, co je v .NETu dostupné od “odjakživa”. Přesto je kolem IDisposable za ty roky plno mýtů a zaručených řešení, které ale nemusí být tak úplně korektní. A můj plán je všechny (nebo většinu) vysvětlit a zdůvodnit.

Shutting down VMs in Azure automatically based on schedule

Published 24 Apr 2017 in Azure and Cloud

Azure VMs are great for developers for testing stuff, not only running servers. Then often you don’t need the VM all the time. You can shut it down i.e. during the night and save some money. The only problem is to remember to do it. Especially if the VM is used in a team etc. Luckily Azure portal has a less-known feature, as I’ve found last Friday when chatting with a friend, to help you with it.

Where does the 65521 (static) or 65520 (instance) number of methods in a class come from?

Published 14 Apr 2017 in .NET and C#

If you have been following last two posts about the stack overflows (post 1, post 2), you know I’ve hit some limits. The first was 65535 fields in a class. Which is easy to explain, because the number is actually the maximum value that fits into unsigned 16-bit integer. Makes sense. Then I’ve hit some weird number (or actually numbers) for number of methods. It took me quite a while, with some help, to understand, what the number is based on.

Stopping MSBuild appending TargetFramework to OutputPath

Published 4 Apr 2017 in .NET Core, MSBuild, and Visual Studio

If you’re using the new csproj format maybe you noticed that the OutputPath has the last part automatically appended according to the framework you’re targeting. For example targeting netstandard1.6 would result in build results to be in bin\[Debug|Release]\netstandard1.6, for net462 it would be bin\[Debug|Release]\net462. But what if you don’t like this behavior? What if you want to specify the path exactly?

Disassembling a relay

Published 2 Apr 2017 in Electronics and IoT

I like taking things apart. Or putting them together. New piece of furniture from IKEA is like a small Christmas. It’s something different than programming, yet very similar, at least for me, in how the brain processes the (dis)assembling. Already as a child in school I liked learning how everyday objects work.

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.