Category Archives

Archive of posts published in the category: Coding

Machine Learning Part 5, ILP Part 51 — Linear regression

This is the fifty first part of the ILP series. For your convenience you can find other parts in the table of contents in Part 1 – Boolean algebra This is the fifth part of the ML series. For your convenience you can…

Machine Learning Part 4 — Linear regression in T-SQL

This is the fourth part of the ML series. For your convenience you can find other parts in the table of contents in Part 1 – Linear regression in MXNet This time we are going to implement linear regression as a function. This…

Machine Learning Part 3 — Linear regression in SQL revisited

This is the third part of the ML series. For your convenience you can find other parts in the table of contents in Part 1 – Linear regression in MXNet Last time we saw how to calculate linear regression for the Iris dataset.…

Machine Learning Part 2 — Linear regression in SQL

This is the second part of the ML series. For your convenience you can find other parts in the table of contents in Part 1 – Linear regression in MXNet Image that you have only a data warehouse with SQL capabilities to train…

Machine Learning Part 1 — Linear regression in MXNet

This is the first part of the Machine Learning series. For your convenience you can find other parts using the links below (or by guessing the address): Part 1 — Linear regression in MXNet Part 2 — Linear regression in SQL Part 3…

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

This is the ninth 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# We know how to generate delegate from a byte…

Async Wandering Part 5 — Catching exceptions from async void

This is the fifth part of the Async Wandering series. For your convenience you can find other parts in the table of contents in Part 1 – Why creating Form from WinForms in unit tests breaks async? Last time we saw how to…

Custom memory allocation in C# Part 11 — Benchmarking UnsafeList

This is the eleventh 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 I presented some results suggesting that UnsafeList is faster than…

Custom memory allocation in C# Part 10 — Hijacking new in .NET Core

This is the tenth 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 I had .NET Core 2.1.103 x64 installed and I wanted…

Custom memory allocation in C# Part 9 — Hijacking new in x64

This is the ninth 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 already hijacked new in C#. Last time we did…

Exception propagation in WinForms

Let’s start with the following code: using System; using System.Windows.Forms; class Program1 { [STAThread] static void Main() { var form = new Form(); form.Load += (sender, e) => throw new Exception(); try { Application.Run(form); } catch(Exception e) { MessageBox.Show(“This doesn’t execute”); } finally…

Random notes from crashing and hanging EMR Spark job

It sometimes happens that your EMR job crashes or hangs indefinitely with no meaningful log. You can try to capture memory dump but it is not very useful when your cluster machines have hundreds gigabytes of memory each. Below are “fixes” which worked…

Investigating AWS SDK conflicts in EMR

When you deploy your package to Amazon Elastic Map Reduce (EMR), you can access the AWS SDK provided by the platform. This gets tricky if you compile your code against different version of SDK because then you may get very cryptic bugs in…

Trivial ScheduledThreadPoolExecutor in C#

Today we are going to implement trivial ScheduledExecutorService in C#. Introduction We want to have a thread pool of fixed size which we can use to execute three types of tasks: One time tasks Tasks with fixed delay between executions Tasks with fixed…

Windows Research Kernel Part 4 — New module

This is the fourth part of the WRK series. For your convenience you can find other parts in the table of contents in Part 1 — Compiling and debugging To create a new module, you need to prepare some directories and a make…

Windows Research Kernel Part 3 — Syscall

This is the third part of the WRK series. For your convenience you can find other parts in the table of contents in Part 1 — Compiling and debugging Today we are going to write a very simple hello world in the kernel…

Windows Research Kernel Part 2 — Monitoring the function invocation

This is the second part of the WRK series. For your convenience you can find other parts in the table of contents in Part 1 — Compiling and debugging In this part we are going to monitor the invocation of QuerySystemInformation system function…

Windows Research Kernel Part 1 — Compiling and debugging

This is the first part of the WRK series. For your convenience you can find other parts using the links below (or by guessing the address): Part 1 – Compiling and debugging Part 2 – Monitoring and function invocation Part 3 — Syscall…

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…