Archive for the ‘Programing’ Category

March 30th, 2019

Back from C# to Java

No Comments, Programing, by admin.
I wanted to write a quick post about my move back from C# to Java.

In 2016 I chose to use C# as the language for a system I was developing. The release of .Net core prompted this move. The key benefits I expected from C# were:

  • Higher productivity
  • Ability to generate native executables – unfortunately, this did not materialize as it seems the AOT functionality in .Net Core was not a priority on server platforms
  • Easier integration with external
Read the rest

March 15th, 2019

(Not) using namespace std;

No Comments, Programing, by admin.

This is called a using directive. Using it in code that is supposed to work for years is not a good idea. Sometimes programmers are given advice to just type using namespace std; and all things from the Standard Library … Continue reading Read the rest

December 9th, 2018

Deducing your intentions

No Comments, Programing, by admin.

The language feature in C++17 known as class template argument deduction was intended to supersede factory functions like make_pair, make_tuple, make_optional, as described in p0091r2. This goal has not been fully achieved and we may still need to stick to … Continue reading Read the rest

Compiler warnings can sometimes help us find bugs before we even build our program, but it only works provided that we can make use of the warnings. Especially, when we are aware that warnings detect only symptoms of the bugs … Continue reading Read the rest

October 27th, 2018

Faces of undefined behavior

No Comments, Programing, by admin.

I have been busy recently (doing C++-related stuff) and cannot find a spare time for preparing a decent blog post. I expect that to change in November. For the interim I am posting here my last year’s talk at code::dive: … Continue reading Read the rest

September 27th, 2018

Glowroot and Axis

No Comments, Programing, by admin.

Unfortunately by default Glowroot does not support logging Axis’ service calls and their response time. You have to write a plugin for this, which is actually very easy once you grasp how the plugins work.

 

package org.glowroot.agent.plugin.axis.v.one;

import javax.xml.namespace.QName;

import org.glowroot.agent.plugin.api.Agent;
import org.glowroot.agent.plugin.api.MessageSupplier;
import org.glowroot.agent.plugin.api.ThreadContext;
import org.glowroot.agent.plugin.api.ThreadContext.Priority;
import org.glowroot.agent.plugin.api.Timer;
import org.glowroot.agent.plugin.api.TimerName;
import org.glowroot.agent.plugin.api.TraceEntry;
import org.glowroot.agent.plugin.api.checker.Nullable;
import org.glowroot.agent.plugin.api.weaving.BindReceiver;
import org.glowroot.agent.plugin.api.weaving.BindThrowable;
import org.glowroot.agent.plugin.api.weaving.BindTraveler;
import org.glowroot.agent.plugin.api.weaving.OnBefore;
import org.glowroot.agent.plugin.api.weaving.OnReturn;
import org.glowroot.agent.plugin.api.weaving.OnThrow;
import org.glowroot.agent.plugin.api.weaving.Pointcut;
import org.glowroot.agent.plugin.api.weaving.Shim;

public class AxisAspect {

  @Shim("org.apache.axis.client.Call")
  public interface Call 
Read the rest

July 7th, 2018

Functions in std

No Comments, Programing, by admin.

Names of functions from the Standard Library used as pointers/references to functions can cause breakage in your code if you are upgrading to the newer version of C++ or compiling using a different implementation of the Standard Library, or even … Continue reading Read the rest

May 16th, 2018

Rvalues redefined

No Comments, Programing, by admin.

In this post we will explore what I consider the most significant language change in C++17. I call it the most significant because it changes the way you design your resource-managing types and how you think about initialization. It is … Continue reading Read the rest

May 10th, 2018

Testing C++ online

No Comments, Programing, by admin.

In this short post I wanted to share links to three online services that I use for testing different aspects of C++ and C++ compilers. https://wandbox.org/ — this allows you to compile and observe the output of programs compiled in … Continue reading Read the rest

Let’s start with the problem. I want to check whether a program received a text message that consists of four consecutive zeroes. Not ‘0’, but the numeric zero. I will create a constant std::string representing the special sequence and compare … Continue reading Read the rest