sql

Setting Firing Order Of SQL Triggers

Posted on

At times there is a need to control order of execution of triggers. This could be due to business requirement but also as a way to control history of a record I usually don’ t see people put any way to prevent trigger nesting, example update trigger updating same records would fire the trigger again.

Uncategorized

RabittMQ RPC Request/Response example

Posted on

RabittMQ RPC Request/Response example using hoplin.io library Following example creates RPC client and then setups Async response handler, which follows by the request to get processed. Hoplin client supports both Direct-Reply and Queue per Request/Response patterns. This is the binding that is used to create our client.

development

hoplin.io A lightweight RabbitMQ client for Java (built on top of rabittmq java client)

Posted on

A lightweight RabbitMQ client for Java (built on top of rabittmq java client) Documentation and project available at GitHub repohttps://github.com/gregbugaj/hoplin.io To make working with RabbitMQ as simple as possible with minimum dependencies. Minimal dependencies, simple configuration and API. Subscriber client Publisher client Async RPC Client Creating simple RabbitMQ client can be done in couple different […]

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 […]

Uncategorized

Hamming distance calculation

Posted on

This is a small snippet of how to calculate hamming distance in cpp with small bit of assembly for doing a population count. Code typedef unsigned long long hash_t;   #include <iostream> #include <bitset>   int popcount64(const hash_t& val) noexcept { int ret; __asm__ ("popcnt %1, %1" : "=r" (ret) : "0" (val)); return ret; […]

Uncategorized

Histogram Comparison for Image Analysis

Posted on

DRAFT This is the first article in the series on Image Comparison using Local Binary Patterns. Complete code is on github lbp-matcher We will start off by looking at different methods of comparing histograms. Histogram Intersection Log Likehood Chi Squared Kullback Leibler Divergence All our operations will be performed on 8bpp(bits per pixel) images anything […]

cpp

Dump leptonica pix data to console

Posted on

Small utility for dumping Leptonica Pix data to the screen. void dump(PIX* pix) { int_t w = pix->w; int_t h = pix->h;   int_t wpl = pixGetWpl(pix); l_uint32* data = pixGetData(pix); l_uint32* line;   printf("\n"); printf("Depth : %d \n", pix->d);   for (int_t y = 0; y < h; ++y) { printf("%04d : ", y); […]

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, […]