Syntax highlighting for Rust language for Linux KDE's Kate


At this point (April 2015) Rust is in 1.0.0-beta and there are no complete IDE integration (either Eclipse or Idea) so we need to go back to basics (no, no, no, not vim/emacs, relax :-) ) and use Kate for editing source files.

Frankly, so far I've never used Kate for programming and was totaly unaware how to configure it and I had some trouble setting Rust's syntax highlighting so here is the short explanation how to do it:

1. Download rust.xml from here:

Take care to save it in it's original XML form, not as HTML (as I did somehow the first time…)

2. Copy it in ~/.kde/share/apps/katepart/syntax/

3. Restart Kate

(btw, I use Kubuntu 14.04, other distros may have different location for the SH files…)

[Android] Android tools 2014


Good practice is to learn from the best. Here is a podcast with Jake Wharton where he mentions the libs and tools he uses.

In short here is the list:

Butter Knife:
AssertJ Android:
One more addition to the Wharton's list is:
Parcelabler (online tool for generating parcelable versions of your classes):

[Android] Dynamic ListView using Volley and NetworkImageView


Just added new example to the Android Volley Examples project which shows how to use Volley to populate dynamically ListView including loading of images using NetworkImageView. It also uses a simple read-ahead technique in order to load next page of data when the user reaches close to the end of the current page in order to minimize the wait.


[Android] Android Volley With GET and POST Parameters Example


Just added a simple example how to use GET and POST parameters to the Android Volley Examples project. You can find it under "GET and POST parameters" button.

Basically the example is quite simple: there is activity with two EditText fields used to enter a number and two buttons "Request with GET params" and "Request with POST params". You have to enter some digits in the fields, press one of the buttons and the request will be send to the server containing the parameters. Server will add the two numbers and return the sum which will be displayed bellow the buttons.

1. Request with GET parameters

In order to send request with GET parameters there are two alternatives:

1.1. To embed them directly in the string of the URL (as shown in the example) like:

String uri = String.format("$s¶m2=%2$s",
StringRequest myReq = new StringRequest(Method.GET,

In the code above num1 and num2 hold the parameters' values.

1.2. If you are using Volley with with external HttpClient (4.2.x) you can use URIBuilder in order to build the URI in more convenient way


2. Request with POST parameters

You will need override getParams() method of the request and return a Map<String, String> that holds your parameters and their values like:

StringRequest myReq = new StringRequest(Method.POST,
                                        createMyReqErrorListener()) {

    protected Map<string, string=""> getParams() throws {
        Map<string, string=""> params = new HashMap<string, string="">();
        params.put("param1", num1);
        params.put("param2", num2);
        return params;



[Android] Using Android Volley With Self-Signed SSL Certificate


In brief:

  1. Get Volley from git clone
  2. Get Android Volley Examples project from git clone git://
  3. Copy your keystore (BKS format) containing the self-signed public key in res/raw
  4. Open Act_SsSslHttpClient in the examples project, find "R.raw.test" and replace it with your keystore name (without the .pem extension)
  5. Find "new SslHttpClient(" and replace the default password "test123" with the password for your keystore
  6. Replace "44400" with the HTTPS port of your server/virtualhost. If you use the standart 443 -- then you may remove this parameter entirely
  7. Replace "" with your  URL. Please make sure that you are using HTTPS otherwise it will work without as normal request, i.e. without encryption
  8. Start the app, go to "HTTPS with self-signed cert", then "Execute HTTPS request"
  9. If successful you will see something like "This is the result of successful HTTPS request. Congrats!". If some error occurres please check your logcat.
  10. Copy SslHttpClientSslSocketFactorySsX509TrustManager and your keystore to your project and enjoy! :-)


In details:

When you create an android app there is  no problem to execute HTTPS request against server with certificate issued by well-known Certification authority. However if you try to you use self-signed certificate you are in trouble -- certificate will be rejected by … more / още »

[Android] Using Volley (Android) With External HttpClient (4.2.x)


By default Volley uses the built-in AndroidHttpClient on systems that are < Gingerbread and HttpUrlConnection on newer. For some this may not be enough. Someone may need Cookies support, other may need to work self-signed SSL certificate.   Probably there are few more reasons to use external HttpClient but most prominent one is that you may have old code that relies on it.

About 2 years ago I wrote Using newer version of HttpClient on Android (like 4.1.x). Now as follow up I added an example how to use Volley with such external HttpClient in my Android Volley Examples project.

Basically all I had to do is to create a new class ExtHttpClientStack, copy the functionality from the HttpClientStack and redirect all method calls from the built-in HttpClient to the external one.

[Android] Android Volley Examples


In brief: here is the git project with the Volley examples/samples


In details:

Volley was announced just few days ago at the I/O 2013. It is a library/framework that helps the developers to create more easily applications that use network requests, and more precisely REST requests. I was very exited to give it a try but unfortunately I found that there are no examples and tutorials. Now, after experimenting with it, I will try to fill to some extend that gap. … more / още »

[PHP] Eclipse + PDT + Mercurial + Win 7 = Very slow. Solution


I had this MF problem: I was using latest PDT (3.0.x) bundle, with latest Java on Windows 7 64 bit. When I was working on projects with Mercurial source control I've experienced huge hangs/lag when I was clicking on the project folder/name or right-clicking on it. After hours of frustration I finally found a solution:

  • rename .hg dir to something different for example .hg-tmp
  • refresh the project in Eclipse
  • Create a linked resource ( New -> File  -> Advanced -> Link to file in the file system ). Name it .hg
  • on filesystem: rename .hg-tmp back to .hg
  • refresh the project in Eclipse

Now things should be fine.

I am not sure why exactly above steps have positive effect but it has something to do with .hg dir slowing down Eclipse/PDT (even thou I had no hg plug-in installed in Eclipse (I use external tool -- TortoiseHg)).

[PHP] Новите неща в PHP 5.4 -- I-ва част


Изненадващо (поне за мен) онзи ден забелязах, че е излязло PHP 5.4. След всичките проблеми покрай разработката на PHP6 (за това ще има отделна публикация) си мислех, че PHP е обречено да се развива единствено в 5.3.х клона. За щастие, здравият разум "най-сетне" надделя и PHP "core" разработчиците решиха да backport-нат някои от нещата от PHP 6. Поставил съм "най-сетне" в кавички, защото идеята им беше нещата да са излезли Q2/3 на 2011, а се появяват чак сега, но важното, все пак е, че вече са налични.
По-важните неща първо "съвсем" накратко:

  • Добавена е поддръжка за traits (характерности). Те представляват … more / още »

[Android] Downloading Android source as zip


I needed the source of Anroid Froyo in order to be able to debug it in Eclipse. On the official download page there  is a description how to download it under Linux (or cygwin) but at the time I did not had either so I tried to find plain, simple, good old zip that contains the entire source but it took me quite some time googling in order to find a site that provides such downloads. In order to save you from wasting time here it is:

If you need the source in order to debug it in Eclipse: download appropriate JAR (for example android-2.2_r1.1-sources.jar) , open it with zip and extract it in <android-sdk-dir>\platforms\<android-version>\sources (you may need to create "sources" subdir). Restart Eclipse and debug should work.