Follow onomatopej on Twitter Meet us on Facebook Blog Portfolio Publications Contact About

Archive for the ‘Programming’ Category

LiveChat for Mac & iOS behind the scenes

Thursday, February 9th, 2012

The purpose of this article is to present several technical design concepts implemented and proven to work well for over one year, since the first release of the Mac version of LiveChat operator application.

Back in 2010 when I started implementing the Mac version, the main task was to reach the feature level of the Windows version (developed for several years) as fast as possible, and also to prepare ground for an upcoming iOS version (available now in App Store). At that time I neither had access to the Windows version’s source code, nor was going to reuse any of it. Therefore I have settled the following constraints that yielded the following results (described in detail in following sections):

(more…)

Streaming thumbnails smoothly using HTTP in your iPhone app

Wednesday, October 6th, 2010

Network enabled apps such as news aggregators, blogging clients often load lots of small files, such as thumbnails, trough HTTP connection. One of them is my app – Kozaczek, that loads thumbnails for every UITableView item when it is about to be displayed. Usually we expect that such application is: (1) responsive (does not block scrolling while loading), (2) it does load thumbnails almost realtime.

I suppose the first thing everybody tries is calling [UIImage imageWithData:[NSData dataWithContentsOfURL:someURL]]. There is nothing wrong with it, except it make your UI stutter and load images painfully slow. After trying that one may think of using background threads, NSOperationQueue, or something like that, but still any modern web browser loads those images much faster when they are embedded into regular web page than your application. Wonder why?

(more…)

Is closed-source project like CMSity doomed to the death nowadays?

Tuesday, April 28th, 2009

Seems it is very hard to spread the news about CMSity around the world, and acquire some user base of this project. Till now I did few commercial deployments of CMSity, however the cmsity.com page hits look really miserable.

I wrote mails to many CMS magazines asking to drop a note about my project. However only two of them replied and posted something on their sites about CMSity. So I still miss some more reviews that can put a breathe into the project. But it seems my mails are ignored by majority of big CMS related sites making very hard to promote new project like CMSity nowadays.

Since I believe this software presents great value and outperforms other popular solutions I consider releasing it as open-source, however probably not GPL but some license that will force the code to stay by the author (me), deny all the forks, making all community changes happen to be included in the source code base.

Open-source is a great idea, but I have seen too many projects that were just bloated, forked and spoiled by masses of developers that were just about put something of themselves in the project regardless of quality of the included changes, missing overall sense and directions of the project itself. That is why I decided to keep the code closed initially, while giving the licenses for free, but it seems non-open source project are just kicked out of the focus today, and releasing the source code is a “must” to gain the momentum.

Haml + Gettext = automagic translation

Monday, April 13th, 2009

Haml logoI was rather sceptic to Haml once I have first time read about it. But after recently playing a while with it I can frankly express that it is simply outstanding template engine for Ruby. What I miss about Haml is some seamless integration with some i18n framework (gem).

So I decided to create Haml “mod” that uses GetText (FastGettext alternatively) to automagically translate static texts from Haml templates during precompilation stage. So something that you don’t see and you don’t need to worry about. (more…)

Opening specified path in Terminal’s new tab

Tuesday, March 24th, 2009

Updates

  1. It uses now click menu instead of keystroke “System Events” command, because in some cases when you had this script assigned to shortcut that used Ctrl or Shift modifiers, those modifiers were sent together with Cmd to “Terminal” producing invalid behavior.
  2. It waits 0.5 second when window is busy just in case Terminal.app was not running and it is just loading the shell which makes it busy for short while too. Fixes incorrect behavior of opening extra tab when Terminal.app was not running.

If you ever wondered how to open specified path in new tab of Terminal.app or reuse current one if it is not busy (running a command), here’s a script you may use:

tell application "Terminal"

    activate

    set windowCount to (count of the windows)

    -- Terminal may be just launched loading the shell, wait a bit
    if windowCount is greater than 0 and first window is busy then
        delay 0.5
    end

    -- Still busy / no windows? open new tab
    if windowCount is greater than 0 and first window is busy or windowCount is 0 then
        tell application "System Events" to tell process "Terminal"
            click first menu item of first menu of second menu item of first menu of third menu bar item of first menu bar
        end tell
    end if

    do script "cd #{e_as(e_sh(dir))}" in first window

end tell

Where #{e_as(e_sh(dir))} is your desired folder. This is modified chunk of TextMate‘s command script found at Mark Eli Kalderon’s Blog. Thanks Mark!

Note: Mark’s TextMate command script does not open anything when Terminal.app has no windows or it is not running.