<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7021623171320558777</id><updated>2012-02-16T08:23:11.617+02:00</updated><category term='dll'/><category term='sms'/><category term='zombies'/><category term='gridview'/><category term='transparent'/><category term='github'/><category term='focusable'/><category term='event'/><category term='mpmediaitem'/><category term='objective-c'/><category term='marquee'/><category term='module'/><category term='iphone'/><category term='ipodlibrary'/><category term='xkcd'/><category term='python'/><category term='0x800736b1'/><category term='plugin'/><category term='browser'/><category term='vs2010'/><category term='assets'/><category term='gist'/><category term='uiwebview'/><category term='memory allocation'/><category term='scons'/><category term='c++'/><category term='xp'/><category term='Gallery'/><category term='hack'/><category term='MSB8015'/><category term='iis'/><category term='java'/><category term='intent'/><category term='manifest'/><category term='qrc'/><category term='version'/><category term='button'/><category term='pdf'/><category term='mkdir'/><category term='broadcast'/><category term='sdcard'/><category term='android'/><category term='blackberry'/><category term='mac'/><category term='textview'/><category term='retain'/><category term='line endings'/><category term='swizzle'/><category term='asp.net'/><category term='network'/><category term='shake'/><category term='qt'/><category term='oatmeal'/><category term='notification'/><category term='bitmap'/><category term='avplayer'/><title type='text'>Stuff Nobody Told Me About</title><subtitle type='html'>A blog containing tips and trips of the mobile developing trade.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-4822898111796601975</id><published>2012-01-22T15:45:00.003+02:00</published><updated>2012-01-22T15:51:57.083+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='pdf'/><category scheme='http://www.blogger.com/atom/ns#' term='oatmeal'/><category scheme='http://www.blogger.com/atom/ns#' term='hack'/><title type='text'>OATMEAL2PDF</title><content type='html'>As a continuation to my wildly popular &lt;a href="http://stuffnobodytoldmeabout.blogspot.com/2011/10/xkcd2pdf.html"&gt;XKCD2PDF&lt;/a&gt; post, here's a script I whipped out to get me some sweet PDFs of a great comic called &lt;a href="http://www.theoatmeal.com/"&gt;The Oatmeal&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/1657112.js"&gt; &lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-4822898111796601975?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/4822898111796601975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2012/01/as-continuation-to-my-wildly-popular.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/4822898111796601975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/4822898111796601975'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2012/01/as-continuation-to-my-wildly-popular.html' title='OATMEAL2PDF'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-5082580265173078444</id><published>2012-01-03T15:42:00.000+02:00</published><updated>2012-01-03T15:42:31.358+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='scons'/><category scheme='http://www.blogger.com/atom/ns#' term='qt'/><category scheme='http://www.blogger.com/atom/ns#' term='qrc'/><title type='text'>SCons and Qt Resource files</title><content type='html'>Today I've stumbled upon a bug/problem with SCons' support for Qt resource files (the ones with QRC extension).&lt;br /&gt;Usually, to add a QRC to your project you add a line like this:&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;qrcobj = programEnv.Qrc("SomeFile.qrc", QT4_QRCFLAGS="-name SomeFile")&lt;/blockquote&gt;and all is well.&lt;br /&gt;But - probably due to a bug somewhere in qt4.py module, the files that are referenced from inside the QRC (the actual images and stylesheets) are not added as a dependency to the build process, so when you change a CSS file, the QRC&lt;b&gt; will not&lt;/b&gt; be rebuilt.&lt;br /&gt;The snippet below parses the QRC manually, fetches the list of files inside and adds the to deps list; Python rocks.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/1554920.js"&gt; &lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-5082580265173078444?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/5082580265173078444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2012/01/scons-and-qt-resource-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/5082580265173078444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/5082580265173078444'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2012/01/scons-and-qt-resource-files.html' title='SCons and Qt Resource files'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-5278409221934614957</id><published>2011-12-06T13:13:00.001+02:00</published><updated>2011-12-06T13:16:33.280+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MSB8015'/><category scheme='http://www.blogger.com/atom/ns#' term='line endings'/><category scheme='http://www.blogger.com/atom/ns#' term='vs2010'/><title type='text'>warning MSB8015</title><content type='html'>If you try to build a project in Visual Studio 2010 and you get the following error:&lt;br /&gt;&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): warning MSB8015: Forcing a rebuild of all source files due to the contents of ".........\Debug\custombuild.command.1.tlog" being invalid.&lt;/blockquote&gt;&lt;br /&gt;Don't despair. I tried googling it and came up with a total of 3 (THREE) results in the whole web, two being in Korean. Yikes.&lt;br /&gt;In any case, the solution was rather simple - check line ending inside the project file. If for some reason (due to being committed to SCM incorrectly, or something of similar nature) it has improper line endings, VS2010 will think that you have bad symbols inside build commands and make the build result invalid.&lt;br /&gt;In my case, I had CR-CR-LF line endings - which, after being changed to CR-LF - solved the issue.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-5278409221934614957?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/5278409221934614957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2011/12/warning-msb8015.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/5278409221934614957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/5278409221934614957'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2011/12/warning-msb8015.html' title='warning MSB8015'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-1229344432165106540</id><published>2011-10-31T11:32:00.000+02:00</published><updated>2011-10-31T11:32:15.916+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xkcd'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='pdf'/><category scheme='http://www.blogger.com/atom/ns#' term='hack'/><title type='text'>XKCD2PDF</title><content type='html'>This one doesn't neccessary fall under the topic of this blog, but since it's a hacky thing I've done - I'm posting it here.&lt;br /&gt;&lt;br /&gt;Some time ago I wanted to get all the &lt;a href="http://xkcd.com/"&gt;XKCD&lt;/a&gt; comics stored on my iPad for offline viewing. Didn't find another solution so I cooked my own:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;A script that gets the JSON files of each comics and rips the important info&lt;/li&gt;&lt;li&gt;Download the stuff&lt;/li&gt;&lt;li&gt;Build a HTML page describing the comics with their 'alt' part (the good stuff)&lt;/li&gt;&lt;li&gt;Open the HTML in Word, set margins to zero, save as PDF&lt;/li&gt;&lt;li&gt;...&lt;/li&gt;&lt;li&gt;Profit!&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;I am really sorry about the 4th step, I know it's lame, but suprisingly, Word's "Save-as PDF" feature gave the best looking output.&lt;br /&gt;&lt;br /&gt;And if you are lazy, you can grab the already generated PDFs here: (split in 3 chunks, the first 900 comics).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.filesonic.com/file/2840295035/out.pdf"&gt;http://www.filesonic.com/file/2840295035/out.pdf&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.filesonic.com/file/2840295055/out2.pdf"&gt;http://www.filesonic.com/file/2840295055/out2.pdf&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.filesonic.com/file/2840295065/out3.pdf"&gt;http://www.filesonic.com/file/2840295065/out3.pdf&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;P.S. Here's the script:&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/1327175.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-1229344432165106540?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/1229344432165106540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2011/10/xkcd2pdf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/1229344432165106540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/1229344432165106540'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2011/10/xkcd2pdf.html' title='XKCD2PDF'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-8982094298593739794</id><published>2011-05-30T16:11:00.000+03:00</published><updated>2011-05-30T16:11:15.778+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='avplayer'/><category scheme='http://www.blogger.com/atom/ns#' term='assets'/><category scheme='http://www.blogger.com/atom/ns#' term='ipodlibrary'/><category scheme='http://www.blogger.com/atom/ns#' term='objective-c'/><category scheme='http://www.blogger.com/atom/ns#' term='mpmediaitem'/><title type='text'>Checking if MPMediaItem exists by URL</title><content type='html'>If you are usings AVPlayer with Asset URLs, you might want to check asset's existence on the device.&lt;br /&gt;If the asset is a file in local folder - no problem, you can use NSFileManager to check for existance? But what if it's inside the iPod library? The following trick wasn't easy to find, but here it is:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp;NSURL* furl = [f trackUrl];&lt;br /&gt;// &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ipod-library://item/item.mp3?id=&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if([[furl scheme] isEqualToString:@"ipod-library"]){&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NSNumber* pid = [NSNumber numberWithLongLong: [[f.name substringFromIndex:32] longLongValue] ];;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MPMediaPropertyPredicate *predicate = [MPMediaPropertyPredicate predicateWithValue:pid forProperty:MPMediaItemPropertyPersistentID];&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MPMediaQuery *songQuery = [[[MPMediaQuery alloc] init] autorelease];&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [songQuery addFilterPredicate: predicate];&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (songQuery.items.count == 0) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return NO; // NOT FOUND!&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-8982094298593739794?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/8982094298593739794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2011/05/checking-if-mpmediaitem-exists-by-url.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/8982094298593739794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/8982094298593739794'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2011/05/checking-if-mpmediaitem-exists-by-url.html' title='Checking if MPMediaItem exists by URL'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-5071453964080692499</id><published>2011-05-26T16:46:00.000+03:00</published><updated>2011-05-26T16:46:50.391+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='memory allocation'/><category scheme='http://www.blogger.com/atom/ns#' term='retain'/><category scheme='http://www.blogger.com/atom/ns#' term='zombies'/><category scheme='http://www.blogger.com/atom/ns#' term='objective-c'/><title type='text'>Tracing Objective-C Allocation</title><content type='html'>So, let's say you have a problem tracking down some pesky retain/autorelease issue in your code. You can use &lt;i&gt;NSZombieEnabled&lt;/i&gt; to catch double-releases, but sometimes those happen inside somebody else's code, and it's hard to track it down.&lt;br /&gt;&lt;br /&gt;Based on a code I've found in &lt;a href="http://rentzsch.tumblr.com/post/3895140826/retain-release-debugging"&gt;this blog post&lt;/a&gt;, I've wrote a template for subclassing somebody else's class to print out the allocation history.&lt;br /&gt;&lt;br /&gt;Here's how it looks:&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/993164.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;And here's how you use it (in this example, I want to track AVPlayer):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="p1"&gt;&lt;b&gt;SYNTESIZE_TRACE&lt;/b&gt;&lt;span class="s1"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;&lt;span class="s2"&gt;&lt;b&gt;AVPlayer&lt;/b&gt;&lt;/span&gt;&lt;span class="s1"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;AVPlayer* p = [[TraceAVPlayer alloc] init];&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;All done. Now, while running, you'll get a record of all retainCount modifications, with their stack trace.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-5071453964080692499?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/5071453964080692499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2011/05/tracing-objective-c-allocation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/5071453964080692499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/5071453964080692499'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2011/05/tracing-objective-c-allocation.html' title='Tracing Objective-C Allocation'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-2065309051619302024</id><published>2011-03-10T14:43:00.000+02:00</published><updated>2011-03-10T14:43:03.318+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='qt'/><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><category scheme='http://www.blogger.com/atom/ns#' term='objective-c'/><title type='text'>Making QT behave properly on Mac.</title><content type='html'>Couple of things I found out that helped porting a QT application to Mac:&lt;br /&gt;&lt;br /&gt;The QMainWindow you create does not look like a native Cocoa window. The status bar is there, no matter what you request, the menu doesn't port and the icon is yucky.&lt;br /&gt;Here's what you can do:&lt;br /&gt;&lt;br /&gt;Remove status bar/resize grip:&lt;br /&gt;&lt;script src="https://gist.github.com/864039.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Don't show unneeded icon in the title bar and move a QAction to Mac's main menu:&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/864043.js"&gt; &lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-2065309051619302024?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/2065309051619302024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2011/03/making-qt-behave-properly-on-mac.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/2065309051619302024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/2065309051619302024'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2011/03/making-qt-behave-properly-on-mac.html' title='Making QT behave properly on Mac.'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-34272996845987216</id><published>2011-01-26T16:20:00.000+02:00</published><updated>2011-01-26T16:20:30.170+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='swizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><category scheme='http://www.blogger.com/atom/ns#' term='objective-c'/><title type='text'>SIMBL For Poking Inside Mac Application Internals</title><content type='html'>SIMBL is, according to it's &lt;a href="http://www.culater.net/software/SIMBL/SIMBL.php"&gt;Home Page&lt;/a&gt;:&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: verdana, sans-serif; font-size: x-small;"&gt;&lt;br /&gt;&lt;dl&gt;&lt;dt style="font-weight: bolder;"&gt;Problem:&lt;/dt&gt;&lt;dd style="margin-bottom: 0.5em;"&gt;Some applications do about 90% of what I want.&lt;/dd&gt;&lt;dt style="font-weight: bolder;"&gt;Solution:&lt;/dt&gt;&lt;dd style="margin-bottom: 0.5em;"&gt;Develop my own applications.&lt;/dd&gt;&lt;dt style="font-weight: bolder;"&gt;Better Solution:&lt;/dt&gt;&lt;dd style="margin-bottom: 0.5em;"&gt;Patch the application myself...&lt;/dd&gt;&lt;/dl&gt;SIMBL (SIMple Bundle Loader) - pronounced like "symbol" or "cymbal" - enables hacks and plugins. For instance, SIMBL enables PithHelmet to enhance Safari.&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;So, let's say we have a naughty program that has a behaviour we don't like. How would we treat that problem?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;u&gt;class-dump&lt;/u&gt; TargetProgram&lt;/li&gt;&lt;li&gt;Look at the list of classes and note the one that seems to be the issue. Let's call that class &lt;u&gt;Victim&lt;/u&gt;.&lt;/li&gt;&lt;li&gt;Inside, find your naughty method, let's call it '&lt;u&gt;- (BOOL) victimMethod;&lt;/u&gt;'&lt;/li&gt;&lt;li&gt;Open Info.plist of the victim, and note the bundle name and version&lt;/li&gt;&lt;li&gt;Create new Cocoa bundle in XCode according to the steps on SIMBL site&lt;/li&gt;&lt;li&gt;Fill in the bundle name as stated&lt;/li&gt;&lt;li&gt;Use the following code:&amp;nbsp;&lt;script src="https://gist.github.com/796736.js"&gt; &lt;/script&gt;&lt;/li&gt;&lt;li&gt;Restart the target app&lt;/li&gt;&lt;li&gt;???&lt;/li&gt;&lt;li&gt;Profit!&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-34272996845987216?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/34272996845987216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2011/01/simbl-for-poking-inside-mac-application.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/34272996845987216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/34272996845987216'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2011/01/simbl-for-poking-inside-mac-application.html' title='SIMBL For Poking Inside Mac Application Internals'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-6583984810331752314</id><published>2010-11-25T15:09:00.000+02:00</published><updated>2010-11-25T15:09:00.302+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='focusable'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><category scheme='http://www.blogger.com/atom/ns#' term='Gallery'/><title type='text'>Gallery, clicking and selecting</title><content type='html'>Android SDK includes a nice-looking component named Gallery.&lt;br /&gt;It's supposed to provide you with functionality of flickable view-changer.&lt;br /&gt;It get's an BaseAdapter and displays views it receives.&lt;br /&gt;All good until you actually start using it.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;First issue:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;setSelection(index, animated)&lt;/b&gt; method ignores the second parameter. There's no 'todo' anywhere, 'deprecated' or even&amp;nbsp;acknowledgement&amp;nbsp;from Google. It just doesn't give a crap what you pass there. It always navigates to your item without animation.&lt;br /&gt;Now let's say that I want to change items in the gallery every X seconds. How can I make a pretty animation showing this lovely change? By hacking the bastard. Basically, the animations are&amp;nbsp;initiates&amp;nbsp;by the Fling motion that the component detects. If you simulate the correct fling - you will get the View flip animation.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;gallery.onRealFling(null, null, -800, 0);&lt;/b&gt;&lt;br /&gt;Here's a tricky part - the X velocity parameter needs to be adjusted per application, because to fling a larger view, you need a bigger velocity. So play with that value until you get a smooth transition.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Second issue:&lt;/span&gt;&lt;br /&gt;Items inside the layout that you return in your adapter cannot receive click events. They just can't. No good reason for it, but someone botched up the bubbling up of mouse events in the Gallery, so now you can't have clickable items. If you set any one of them as clickable - the gallery stops handling dragging.&lt;br /&gt;But fear not - you can fix it!&lt;br /&gt;The solution is as follows - you add a touch listener to the gallery, and catch a Single Tap event (I did it with gesture listener), to differentiate it from the dragging that the gallery needs to handle.&lt;br /&gt;Then, from the the location of the touch event, you can calculate where exactly inside your sub view the click was made - and from that you can handle the actual click.&lt;br /&gt;&lt;br /&gt;Here's the code:&lt;br /&gt;&lt;script src="https://gist.github.com/715364.js"&gt; &lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-6583984810331752314?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/6583984810331752314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/11/gallery-clicking-and-selecting.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/6583984810331752314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/6583984810331752314'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/11/gallery-clicking-and-selecting.html' title='Gallery, clicking and selecting'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-2264265606368525223</id><published>2010-10-24T12:23:00.000+02:00</published><updated>2010-10-24T12:23:20.937+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='marquee'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='textview'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Making a real marquee out of Android TextView</title><content type='html'>Android &lt;b&gt;TextView&lt;/b&gt; supports a &lt;i&gt;Marquee&lt;/i&gt; ellipsis method, which starts animating the text in the &lt;b&gt;TextView&lt;/b&gt; if it's width exceeded the width of the view.&lt;br /&gt;But let's say you want it to animate the text constantly? Here's a classic trick - pad the string until it goes out of the width of the view, so it will start the scrolling.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The hard part here was to find out how to calculate the line width (since the &lt;b&gt;TextView&lt;/b&gt; itself doesn't supply that info. Had to dig android sources for that.&lt;br /&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/643420.js"&gt; &lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-2264265606368525223?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/2264265606368525223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/10/making-real-marquee-out-of-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/2264265606368525223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/2264265606368525223'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/10/making-real-marquee-out-of-android.html' title='Making a real marquee out of Android TextView'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-1378549509393261753</id><published>2010-09-22T10:49:00.001+02:00</published><updated>2010-09-22T10:50:15.589+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='pdf'/><category scheme='http://www.blogger.com/atom/ns#' term='intent'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>A PDF Intent</title><content type='html'>Here's a naughty bit of behavior from the Android's Intents.&lt;br /&gt;When you want to customize the mime-type of the requested intent, the setter for reason resets the previously set Data parameter. Cute right?&lt;br /&gt;And to overcome this great issue, the API has another method &lt;i&gt;setDataAndType()&lt;/i&gt;. See what they did there?&lt;br /&gt;Anyways - here's a correct method (opening a PDF in this example):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/591374.js"&gt; &lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-1378549509393261753?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/1378549509393261753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/09/pdf-intent.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/1378549509393261753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/1378549509393261753'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/09/pdf-intent.html' title='A PDF Intent'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-3581202950726939099</id><published>2010-09-22T10:01:00.000+02:00</published><updated>2010-09-22T10:01:55.734+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>NullPointerException Confusion</title><content type='html'>It's good to know that our field is called Computer Science. We're scientists. We like facts, laws and rules... Yeah, right. You think that if you've learned the basics of Data Structures, Algorithms and other courses in your B.Sc. it would prepare you for the real world. Nope. It's craaaaazy out there.&lt;br /&gt;&lt;br /&gt;Today I had a real head-scratching moment when a completely innocent '&lt;i&gt;hashtable.put(key,val)&lt;/i&gt;' started giving me &lt;b&gt;NullPointerException&lt;/b&gt;. Now, since I do know how hashes work, all I checked was - is the table itself null ? Nope, it's good. So what the hell?&lt;br /&gt;&lt;br /&gt;Here comes the scary part:&lt;br /&gt;&lt;blockquote&gt;&lt;h3&gt;put&lt;/h3&gt;&lt;pre&gt;public &lt;a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Hashtable.html" title="type parameter in Hashtable"&gt;V&lt;/a&gt; &lt;b&gt;put&lt;/b&gt;(&lt;a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Hashtable.html" title="type parameter in Hashtable"&gt;K&lt;/a&gt;&amp;nbsp;key,&lt;br /&gt;             &lt;a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Hashtable.html" title="type parameter in Hashtable"&gt;V&lt;/a&gt;&amp;nbsp;value)&lt;/pre&gt;&lt;dl&gt;&lt;dd&gt;Maps the specified&amp;nbsp;&lt;code&gt;key&lt;/code&gt;&amp;nbsp;to the specified&amp;nbsp;&lt;code&gt;value&lt;/code&gt;&amp;nbsp;in this hashtable. Neither the key nor the value can be&amp;nbsp;&lt;code&gt;null&lt;/code&gt;.The value can be retrieved by calling the&amp;nbsp;&lt;code&gt;get&lt;/code&gt;&amp;nbsp;method with a key that is equal to the original key.&lt;/dd&gt;&lt;dd&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Specified by:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Map.html#put(K, V)"&gt;put&lt;/a&gt;&lt;/code&gt;&amp;nbsp;in interface&amp;nbsp;&lt;code&gt;&lt;a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Map.html" title="interface in java.util"&gt;Map&lt;/a&gt;&amp;lt;&lt;a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Hashtable.html" title="type parameter in Hashtable"&gt;K&lt;/a&gt;,&lt;a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Hashtable.html" title="type parameter in Hashtable"&gt;V&lt;/a&gt;&amp;gt;&lt;/code&gt;&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Specified by:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Dictionary.html#put(K, V)"&gt;put&lt;/a&gt;&lt;/code&gt;&amp;nbsp;in class&amp;nbsp;&lt;code&gt;&lt;a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Dictionary.html" title="class in java.util"&gt;Dictionary&lt;/a&gt;&amp;lt;&lt;a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Hashtable.html" title="type parameter in Hashtable"&gt;K&lt;/a&gt;,&lt;a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Hashtable.html" title="type parameter in Hashtable"&gt;V&lt;/a&gt;&amp;gt;&lt;/code&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;/dd&gt;&lt;dd&gt;&lt;br /&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Parameters:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;key&lt;/code&gt;&amp;nbsp;- the hashtable key.&lt;/dd&gt;&lt;dd&gt;&lt;code&gt;value&lt;/code&gt;&amp;nbsp;- the value.&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Returns:&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;the previous value of the specified key in this hashtable, or&amp;nbsp;&lt;code&gt;null&lt;/code&gt;&amp;nbsp;if it did not have one.&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="background-color: red;"&gt;Throws:&lt;/span&gt;&lt;/b&gt;&lt;/dt&gt;&lt;dd&gt;&lt;code&gt;&lt;a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/NullPointerException.html" title="class in java.lang"&gt;&lt;span class="Apple-style-span" style="background-color: red;"&gt;NullPointerException&lt;/span&gt;&lt;/a&gt;&lt;/code&gt;&lt;span class="Apple-style-span" style="background-color: red;"&gt;&amp;nbsp;- if the key or value is&amp;nbsp;&lt;code&gt;null&lt;/code&gt;.&lt;/span&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;/blockquote&gt;Apparently the usual approach is not good for the Java folk. They don't want no stinking nulls in their precious hashes!&lt;br /&gt;The reasoning behind the idiocity is this - the default&amp;nbsp;behavior&amp;nbsp;of &lt;i&gt;get()&lt;/i&gt; method in &lt;i&gt;hashtable&lt;/i&gt; is to return null if key was not found. So when the designers of the API chose that wrong path, they had to follow it up with a wronger path, since they couldn't distinguish between a null from 'no key found' and 'null found &amp;nbsp;as a value'.&lt;br /&gt;&lt;br /&gt;I hate people.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-3581202950726939099?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/3581202950726939099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/09/nullpointerexception-confusion.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/3581202950726939099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/3581202950726939099'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/09/nullpointerexception-confusion.html' title='NullPointerException Confusion'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-1773334464325605209</id><published>2010-09-15T11:09:00.000+02:00</published><updated>2010-09-15T11:09:32.428+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='gridview'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><category scheme='http://www.blogger.com/atom/ns#' term='button'/><title type='text'>GridViews, Buttons, Oh My.</title><content type='html'>In Android, there is a versatile class called &lt;b&gt;GridView&lt;/b&gt; which can display any custom designed cells. You provide it with a layout for each item, fill in the values - and voila - it's working.&lt;br /&gt;All is well, until you try to add something interactive to the Grid cell - like a button - you come across an interesting effect.&lt;br /&gt;If you add a &lt;i&gt;onClick&lt;/i&gt; listener to both the &lt;b&gt;GridView&lt;/b&gt; and the &lt;b&gt;Button&lt;/b&gt; inside the &lt;b&gt;GridView&lt;/b&gt; - only one will get the click event. And you won't guess which one :) (hint: it's the button)&lt;br /&gt;So basically, you can have interactivity - but not paired with &lt;i&gt;OnItemClick&lt;/i&gt; events of the Grid.&lt;br /&gt;Bummer, right?&lt;br /&gt;Wrong. This can be rather easily fixed, and the problem lays in the way Android handles focus resolution between parent and child &lt;b&gt;View&lt;/b&gt;s. For &lt;b&gt;ListView&lt;/b&gt; you can play with &lt;i&gt;Focusability&lt;/i&gt; parameter which controls who reacts first, and on &lt;b&gt;GridView&lt;/b&gt;, just the the &lt;b&gt;Button&lt;/b&gt;'s &lt;i&gt;Focusable&lt;/i&gt; parameter to false - and it just works. It still gets the touch events which cause the click, but it doesn't&amp;nbsp;interfere&amp;nbsp;with the focus mechanics of the Grid.&lt;br /&gt;You're welcome!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-1773334464325605209?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/1773334464325605209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/09/gridviews-buttons-oh-my.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/1773334464325605209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/1773334464325605209'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/09/gridviews-buttons-oh-my.html' title='GridViews, Buttons, Oh My.'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-2003445807805408391</id><published>2010-07-18T11:27:00.000+03:00</published><updated>2010-07-18T11:27:25.454+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='0x800736b1'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='xp'/><category scheme='http://www.blogger.com/atom/ns#' term='manifest'/><category scheme='http://www.blogger.com/atom/ns#' term='iis'/><category scheme='http://www.blogger.com/atom/ns#' term='dll'/><title type='text'>The Saga of COMException (0x800736b1)</title><content type='html'>So I had a very lovely weekend being sexually&amp;nbsp;assaulted&amp;nbsp;by a pesky problem while installing an ASP.NET application on a Windows XP IIS server.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="color: #4d4d4d; font-family: Verdana; font-size: 10px; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: red; font-family: Verdana; font-size: 18pt;"&gt;Server Error in '/AppName' Application.&lt;/span&gt;&lt;/div&gt;&lt;h1 align="center" style="color: #4d4d4d; font-family: Verdana; font-size: 10px; margin-bottom: auto; margin-left: 0in; margin-right: 0in; margin-top: auto; text-align: center;"&gt;&lt;span style="color: red; font-family: Verdana; font-size: 18pt;"&gt;&lt;hr align="center" style="background-color: transparent; border-bottom-color: rgb(204, 204, 204); border-bottom-style: dotted; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: dotted; border-left-width: 0px; border-right-color: rgb(204, 204, 204); border-right-style: dotted; border-right-width: 0px; border-top-color: rgb(204, 204, 204); border-top-style: dotted; border-top-width: 0px; height: 0px;" /&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h2 style="color: #4d4d4d; font-family: Verdana; font-size: 10px; margin-bottom: auto; margin-left: 0in; margin-right: 0in; margin-top: auto;"&gt;&lt;span style="font-size: large;"&gt;&lt;i&gt;&lt;span style="color: maroon; font-family: Verdana;"&gt;This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style="font-size: large;"&gt;&lt;i&gt;&lt;span style="color: maroon; font-family: Verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: maroon; font-family: Verdana;"&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: #4d4d4d; font-size: 10px; font-style: normal;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-family: 'Times New Roman'; font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #4d4d4d; font-size: 10px; font-style: normal;"&gt;&lt;b&gt;&lt;span style="color: black; font-family: Verdana; font-size: 8.5pt;"&gt;Exception Details:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #4d4d4d; font-size: 10px; font-style: normal;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 8.5pt;"&gt;System.Runtime.InteropServices.COMException: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: maroon; font-family: Verdana;"&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: #4d4d4d; font-size: 10px; font-style: normal;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 8.5pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: maroon; font-family: Verdana;"&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: #4d4d4d; font-size: 10px; font-style: normal;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 8.5pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Ok, this is lovely. Tracing the error code was pretty straight forward and pointed to the lack of VC++&amp;nbsp;Redistributable&amp;nbsp;DLLs on the target machine. They are present on the developer box, but are missing on target. Sounds easy enough, downloaded vc_redistx86.exe , installed - same result.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Excellent. So, using depends.exe, I checked that the DLL in question is looking for msvcr80.dll and friends. Curiously enough - they were installed on the system, but the problem persisted, the application just didn't pick them up.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So I dug some more, and came across a folder \Windows\WinSxS (&lt;a href="http://msdn.microsoft.com/en-us/library/aa376307(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/aa376307(VS.85).aspx&lt;/a&gt;). It's Microsoft's solution to &lt;a href="http://en.wikipedia.org/wiki/DLL_hell"&gt;DLL Hell&lt;/a&gt;. There are several versions of the same CRT DLLs, in subfolders with different version names.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Which pointed me to the fact that it's not that the DLL is missing, but it's of incorrect version. So what was left is to discover how exactly does the application select which DLL to load. (it's&amp;nbsp;obviously&amp;nbsp;not by name!). So after frantic Google searches I came across a beast whom I met before but didn't pay attention to - "XP Manifest".&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It's a XML file which is embedded inside the application/DLL as a resource, and can define properties like 'Dll dependency'. So a quick run of ResHacker, patching the XP Manifest, saving the new app, re running, seeing that it works and then&amp;nbsp;promising&amp;nbsp;my self to tear away the nads of whomever though it would be a great idea to make me spend my weekend tracking this shit, and not just showing me a freaking help message!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-2003445807805408391?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/2003445807805408391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/07/saga-of-comexception-0x800736b1.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/2003445807805408391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/2003445807805408391'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/07/saga-of-comexception-0x800736b1.html' title='The Saga of COMException (0x800736b1)'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-3783305716856637397</id><published>2010-07-05T10:21:00.002+03:00</published><updated>2010-07-05T10:21:39.486+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='blackberry'/><category scheme='http://www.blogger.com/atom/ns#' term='bitmap'/><category scheme='http://www.blogger.com/atom/ns#' term='button'/><title type='text'>Bitmap Button in Blackberry</title><content type='html'>I won't bitch about the state of Blackberry UI framework, just mention that there's isn't a standard button class that supports images. WTF?&lt;br /&gt;In any case, here's the code that implements one.&lt;br /&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/464101.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-3783305716856637397?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/3783305716856637397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/07/bitmap-button-in-blackberry.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/3783305716856637397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/3783305716856637397'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/07/bitmap-button-in-blackberry.html' title='Bitmap Button in Blackberry'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-1390728391880909353</id><published>2010-07-05T10:12:00.000+03:00</published><updated>2010-07-05T10:12:42.237+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><title type='text'>Open an external browser on Android</title><content type='html'>Ok, so I wanted to open an external browser from my Android application. Crazy, right? Anyways, after some searching and trying to read almost empty Android SDK docs on the subject, I came across this golden turd:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman';"&gt;&lt;span class="Apple-style-span" style="font-family: monospace;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman';"&gt;&lt;span class="Apple-style-span" style="font-family: monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try{ &amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Intent i = new Intent();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ComponentName comp = new ComponentName(&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "com.google.android.browser",&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"com.google.android.browser.BrowserActivity");&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i.setComponent(comp);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i.setAction("android.intent.action.VIEW");&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i.addCategory("android.intent.category.BROWSABLE");&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Uri.Builder z = new Uri.Builder(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i.setData(z.build());&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;getContext().startActivity(i);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} catch (URISyntaxException e) {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.printStackTrace();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;At this point I lost all faith in humanity and all that's sacred.&lt;br /&gt;Come on people, there must be a better way!&lt;br /&gt;&lt;br /&gt;And here I come to save the day :) The code is actually very short and simple:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;getContext().startActivity(new Intent(Intent.ACTION_VIEW,  Uri.parse(url)));&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-1390728391880909353?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/1390728391880909353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/07/open-external-browser-on-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/1390728391880909353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/1390728391880909353'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/07/open-external-browser-on-android.html' title='Open an external browser on Android'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-1740740785517225519</id><published>2010-06-26T11:51:00.001+03:00</published><updated>2010-06-26T11:51:31.105+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='blackberry'/><category scheme='http://www.blogger.com/atom/ns#' term='broadcast'/><title type='text'>Inter-process Communication of BlackBerry</title><content type='html'>&lt;p&gt;Maybe I just don’t know how to read the docs, or how to Google, but I was looking for this info way too much, somehow it was burried. In any case – let’s say you have to apps on the device, and they use a common PersistenStore. One app adds stuff there in the background. The other – shows a UI with a list of the items from the store. All nice and synchronized. The only problem is – there is no way to detect that the PersistentObject that you are using was updated! So if you want to have your list refreshed automatically – you have to get creative.&lt;/p&gt; &lt;p&gt;On the producer side, after updating the PersistentStore, post a global notification with a unique ID:&lt;br&gt;&lt;font style="background-color: #ffffff" color="#333333" face="Comic Sans MS"&gt;ApplicationManager.getApplicationManager().postGlobalEvent(Main.NOTIFICATIONS_ID_1);&lt;/font&gt;&lt;/p&gt; &lt;p&gt;On the consumer side (UI), register for the notifications, then catch that message and update the UI accordingly:&lt;/p&gt; &lt;p&gt;&lt;script src="http://gist.github.com/453910.js"&gt;&lt;/script&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-1740740785517225519?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/1740740785517225519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/inter-process-communication-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/1740740785517225519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/1740740785517225519'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/inter-process-communication-of.html' title='Inter-process Communication of BlackBerry'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-1596236135307306510</id><published>2010-06-26T11:41:00.001+03:00</published><updated>2010-06-26T11:41:32.201+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='sdcard'/><category scheme='http://www.blogger.com/atom/ns#' term='blackberry'/><category scheme='http://www.blogger.com/atom/ns#' term='mkdir'/><title type='text'>Why I Hate BlackBerry. Also, how to make a folder.</title><content type='html'>&lt;p&gt;Let’s be clear, RIM should be ashamed of the way their developer toolkit looks. The documentation is sparse at best, their own ide JDE looks and works like something from the 70s, and their Eclipse plugin refuses to work with actual devices and crashes on Simulator hot swaps. I am not even mentioning the fact that the UI has to be built in code like in the DOS days. Seriously? No GUI builders? In 2010? Sheesh. Now to the tip of today: How to make a folder on a SD Card.&lt;/p&gt; &lt;p&gt;Sounds simple right? Open a FileConnection, call a mkdir() method? Nope. IO Exceptions, Cannot access root file system and other not very helpful messages (all that is in addition to the fact that you cannot work with both debugger and SD card at the same time. very convenient).&lt;/p&gt; &lt;p&gt;Basically, the hidden gem is – you &lt;strong&gt;must&lt;/strong&gt; have a trailing slash at the end of your path. Otherwise – no mkdir() for you!&lt;/p&gt; &lt;p&gt;&lt;script src="http://gist.github.com/453908.js"&gt;&lt;/script&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-1596236135307306510?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/1596236135307306510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/why-i-hate-blackberry-also-how-to-make.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/1596236135307306510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/1596236135307306510'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/why-i-hate-blackberry-also-how-to-make.html' title='Why I Hate BlackBerry. Also, how to make a folder.'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-2826738578559066111</id><published>2010-06-26T11:35:00.001+03:00</published><updated>2010-06-26T11:35:26.844+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugin'/><category scheme='http://www.blogger.com/atom/ns#' term='github'/><category scheme='http://www.blogger.com/atom/ns#' term='gist'/><title type='text'>Gist, GitHub and Live Writer</title><content type='html'>&lt;p&gt;Microsoft has a small project they purchased with some company that is actually very nice – small, free and better than most commercial products – Live Writer &lt;a title="http://windowslivewriter.spaces.live.com" href="http://windowslivewriter.spaces.live.com"&gt;http://windowslivewriter.spaces.live.com&lt;/a&gt; . Supports different blogging sites, has many nice features. All in all – a solid product.&lt;/p&gt; &lt;p&gt;It also supports a very simple plugin model for easy extensibility of the program.&lt;/p&gt; &lt;p&gt;As you might have noticed before, I am posting snippets of code using a most excellent &lt;a href="http://gist.github.com"&gt;http://gist.github.com&lt;/a&gt; service.&lt;/p&gt; &lt;p&gt;So I decided to make a plugin for Live Writer that will simplify that process. 20 minutes of work and it is done. You can find it at the &lt;a href="http://gallery.live.com/liveItemDetail.aspx?li=bf276dce-2c86-43d5-97ef-a599a055f4ae&amp;amp;pl=8&amp;amp;bt=9"&gt;Live Writer Extension Gallery&lt;/a&gt;. The sources (badly written due to laziness) can be downloaded &lt;a href="http://sites.google.com/site/kodermonkeys/GistPlugin.rar"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-2826738578559066111?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/2826738578559066111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/gist-github-and-live-writer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/2826738578559066111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/2826738578559066111'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/gist-github-and-live-writer.html' title='Gist, GitHub and Live Writer'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-9206146374669257712</id><published>2010-06-24T18:26:00.001+03:00</published><updated>2010-06-24T18:26:25.339+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Detecting network availability on Android</title><content type='html'>&lt;p&gt;This tip is not really a ‘hidden feature’, but it’s useful and can come in handy if you don’t want to register BroadcastReceiver and add listeners for network events, but just want to check if you have network access at a certain point.&lt;/p&gt;&lt;script src="http://gist.github.com/451576.js"&gt;&lt;/script&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-9206146374669257712?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/9206146374669257712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/detecting-network-availability-on.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/9206146374669257712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/9206146374669257712'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/detecting-network-availability-on.html' title='Detecting network availability on Android'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-6222120067843298311</id><published>2010-06-23T12:52:00.001+03:00</published><updated>2010-06-23T12:53:11.739+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='transparent'/><category scheme='http://www.blogger.com/atom/ns#' term='uiwebview'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><title type='text'>Transparent UIWebView on iPhone</title><content type='html'>Here's a little trick that allows you to create a WebView in your iPhone application that has it's background transparent, showing whatever controls you have underneath.&lt;br /&gt;Could be used to create some sort of animation/background images behind the view.&lt;br /&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/449713.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-6222120067843298311?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/6222120067843298311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/heres-little-trick-that-allows-you-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/6222120067843298311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/6222120067843298311'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/heres-little-trick-that-allows-you-to.html' title='Transparent UIWebView on iPhone'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-6779544956344930106</id><published>2010-06-20T00:18:00.001+03:00</published><updated>2010-06-20T00:18:50.319+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='notification'/><category scheme='http://www.blogger.com/atom/ns#' term='event'/><category scheme='http://www.blogger.com/atom/ns#' term='shake'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><category scheme='http://www.blogger.com/atom/ns#' term='broadcast'/><title type='text'>Shaking on the iPhone</title><content type='html'>&lt;p&gt;Let’s say you have an iPhone application with many different View Controllers, and in some of them you want to detect a ‘Device Shake’ event. You can’t just catch it in the Controller itself, since it provide methods for that. So the solution is this – you subclass a UIWindow to detect an event and then broadcast it to your app. Then catch the event in appropriate places using NSNotificationCenter.&lt;/p&gt; &lt;p&gt;Don’t forget to change the parent class of your main Window to MotionWindow to catch the events.&lt;/p&gt; &lt;p&gt;Enjoy, here's the code:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;script src="http://gist.github.com/445282.js"&gt;&lt;/script&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-6779544956344930106?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/6779544956344930106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/shaking-on-iphone.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/6779544956344930106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/6779544956344930106'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/shaking-on-iphone.html' title='Shaking on the iPhone'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-1432957803570947270</id><published>2010-06-16T09:31:00.002+03:00</published><updated>2010-06-16T20:39:31.858+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='version'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='blackberry'/><category scheme='http://www.blogger.com/atom/ns#' term='module'/><title type='text'>Get your Blackberry app version programmatically</title><content type='html'>&lt;p&gt;Let's say you want to add a 'About' dialog in your application and you want to show current application's version. &lt;/p&gt;&lt;p&gt;Sounds easy, right? Well, not exactly. In BlackBerry there could be several apps per COD file, called ‘modules’, so you have to traverse them to find your own module. Then there’s the case with simulators which are not close to the real device and therefore cause many issues, so you have to add a special case for them… All this sums up to the following piece of code:&lt;/p&gt;&lt;br&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/441007.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-1432957803570947270?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/1432957803570947270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/get-your-blackberry-app-version.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/1432957803570947270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/1432957803570947270'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/get-your-blackberry-app-version.html' title='Get your Blackberry app version programmatically'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-8728155290757920556</id><published>2010-06-15T17:52:00.001+03:00</published><updated>2010-06-16T20:35:28.823+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='blackberry'/><category scheme='http://www.blogger.com/atom/ns#' term='sms'/><title type='text'>Sending an SMS on BlackBerry</title><content type='html'>While reading documentation on SMS sending in BlackBerry JDE JavaDocs you come across a fact that several important parts are missing.&lt;br /&gt;Documentation mentions SMS 'port', a number you are supposed to write after the phone, using the :123 format. Googling, you might see on many sites a random number provided, then on others you see a + sign used in the phone number.&lt;br /&gt;Don't&amp;nbsp;believe&amp;nbsp;the hype!&lt;br /&gt;Here's a simple function, that, given a phone number (just digits) and SMS text, will simply send a SMS or return false in case something bad happens. Easy peasy!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/440998.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-8728155290757920556?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/8728155290757920556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/8728155290757920556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/8728155290757920556'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/test.html' title='Sending an SMS on BlackBerry'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021623171320558777.post-1519333482559768788</id><published>2010-06-14T20:07:00.000+03:00</published><updated>2010-06-14T20:07:56.143+03:00</updated><title type='text'>Set Sail</title><content type='html'>During my many hours of laboring as a mobile application developer I came across an interesting fact - the amount of documentation provided to the programmers by the different OS manufacturers is incredibly&amp;nbsp;scarce&amp;nbsp;and partial, missing many small details that can cause countless hours of hear-pulling and cursing.&lt;br /&gt;&lt;br /&gt;Thankfully we now have sites like &lt;a href="http://www.stackoverflow.com/"&gt;StackOverflow&lt;/a&gt; which connect developers and empower them, but even there you sometimes miss this important information.&lt;br /&gt;&lt;br /&gt;So I present to you, dear Internet, this blog, in which I will some times post notes, code snippets, suggestions and findings that I&amp;nbsp;believe&amp;nbsp;can be useful to many developers word wide.&lt;br /&gt;&lt;br /&gt;P.S. I do not claim the be the uber-specialist, nor do I claim copyright for the code. It's been either collected from pieces on the net, or glued together by me.&lt;br /&gt;You are free to use and repost anything you find here, though I would appreciate a mention in you comments if you plan on using the content.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7021623171320558777-1519333482559768788?l=stuffnobodytoldmeabout.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffnobodytoldmeabout.blogspot.com/feeds/1519333482559768788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/set-sail.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/1519333482559768788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021623171320558777/posts/default/1519333482559768788'/><link rel='alternate' type='text/html' href='http://stuffnobodytoldmeabout.blogspot.com/2010/06/set-sail.html' title='Set Sail'/><author><name>Eli Yukelzon</name><uri>https://profiles.google.com/104518334323579390428</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-Q-X2gQIMqfQ/AAAAAAAAAAI/AAAAAAAAJQU/7M5TQee0V3o/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
