<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
  <id>http://www.digitalmihailo.com/</id>
  <title>Digital Me</title>
  <subtitle>Random contributions to digital noise</subtitle>
  <updated>2013-05-21T07:51:49+00:00</updated>
  <link href="http://www.digitalmihailo.com/" />
  
  <author>
    <name>Mihailo Lalevic</name>
    <email />
    <uri>http://www.digitalmihailo.com/</uri>
  </author>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/blogspot/digitalmihailo" /><feedburner:info uri="blogspot/digitalmihailo" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>51.873</geo:lat><geo:long>-8.5409</geo:long><link rel="license" type="text/html" href="http://creativecommons.org/licenses/by/2.0/" /><entry>
    <id>http://www.digitalmihailo.com/post/fixing-69-c00d36be-error-when-playing-video-on-xbox-360</id>
    <title>Fixing 69-C00D36BE error when playing video on Xbox 360</title>
    <published>2012-02-02T15:22:21+00:00</published>
    <updated>2012-02-02T15:22:36+00:00</updated>
    <link href="http://feedproxy.google.com/~r/blogspot/digitalmihailo/~3/YY17EPmpX3U/fixing-69-c00d36be-error-when-playing-video-on-xbox-360" rel="alternate" />
    <content type="html">&lt;p&gt;Recently I got &lt;a href="http://www.amazon.com/gp/product/B004SUO450/ref=as_li_ss_tl?ie=UTF8&amp;amp;tag=nevermindthet-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B004SUO450"&gt;D-Link &lt;span class="caps"&gt;DNS&lt;/span&gt;-320 ShareCenter&lt;/a&gt; and enabled &lt;a href="http://en.wikipedia.org/wiki/Upnp"&gt;UPnP&lt;/a&gt; on it so I could stream videos to my &lt;a href="http://www.amazon.com/gp/product/B003O6EE4U/ref=as_li_ss_tl?ie=UTF8&amp;amp;tag=nevermindthet-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B003O6EE4U"&gt;Xbox 360&lt;/a&gt;. I was getting the following error for some videos:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Unplayable Content&lt;/p&gt;
&lt;p&gt;Can&amp;#8217;t play this content because it may not be supported.&lt;/p&gt;
&lt;p&gt;Status code: 69-C00D36BE&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;But it was working for other videos, and when I tried playing them from &lt;span class="caps"&gt;USB&lt;/span&gt; storage, it worked just fine. What I figured out is that videos in parent folder worked just fine and they all used the same encoding for both video and audio. I moved problematic videos so to parent folder and, guess what &amp;#8211; they played just fine. I might investigate further why is this happening, but seems that path to the videos might&amp;#8217;ve been to long or something.&lt;/p&gt;
&lt;p&gt;Other error I&amp;#8217;ve encountered is:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Uplayable Content&lt;/p&gt;
&lt;p&gt;Can&amp;#8217;t play this content because it contains audio or video with unsupported codec.&lt;/p&gt;
&lt;p&gt;Status code: 80-C00DF242&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now, this is actually unsupported codecs. The videos in question were encoded with DivX 3 and 4 which are unsupported &amp;#8211; only DivX 5 and later are supported on Xbox. I&amp;#8217;ll see later on how to transcode them with &lt;a href="http://ffmpeg.org/"&gt;ffmpeg&lt;/a&gt; and I&amp;#8217;ll update here (should be easy).&lt;/p&gt;
&lt;p&gt;Oh, yes, nearly forgot, when I was getting the latter error Xbox would say openning media or similar, in the case of the former it wasn&amp;#8217;t even trying to open it.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=YY17EPmpX3U:3DllrBQzVEE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=YY17EPmpX3U:3DllrBQzVEE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=YY17EPmpX3U:3DllrBQzVEE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=YY17EPmpX3U:3DllrBQzVEE:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=YY17EPmpX3U:3DllrBQzVEE:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=YY17EPmpX3U:3DllrBQzVEE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=YY17EPmpX3U:3DllrBQzVEE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=YY17EPmpX3U:3DllrBQzVEE:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=YY17EPmpX3U:3DllrBQzVEE:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/digitalmihailo/~4/YY17EPmpX3U" height="1" width="1"/&gt;</content>
    <category term="networking" label="networking" scheme="http://www.digitalmihailo.com/tag/networking" />
    <category term="xbox" label="xbox" scheme="http://www.digitalmihailo.com/tag/xbox" />
  <feedburner:origLink>http://www.digitalmihailo.com/post/fixing-69-c00d36be-error-when-playing-video-on-xbox-360</feedburner:origLink></entry>
  <entry>
    <id>http://www.digitalmihailo.com/post/connecting-to-network-printer-using-a-particular-user</id>
    <title>Connecting to Network Printer Using a Particular User</title>
    <published>2012-01-14T06:11:10+00:00</published>
    <updated>2012-01-14T06:11:22+00:00</updated>
    <link href="http://feedproxy.google.com/~r/blogspot/digitalmihailo/~3/3aNZR1rur8w/connecting-to-network-printer-using-a-particular-user" rel="alternate" />
    <content type="html">&lt;p&gt;Recently I got &lt;a href="http://www.amazon.com/gp/product/B004SUO450/ref=as_li_ss_tl?ie=UTF8&amp;tag=nevermindthet-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B004SUO450"&gt;D-Link &lt;span class="caps"&gt;DNS&lt;/span&gt;-320 ShareCenter&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=nevermindthet-20&amp;l=as2&amp;o=1&amp;a=B004SUO450" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;. Seems very good value for the money, and I already had 2 disks I wanted to put in a &lt;span class="caps"&gt;RAID&lt;/span&gt;. Anyway, &lt;del&gt;there&amp;#8217;s&lt;/del&gt; there was a bug in the firmware that would only allow printing as admin user (once custom users are added to the &lt;span class="caps"&gt;NAS&lt;/span&gt; printer cannot be accessed as a guest I suppose anymore but new useres don&amp;#8217;t have permissions to access it).&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s not a bother in Linux &amp;#8211; it asks for permissions and you can print, but on Windows it just says the printer cannot be connected or something. So after some digging solution is to redirect the printer to a local port and manually add credentials under which to connect. So in general case this can be used:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;net use LPT1 \\servername\printername password /user:username&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Or in case of &lt;span class="caps"&gt;DNS&lt;/span&gt;-320, since using admin user is required and the printer shows as lp it goes like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;net use LPT1 \\you_nas_machine_name_or_ip\lp put_admins_password_here /user:admin&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After doing this from &lt;code&gt;Harward and Sound -&amp;gt; Printers&lt;/code&gt; do &lt;code&gt;Add Printer -&amp;gt; Add Local Printer -&amp;gt; LPT1&lt;/code&gt;, it&amp;#8217;ll ask to choose drivers (&lt;span class="caps"&gt;TIP&lt;/span&gt;: pre-install them) and after that printer&amp;#8217;s ready for printing.&lt;/p&gt;
&lt;p&gt;For more info on &lt;code&gt;net use&lt;/code&gt; command &lt;a href="http://pcsupport.about.com/od/commandlinereference/p/net-use-command.htm"&gt;go here&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=3aNZR1rur8w:2kKTzVW2Mto:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=3aNZR1rur8w:2kKTzVW2Mto:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=3aNZR1rur8w:2kKTzVW2Mto:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=3aNZR1rur8w:2kKTzVW2Mto:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=3aNZR1rur8w:2kKTzVW2Mto:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=3aNZR1rur8w:2kKTzVW2Mto:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=3aNZR1rur8w:2kKTzVW2Mto:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=3aNZR1rur8w:2kKTzVW2Mto:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=3aNZR1rur8w:2kKTzVW2Mto:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/digitalmihailo/~4/3aNZR1rur8w" height="1" width="1"/&gt;</content>
    <category term="networking" label="networking" scheme="http://www.digitalmihailo.com/tag/networking" />
    <category term="windows" label="windows" scheme="http://www.digitalmihailo.com/tag/windows" />
  <feedburner:origLink>http://www.digitalmihailo.com/post/connecting-to-network-printer-using-a-particular-user</feedburner:origLink></entry>
  <entry>
    <id>http://www.digitalmihailo.com/post/using-javascript-modules---a-catch</id>
    <title>Using JavaScript Modules - A Catch</title>
    <published>2011-01-13T12:44:33+00:00</published>
    <updated>2011-01-13T12:45:46+00:00</updated>
    <link href="http://feedproxy.google.com/~r/blogspot/digitalmihailo/~3/BpZ9Yx-BDZk/using-javascript-modules---a-catch" rel="alternate" />
    <content type="html">&lt;p&gt;I&amp;#8217;m sure I saw somewhere an example how to use &lt;a href="https://developer.mozilla.org/en/Using_JavaScript_code_modules"&gt;JavaScript modules&lt;/a&gt; in Firefox extensions and I just used that snippet. Anyway, I was recently caught by a conflict between &lt;a href="http://www.new-tab-jumpstart.com"&gt;New Tab Jumpstart&lt;/a&gt; extension and &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/7447/"&gt;NetVideoHunter&lt;/a&gt; Basically they could not work together and whichever was loaded first was working properly, second loaded wasn&amp;#8217;t.&lt;/p&gt;
&lt;p&gt;It turns out that conflict was due to both extensions registering modules folder with the same alias &lt;em&gt;modules&lt;/em&gt;. Both extensions would thus import their files with a similar uri: &lt;strong&gt;Components.utils.import(&amp;#8220;resource://modules/some_module.js&amp;#8221;);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The reason why this was failing is &lt;strong&gt;resource://modules&lt;/strong&gt; will be registered for the first loaded extension so for one of the extensions some_module.js file will not be found in the registered location (or even worse it will be found but would be completely wrong).&lt;/p&gt;
&lt;p&gt;It was simply fixed by changing registration in &lt;em&gt;chrome.manifest&lt;/em&gt; to: &lt;strong&gt;resource jumpstart content/modules/&lt;/strong&gt; and replacing &lt;strong&gt;resource://modules&lt;/strong&gt; to &lt;strong&gt;resource://jumpstart&lt;/strong&gt; in all files.&lt;/p&gt;
&lt;p&gt;Now when I look at it it&amp;#8217;s completely logical but you do it once, don&amp;#8217;t think about it at the time and you forget about it but it comes back to bite you later. All in all, if you plan on using modules in your extension do not register your modules folder with modules alias or similar, use your extension&amp;#8217;s alias.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=BpZ9Yx-BDZk:8jAqUQZ6JpA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=BpZ9Yx-BDZk:8jAqUQZ6JpA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=BpZ9Yx-BDZk:8jAqUQZ6JpA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=BpZ9Yx-BDZk:8jAqUQZ6JpA:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=BpZ9Yx-BDZk:8jAqUQZ6JpA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=BpZ9Yx-BDZk:8jAqUQZ6JpA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=BpZ9Yx-BDZk:8jAqUQZ6JpA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=BpZ9Yx-BDZk:8jAqUQZ6JpA:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=BpZ9Yx-BDZk:8jAqUQZ6JpA:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/digitalmihailo/~4/BpZ9Yx-BDZk" height="1" width="1"/&gt;</content>
    <category term="firefox extensions" label="firefox extensions" scheme="http://www.digitalmihailo.com/tag/firefox+extensions" />
    <category term="javascript" label="javascript" scheme="http://www.digitalmihailo.com/tag/javascript" />
    <category term="javascript modules" label="javascript modules" scheme="http://www.digitalmihailo.com/tag/javascript+modules" />
  <feedburner:origLink>http://www.digitalmihailo.com/post/using-javascript-modules---a-catch</feedburner:origLink></entry>
  <entry>
    <id>http://www.digitalmihailo.com/post/experimental-hexwax-expandio-usb-library-on-git</id>
    <title>Experimental HexWax expandIO-USB Library on Git</title>
    <published>2010-11-20T12:19:07+00:00</published>
    <updated>2010-11-20T12:19:33+00:00</updated>
    <link href="http://feedproxy.google.com/~r/blogspot/digitalmihailo/~3/sm8-X5H_8cg/experimental-hexwax-expandio-usb-library-on-git" rel="alternate" />
    <content type="html">&lt;p&gt;I have added experimental library for &lt;a href="http://www.hexwax.com/Products/expandIO-USB/"&gt;HexWax expandIO-&lt;span class="caps"&gt;USB&lt;/span&gt;&lt;/a&gt; to &lt;a href="https://github.com/mlalevic/HexWax-expandIO-Python-Library"&gt;GitHub&lt;/a&gt; . It should work fine for official evaluation board as well as it works for mine custom made one. The library is still in early stage so some significant changes are to be expected to both code and code structure.&lt;/p&gt;
&lt;p&gt;Read only repository is here: git://github.com/mlalevic/HexWax-expandIO-Python-Library.git&lt;/p&gt;
&lt;p&gt;Nearly all commands from the firmware are covered, and I have added two examples &amp;#8211; one single threaded and one multi-threaded &amp;#8211; the same example &amp;#8211; blinking LEDs.&lt;/p&gt;
&lt;p&gt;See how simple it is:&lt;/p&gt;
&lt;script src="http://pastebin.com/embed_js.php?i=RS63AhuH"&gt;&lt;/script&gt;&lt;p&gt;All commands are created like SetBit(&amp;#8220;&lt;span class="caps"&gt;TRISC&lt;/span&gt;&amp;#8221;, 6, 0), method pack() is used to get byte array representation for sending to device. Unpacking is done by a corresponding unpack class &amp;#8211; like SetBitUnpack, and it unpacks input packet into member attributes.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s multi-threaded version which is even simpler:&lt;/p&gt;
&lt;script src="http://pastebin.com/embed_js.php?i=bMYkeiF7"&gt;&lt;/script&gt;&lt;p&gt;UsbBackgroundRead spawns a thread to read data from &lt;span class="caps"&gt;USB&lt;/span&gt; device in background. This is useful if the device can have external events &amp;#8211; interrupts.&lt;/p&gt;
&lt;p&gt;Anyway, got to do some more documentation on it and add more examples soon.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=sm8-X5H_8cg:x2h84pinXxU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=sm8-X5H_8cg:x2h84pinXxU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=sm8-X5H_8cg:x2h84pinXxU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=sm8-X5H_8cg:x2h84pinXxU:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=sm8-X5H_8cg:x2h84pinXxU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=sm8-X5H_8cg:x2h84pinXxU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=sm8-X5H_8cg:x2h84pinXxU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=sm8-X5H_8cg:x2h84pinXxU:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=sm8-X5H_8cg:x2h84pinXxU:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/digitalmihailo/~4/sm8-X5H_8cg" height="1" width="1"/&gt;</content>
    <category term="linux" label="linux" scheme="http://www.digitalmihailo.com/tag/linux" />
    <category term="python" label="python" scheme="http://www.digitalmihailo.com/tag/python" />
    <category term="usb" label="usb" scheme="http://www.digitalmihailo.com/tag/usb" />
  <feedburner:origLink>http://www.digitalmihailo.com/post/experimental-hexwax-expandio-usb-library-on-git</feedburner:origLink></entry>
  <entry>
    <id>http://www.digitalmihailo.com/post/usb-programming-with-python-on-linux---pyusb-version</id>
    <title>USB Programming with Python on Linux - PyUSB version</title>
    <published>2010-11-04T16:09:19+00:00</published>
    <updated>2010-11-04T16:09:48+00:00</updated>
    <link href="http://feedproxy.google.com/~r/blogspot/digitalmihailo/~3/wWBG5lTFF_4/usb-programming-with-python-on-linux---pyusb-version" rel="alternate" />
    <content type="html">&lt;p&gt;In my &lt;a href="/post/usb-programming-with-python-on-linux"&gt;earlier post&lt;/a&gt; I was using &lt;a href="http://libhid.alioth.debian.org/"&gt;libhid&lt;/a&gt; however due to it&amp;#8217;s alleged problems with multi-threading I decided to use &lt;a href="http://sourceforge.net/apps/mediawiki/pyusb/index.php?title=Main_Page"&gt;PyUSB&lt;/a&gt; instead. The code is a bit different, however a little shorter and simpler.&lt;/p&gt;
&lt;p&gt;One notable thing to be aware of is that device I&amp;#8217;m using is &lt;span class="caps"&gt;HID&lt;/span&gt; device and Linux is automatically loading &lt;span class="caps"&gt;HID&lt;/span&gt; drivers for it so it needs to be unloaded for PyUSB to continue working. That&amp;#8217;s done by calling &lt;em&gt;dev.detach&lt;/em&gt;kernel_driver(0)_ I suppose the device is used as vendor-specific device then, but who cares.&lt;/p&gt;
&lt;p&gt;Anyway, here&amp;#8217;s the code, should be a bit simpler than before:&lt;br /&gt;
&lt;div style="height:400px;overflow:auto;padding:10px;"&gt;&lt;br /&gt;&lt;br /&gt;
&lt;script src="http://pastebin.com/embed_js.php?i=2YFSb20w"&gt;&lt;/script&gt;&lt;br /&gt;&lt;/p&gt;
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=wWBG5lTFF_4:dh6u49awtYA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=wWBG5lTFF_4:dh6u49awtYA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=wWBG5lTFF_4:dh6u49awtYA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=wWBG5lTFF_4:dh6u49awtYA:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=wWBG5lTFF_4:dh6u49awtYA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=wWBG5lTFF_4:dh6u49awtYA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=wWBG5lTFF_4:dh6u49awtYA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=wWBG5lTFF_4:dh6u49awtYA:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=wWBG5lTFF_4:dh6u49awtYA:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/digitalmihailo/~4/wWBG5lTFF_4" height="1" width="1"/&gt;</content>
    <category term="hardware" label="hardware" scheme="http://www.digitalmihailo.com/tag/hardware" />
    <category term="linux" label="linux" scheme="http://www.digitalmihailo.com/tag/linux" />
    <category term="python" label="python" scheme="http://www.digitalmihailo.com/tag/python" />
    <category term="usb" label="usb" scheme="http://www.digitalmihailo.com/tag/usb" />
  <feedburner:origLink>http://www.digitalmihailo.com/post/usb-programming-with-python-on-linux---pyusb-version</feedburner:origLink></entry>
  <entry>
    <id>http://www.digitalmihailo.com/post/using-pyusb-with-netbeans</id>
    <title>Using PyUSB with NetBeans</title>
    <published>2010-11-03T05:49:25+00:00</published>
    <updated>2010-11-03T05:49:31+00:00</updated>
    <link href="http://feedproxy.google.com/~r/blogspot/digitalmihailo/~3/Hz24sYkH0bw/using-pyusb-with-netbeans" rel="alternate" />
    <content type="html">&lt;p&gt;I&amp;#8217;m going to rewrite my previous example on &lt;a href="/page/usb-programming-with-python-on-linux"&gt;programming &lt;span class="caps"&gt;USB&lt;/span&gt; with Python on Linux&lt;/a&gt;. &lt;a href="http://libhid.alioth.debian.org/"&gt;libhid&lt;/a&gt; I&amp;#8217;m using at the moment is using old version of &lt;a href="http://www.libusb.org/"&gt;libusb&lt;/a&gt; and that version seems not to be behaving best in multi-threading environment. The new version of libusb has completely different &lt;span class="caps"&gt;API&lt;/span&gt;, so I decided to use &lt;a href="http://sourceforge.net/apps/mediawiki/pyusb/index.php?title=Main_Page"&gt;PyUSB&lt;/a&gt; a Python library wrapped around libusb.&lt;/p&gt;
&lt;p&gt;&amp;#8220;This should be straightforward&amp;#8221; I thought to myself, however I had trouble making it work with &lt;a href="http://netbeans.org/"&gt;NetBeans&lt;/a&gt; I installed PyUSB according to instructions and it seemed installation was successful, but no joy in NetBeans. Even import usb.core was throwing error &lt;em&gt;ImportError: No module named core&lt;/em&gt; That was strange since at least import usb.core worked fine in &lt;span class="caps"&gt;IDLE&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Anyway, to cut the long story short, PyUSB was installed in &lt;strong&gt;/usr/local/lib/python2.6/dist-packages&lt;/strong&gt;, when adding it to path, and other experiments did not yield expected results, I just copied files to &lt;strong&gt;/usr/lib/python2.6/dist-packages&lt;/strong&gt; where I have other libraries installed and I know them working. After doing that everything was fine, I could actually do some coding. Why it did not work in the first place? I don&amp;#8217;t have a clue, however I won&amp;#8217;t be investigating it any further.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=Hz24sYkH0bw:zrza9izq_ZQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=Hz24sYkH0bw:zrza9izq_ZQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=Hz24sYkH0bw:zrza9izq_ZQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=Hz24sYkH0bw:zrza9izq_ZQ:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=Hz24sYkH0bw:zrza9izq_ZQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=Hz24sYkH0bw:zrza9izq_ZQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=Hz24sYkH0bw:zrza9izq_ZQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=Hz24sYkH0bw:zrza9izq_ZQ:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=Hz24sYkH0bw:zrza9izq_ZQ:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/digitalmihailo/~4/Hz24sYkH0bw" height="1" width="1"/&gt;</content>
    <category term="linux" label="linux" scheme="http://www.digitalmihailo.com/tag/linux" />
    <category term="netbeans" label="netbeans" scheme="http://www.digitalmihailo.com/tag/netbeans" />
    <category term="python" label="python" scheme="http://www.digitalmihailo.com/tag/python" />
  <feedburner:origLink>http://www.digitalmihailo.com/post/using-pyusb-with-netbeans</feedburner:origLink></entry>
  <entry>
    <id>http://www.digitalmihailo.com/post/usb-programming-with-python-on-linux</id>
    <title>Linux USB Programming with Python</title>
    <published>2010-10-13T16:14:26+00:00</published>
    <updated>2010-10-14T05:53:11+00:00</updated>
    <link href="http://feedproxy.google.com/~r/blogspot/digitalmihailo/~3/YFdDoV5ykFk/usb-programming-with-python-on-linux" rel="alternate" />
    <content type="html">&lt;p&gt;Recently I started doing some hardware design, just for fun. Anyway, I got my hands on one microcontroller with &lt;span class="caps"&gt;USB&lt;/span&gt; interface so I wanted to see how I can control it from my Linux box. It turns out to be quite easy and with this any general &lt;a href="http://en.wikipedia.org/wiki/USB_human_interface_device_class"&gt;&lt;span class="caps"&gt;USB&lt;/span&gt; &lt;span class="caps"&gt;HID&lt;/span&gt; class&lt;/a&gt; device can be controlled (&lt;span class="caps"&gt;USB&lt;/span&gt; rocket launchers, &lt;span class="caps"&gt;USB&lt;/span&gt; toys and such I suppose).&lt;br /&gt;
Anyway, this post just lays out basics on how these devices can be used with Python on Linux. (&lt;em&gt;Mind though that I&amp;#8217;m Python, &lt;span class="caps"&gt;USB&lt;/span&gt; and Linux noob so don&amp;#8217;t take this for granted &amp;#8211; and of course no warranties whatsoever.&lt;/em&gt;)&lt;br /&gt;
First of all we need some library to access &lt;span class="caps"&gt;USB&lt;/span&gt; &amp;#8211; &lt;a href="http://libhid.alioth.debian.org/"&gt;libhid&lt;/a&gt; there should be Python bindings with it. I got both the library and the bindings with the following command (on my Ubuntu):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo apt-get install libhid-dev python-hid &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then we need some hardware. I suppose any suitable Hid device can be used as long as communication protocol is known. I created my own device using &lt;a href="http://www.hexwax.com/Products/expandIO-USB/"&gt;HexWax expandIO-&lt;span class="caps"&gt;USB&lt;/span&gt;&lt;/a&gt; which is just a fancy name for (in my case) &lt;a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010273"&gt;PIC18F2455&lt;/a&gt; with HexWax&amp;#8217;s firmware. I got mine from &lt;a href="http://ie.farnell.com/hexwax/expandio-usb-fs-dil-28/interface-usb-i-o-expander-28dil/dp/1670831"&gt;Farnell&lt;/a&gt; . The chip supports 10-bit A/D, digital I/O, counter input, interrupts, comparators, &lt;span class="caps"&gt;CCP&lt;/span&gt;, &lt;span class="caps"&gt;SPI&lt;/span&gt;, I2C so we can control loads of different peripherals if we wanted to.&lt;/p&gt;
&lt;p&gt;The board is very simple and I used simplest reference schema from the documentation. It doesn&amp;#8217;t follow any good &lt;span class="caps"&gt;USB&lt;/span&gt; design practices, I&amp;#8217;m sure, but it can be assembled on a &lt;a href="http://en.wikipedia.org/wiki/Breadboard"&gt;breadboard&lt;/a&gt; . Here&amp;#8217;s the schema:&lt;/p&gt;
&lt;p&gt;&lt;img src="/images/hexwax.png" title="USB board schema" alt="USB board schema" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;mind though, I used PIC18F2455 but it&amp;#8217;s the same thing&lt;/em&gt;&lt;br /&gt;
And as I said it can be assembled on a bread board:&lt;/p&gt;
&lt;p&gt;&lt;img src="/images/HexWax_bb.png" title="HexWax on breadboard" alt="HexWax on breadboard" /&gt;&lt;/p&gt;
&lt;p&gt;This image was made in &lt;a href="http://fritzing.org/"&gt;Fritzing&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Very simple &amp;#8211; only 6 capacitors, 2 resistors, a &lt;span class="caps"&gt;LED&lt;/span&gt;, a crystal, the chip itself, &lt;span class="caps"&gt;USB&lt;/span&gt; connector and few wires. I assembled it quickly, and instead of using &lt;span class="caps"&gt;USB&lt;/span&gt; connector I cut one &lt;span class="caps"&gt;USB&lt;/span&gt; cable I wasn&amp;#8217;t using and stripped off wires and plugged them into the breadboard &amp;#8211; it looked ugly but it worked (of course use this approach on your own risk, as with anything else). Here&amp;#8217;s &lt;a href="http://pinouts.ru/Slots/USB_pinout.shtml"&gt;&lt;span class="caps"&gt;USB&lt;/span&gt; pinout&lt;/a&gt; . Btw, I added a &lt;span class="caps"&gt;LED&lt;/span&gt; and one resistor just so I have some kind of a peripheral to play with.&lt;/p&gt;
&lt;p&gt;After I finished testing the design on breadboard I used &lt;a href="http://en.wikipedia.org/wiki/Stripboard"&gt;stripboard&lt;/a&gt; to create a more permanent board:&lt;/p&gt;
&lt;p&gt;&lt;img src="/images/hexwax_board.JPG" title="HexWax on stripboard" alt="HexWax on stripboard" /&gt;&lt;/p&gt;
&lt;p&gt;Basically the same thing, I just added some receptacles on both sides of the chip so I can connect other peripherals later.&lt;/p&gt;
&lt;p&gt;Oh yes, since there&amp;#8217;s HexWax firmware preloaded there&amp;#8217;s no need to do any microcontroller programming, all&amp;#8217;s done from PC.&lt;/p&gt;
&lt;p&gt;Off to programming part and Python. First of all lets see how this board shows up to our system when we plug it in. Here&amp;#8217;s output of lsusb command:&lt;/p&gt;
&lt;p&gt;&lt;img src="/images/hexwax_lsusb.png" title="HexWax plugged in" alt="HexWax plugged in" /&gt;&lt;/p&gt;
&lt;p&gt;It shows up as a device with ID 0b40:0132. This can be changed in code but I couldn&amp;#8217;t be bothered. So lets put libhid into action. Here&amp;#8217;s code that is initializing the library, finding the device, reading it&amp;#8217;s details (so far all standard code from libhid), then reading device&amp;#8217;s firmware, setting our &lt;span class="caps"&gt;LED&lt;/span&gt; pin to be output, and blink 10 times with it with 1 second pause. Simple. Comments are in &lt;a href="http://pastebin.com/rpMEjHN5"&gt;the code&lt;/a&gt; :&lt;/p&gt;
&lt;p&gt;&lt;div style="height:400px;overflow:auto;padding:10px;"&gt;&lt;br /&gt;
&lt;script src="http://pastebin.com/embed_js.php?i=rpMEjHN5"&gt;&lt;/script&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
This was a quick run through. Hopefully I get some time to play more with this in the near future, and will follow up with new posts.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=YFdDoV5ykFk:BHYPOdwi0w4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=YFdDoV5ykFk:BHYPOdwi0w4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=YFdDoV5ykFk:BHYPOdwi0w4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=YFdDoV5ykFk:BHYPOdwi0w4:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=YFdDoV5ykFk:BHYPOdwi0w4:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=YFdDoV5ykFk:BHYPOdwi0w4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=YFdDoV5ykFk:BHYPOdwi0w4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=YFdDoV5ykFk:BHYPOdwi0w4:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=YFdDoV5ykFk:BHYPOdwi0w4:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/digitalmihailo/~4/YFdDoV5ykFk" height="1" width="1"/&gt;</content>
    <category term="hardware" label="hardware" scheme="http://www.digitalmihailo.com/tag/hardware" />
    <category term="linux" label="linux" scheme="http://www.digitalmihailo.com/tag/linux" />
  <feedburner:origLink>http://www.digitalmihailo.com/post/usb-programming-with-python-on-linux</feedburner:origLink></entry>
  <entry>
    <id>http://www.digitalmihailo.com/post/custom-notification-box-in-firefox</id>
    <title>Custom notification box in Firefox</title>
    <published>2010-09-28T14:38:21+00:00</published>
    <updated>2010-09-28T14:38:39+00:00</updated>
    <link href="http://feedproxy.google.com/~r/blogspot/digitalmihailo/~3/L5ZGtfDiAK8/custom-notification-box-in-firefox" rel="alternate" />
    <content type="html">&lt;p&gt;Out of the box &lt;a href="https://developer.mozilla.org/en/XUL/notification"&gt;notifications&lt;/a&gt; in &lt;a href="http://www.getfirefox.com"&gt;Firefox&lt;/a&gt; as far as extension developers are concerned are pretty blend. You can only set icon and text, which is enough in most of the cases; however while working on &lt;a href="http://www.new-tab-jumpstart.com"&gt;New Tab JumpStart&lt;/a&gt; extension I wanted to show more than that.&lt;/p&gt;
&lt;p&gt;I wanted to show list of all search engines in Firefox. One of the &lt;a href="https://developer.mozilla.org/en/Code_snippets/Alerts_and_Notifications#Using_notification_box"&gt;suggested solutions&lt;/a&gt; requires manual control over animation, persistence counting, styling, etc. So I tried to see if there was a simpler or at least more elegant solution. And, I might have found it.&lt;/p&gt;
&lt;p&gt;1) Get notification box and add notification&lt;br /&gt;
2) Replace notification body with custom binding&lt;/p&gt;
&lt;p&gt;Should be simple as that. So here&amp;#8217;s a short snippet for doing that (see below for the full code reference, this is just a cut out showing principle):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;var nb = getBrowserWindow().getNotificationBox(window);
var n = nb.getNotificationWithValue('jumpstart_searchnotice');
if(!n){
    nb.appendNotification('', 'jumpstart_searchnotice',
                              'chrome://jumpstart/skin/img/JumpStart32.png',
                               nb.PRIORITY_INFO_HIGH, []);
    n = nb.getNotificationWithValue('jumpstart_searchnotice');&lt;/code&gt;

&lt;code&gt;    var p = n.ownerDocument.getAnonymousElementByAttribute(n, 'anonid', 'details');&lt;/code&gt;

&lt;code&gt;    var bx = n.ownerDocument.createElement('hbox');
    bx.setAttribute('style', '-moz-binding: url("chrome://jumpstart/content/bindings/thumbnail.xml#searchEngines");');
    bx.setAttribute('flex', '1');&lt;/code&gt;

&lt;code&gt;    p.parentNode.replaceChild(bx, p);
}&lt;/code&gt;

&lt;code&gt;n.persistence = 10;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Full code how it&amp;#8217;s used in the extension is in &lt;a href="http://code.google.com/p/new-tab-jumpstart/source/browse/tags/0.5a5/content/tabView.js"&gt;tabView.js&lt;/a&gt; search for &lt;strong&gt;showSearchNotice&lt;/strong&gt; function.&lt;br /&gt;
&lt;em&gt;getBrowserWindow&lt;/em&gt; is getting current browser window so we can get &lt;a href="https://developer.mozilla.org/en/XUL/notificationbox"&gt;notificationbox&lt;/a&gt; . Then we are getting or creating the notice. Text doesn&amp;#8217;t really matter since it&amp;#8217;s going to be replaced anyway.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;var p = n.ownerDocument.getAnonymousElementByAttribute(n, 'anonid', 'details');&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This part is crucial since that is the element we are going to replace (it&amp;#8217;s parent is container we really want but it doesn&amp;#8217;t have a suitable attribute to get it). Note though that ownerDocument should be used to get element or create new element since it is not the same document as page&amp;#8217;s &amp;#8211; it&amp;#8217;s really chrome window&amp;#8217;s document.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bx.setAttribute('style', '-moz-binding: url("chrome://jumpstart/content/bindings/thumbnail.xml#searchEngines");');&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is also important since this way we&amp;#8217;re adding custom binding to the notification. If &lt;span class="caps"&gt;XUL&lt;/span&gt; markup is complex this is much easier to do than adding children manually.&lt;br /&gt;
Note as well at the end how properties of notification can be still controlled and Firefox handles them correctly.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a snippet of the &lt;span class="caps"&gt;XBL&lt;/span&gt; binding:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;binding id="searchEngines"&amp;gt;
    &amp;lt;resources&amp;gt;
      &amp;lt;stylesheet src="chrome://jumpstart/skin/tabView.css"/&amp;gt;
      &amp;lt;stylesheet src="chrome://jumpstart/skin/xbl.css"/&amp;gt;
      &amp;lt;!--&amp;lt;stylesheet src="chrome://jumpstart/skin/overlay.css"/&amp;gt;--&amp;gt;
    &amp;lt;/resources&amp;gt;
    &amp;lt;content&amp;gt;
            &amp;lt;xul:hbox class="searchEngines"&amp;gt;
               &amp;lt;xul:spacer flex="1" /&amp;gt;
               &amp;lt;xul:arrowscrollbox anonid="searchEnginesContainer" flex="1"&amp;gt;&amp;lt;/xul:arrowscrollbox&amp;gt;
               &amp;lt;xul:spacer flex="1" /&amp;gt;
               &amp;lt;xul:label class="customlink" value="&amp;amp;back;" onclick="loadURI('chrome://jumpstart/content/tabView.xul', null, null, true);" /&amp;gt;
            &amp;lt;/xul:hbox&amp;gt;
    &amp;lt;/content&amp;gt;
    &amp;lt;implementation&amp;gt;
  ...&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That is snippet from &lt;a href="http://code.google.com/p/new-tab-jumpstart/source/browse/tags/0.5a5/content/bindings/thumbnail.xml"&gt;thumbnails.xml&lt;/a&gt; search for &lt;strong&gt;id=&amp;#8220;searchEngines&amp;#8221;&lt;/strong&gt;. Basically, further in the implementation I&amp;#8217;m just enumerating all search engines, that&amp;#8217;s why the content doesn&amp;#8217;t look like contains much.&lt;/p&gt;
&lt;p&gt;And the final result of this is:&lt;br /&gt;
&lt;img src="/images/CustomNotification.jpg" title="Custom Notification" alt="Custom Notification" /&gt;&lt;/p&gt;
&lt;p&gt;Oh, yes, some final thoughts. This seems to be more elegant solution than what was suggested on &lt;a href="https://developer.mozilla.org/"&gt;&lt;span class="caps"&gt;MDN&lt;/span&gt;&lt;/a&gt; however this might break if Firefox developers decide to change layout of notifications in future. That being said &lt;strong&gt;this works in both 3.6 and 4.0&lt;/strong&gt; beta versions so I don&amp;#8217;t expect it to change soon.&lt;br /&gt;
And another thing, &lt;strong&gt;&lt;span class="caps"&gt;CSS&lt;/span&gt; is applied incorrectly by Firefox&lt;/strong&gt; so broader &lt;span class="caps"&gt;CSS&lt;/span&gt; selector is applied after more specific one. Note &lt;em&gt;customlink&lt;/em&gt; class in content of the &lt;span class="caps"&gt;XBL&lt;/span&gt;, that was applied before label style which doesn&amp;#8217;t make sense at all. That was effectively breaking my styling so I had to add the styling to my overlay.css which I didn&amp;#8217;t feel like. My overlay.css is added as overlay to the browser itself so I suppose binding&amp;#8217;s overlay is applied first regardless of specificity of &lt;span class="caps"&gt;CSS&lt;/span&gt; selectors and that seems to be completely wrong but what can you do. Anyway, just so you know and not waste hours in frustration.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=L5ZGtfDiAK8:0R5Mux9Q2pM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=L5ZGtfDiAK8:0R5Mux9Q2pM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=L5ZGtfDiAK8:0R5Mux9Q2pM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=L5ZGtfDiAK8:0R5Mux9Q2pM:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=L5ZGtfDiAK8:0R5Mux9Q2pM:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=L5ZGtfDiAK8:0R5Mux9Q2pM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=L5ZGtfDiAK8:0R5Mux9Q2pM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=L5ZGtfDiAK8:0R5Mux9Q2pM:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=L5ZGtfDiAK8:0R5Mux9Q2pM:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/digitalmihailo/~4/L5ZGtfDiAK8" height="1" width="1"/&gt;</content>
    <category term="firefox" label="firefox" scheme="http://www.digitalmihailo.com/tag/firefox" />
    <category term="xul" label="xul" scheme="http://www.digitalmihailo.com/tag/xul" />
  <feedburner:origLink>http://www.digitalmihailo.com/post/custom-notification-box-in-firefox</feedburner:origLink></entry>
  <entry>
    <id>http://www.digitalmihailo.com/post/set-hard-drive-name-in-ubuntu</id>
    <title>Set Hard Drive Name in Ubuntu</title>
    <published>2010-05-11T14:49:46+00:00</published>
    <updated>2010-05-11T14:49:56+00:00</updated>
    <link href="http://feedproxy.google.com/~r/blogspot/digitalmihailo/~3/ANFhK0Jm3Bg/set-hard-drive-name-in-ubuntu" rel="alternate" />
    <content type="html">&lt;p&gt;This one is simple. &lt;a href="http://www.ubuntu.com/"&gt;Ubuntu&lt;/a&gt; is using volume label to show &lt;span class="caps"&gt;HDD&lt;/span&gt; name. My file system is ext3 so tool of choice is: e2label, eg. to name your disk &lt;em&gt;Data&lt;/em&gt; use something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;e2label /dev/sda1 Data&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For more info see Ubuntu documentation: &lt;a href="https://help.ubuntu.com/community/RenameUSBDrive"&gt;Renaming &lt;span class="caps"&gt;USB&lt;/span&gt; Drive&lt;/a&gt;. Tools for other file systems are mentioned there and other useful commands.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=ANFhK0Jm3Bg:QzuAqn4ctsM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=ANFhK0Jm3Bg:QzuAqn4ctsM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=ANFhK0Jm3Bg:QzuAqn4ctsM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=ANFhK0Jm3Bg:QzuAqn4ctsM:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=ANFhK0Jm3Bg:QzuAqn4ctsM:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=ANFhK0Jm3Bg:QzuAqn4ctsM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=ANFhK0Jm3Bg:QzuAqn4ctsM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=ANFhK0Jm3Bg:QzuAqn4ctsM:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=ANFhK0Jm3Bg:QzuAqn4ctsM:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/digitalmihailo/~4/ANFhK0Jm3Bg" height="1" width="1"/&gt;</content>
    <category term="linux" label="linux" scheme="http://www.digitalmihailo.com/tag/linux" />
  <feedburner:origLink>http://www.digitalmihailo.com/post/set-hard-drive-name-in-ubuntu</feedburner:origLink></entry>
  <entry>
    <id>http://www.digitalmihailo.com/post/setting-favicon-for-xul-pages</id>
    <title>Setting favicon for XUL pages</title>
    <published>2010-01-22T15:35:41+00:00</published>
    <updated>2010-01-22T15:36:09+00:00</updated>
    <link href="http://feedproxy.google.com/~r/blogspot/digitalmihailo/~3/kyrej2z6jYI/setting-favicon-for-xul-pages" rel="alternate" />
    <content type="html">&lt;p&gt;This post is basically inspired by a problem I encountered with latest Firefox release (3.6). Some styling changed for no apparent reason at the end it turned out to be favicon I had set in &lt;span class="caps"&gt;XUL&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Basically, with favicon set my vbox stopped filling the window so my styling was off &amp;#8211; background image was cut off, and I got some weird popup menu behavior where menu appeared to be shifted off the button.&lt;/p&gt;
&lt;p&gt;Anyway here are a few simple examples that shows what is going on and how to solve it.&lt;/p&gt;
&lt;p&gt;This what I want to have:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        xmlns:html="http://www.w3.org/1999/xhtml"
         &amp;gt;
		 &amp;lt;vbox flex="1" style="background-color: red"&amp;gt;
			&amp;lt;hbox height="100" style="background-color: green"&amp;gt;&amp;lt;/hbox&amp;gt;
		 &amp;lt;/vbox&amp;gt;
&amp;lt;/window&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This would look like this in browser:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://lh5.ggpht.com/_3qhD-19YgiQ/S1oyXjigkGI/AAAAAAAAE24/g_7PPn6vfV4/s800/xul1.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Now lets try to add favicon there:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        xmlns:html="http://www.w3.org/1999/xhtml"
         &amp;gt;
		 &amp;lt;html:link rel="icon" /&amp;gt;
		 &amp;lt;vbox flex="1" style="background-color: red"&amp;gt;
			&amp;lt;hbox height="100" style="background-color: green"&amp;gt;&amp;lt;/hbox&amp;gt;
		 &amp;lt;/vbox&amp;gt;
&amp;lt;/window&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that doesn&amp;#8217;t really matter what icon you put there. I expected the browser to show exactly the same thing but it did not happen:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://lh4.ggpht.com/_3qhD-19YgiQ/S1o0RYTYY0I/AAAAAAAAE28/SJMGmVEaSkM/s800/xul2.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Now, that was unexpected. Basically the whole box collapsed and Firebug at the bottom shows that code is there, just not shown.&lt;/p&gt;
&lt;p&gt;Fix for this was just to add &lt;code&gt;style="display:none"&lt;/code&gt; and that was it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;html:link rel="icon" style="display:none" /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And we&amp;#8217;re back on track, browser is showing our page correctly again. This works in Firefox 3.0.x and 3.5.x without adding style attribute, but it has been changed in Firefox 3.6 for some reason so be warned. I&amp;#8217;d suggest that if you have favicon specified like this and your page is not behaving as you expect try this fix first, my popups were shifted by the size of a spacer to the left and once I&amp;#8217;ve applied this it was back to normal.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=kyrej2z6jYI:7ras3Kbk_EU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=kyrej2z6jYI:7ras3Kbk_EU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=kyrej2z6jYI:7ras3Kbk_EU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=kyrej2z6jYI:7ras3Kbk_EU:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=kyrej2z6jYI:7ras3Kbk_EU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=kyrej2z6jYI:7ras3Kbk_EU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?i=kyrej2z6jYI:7ras3Kbk_EU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=kyrej2z6jYI:7ras3Kbk_EU:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?a=kyrej2z6jYI:7ras3Kbk_EU:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/blogspot/digitalmihailo?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/digitalmihailo/~4/kyrej2z6jYI" height="1" width="1"/&gt;</content>
    <category term="firefox extensions" label="firefox extensions" scheme="http://www.digitalmihailo.com/tag/firefox+extensions" />
  <feedburner:origLink>http://www.digitalmihailo.com/post/setting-favicon-for-xul-pages</feedburner:origLink></entry>
</feed>
