Author Archives

Archive of the posts written by author : afish.

Windows Research Kernel Part 1 — Compiling and debugging

Nowadays Microsoft is very happy to share code of its tools with the open source community. But it wasn’t always the same — .NET Framework code wasn’t freely available, however, there was the project Rotor (or Shared Source CLI 2.0) which was a…

Dynamically loading JAR file in Zeppelin

Imagine that you need to load JAR file dynamically in Zeppelin working on your EMR cluster. One easy way is to deploy the file to the instance and load it from there, however, what can you do if you have almost no access…

Generating class in Zeppelin

If you want to declare a class in Zeppelin and create instance of it, you might be surprised: class K defined class K classOf[K].newInstance() java.lang.InstantiationException: K at java.lang.Class.newInstance(Class.java:427) … 52 elided Caused by: java.lang.NoSuchMethodException: K.() at java.lang.Class.getConstructor0(Class.java:3082) at java.lang.Class.newInstance(Class.java:412) … 52 more What…

ILP Part 50 — MST, vertex cover and edge cover

This is the fiftieth part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra Today we are going to solve three graph problems: vinimum spanning tree, vertex cover and…

Custom memory allocation in C# Part 8 — Unsafe list in .NET Core x64

This is the eighth part of the Custom memory allocation series. For your convenience you can find other parts in the table of contents in Part 1 — Allocating object on a stack Today we are going to revisit an Unsafe list example…

Reordered code after compilation

Can one line of code in C# JIT compile into two different blocks of code in the same program? This sounds a little tricky but in fact is very easy and happens pretty often. Consider the following code: using System; namespace Reordering {…

Custom memory allocation in C# Part 7 — Stack allocation once again

This is the seventh part of the Custom memory allocation series. For your convenience you can find other parts in the table of contents in Part 1 — Allocating object on a stack We know how to allocate object on a stack, however,…

Concurrency Part 6 – Abandoned mutex

This is the sixth part of the Concurrency series. For your convenience you can find other parts in the table of contents in Part 1 – Mutex performance in .NET Let’s start with the following code: using System; using System.Threading; namespace AbandonedMutex {…

Concurrency Part 5 – WinAPI mutex

This is the fifth part of the Concurrency series. For your convenience you can find other parts in the table of contents in Part 1 – Mutex performance in .NET Last time we called WinAPI through P/Invoke, today we are going to call…

Concurrency Part 4 – .NET with P/Invoke

This is the fourth part of the Concurrency series. For your convenience you can find other parts in the table of contents in Part 1 – Mutex performance in .NET We have already seen a mutex in C# but last time it happened…

Concurrency Part 3 – Java mutex via JNI

This is the third part of the Concurrency series. For your convenience you can find other parts in the table of contents in Part 1 – Mutex performance in .NET Last time we saw file lock in Java which we can use on…

Concurrency Part 2 – Java file lock

This is the second part of the Concurrency series. For your convenience you can find other parts in the table of contents in Part 1 – Mutex performance in .NET Today we explore system-wide lock in Java 1.8.0_161 on Windows 10 x64. There…

Concurrency Part 1 – Mutex performance in .NET

This is the first part of the Concurrency series. For your convenience you can find other parts using the links below: Part 1 — Mutex performance in .NET Part 2 — Java file lock Part 3 — Java mutex via JNI Part 4…

ILP Part 49 — Deadline24 2018 – Flow

This is the forty ninth part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra Today we solve the task B from Deadline24 2018 edition. Sewage system Introduction Beetlejumpers…

ILP Part 48 — Shapes and colors

This is the forty eighth part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra You are given board with thirty rows and fifteen columns. For each cell you…

.NET Inside Out Part 8 — Handling Stack Overflow Exception in C# with VEH

This is the eighth part of the .NET Inside Out series. For your convenience you can find other parts in the table of contents in Part 1 – Virtual and non-virtual calls in C# If you are interested in the topic see the…

DLL Injection Part 7 — Injecting Java code

This is the seventh part of the DLL Injection series. For your convenience you can find other parts in the table of contents in Part 1 – Registry We already injected native code into target, managed code into default application domain, and managed…

.NET Inside Out Part 7 — Generating Func from a bunch of bytes in C#

This is the seventh part of the .NET Inside Out series. For your convenience you can find other parts in the table of contents in Part 1 – Virtual and non-virtual calls in C# In Capturing thread creation to catch exceptions we generated…

Transaction Scope time limit in ADO.NET

In ADO.NET there is a hard-coded system-wide limit for transaction set to 10 minutes. You cannot change it just like that in your web.config or App.config. You can change it in machine.config though. First, where are the machine configs? For 32 Bits: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machie.config…

VBS script to send an HTTP request

Another post with little script: Set o = CreateObject(“MSXML2.XMLHTTP”) o.open “GET”, “https://page.com”, False o.setRequestHeader “Header”, “Header value” ‘ Ignore certs (I bet you want to know how to do it) ‘ 2 stands for SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS ‘ 13056 means ignore all server side cert…