Catch back button and exit PhoneGap application

This article shows an example, how to respond, when user of your mobile application taps on Back button and how to exit application, after getting user confirmation, that he or she is willing to do so. It also explains, why you shouldn’t do it at all, if you plan to ship your application to multiple platforms, including Apple iOS.

Read More “Catch back button and exit PhoneGap application”

Very simple alternative to jQuery

Often, in many small or very small projects, you include jQuery only to have a conviniend DOM-selectors access via $(selector) and except this, you don’t use jQuery at all. In cases like that using neither jQuery nor smaller Zepto.js isn’t pretty wise.

Here is an example on how to achieve same effect in pure JS with querySelector and querySelectorAll.

Read More “Very simple alternative to jQuery”

Icon and splash screen sizes for PhoneGap applications

Since PhoneGap is used to build mobile applications for many destination platforms, out of one source files package, and since each platform contains many mobile devices, with different screens sizes and orientations, it is fairly hard task to design set of mobile application icons and splash screens to suit all needs.

This post is meant to help you with solving this problem, but it is nothing more than a bunch of links to an external sources plus some comments.

Read More “Icon and splash screen sizes for PhoneGap applications”

Hiding splash screen in PhoneGap application

There are various things you have to consider, when developing a PhoneGap application, if you want to control when and how your application’s splash screen will be shown or hidden. This post summarizes all my knowledge in this area. Most information presented here are obvious to more experienced PhoneGap developers, so this post works more like memo to myself.

Read More “Hiding splash screen in PhoneGap application”

Developing PhoneGap applications on Windows

When I first time checked PhoneGap I immediatelly felt in love with it. That was something just amazing and nearly impossible. Use well known HTML5, CSS and JavaScript to build mobile applications with direct out-of-the-box support for eight different mobile apps platforms? No Java, no Objective-C? Hard to believe!

But it was true… Then I moved to famous Getting Started Guides and actually died! Oh, my f*king goodness! Eclipse? Insane number of SDKs? And then PhoneGap Build has been born and my soul has been saved! :]

Read More “Developing PhoneGap applications on Windows”

Fixing graphic problems in Diablo I and Diablo II

I’m so sucking and low player that actually for past fifteen (!) years I’ve been playing in actually four games: Diablo I, Diablo II, Civilisation and Transport Tycoon. The first two caught my heart so deeply that I even try to run them (Diablo I!) on Windows 7. And… I actually managed to do this.

Since, this involved a lot of googling and asking, here is a summary of my findings.

Read More “Fixing graphic problems in Diablo I and Diablo II”

Delphi TreeView with checkboxes

Delphi’s TListView supports checkboxes out-of-the-box. You just have to set Checkboxes to True and iterate through TListView.Items to find, if particular item have Checked property set to True. You can even enable your own OnCheckboxClick event (not available by default) — I wrote about it here. But very similar to TListView‘s TTreeView does not support checkboxes by default at all.

So, you have to craft entire solution yourself.

Read More “Delphi TreeView with checkboxes”

ListView’s OnCheckboxClick event

Unfortunately, the TListView object does not have a specific event fired, when the Checked state changes for a TListItem (an item in the ListView). If you need to react in such situation, you have to mimic this behaviour yourself. Here are some tips on this.

Every Delphi’s Guru will probably think about subclassing and catching windows messages here. If you’re one of them — at delphi.about.com you’ll find an example. But, there’s an easier way to achieve the same.

Read More “ListView’s OnCheckboxClick event”

Read and write ID3Tag in Delphi without any extra components [updated]

There’s an (probably very) old About.com Delphi’s article on how to build simply MP3 Player using only TMediaPlayer component available in every Delphi edition. Since powerful XAudio is no longer offcially available to Windows developers and other MP3 players or components are quite expensive, when it comes to pay for the license, then this could be a good alternative. But, this article catched my attention for a completely different reason — reading and writing ID3Tag v1 in MP3 files, without using external libraries, just the pure Delphi code.

Read More “Read and write ID3Tag in Delphi without any extra components [updated]”

XAudio SDK for Delphi

XAudio SDK probably is (or at least was) the most powerful, yet freeware Software Developer Kit for playing MP3 files in Delphi. It offered outstanding possibilities. Let’s say that fifty (!) events, you could use to write any MP3-related software in Delphi is enough good mark. And there’s more. That is why, it was really pity to me to discover, that this library is no longer available neither to Windows nor free. And finding replacement is really hard, if not impossible.

Read More “XAudio SDK for Delphi”

Convert string into key-value array

I was looking for a function or solution, that would convert a string into associative array, i.e. respecting both keys and values. To be successfull, such function would have to operate on two delimiters. One for separating each key-value pair from surronding one. And second — for spliting keys from values. Which is, where PHP’s build-in explode function fails. Lucky I am, my two favorite uncles — Uncle Google and Uncle Stack Overflow — helped me in this case as well.

Read More “Convert string into key-value array”

Automate compare in folder sync tool in Total Commander

To automate compare phase (first step) in folder sync tool you should:

  1. Set the parameters as you need them.
  2. Click on the folder button in the top left of the sync dialog to save these settings.
  3. Create a button with the c:\totalcmd\totalcmd.exe /S=S:=backup command.

The := instead of just /S=S:backup causes an automatic start of the comparison.

Of course you must adjust path to reflect your location of Total Commander.

Currently you can automate the compare step, not the copy step. It is considered to risky to be automated.

Over hundred cool icon sets for your website or application

Here you have three different pages, each holding links to 25+ beautiful icons sets:

There are 109 total icons sets presented on these three webpages. Most of them are free. Some of them are devastating beautiful, some have medium quality. But, put together, makes a strong icon sets compilation, in which nearly anyone should find something interesting for his or her current project.

Fix for multi-rename tool bug in Total Commander

If you use Multi-Rename Tool in Total Commander to batch-rename only folders and if all folders are numbered with dot after number (example attached and below) then multi-rename tool will treat all folders as filenames — i.e. it will “see” everything before dot (two characters in above example) as actual filename and all the rest, after dot, as file’s extension. Here is a quick fix for this situation (it actually may not be considered as bug).

Read More “Fix for multi-rename tool bug in Total Commander”

Simple way for hiding your email address

They say that SPAM bots are really good these days and can figure out your e-mail out of many “traps”.

I wonder, if they can catch it out of something like this:

<a
    href="mailto:me.nononono@domain.nononono.com"
    onmousedown="this.href=this.href.replace('.nononono','')"
    onkeydown="this.onmousedown()">
contact me</a>

I prefer to think, they don’t and that they’ll crush their ugly spammy teeth on this! :]

Problems installing Google Earth client or plugin

Sometimes any attempt to install Google Earth standalone program or a plugin for your favorite browser ends up with error message: Error during execution of GoogleEarth.exe. Cannot find specified file. If you’re installing a plugin, directly from your browser, you can see an additional message saying that installation failed with error number 9. I don’t know, what exactly causes this to happen, but found an easy workaround for this.

Read More “Problems installing Google Earth client or plugin”

Application works fine on localhost but fails on web server

If you ever run into situation, that your application works fine on localhost (or one of webhosting) but fails completely on webhost (or another server) then first thing, you should look for, is to check, if you don’t have an extra XHTML line in on of your files that you’re loading using include or require.

Meaning, that your loading and PHP-parsing these files. Because problem doesn’t exist, if you’re loading this files as simple text files, using file_get_contents for example.

Situation, I’m talking about most times causes a PHP syntax error saying, that there is an unexpected T_STRING in first line of one of the files used in an application.

Read More “Application works fine on localhost but fails on web server”

Simple page rendering class

I have created a simple CPage class, which I use in my non-Yii projects for easily rendering views, templates and whole pages using object-oriented approach. This class can render given contents into given view and embeded it in a selected layout file. These are very limited versions of Yii framework’s view and layout rendering mechanisms. I have also added a simple alerting system, this time taken from Twitter Bootstrap.

Read More “Simple page rendering class”