<?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-18690850</id><updated>2012-01-20T03:59:43.642-08:00</updated><category term='google app engine'/><category term='ontologies'/><category term='dow'/><category term='javascript'/><category term='perl'/><category term='AJAX'/><category term='shopping'/><category term='investments'/><category term='maven'/><category term='gold'/><category term='tomcat'/><category term='dvd'/><category term='freebase'/><category term='css'/><category term='python'/><category term='jetty'/><category term='userscripts'/><category term='codec'/><category term='windows'/><category term='eclipse'/><category term='OWL'/><category term='covered'/><category term='dos'/><category term='naked'/><category term='eCID'/><category term='solaris'/><category term='greasemonkey'/><category term='hardware'/><category term='linux'/><category term='apache'/><category term='scripting'/><category term='java'/><category term='semaphores'/><category term='php'/><category term='enhanced caller id'/><category term='XML'/><category term='calls'/><category term='titanium'/><category term='computers'/><category term='gaming'/><category term='options'/><category term='android'/><category term='shared memory'/><category term='equities'/><category term='unix'/><category term='administration'/><category term='log'/><category term='digital copy protection'/><category term='webapp'/><category term='puts'/><category term='svn'/><category term='subversion'/><category term='google'/><title type='text'>off the blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>44</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-18690850.post-3440938028925054013</id><published>2011-12-22T21:26:00.000-08:00</published><updated>2011-12-22T21:26:48.435-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='titanium'/><title type='text'>Titanium Image Gallery</title><content type='html'>Creating an Image Gallery that scrolls side to side isn't terribly difficult with Titanium.&lt;br /&gt;&lt;br /&gt;Here is how I did it:&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;// put this in a file, for instance "ImageGallery.js"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;var ImageGallery = {};&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;(function() {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ImageGallery.imageViewArray = [];&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ImageGallery.imageNameArray = [];&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ImageGallery.nextImageIndex;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ImageGallery.Gallery = null;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ImageGallery.createGallery = function(params) {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if (params.Images) {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ImageGallery.imageNameArray = params.Images;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ImageGallery.init(params);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ImageGallery.Gallery.addEventListener('click', function(e){});&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for(var i = 0; i &amp;lt; ImageGallery.imageNameArray.length ; i++){&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ImageGallery.Gallery.views[i].image = ImageGallery.imageNameArray[i];&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ImageGallery.nextImageIndex = 1;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return ImageGallery.Gallery;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ImageGallery.init = function(params) {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; var imageParams = {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; width:Ti.Platform.displayCaps.platformWidth - 4,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; height:Ti.Platform.displayCaps.platformHeight/2,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; hires:true,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; left:2,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; right:2&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for(var i = 0; i &amp;lt; ImageGallery.imageNameArray.length ; i++){&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ImageGallery.imageViewArray[i] = Titanium.UI.createImageView(imageParams);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; var p = {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; width: 310,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; height: 450,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; top: 5,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; left: 5,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; borderWidth: 2,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; borderColor: '#000',&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; showPagingControl: false,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; pagingControlColor: '#fff',&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; currentpage:0&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for (var prop in params) {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; p[prop] = params[prop];&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; p.views = ImageGallery.imageViewArray;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; p.backgroundColor = "#000";&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ImageGallery.Gallery = Titanium.UI.createScrollableView(p);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;})();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;Assuming that you include the file above in your view, you then can use it like so:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: xx-small;"&gt;var gallery = ImageGallery.createGallery(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: xx-small;"&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; // here images is an array of image URLs&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Images:images, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; width:Ti.Platform.displayCaps.platformWidth,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; height:Ti.Platform.displayCaps.platformHeight/2,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; top:null,left:null&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What do you think?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-3440938028925054013?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/3440938028925054013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=3440938028925054013' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/3440938028925054013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/3440938028925054013'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2011/12/titanium-image-gallery.html' title='Titanium Image Gallery'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-1996963110324958035</id><published>2011-11-03T07:17:00.000-07:00</published><updated>2011-11-03T07:17:40.970-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='log'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><title type='text'>PHP and writing to Apache logs</title><content type='html'>Printing to STDERR is quite easy, once you figure it out!&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;file_put_contents('php://stderr', print_r($your_string, TRUE));&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Of course, you can also replace '&lt;i&gt;&lt;b&gt;stderr&lt;/b&gt;&lt;/i&gt;' with '&lt;i&gt;&lt;b&gt;stdout&lt;/b&gt;&lt;/i&gt;'.&lt;br /&gt;&lt;br /&gt;You could also use &lt;i&gt;&lt;b&gt;&lt;a href="http://php.net/manual/en/function.error-log.php" target="_blank"&gt;error_log&lt;/a&gt; &lt;/b&gt;&lt;/i&gt;but it truncates long strings ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-1996963110324958035?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/1996963110324958035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=1996963110324958035' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/1996963110324958035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/1996963110324958035'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2011/11/php-and-writing-to-apache-logs.html' title='PHP and writing to Apache logs'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-1256823865687736787</id><published>2011-07-16T12:16:00.000-07:00</published><updated>2011-12-31T09:12:46.293-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android App Piracy</title><content type='html'>As you may know, I have a bunch of apps on the Android market. Recently, I have been fielding questions from users that have had problems with my app. Turns out their contacts were being deleted. Their contacts were receiving lewd photos and messages.&lt;br /&gt;&lt;br /&gt;After some digging around, it became clear that they downloaded pirated versions of my apps. Aside from feeling glad that people too cheap to buy something that costs the same as a bag of chips and a soda got what was coming to them, I was inclined to post a message about piracy on my apps &lt;a href="http://www.enhancedsmscallerid.com/home/faq/piracy" target="_blank"&gt;home page&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Basically, the gist of what I posted is this:&lt;br /&gt;&lt;br /&gt;Would you openly give all of the data on your phone to a third party that you did not know or trust? By downloading applications from sources where the original author did not intend to publish them, you are doing just that.&lt;br /&gt;&lt;br /&gt;Most paid applications on the market implement some form of weak licensing that Google endorses. Unfortunately, this&lt;a href="http://www.androidpolice.com/2010/08/23/exclusive-report-googles-android-market-license-verification-easily-circumvented-will-not-stop-pirates/" target="_blank"&gt; licensing is very easy to beat&lt;/a&gt;. In order to beat it, pirates must add their own bits of source code to apps.&lt;br /&gt;&lt;br /&gt;So ask yourself, what would stop them from injecting more code, to say, read all of your contacts and send them to a third party? Or, reading your banking details? &lt;br /&gt;&lt;br /&gt;Some will read this post and assume that I am just trying to protect my interests. Well, of course I am. But understand, my claims are real:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.androidpolice.com/2011/03/01/the-mother-of-all-android-malware-has-arrived-stolen-apps-released-to-the-market-that-root-your-phone-steal-your-data-and-open-backdoor/" target="_blank"&gt;Example 1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.pcworld.com/article/229263/google_clearing_up_more_android_malware.html" target="_blank"&gt;Example 2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.wired.com/gadgetlab/2011/06/android-malware-angry-birds/" target="_blank"&gt;Example 3 (with angry birds ...)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://news.cnet.com/8301-27080_3-20078606-245/more-malware-targeting-android/" target="_blank"&gt;Example 4&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;The list could go on and on ... Basically, they all say the same thing; Download applications from sources that you trust (Android Market, App Store, etc) and not pirate web sites.&lt;br /&gt;&lt;br /&gt;In the end, is the couple of bucks you save worth all of the headache of having your information stolen, your accounts hacked and your life turned upside down?&lt;br /&gt;&lt;br /&gt;A little bit of brain goes a long way.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-1256823865687736787?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.enhancedsmscallerid.com/home/faq/piracy' title='Android App Piracy'/><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/1256823865687736787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=1256823865687736787' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/1256823865687736787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/1256823865687736787'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2011/07/app-piracy.html' title='Android App Piracy'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-1120721985354480505</id><published>2011-01-06T12:26:00.000-08:00</published><updated>2011-01-06T12:26:21.359-08:00</updated><title type='text'>ServletContextListener: reading init parameters</title><content type='html'>Previously, I showed you how to&lt;a href="http://ekawas.blogspot.com/2006/10/scheduling-ongoing-task-in-servlet.html"&gt; schedule an ongoing task with servlets&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Recently, I   needed a way to set the location of a configurable properties file for   my web application. This location was to be used by each Servlet/JSP in   my web application. You could add an init-param to each servlet   declaration, like it is explained &lt;a href="http://www.exampledepot.com/egs/javax.servlet/GetInit.html"&gt;here&lt;/a&gt;.   But why do this if each servlet is going to have the same value?&lt;br /&gt;&lt;br /&gt;The   better choice is to declare this parameter once and have it read when   the web application is loaded by the servlet engine.&lt;br /&gt;&lt;br /&gt;To   do this, you need to once again implement the interface for   ServletContextListener,&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;i&gt;&lt;b&gt;public   class MyServletContextListener &lt;br /&gt;&amp;nbsp;&amp;nbsp; implements   javax.servlet.ServletContextListener&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/blockquote&gt;This   interface requires you to provide an implemention for&lt;br /&gt;&lt;ul style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;li&gt;&lt;span style="font-size: x-small;"&gt;&lt;i&gt;&lt;b&gt;public void   contextDestroyed(ServletContextEvent sce)&lt;/b&gt;&lt;/i&gt;, &lt;span style="font-size: small;"&gt;and&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: x-small;"&gt;&lt;i&gt;&lt;b&gt;public void contextInitialized(ServletContextEvent sce)&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;Before   we get to the implementation for our listener, let's add a context   parameter to our web application. This is the 'global' variable our   servlets and JSP pages are interested in!&lt;br /&gt;If you open &lt;i&gt;&lt;b&gt;web.xml&lt;/b&gt;&lt;/i&gt; and add something like the following as a direct child element of the &lt;i&gt;&lt;b&gt;&amp;lt;web-app&amp;gt;&lt;/b&gt;&lt;/i&gt; element,&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size: x-small;"&gt;&lt;i style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;lt;context-param&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;     &amp;lt;param-name&amp;gt;some   parameter&amp;lt;/param-name&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;param-value&amp;gt;some parameter value&amp;lt;/param-value&amp;gt;&lt;br /&gt;&amp;lt;/context-param&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;And   while we have the &lt;i&gt;&lt;b&gt;web.xml&lt;/b&gt;&lt;/i&gt; open, we will declare our   listener (right below our &lt;i&gt;&lt;b&gt;&amp;lt;context-param&amp;gt;&lt;/b&gt;&lt;/i&gt; declaration):&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;"&gt;&lt;i&gt;&amp;lt;listener&amp;gt;     &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;     &amp;lt;listener-class&amp;gt;&lt;/i&gt;&lt;i&gt;your.package.path.MyServletContextListener&lt;/i&gt;&lt;i&gt;&amp;nbsp; &amp;lt;/listener-class&amp;gt;     &amp;nbsp; &lt;br /&gt;&amp;lt;/listener&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;Having   declared our listener and a context parameter, our &lt;i&gt;&lt;b&gt;contextInitialized()&lt;/b&gt;&lt;/i&gt; will look something like:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;i&gt;public   void contextInitialized(ServletContextEvent sce) { &lt;br /&gt;&amp;nbsp; ServletContext c = sce.getServletContext();&lt;br /&gt;&amp;nbsp; if (c != null) {  &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if   (c.getInitParameter(  "some paramter") != null) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c.setAttribute(   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "some parameter",&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c.getInitParameter(  "some parameter")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );   &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }  &amp;nbsp; &lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;When   the servlet container unloads our web application, we need to clean up   after ourselves (not 100% that this is necessary, but it is still a good   practice):&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;i&gt;public   void contextDestroyed(ServletContextEvent sce) {&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;"&gt;&lt;i&gt;&amp;nbsp; ServletContext c = sce.getServletContext();&lt;br /&gt;&amp;nbsp; if   (c.getAttribute("some parameter") != null) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c.removeAttribute(    "some parameter");&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;Now,   these attributes are available for each of our individual servlets by   calling &lt;i&gt;&lt;b&gt;getServletContext().getAttribute("some   parameter")&lt;/b&gt;&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;Nothing to it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-1120721985354480505?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/1120721985354480505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=1120721985354480505' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/1120721985354480505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/1120721985354480505'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2011/01/servletcontextlistener-reading-init.html' title='ServletContextListener: reading init parameters'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-3183381512286662369</id><published>2010-05-06T07:33:00.000-07:00</published><updated>2010-05-06T07:33:35.414-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>Finding all JAVA imports in a Specified Directory (&amp; sub-directories)</title><content type='html'>Here is a little (Li | U)nix command line script that looks through a given directory and extracts all of the JAVA import statements, sorts them and then prints them to STDOUT.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt;find ./someJavaDir/ -type f -name '*.java' \&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt;-exec grep '^import .*$' '{}' \; | \&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; text-align: left;"&gt;&lt;span style="font-size: x-small;"&gt; sort | uniq | sort | awk '/import/ {print $2 }'&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;Basically, replace ./someJAVADir/ with the actual directory that you would like to search for JAVA imports.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-3183381512286662369?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/3183381512286662369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=3183381512286662369' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/3183381512286662369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/3183381512286662369'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2010/05/finding-all-java-imports-in-specified.html' title='Finding all JAVA imports in a Specified Directory (&amp; sub-directories)'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-2965895490541333251</id><published>2010-05-01T06:26:00.000-07:00</published><updated>2011-01-06T09:57:01.478-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='enhanced caller id'/><category scheme='http://www.blogger.com/atom/ns#' term='eCID'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>eCID - Android App</title><content type='html'>&lt;b&gt;Please go to our new site: &lt;a href="http://www.enhancedsmscallerid.com/"&gt;http://www.enhancedsmscallerid.com/&lt;/a&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-2965895490541333251?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/2965895490541333251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=2965895490541333251' title='37 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/2965895490541333251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/2965895490541333251'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2010/05/ecid-android-app.html' title='eCID - Android App'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>37</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-6430896673704107679</id><published>2010-04-27T08:30:00.000-07:00</published><updated>2010-04-27T08:30:10.013-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Getting rid of empty XML elements using XML::Simple</title><content type='html'>&lt;h2&gt;&lt;/h2&gt;Sometimes it is necessary to remove empty XML elements from XML documents (need a condensed message, etc) and doing so can be a difficult task to achieve! Well, here comes XML::Simple to the rescue...&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;#!/usr/bin/perl -w&lt;br /&gt;use strict;&lt;br /&gt;use XML::Simple;&lt;br /&gt;use Data::Dumper;&lt;br /&gt;my $xml = &amp;lt;&amp;lt;EOF;&lt;br /&gt;&amp;lt;fullletter&amp;gt;&lt;br /&gt;&amp;lt;CASE_EPIS&amp;gt;00036&amp;lt;/CASE_EPIS&amp;gt;&lt;br /&gt;   &amp;lt;letter&amp;gt;&lt;br /&gt;      &amp;lt;IMAGENAME&amp;gt;02_20100423124541&amp;lt;/IMAGENAME&amp;gt;&lt;br /&gt;      &amp;lt;RUNDATE&amp;gt;2010-04-23 12:04:41&amp;lt;/RUNDATE&amp;gt;&lt;br /&gt;       &amp;lt;LETTERTYPE&amp;gt;LOI2&amp;lt;/LETTERTYPE&amp;gt;&lt;br /&gt;   &amp;lt;/letter&amp;gt;&lt;br /&gt;    &amp;lt;service&amp;gt; &amp;lt;/service&amp;gt;&lt;br /&gt;       &amp;lt;service&amp;gt;&lt;br /&gt;           &amp;lt;NTV_SEQUENCE&amp;gt;26&amp;lt;/NTV_SEQUENCE&amp;gt;&lt;br /&gt;           &amp;lt;NTV_DISPLAY_VALUE&amp;gt;Need start date &amp;lt;/NTV_DISPLAY_VALUE&amp;gt;&lt;br /&gt;      &amp;lt;/service&amp;gt;&lt;br /&gt;       &amp;lt;service&amp;gt; &amp;lt;/service&amp;gt;&lt;br /&gt;&amp;lt;/fullletter&amp;gt;&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;# use XML simple to process the XML&lt;br /&gt;my $xs = XML::Simple-&amp;gt;new(&lt;br /&gt;&lt;br /&gt;      # remove extra whitespace&lt;br /&gt;      NormaliseSpace =&amp;gt; 2,&lt;br /&gt;      # keep root element&lt;br /&gt;      KeepRoot       =&amp;gt; 1,&lt;br /&gt;      # force elements to arrays&lt;br /&gt;      ForceArray     =&amp;gt; 1,&lt;br /&gt;      # ignore empty elements&lt;br /&gt;      SuppressEmpty  =&amp;gt; 1&lt;br /&gt;);&lt;br /&gt;# read in the XML&lt;br /&gt;my $ref = $xs-&amp;gt;XMLin($xml);&lt;br /&gt;&lt;br /&gt;# print out the data structure&lt;br /&gt;# shows you how to access the data&lt;br /&gt;print Dumper($ref);&lt;br /&gt;&lt;br /&gt;# print out the XML minus the empty tags&lt;br /&gt;print $xs-&amp;gt;XMLout($ref);&lt;/pre&gt;&lt;/blockquote&gt;Running this sample code then produces (minus the Data::Dumper text):&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;fullletter&amp;gt;&lt;br /&gt;  &amp;lt;CASE_EPIS&amp;gt;00036&amp;lt;/CASE_EPIS&amp;gt;&lt;br /&gt;  &amp;lt;letter&amp;gt;&lt;br /&gt;    &amp;lt;IMAGENAME&amp;gt;02_20100423124541&amp;lt;/IMAGENAME&amp;gt;&lt;br /&gt;    &amp;lt;LETTERTYPE&amp;gt;LOI2&amp;lt;/LETTERTYPE&amp;gt;&lt;br /&gt;    &amp;lt;RUNDATE&amp;gt;2010-04-23 12:04:41&amp;lt;/RUNDATE&amp;gt;&lt;br /&gt;  &amp;lt;/letter&amp;gt;&lt;br /&gt;  &amp;lt;service&amp;gt;&lt;br /&gt;    &amp;lt;NTV_DISPLAY_VALUE&amp;gt;Need start date&amp;lt;/NTV_DISPLAY_VALUE&amp;gt;&lt;br /&gt;    &amp;lt;NTV_SEQUENCE&amp;gt;26&amp;lt;/NTV_SEQUENCE&amp;gt;&lt;br /&gt;  &amp;lt;/service&amp;gt;&lt;br /&gt;&amp;lt;/fullletter&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-6430896673704107679?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/6430896673704107679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=6430896673704107679' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/6430896673704107679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/6430896673704107679'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2010/04/getting-rid-of-empty-xml-elements-using.html' title='Getting rid of empty XML elements using XML::Simple'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-2893296523525933603</id><published>2010-02-16T06:50:00.000-08:00</published><updated>2010-02-16T10:08:32.361-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='computers'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><title type='text'>Firefox (64 bit)</title><content type='html'>Just a quick note for those of you wanting a 64bit version of Firefox!&lt;br /&gt;&lt;br /&gt;You can obtain a 64bit version &lt;a href="http://wiki.mozilla-x86-64.com/Firefox:Download" target="_blank"&gt;here&lt;/a&gt;! For those of you that are daring, download and install &lt;b&gt;Firefox.next&lt;/b&gt; (&lt;i&gt;version is based on a time stamp&lt;/i&gt;).&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_8PosphSzLk0/S3rd4xeW_gI/AAAAAAAAADU/3cAbqN9hxfc/s1600-h/firefox_next.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="117" src="http://2.bp.blogspot.com/_8PosphSzLk0/S3rd4xeW_gI/AAAAAAAAADU/3cAbqN9hxfc/s320/firefox_next.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;For those wanting something that works, you should download a version after the list of files for &lt;b&gt;Firefox.next&lt;/b&gt; (e.g. &lt;i&gt;&lt;b&gt;Firefox 3.6&lt;/b&gt;&lt;/i&gt; below).&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_8PosphSzLk0/S3reBmPXshI/AAAAAAAAADc/gEpuVbJcpOM/s1600-h/firefox_stable.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="152" src="http://2.bp.blogspot.com/_8PosphSzLk0/S3reBmPXshI/AAAAAAAAADc/gEpuVbJcpOM/s320/firefox_stable.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;JAVA is available (and more stable from what I can tell) in 64bit flavors and I would recommend installing a 64bit version after installing a 64 bit version of Firefox&lt;br /&gt;Note that Flash is not available for 64 bit browsers yet (unless you are on &lt;a href="http://labs.adobe.com/technologies/flashplayer10/64bit.html" target="_blank"&gt;linux&lt;/a&gt;).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-2893296523525933603?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://wiki.mozilla-x86-64.com/Firefox:Download' title='Firefox (64 bit)'/><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/2893296523525933603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=2893296523525933603' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/2893296523525933603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/2893296523525933603'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2010/02/firefox-64-bit.html' title='Firefox (64 bit)'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_8PosphSzLk0/S3rd4xeW_gI/AAAAAAAAADU/3cAbqN9hxfc/s72-c/firefox_next.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-6353983787080110614</id><published>2010-01-28T06:17:00.000-08:00</published><updated>2010-01-28T06:17:23.569-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Posting to Blogger from Perl</title><content type='html'>&lt;p&gt;Here is a little snippet that allows you to post to your Blogger blog from Perl:&lt;/p&gt;&lt;pre&gt;use Net::SMTP::TLS;&lt;br /&gt;my $mailer = new Net::SMTP::TLS(&lt;br /&gt;    &amp;#39;smtp.gmail.com&amp;#39;,    # dont change&lt;br /&gt;    Hello    =&amp;gt; &amp;#39;smtp.gmail.com&amp;#39;,         # dont change&lt;br /&gt;    Port     =&amp;gt; 587,                      # dont change&lt;br /&gt;    User     =&amp;gt; &amp;#39;your.address@gmail.com&amp;#39;, # change to your username&lt;br /&gt;    Password =&amp;gt; &amp;#39;password&amp;#39;                # change to your password&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;# you email address associated with the blog&lt;br /&gt;$mailer-&amp;gt;mail(&amp;#39;your.address@gmail.com&amp;#39;);&lt;br /&gt;&lt;br /&gt;# the address to send the post to&lt;br /&gt;$mailer-&amp;gt;to(&amp;#39;blogid.secretword@blogger.com&amp;#39;);&lt;br /&gt;$mailer-&amp;gt;data;&lt;br /&gt;&lt;br /&gt;# blog post body&lt;br /&gt;$mailer-&amp;gt;datasend(&amp;quot;Subject: Title of my blog post\n\n&amp;quot;)&lt;br /&gt;  ;                                       # keep the trailing \n\n!&lt;br /&gt;$mailer-&amp;gt;datasend(&amp;quot;The text of my post here\n&amp;quot;);&lt;br /&gt;&lt;br /&gt;# end blog post&lt;br /&gt;$mailer-&amp;gt;dataend;&lt;br /&gt;$mailer-&amp;gt;quit;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Let me know how this works for you!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-6353983787080110614?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/6353983787080110614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=6353983787080110614' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/6353983787080110614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/6353983787080110614'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2010/01/posting-to-blogger-from-perl.html' title='Posting to Blogger from Perl'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-4189323612263727083</id><published>2010-01-14T07:01:00.000-08:00</published><updated>2010-01-14T07:02:59.868-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OWL'/><category scheme='http://www.blogger.com/atom/ns#' term='ontologies'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Mapping OWL ontologies into PERL</title><content type='html'>Unlike in &lt;a href="http://jastor.sourceforge.net/"&gt;JAVA&lt;/a&gt;, there doesn't exist a way in PERL to generate modules from Web Ontologies (&lt;a href="http://www.w3.org/2004/OWL/"&gt;OWL&lt;/a&gt;). Well, not until recently!&lt;br /&gt;&lt;br /&gt;As part of a bigger effort, the CPAN module, &lt;a href="http://search.cpan.org/dist/SADI/"&gt;SADI&lt;/a&gt;, contains a script for generating fully functional PERL modules from Web Ontologies. The script is called sadi-generate-datatypes.pl and is automatically installed along side the SADI module. Under the hood it is using RDF/OWL parsing code from &lt;a href="http://search.cpan.org/dist/PLUTO/"&gt;PLUTO &lt;/a&gt;(a module built on from a project from &lt;a href="http://ibm-slrp.sourceforge.net/"&gt;IBM&lt;/a&gt;&lt;a href="http://ibm-slrp.sourceforge.net/"&gt;&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&amp;nbsp;I wont go into the details for how to use this module here (there is ample documentation available on CPAN for this module). I would like to point the interested reader to the documentation for generating the Perl modules. Go to &lt;a href="http://search.cpan.org/dist/SADI/"&gt;http://search.cpan.org/dist/SADI/ &lt;/a&gt;and at the very bottom you will see under the &lt;i&gt;&lt;b&gt;"Other Files"&lt;/b&gt;&lt;/i&gt; header a link called &lt;i&gt;&lt;b&gt;doc/working_with_datatypes.html&lt;/b&gt;&lt;/i&gt;. That file should get you going.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-4189323612263727083?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://search.cpan.org/dist/SADI/' title='Mapping OWL ontologies into PERL'/><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/4189323612263727083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=4189323612263727083' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/4189323612263727083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/4189323612263727083'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2010/01/mapping-owl-ontologies-into-perl.html' title='Mapping OWL ontologies into PERL'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-5027950261268256254</id><published>2009-11-26T07:21:00.000-08:00</published><updated>2009-11-26T11:31:47.186-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shopping'/><title type='text'>Earning rebates when shopping online in Canada</title><content type='html'>As someone that enjoys shopping for things online, I thought that I would share a way for Canadian shoppers to earn rebates while shopping for items online.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.greatcanadianrebates.ca/register/107588/" target="_blank" title="Great Canadian Rebates"&gt;Great Canadian Rebates&lt;/a&gt; is a site that lists various online retailers and offers coupons/rebates (ranging from a flat amount of cash back, to 12%) on items that you buy from retailers that they list. The require you to sign up for an account and then to click through their site to shop the online retailer. With my account, I have received just under $70 back in under a year. They even give you a toonie ($2) for just signing up! &lt;br /&gt;&lt;br /&gt;I figure that since I buy stuff online, why not get a little something back!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-5027950261268256254?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/5027950261268256254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=5027950261268256254' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5027950261268256254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5027950261268256254'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2009/11/earning-rebates-when-shopping-online-in.html' title='Earning rebates when shopping online in Canada'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-8392968154247607850</id><published>2009-11-25T11:27:00.000-08:00</published><updated>2009-11-25T11:41:05.904-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='scripting'/><title type='text'>Perl script to exact packages from multi package Perl module</title><content type='html'>Here is a little script that I use to extract the individual modules from a multiple package Perl module.&lt;br /&gt;&lt;br /&gt;While the script works, it isn't perfect and if you have any comments, have an addendum, etc, please let me know!&lt;br /&gt;&lt;br /&gt;The script is below. Please make sure to edit &lt;span style="font-weight: bold; font-style: italic;"&gt;$file&lt;/span&gt;, the input file, and &lt;span style="font-weight: bold; font-style: italic;"&gt;$outdir&lt;/span&gt;, the destination directory. Good Luck.&lt;br /&gt;&lt;pre&gt;&lt;pre&gt;&lt;br /&gt;#!/usr/bin/perl -w&lt;br /&gt;use strict;&lt;br /&gt;use File::Spec;&lt;br /&gt;use File::Path qw(mkpath);&lt;br /&gt;my $file   = '/exact/path/to/perl/module.pm';&lt;br /&gt;my $outdir = '/tmp/';&lt;br /&gt;open(my $fh, '&amp;lt;', "$file") or die $!;&lt;br /&gt;my $contents = '';&lt;br /&gt;my $filename = undef;&lt;br /&gt;while (&amp;lt;$fh&amp;gt;) {&lt;br /&gt;       if ( $_ =~ /^package (.*);/g ) {&lt;br /&gt;&lt;br /&gt;               # construct a new file&lt;br /&gt;               $contents = '';&lt;br /&gt;&lt;br /&gt;               # its filename&lt;br /&gt;               $filename = File::Spec-&amp;gt;catfile( $outdir, split( /::/, $1 ) ) . '.pm';&lt;br /&gt;&lt;br /&gt;               # its contents&lt;br /&gt;               $contents .= $_;&lt;br /&gt;       } elsif ( $_ =~ /^1;/g ) {&lt;br /&gt;&lt;br /&gt;               # put the contents into $filename&lt;br /&gt;               $contents .= $_;&lt;br /&gt;               my ( $volume, $directories, $file ) = File::Spec-&amp;gt;splitpath($filename);&lt;br /&gt;&lt;br /&gt;               # make the path&lt;br /&gt;               mkpath(&lt;br /&gt;                                  $directories,&lt;br /&gt;                                  {&lt;br /&gt;                                         verbose =&amp;gt; 1,&lt;br /&gt;                                         mode    =&amp;gt; 0711,&lt;br /&gt;                                  }&lt;br /&gt;               );&lt;br /&gt;               do {&lt;br /&gt;                       open OUT, "&amp;gt;$filename" or die "Can't write to $filename: $!\n";&lt;br /&gt;                       print OUT $contents;&lt;br /&gt;                       close OUT;&lt;br /&gt;               } if $filename;&lt;br /&gt;       } else {&lt;br /&gt;               $contents .= $_;&lt;br /&gt;       }&lt;br /&gt;}&lt;br /&gt;close $fh;&lt;br /&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-8392968154247607850?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/8392968154247607850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=8392968154247607850' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/8392968154247607850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/8392968154247607850'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2009/11/perl-script-to-exact-packages-from.html' title='Perl script to exact packages from multi package Perl module'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-5817049979320089024</id><published>2009-10-12T06:34:00.000-07:00</published><updated>2009-10-13T12:51:49.239-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='greasemonkey'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='userscripts'/><category scheme='http://www.blogger.com/atom/ns#' term='scripting'/><title type='text'>Callback Functions - Scoping</title><content type='html'>According to &lt;a href="http://en.wikipedia.org/wiki/Callback_%28computer_science%29"&gt;Wikipedia&lt;/a&gt;, a callback function is  executable code that is passed as an argument to other code. It allows a lower-level software layer to call a subroutine (or function) defined in a higher-level layer.&lt;br /&gt;&lt;br /&gt;Callback functions are used very frequently in event driven software systems. Whenever an event happens, a function is called.&lt;br /&gt;&lt;br /&gt;The idea is simple, but many people tend to become confused when using these things. The problem that they encounter is that people tend to run into problems with the scope of variables that they are using.&lt;br /&gt;&lt;br /&gt;Part of the problem is remembering that the callback function may form a closure. When the callback function is executed, the scope consists of the callback function's code and references to any variables of the function containing the callback function reference. The converse is not true; the function containing the callback function reference cannot use the arguments and variables of the callback function.&lt;br /&gt;&lt;br /&gt;Another thing that can confuse people using callback functions is the use of global variables. Since callbacks are usually called in response to events, it may not be clear what the current state of the system is and using any predefined global variable may result in inconsistent results.&lt;br /&gt;&lt;br /&gt;In addition to global variables, variables using the same name in the code containing the reference to the callback function and with in the callback can sometimes confusing to people. In this case, the variable within the callback takes precedence.&lt;span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;# example function with closure&lt;br /&gt;&lt;br /&gt;function makePowerTo(x) {&lt;br /&gt; return function(y) {&lt;br /&gt;  var result = y;&lt;br /&gt;  for (var i = 1; i &lt; x;i++)&lt;br /&gt;    result *= y;&lt;br /&gt;  return result;&lt;br /&gt;  };&lt;br /&gt;}&lt;br /&gt;var square = makePowerTo(2);&lt;br /&gt;var cube = makePowerTo(3);&lt;br /&gt;print(square(2)); // 4&lt;br /&gt;print(cube(2));   // 8 &lt;/pre&gt;&lt;code&gt;&lt;br /&gt;square&lt;/code&gt; and &lt;code&gt;&lt;span style="font-family:Georgia,serif;"&gt;cube&lt;/span&gt;&lt;/code&gt; are both closures. They share the same function body definition, but store different environments. In &lt;code&gt;square&lt;/code&gt;'s environment, &lt;code&gt;x&lt;/code&gt; is 2. As far as &lt;code&gt;cube&lt;/code&gt; is concerned, &lt;code&gt;x&lt;/code&gt; is 3.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-5817049979320089024?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/5817049979320089024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=5817049979320089024' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5817049979320089024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5817049979320089024'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2009/10/callback-functions-scoping.html' title='Callback Functions - Scoping'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-5510129460424003638</id><published>2009-10-05T06:00:00.000-07:00</published><updated>2009-10-05T09:16:24.374-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='computers'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='dos'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='scripting'/><title type='text'>Finding and Deleting Files</title><content type='html'>Today, I was trying to remove a bunch of temporary files using the DOS command prompt on Windows Vista. What a pain in the butt!&lt;br /&gt;&lt;br /&gt;Let's assume that I have a bunch of unwanted ".tmp" files in the sub-directory "subdir". The directory "subdir" also has other sub-directories containing more files that I would like to delete.&lt;br /&gt;&lt;br /&gt;For those of you familiar with Linux, to find and delete files its as easy as the following command:&lt;br /&gt;&lt;blockquote style="font-weight: bold;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:courier new;"&gt;find ./subdir/ -name '*.tmp'&lt;/span&gt;&lt;/span&gt;&lt;code style="font-family: courier new;"&gt;-exec rm -f {} \;&lt;/code&gt;&lt;/span&gt;&lt;/blockquote&gt;Unfortunately, I couldn't muster something like that up on Windows Vista. I tried stuff like&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;dir /B /S | find ".tmp"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;This produced the full path of the files that I no longer wanted. When I then tried to pipe those files to del, like&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;font-size:85%;"  &gt;&lt;blockquote&gt;dir /B /S | find ".tmp" | del&lt;/blockquote&gt;&lt;/span&gt;Vista just said '&lt;span style="font-style: italic;"&gt;The syntax of the command is incorrect.&lt;/span&gt;'&lt;br /&gt;&lt;br /&gt;To make a long story short,  I was finally able to come up with the following:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-weight: bold;"&gt;for /R %i in ("*.tmp") do del %i&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;Do you have an alternative way of finding and deleting files?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-5510129460424003638?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/5510129460424003638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=5510129460424003638' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5510129460424003638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5510129460424003638'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2009/10/finding-and-deleting-files.html' title='Finding and Deleting Files'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-610992599853473061</id><published>2009-10-01T05:47:00.000-07:00</published><updated>2009-10-01T08:22:09.766-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Trim whitespace from string in PERL</title><content type='html'>I like Java's String.trim() method, and so I thought I would add one for PERL:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sub trim {&lt;br /&gt;     my ($self, $text) = @_;&lt;br /&gt;     $text = $self&lt;br /&gt;           if ref(\$self) =~ m/^SCALAR/i;&lt;br /&gt;     # return empty string if $text is not defined&lt;br /&gt;     return "" unless $text;&lt;br /&gt;     $text =~ s/^\s+//;&lt;br /&gt;     $text =~ s/\s+$//;&lt;br /&gt;     return $text;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;That is all that there is to it!&lt;br /&gt;&lt;br /&gt;You can add this to your module, and do $self-&gt;trim($string) or you can do trim($string) ... If you have anything to add, let me know!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-610992599853473061?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/610992599853473061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=610992599853473061' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/610992599853473061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/610992599853473061'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2009/10/trim-whitespace-from-string-in-perl.html' title='Trim whitespace from string in PERL'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-6124213939444423224</id><published>2009-08-31T07:30:00.001-07:00</published><updated>2009-08-31T08:08:11.250-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><title type='text'>Eclipse.ini / Windows Vista - Don't hardcode Vm; Use JAVA_HOME</title><content type='html'>I have a little trick for those of you using Windows Vista (and possibly XP), running Eclipse and fed up of editing your eclipse.ini file each and every time you upgrade your JAVA installation! You know what I mean!&lt;br /&gt;&lt;br /&gt;According to &lt;a href="http://wiki.eclipse.org/Eclipse.ini"&gt;Eclipsepedia&lt;/a&gt;, you need to tell Eclipse the exact path to your JAVA executable. You &lt;span style="font-weight: bold;"&gt;cannot&lt;/span&gt; use &lt;span style="font-weight: bold; font-style: italic;"&gt;JAVA_HOME&lt;/span&gt; or any other variable name in this file!&lt;br /&gt;&lt;br /&gt;Here we are going to show you how to make Eclipse use your JAVA_HOME directory so that when new versions (one of the umpteen updates) of JAVA are installed, Eclipse just works!&lt;br /&gt;&lt;br /&gt;Assumptions:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;You are using Windows Vista (or possible XP).&lt;/li&gt;&lt;li&gt;You know the exact path to your Eclipse installation directory.&lt;/li&gt;&lt;li&gt;You know the exact path of the JVM that your eclipse installation is utilizing.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The variable JAVA_HOME is set up on your computer.&lt;/li&gt;&lt;/ul&gt;To begin, navigate to the folder, using an elevated &lt;a href="http://www.winhelponline.com/articles/158/1/How-to-open-an-elevated-Command-Prompt-in-Windows-Vista.html"&gt;comm&lt;/a&gt;&lt;a href="http://www.winhelponline.com/articles/158/1/How-to-open-an-elevated-Command-Prompt-in-Windows-Vista.html"&gt;and prompt&lt;/a&gt;, that contains your Eclipse installation. For example, on my machine, that folder is C:\eclipse.&lt;br /&gt;&lt;br /&gt;The next step is to enter the following command at the prompt:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-family:courier new;"&gt;mklink /D java %JAVA_HOME%&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Basically, we are telling Windows to create a &lt;a href="http://en.wikipedia.org/wiki/Symbolic_link"&gt;symbolic link&lt;/a&gt; from the eclipse home directory, to the JAVA_HOME directory and to call this link &lt;span style="font-weight: bold;font-family:courier new;" &gt;java&lt;/span&gt;. Windows uses a program called &lt;a href="http://technet.microsoft.com/en-us/library/cc753194%28WS.10%29.aspx"&gt;&lt;span style=";font-family:courier new;font-size:130%;"  &gt;mklink&lt;/span&gt;&lt;/a&gt; to do this.The output from that command will should resemble something like:&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8PosphSzLk0/Spvih7CFx8I/AAAAAAAAACs/AgCe--s0HZc/s1600-h/image001.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 26px;" src="http://2.bp.blogspot.com/_8PosphSzLk0/Spvih7CFx8I/AAAAAAAAACs/AgCe--s0HZc/s320/image001.png" alt="" id="BLOGGER_PHOTO_ID_5376139652606838722" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;For those of you curious to see what happens when I list the directory contents:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_8PosphSzLk0/Spvmc9fuqvI/AAAAAAAAAC0/83RvGPbISUs/s1600-h/image002.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 188px;" src="http://3.bp.blogspot.com/_8PosphSzLk0/Spvmc9fuqvI/AAAAAAAAAC0/83RvGPbISUs/s320/image002.png" alt="" id="BLOGGER_PHOTO_ID_5376143965415189234" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The final step is now to put our symbolic link in the eclipse.ini file. So open up the eclipse.ini file (you can create a backup first if you like) and look for the lines that look like:&lt;br /&gt;&lt;div  style="text-align: center;font-family:courier new;"&gt;&lt;span style="font-size:130%;"&gt;-vm&lt;br /&gt;C:\path\to\JAVA_SDK\bin\javaw.exe&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;and replace them with:&lt;br /&gt;&lt;div  style="text-align: center;font-family:courier new;"&gt;&lt;span style="font-size:130%;"&gt;-vm&lt;br /&gt;java\bin\javaw.exe&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Remember, that you are editing 2 lines (the&lt;span style="font-weight: bold; font-style: italic;"&gt; -vm&lt;/span&gt; is on one line, while the &lt;span style="font-weight: bold; font-style: italic;"&gt;java\bin\javaw.exe&lt;/span&gt; is on another)!&lt;br /&gt;To confirm that everything works as promised, save your eclipse.ini file and start up eclipse!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-6124213939444423224?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/6124213939444423224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=6124213939444423224' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/6124213939444423224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/6124213939444423224'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2009/08/eclipseini-windows-vista-dont-hardcode.html' title='Eclipse.ini / Windows Vista - Don&apos;t hardcode Vm; Use JAVA_HOME'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_8PosphSzLk0/Spvih7CFx8I/AAAAAAAAACs/AgCe--s0HZc/s72-c/image001.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-5146933661787699517</id><published>2009-05-27T09:57:00.000-07:00</published><updated>2009-05-27T10:42:17.619-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jetty'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='webapp'/><category scheme='http://www.blogger.com/atom/ns#' term='maven'/><category scheme='http://www.blogger.com/atom/ns#' term='solaris'/><title type='text'>Eclipse, Maven &amp; Jetty</title><content type='html'>&lt;span style="font-weight: bold;font-size:100%;" &gt;How to run your web application Maven archetype with Jetty in Eclipse&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We will be creating 2 '&lt;span style="font-weight: bold;"&gt;External Tool Configurations&lt;/span&gt;', one to start our web application and one to stop it.&lt;br /&gt;&lt;br /&gt;To get started, we need need to bring up the &lt;span style="font-weight: bold; font-style: italic;"&gt;Create, manage, and run configurations &lt;/span&gt;window. This can be done by clicking on&lt;div style="text-align: center;"&gt;&lt;span style="font-family:courier new;"&gt;Run -&gt; External Tools -&gt; External Tools Configurations...&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;from the menu bar.&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8PosphSzLk0/Sh1yKnTPhNI/AAAAAAAAABk/q-DNk6PijMQ/s1600-h/01.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 186px;" src="http://1.bp.blogspot.com/_8PosphSzLk0/Sh1yKnTPhNI/AAAAAAAAABk/q-DNk6PijMQ/s320/01.png" alt="" id="BLOGGER_PHOTO_ID_5340550259805226194" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;From here, we will context click on Program and choose to create a new configuration. Do this twice and give them the names &lt;span style="font-family:courier new;"&gt;mvn jetty run&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;mvn jetty stop&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8PosphSzLk0/Sh1yK189CPI/AAAAAAAAABs/FeVbEtpjyyU/s1600-h/02.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 154px;" src="http://4.bp.blogspot.com/_8PosphSzLk0/Sh1yK189CPI/AAAAAAAAABs/FeVbEtpjyyU/s320/02.PNG" alt="" id="BLOGGER_PHOTO_ID_5340550263738271986" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Now we have to configure our new External Tool!&lt;br /&gt;&lt;br /&gt;The configuration for both &lt;span style="font-family:courier new;"&gt;start &lt;/span&gt;and &lt;span style="font-family:courier new;"&gt;stop &lt;/span&gt;are very similar! The only difference is for the &lt;span style="font-weight: bold; font-style: italic;"&gt;Arguments &lt;/span&gt;section.&lt;br /&gt;&lt;br /&gt;Under &lt;span style="font-weight: bold; font-style: italic;"&gt;Location&lt;/span&gt;, we need to enter the absolute path to our maven executable. On windows, this is &lt;span style="font-family:courier new;"&gt;mvn.bat&lt;/span&gt; and can be found in the &lt;span style="font-family:courier new;"&gt;\maven\bin\&lt;/span&gt; directory. On *nix machines, you are looking for &lt;span style="font-family:courier new;"&gt;mvn&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;For &lt;span style="font-weight: bold; font-style: italic;"&gt;Working Directory&lt;/span&gt;, we enter &lt;span style="font-family:courier new;"&gt;${project_loc}&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Finally, for &lt;span style="font-weight: bold; font-style: italic;"&gt;Arguments&lt;/span&gt;, we enter &lt;span style="font-family:courier new;"&gt;clean jetty:run&lt;/span&gt; for our &lt;span style="font-weight: bold; font-style: italic;"&gt;mvn jetty run&lt;/span&gt; configuration and &lt;span style="font-family:courier new;"&gt;jetty:stop&lt;/span&gt; for our &lt;span style="font-weight: bold; font-style: italic;"&gt;mvn jetty stop&lt;/span&gt; configuration.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_8PosphSzLk0/Sh1yLMyfFsI/AAAAAAAAAB0/R861ubG9d6k/s1600-h/03.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 175px;" src="http://3.bp.blogspot.com/_8PosphSzLk0/Sh1yLMyfFsI/AAAAAAAAAB0/R861ubG9d6k/s320/03.PNG" alt="" id="BLOGGER_PHOTO_ID_5340550269868381890" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The next thing to configure is the &lt;span style="font-weight: bold; font-style: italic;"&gt;Environment&lt;/span&gt;. Here we will set up &lt;span style="font-family:courier new;"&gt;MAVEN_OPTS&lt;/span&gt; so that we can remotely debug our application if the need ever arises! &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;This is only done for the &lt;span style="font-style: italic;"&gt;mvn jetty run&lt;/span&gt; configuration!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Basically, click on New... and give the variable the &lt;span style="font-weight: bold;"&gt;name&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;MAVEN_OPTS&lt;/span&gt; with the &lt;span style="font-weight: bold;"&gt;value&lt;/span&gt; (all on one line):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8PosphSzLk0/Sh1yLRLM5-I/AAAAAAAAACE/Pm8HEZtHCgI/s1600-h/05.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 126px;" src="http://1.bp.blogspot.com/_8PosphSzLk0/Sh1yLRLM5-I/AAAAAAAAACE/Pm8HEZtHCgI/s320/05.PNG" alt="" id="BLOGGER_PHOTO_ID_5340550271045789666" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;When we are done, it should look like so:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8PosphSzLk0/Sh1yLea_3UI/AAAAAAAAAB8/M4x4xC-AiiQ/s1600-h/04.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 82px;" src="http://4.bp.blogspot.com/_8PosphSzLk0/Sh1yLea_3UI/AAAAAAAAAB8/M4x4xC-AiiQ/s320/04.PNG" alt="" id="BLOGGER_PHOTO_ID_5340550274601704770" border="0" /&gt;&lt;/a&gt;We are pretty much done. I like to have my configuration handy, so I usually add these external configurations to the favorites menu. This is done from the &lt;span style="font-weight: bold; font-style: italic;"&gt;Common&lt;/span&gt; tab. Basically, you just add a check to the check box in the &lt;span style="font-family:courier new;"&gt;Display in favorites menu&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;For the run configuration:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_8PosphSzLk0/Sh1ybpuVTlI/AAAAAAAAACM/Dryxf-1cDTw/s1600-h/06.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 209px;" src="http://3.bp.blogspot.com/_8PosphSzLk0/Sh1ybpuVTlI/AAAAAAAAACM/Dryxf-1cDTw/s320/06.PNG" alt="" id="BLOGGER_PHOTO_ID_5340550552513498706" border="0" /&gt;&lt;/a&gt;And finally, for the stop configuration:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8PosphSzLk0/Sh1yb85hYiI/AAAAAAAAACU/nvyTc32N0Ds/s1600-h/07.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 180px;" src="http://4.bp.blogspot.com/_8PosphSzLk0/Sh1yb85hYiI/AAAAAAAAACU/nvyTc32N0Ds/s320/07.PNG" alt="" id="BLOGGER_PHOTO_ID_5340550557660701218" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;That really is all there is to it. The only other thing to make sure of is that you have the &lt;a target="_blank" href="http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin"&gt;maven-jetty-plugin&lt;/a&gt; added to your &lt;a href="http://maven.apache.org/guides/introduction/introduction-to-the-pom.html#What_is_a_POM" target="_blank"&gt;POM&lt;/a&gt; file.&lt;br /&gt;&lt;br /&gt;Here is the plugin XML fragment that I have currently:&lt;br /&gt;&lt;pre&gt;    &amp;lt;plugin&amp;gt;&lt;br /&gt;       &amp;lt;groupId&amp;gt;org.mortbay.jetty&amp;lt;/groupId&amp;gt;&lt;br /&gt;       &amp;lt;artifactId&amp;gt;maven-jetty-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;       &amp;lt;version&amp;gt;6.1.16&amp;lt;/version&amp;gt;&lt;br /&gt;       &amp;lt;configuration&amp;gt;&lt;br /&gt;           &amp;lt;stopPort&amp;gt;9966&amp;lt;/stopPort&amp;gt;&lt;br /&gt;           &amp;lt;stopKey&amp;gt;foo&amp;lt;/stopKey&amp;gt;&lt;br /&gt;       &amp;lt;/configuration&amp;gt;&lt;br /&gt;   &amp;lt;/plugin&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt; Let me know if you have any questions!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-5146933661787699517?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/5146933661787699517/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=5146933661787699517' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5146933661787699517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5146933661787699517'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2009/05/eclipse-maven-jetty.html' title='Eclipse, Maven &amp; Jetty'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_8PosphSzLk0/Sh1yKnTPhNI/AAAAAAAAABk/q-DNk6PijMQ/s72-c/01.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-7316559986052878438</id><published>2009-04-29T06:40:00.000-07:00</published><updated>2009-04-29T07:29:35.295-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='google app engine'/><title type='text'>Google App Engine &amp; Eclipse</title><content type='html'>I am going to show you how to run your Google App (Python) in eclipse without any special plugins!&lt;br /&gt;&lt;br /&gt;All you need to do is ensure that you have downloaded and installed both the Google App Engine and Python.&lt;br /&gt;&lt;br /&gt;The trick to getting Google apps to run within eclipse is to run your app as an &lt;span style="font-family: courier new;font-size:78%;" &gt;'&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic; font-family: courier new;font-size:78%;" &gt;External Tool&lt;/span&gt;&lt;span style="font-family: courier new;font-size:78%;" &gt;'&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;From the Eclipse file menu, click on&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic; font-family: courier new;font-size:78%;" &gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-family: courier new; font-weight: bold;font-size:78%;" &gt;Run -&gt; External Tools -&gt; External Tools Configuration ...&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In the resulting window, choose to create a new program:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_8PosphSzLk0/SfhcFs4GrNI/AAAAAAAAAA0/EFwLzcJDyiU/s1600-h/run_app_0.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 278px; height: 320px;" src="http://3.bp.blogspot.com/_8PosphSzLk0/SfhcFs4GrNI/AAAAAAAAAA0/EFwLzcJDyiU/s320/run_app_0.PNG" alt="" id="BLOGGER_PHOTO_ID_5330111412008561874" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Give it a name (I called it 'App Engine') in the &lt;span style="font-weight: bold;"&gt;Name field&lt;/span&gt;. In the &lt;span style="font-weight: bold;"&gt;Location field&lt;/span&gt;, enter the exact path to your Python executable. For the &lt;span style="font-weight: bold;"&gt;Working Directory&lt;/span&gt;, enter the exact path to the Google App Engine.&lt;br /&gt;&lt;br /&gt;The Arguments field is the most interesting one! Here we enter:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;dev_appserver.py -d ${resource_loc}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The &lt;span style="font-weight: bold;"&gt;dev_appserver.py&lt;/span&gt; is the Python script that Google tells you to run when you want to test your app.&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-weight: bold;"&gt;-d&lt;/span&gt; just tells the App Engine to output debug statements. Feel free to use any &lt;a href="http://code.google.com/appengine/docs/python/tools/devserver.html#Command_Line_Arguments" target="_blank"&gt;command line arguments&lt;/a&gt; that the App Engine allows!&lt;br /&gt;&lt;br /&gt;Finally, the &lt;span style="font-family: courier new;"&gt;${resource_loc}&lt;/span&gt; tells Eclipse to use the full path of any item currently selected in the Navigator.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8PosphSzLk0/SfhdGjqsfII/AAAAAAAAABE/YVQ7BZQHYqM/s1600-h/run_app_2.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 171px;" src="http://1.bp.blogspot.com/_8PosphSzLk0/SfhdGjqsfII/AAAAAAAAABE/YVQ7BZQHYqM/s320/run_app_2.PNG" alt="" id="BLOGGER_PHOTO_ID_5330112526227897474" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The final thing to do is to click on the &lt;span style="font-weight: bold;"&gt;Common&lt;/span&gt; tab and to Select &lt;span style="font-weight: bold;"&gt;"Display in favorites menu"&lt;/span&gt;. This will provide you with a shortcut so that running your Google App requires the least amount of  clicks!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8PosphSzLk0/SfhdOTpp9eI/AAAAAAAAABM/Sn5CkFabAvU/s1600-h/run_app_3.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 189px;" src="http://1.bp.blogspot.com/_8PosphSzLk0/SfhdOTpp9eI/AAAAAAAAABM/Sn5CkFabAvU/s320/run_app_3.PNG" alt="" id="BLOGGER_PHOTO_ID_5330112659367523810" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Set up is complete!&lt;br /&gt;&lt;br /&gt;Now choose the root folder of your Google App in Eclipse and click on 'App Engine' (or the name that you named your &lt;span style="font-weight: bold; font-style: italic;"&gt;External Tool&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8PosphSzLk0/Sfhg9FDDIyI/AAAAAAAAABc/cCb4dfuVxWU/s1600-h/run_app_5.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 293px; height: 221px;" src="http://2.bp.blogspot.com/_8PosphSzLk0/Sfhg9FDDIyI/AAAAAAAAABc/cCb4dfuVxWU/s320/run_app_5.PNG" alt="" id="BLOGGER_PHOTO_ID_5330116761436234530" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As you can see, the App Engine is running!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8PosphSzLk0/SfhdZP-C6DI/AAAAAAAAABU/5A05SNvzMLk/s1600-h/run_app_4.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 85px;" src="http://1.bp.blogspot.com/_8PosphSzLk0/SfhdZP-C6DI/AAAAAAAAABU/5A05SNvzMLk/s320/run_app_4.PNG" alt="" id="BLOGGER_PHOTO_ID_5330112847357863986" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Some Notes:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If the App engine looks like it has hung (froze), click in the Eclipse console and hit the return key on your keyboard. What may have happened is that the App Engine has prompted you to check for updates and Eclipse didn't show you the message.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you get an Eclipse error, "Problem Occurred", make sure that the root folder for your app is selected in Eclipse (i.e. click on it!).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;If you have any other things to add, please post your comments!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-7316559986052878438?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/7316559986052878438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=7316559986052878438' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/7316559986052878438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/7316559986052878438'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2009/04/google-app-engine-eclipse.html' title='Google App Engine &amp; Eclipse'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_8PosphSzLk0/SfhcFs4GrNI/AAAAAAAAAA0/EFwLzcJDyiU/s72-c/run_app_0.PNG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-8358026634974495778</id><published>2009-04-27T07:49:00.001-07:00</published><updated>2009-04-27T08:00:36.319-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='scripting'/><title type='text'>for loop using 'find'</title><content type='html'>I find myself constantly creating complex loops and forgetting, for a small instance of time, how to construct them again.&lt;br /&gt;&lt;br /&gt;In this case, I wanted to list files that passed a certain criteria and loop over them so that I could call a Perl script on them.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new; font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote style="font-family: courier new;"&gt;&lt;span style="font-size:78%;"&gt;for i in `find . -type f -name '*.pm' -print`; \&lt;br /&gt;do perl some_script.pl $i; \&lt;br /&gt;done&lt;/span&gt;&lt;/blockquote&gt;In the above case, I am searching for all files that end in &lt;span style="font-weight: bold; font-style: italic;"&gt;pm&lt;/span&gt;, starting from the &lt;span style="font-weight: bold;"&gt;current directory&lt;/span&gt; (.) and once found, I am executing the &lt;span style="font-weight: bold; font-style: italic;"&gt;perl script some_script.pl &lt;/span&gt;on them.&lt;br /&gt;&lt;br /&gt;Of course, you don't have run a perl script ... you could just echo the output:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-family: courier new;"&gt;&lt;blockquote&gt;for i in `find . -type f -name '*.pm' -print`; \&lt;br /&gt;do echo found $i; \&lt;br /&gt;done&lt;/blockquote&gt;&lt;/span&gt;&lt;/span&gt;Now, next time I need to run a similar command, I wont forget how to construct the query!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-8358026634974495778?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/8358026634974495778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=8358026634974495778' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/8358026634974495778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/8358026634974495778'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2009/04/for-loop-using-find.html' title='for loop using &apos;find&apos;'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-5280870141527463536</id><published>2009-01-08T06:00:00.000-08:00</published><updated>2009-01-08T08:28:56.323-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='maven'/><title type='text'>Skipping Maven Tests ... For real!</title><content type='html'>For the longest time, I have been trying to figure out how to skip running&lt;br /&gt;the tests that are in a project that I have been working on because they&lt;br /&gt;usually fail! &lt;p&gt;Usually, I edit the POM file and disable testing, but with a project&lt;br /&gt;containing numerous subprojects, this became very tedious. &lt;/p&gt;&lt;p&gt;All of the documentation points to a variable maven.test.skip and states to&lt;br /&gt;set it to true in order to skip tests; something like:&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;maven.test.skip=true&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;This has never worked for me. In case you are wondering, I am using maven&lt;br /&gt;2.0.9 (latest as of January 8, 2009)&lt;/p&gt;&lt;p&gt;Having tried everything, I finally have found a way to get it to work&lt;br /&gt;properly:&lt;/p&gt;&lt;p style="font-weight: bold;"&gt; &lt;/p&gt;&lt;blockquote style="font-weight: bold;"&gt;maven.test.skip.exec=true&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Now when I run the install task for the project, I do it like:&lt;/p&gt;&lt;p style="font-weight: bold;"&gt; &lt;/p&gt;&lt;blockquote style="font-weight: bold;"&gt;mvn -Dmaven.test.skip.exec=true install&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Tests are finally skipped!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-5280870141527463536?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/5280870141527463536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=5280870141527463536' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5280870141527463536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5280870141527463536'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2009/01/skipping-maven-tests-for-real.html' title='Skipping Maven Tests ... For real!'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-2520850618472330679</id><published>2008-12-28T11:12:00.000-08:00</published><updated>2008-12-28T11:28:41.536-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='computers'/><category scheme='http://www.blogger.com/atom/ns#' term='codec'/><category scheme='http://www.blogger.com/atom/ns#' term='digital copy protection'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><category scheme='http://www.blogger.com/atom/ns#' term='dvd'/><title type='text'>Windows and problem playing DVDs</title><content type='html'>The other day on a short road trip we tried playing a DVD on our laptop and got the following message:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;"Windows Media Player cannot play this DVD because there is a problem with digital copy protection between your DVD drive, decoder, and video card. Try installing an updated driver for your video card."&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8PosphSzLk0/SVfQCgVIhkI/AAAAAAAAAAM/GEV1vSd6ork/s1600-h/error.jpg" target="_blank"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 146px;" src="http://4.bp.blogspot.com/_8PosphSzLk0/SVfQCgVIhkI/AAAAAAAAAAM/GEV1vSd6ork/s320/error.jpg" alt="" id="BLOGGER_PHOTO_ID_5284921429199455810" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;As soon as I got an internet connection, I tried downloading a driver for my video card. After installing it, I assumed that the DVD would play (after all, the message told me it would!).&lt;br /&gt;&lt;br /&gt;No luck. I then downloaded new firmware and drivers for my DVD drive. The message did say something about my DVD drive too ...&lt;br /&gt;&lt;br /&gt;Again, no luck. Well, what else is there? Then I noticed the word 'decoder' in the message and decided to pursue that option.&lt;br /&gt;&lt;br /&gt;I tried a few things, but the one that actually did the trick was to download the &lt;a href="http://free-codecs.net/download/XP_Codec_Pack.htm" target="_blank"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;XP Codec Pack&lt;/span&gt;&lt;/a&gt;. After downloading and installing these &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Codec"&gt;codecs&lt;/a&gt;, I was finally able to play the DVD that we brought to occupy our time on our short road trip!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-2520850618472330679?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/2520850618472330679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=2520850618472330679' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/2520850618472330679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/2520850618472330679'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2008/12/windows-and-problem-playing-dvds.html' title='Windows and problem playing DVDs'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_8PosphSzLk0/SVfQCgVIhkI/AAAAAAAAAAM/GEV1vSd6ork/s72-c/error.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-5518298978559884837</id><published>2008-11-27T13:39:00.001-08:00</published><updated>2008-11-27T14:04:13.630-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='computers'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='solaris'/><title type='text'>Comparing XML Documents Semantically</title><content type='html'>I have been interested in comparing the contents of XML documents for some time now.&lt;br /&gt;&lt;br /&gt;What I wanted to do is to perform a '&lt;span style="font-style: italic;"&gt;Diff&lt;/span&gt;' on 2 XML documents and determine whether or not they are the same document (regardless of whitespace or child element ordering).&lt;br /&gt;&lt;br /&gt;In JAVA, I came across &lt;a href="http://xmlunit.sourceforge.net/" target="_blank"&gt;XmlUnit&lt;/a&gt;. This piece of software is excellent for determining whether or not 2 separate XML documents are equal.&lt;br /&gt;&lt;br /&gt;In Perl, I came across &lt;a target="_blank" href="http://search.cpan.org/dist/XML-SemanticDiff/"&gt;XML-SemanticDiff&lt;/a&gt;. I thought it was great until I re-ordered the elements in one of my documents. Then this module wasn't so great anymore.&lt;br /&gt;&lt;br /&gt;Since I really needed a piece of software equivalent to XmlUnit in Perl, I decided to create my own module and to call it &lt;a target="_blank" href="http://search.cpan.org/dist/XML-SemanticCompare/"&gt;XML-SemanticCompare&lt;/a&gt;. This new module really does perform a semantic diff on XML documents:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Child element re-ordering doesn't result in false negatives. &lt;/li&gt;&lt;li&gt;Whitespace is trimmed from text by default when comparing text and attribute values &lt;span style="font-style: italic;"&gt;[can be turned off]&lt;/span&gt;.&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Attributes can be ignored&lt;span style="font-style: italic;"&gt; [turned off by default].&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Using the module is extremely straightforward:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;  use XML::SemanticCompare;&lt;br /&gt;  my $x = XML::SemanticCompare-&gt;new;&lt;br /&gt;&lt;br /&gt;  # compare 2 different files&lt;br /&gt;  my $isSame = $x-&gt;compare($control_xml, $test_xml);&lt;br /&gt;  # are they the same&lt;br /&gt;  print "XML matches!\n"&lt;br /&gt;    if $isSame;&lt;br /&gt;  print "XML files are semantically different!\n"&lt;br /&gt;    unless $isSame;&lt;br /&gt;&lt;br /&gt;  # get the diffs&lt;br /&gt;  my $diffs_arrayref = $x-&gt;diff($control_xml, $test_xml);&lt;br /&gt;&lt;br /&gt;  # test xpath statement against XML&lt;br /&gt;  my $success = $x-&gt;test_xpath($xpath, $test_xml);&lt;br /&gt;  print "xpath success!\n" if $success;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;The only downside to this piece of software is that it isn't very efficient (although, it isn't terribly inefficient either).&lt;br /&gt;&lt;br /&gt;If you find yourself trying to compare XML documents DOM trees for equality and you are using Perl, please check out XML-SemanticCompare. If you can make the code more robust and efficient, please do!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-5518298978559884837?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://search.cpan.org/dist/XML-SemanticCompare/' title='Comparing XML Documents Semantically'/><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/5518298978559884837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=5518298978559884837' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5518298978559884837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5518298978559884837'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2008/11/comparing-xml-documents-semantically.html' title='Comparing XML Documents Semantically'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-7931925529317609092</id><published>2008-11-25T13:59:00.000-08:00</published><updated>2008-11-27T14:04:49.431-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='computers'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='solaris'/><title type='text'>A perl script to rename your files</title><content type='html'>For those of you looking for a cool way to rename your files, here is a little script that could work wonders for you.&lt;br /&gt;&lt;br /&gt;Basically, this scripts takes in a PERL substitution expression and applies it to the filename of interest.&lt;br /&gt;&lt;br /&gt;To get started, copy the script below into a file called 'rename.pl'. Once you have done that, then read the usage instructions by running the script with the '-h' option. Of course, you will need &lt;a href="http://www.perl.com/download.csp" target="_blank"&gt;perl&lt;/a&gt; installed on your machine.&lt;br /&gt;&lt;br /&gt;So why write this script? Because I got sick and tired of manually renaming files by hand. Some people have files called 'some_file.txt'. I prefer that file to be called 'SomeFile.txt'. &lt;br /&gt;&lt;br /&gt;To accomplish this, all I have to do is run the script like so:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;   &lt;span style="font-style:italic;font-weight:bold;"&gt;perl rename.pl -u "s/_/ /g" some_file.txt&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;followed by&lt;br /&gt;&lt;pre&gt;   &lt;span style="font-style:italic;font-weight:bold;"&gt;perl rename.pl "s/ //g" "Some File.txt"&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;font-weight:bold;"&gt;Note: The -u option causes the first letter of each word separated by a space to be capitalized.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Okay, maybe its quicker to manually do this for a single file, but if you are on Windows and have a whole folder full of files like that, then the process is:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;   &lt;span style="font-style:italic;font-weight:bold;"&gt;for %v in (*.txt) do perl rename.pl -u "s/_/ /g" "%v" &lt;br /&gt;   for %v in (*.txt) do perl rename.pl "s/ //g" "%v"&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That is all there is to it! All of the files will be renamed with 'camel' text names.&lt;br /&gt;&lt;br /&gt;Please make sure that before you attempt to batch rename files, that you have them backed up first!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Script start&lt;/span&gt; &lt;span style="font-style:italic;"&gt;[hint: dont copy this line ;-)]&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/usr/bin/perl -w&lt;br /&gt;&lt;br /&gt;BEGIN {&lt;br /&gt; use Getopt::Std;&lt;br /&gt; use vars qw/ $opt_h $opt_u /;&lt;br /&gt; getopt;&lt;br /&gt;&lt;br /&gt; # usage&lt;br /&gt;        sub usage {&lt;br /&gt;  print STDOUT &lt;&lt;'END_OF_USAGE';&lt;br /&gt;&lt;br /&gt;  Usage: rename [-hu] sub_regex [files]&lt;br /&gt;&lt;br /&gt;                sub_regex is any expression that you would like to&lt;br /&gt;                apply to filename. You can use capturing or just &lt;br /&gt;                matching.&lt;br /&gt;&lt;br /&gt;                -h .... shows this message ;-)&lt;br /&gt;                -u .... makes first letter of each word uppercase&lt;br /&gt;&lt;br /&gt;  examples:&lt;br /&gt;&lt;br /&gt;                1.&lt;br /&gt;         perl rename.pl "s/_/ /g" rename_me.txt&lt;br /&gt;                   This renames rename_me.txt to "rename me.txt"&lt;br /&gt;&lt;br /&gt;                2.&lt;br /&gt;         perl rename.pl -u "s/_/ /g" rename_me.txt&lt;br /&gt;                   This renames rename_me.txt to "Rename Me.txt"&lt;br /&gt;&lt;br /&gt;                3. MS Windows example&lt;br /&gt;         for %v in (*.mp3) do perl rename.pl -u "s/_/ /g" "%v"&lt;br /&gt;                   This renames all mp3 files in the current directory such that&lt;br /&gt;                   every word begins with a capital letter and all underscores&lt;br /&gt;                   are replaced with spaces.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;END_OF_USAGE&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt; if ($opt_h) {&lt;br /&gt;                usage();&lt;br /&gt;  exit(0);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# get the substition regex&lt;br /&gt;$op = shift or (usage() and exit(1));&lt;br /&gt;&lt;br /&gt;# go through file names&lt;br /&gt;chomp(@ARGV = &lt;STDIN&gt;) unless @ARGV;&lt;br /&gt;for (@ARGV) {&lt;br /&gt;    $was = $_;&lt;br /&gt;    eval $op;&lt;br /&gt;    die $@ if $@;&lt;br /&gt;    # cap first letter of each word&lt;br /&gt;    my $newname = "";&lt;br /&gt;    my @components = split(/ /, $_);&lt;br /&gt;    foreach (@components) {&lt;br /&gt;      my $x = $_;&lt;br /&gt;      $x = ucfirst lc $x if $opt_u;&lt;br /&gt;      $newname .= " $x";&lt;br /&gt;    }&lt;br /&gt;    rename($was,$newname) unless $was eq $newname;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Script End&lt;/span&gt; &lt;span style="font-style:italic;"&gt;[hint: dont copy this line ;-)]&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-7931925529317609092?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/7931925529317609092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=7931925529317609092' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/7931925529317609092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/7931925529317609092'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2008/11/perl-script-to-rename-your-files.html' title='A perl script to rename your files'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-293314671813305466</id><published>2008-08-27T05:32:00.000-07:00</published><updated>2008-08-27T07:43:41.732-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='freebase'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><category scheme='http://www.blogger.com/atom/ns#' term='google app engine'/><title type='text'>Freebase &amp; Google App Engine - Write Queries</title><content type='html'>If you would like to use &lt;a href="http://www.freebase.com/"&gt;Freebase&lt;/a&gt; with your application that is hosted with &lt;a href="http://code.google.com/appengine/"&gt;Google App Engine&lt;/a&gt;, then you may have run into some difficulties trying to get write queries to work!&lt;br /&gt;&lt;br /&gt;Now that I have been able to get writes to work, I am going to write down what it is that I did so that other people don't run into the same problems that I did!&lt;br /&gt;&lt;br /&gt;Basically, to get writes to work, I created a proxy between my app engine page and freebase. In other words, I had a form that allows you to modify an entity in freebase and upon submit, the mql write statement was created and sent to the app engine. The app engine then forwarded this request to Freebase and then waited for the response. The response was then forwarded back to the to the client page.&lt;br /&gt;&lt;br /&gt;To get this to work, you need to first obtain the cookies that are set when you authenticate with Freebase. To do this, we have a simple python subroutine:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# domain is either sandbox.freebase.com or www.freebase.com&lt;br /&gt;# user is the username&lt;br /&gt;# pass is the password&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;def login(domain, user, pass):&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    result = urlfetch.fetch(&lt;br /&gt;             url='http://'&lt;br /&gt;                  + domain&lt;br /&gt;                  + '/api/account/login?username='&lt;br /&gt;           &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;       &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;+ user&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;       &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;              + '&amp;amp;password='&lt;br /&gt;    &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;       &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;       + pass&lt;br /&gt;           &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;       &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;+ '&amp;amp;rememberme=true',&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;       &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;          payload={},&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;       &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;   method=urlfetch.POST,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;       &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;          headers={&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;       &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;      'X-Metaweb-Request':'x-metaweb-request'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;       &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;}&lt;br /&gt;       )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    return result.headers['set-cookie']&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This subroutine basically calls the login service for Freebase and returns any cookies that their server says to save.&lt;br /&gt;&lt;br /&gt;The next thing that you need to do is to forward your write mql to Freebase. This can be done in a similar manner:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# domain is either sandbox.freebase.com or www.freebase.com&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# user is the username performing the write&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# pass is the password for the user performing the write&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# mql  is the write query wrapped in the query envelope&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;def write_to_freebase(domain, user, pass, mql):&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    form_fields = {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        "queries":mql,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    form_data = urllib.urlencode(form_fields)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    cookies = login(domain, user, pass)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    result = urlfetch.fetch(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                url='http://' + domain+ '/api/service/mqlwrite', &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                payload=form_data,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                method=urlfetch.POST,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                headers={&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                    'Content-Type': 'application/x-www-form-urlencoded', &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                    'X-Metaweb-Request':'x-metaweb-request', &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                    'Cookie' : cookies&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;             )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    return result.content;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This method simply calls the mqlwrite service and forwards the JSON object to you.&lt;br /&gt;&lt;br /&gt;The imports required are:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   from google.appengine.api import urlfetch&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   import urllib&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That is all that is required in order to get writes to work with google app engine!&lt;br /&gt;&lt;br /&gt;Please let me know if I missed anything so that I can update this post!&lt;br /&gt;&lt;br /&gt;Thanks and good luck!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-293314671813305466?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/293314671813305466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=293314671813305466' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/293314671813305466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/293314671813305466'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2008/08/freebase-google-app-engine-write.html' title='Freebase &amp; Google App Engine - Write Queries'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-8368482839118664588</id><published>2008-06-18T16:13:00.000-07:00</published><updated>2008-06-18T16:26:42.597-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='solaris'/><title type='text'>My Solaris .profile</title><content type='html'>I wanted to post my .profile file online because I have had to re-create it many times and I thought that others might find it useful!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;Some of the things that the profile does are:&lt;/span&gt;&lt;br /&gt;&lt;ul style="font-family: times new roman;"&gt;&lt;li&gt;colors the prompt&lt;br /&gt;&lt;/li&gt;&lt;li&gt;adds shortcuts for ll and l (ls -lF and ls -laF)&lt;/li&gt;&lt;li&gt;fixes the delete (among others) key so that delete actually deletes characters, rather than add tildes!&lt;/li&gt;&lt;li&gt;adds mouse support to pico and makes 'nano' refer to pico (our system doesn't have nano)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;sets up CDPATH (adds the directories in this variable to the search path when using cd)&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# set the term to xterm&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;export TERM=xterm&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# Set up VISUAL, EDITOR for crontab editing&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;VISUAL=/usr/local/bin/pico&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;EDITOR=${VISUAL}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# Set up a prompt&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;PS1="\u@\h:\w# "&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;export PS1="\e[1;31m$(echo $PS1)\e[m"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# Export all the above&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;export VISUAL EDITOR PS1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# set up CDPATH&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;CDPATH=$HOME&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;export CDPATH&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# set up some aliases&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;alias ll="ls -lF"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;alias l="ls -laF"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;alias nano="pico -w -m"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;alias pico="/usr/local/bin/pico -w -m"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# fix some keys&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;case $TERM in&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;xterm*)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    bind '"\e[1~": beginning-of-line'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    bind '"\e[3~": delete-char'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    bind '"\e[4~": end-of-line'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    bind '"\177": backward-delete-char'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    ;;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;esac&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# eof&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;span style="font-family:times new roman;"&gt;All that you need to do is save the above text in your home directory under the filename &lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;font-family:times new roman;" &gt;'.profile'&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;.&lt;br /&gt;&lt;br /&gt;I have tested this on Solaris, SuSe Linux and Ubuntu Linux.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;Good luck!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-8368482839118664588?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/8368482839118664588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=8368482839118664588' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/8368482839118664588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/8368482839118664588'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2008/06/my-solaris-profile.html' title='My Solaris .profile'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-6344108801209394364</id><published>2008-06-17T08:35:00.000-07:00</published><updated>2008-06-17T08:48:20.609-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='semaphores'/><category scheme='http://www.blogger.com/atom/ns#' term='computers'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='administration'/><category scheme='http://www.blogger.com/atom/ns#' term='shared memory'/><title type='text'>Deleting shared memory segments</title><content type='html'>Recently, I found myself using &lt;a href="http://en.wikipedia.org/wiki/Inter-process_communication" target="_blank"&gt;IPC&lt;/a&gt; in a multi-threaded perl script that I wrote.&lt;br /&gt;&lt;br /&gt;After running the script a few times I eventually ran out of memory segments and so the script would just die (turns out that the script wasn't robust enough ;-)&lt;br /&gt;&lt;br /&gt;So after searching around, I came up with 2 commands that go through and clean, (read &lt;span style="font-weight: bold;"&gt;delete&lt;/span&gt;) all segments (and semaphores) on the computer. The commands need to be run from the command line.&lt;br /&gt;&lt;br /&gt;On Solaris:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ipcs -s | awk ' $5 == "ekawas" {print $2, $5}' | awk '{ print $1}' | while read i; do ipcrm -s $i; done &lt;br/&gt;&lt;br /&gt;ipcs -m | awk ' $5 == "ekawas" {print $2, $5}' | awk '{ print $1}' | while read i; do ipcrm -m $i; done&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;On Linux/Unix:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ipcs -s | awk ' $3 == "ekawas" {print $2, $3}' | awk '{ print $1}' | while read i; do ipcrm sem $i; done&lt;br/&gt;&lt;br /&gt;ipcs -m | awk ' $3 == "ekawas" {print $2, $3}' | awk '{ print $1}' | while read i; do ipcrm -m $i; done&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Of course, you will need to change "ekawas" to a more appropriate username. To find out the username that you should be using, run 'ipcs -s' or 'ipcs -m' and see who created the segments.&lt;br /&gt;&lt;br /&gt;Please be careful, because all segments created by all users will be listed; so don't delete ones that you didn't create!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-6344108801209394364?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/6344108801209394364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=6344108801209394364' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/6344108801209394364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/6344108801209394364'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2008/06/deleting-shared-memory-segments.html' title='Deleting shared memory segments'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-6113089504182410676</id><published>2008-04-25T12:20:00.000-07:00</published><updated>2008-04-25T12:26:11.966-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>dos2unix On Every File in a Dir</title><content type='html'>I am by no means a Linux expert and I find myself forgetting obvious commands if I haven't used them for a while.&lt;br /&gt;&lt;br /&gt;Today, I found myself needing to apply the app 'dos2unix' on a bunch of files recursively in a directory.&lt;br /&gt;&lt;br /&gt;After fumbling for a few minutes, this is what I came up with:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;pre&gt;    find . -type f -exec dos2unix '{}' \;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;Now hopefully, I wont forget again!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-6113089504182410676?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/6113089504182410676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=6113089504182410676' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/6113089504182410676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/6113089504182410676'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2008/04/dos2unix-on-every-file-in-dir.html' title='dos2unix On Every File in a Dir'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-2832885898408058401</id><published>2008-01-17T10:54:00.000-08:00</published><updated>2008-01-17T11:14:01.389-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='administration'/><title type='text'>Enabling the Home/End/Delete Keys on a *nix Machine</title><content type='html'>Make the &lt;span style="font-style: italic;"&gt;Home/End/Delete&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt; key function like you would assume that they would!&lt;br /&gt;&lt;br /&gt;In your &lt;span style="font-style: italic;"&gt;.profile&lt;/span&gt; file (create it if necessary in your home directory), if you add the following to the bottom (or top), you can enable the Home/End/Delete keys:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;case $TERM in&lt;br /&gt;xterm*)&lt;br /&gt;      bind '"\e[1~": beginning-of-line'&lt;br /&gt;      bind '"\e[3~": delete-char'&lt;br /&gt;      bind '"\e[4~": end-of-line'&lt;br /&gt;      bind '"\177": backward-delete-char'&lt;br /&gt;      ;;&lt;br /&gt;esac&lt;br /&gt;&lt;/pre&gt;This would enable the hot keys for your profile.&lt;br /&gt;&lt;br /&gt;If you want to set them up system wide, then (as root) add the following to the end of your /etc/inputrc file:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;"\e[1~": beginning-of-line&lt;br /&gt;"\e[4~": end-of-line&lt;br /&gt;"\e[3~": delete-char&lt;br /&gt;"\177": backward-delete-char&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-2832885898408058401?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/2832885898408058401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=2832885898408058401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/2832885898408058401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/2832885898408058401'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2008/01/enabling-homeenddelete-keys-on-nix.html' title='Enabling the Home/End/Delete Keys on a *nix Machine'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-5890889102350245265</id><published>2007-08-24T08:19:00.000-07:00</published><updated>2007-08-24T09:55:08.727-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='greasemonkey'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='userscripts'/><category scheme='http://www.blogger.com/atom/ns#' term='subversion'/><category scheme='http://www.blogger.com/atom/ns#' term='svn'/><title type='text'>Greasemonkey &amp; Auto Updating Userscripts With Subversion</title><content type='html'>&lt;p&gt;Some time ago, I wanted to create a way of auto updating my &lt;a href="http://www.greasespot.net/" target="_blank"&gt;Greasemonkey&lt;/a&gt; userscripts so that I wouldn't have to somehow manually notify everyone when an update occured. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;My scripts are kept in a subversion repository with &lt;a href="http://en.wikipedia.org/wiki/WebDAV" target="_blank"&gt;WebDav support&lt;/a&gt;. So one of the first things that I did was examine the HTTP headers of my web server when I made a subversion request from my browser:&lt;/p&gt;&lt;br /&gt;&lt;pre style='overflow:auto;font-family: "Courier New", Courier, monospace; color: #000000; background-color: #CCCCCC; border: thin solid #000000;'&gt;&lt;br /&gt;Date Fri, 24 Aug 2007 16:00:53 GMT &lt;br /&gt;Server Apache/2.0.54 (Unix) DAV/2 SVN/1.2.0 mod_perl/1.999.22 Perl/v5.8.5 &lt;br /&gt;Etag &amp;quot;1390//some_script.user.js&amp;quot; &lt;br /&gt;Accept-Ranges bytes &lt;br /&gt;Content-Length 638 &lt;br /&gt;Keep-Alive timeout=15, max=99 &lt;br /&gt;Connection Keep-Alive &lt;br /&gt;Content-Type text/html; charset=UTF-8&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The one thing to notice is the line with the &lt;em&gt;&lt;strong&gt;Etag&lt;/strong&gt;&lt;/em&gt;  text. It pretty much displays the subversion version of my script, 'some_script.user.js'. So if I could get this information when my script loads and compare it to any value that I have stored previously, then I can cause my script to update itself quite easily!&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So I created a function called &lt;em&gt;&lt;strong&gt;check4Update(options)&lt;/strong&gt;&lt;/em&gt;  that did just that. In addition to my function, I also used cookie management code that I slighltly modified from &lt;a href="http://www.webreference.com/js/column8/functions.html" target="_blank"&gt;webreference.com&lt;/a&gt; (included below). &lt;/p&gt;&lt;br /&gt;&lt;p&gt;The function that I created has a json object called options with the following parameters:&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;ul&gt;&lt;br /&gt;    &lt;li&gt;&lt;strong&gt;url &lt;/strong&gt;- the subversion URL for your userscript&lt;/li&gt;&lt;br /&gt;    &lt;li&gt;&lt;em&gt;scriptname&lt;/em&gt; - the name of your script&lt;em&gt;&lt;strong&gt; [defaults to the domain that the script acts upon; this may not be desirable, so please set it!] &lt;/strong&gt;&lt;/em&gt;&lt;/li&gt;&lt;br /&gt;    &lt;li&gt;&lt;em&gt;delay&lt;/em&gt; -  the number of page refreshes to wait before nagging the user again &lt;em&gt;&lt;strong&gt;[ defaults to 7] &lt;/strong&gt;&lt;/em&gt;&lt;/li&gt;&lt;br /&gt;  &lt;/ul&gt;&lt;br /&gt;  &lt;p&gt;Items in &lt;strong&gt;bold&lt;/strong&gt; are required and items in &lt;em&gt;italics&lt;/em&gt; are optional&lt;/p&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;pre style='overflow:auto;font-family: "Courier New", Courier, monospace; color: #000000; background-color: #CCCCCC; border: thin solid #000000;'&gt; &lt;br /&gt;window.check4Update = function(options) {&lt;br /&gt; var options = options || {}; &lt;br /&gt; if (!url) {&lt;br /&gt;  // we need this at least ...&lt;br /&gt;  return;&lt;br /&gt; }&lt;br /&gt; var url = options.url;&lt;br /&gt; var scriptname = options.scriptname || location.host + "_script";&lt;br /&gt; var delay = options.delay || 7;&lt;br /&gt; &lt;br /&gt; // cookie_name is the name of the cookie that we will set with the &lt;br /&gt; // value of version&lt;br /&gt; var cookie_name = scriptname&lt;br /&gt; &lt;br /&gt; // the version of the script. Initially, this will be null.&lt;br /&gt; var version =  getCookie(cookie_name);&lt;br /&gt; &lt;br /&gt; // the name of the cookie that indicates when we should nag &lt;br /&gt; // about upgrading in case the user didnt want to upgrade their script&lt;br /&gt; var upgrade_cookie = scriptname+ '_DELAY_UPGRADE'&lt;br /&gt; &lt;br /&gt; try {&lt;br /&gt;  GM_xmlhttpRequest({ &lt;br /&gt;   // head command because we are only interested &lt;br /&gt;   // in the Headers and not the script!&lt;br /&gt;   method: 'HEAD',&lt;br /&gt;   url: url,&lt;br /&gt;   headers: {&lt;br /&gt;            'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey '+scriptname+'/1.0'&lt;br /&gt;   },&lt;br /&gt;   onload: function(responseDetails) {&lt;br /&gt;            if (responseDetails.status == 200 || responseDetails.status == 202) {&lt;br /&gt;            var headers = (responseDetails.responseHeaders).split('\n');&lt;br /&gt;            for (var i in headers) {&lt;br /&gt;    &lt;br /&gt;            // go through and look for 'Etag'&lt;br /&gt;            if (headers[i].indexOf('Etag') != -1) {&lt;br /&gt;             var s = headers[i];&lt;br /&gt;             &lt;br /&gt;             // create a regular expression to parse the version&lt;br /&gt;             var regx = /^.*Etag: \"(\d+)\/\/.*\"$/;&lt;br /&gt;             regx = regx.exec(s);&lt;br /&gt;             &lt;br /&gt;             // here s will be our version obtained from the svn repository&lt;br /&gt;             s = regx[1]&lt;br /&gt;             &lt;br /&gt;             //  here version would be a previously set version or null&lt;br /&gt;             // if this is the first time running the script&lt;br /&gt;             if (version) {&lt;br /&gt;                      // here we get the nag count&lt;br /&gt;                      var count = getCookie(upgrade_cookie)&lt;br /&gt;                    &lt;br /&gt;                      // if the nag count exists and is greater than 0, then decrement it&lt;br /&gt;                      // and dont prompt to upgrade&lt;br /&gt;                      if (count &amp;&amp; count-- &gt; 0) {&lt;br /&gt;                      // user doesnt want to be notified&lt;br /&gt;                     var now = new Date();&lt;br /&gt;                     window.fixDate(now);&lt;br /&gt;                     now.setTime(now.getTime() +  31*24*60*60*1000); // expire in a month&lt;br /&gt;                     deleteCookie(upgrade_cookie);&lt;br /&gt;                     setCookie(upgrade_cookie, count, now,"/", scriptname + ".com");&lt;br /&gt;                     GM_log("Wont nag for " + count +" more reloads ....");&lt;br /&gt;                     return;&lt;br /&gt;                       }&lt;br /&gt;                    &lt;br /&gt;                    // so we have found a newer version of the script prompt to upgrade                    &lt;br /&gt;                    if (s &gt; version) { &lt;br /&gt;                      // ask the user if they wish to upgrade&lt;br /&gt;                      // if they choose not to, then set a cookie to wait 'delay' page&lt;br /&gt;                      // refreshes and then notify them to upgrade again&lt;br /&gt;                      if (confirm("A newer version of this script exists!\n\tRemote Version: " +s+"\n\tYour Version: "+version+"\nWould you like to upgrade now?")) {&lt;br /&gt;                     setCookie(upgrade_cookie, -1, null, "/", scriptname + ".com");&lt;br /&gt;                     var now = new Date();&lt;br /&gt;                     window.fixDate(now);&lt;br /&gt;                     now.setTime(now.getTime() +  31*24*60*60*1000); // expire in a month&lt;br /&gt;                     deleteCookie(cookie_name,"/", scriptname + ".com");&lt;br /&gt;                     setCookie(cookie_name, s, now,"/", scriptname + ".com");&lt;br /&gt;                     alert("Please reload the page once the script has been updated!")&lt;br /&gt;                     // here we cause the page to refresh with the location of our script&lt;br /&gt;                     // this will cause greasemonkey to prompt the user to install the script&lt;br /&gt;                     location.replace(url)&lt;br /&gt;                      } else {&lt;br /&gt;                     // set a cookie to upgrade later&lt;br /&gt;                     var now = new Date();&lt;br /&gt;                     window.fixDate(now);&lt;br /&gt;                     now.setTime(now.getTime() +  31*24*60*60*1000); // expire in a month&lt;br /&gt;                     deleteCookie(upgrade_cookie,"/", scriptname + ".com");&lt;br /&gt;                     setCookie(upgrade_cookie, delay, now,"/", scriptname + ".com");&lt;br /&gt;                     GM_log("Won't notify of upgrades for a "+delay+" page refreshes!");&lt;br /&gt;                      }&lt;br /&gt;                    }&lt;br /&gt;               } else {&lt;br /&gt;                     // version wasnt previously set so we set the version in the cookie to&lt;br /&gt;                     // be the current version of the script in svn repository&lt;br /&gt;                     var now = new Date();&lt;br /&gt;                     window.fixDate(now);&lt;br /&gt;                     now.setTime(now.getTime() +  31*24*60*60*1000); // expire in a month&lt;br /&gt;                     deleteCookie(cookie_name,"/", scriptname + ".com");&lt;br /&gt;                     setCookie(cookie_name, s, now,"/", scriptname + ".com");&lt;br /&gt;               }&lt;br /&gt;            }&lt;br /&gt;           }          &lt;br /&gt;          }&lt;br /&gt;   }, &lt;br /&gt;   onerror: function(responseDetails) {&lt;br /&gt;          console.log('GM_xmlhttpRequest error: %s', responseDetails.responseText)&lt;br /&gt;   }, &lt;br /&gt;   onreadystatechange: function(responseDetails) {&lt;br /&gt; &lt;br /&gt;   }&lt;br /&gt;  });&lt;br /&gt; } catch (exception){&lt;br /&gt;  console.log('Error occurred while updating the script %s . The error was: %s', scriptname, exception);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;The code above is commented to indicate the logic behind it. If you need more information, please add a comment and I will explain any discrepancies. Also, if you can think of a better way of doing things, please let me know!&lt;/strong&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Below are the cookie management functions:&lt;/p&gt;&lt;br /&gt;&lt;pre style='overflow:auto;font-family: "Courier New", Courier, monospace; color: #000000; background-color: #CCCCCC; border: thin solid #000000;'&gt;&lt;br /&gt;window.setCookie = function (name, value, expires, path, domain, secure) {&lt;br /&gt;  var curCookie = name + "=" + escape(value) +&lt;br /&gt;      ((expires) ? "; expires=" + expires.toGMTString() : "") +&lt;br /&gt;      ((path) ? "; path=" + path : "") +&lt;br /&gt;      ((domain) ? "; domain=" + domain : "") +&lt;br /&gt;      ((secure) ? "; secure" : "");&lt;br /&gt;   &lt;br /&gt;  document.cookie = curCookie;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;window.getCookie = function (name) {&lt;br /&gt;  var dc = document.cookie;&lt;br /&gt;  var prefix = name + "=";&lt;br /&gt;  var begin = dc.indexOf("; " + prefix);&lt;br /&gt;  if (begin == -1) {&lt;br /&gt;    begin = dc.indexOf(prefix);&lt;br /&gt;    if (begin != 0) return null;&lt;br /&gt;  } else&lt;br /&gt;    begin += 2;&lt;br /&gt;  var end = document.cookie.indexOf(";", begin);&lt;br /&gt;  if (end == -1)&lt;br /&gt;    end = dc.length;&lt;br /&gt; &lt;br /&gt;  return unescape(dc.substring(begin + prefix.length, end));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;window.deleteCookie = function (name, path, domain) {&lt;br /&gt;  if (getCookie(name)) {&lt;br /&gt;    document.cookie = name + "=" +&lt;br /&gt;    ((path) ? "; path=" + path : "") +&lt;br /&gt;    ((domain) ? "; domain=" + domain : "") +&lt;br /&gt;    "; expires=Thu, 01-Jan-70 00:00:01 GMT";&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;window.fixDate = function (date) {&lt;br /&gt;  var base = new Date(0);&lt;br /&gt;  var skew = base.getTime();&lt;br /&gt;  if (skew &gt; 0)&lt;br /&gt;    date.setTime(date.getTime() - skew); &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This is how one could call the this function from within their userscript.&lt;/p&gt;&lt;br /&gt;&lt;pre style='overflow:auto;font-family: "Courier New", Courier, monospace; color: #000000; background-color: #CCCCCC; border: thin solid #000000;'&gt;&lt;br /&gt;window.check4Update({'url':'http://someurl.com/my_script.user.js', 'scriptname':'my_script_name', 'delay':7});&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Finally, all of the code mentioned above was placed in my Greasemonkey userscript at the end of the onload event handler:&lt;/p&gt;&lt;br /&gt;&lt;pre style='overflow:auto;font-family: "Courier New", Courier, monospace; color: #000000; background-color: #CCCCCC; border: thin solid #000000;'&gt;&lt;br /&gt;window.addEventListener('load',&lt;br /&gt;  function () {&lt;br /&gt;//... your user script code here ... //&lt;br /&gt;&lt;br /&gt;// ... the auto update code here ... //&lt;br /&gt; }&lt;br /&gt;,true);&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Good luck! &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-5890889102350245265?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/5890889102350245265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=5890889102350245265' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5890889102350245265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5890889102350245265'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2007/08/greasemonkey-auto-updating-userscripts.html' title='Greasemonkey &amp; Auto Updating Userscripts With Subversion'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-597846599678597416</id><published>2007-08-01T10:35:00.000-07:00</published><updated>2007-08-01T11:53:44.961-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>Creating a Modular 'Waiting' dialog in javascript</title><content type='html'>Have you ever needed to create a modular pop up that displayed a message to the user while you did some processing in the background? I have and I got fed up of constantly creating a new modular pop up each time.&lt;br /&gt;&lt;br /&gt;The following javascript code is easy to use and is based upon the &lt;a href="http://www.hunlock.com/blogs/Snippets:_Howto_Grey-Out_The_Screen#"&gt;grayOut&lt;/a&gt; javascript function.&lt;br /&gt;&lt;p&gt;This snippet of code creates a modal dialog box. This is useful for times when you want to make the user wait while you do something in the background or if you would like to make the user aware of something on the page. While the dialog box is active, most interactive elements on the page (links, etc) are inactive. &lt;/p&gt;&lt;p&gt;The dialog box is dynamically created and can be customized to a certain height and width. The dialog box has a high z-index and should be placed above most other elements.  Items which have a higher z-index than the dialog box will appear on top of the dialog box. &lt;/p&gt;&lt;p&gt;By default the dialog box has a z-index of 100.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Other default parameters are:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;height   - 25% of the page height&lt;/li&gt;&lt;li&gt;width     - 35% of the page width&lt;/li&gt;&lt;li&gt;opacity  - 90% (i.e. semi-transparent)&lt;/li&gt;&lt;li&gt;border style - solid&lt;/li&gt;&lt;li&gt;border color - black&lt;/li&gt;&lt;li&gt;border width - 3px&lt;/li&gt;&lt;li&gt;text alignment - center&lt;/li&gt;&lt;li&gt;many others ...&lt;/li&gt;&lt;/ul&gt;All of the above can be configured to your liking. Look at the comments in the script for more customization features.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=18690850&amp;postID=597846599678597416#" onclick="modular_waiting(true,'Here is the message..'); alert('Example!'); modular_waiting(false); return false;"&gt;Example&lt;/a&gt;.   This snippet has been tested in Firefox 2, Safari 3, and Internet Explorer 7.&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px solid black; padding: 3px; overflow: auto; -moz-border-radius-bottomleft: 3px; -moz-border-radius-bottomright: 3px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; background-color: rgb(221, 221, 221); cursor: default; font-size: 10pt; max-height: 500px;"&gt;&lt;br /&gt;function modular_waiting(vis, msg, options) {&lt;br /&gt;// Pass true to show the dialogue screen, false to hide&lt;br /&gt;// options are optional.  This is a JSON object with the following (optional) properties&lt;br /&gt;// opacity:0-100         // Lower number implies a more transparent dialog box&lt;br /&gt;// zindex: #             // HTML elements with a higher zindex appear on top of others with a lower number&lt;br /&gt;// height: 0-100         // The height in percentage terms relative to the browser screen&lt;br /&gt;// width:  0-100         // The width in percentage terms relative to the browser screen&lt;br /&gt;// name: text         // A name for your dialog box - this is what you will refer to when showing and hiding the dialog&lt;br /&gt;// align: text         // Should the text be placed in the: center, justify, left or right&lt;br /&gt;// fontcolor: (#xxxxxx)  // Standard RGB Hex color code&lt;br /&gt;// fontweight: 100-900   // The boldness of the text in increments of 100. 900 implies maximum boldness&lt;br /&gt;// bgcolor: (#xxxxxx)    // Standard RGB Hex color code&lt;br /&gt;// borderwidth: #     // The thickness of the border&lt;br /&gt;// bordercolor: (#xxxxxx)// The color of the border in HEX&lt;br /&gt;// borderstyle: text     // The style of the border. One of dashed, dotted, double, groove, inset, none, outset, ridge, solid&lt;br /&gt;// modular_waiting(false); // hide the dialog&lt;br /&gt;// modular_waiting(true, 'my message to show here', {'name':'myName', 'zindex':'50', 'bgcolor':'#0000FF', 'opacity':'70'}); // show the dialog&lt;br /&gt;// Because options is JSON opacity/zindex/bgcolor are all optional and can appear&lt;br /&gt;// in any order.  Pass only the properties you need to set.&lt;br /&gt;var options   = options || {};&lt;br /&gt;var zindex   = options.zindex || 100;&lt;br /&gt;var height   = options.height || 25;&lt;br /&gt;var width   = options.width || 35;&lt;br /&gt;var opacity   = options.opacity || 90;&lt;br /&gt;var opaque   = (opacity / 100);&lt;br /&gt;var bgcolor   = options.bgcolor || '#FFDC75';&lt;br /&gt;var fColor   = options.fontcolor || '#0000FF';&lt;br /&gt;var fWeight  = options.fontweight || 600;&lt;br /&gt;var bcolor   = options.bordercolor || 'black';&lt;br /&gt;var bstyle  = options.borderstyle || 'solid'&lt;br /&gt;var bwidth  = options.borderweight || '3px'&lt;br /&gt;var align   = options.align || 'center';&lt;br /&gt;var __div_id__ = options.name ||  '__modular__popup__';&lt;br /&gt;&lt;br /&gt;var dark=document.getElementById(__div_id__ );&lt;br /&gt;&lt;br /&gt;if (!dark) {&lt;br /&gt;var tbody = document.getElementsByTagName("body")[0];&lt;br /&gt;var tnode = document.createElement('div');       // Create the layer.&lt;br /&gt;tnode.style.position='fixed';                 // Position absolutely&lt;br /&gt;tnode.style.overflow='auto';&lt;br /&gt;tnode.style.display='none';                      // Start out Hidden&lt;br /&gt;tnode.id=__div_id__ ;                    // Name it so we can find it later&lt;br /&gt;tbody.appendChild(tnode);                        // Add it to the web page&lt;br /&gt;dark=document.getElementById(__div_id__ );       // Get the object.&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (vis) {&lt;br /&gt;var txt = document.createElement('font')&lt;br /&gt;txt.setAttribute('color',fColor);&lt;br /&gt;txt.style.fontWeight = fWeight;&lt;br /&gt;txt.innerHTML = msg.replace(/\"/g,""").replace(/\'/g,"'").replace(/\/g,"&amp;gt;").replace(/\n/g,"&amp;lt;br/&amp;gt;")&lt;br /&gt;&lt;br /&gt;dark.style.border = bwidth + " " + bstyle + " " + bcolor;&lt;br /&gt;dark.setAttribute('align',align);&lt;br /&gt;dark.style.opacity=opaque;    &lt;br /&gt;dark.style.MozOpacity=opaque; &lt;br /&gt;dark.style.filter='alpha(opacity='+opacity+')';&lt;br /&gt;dark.style.zIndex=zindex;&lt;br /&gt;dark.style.backgroundColor=bgcolor;&lt;br /&gt;dark.style.width= width+'%';&lt;br /&gt;dark.style.height= height+ '%';&lt;br /&gt;dark.style.display='block';&lt;br /&gt;dark.style.cursor = 'wait';&lt;br /&gt;dark.appendChild(txt);&lt;br /&gt;dark.style.left =  '40%'&lt;br /&gt;dark.style.top  =  '50%'&lt;br /&gt;} else {&lt;br /&gt;// TODO - should i remove the element?&lt;br /&gt;dark.style.display='none';&lt;br /&gt;dark.innerHTML = "";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Activate/Deactivate with a function call to modular_waiting(vis, msg, options).&lt;/p&gt;&lt;p&gt;   &lt;q&gt;vis&lt;/q&gt; is a true/false variable.  If you pass true, the dialog will appear. If you pass false, the dialog will be removed.&lt;/p&gt;&lt;p&gt;"msg" is the message that you would like to display.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;q&gt;options&lt;/q&gt; is an optional JSON object this allows you to send only the properties you want modified.  You don't have to pass options if you don't want. modular_waiting(true,"Hello world") and modular_waiting(false) will work quite nicely.  &lt;/p&gt;To set all of the options, do the following {'opacity':'70', 'bgcolor':'#0000FF', 'zindex':'25', 'height':'50','height':'50', 'name':'myPopUpDialog', 'align':'left', 'fontcolor':'red', 'fontweight':'900', 'bgcolor':'yellow', 'borderwidth':'5', 'bordercolor':'blue', 'borderstyle':'dotted'     }.  This will create a somewhat transparent dialog box that covers approximately 50% of the window, with text aligned left, colored red and bold on a yellow background and a dotted, blue border!&lt;br /&gt;&lt;br /&gt;Feel free to change the values yourself!&lt;br /&gt;&lt;br /&gt;Order doesn't matter, mix and match however you wish.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-597846599678597416?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/597846599678597416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=597846599678597416' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/597846599678597416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/597846599678597416'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2007/08/creating-modular-waiting-dialog-in.html' title='Creating a Modular &apos;Waiting&apos; dialog in javascript'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-7860876390230913607</id><published>2007-06-05T06:45:00.000-07:00</published><updated>2007-06-05T08:02:52.005-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='investments'/><category scheme='http://www.blogger.com/atom/ns#' term='equities'/><category scheme='http://www.blogger.com/atom/ns#' term='dow'/><title type='text'>The Dogs of the Dow - Half Year Performance 2007</title><content type='html'>Previously, I talked about &lt;a href="http://ekawas.blogspot.com/2006/12/dogs-of-dow-for-2007.html"&gt;the dogs of the dow&lt;/a&gt; and how you could use that as a strategy. Below is an update for those that are interested in this investment strategy. The table includes the Dow component and it's year to date increase.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Please note that dividends are not re-invested, but are included in the rate of return.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;As of June 4, 2007:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="text-align: left; margin-left: auto; margin-right: auto;" border="1" cellpadding="3" cellspacing="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: left;" class="left"&gt;Pfizer&lt;/td&gt;&lt;td&gt;5.8%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;Verizon Communications&lt;/td&gt;&lt;td&gt;15.9%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;Altria&lt;/td&gt;&lt;td style="color: rgb(255, 0, 0);"&gt;-16.1%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;AT&amp;T&lt;/td&gt;&lt;td&gt;19.2%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;Citigroup&lt;/td&gt;&lt;td style="color: rgb(255, 0, 0);"&gt;0.0%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;Merck&lt;/td&gt;&lt;td&gt;18.5%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;General Motors&lt;/td&gt;&lt;td&gt;4.0%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;General Electric&lt;/td&gt;&lt;td&gt;0.3%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;Dupont&lt;/td&gt;&lt;td&gt;9.3%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;Coca-Cola&lt;/td&gt;&lt;td&gt;9.1%&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;The overall rate of return for the first 6 months was about 6.6%.&lt;br /&gt;The overall gain  for the Dow in the same period was roughly  9.3%.&lt;br /&gt;&lt;br /&gt;There were 2 components in negative territory (Citigroup was slightly in the red and Altria was in the red by double digits).&lt;br /&gt;&lt;br /&gt;Cheers!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Disclaimer:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul style="font-style: italic; font-weight: bold;"&gt;&lt;li&gt;&lt;span style="font-size: 85%;"&gt;I am not be liable for any investment  decision made or action taken based upon the information on this page.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 85%;"&gt;I suggest you check with a broker or financial adviser before making any stock investing decisions.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic; font-size: 85%;"&gt;I am not offering financial advise, but rather commenting on widely available investment strategies.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic; font-size: 85%;"&gt;Finally, &lt;/span&gt;&lt;span style=""&gt;Caveat emptor!&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-7860876390230913607?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/7860876390230913607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=7860876390230913607' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/7860876390230913607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/7860876390230913607'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2007/06/dogs-of-dow-half-year-performance-2007.html' title='The Dogs of the Dow - Half Year Performance 2007'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-5481077223868017539</id><published>2007-05-03T06:00:00.000-07:00</published><updated>2007-05-04T09:38:45.276-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='investments'/><category scheme='http://www.blogger.com/atom/ns#' term='calls'/><category scheme='http://www.blogger.com/atom/ns#' term='options'/><category scheme='http://www.blogger.com/atom/ns#' term='gold'/><category scheme='http://www.blogger.com/atom/ns#' term='naked'/><category scheme='http://www.blogger.com/atom/ns#' term='puts'/><category scheme='http://www.blogger.com/atom/ns#' term='covered'/><category scheme='http://www.blogger.com/atom/ns#' term='equities'/><title type='text'>Gold Stocks - Trade Idea Part 2</title><content type='html'>Last time, I talked about &lt;a href="http://ekawas.blogspot.com/2007/04/gold-stocks-trade-idea.html"&gt;naked put selling on gold stocks&lt;/a&gt; that you wouldn't mind owning. Let's assume, following the earlier example, that at the end of May you are 'put' into Barrick Gold Corp because the stock traded lower than the strike price of the put options you wrote (i.e. $30 USD).&lt;br /&gt;&lt;br /&gt;This means that you are now the proud owner of 500 shares of ABX. What can you do? You could hold the stock and hope it goes up or you could sell the stock for a slight loss (remember, it must be less than $30 because you were 'put' into the stock). Alternatively, you could &lt;span style="font-weight: bold;"&gt;write covered calls&lt;/span&gt; on the stock.&lt;br /&gt;&lt;br /&gt;So, what is a 'call'? A &lt;a href="http://en.wikipedia.org/wiki/Call_option"&gt;call option&lt;/a&gt; is an agreement that gives an investor the right (but not the obligation) to buy a stock (or some other other financial instrument) at a specified price within a specific time period. If you sell someone the right to buy stock  that you own, then this is a covered call.&lt;br /&gt;&lt;br /&gt;Imagine now that you sell 5 call contracts that expire in one months' time at the $30 strike price. Imagine that each contract is trading at $0.75. This would mean that you would receive:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;$0.75 x 500 or $375 for selling someone the right to buy your stock in one months' time!&lt;/li&gt;&lt;/ul&gt;If at the end of next month, the stock is trading below the strike price of $30, then you keep your stock and the $375 that you made on the call options. For argument's sake, if the stock is trading at $50, you are obligated to sell your stock for $30. In other words, if on the day of expiration for your call option, ABX is trading at any price over $30, you must deliver your stock for $30.&lt;br /&gt;&lt;br /&gt;Let's assume now that for one year, you write naked put options for ABX, and when you are put into the stock you write covered calls. Moreover, when you called to deliver your stock, you write naked puts for the following month. In other words, every month that goes by, you either own ABX and sell covered calls, or don't own ABX and sell naked puts.&lt;br /&gt;&lt;br /&gt;Let's also assume that your monthly premium on the option writing is approximately $0.85. Then each month, you generate about 500 x $0.85 or $425. For the year, you would generate about $5,100. Remembering that you had to initially have $15,000 in your account to cover the naked put options, you are looking at yearly rate of return of about 33%. Not too shabby!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Disclaimer:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul style="font-style: italic; font-weight: bold;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;I am not be liable for any investment  decision made or action taken based upon the information on this page.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;I suggest you check with a broker or financial adviser before making any stock investing decisions.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;I am not offering financial advise, but rather commenting on widely available investment strategies.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;Options trading can be extremely risky.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;Finally, &lt;/span&gt;&lt;span style=""&gt;Caveat emptor!&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-5481077223868017539?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/5481077223868017539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=5481077223868017539' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5481077223868017539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5481077223868017539'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2007/05/gold-stocks-trade-idea-part-2.html' title='Gold Stocks - Trade Idea Part 2'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-5369970270352268327</id><published>2007-04-17T07:45:00.000-07:00</published><updated>2007-04-17T09:24:51.254-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='investments'/><category scheme='http://www.blogger.com/atom/ns#' term='options'/><category scheme='http://www.blogger.com/atom/ns#' term='gold'/><category scheme='http://www.blogger.com/atom/ns#' term='equities'/><title type='text'>Gold Stocks - Trade Idea</title><content type='html'>Over the last year, I have benefited from one trading strategy involving gold stocks. First of all, I believe that gold will continue to rise, first as a hedge against inflation and second as a hedge against the falling us dollar.&lt;br /&gt;&lt;br /&gt;With that said, it seems that gold stocks would be the place to be. My strategy is simple: write 'in the money' naked &lt;a href="http://en.wikipedia.org/wiki/Put_option"&gt;put options&lt;/a&gt; on gold stocks that I wouldn't mind owning for the amount of shares that I am willing to buy.&lt;br /&gt;&lt;br /&gt;The seller of a put option has the obligation to buy shares in a company at a specified price at a certain time. In return for this obligation, a put seller gains a premium. Most gold companies are volatile, thus garnering larger premiums.&lt;br /&gt;&lt;br /&gt;As an example, take Barrick Gold Corp (&lt;a href="http://moneycentral.msn.com/detail/stock_quote?Symbol=abx"&gt;ABX &lt;/a&gt;on the NYSE; &lt;a href="http://investdb.theglobeandmail.com/invest/investSQL/gx.stock_today?pi_symbol=ABX-T"&gt;ABX &lt;/a&gt;on the TSX). Currently, this stock is trading at around $30 USD per share. Assuming that you thought this stock was going to follow the price of gold higher and that you wanted to buy 500 shares, then following the strategy above, you would:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; sell 5 put contracts (uncovered) for the month of &lt;a href="http://moneycentral.msn.com/detail/market_quote?symbol=.ABXQF"&gt;May &lt;/a&gt;for a premium of around $1 per contract&lt;/li&gt;&lt;li&gt;ensure that your account has enough money in it to finance the trade (in this example, $15,000)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Doing this, you would gain $500 (minus commissions) and come the third Friday of May, if the stock is trading less than $30, you are obliged to purchase 500 shares at $30 dollars. Otherwise, you keep the $500 and repeat the strategy the next month if you still are bullish on Barrick and the price of Gold.&lt;br /&gt;&lt;br /&gt;Keep in mind that there are numerous gold producing companies out there, not just Barrick Gold and that those companies that exhibit wild fluctuations in daily share price, usually garner larger premiums.&lt;br /&gt;&lt;br /&gt;Good luck.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Disclaimer:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul style="font-style: italic; font-weight: bold;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;I am not be liable for any investment  decision made or action taken based upon the information on this page.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;I suggest you check with a broker or financial adviser before making any stock investing decisions.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;I am not offering financial advise, but rather commenting on widely available investment strategies.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;Finally, &lt;/span&gt;&lt;span style=""&gt;Caveat emptor!&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-5369970270352268327?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/5369970270352268327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=5369970270352268327' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5369970270352268327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5369970270352268327'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2007/04/gold-stocks-trade-idea.html' title='Gold Stocks - Trade Idea'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-3841933431319306580</id><published>2007-03-02T07:51:00.000-08:00</published><updated>2007-03-02T08:09:00.743-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>Solving Pesky ssh Issues in Cygwin</title><content type='html'>Every time that I re-install cygwin and I use ssh for the first time, I encounter minor annoyances. My biggest annoyance is the fact that no matter how many times I log into a remote machine, cygwins' ssh utility tells me the following:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Could not create directory '/home/ME/.ssh'.&lt;br /&gt;The authenticity of host 'xxx.yyy.zzz.ca (1xx.82.67.xx)' can't be established.&lt;br /&gt;RSA key fingerprint is 6c:59:15:64:ed:c8:67:35:d6:ed:1c:a2:ee:87:2b:3f.&lt;br /&gt;Are you sure you want to continue connecting (yes/no)?&lt;br /&gt;&lt;/blockquote&gt;Once I enter 'yes', I get the following:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Failed to add the host to the list of known hosts (/home/ME/.ssh/known_hosts).&lt;/blockquote&gt;&lt;br /&gt;So that message occurs every single time that I attempt to login to the remote machine.&lt;br /&gt;&lt;br /&gt;So the question is, how do I solve this problem? The solution was actually quite simple!&lt;br /&gt;&lt;br /&gt;First locate the file called '&lt;span style="font-weight: bold; font-style: italic;"&gt;passwd&lt;/span&gt;' in your &lt;span style="font-style: italic;"&gt;C:\path\to\cygwin\etc&lt;/span&gt; directory and open it with wordpad.&lt;br /&gt;&lt;br /&gt;Second, replace the text&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;   /home/YOUR_NAME&lt;/span&gt;&lt;br /&gt;with&lt;br /&gt;  &lt;span style="font-weight: bold; font-style: italic;"&gt;/cygdrive/c/Documents and Settings/YOUR_NAME&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Finally, save the file.&lt;br /&gt;&lt;br /&gt;In hindsight, the solution is very straightforward, but it took me hours to finally figure out. Hopefully, I can save your time!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-3841933431319306580?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/3841933431319306580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=3841933431319306580' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/3841933431319306580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/3841933431319306580'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2007/03/solving-pesky-ssh-issues-in-cygwin.html' title='Solving Pesky ssh Issues in Cygwin'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-103018606827959332</id><published>2007-02-03T08:11:00.000-08:00</published><updated>2007-02-03T09:20:47.206-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='maven'/><title type='text'>Maven, Windows and Deploying to a Remote Location</title><content type='html'>If you are a programmer on Windows, some tasks take longer to perform than others. Attempting to set up &lt;a href="http://maven.apache.org/" target="_blank"&gt;maven&lt;/a&gt; so that you can deploy files to a remote machine is one of those tasks!&lt;br /&gt;&lt;br /&gt;Here is what you need to get the job done:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download &lt;a href="http://putty.leetnet.com/latest/x86/putty.exe" target="_blank"&gt;plink&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Download &lt;a href="http://putty.leetnet.com/latest/x86/puttygen.exe" target="_blank"&gt;puttygen&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Download &lt;a href="http://putty.leetnet.com/latest/x86/pscp.exe" target="_blank"&gt;pscp&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;If the above links do not work, use &lt;span style="font-weight: bold;"&gt;Google  &lt;/span&gt;and search for "&lt;span style="font-style: italic;"&gt;putty download&lt;/span&gt;".&lt;br /&gt;&lt;br /&gt;Once you download them, place them in a folder called &lt;span style="font-style: italic;"&gt;putty&lt;/span&gt; and move that folder to your root drive (C:\). The next thing that you should do is add that folder to the PATH. Not sure how to do that?&lt;br /&gt;&lt;ol&gt;&lt;li&gt;press the &lt;span style="font-weight: bold;"&gt;windows key&lt;/span&gt; and '&lt;span style="font-weight: bold;"&gt;pause break&lt;/span&gt;' at the same time.&lt;/li&gt;&lt;li&gt;A system properties panel will appear. Click on the '&lt;span style="font-weight: bold;"&gt;Advanced&lt;/span&gt;' tab.&lt;/li&gt;&lt;li&gt;Click on the '&lt;span style="font-weight: bold;"&gt;Environment Variables&lt;/span&gt;' button.&lt;/li&gt;&lt;li&gt;Locate the PATH variable from the &lt;span style="font-style: italic;"&gt;System variables&lt;/span&gt; portion of the panel and choose '&lt;span style="font-weight: bold;"&gt;Edit&lt;/span&gt;'.&lt;/li&gt;&lt;li&gt;Append, without quotations, '&lt;span style="font-style: italic; font-weight: bold;"&gt;;c:\putty;&lt;/span&gt;' to the end of the PATH value.&lt;/li&gt;&lt;li&gt;close the panels and you are done!&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Now you need to create a private key from the remote server that you would like to deploy your files to.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;ssh into the remote machine&lt;/li&gt;&lt;li&gt;execute the following command on the remote machine&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;ssh-keygen -b 1024 -f ssh_host_key -N '' -t rsa&lt;br /&gt;&lt;/span&gt;This will create a file called ssh_host_key.&lt;span style="font-weight: bold; font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;On your local machine, create a folder called &lt;span style="font-weight: bold; font-style: italic;"&gt;c:\ssh&lt;/span&gt; and place the file, &lt;span style="font-weight: bold; font-style: italic;"&gt;ssh_host_key&lt;/span&gt;, in that folder from the remote machine.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;The key that we generated on the remote machine will now be used to create one that is compatible with &lt;span style="font-style: italic;"&gt;putty&lt;/span&gt;. We will now use &lt;span style="font-style: italic;"&gt;puttygen&lt;/span&gt; to create a 'putty' private key.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Double click the file puttygen.&lt;/li&gt;&lt;li&gt;Make sure that you select you select '&lt;span style="font-weight: bold; font-style: italic;"&gt;ssh-2 RSA&lt;/span&gt;' at the bottom of the page.&lt;/li&gt;&lt;li&gt;Next choose, &lt;span style="font-weight: bold;"&gt;Conversion -&gt; import&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;Select &lt;span style="font-weight: bold;"&gt;c:\ssh\ssh_host_key&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;Save the generated key (save both the public/private key) in c:\ssh.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Most of the 'hard' stuff is now done. Next we will add our remote server to our local maven configuration. To do this, we will have to modify the file &lt;span style="font-weight: bold; font-style: italic;"&gt;settings.xml&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The settings.xml file is usually located in&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;c:\Documents and Settings\&lt;/span&gt;&lt;your&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;&amp;lt;user&amp;gt;\.m2.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Before proceeding, you should back up the file. Open settings.xml in Wordpad and add the following fragment of xml into the file:&lt;br /&gt;&lt;/your&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;server&amp;gt;&lt;br /&gt; &amp;lt;id&amp;gt;&lt;span style="font-weight: bold;"&gt;remote-repository-id&lt;/span&gt;&amp;lt;/id&amp;gt;&lt;br /&gt; &amp;lt;username&amp;gt;&lt;span style="font-weight: bold;"&gt;your_username_here&lt;/span&gt;&amp;lt;/username&amp;gt;&lt;br /&gt; &amp;lt;password&amp;gt;&lt;span style="font-weight: bold;"&gt;your password here&lt;/span&gt;&amp;lt;/password&amp;gt;&lt;br /&gt; &amp;lt;privateKey&amp;gt;&lt;span style="font-weight: bold;"&gt;c:/ssh/your_private_key.pkk&lt;/span&gt;&amp;lt;/privateKey&amp;gt;&lt;br /&gt; &amp;lt;configuration&amp;gt;&lt;br /&gt;  &amp;lt;sshExecutable&amp;gt;plink&amp;lt;/sshExecutable&amp;gt;&lt;br /&gt;  &amp;lt;scpExecutable&amp;gt;pscp&amp;lt;/scpExecutable&amp;gt;&lt;br /&gt; &amp;lt;/configuration&amp;gt;&lt;br /&gt;&amp;lt;/server&amp;gt;&lt;br /&gt;&lt;/pre&gt;That piece of xml goes in the &lt;span style="font-weight: bold; font-style: italic;"&gt;servers&lt;/span&gt; portion of the file. Add it and modify the bold pieces of the text.&lt;br /&gt;&lt;br /&gt;That's really all there is to do. However, if you are lazy, like myself, then create a windows batch file that does the deploying for you!&lt;br /&gt;&lt;br /&gt;Below is one that I use. You will have to modify the lines in bold. Run it without arguments first, to have it display the usage!&lt;br /&gt;&lt;br /&gt;@echo off&lt;br /&gt;if "%1"=="" GOTO ERROR&lt;br /&gt;if "%2"=="" GOTO ERROR&lt;br /&gt;GOTO DEPLOY&lt;br /&gt;&lt;br /&gt;:ERROR&lt;br /&gt;@echo off&lt;br /&gt;echo There was an error deploying file.&lt;br /&gt;echo     usage:&lt;br /&gt;echo       %0 jar pom [repository_id]&lt;br /&gt;goto END&lt;br /&gt;&lt;br /&gt;:DEPLOY&lt;br /&gt;setlocal&lt;br /&gt;set REPO=%3&lt;br /&gt;if "%3"=="" set REPO=&lt;span style="font-weight: bold; font-style: italic;"&gt;remote-repository-id&lt;/span&gt;&lt;br /&gt;@echo on&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;REM should be on one line!&lt;/span&gt;&lt;br /&gt;mvn deploy:deploy-file -Dfile=%1 -DpomFile=%2  -Durl=scpexe://&lt;span style="font-weight: bold;"&gt;remote_server_domain/:/remote/path/to/maven/  &lt;/span&gt;-DrepositoryId=%REPO%&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;REM end one line&lt;/span&gt;&lt;br /&gt;endlocal&lt;br /&gt;@echo off&lt;br /&gt;GOTO END&lt;br /&gt;&lt;br /&gt;:END&lt;br /&gt;@echo off&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-103018606827959332?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/103018606827959332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=103018606827959332' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/103018606827959332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/103018606827959332'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2007/02/maven-windows-and-deploying-to-remote.html' title='Maven, Windows and Deploying to a Remote Location'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-5586778659832160084</id><published>2006-12-31T10:58:00.000-08:00</published><updated>2006-12-31T11:38:00.792-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='investments'/><title type='text'>Dogs of the Dow for 2007</title><content type='html'>&lt;span style="font-style: italic;"&gt;This is my first public mention of the stock market, so please bear with me ... &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Every year, I find myself worrying about where to place my money for the upcoming year. Last year around this time, I really liked metals and mining stocks. The year before that, it was oil and gas royalty trusts (I am a Canadian investor).&lt;br /&gt;&lt;br /&gt;This year, I find myself intrigued with the 'Dogs of the Dow' theory, which according to &lt;a style="font-style: italic;" href="http://en.wikipedia.org/wiki/Dogs_of_the_Dow"&gt;wikipedia,&lt;/a&gt; is where 'an investor should annually select for investment the ten &lt;a href="http://en.wikipedia.org/wiki/Dow_Jones_Industrial_Average" title="Dow Jones Industrial Average"&gt;Dow Jones Industrial Average&lt;/a&gt; stocks whose &lt;a href="http://en.wikipedia.org/wiki/Dividend" title="Dividend"&gt;dividend&lt;/a&gt; is the highest fraction of their price.'&lt;br /&gt;&lt;br /&gt;According to the &lt;a href="http://www.sinletter.com/dogsofthedow.aspx"&gt;SINLetter&lt;/a&gt;, the Dogs faired quite well in 2006 in comparison to the rest of the Dow (and other American markets).&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;strong&gt;Dogs Of The Dow Performance Vs Major Indices&lt;/strong&gt;                                                                                                       &lt;/div&gt;&lt;table style="text-align: left; margin-left: auto; margin-right: auto; width: 576px; height: 162px;" class="tablefont" border="1"&gt;&lt;tbody&gt;&lt;tr&gt;                       &lt;td width="250"&gt;2006 Dogs of the Dow&lt;/td&gt;                       &lt;td width="50"&gt;                       &lt;span style="color: rgb(160, 206, 61);"&gt;24.8%&lt;/span&gt;                       &lt;/td&gt;&lt;/tr&gt;                     &lt;tr&gt;&lt;td width="250"&gt;Dow Jones Industrial Average&lt;/td&gt;&lt;td width="50"&gt;&lt;span style="color: rgb(160, 206, 61);"&gt;16.29%&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="250"&gt;S&amp;P 500&lt;/td&gt;&lt;td width="50"&gt;&lt;span style="color: rgb(160, 206, 61);"&gt;13.62%&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="250"&gt;Nasdaq&lt;/td&gt;&lt;td width="50"&gt;&lt;span style="color: rgb(160, 206, 61);"&gt;9.52%&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="250"&gt;Russell 2000&lt;/td&gt;&lt;td width="50"&gt;&lt;span style="color: rgb(160, 206, 61);"&gt;17%&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;The 2007 picks for the dogs of the Dow are as follows (Name/Yield):&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;table style="text-align: left; margin-left: auto; margin-right: auto;" border="1" cellpadding="3" cellspacing="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: left;" class="left"&gt;Pfizer&lt;/td&gt;&lt;td&gt;4.45%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;Verizon Communications&lt;/td&gt;&lt;td&gt;4.34%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;Altria&lt;/td&gt;&lt;td&gt;4.13%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;AT&amp;T&lt;/td&gt;&lt;td&gt;4.00%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;Citigroup&lt;/td&gt;&lt;td&gt;3.87%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;Merck&lt;/td&gt;&lt;td&gt;3.49%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;General Motors&lt;/td&gt;&lt;td&gt;3.27%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;General Electric&lt;/td&gt;&lt;td&gt;3.07%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;Dupont&lt;/td&gt;&lt;td&gt;3.02%&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class="left"&gt;Coca-Cola&lt;/td&gt;&lt;td&gt;2.80%&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/div&gt;I have read about some modifications, for instance, picking the top yielding dogs with the smallest market capitalization with the hopes of higher growth which would translate into higher returns. Some opponents of the &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;Dog&lt;/span&gt;&lt;/span&gt; strategy mention that some stocks (usually the high tech ones) pay smaller dividends which result from there consistent exclusion from the list.&lt;br /&gt;&lt;br /&gt;The 'Pigs of the Dow' is another modification of the &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;Dog &lt;/span&gt;&lt;/span&gt;strategy that doesn't exclude any members of the Dow. This strategy entails picking the 10 worst performing Dow stocks of the previous year. Of course, you might want to make sure that they didn't underperform for some obvious reason (maybe there was mention of bankruptcy, or have some form of potentially crippling pending litigation).&lt;br /&gt;&lt;br /&gt;Anyways, I wish you luck with all your investments in the new year! Please feel free to comment on these strategies and to mention others that people might like.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Disclaimer:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul style="font-style: italic; font-weight: bold;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;I am not be liable for any investment  decision made or action taken based upon the information on this page.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;I suggest you check with a broker or financial adviser before making any stock investing decisions.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;I am not offering financial advise, but rather commenting on widely available investment strategies.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;Finally, &lt;/span&gt;&lt;span style=""&gt;Caveat emptor!&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-5586778659832160084?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/5586778659832160084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=5586778659832160084' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5586778659832160084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/5586778659832160084'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2006/12/dogs-of-dow-for-2007.html' title='Dogs of the Dow for 2007'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-3604306924878497196</id><published>2006-12-19T11:05:00.000-08:00</published><updated>2008-05-15T13:00:32.159-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>Intel ProSet Wireless ... Part 2</title><content type='html'>Previously (&lt;a href="http://ekawas.blogspot.com/2006/11/intel-proset-wireless-issues-and.html"&gt;see here&lt;/a&gt;), I had noted some problems that occurred upon performing an upgrade of the drivers for my Dell Intel 2915 ABG Wireless Network Card.&lt;br /&gt;&lt;br /&gt;Specifically, I had to downgrade my router from acting as a wireless G router, to acting as a B/G router. This resulted in slower performance (from the router).&lt;br /&gt;&lt;br /&gt;I am glad to say that this morning, I upgraded my network cards' drivers (&lt;a href="http://support.dell.com/support/downloads/type.aspx?c=us&amp;l=en&amp;amp;s=dfh&amp;SystemID=INS_PNT_6000&amp;amp;os=WW1&amp;osl=en&amp;amp;deviceid=7039&amp;libid=5"&gt;see here&lt;/a&gt;) and it seems like Dell finally corrected this problem. I can safely say that the problems that I have encountered in the past &lt;span style="font-weight: bold; font-style: italic;"&gt;have fully been resolved&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The update is for the Intel wireless adapter model number &lt;span style="font-weight: bold;"&gt;2915 &lt;/span&gt;and &lt;span style="font-weight: bold;"&gt;2200&lt;/span&gt;. Before upgrading, make sure to backup your 'profiles' that you connect to just in case.&lt;br /&gt;&lt;br /&gt;Just thought that I would let you know!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-3604306924878497196?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/3604306924878497196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=3604306924878497196' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/3604306924878497196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/3604306924878497196'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2006/12/intel-proset-wireless-part-2.html' title='Intel ProSet Wireless ... Part 2'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-4366034219472845753</id><published>2006-12-06T15:07:00.000-08:00</published><updated>2006-12-06T15:36:56.063-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tomcat'/><title type='text'>Where is my context.xml coming from!?!</title><content type='html'>I recently modified some JSPs that were being served by Tomcat.  Specifically, I added some 'Environment Entries' so that I could set  some 'global' variables for my webapp.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I added things like the following to my &lt;span style="font-weight: bold; font-style: italic;"&gt;context.xml&lt;/span&gt; file in the &lt;span style="font-style: italic;"&gt;META-INF&lt;/span&gt; directory of my webapp:&lt;br /&gt;&lt;blockquote style="font-weight: bold;"&gt;&lt;pre&gt;&lt;pre&gt;&amp;lt;Environment name="maxExemptions" value="10" type="java.lang.Integer"/&amp;gt;&lt;/pre&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;p&gt;So that during execution I could do load the variable and use it like so:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Context c = new InitialContext();&lt;br /&gt;String maxExemptions =&lt;br /&gt;  ((Integer)c.lookup("java:comp/env/maxExemptions")).intValue();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;/blockquote&gt;After I deployed my new code, I tested it and found out quickly that the &lt;strong&gt;javax.naming.NamingException&lt;/strong&gt; were being throw. The error basically stated that the variable was not bound in this context.&lt;br /&gt;&lt;p&gt;At first I thought that I did the whole looking up stored properties incorrectly. What really happened though, was that in my&lt;br /&gt;&lt;br /&gt;          &lt;span style="font-weight: bold; font-style: italic;"&gt;/${catalina.home}/conf/Catalina/localhost/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;directory was a&lt;span style="font-style: italic;"&gt; cached copy of my context.xml&lt;/span&gt; file under the name of &lt;span style="font-style: italic;"&gt;'my_webapps_name'&lt;/span&gt;.xml.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Once I deleted that and restarted Tomcat, everything worked as expected.&lt;/p&gt;&lt;p&gt;If you came here trying to debug &lt;strong&gt;javax.naming.NamingException&lt;/strong&gt;s, I recommend that you first try removing that file first!&lt;/p&gt;&lt;p&gt;Good Luck!  &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-4366034219472845753?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/4366034219472845753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=4366034219472845753' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/4366034219472845753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/4366034219472845753'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2006/12/where-is-my-contextxml-coming-from.html' title='Where is my context.xml coming from!?!'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-2713366932148915001</id><published>2006-11-22T12:34:00.000-08:00</published><updated>2006-11-22T12:56:57.709-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gaming'/><title type='text'>Funny EA Sports NHL 2007 Bug</title><content type='html'>I came across a bug that I reported to &lt;a href="http://www.ea.com/"&gt;EA&lt;/a&gt; but wanted to share since I haven't come across anyone else that has encountered it before.&lt;br /&gt;&lt;br /&gt;   The basic gist of the bug is that there is an extra goalie on one of the teams. Moreover, the team that has the extra goalie seems to steal this man from the other team because they are one man shy. So not only does one team have an extra goalie, the extra man was taken from the other team!&lt;br /&gt;&lt;br /&gt;   Oddly, enough, I really like this bug. It's really fun trying to deke out both goalies. Right when you think that you have beat one of them, the other dives across and saves the day. Who knows, maybe EA should add a mini-game in the next installment that allows you to play against a team with an extra on ice goalie.&lt;br /&gt;&lt;br /&gt;   So how does one re-create this bug?&lt;br /&gt;&lt;ul&gt;&lt;li&gt;First of all, I have an Xbox 360, so that is the only platform that I have tried this game on. So all other consoles are out of luck.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Second, the bug has happened to me many times, and only when playing against a friend using the 'play now' mode. The team that always seems to be on the ice when this happens are the Buffalo Sabres. For the screenshots below, they were playing against Colorado.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Thirdly, you have to edit your lines once you have chosen your teams and before loading the game. When changing your lines, try to have as many players listed as '&lt;span style="font-style: italic;"&gt;undefined, undefined, undefined&lt;/span&gt;'. If you don't know what I mean, try double shifting players repeatedly until this glitch occurs.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Finally, go on and play the game. During a face off, you will notice that all of a sudden both teams are 4 on 4. After the face off, a player will come off the bench and his team will have an extra goalie.&lt;/li&gt;&lt;/ul&gt;So below are some screen shots that I took when I encountered the bug. Sorry if they are out of focus, but I am sure that you get the point!&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/4898/2281/1600/DSCF0051.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger2/4898/2281/320/DSCF0051.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/4898/2281/1600/DSCF0053.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger2/4898/2281/320/DSCF0053.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/4898/2281/1600/DSCF0052.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger2/4898/2281/320/DSCF0052.jpg" alt="" border="0" /&gt;&lt;/a&gt;&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/18690850-2713366932148915001?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/2713366932148915001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=2713366932148915001' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/2713366932148915001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/2713366932148915001'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2006/11/funny-ea-sports-nhl-2007-bug.html' title='Funny EA Sports NHL 2007 Bug'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-6642379069661258782</id><published>2006-11-09T14:58:00.000-08:00</published><updated>2008-05-15T12:59:56.284-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>Intel ProSet Wireless Issues and Solutions</title><content type='html'>I decided today that I would update the drivers for my Intel Pro/Wireless 2915ABG Network Card. This is the network card that came with my Dell Inspiron 6000.&lt;br /&gt;&lt;br /&gt;Downloading the file from Dell's website was no problem at all. The only thing that bothers me is that the file is 100MB. A bit large for something that just handles wireless connections don't you think?&lt;br /&gt;&lt;br /&gt;Anyways, in the past all attempts of upgrading my drivers have led to failure. For one reason or another, the upgrade doesn't work and I revert to old drivers. I always wonder what it is that I am missing ...&lt;br /&gt;&lt;br /&gt;Back to the story ... I downloaded the drivers and installed them. I wasn't surprised when I was unable to connect to my network. Another upgrade, and another failure... Wait, not this time. I was determined to see it through.&lt;br /&gt;&lt;br /&gt;To save you from my ramblings, this is what I found:&lt;ol&gt;&lt;li&gt;My Intel wireless card does not like my wireless router.&lt;/li&gt;&lt;li&gt;To get my router and the wireless card talking, I had to downgrade router. Actually, I went from a purely G router, to a mixed mode B/G setting.&lt;/li&gt;&lt;li&gt;My wireless card likes to beep when it connects to a network&lt;/li&gt;&lt;/ol&gt;    Okay, so point 2 solved my incompatiblity issue. That's great, except I wish that I didn't have to run in mixed mode. To make sure that my wireless card isn't running in B mode, I made sure that the adapters &lt;span style="font-weight: bold; font-style: italic;"&gt;'Wireless Mode'&lt;/span&gt; was set to &lt;span style="font-weight: bold;"&gt;'802.11g only'.&lt;/span&gt; You can modify this setting from the &lt;span style="font-weight: bold; font-style: italic;"&gt;'Advanced'&lt;/span&gt; tab of the wireless card's properties panel  (&lt;span style="font-weight: bold;"&gt;Control + A&lt;/span&gt; from within the Intel ProSet/Wireless application window).&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/4898/2281/1600/wireless.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 376px; height: 364px;" src="http://photos1.blogger.com/blogger2/4898/2281/320/wireless.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As for point 3 above, the beeping, I think that I managed to fix that by modifying a setting in the &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;Intel PROSet/Wireless Application Settings&lt;/span&gt;&lt;/span&gt; (issue a &lt;span style="font-weight: bold; font-style: italic;"&gt;Control + P&lt;/span&gt; from within the application) window. The setting that I changed was to uncheck the '&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;Show Information Notifications' &lt;/span&gt;&lt;/span&gt;box. This seemed to work for me.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/4898/2281/1600/beep.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger2/4898/2281/320/beep.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;All in all, I am glad that I finally was able to upgrade my drivers. Hope that you can too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-6642379069661258782?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/6642379069661258782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=6642379069661258782' title='25 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/6642379069661258782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/6642379069661258782'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2006/11/intel-proset-wireless-issues-and.html' title='Intel ProSet Wireless Issues and Solutions'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>25</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-116225629706595355</id><published>2006-10-30T16:51:00.000-08:00</published><updated>2006-11-02T07:21:37.406-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tomcat'/><title type='text'>Scheduling an Ongoing Task in a Servlet</title><content type='html'>&lt;p&gt;Recently, I had the need to create a task that had to run hourly, with  the stats to be available to clients. I wanted the task to be  distributed without having to worry about configuring a database store,  etc.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The solution I came up with was to create a JAVA servlet and use a &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Timer.html" target="_blank"&gt;Timer&lt;/a&gt; object to schedule a &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/TimerTask.html" target="_blank"&gt;timer task&lt;/a&gt; that runs every hour. The task then runs hourly and saves the results in memory.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Usually, creating threads (which is what a TimerTask  object is) in a servlet container is frowned upon because the container  cannot manage the resources used by the user spawned thread. In  addition, whenever your web application is deployed, reloaded, or  undeployed you have to ensure that you clean up after your thread.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The first thing that you will do is implement the &lt;a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContextListener.html" target="_blank"&gt;ServletContextListener&lt;/a&gt; interface. This interface consist of 2 methods that you will have to implement, namely,&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;public void contextInitialized (ServletContextEvent servletContextEvent);&lt;br /&gt;   &lt;br /&gt;     &amp;&lt;br /&gt;   &lt;br /&gt;public void contextDestroyed (ServletContextEvent servletContextEvent);&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The &lt;em&gt;contextInitialized(...) &lt;/em&gt;method is invoked by the servlet container everytime the servlet is 'started up'. So upon initial deployment, this method is called. Everytime you reload your web application, this method is invoked.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The &lt;em&gt;contextDestroyed(...)&lt;/em&gt; method is invoked everytime the web application is shut down, for example, when you reload or un-deploy the web application.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Ideally, anything that you need to do when the web application first starts up should be done in the &lt;em&gt;contextInitialized(...)&lt;/em&gt; method, while anything to undo the initialization should be done in the &lt;em&gt;contextDestroyed(...)&lt;/em&gt; method.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In the &lt;em&gt;&lt;strong&gt;contextInitialized(...)&lt;/strong&gt;&lt;/em&gt; method, the idea is to create a TimerTask object and using the Timer object, schedule it at the desired time interval. Once the scheduling is done, we save the Timer object as an attribute in the ServletContext.&lt;/p&gt;&lt;p&gt;For example, assuming that MyTimerTask extends TimerTask,&lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;  &lt;br /&gt;ServletContext servletContext = servletContextEvent.getServletContext();&lt;br /&gt;try{&lt;br /&gt; // create the timer and timer task objects&lt;br /&gt;  Timer timer = new Timer();&lt;br /&gt; MyTimerTask task = new MyTimerTask();&lt;br /&gt;&lt;br /&gt; // get a calendar to initialize the start time&lt;br /&gt;  Calendar calendar = Calendar.getInstance();&lt;br /&gt; Date startTime = calendar.getTime();&lt;br /&gt;&lt;br /&gt;  // schedule the task to run hourly&lt;br /&gt; timer.scheduleAtFixedRate(task, startTime, 1000 * 60 * 60);&lt;br /&gt;&lt;br /&gt;  // save our timer for later use&lt;br /&gt;  servletContext.setAttribute ("timer", timer);&lt;br /&gt;} catch (Exception e) {&lt;br /&gt; servletContext.log ("Problem initializing the task that was to run hourly: " + e.getMessage ());&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;p&gt;In the &lt;em&gt;&lt;strong&gt;contextDestroyed(...)&lt;/strong&gt;&lt;/em&gt; method, the idea is to clean up after yourself. In our case, this means cancelling any tasks and removing the timer object.&lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;br /&gt;ServletContext servletContext = servletContextEvent.getServletContext();&lt;br /&gt;&lt;br /&gt;// get our timer from the Context&lt;br /&gt;Timer timer = (Timer)servletContext.getAttribute ("timer");&lt;br /&gt;&lt;br /&gt;// cancel all pending tasks in the timers queue&lt;br /&gt;if (timer != null)&lt;br /&gt;timer.cancel();&lt;br /&gt;&lt;br /&gt;// remove the timer from the servlet context&lt;br /&gt;servletContext.removeAttribute ("timer");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;The final thing that we have to do now is make sure that our ServletContextListener is added to our web.xml file.&lt;br /&gt;&lt;p&gt;As a child element of the &lt;em&gt;&lt;strong&gt;&amp;lt;web-app&amp;gt;&lt;/strong&gt;&lt;/em&gt; element, add the following lines of code:&lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;listener&amp;gt;&lt;br /&gt;   &amp;lt;listener-class&amp;gt;your.package.declaration.MyServletContextListener&amp;lt;/listener-class&amp;gt;&lt;br /&gt;&amp;lt;/listener&amp;gt;&lt;/pre&gt;&lt;br /&gt;Where, &lt;em&gt;your.package.declaration&lt;/em&gt; is the package containing the class &lt;em&gt;&lt;strong&gt;MyServletContextListener&lt;/strong&gt; &lt;/em&gt;that implements ServletContextListener! &lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;Now everytime the web application starts up and shuts down, our listener will be invoked. Not only did we create an on-going task, but we scheduled the task and made sure that we cleaned up after ourselves too!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-116225629706595355?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/116225629706595355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=116225629706595355' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/116225629706595355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/116225629706595355'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2006/10/scheduling-ongoing-task-in-servlet.html' title='Scheduling an Ongoing Task in a Servlet'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-116178830202201530</id><published>2006-10-25T07:20:00.000-07:00</published><updated>2006-10-30T18:35:05.649-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>Creating Your Own Cat 5 Cable</title><content type='html'>The other day I wanted to create an Ethernet outlet in one of my rooms. I bought a network switch, some 'high' quality cat 5 cable, an outlet, some rj45 plug ends  and a crimper.&lt;br /&gt;&lt;br /&gt;Wiring the outlet was extremely easy, but the cable was another story... For the life of me, I couldn't find what the proper ordering of the cables was supposed to be! Most places that I had found on the internet contradicted each other.&lt;br /&gt;&lt;br /&gt;Now that I know how this works, I wanted to post here for my future use and for others to benefit from.&lt;br /&gt;&lt;br /&gt;There are 4 pairs of colors, with each pair consisting of a solid and a striped wire. The order of these wires is obviously important for its function and once ordered correctly, they are placed in a RJ45 plug end (shown below).&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/4227/1835/1600/images.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/4227/1835/200/images.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Using the image above, going from left to right, the order of the wires for a &lt;span style="font-weight: bold; font-style: italic;"&gt;straight through cable&lt;/span&gt; (non-crossover, for connecting a computer to a network) is:&lt;br /&gt;&lt;ol&gt;&lt;ol&gt;&lt;li&gt;orange striped&lt;/li&gt;&lt;li&gt;solid orange&lt;/li&gt;&lt;li&gt;green striped&lt;/li&gt;&lt;li&gt;solid blue&lt;/li&gt;&lt;li&gt;blue striped&lt;/li&gt;&lt;li&gt;solid green&lt;/li&gt;&lt;li&gt;brown striped&lt;/li&gt;&lt;li&gt;solid brown&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;If you are interested in creating the &lt;span style="font-weight: bold; font-style: italic;"&gt;crossover cable&lt;/span&gt; (for connecting a router to a switch, or connecting 2 computers directly through their network adapters), one end of your cable would be wired as stated above and the other end would be:&lt;br /&gt;&lt;ol&gt;&lt;ol&gt;&lt;li&gt;green striped&lt;/li&gt;&lt;li&gt;solid green&lt;br /&gt;&lt;/li&gt;&lt;li&gt;orange striped&lt;/li&gt;&lt;li&gt;solid blue&lt;/li&gt;&lt;li&gt;blue striped&lt;/li&gt;&lt;li&gt;solid orange&lt;/li&gt;&lt;li&gt;brown striped&lt;/li&gt;&lt;li&gt;solid brown&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;Once you line up the wires and push them into your RJ45 plug end, use your crimper to finish the job off.&lt;br /&gt;&lt;br /&gt;Creating the wire is very easy and extremely cost effective. Good luck!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-116178830202201530?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/116178830202201530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=116178830202201530' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/116178830202201530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/116178830202201530'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2006/10/creating-your-own-cat-5-cable.html' title='Creating Your Own Cat 5 Cable'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-116058629692844358</id><published>2006-10-11T09:47:00.000-07:00</published><updated>2008-08-06T12:50:57.384-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tomcat'/><title type='text'>Configuring Tomcat to serve static files</title><content type='html'>&lt;p&gt;For a long time now, I have been trying to figure out how to specify a default servlet in Tomcat 5 and still allows for static files to be served.&lt;/p&gt;&lt;p&gt;From all of my readings, I have noticed that  in order to have a default servlet and serve static files, I would have to serve the files via my servlet. I didn't like this solution. Finally, I have discovered a work around...  &lt;/p&gt;&lt;p&gt;To outline the problem, imagine that your &lt;span style="font-style: italic;"&gt;web.xml&lt;/span&gt; file contains the following:&lt;/p&gt;   &lt;blockquote&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;servlet-mapping&amp;gt;&lt;br /&gt; &amp;lt;servlet-name&amp;gt;My Servlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt; &amp;lt;url-pattern&amp;gt;/&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;&amp;lt;/servlet-mapping&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;p&gt;Now all requests to your webapp are going to go through &lt;span style="font-weight: bold; font-style: italic;"&gt;'My Servlet'&lt;/span&gt;. So if you ask for a file like &lt;span style="font-style: italic;"&gt;http://localhost:8080/your_app/myStyleSheet.css&lt;/span&gt;, Tomcat will look at the request and forward it to&lt;span style="font-weight: bold; font-style: italic;"&gt; 'My Servlet'&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Now unless that particular servlet contains code to handle the case for &lt;span style="font-weight: bold;"&gt;myStyleSheet.css&lt;/span&gt;, nothing will happen (depends on your &lt;span style="font-weight: bold; font-style: italic;"&gt;'My Servlet' &lt;/span&gt;code of course; 404 might be returned, etc).&lt;/p&gt;&lt;p&gt; So one work around that I have found is to enter the following in your &lt;span style="font-weight: bold; font-style: italic;"&gt;tomcat/webapps/your_app/WEB-INF/web.xml&lt;/span&gt;:&lt;/p&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;servlet-mapping&amp;gt;&lt;br /&gt; &amp;lt;servlet-name&amp;gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;default&lt;/span&gt;&amp;lt;/servlet-name&amp;gt;&lt;br /&gt; &amp;lt;url-pattern&amp;gt;&lt;span style="font-weight: bold;"&gt;*.css&lt;/span&gt;&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;&amp;lt;/servlet-mapping&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt; &lt;/blockquote&gt;&lt;p&gt;With that code all requests for a file ending in the prefix &lt;span style="font-weight: bold;"&gt;css &lt;/span&gt;will not be sent to &lt;span style="font-weight: bold; font-style: italic;"&gt;'My Servlet'&lt;/span&gt;. Instead Tomcat will look for the file in your web apps home directory and if found, serve it, otherwise a &lt;span style="font-weight: bold;"&gt;404 &lt;/span&gt;is returned.  &lt;/p&gt;&lt;p&gt;Now that I have found this one solution, it seems to me like it was obvious (maybe that's why I couldn't find it in all my web searching with google) ...&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-116058629692844358?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/116058629692844358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=116058629692844358' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/116058629692844358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/116058629692844358'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2006/10/configuring-tomcat-to-serve-static.html' title='Configuring Tomcat to serve static files'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18690850.post-113341350496992053</id><published>2005-11-30T20:34:00.000-08:00</published><updated>2006-10-30T18:35:05.468-08:00</updated><title type='text'>Dell &amp; Poor Customer Support</title><content type='html'>I am so disappointed with Dell. Up until now, I have been a satisfied customer. I have purchased, in the last couple of years, 2 desktop systems, 4 notebooks, 2 laser printers, 2 flat panel displays and even an ipod wannabe Dell DJ.&lt;br /&gt;&lt;br /&gt;So I went to purchase my next notebook, an Inspiron 6000. Got the fastest processor, the highest resolution screen, a big hard disk (100GB). I got the works. Placed my order on the 9th and thought great, I will have a new notebook probably by the end of the week (like most of my previous orders). Great.&lt;br /&gt;&lt;br /&gt;Well, a week passes. My 'order status' looks like it has shipped. I will wait a few more days. By the 21st, I figure that it has been a while, so I call their shipping company. Seems like they received something from Dell that states that they will be shipping something for them. As for that something, it isn't there. The shipping company told me to call Dell. I did and I told them that there website says that it has shipped on the 13th and that the shipping company told me that they didnt have it. I was told that I would have it soon. Soon?! I ask, when is soon. Their reply - 'Dont worry sir, your computer is coming.'&lt;br /&gt;&lt;br /&gt;So, I wont bore you with the other calls that I made before receiving my notebook on the 26th. But upon opening the box that my computer was in, I noticed that, first it came with no 'support' cds and no operating system cd (i.e. windows XP media edition cd was missing). Okay, no big deal. Oh, what is this? No power adapter. I understand that the computer has a great battery life, but I dont think it will last so long as I wont need to charge it.&lt;br /&gt;&lt;br /&gt;So what do I do? I phone Dell. After navigating through the endless maze of menus. I am told that they are closed weekends. Nice, now I have to wait 2 more days to see if I can resolve this mess. On the 28th, I phone customer care. They transfer me to hardware support. I tell the agent that my computer shipped without various components. The agent then asks me, how long have I had this problem? How long have I had this problem!?! Probably since I opened the box. What kind of question is that? These call 'support' agents really need to start thinking for themselves. So, after the agent finally gets it, I ask, how long will it take to get my power supply? The agent replies, 1-2 weeks. All of a sudden, I snapped and I asked to speak to their supervisor. The supervisor then assured me that in a few days I would receive my adaptor. I did, on the 29th. Unfortunately, no discs.&lt;br /&gt;&lt;br /&gt;But wait, what is this. I have another item in my order status window. It says that the discs are coming and that the total cost is $25? Now I have to pay for the discs? What a mess. I phone customer support and ask to speak to a supervisor. The agent tries to help me. At the end, I ask for the supervisor. The agent tells me that he will transfer me to him, and he places me on hold.&lt;br /&gt;&lt;br /&gt;10 minutes later I hang up. How long can I be placed on hold? I think I will place Dell on hold from now on. I am strongly urging anyone contemplating a purchase from Dell to rethink the purchase. I strongly recommend going to a physical store, where customer representatives (employees) treat you properly. I was told 4 times that a supervisor would be phoning me in a couple of hours. I think that their watch must be slow, because it has been at least a few days since I was told this.&lt;br /&gt;&lt;br /&gt;Dell use to be known for customer support. If you do buy from Dell, god forbid that something should go wrong with your order or worse, your computer. You will have to jump through hoops trying to correct it. The worst part is, Dell doesnt think that your time matters and you will be on hold for hours. In total, I must have spent about 29hours on the phone. Do yourself a favor and walk to your local computer store and buy your computer there. You might pay $50 dollars more, but at least you will be taken care of.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18690850-113341350496992053?l=ekawas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ekawas.blogspot.com/feeds/113341350496992053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18690850&amp;postID=113341350496992053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/113341350496992053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18690850/posts/default/113341350496992053'/><link rel='alternate' type='text/html' href='http://ekawas.blogspot.com/2005/11/dell-poor-customer-support.html' title='Dell &amp; Poor Customer Support'/><author><name>Ed</name><uri>http://www.blogger.com/profile/08459071099726319400</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
