<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on pnkv - Nick's blog</title><link>/post/</link><description>Recent content in Posts on pnkv - Nick's blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 19 Nov 2022 19:39:15 +0100</lastBuildDate><atom:link href="/post/index.xml" rel="self" type="application/rss+xml"/><item><title>Using C++ library From Rust - DepthAI RGB Camera Example</title><link>/post/2022/11/19/using-cpp-from-rust-depthai-core-rgb-camera-example/</link><pubDate>Sat, 19 Nov 2022 19:39:15 +0100</pubDate><guid>/post/2022/11/19/using-cpp-from-rust-depthai-core-rgb-camera-example/</guid><description>&lt;p>There has been a long time since the my last post, and many things happend. I have been persuaded by Alex to join AdVentura Works SA to a very exiting adventure, touching one of my passions in embedded software, robotics, AI/CV/ML. I have left Zest Labs GmbH and joined the new startup, where we are making the warehouse operations more safe and efficient. We have lots of opportunities in the area of tele-operations, AI assited operations, tasks and operation optimisations.&lt;/p></description></item><item><title>Maintaining uniqueness using golang and cassandra light weight transactions (LWT)</title><link>/post/2020/11/11/golang-cassandra-lwt/</link><pubDate>Wed, 11 Nov 2020 16:41:00 +0100</pubDate><guid>/post/2020/11/11/golang-cassandra-lwt/</guid><description>&lt;p>CCommon case when running a backend system is to require some kind of uniqueness of the records, based on their content. Wheneven having a transactional system, that is pumped with events from other systems/services, every transaction is with generated UUID, but this does not guarantee that the source is unique. There are many cases, where there is backend service that sends data, and if the call fails, the data sending is retried. There are plenty of ways to handle this case with SQL databases, but I would like to explain how we approach the problem in highly scalable system, relying on NoSQL database in AP segment of CAP Theorem - Cassandra.&lt;/p></description></item><item><title>Managing your IdP with terraform</title><link>/post/2020/10/31/terraform-keycloak/</link><pubDate>Sat, 31 Oct 2020 20:55:15 +0100</pubDate><guid>/post/2020/10/31/terraform-keycloak/</guid><description>&lt;p>Often when you want to implement authenticaiton/identity provider in your system, you turn to a well tested solution that is already on the market. Writting a good full OAuth2/OIDC/Federation IdP Provider is not a simple task, and if you start from scratch - you can consider it 3-6 months with good size pizza team, that is experienced in the technologies - to go through the whole implementation cycle.
There are plenty of solutions out there, and quite a good ones - Auth0, Google OAuth, Github OAuth, AWS Cognito. Those are all external indentity providers that you can hook into your product, and rely on them. The problem usually is that mojority of Enterprises would like to keep the solution inhouse. They are even not ready to do federation through the public internet.&lt;/p></description></item><item><title>Playing with kaniko and kubernetes internal docker registry</title><link>/post/2018/06/23/kaniko-private-registry/</link><pubDate>Sun, 01 Jul 2018 18:44:45 +0100</pubDate><guid>/post/2018/06/23/kaniko-private-registry/</guid><description>&lt;p>General idea here is to deploy a docker resgistry inside kubernetes and to use it just for putting the images that we build in the cluster, and to serve them to the same cluster.&lt;/p>
&lt;p>Few considerations&lt;/p>
&lt;ul>
&lt;li>
&lt;p>We are not going to secure the registry, the presumtions will be that your k8s cluster nodes run in a private network. If you want to secure pulling images in a secure way, you have to consider few more steps.&lt;/p></description></item><item><title>Gcqlsh</title><link>/post/2016/10/23/gcqlsh/</link><pubDate>Sun, 30 Oct 2016 22:14:45 +0100</pubDate><guid>/post/2016/10/23/gcqlsh/</guid><description>&lt;p>It has been a long time since the last post. It is time to show my new open source project - &lt;a href="https://github.com/npenkov/gcqlsh" title="gcqlsh" target="_blank" rel="nofollow noopener">gcqlsh&lt;/a>. The idea came when I was preparing some Cassandra docker images and I wanted to stay minimalistic with our CI infrastructure. So I have based my Cassandra docker image on Alpine. Unfortunatly came the frustration with installing python and all the dependencies. On the other hand, I needed an utility for automating the schema creation withing the docker container on first start.
There it came Golang with its beautiful architecture and performance. Write you code. Build it for any architecture - and you have one single performant binary without need of any dependencies.
If you are interested - make sure to visit the project&amp;rsquo;s github page.
Ideas and contributions are also welcome.&lt;/p></description></item><item><title>Caching Prepared Sqlite Statements in iOS Application</title><link>/post/2013/08/02/caching-prepared-sqlite-statements-in-ios-application/</link><pubDate>Fri, 02 Aug 2013 23:08:00 +0000</pubDate><guid>/post/2013/08/02/caching-prepared-sqlite-statements-in-ios-application/</guid><description>&lt;p>Many applications use Core data for iOS devices, others utilize frameworks like fmdb. But there are also people that write SQLite access from scratch. The comes the answer - how do you cache prepared statements (I will not discuss here why we cache prepared statements)?&lt;/p>
&lt;p>Well - I have implemented 2 methods:&lt;/p>
&lt;ul>
&lt;li>
&lt;ol>
&lt;li>Using C syntax to maintain array of &lt;strong>sqlite_stmt&lt;/strong>*&lt;/li>
&lt;/ol>
&lt;/li>
&lt;li>
&lt;ol start="2">
&lt;li>Using &lt;strong>NSPointerArray&lt;/strong>* to store &lt;strong>sqlite_stmt&lt;/strong>* that are prepared&lt;/li>
&lt;/ol>
&lt;/li>
&lt;/ul>
&lt;p>First approach has it&amp;rsquo;s advantages in regards of using older SDKs (NSPointerArray is available from iOS 6.0+)&lt;/p></description></item><item><title>Migrating From Svn to Git</title><link>/post/2013/04/21/migrating-from-svn-to-git/</link><pubDate>Sun, 21 Apr 2013 13:05:48 +0000</pubDate><guid>/post/2013/04/21/migrating-from-svn-to-git/</guid><description>&lt;p>Suppose you have a SVN repository and you would like to move to GIT - there might be many arguments around this. Well - here are some steps that I have tried to synthesise after many attempts and reading in internet. I am sure there are many approaches, but this one works for me straight forward.&lt;/p>
&lt;p>The whole procedure consists of several steps:&lt;/p>
&lt;ul>
&lt;li>Extracting users from SVN and creating a mapping file SVN_USER &amp;lt;-&amp;gt; GIT_USER&lt;/li>
&lt;li>Cloning SVN repository into GIT repository&lt;/li>
&lt;li>Migrating branches&lt;/li>
&lt;li>Migrating tags&lt;/li>
&lt;li>Creating new GIT detached repository and pushing all changes to it&lt;/li>
&lt;/ul>
&lt;p>Here are some assumptions:&lt;/p></description></item><item><title>How to Speed Up Android Emulator on UX System</title><link>/post/2012/08/05/how-to-speed-up-android-emulator-on-ux-system/</link><pubDate>Sun, 05 Aug 2012 11:29:01 +0000</pubDate><guid>/post/2012/08/05/how-to-speed-up-android-emulator-on-ux-system/</guid><description>&lt;p>If you are developing for Android, you probably have already abandoned the emulator that comes with Android SDK, and are testing and debugging on a real device. I cannot blame you - the emulator is awfully slow. Well I have good news for you - you can speed it up, if you are using uX system (Unix like - Linux, Mac OS X, BSD).&lt;/p>
&lt;p>The trick is very simple - and I suppose some of you have already activated it - &lt;strong>mount /tmp folder into memory&lt;/strong>. The reason why the emulator is much more faster - is that when the emulator is started, the image is expanded into &lt;strong>/tmp&lt;/strong> folder - and all the communication goes through there. Normally it goes through DiskIO, and the trick is to do it through much faster channel - memory.&lt;/p></description></item><item><title>Setting Environment Variables in Mac Os X</title><link>/post/2012/03/17/setting-environment-variables-in-mac-os-x/</link><pubDate>Sat, 17 Mar 2012 21:32:49 +0000</pubDate><guid>/post/2012/03/17/setting-environment-variables-in-mac-os-x/</guid><description>&lt;p>Once you have experience (or not) with some uX system, at some point you have to deal with environment variables, especially if you intend to do some development. I used to come from Open Source uX systems, and some old ones like HPUX, AIX, Solaris. When I switched to OS X, which is to some extent BSD - I had to find the best way to deal with env. variables. So - here are the ones that I use&lt;/p></description></item><item><title>First steps in creating Web service JSON enabled iOS application</title><link>/post/2012/01/28/first-steps-in-creating-web-service-json-enabled-ios-application/</link><pubDate>Sat, 28 Jan 2012 13:07:35 +0000</pubDate><guid>/post/2012/01/28/first-steps-in-creating-web-service-json-enabled-ios-application/</guid><description>&lt;p>This article continues the series for creating a web service consuming program on your mobile device. In the &lt;a href="/2012/01/25/first-steps-in-creating-your-web-service-enabled-mobile-application-using-json-geronimo-android-and-resteasy/" title="previous article">previous article&lt;/a> I have showed you how to create Server part (web service) on Geronimo and how to access it from Android app. Now we shall do the same with iOS application.&lt;/p>
&lt;p>So what do you need.&lt;/p>
&lt;ul>
&lt;li>Mac with OSX&lt;/li>
&lt;li>XCode IDE with iOS SDK&lt;/li>
&lt;li>&lt;a href="/2012/01/25/first-steps-in-creating-your-web-service-enabled-mobile-application-using-json-geronimo-android-and-resteasy/" title="Code and applications (server, IDE, code) from previous article in order to run the server">Code and applications (server, IDE, code) from previous article in order to run the server&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>So lets start. First create iOS Project - I prefer here to use &amp;ldquo;Single View Controller&amp;rdquo; template:&lt;/p></description></item><item><title>First steps in creating your web service enabled mobile application using JSON, Geronimo, Android and RESTEasy</title><link>/post/2012/01/25/first-steps-in-creating-your-web-service-enabled-mobile-application-using-json-geronimo-android-and-resteasy/</link><pubDate>Wed, 25 Jan 2012 17:23:20 +0000</pubDate><guid>/post/2012/01/25/first-steps-in-creating-your-web-service-enabled-mobile-application-using-json-geronimo-android-and-resteasy/</guid><description>&lt;p>This articles will reveal the first steps in setting up your development environment for building WebService/Enterprise Java applications and consuming their services from Android device. What I am using in this example:&lt;/p>
&lt;ul>
&lt;li>Geronimo with Jetty7 javaee5 - 2.2.1 - as application/web server&lt;/li>
&lt;li>Eclipse Indigo EE (with WTP plugin)&lt;/li>
&lt;li>Android SDK 4.0.3&lt;/li>
&lt;li>Google Gson 2.1&lt;/li>
&lt;li>Resteasy - jaxrs - 2.3.1.GA&lt;/li>
&lt;/ul>
&lt;p>Please don&amp;rsquo;t be bored from so many screenshots. If you know the basics you just can skip them. Please also don&amp;rsquo;t try to rewrite any code from them - source code is available for download at the end of the article.&lt;/p></description></item><item><title>Running ABAP queries with dynamic WHERE clause - UPDATED 2</title><link>/post/2011/11/24/running-abap-queries-with-dynamic-where-clause/</link><pubDate>Thu, 24 Nov 2011 16:26:57 +0000</pubDate><guid>/post/2011/11/24/running-abap-queries-with-dynamic-where-clause/</guid><description>&lt;p>Here comes a short and simple example for ABAP Programming. Suppose you want to make some more flexible function module for searching data in database table, that depending on parameters that are passed (can be optional), forms the WHERE clause of select statement. In ABAP this is pretty straight forward:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-abap" data-lang="abap">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">FUNCTION&lt;/span> &lt;span style="color:#8be9fd;font-style:italic">zsfli_sflight_getlist&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#6272a4">*&amp;#34;----------------------------------------------------------------------&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#6272a4">*&amp;#34;*&amp;#34;Local Interface:&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#6272a4">*&amp;#34; IMPORTING&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#6272a4">*&amp;#34; VALUE(P_CARRID) TYPE ZSFLIGHT-CARRID OPTIONAL&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#6272a4">*&amp;#34; VALUE(P_CONNID) TYPE ZSFLIGHT-CONNID OPTIONAL&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#6272a4">*&amp;#34; VALUE(P_FLDATE) TYPE ZSFLIGHT-FLDATE OPTIONAL&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#6272a4">*&amp;#34; TABLES&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#6272a4">*&amp;#34; FLIGHT_DATA STRUCTURE ZSFLIGHT&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#6272a4">*&amp;#34; RETURN STRUCTURE BAPIRET2&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#6272a4">*&amp;#34;----------------------------------------------------------------------&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">DATA&lt;/span> &lt;span style="color:#8be9fd;font-style:italic">l_where&lt;/span>(&lt;span style="color:#bd93f9">100&lt;/span>) &lt;span style="color:#8be9fd;font-style:italic">OCCURS&lt;/span> &lt;span style="color:#bd93f9">0&lt;/span> &lt;span style="color:#ff79c6">WITH&lt;/span> &lt;span style="color:#ff79c6">HEADER LINE&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">IF&lt;/span> &lt;span style="color:#8be9fd;font-style:italic">p_carrid&lt;/span> &lt;span style="color:#ff79c6">IS NOT INITIAL&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">APPEND&lt;/span> &lt;span style="color:#f1fa8c">&amp;#39;carrid = p_carrid&amp;#39;&lt;/span> &lt;span style="color:#ff79c6">TO&lt;/span> &lt;span style="color:#8be9fd;font-style:italic">l_where&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">ENDIF&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">IF&lt;/span> &lt;span style="color:#8be9fd;font-style:italic">p_connid&lt;/span> &lt;span style="color:#ff79c6">IS NOT INITIAL&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">IF&lt;/span> &lt;span style="color:#8be9fd;font-style:italic">l_where&lt;/span> &lt;span style="color:#ff79c6">IS INITIAL&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">APPEND&lt;/span> &lt;span style="color:#f1fa8c">&amp;#39; and &amp;#39;&lt;/span> &lt;span style="color:#ff79c6">TO&lt;/span> &lt;span style="color:#8be9fd;font-style:italic">l_where&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">ENDIF&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">APPEND&lt;/span> &lt;span style="color:#f1fa8c">&amp;#39;connid = p_connid&amp;#39;&lt;/span> &lt;span style="color:#ff79c6">TO&lt;/span> &lt;span style="color:#8be9fd;font-style:italic">l_where&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">ENDIF&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">IF&lt;/span> &lt;span style="color:#8be9fd;font-style:italic">p_fldate&lt;/span> &lt;span style="color:#ff79c6">IS NOT INITIAL&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">IF&lt;/span> &lt;span style="color:#8be9fd;font-style:italic">l_where&lt;/span> &lt;span style="color:#ff79c6">IS INITIAL&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">APPEND&lt;/span> &lt;span style="color:#f1fa8c">&amp;#39; and &amp;#39;&lt;/span> &lt;span style="color:#ff79c6">TO&lt;/span> &lt;span style="color:#8be9fd;font-style:italic">l_where&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">ENDIF&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">APPEND&lt;/span> &lt;span style="color:#f1fa8c">&amp;#39;fldate = p_fldate&amp;#39;&lt;/span> &lt;span style="color:#ff79c6">TO&lt;/span> &lt;span style="color:#8be9fd;font-style:italic">l_where&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">ENDIF&lt;/span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">SELECT&lt;/span> &lt;span style="color:#ff79c6">*&lt;/span> &lt;span style="color:#ff79c6">FROM&lt;/span> &lt;span style="color:#8be9fd;font-style:italic">sflight&lt;/span> &lt;span style="color:#ff79c6">INTO&lt;/span> &lt;span style="color:#ff79c6">CORRESPONDING FIELDS OF&lt;/span> &lt;span style="color:#ff79c6">TABLE&lt;/span> &lt;span style="color:#8be9fd;font-style:italic">flight_data&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">WHERE&lt;/span> (&lt;span style="color:#8be9fd;font-style:italic">l_where&lt;/span>).
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">ENDFUNCTION&lt;/span>.
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>In this way you can call function &lt;strong>&lt;code>zsfli_sflight_getlist&lt;/code>&lt;/strong> only with parameter &lt;strong>&lt;code>p_fldate&lt;/code>&lt;/strong> set, the select will filter and return all records for desired date.&lt;/p></description></item><item><title>Get Ruby on Rails working on Ubuntu 11.10</title><link>/post/2011/11/08/get-ruby-on-rails-working-on-ubuntu-11-10/</link><pubDate>Tue, 08 Nov 2011 10:54:25 +0000</pubDate><guid>/post/2011/11/08/get-ruby-on-rails-working-on-ubuntu-11-10/</guid><description>&lt;p>A long time I have not been using Ruby On Rails. I have decided to give it a try again, so started by installing on Ubuntu 11.10 in VirtualBox. From what I remember - I have never happened before having issue with RoR working out of the box. Unfortunately this was not the case this time. Everything started with something really new to me:&lt;/p>
&lt;pre tabindex="0">&lt;code> Invalid gemspec in [/var/lib/gems/1.8/specifications/json-1.6.1.gemspec]: invalid date format in specification: &amp;#34;2011-09-18 00:00:00.000000000Z&amp;#34;
 Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: &amp;#34;2011-08-25 00:00:00.000000000Z&amp;#34;
&lt;/code>&lt;/pre>&lt;p>At the beginning I have tried to solve it in several ways - by installing ruby from APT sources via&lt;/p></description></item><item><title>'Preview' crashes under Mac OSX Lion - FIX</title><link>/post/2011/08/12/preview-crashes-under-mac-osx-lion/</link><pubDate>Fri, 12 Aug 2011 22:10:28 +0000</pubDate><guid>/post/2011/08/12/preview-crashes-under-mac-osx-lion/</guid><description>&lt;p>It happened, that when I upgraded to Lion, for some reason Preview stopped working. This was new to me - usually I don&amp;rsquo;t expect such behavior under Mac OS. Seems that lots of people had this, especially the ones that have upgraded MBP with SDD and having HDD at the place of Optical Drive. In this case you make SymLinks in your home directory pointing to HHD for Downloads (for Photos, Music, Movies or anything that you can afford to play from slow media and takes more space, which is expensive on SSD).&lt;/p></description></item><item><title>Solving Issues Like Warning Attempting to Create Use_block_in_frame Variable With Block That Isnt in the Frame</title><link>/post/2011/08/01/solving-issues-like-warning-attempting-to-create-use_block_in_frame-variable-with-block-that-isnt-in-the-frame/</link><pubDate>Mon, 01 Aug 2011 22:42:59 +0000</pubDate><guid>/post/2011/08/01/solving-issues-like-warning-attempting-to-create-use_block_in_frame-variable-with-block-that-isnt-in-the-frame/</guid><description>&lt;p>I used to fight for a while with strange issue. I am using Singleton in my iOS application to hold Session information. Unfortunately when using NSMutableArrayList to hold stack of current objects - the references become empty at some point and there is a warning like:&lt;/p>
&lt;p>&lt;code>warning: Attempting to create USE_BLOCK_IN_FRAME variable with block that isn't in the frame.&lt;/code>&lt;/p>
&lt;p>While searching on the net - I have mentioned one comment about using singletons - well - this was my lead.&lt;/p></description></item></channel></rss>