Some random hints if you get started (in my case restarted) with C++ – let me know if I wrote something in wrong in my personal memos: Use RAII: Resource Acquisition Is Initialization Use scoped variables which gets destroyed automatically after leaving the block: MyClass myVar(“Hello Memory”); To use call by reference use the method … Continue reading »
Filed under Java …
Ugly but most efficient setSize for ArrayList
Here is the reported issue and here a discussion. When you need decreasing the size too then have a look into Vector.setSize A less hacky but also less efficient version would be:
Jetslide uses ElasticSearch as Database
GraphHopper – A Java routing engine karussell ads This post explains how one could use the search server ElasticSearch as a database. I’m using ElasticSearch as my only data storage system, because for Jetslide I want to avoid maintenance and development time overhead, which would be required when using a separate system. Be it NoSQL, … Continue reading »
Introducing Jetslide News Reader
Update: Jetsli.de is no longer online. Checkout the projects snacktory and jetwick which were used in jetslide. We are proud to announce the release of our Jetslide News Reader today! We know that there are a lot services aggregating articles from your twitter timeline such as the really nice tweetedtimes.com or paper.li. But as a … Continue reading »
Snacktory – Yet another Readability clone. This time in Java.
For Jetslide I needed a readability Java clone. There are already some tools, but I wanted some more and other features so I adapted the existing goose and jreadability and added some stuff. Check out the detection quality at Jetslide and fork it to improve it – since today snacktory is free software ! Copied … Continue reading »
How to backup ElasticSearch with rsync
Although there is a gateway feature implemented in ElasticSearch which basically recovers your index on start if it is corrupted or similar it is wise to create backups if there are bugs in Lucene or ElasticSearch (assuming you have set the fs gateway). The backup script looks as follows and uses the possibility to enable … Continue reading »
ElasticSearch vs. Solr #lucene
GraphHopper – A Java routing engine karussell ads I prepared a small presentation of ‘Why one should use ElasticSearch over Solr’ ** There is also a German article available in the iX magazine which introduces you to ElasticSearch and takes several aspects to compare Apache Solr and ElasticSearch. ** This slide is based on my … Continue reading »
Longest Common Substring Algorithm in Java
For jetwick I needed yet another string algorithm and stumbled over this cool and common problem: trying to find the longest substring of two strings. Be sure that you understand the difference to the LC sequence problem. For example if we have two strings: Please, peter go swimming! and I’m peter goliswi The algorithm should … Continue reading »
Viewing hprof from android with jvisualvm
Add an additional permission to your app <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE” /> to your manifest Create hprof protected void onDestroy() { super.onDestroy(); try { Debug.dumpHprofData(“/sdcard/data.hprof”); } catch (Exception e) { Log.e(“xy”, “couldn’t dump hprof”); } } or alternatively create a hprof file with: adb shell ps | grep yourpackage; adb shell kill -10 pid Get the hprof … Continue reading »
Twitter API and Me
I have a love hate relationship with Twitter. As a user I see the benefits of Twitter, when looking at it without the spam, duplicates and senseless tweets e.g. through jetwick. But as a developer the Twitter API is very ‘heuristic’ and handwaving in a lot areas and makes it complicated to use. I would … Continue reading »