-rw-r--r-- 458B Feb 27, 2013 · 9EB9080 · ~1 min

Diablo Swing Orchestra at Aurora, February 23, 2013, video

diablo swing orchestra видео

The Diablo Swing Orchestra concert from Sweden at Aurora on February 23 was unexpectedly great. Based on the description «metal, operatic vocals, orchestral instruments», I expected some gloomy Scandinavian death metal with summoning Satan. But the band was a very pleasant surprise.

Something very strange happened with the sound, though. It recorded only into the left channel, so I had to fix it, although I checked the gear and everything seemed fine.

[↵] open page diablo-swing-orchestra-v-avrore-23-fevralya-2013--video.md
-rw-r--r-- 448B Feb 19, 2013 · C4B7FE3 · ~1 min

Phuket Airport Schizophrenia

phuket airport schizophrenia видео путешествия

I got back from Thailand. On the way home I had to wait six hours at night at Phuket airport before check-in for my flight started. I was really counting on the Irish pub at the airport, but it turned out it was open only until 11 pm. As a result, everything at the airport was closed except the flight check-in counters. During those six hours I explored all three floors of the airport, shot some video, and even found a power outlet to recharge.

[↵] open page phuket-airport-schizophrenia.md
-rw-r--r-- 1.6K Jan 10, 2013 · 87BA54F · ~2 min

PHP script for building all views in CouchDB

couchdb скрипты

I wrote this little script before New Year. It goes through all databases in CouchDB and builds all views one by one. Leaving it here.

<?php

            set_time_limit( 0 );

            // all dbs
            $ch = prepareCurlResource();
            curl_setopt( $ch, CURLOPT_URL, 'http://localhost:5984/_all_dbs' );
            $data = curl_exec( $ch );
            $dbs = json_decode( $data );

            foreach ( $dbs as $db ) {
                // skip _users and _replicator
                if ( substr( $db, 0, 1 ) == '_' )
                    continue;

                // getting all databases
                $chCC = prepareCurlResource();
                curl_setopt( $chCC, CURLOPT_URL, 'http://localhost:5984/' . $db . '/_all_docs?startkey="_design/"&endkey="_design0"&include_docs=true' );
                $data = json_decode( curl_exec( $chCC ) );

                if ( false === empty( $data->rows ) ) {
                    foreach( $data->rows as $design ) {

                        // creating views of design
                        if ( false === empty( $design->doc->views ) ) {
                            foreach( $design->doc->views as $viewName => $tmp ) {
                                echo 'Creating view: ' . $db . '/' . $design->id . '/_view/' . $viewName . "
";

                                $chCC = prepareCurlResource();
                                curl_setopt( $chCC, CURLOPT_URL, 'http://localhost:5984/' . $db . '/' . $design->id . '/_view/' . $viewName . '?limit=0' );
                                curl_exec( $chCC );
                            }
                        }
                    }
                }
            }

            function prepareCurlResource() {
            $ch = curl_init();
            curl_setopt( $ch, CURLOPT_PORT, 5984 );
            curl_setopt( $ch, CURLOPT_HEADER, false );
            curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
            curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-type: application/json' ) );

            return $ch;
            }
            
[↵] open page php-skript-dlya-sborki-vseh-vidov-v-couchdb.md
-rw-r--r-- 7.7K Dec 31, 2012 · 181EA8A · ~7 min

2012 in review

новый год итоги жизнь концерты итоги года

The year was insane. Packed. With everything that follows from that.

[↵] open page itogi-goda-2012.md
-rw-r--r-- 1.9K Dec 18, 2012 · EDC0F30 · ~2 min

Escaping image URLs with Russian filenames in Objective-C

objective-c ios

Management at the office started uploading images with Russian filenames into news on the portal — things like Фото-Ресторана.jpg.

Images from news items are shown inside the app, so the app fetches them by these URLs.

The URL arrives in the app already percent-encoded, e.g.:


http://allcafe.ru/s/pic/news/!_2012/2012_12/%D0%A0%D0%B5%D1%81%D1%82%D0%BE%D1%80%D0%B0%D0%BD-Graf-in-%D0%A1%D0%B0%D0%BD%D0%BA%D1%82-%D0%9F%D0%B5%D1%82%D0%B5%D1%80%D0%B1%D1%83%D1%80%D0%B3-%D0%B7%D0%B8%D0%BC%D0%BD%D1%8F%D1%8F-%D1%82%D0%B5%D1%80%D1%80%D0%B0%D1%81%D0%B0.jpg

The app uses a class called AsynchronousUIImage that I found online about a year ago. It just loads the image asynchronously via NSURLConnection.

- (void)loadImageFromURL:(NSString *)anUrl {
    anUrl = [anUrl stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:anUrl] 
        cachePolicy:NSURLRequestReturnCacheDataElseLoad 
        timeoutInterval:30.0
    ];

    connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
}

The catch turned out to be in stringByAddingPercentEscapesUsingEncoding. Since the URLs come in already percent-encoded, it looks like double-encoding was happening and the image simply wouldn’t load. And if the NSURLConnectionDelegate method connection:didFailWithError: isn’t implemented, you get a crash — which is what hit me.

The funny conclusion: if you have URLs containing Cyrillic characters, you have to escape them either on the server before sending them to the client, or in the client. Doing it in both places — doesn’t work. Doing it nowhere — also doesn’t work :)

Luckily I fixed it on the server side without breaking anything and avoided shipping an emergency client update. By the way, on Android there is no such problem.

[↵] open page pro-ekranirovanie-url-ov-izobrazhenij-s-russkimi-imenami-v-objective-c.md
-rw-r--r-- 787B Dec 16, 2012 · 1B3F6E5 · ~1 min

Est Est Est at DA:DA on December 14, 2012, audio

есть есть есть бутлеги аудио

Est Est Est at DA:DA on December 12, 2012

Recorded an Est Est Est show for the third time.
They were presenting the new album «Satan on Vacation».

Cover photo by Dasha.

Tracklist:

01. Intro
02. Homer
03. Victory Day
04. Brodsky night, Svyatki skit
05. Svyatki
06. Plyonka
07. Kapitoshki
08. The Journalists
09. Already
10. Heroic Poem
11. Satan on Vacation
12. Spring
13. Résumé
14. Lisbon
15. Palette
16. The House Painter Duck
17. Autumn

Download (mp3, 320 kbps, 230 mb): Narod | Rutracker

[↵] open page est-est--est--v-klube-da-da-14-dekabrya-2012--audio.md
makoni@arm1:~/blog$ cd ../page-24/ // ← previous cd ./page-26/ // more posts →