<?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-4478829316282336892</id><updated>2011-08-02T20:30:21.581+02:00</updated><category term='ruby'/><category term='ionice'/><category term='merging'/><category term='templates'/><category term='enamouring'/><category term='reverse-engineering'/><category term='funny'/><category term='gentoo'/><category term='sony'/><category term='quote'/><category term='cross-compiling'/><category term='blender'/><category term='fonts'/><category term='channel 13'/><category term='3d modelling'/><category term='hacking'/><category term='youtube'/><category term='wine'/><category term='crda'/><category term='lvm'/><category term='api'/><category term='plasma'/><category term='snapshot'/><category term='png'/><category term='win32'/><category term='visualisation'/><category term='second life'/><category term='compilation'/><category term='paludis'/><category term='qt4'/><category term='DRM'/><category term='htc dream'/><category term='video'/><category term='subpixel antialiasing'/><category term='image'/><category term='shower insights'/><category term='qmake'/><category term='hardware'/><category term='rant'/><category term='patch'/><category term='ath5k'/><category term='linux'/><category term='silence'/><category term='screen'/><category term='hack'/><category term='KDE'/><category term='SCSI'/><category term='vision'/><category term='opensuse'/><category term='java'/><category term='interactive fiction'/><category term='wifi'/><category term='x11'/><category term='crush'/><category term='magic ink'/><category term='graphics'/><category term='music'/><category term='faq'/><category term='regdom'/><category term='ideas'/><category term='restrained life'/><category term='synaesthesia'/><category term='cropwidget'/><category term='radeon'/><category term='xrandr'/><category term='android'/><category term='blogger'/><category term='drivers'/><category term='reference'/><category term='color'/><category term='short-circuit'/><category term='icon'/><category term='jfs'/><category term='ebuild'/><category term='crop'/><category term='led'/><category term='device mapper'/><category term='network walkman'/><category term='nice'/><category term='widget'/><category term='mingw32'/><category term='qt4/win'/><category term='scheduling'/><title type='text'>Divided Mind</title><subtitle type='html'>opinions are divided</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-5777621822379267423</id><published>2010-03-13T19:01:00.003+01:00</published><updated>2010-03-13T19:05:06.561+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sony'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='network walkman'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><category scheme='http://www.blogger.com/atom/ns#' term='drivers'/><title type='text'>Software from the dark past - Sony Network Walkman NW-E507 drivers for Linux</title><content type='html'>&lt;p&gt;Remember how I used to &lt;a href="http://divided-mind.blogspot.com/2008/01/hardware-hacking-or-how-i-learned-to.html"&gt;hack Sony Network Walkman NW-E507&lt;/a&gt;? Well, back then, I succeeded and it did work, but soon after that the device got stolen so I never polished it up to release quality. But even though it isn't release quality and I'm not even sure the code I got is the working one (although commit history does suggest so), I decided to &lt;a href="http://repo.or.cz/w/amarok_sonynw.git"&gt;publish it anyway&lt;/a&gt;. Perhaps it will be useful to someone.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-5777621822379267423?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/5777621822379267423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=5777621822379267423' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/5777621822379267423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/5777621822379267423'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2010/03/software-from-dark-past-sony-network.html' title='Software from the dark past - Sony Network Walkman NW-E507 drivers for Linux'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-140601217664316615</id><published>2009-11-17T17:38:00.002+01:00</published><updated>2009-11-17T17:40:30.469+01:00</updated><title type='text'>Inventing schemes is not really cool</title><content type='html'>&lt;p&gt;&lt;a href="http://android-developers.blogspot.com/2009/11/integrating-application-with-intents.html"&gt;Android Developers Blog: Integrating Application with Intents&lt;/a&gt; &amp;mdash; a nice writeup about really, seriously underappreciated Android feature, Intents. Somehow it's reminiscient of the revolutionary &lt;a href="http://worrydream.com/MagicInk/#engineering_inference_from_the_environment"&gt;Magic Ink&lt;/a&gt; proposal, albeit on a push, not pull basis.&lt;/p&gt;

&lt;p&gt;Having said that, I can't shake the feeling that making up URI schemes is not cool. Especially when they're made up to go with an Intent action which is actually redundant with the scheme. URI should point to a location, not embody action; actions should go in the action field (hey, action&amp;ndash;action, ya see? almost like it was designed for that!).&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-140601217664316615?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/140601217664316615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=140601217664316615' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/140601217664316615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/140601217664316615'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/11/inventing-schemes-is-not-really-cool.html' title='Inventing schemes is not really cool'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-7403500859980682281</id><published>2009-11-17T01:28:00.009+01:00</published><updated>2009-11-17T02:38:37.707+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rant'/><category scheme='http://www.blogger.com/atom/ns#' term='channel 13'/><category scheme='http://www.blogger.com/atom/ns#' term='crda'/><category scheme='http://www.blogger.com/atom/ns#' term='opensuse'/><category scheme='http://www.blogger.com/atom/ns#' term='regdom'/><category scheme='http://www.blogger.com/atom/ns#' term='wifi'/><category scheme='http://www.blogger.com/atom/ns#' term='ath5k'/><title type='text'>OpenSuSE 11.2, ath5k and channel 13</title><content type='html'>&lt;p&gt;Kernel 2.6.28 adds brand new &lt;abbr title="Wireless Local Area Network"&gt;WiFi&lt;/abbr&gt; &lt;a href="http://wireless.kernel.org/en/developers/Regulatory"&gt;regulatory domain handling&lt;/a&gt;; so if you upgrade from OpenSuSE 11.1 to 11.2 (and so from 2.6.27 to 2.6.31) you get this shiny new (FCC) sheriff's badge right there too. This is all fine and cool, only the userspace part &lt;a href="https://bugzilla.novell.com/show_bug.cgi?id=555850"&gt;is utterly broken in SuSE&lt;/a&gt;, so you're limited to world regulatory domain.&lt;/p&gt;

&lt;p&gt;Ah, well, downloading &lt;a href="http://wireless.kernel.org/download/wireless-regdb/regulatory.bins/"&gt;Lineville's regulatory.bin&lt;/a&gt; fixes it. (Only it's a bit hard if you have NO FREAKING NETWORK because you use channel 13 on your AP and your OS decides that it's &lt;a href="http://www.youtube.com/watch?v=kNwbjcuQUv8"&gt;no channel 13 for you&lt;/a&gt;.) Or does it? Wait, it only gets better.&lt;/p&gt;

&lt;p&gt;Now, apparently, your network card feels a citizen of the world. It doesn't matter you're an EU citizen in the EU and that the computer has been bought in the EU. EEPROM says world regdom, the kernel must obey. So you end up &lt;a href="http://osdir.com/ml/linux-wireless/2009-09/msg00961.html"&gt;patching the driver&lt;/a&gt; to report correct regdom to kernel (because it obviously won't just let you override it, you malicious, evil bastard, you). I sure hope you have that kernel source around! And development tools. And stuff. Although I'd advise against those -s in the patch, they seem to break it further, dunno why.&lt;/p&gt;

&lt;p&gt;Apparently you can use &lt;a href="http://madwifi-project.org/wiki/UserDocs/AthInfo"&gt;ath_info&lt;/a&gt; to patch up your EEPROM to report correct regdom, so you don't have to patch up ath.ko every time a kernel upgrade comes down the line. Fortunately the &lt;a href="http://madwifi-project.org/suse/11.1/"&gt;11.1 repo&lt;/a&gt;'s version still works. (It's regdom 0x37 for EU.) Just that... the card refuses to write it. So you're stuck with patching. Or just shut up and don't use channel 13. Which might explain exactly why it's usually less crowded. (Which, incidentally, is exactly why you'd want to use it.)&lt;/p&gt;

&lt;p&gt;Oh, wait, you can enable EEPROM writing on AR5110. You just need to pull the GPIO EEPROM write enable pin. Of course, there's no datasheet anywhere in sight. You're lucky your humble editor took the risk and brute-forced all 10 pins (ok, not all, but he was ready to) and found the magic combination. It's &lt;tt&gt;# &lt;kbd&gt;ath_info -g 1:0 -w &amp;lt;base-address&amp;gt; regdomain 0x37&lt;/kbd&gt;&lt;/tt&gt;. &lt;kbd&gt;lspci -v&lt;/kbd&gt; will tell you the address.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-7403500859980682281?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/7403500859980682281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=7403500859980682281' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/7403500859980682281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/7403500859980682281'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/11/opensuse-112-ath5k-and-channel-13.html' title='OpenSuSE 11.2, ath5k and channel 13'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-2811085987079873512</id><published>2009-11-17T00:54:00.002+01:00</published><updated>2009-11-17T01:00:25.865+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='qt4'/><category scheme='http://www.blogger.com/atom/ns#' term='xrandr'/><category scheme='http://www.blogger.com/atom/ns#' term='radeon'/><category scheme='http://www.blogger.com/atom/ns#' term='x11'/><category scheme='http://www.blogger.com/atom/ns#' term='fonts'/><category scheme='http://www.blogger.com/atom/ns#' term='subpixel antialiasing'/><title type='text'>Broken SPAA on Radeons with analog panels</title><content type='html'>&lt;p&gt;If you have a Radeon with analog LCD panel and after upgrading something (possibly the radeon driver) SPAA suddenly no longer works for you in Qt4, try the following:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;
$ &lt;kbd&gt;echo Xft.rgba: rgb &gt;&gt; ~/.Xresources&lt;/kbd&gt;&lt;br/&gt;
$ &lt;kbd&gt;xrdb -merge ~/.Xresources&lt;/kbd&gt;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;I'm too pissed off by this and debugging it for two days to offer any explanation (just to note, &lt;code&gt;radeon&lt;/code&gt;'s &lt;code&gt;Option "SubPixelOrder"&lt;/code&gt; doesn't work; if you feel like digging, see &lt;em class="filename"&gt;qfontengine_ft.cpp&lt;/em&gt;, libXrender's and libXrandr's source). Also, YMMV. If it works you're on your own to make sure it gets loaded properly.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-2811085987079873512?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/2811085987079873512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=2811085987079873512' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/2811085987079873512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/2811085987079873512'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/11/broken-spaa-on-radeons-with-analog.html' title='Broken SPAA on Radeons with analog panels'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-571881536504667882</id><published>2009-10-28T06:32:00.007+01:00</published><updated>2009-10-28T06:44:22.601+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='interactive fiction'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Hunky Punk — crawl dungeon on the bus</title><content type='html'>&lt;img width="640" height="427" src="http://1.bp.blogspot.com/_NjREpqVx84E/SufZ0jLJ1UI/AAAAAAAAAYk/xHkWMkqpFNY/s1600/promo.png" alt="How deep dare you go?" /&gt;

&lt;p&gt;Interactive fiction interpreter for Android released! Look at &lt;a href="https://sourceforge.net/projects/hunkypunk/"&gt;the code&lt;/a&gt; or just &lt;a href="market://search?q=pname:org.andglk.hunkypunk"&gt;grab the package at Market&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/4478829316282336892-571881536504667882?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/571881536504667882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=571881536504667882' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/571881536504667882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/571881536504667882'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/10/hunky-punk-crawl-dungeon-on-bus.html' title='Hunky Punk &amp;mdash; crawl dungeon on the bus'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_NjREpqVx84E/SufZ0jLJ1UI/AAAAAAAAAYk/xHkWMkqpFNY/s72-c/promo.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-1369958004103845562</id><published>2009-07-08T13:14:00.002+02:00</published><updated>2009-07-08T13:26:58.498+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='api'/><category scheme='http://www.blogger.com/atom/ns#' term='color'/><category scheme='http://www.blogger.com/atom/ns#' term='htc dream'/><category scheme='http://www.blogger.com/atom/ns#' term='led'/><category scheme='http://www.blogger.com/atom/ns#' term='drivers'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>HTC Dream's notification LED color.</title><content type='html'>&lt;p&gt;Android documentation &lt;a href="http://developer.android.com/reference/android/app/Notification.html#ledARGB"&gt;says&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;public int ledARGB&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The color of the led. The hardware will do its best approximation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="http://code.google.com/p/android/issues/detail?id=3204"&gt;Best approximation my ass&lt;/a&gt;. I wanted &lt;code&gt;#fb2a0c&lt;/code&gt;, I got pink. To get the orange color, I needed &lt;code&gt;#080800&lt;/code&gt;, for which orange is most certainly &lt;em&gt;not&lt;/em&gt; what I'd call best approximation. It seems that Dreams' drivers just feed the raw RGB values to the hardware without bothering to do any processing on them.&lt;/p&gt;

&lt;p&gt;To make it easier to find out which color to feed your device to get the real best approximation of color &lt;em&gt;you&lt;/em&gt; want, I made this &lt;a href="http://repo.or.cz/w/ledtester.git"&gt;quick and dirty android LED tester&lt;/a&gt;. Just slide the sliders until you're satisfied, note the values and get on with it.&lt;/p&gt;

&lt;p&gt;As a note, you might want to only serve the fake colors to devices you tested them on, in case other devices handle this properly and your app would turn out to blink the LED in real &lt;code&gt;#080800&lt;/code&gt;, which is to say, almost black. I do this with &lt;code&gt;if (Build.DEVICE.equals("dream")) color = 0xff080800; else color = 0xfffb2a0c;&lt;/code&gt; obviously if you test on more devices and they're all equally quirky, you need to add more checks.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-1369958004103845562?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/1369958004103845562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=1369958004103845562' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/1369958004103845562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/1369958004103845562'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/07/htc-dreams-notification-led-color.html' title='HTC Dream&apos;s notification LED color.'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-5881341626080745070</id><published>2009-07-07T19:12:00.004+02:00</published><updated>2009-07-07T19:16:40.103+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='3d modelling'/><category scheme='http://www.blogger.com/atom/ns#' term='icon'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><category scheme='http://www.blogger.com/atom/ns#' term='blender'/><title type='text'>Making Android application icons</title><content type='html'>&lt;p&gt;Making application icons which would fit in style of the original icons on Android isn't at all easy. I've found it's easiest to model icon in 3D and render it. In the best interest of aesthetically-sensitive android users worldwide, I'm making available this &lt;a href="http://drop.io/android_app_icon"&gt;android application icon template&lt;/a&gt; you can use to make your new beautiful icon.&lt;/p&gt;

&lt;p&gt;It's got the camera, lights and whatnot setup just the proper way. It's still a little bit off the original icons&amp;mdash;the shadow could be softer, for instance&amp;mdash;but works good enough for me after some time struggling with blender's clunky interface. If you can fix it, great&amp;mdash;the drop has guest upload enabled, so feel free to share your improved version.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-5881341626080745070?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/5881341626080745070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=5881341626080745070' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/5881341626080745070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/5881341626080745070'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/07/making-android-application-icons.html' title='Making Android application icons'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-5395556831511586975</id><published>2009-07-02T12:32:00.002+02:00</published><updated>2009-07-02T12:45:54.535+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='png'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Extracting 9-patches from apk files</title><content type='html'>&lt;p&gt;As you may or may not know, 9.png files in compiled android packages have the nine patch metadata info rolled from the image OOB into the PNG file. Following quick and dirty ruby script extracts it back.&lt;/p&gt;

&lt;code&gt;
&lt;pre&gt;#!/usr/bin/env ruby

# Rafał Rzepecki &lt;divided.mind@gmail.com&gt;
# public domain
#
# deserializes metadata of 9-patch png file
# optionally writes out png with 9-patch info embedded (needs imagemagick for that)
#
# quick and dirty hack, no error handling, almost no test, YMMV
#
# for format specs see android/platform/frameworks/base/libs/utils/ResourceTypes.cpp
# (in android platform source)

if ARGV.length == 0
    print "Usage: #{__FILE__} &amp;lt;serialized nine-patch png file&amp;gt; [optional output png with inline 9-patch info]\n"
    exit 1
end

filename = ARGV[0]
png = File.open(filename) { |f|f.read }
index = png.index 'npTc'
data = png[(index+4)..-1]
wasDeserialized, numXDivs, numYDivs, numColors = data[0...4].unpack('C4')
paddings = data[12...(12+16)].unpack('N4') #left right top bottom
data.slice!(0...32)
xDivs = data.unpack("N#{numXDivs}")
data.slice!(0...(4*numXDivs))
yDivs = data.unpack("N#{numYDivs}")
data.slice!(0...(4*numYDivs))
colors = data.unpack("N#{numColors}")

print "was deserialized: #{wasDeserialized}
paddings: #{paddings.join(', ')}
xdivs: #{xDivs.join(', ')}
ydivs: #{yDivs.join(', ')}
colors: #{colors.map{|c| "#%08x"%c}.join(', ')}
"

if ARGV.length == 1
    exit 0
end

# quick and dirty
`identify #{filename}` =~ /PNG (\d+)x(\d+)/
w, h = $1.to_i, $2.to_i
`convert #{filename} -bordercolor white -compose Copy -border 1x1 -stroke black \
-draw 'line #{xDivs[0] + 1},0 #{xDivs[1] + 1},0' \
-draw 'line 0,#{yDivs[0] + 1} 0,#{yDivs[1] + 1}' \
-draw 'line #{paddings[0] + 1},#{h + 1} #{w - paddings[1]},#{h+1}' \
-draw 'line #{w+1},#{paddings[2] + 1} #{w+1},#{h - paddings[3]}' \
#{ARGV[1]}`
&lt;/pre&gt;
&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-5395556831511586975?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/5395556831511586975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=5395556831511586975' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/5395556831511586975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/5395556831511586975'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/07/extracting-9-patches-from-apk-files.html' title='Extracting 9-patches from apk files'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-3199674292686918003</id><published>2009-06-28T00:01:00.003+02:00</published><updated>2009-06-28T00:03:49.831+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='api'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>SIM contact list query doesn't support filtering</title><content type='html'>&lt;p&gt;&lt;code&gt;content://sim/adn&lt;/code&gt; doesn't respect the &lt;code&gt;where&lt;/code&gt; clause when querying it. Just so that someone doesn't spend as much time wondering why the freaking thing wouldn't work as I did.&lt;/p&gt;

&lt;p&gt;You have to filter it another way. I did by creating a custom &lt;code&gt;CursorAdapter&lt;/code&gt; to filter it, but your mileage may vary. It might be better to make a cursor wrapper, or something. Or is there something like that in the library already, and I just missed it?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-3199674292686918003?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/3199674292686918003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=3199674292686918003' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/3199674292686918003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/3199674292686918003'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/06/sim-contact-list-query-doesnt-support.html' title='SIM contact list query doesn&apos;t support filtering'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-2418435077942920174</id><published>2009-06-23T22:36:00.002+02:00</published><updated>2009-06-23T22:40:27.891+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='api'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Launching applications in Android</title><content type='html'>&lt;p&gt;To launch an application programmatically in Android given an &lt;code&gt;ApplicationInfo&lt;/code&gt;, do:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;pre&gt;ApplicationInfo ai;
PackageManager pm = getPackageManager();
try {
    Intent i = pm.getLaunchIntentForPackage(ai.packageName);
    startActivity(i);
} catch (Exception e) {
    Toast t = Toast.makeText(this, "Couldn't launch the application.", Toast.LENGTH_SHORT);
    t.show();
}&lt;/pre&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Apparently this was harder pre-1.5, where you had to look for the proper activity yourself.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-2418435077942920174?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/2418435077942920174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=2418435077942920174' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/2418435077942920174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/2418435077942920174'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/06/launching-applications-in-android.html' title='Launching applications in Android'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-2587065140237953937</id><published>2009-06-23T01:12:00.003+02:00</published><updated>2009-06-23T01:22:22.942+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rant'/><category scheme='http://www.blogger.com/atom/ns#' term='blogger'/><category scheme='http://www.blogger.com/atom/ns#' term='faq'/><category scheme='http://www.blogger.com/atom/ns#' term='reference'/><category scheme='http://www.blogger.com/atom/ns#' term='templates'/><title type='text'>Blogger's data:blog.feedLinks</title><content type='html'>&lt;p&gt;As you might have noticed, I got sick of the crufty, old, temporary-turned-permanent template here and been playing with making a new one from scratch. So you might expect this place to look even worse and more half-baked for some time to come.&lt;/p&gt;

&lt;p&gt;And while I was trying to get the RSS links in the header, I came across the &lt;code&gt;data:blog.feedLinks&lt;/code&gt; thingy. I've been extremely puzzled as to why couldn't I &lt;code&gt;&amp;lt;b:loop&amp;gt;&lt;/code&gt; it... turns out it's not a list, but a piece of HTML code. Just smack the &lt;code&gt;&amp;lt;data:blog.feedLinks/&amp;gt;&lt;/code&gt; in your &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; and be done with it.&lt;/p&gt;

&lt;p&gt;To end this rant, I'd really appreciate if blogger had anything resembling a proper reference instead of this freaking I-m-so-stupid-I-can't-use-a-reference-and-need-mom-to-answer-me-questions freaking FAQd up 'online help'.&lt;/p&gt;

&lt;p&gt;EDIT: BTW, no, no comments for you. We'll see if it's to stay. Mostly depends on how fed up I'd be with the blogger API, I guess.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-2587065140237953937?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/2587065140237953937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=2587065140237953937' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/2587065140237953937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/2587065140237953937'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/06/bloggers-datablogfeedlinks.html' title='Blogger&apos;s data:blog.feedLinks'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-3516528860137059788</id><published>2009-06-11T06:42:00.003+02:00</published><updated>2009-06-11T06:45:50.362+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='device mapper'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='lvm'/><category scheme='http://www.blogger.com/atom/ns#' term='jfs'/><title type='text'>JFS external journal devices on LVM</title><content type='html'>&lt;p&gt;JFS allows using external journal devices, but has trouble finding them when they are located on LVM (as of jfsutils-1.1.13). It turns out it doesn't search proper dev directories when searching for device by UUID.&lt;/p&gt;

&lt;p&gt;It does search &lt;tt&gt;/dev/evms&lt;/tt&gt; though. Simple workaround is to &lt;tt&gt;ln -s mapper /dev/evms&lt;/tt&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-3516528860137059788?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/3516528860137059788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=3516528860137059788' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/3516528860137059788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/3516528860137059788'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/06/jfs-external-journal-devices-on-lvm.html' title='JFS external journal devices on LVM'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-479897461761496467</id><published>2009-05-13T16:06:00.001+02:00</published><updated>2009-05-13T16:08:03.224+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='quote'/><category scheme='http://www.blogger.com/atom/ns#' term='funny'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Power management in Android's kernel</title><content type='html'>&lt;blockquote&gt;&lt;p&gt;Google was going to be an interesting case of a large company hiring people both from the embedded world and also the existing Linux development community and then producing an embedded device that was intended to compete with the very best existing platforms. I had high hopes that this combination of factors would result in the Linux community as a whole having a better idea what the constraints and requirements for high-quality power management in the embedded world were, rather than us ending up with another pile of vendor code sitting on an FTP site somewhere in Taiwan that implements its power management by passing tokenised dead mice through a wormhole.&lt;/p&gt;

&lt;p&gt;To a certain extent, my hopes were fulfilled. We got a git server in California.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p class="quotesource"&gt;&lt;a href="http://mjg59.livejournal.com/100221.html"&gt;mjg59&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/4478829316282336892-479897461761496467?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/479897461761496467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=479897461761496467' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/479897461761496467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/479897461761496467'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/05/power-management-in-androids-kernel.html' title='Power management in Android&apos;s kernel'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-317650763365277810</id><published>2009-03-11T13:59:00.004+01:00</published><updated>2009-03-11T14:05:01.017+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='second life'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='patch'/><category scheme='http://www.blogger.com/atom/ns#' term='restrained life'/><title type='text'>Restrained Life Viewer for Linux</title><content type='html'>&lt;p&gt;Current (1.15.2_LL-1.21.6) binary distribution of &lt;a href="http://www.erestraint.com/realrestraint/"&gt;Restrained Life Viewer&lt;/a&gt; for Linux is broken. The binary is compiled with an extra flag which is not in the settings file, which makes the client crash when trying to wear a blindfold.&lt;/p&gt;

&lt;p&gt;Luckily this is easily fixed. The patch below makes you able to enjoy being blindfolded also in Linux.&lt;/p&gt;

&lt;pre&gt;
--- RLV-1.15.2_LL-1.21.6/app_settings/settings.xml      2008-10-25 22:03:09.000000000 +0200
+++ /home/divide/games/SecondLife-i686-1.21.6.99587/app_settings/settings.xml   2009-03-11 13:58:29.000000000 +0100
@@ -12,6 +12,17 @@
       &amp;lt;key&amp;gt;Value&amp;lt;/key&amp;gt;
       &amp;lt;integer&amp;gt;1&amp;lt;/integer&amp;gt;
     &amp;lt;/map&amp;gt;
+    &amp;lt;key&amp;gt;RestrainedLifeNoSetEnv&amp;lt;/key&amp;gt;
+    &amp;lt;map&amp;gt;
+      &amp;lt;key&amp;gt;Comment&amp;lt;/key&amp;gt;
+      &amp;lt;string&amp;gt;Toggles the RestrainedLife atmospheric effects restraint, needed for eg. blindfolds. (False means blindfolds work.) Needs a restart of the viewer.&amp;lt;/string&amp;gt;
+      &amp;lt;key&amp;gt;Persist&amp;lt;/key&amp;gt;
+      &amp;lt;integer&amp;gt;0&amp;lt;/integer&amp;gt;
+      &amp;lt;key&amp;gt;Type&amp;lt;/key&amp;gt;
+      &amp;lt;string&amp;gt;Boolean&amp;lt;/string&amp;gt;
+      &amp;lt;key&amp;gt;Value&amp;lt;/key&amp;gt;
+      &amp;lt;integer&amp;gt;0&amp;lt;/integer&amp;gt;
+    &amp;lt;/map&amp;gt;
     &amp;lt;key&amp;gt;RestrainedLifeDebug&amp;lt;/key&amp;gt;
     &amp;lt;map&amp;gt;
       &amp;lt;key&amp;gt;Comment&amp;lt;/key&amp;gt;
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-317650763365277810?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/317650763365277810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=317650763365277810' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/317650763365277810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/317650763365277810'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/03/restrained-life-viewer-for-linux.html' title='Restrained Life Viewer for Linux'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-3590440723118028154</id><published>2009-03-09T15:32:00.005+01:00</published><updated>2009-03-09T15:37:40.134+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silence'/><category scheme='http://www.blogger.com/atom/ns#' term='music'/><title type='text'>The sound of silence</title><content type='html'>&lt;p&gt;From "The Power of Now" by Eckhart Tolle:
&lt;blockquote&gt;Every sound is born out of silence, dies back into silence, and during its life span is surrounded by silence. Silence enables the sound to be. It is an intrinsic but unmanifested part of every sound, every musical note, every song, every word.&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;It somehow made me think of John Cage:&lt;br /&gt;

&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/hUJagb7hL0E&amp;hl=pl&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/hUJagb7hL0E&amp;hl=pl&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-3590440723118028154?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/3590440723118028154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=3590440723118028154' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/3590440723118028154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/3590440723118028154'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/03/sound-of-silence.html' title='The sound of silence'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-6162242922219383443</id><published>2009-02-23T23:18:00.002+01:00</published><updated>2009-02-23T23:20:25.743+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='video'/><category scheme='http://www.blogger.com/atom/ns#' term='enamouring'/><category scheme='http://www.blogger.com/atom/ns#' term='crush'/><title type='text'>Probably the most beautiful short I've ever seen</title><content type='html'>&lt;div&gt;&lt;object width="420" height="339"&gt;&lt;param name="movie" value="http://www.dailymotion.pl/swf/x87daz" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;param name="allowScriptAccess" value="always" /&gt;&lt;embed src="http://www.dailymotion.pl/swf/x87daz" type="application/x-shockwave-flash" width="420" height="339" allowFullScreen="true" allowScriptAccess="always"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://www.dailymotion.pl/swf/x87daz"&gt;Signs&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;i&gt;by &lt;a href="http://www.dailymotion.com/mg02"&gt;mg02&lt;/a&gt;&lt;/i&gt;&lt;/div&gt;

&lt;p&gt;(Via ^&lt;a href="http://zjadamyreklamy.blox.pl/2009/02/Dla-rownowagi.html"&gt;eirena&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/4478829316282336892-6162242922219383443?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/6162242922219383443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=6162242922219383443' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/6162242922219383443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/6162242922219383443'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/02/probably-most-beautiful-short-ive-ever.html' title='Probably the most beautiful short I&apos;ve ever seen'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-7414151361787675773</id><published>2009-02-23T07:19:00.006+01:00</published><updated>2009-02-23T07:28:26.031+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='qt4'/><category scheme='http://www.blogger.com/atom/ns#' term='crop'/><category scheme='http://www.blogger.com/atom/ns#' term='image'/><category scheme='http://www.blogger.com/atom/ns#' term='widget'/><category scheme='http://www.blogger.com/atom/ns#' term='snapshot'/><category scheme='http://www.blogger.com/atom/ns#' term='cropwidget'/><title type='text'>Snapshotting and cropping widget</title><content type='html'>&lt;p&gt;I wrote simple Qt widget that is able to take an image of its own contents, and then crop it. (I use it with a video player widget to allow the user to take a snapshot of the video stream.) You can find it at &lt;a href="http://repo.or.cz/w/cropwidget.git"&gt;the repo&lt;/a&gt;. It's not perfect, but it's what I need. Feel free to extend it, the mob access is open.&lt;/p&gt;

&lt;p&gt;As an example (no code at all, all designer point-and-click), consider the following window:&lt;/p&gt;
&lt;p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_NjREpqVx84E/SaJA52e-rOI/AAAAAAAAANM/m6LwpyMGifQ/s1600-h/cropwidget1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_NjREpqVx84E/SaJA52e-rOI/AAAAAAAAANM/m6LwpyMGifQ/s400/cropwidget1.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5305874673618037986" /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;Now if you click the "Snap" button (which is connected to the CropWidget's snap(bool) slot), the controls are no longer interactive (and are, in fact, just images of controls). You can use your mouse instead to draw a crop rect:&lt;/p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_NjREpqVx84E/SaJBcqDK0NI/AAAAAAAAANU/hY86nst3AsY/s1600-h/cropwidget2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_NjREpqVx84E/SaJBcqDK0NI/AAAAAAAAANU/hY86nst3AsY/s400/cropwidget2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5305875271575589074" /&gt;&lt;/a&gt;
&lt;p&gt;And then, by clicking "Crop" (connected to crop(), simple), get it... you guessed it ;)&lt;/p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_NjREpqVx84E/SaJBtBu78BI/AAAAAAAAANc/VoCo9hESLSI/s1600-h/cropwidget3.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_NjREpqVx84E/SaJBtBu78BI/AAAAAAAAANc/VoCo9hESLSI/s400/cropwidget3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5305875552811085842" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-7414151361787675773?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/7414151361787675773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=7414151361787675773' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/7414151361787675773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/7414151361787675773'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/02/snapshotting-and-cropping-widget.html' title='Snapshotting and cropping widget'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_NjREpqVx84E/SaJA52e-rOI/AAAAAAAAANM/m6LwpyMGifQ/s72-c/cropwidget1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-5746437646074949336</id><published>2009-02-21T18:24:00.003+01:00</published><updated>2009-02-21T18:57:25.556+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visualisation'/><category scheme='http://www.blogger.com/atom/ns#' term='synaesthesia'/><category scheme='http://www.blogger.com/atom/ns#' term='music'/><category scheme='http://www.blogger.com/atom/ns#' term='hack'/><category scheme='http://www.blogger.com/atom/ns#' term='youtube'/><title type='text'>Synaesthesia resurrection</title><content type='html'>&lt;p&gt;&lt;a href="http://www.logarithmic.net/pfh/synaesthesia"&gt;Synaesthesia&lt;/a&gt; may well be the most beautiful and meaningful music visualization I've ever seen.&lt;/p&gt;

&lt;p&gt;Unfortunately the project seems abandoned&amp;mdash;it's twelve years old and last release was in 2005. As such it's a little bit hard to use nowadays; well, you can pipe sound in just fine, but what really lacks is the ability to record a video of the visualization.&lt;/p&gt;

&lt;p&gt;This is especially important for me because I'm using a &lt;a href="http://blip.pl"&gt;Polish Twitter-like thingy&lt;/a&gt; which makes it much more straightforward to embed videos than sound; every time I find myself wanting to share a song I'm listening to I have to find a video on YouTube, and when there is none, I feel compelled to share a synaesthesia video.&lt;/p&gt;

&lt;p&gt;So I took the matter into my own hands and hacked together raw video output for synaesthesia. You can find the code at &lt;a href="http://repo.or.cz/w/synaesthesia.git"&gt;the repo&lt;/a&gt;; feel free to tinker in it, you may even commit anonymously (just use the mob account and branch).&lt;/p&gt;

&lt;p&gt;I can now do&lt;br /&gt;
&lt;kbd&gt;mpg123 -s song.mp3 | ./synaesthesia --width 640 --height 360 --output-raw 25 pipe 44100 | nice -n10 mencoder - -demuxer rawvideo -rawvideo w=640:h=360:format=rgb32:fps=25 -oac copy -audiofile song.mp3 -ovc lavc -o song.avi&lt;/kbd&gt;&lt;br /&gt;
and get a video like this one:&lt;br /&gt;
&lt;object width="640" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/BgBs6TF_HuQ&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/BgBs6TF_HuQ&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;/p&gt;

&lt;p&gt;The only thing that needs doing is making it possible to visualize asynchronically. Currently it still generates the video in real-time while playing and this sometimes causes dropped frames (visible in the video as some hickups, especially at the beginning).&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-5746437646074949336?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/5746437646074949336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=5746437646074949336' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/5746437646074949336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/5746437646074949336'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2009/02/synaesthesia-resurrection.html' title='Synaesthesia resurrection'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-2139372570289321598</id><published>2008-08-15T09:57:00.003+02:00</published><updated>2008-08-15T10:04:33.457+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='KDE'/><category scheme='http://www.blogger.com/atom/ns#' term='vision'/><category scheme='http://www.blogger.com/atom/ns#' term='ideas'/><category scheme='http://www.blogger.com/atom/ns#' term='shower insights'/><category scheme='http://www.blogger.com/atom/ns#' term='plasma'/><category scheme='http://www.blogger.com/atom/ns#' term='magic ink'/><title type='text'>My share of shower insights: power to the artists!</title><content type='html'>&lt;p&gt;KDE4 has made revolutionary changes in UI architecture, there is no doubt about that. But I can't shake the feeling that, while you can certainly see big advantages this brings to applications, all those KDE4 pillars aren't leveraged nearly as much as could be, in principle, possible.&lt;/p&gt;

&lt;p&gt;Take Plasma, for example. The decoupling of logic and presentation into engines and plasmoids is perhaps the most powerful single idea implemented there. But what I see as the greatest opportunity it creates is left untaken: the decoupling makes it possible, in principle, for the artists to design plasmoids entirely by themselves.&lt;/p&gt;

&lt;p&gt;Indeed, the simplest Plasma applets do nothing that couldn't be trivially designed graphically: see my own &lt;a href="http://websvn.kde.org:80/trunk/extragear/utils/rsibreak/plasma/"&gt;RSIBreak plasmoid&lt;/a&gt; (a simplistic prototype yet, sorry) for example. Yet, we still have the situation that the presentation logic is written in a programming language; even if it isn't C++ but something more human-friendly, such as Ruby or Python (having said that, I have yet to see a single useful plasmoid written in one of those) it still leaves out many if not most of the people that could design them on the mercy of developers, who often have more interesting things to do than code trivial UI handling code.&lt;/p&gt;

&lt;p&gt;Even the more complicated applets, see the clock for example (you can't talk about Plasma without mentioning the clocks, can you?), could be done entirely in a language designers already know (even if not directly)&amp;mdash;SVG. SVG is expressive enough to do every operation that is currently done in C++ code of analog clock plasmoid. But how to program graphically what operations map to which inputs? Why, &lt;a href="http://worrydream.com/MagicInk/#designing_a_design_tool"&gt;telling by showing&lt;/a&gt;, of course:&lt;/p&gt;

&lt;p&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://worrydream.com/MagicInk/p/mccloud.png" border="0" alt="[a comic of telling by showing]" /&gt;&lt;/p&gt;

&lt;p&gt;The problem with current architecture is that we cannot easily modify SVG tree programatically, so we end up with having to use two languages to describe the interface: SVG for the static parts and C++/whatever for the dynamic behaviour and coupling with the engine. But, IMHO, most plasmoids' presentation could be described just by a smart mapping from engine data to SVG properties.&lt;/p&gt;

&lt;p&gt;So, what do we need? What is teh masterplan? Well, first we have to have a framework in place&amp;mdash;that's the easy part. First of all, we need a widget that is able to draw an SVG tree that we can modify. Then we need to devise language to describe mapping of inputs to SVG transformation&amp;mdash;I'm pretty sure that existing SVG infrastructure for animation is well adaptable to that task. After that, it's just a matter of wrapping the mutable SVG widget with another one that draws the graphic transformed according to the transformation given input data.&lt;/p&gt;

&lt;p&gt;The harder part would be making the "tell by showing" interface for the artists&amp;mdash;but even without that, this approach has a whole host of benefits. Making a new plasmoid (using an existing data engine) would be just a matter of drawing it and coupling it to the inputs using a description&amp;mdash;not programming&amp;mdash;language.&lt;/p&gt;

&lt;p&gt;This would enable theme designers to alter widgets' look completely&amp;mdash;they would no longer be constrained by whatever design the programmer had in mind while writing the code; so that, for example, one theme could show, say, CPU temperature as a bar, while another could use VU-like meters, all that without changing a single line of code&amp;mdash;without any additional code at all, in fact!&lt;/p&gt;

&lt;p&gt;I'll confess that I'm largely inspired in this idea by &lt;a href="http://worrydream.com/"&gt;Bret Victor&lt;/a&gt; whose paper &lt;a class="title" href="http://worrydream.com/MagicInk/"&gt;Magic Ink: Information Software and the Graphical Interface&lt;/a&gt; I have once read and which sits in my head since and transpires to my consciousness from time to time. You should really read it in its entirety&amp;mdash;it's full of innovative, revolutionary ideas and I feel that, with KDE4, for the first time in the history of computer user interfaces, implementing those ideas is finally feasible.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-2139372570289321598?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/2139372570289321598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=2139372570289321598' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/2139372570289321598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/2139372570289321598'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2008/08/my-share-of-shower-insights-power-to.html' title='My share of shower insights: power to the artists!'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-7439032571889135634</id><published>2008-05-20T08:29:00.003+02:00</published><updated>2008-05-20T08:38:06.754+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='short-circuit'/><category scheme='http://www.blogger.com/atom/ns#' term='gentoo'/><category scheme='http://www.blogger.com/atom/ns#' term='ebuild'/><category scheme='http://www.blogger.com/atom/ns#' term='merging'/><category scheme='http://www.blogger.com/atom/ns#' term='paludis'/><title type='text'>Skipping to merge install phase in Paludis</title><content type='html'>&lt;p&gt;Don't you hate it when building a lengthy package succeeds, installs all right into the image, only to fail for some trivial reason (like out of disk space) when merging into the filesystem? In portage you could just use the &lt;code&gt;ebuild&lt;/code&gt;(1) command to short-circuit it right to merge. It's not that easy with Paludis, unfortunately.&lt;/p&gt;

&lt;p&gt;But worry not, undocumented environment variables to the rescue! The &lt;code&gt;SKIP_FUNCTIONS&lt;/code&gt; environment variable allows you to force &lt;tt&gt;paludis&lt;/tt&gt; not to execute some phases of the install action. The magic combo is &lt;code&gt;SKIP_FUNCTIONS="init killold setup saveenv unpack compile install"&lt;/code&gt;. It fails on &lt;code&gt;loadenv&lt;/code&gt; just before &lt;code&gt;postrm&lt;/code&gt; for some reason (probably because we barred it from &lt;code&gt;saveenv&lt;/code&gt;, but there seems to be no way to skip one &lt;code&gt;saveenv&lt;/code&gt; and not another), but by that point the package is already merged.&lt;/p&gt;

&lt;p&gt;But really, they ought to make it easier to do such tricks (or at least document the freakin' variable). I can only imagine how hard it must be to debug ebuilds with paludis... Or maybe there is something I don't know about?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-7439032571889135634?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/7439032571889135634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=7439032571889135634' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/7439032571889135634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/7439032571889135634'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2008/05/skipping-to-merge-install-phase-in.html' title='Skipping to merge install phase in Paludis'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-3760538762507017354</id><published>2008-02-25T13:39:00.004+01:00</published><updated>2008-02-25T13:50:55.716+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='screen'/><category scheme='http://www.blogger.com/atom/ns#' term='gentoo'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='ionice'/><category scheme='http://www.blogger.com/atom/ns#' term='compilation'/><category scheme='http://www.blogger.com/atom/ns#' term='scheduling'/><category scheme='http://www.blogger.com/atom/ns#' term='nice'/><title type='text'>Really nice system administration console</title><content type='html'>&lt;p&gt;When you're like me, you don't like your CPU cycles waste &amp;mdash; and if you're using Gentoo, you like to be constantly merging something in the background. The problem is that the CPU and IO load really can be a major &lt;abbr title="Pain In The Ass"&gt;PITA&lt;/abbr&gt;, rendering the machine essentially unusable to do any real work when compilation is running.&lt;/p&gt;

&lt;p&gt;Luckily, Linux kernel offer a great deal of flexibility when it comes to scheduling and prioritizing processes. And using that, I hereby present you &lt;em&gt;The Really Nice SysAdmin Console&lt;/em&gt;:&lt;p&gt;

&lt;p&gt;&lt;code&gt;alias suscreen="sudo screen -drU || sudo nice -n19 ionice -c3 chrt -b 0 su - -c 'screen -U'"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;What this code does, is to:
&lt;ul&gt;
&lt;li&gt;try to attach to an existing root screen (won't work for more than one, sorry),&lt;/li&gt;
&lt;li&gt;in case that fails (ie. no screen running) it sets up a root login screen, scheduled on
&lt;ul&gt;&lt;li&gt;lowest nice priority,&lt;/li&gt;
&lt;li&gt;idle io priority class,&lt;/li&gt;
&lt;li&gt;BATCH scheduler class.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;

&lt;p&gt;Maybe &lt;code&gt;chrt -b 0&lt;/code&gt; and &lt;code&gt;nice -n19&lt;/code&gt; are a bit redundant, but you're never too sure. The bottom line is &amp;mdash; you can have your compilation running in that screen and it doesn't go in the way with whatever you do; when need be, it just yields any CPU and IO to higher-class (ie. &lt;em&gt;your&lt;/em&gt;) processes. So you can have your cake and eat it too.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-3760538762507017354?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/3760538762507017354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=3760538762507017354' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/3760538762507017354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/3760538762507017354'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2008/02/really-nice-system-administration.html' title='Really nice system administration console'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-5182630261057828292</id><published>2008-01-07T03:21:00.000+01:00</published><updated>2008-01-07T03:54:50.145+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DRM'/><category scheme='http://www.blogger.com/atom/ns#' term='sony'/><category scheme='http://www.blogger.com/atom/ns#' term='SCSI'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse-engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><title type='text'>Hardware hacking or how I learned to love the DRM</title><content type='html'>&lt;p&gt;&lt;a href="http://www.jp.sonystyle.com/Product/Paudi/Nw-e507/Store/Images/ind_itm_img.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 200px;" src="http://www.jp.sonystyle.com/Product/Paudi/Nw-e507/Store/Images/ind_itm_img.jpg" border="0" alt="[a photo of the device]" /&gt;&lt;/a&gt;My friend, roommate and/or wife (pick two) has a &lt;a href="http://www.jp.sonystyle.com/Product/Paudi/Nw-e507/Store/"&gt;Sony Network Walkman NW-E507&lt;/a&gt;. Quite nice piece of hardware in and of itself&amp;mdash;gotta love the shiny bright OLED (or whatever) display.&lt;/p&gt;
&lt;p&gt;It has only one forthcoming, and a huge one at that. Designed from grounds-up with DRM in mind, it seems that the only way to upload music is to use Sony SonicStage software; it converts files to ATRAC3 (supposedly the only format the device can play), encrypts them and only after such preparation (and adding to a proprietary-binary-formatted directory files) they could be played back. Quite amazingly odd, if you ask me&amp;mdash;especially given it's a USB Storage device.&lt;/p&gt;
&lt;p&gt;What's worse, the software is only available for Windows and doesn't seem to work in wine at all. (appdb.winehq says someone succeeded in running it, but I have no patience trying different wines and crazy config files + dlls mix and match. Sorry.) This is quite a major headache, as recently I've convinced her to switch to Ubuntu (and now we're running a 100% windows-free household) and now she's effectively unable to use the player (well, only as a really cool looking portable radio).&lt;/p&gt;
&lt;p&gt;After some googling, there seemed there is no way to drive it with linux. But then again, it seems to semiofficially support playing MP3 files&amp;mdash;but they have to be encrypted, too. Looking deeper, I've found &lt;a href="http://sourceforge.net/projects/mlsony"&gt;mlsony&lt;/a&gt;&amp;mdash;an open-source plugin for winamp allowing to upload and download mp3s to the Walkman. It is written in rather clean C++, so it wouldn't be hard to port.&lt;/p&gt;
&lt;p&gt;Now, what's cool is that it seems they have succeeded in reverse-engineering the encryption format; alas, the plugin needs a key, and to get the device key, you have to run another proprietary Sony program.&lt;/p&gt;
&lt;p&gt;As it wouldn't work in wine either, I've had a choice: either going through hell of installing (or downloading a VM, anyways) and running windows just to get those fricking 16 bytes, or reverse engineering the app. Obviously the latter seemed more fun, so that's just what I've done.&lt;/p&gt;
&lt;p&gt;After some fun with freeIDA, assembly and WINAPI (thank you &lt;a href="http://www.reactos.org"&gt;ReactOS&lt;/a&gt; for a clean reference and clean header files!) I've finally revealed that getting the key is a piece of cake. Everything that needs to be done is to send special SCSI commands to the device; first to authorize you, and then to read the key.&lt;/p&gt;
&lt;p&gt;You can even do that from command line. Just make sure you have &lt;code&gt;sg3-utils&lt;/code&gt; and &lt;code&gt;xxd&lt;/code&gt;installed and just do &lt;br/&gt;
&lt;kbd&gt;echo 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | xxd -r -p | sg_raw -s 20 /dev/sg2 a3 00 00 00 00 00 00 bc 00 14 30 00; sg_raw -r 18 -o sonydid /dev/sg2 a4 00 00 00 00 00 00 bc 00 12 3f 00; cat sonydid | tail -c16 &gt; key&lt;/kbd&gt;&lt;/p&gt;
&lt;p&gt;There, you have your device key in the &lt;code&gt;key&lt;/code&gt; file! Just be sure to substitute your walkman device for /dev/sg2.&lt;/p&gt;
&lt;p&gt;(Keep in mind that I have not tested the key yet; I have disassembled the validation procedure of the Sony software, and the string I've obtained seems all right. If you need to know, the magic value is &lt;code&gt;03 01 01 00 00 00&lt;/code&gt;.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-5182630261057828292?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/5182630261057828292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=5182630261057828292' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/5182630261057828292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/5182630261057828292'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2008/01/hardware-hacking-or-how-i-learned-to.html' title='Hardware hacking or how I learned to love the DRM'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-7562984299589976472</id><published>2007-09-19T09:55:00.000+02:00</published><updated>2008-01-07T03:20:30.798+01:00</updated><title type='text'>Tray icons in DWM</title><content type='html'>&lt;p&gt;&lt;a href="http://www.suckless.org/wiki/dwm/about"&gt;&lt;acronym title="Dynamic Window Manager"&gt;DWM&lt;/acronym&gt;&lt;/a&gt; is a pretty neat window manager&amp;mdash;it's very flexible and can be customized exactly to suit one's needs: I've tried several dynamic tiling managers, and so far only DWM doesn't get in my way and actually is more comfortable than traditional WMs.&lt;/p&gt;

&lt;p&gt;Configurability of DWM may sound strange to some: there is none. All customization is done through editing the source code. This may seem daunting, but it really isn't: there isn't much code (below 2000 SLOC) and it's all so clear, that even someone without a background on X11 can get to hacking and learn something in the process. Plus, many immediately configurable settings are gathered in a single header file.&lt;/p&gt;

&lt;p&gt;Given this, even though DWM may be mean-and-lean, it's easy to extend it with any feature one would dream of. For me, it was system tray support (you know, those little 22&amp;times;22 applets docked near your clock). As I'm a KDE user, I'm very much used to little conveniences such as klipper. (Yes, that's right, I'm using DWM with KDE, just by setting KDEWM environment variable.) And vanilla DWM can't handle those properly&amp;mdash;every tray icon gets its own ordinary window, which, as you can see, isn't terribly convenient:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://bp3.blogger.com/_NjREpqVx84E/RvDb0H5hecI/AAAAAAAAAE4/YFoOJ7ee7Lc/s1600-h/vanilla-dwm-tray.png"&gt;&lt;img rel="lightbox" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_NjREpqVx84E/RvDb0H5hecI/AAAAAAAAAE4/YFoOJ7ee7Lc/s400/vanilla-dwm-tray.png" border="0" alt="[a screenshot showing tray icons on vanilla DWM]" id="BLOGGER_PHOTO_ID_5111827265585510850" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To fix that, we first need to see how tray icons are handled in X11. It turns out there is no single standard of doing that. Well, there is the &lt;a href="http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.2.html"&gt;FreeDesktop one&lt;/a&gt;, but it's &lt;a href="http://modeemi.fi/~tuomov/ion/faq/entries/Tray_icons.html"&gt;overly complicated&lt;/a&gt; and (fortunately) not really used (yet), except maybe for Gnome. KDE3 and third-party apps use a simpler method: they set certain window property, which get spotted by the WM (or other program) which then position and/or swallow the window accordingly.&lt;/p&gt;

&lt;p&gt;Two atoms seem to be used for that: &lt;code&gt;WM_WINDOW_ROLE&lt;/code&gt; set to &lt;code&gt;Tray Icon&lt;/code&gt; and &lt;code&gt;_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR&lt;/code&gt; pointing to the parent window. Some programs use both.&lt;/p&gt;

&lt;p&gt;So all we need to do is spot appropriate properties and check if they're right; if either the role is tray icon, or the KDE-specific property is set at all, we can put the tray window to the right side of the screen. Here, much better:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://bp3.blogger.com/_NjREpqVx84E/R4GMBHu0AhI/AAAAAAAAAHo/qQtZ2DFs5sY/s1600-h/better-dwm-tray.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_NjREpqVx84E/R4GMBHu0AhI/AAAAAAAAAHo/qQtZ2DFs5sY/s400/better-dwm-tray.png" border="0" alt="[improved tray handling]" id="BLOGGER_PHOTO_ID_5152553399571710482" /&gt;&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/4478829316282336892-7562984299589976472?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/7562984299589976472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=7562984299589976472' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/7562984299589976472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/7562984299589976472'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2007/09/tray-icons-in-dwm.html' title='Tray icons in DWM'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_NjREpqVx84E/RvDb0H5hecI/AAAAAAAAAE4/YFoOJ7ee7Lc/s72-c/vanilla-dwm-tray.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4478829316282336892.post-333149154182119165</id><published>2007-09-11T15:27:00.001+02:00</published><updated>2011-02-25T12:38:39.268+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='qt4'/><category scheme='http://www.blogger.com/atom/ns#' term='win32'/><category scheme='http://www.blogger.com/atom/ns#' term='mingw32'/><category scheme='http://www.blogger.com/atom/ns#' term='qmake'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='qt4/win'/><category scheme='http://www.blogger.com/atom/ns#' term='cross-compiling'/><category scheme='http://www.blogger.com/atom/ns#' term='wine'/><title type='text'>Cross-compiling Qt4/Win on Linux</title><content type='html'>&lt;p&gt;I've recently been playing rediscovering Qt with Qt4. Qt is a great cross-platform programming environment for GUI apps—the best I've used, at least. Anyway, as I put my app together, I thought that I should release it as a windows binary as well—both to use (and test!) this Qt cross-platform compatibility and because I expect the majority of the tool users would be windows users. Alas, I don't have a working windows os (I do have installed some 120-day evaluation version of win2003 somewhere, but even if it works, which I doubt, given some hardware changes since I've last launched it, I think the evaluation period is over anyway), let alone windows development environment.&lt;/p&gt;
&lt;p&gt;So, I immediately thought about cross-compiling. Cross-compiling is compiling for another target platform than the host platform (where we run compilation). Generally, mingw32-gcc works marvels for linux-to-win32 cross-compilation and I've been using it some time ago for GTK apps. That was easier, because GTK/win is available in compiled form, so I just needed to cross-compile my own apps. For Qt4/win, no mingw32 binaries are readily available. So I had to take a go at compiling it myself.&lt;/p&gt;
&lt;p&gt;After some googling, I've found that although &lt;a href="http://qtnode.net/wiki?title=Cross_compiling"&gt;some&lt;/a&gt; &lt;a href="http://silmor.de/38"&gt;people&lt;/a&gt; tried to achieve that, none of them succeeded. This turned me down a little bit, but I'm not a person which would run away from a challenge.&lt;/p&gt;
&lt;p&gt;The main problem with this cross-compilation is Qt4 build system. Although it seems to support cross-compilation, it really can only do it out-of-the-box between different Unix platforms. Since mingw32 is not strictly a Unix platform and different codepaths need to be compiled, this approach fails. So what we need to do is trick the buildsystem into thinking that win32 codepaths apply to unix.&lt;/p&gt;
&lt;p&gt;Without further ado, I present you with step-by-step instructions on how to cross-compile Qt4/win. First, though, you need to obtain cross-compiling environment. On gentoo it's simple. Run the following as root:&lt;br/&gt;
&lt;kbd&gt;emerge crossdev&lt;br /&gt;
crossdev -t mingw32&lt;/kbd&gt;&lt;/p&gt;
&lt;p&gt;Well, simple as it may be, compilation was broken on my box on one step. It seems that it didn't find the right compiler to compile win32api. What was needed is&lt;br/&gt;
&lt;kbd&gt;gcc-config mingw32-4.2.0&lt;br /&gt;
source /etc/profile&lt;/kbd&gt;&lt;/p&gt;
&lt;p&gt;After that I've re-issued the &lt;kbd&gt;crossdev -t mingw32&lt;/kbd&gt; command and everything worked.&lt;/p&gt;
&lt;p&gt;Now for the compilation of Qt4/win. You need to have Qt4/X11 already installed on your system, as we'll use Qt utilities already available on the system. Make sure you don't the following as root, because the build system for some reason insists on installing &lt;acronym title="dynamically linked libraries"&gt;DLL&lt;/acronym&gt;s in &lt;code&gt;/usr/bin&lt;/code&gt; (doesn't break if it can't, so no harm).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Get &lt;a href="http://trolltech.org/developer/downloads/qt/windows"&gt;Qt4/win sources&lt;/a&gt;. I've used 4.3.1 edition.&lt;/li&gt;
&lt;li&gt;Unpack them. Enter the directory.&lt;/li&gt;
&lt;li&gt;Trick the buildsystem into using win32 feature files:&lt;br /&gt;
&lt;kbd&gt;cd mkspecs/features&lt;br /&gt;
ln -s win32 unix&lt;br /&gt;
cd ../..&lt;/kbd&gt;&lt;/li&gt;
&lt;li&gt;Download &lt;a href="http://pastebin.com/S7i697qq"&gt;the patch&lt;/a&gt;. Apply it.&lt;br /&gt;
&lt;kbd&gt;patch -p1 &amp;lt; qt4win-cross-mingw.patch&lt;/kbd&gt;&lt;/li&gt;
&lt;li&gt;Make sure qmake doesn't use compilation paths meant for unix&lt;br/&gt;
&lt;kbd&gt;find src -name '*.pro' -o -name '*.pri' | xargs sed -i -e 's/\(^\|[^_/]\)unix/\1linux/g;'&lt;/kbd&gt;&lt;/li&gt;
&lt;li&gt;Make qmake use compilation paths meant for Windows.&lt;br/&gt;
&lt;kbd&gt;find src -name '*.pro' -o -name '*.pri' | xargs sed -i -e 's/\(^\|[^_/]\)win32\([^-]\|$\)/\1unix\2/g;'&lt;/kbd&gt;&lt;/li&gt;
&lt;li&gt;Trick configure into using system utilities.
&lt;kbd&gt;
for f in moc rcc uic qmake; do ln -s `which $f` bin; done&lt;/kbd&gt;&lt;/li&gt;
&lt;li&gt;Make sure we don't build them:&lt;br/&gt;
&lt;kbd&gt;echo qmake: &gt; qmake/Makefile.unix&lt;br /&gt;
for f in `ls src/tools`; do echo TEMPLATE = subdirs &gt; src/tools/$f/$f.pro; done&lt;/kbd&gt;&lt;/li&gt;
&lt;li&gt;We need some files from the Qt/X11 source, specifically &lt;code&gt;configure&lt;/code&gt; script and &lt;code&gt;config.tests&lt;/code&gt; directory. I've got them from my &lt;code&gt;qt-copy&lt;/code&gt; (from &lt;acronym title="K Desktop Environment"&gt;KDE&lt;/acronym&gt; repo); you can use that or download Qt/X11 sources. Put them in the main source directory.&lt;/li&gt;
&lt;li&gt;Configure. These options are carefully chosen not to break compilation (except &lt;code&gt;-prefix&lt;/code&gt; and &lt;code&gt;-prefix-install&lt;/code&gt;; the latter doesn't seem to work anyway).&lt;br/&gt;
&lt;kbd&gt;./configure -prefix $PWD -xplatform win32-g++ -no-largefile -exceptions -no-accessibility -no-qt3support -make libs -prefix-install $PWD -no-reduce-exports&lt;/kbd&gt;&lt;/li&gt;
&lt;li&gt;Make a missing makefile.&lt;br/&gt;
&lt;kbd&gt;qmake -spec $PWD/mkspecs/win32-g++ src/winmain/winmain.pro -o src/winmain/Makefile&lt;/kbd&gt;&lt;/li&gt;
&lt;li&gt;Build.&lt;br/&gt;
&lt;kbd&gt;make&lt;/kbd&gt;&lt;/li&gt;
&lt;li&gt;Done!&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you have Wine, you can even test it. Just make sure the dlls are where Wine can find them: &lt;kbd&gt;cp /usr/mingw32/usr/bin/mingwm10.dll lib/*.dll /home/divide/.wine/c/windows/system/&lt;/kbd&gt;. To compile the demos, do&lt;br /&gt;
&lt;kbd&gt;cd demos&lt;br /&gt;
qmake -spec ../mkspecs/win32-g++ demos.pro&lt;br /&gt;
make&lt;br /&gt;
wine demos/affine/affine.exe&lt;/kbd&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://img404.imageshack.us/my.php?image=qt4winrz5.png" target="_blank"&gt;&lt;img src="http://img404.imageshack.us/img404/5792/qt4winrz5.th.png" border="0" alt="A screenshot of affine Qt4 demo under wine" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The only problem I've found with using Qt4 in wine is that the latter doesn't implement some font handling functions and it sometimes breaks font rendering where text is laid out dynamically&amp;mdash;esp. QGraphicsView and QTextEdit seem to be the worst offenders.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4478829316282336892-333149154182119165?l=divided-mind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://divided-mind.blogspot.com/feeds/333149154182119165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4478829316282336892&amp;postID=333149154182119165' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/333149154182119165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4478829316282336892/posts/default/333149154182119165'/><link rel='alternate' type='text/html' href='http://divided-mind.blogspot.com/2007/09/cross-compiling-qt4win-on-linux.html' title='Cross-compiling Qt4/Win on Linux'/><author><name>Divided Mind</name><uri>http://www.blogger.com/profile/10639132821455811003</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_NjREpqVx84E/TG1ArfCvjTI/AAAAAAAAAqE/2eZdO69TRGw/S220/avatar.jpg'/></author><thr:total>11</thr:total></entry></feed>
