<?xml version="1.0" encoding="iso-8859-1" ?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<atom:link href="http://www.m0interactive.com/rss/articles.xml" rel="self" type="application/rss+xml" />
	<title>Mohamed Mansour | articles</title>
	<copyright>Copyright (c) 2006 Mohamed Mansour! Inc. All rights reserved.</copyright>
	<link>http://www.m0interactive.com/</link>
	<description>Mohamed Mansour RSS Feeds</description>
	<language>en-us</language> 
	<item>
		<title>Software - Chromium OS compiled in Debian running in VirtualBox</title>
		<link>http://www.m0interactive.com/archives/2009/11/20/chromium_os_compiled_in_debian_running_in_virtualbox.html</link>
		<description><![CDATA[<p>So today Google announced Chrome OS and released the source code. So I grabbed the source and started lurking! I have compiled it with Debian and created the chromiumos.vmdk drive that you can load in VirtualBox or VMWare Player. In this article, I will explain what extra stuff I needed to make it compile on Debian and you can download the working image at the end of this article.</p>

<h3>How to compile in Debian</h3>
<p>Make sure you read the dev docs here <a href="http://dev.chromium.org/chromium-os/building-chromium-os" > http://dev.chromium.org/chromium-os/building-chromium-os </a>, it works perfectly. So make sure you install: </p>
<ol>
<li>Prerequisites</li>
<li>Download the Source Code http://src.chromium.org/git/chromiumos.git</li>
<li>And build!</li>
</ol>

<p>In Debian make sure you have "qemu" installed (sudo apt-get install qemu), that is needed to create the image. And make sure you add sbin to your path (export PATH=/sbin:/usr/sbin:"$PATH" or it wont work. Thats all!</p>


<h3>How it feels</h3>
<p>Okay, it booted in 2 seconds in a VM! That is bloody quick. It seems slow in the VM but that is normal. It really seems like an unfinished product and many stuff hasn't been cleaned. Such as, many broken links (internal Google sites) still in tact. Keyboard shortcuts doesn't for many. The only thing you can make working is use the internet. Good for a start, I guess!</p>

<h3>How to run Chromium OS</h3>
<p>I used VirtualBox and VMWare Player, VirtualBox was very simple to use. All you had to do is follow these steps. Remember to download the virtual disk below:</p>
<div style="border: 1px dotted #ccc">
  <a href="http://mohamedmansour.com/" style="color:black">
    <img src="http://mohamedmansour.com/chrome/chrome-icon.png" alt="Download ChromeOS" style="float:left"/>
    <p>
      <strong><del>Download Chromium OS (Root password: chrome)</del>No longer exists.</strong><br />
      Virtual Machine Disk Format (works on VirtualBox and VMWare Player)
    </p>
  </a>
</div>
<p>Steps to run it:</p>
<ol>
<li>Download from <a href="http://www.virtualbox.org/">http://www.virtualbox.org/</a>, its free and Open Source! Install it.</li>
<li>Create a new Virtual Machine.</li>
<li>Type any name (ChromeOS)</li>
<li>The Operating System should be Linux, and the Version could be Other.</li>
<li>Use an existing hard disk, point to the chromiumos.vmdk file </li>
<li>Thats it, press start!</li>
</ol>

<img src="http://www.m0interactive.com/images/blog/chromeos/chromeos_start.jpg" alt=""/>

<img src="http://www.m0interactive.com/images/blog/chromeos/chromeos_inside.jpg" alt=""/>
]]></description>
		<pubDate>Fri, 20 Nov 2009 02:45:54 -0500</pubDate>
		<guid>http://www.m0interactive.com/archives/2009/11/20/chromium_os_compiled_in_debian_running_in_virtualbox.html</guid>
	</item>
	<item>
		<title>Technology - How to Enable WebGL on Google Chrome</title>
		<link>http://www.m0interactive.com/archives/2009/10/26/how_to_enable_webgl_on_google_chrome.html</link>
		<description><![CDATA[<p>This month, WebGL has been released in its pre-state in Firefox, Safari, and Chromium. WebGL is a cool way to display 3D content in the Web using OpenGL.</p>


<h3>What is WebGL</h3>
<p>WebGL is a JavaScript binding to OpenGL ES 2.0 for 3D Web Graphics without installing any web plugins. The Khronos Group (the creators/maintainers of OpenGL standard) working group includes many industry leaders such as Google, Mozilla, NVIDIA, Opera, AMD, etc to work on standardizing WebGL. The press release can be red <a href="http://www.khronos.org/news/press/releases/khronos-webgl-initiative-hardware-accelerated-3d-graphics-internet">here</a>. WebGL is currently still in development, if you want to keep track of its status, you can star this issue: <a href="http://code.google.com/p/chromium/issues/detail?id=21852"> http://code.google.com/p/chromium/issues/detail?id=21852</a></p>

<h3>But how is it different than Google's O3D?</h3>
<p>The main reason is that WebGL is still very slow, O3D is a plugin which is native. There is an interesting thread going on and some Googlers from the O3D team discussed the differences: </p>
<pre style="overflow:hidden; border-left: 10px solid #eee; padding-left: 5px">
<span style="font-size: 1.5em; color: #ccc;font-weight:bold">Quote...</span>
O3D is not going away. WebGL is a very cool initiative but it has
a lot of hurdles to overcome. The direction of WebGL is trying to
just expose straight OpenGL ES 2.0 calls to JavaScript. 

JavaScript is still slow in the large scheme of things. Maybe at 
sometime in the future WebGL will have added enough features over
basic OpenGL to be more powerful or JavaScript  will have gotten 
a few orders of magnitude faster but at the moment…

…
The WebGL team at Google and the O3D team are currently the same
team. We have every interest in seeing both WebGL and O3D succeed.

<a href="http://groups.google.com/group/o3d-discuss/browse_thread/thread/7bfa31efcc03b5f6">Read Original Source ...</a>
</pre>

<h3>How to enable WebGL on Google Chrome / Chromium?</h3>
<p>Make sure you are in the dev channel. Google Chrome releases updates to different release channels. Currently, there are three channels; Stable (everyone is on this when the first install Google Chrome), Beta (every month or so, you will get an update), and Dev (the developer preview channel where stuff gets tested, like WebGL). In order to use WebGL at this current time, you would need the "Dev" release channel. </p>
<ol>
<li>First, subscribe here: <a href="http://www.google.com/chrome/eula.html?extra=devchannel"> http://www.google.com/chrome/eula.html?extra=devchannel </a></li>
<li>Make sure all other windows are closed.</li>
<li>Install</li>
<li>Now you are subscribed to the Development Channel, yay!</li>
</ol>

<p>After you have subscribed to the Development channel, you would need to put some command line parameters when you launch Google Chrome. </p>
<ol>
<li>Right click on your "Chrome" icon.</li>
<li>Choose properties</li>
<li>At the end of your target line, place these parameters: 
<ul>
<li>--enable-webgl</li>
<li>--no-sandbox</li>
</ul>
</li>
<li>It should look like: "chrome.exe --enable-webgl --no-sandbox"</li>
</ol>

<p>Now you have WebGL installed! Lets look at a cool example! This example of Escher Droste effect, where one image, rotated, thinking its zooming in forever. So cool! Take a look here: <a href="http://wakaba.c3.cx/w/escher_droste.html"> http://wakaba.c3.cx/w/escher_droste.html </a></p>

<p>Have fun WebGL'n!</p>]]></description>
		<pubDate>Mon, 26 Oct 2009 23:53:56 -0400</pubDate>
		<guid>http://www.m0interactive.com/archives/2009/10/26/how_to_enable_webgl_on_google_chrome.html</guid>
	</item>
	<item>
		<title>Software - Google Chrome reload all tabs extension</title>
		<link>http://www.m0interactive.com/archives/2009/10/03/google_chrome_reload_all_tabs_extension.html</link>
		<description><![CDATA[<p>Since I just did a bookmark all tabs extension for Chrome, many users on the Chrome Forums want a reload / refresh all tabs feature. We recently marked it as "WontFix" for including this into the browser, but it works fine as an extension.</p>

<img src="https://chrome.google.com/extensions/img/midkcinmplflbiflboepnahkboeonkam/1265572518.79/screenshot/5001" alt="Reload all tabs" />

<h3> Intro </h3>
<p>Since Google Chrome extensions is ready (currently for dev channel), you could install this extension and press <strong>"CTRL + SHIFT + R"</strong> to reload / refresh all tabs in the current window. The reason why I picked that keyboard shortcut combo, is simply because "CTRL + R" reloads the current tab, hence adding a Shift will reload all tabs which is a proper gesture (similar to FF/IE).</p>

<h3> Prerequisites / Installation </h3>
<p>Please refer to my previous post on how to install extension in Google Chrome / Chromium. It could be found <a href="http://m0interactive.com/archives/2009/10/02/google_chrome_bookmark_all_tabs_extension.html">here</a>.</p>

<div  class="download" style="border: 1px dotted #ccc">
  <a href="https://chrome.google.com/extensions/detail/midkcinmplflbiflboepnahkboeonkam" style="color:black">
    <img src="http://mohamedmansour.com/chrome/chrome-icon.png" alt="Install Reload all tabs Extension" style="float:left"/>
    <p>
      <strong>Install Extension</strong><br />
      Reload all tabs
    </p>
  </a>
</div>

<div class="download" style="border: 1px dotted #ccc; clear: left;">
  <a href="https://chrome.google.com/extensions/detail/bfenodnbilondijnaionekngdhadmegk" style="color:black">
    <img src="http://mohamedmansour.com/chrome/chrome-icon.png" alt="Install Reload all tabs Extension" style="float:left"/>
    <p>
      <strong>Install Browser Action Addon</strong><br />
      Reload all tabs button on the toolbar
    </p>
  </a>
</div>

<h3> Conclusion </h3>
<p>This feature has been requested by many users, and it work on all http and https websites. The source code is available in my <a href="http://github.com/mohamedmansour/chrome-extensions/tree/master/reload_all_tabs/" target="_blank">git repository</a>.</p>

<p>If you have any suggestions, or improvements, please let me know (comment down), and the extension will auto update in the future. </p>

<p>Happy refreshing!</p>

]]></description>
		<pubDate>Sat, 03 Oct 2009 13:41:43 -0400</pubDate>
		<guid>http://www.m0interactive.com/archives/2009/10/03/google_chrome_reload_all_tabs_extension.html</guid>
	</item>
	<item>
		<title>Software - Google Chrome bookmark all tabs extension</title>
		<link>http://www.m0interactive.com/archives/2009/10/02/google_chrome_bookmark_all_tabs_extension.html</link>
		<description><![CDATA[<p>Many users on the Chrome Forums want a bookmark all tabs feature since September 2008. We didn't implement it into the browser because we felt that is really a *feature* that people could download.</p>

<fieldset>
<legend>UPDATE</legend>
<p>We have integrated "bookmarking all tabs" natively within Chrome. For more information visit the <a href="http://www.google.com/support/forum/p/Chrome/thread?tid=37ed26a386ed45fb&hl=en">forums</a>. In the meantime, you can use the extension until they send the next dev/beta/stable updates.</p>
</fieldset>

<del>
<h3> Intro </h3>
<p>Since Google Chrome extensions is ready (currently for dev channel), you could install this extension and press <strong>"CTRL + SHIFT + D"</strong> to bookmark all tabs in the current window. The reason why I picked that keyboard shortcut combo, is simply because "CTRL + D" bookmarks one tab, hence adding a Shift will bookmark all tabs which is a proper gesture (similar to Firefox).</p>

<h3> Prerequisites </h3>
<p>In order to use "any" Google Extension, currently, you need to subscribe to the dev channel. Google Chrome releases updates to different release channels. Subscribing to the Beta or Dev channel means you'll get more frequent (but less stable) updates and you'll get to try new features first. Google Chrome Extensions are only available in the dev channel! <em><a href="http://dev.chromium.org/getting-involved/dev-channel" target="_blank">Subscribe now!</a></em></p>

<h3> How to install "Bookmark all tabs" extension</h3>
<p>You simply just click on the link below. , after its complete, it will ask you to install it, choose yes!</p>
<div style="border: 1px dotted #ccc">
  <a href="http://mohamedmansour.com/chrome/extensions/bookmark_all_tabs/bookmark_all_tabs.crx" style="color:black">
    <img src="http://mohamedmansour.com/chrome/chrome-icon.png" alt="Install Bookmark all tabs Extension" style="float:left"/>
    <p>
      <strong>Install Extension</strong><br />
      Bookmark all tabs
    </p>
  </a>
</div>
<h3> Conclusion </h3>
<p>This feature has been requested by many users, and it works perfectly (I hope so) as an Google Extension. The source code is available in my <a href="http://github.com/mohamedmansour/chrome-extensions/tree/master/bookmark_all_tabs/" target="_blank">git repository</a>.</p>

<p>If you have any suggestions, or improvements, please let me know (comment down), and the extension will auto update in the future. </p>

<p>Happy bookmarking!</p>
</del>]]></description>
		<pubDate>Fri, 02 Oct 2009 21:49:58 -0400</pubDate>
		<guid>http://www.m0interactive.com/archives/2009/10/02/google_chrome_bookmark_all_tabs_extension.html</guid>
	</item>
	<item>
		<title>Software - I just contributed my 100th patch to Google Chrome today</title>
		<link>http://www.m0interactive.com/archives/2009/09/12/i_just_contributed_my_100th_patch_to_google_chrome_today.html</link>
		<description><![CDATA[<p>Chromium is an open source browser that Google created. As an external contributor, I have been contributing patches in some of my spare time. As the second external contributor to Chome, Google gave me committer access to the project which is awesome. </p>

<p>I only had 22 patches committed for me by Google employees within the first 6 months of contributing to Google Chrome, but after they granted me committer access in June 2009, it seemed my productivity increased. It actually quadrupled the amount of fixes/features going into Google Chrome. I ask myself why? A simple answer, I love what I am doing. Every code snippet I write, every review I comment, will affect a browser that many people will use. That amount of responsibility, is awesome to have.</p>

<img src="http://i34.tinypic.com/254wpxx.png" />

<p>I don't know why the amount of patches I am doing is increasing, maybe because its a nice feeling working on a product that millions of people use. I am learning a lot from the Googlers more than I have ever learned before. By being part of the Chromium team, and being surrounded by one of the most talented group people in the world, has made me a better Software Engineer. I am learning so much from that group, it is unbelievable.</p>

<p>Prior to fixing my first bug in chrome, I didn't know any C++, python, Linux Gtk, C++/python testing, software engineering processes, etc. The extensive code review process and live peer mentoring is what's awesome in this project. Google is so open in their processes, it is nice to learn from them. </p>

<p>Since now I submitted my 100th patch, I have learned C++, Python, Gtk+, Git, gdb, testing frameworks, accessibility, software processes, code style, best engineering practices in the languages, and gained many awesome friends. I just want to thank the Chromium community and Google for allowing me be in this awesome open source project, and I haven't seen a software project in my life that they give so much heart into. They argue about everything, such as, quality, performance, every single pixel that gets added to any ui, etc...</p>

<p>If only I have more time to work on Chromium, I would have submitted 1000 patches! I highly recommend any software developer to contribute to chromium. You will not only learn from the brightest engineers in the world, you will be part of a community that cares about the software they are developing. As well, you will be part of a project that will change the way we look at the Internet. How cool is that? </p>

]]></description>
		<pubDate>Sat, 12 Sep 2009 00:08:07 -0400</pubDate>
		<guid>http://www.m0interactive.com/archives/2009/09/12/i_just_contributed_my_100th_patch_to_google_chrome_today.html</guid>
	</item>
	<item>
		<title>Software - Cannot open include files for ATL t2embapi.h while having VS2008 installed</title>
		<link>http://www.m0interactive.com/archives/2009/08/03/cannot_open_include_files_for_atl_t2embapi_h_while_having_vs2008_installed.html</link>
		<description><![CDATA[<p>I had trouble this morning trying to figure out why Chromium wont compile, it turned out to be that my installation of Visual Studio Express C++ messed up my configuration! So if you have installed Visual Studio 2008 (VS 2008), and while compiling your C++ Windows application you see an unusual error like the following, don't panic, its an easy fix!</p>
<pre>
fatal error C1083: Cannot open include file: 't2embapi.h': No such file or directory
</pre>

<h3>What does it mean?</h3>
<p>Basically, its informing you that it cannot find the specified file "t2embapi.h" while compiling your application. There are two reasons why this might be happen:</p>
<ul>
<li>You have not installed the latest Windows SDK (currently it is <del><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e6e1c3df-a74f-4207-8586-711ebe331cdc&DisplayLang=en">Windows SDK 6.1</a></del> <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505&displaylang=en">Windows SDK 7</a> )</li>
<li>You are not targeting the correct Windows SDK. Still targetting 6.0A (which is the default version) but you already installed the above 6.1 or 7.0)</li>
</ul>

<h3>How to target the right SDK.</h3>
<p>Some reasons why it wont target the correct Windows SDK is because you have simply installed an application that overwrote that. For example, you have installed VS2008 PRO first, but then installed VS2008 C++ Express. All Windows Express suit, do not support ATL so it is using the default paths of 6.0A. It overwrites all the default registry and uses the old registry which it doesn't have those include files.</p>

<h3>How to fix, the correct way!</h3>
<p>Basically, you would have to revert your registry settings to point it back to Windows SDK <del>6.1</del> 7.0. To do so, open up "regedit" and find this key:</p>
<pre>
HKEY_CURRENT_USER\Software\Microsoft\Microsoft SDKs\Windows\CurrentVersion = v7.0
HKEY_CURRENT_USER\Software\Microsoft\Microsoft SDKs\Windows\CurrentInstallFolder = C:\Program Files\Microsoft SDKs\Windows\v7.0\
</pre>

<p>Similar to this screenshot:</p>
<a href="http://i29.tinypic.com/2dslmwz.png">
<img src="http://i26.tinypic.com/1zn6hom.png" alt="CurrentInstallFolder and CurrentVersion"/></a>

<p>I hope this helped anyone out there!</p>

]]></description>
		<pubDate>Mon, 03 Aug 2009 17:18:23 -0400</pubDate>
		<guid>http://www.m0interactive.com/archives/2009/08/03/cannot_open_include_files_for_atl_t2embapi_h_while_having_vs2008_installed.html</guid>
	</item>
	<item>
		<title>Software - How to read and write from linux ext3 partition in windows</title>
		<link>http://www.m0interactive.com/archives/2009/05/24/how_to_read_and_write_from_linux_ext3_partition_in_windows.html</link>
		<description><![CDATA[<p>As a Software Engineer, I like to experiment many languages and operating systems. That is why I duel boot Linux (Ubuntu), Windows (XP), and an Apple Laptop (OSX). When I am working with Chromium (Open source browser for Google Chrome), I would like to access my ext3 Linux partition from Windows so I could work on the same code base. I will discuss which solutions I found working and efficient.</p>

<p>As far as I know, I heard of two softwares which allows an ext2 file system driver for winnt/win2k/winxp.</p>
<ol>
<li>Ext2-IFS - <a href="http://www.fs-driver.org/">http://www.fs-driver.org/</a></li>
<li>Ext2Fsd - <a href="http://ext2fsd.sourceforge.net/projects/projects.htm#ext2fsd">http://ext2fsd.sourceforge.net/projects/projects.htm#ext2fsd</a></li>
</ol>

<p>They are both file system drivers which are pure kernel mode, that extends the Windows operating system to include the Ext2 file system.</p>

<p>Ext2-IFS has a superb user interface to it, and I love UIs! While Ext2Fsd has more adminstrations. I tried both, but Ext2-IFS didn't work for me for some reason, it kept on saying "The disk in drive ? is not formatted. Do you want to format it now?" I really wanted it to work, but Ext2Fsd worked flawlessly after a restart. </p>

<p>Now I have my Linux-Windows bridge connected :)</p>]]></description>
		<pubDate>Sun, 24 May 2009 02:51:24 -0400</pubDate>
		<guid>http://www.m0interactive.com/archives/2009/05/24/how_to_read_and_write_from_linux_ext3_partition_in_windows.html</guid>
	</item>
	<item>
		<title>Java - Google App Engine Plugin for Eclipse in Ubuntu</title>
		<link>http://www.m0interactive.com/archives/2009/05/13/google_app_engine_plugin_for_eclipse_in_ubuntu.html</link>
		<description><![CDATA[<p>Installing Google Plugin for Eclipse in Ubuntu should be easy, but it requires some work to make it actually "work". I am using Ubuntu 9.04 Jaunty which got released this month.</p>

<h3>Installing latest Eclipse version in Ubuntu</h3>
<p>First of all, Ubuntu 9.04 ships with Eclipse 3.2.2 IDE, to run Google Plugin, it requires you to have at least an Eclipse 3.3 version. I installed the latest, 3.4 Eclipse IDE.</p>

<p>To do that, I did not use the Ubuntu synaptic repository, I just visited <a href="http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a> and downloaded "Eclipse IDE for Java Developers". I extracted it and then ran eclipse. Now I have the latest version of Eclipse installed. (Eclipse 3.4.2 on Ubuntu Jaunty)</p>

<h3>Installing the plugin</h3>
<p>I followed the following documentation <a href="http://code.google.com/eclipse/docs/install-eclipse-3.4.html"> http://code.google.com/eclipse/docs/install-eclipse-3.4.html</a>, since I am familiar with installing Eclipse plugins, I added <strong>http://dl.google.com/eclipse/plugin/3.4</strong> as a Site to my available software under Help > Software Updates.</p>

<h3>Running a Google Web Applicaiton</h3>
<p>To create your first Web Application, select <strong>File > New > Web Application Project</strong> from the Eclipse menu.</p>

<p>In the <strong>New Web Application Project</strong> wizard, enter a name for your project and a java package name, e.g., com.example.mywebapp. Click <strong>Finish</strong>.</p>

<p>You now have an App Engine and GWT-enabled web application!</p> 

<h3>How to run your application! (And fix the initial error!)</h3>
<p>Right-click on your web application project and select <strong>Debug As > Web Application</strong> from the popup menu. Oh wait, an error occurs: </p>

<pre>
ubuntu java.lang.UnsatisfiedLinkError: ubuntu java.lang.UnsatisfiedLinkError: com.google.gwt.eclipse.sdkbundle.linux_1.6.4.v200904062334/gwt-linux-1.6.4/mozilla-1.7.12/libxpcom.so: libstdc++.so.5: cannot open shared object file: No such file or directory
</pre>

<p>The reason why this error exists is because in order to run a Google Web Application, we need libstdc++5, you could install it within your Synaptic Package manager or via aptitude:</p>
<pre>
sudo apt-get install libstdc++5
</pre>

<p>Run it again, and it will work fine!</p>

<p>Have fun programming! Java on App Engine!</p>]]></description>
		<pubDate>Wed, 13 May 2009 19:36:24 -0400</pubDate>
		<guid>http://www.m0interactive.com/archives/2009/05/13/google_app_engine_plugin_for_eclipse_in_ubuntu.html</guid>
	</item>
	<item>
		<title>Java - How to get the list of files in a directory inside a JAR file</title>
		<link>http://www.m0interactive.com/archives/2009/04/29/how_to_get_the_list_of_files_in_a_directory_inside_a_jar_file.html</link>
		<description><![CDATA[<p>A Java snippet for the day. You cannot simply use a "File" object to grab a list of files from a directory within a JAR file. You would need to iterate through the JAR entries, one by one, (unless I am mistaken). With this approach, you can quickly supply some sort of regex filter, that will return a list of file paths for what your searching.</p>

<h2>Code</h2>
<pre>
    /**
     * <p>Retrieve a list of filepaths from a given directory within a jar
     * file. If filtered results are needed, you can supply a |filter| 
     * regular expression which will match each entry. 
     *
     * @param filter to filter the results within a regular expression.
     * @return a list of files within the jar |file|
     */
    public static List<String> getJarFileListing(String file, String filter) {
        List<String> files = new ArrayList<String>();
        if (jarLocation == null) {
            return files; // Empty.
        }
        
        // Lets stream the jar file 
        JarInputStream jarInputStream = null;
        try {
            jarInputStream = new JarInputStream(new FileInputStream(jarLocation));
            JarEntry jarEntry;
            
            // Iterate the jar entries within that jar. Then make sure it follows the
            // filter given from the user.
            do {
                jarEntry = jarInputStream.getNextJarEntry();
                if (jarEntry != null) {
                    String fileName = jarEntry.getName();

                    // The filter could be null or has a matching regular expression.
                    if (filter == null || fileName.matches(filter)) {
                        files.add(fileName);
                    }
                }
            }
            while (jarEntry != null);
            jarInputStream.close();
        }
        catch (IOException ioe) {
            throw new RuntimeException("Unable to get Jar input stream from '" + jarLocation + "'", ioe);
        }
        return files;
    }
</pre>

<h2>Examples</h2>
 <p>a) Find all files under /com/:</p>
 <pre>
List<String> files = getJarFileListing("file.jar", "^com/(.*)")
 </pre> 

<p>a) Find all files under /template/ that has a .tpl extension:</p>
 <pre>
List<String> files = getJarFileListing("file.jar", "^template/(.*).tpl$")
 </pre> ]]></description>
		<pubDate>Wed, 29 Apr 2009 13:33:31 -0400</pubDate>
		<guid>http://www.m0interactive.com/archives/2009/04/29/how_to_get_the_list_of_files_in_a_directory_inside_a_jar_file.html</guid>
	</item>
	<item>
		<title>Software - Quick way searching comments from svn using bash script</title>
		<link>http://www.m0interactive.com/archives/2009/04/23/quick_way_searching_comments_from_svn_using_bash_script.html</link>
		<description><![CDATA[<p>As far as I know, there is no mechanism to search "svn log" for a specific comment. Sure you can do "svn log | grep Mohamed", but that will just give you the line where that comment was found. I wanted more information, such as revision number.</p>

<p>So I created a very simple script (there are a gazillion other ways to do it), that you give it a regular expression as argument (quoted of course). And it will search svn's log quickly using bash. Just save the contents below to a file, and let it run!</p>

<pre>
#!/bin/sh
SEARCH=$1
echo "Searching for ["$SEARCH"]"
svn log | awk '{
  if ( $1 == "------------------------------------------------------------------------") {
    getline
    REVISION = $1
    COMITTER = $3
    DATE = $5
    LINES = $13
  }
  else {
    if (match($0, SEARCH)) {
      TOTAL=TOTAL+1
      print "-[",TOTAL,"]------------------"
      print " Revision: ", REVISION
      print " Comitter: ", COMITTER
      print " Date: ", DATE
      print " Lines Changed: ", LINES
    }
  }

}' SEARCH="$SEARCH"
</pre>

<p>After you save that script and run it, (make sure you chmod +x) you will see a pretty view of what you have searched within the comments. For example: </p>

<pre>
$ ./svnsearch.sh "Mohamed"
Searching for [Mohamed]
-[ 1 ]------------------
 Revision:  r13831
 Comitter:  hbono@chromium.org
 Date:  2009-04-16
 Lines Changed:  15
-[ 2 ]------------------
 Revision:  r13616
 Comitter:  tc@google.com
 Date:  2009-04-13
 Lines Changed:  28
-[ 3 ]------------------
 Revision:  r13426
 Comitter:  maruel@chromium.org
 Date:  2009-04-09
 Lines Changed:  52

...
...
</pre>

<p>Enjoy! If you have any updated version, I would love to see how you improved it!</p>]]></description>
		<pubDate>Thu, 23 Apr 2009 01:20:28 -0400</pubDate>
		<guid>http://www.m0interactive.com/archives/2009/04/23/quick_way_searching_comments_from_svn_using_bash_script.html</guid>
	</item>
</channel>
</rss><!-- m0|XML Creator v1 -->
