<?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'><id>tag:blogger.com,1999:blog-2707108039665181350</id><updated>2009-11-11T05:15:44.154-08:00</updated><title type='text'>codemagnet</title><subtitle type='html'>Dear Malaysian programmers,
You need guidance? Msg me, if i can help you to the right footing i will.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default?start-index=26&amp;max-results=25'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>58</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-4311254036819870981</id><published>2009-11-03T00:11:00.001-08:00</published><updated>2009-11-03T00:13:24.897-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drupal plone joomla sitefinity'/><title type='text'>Plone, Drupal or What?</title><content type='html'>&lt;p&gt;A quick migration of a static website to a CMS version was needed. However one of the requirement is that it must be as ‘non-programmer’ as possible since an assigned web designer will be doing the project. &lt;/p&gt;  &lt;p&gt;After toying around with Plone, its way too technical and the curve is just too much to even be considered. It is also pretty slow, around 1.3 times slower in a Pentium Celeron with 1GB memory compared to Drupal on a dummy blank site. &lt;/p&gt;  &lt;p&gt;So Drupal was next in the list and in fact chosen for the job , however as 2 weeks gone by, it was obvious that what we know about Drupal is in fact largely OVERRATED. There are certain theme layouts that doesn’t appear correctly on different browsers, very limited customization without going to php and way too much work for a non-technical person to get it looking nice, not to mentioned that most sites on Drupal looks similar.&lt;/p&gt;  &lt;p&gt;Finally we stumbled upon SiteFinity by SmarterTools, the condition however was that it had to run on IIS but in this case we had no issues with that since the project doesn’t mind whether its IIS or Apache (who the hell going to modify apache code in the name of open source?) &lt;/p&gt;  &lt;p&gt;SiteFinity not only blows Drupal to stoneage, more importantly we saved the Web designer guy from committing suicide. For once she was able to get something done. &lt;/p&gt;  &lt;p&gt;** there is a community version available free for use &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-4311254036819870981?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/4311254036819870981/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/11/plone-drupal-or-what.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/4311254036819870981'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/4311254036819870981'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/11/plone-drupal-or-what.html' title='Plone, Drupal or What?'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-6821575098297579448</id><published>2009-10-19T10:00:00.001-07:00</published><updated>2009-10-19T10:43:45.961-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='achtbanen trojan injection web htm remover'/><title type='text'>Removing “achtbanen” trojan links</title><content type='html'>&lt;p&gt;Ok so someone got careless and somehow his website files have been replaced with links to a trojan. Each of the html/asp files have been injected with a script “&amp;lt;script src=http://achtbanen.org/images/blah blah blah&amp;gt;&amp;lt;/script&amp;gt;”&lt;/p&gt;  &lt;p&gt;I was asked to write a script to clean it up, so here it is, a script injector remover, basically will work on any injected one liner script (modify the signature on “FindThis” in the source yourself), by default will remove this particular achtbanen line.&lt;/p&gt;  &lt;p&gt;TrjLinkRemove.py&lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 148.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; height: 210px; background-color: #f4f4f4; text-align: left"&gt;   &lt;div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;# Copyright 2009, codemagnet.blogspot.com&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;# Free to use ;-), just keep this credit comments.&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;import sys&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;import os&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;import nowlog&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;logfile = nowlog.SetLogConfig(&lt;span style="color: #006080"&gt;&amp;quot;removed.log&amp;quot;&lt;/span&gt;)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;script src=http://achtbanen.org/images/b-one-default.php &amp;gt;&amp;lt;/script&amp;gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;FindThis = &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;script src=http://achtbanen.org/images&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;FindThisJS = &lt;span style="color: #006080"&gt;&amp;quot;document.write('&amp;lt;script src=http://&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;MaximumIndexTail = 150 &lt;span style="color: #008000"&gt;#  search 150 off the first found signature&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;def dirwalk(dir):&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    &lt;span style="color: #006080"&gt;&amp;quot;walk a directory tree, using a generator&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    try :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; f in os.listdir(dir):&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;            fullpath = os.path.join(dir,f)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; os.path.isdir(fullpath) &lt;span style="color: #0000ff"&gt;and&lt;/span&gt; not os.path.islink(fullpath):&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;                &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; x in dirwalk(fullpath):  &lt;span style="color: #008000"&gt;# recurse into subdir&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;                    yield x&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;:&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;                yield fullpath            &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    except :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        pass&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;                &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;            &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;def CleanFile (filename) :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;global&lt;/span&gt; FindThis&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    try :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        f = open(filename, &lt;span style="color: #006080"&gt;&amp;quot;rb&amp;quot;&lt;/span&gt;)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        fb = f.read()&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        f.close()&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        i = fb.find(FindThis) &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; i == -1 :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #008000"&gt;# found&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        o = fb.find(&lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;/script&amp;gt;&amp;quot;&lt;/span&gt;, i+len(FindThis), i+len(FindThis) + MaximumIndexTail)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; o == -1:&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;            logfile.error(&lt;span style="color: #006080"&gt;&amp;quot;partial found, ignored, %s&amp;quot;&lt;/span&gt;, filename)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #008000"&gt;# create a new file&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        newfile = filename + &lt;span style="color: #006080"&gt;&amp;quot;.trj.rmv&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        p = open(filename + &lt;span style="color: #006080"&gt;&amp;quot;.trj.rmv&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;wb&amp;quot;&lt;/span&gt;)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        p.write(fb[:i])&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        p.write(fb[o+9:])&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        p.close()&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        os.rename(filename, filename + &lt;span style="color: #006080"&gt;&amp;quot;.xxxx&amp;quot;&lt;/span&gt;)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        os.rename(newfile, filename)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        os.unlink(filename + &lt;span style="color: #006080"&gt;&amp;quot;.xxxx&amp;quot;&lt;/span&gt;)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        logfile.info(&lt;span style="color: #006080"&gt;&amp;quot;Cleaning : %s&amp;quot;&lt;/span&gt;, filename)        &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    except :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        logfile.error(&lt;span style="color: #006080"&gt;&amp;quot;unable to open file %s&amp;quot;&lt;/span&gt;, filename)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;   &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;#-------------------------------------------------------------------------#&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;def CleanFileJS (filename) :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;global&lt;/span&gt; FindThis&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    try :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        f = open(filename, &lt;span style="color: #006080"&gt;&amp;quot;rb&amp;quot;&lt;/span&gt;)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        fb = f.read()&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        f.close()&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        i = fb.find(FindThisJS) &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; i == -1 :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #008000"&gt;# found&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        o = fb.find(&lt;span style="color: #006080"&gt;&amp;quot;.php&amp;quot;&lt;/span&gt;, i+len(FindThisJS), i+len(FindThisJS) + MaximumIndexTail)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; o == -1:&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;            logfile.error(&lt;span style="color: #006080"&gt;&amp;quot;partial found, ignored, %s&amp;quot;&lt;/span&gt;, filename)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #008000"&gt;# create a new file&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        newfile = filename + &lt;span style="color: #006080"&gt;&amp;quot;.trj.rmv&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        p = open(filename + &lt;span style="color: #006080"&gt;&amp;quot;.trj.rmv&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;wb&amp;quot;&lt;/span&gt;)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        p.write(fb[:i])&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        p.close()&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        os.rename(filename, filename + &lt;span style="color: #006080"&gt;&amp;quot;.xxxx&amp;quot;&lt;/span&gt;)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        os.rename(newfile, filename)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        os.unlink(filename + &lt;span style="color: #006080"&gt;&amp;quot;.xxxx&amp;quot;&lt;/span&gt;)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        logfile.info(&lt;span style="color: #006080"&gt;&amp;quot;Cleaning : %s&amp;quot;&lt;/span&gt;, filename)        &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    except :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        logfile.error(&lt;span style="color: #006080"&gt;&amp;quot;unable to open file %s&amp;quot;&lt;/span&gt;, filename)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;            &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;def cleanup (path) :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; x in dirwalk(path) :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        o = x.split(&lt;span style="color: #006080"&gt;&amp;quot;.&amp;quot;&lt;/span&gt;)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; o[-1].lower() in [&lt;span style="color: #006080"&gt;&amp;quot;asp&amp;quot;&lt;/span&gt;,&lt;span style="color: #006080"&gt;&amp;quot;html&amp;quot;&lt;/span&gt;,&lt;span style="color: #006080"&gt;&amp;quot;htm&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;aspx&amp;quot;&lt;/span&gt;] :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;            CleanFile(x)          &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;continue&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; o[-1].lower() == &lt;span style="color: #006080"&gt;&amp;quot;js&amp;quot;&lt;/span&gt; :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;            CleanFileJS(x)        &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;      &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; __name__ == &lt;span style="color: #006080"&gt;&amp;quot;__main__&amp;quot;&lt;/span&gt; :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; len(sys.argv) &amp;lt; 2 :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;print&lt;/span&gt; &lt;span style="color: #006080"&gt;&amp;quot;Removes achtbanen trojan links from all webfiles&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;print&lt;/span&gt; &lt;span style="color: #006080"&gt;&amp;quot;TrjLinkRemove &amp;lt;path&amp;gt;&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;print&lt;/span&gt; &lt;span style="color: #006080"&gt;&amp;quot;e.g TrjLinkRemove c:\\iisroot&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        sys.&lt;span style="color: #0000ff"&gt;exit&lt;/span&gt;(1)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; not os.path.exists(sys.argv[1]) :&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;print&lt;/span&gt; &lt;span style="color: #006080"&gt;&amp;quot;invalid path given&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        sys.&lt;span style="color: #0000ff"&gt;exit&lt;/span&gt;(1)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    cleanup(sys.argv[1])    &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;nowlog.py &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 148.64%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; height: 210px; background-color: #f4f4f4; text-align: left"&gt;&lt;br /&gt;  &lt;div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;import logging, logging.handlers&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;def SetLogConfig (namefile):&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    logfile = logging.handlers.TimedRotatingFileHandler(namefile , &lt;span style="color: #006080"&gt;'midnight'&lt;/span&gt;, 1, backupCount=14)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    logfile.setLevel(logging.INFO)    &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    FORMAT = &lt;span style="color: #006080"&gt;&amp;quot;%(asctime)-15s %(levelname)s:[%(thread)d]:%(message)s&amp;quot;&lt;/span&gt;           &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    logfile.setFormatter(logging.Formatter(FORMAT))    &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    ch = logging.StreamHandler()&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    ch.setLevel(logging.INFO)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    Logger = logging.getLogger(namefile)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    Logger.addHandler(logfile)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    Logger.addHandler(ch)&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    Logger.setLevel(logging.INFO)    &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    &lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; Logger&lt;/pre&gt;&lt;br /&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;* sorry about the formatting –.- was using a code snippet plugin&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-6821575098297579448?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/6821575098297579448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/10/removing-achtbanen-trojan-links.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/6821575098297579448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/6821575098297579448'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/10/removing-achtbanen-trojan-links.html' title='Removing “achtbanen” trojan links'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-3820951727209471958</id><published>2009-10-14T11:57:00.001-07:00</published><updated>2009-10-14T11:57:18.226-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='robot avatar mail server email'/><title type='text'>World First Email Server with MSN Robot (Avatar)</title><content type='html'>&lt;p&gt;This is probably true as the team gets ready to launch MailNow!5&lt;/p&gt;  &lt;p&gt;MailNow! 5 is a Windows Mail Server that is of the likes of SmarterMail, Mdaemon, Merak and Hmail. The difference would be the amount of innovation that the team built into the MailNow! 5 that would eliminate log searching, greps etc for mail tracing , anti domain queue hogging and features on accountability that is way off the conventional school. &lt;/p&gt;  &lt;p&gt;One distinct one is the world first Email Server Robot or Avatar. Its is an MSN robot that would inform users of the mail server status, new mails alert + details, collect log files, send SMS alerts, compose emails, retrieve emails, provide Email server spam statistics, emails per hour statistics and provide an “eliza” chat for idle users.&lt;/p&gt;  &lt;p&gt;Looks really cool when it was demoed today. I guess the folks attending the launch on 12 Nov, 2009&amp;#160; will get some sneak peek too. (&lt;a href="http://www.internetnow.com.my"&gt;www.internetnow.com.my&lt;/a&gt;)&lt;/p&gt;  &lt;p&gt;If you see any other mail servers adding this feature in the future, you heard it here first. That Malaysian made, MailNow! 5 , the windows mail server…had the first ever robot. &lt;/p&gt;  &lt;p&gt;The team won’t be patenting it, the team here is just too engrossed in technical development than to invest in any legal procedures to write such a patent. Chances is MS Exchange would build one super robot in the future and who’s gonna sue?&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-3820951727209471958?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/3820951727209471958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/10/world-first-email-server-with-msn-robot.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/3820951727209471958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/3820951727209471958'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/10/world-first-email-server-with-msn-robot.html' title='World First Email Server with MSN Robot (Avatar)'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-2511310316361617536</id><published>2009-09-29T00:38:00.001-07:00</published><updated>2009-09-29T00:38:46.655-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='imap roundcube mailnow'/><title type='text'>RoundCube on Windows</title><content type='html'>&lt;p&gt;While testing the high speed IMAP server that i developed, i wanted to see how it perform with some open source webmail, particularly those that works with IMAP. &lt;/p&gt;  &lt;p&gt;One of the most popular one that i found is RoundCube.&lt;/p&gt;  &lt;p&gt;1. First you need to install the WAMPSERVER. The php included should be version 5++&lt;/p&gt;  &lt;p&gt;2. Open up php.ini and make sure “extension_dir” points to the right directory which is under …\php\ext. Put in the extension module for sql . e.g&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;&lt;font color="#008080"&gt;extension_dir = &amp;quot;/usr/local/apache/php/ext&amp;quot;         &lt;br /&gt;extension=php_mysql.dll&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Yeah i created an c:/usr even on my Windows so that i don’t have to much changes.&lt;/p&gt;  &lt;p&gt;3. Open up httpd.conf and make sure u have :-&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#008080"&gt;&lt;em&gt;&amp;lt;IfModule dir_module&amp;gt;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font color="#008080"&gt;&lt;em&gt;DirectoryIndex index.html index.php&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font color="#008080"&gt;&lt;em&gt;&amp;lt;/IfModule&amp;gt;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Double check to see if the following is loaded :&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;&lt;font color="#008080"&gt;LoadModule php5_module &amp;quot;/usr/local/apache/php/php5apache2_2.dll&amp;quot;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;4. Install Mysql for Windows. (This can open up one whole can of worms if you get it wrong)&lt;/p&gt;  &lt;p&gt;5. Open the INSTALL file found in RoundCube and follow the instruction to create the database for roundcube. I would advice you to stick to the names given. &lt;/p&gt;  &lt;p&gt;5. Open the roundcube\conf\, rename the *.dist to *. (whithout dist extension). E.g&amp;#160; db.inc.php.dist –&amp;gt; db.inc.php&lt;/p&gt;  &lt;p&gt;Edit db.inc.php and set the&amp;#160; :&amp;#160; &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#008080"&gt;config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail' &lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;to the username password that is created in 5, if you followed the default it should be :&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#008080"&gt;config['db_dsnw'] = 'mysql://roundcube:password@localhost/roundcubemail'&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Edit the main.inc.php and set the this to where ur email server is :&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;&lt;font color="#008080"&gt;$rcmail_config['smtp_server'] = '10.8.0.21';&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;6. Now copy this whole roundcube folder to a subfolder under htdocs (apache) . For e.g c:\usr\local\apachce\htdocs\roundcube&lt;/p&gt;  &lt;p&gt;And you can try and access it via : &lt;a href="http://x.x.x.x./roundcube"&gt;http://x.x.x.x./roundcube&lt;/a&gt;&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/2707108039665181350-2511310316361617536?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/2511310316361617536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/09/roundcube-on-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/2511310316361617536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/2511310316361617536'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/09/roundcube-on-windows.html' title='RoundCube on Windows'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-1382047204464947317</id><published>2009-09-16T21:22:00.001-07:00</published><updated>2009-09-16T21:26:50.123-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Preaching Python : The obstacles</title><content type='html'>&lt;p&gt;I am a big fan of Python. I am a Windows Developer. I’ve been doing C/C++ as long as i can remember before jumping to C# to leverage on the .NET. &lt;/p&gt;  &lt;p&gt;I abandoned Java when it was 2 years old, it just never got me attracted. Maybe its because my field centralizes on system level and security and not enterprise business applications.&amp;#160; &lt;/p&gt;  &lt;p&gt;Python has a distinct place in development today. But try convincing the following crowd :-&lt;/p&gt;  &lt;p&gt;1. A Windows C#/ASP.NET developer, been using VB since 1997.&lt;/p&gt;  &lt;p&gt;2. Java Developer with over 7 years of exp&lt;/p&gt;  &lt;p&gt;3. C++ /C hardcore&lt;/p&gt;  &lt;p&gt;4. PHP developer &lt;/p&gt;  &lt;p&gt;Here are the list of the most common obstacles :&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;1. Python is SLOW&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;2. Python has no strong Enterprise Framework&lt;/p&gt;  &lt;p&gt;3. Python has weak data typing, its hard to create APIs for users to extend. &lt;/p&gt;  &lt;p&gt;4. C# can do everything that Python can and it works better in Windows and..faster. &lt;/p&gt;  &lt;p&gt;5. Python GUI development in Windows sucks.&lt;/p&gt;  &lt;p&gt;6. see no.1&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;Python is slow&lt;/font&gt;. Compared to&amp;#160; C. Which language is faster than C ? Assembly maybe but definitely not Java or C#.&amp;#160; Does the program speed really matter so much when practically in most applications the speed differences might not even exist to be practical.&lt;/p&gt;  &lt;p&gt;Lets say you are developing a Network application that accepts data from the Internet and do something with it. The internet bandwidth speed from your ISP to you is nothing compared to your LAN speed. Lately The CPU processing power has grown from exponential to straight upward beating Moore’s Law.&amp;#160; In this case python would do perfectly well, the bottleneck is not the application speed but rather the internet speed.&lt;/p&gt;  &lt;p&gt;One of the exceptions would be if you are doing scientific research and mathematical data of which nanoseconds per iteration differences might matter to you. &lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;Python is slow?&lt;/font&gt; Use C then for the part that requires special computational algorithm . Recently a friend of mine showed me a game called Civilization, its the latest version and it uses Python. It runs fast and flawlessly on my Vista. I believe they used python just for the main framework of the game coding while the graphic rendering is back to C/C++ . Now that is smart. &lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;Python is slow?&lt;/font&gt; Blink. Did u see the difference? &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-1382047204464947317?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/1382047204464947317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/09/preaching-python-obstacles.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/1382047204464947317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/1382047204464947317'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/09/preaching-python-obstacles.html' title='Preaching Python : The obstacles'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-1642244183421377071</id><published>2009-09-15T21:54:00.001-07:00</published><updated>2009-09-15T21:54:45.751-07:00</updated><title type='text'>Windows Live, Twisted</title><content type='html'>&lt;p&gt;This is the first posting via the Windows Live Writer. Today my MSN Messenger pops up and literally forced me to upgrade my Msgr to the Windows Live version. &lt;/p&gt;  &lt;p&gt;What surprises me was the list of other services that you get to choose to install apart from Messenger itself&amp;#160; and one of them is this Windows Live Writer.&amp;#160; It allows you to post to various blogs (the first&amp;#160; one in the menu is MS own service naturally…)&lt;/p&gt;  &lt;p&gt;The online office documents is the other apps. This&amp;#160; put the power of the MS Office to the internet for laymen. It makes google docs looks like cavemen offering. The google doc is laden with incompatible glitches when uploading MS documents over, and MS answers to this is a solid one.&amp;#160; Try uploading a powerpoint and you will get what i mean….not a big issue , minor displacement here and there but still…&lt;/p&gt;  &lt;p&gt;So what has this gotta do with Twisted ? Nothing really, except that the solid feel you get when using components from MS compared to Twisted (open source component) sometimes is evident, at least to developers that are not just MS bashers. On the other hand, MS is super slow in adopting and promoting what is evidently internet driven standards and if you want to develop for Windows, chances is&amp;#160; that MS already have some offering that is either free, “included in the OS/will be” or some bundling Server products. The development for Windows software is a grim future to many Windows developers (except for project based solutions) . Of course the gang of MS partners and those getting projects from MS as partners via MS solutions are making tons. &lt;/p&gt;  &lt;p&gt;For independent product development, Windows leaves Anti-virus, some security related fields and libraries/components the only profitable playing field for Windows Developers looking at “off the shelf” development.&amp;#160; &lt;/p&gt;  &lt;p&gt;Now back to twisted, i was&amp;#160; looking at imap4.py, the “search_” functions have a typo bug that will never work , a simple one…missing an “s” on 3 functions of which i have reported to twistedmatrix. If MS components have such bugs, it would be totally unacceptable and laughable.&amp;#160; I was thinking to myself, is this a framework that has so much hoo-haa in Python and over 7 years of evolution? Don’t even want to start on its poor documentation. If its not because of its beautiful skeletal architecture for various protocols, i would say asynch chat in the standard Python library would be more productive.&amp;#160; (noob ! noob!, yeah spare me the insults)&lt;/p&gt;  &lt;p&gt;Python is the best&amp;#160; thing i have found in the OSS world. Each day passed by and i still find it the most attractive programming language.&amp;#160; I place Python on the same playing fields as C++, Java, C#, not Perl and other scripting languages. Its meant for serious development and deserved to be used in an IDE and adopted by full fledged teams. &lt;/p&gt;  &lt;p&gt;Are you using C#? Try python, use the Wing-ide. You won’t regret! You won’t lose much of the VS pampering that you are so used to and you get to think …somewhat…differently. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-1642244183421377071?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/1642244183421377071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/09/windows-live-twisted.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/1642244183421377071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/1642244183421377071'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/09/windows-live-twisted.html' title='Windows Live, Twisted'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-1553011975625917143</id><published>2009-08-18T01:13:00.000-07:00</published><updated>2009-08-18T01:44:09.362-07:00</updated><title type='text'>Google And Microsoft : Twin Effect</title><content type='html'>The evidence can be found everywhere. Headlines, headways and in some people's head.&lt;br /&gt;The pattern is recognizable given that one have been around since DOS days.&lt;br /&gt;Google, the company that was once  just associated with "search" is no longer staying where its domain is. It has tentacles that reaches far and wide but with one clear difference. The community don't realize it or maybe they do but they sure don't hate it.&lt;br /&gt;&lt;br /&gt;Perhaps MS's reputation and brand was so powerfully seared into the hearts and minds of computing folks that we could only identify MS as the only possible gigantic sofware company that we could hate. One that squashes its competitor mercilessly using various "partnership" tactics through the history of IT. Novell...Nescape....scandisk....C++ builder...Word Perfect...Quattro Pro....OS/2......Isn't scandisk just a program, yeah, so was Netscape browser. Sure some of these companies survived but became obscure tech names, a fraction of what they could have  been.&lt;br /&gt;&lt;br /&gt;Times are changing indeed. Windows Mobile is losing out. Microsoft Live Search is a  joke. A victim of its own game in an ever changing world.  Its rare to hear  MS losing in an area that it plans to focus or profit from but the new kid in town is nothing like MS have seen. Previously everyone had to fight MS in MS own turf...and since that  turf is the OS itself, it was rarely a fair fight. Its  90% of the World's desktops dear, get real. But what if you challenge MS in a very unlikely place...the cloud?&lt;br /&gt;&lt;br /&gt;When MS IE7 could  not open the Google Wave page and  Chrome could use it perfectly (ok firefox and other  browsers worked somewhat) , you get a very familiar feeling. This creepy Dejavu feeling just jumps out of the page into your lap.&lt;br /&gt;&lt;br /&gt;Android phones? Google Doc? GMail for Corporates? GAE hosted domain.&lt;br /&gt;&lt;br /&gt;China always had a long history of bad Emperors and those who attempt to topple them. Given such power and position, it was usual for Emperors to behave like morons and do what they want regardless of the citizens sentiments. Heck an Emperor gets to have 600++ wives!&lt;br /&gt;&lt;br /&gt;But Chinese History also teaches us one thing, topple one Emperor, the one taking over his place is no better.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-1553011975625917143?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/1553011975625917143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/08/google-and-microsoft-twin-effect.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/1553011975625917143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/1553011975625917143'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/08/google-and-microsoft-twin-effect.html' title='Google And Microsoft : Twin Effect'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-1993855736861459405</id><published>2009-08-15T06:58:00.000-07:00</published><updated>2009-08-15T09:26:44.707-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='google wave hackathon'/><title type='text'>Google Wave Hackathon Malaysia</title><content type='html'>Today i attended the Wave hackathon. Some lucky fellas here are supposed to be the first in Malaysia to get google wave accounts (for the sandbox) . &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Nazrul (the founder of MYGTUG) gave an overview and everyone quickly surfed and googled for more info . Basically for most of us, its the first time we are exposed to this Wave thing. This whole idea of blurring the line between emails and chats is boggling but opens up a whole new way of using "emails". &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Due to some problems faced by other participants, somehow my "robot" was the only one demo-able at the end of the day. I guess my decision to just use the robot for fun things turns out to be easier to implement, Java programmers also complained about some issues with the api and Wave's unstability in handling certain events.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I went in with Python and i was using WingIde Pro, that must have been a real time saver since the autocompletion and module search gave lots of revelation of how some of the Wave Api works and fixes most easy errors. The problem is that you can't do a local test, so all the code must be uploaded before you can test it , simple errors will be a waste of time. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here are some "traps" to avoid in creating a "robot" :-&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. If you add a capability to the robot AFTER you already uploaded your first robot, you will need to bump the version in your "whateverrobot.py" under the _main_ so that Google Wave will recognize that you are supporting a new event handling.&lt;/div&gt;&lt;div&gt;Java programmers will need to modify the capabilities.xml file to bump the version.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. Don't just use the Tutorial example in creating Blips, you will end up modifying the blip&lt;/div&gt;&lt;div&gt;that the user posted instead of creating a new one since that is what the Tutorial example does. &lt;/div&gt;&lt;div&gt;You will get something like "User and robot" in the blip which is probably not what you want, instead just : &lt;span class="Apple-style-span" style="COLOR: rgb(0,153,0)"&gt;&lt;span class="Apple-style-span" style="FONT-STYLE: italic"&gt;newblip = root_wavelet.CreateBlip().GetDocument()&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;div&gt;You can also try &lt;span class="Apple-style-span" style="FONT-STYLE: italic"&gt;&lt;span class="Apple-style-span" style="COLOR: rgb(0,153,0)"&gt;blip.CreateChild() &lt;/span&gt;&lt;span class="Apple-style-span" style="FONT-STYLE: normal"&gt;if want it to appear below the original blip.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;You must use the Tutorial example to learn and do the first upload though! Just don't&lt;/div&gt;&lt;div&gt;copy everyline when u want to do your actual one. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3. Upload the tutorial example so make sure all your other setup is already working.&lt;/div&gt;&lt;div&gt;You will need to setup a Google Application Engine account and a choice of either &lt;/div&gt;&lt;div&gt;Python or Java. (for Python i was using ver 2.5.4). Setting up Google Application Engine requires a valid and real mobile phone (it will sms a validation code).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4. IE.7 is unsupported!! Yeah, i guess Google is doing to Microsoft what Microsoft used&lt;/div&gt;&lt;div&gt;to do to some companies. So make sure you just stick to Chrome when participating.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Overall, it was a pleasant and enjoyable event.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here is the robot i wrote (for those who have google wave account) : &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Id : &lt;a href="mailto:369robot@appspot.com"&gt;369robot@appspot.com&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Have Fun!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-1993855736861459405?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/1993855736861459405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/08/google-wave-hackathon-malaysia.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/1993855736861459405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/1993855736861459405'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/08/google-wave-hackathon-malaysia.html' title='Google Wave Hackathon Malaysia'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-3680982436859199335</id><published>2009-08-06T19:40:00.000-07:00</published><updated>2009-08-06T19:44:13.791-07:00</updated><title type='text'>Too much support?</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_kAVoQr76SBY/SnuUbNDKBQI/AAAAAAAAAHg/hlWRECkupMo/s1600-h/bz.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5367046576022357250" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 285px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_kAVoQr76SBY/SnuUbNDKBQI/AAAAAAAAAHg/hlWRECkupMo/s400/bz.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;I got this screen this morning when searching for something in MS.&lt;/div&gt;&lt;div&gt;Did MS just redirected all support calls to online search? ;-)&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-3680982436859199335?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/3680982436859199335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/08/too-much-support.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/3680982436859199335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/3680982436859199335'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/08/too-much-support.html' title='Too much support?'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_kAVoQr76SBY/SnuUbNDKBQI/AAAAAAAAAHg/hlWRECkupMo/s72-c/bz.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-8632631932119308786</id><published>2009-08-03T07:27:00.000-07:00</published><updated>2009-08-03T07:58:23.456-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='calling'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='DLL'/><category scheme='http://www.blogger.com/atom/ns#' term='pinvoke'/><title type='text'>C# calling C DLL routines (YET ANOTHER ONE)</title><content type='html'>I am totally baffled on the examples given by sites on how to call C routines in DLL via C#.&lt;br /&gt;Not only are many of them repeating one same example after another, you soon realize they are not very helpful when you want to do something that is common like passing a structure with all kinds of types inside.&lt;br /&gt;&lt;br /&gt;So here is one example that serve as an answer to MANY of the pinvoke/calling C apis problem :- ( i wanted to say 90% but i can't justify or prove it ;-))&lt;br /&gt;&lt;br /&gt;I got this example structure that has :&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;struct ToughCallDef&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;{&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;char * ptrName; // this will contain some return string values&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;int ptrNameLen; // normal integer &lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;MEMBLOCK somestruct; // a structure&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;ANOTERBLOCK* structpointer; // structure pointer&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;int* ptrtoMyInt; // integer pointer&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#339999;"&gt;char * ptrID // this must be supplied&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;};&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;/span&gt;&lt;br /&gt;Just translate it this way :-&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;[StructLayout(LayoutKind.Sequential)]&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;public class ToughCallDef&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;{&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;IntPtr ptrName;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;MEMBLOCK somestruct; // you need to define MEMBLOCK also&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;IntPtr structPointer;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;IntPtr ptrtoMyInt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#339999;"&gt;IntPtr ptrID;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;}&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And if the call requires a reference to this "ToughCall" :&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff6600;"&gt;[DllImport("anotherc.dll")]&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff6600;"&gt;public static extern int Call_C_API(ref ptrToughCall);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;define it this way instead :&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;[DllImport("anotherc.dll")]&lt;br /&gt;public static extern int Call_C_API(IntPtr ptrToughCall);&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;/span&gt;&lt;br /&gt;Basically anything to do with Pointers, regardless of whether its integer *, char *, structure reference etc, just use &lt;strong&gt;IntPtr.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1 . If the member is a "char *" that you expect return values you point the IntPtr this way :&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;szReason = new StringBuilder(100);&lt;br /&gt;zReason.Append(' ', 100); // empty string with spaces&lt;br /&gt;ToughCall.PtrName = Marshal.StringToHGlobalAnsi(m_szReason.ToString());&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;2. If the member is a "char *" that you need to assign a value before passing in :&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;ToughCall.ptrID = Marshal.StringToHGlobalAnsi(StringVar);&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;3. If the member is a structure pointer, you assign it this way :&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;ANOTHERBLOCK o = new ANOTHERBLOCK();&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#339999;"&gt;&lt;em&gt;ToughCall.structPointer = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(ANOTHERBLOCK)));&lt;br /&gt;Marshal.StructureToPtr(o, ToughCall.structPointer, true);&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. After calling the C routine you will need to do the following to get the values :-&lt;br /&gt;&lt;ol&gt;&lt;li&gt;If its a string, use :&lt;br /&gt;&lt;span style="color:#339999;"&gt;string s = Marshal.PtrToStringAnsi(ToughCall.PtrName)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;If its a structure use :&lt;br /&gt;&lt;span style="color:#339999;"&gt;Marshal.PtrToStructure(ToughCall.structPointer, o);&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;Free any allocated strings/struct pointers via :&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#339999;"&gt;Marshal.FreeHGlobal&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;That's it. &lt;/p&gt;&lt;p&gt;&lt;/p&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/2707108039665181350-8632631932119308786?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/8632631932119308786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/08/c-calling-c-dll-routines-yet-another.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/8632631932119308786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/8632631932119308786'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/08/c-calling-c-dll-routines-yet-another.html' title='C# calling C DLL routines (YET ANOTHER ONE)'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-5699587427430104964</id><published>2009-07-22T01:18:00.000-07:00</published><updated>2009-07-23T18:51:27.807-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='twitter python s60 nokia pys60'/><title type='text'>Twitter (python api) on Nokia S60</title><content type='html'>I wanted a system whereby people can sms to a phone that will log it to twitter.&lt;br /&gt;With this system an organization can keep track of what its support/sales staff are at any given point of time.&lt;br /&gt;After tinkering around with the twitter python api and Nokia s60 python (1.9.6), i finally&lt;br /&gt;got it working...(duh...that took me more than an hour...)&lt;br /&gt;&lt;br /&gt;There is however ONE big catch (read end of the section)&lt;br /&gt;&lt;br /&gt;Here is the code :&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_kAVoQr76SBY/SmiFqsSuopI/AAAAAAAAAG4/4ISEl5WbpDQ/s1600-h/sms.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5361682324875289234" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 209px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_kAVoQr76SBY/SmiFqsSuopI/AAAAAAAAAG4/4ISEl5WbpDQ/s400/sms.jpg" border="0" /&gt;&lt;/a&gt; &lt;p style="TEXT-ALIGN: center"&gt;&lt;span class="Apple-style-span" style="COLOR: rgb(85,26,139); TEXT-DECORATION: underline"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Gotchas :-&lt;/p&gt;&lt;p&gt;1 - Ah yes you also need to change that getusername routine in twitter, else it wont work &lt;/p&gt;&lt;p&gt;2- Pay attention to that pesky pyS60 Application Packager (READ the README file) , this is not py2exe. Basically, you will need to rename your main file to some fix default.py.&lt;/p&gt;&lt;p&gt;3- It will keep asking you for connection (access point) on each msg , unless your using some newer phones like nokia 5800 XM. If you are using N82, ALL the popular examples shown in the internet like these : &lt;/p&gt;&lt;p&gt;&lt;a href="http://discussion.forum.nokia.com/forum/showthread.php?t=163939"&gt;http://discussion.forum.nokia.com/forum/showthread.php?t=163939&lt;/a&gt;&lt;/p&gt;&lt;p&gt;or&lt;/p&gt;&lt;p&gt;&lt;a href="http://snippets.dzone.com/tag/pys60"&gt;http://snippets.dzone.com/tag/pys60&lt;/a&gt;&lt;/p&gt;&lt;p&gt;or&lt;/p&gt;&lt;p&gt;&lt;a href="http://croozeus.com/blogs/?p=836"&gt;http://croozeus.com/blogs/?p=836&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;DOESN'T Work. The reason is due to some "compatibility problem" between socket and btsocket. &lt;/p&gt;&lt;p&gt;"Twitter" uses urllib2 not urllib, and these people probably have never tested it on that api. Someone from Silicon Valley once said that Nokia know nuts about promoting development, and thus he rejected their offer to develop for symbian and instead move the whole team to iphone.&lt;/p&gt;&lt;p&gt;In some ways, i agree....but i still love my nokias ;-) I reckon the same thing would have worked in Iphone much earlier and with less blood on my desk.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;** Update :&lt;/p&gt;&lt;p&gt;&lt;em&gt;Marcelo Barros  from Croozeus :&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Yes, that is the problem. I reported it at maemo some time ago.&lt;br /&gt;I suggest you to use my twitter api. Extend it if necessary.&lt;br /&gt;&lt;/em&gt;&lt;a style="FONT-WEIGHT: bold; COLOR: rgb(0,51,91); TEXT-DECORATION: none" href="http://code.google.com/p/wordmobi/source/browse/trunk/wordmobi/src/s60twitter.py" rel="nofollow"&gt;&lt;em&gt;http://code.google.com/p/wordmobi/source/browse/trunk/wordmobi/src/s60twitter.py&lt;/em&gt;&lt;/a&gt;&lt;br /&gt;&lt;em&gt;It uses urllib and simplejson (I ported it to S60, code in the same dir).&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Note : If you still want to use the twitterapi as it is and not the ported version, you will&lt;/p&gt;&lt;p&gt;need to hardcode the "getusername" and stick to "socket" only calls, avoid using btsocket.&lt;/p&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/2707108039665181350-5699587427430104964?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/5699587427430104964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/07/twitter-python-api-on-nokia-s60.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/5699587427430104964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/5699587427430104964'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/07/twitter-python-api-on-nokia-s60.html' title='Twitter (python api) on Nokia S60'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_kAVoQr76SBY/SmiFqsSuopI/AAAAAAAAAG4/4ISEl5WbpDQ/s72-c/sms.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-4762311437161407354</id><published>2009-07-12T20:26:00.001-07:00</published><updated>2009-07-12T20:36:26.763-07:00</updated><title type='text'>C# calling Python scripts and processing output</title><content type='html'>Occasionally there would be a situation where the C# needs to call a python script and work with its output. While this might sounds like a piece of cake, it does have its gotcha, that is when&lt;br /&gt;you want to process each line one by one and you happened to have somekind of timing (time.sleep) or some other python codes that works correctly under console but unable to be processed by C#.&lt;br /&gt;&lt;br /&gt;Below is how you do it : (read until the end, there is a gotcha)&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;&lt;em&gt;&lt;span style="color:#666666;"&gt;private static void OutputHandler(object sendingProcess, DataReceivedEventArgs outLine)&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;      if (outLine.Data != null)&lt;br /&gt;      Console.Out.WriteLine(outLine.Data.ToString());&lt;br /&gt;}&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;&lt;em&gt;&lt;span style="color:#33ff33;"&gt;&lt;span style="color:#666666;"&gt;static void Main(string[] args)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;    Process p = new Process();&lt;br /&gt;    p.StartInfo.FileName = "python.exe";&lt;br /&gt;    p.StartInfo.Arguments = "c:\\test\\test.py";&lt;br /&gt;    p.StartInfo.UseShellExecute = false;&lt;br /&gt;    p.StartInfo.CreateNoWindow = true;&lt;br /&gt;    p.StartInfo.RedirectStandardOutput = true;&lt;br /&gt;    p.OutputDataReceived += new DataReceivedEventHandler(OutputHandler);&lt;br /&gt;    p.Start();&lt;br /&gt;    p.BeginOutputReadLine();&lt;br /&gt;    p.WaitForExit();&lt;br /&gt;    p.Close();&lt;br /&gt;}&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Assuming ur python script is the following (test.py) :&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#333399;"&gt;import time&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#333399;"&gt;import sys&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#333399;"&gt;for x in range(100) :     &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#333399;"&gt;         print x   &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#333399;"&gt;         time.sleep(1)&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#333399;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;&lt;/span&gt;&lt;br /&gt;You will be surprised that you dont get anything. For some reason, time.sleep(1) and possibly&lt;br /&gt;some other python library calls would result in the output not being flushed. The solution&lt;br /&gt;would be to "flush" it :&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#6600cc;"&gt;for x in range(100) :    &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#6600cc;"&gt;         print x    &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#6600cc;"&gt;         sys.stdout.flush()&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#6600cc;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#6600cc;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#6600cc;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#6600cc;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-4762311437161407354?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/4762311437161407354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/07/c-calling-python-scripts-and-processing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/4762311437161407354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/4762311437161407354'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/07/c-calling-python-scripts-and-processing.html' title='C# calling Python scripts and processing output'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-1971937753681906808</id><published>2009-07-12T18:51:00.000-07:00</published><updated>2009-07-12T19:11:10.868-07:00</updated><title type='text'>Vmware and the Virtualization Gotcha's</title><content type='html'>There is this lab that has 4 different Win2k servers, each running a different application.&lt;br /&gt;Server A - Mailserver&lt;br /&gt;Server B - Intranet application with MS SQL db&lt;br /&gt;Server C - Vpn server and backup&lt;br /&gt;Server D - Test server&lt;br /&gt;&lt;br /&gt;Along the way, the admin decides to put all these dated servers into a VM and slot it in to a high end Server from Dell. The whole porting process took around 2 weeks and when it was over,&lt;br /&gt;everyone was happy with the new setup. No more additional switching cables and multiple monitors lyring around and the perceived energy savings cost was a bonus.&lt;br /&gt;&lt;br /&gt;However one day, the mailserver began to feel very slow,  Procexp (sysinternals)  itself was myteriously taking up 45% cpu and more  and even with the mailserver service stopped the pc still feels awkwardly slow. Rebooting didnt that mail server VM doesn't help either.&lt;br /&gt;&lt;br /&gt;When i came in to help out in this scenario, the first thing i went thru was the list of VMs running in the server. One particular VM is taking up 26% of the CPU of the main server, however that should not be the reason why it would affect the mail server VM. Upon closer inspection however, i notice some native apps running on the test machine VM (26%) that is using up the VM's tcp/ip port very quickly.&lt;br /&gt;It then became logically clear that this was the problem, pausing that VM immediately restored the other server's performance and that was like a 100% improvement.&lt;br /&gt;&lt;br /&gt;I suspect the problem is because the main server is still just an OS with the normal limitation of the 65535 ports on a single ip and single network card. Since all the VMs runs on this machine , that test application was just blasting away the network resource, this turns the allocation of the real main server NDIS packets resources into an ugly situation where each of the VMs are queueing up to get its allocation.&lt;br /&gt;&lt;br /&gt;Another case solve. Another Hamster Huey and the GooiKablooi award for virtualization.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-1971937753681906808?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/1971937753681906808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/07/vmware-and-virtualization-gotchas.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/1971937753681906808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/1971937753681906808'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/07/vmware-and-virtualization-gotchas.html' title='Vmware and the Virtualization Gotcha&apos;s'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-7348701341293678774</id><published>2009-06-04T10:33:00.000-07:00</published><updated>2009-06-04T11:35:13.056-07:00</updated><title type='text'>Linux Desktop And Windows 7</title><content type='html'>I must admit, Ubuntu has reconfigured my view towards the Linux desktop distro. Yes, its not something new, but from version 8.1 onwards since last year, the refinement is just slightly short of a usable desktop for common users.&lt;br /&gt;&lt;br /&gt;Most of the stuffs are similar to windows in that you have hardware detection app running in the background with an icon in the system tray. The wifi detector works its best in trying to minimise "geeky" configurations and in my test notebook DELL inspiron 1520, it works straight out without the need for me to configure it manually and tweaking the config files.&lt;br /&gt;&lt;br /&gt;With the common host of free apps like openoffice and email clients (Evolution - the email client is still lacking in refinement compared to Outlook Express but Thunderbird isn't), heck, for most Janes and Johns who just want to have email, internet surfing and office documents, this would feel right at home. The system works faster and you even feel "safer" without having any anti-virus, anti-malware, anti-adware, malicious removal tools , Windows Defender and all those hooking apps that layers itself one on top of the other.&lt;br /&gt;&lt;br /&gt;Nine months ago, when i tried OpenSuse on my other notebook , it was hell, i had to configure and download specific wifi patch just to make it work. If a common user would have to choose between OpenSuse and Windows OS, even Win 98 would be a better option (speaking strictly in terms of usability for users who want things to just work and not do any command lines, scavaging forums and pulling hairs)&lt;br /&gt;&lt;br /&gt;Ubuntu, rightly one of the most popular distro now, deserves an applause from the Linux community. Instead of sticking to the unspoken rule of "we can't copy microsoft, if you can't configure some simple scripts you are lame", it went straight on to make Linux a much friendlier distro for desktop. By providing an option without the need to repartition the HD and installing it side by side with Windows XP/Vista, it became an attractive option for users to try it.&lt;br /&gt;&lt;br /&gt;The introduction of Version 8.1 was nothing short of perfect timing too. Vista, being an infamous slow OS - thanks to the "dev team" that insists on working on the new approach and forsake previous compatibility.&lt;br /&gt;&lt;br /&gt;The fact is, Vista is slow. There is just something wrong with its design.&lt;br /&gt;Personally i do not use any anti-virus, instead i even ran defrag religiously and PerfectDisk periodically to make sure i have optimum speed for my HD files. Still it was slow, i made sure my services are configured correctly and disabled all that i can lay my hands on and it is still slow. The frighthening thing was the fact that my Vista ran 3 times faster than any other Vista around my office on similar hardware, yet i find the response unacceptable.&lt;br /&gt;&lt;br /&gt;Ubuntu on the other hand, ran seemingly faster even when it was installed using the side by side installation. Thanks to Vista, I believe tons of users flock to try Linux distro and many who happened to try Ubuntu would be positively surprised. Just this 2 weeks, i notice that there are 2 more collegues who installed Ubuntu and was excited to show it around.&lt;br /&gt;&lt;br /&gt;However, there are still many hurdles for Ubuntu to overcome before it can become a replacement for Windows. For e.g, try connecting it to a projector, and good luck.&lt;br /&gt;Try getting Compiz to work, chances are that you won't get it working correctly in the first 30 minutes and oh, pls update your Nvidia drivers else be prepared to do some file editing.&lt;br /&gt;&lt;br /&gt;To date, there are around 200 Linux distros, some says 450. This is actually good news to Microsoft. As long as these jokers cannot unite, Windows will continue to dominate. Every aspiring Linux techie with enough willpower will want to produce his/her own Distro with some lousy excuse for yet another distro.&lt;br /&gt;&lt;br /&gt;I would bet that if the community would drop all the similar distros and say just concentrate on 3 :&lt;br /&gt;&lt;br /&gt;1. CentOS or RedHat for Server&lt;br /&gt;2. Ubuntu for Desktop / Workstation&lt;br /&gt;3. Knoppix for small storage / misc applications&lt;br /&gt;&lt;br /&gt;Or better :&lt;br /&gt;Ubuntu Desktop, Ubuntu Server, Ubuntu Mini.&lt;br /&gt;&lt;br /&gt;Then all the big hardware manufacturers and the gaming industry would ensure that they will provide support for this alternative OS. Ms.Window would have to taste its own medicine in pitting against FREE OS. Yup, taste its own medicine. The number of companies that MS brought down just by including the said product/feature FREE are calling out for judgement day.&lt;br /&gt;&lt;br /&gt;Netscape, RIP.&lt;br /&gt;&lt;br /&gt;The only other area that MS still have not managed to kill are the Anti-Virus companies. Free Anti-virus seems to be playing along MS agenda all the time and yet failed to be executed. Hmm, before this happens, i should seriously fold up my sleeves and start working on this project i have in mind for some time now, the Corporate-Anti-Malware-End-Of-Anti-Virus project. A solution that will guarantee a corporate environment to be clean of viruses using a filter driver and a concept that involves a model pc, central sandbox and whitelisting. No more antivirus scanning and signature subscriptions!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Yawn....signing off.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-7348701341293678774?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/7348701341293678774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/06/linux-desktop-and-windows-7.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/7348701341293678774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/7348701341293678774'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/06/linux-desktop-and-windows-7.html' title='Linux Desktop And Windows 7'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-4602403750050731185</id><published>2009-05-27T20:08:00.000-07:00</published><updated>2009-05-27T20:23:37.906-07:00</updated><title type='text'>Virtual Desktops and Cubes on Vista  :  Compiz, Ubuntu</title><content type='html'>Recently i been playing with Ubuntu 8.1 and quite fancy the desktop cube that was&lt;br /&gt;available in the Compiz.&lt;br /&gt;&lt;br /&gt;If you look at google, there are many Linux users that posted cool videos of this "virtual desktop" and its effects, the comments ranged anywhere from MS bashing to degrading insults to people who chooses to use Windows/Vista instead.&lt;br /&gt;&lt;br /&gt;Well here are the good news.&lt;br /&gt;&lt;br /&gt;You can download a cheap (Free) and fast virtual desktop manager for Vista here :&lt;br /&gt;&lt;a href="http://technet.microsoft.com/en-us/sysinternals/cc817881.aspx"&gt;http://technet.microsoft.com/en-us/sysinternals/cc817881.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It allows you 4 desktop that you can switched via ALT-Num, which is a good hotkey.&lt;br /&gt;Its only &lt;span style="color: rgb(0, 153, 0);"&gt;68k&lt;/span&gt;, that shows how little work is required to have such functionality in Windows.&lt;br /&gt;&lt;br /&gt;"How about the cube! We want the cube!!!"&lt;br /&gt;&lt;br /&gt;The cube is available here, you have two options :-&lt;br /&gt;&lt;br /&gt;One that is not free :&lt;br /&gt;&lt;a href="http://www.otakusoftware.com/deskspace/index.html"&gt;http://www.otakusoftware.com/deskspace/index.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;One that is free :&lt;br /&gt;&lt;a href="http://www.docs.kr/"&gt;&lt;/a&gt;&lt;a href="http://www.docs.kr/entry/Download-Shock-4Way3D-en"&gt;http://www.docs.kr/entry/Download-Shock-4Way3D-en&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Have fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-4602403750050731185?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/4602403750050731185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/05/virtual-desktops-and-cubes-on-vista.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/4602403750050731185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/4602403750050731185'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/05/virtual-desktops-and-cubes-on-vista.html' title='Virtual Desktops and Cubes on Vista  :  Compiz, Ubuntu'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-2357381326630471071</id><published>2009-05-13T20:11:00.000-07:00</published><updated>2009-05-13T20:42:53.373-07:00</updated><title type='text'>In hardware we put our trust....</title><content type='html'>This morning i got a call from a customer. Running a powerful custom VPN solution (ipsec) for Windows that i wrote with multi-branch and failure switchover. He was just upgraded to a new version just few days back and now he complains that it hangs the server.&lt;br /&gt;&lt;br /&gt;The symptoms are :&lt;br /&gt;- server unresponsive and hangs periodically&lt;br /&gt;- it even hangs while trying to reboot&lt;br /&gt;&lt;br /&gt;After we turn on the VNC and remote in, i couldn't find anything wrong with the system. The guy on the other side then exclaim "How did you manage to login? I can't even get the CTRL-ALT-DEL to work". It was then obvious that i could login by asking VNC to send the CTRL-ALT-DEL, so i queried him further and the problem was  actually his Keyboard.&lt;br /&gt;&lt;br /&gt;An erratic hardware failure on the keyboard (capslock, numlock not responding) gives you the impression that the Server has hung.&lt;br /&gt;&lt;br /&gt;This event got me thinking. Why do people always associate failures with Software and not hardwares when a problem first surfaced? I believe the reason lies much to the way sofware are produced compared to hardware. Sure, there are good programmers and bad programmers, they are also good manufacturers and bad manufacturers. But the key lies in the fact that&lt;br /&gt;"bad manufacturers" still have to adhere to  certain quality and the fact that creating a hardware requires much resources and after thought before committing to one.&lt;br /&gt;&lt;br /&gt;Hardware specifications are dead static and factories that produce it must have certain quality check. If you are planning to produce a cheap alternative graphic card to the market, you will still pay a lot of attention to some quality and testing cause its going to cause you a bomb to start a factory on it. The same goes for keyboard, mouse, webcams and the whole list of hardwares that we associate with the PC.  Yea sure, Logitech wares that are made in china have lousy fittings and cheap plastics but it still works as advertised.&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;Electronic  components are "reusable code" at its' highest form&lt;/span&gt;. Nobody builds a hardware from scratch, they select the components that are already widely available in the industry and just design its own mold and maybe a few specific components.&lt;br /&gt;Take the Razer mouse for example, the optical component and the RAM are manufactured elsewhere i am sure, while the casing, the scroll wheel and buttons are Razer's design.&lt;br /&gt;&lt;br /&gt;Software on the other hand, much of its true value are hidden from the naked eyes. How a particular function is done varies from each programmer and so are its reliability. Much of what users perceive are just GUI while the core engine could fail in a thousand ways.&lt;br /&gt;&lt;br /&gt;This brings me back to the Demmings 14 points some believe are the reasons why Japanese goods are viewed as high quality and reliability, it should be practiced in Software manufacturing as well.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;Demming's 14 point :-&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;1."Create constancy of purpose towards improvement". Replace short-term reaction with long-term planning.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;2."Adopt the new philosophy". The implication is that management should actually adopt his philosophy, rather than merely expect the workforce to do so.&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;3.&lt;span style="color: rgb(0, 0, 153);"&gt;"Cease dependence on inspection". If variation is reduced, there is no need to inspect manufactured items for defects, because there won't be any.&lt;/span&gt;&lt;/span&gt; - (Unit test?)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;4."Move towards a single supplier for any one item." Multiple suppliers mean variation between feedstocks.&lt;/span&gt; -(Oh dear, not Microsoft pls...)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;5.&lt;span style="color: rgb(0, 0, 153);"&gt;"Improve constantly and forever". Constantly strive to reduce variation.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;6."Institute training on the job". If people are inadequately trained, they will not all work the same way, and this will introduce variation.&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;7."Institute leadership". Deming makes a distinction between leadership and mere supervision. The latter is quota- and target-based.&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;8.&lt;span style="color: rgb(0, 0, 153);"&gt;"Drive out fear". Deming sees management by fear as counter- productive in the long term, because it prevents workers from acting in the organisation's best interests.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;9."Break down barriers between departments". Another idea central to TQM is the concept of the 'internal customer', that each department serves not the management, but the other departments that use its outputs.&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;10."Eliminate slogans". Another central TQM idea is that it's not people who make most mistakes - it's the process they are working within. Harassing the workforce without improving the processes they use is counter-productive.&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;11."Eliminate management by objectives". Deming saw production targets as encouraging the delivery of poor-quality goods.&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;12.&lt;span style="color: rgb(0, 0, 153);"&gt;"Remove barriers to pride of workmanship". Many of the other problems outlined reduce worker satisfaction.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;13."Institute education and self-improvement".&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;14."The transformation is everyone's job".&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/2707108039665181350-2357381326630471071?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/2357381326630471071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/05/in-hardware-we-put-our-trust.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/2357381326630471071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/2357381326630471071'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/05/in-hardware-we-put-our-trust.html' title='In hardware we put our trust....'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-2702565628512994201</id><published>2009-04-13T20:34:00.000-07:00</published><updated>2009-04-13T21:21:44.359-07:00</updated><title type='text'>Ldaptor, Python List, Django</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;LDAPtor - The king who never made it&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;I wanted to deploy ldap server on windows. Apache DS with a 200 simulated user environment went kaput and need frequents restarting/backup. Openldap on Windows via the berkeley db was prone to corruption as well. Nothing seems to work robustly under Windows for some of these open source projects, no matter how popular it was. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then i found Ldaptor, written completely in python via the Twisted framework. Wasn't really a big fan of the Twisted framework, heck, the only book on Twisted i saw by Oreilly, had examples that are "badly" coded in my personal opinion, works though. One can't doubt the benefit of having such a large ready made framework. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After just 5 minutes trying out ldaptor, it bombs out, won't even run, turns out that some modules are referencing the previous Twisted "components.interface" and should be replaced with "zope.interface.Interface", then it runs. Now just have to figure out how to import the Ldif into it...documentation seems to be scarce on ldaptor..."Ldaptor will one day rise to world domination" &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thats the problem with a LOT of open source projects, abandoned or left dying prematurely when the Initiator found something more profitable to do...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 102, 255);"&gt;&gt; Switch Channel ....&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am really grateful for some of python default implementation and behaviour, especially on its container. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I wanted to get a list of files in a directory and process it according to its "creation time". i did a "glob.glog" on a directory, the return result  was anything but sorted.  The normal procedure would be something like this :-&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;1. get each of the files creation time&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;2. sort based on the creation time&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;3. process the file&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In python that translates to :-&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;ActualFiles = [(os.stat(x).st_ctime,x) for x in GetFilesListing(path))]&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;ActualFiles.sort()&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;for x in ActualFiles : &lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;# do something with already sorted x[1]&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When i wanted to remove some items from a list and yet continue to process the list :&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 51, 204);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 51, 204);"&gt;for x in MyList[:] :&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 51, 204);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 51, 204);"&gt;if x.value == "whatever_i_am_looking_for" :&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 51, 204);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 51, 204);"&gt;MyList.remove(x)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 153, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If this was translated  to C++ it would be something like this  (warning: it won't work!)&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;for (ptr = listcopy.begin(); ptr != listcopy.end(); ptr++)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;if  (ptr-&gt;value == "whatever_i_am_looking_for") &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;{&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;listorg.erase(ptr)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Thus, someone who starts on python would probably find it hard to move to C/C++ but&lt;/div&gt;&lt;div&gt;someone who starts from C/C++ would  easily addicted to python and appreciate its fun way of working (lazy).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 102, 255); "&gt;&gt; Django&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 102, 255);"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); "&gt;I wonder how does Python web building such as Django matches against premium platforms like ASP.Net. Just the other day some people working on PHP was amazed to see how building cool working websites was done in ASP.NET. All those ajax coding are so automated it makes similar offering in PHP looks primitive not to mention the state of the art Visual Studio IDE.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Frankly developing website is something that is out of my reach but it would be great to see how Python fare in this area. Better than PHP? Ruby on rails? Come on, it has to do better. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 102, 255);"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); "&gt; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 102, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 102, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-2702565628512994201?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/2702565628512994201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/04/ldaptor-python-list-django.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/2702565628512994201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/2702565628512994201'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/04/ldaptor-python-list-django.html' title='Ldaptor, Python List, Django'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-6554487726227070878</id><published>2009-03-28T02:59:00.000-07:00</published><updated>2009-07-23T08:56:46.934-07:00</updated><title type='text'>Programmer's Mind vs None Programmer</title><content type='html'>&lt;div&gt;There are basically two types of jokes among the elite programmers when it comes to people who are non technically inclined or non-programmers.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;#1 :&lt;/div&gt;Sometimes people in Malaysia here thinks that they can just pump in a few million, start a team and expect to get a project done. Little do they know of the various traps and software pitfalls that awaits such a team. Unless its a crony project that don't mind accepting substandard deliveries, most of these projects often end up in the drain. Sure there are some big companies here that hire top Chief architects whom never deliver any projects to a real competition, all inhouse or cronies companies deliveries. Little do these self deceived Architects are aware of how weak their skill and proficiency are in that area. When you are the Chief Architect of such big corporations, everyone wants to kiss ur ass, no matter what ur true capabilities are.&lt;div&gt;&lt;br /&gt;&lt;div&gt;This phenomena is so common that over here, the local folks have a name for it. Its called "Jaguh Kampung". In english it means "Village Champion". What happens when a few village champions join an international competition? They learn the meaning of "Village".&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Each year in local software Awards here we see various Sofwares being conferred the "Software of the year", often these Software are either developed for its own use or for its branches. If you look at the track record, almost all the winners have ran out of business or no longer using it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;#2 :&lt;/div&gt;&lt;div&gt;There are Sales and Business people who don't know how dumb they look when saying something to the technical team or when accepting a business proposal whom they know nothing of in programming terms. When the technical team rejected the proposal, they have the impression that their team is incapable or does not have business sense, where in actual fact, the &lt;/div&gt;&lt;div&gt;problem is in the mirror.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Someone i knew once asked me to write a local chat software, i asked him "what is the sales forcast?" He replied "well i am sure there are many, let me call up this ABC company and see if they want it". (This is a clear sign to "reject" the idea, no proper thoughts given to the project and just do a blind jab by asking some programmers to commit to it).&lt;/div&gt;&lt;div&gt;Anyway, to deter him i ask him further "what are the specifications?". He replied "Oh, its very simple just do exactly what Skype can do and make it work in LAN".&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;** If you are not laughing already, you should stop reading this post.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Another story i heard is about this lady, who has many connections and "cables" to VIP people. Often she would try to get some projects from these people and her technical partner would reject it. She would then be very upset and gave some lectures on "How important is business and why nothing is impossible to code". A very sad partnership that is destined to end up in the gutter. What most of these "business" people don't understand is that, What you see on paper and in request is VERY different when its translated to actual coding. It can be so different that its actually supernaturally unrealistic to take it up. For example would you commit a team to write a product in 6 months and due to economics of scale, you would need to pay USD 1000 for an appliance/embedded system while out there, there are similar products retailing at USD 400 that is doing exactly the same thing?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you have such a boss or partner , you should use this statement to bring enlightenment to him/her by saying "Actually if we want to make money we should just get a team to write an OS what works exactly like Vista but with a budget of USD 100k." or "Lets write a Windows 2008 replacement in 6 months, that sounds easy too isn't it?" or "Lets write a replacement for MS-Exchange and make it cooloer in 6 months"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-6554487726227070878?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/6554487726227070878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/03/programmers-mind-vs-none-programmer.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/6554487726227070878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/6554487726227070878'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/03/programmers-mind-vs-none-programmer.html' title='Programmer&apos;s Mind vs None Programmer'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-7755075061140890323</id><published>2009-03-08T20:18:00.000-07:00</published><updated>2009-03-08T20:32:15.085-07:00</updated><title type='text'>Windows Mobile : The evolution of O2 -&gt; Dopod -&gt; HTC (its HTC all along)</title><content type='html'>The Windows mobile has always been manufactured by HTC. Many years ago, its called&lt;div&gt;O2, sleek looking Phone PDA that usually sells well on first launch and turns out to be very buggy devices . The cycle repeats when new versions are launced. This is because out there, there are many people who love Windows and used to the Windows Experience, the option of having a mobile that has outlook and other familiar apps working is a big motivation for the purchase.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, O2 really took the bulk of the fall as people began to wake up and identified it as an unusable device. Guess what? After the demised of O2 brand in Malaysia here, Dopod came up, with some brand new units and exciting offerings . Again, same forgiveness and embracement by the community, good sales and popularity of Dopod began to soar....only to be greeted by the same negative feedback and buggy usage.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The problem really lies with Windows mobile and cheap plastics production that easily wear off and scratches for usage that was never designed to last. Windows mobile started off as Windows CE hacked and rush into a market that is dominated by Nokia and Symbian. When it comes to phone usage, it sucks and is buggy.&lt;/div&gt;&lt;div&gt;I remember the O2-XPhone, boy, i must say i can't find a dumber smartphone than that one and yet, it was sold presumtiously to the community with no sense of responsibility and accountability. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now that dopod is dying due to the same reasons that O2 went down, HTC decides its time to use its own name and produce units and avoid mistakes that was bourned by its previous two brands. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Will i buy an HTC? No way, i pity those companies who are associated with the prev two brands and if history prove itself well, HTC units will go the same cycle. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-7755075061140890323?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/7755075061140890323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/03/windows-mobile-evolution-of-o2-dopod.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/7755075061140890323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/7755075061140890323'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/03/windows-mobile-evolution-of-o2-dopod.html' title='Windows Mobile : The evolution of O2 -&gt; Dopod -&gt; HTC (its HTC all along)'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-6576672645976511878</id><published>2009-02-23T23:56:00.000-08:00</published><updated>2009-02-24T06:26:42.956-08:00</updated><title type='text'>Switching away from Streamyx...or use together with Maxis</title><content type='html'>The last few weeks have been pretty frustrating for me.&lt;br /&gt;I can't access public servers in an acceptable speed and some anti-virus websites and even my online banking was crawling to a halt. I notice the problem is affecting all streamyx users as i tried in office, in my house and confirmed with other collegues in areas like Damasara, Ampang and Puchong. Even trying out kids games like &lt;a href="http://www.bigfishgames.com/"&gt;http://www.bigfishgames.com/&lt;/a&gt; for my kid and &lt;a href="http://www.standardchartered.com.my/"&gt;http://www.standardchartered.com.my/&lt;/a&gt; was slower than a 28.8 modem.&lt;br /&gt;&lt;br /&gt;I did notice there are some "cheats", access to google.com and youtube.com is fast however try something else it drops dead. Seems like Tm.net is using somekind of packet shaper, one that is implemented in a very very bad way.&lt;br /&gt;&lt;br /&gt;But there is this happy guy in my office that seems to be talking greek when we complain about Streamyx woes lately and he is using Maxis broadband. Heck, i thought give it a few more days maybe it will improved after all nothing beats experience and that is what Tm.net is, a veteran in Malaysia as an ISP.&lt;br /&gt;&lt;br /&gt;While we oogled over his fast connection response in the office the inconvenience of terminating the Streamyx and trying out something new kept me unmoved.&lt;br /&gt;&lt;br /&gt;Finally today, the last straw broke so to speak... I needed to prepare a demo and that particular site is slowing to a crawl when accessed by streamyx.&lt;br /&gt;&lt;br /&gt;2 hours later and RM 100 poorer (for the wireless modem), i connected it to my exising wifi modem/router which i am using for streamyx, pulled off the phone line, some simple configuration and wahla! Everything works normally, my wife wont even know i switched when she comes home and use her other notebook.&lt;br /&gt;&lt;br /&gt;^_^&lt;br /&gt;&lt;br /&gt;There is ONE big catch though :&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.maxis.com.my/personal/broadband/termncon.asp"&gt;&lt;em&gt;&lt;span style="color:#000099;"&gt;http://www.maxis.com.my/personal/broadband/termncon.asp&lt;/span&gt;&lt;/em&gt;&lt;/a&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#000099;"&gt;Excessive Usage&lt;br /&gt;5.3.1&lt;br /&gt;Each customer’s total usage per month &lt;strong&gt;&lt;span style="color:#ff0000;"&gt;shall NOT exceed 3GB of data volume&lt;/span&gt;&lt;/strong&gt; transmitted &lt;span style="color:#ff0000;"&gt;(total upload and download usage)&lt;/span&gt;. This is to ensure that no individual hogs the bandwidth at all times. &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#000099;"&gt;5.3.2&lt;br /&gt;If a customer wishes to use more than the volume permitted,&lt;br /&gt;a written request should be made to Maxis.&lt;br /&gt;5.3.2&lt;br /&gt;Maxis reserves the right to reject the said application or &lt;span style="color:#ff0000;"&gt;&lt;strong&gt;charge for any additional data volume&lt;/strong&gt;&lt;/span&gt; transmitted from what is already allocated.&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;This is the only part that makes streamyx still the most popular choice. 3GB is nothing as you and i know for today's internet need. Heck even free emails has 10GB free volume.&lt;br /&gt;Did i read this policy? NO, the promoter never talked on this problem nor show you the policy.&lt;br /&gt;So I was right, Maxis is inexperience on this area, but for now, It will have to be or lets hope Maxis will have some sense and make a more realistic limitation.&lt;br /&gt;&lt;br /&gt;**** Latest update ******&lt;br /&gt;A technical guy from TM has informed me that there is a MAJOR problem on their international link that will affect many access outside of Malaysia. The problem is promised to be fixed by&lt;br /&gt;5th March 2009.&lt;br /&gt;Well, i guess i will keep both ...until a super isp emerge.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Since most servers in Malaysia is under streamyx and if you are in IT you will need to support these servers or remote in etc, i suggest you use the following "batch" file so that you can access out of malaysia servers via Maxis and local servers via Streamyx to alleviate the current problem :&lt;br /&gt;&lt;br /&gt;Assuming your Streamyx router is 192.168.1.1 and your Maxis is 192.168.2.1, point ur gateway to 192.168.2.1 and put the following into a *.bat file which u need to execute whenever u want to connect to local malaysia servers.&lt;br /&gt;&lt;br /&gt;route add 219.0.0.0 mask 255.0.0.0 192.168.1.1&lt;br /&gt;route add 118.0.0.0 mask 255.0.0.0 192.168.1.1&lt;br /&gt;route add 218.0.0.0 mask 255.0.0.0 192.168.1.1&lt;br /&gt;route add 60.0.0.0 mask 255.0.0.0 192.168.1.1&lt;br /&gt;route add 202.0.0.0 mask 255.0.0.0 192.168.1.1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-6576672645976511878?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/6576672645976511878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/02/switching-away-from-streamyx.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/6576672645976511878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/6576672645976511878'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/02/switching-away-from-streamyx.html' title='Switching away from Streamyx...or use together with Maxis'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-3244810534914733982</id><published>2009-01-05T20:32:00.000-08:00</published><updated>2009-01-05T20:45:40.685-08:00</updated><title type='text'>Keeping and Switching Multiple Python Version on Windows</title><content type='html'>Assuming you have python 2.5 and python 2.6 installed.&lt;br /&gt;&lt;br /&gt;Here is what you need to do :-&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;1. Right click on My Computer, under advance, environment variables.&lt;/span&gt;&lt;br /&gt;Change all c:\python25 or c:\python26 path that u can find here to C:\python2x.&lt;br /&gt;That includes c:\python2x\scripts, c:\python2x\lib, c:\python2x&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;2. Rename your c:\python25 (or whatever it is) to c:\python25.bin&lt;/span&gt;&lt;br /&gt;Rename your c:\python26 (whatever it is) to c:\python26&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;3. type this to your command prompt (admin rights) :&lt;/span&gt;&lt;br /&gt;&lt;em&gt;ftype Python.CompiledFile=C:\Python2x\python.exe "%1" %*&lt;/em&gt;&lt;br /&gt;&lt;em&gt;ftype Python.File=C:\Python2x\python.exe "%1" %*&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;4. Create 2 batch file :&lt;/span&gt;&lt;br /&gt;batch file 1.&lt;br /&gt;&lt;em&gt;xcopy c:\python25 c:\python2x /s /I&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;batch file 2.&lt;br /&gt;&lt;em&gt;xcopy c:\python26 c:\python2x /s /I&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;5. Fixup all the scripts dependencies.&lt;/span&gt;&lt;br /&gt;For eg, goto c:\python25.bin\scripts, open up easy_install-2.5-script.py&lt;br /&gt;Change the first line to : #!C:\Python2x\python.exe&lt;br /&gt;&lt;br /&gt;You can repeat step 5 for other modules like nosetests, coverage  etc. &lt;strong&gt;Else you will get the dreadful message "Cannot find Python executable ....."&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now, if you want to use python 2.5, just run the batch file 1 in your command prompt.&lt;br /&gt;If you want to use python 2.6, just run batch file 2 in your command prompt.&lt;br /&gt;&lt;br /&gt;There you go....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-3244810534914733982?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/3244810534914733982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2009/01/keeping-and-switching-multiple-python.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/3244810534914733982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/3244810534914733982'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2009/01/keeping-and-switching-multiple-python.html' title='Keeping and Switching Multiple Python Version on Windows'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-1620277232513601648</id><published>2008-12-16T22:13:00.000-08:00</published><updated>2008-12-17T18:51:03.933-08:00</updated><title type='text'>Python 2.6 : ez_setup and setuptools, pylint on Windows</title><content type='html'>After i installed 2.6 i notice there is no setuptools windows installer in the python.org site. &lt;div&gt;So to manually install it you need to :-&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Download this egg file :&lt;/div&gt;&lt;div&gt;http://pypi.python.org/packages/2.6/s/setuptools/&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. Make sure u have download ez_setup.py from &lt;/div&gt;&lt;div&gt;http://peak.telecommunity.com/dist/&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3. &lt;span class="Apple-style-span" style="FONT-STYLE: italic"&gt;ez_setup setuptools-0.6c9-py2.6.egg&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;em&gt;&lt;/em&gt; &lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#339999;"&gt;** &lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#339999;"&gt;PJ Eby :&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#339999;"&gt;Actually, you can just download the source, unzip it, and do "setup.py bdist_wininst" to build your own .exe installer.&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="color:#339999;"&gt;**&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-STYLE: italic"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Now you need to download the pylint for checking /integrating with ur ide.&lt;/div&gt;&lt;div&gt;And again, u  notice that u will fail to get it installed via "easy_install pylint", so here&lt;/div&gt;&lt;div&gt;is the manual way.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;http://www.logilab.org/view?rql=Any%20X%20WHERE%20X%20eid%20848&lt;br /&gt;&lt;/div&gt;&lt;div&gt;http://www.logilab.org/view?rql=Any%20X%20WHERE%20X%20eid%20856&lt;br /&gt;&lt;/div&gt;&lt;div&gt;http://www.logilab.org/view?rql=Any%20X%20WHERE%20X%20eid%20857&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(all the download links are  at the upper right hand corner)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Download and unzip to all the folders, then goto each of them, common, astng, pylint and run :&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-STYLE: italic"&gt;python setup.py install&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Case close. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-1620277232513601648?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/1620277232513601648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2008/12/python-26-ezsetup-and-setuptools-pylint.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/1620277232513601648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/1620277232513601648'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2008/12/python-26-ezsetup-and-setuptools-pylint.html' title='Python 2.6 : ez_setup and setuptools, pylint on Windows'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-6851348847234251157</id><published>2008-12-16T20:29:00.000-08:00</published><updated>2008-12-16T20:37:33.741-08:00</updated><title type='text'>.py association in Vista/Windows Missing</title><content type='html'>I was playing  with version 2.6 Python without uninstalling version 2.5. &lt;div&gt;And for some reason i realize that when i execute a module without specifying the python.exe, the module could not get the arguments that was passed in.&lt;/div&gt;&lt;div&gt;For eg.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;test.py argument1 argument 2&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;(argument1 and argument2 is missing from the sys.argv)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;python test.py argument1 argument2&lt;/span&gt; : &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;works&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Initially i tried "assoc .py" followed by "ftype Python.File" and the association was CORRECT!&lt;/div&gt;&lt;div&gt;It shows : &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Python.File="C:\Python26\python.exe" "%1" %*&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Later i found out it was because there is still a registry key that is mapping wrongly.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Changing that registry key solves the problem.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Refer to the picture.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_kAVoQr76SBY/SUiBcQK4FvI/AAAAAAAAABo/HRcN8uScDqk/s1600-h/pythonpath.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_kAVoQr76SBY/SUiBcQK4FvI/AAAAAAAAABo/HRcN8uScDqk/s320/pythonpath.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5280612885468813042" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-6851348847234251157?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/6851348847234251157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2008/12/py-association-in-vistawindows-missing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/6851348847234251157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/6851348847234251157'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2008/12/py-association-in-vistawindows-missing.html' title='.py association in Vista/Windows Missing'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_kAVoQr76SBY/SUiBcQK4FvI/AAAAAAAAABo/HRcN8uScDqk/s72-c/pythonpath.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-1453073036770836967</id><published>2008-11-02T23:07:00.000-08:00</published><updated>2008-11-02T23:13:25.234-08:00</updated><title type='text'>Python Gotchas and Pitfalls for Windows Programmers</title><content type='html'>The no.1 pitfall i face is the "\r\n" that windows uses for its text "open" file where else in linux it will be "\n". &lt;div&gt;Although this might seems obvious or easy to fix by using "open("xxxxx", mode="wb")" when writing a string to a file, its not as simple as it sounds.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is because many of the functions that is supposed to be ported to Windows will failed to work, one example is the mbox and maildir, if you use the "import mailbox" and attempt to use maildir to store the files, even if you issue a "rb" on an eml, when you store it via :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    dest_mbox = mailbox.Maildir(path + folder, create=True)   &lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;    msgdata = email.message_from_string(emailtext)        &lt;/div&gt;&lt;div&gt;    new_key = dest_mbox.add(msgdata)        &lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;/div&gt;&lt;div&gt;The stored eml message contains "\r\r\n". This will then be a problem when you try to parse it via the email module.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Who knows what other python provided modules works this way too...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-1453073036770836967?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/1453073036770836967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2008/11/python-gotchas-and-pitfalls-for-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/1453073036770836967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/1453073036770836967'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2008/11/python-gotchas-and-pitfalls-for-windows.html' title='Python Gotchas and Pitfalls for Windows Programmers'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2707108039665181350.post-7689605678855140449</id><published>2008-08-11T09:49:00.001-07:00</published><updated>2008-08-11T10:01:27.953-07:00</updated><title type='text'>Pylint On WingIDE Check on Save!</title><content type='html'>Now lets face it, for a data typeless language like python, its easy to get errors that other languages IDE would have picked up easily. For example, if you were to point "ooo = hellu()" and hellu() is actually a typo, it should have been "hello()". You wont get any error on the IDE until you run it.&lt;br /&gt;&lt;br /&gt;This becomes pretty irritating when u have a number of these erorrs occuring when you are running your applications and you wished such flimsy bugs would have been picked by the IDE before you ever ran it.&lt;br /&gt;&lt;br /&gt;Solution : Use Pylint.&lt;br /&gt;Install it and goto "tools"-&gt;pylint and you will see a window on the right handside with "pylint" as the tab caption. (pls refer to other documentation on where to get and install pylint)&lt;br /&gt;&lt;br /&gt;And what you need now is to have Pylint autocheck everytime u save a module so that all modules gets pre-checked and those irritating typos i mentioned earlier and other bugs will get caught.&lt;br /&gt;&lt;br /&gt;Here is what you do, open up "editor-extensions.py" found in ur WingIDE installed directory under "scripts" (make a backup of this file first to somewhere else). Add the following lines at the end :-&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;def _connect_to_savepoint(doc):&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;def _on_savepoint(val):&lt;br /&gt;&lt;br /&gt;if val == 0 :&lt;br /&gt;return&lt;br /&gt;&lt;br /&gt;# Get editor and do action&lt;br /&gt;ed = wingapi.gApplication.GetActiveDocument()&lt;br /&gt;if ed == None :&lt;br /&gt;return&lt;br /&gt;&lt;br /&gt;wingapi.gApplication.ExecuteCommand('pylint-execute')&lt;br /&gt;&lt;br /&gt;connect_id = doc.Connect('save-point', _on_savepoint)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;def _savepointinit():&lt;br /&gt;wingapi.gApplication.Connect('document-open', _connect_to_savepoint)&lt;br /&gt;for doc in wingapi.gApplication.GetOpenDocuments():&lt;br /&gt;_connect_to_savepoint(doc)&lt;br /&gt;&lt;br /&gt;_savepointinit()&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And there you have it! Pylint total integration. Notice that if you open new modules and save it sometimes u get the "tried to execute an unavailable command .internal.gui.save". Just ignore this, the autosave in Pylint makes the IDE notice that you dont need to save the file again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2707108039665181350-7689605678855140449?l=codemagnet.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codemagnet.blogspot.com/feeds/7689605678855140449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codemagnet.blogspot.com/2008/08/pylint-on-wingide-check-on-save.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/7689605678855140449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2707108039665181350/posts/default/7689605678855140449'/><link rel='alternate' type='text/html' href='http://codemagnet.blogspot.com/2008/08/pylint-on-wingide-check-on-save.html' title='Pylint On WingIDE Check on Save!'/><author><name>Magnet.Code</name><uri>http://www.blogger.com/profile/11002239962689176722</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13436920065781668936'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>