Archive for the ‘Programing’ Category

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

This is a basic python string and string manipualtion tutorial. Strings are a special type of a python class. As objects, in a class, you can call methods on string objects using the .methodName() notation. The string class is available by default in python, so you do not need an import statement to use the object interface to strings. … Read the rest

These are the ten most rated questions at Stack Overflow last week.
Between brackets: [question score / answers count]
Build date: 2018-02-03 18:20:21 GMT


  1. Create index dictionary from integer list – [8/4]
  2. How can I use Regex to find a string of characters in alphabetical order using Python? – [7/4]
  3. How to keep track of instances of python objects in a reliable way? – [7/1]
  4. Converting String dictionary like to dictionary – [
Read the rest