<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on InternetException</title><link>https://internetexception.com/post/</link><description>Recent content in Posts on InternetException</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 28 Aug 2026 17:33:25 +0200</lastBuildDate><atom:link href="https://internetexception.com/post/index.xml" rel="self" type="application/rss+xml"/><item><title>I built an app and it cost almost $40</title><link>https://internetexception.com/2026/08/28/i-built-an-app-and-it-cost-almost-40/</link><pubDate>Fri, 28 Aug 2026 17:33:25 +0200</pubDate><guid>https://internetexception.com/2026/08/28/i-built-an-app-and-it-cost-almost-40/</guid><description>&lt;p&gt;I posted already about me selfhosting LLM models. Right now I have two devices:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Framework Desktop&lt;/li&gt;&#10;&lt;li&gt;Custom Ryzen Threadripper server with R9700 32GB GPU&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Both are decent with llama.cpp. The biggest issue is prefill times.&lt;/p&gt;&#10;&lt;p&gt;I have from work subscription for Claude and Codex which I tested too for last couple of months. It is OK but lack of thinking traces really hurt to keep up with what models are doing.&lt;/p&gt;</description></item><item><title>Surprised LLM</title><link>https://internetexception.com/2026/08/18/surprised-llm/</link><pubDate>Tue, 18 Aug 2026 15:31:20 +0200</pubDate><guid>https://internetexception.com/2026/08/18/surprised-llm/</guid><description>&lt;p&gt;I know that LLM or Large Language Models are designed to mimic what people write, but still from time to time it surprises me and make me chuckle.&lt;/p&gt;&#10;&lt;p&gt;I am working on small tool that runs agents in confinement that gives those programs limited set of tools that you would want them to use only. Otherwise they may try to use &lt;code&gt;sudo&lt;/code&gt; to change system settings or kill all your docker containers instead of only few were created by them. I had several times the same problem with &lt;code&gt;codex&lt;/code&gt; not being able to start in such sandbox because of permissions issues. I am using Qwen 3.8 for now and it thinks a lot and this particular case it was thinking about those permissions.&lt;/p&gt;</description></item><item><title>Short review of Qwen 3.8 27B</title><link>https://internetexception.com/2026/08/17/short-review-of-qwen-3-8-27b/</link><pubDate>Mon, 17 Aug 2026 17:27:09 +0200</pubDate><guid>https://internetexception.com/2026/08/17/short-review-of-qwen-3-8-27b/</guid><description>&lt;p&gt;&lt;a href="https://huggingface.co/Qwen/Qwen3.8-27B" target="_blank" rel="noopener noreferrer"&gt;Qwen 3.8&lt;/a&gt;&#10; is out since Friday, 17 of August. I am running it on my own server since Saturday. I am running &lt;a href="https://huggingface.co/unsloth/Qwen3.8-27B-GGUF" target="_blank" rel="noopener noreferrer"&gt;Q4 quants from unsloth&lt;/a&gt;&#10;.&lt;/p&gt;&#10;&lt;p&gt;So far it feels like a step up from Qwen 3.6 27B, which sometimes had problems figuring stuff in my project that I am developing almost entirely using models - just as a test of how far I can push LLMs in agentic coding - mostly local models, I must add. Qwen 3.8 seems like having no problem at all.&lt;/p&gt;</description></item><item><title>Quick review of Laguna S 2.1</title><link>https://internetexception.com/2026/07/24/quick-review-of-laguna-s-2-1/</link><pubDate>Fri, 24 Jul 2026 15:06:50 +0200</pubDate><guid>https://internetexception.com/2026/07/24/quick-review-of-laguna-s-2-1/</guid><description>&lt;p&gt;Just couple of days ago poolside released their new model: Laguna S 2.1. I was happy to try it since it have native support for 1M tokens in context. I am doing development of hobby projects on my phone, via SSH prompting models to do stuff and 250k tokens of context using Qwen 3.6 27B usually means going through few rounds of compaction before I am happy with the results. Having longer context would be better - in theory - without those ugly interruptions and reiterating stuff to agent that were lost in previous session.&lt;/p&gt;</description></item><item><title>Problem with local network in termux</title><link>https://internetexception.com/2026/07/04/problem-with-local-network-in-termux/</link><pubDate>Sat, 04 Jul 2026 15:42:04 +0200</pubDate><guid>https://internetexception.com/2026/07/04/problem-with-local-network-in-termux/</guid><description>&lt;p&gt;I bought new phone and I started installing applications from previous device. When I installed termux I tried to copy ssh keys and ssh config from previous installation.&lt;/p&gt;&#10;&lt;p&gt;This is where problems started. I could not reach any local address. Nothing in 10.x.x.x was working. No pings no ssh.&lt;/p&gt;&#10;&lt;p&gt;I could do that to public IPs just fine.&lt;/p&gt;&#10;&lt;p&gt;I tried to install new version of packages but it also did not work.&lt;/p&gt;</description></item><item><title>Remote phone development.</title><link>https://internetexception.com/2026/06/19/remote-phone-development/</link><pubDate>Fri, 19 Jun 2026 17:18:48 +0200</pubDate><guid>https://internetexception.com/2026/06/19/remote-phone-development/</guid><description>&lt;p&gt;I remember when I started selfhosting my own instance of GitLab, which had simple code editor that allows you to edit code quickly inline. Then they integrated with fork of Visual Studio Code and allowed you to code in real repository directly in GL.&lt;/p&gt;&#10;&lt;p&gt;I was thinking of doing quick code changes to applications at this way, change some configuration of my API, quick fix of my mobile phone for home automation and etc.&lt;/p&gt;</description></item><item><title>High Five with LLM</title><link>https://internetexception.com/2026/06/12/high-five-with-llm/</link><pubDate>Fri, 12 Jun 2026 18:35:39 +0200</pubDate><guid>https://internetexception.com/2026/06/12/high-five-with-llm/</guid><description>&lt;p&gt;I do not know&amp;hellip; I find it funny.&lt;/p&gt;&#10;&lt;p&gt;After few days fighting with local LLM to force it to write documentation and comments in code, in good quality I must add, and the forcing it to write readable unit tests, after I wrote:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;File is untracked (new). Build passes. Ready for review.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;I just answered.&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;awesome mate. It is friday we deserve a brake. High five.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;I was thinking for a bit and answered:&lt;/p&gt;</description></item><item><title>Running Qwen 3.6 on vLLM with 6 draft tokens</title><link>https://internetexception.com/2026/05/20/running-qwen-3-6-on-vllm-with-6-draft-tokens/</link><pubDate>Wed, 20 May 2026 20:13:55 +0200</pubDate><guid>https://internetexception.com/2026/05/20/running-qwen-3-6-on-vllm-with-6-draft-tokens/</guid><description>&lt;p&gt;Just out of curiosity I tested Qwen3.6-27B model with MTP speculative decoding with 6 draft tokens. Whole script looked like this:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;docker run --rm --name=&amp;#34;${2:-qwen3.6-medium-vllm}&amp;#34; \&#10; --group-add=video \&#10; --cap-add=SYS_PTRACE \&#10; --security-opt seccomp=unconfined \&#10; --device /dev/kfd \&#10; --device /dev/dri \&#10; -v /cache/huggingface:/root/.cache/huggingface \&#10; -v /cache/vllm:/root/.cache/vllm \&#10; --env &amp;#34;HF_TOKEN=$3&amp;#34; \&#10; -e TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1 \&#10; -e VLLM_ROCM_USE_AITER=1 \&#10; -e FLASH_ATTENTION_TRITON_AMD_ENABLE=TRUE \&#10; -p &amp;#34;${1:-8000}&amp;#34;:8000 \&#10; --ipc=host \&#10; --entrypoint &amp;#39;/bin/sh&amp;#39; \&#10; vllm/vllm-openai-rocm:nightly \&#10; -c &amp;#34;pip install fastokens; vllm serve Lorbus/Qwen3.6-27B-int4-AutoRound \&#10; --gpu-memory-utilization 0.48 \&#10; --dtype half \&#10; --optimization-level 1 \&#10; --enable-prefix-caching \&#10; --performance-mode interactivity \&#10; --kv-cache-dtype fp8_e4m3 \&#10; --language-model-only \&#10; --reasoning-parser qwen3 \&#10; --enable-auto-tool-choice \&#10; --tool-call-parser qwen3_coder \&#10; --speculative-config &amp;#39;{ \&amp;#34;method\&amp;#34;: \&amp;#34;mtp\&amp;#34;, \&amp;#34;num_speculative_tokens\&amp;#34;: 2}&amp;#39; \&#10; --max-num-seqs 1 \&#10; --tokenizer-mode fastokens \&#10; --max-num-batched-tokens 262144 \&#10; #--max-model-len 262144&amp;#34;&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Those are results with vLLM bench tool:&lt;/p&gt;</description></item><item><title>Lllama.cpp vs vLLM running Qwen 3.6 27B</title><link>https://internetexception.com/2026/05/20/lllama-cpp-vs-vllm-running-qwen-3-6-27b/</link><pubDate>Wed, 20 May 2026 17:27:57 +0200</pubDate><guid>https://internetexception.com/2026/05/20/lllama-cpp-vs-vllm-running-qwen-3-6-27b/</guid><description>&lt;p&gt;After optimizing lately my vllm startup I started optimizing performance of vLLM during inference. Thing it had abysmal performance spanning like 2-4ts. Or even 0.5ts with 180k context. That was really terrible and I started to think that I wont be able to get better performance out of Strix Halo inside my Desktop Framework.&lt;/p&gt;&#10;&lt;p&gt;But&amp;hellip; I remembered people praising it and its great usability with agents and Qwen models. How is that possible since it have so terrible performance.&lt;/p&gt;</description></item><item><title>Lets ask Claude!</title><link>https://internetexception.com/2026/05/14/lets-ask-claude/</link><pubDate>Thu, 14 May 2026 10:31:18 +0200</pubDate><guid>https://internetexception.com/2026/05/14/lets-ask-claude/</guid><description>&lt;p&gt;AI hype is &lt;a href="https://nooneshappy.com/article/appearing-productive-in-the-workplace/" target="_blank" rel="noopener noreferrer"&gt;calming down in some companies&lt;/a&gt;&#10;, but in others like in the one I am currently consulting for, we still on the hype.&lt;/p&gt;&#10;&lt;p&gt;Few days ago I was asked by my peer about some problem with the tool that I was mostly developing. This is fine are there are always some bugs in every software, though bug was concerning behavior on bad data and therefore out of scope really. Still I offered to help, regardless of the fact that correct fix would be to fix the bad data.&lt;/p&gt;</description></item><item><title>Junie Coding Agent short review</title><link>https://internetexception.com/2026/05/13/junie-coding-agent-short-review/</link><pubDate>Wed, 13 May 2026 07:40:03 +0200</pubDate><guid>https://internetexception.com/2026/05/13/junie-coding-agent-short-review/</guid><description>&lt;p&gt;I have been running few coding agents in my spare time on my personal projects and Junie does not look great when paired with local model&lt;/p&gt;&#10;&lt;p&gt;First of all, local models are capable but their ability to answer prompts in sustainable speeds degrades very quickly. I was experimenting with Qwen3.6-35B-A3B and Qwen3.5-35B-A3B. Both seems to be fairly capable, which is great for a local model that can run on decent GPU that is few years old (I have Radeon 7900 XTX with 24GB of VRAM) - that is outstanding considering what we thought about computers i.e. ten years ago. If someone then would say to me that we will be able to converse with our applications in human language and instruct them to do useful stuff, I would say: &amp;lsquo;Impossible!&amp;rsquo;. But we can and it does work but it have limitation, mainly in context size.&lt;/p&gt;</description></item><item><title>Optimizing vLLM startup time</title><link>https://internetexception.com/2026/05/07/optimizing-vllm-startup-time/</link><pubDate>Thu, 07 May 2026 20:38:15 +0200</pubDate><guid>https://internetexception.com/2026/05/07/optimizing-vllm-startup-time/</guid><description>&lt;p&gt;vLLM has very slow time to first token (TTFT). On &lt;strong&gt;AMD Ryzen AI Max+ 395&lt;/strong&gt; it can take even 10 minutes depending on exact settings and model size.&lt;/p&gt;&#10;&lt;p&gt;To make my user experience of using those things myself I need to have comparison of llama.cpp and vLLM startup time and performance. But to do this I needed to perform optimizations of startup of vLLM since it is even slower to start then it was with v0.17.&lt;/p&gt;</description></item><item><title>My new hobby: Asking LLMS to generate ASCII Hamsters</title><link>https://internetexception.com/2026/05/04/my-new-hobby-asking-llms-to-generate-ascii-hamsters/</link><pubDate>Mon, 04 May 2026 16:53:43 +0200</pubDate><guid>https://internetexception.com/2026/05/04/my-new-hobby-asking-llms-to-generate-ascii-hamsters/</guid><description>&lt;p&gt;I was playing over the weekend trying to write POC of C# interactive console. It is not ready yet but I wanted to have some cute hamster as logo for this project - I will probably incorporate it to some degree into &lt;a href="https://internetexception.com/why-hamster-wheel/"&gt;Hamster Wheel&lt;/a&gt;&#10;, so cute hamster seemed appropriate.&lt;/p&gt;&#10;&lt;p&gt;Just for fun I decided to use LLMs to generate it since maybe I will not finish this project ever so trying to do it myself would be waste of time. And result probably would be terrible since I do not have any artistic skills.&lt;/p&gt;</description></item><item><title>Running Qwen 3.5 on Strix Halo using vLLM and Docker</title><link>https://internetexception.com/2026/04/26/running-qwen-3-5-on-strix-halo-using-vllm-and-docker/</link><pubDate>Sun, 26 Apr 2026 22:20:40 +0200</pubDate><guid>https://internetexception.com/2026/04/26/running-qwen-3-5-on-strix-halo-using-vllm-and-docker/</guid><description>&lt;p&gt;I have Desktop Framework for 2 months now. It is pretty capable for interefence with small contexts. With longer contexts it degrades quickly. It can for example can run 100k tokens contexts for 10minutes. Because of those limitations I decided to try vllm again - maybe it will be quicker. Two months is long time in LLM frameworks last time I was using vllm it has version 0.17. Now stable is 0.19.&lt;/p&gt;</description></item><item><title>Using Mistral Vibe with local model</title><link>https://internetexception.com/2026/04/24/using-mistral-vibe-with-local-model/</link><pubDate>Fri, 24 Apr 2026 22:00:00 +0200</pubDate><guid>https://internetexception.com/2026/04/24/using-mistral-vibe-with-local-model/</guid><description>&lt;p&gt;Vibe was the first coding agent I tried to use with local model. It works and it is fun to have ability to to just tell the computer to do something you want in plain English or even in your own language if your model support it.&lt;/p&gt;&#10;&lt;h2 id="installation-and-configuration"&gt;Installation and Configuration&lt;/h2&gt;&#10;&lt;p&gt;There are several installation methods for vibe that are available along to the usual, security nightmare of running of piping curl-downloaded scripts directly to bash :)&lt;br&gt;&#10;I advise using other installation methods for example via &lt;code&gt;uv&lt;/code&gt;:&lt;/p&gt;</description></item><item><title>Using Junie agent CLI with local model</title><link>https://internetexception.com/2026/04/24/using-junie-agent-cli-with-local-model/</link><pubDate>Fri, 24 Apr 2026 19:04:03 +0200</pubDate><guid>https://internetexception.com/2026/04/24/using-junie-agent-cli-with-local-model/</guid><description>&lt;p&gt;Jet Brains have their own coding agent. Since I am already using Rider and all coding agents are pretty slow and inefficient with what they do I wanted to test if Junie have better integrations with IDE which would make things much faster.&lt;/p&gt;&#10;&lt;p&gt;For example if you will have following unused namespace in Rider.&lt;/p&gt;&#10;&lt;img src="https://internetexception.com/wp-content/uploads/2026/04/image-1.png" class="wp-image-1250" /&gt;&#10;&lt;p&gt;Removing it all cleaning all unused namespaces in entire project or even entire solution is just few clicks away. Or key strokes.&lt;/p&gt;</description></item><item><title>AI agent critique of itself</title><link>https://internetexception.com/2026/04/23/ai-agent-critique-of-itself/</link><pubDate>Thu, 23 Apr 2026 11:30:40 +0200</pubDate><guid>https://internetexception.com/2026/04/23/ai-agent-critique-of-itself/</guid><description>&lt;p&gt;I like to self-host my own services. I have my own email server. I have my own cloud storage and sync and backup. I want to have this secure and safe while having my data private.&lt;/p&gt;&#10;&lt;p&gt;But I need to learn and be up to date with current technology.&lt;/p&gt;&#10;&lt;p&gt;I decided to use &lt;a href="https://junie.jetbrains.com/docs/junie-cli.html" target="_blank" rel="noopener noreferrer"&gt;Junie&lt;/a&gt;&#10; with my own, &lt;a href="https://internetexception.com/2026/03/26/swapping-vllm-to-llama-cpp/"&gt;self hosted models&lt;/a&gt;&#10; that I run on my own &lt;a href="https://internetexception.com/2026/03/04/desktop-framework-ai-assistant-part-1/"&gt;hardware&lt;/a&gt;&#10;. In the docs they say it can be run on top your own custom provider and model. But it does not work with Rider plugin. You are limited to their own limited list of models.&lt;/p&gt;</description></item><item><title>Testing Qwen 3.6</title><link>https://internetexception.com/2026/04/16/testing-qwen-3-6/</link><pubDate>Thu, 16 Apr 2026 22:26:06 +0200</pubDate><guid>https://internetexception.com/2026/04/16/testing-qwen-3-6/</guid><description>&lt;p&gt;Today I noticed that &lt;a href="https://qwen.ai/blog?id=qwen3.6-35b-a3b" target="_blank" rel="noopener noreferrer"&gt;new version of Qwen was realesed&lt;/a&gt;&#10;. Only 35B-A3B for now but this is the same size of Qwen I was using previously. Usually (as with every other software) it is better to wait few weeks for fixes, in this case for re uploads of the model, that is done after testing/template adjustments, but it is not a problem to do few tests. I decided to give it a spin. I added it to my llama swap instance and started it up.&lt;/p&gt;</description></item><item><title>Bonding Network interfaces in Debian Forky</title><link>https://internetexception.com/2026/03/31/bonding-network-interfaces-in-debian-forky/</link><pubDate>Tue, 31 Mar 2026 21:18:00 +0200</pubDate><guid>https://internetexception.com/2026/03/31/bonding-network-interfaces-in-debian-forky/</guid><description>&lt;p&gt;I am experimenting lately on with Nanobot and running self hosted language models on Desktop Framework.&lt;/p&gt;&#10;&lt;p&gt;I was trying to run lately Qwen 3.5 397B model on this small PC and it was a bit hard because I just do not have enough disk space on it. I bought just small NVMe SSD disk. With current prices, I planned to use disk space on other server I have at my hope as storage&lt;/p&gt;</description></item><item><title>Running Qwen 3.5 397B on Desktop Framework</title><link>https://internetexception.com/2026/03/30/running-qwen-3-5-397b-on-desktop-framework/</link><pubDate>Mon, 30 Mar 2026 17:53:10 +0200</pubDate><guid>https://internetexception.com/2026/03/30/running-qwen-3-5-397b-on-desktop-framework/</guid><description>&lt;p&gt;Today I finally was able to download and run largest Qwen 3.5 model. I downloaded the smallest quant even if a bit bigger probably would fit too, but I want to run also few smaller models at the same time, so 107GB for UD-IQ1_M is the biggest I was able to spare.&lt;/p&gt;&#10;&lt;p&gt;I downloaded and was able to run it with llama.cpp with the following command:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;./llama-server \&#10; -hf unsloth/Qwen3.5-397B-A17B-GGUF:UD-IQ1_M\&#10; --ctx-size 32000 \&#10; --no-warmup \&#10; --no-mmap \&#10; --flash-attn on \&#10; --n-gpu-layers 1 \&#10; --host 0.0.0.0\&#10; --port $1 \&#10; --direct-io \&#10; --jinja --chat-template-file /data/apps/vllm/qwen3_nonthinking.jinja&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;My intention was to test it with nanobot to see if this will be capable agent for my AI assistant.&lt;/p&gt;</description></item><item><title>My first PR to Nanobot</title><link>https://internetexception.com/2026/03/28/my-first-pr-to-nanobot/</link><pubDate>Sat, 28 Mar 2026 18:52:58 +0100</pubDate><guid>https://internetexception.com/2026/03/28/my-first-pr-to-nanobot/</guid><description>&lt;p&gt;I am blogging last few weeks about &lt;a href="https://internetexception.com/2026/02/26/running-my-own-ai-assistant/"&gt;my new aventure with nanobot.&lt;/a&gt;&#10; I am running model for that &lt;a href="https://internetexception.com/2026/03/04/desktop-framework-ai-assistant-part-1/"&gt;little assistant of mine on Desktop Framework&lt;/a&gt;&#10; motherboard I bought couple of days ago.&lt;/p&gt;&#10;&lt;p&gt;Few days ago I was working on my own fork of nanobot. I was not happy how few things are not entirely correctly implemented in this project. For example command support in Matrix channel. I created PR for that one &lt;a href="https://github.com/HKUDS/nanobot/pull/2361" target="_blank" rel="noopener noreferrer"&gt;here&lt;/a&gt;&#10;. Unfortunately it was not merged yet. I am not sure why. Maybe it is mising few unit tests.&lt;/p&gt;</description></item><item><title>Swapping vLLM to Llama.cpp</title><link>https://internetexception.com/2026/03/26/swapping-vllm-to-llama-cpp/</link><pubDate>Thu, 26 Mar 2026 20:04:51 +0100</pubDate><guid>https://internetexception.com/2026/03/26/swapping-vllm-to-llama-cpp/</guid><description>&lt;p&gt;Yesterday &lt;a href="https://internetexception.com/2026/03/25/vllm-is-fast-but-kind-of-slow/"&gt;I posted about vLLM being nice but optimized for different usage I am being really interested in&lt;/a&gt;&#10;. I commented on Llama Swap GH issue asking for help my problem of vLLM being shutdown before it actually started. During writing that comment I was thinking about Llama.cpp and it inability to run Qwen 3.5. It was at the beginning of March when I started (again) experimenting with LLMs. I tried to run Qwen models with release version of Llama.cpp and it was failing with &amp;lsquo;model architecture of Qwen3 is not found&amp;rsquo; (or something like that; I do not really remember). Because of that I switched to using vLLM, even if it could not run Qwen 3.5, it could run Qwen 3 just fine from the docker image. Sglang seemed like not a good choice for my needs.&lt;/p&gt;</description></item><item><title>vLLM is fast but kind of slow</title><link>https://internetexception.com/2026/03/25/vllm-is-fast-but-kind-of-slow/</link><pubDate>Wed, 25 Mar 2026 18:53:05 +0100</pubDate><guid>https://internetexception.com/2026/03/25/vllm-is-fast-but-kind-of-slow/</guid><description>&lt;p&gt;I was using vLLM to run my AI assistant models for few weeks now. It is quite nice, production ready framework &lt;a href="https://github.com/vllm-project/vllm/issues/27706" target="_blank" rel="noopener noreferrer"&gt;that have few bugs&lt;/a&gt;&#10;. ROCm support and by extent Strix Halo support is quite nice, even if AMD GPU docker image does not work on &lt;a href="https://internetexception.com/2026/03/14/running-qwen-3-5-on-amd-ryzen-ai-max-395/"&gt;Strix Halo without aiter&lt;/a&gt;&#10; in custom version.&lt;/p&gt;&#10;&lt;p&gt;Interference speeds are quite nice. You can get 20-30t/s out of new AMD APU. Which is totally usable. Here is sample test I done on this device via LLM API Throughput Benchmark:&lt;/p&gt;</description></item><item><title>Integrating my AI assistant with StartPage</title><link>https://internetexception.com/2026/03/20/integrating-my-ai-assistant-with-startpage/</link><pubDate>Fri, 20 Mar 2026 21:09:48 +0100</pubDate><guid>https://internetexception.com/2026/03/20/integrating-my-ai-assistant-with-startpage/</guid><description>&lt;p&gt;Today &lt;a href="https://internetexception.com/2026/03/20/teaching-my-ai-assistant-to-surf-the-web-part-2/"&gt;I was fixing an issue with my assistant having a hard time accessing web search&lt;/a&gt;&#10;. I fixed that but I was not entirelly satisfied with the result. Browsh is great for that used but I am using StartPage on my PC and on my phone. Ability to see similar or even the same web search result for me and my assistant would be great.&lt;/p&gt;&#10;&lt;p&gt;How hard it can be to actually fetch the result od search via CLI? Actually it is not that hard. I was able to figurę it out though it requires very specific set od parameters, headers being sent to very specific address.&lt;/p&gt;</description></item><item><title>Teaching my AI assistant to surf the web part 2</title><link>https://internetexception.com/2026/03/20/teaching-my-ai-assistant-to-surf-the-web-part-2/</link><pubDate>Fri, 20 Mar 2026 12:01:32 +0100</pubDate><guid>https://internetexception.com/2026/03/20/teaching-my-ai-assistant-to-surf-the-web-part-2/</guid><description>&lt;p&gt;Few days ago &lt;a href="https://internetexception.com/2026/03/03/how-i-taught-my-ai-assistant-to-read-websites/"&gt;I thought my assistant to do web search via Browsh&lt;/a&gt;&#10; and Duck Duck Go. It was working for some time with small problems, like for example I changed host name of the machine hosting nanobot and forget to adjust the host name in skill URL. Another small pain point is that sometimes returns timeout instead of web page content and not falls back to Brave Search API, and since I do not like that service, there is no API key and it falls back to DDG via python code. So it is mostly slow but I am still happy with that.&lt;/p&gt;</description></item><item><title>Desktop Framework AI assitant part 3</title><link>https://internetexception.com/2026/03/16/desktop-framework-ai-assitant-part-3/</link><pubDate>Mon, 16 Mar 2026 21:31:03 +0100</pubDate><guid>https://internetexception.com/2026/03/16/desktop-framework-ai-assitant-part-3/</guid><description>&lt;p&gt;&lt;a href="https://internetexception.com/2026/02/26/running-my-own-ai-assistant/"&gt;Recently&lt;/a&gt;&#10; I started playing with &lt;a href="https://github.com/HKUDS/nanobot" target="_blank" rel="noopener noreferrer"&gt;Nanobot&lt;/a&gt;&#10; which is a bit like OpenClaw but, in my opinion much better since it is small and simple and have native integration with custom OpenAI APIs providers. I decided to use &lt;a href="https://vllm.ai/" target="_blank" rel="noopener noreferrer"&gt;vLLM&lt;/a&gt;&#10; because I wanted to use &lt;a href="https://huggingface.co/Qwen/Qwen3.5-35B-A3B" target="_blank" rel="noopener noreferrer"&gt;Qwen 3.5&lt;/a&gt;&#10; because according to my quick reaserach it is pretty good in such agentic usage and Qwen models are built with integration with SgLang and vLLM frameworks in mind. Also AMD is testing their own drivers and libraries, ROCm on docker images with SgLang and vLLM and Desktop Framework is AMD APU. So all of it since like a good idea since I decided to go with &lt;a href="https://internetexception.com/2026/03/01/self-hosting-your-ai-assistant-efficiently/"&gt;Strix Halo unifies memory architecture&lt;/a&gt;&#10; for my AI assistant. I &lt;a href="https://internetexception.com/2026/03/04/desktop-framework-ai-assistant-part-1/"&gt;bought&lt;/a&gt;&#10; Desktop Framework motherboard and &lt;a href="https://internetexception.com/2026/03/05/desktop-framework-ai-assistant-part-2/"&gt;played with it a little&lt;/a&gt;&#10; to test models performance on ROCm inside the docker. It was not blazing fast but enough to actually have working solution.&lt;/p&gt;</description></item><item><title>Adding voice recognition to my AI assistant</title><link>https://internetexception.com/2026/03/15/adding-voice-recognition-to-my-ai-assistant/</link><pubDate>Sun, 15 Mar 2026 23:43:00 +0100</pubDate><guid>https://internetexception.com/2026/03/15/adding-voice-recognition-to-my-ai-assistant/</guid><description>&lt;p&gt;It is amazing how time flies&amp;hellip; I am living at my current house already 9 years almost. I did put up a fence around the house in 2019. Next year I installed metal gate with automation and was working on a way to make it more &amp;lsquo;smart&amp;rsquo;. My first attempt was to have small raspberry Pi connected via some metal wires and solid relays to the gate electrical engine. It is working like that till now.&lt;/p&gt;</description></item><item><title>Running AI assistant on Qwen 3.5</title><link>https://internetexception.com/2026/03/15/running-ai-assistant-on-qwen-3-5/</link><pubDate>Sun, 15 Mar 2026 22:35:00 +0100</pubDate><guid>https://internetexception.com/2026/03/15/running-ai-assistant-on-qwen-3-5/</guid><description>&lt;p&gt;I did make mistake installing my favorite &lt;a href="https://internetexception.com/2026/03/13/switching-my-ai-assistant-os-to-ubuntu/"&gt;Debian Linux distribution on Desktop Framework&lt;/a&gt;&#10; PC I am using to run my LLM models. Probably some hacking during installing vLLM and all libraries and drivers and I would be able to make it work. But is it really worth it? I think it was not. So I switched to Ubuntu and I am &lt;a href="https://internetexception.com/2026/03/14/running-qwen-3-5-on-amd-ryzen-ai-max-395/"&gt;running Qwen 3.5&lt;/a&gt;&#10; second day now.&lt;/p&gt;&#10;&lt;p&gt;For now I can say that I am very happy. It seems to be able to reason much better than its predecessor Qwen 3. It have pretty good vision capabilities. It is able to fix its own mistakes, which makes its usage much easier.&lt;/p&gt;</description></item><item><title>Integrating my AI assistant with pyLoad</title><link>https://internetexception.com/2026/03/15/integrating-my-ai-assistant-with-pyload/</link><pubDate>Sun, 15 Mar 2026 20:59:04 +0100</pubDate><guid>https://internetexception.com/2026/03/15/integrating-my-ai-assistant-with-pyload/</guid><description>&lt;p&gt;I am using pyLoad download manager for quite some time now. Previously when I was running windows server I was using JDownloader. I think it was better in few things, for example it was able to automatically name a package based on the name of the file from the link. So if I would be trying to download &lt;code&gt;https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-13.4.0-amd64-netinst.iso&lt;/code&gt;, it would automatically name a package &amp;lsquo;debian-13.4.0-amd64-netinst.iso&amp;rsquo;. Folder with downloaded file would be named the same too. Much more convenient. If I would drop multiple links for the same file it would be downloading them in parallel, downloading them much quicker. Though with current speeds in average home maybe this is not necessary anymore. It had better UI, in my opinion, but maybe I was more accustomed to windows desktop then; certainly it was better to have single view instead of 3 views like in pyLoad:&lt;/p&gt;</description></item><item><title>Running Qwen 3.5 on AMD Ryzen AI Max+ 395</title><link>https://internetexception.com/2026/03/14/running-qwen-3-5-on-amd-ryzen-ai-max-395/</link><pubDate>Sat, 14 Mar 2026 15:09:00 +0100</pubDate><guid>https://internetexception.com/2026/03/14/running-qwen-3-5-on-amd-ryzen-ai-max-395/</guid><description>&lt;p&gt;I bough lately Desktop Framework with intention of running Qwen 3.5 as model for my AI assistant on &lt;a href="https://github.com/HKUDS/nanobot" target="_blank" rel="noopener noreferrer"&gt;Nanobot&lt;/a&gt;&#10;. At first I could not run this model on this hardware for some weird bug in one of the libraries. I explained why and how I fixed it &lt;a href="https://internetexception.com/2026/03/13/switching-my-ai-assistant-os-to-ubuntu/"&gt;here&lt;/a&gt;&#10;. In this post I will just put the list of packages that I used to run Qwen finally and vLLM command switches and parameters.&lt;/p&gt;</description></item><item><title>Switching my AI assistant OS to Ubuntu</title><link>https://internetexception.com/2026/03/13/switching-my-ai-assistant-os-to-ubuntu/</link><pubDate>Fri, 13 Mar 2026 20:38:31 +0100</pubDate><guid>https://internetexception.com/2026/03/13/switching-my-ai-assistant-os-to-ubuntu/</guid><description>&lt;p&gt;I did make a mistake trying to run a vLLM server on Debian. I theory everything should be OK: Debian is stable, have docker, docker have images for vLLM so I should be able to run all the models on docker on Debian. Also it should not really matter what distro is as long as it have new kernel and docker works. That in theory. I practice I could not force some models to run and Qwen 3 even if it was capable enough it felt limiting at times. For example I was unable to force it to work in agentic loops. I am not sure what was the problem, probably some configuration issue that I am still unable to understand and fix. Still that was just a simple problem that required me to give my assistant some nudge with another prompt. It was not as bad another issue though.&lt;/p&gt;</description></item><item><title>Futuristic API design</title><link>https://internetexception.com/2026/03/13/futuristic-api-design/</link><pubDate>Fri, 13 Mar 2026 16:06:36 +0100</pubDate><guid>https://internetexception.com/2026/03/13/futuristic-api-design/</guid><description>&lt;p&gt;Few days ago &lt;a href="https://internetexception.com/2026/02/28/i-taught-my-virtual-assistant-to-operate-my-gate-and-it-feels-great/"&gt;I was bragging here&lt;/a&gt;&#10; how great I am about teaching my AI assistant operating of my property gate.&lt;/p&gt;&#10;&lt;p&gt;Today I noticed that it no longer works. I asked it again to:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;Open the gate&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;while wondering why am I actually doing it since I can just press the button on my phone&amp;hellip; but well people are sometimes radicoulous like that.&lt;/p&gt;&#10;&lt;p&gt;Anyway I wrote message as above and I got answer like below:&lt;/p&gt;</description></item><item><title>Assigning VRAM on AMD AI Max+ 395</title><link>https://internetexception.com/2026/03/08/assigning-vram-on-amd-ai-max-395/</link><pubDate>Sun, 08 Mar 2026 11:33:00 +0100</pubDate><guid>https://internetexception.com/2026/03/08/assigning-vram-on-amd-ai-max-395/</guid><description>&lt;p&gt;&lt;a href="https://internetexception.com/2026/02/26/running-my-own-ai-assistant/"&gt;Few days ago&lt;/a&gt;&#10; I started playing with AI assistant and I decided to buy new hardware dedicated to running LLM. I bought Framework Desktop board. So far it is really great but running more than one model is a bit difficult and I wanted to test few things while my nanobot is running undisrupted.&lt;/p&gt;&#10;&lt;p&gt;I did quick search on my phone before buying and people were saying that it is possible to set it up via BIOS settings up to 96GB.&lt;/p&gt;</description></item><item><title>Desktop Framework AI assistant part 2</title><link>https://internetexception.com/2026/03/05/desktop-framework-ai-assistant-part-2/</link><pubDate>Thu, 05 Mar 2026 18:59:13 +0100</pubDate><guid>https://internetexception.com/2026/03/05/desktop-framework-ai-assistant-part-2/</guid><description>&lt;p&gt;Today my new NVMe disk arrived. I bought it for my new &lt;a href="https://internetexception.com/2026/03/04/desktop-framework-ai-assistant-part-1/"&gt;Desktop Framework mini PC&lt;/a&gt;&#10; on new AMD APU intended for AI workloads. Certainly &lt;a href="https://internetexception.com/2026/03/01/self-hosting-your-ai-assistant-efficiently/"&gt;it will be better suited&lt;/a&gt;&#10; for running my AI assistant then my daily working PC. Though performance will be a bit worse. But still better than CPU.&lt;/p&gt;&#10;&lt;p&gt;Anyway I decided to split my assistant into 2 parts. The nanobot part will be working on my main server and model (or models) that will be working on Desktop Framework. This way more powerful machine will be running AI assitant UI and operations and LLM capable device will do faster interference - that will be the Framework device. Nanobot communicate with model via OpenAI API anyway so it is not a problem. Maybe a bit of security in terms of HTTPS with some auth would not hurt. Or maybe I will put it in private subnetwork that can&amp;rsquo;t be accessed from outside and only have internet when necessary? Running dockers and all of those python AI firework is not exactly secure but maybe I will deal with that later.&lt;/p&gt;</description></item><item><title>Desktop Framework AI assistant part 1</title><link>https://internetexception.com/2026/03/04/desktop-framework-ai-assistant-part-1/</link><pubDate>Wed, 04 Mar 2026 16:06:41 +0100</pubDate><guid>https://internetexception.com/2026/03/04/desktop-framework-ai-assistant-part-1/</guid><description>&lt;p&gt;I &lt;a href="https://internetexception.com/2026/03/01/self-hosting-your-ai-assistant-efficiently/"&gt;ordered Desktop Framework&lt;/a&gt;&#10; motherboard last week and today it arrived. It was neatly packaged and did not come with anything else then some piece of plastic to mount your own fan on top of the radiator. But I did not need much else. At least for first tests.&lt;/p&gt;&#10;&lt;img src="https://internetexception.com/wp-content/uploads/2026/03/image-10-1024x619.png" class="wp-image-973" /&gt;&#10;&lt;p&gt;I had some PSU laying around that was compatible. I have some old fan that I was able connect to board even if it was a bit to small but would cool it a bit at least.&lt;/p&gt;</description></item><item><title>Working on AI assistant soul</title><link>https://internetexception.com/2026/03/03/working-on-ai-assistant-soul/</link><pubDate>Tue, 03 Mar 2026 22:30:57 +0100</pubDate><guid>https://internetexception.com/2026/03/03/working-on-ai-assistant-soul/</guid><description>&lt;p&gt;&lt;a href="https://internetexception.com/2026/02/26/running-my-own-ai-assistant/"&gt;Recently&lt;/a&gt;&#10; I started playing with &lt;a href="https://github.com/HKUDS/nanobot" target="_blank" rel="noopener noreferrer"&gt;nanobot&lt;/a&gt;&#10;. It is pretty cool tool. I was able to connect it to my own instance of vLLM running Qwen 3. I must say that so far it is great experience. Though it was sometimes annoying.&lt;/p&gt;&#10;&lt;p&gt;What was itching me from the start was abuse of emojis by the bot. I am using emojis from time to time myself, but what was produced by LLM was just excessive. Almost every message was finished by:&lt;/p&gt;</description></item><item><title>How I taught my AI assistant to read websites</title><link>https://internetexception.com/2026/03/03/how-i-taught-my-ai-assistant-to-read-websites/</link><pubDate>Tue, 03 Mar 2026 22:16:00 +0100</pubDate><guid>https://internetexception.com/2026/03/03/how-i-taught-my-ai-assistant-to-read-websites/</guid><description>&lt;p&gt;Main problem with running your own AI assistant is speed. Nanobot is lightweight but main problem it time od the reponses generated by the model. I am running right now Qwen 3 27B parameters. Average reponse varies but it is at least few seconds. If I would have faster GPU than Radeon 7900 XTX than probably it would faster but prices of GPUs are crazy now.&lt;/p&gt;&#10;&lt;p&gt;One of the things I have been testing my little chatbot with was searching for stuff on the internet. For example I like to check prices of some PC parts from time to time. Just out of curiosity and to have a knowledge how crazy it is (NVMe SSDs of 8TB sizes are at least 2x times pricier than last year, on the other hand salary for my profession dropped to 60-70% last 3 years, without inflation, with inflation it would be around 58%). Things are crazy.&lt;/p&gt;</description></item><item><title>Running AI assistant on Threadripper PRO</title><link>https://internetexception.com/2026/03/01/running-ai-assistant-on-threadripper-pro/</link><pubDate>Sun, 01 Mar 2026 13:57:00 +0100</pubDate><guid>https://internetexception.com/2026/03/01/running-ai-assistant-on-threadripper-pro/</guid><description>&lt;p&gt;The answer is: don&amp;rsquo;t do that to yourself.&lt;/p&gt;&#10;&lt;p&gt;Recently I started playing with &lt;a href="https://internetexception.com/2026/02/26/running-my-own-ai-assistant/"&gt;AI assistant using nanobot.&lt;/a&gt;&#10; It is good but so far I am running it on my daily working PC. &lt;a href="https://internetexception.com/2026/02/27/running-llm-on-your-daily-pc-and-why-it-is-not-good/"&gt;And it is not great experience so far&lt;/a&gt;&#10;. So I am exploring some other way that will allow me to do that, especially when I am not at home but still want to use my little helper to do stuff. Running big PC in your office next to your bedroom is not the best idea. And electricity bill would also not be that great.&lt;/p&gt;</description></item><item><title>Self hosting your AI assistant efficiently</title><link>https://internetexception.com/2026/03/01/self-hosting-your-ai-assistant-efficiently/</link><pubDate>Sun, 01 Mar 2026 06:27:00 +0100</pubDate><guid>https://internetexception.com/2026/03/01/self-hosting-your-ai-assistant-efficiently/</guid><description>&lt;p&gt;I wrote previously &lt;a href="https://internetexception.com/2026/02/27/running-llm-on-your-daily-pc-and-why-it-is-not-good/"&gt;why running models that you want to use on your daily driver&lt;/a&gt;&#10; is not great. Basically it is not convenient and it is fine for testing but if you want to run while doing something else it not great experience.&lt;/p&gt;&#10;&lt;p&gt;Of course you can have more powerful device so you will not notice few models running in the background but this is like running a fan with heater under your desk.&lt;/p&gt;</description></item><item><title>I taught my virtual assistant to operate my gate and it feels great</title><link>https://internetexception.com/2026/02/28/i-taught-my-virtual-assistant-to-operate-my-gate-and-it-feels-great/</link><pubDate>Sat, 28 Feb 2026 17:57:00 +0100</pubDate><guid>https://internetexception.com/2026/02/28/i-taught-my-virtual-assistant-to-operate-my-gate-and-it-feels-great/</guid><description>&lt;p&gt;Lately I started playing with an &lt;a href="https://internetexception.com/2026/02/26/running-my-own-ai-assistant/"&gt;LLM operating as my own virtual assistant&lt;/a&gt;&#10; . I was skeptical, I mean I still am skeptical, about this whole &amp;lsquo;AI will take your job&amp;rsquo;, but now I do understand the appeal. You can finally have a computer do your biding in a way you control. Previously computer were complicated beasts. You needed to appeal to it like with threats in form of complicated keystrokes forming more complicated commands evolving in even more complicated programs that may or not do the thing you actually wanted. Or it may be not amused by your plea and swallow your data. You would never know for sure if you would not learn those complex magical incantations in magical schools called Universities which takes years and a lot of money. Or you could hire those magicians, Software Engineers, or even Archmages, that commands magicians, called Software Architects that would be appeasing the capricious spirit of the machine to direct flow of money in a company in a correct way. But this is costly and those spells takes years. So you may hire more magicians, entire houses of magic that will appease, train and teach your pricey machine beasts to do what you need them to do. Those houses are called Software Houses for Enterprise Solutions. And they will force those machines to do what you need them to do. Sometimes they will replace entire herds of machines because previous ones were not cooperative enough. And this is costing you riches beyond riches. If you did not had your weight in gold to buy such service you could buy trained machine to do what you need that were not even at your house but somewhere far beyond the realms of your kingdom, in a place called The Cloud. Or you could buy complex incantation that needed only few keywords in correct place to operate your business - CRM or Accounting System or ERP.&lt;/p&gt;</description></item><item><title>Running LLM on your daily PC and why it is not good</title><link>https://internetexception.com/2026/02/27/running-llm-on-your-daily-pc-and-why-it-is-not-good/</link><pubDate>Fri, 27 Feb 2026 15:11:00 +0100</pubDate><guid>https://internetexception.com/2026/02/27/running-llm-on-your-daily-pc-and-why-it-is-not-good/</guid><description>&lt;p&gt;&lt;a href="https://internetexception.com/2026/02/26/running-my-own-ai-assistant/"&gt;Two days ago&lt;/a&gt;&#10; I started playing a bit with my own AI assistant. It has been very great and funny experience so far but with few wrinkles. For example:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;performance of new models on previous generation GPU (Radeon RX 7900 XTX) is surprisingly good with average of 28t/s but it takes whole VRAM and put a load on PC overall.&lt;/li&gt;&#10;&lt;li&gt;It takes whole lot of disk space. I.e. one vllm docker image to download and extract needs about 18gb; this seems a bit excessive.&lt;/li&gt;&#10;&lt;li&gt;Rocm installation needed a bit like 9gb to install all of its binaries. How much code do you need to produce 9gb of compiled code? This is crazy.&lt;/li&gt;&#10;&lt;li&gt;I have 16c/32t CPU and it seems to be enough for most of my workload but with llm in the background sometimes most of it is in use.&lt;/li&gt;&#10;&lt;li&gt;32gb is not enough, but with current prices I can suffer for now. :)&lt;/li&gt;&#10;&lt;li&gt;If you want to swap models a lot you need a lot of disk space since bigger models takes several gigabytes.&lt;/li&gt;&#10;&lt;li&gt;You need decent internet speed to be able to download it.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Yes you may say that it is fine in 2026, everybody have fiber connection now! Yes but when you want to test something and new docker image is downloading in with 1mb/s speed, you may have a walk in that time.&lt;/p&gt;</description></item><item><title>Connecting Nanobot to Matrix</title><link>https://internetexception.com/2026/02/27/connecting-nanobot-to-matrix/</link><pubDate>Fri, 27 Feb 2026 12:19:00 +0100</pubDate><guid>https://internetexception.com/2026/02/27/connecting-nanobot-to-matrix/</guid><description>&lt;p&gt;I started digging into &lt;a href="https://github.com/HKUDS/nanobot/" target="_blank" rel="noopener noreferrer"&gt;Nanobot code&lt;/a&gt;&#10; to check why it cannot connect to Matrix server despite the config being correct and &lt;code&gt;nanobot gateway&lt;/code&gt; being executed. Just in case I messed up something I did recreate entire nanobot workspace by doing &lt;code&gt;nanobot onboard&lt;/code&gt; after removing entire directory. Did not work.&lt;/p&gt;&#10;&lt;p&gt;Closer inspection of the code shed some light on the problem: the config was not being used because channel was never instantiated. That part of the code was gone for some reason despite the Readme stating it is possible to integrate nanobot with Matrix.&lt;/p&gt;</description></item><item><title>Adding the bot to Matrix server</title><link>https://internetexception.com/2026/02/26/adding-the-bot-to-matrix-server/</link><pubDate>Thu, 26 Feb 2026 15:04:00 +0100</pubDate><guid>https://internetexception.com/2026/02/26/adding-the-bot-to-matrix-server/</guid><description>&lt;p&gt;I have my own matrix server for my own use. Usually it is used by me a bit by my family and most of it by my own services to sent me some notifications.&lt;/p&gt;&#10;&lt;p&gt;Lately &lt;a href="https://internetexception.com/2026/02/26/running-my-own-ai-assistant/"&gt;I started playing with nanobot.&lt;/a&gt;&#10; It is personal AI assistant like OpenClaw. I wanted to be able to chat with it in my own Matrix via my own phone. To do that I needed to create new user dedicated&lt;/p&gt;</description></item><item><title>Running my own AI assistant.</title><link>https://internetexception.com/2026/02/26/running-my-own-ai-assistant/</link><pubDate>Thu, 26 Feb 2026 10:32:00 +0100</pubDate><guid>https://internetexception.com/2026/02/26/running-my-own-ai-assistant/</guid><description>&lt;p&gt;I recently started experimenting with my own AI asisstant. I decided to skip on OpenClaw for being massive slop of 400k LOC of vibe coded monstrosity. Looking trough web I found that there is also NanoClaw which seems much better but looks like it is tied to Anthropic service and I like owning my own data and I self host what I can.&lt;/p&gt;&#10;&lt;p&gt;That left me with &lt;a href="https://github.com/HKUDS/nanobot" data-type="link" data-id="https://github.com/HKUDS/nanobot"&gt;Nanobot&lt;/a&gt; being my only option from bigger open source projects that are (relatively) known, are under active development and have big user base.&lt;/p&gt;</description></item><item><title>Moving /boot partition</title><link>https://internetexception.com/2026/02/18/moving-boot-partition/</link><pubDate>Wed, 18 Feb 2026 11:55:26 +0100</pubDate><guid>https://internetexception.com/2026/02/18/moving-boot-partition/</guid><description>&lt;p&gt;For a while I had a problem with my boot partition being too small. It was fine for one kernel image but not for two. So whenever kernel was updated it was failing because of lack of space. Five years ago 500MB was enough but not nowadays.&lt;/p&gt;&#10;&lt;p&gt;Today I decided to finally fix that.&lt;/p&gt;&#10;&lt;p&gt;First, I did created new LVM volume for /boot:&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;sudo lvcreate -L 1G -n boot root-vg&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Purging smtp services from Debian</title><link>https://internetexception.com/2026/02/18/purging-smtp-services-from-debian/</link><pubDate>Wed, 18 Feb 2026 10:45:50 +0100</pubDate><guid>https://internetexception.com/2026/02/18/purging-smtp-services-from-debian/</guid><description>&lt;p&gt;Lately I purchased mew dedicated server with intention to use it as my new running mail email server - &lt;a href="https://mailcow.email/" data-type="link" data-id="https://mailcow.email/"&gt;mailcow&lt;/a&gt;, my blog, and some other services. When I was migrating mailcow suite everything was fine except postfix image failed to start.&lt;/p&gt;&#10;&lt;p&gt;I had problem like that already on Debian and usually I was dealing with that by disabling exim:&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;sudo systemctl disable exim.service&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;This was fine till major Debian update that was reinstalling exim and causing it to steal port 25 again. So this time I decided to uinstall it completely.&lt;/p&gt;</description></item><item><title>Enhancing your .NET API with query language</title><link>https://internetexception.com/2025/10/30/enhancing-your-net-api-with-query-language/</link><pubDate>Thu, 30 Oct 2025 21:14:03 +0100</pubDate><guid>https://internetexception.com/2025/10/30/enhancing-your-net-api-with-query-language/</guid><description>&lt;p&gt;What is query language? SQL is Structured Query Language and you use it to query your database for data you are interested in. It does not have to do anything with your API. If you ever were working with big XML files you probably used XQuery or XPath, query languages designed to XML for data. There are specialized languages that are designed to work with APIs to query &lt;strong&gt;them&lt;/strong&gt; for data. For example, you probably heard about GraphQL or even used it when you were working with some API.&lt;/p&gt;</description></item><item><title>HLinq design</title><link>https://internetexception.com/2025/10/28/hlinq-design/</link><pubDate>Tue, 28 Oct 2025 21:14:55 +0100</pubDate><guid>https://internetexception.com/2025/10/28/hlinq-design/</guid><description>&lt;h2 id="a-bit-of-history"&gt;A bit of history&lt;/h2&gt;&#10;&lt;p&gt;I remember the day when I started writing the HLinq query language. It was weekend and I was experimenting with writing Single endpoints for &lt;a href="https://internetexception.com/2013/02/07/why-i-dont-like-python-anymore/" data-type="post" data-id="228"&gt;Hamster Wheel.&lt;/a&gt; Single endpoints were almost done and next step was to write List endpoint. This would allow to get list of records of specific type. After I got single GET returns correct data for chosen record id, list should not be hard to implement. Then just create, update and delete. Basic CRUD API in Hamster Wheel would be finished. I was thrilled that I actually was able to do such thing.&lt;/p&gt;</description></item><item><title>Disable Xunit Test on specific OS</title><link>https://internetexception.com/2025/10/04/disable-xunit-test-on-specific-os/</link><pubDate>Sat, 04 Oct 2025 22:51:15 +0200</pubDate><guid>https://internetexception.com/2025/10/04/disable-xunit-test-on-specific-os/</guid><description>&lt;p&gt;Lately I was having a problem with some of my tests causing problems for other developers on the project I am working on. They were using Windows for their development while I am using Debian for my work. The application that was being tested was not designed for non Unix system - now rarely anybody is hosting they production code on Windows Server - everybody is using Unix for .net.&lt;/p&gt;</description></item><item><title>Writing a simple C# source code generator with Fluent API</title><link>https://internetexception.com/2025/10/02/writing-simple-c-source-code-generator/</link><pubDate>Thu, 02 Oct 2025 16:05:39 +0200</pubDate><guid>https://internetexception.com/2025/10/02/writing-simple-c-source-code-generator/</guid><description>&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;&#10;&lt;p&gt;Usually in .NET world when you want to write generic code you use generic method or classes. But sometimes it is still not enough when you want to automate some things. I.e. you want to dynamically register in &lt;a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-9.0" target="_blank" rel="noopener noreferrer"&gt;DI&lt;/a&gt;&#10; all the classes that implements some interface. Probably, in this case, you would do something like that:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;implementations&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MyClass&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;Assembly&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Types&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GetInterfaces&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IMyInterface&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;foreach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;implementation&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;implementations&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddScoped&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;IMyInterface&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;implementation&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And it would be completely fine. Even if Reflection is pretty slow, your application would not be getting significantly slower because of that. Certainly you would not notice the slow down.&lt;/p&gt;</description></item><item><title>HamsterWheel.FluentCodeGenerators is out</title><link>https://internetexception.com/2025/10/01/hamsterwheel-fluentcodegenerators-is-out/</link><pubDate>Wed, 01 Oct 2025 16:58:21 +0200</pubDate><guid>https://internetexception.com/2025/10/01/hamsterwheel-fluentcodegenerators-is-out/</guid><description>&lt;p&gt;I released today first new Nuget package connected to my new project that I am working on for sometime: dynamically configurable, zero-downtime API, with low-code flows to write small pieces of logic - &lt;a href="https://internetexception.com/why-hamster-wheel/" data-type="page" data-id="666"&gt;Hamster Wheel&lt;/a&gt;.&lt;br&gt;&#10;&lt;br&gt;&#10;System heavily relies on dynamic source code generation. For that I wrote&lt;br&gt;&#10;&lt;a href="https://www.nuget.org/packages/HamsterWheel.FluentCodeGenerators" target="_blank" rel="noopener noreferrer"&gt;https://www.nuget.org/packages/HamsterWheel.FluentCodeGenerators&lt;/a&gt;&#10; and &lt;a href="https://www.nuget.org/packages/HamsterWheel.FluentCodeGenerators.Abstractions" target="_blank" rel="noopener noreferrer"&gt;https://www.nuget.org/packages/HamsterWheel.FluentCodeGenerators.Abstractions&lt;/a&gt;&#10;&lt;br&gt;&#10;small package that helps with writing C# incremental source code generators for Roslyn compiler.&lt;br&gt;&#10;&lt;br&gt;&#10;Original Roslyn APIs are a bit hard to use so this package helps with that. Also it helps with:&lt;br&gt;&#10;\&lt;/p&gt;</description></item><item><title>Convert LVM logical volume Raid 10 to Raid 5</title><link>https://internetexception.com/2025/09/11/convert-lvm-logical-volume-raid-10-to-raid-5/</link><pubDate>Thu, 11 Sep 2025 09:28:48 +0200</pubDate><guid>https://internetexception.com/2025/09/11/convert-lvm-logical-volume-raid-10-to-raid-5/</guid><description>&lt;p&gt;Two weeks ago I was running out of space on my main raid matrix on my server. Server was configured and assembled few years back, and at that time I had about 700GB of data there so having RAID 10 of 4 1TB disks (that account for about 1,7TB of actual space for data) was enough. Especially when you count in a price of 2TB (or 4TB) NVME M2 disk back then.&lt;/p&gt;</description></item><item><title>No Display Manager in Debian Trixie</title><link>https://internetexception.com/2025/05/15/no-display-manager-in-debian-trixie/</link><pubDate>Thu, 15 May 2025 10:47:46 +0200</pubDate><guid>https://internetexception.com/2025/05/15/no-display-manager-in-debian-trixie/</guid><description>&lt;p&gt;Lately I decided to try &lt;a href="https://www.redhat.com/en/blog/quadlet-podman" data-type="link" data-id="https://www.redhat.com/en/blog/quadlet-podman"&gt;Podman Quadlets&lt;/a&gt;. It seemed to be really interesting way to achieve similar results as with &lt;code&gt;Docker&lt;/code&gt; and &lt;code&gt;Compose&lt;/code&gt;, but it have nicer integration with the system (i.e. ability to see container in &lt;a href="https://cockpit-project.org/" data-type="link" data-id="https://cockpit-project.org/"&gt;Cockpit&lt;/a&gt; along with other &lt;code&gt;systemd&lt;/code&gt; services, or triggering container by socket, so less frequently used containers won&amp;rsquo;t be running all the time).&lt;/p&gt;&#10;&lt;p&gt;Everything went fine except for unavailability of &lt;code&gt;buildah&lt;/code&gt; package in Debian stable apt channel (or the version that were needed for &lt;code&gt;podman&lt;/code&gt; at least). Quick search on the internet and I found the answer is to reference this specific package from the &lt;code&gt;testing&lt;/code&gt; channel of apt.&lt;/p&gt;</description></item><item><title>Monitoring vs Observability</title><link>https://internetexception.com/2025/02/20/monitoring-vs-observability/</link><pubDate>Thu, 20 Feb 2025 09:25:14 +0100</pubDate><guid>https://internetexception.com/2025/02/20/monitoring-vs-observability/</guid><description>&lt;p&gt;What is the difference between monitoring and observability?&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Monitoring&lt;/strong&gt; is process of collecting live events from your application, traces, debug messages, warnings and exceptions. The same process may involve sending those events to some storage or application that analyze or visualize those messages. I.e. in asp.net core applications monitoring of application involves calling a &lt;code&gt;ILogger&lt;/code&gt; and sending those logs or critical exceptions to AppInsights. &lt;strong&gt;Monitoring&lt;/strong&gt; may also involve activity of development team members to active watch those logged messages for any potential errors or problems that may impact availability of production environment.&lt;/p&gt;</description></item><item><title>Solid</title><link>https://internetexception.com/2022/10/26/solid/</link><pubDate>Wed, 26 Oct 2022 14:14:41 +0200</pubDate><guid>https://internetexception.com/2022/10/26/solid/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;The single-responsibility principle - piece of software should have only one responsibility&lt;/li&gt;&#10;&lt;li&gt;The open–closed principle - things should be open for extension but closed for modification&lt;/li&gt;&#10;&lt;li&gt;The Liskov substitution principle - changing interface implementation should not brake software&lt;/li&gt;&#10;&lt;li&gt;The interface segregation principle - it is better to have more specialized interfaces than single big one&lt;/li&gt;&#10;&lt;li&gt;The dependency inversion principle - dependencies should be abstracted via interfaces&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/SOLID" target="_blank" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/SOLID&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>.NET/C# interview questions</title><link>https://internetexception.com/2022/10/26/net-c-interview-questions/</link><pubDate>Wed, 26 Oct 2022 10:21:52 +0200</pubDate><guid>https://internetexception.com/2022/10/26/net-c-interview-questions/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="https://internetexception.com/2022/10/18/idisposable-interface-pattern/" data-type="URL" data-id="/2022/10/18/idisposable-interface-pattern/"&gt;&lt;code&gt;IDisposable&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/18/supressfinalize-in-idisposable-interface/" data-type="URL" data-id="/2022/10/18/supressfinalize-in-idisposable-interface/"&gt;&lt;code&gt;SupressFinalize&lt;/code&gt; in &lt;code&gt;IDisposable&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="https://internetexception.com/2022/10/19/asynchronous-programming-in-net/" data-type="URL" data-id="/2022/10/19/asynchronous-programming-in-net/"&gt;Asynchronous programming in .NET&lt;/a&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/async-await-in-c/" data-type="post" data-id="491"&gt;&lt;code&gt;async&lt;/code&gt;/&lt;code&gt;await&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;!-- --&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/avoid-deadlock-with-asynchronous-methods/"&gt;Avoid deadlock with &lt;code&gt;async&lt;/code&gt;/&lt;code&gt;await&lt;/code&gt;&lt;/a&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="http://2022/10/19/does-async-await-creates-new-thread/" target="_blank" rel="noopener noreferrer"&gt;Does &lt;code&gt;async&lt;/code&gt;/&lt;code&gt;await&lt;/code&gt; creates new thread?&lt;/a&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/cpu-bound-vs-i-o-bound/"&gt;CPU bound vs I/O bound tasks&lt;/a&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/what-is-synchronizationcontext-in-net/"&gt;SynchronizationContext&lt;/a&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/thread-vs-task-in-net/"&gt;Threads/tasks&lt;/a&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/locking-in-net/" data-type="URL" data-id="/2022/10/19/locking-in-net/"&gt;locking in .NET&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/locking-with-integer/" data-type="post" data-id="513"&gt;locking with integer&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/task-parallel-library-tpl/" data-type="URL" data-id="/2022/10/19/task-parallel-library-tpl/"&gt;TPL&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/threadpool/" data-type="URL" data-id="/2022/10/19/threadpool/"&gt;ThreadPool&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="https://internetexception.com/2022/10/19/net-type-system/" data-type="URL" data-id="/2022/10/19/net-type-system/"&gt;Type system&lt;/a&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/reference-types-vs-value-types/" data-type="URL" data-id="/2022/10/19/reference-types-vs-value-types/"&gt;Reference types vs value types&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/value-types-as-fields-in-objects/" data-type="URL" data-id="/2022/10/19/value-types-as-fields-in-objects/"&gt;value types as fields in objects&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;!-- --&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/what-type-can-not-be-object-field/"&gt;What kind of types cannot be object field?&lt;/a&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/ref-struct-types/" data-type="URL" data-id="/2022/10/19/ref-struct-types/"&gt;&lt;code&gt;ref struct&lt;/code&gt; types&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/strings-in-net/" data-type="post" data-id="535"&gt;Strings in .NET&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/data-structures-in-net/" data-type="post" data-id="537"&gt;Data Structures&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/net-generics/" data-type="URL" data-id="/2022/10/19/net-generics/"&gt;Generics&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/19/covariance-and-contravariance/" data-type="post" data-id="541"&gt;Covariance and Contravariance&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/25/equals-and-gethashcode/" data-type="post" data-id="587"&gt;Equals and GetHashCode&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="https://internetexception.com/2022/10/19/garbage-collector/" data-type="post" data-id="545"&gt;Garbage Collector&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Equals and GetHashCode</title><link>https://internetexception.com/2022/10/25/equals-and-gethashcode/</link><pubDate>Tue, 25 Oct 2022 16:36:49 +0200</pubDate><guid>https://internetexception.com/2022/10/25/equals-and-gethashcode/</guid><description>&lt;p&gt;Custom implementation is usually only necessary if default, reference equality is not enough. In example:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;entities value based equality&lt;/li&gt;&#10;&lt;li&gt;value equality of deserialized objects&lt;/li&gt;&#10;&lt;li&gt;custom comparisons based on other criterias&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ImaginaryNumber&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;IEquatable&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ImaginaryNumber&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;RealNumber&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;ImaginaryUnit&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;override&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;Equals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;object&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Equals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;ImaginaryNumber&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;Equals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ImaginaryNumber&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="p"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;RealNumber&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;RealNumber&lt;/span&gt; &lt;span class="p"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;ImaginaryUnit&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ImaginaryUnit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;override&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;GetHashCode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;HashCode&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Combine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;RealNumber&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ImaginaryUnit&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Difference between Controller and ControllerBase</title><link>https://internetexception.com/2022/10/25/difference-between-controller-and-controllerbase/</link><pubDate>Tue, 25 Oct 2022 16:28:23 +0200</pubDate><guid>https://internetexception.com/2022/10/25/difference-between-controller-and-controllerbase/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;Controller&lt;/code&gt; type inherits from &lt;code&gt;ControllerBase&lt;/code&gt; and have Views support&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;ControllerBase&lt;/code&gt; type is better suited for APIs&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/aspnet/core/web-api/?view=aspnetcore-6.0" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/aspnet/core/web-api/?view=aspnetcore-6.0&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>Kestrel</title><link>https://internetexception.com/2022/10/25/kestrel/</link><pubDate>Tue, 25 Oct 2022 15:56:40 +0200</pubDate><guid>https://internetexception.com/2022/10/25/kestrel/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;default application server for .net&lt;/li&gt;&#10;&lt;li&gt;cross platform&lt;/li&gt;&#10;&lt;li&gt;best performance and memory utilization&lt;/li&gt;&#10;&lt;li&gt;may not have some advanced features of HTTP.sys on Windows&lt;/li&gt;&#10;&lt;li&gt;may be used with proxy server or as internet facing server&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel?view=aspnetcore-6.0" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel?view=aspnetcore-6.0&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>ASP.NET Core controller level exception handling</title><link>https://internetexception.com/2022/10/25/asp-net-core-controller-level-exception-handling/</link><pubDate>Tue, 25 Oct 2022 15:53:52 +0200</pubDate><guid>https://internetexception.com/2022/10/25/asp-net-core-controller-level-exception-handling/</guid><description>&lt;p&gt;To handle exceptions on Controller/Action level Exception Filters are used.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;[TypeFilter(typeof(SampleExceptionFilter))]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ExceptionController&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Controller&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Exception Filters are implemented using &lt;code&gt;IExceptionFilter&lt;/code&gt; with &lt;code&gt;OnExcetion&lt;/code&gt; method override to handle exceptions.&lt;/p&gt;&#10;&lt;p&gt;Exception Filters can be applied to Controller and Action level.&lt;/p&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/filters?view=aspnetcore-7.0#exception-filters" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/filters?view=aspnetcore-7.0#exception-filters&lt;/a&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.filters.iexceptionfilter?view=aspnetcore-7.0" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.filters.iexceptionfilter?view=aspnetcore-7.0&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>ASP.NET Core global exception handling</title><link>https://internetexception.com/2022/10/25/asp-net-core-global-exception-handling/</link><pubDate>Tue, 25 Oct 2022 15:49:53 +0200</pubDate><guid>https://internetexception.com/2022/10/25/asp-net-core-global-exception-handling/</guid><description>&lt;p&gt;To add global exception handling in ASP.NET Core just use configuration method:&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;app.UseExceptionHandler&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/error-handling?view=aspnetcore-6.0#exception-handler-lambda" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/aspnet/core/fundamentals/error-handling?view=aspnetcore-6.0#exception-handler-lambda&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>What ASP.NET Middleware can do?</title><link>https://internetexception.com/2022/10/25/what-asp-net-middleware-can-do/</link><pubDate>Tue, 25 Oct 2022 15:45:12 +0200</pubDate><guid>https://internetexception.com/2022/10/25/what-asp-net-middleware-can-do/</guid><description>&lt;p&gt;Pretty much everything. Default ASP.NET Core request handling pipeline is consisting of bunch of middlewares:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/aspnet/core/security/authentication/identity?view=aspnetcore-6.0" target="_blank" rel="noopener noreferrer"&gt;Authentication&lt;/a&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.authorizationappbuilderextensions.useauthorization" target="_blank" rel="noopener noreferrer"&gt;Authorization&lt;/a&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-6.0" target="_blank" rel="noopener noreferrer"&gt;CORS&lt;/a&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/http-logging/?view=aspnetcore-6.0" target="_blank" rel="noopener noreferrer"&gt;HTTP Logging&lt;/a&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/aspnet/core/mvc/overview?view=aspnetcore-6.0" target="_blank" rel="noopener noreferrer"&gt;MVC&lt;/a&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-6.0" target="_blank" rel="noopener noreferrer"&gt;Static Files&lt;/a&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;other&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Whole list of built-in middlewares can be found here:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-7.0#built-in-middleware" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-7.0#built-in-middleware&lt;/a&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There is possibility to write custom middleware too.&lt;/p&gt;</description></item><item><title>Middleware in OWIN</title><link>https://internetexception.com/2022/10/25/middleware-in-owin/</link><pubDate>Tue, 25 Oct 2022 15:40:45 +0200</pubDate><guid>https://internetexception.com/2022/10/25/middleware-in-owin/</guid><description>&lt;p&gt;There are 2 ways of writing OWIN middleware in ASP.NET Core.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Pure OWIN - usefull if you want to integrate with OWIN compatible module but not written in C#&lt;/li&gt;&#10;&lt;li&gt;ASP.NET Core OWIN middleware&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="aspnet-core-middleware"&gt;ASP.NET Core Middleware:&lt;/h2&gt;&#10;&lt;p&gt;This type of middleware can be:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;delegate of &lt;code&gt;Func&amp;lt;HttpContext, Func&amp;lt;&lt;/code&gt;Task&amp;gt;&lt;code&gt;, Task&amp;gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;class with &lt;a href="https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.imiddleware?view=aspnetcore-7.0" data-type="URL" data-id="https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.imiddleware?view=aspnetcore-7.0"&gt;&lt;code&gt;IMiddleware&lt;/code&gt;&lt;/a&gt; imlementation&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// Do work that can write to the Response.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Invoke&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// Do logging or other work that doesn&amp;#39;t write to the Response.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;});&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="pure-owin-middleware"&gt;Pure OWIN Middleware:&lt;/h2&gt;&#10;&lt;p&gt;This rather would be used to integrate with OWIN middlewares written in different language, so that ASP.NET Core implementation directly is not possible.&lt;/p&gt;</description></item><item><title>Owin model and Kestrell request handling</title><link>https://internetexception.com/2022/10/24/owin-model-and-kestrell-request-handling/</link><pubDate>Mon, 24 Oct 2022 15:23:02 +0200</pubDate><guid>https://internetexception.com/2022/10/24/owin-model-and-kestrell-request-handling/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;OWIN&lt;/strong&gt; - Open Web Interface for .NET&lt;/li&gt;&#10;&lt;li&gt;allows web apps to be decoupled from web servers&lt;/li&gt;&#10;&lt;li&gt;defines standard way for middleware to be used in a pipeline to handle requests and provide responses&lt;/li&gt;&#10;&lt;li&gt;ASP.NET Core applications can interoperate with OWIN-based applications, servers and middleware&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Microsoft.AspNetCore.Owin package provides two adapter implementations:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;ASP.NET Core to OWIN&lt;/li&gt;&#10;&lt;li&gt;OWIN to ASP.NET Core&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;This allows ASP.NET Core to be hosted on top of an OWIN compatible server/host or for other OWIN compatible components to be run on top of ASP.NET Core.&lt;/p&gt;</description></item><item><title>Expression Trees</title><link>https://internetexception.com/2022/10/24/expression-trees/</link><pubDate>Mon, 24 Oct 2022 15:08:43 +0200</pubDate><guid>https://internetexception.com/2022/10/24/expression-trees/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;&amp;rsquo;tree like&amp;rsquo; data structure&lt;/li&gt;&#10;&lt;li&gt;each node is expression (method call, equality comparison, binary operation etc.) representing a piece of code&lt;/li&gt;&#10;&lt;li&gt;you can compile expression tree and run code it represent&lt;/li&gt;&#10;&lt;li&gt;enables dynamic code generation at runtime&lt;/li&gt;&#10;&lt;li&gt;LINQ queries on DBs are implemented with Expression Trees&lt;/li&gt;&#10;&lt;li&gt;used in the dynamic language runtime (DLR)&lt;/li&gt;&#10;&lt;li&gt;anonymous lambda expression can be converted to &lt;code&gt;ExpressionTree&lt;/code&gt; via compiler (i.e. &lt;code&gt;x =&amp;gt; x*2&lt;/code&gt; can be represented as tree instead of delegate or anonymous lambda function)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;</description></item><item><title>Linq</title><link>https://internetexception.com/2022/10/24/linq/</link><pubDate>Mon, 24 Oct 2022 15:05:47 +0200</pubDate><guid>https://internetexception.com/2022/10/24/linq/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;consistent model for working with data from various kinds of sources and formats (XML, SQL, ADO.NET, Datasets, .NET collections etc)&lt;/li&gt;&#10;&lt;li&gt;3 stages of working with LINQ:&#10;&lt;ul&gt;&#10;&lt;li&gt;obtain data source&lt;/li&gt;&#10;&lt;li&gt;create the query&lt;/li&gt;&#10;&lt;li&gt;execute the query&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;data sources implements &lt;code&gt;IEnumerable&amp;lt;&amp;gt;&lt;/code&gt; and are called &lt;code&gt;queryable types&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;IQueryable&amp;lt;&amp;gt;&lt;/code&gt; interface inherits from &lt;code&gt;IEnumerable&amp;lt;&amp;gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;generally it is better to use LINQ via &lt;code&gt;IQueryable&amp;lt;&amp;gt;&lt;/code&gt; which produces &lt;code&gt;deferred query&lt;/code&gt; instead of producing result immediately&lt;/li&gt;&#10;&lt;li&gt;queries can be executed multiple times&lt;/li&gt;&#10;&lt;li&gt;queries can be forced immediate execution via &lt;code&gt;Count()&lt;/code&gt;, &lt;code&gt;Max()&lt;/code&gt;, &lt;code&gt;ToList()&lt;/code&gt; or &lt;code&gt;ToArray()&lt;/code&gt; etc.&lt;/li&gt;&#10;&lt;li&gt;LINQ to DB libraries (like EntityFramework) usually are implemented via &lt;code&gt;Expression Trees&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>Entity Framework: Change Tracking</title><link>https://internetexception.com/2022/10/24/entity-framework-change-tracking/</link><pubDate>Mon, 24 Oct 2022 15:02:09 +0200</pubDate><guid>https://internetexception.com/2022/10/24/entity-framework-change-tracking/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;tracked entities are saved during &lt;code&gt;SaveChanges()&lt;/code&gt; call&lt;/li&gt;&#10;&lt;li&gt;entities being tracked when they are:&#10;&lt;ul&gt;&#10;&lt;li&gt;returned from DB&lt;/li&gt;&#10;&lt;li&gt;attached to context&lt;/li&gt;&#10;&lt;li&gt;added as subentity&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;tracking can be disabled (&lt;code&gt;AsNoTracking()&lt;/code&gt; i.e.)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/ef/core/change-tracking/" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/ef/core/change-tracking/&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>Entity Framework: eager and lazy loading</title><link>https://internetexception.com/2022/10/24/entity-framework-eager-and-lazy-loading/</link><pubDate>Mon, 24 Oct 2022 14:57:56 +0200</pubDate><guid>https://internetexception.com/2022/10/24/entity-framework-eager-and-lazy-loading/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;lazy loading:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;delaying load of data until we specifically request for it&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;!-- --&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;i.e. accessing &lt;code&gt;customer.Address&lt;/code&gt; loads Address of a customer in the background via separate SQL query&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;!-- --&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;property needs to be public, virtual&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;!-- --&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;context.Configuration.ProxyCreationEnabled should be true&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;!-- --&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;context.Configuration.LazyLoadingEnabled should be true&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;!-- --&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;to disable lazy loading completely &lt;code&gt;Context.Configuration.LazyLoadingEnabled = false;&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;eager loading&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;opposite of lazy loading&lt;/li&gt;&#10;&lt;li&gt;loads related entities as part of the query&lt;/li&gt;&#10;&lt;li&gt;done via &lt;code&gt;.Include()&lt;/code&gt; query&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;</description></item><item><title>Pattern matching</title><link>https://internetexception.com/2022/10/24/pattern-matching/</link><pubDate>Mon, 24 Oct 2022 14:50:08 +0200</pubDate><guid>https://internetexception.com/2022/10/24/pattern-matching/</guid><description>&lt;p&gt;Pattern matching is used for:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;testing expression to check if some value have certain characteristics&lt;/li&gt;&#10;&lt;li&gt;safer compare because &amp;lsquo;==&amp;rsquo; and &amp;lsquo;!=&amp;rsquo; can be overloaded&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Examples:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sequence&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="n"&gt;IList&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;list&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;switch statement:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;command&lt;/span&gt; &lt;span class="k"&gt;switch&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Operation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SystemTest&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;RunDiagnostics&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Operation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Start&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;StartSystem&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Operation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Stop&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;StopSystem&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Operation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Reset&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ResetToReady&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;ArgumentException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Invalid enum value for command&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nameof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;};&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;switch with ranges:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;tempInFahrenheit&lt;/span&gt; &lt;span class="k"&gt;switch&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;(&amp;gt;&lt;/span&gt; &lt;span class="m"&gt;32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&amp;lt;&lt;/span&gt; &lt;span class="m"&gt;212&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;liquid&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="m"&gt;32&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;solid&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="m"&gt;212&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;gas&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="m"&gt;32&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;solid/liquid transition&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="m"&gt;212&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;liquid / gas transition&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;};&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;collection pattern matching:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;array&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="m"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;..]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/functional/pattern-matching" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/functional/pattern-matching&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>Reflection</title><link>https://internetexception.com/2022/10/19/reflection/</link><pubDate>Wed, 19 Oct 2022 16:44:33 +0200</pubDate><guid>https://internetexception.com/2022/10/19/reflection/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;obtain information about types and members at runtime&lt;/li&gt;&#10;&lt;li&gt;create instances, invoke or access them&lt;/li&gt;&#10;&lt;li&gt;dynamic code generation&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/framework/reflection-and-codedom/reflection" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/framework/reflection-and-codedom/reflection&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>Deployment models</title><link>https://internetexception.com/2022/10/19/deployment-models/</link><pubDate>Wed, 19 Oct 2022 16:42:01 +0200</pubDate><guid>https://internetexception.com/2022/10/19/deployment-models/</guid><description>&lt;table&gt;&#10;&lt;thead&gt;&#10;&lt;tr&gt;&#10;&lt;th&gt;Type&lt;/th&gt;&#10;&lt;th&gt;Command&lt;/th&gt;&#10;&lt;/tr&gt;&#10;&lt;/thead&gt;&#10;&lt;tbody&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-framework-dependent"&gt;framework-dependent executable&lt;/a&gt; for the current platform.&lt;/td&gt;&#10;&lt;td&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish"&gt;&lt;code&gt;dotnet publish&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-framework-dependent"&gt;framework-dependent executable&lt;/a&gt; for a specific platform.&lt;/td&gt;&#10;&lt;td&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish"&gt;&lt;code&gt;dotnet publish -r &amp;lt;RID&amp;gt; --self-contained false&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-framework-dependent"&gt;framework-dependent binary&lt;/a&gt;.&lt;/td&gt;&#10;&lt;td&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish"&gt;&lt;code&gt;dotnet publish&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-self-contained"&gt;self-contained executable&lt;/a&gt;.&lt;/td&gt;&#10;&lt;td&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish"&gt;&lt;code&gt;dotnet publish -r &amp;lt;RID&amp;gt;&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-framework-dependent" data-type="URL" data-id="https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-framework-dependent"&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-framework-dependent" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-framework-dependent&lt;/a&gt;&#10;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>.NET AOT</title><link>https://internetexception.com/2022/10/19/net-aot/</link><pubDate>Wed, 19 Oct 2022 16:39:08 +0200</pubDate><guid>https://internetexception.com/2022/10/19/net-aot/</guid><description>&lt;p&gt;&lt;strong&gt;Ahead of the time&lt;/strong&gt; compilation to machine code&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;produces self-contained application which:&#10;&lt;ul&gt;&#10;&lt;li&gt;starts quicker&lt;/li&gt;&#10;&lt;li&gt;uses less memory&lt;/li&gt;&#10;&lt;li&gt;does not require .NET runtime installed&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;it is better for workloads with high deployment instances (clouds)&lt;/li&gt;&#10;&lt;li&gt;makes runtime code generation impossible&lt;/li&gt;&#10;&lt;li&gt;not all libraries are compatible&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>.NET Jit</title><link>https://internetexception.com/2022/10/19/net-jit/</link><pubDate>Wed, 19 Oct 2022 16:36:28 +0200</pubDate><guid>https://internetexception.com/2022/10/19/net-jit/</guid><description>&lt;p&gt;&lt;strong&gt;Just - in - time&lt;/strong&gt; compiler.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;part of CLR&lt;/li&gt;&#10;&lt;li&gt;for all .net programs for all .net languages&lt;/li&gt;&#10;&lt;li&gt;converts &lt;strong&gt;MSIL&lt;/strong&gt; to native machine code&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;compiles&lt;/strong&gt; code when it is necessary at &lt;strong&gt;runtime&lt;/strong&gt;&lt;/li&gt;&#10;&lt;li&gt;also it is possible to &lt;strong&gt;pre-compile to native code&lt;/strong&gt; at compile time instead&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://www.geeksforgeeks.org/what-is-just-in-time-jit-compiler-in-dot-net/" target="_blank" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/what-is-just-in-time-jit-compiler-in-dot-net/&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>Records</title><link>https://internetexception.com/2022/10/19/records/</link><pubDate>Wed, 19 Oct 2022 16:33:51 +0200</pubDate><guid>https://internetexception.com/2022/10/19/records/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;can be class or struct&lt;/li&gt;&#10;&lt;li&gt;creates methods overrides for enforcing value equality instead of reference equality:&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;Object.Equals&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;Object.GetHashCode&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;operators&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;==&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;!=&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;implements &lt;code&gt;IEquatable&amp;lt;&amp;gt;&lt;/code&gt; parameter&lt;/li&gt;&#10;&lt;li&gt;implements &lt;code&gt;ToString&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;supports deconstruction&lt;/li&gt;&#10;&lt;li&gt;supports &lt;code&gt;with&lt;/code&gt; expression&lt;/li&gt;&#10;&lt;li&gt;meant to be &lt;strong&gt;immutable&lt;/strong&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;&lt;code&gt;Positional records&lt;/code&gt; is a more concise syntax for record:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;primary constructor parameters match the positional parameters of the record declaration&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;public&lt;/strong&gt; &lt;strong&gt;init-only&lt;/strong&gt; properties for each parameter&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/tutorials/records#characteristics-of-records" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/tutorials/records#characteristics-of-records&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>Is it possible to block GC?</title><link>https://internetexception.com/2022/10/19/is-it-possible-to-block-gc/</link><pubDate>Wed, 19 Oct 2022 16:28:54 +0200</pubDate><guid>https://internetexception.com/2022/10/19/is-it-possible-to-block-gc/</guid><description>&lt;p&gt;We can.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;for some critical part of application code using &lt;code&gt;GC.TryStartNoGCRegion&lt;/code&gt; method.&lt;/li&gt;&#10;&lt;li&gt;using &lt;code&gt;CER&lt;/code&gt; (Constrained Execution Regions) (obsolete)&lt;/li&gt;&#10;&lt;li&gt;with &lt;code&gt;GC LatencyModes&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/api/system.gc.trystartnogcregion?redirectedfrom=MSDN&amp;amp;view=net-7.0#overloads" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/api/system.gc.trystartnogcregion?redirectedfrom=MSDN&amp;view=net-7.0#overloads&lt;/a&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/framework/performance/constrained-execution-regions?redirectedfrom=MSDN" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/framework/performance/constrained-execution-regions?redirectedfrom=MSDN&lt;/a&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/latency" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/latency&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>Garbage Collector</title><link>https://internetexception.com/2022/10/19/garbage-collector/</link><pubDate>Wed, 19 Oct 2022 16:26:09 +0200</pubDate><guid>https://internetexception.com/2022/10/19/garbage-collector/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;automatic memory management&lt;/li&gt;&#10;&lt;li&gt;allocates and releases memory&lt;/li&gt;&#10;&lt;li&gt;prevents memory leaks and accessing dead objects&lt;/li&gt;&#10;&lt;li&gt;provides memory safety&lt;/li&gt;&#10;&lt;li&gt;virtual memory space&lt;/li&gt;&#10;&lt;li&gt;defragments/compacts memory&lt;/li&gt;&#10;&lt;li&gt;heap have 3 generations&#10;&lt;ul&gt;&#10;&lt;li&gt;0 - for new objects;&lt;/li&gt;&#10;&lt;li&gt;1 - for objects that lives through GC from 0&lt;/li&gt;&#10;&lt;li&gt;2 - for long living objects from 1 and 0&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;also Large Objects Heap (LOH) for big objects like arrays over 85,000 bytes&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/fundamentals?source=recommendations" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/fundamentals?source=recommendations&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>Covariance and Contravariance</title><link>https://internetexception.com/2022/10/19/covariance-and-contravariance/</link><pubDate>Wed, 19 Oct 2022 16:21:04 +0200</pubDate><guid>https://internetexception.com/2022/10/19/covariance-and-contravariance/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;enables implicit reference conversions for&#10;&lt;ul&gt;&#10;&lt;li&gt;arrays&lt;/li&gt;&#10;&lt;li&gt;delegates&lt;/li&gt;&#10;&lt;li&gt;generic type arguments&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Covariance&lt;/strong&gt; preserves assignment compatibility&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Contravariance&lt;/strong&gt; reverses assignment compatibility&lt;/li&gt;&#10;&lt;li&gt;allows for matching signatures of delegates and method groups&#10;&lt;ul&gt;&#10;&lt;li&gt;to assign to delegates from method that returns more derived types - &lt;strong&gt;covariance&lt;/strong&gt;&lt;/li&gt;&#10;&lt;li&gt;to assign to delegates from method that returns less derived types - &lt;strong&gt;contravariance&lt;/strong&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Covariance&lt;/strong&gt; and &lt;strong&gt;Contravariance&lt;/strong&gt; are supported in &lt;strong&gt;Generics&lt;/strong&gt; for implicit conversions for type parameters&#10;&lt;ul&gt;&#10;&lt;li&gt;allows method to have more derived return type than defined by generic type parameter of the interface&lt;/li&gt;&#10;&lt;li&gt;this allows implicit conversions from one generic interface to another (from &lt;code&gt;IEnumerable&amp;lt;string&amp;gt;&lt;/code&gt; to &lt;code&gt;IEnumerable&amp;lt;object&amp;gt;&lt;/code&gt; even if first does not inherits from second)&lt;/li&gt;&#10;&lt;li&gt;allows generic types to have less derived argument types than specified by the generic parameter of the interface (implementation of &lt;code&gt;IEqualityComparer&amp;lt;BaseClass&amp;gt;&lt;/code&gt; can be implicitly converted to &lt;code&gt;IEqualityComparer&amp;lt;DerivedClass&amp;gt;&lt;/code&gt; because &lt;code&gt;IEqualityComparer.Equals&lt;/code&gt; is contravariant)&lt;/li&gt;&#10;&lt;li&gt;implicit conversions works for interfaces but not classes that implement from those interfaces (i.e. this won&amp;rsquo;t work &lt;code&gt;List&amp;lt;Object&amp;gt; list = new List&amp;lt;String&amp;gt;()&lt;/code&gt;)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;&lt;em&gt;Assignment compatibility&lt;/em&gt; is when object of a more derived type is assigned to an object of a less derived type.&lt;/p&gt;</description></item><item><title>.NET Generics</title><link>https://internetexception.com/2022/10/19/net-generics/</link><pubDate>Wed, 19 Oct 2022 15:48:04 +0200</pubDate><guid>https://internetexception.com/2022/10/19/net-generics/</guid><description>&lt;p&gt;Allow for:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;generalization of logic based on available types&lt;/li&gt;&#10;&lt;li&gt;specify possible supported types&lt;/li&gt;&#10;&lt;li&gt;re-usability of code&lt;/li&gt;&#10;&lt;li&gt;type safety&lt;/li&gt;&#10;&lt;li&gt;defers the exact specification of logic until the class or method is declared and instantiated by user code with all type parameters specified&lt;/li&gt;&#10;&lt;li&gt;mostly used for collections (some non-generic versions of collection are not recommended like &lt;code&gt;ArrayList&lt;/code&gt; i.e.)&lt;/li&gt;&#10;&lt;li&gt;information of exact type parameters used in a generic can be obtained at runtime by reflection&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;</description></item><item><title>Data structures in .NET</title><link>https://internetexception.com/2022/10/19/data-structures-in-net/</link><pubDate>Wed, 19 Oct 2022 14:52:50 +0200</pubDate><guid>https://internetexception.com/2022/10/19/data-structures-in-net/</guid><description>&lt;p&gt;In table below official recommendations for choosing data structure for your needs:&lt;/p&gt;&#10;&lt;table&gt;&#10;&lt;tbody&gt;&#10;&lt;tr&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;Generic&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;Non-Generic&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;Thread safe&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;Purpose&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;code&gt;Dictionary&lt;/code&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;code&gt;Hashtable&lt;/code&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;code&gt;ConcurrentDictionary&lt;/code&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;key value pairs, lookup&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;code&gt;List&lt;/code&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;code&gt;Array&lt;/code&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;code&gt;ImmutableList&lt;/code&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;access items by index&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;code&gt;Queue&lt;/code&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;-&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;code&gt;ConcurrentQueue&lt;/code&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;FIFO queue&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;code&gt;Stack&lt;/code&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;-&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;code&gt;ConcurrentStack&lt;/code&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;LIFO queue&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;code&gt;LinkedList&lt;/code&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;-&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;-&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;access items sequentially&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;code&gt;ObservableCollection&lt;/code&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;-&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;-&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;notfications after modification&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;code&gt;SortedList&lt;/code&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;code&gt;ImmutableSortedSet&lt;/code&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;auto sorted collection&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;code&gt;HashSet&lt;/code&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;code&gt;ImmutableHashSet&lt;/code&gt;&lt;/td&gt;&#10;&lt;td class="has-text-align-center" data-align="center"&gt;dictionary of just keys (high performance set operations)&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;</description></item><item><title>Strings in .NET</title><link>https://internetexception.com/2022/10/19/strings-in-net/</link><pubDate>Wed, 19 Oct 2022 14:44:37 +0200</pubDate><guid>https://internetexception.com/2022/10/19/strings-in-net/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;sequential collection of chars&lt;/li&gt;&#10;&lt;li&gt;immutable&lt;/li&gt;&#10;&lt;li&gt;max 2GB or about 1 billion characters&lt;/li&gt;&#10;&lt;li&gt;reference type&lt;/li&gt;&#10;&lt;li&gt;are interned - CLR saves memory by maintaining a table, called the &amp;ldquo;intern pool&amp;rdquo;, that contains a single reference to each unique literal string declared or created programmatically in your program.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-7.0" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-7.0&lt;/a&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/api/system.string.intern?view=net-6.0#remarks" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/api/system.string.intern?view=net-6.0#remarks&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>What type can not be object field?</title><link>https://internetexception.com/2022/10/19/what-type-can-not-be-object-field/</link><pubDate>Wed, 19 Oct 2022 14:33:00 +0200</pubDate><guid>https://internetexception.com/2022/10/19/what-type-can-not-be-object-field/</guid><description>&lt;p&gt;&lt;code&gt;ref struct&lt;/code&gt; type can not be used as object field.&lt;/p&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="http://2022/10/19/ref-struct-types/" target="_blank" rel="noopener noreferrer"&gt;`ref struct` types&lt;/a&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/ref-struct" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/ref-struct&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>`ref struct` types</title><link>https://internetexception.com/2022/10/19/ref-struct-types/</link><pubDate>Wed, 19 Oct 2022 14:28:48 +0200</pubDate><guid>https://internetexception.com/2022/10/19/ref-struct-types/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;added as part of C# 7.2.&lt;/li&gt;&#10;&lt;li&gt;defined with &lt;code&gt;ref struct StructName&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;always on the stack&lt;/li&gt;&#10;&lt;li&gt;never part of heap&lt;/li&gt;&#10;&lt;li&gt;cannot be element of an array&lt;/li&gt;&#10;&lt;li&gt;cannot be field type of reference type&lt;/li&gt;&#10;&lt;li&gt;can&amp;rsquo;t implement interfaces&lt;/li&gt;&#10;&lt;li&gt;can&amp;rsquo;t be boxed&lt;/li&gt;&#10;&lt;li&gt;can&amp;rsquo;t be type argument&lt;/li&gt;&#10;&lt;li&gt;can&amp;rsquo;t be captured by closure of lambda or local function&lt;/li&gt;&#10;&lt;li&gt;can&amp;rsquo;t be used in async methods&lt;/li&gt;&#10;&lt;li&gt;can&amp;rsquo;t be used in iterators&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/ref-struct" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/ref-struct&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>Value types as fields in objects</title><link>https://internetexception.com/2022/10/19/value-types-as-fields-in-objects/</link><pubDate>Wed, 19 Oct 2022 14:26:29 +0200</pubDate><guid>https://internetexception.com/2022/10/19/value-types-as-fields-in-objects/</guid><description>&lt;p&gt;Value types are stored in the &lt;strong&gt;heap&lt;/strong&gt; when they are part of the reference type.&lt;/p&gt;</description></item><item><title>Reference types vs Value types</title><link>https://internetexception.com/2022/10/19/reference-types-vs-value-types/</link><pubDate>Wed, 19 Oct 2022 14:17:17 +0200</pubDate><guid>https://internetexception.com/2022/10/19/reference-types-vs-value-types/</guid><description>&lt;p&gt;&lt;strong&gt;Reference types:&lt;/strong&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;passed via reference&lt;/li&gt;&#10;&lt;li&gt;reside on the heap&lt;/li&gt;&#10;&lt;li&gt;subject to GC&lt;/li&gt;&#10;&lt;li&gt;inherits from &lt;code&gt;System.Object&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;&lt;strong&gt;Value types:&lt;/strong&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;passed via value&lt;/li&gt;&#10;&lt;li&gt;reside on the stack, CPU registers or the heap&lt;/li&gt;&#10;&lt;li&gt;no subject to GC&lt;/li&gt;&#10;&lt;li&gt;inherits from &lt;code&gt;System.ValueType&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/reference-types" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/reference-types&lt;/a&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-types" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-types&lt;/a&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://www.infoworld.com/article/3043992/a-deep-dive-value-and-reference-types-in-net.html" target="_blank" rel="noopener noreferrer"&gt;https://www.infoworld.com/article/3043992/a-deep-dive-value-and-reference-types-in-net.html&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>.NET Type System</title><link>https://internetexception.com/2022/10/19/net-type-system/</link><pubDate>Wed, 19 Oct 2022 13:59:44 +0200</pubDate><guid>https://internetexception.com/2022/10/19/net-type-system/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;shared type system across all .net languages&lt;/li&gt;&#10;&lt;li&gt;primitives data types library&lt;/li&gt;&#10;&lt;li&gt;5 kind of types:&#10;&lt;ul&gt;&#10;&lt;li&gt;classes&lt;/li&gt;&#10;&lt;li&gt;structures&lt;/li&gt;&#10;&lt;li&gt;enumerations&lt;/li&gt;&#10;&lt;li&gt;interfaces&lt;/li&gt;&#10;&lt;li&gt;delegates&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/standard/base-types/common-type-system" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/standard/base-types/common-type-system&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>ThreadPool</title><link>https://internetexception.com/2022/10/19/threadpool/</link><pubDate>Wed, 19 Oct 2022 13:53:37 +0200</pubDate><guid>https://internetexception.com/2022/10/19/threadpool/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;provides a pool of threads&lt;/li&gt;&#10;&lt;li&gt;can be used to execute tasks&lt;/li&gt;&#10;&lt;li&gt;post work items&lt;/li&gt;&#10;&lt;li&gt;process asynchronous I/O&lt;/li&gt;&#10;&lt;li&gt;process timers&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/api/system.threading.threadpool?view=net-6.0" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/api/system.threading.threadpool?view=net-6.0&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>Task Parallel Library (TPL)</title><link>https://internetexception.com/2022/10/19/task-parallel-library-tpl/</link><pubDate>Wed, 19 Oct 2022 13:51:20 +0200</pubDate><guid>https://internetexception.com/2022/10/19/task-parallel-library-tpl/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;simplify process of adding parallelism and concurrency to application&lt;/li&gt;&#10;&lt;li&gt;scales concurrency automatically&lt;/li&gt;&#10;&lt;li&gt;data parallelism&lt;/li&gt;&#10;&lt;li&gt;task based &lt;code&gt;async&lt;/code&gt; programming&lt;/li&gt;&#10;&lt;li&gt;data flow&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/standard/parallel-programming/task-parallel-library-tpl" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/standard/parallel-programming/task-parallel-library-tpl&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>Locking with integer</title><link>https://internetexception.com/2022/10/19/locking-with-integer/</link><pubDate>Wed, 19 Oct 2022 13:44:02 +0200</pubDate><guid>https://internetexception.com/2022/10/19/locking-with-integer/</guid><description>&lt;p&gt;In short:&lt;/p&gt;&#10;&lt;p&gt;it will not work because it requires boxing and boxing will create new object for reference in &lt;code&gt;lock&lt;/code&gt; every time code is executed so lock statement will not prevent anything.&lt;/p&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://intellitect.com/blog/locking-a-block-of-code-with-an-integer/" target="_blank" rel="noopener noreferrer"&gt;https://intellitect.com/blog/locking-a-block-of-code-with-an-integer/&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>Locking in .NET</title><link>https://internetexception.com/2022/10/19/locking-in-net/</link><pubDate>Wed, 19 Oct 2022 13:27:01 +0200</pubDate><guid>https://internetexception.com/2022/10/19/locking-in-net/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;lock&lt;/code&gt; statement blocks execution of a code block for single thread that hold lock&lt;/li&gt;&#10;&lt;li&gt;the same thread can acquire and release lock again&lt;/li&gt;&#10;&lt;li&gt;any other thread is blocked from the statement&lt;/li&gt;&#10;&lt;li&gt;lock on dedicated instance only&lt;/li&gt;&#10;&lt;li&gt;using the same instance on multiple &lt;code&gt;lock&lt;/code&gt; statements may lead to deadlock&lt;/li&gt;&#10;&lt;li&gt;avoid using as lock&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;this&lt;/code&gt;, as it might be used by the callers as a lock&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/api/system.type" target="_blank" rel="noopener noreferrer"&gt;Type&lt;/a&gt;&#10; instances, as those might be obtained by the &lt;a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/type-testing-and-cast#typeof-operator" target="_blank" rel="noopener noreferrer"&gt;typeof&lt;/a&gt;&#10; operator or reflection&lt;/li&gt;&#10;&lt;li&gt;string instances, including string literals, as those might be &lt;a href="https://learn.microsoft.com/en-us/dotnet/api/system.string.intern#remarks" target="_blank" rel="noopener noreferrer"&gt;interned&lt;/a&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Hold a lock for as short time as possible to reduce lock contention.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Below code block is translated by compiler&lt;/p&gt;</description></item><item><title>Thread vs task in . NET</title><link>https://internetexception.com/2022/10/19/thread-vs-task-in-net/</link><pubDate>Wed, 19 Oct 2022 13:12:33 +0200</pubDate><guid>https://internetexception.com/2022/10/19/thread-vs-task-in-net/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;task is asynchronous operation&lt;/li&gt;&#10;&lt;li&gt;thread is abstraction on OS thread&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://www.c-sharpcorner.com/article/task-and-thread-in-c-sharp/" target="_blank" rel="noopener noreferrer"&gt;https://www.c-sharpcorner.com/article/task-and-thread-in-c-sharp/&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>What is SynchronizationContext in .NET</title><link>https://internetexception.com/2022/10/19/what-is-synchronizationcontext-in-net/</link><pubDate>Wed, 19 Oct 2022 13:08:18 +0200</pubDate><guid>https://internetexception.com/2022/10/19/what-is-synchronizationcontext-in-net/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;multi threaded programs usually uses one of the threads as means of synchronization&lt;/li&gt;&#10;&lt;li&gt;there are message loops to pass unit of works (like Windows message queue)&lt;/li&gt;&#10;&lt;li&gt;message queues require messages formats and convention for handling it&lt;/li&gt;&#10;&lt;li&gt;single thread to handle ASP.NET request is waste of the resources (before .NET 2)&lt;/li&gt;&#10;&lt;li&gt;thread pool was better but inconvenient to work with&lt;/li&gt;&#10;&lt;li&gt;instead &lt;strong&gt;SynchronizationContext&lt;/strong&gt; queues work for given &lt;em&gt;context&lt;/em&gt; not thread&lt;/li&gt;&#10;&lt;li&gt;thread have &lt;em&gt;current&lt;/em&gt; context&lt;/li&gt;&#10;&lt;li&gt;context does not have to be &lt;em&gt;unique&lt;/em&gt; but can be shared between &lt;em&gt;multiple threads&lt;/em&gt;&lt;/li&gt;&#10;&lt;li&gt;thread can &lt;em&gt;change context&lt;/em&gt; but this is &lt;em&gt;rare&lt;/em&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;SynchronizationContext&lt;/strong&gt; keeps count of all asynchronous operations&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Windows Forms&lt;/strong&gt; uses &lt;strong&gt;WindowsFormsSynchronizationContext&lt;/strong&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;WPF and Silverlight&lt;/strong&gt; uses &lt;strong&gt;DispatcherSynchronizationContext&lt;/strong&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Console app and WindowsServices and ThreadPool threads&lt;/strong&gt; uses &lt;strong&gt;default SynchronizationContext&lt;/strong&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;ASP.NET&lt;/strong&gt; uses &lt;strong&gt;AspNetSynchronizationContext&lt;/strong&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;</description></item><item><title>Does async/await creates new thread?</title><link>https://internetexception.com/2022/10/19/does-async-await-creates-new-thread/</link><pubDate>Wed, 19 Oct 2022 12:58:00 +0200</pubDate><guid>https://internetexception.com/2022/10/19/does-async-await-creates-new-thread/</guid><description>&lt;p&gt;In short: &lt;strong&gt;no&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;p&gt;Longer explanation:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;task that want to do I/O write call to driver write&lt;/li&gt;&#10;&lt;li&gt;driver operations are performed asynchronously&lt;/li&gt;&#10;&lt;li&gt;write operations on devices is done without CPU involved&lt;/li&gt;&#10;&lt;li&gt;finish of writing is done via interrupt&lt;/li&gt;&#10;&lt;li&gt;interrupt, schedules &lt;code&gt;Deferred Procedure Call&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;DPC&lt;/code&gt; schedules &lt;code&gt;Asynchronous Procedure Call&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;APC&lt;/code&gt; notifies thread that I/O write is done&lt;/li&gt;&#10;&lt;li&gt;task that was doing I/O is scheduled with continuation of its method after I/O is done.&lt;/li&gt;&#10;&lt;li&gt;some threads might need to be borrowed for handling APC and such but &lt;em&gt;no thread is spawn to handle I/O&lt;/em&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;I recommend reading this post: &lt;a href="https://blog.stephencleary.com/2013/11/there-is-no-thread.html" data-type="URL" data-id="https://blog.stephencleary.com/2013/11/there-is-no-thread.html"&gt;&lt;a href="https://blog.stephencleary.com/2013/11/there-is-no-thread.html" target="_blank" rel="noopener noreferrer"&gt;https://blog.stephencleary.com/2013/11/there-is-no-thread.html&lt;/a&gt;&#10;&lt;/a&gt;. This will explain the topic much better than I can.&lt;/p&gt;</description></item><item><title>Avoid deadlock with asynchronous methods</title><link>https://internetexception.com/2022/10/19/avoid-deadlock-with-asynchronous-methods/</link><pubDate>Wed, 19 Oct 2022 12:52:45 +0200</pubDate><guid>https://internetexception.com/2022/10/19/avoid-deadlock-with-asynchronous-methods/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;avoid doing &lt;code&gt;AsyncOperation.Result&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;parent method waits for &lt;code&gt;Result&lt;/code&gt; while child method waits for parent thread to take control, after being done with async I/O&lt;/li&gt;&#10;&lt;li&gt;both waits&lt;/li&gt;&#10;&lt;li&gt;deadlock&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://medium.com/rubrikkgroup/understanding-async-avoiding-deadlocks-e41f8f2c6f5d" target="_blank" rel="noopener noreferrer"&gt;https://medium.com/rubrikkgroup/understanding-async-avoiding-deadlocks-e41f8f2c6f5d&lt;/a&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/15021304/an-async-await-example-that-causes-a-deadlock" target="_blank" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/15021304/an-async-await-example-that-causes-a-deadlock&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>Asynchronous programming in .NET</title><link>https://internetexception.com/2022/10/19/asynchronous-programming-in-net/</link><pubDate>Wed, 19 Oct 2022 09:52:30 +0200</pubDate><guid>https://internetexception.com/2022/10/19/asynchronous-programming-in-net/</guid><description>&lt;p&gt;Asynchronous programming patterns in .NET:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm" data-type="URL" data-id="https://learn.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm"&gt;Asynchronous Programming Model&lt;/a&gt; (BeginOperation/EndOperation)&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/event-based-asynchronous-pattern-overview" data-type="URL" data-id="https://learn.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/event-based-asynchronous-pattern-overview"&gt;Event-based Asynchronous Pattern&lt;/a&gt; (invoke event with result from async job)&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/task-asynchronous-programming-model" target="_blank" rel="noopener noreferrer"&gt;Task-based Asynchronous Pattern&lt;/a&gt;&#10; (Task&amp;lt;&amp;gt;)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Ways of achieving asynchronous code in .NET&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;async, await&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;Task&lt;/code&gt; class API (&lt;code&gt;Run&lt;/code&gt;, &lt;code&gt;WhenAll&lt;/code&gt;, &lt;code&gt;WhenAny&lt;/code&gt;, etc.)&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;ThreadPool.QueueUserWorkItem(ThreadProc);&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://internetexception.com/2022/10/19/async-await-in-c/" data-type="URL" data-id="/2022/10/19/async-await-in-c/"&gt;async/await in .NET&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/" target="_blank" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>async/await in C#</title><link>https://internetexception.com/2022/10/19/async-await-in-c/</link><pubDate>Wed, 19 Oct 2022 09:51:34 +0200</pubDate><guid>https://internetexception.com/2022/10/19/async-await-in-c/</guid><description>&lt;p&gt;&lt;code&gt;async&lt;/code&gt;/&lt;code&gt;await&lt;/code&gt; syntax should be used for &lt;a href="https://internetexception.com/2022/10/19/async-await-in-c/" data-type="post" data-id="491"&gt;I/O bound&lt;/a&gt; asynchronous operations only.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;GetUrlContentLengthAsync&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;HttpClient&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;getStringTask&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GetStringAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;https://docs.microsoft.com/dotnet&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;DoIndependentWork&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;contents&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;getStringTask&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;contents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Compiler transforms code into a state machine that to track yielding execution for &lt;code&gt;await&lt;/code&gt; and resuming execution when a background job is finished.&lt;/p&gt;&#10;&lt;p&gt;Things to keep in mind:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;async&lt;/code&gt; method needs await&lt;/li&gt;&#10;&lt;li&gt;add &lt;code&gt;Async&lt;/code&gt; suffix to asynchronous methods&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;async void&lt;/code&gt; for &amp;lsquo;Fire and Forget&amp;rsquo; work i.e. event Handlers&lt;/li&gt;&#10;&lt;li&gt;be aware of mixing LINQ with &lt;code&gt;async&lt;/code&gt; lambdas&lt;/li&gt;&#10;&lt;li&gt;wait for tasks in a non-blocking manner (do not use &lt;code&gt;Task.Result&lt;/code&gt; i.e.)&lt;/li&gt;&#10;&lt;li&gt;for tight loops use &lt;code&gt;ValueTasks&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Consider using &lt;code&gt;ConfigureAwait(false)&lt;/code&gt; for performance and for avoiding deadlocks&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;</description></item><item><title>CPU bound vs I/O bound</title><link>https://internetexception.com/2022/10/19/cpu-bound-vs-i-o-bound/</link><pubDate>Wed, 19 Oct 2022 09:35:37 +0200</pubDate><guid>https://internetexception.com/2022/10/19/cpu-bound-vs-i-o-bound/</guid><description>&lt;p&gt;There are two types of asynchronous operations in .NET.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;I/O bound&lt;/li&gt;&#10;&lt;li&gt;CPU bound&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;For I/O bound &lt;code&gt;async&lt;/code&gt;/&lt;code&gt;await&lt;/code&gt; syntax should be used. TPL should not be used for this. &lt;code&gt;async&lt;/code&gt; methods does not spawns new thread to hand le I/O work asynchronously.&lt;/p&gt;&#10;&lt;p&gt;For CPU bound operations TPL should be used (&lt;code&gt;Task.Run&lt;/code&gt;). This spawns new thread. Performance testing should be done to check if overhead of new thread and context switching is not greater than actual work to be done.&lt;/p&gt;</description></item><item><title>SupressFinalize in IDisposable interface</title><link>https://internetexception.com/2022/10/18/supressfinalize-in-idisposable-interface/</link><pubDate>Tue, 18 Oct 2022 14:24:06 +0200</pubDate><guid>https://internetexception.com/2022/10/18/supressfinalize-in-idisposable-interface/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;informs GC that object does not need to be added to finalizer queue&lt;/li&gt;&#10;&lt;li&gt;finalizer execution is not deterministic and objects can live for long time in queue - this is optimization technique&lt;/li&gt;&#10;&lt;li&gt;to make sure that object disposes of any unamanaged resources even if &lt;code&gt;Dispose&lt;/code&gt; will be not called we need to implement finalizer&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Basically finalizer execution time is not deterministic. We cannot predict when this will be called and till that time - object is existing and still taking memory space. Since we are controlling creation and disposal of those resources we can say to GC: &amp;lsquo;Do not worry about that! It already had been taken care of!&amp;rsquo;. So this way object will be destroyed sooner, leaving this space to be used by something else possibly.&lt;/p&gt;</description></item><item><title>IDisposable interface pattern</title><link>https://internetexception.com/2022/10/18/idisposable-interface-pattern/</link><pubDate>Tue, 18 Oct 2022 14:16:21 +0200</pubDate><guid>https://internetexception.com/2022/10/18/idisposable-interface-pattern/</guid><description>&lt;p&gt;Example implementation of &lt;code&gt;IDisposable&lt;/code&gt;&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyResource&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;IDisposable&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="n"&gt;MyResource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IntPtr&lt;/span&gt; &lt;span class="n"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;handle&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="n"&gt;Dispose&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Dispose&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;disposing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;GC&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SuppressFinalize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;virtual&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="n"&gt;Dispose&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;disposing&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(!&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;disposed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;disposing&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;component&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Dispose&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;CloseHandle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;handle&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;IntPtr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Zero&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;disposed&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;~&lt;/span&gt;&lt;span class="n"&gt;MyResource&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Dispose&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;disposing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;MyResource&lt;/code&gt; object have pointer which is unmanaged. This is why this class should implement &lt;code&gt;IDisposable&lt;/code&gt; interface. Implementation should be correct according to recommended pattern (see below for documentation).&lt;/p&gt;&#10;&lt;p&gt;There a re few points to highlight here:&lt;/p&gt;</description></item><item><title>General Interview Questions</title><link>https://internetexception.com/2022/10/18/general-interview-questions/</link><pubDate>Tue, 18 Oct 2022 13:32:58 +0200</pubDate><guid>https://internetexception.com/2022/10/18/general-interview-questions/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;Closed&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/17/what-is-asynchronous-programming/" data-type="URL" data-id="/2022/10/17/what-is-asynchronous-programming/"&gt;What is asynchronous programming?&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/18/what-is-tdd/" data-type="URL" data-id="/2022/10/18/what-is-tdd/"&gt;What is TDD&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/18/what-is-bdd/" data-type="URL" data-id="/2022/10/18/what-is-bdd/"&gt;What is BDD&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://internetexception.com/2022/10/18/what-is-ddd/" data-type="URL" data-id="/2022/10/18/what-is-ddd/"&gt;What is DDD&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Open - to consider for yourself&#10;&lt;ul&gt;&#10;&lt;li&gt;Interesting technical problem you solved lately&lt;/li&gt;&#10;&lt;li&gt;Interesting technical problem you solved during your career&lt;/li&gt;&#10;&lt;li&gt;What is the process of the MR/PR change review for you&lt;/li&gt;&#10;&lt;li&gt;What is great success you accomplished lately? What skill did you improved lately?&lt;/li&gt;&#10;&lt;li&gt;What is your greatest failure during your career? What was your biggest mistake?&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>What is DDD</title><link>https://internetexception.com/2022/10/18/what-is-ddd/</link><pubDate>Tue, 18 Oct 2022 13:29:02 +0200</pubDate><guid>https://internetexception.com/2022/10/18/what-is-ddd/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;software design approach&lt;/li&gt;&#10;&lt;li&gt;software should be driven by business domain&lt;/li&gt;&#10;&lt;li&gt;pieces of software should match the business domain&lt;/li&gt;&#10;&lt;li&gt;goals:&#10;&lt;ul&gt;&#10;&lt;li&gt;domain is primary focus&lt;/li&gt;&#10;&lt;li&gt;complex design should base on model of the domain&lt;/li&gt;&#10;&lt;li&gt;devs and business should continuously work on refining this model to address changes in business&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;common language for defining a business model of the domain&lt;/li&gt;&#10;&lt;li&gt;complex logic should be abstracted to domain&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Domain-driven_design" target="_blank" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Domain-driven_design&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>What is BDD</title><link>https://internetexception.com/2022/10/18/what-is-bdd/</link><pubDate>Tue, 18 Oct 2022 13:24:32 +0200</pubDate><guid>https://internetexception.com/2022/10/18/what-is-bdd/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;based on TDD&lt;/li&gt;&#10;&lt;li&gt;better collaboration between devs, QAs and business than TDD&lt;/li&gt;&#10;&lt;li&gt;behavioral tests first, implementation second&lt;/li&gt;&#10;&lt;li&gt;behavioral tests should be easy to understand, simple&lt;/li&gt;&#10;&lt;li&gt;those tests should be written in specific language, possible to understood by business&lt;/li&gt;&#10;&lt;li&gt;combines idea of unit tests naming, acceptance tests standard agile framework (As a XXX I want YY to achieve ZZ), and acceptance criteria with Gherkin&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Behavior-driven_development" target="_blank" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Behavior-driven_development&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>What is TDD</title><link>https://internetexception.com/2022/10/18/what-is-tdd/</link><pubDate>Tue, 18 Oct 2022 13:08:00 +0200</pubDate><guid>https://internetexception.com/2022/10/18/what-is-tdd/</guid><description>&lt;p&gt;Test-driven development&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;software requirements are converted to tests cases *before* actual implementation&lt;/li&gt;&#10;&lt;li&gt;implementation is done against all those test cases&lt;/li&gt;&#10;&lt;li&gt;opposing to first writing an implementation then tests cases&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Further read:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Test-driven_development" target="_blank" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Test-driven_development&lt;/a&gt;&#10;&lt;/p&gt;</description></item><item><title>What is asynchronous programming?</title><link>https://internetexception.com/2022/10/17/what-is-asynchronous-programming/</link><pubDate>Mon, 17 Oct 2022 16:25:05 +0200</pubDate><guid>https://internetexception.com/2022/10/17/what-is-asynchronous-programming/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;software often waits for some I/O operation to complete (file operation, network call, database query etc.)&lt;/li&gt;&#10;&lt;li&gt;we can use this time for something productive instead to wait for data to be available or I/O operation to be completed&lt;/li&gt;&#10;&lt;li&gt;with asynchronous programming user can work in the meantime&lt;/li&gt;&#10;&lt;li&gt;not waiting for I/O operations synchronously enhances user experience&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Of course this problem is much more complex. Modern software operates on much more different PC architecture than 20 years ago. Nowadays software must be asynchronous to appear more user friendly and to made better use of modern multi CPU architecture. Right now complex, professional software uses multiple processes, threads on multiple CPUs (CPU you buy is not really *single* CPU) or even utilize GPU for more complex computations (like i.e. video editing software). Before that we mostly had single threaded desktop applications that had &amp;lsquo;please wait&amp;rsquo; or &amp;rsquo;loading&amp;rsquo; pop ups. Right now this is song of the past really and to achieve better User Interfaces that allow to edit tag of your post without changing whole post. With mobile devices on the rise and sometimes lousy cellular network those kind of designs would not be sensible or sometimes impossible to implement. Did you ever happened to reenter some chunk of data into some software because you lost it? Maybe network was down? Or you hit back button by mistake? Right now it belongs to past mostly. All of those would be hard to do with synchronous operations. Right now people are bit spoiled and they tend to leave the page/application if it appears to be slow and not every company can sell &amp;lsquo;one-in-the-market-necessary-for-your-work-software&amp;rsquo; that you will be forced to use. And this is why we have asynchronous operations and this is why we have asynchronous programming model that allows us to program such operations.&lt;/p&gt;</description></item><item><title>Dynamic runtime delegates conversion</title><link>https://internetexception.com/2017/05/07/dynamic-runtime-delegates-conversion/</link><pubDate>Sun, 07 May 2017 11:53:00 +0200</pubDate><guid>https://internetexception.com/2017/05/07/dynamic-runtime-delegates-conversion/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;&#10;&lt;p&gt;Delegates can be converted easily to another type if you know types of those delegates. But if you do not know it is impossible without really complicated code.&lt;/p&gt;</description></item><item><title>Automatic scrolling to edited text box in Xamarin Android.</title><link>https://internetexception.com/2017/02/25/automatic-scrolling-to-edited-text-box-in-xamarin-android/</link><pubDate>Sat, 25 Feb 2017 14:48:00 +0100</pubDate><guid>https://internetexception.com/2017/02/25/automatic-scrolling-to-edited-text-box-in-xamarin-android/</guid><description>&lt;p&gt;&lt;strong&gt;Important note: this should work well with newer version of Xamarin (2.3.3). If you cannot update for some reason this article will explain workaround.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;&#10;&lt;p&gt;In previous article I explained how to detect show and hide events of software keyboard in Xamarin Android. I did it in my project because of the fact that some of text boxes was hidden by software keyboard that suppose to edit contents of those text boxes. In this article I will explain how to work around this issue in some older versions of Xamarin.&lt;/p&gt;</description></item><item><title>Detecting software keyboard events in Xamarin Android</title><link>https://internetexception.com/2017/02/03/detecting-software-keyboard-events-in-xamarin-android/</link><pubDate>Fri, 03 Feb 2017 23:31:00 +0100</pubDate><guid>https://internetexception.com/2017/02/03/detecting-software-keyboard-events-in-xamarin-android/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;&#10;&lt;p&gt;It is quite strange that you can&amp;rsquo;t easily detect if software keyboard is visible or not on Android. Because of that, it is also complicated thing to do in Xamarin.&lt;/p&gt;</description></item><item><title>Xamarin Android Services Pattern on GPS example</title><link>https://internetexception.com/2017/01/30/xamarin-android-services-pattern-on-gps-example/</link><pubDate>Mon, 30 Jan 2017 04:17:00 +0100</pubDate><guid>https://internetexception.com/2017/01/30/xamarin-android-services-pattern-on-gps-example/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;&#10;&lt;p&gt;In Xamarin if you want to use many Android native service/mechanism you have to implement it in Activity class. Or at least that is how Xamarin documentation wants you to do it.&lt;/p&gt;</description></item><item><title>Xamarin with TinyIoC</title><link>https://internetexception.com/2016/12/10/xamarin-with-tinyioc/</link><pubDate>Sat, 10 Dec 2016 09:48:00 +0100</pubDate><guid>https://internetexception.com/2016/12/10/xamarin-with-tinyioc/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;&#10;&lt;p&gt;This article is builds on topics and solutions introduces in &lt;a href="https://internetexception.com/2016/07/09/viewfactory-for-xamarin-application/"&gt;ViewFactory for Xamarin application&lt;/a&gt;&#10; and &lt;a href="https://internetexception.com/2016/04/24/xamarin-master-detail-page/"&gt;Xamarin Master-Detail Page&lt;/a&gt;&#10; articles. It shows method for easier navigation and use of services via IoC in Xamarin application. Knowledge from previous examples is not necessary, but makes this article bit easier to understand.&lt;/p&gt;</description></item><item><title>Genereting proxies during runtime using Reflection.Emit</title><link>https://internetexception.com/2016/10/07/genereting-proxies-during-runtime-using-reflection-emit/</link><pubDate>Fri, 07 Oct 2016 12:29:00 +0200</pubDate><guid>https://internetexception.com/2016/10/07/genereting-proxies-during-runtime-using-reflection-emit/</guid><description>&lt;p&gt;&lt;em&gt;Reflection.Emit&lt;/em&gt; is very powerful tool. It creates IL code and since C# is converted into IL too, we have the same functionality as in C# and even more. It is very powerful and at the same time very complicated. Because of that it is worth to discuss how and for what it should be used. One idea is to create dynamic code with automatic implementations of interfaces - proxy types.&lt;/p&gt;</description></item><item><title>Faster than Reflection: Delegates. Part 3.</title><link>https://internetexception.com/2016/09/02/faster-than-reflection-delegates-part-3/</link><pubDate>Fri, 02 Sep 2016 13:15:00 +0200</pubDate><guid>https://internetexception.com/2016/09/02/faster-than-reflection-delegates-part-3/</guid><description>&lt;p&gt;&lt;strong&gt;This is third article in series, that explains how to create delegates for public and non-public members of public, non-public or not known in compile-time types. If you are not familiar with previous articles and looking for detailed explanation of how delegates works, how they are created and why, I strongly encourage you to read first two. If you are just looking for a way to create delegates for methods or constructors it is not necessary.&lt;/strong&gt; Code with new features and with bug fixes is available on &lt;a href="https://github.com/npodbielski/Delegates" target="_blank" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&#10; and as &lt;a href="https://www.nuget.org/packages/DelegatesFactory/1.0.0" target="_blank" rel="noopener noreferrer"&gt;Nuget&lt;/a&gt;&#10; package.&lt;/p&gt;</description></item><item><title>Faster than Reflection: Delegates. Part 2.</title><link>https://internetexception.com/2016/08/16/faster-than-reflection-delegates-part-2/</link><pubDate>Tue, 16 Aug 2016 12:59:00 +0200</pubDate><guid>https://internetexception.com/2016/08/16/faster-than-reflection-delegates-part-2/</guid><description>&lt;p&gt;&lt;strong&gt;This is second article in series, that explains how to create delegates for public and non-public members of public, non-public or not known in compile-time types. If you are not familiar with previous article and looking for detailed explanation of how delegates works, how they are created and why, I strongly encourage you to read it first. If you are just looking for a way to create delegates for methods or constructors it is not necessary.&lt;/strong&gt; Last article in series you can find &lt;a href="https://internetexception.com/2016/09/02/faster-than-reflection-delegates-part-3/" title="Third part"&gt;here&lt;/a&gt;&#10;. Code with new features and with bug fixes is available on &lt;a href="https://github.com/npodbielski/Delegates" target="_blank" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&#10; and as &lt;a href="https://www.nuget.org/packages/DelegatesFactory/1.0.0" target="_blank" rel="noopener noreferrer"&gt;Nuget&lt;/a&gt;&#10; package. In previous &lt;a href="https://internetexception.com/2016/08/05/faster-than-reflection-delegates-part-1/"&gt;article&lt;/a&gt;&#10; and first one in series, we covered:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Static&#10;&lt;ol&gt;&#10;&lt;li&gt;Properties&lt;/li&gt;&#10;&lt;li&gt;Fields&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Instance&#10;&lt;ol&gt;&#10;&lt;li&gt;Properties&lt;/li&gt;&#10;&lt;li&gt;Fields&lt;/li&gt;&#10;&lt;li&gt;Indexers&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;Now it is time to cover following members.&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Static&#10;&lt;ol&gt;&#10;&lt;li&gt;Methods&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Instance&#10;&lt;ol&gt;&#10;&lt;li&gt;Methods&lt;/li&gt;&#10;&lt;li&gt;Constructors&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;</description></item><item><title>Faster than Reflection: Delegates. Part 1.</title><link>https://internetexception.com/2016/08/05/faster-than-reflection-delegates-part-1/</link><pubDate>Fri, 05 Aug 2016 09:58:00 +0200</pubDate><guid>https://internetexception.com/2016/08/05/faster-than-reflection-delegates-part-1/</guid><description>&lt;p&gt;This article is first part of the series of three. Next ones you can find &lt;a href="https://internetexception.com/2016/08/16/faster-than-reflection-delegates-part-2/" title="Second part"&gt;here&lt;/a&gt;&#10; and &lt;a href="https://internetexception.com/2016/09/02/faster-than-reflection-delegates-part-3/" title="Third part"&gt;here&lt;/a&gt;&#10;. Code for all three articles, with new features and bug fixes is available on &lt;a href="https://github.com/npodbielski/Delegates" target="_blank" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&#10; and as &lt;a href="https://www.nuget.org/packages/DelegatesFactory/1.0.0" target="_blank" rel="noopener noreferrer"&gt;Nuget&lt;/a&gt;&#10; package.&lt;/p&gt;&#10;&lt;h3 id="why-not-reflection"&gt;Why not Reflection?&lt;/h3&gt;&#10;&lt;p&gt;If you working with .NET and C# (probably other languages too), at some point, you will have to write more advanced and generic code, that i.e. reads all properties of a type, searches for attributes, etc. Or maybe you want to call some private method or property? It is not that rare to use some internal mechanism of framework or library. Usually, the first solution involves Reflection. But the thing is: Reflection is slow. Of course, it is sufficient if you need to use Reflection rarely and it is not the main code of the application. If it is used more often at some point, you will probably try to optimize it. And now is the fun part: how to do it?&lt;/p&gt;</description></item><item><title>ViewFactory for Xamarin application</title><link>https://internetexception.com/2016/07/09/viewfactory-for-xamarin-application/</link><pubDate>Sat, 09 Jul 2016 12:37:00 +0200</pubDate><guid>https://internetexception.com/2016/07/09/viewfactory-for-xamarin-application/</guid><description>&lt;h2 id="first-things-first---why"&gt;First things first - Why?&lt;/h2&gt;&#10;&lt;p&gt;First of all I do not like how creating of views and navigation works in Xamarin. There is much boilerplate needed to just navigate from one page to another. Typically like in &lt;a href="https://developer.xamarin.com/guides/xamarin-forms/getting-started/introduction-to-xamarin-forms/#Navigation" target="_blank" rel="noopener noreferrer"&gt;Xamarin documentation&lt;/a&gt;&#10; we have to obtain &lt;code&gt;INavigation&lt;/code&gt; interface instance, create instance of a new page, create instance of view model and all dependencies it requires. When you page do not require view model things are real easy and Xamarin sample is just enough.&lt;/p&gt;</description></item><item><title>Xamarin Master-Detail Page</title><link>https://internetexception.com/2016/04/24/xamarin-master-detail-page/</link><pubDate>Sun, 24 Apr 2016 07:41:00 +0200</pubDate><guid>https://internetexception.com/2016/04/24/xamarin-master-detail-page/</guid><description>&lt;p&gt;This article as previous ones (&lt;a href="https://internetexception.com/2016/04/22/xamarin-frame-and-style-with-padding/"&gt;Frame With Padding&lt;/a&gt;&#10;, &lt;a href="https://internetexception.com/2016/04/22/xamarin-frame-and-disappearing-outline/"&gt;Frame Outline Problem&lt;/a&gt;&#10;, &lt;a href="https://internetexception.com/2016/04/22/xamarin-frame-and-disappearing-outline/"&gt;Inheritance from Implicit Styles&lt;/a&gt;&#10;) also will be about Xamarin. This time we will inspect Master-Detail page control/mechanism. You can find official documentation for this control &lt;a href="https://developer.xamarin.com/guides/xamarin-forms/user-interface/navigation/master-detail-page/" target="_blank" rel="noopener noreferrer"&gt;here&lt;/a&gt;&#10;. Quick spoiler: I never used this in any production application. Why? I will explain. Whole article will be to explain why this is just not worth your time. In this and subsequent articles I will introduce much better solution.&lt;/p&gt;</description></item><item><title>Xamarin Style based on implicit Style</title><link>https://internetexception.com/2016/04/22/xamarin-style-based-on-implicit-style/</link><pubDate>Fri, 22 Apr 2016 23:17:00 +0200</pubDate><guid>https://internetexception.com/2016/04/22/xamarin-style-based-on-implicit-style/</guid><description>&lt;p&gt;Next article about bugs in Xamarin will touch topic of Styles. Styles for all of controls not only Frame (and if you wondering why Frame you should check first two articles about Xamarin &lt;a href="https://internetexception.com/2016/04/22/xamarin-frame-and-style-with-padding/" title="Xamarin Frame and Style with Padding"&gt;here&lt;/a&gt;&#10; and &lt;a href="https://internetexception.com/2016/04/22/xamarin-frame-and-disappearing-outline/" title="Xamarin Frame and disappearing Outline"&gt;here)&lt;/a&gt;&#10;. First of all if you are using Styles in Xamarin you probably know how to define implicit styles. If not here is a sample:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;Application.Resources&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;ResourceDictionary&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Style&lt;/span&gt; &lt;span class="na"&gt;TargetType=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Label&amp;#34;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Setter&lt;/span&gt; &lt;span class="na"&gt;Property=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;FontSize&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;Value=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;45&amp;#34;&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/Style&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/ResourceDictionary&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/Application.Resources&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Xamarin Frame and disappearing Outline</title><link>https://internetexception.com/2016/04/22/xamarin-frame-and-disappearing-outline/</link><pubDate>Fri, 22 Apr 2016 13:00:00 +0200</pubDate><guid>https://internetexception.com/2016/04/22/xamarin-frame-and-disappearing-outline/</guid><description>&lt;p&gt;This is another article in mini series of Xamarin bugs and workarounds for them :) Previous one you can find &lt;a href="https://internetexception.com/2016/04/22/xamarin-frame-and-style-with-padding/" title="Xamarin Frame and Style with Padding"&gt;here&lt;/a&gt;&#10;. This one is again about Frame control. I promise that another one will be about something else B) Issue can be observed when you bind BackgroundColor property of Frame control and something will trigger change of view model source property binded to background color.&lt;/p&gt;</description></item><item><title>Xamarin Frame and Style with Padding</title><link>https://internetexception.com/2016/04/22/xamarin-frame-and-style-with-padding/</link><pubDate>Fri, 22 Apr 2016 05:10:00 +0200</pubDate><guid>https://internetexception.com/2016/04/22/xamarin-frame-and-style-with-padding/</guid><description>&lt;p&gt;If you are a bit advanced with Xamarin you should already now that there is possibility of styling your controls almost like in WPF. Almost, because there is a few strange bugs involving this. For example there is a problem with styling a Padding property in Frame. Consider following Xaml of Xamarin application (I tested it in Android):&lt;/p&gt;</description></item><item><title>Safe cast string to enum</title><link>https://internetexception.com/2014/02/25/safe-cast-string-to-enum-2/</link><pubDate>Tue, 25 Feb 2014 23:49:00 +0100</pubDate><guid>https://internetexception.com/2014/02/25/safe-cast-string-to-enum-2/</guid><description>&lt;p&gt;In on of my projects I had make an interface between database and web service in C# code. One of problem I had to face was need to cast strings to enumerable types, because of simple fact that database have no idea what is an &amp;rsquo;enum&amp;rsquo;. Yes simplest mapping between an enumeration and database type is integer. It is simplest but in my idea not best. For example I really do not remember (or do not WANT to remember) what is the meaning of 4 integer value in case of package shipment status.&lt;/p&gt;</description></item><item><title>Visual Studio code snippets</title><link>https://internetexception.com/2014/02/25/visual-studio-code-snippets/</link><pubDate>Tue, 25 Feb 2014 11:39:00 +0100</pubDate><guid>https://internetexception.com/2014/02/25/visual-studio-code-snippets/</guid><description>&lt;p&gt;What I really like in Visual Studio as development environment is code snippets. Well actually probably other IDE have something very similar but I do not have much of a choice in that matter as C# developer :) Anyway this feature is really useful. For example while refactoring I very often use &lt;strong&gt;if&lt;/strong&gt; surround snippet.&lt;/p&gt;</description></item><item><title>Smart string builder</title><link>https://internetexception.com/2014/02/22/smart-string-builder/</link><pubDate>Sat, 22 Feb 2014 03:16:00 +0100</pubDate><guid>https://internetexception.com/2014/02/22/smart-string-builder/</guid><description>&lt;p&gt;In this rare times when I was writing code that suppose to create large string from smaller chunks and with some non string parameters I was using &lt;strong&gt;StringBuilder&lt;/strong&gt; class of course. Of course because string adding, or string concatenation is very costly when talking about memory utilization. It is because every time you do this:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Hello world!&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;n&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;How are you?&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;new string is created for every &amp;lsquo;+&amp;rsquo; operation in memory. Not a best way of doing strings creations. &lt;code&gt;StringBuilder&lt;/code&gt; is better because it do not creates strings until you call &lt;strong&gt;.&lt;/strong&gt;&lt;code&gt;ToString&lt;/code&gt; method of &lt;code&gt;StringBuilder&lt;/code&gt; class.&lt;/p&gt;</description></item><item><title>Expression parsing and nested properties</title><link>https://internetexception.com/2014/02/22/expression-parsing-and-nested-properties/</link><pubDate>Sat, 22 Feb 2014 03:00:00 +0100</pubDate><guid>https://internetexception.com/2014/02/22/expression-parsing-and-nested-properties/</guid><description>&lt;p&gt;In one of projects I was working on, I needed to get property value from property path and property path from expression. First, lets cover second case. With expression in form of nested property value:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;()=&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;object1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;object2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;object3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;object4&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;we cannot take simple value of some property, because we have only root object, &lt;code&gt;object1&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>WebSocket libraries comparison</title><link>https://internetexception.com/2014/02/21/websocket-libraries-comparison/</link><pubDate>Fri, 21 Feb 2014 14:38:00 +0100</pubDate><guid>https://internetexception.com/2014/02/21/websocket-libraries-comparison/</guid><description>&lt;p&gt;Web project often requires to push data to clients as fast as possible, whenever it is necessary without waiting for client request. It is perfect for website with real time communication between users, like with online communicators for example. Or document collaboration tools. Or maybe system status updates on long running calculation/tasks performed by server. In every case two way communication mechanism is ideal.&lt;/p&gt;</description></item><item><title>Ninject and WCF</title><link>https://internetexception.com/2013/05/26/ninject-and-wcf/</link><pubDate>Sun, 26 May 2013 12:01:00 +0200</pubDate><guid>https://internetexception.com/2013/05/26/ninject-and-wcf/</guid><description>&lt;p&gt;Ninject is very simple and in the same time powerful IoC container. I used it in few project and had very little or none problems. Most of the time getting instances from Ninject kernel requires simple line with binding expression, or even this is sometime unnecessary if type is self bind able (i.e. if it is concrete class with parameterless constructor). Little harder is getting Ninject to work with WCF. You cannot just bind interfaces types because proxies which implements them are created through .NET mechanism. Luckily WCF system is very flexible and mostly can be changed/extended with custom functionality.&lt;/p&gt;</description></item><item><title>Mapping collection of entities in EF with AutoMapper</title><link>https://internetexception.com/2013/05/25/mapping-collection-of-entities-in-ef-with-automapper/</link><pubDate>Sat, 25 May 2013 11:38:00 +0200</pubDate><guid>https://internetexception.com/2013/05/25/mapping-collection-of-entities-in-ef-with-automapper/</guid><description>&lt;p&gt;In my &lt;a href="https://internetexception.com/2013/05/16/entity-framework-and-base-entity-class/"&gt;last post&lt;/a&gt;&#10; I explained why is useful to add base entity class in EF. Today I will write how with use of this base class an AutoMapped map collection of data objects (i.e. DTOs to existing collection of entities).&lt;/p&gt;</description></item><item><title>Entity Framework and Base Entity class</title><link>https://internetexception.com/2013/05/16/entity-framework-and-base-entity-class/</link><pubDate>Thu, 16 May 2013 14:32:00 +0200</pubDate><guid>https://internetexception.com/2013/05/16/entity-framework-and-base-entity-class/</guid><description>&lt;p&gt;Entity Framework does great job with taking care of entities changes and entities collection internally. And its uses almost plain POCO objects. Almost because collections of dependents data like in 1 to many tables relationship needs virtual keyword. Its understandable since EF needs to track what happens to collection. For instance lets have 2 tables: Customer and dependent Order. &lt;a class="img-zoom" href="https://internetexception.com/wp-content/uploads/2013/05/customer_order.png"&gt;&lt;img&#10; src="https://internetexception.com/wp-content/uploads/2013/05/customer_order.png"&#10; alt=""&#10; &#10; loading="lazy" decoding="async"&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Ninject and Entity Framework</title><link>https://internetexception.com/2013/05/03/ninject-and-entity-framework/</link><pubDate>Fri, 03 May 2013 03:50:00 +0200</pubDate><guid>https://internetexception.com/2013/05/03/ninject-and-entity-framework/</guid><description>&lt;p&gt;&lt;a href="https://internetexception.com/2013/04/23/entity-framework-patterns-extension-and-unit-test-in-visual-studio-2012/" target="_blank" rel="noopener noreferrer"&gt;Last time&lt;/a&gt; I wrote about problem with testing Entity Framework in Visual Studio 2012. During working on this project I also encounter problems with configuration of Ninject to allow injecting Entity Framework classes from its Patterns extension. To be frankly this was not much a problem then lack of documentation. I just was forced to experiment with Ninject and new-thing-for-me Entity Framework Patterns extension.&lt;/p&gt;</description></item><item><title>Entity Framework Patterns extension and Unit Test in Visual Studio 2012</title><link>https://internetexception.com/2013/04/23/entity-framework-patterns-extension-and-unit-test-in-visual-studio-2012/</link><pubDate>Tue, 23 Apr 2013 02:18:00 +0200</pubDate><guid>https://internetexception.com/2013/04/23/entity-framework-patterns-extension-and-unit-test-in-visual-studio-2012/</guid><description>&lt;p&gt;Yesterday I was trying to make work simple test class in VS2012. I did not know what was wrong exactly. It was first project when I tried to glue together Entity Framework with repository pattern and Ninject as IoC container. Because of the fact that this was first time for solution like that I was sure that it is me, or rather source of my problem was indeed my code. But let&amp;rsquo;s not skip ahead.&lt;/p&gt;</description></item><item><title>Line in WebGL and why you gonna do this on your own.</title><link>https://internetexception.com/2013/02/26/line-in-webgl-and-why-you-gonna-do-this-on-your-own/</link><pubDate>Tue, 26 Feb 2013 02:15:00 +0100</pubDate><guid>https://internetexception.com/2013/02/26/line-in-webgl-and-why-you-gonna-do-this-on-your-own/</guid><description>&lt;p&gt;WebGL as method for generating 3D graphic in browser and it is pretty powerful. You can do really awesome things with this, like &lt;a href="http://code.google.com/p/quake2-gwt-port/" target="_blank" rel="noopener noreferrer"&gt;porting Quake 2 to JavaScript&lt;/a&gt;&#10; or creating &lt;a href="http://www.zygotebody.com/" target="_blank" rel="noopener noreferrer"&gt;model of human body&lt;/a&gt;&#10;. But all of this 3D object are complex collection of hundreds or thousands triangles. What if you just want to draw a simple thin line? Luckily OpenES have support for that. So it is possible. Lets see how to do that.&lt;/p&gt;</description></item><item><title>Cartezian coordinate system in HTML 5 canvas</title><link>https://internetexception.com/2013/02/23/cartezian-coordinate-system-in-html-5-canvas/</link><pubDate>Sat, 23 Feb 2013 14:35:00 +0100</pubDate><guid>https://internetexception.com/2013/02/23/cartezian-coordinate-system-in-html-5-canvas/</guid><description>&lt;p&gt;Normally canvas 2D context is using custom coordinate transform where Y coordinates are flipped vertically. Here is image with example (taken from &lt;a href="http://diveintohtml5.info/canvas.html" target="_blank" rel="noopener noreferrer"&gt;http://diveintohtml5.info/canvas.html&lt;/a&gt;&#10;; it is great book and you should read it :) ) &lt;a class="img-zoom" href="https://internetexception.com/wp-content/uploads/2013/02/canvas.png"&gt;&lt;img&#10; src="https://internetexception.com/wp-content/uploads/2013/02/canvas.png"&#10; alt=""&#10; &#10; loading="lazy" decoding="async"&gt;&lt;/a&gt; It is a bit inconvenient to use if you are drawing some shapes with points given in classic Cartezian coordinate system.&lt;/p&gt;</description></item><item><title>Simple 2D graphs</title><link>https://internetexception.com/2013/02/17/simple-2d-graphs/</link><pubDate>Sun, 17 Feb 2013 02:26:00 +0100</pubDate><guid>https://internetexception.com/2013/02/17/simple-2d-graphs/</guid><description>&lt;p&gt;While writing application for my Masters Degree diploma I was required to came up with simple library for creating simple 2D graphs in the browser. Today I decided to share it with the rest of the world :)&lt;/p&gt;</description></item><item><title>Curious Case of Visual Studio project compatibility.</title><link>https://internetexception.com/2013/02/12/curious-case-of-visual-studio-project-compatibility/</link><pubDate>Tue, 12 Feb 2013 08:06:00 +0100</pubDate><guid>https://internetexception.com/2013/02/12/curious-case-of-visual-studio-project-compatibility/</guid><description>&lt;p&gt;Recently I was asked at work for quick review of small project. It was created (or updated) in newest version of Visual Studio - 2012. I don&amp;rsquo;t have installed VS 2012. I could install it, yes, but it would be just waste of time since browsing through code in that project took me only few hours. So I decided to try to open that in VS 2010.&lt;/p&gt;</description></item><item><title>Why I don't like Python anymore.</title><link>https://internetexception.com/2013/02/07/why-i-dont-like-python-anymore/</link><pubDate>Thu, 07 Feb 2013 06:45:00 +0100</pubDate><guid>https://internetexception.com/2013/02/07/why-i-dont-like-python-anymore/</guid><description>&lt;p&gt;It was few years back on my first year of studies, when my friend told me about Python. Then it was great for me. One-liners could read ftp folders, web pages, interact with operation system, list comprehension, injecting code into life programs, nested functions, procedural as object oriented programming styles etc. etc. All of this in builtin libraries with simple but yet quite functional editor, supported with great documentation. I wrote my first studies project in Python and I was proud with it a little ;) During next years I was using Python for writing simple scripts to automate my professional work as PHP programmer. Python was and I still think is better language then PHP. After that I started to work as .NET/C# developer. It has different syntax but C similarities let me to learn it quite quick. Framework .NET is powerful tool also so I didn&amp;rsquo;t touch Python for 2 or 3 years at least for anything longer then few lines.&lt;/p&gt;</description></item><item><title>Using Matlab from C# application.</title><link>https://internetexception.com/2013/01/20/using-matlab-from-c-application/</link><pubDate>Sun, 20 Jan 2013 11:25:00 +0100</pubDate><guid>https://internetexception.com/2013/01/20/using-matlab-from-c-application/</guid><description>&lt;p&gt;While writing an application for my Masters degree diploma, I wrote a simple application that was using COM Matlab server. I have found it hard to use it mainly due to lack of documentation, which is really basic with only few code examples for C#. I guess writing programs that use Matlab for calculating is not encouraged by MathWorks, you would became competition that way :) Nonetheless, I accomplished why I was required to do, so I decided to share this with the rest of the world.&lt;/p&gt;</description></item><item><title>Server controls in separete assembly part 2</title><link>https://internetexception.com/2012/12/24/server-controls-in-separete-assembly-part-2/</link><pubDate>Mon, 24 Dec 2012 05:14:00 +0100</pubDate><guid>https://internetexception.com/2012/12/24/server-controls-in-separete-assembly-part-2/</guid><description>&lt;p&gt;&lt;a href="https://internetexception.com/2012/12/22/server-controls-in-separate-assembly/"&gt;Yesterday I was writing about creating server controls in separate assembly&lt;/a&gt;&#10;. Today I will cover more complicated example then simple &amp;ldquo;Hello World!&amp;rdquo; control. My goal was to create text box that will take handler method to run when validation event will be triggered, and when validation fail will show appropriate message. Text box with builtin validation would be nice, since &lt;a href="http://searchsoftwarequality.techtarget.com/tip/The-importance-of-input-validation" target="_blank" rel="noopener noreferrer"&gt;you always&lt;/a&gt;&#10; &lt;a href="http://www.ibm.com/developerworks/library/l-sp2/index.html" target="_blank" rel="noopener noreferrer"&gt;should&lt;/a&gt;&#10; &lt;a href="http://web.securityinnovation.com/appsec-weekly/blog/?Tag=Input%20and%20Data%20Validation" target="_blank" rel="noopener noreferrer"&gt;validate&lt;/a&gt;&#10; &lt;a href="http://www.securityninja.co.uk/secure-development/input-validation/" target="_blank" rel="noopener noreferrer"&gt;user input&lt;/a&gt;&#10;, right? But lets start creating our control.&lt;/p&gt;</description></item><item><title>Server controls in separate assembly</title><link>https://internetexception.com/2012/12/22/server-controls-in-separate-assembly/</link><pubDate>Sat, 22 Dec 2012 14:52:00 +0100</pubDate><guid>https://internetexception.com/2012/12/22/server-controls-in-separate-assembly/</guid><description>&lt;p&gt;In my project I wanted to create text box control with builtin configurable validation. ASP.NET definition in &lt;code&gt;.aspx&lt;/code&gt; or &lt;code&gt;.ascx&lt;/code&gt; file would get validation function by name. But I do not wanted to create just &lt;code&gt;.ascx&lt;/code&gt; file with text box. I could not then reuse that control in other projects and it certainly would be nice, right? Creating such server control from code is not hard, but maintainability of HTML code in C# (it cannot be done other way) is not good. It&amp;rsquo;s pain really. Why Microsoft would create way to automatically create C# code from &lt;code&gt;.ascx&lt;/code&gt;, &lt;code&gt;.aspx&lt;/code&gt; files is mystery for me.&lt;/p&gt;</description></item><item><title>Handling Ajax errors in ASP.NET</title><link>https://internetexception.com/2012/12/22/handling-ajax-errors-in-asp-net/</link><pubDate>Sat, 22 Dec 2012 09:58:00 +0100</pubDate><guid>https://internetexception.com/2012/12/22/handling-ajax-errors-in-asp-net/</guid><description>&lt;p&gt;Yesterday I wrote about &lt;a href="https://internetexception.com/2012/12/21/global-updatepanel-loading-indicator-in-asp-net/"&gt;issue with Ajax postbacks&lt;/a&gt;&#10; in application I am working currently. Problem was with buttons that was triggering &lt;code&gt;UpdatePanels&lt;/code&gt; to update asynchronously. After adding loading indicator I wanted to add error handling at client side.&lt;/p&gt;</description></item><item><title>Global UpdatePanel loading indicator in ASP.NET</title><link>https://internetexception.com/2012/12/21/global-updatepanel-loading-indicator-in-asp-net/</link><pubDate>Fri, 21 Dec 2012 10:48:00 +0100</pubDate><guid>https://internetexception.com/2012/12/21/global-updatepanel-loading-indicator-in-asp-net/</guid><description>&lt;p&gt;When I started working on application I am working right now, one of first things I noticed, that was not entirely wrong but was inconvenient: when user clicked on some button that triggers update panel you was not entirely sure it worked or not. Why? Because of three things:&lt;/p&gt;</description></item><item><title>Better algorithm for finding UpdatePanel that will be updated during page request.</title><link>https://internetexception.com/2012/12/13/better-algorithm-for-finding-updatepanel-that-will-be-updated-during-page-request/</link><pubDate>Thu, 13 Dec 2012 15:50:00 +0100</pubDate><guid>https://internetexception.com/2012/12/13/better-algorithm-for-finding-updatepanel-that-will-be-updated-during-page-request/</guid><description>&lt;p&gt;Other day I was experimenting with finding which &lt;a href="https://internetexception.com/2012/12/10/display-message-on-client-from-anywhere-in-code-with-asp-net/"&gt;UpdatePanel will be updated during page post back.&lt;/a&gt;&#10; I found out that my solution was not working correctly for complex triggers, like user controls with custom events, which will trigger async postbacks and update of panel. Or for grids with buttons. It was big issue. Also it was not pointing to correct &lt;code&gt;UpdatePanel&lt;/code&gt; if name of control was not entirely unique (for example when you have multiple same custom controls on page). It would return first panel, even if it wasn&amp;rsquo;t updating.&lt;/p&gt;</description></item><item><title>Display message on client from anywhere in code with ASP.NET</title><link>https://internetexception.com/2012/12/10/display-message-on-client-from-anywhere-in-code-with-asp-net/</link><pubDate>Mon, 10 Dec 2012 09:20:00 +0100</pubDate><guid>https://internetexception.com/2012/12/10/display-message-on-client-from-anywhere-in-code-with-asp-net/</guid><description>&lt;p&gt;When I was working with WinForms application in previous work I have found one of most useful feature, ability to show some message to the client. For example user cannot edit some entity in particular time (it is being edited by someone else) or should change password because it will expire in x days. I wanted to do something similar in my web application.&lt;/p&gt;</description></item><item><title>Getting private field or property from object</title><link>https://internetexception.com/2012/12/09/getting-private-field-or-property-from-object/</link><pubDate>Sun, 09 Dec 2012 07:26:00 +0100</pubDate><guid>https://internetexception.com/2012/12/09/getting-private-field-or-property-from-object/</guid><description>&lt;p&gt;Yesterday I was playing with finding all &lt;code&gt;UpdatePanel&lt;/code&gt; controls on page during generating response in ASP.NET. Since object with this information is private itself and collection of panels is private in that object, I had to write some code to extract that data. I ended up with to extension methods for &lt;code&gt;Object&lt;/code&gt; type, for getting private field an private property. It&amp;rsquo;s pretty straightforward, besides one thing: since member is private. And we don&amp;rsquo;t know in witch type exactly (every type in base/descendant hierarchy have it&amp;rsquo;s one private members) we have to search them all. So this is final code:&lt;/p&gt;</description></item></channel></rss>