development

Extended GIT Information in bash PS1

Posted on

Extended GIT Information in bash PS1 This will generate shell similar to this : Multiline version: ┌──┤ greg: ~/dev/discovery/discovery-agent │ master ≡ !1 +2 -2 ≡ 2 weeks ago └── λ Format `branch ≡ changes additions deletions ≡ last commit` Example `master ≡ !1 +2 -2 ≡ 2 weeks ago` Since we are interested in […]

cpp

Counting transitions in a bit string

Posted on

We need to count a number of transitions in a bit string from 0->1 and 1->0. I needed this in order to determine Uniform Descriptor in Local Binary Patterns(LBP) Samples 0000 0000 (0 Transitions : Uniform) 0x0 1110 0011 (2 Transitions : Uniform) 0xE3 0101 0000 (4 Transitions : NonUniform) 0x50 0000 1010 (4 Transitions […]

development

Fingerprint cannot be generated while adding new ssh key in GitLab

Posted on

This applies to Windows only machines. I have GitLab running and was adding a new ‘ssh key’ from windows that was generated using a standard ssk-keygen command but was reciving following error: “Fingerprint cannot be generated” Command used to generate key: ssh-keygen -t rsa -C “gbugaj@localhost” -b 4096 This produces a key in ‘id_rsa.pub’ file, […]

cpp

Overloading by return value in C++

Posted on

Here we have a method that allows us to determine return parameter type using templates and operator overloading in C++. This is something that I needed for a project that I am working on where a method call would give me the expected type based on the return type. Usage There is two way of […]

development

EventEmitter

Posted on

Our EventEmitter in PhantomSQL is based on NodeJS version so they should be compatible. Here are couple examples on how to use the emitter. Basic usage of registering and listening to an event. "use strict";   const {EventEmitter} = require(’events’);   // Dump all the args em.on(’hello-event’, (…arg)=> {console.info("Hello event handler : " + arg)}); […]

development

Run MD5 check sum against all files in a directory

Posted on

Couple snippets that allow us to run checksum and get unique md5 checksums. This is two step process. First, we obtain our md5 checksum for all files find -type f -exec md5sum "{}" + > /opt/checklist.chkfind -type f -exec md5sum "{}" + > /opt/checklist.chk This produces file with following contents 71cc452a8ac5a27c32a83e6a0909e7ae ./PID_190_7344_0_47710322.tif6712032974632727465.tiff 71cc452a8ac5a27c32a83e6a0909e7ae ./PID_190_7344_0_47710322.tif174464329785828524.tiff 71cc452a8ac5a27c32a83e6a0909e7ae […]

development

Starting jetty via command line an nohup

Posted on

Somehow I am getting problems starting Jetty via service jetty start We will be using unix command called nohup “Nohup is a unix command, used to start another program, in such a way that it does not terminate when the parent process is terminated.” I have opted out for using this nohup java -jar start.jar […]

cpp

Compiling Webkit on Windows using Visual Studio 2012

Posted on

Just some notes on compiling WebKit on windows with visual studio. Issues : C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xrefwrap(431): error C2064: term does not evaluate to a function taking 1 arguments (..\..\win\WebCoreSupport\WebFrameLoaderClient.cpp) 25> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\functional(239) : see reference to function template instantiation ‘_Ret std::_Callable_obj::_ApplyX(_V0_t &&)’ being compiled 25> with 25> [ […]