Yesterday was a trip to the world of tuples and reflection and today I’m going to continue on that note. As previously, I needed something with tuples for FbNetExternalEngine - number of elements in whole tuple. I call it “size of tuple”.
Continuing with my tuples (
ValueTuple<...> to be precise) exploration in C# I was in a need to check whether the type is a “tuple”. The
(T, T, T, ...) in C#. You can create
ValueTuple<...> yourself manually, but you can also create something that’s not a tuple - compiler wouldn’t do it that way.
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.
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.
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.
I’ve had some spare time in between working on other items yesterday and I decided to explore how the FbNetExternalEngine plugin would feel with new tuples support in C# 7. As it happens the sailing was not smooth and I was bitten by the magic the compiler does for us.
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.
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.
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.
I’m working on a small side-project where I need some multiple-writers-safe storage for storing logging-like events. For this the Azure’s Append Blob is a good match.
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.
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.
New version 220.127.116.11 of ADO.NET provider for Firebird is ready for download. The story of this version is finalizers. Yeah.
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.
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í.
You know the feeling when you write some awesome code and then you find the underlying code or library does not do what you expect it to do? Well, that’s exactly what happened to me with the
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
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
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.
New version 18.104.22.168 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 22.214.171.124 is thus full of bugfixes inside, without any visible changes outside.
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.