Category Archives: Code Snippets

Short and usefull code snippets and tutorials used in day-to-day programing

iOS HTTP Basic Authentication and RestKit

Today morning I was looking for some solution to use authentication with my REST calls to GeoCouch database. I set up the security on the server side but couldn’t get it to work really on the iOS. No joy on stackoverflow.com either :). Was lucky enough to google up a very small solution project created […]

Read More →

Parsing JSON with Objective-C and RestKit

Another problem I have found while developing my pet-project application called ‘BeaconHarvester‘ was to integrate it with the external web service somewhere to allow people exchange information about iBeacons found, this functionality is on its way but for now I would like to share a few bits on how to parse quite complex JSON data […]

Read More →

How to get geographic coordinates of the visible MKMapView area in iOS

Recently I become interested in a problem of managing a large number of annotations on a MKMapView in iOS application. The problem is twofold, first is about displaying a large number of annotations on the map view, second is managing the large number of annotations before displaying them. The commonly known solutions to the first […]

Read More →

Big Data analysis with Hadoop, Pig and Stack Exchange data dump

Finally I have finished my latest pet project. I was learning Pig and Hadoop but most importantly I was trying to learn how to finish things. As with most of my pet projects, I start small hoping I will finish that, get smth useful and have something to write about, but usually I never stop […]

Read More →

Importing data into CouchDB – Java, Ruby and Erlang way

Working recently with CouchDB I become interested on how to import existing data into the database quickly. The CouchDB is written in Erlang so the first thing which came to my mind was to use that language for the job, but to find out if it runs ‘quickly’ or not, I had to compare it […]

Read More →

Parsing large XML files with Woodstox library

Today I wanted to play a bit with the library providing support for StAX (The Streaming API for XML) – JSR-173. Recently I have worked a bit with XML parsers in Ruby (like LibXml) while I was reading Seven Databases in Seven Weeks by E.Redmond and J.R.Wilson – which is by the way a really […]

Read More →

Quering CouchDB for scalar values with Map/Reduce view and Ektorp library

I have encountered a problem today when I was trying to execute a simple Map/Reduce query within my pet project using Ektorp java library. Besides not too bad documentation for the library itself, for some reason I couldn’t execute the query to retrieve scalar value from the database using an array of keys. The problem: […]

Read More →

JBoss AS 7 deployment problems

I have recently encountered a problem while deploying web application to JBoss AS 7 when my application just undeployed itself automatically after deployment. No errors, nothing in logs, no nothing. Application I was trying to use was pre-populating data on the database during deployment and that caused invisible deployment timeout on JBoss, especially on our […]

Read More →

Apache Camel – JDBC with Spring Transaction support

Continuing my journey with Fuse ESB (ServiceMix) and Apache Camel I will present a small example on how to route your messages in a transacted way using Spring Transaction Manager. For the purpose of this tutorial we are going to define a datasource to in memory Hsqldb instance and configure it with ‘org.springframework.jdbc.datasource.DataSourceTransactionManager’. Our camel […]

Read More →

Eclipse RCP – Auto-complete Text and Combo widgets

Today I will describe a simple way to add auto-completion to you Eclipse RCP/SWT based application using some resources I’ve found browsing the web. To not reinvent the wheel, I have found a project on sourceforge which does just that, and which does the job well enough. First of all go to the sourceforge website […]

Read More →