<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>vava's ideas</title>
	<atom:link href="http://atlygin.com/ideas/feed/" rel="self" type="application/rss+xml" />
	<link>http://atlygin.com/ideas</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Tue, 01 Jul 2008 13:45:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>To write or not to write</title>
		<link>http://atlygin.com/ideas/2008/07/to-write-or-not-to-write/</link>
		<comments>http://atlygin.com/ideas/2008/07/to-write-or-not-to-write/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 10:51:51 +0000</pubDate>
		<dc:creator>vava</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://atlygin.com/ideas/?p=15</guid>
		<description><![CDATA[If you have spent any time working as a software developer you probably know that the most essential skills in our field is the ability to make the right choices. No, really, every single time you writing a code you have to think, do you want to make all that iterations in a loop or [...]]]></description>
			<content:encoded><![CDATA[<p>If you have spent any time working as a software developer you probably know that the most essential skills in our field is the ability to make the right choices. No, really, every single time you writing a code you have to think, do you want to make all that iterations in a loop or use a recursion, do you want to use clever functional style techniques with closures and stuff or just OOP, or maybe just plain procedural code, do you want to store your data in a database or in a simple file and so on and so forth.</p>
<p>But there is a one choice you have to make even before you start your favorite editor and it is - should you write that thing yourself or maybe just reuse someone else&#8217;s code from out there?</p>
<p>It is really, really hard question. From developers point of view it always fun to create something by yourself, you&#8217;ll have fun and get more experienced. And it will do exactly what you want it to do. But from business perspective it&#8217;s easier to reuse or even buy someone else&#8217;s code, since it&#8217;s already written, bugs are fixed and you have guys outside of the company working on it so you could use them as help and they also will fix bugs in your code for free.</p>
<p>In most cases the choice is obvious, nobody would write his own database if he can use mysql, mssql or whatever and it&#8217;s enough for his needs, nobody in his mind would create his own language to use it internally, except really specific cases when that actually makes a point, 
<a  href='http://www.joelonsoftware.com/items/2006/09/01b.html' onclick="javascript:pageTracker._trackPageview('/external/www.joelonsoftware.com/items/2006/09/01b.html');" >like in FogBugz for example</a>, nobody would write his own graphical editor if what he need is just to edit couple of dozens of photos. But you see, sometimes you have to write that stuff yourself even if it&#8217;s complicated and will take a lot of effort and time to build. The obvious rule of thumb here is to write only the core set of features, something that will distinguish your application from it&#8217;s competitors and download all the other parts from the Internet.</p>
<p>But there are situations when there is no right choice and one of them is when you want some tool to make some job just for yourself. Like you have to find something in a bunch of files, are you going to use grep or write a Perl script for that? What if you have to generate or edit some of the text files based on other text files, are you going to write sed script or a program in Ruby?</p>
<p>There&#8217;s no right or wrong choice here. Some of us will write ruby code faster than read man page for grep and find out what options he should use. Others will write sed script faster than figure out how to write in a file in C++. And the speed is not always a benefit for a choice, learning something new might be much more enjoyable and will pay off in a long run.</p>
<p>Anyway, the reason of this whole post is that I recently chose not to write and I want to tell you a story about it. And proof to myself the choice was correct.<br />
Couple of weeks ago I bout an 
<a  href='http://www.jabra.com/Sites/Jabra/UK-UK/pages/Product.aspx?productid=7cdcf001-7f6d-48d2-8962-0cf47f88de99' onclick="javascript:pageTracker._trackPageview('/external/www.jabra.com/Sites/Jabra/UK-UK/pages/Product.aspx');" >bluetooth headset</a> and wanted to use it in a car with my 
<a  href='http://www.htc.com/ru/product.aspx?id=15546' onclick="javascript:pageTracker._trackPageview('/external/www.htc.com/ru/product.aspx');" >Kaiser</a>. But I&#8217;ve noticed that despite it is plugged in to car charger, simultaneous usage of GPS and Bluetooth drain battery in about 5 hours. Not usable. Then I remembered that some phones have a feature to turn bluetooth on when incoming call is arriving and disable it afterwards. I&#8217;ve checked that headset pairs automatically once bluetooth on a PDA becomes active so I just had to find a simple program to turn it on and off depends on call events. And I couldn&#8217;t find any. Just an empty spot here, really. But googling shows me 
<a  href='http://forum.xda-developers.com/archive/index.php/t-316747.html' onclick="javascript:pageTracker._trackPageview('/external/forum.xda-developers.com/archive/index.php/t-316747.html');" >MortScript for similar problem</a> and I gave it a go. The first revision of a script was simple - it was waiting for a window with title &#8216;Phone - incoming call&#8217; to became active, turn bluetooth on and then wait until all windows with &#8216;Phone&#8217; in a tittle will go in to the background. A little bit later I added feature not to turn bluetooth off if it was on already.</p>
<p>
<pre class="prettyprint">
while(TRUE)
        while(WndActive("Phone - incoming call...") = 0)
	   Sleep(1000)
	endwhile
	if ( RegRead("HKLM", "System\State\Hardware", "Bluetooth") = 8 )
           Run("\Program files\vijay555\VJVolubilis\VJVolubilis.exe", "-blueon")
	   while(WndActive("Phone"))
                Sleep(5000)
           endwhile
	   Run("\Program files\vijay555\VJVolubilis\VJVolubilis.exe", "-blueoff")
	endif
endwhile
</pre>
</p>
<p>You would have to install 
<a  href='http://www.vijay555.com/?Releases:VJVolubilis' onclick="javascript:pageTracker._trackPageview('/external/www.vijay555.com/');" >VJVolubilis</a> and 
<a  href='http://www.sto-helit.de/index.php?module=page&#038;entry=ms_overview&#038;action=view&#038;menu=29' onclick="javascript:pageTracker._trackPageview('/external/www.sto-helit.de/index.php');" >MortScript</a> for that to work.</p>
<p>I&#8217;ve spent couple of hours on that script and it worked like a charm with one little detail, it was running a infinite loop eating up precious CPU cycles and draining battery. Sadly, MortScript doesn&#8217;t support events all that much.</p>
<p>But then I 
<a  href='http://s-k-tools.com/?skschema/m_skschema.html' onclick="javascript:pageTracker._trackPageview('/external/s-k-tools.com/');" >SKSchema</a> came along, application that knows about events and could run some predefined actions on them. At first I just added two actions - turn bluetooth on incoming call and turn it off on disconnect. That worked except it would turn bluetooth off after call even if it was on long before call arrived.</p>
<p>So I removed a loop from MortScript and made SKSchema run it on call. Script then based on active window title will figure out when call is over and turn bluetooth off.</p>
<p>
<pre class="prettyprint">
if ( RegRead("HKLM", "System\State\Hardware", "Bluetooth") = 8 )
   Run("\Program files\vijay555\VJVolubilis\VJVolubilis.exe", "-blueon")
   while(WndActive("Phone"))
        Sleep(5000)
   endwhile
   Run("\Program files\vijay555\VJVolubilis\VJVolubilis.exe", "-blueoff")
endif
</pre>
</p>
<p>And then I got thinking, as a developer, I could write that code in C# or even C++, it will work faster, it wouldn&#8217;t depend on windows titles and use normal events. It will be better.<br />
But I already got the working solution. There&#8217;s no point in spending even a couple of days on that task anymore. Nobody except me will ever use it anyway.<br />
So I decided leave it as it is. It automatically signed me off &#8216;Done and getting stuff smart&#8217; category since those guys don&#8217;t think they just do but I knew I didn&#8217;t belong there anyway.</p>
<p>Huh, long post, all the right arguments, I know I am making a right decision here and still something bothering me. Yes, I just want to spend considerable amount of time learning Compact .NET framework, knowing I will never use this knowledge, and nobody except me would use the result product and I do have working solution already. Only my laziness helping me staying on the sane side right know. I guess it is damnation of developers, writing code even when you really shouldn&#8217;t. Please give me the slightest reason to do that, say that you would use this product and I will give it to you for free, no strings attached. Let the choice I want to win actually win. I am at your will here.</p>
]]></content:encoded>
			<wfw:commentRss>http://atlygin.com/ideas/2008/07/to-write-or-not-to-write/feed/</wfw:commentRss>
		</item>
		<item>
		<title>My 3 Recent Stupid Mistakes</title>
		<link>http://atlygin.com/ideas/2008/06/my-3-recent-stupid-mistakes/</link>
		<comments>http://atlygin.com/ideas/2008/06/my-3-recent-stupid-mistakes/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 10:16:59 +0000</pubDate>
		<dc:creator>vava</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://atlygin.com/ideas/?p=14</guid>
		<description><![CDATA[As a developer I often make various bugs in my code. It&#8217;s inherent in our job, we all do that, we&#8217;re humans after all. It&#8217;s no wonder that in some companies you even got asked about your favorite mistakes you made, if you didn&#8217;t make any means you didn&#8217;t write code enough. On the other [...]]]></description>
			<content:encoded><![CDATA[<p>As a developer I often make various bugs in my code. It&#8217;s inherent in our job, we all do that, we&#8217;re humans after all. It&#8217;s no wonder that in some companies you even got asked about your favorite mistakes you made, if you didn&#8217;t make any means you didn&#8217;t write code enough. On the other hand it is a good practice to think about bugs you made, why that happened and how can you prevent them in the future. You&#8217;ll become a substantially better programmer after any single mistake you made if only you investigate it afterwards. So don&#8217;t be afraid of making one, you still will at some point of time, it&#8217;s inevitable in process of becoming better.</p>
<p>I definitely not afraid of my errors that&#8217;s why I decided to share them with you. Those a recent ones, I made them in a course of last couple of weeks of writing C# code and I novice in .NET, so enjoy.</p>
<p><strong>TimeSpan.Milliseconds</strong></p>
<p>This one isn&#8217;t really my fault. It&#8217;s Intellisense&#8217;s one and style of programming it imposes on. But let&#8217;s see from the beginning.</p>
<p>So one sunny morning I was tasked to make some research on how fast application would run in multi-threaded environment given that one crucial resource should work only in single-threaded manner. So I made a little test application, span couple of threads and time function calls I want to have results for. How do you usually do that? Of course, call Date.now before and after the call and then subtract former from the latter. Usually (that is, what I&#8217;ve got on every platform I have ever worked before) what you get after that is a number of milliseconds call took. But in .NET for some reason you get an TimeSpan object. After a couple of seconds of frustration I called an Intellisense to see if there is a method to get number of milliseconds this object is represent. So I typed a letter &#8220;m&#8221;, and I saw a really nice property named &#8220;Milliseconds&#8221; there. &#8220;Ok&#8221;, I thought, &#8220;looks like the one&#8221; and I put it there. After a couple of tests with different number of threads I noticed something suspicious. Whatever the number of threads was, the average time always stays around 500ms and max time was always 984ms. At first I thought that is a good news, that means application is good written and we&#8217;re not going to have any performance problems whatsoever. I even told that to management and they were happy. But my intuition was telling me that something is wrong here. Calculations of average time was taking so long given that average is half a second. I mean common, function was called 12500 times but it would take only about 1.7 hours to run and it took like 4 of them. Something was really wrong.</p>
<p>There were couple of additional locks in the code that were for collecting statistics and so weren&#8217;t timed so I decided to eliminate them and I did. Then after every operation I put a code that writes a &#8220;.&#8221; in a console to see how fast a progress goes. And even though there weren&#8217;t any untimed locks and average time stays half a second and max time 984ms still I could really see sometimes progress stops for about 5 seconds doing nothing. That&#8217;s why I decided to check my timing code. Magical 984ms was obvious error. After couple of minutes staring at the simplest code I ever wrote I decided to go check what MSDN knows about TimeSpan. And there it was, somewhere in the end of an article about TimeSpan.Milliseconds was a remark that it could take a values from -999 to 999 only, and was for a fact just a component of interval whole length. That&#8217;s why average stays 500, just in the middle of possible values (negative values weren&#8217;t possible in my situation). No link to correct method though, quality of MSDN is really low these days. But luckily there was a sample code right in the article with calls to all possible TimeSpan functions and results they return. That&#8217;s how I found the right property for a job, TotalMilliseconds. And yes, correct performance values were never near the 500ms, more like 40s. Sad news but a different story.</p>
<p><strong>new Random()</strong></p>
<p>This is a really funny story. The most unexpected error I ever got with random numbers. Here it goes.<br />
As a part of fighting with TimeSpan.Milliseconds bug I decided to run all my threads at the same time. Just to make sure none of them finishes before the full set of them run. At the same time I used a lot of random stuff around, to choose values for function calls, to create a users (I was actually test client to some kind of special purpose database, not a fancy one though), to choose what to do with database (that is, create something or just get data from it). After the session each thread was deleting users it created to clean a DB for the next round. And I&#8217;ve started to get strange results here, while deleting a user DB sometimes would complain it doesn&#8217;t have that one. Hm. It was created before after all, where did it go. It was late and I was tired from Milliseconds story already so I just ignored that complains and removed a code that checks it. Which leads to even more strange results, sometimes in a function user was created, uploaded to DB, everything was fine and then just a couple lines later it couldn&#8217;t be found. Not a nice stuff.</p>
<p>The next day I fired up a debugger to see why that happened. After couple of runs when I couldn&#8217;t find out a reason for such a strange behavior, I decided to put checks in cleaning code back since those issues probably was related. And when the check failed and I was looking at what other threads doing I found out couple of them were cleaning as well. Sadly, VS 2008 couldn&#8217;t show a collections while thread is paused so I couldn&#8217;t look up what they were cleaning but luckily one of them have value cached in local variable. And you know what? There was the same value in a collection of a thread I was examining.</p>
<p>So random were broken. How could that happen? And then a lucky guess, could it be that&#8230; I put a breakpoint just after a first random value was generated and, you guess it, for every thread it was the same. Yeah, random get seeded by the time, apparently it uses not high resolution clocks and threads which runs simultaneously even on single core computer and under .NET VM could get the same seed. Really nice. Adding Thread.CurrentThread.ManagedThreadId to the (int)DateTime.Now.Ticks and seed randoms with this value cured the bug instantly. This going to be my favorite bug with Random values for a long time, I don&#8217;t really know what could beat it.</p>
<p><strong>System.Threading.Timer vs. System.Windows.Forms.Timer</strong></p>
<p>This is the bug from a different application. This one shows how bad MSDN is.</p>
<p>So I was making application that should every couple of minutes do some work and notify user after it&#8217;s done. Application was working silently in the background so as a notify facility I chose 
<a  href="http://www.codeproject.com/KB/miscctrl/taskbarnotifier.aspx" onclick="javascript:pageTracker._trackPageview('/external/www.codeproject.com/KB/miscctrl/taskbarnotifier.aspx');" >TaskbarNotifier</a>, it does a great job of informing user without disturbing her.</p>
<p>So, how do you run a task every couple of minutes? You going to use timers of course. What the first thing you see if you look for &#8220;timer&#8221; in MSDN? System.Threading.Timer, which is, and I cite, &#8220;a simple, lightweight timer that uses callback methods and is served by threadpool threads. You might also consider System.Windows.Forms.Timer for use with Windows forms, and System.Timers.Timer for server-based timer functionality. These timers use events and have additional features.&#8221; Apart from threadpool reference is what I wanted, simple and lightweight. So I ignored that sign and go coding. Implementing was easy, everything worked just fine until I finally got to the point where I wanted to notify user. Notification just wasn&#8217;t working at all.</p>
<p>I saw a demo and knew it should work so I start debugging. Got into library code and noticed that timer callback that lib uses to slide window slowly just doesn&#8217;t fire. I found 
<a  href="http://www.daniweb.com/forums/thread91665.html" onclick="javascript:pageTracker._trackPageview('/external/www.daniweb.com/forums/thread91665.html');" >this thread</a> but I thought it doesn&#8217;t apply to my situation, I do all my stuff in a single thread. After minutes of frustration and googling I  decided to rewrite TaskbarNotifier a little with System.Threading.Timer since I knew it work well. And I did, and it crashed with the exception saying some GUI control was used in a thread different from where it was created. And then it hit me, &#8220;Threading&#8221; is all about threads, isn&#8217;t it? And I read documentation carefully and yes, this timer spans a new thread for callback. Not sure how this is &#8220;lightweight&#8221; but here you go. Yes, changing System.Threading.Timer to System.Windows.Forms.Timer made everything work just fine. But hell, this line about new thread should be right there, in one-line description of a class, that&#8217;s what I read after all. And yes, it&#8217;s not near simple or lightweight, so it shouldn&#8217;t be stated there. And yes, the first class in search should be most used one, System.Windows.Forms.Timer, what&#8217;s wrong with relevancy there?</p>
<p>That&#8217;s it. I didn&#8217;t make any more mistakes those couple of weeks. I did much more in my life of course but well, as I already said it&#8217;s inevitable. Be proud of your mistakes, they make you better.</p>
]]></content:encoded>
			<wfw:commentRss>http://atlygin.com/ideas/2008/06/my-3-recent-stupid-mistakes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Keep the data safe</title>
		<link>http://atlygin.com/ideas/2008/05/keep-the-data-safe/</link>
		<comments>http://atlygin.com/ideas/2008/05/keep-the-data-safe/#comments</comments>
		<pubDate>Thu, 29 May 2008 16:35:46 +0000</pubDate>
		<dc:creator>vava</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://atlygin.com/ideas/?p=13</guid>
		<description><![CDATA[I&#8217;m really angry at HTC.
I&#8217;m an owner of 
HTC TyTN II and I like this little device. It&#8217;s not perfect but I&#8217;ve never seen anything perfect with Windows Mobile inside (well, to be honest, that applies to any kind of Windows but especially to Mobile family). The reason is simple - too much freedom and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m really angry at HTC.</p>
<p>I&#8217;m an owner of 
<a  href="http://www.htc.com/www/product.aspx?id=640" onclick="javascript:pageTracker._trackPageview('/external/www.htc.com/www/product.aspx');" >HTC TyTN II</a> and I like this little device. It&#8217;s not perfect but I&#8217;ve never seen anything perfect with Windows Mobile inside (well, to be honest, that applies to any kind of Windows but especially to Mobile family). The reason is simple - too much freedom and not that much stuff working out-of-the box. Those two usually goes one with the other, iPhone and iPod don&#8217;t give you much freedom but you already have everything you need, Windows Mobile doesn&#8217;t care about third party applications but everything that comes with it sucks. It&#8217;s completely unusable for anything, you have to install Opera as a browser, mp3 and video players, all kind of readers. Thank god it could call by itself but the way it manages address book is just horrible. But at least you have freedom and can choose better products. It just drawned upon me what that reminds me of - Linux. That&#8217;s right <img src='http://atlygin.com/ideas/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> The first thing you notice when you install Linux is how much alternatives you have to everything. And how authors of distributives sometimes decides not to provide you with even essential tools since they couldn&#8217;t choose between deferent implementations of them. It sounds different but feels pretty much the same, you, as a user, have to find yourself a tool you like and could use, spend your precious time to that, while the authors of OS just feel pretty well since they give you alternatives and didn&#8217;t spend they precious time choosing themselves. But at least everything under Linux is free.</p>
<p>But enough about WM, it sucks, it will never be as good as iPhone. But it&#8217;s not HTC fault.</p>
<p>As already said I love my little device, it helps me everywhere I go. It slow for it&#8217;s money but there isn&#8217;t anything else usable with sliding QWERTY keyboard on a market. 
<a  href="http://www.google.ru/url?sa=t&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Fwww.sonyericsson.com%2Fx1%2F&amp;ei=Adk-SMGrK4_MefP1_d0N&amp;usg=AFQjCNEME51ZgHRXBQX0rwm0ZugyxbFtAg&amp;sig2=gH5yGGhASbCVjkDeWADHfQ" onclick="javascript:pageTracker._trackPageview('/external/www.google.ru/url');" >Yet</a>. But even though HTC 
<a  href="http://htcclassaction.org/" onclick="javascript:pageTracker._trackPageview('/external/htcclassaction.org/');" >doesn&#8217;t want to make it faster</a> by providing drivers for (already licensed and built inside) graphic accelerator, it&#8217;s also not the reason I&#8217;m angry at them.</p>
<p>HTC was very kind and provided update to WM to version 6.1. I did upgrade since people said it&#8217;s faster than version 6. Upgrade procedure wasn&#8217;t really hard to follow, backup your data, run this program and wait for 10 minutes. Yes, you have to backup since upgrade will wipe out every single piece of data it could find. Ok, I thought, I backup already, I&#8217;ll restore everything later. So I run the program and now my device has working WM 6.1. &#8220;How nice&#8221;, I thought, &#8220;now I just need to restore my data and good to go&#8221;. &#8220;Not that fast&#8221;, said backup utility, &#8220;you see, your version of OS is different from what that file was created for and since stupid Windows store all the system data in the registry as every other application in the system do, I can&#8217;t just restore everything because it&#8217;ll almost sure will break your system&#8221;. &#8220;Heh&#8221;, I thought, &#8220;so I have a backup, I did everything instruction said but I&#8217;m still screwed. How nice of HTC was to forget inform me about this little inconvenience&#8221;. And that&#8217;s why I&#8217;m angry at them.</p>
<p>I mean how hard it was for them to check the simplest use case of this update. I didn&#8217;t do anything custom, I even used a tool they provided to backup my stuff. That what 90% of people out there did as well I think. The funniest thing is that I could prevent all that if only I knew before. The tool is actually rather smart and if you know you&#8217;re going to upgrade your system, you could run a special application that will collect data about system stuff and with the help of that info backups could be restored afterward. But of course I didn&#8217;t know about this <strong>UNTIL</strong> I got to the point when I couldn&#8217;t do anything to fix everything and put my data back where it was.</p>
<p>That is partially my fault. I&#8217;m software engineer, I should know better. I shouldn&#8217;t trust any software and check that I could revert everything back before I run any application. But common, I&#8217;ve upgraded a ROM on couple of devices, I have never seen that it deletes all the setting <strong>AND</strong> all my data as well. I mean, yeah, BIOS isn&#8217;t critical part of a modern OS, if it changes, OS doesn&#8217;t care. But I did upgrade my Siemens CX65 phone as well numerous times and it never deleted a single setting I made before. So I wasn&#8217;t exactly prepared for that kind of situation.</p>
<p>But ok, if only HTC cared about their users a little bit more, they would have tested the whole update scenario and I&#8217;m sure they would have noticed that it&#8217;s impossible to restore a backup if you didn&#8217;t take special precautions before and they would have put the note about it in upgrading steps description and I wouldn&#8217;t have lost all my data and settings. If only&#8230;</p>
<p>So remember kinds, if you provide your customers with upgrade that will wipe (or could wipe) all her data out, check that she could restore backup she made. And if you are a customer, who going to upgrade to a new version of a product and that version could wipe your data out, wait couple of weeks and then check the blogs about other users experience. That will make your data safe.</p>
]]></content:encoded>
			<wfw:commentRss>http://atlygin.com/ideas/2008/05/keep-the-data-safe/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Colorediffs bookmarklet</title>
		<link>http://atlygin.com/ideas/2008/05/colorediffs-bookmarklet/</link>
		<comments>http://atlygin.com/ideas/2008/05/colorediffs-bookmarklet/#comments</comments>
		<pubDate>Sat, 10 May 2008 16:27:15 +0000</pubDate>
		<dc:creator>vava</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://atlygin.com/ideas/?p=12</guid>
		<description><![CDATA[As I&#8217;m sure almost nobody know yet, I am a developer of pretty Thunderbird extension called 
Colorediffs. It does a good job for couple of people coloring those boring plain text diffs every good developer receiving constantly. It&#8217;s part of our job to review them, we couldn&#8217;t do anything with this. Except maybe use some [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;m sure almost nobody know yet, I am a developer of pretty Thunderbird extension called 
<a  href="http://code.google.com/p/colorediffs/" onclick="javascript:pageTracker._trackPageview('/external/code.google.com/p/colorediffs/');" >Colorediffs</a>. It does a good job for couple of people coloring those boring plain text diffs every good developer receiving constantly. It&#8217;s part of our job to review them, we couldn&#8217;t do anything with this. Except maybe use some good tool to make life a little bit easier.</p>
<p>Anyway as a developer of this extension I get numerous of request from people to add some additional features in it but the most surprising was to make it work in a browser. I was almost shocked, do people really use browsers for reading code? If they do why the provider of a code couldn&#8217;t make it look pretty? It isn&#8217;t that hard, I mean the simplest and welcomed by a lot of people solution is just color the changed lines and it could be done with a simple regexp. Really simple.</p>
<p>But it turns out, yes, people look at plain text in their browser. Still. And then I thought, could I help them? Making extension work in a browser isn&#8217;t a good idea still, it&#8217;s heavy, slow and doesn&#8217;t care if there&#8217;s other content on the page except code. It just wasn&#8217;t made for that. In the world where it lives, whole letter is under it&#8217;s power and it uses it to make diffs looking good and actually make sense for a reader.</p>
<p>But web pages is just a whole different story. Even though as it turns out people use browsers for reading plain pages of code they usually looking at other pretty stuff and make an extension understand that is a hard task. Even harder one is to find couple of lines of code on the page with other stuff and make it any good.</p>
<p>On the other hand, I though, do I have to do this with extension and it&#8217;s full blown diff files parser? Could I just color some lines in &lt;pre&gt; blocks and call the work done? That&#8217;s still better than black-on-white stuff. So I thought a little more and created a 
<a  href="javascript:var%20s=document.createElement('script');s.setAttribute('src','http://jquery.com/src/jquery-latest.js');document.body.appendChild(s);s.onload=function(){jQuery.noConflict();jQuery('pre').each(function(i,el){jQuery(el).html(jQuery(el).html().replace(/^(@@\s-[\d,]+\s\+[\d,]+\s@@)\s/mg,'$1\n').replace(/^(@@\s-[\d,]+\s\+[\d,]+\s@@)$/mg,'&lt;span%20style=\'color:blue\'&gt;$1&lt;/span&gt;').replace(/^(\+)$/mg,'&lt;span%20style=\'color:green\'&gt;$1&lt;/span&gt;').replace(/^(\+{3}%20[^+].*)$/mg,'&lt;span%20style=\'color:green\'&gt;$1&lt;/span&gt;').replace(/^(\+[^+].*)$/mg,'&lt;span%20style=\'color:green\'&gt;$1&lt;/span&gt;').replace(/^(\-)$/mg,'&lt;span%20style=\'color:red\'&gt;$1&lt;/span&gt;').replace(/^(\-{3}%20[^-].*)$/mg,'&lt;span%20style=\'color:red\'&gt;$1&lt;/span&gt;').replace(/^(\-[^-].*)$/mg,'&lt;span%20style=\'color:red\'&gt;$1&lt;/span&gt;'));});};void(s);">Bookmarklet</a>. Just drag-and-drop it to your bookmarks panel and click when you&#8217;re viewing some site with a code, and your code will have some colors. Enjoy!</p>
<p>Full code is below, you could do everything you want with it but if you would convert it or improve it somehow I would appreciate if you send me a link to a project.</p>
<pre><span style="color: #a020f0;">var</span> <span style="color: #b8860b;">s</span>=document.createElement(<span style="color: #bc8f8f;">'script'</span>);
s.setAttribute(<span style="color: #bc8f8f;">'src'</span>, <span style="color: #bc8f8f;">'http://jquery.com/src/jquery-latest.</span><span style="font-weight: bold; text-decoration: underline; color: #ff4500;">js</span><span style="color: #bc8f8f;">'</span>);
document.body.appendChild(s);
<span style="color: #0000ff;">s.onload</span>=function(){
    jQuery.noConflict();
    jQuery(<span style="color: #bc8f8f;">"pre"</span>).each(<span style="color: #a020f0;">function</span>(i, el) {
            jQuery(el).html(
                jQuery(el).html()
                .replace(/^(@@\s-[\d,]+\s\+[\d,]+\s@@)\s/mg,
                         <span style="color: #bc8f8f;">"$1\n"</span>)
                .replace(/^(@@\s-[\d,]+\s\+[\d,]+\s@@)$/mg,
                         <span style="color: #bc8f8f;">"&lt;span style='color:blue'&gt;$1&lt;/span&gt;"</span>)
                .replace(/^(\+)$/mg,
                         <span style="color: #bc8f8f;">"&lt;span style='color:green'&gt;$1&lt;/span&gt;"</span>)
                .replace(/^(\+{3} [^+].*)$/mg,
                         <span style="color: #bc8f8f;">"&lt;span style='color:green'&gt;$1&lt;/span&gt;"</span>)
                .replace(/^(\+[^+].*)$/mg,
                         <span style="color: #bc8f8f;">"&lt;span style='color:green'&gt;$1&lt;/span&gt;"</span>)
                .replace(/^(\-)$/mg,
                         <span style="color: #bc8f8f;">"&lt;span style='color:red'&gt;$1&lt;/span&gt;"</span>)
                .replace(/^(\-{3} [^-].*)$/mg,
                         <span style="color: #bc8f8f;">"&lt;span style='color:red'&gt;$1&lt;/span&gt;"</span>)
                .replace(/^(\-[^-].*)$/mg,
                         <span style="color: #bc8f8f;">"&lt;span style='color:red'&gt;$1&lt;/span&gt;"</span>)
            );
        });
};
<span style="color: #a020f0;">void</span>(s);</pre>
]]></content:encoded>
			<wfw:commentRss>http://atlygin.com/ideas/2008/05/colorediffs-bookmarklet/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Unit Testing won&#8217;t save you testing time</title>
		<link>http://atlygin.com/ideas/2008/05/unit-testing-wont-save-you-testing-time/</link>
		<comments>http://atlygin.com/ideas/2008/05/unit-testing-wont-save-you-testing-time/#comments</comments>
		<pubDate>Thu, 08 May 2008 11:51:48 +0000</pubDate>
		<dc:creator>vava</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://atlygin.com/ideas/?p=11</guid>
		<description><![CDATA[Everybody knows the more you test the better quality of product will be. Unit testing (and other forms of automated testing) is a great helper here since you can literally run it on every change. And it&#8217;s cheap as well, people hour cost a lot more than machine hour. But will it guarantee quality of [...]]]></description>
			<content:encoded><![CDATA[<p>Everybody knows the more you test the better quality of product will be. Unit testing (and other forms of automated testing) is a great helper here since you can literally run it on every change. And it&#8217;s cheap as well, people hour cost a lot more than machine hour. But will it guarantee quality of a product?</p>
<p>The answer is &#8216;maybe&#8217;. It depends on how you develop your software, how many testers you have, how your develop cycle is organized and other stuff. Don&#8217;t get me wrong, it will increase quality of a product anyway. On the other hand there&#8217;s a chance you won&#8217;t notice it but at the same time will be spending a lot of priceless development time on that. How can that be, how can such a nice and helpful technology cost you a lot of money and don&#8217;t give any value in return.</p>
<p>But there is an answer and it is - you have to understand what it could you help with and what it can&#8217;t possible manage. You have to understand that unit testing would test only regression of your code. You have to understand that it will test only specification and only things developer could think of while writing it. It is really, really small amount of the whole work amount on testing that should be done.</p>
<p>Yes, it will help you during refactoring one part of the system. No, you still have to test everything by hands since it won&#8217;t find errors it wasn&#8217;t developed for such as white text on white background.<br/><br />
Yes, it will test that your component is working by the spec and no, it won&#8217;t help finding the wrong use of it (which might work now and won&#8217;t in production).<br/><br />
Yes, it will take some responsibilities from testers and no, you cannot fire them since look&#038;feel couldn&#8217;t be automated.<br/><br />
Yes, you could run it all the time and no, it won&#8217;t save you any testing time before release.<br/><br />
Yes, it could find some of the bugs and no, it won&#8217;t find all of them no matter how good coverage is.<br/><br />
Yes, it will save you some money on developers time since they would find errors faster and wouldn&#8217;t need costly context switch later but no, it won&#8217;t save you a lot of it since developers have to write the tests.<br/></p>
<p>So if you want to save money or time - find another way. If you want to have a little less stress at the end of development cycle or a little more quality of the product - you definitely should do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://atlygin.com/ideas/2008/05/unit-testing-wont-save-you-testing-time/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mobile browsing critical issue</title>
		<link>http://atlygin.com/ideas/2008/05/mobile-browsing-critical-issue/</link>
		<comments>http://atlygin.com/ideas/2008/05/mobile-browsing-critical-issue/#comments</comments>
		<pubDate>Tue, 06 May 2008 13:47:33 +0000</pubDate>
		<dc:creator>vava</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://atlygin.com/ideas/?p=10</guid>
		<description><![CDATA[It&#8217;s not a secret that number of mobile devices that is capable of web browsing is growing every day, heck, every phone could do that with 
opera mini now, every PDA has at least WiFi connection even 
iPod Touch has it. Sure not every owner of mobile device use it for internet access but that [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not a secret that number of mobile devices that is capable of web browsing is growing every day, heck, every phone could do that with 
<a  href='http://www.operamini.com/' onclick="javascript:pageTracker._trackPageview('/external/www.operamini.com/');" >opera mini</a> now, every PDA has at least WiFi connection even 
<a  href='http://www.apple.com/ipodtouch/' onclick="javascript:pageTracker._trackPageview('/external/www.apple.com/ipodtouch/');" >iPod Touch</a> has it. Sure not every owner of mobile device use it for internet access but that number is also grows and even google 
<a  href='http://www.reuters.com/article/internetNews/idUSN1824958820080319' onclick="javascript:pageTracker._trackPageview('/external/www.reuters.com/article/internetNews/idUSN1824958820080319');" >says that</a>. But despite that mobile browsing is just plainly painful. Not because a lack of screen space or CPU speed, not even because of mouseless experience which annoys a lot but because of QWERTY keyboard absence.</p>
<p>Why is that important you ask, isn&#8217;t a web browsing is just click-click-click? It turns out no, there is a crucial little step that you don&#8217;t even notice much on desktop computer and it is logging in. Those little buttons just wasn&#8217;t made for entering long text (and you password is long and cryptic, isn&#8217;t it?), the fact that you couldn&#8217;t see what letter you just pressed is a huge annoyance and you couldn&#8217;t even edit it if it is wrong, you have to enter it from scratch. Yes, you have all those issues except small buttons on your desktop machine as well but you just accustomed to enter text fast and without even glancing to keyboard just with 
<a  href='http://en.wikipedia.org/wiki/Procedural_memory' onclick="javascript:pageTracker._trackPageview('/external/en.wikipedia.org/wiki/Procedural_memory');" >procedural memory</a>. It couldn&#8217;t be done when one key is mapped to dozens of symbols, you actually have to turn your brain on and find that ! or &#038; that you used in your password, switching case also a huge stopover.</p>
<p>From my point of view making your customers entering a password on mobile phone is just subject her to torture. I know I&#8217;m not going to logging in unless I really have to and if there is no way to use the site without that I just wouldn&#8217;t use it until I&#8217;m home with a normal keyboard. I think most of the people think the same.</p>
<p>But sometimes you just have to login. You couldn&#8217;t use any kind of social networking without that. So how we can ease the pain then?<br />
There are different methods, some of them like attach QWERTY keyboard to every device aren&#8217;t really achievable, but others are. So let&#8217;s see what we can do.</p>
<p>First of all we can make a entering a text a little bit easier to achieve. You can remove all that masking from the password field, it is less secure but then again with the speed of typing on mobile device masking doesn&#8217;t really mask anything, last entered letter shows on the screen anyway. You can make a button to switch the behavior like Vista 
<a  href='http://www.codinghorror.com/blog/archives/001056.html' onclick="javascript:pageTracker._trackPageview('/external/www.codinghorror.com/blog/archives/001056.html');" >does</a> in WiFi settings. But anyway this is a partial solution since the pain of looking for the correct buttons is still there but you can control that you typed it correctly.</p>
<p>You can make a user enter a password only once through whole life like a google does. It would actually improve even desktop-users browser experience. But the only way you could do that is through cookies and you would have to sent them over SSL only or else anyone could steal them and the session with them. On the other hand not all mobile browsers store cookies for long, I have to login to gmail all the time even with Opera Mini which is like the best solution out there. Opera Mobile works great by the way but it is for more advanced devices.</p>
<p>That&#8217;s about it, you can&#8217;t make entering text any more pleasant but do we really have to enter it to log in? No, we don&#8217;t, there&#8217;s a plenty of technologies out there that don&#8217;t depend on a keyboard. The most great of course is fingerprint reader but it has to be in the device and browser has to support it as well. SSH style 
<a  href='http://en.wikipedia.org/wiki/Secure_Shell#How_SSH_uses_public-key_cryptography' onclick="javascript:pageTracker._trackPageview('/external/en.wikipedia.org/wiki/Secure_Shell?How_SSH_uses_public-key_cryptography');" >login by a secure key</a> doesn&#8217;t depend on hardware but still does on the browser unless you&#8217;re ready to pass a secret key over a wire as a file from the page and check it on the server. Which isn&#8217;t that much a secure hole if you&#8217;re using SSL connection for that but a bad habit anyway.</p>
<p>You could use pictures instead of letters. Just show a person nine pictures, let him choose the correct one and then repeat the procedure couple of times. It has limited the number of possible password combinations in comparison with letters but it is easy to implement, easy to enter. There is even a 
<a  href='http://www.springerlink.com/content/d232002j325m46v5/' onclick="javascript:pageTracker._trackPageview('/external/www.springerlink.com/content/d232002j325m46v5/');" >book</a> on the topic.</p>
<p>Another way is to learn from Twitter and use phone number as a person id. There is actually a couple of different ways to do that. First, you might just SMS some kind of short auto-generated pin-code to the phone and make a person enter it. If it is just digits there is no problem to enter them whatsoever.<br/><br />
The second solution would be to SMS auto-generated unique url that would login automatically. Much stronger against attack since you could make a huge url and you couldn&#8217;t do that with pin-code. On the other hand phone have to have ability to follow that url and not every phone could do that. PDAs without GSM module is out of business too.</p>
<p>Whatever way you choose just don&#8217;t forget how hard it is and how many potential customers would just say no to your site because of the login problem. So you have to do it right, it is just essential even more than any other functionality. Because no matter how great you site is nobody would use it if they just cannot login.</p>
]]></content:encoded>
			<wfw:commentRss>http://atlygin.com/ideas/2008/05/mobile-browsing-critical-issue/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Upgrading</title>
		<link>http://atlygin.com/ideas/2008/04/upgrading/</link>
		<comments>http://atlygin.com/ideas/2008/04/upgrading/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 18:52:38 +0000</pubDate>
		<dc:creator>vava</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://atlygin.com/ideas/?p=9</guid>
		<description><![CDATA[Did you ever though about how can you spot a real IT guy looking at his computer? Sure installed JVM is a good indicator but there is another way. Just look at software versions. Guys like us always upgrading just for the sake of it. It is easy, fast, brings you new features and eliminates [...]]]></description>
			<content:encoded><![CDATA[<p>Did you ever though about how can you spot a real IT guy looking at his computer? Sure installed JVM is a good indicator but there is another way. Just look at software versions. Guys like us always upgrading just for the sake of it. It is easy, fast, brings you new features and eliminates old bugs.</p>
<p>Except sometimes it brings new bugs and breaks features you liked. Every one of us I&#8217;m sure has a couple of disaster upgrade stories. Every now and then it happens. Just a month ago I upgraded to a beta version of Ubuntu and my system 
<a  href='https://bugs.launchpad.net/ubuntu/+bug/179095' onclick="javascript:pageTracker._trackPageview('/external/bugs.launchpad.net/ubuntu/+bug/179095');" >suddenly lost sound</a>. I mean common, it was like three weeks before release, software should be stable as hell at this moment. But it didn&#8217;t I my system stayed noiseless for a couple of weeks when eventually bugs got fixed. It wasn&#8217;t pleasant experience especially since I didn&#8217;t have any way to fix it myself, you couldn&#8217;t just downgrade a piece of software and reinstalling OS is too much pain.</p>
<p>But here you go, it happens. Some guys decide not to upgrade at all and therefore not to have any upgrading issues, leaving the system as stable as possible. And while I think it makes sense for some systems like a Nuclear Power Station computers we as developers shouldn&#8217;t follow it. We should run the latest more or less stable build of any software we use.</p>
<p>Here is why - we write systems as well. We&#8217;re not afraid of bugs, we&#8217;re use to them. Stability is a good option but it is not <strong>that</strong> important in our world. I&#8217;m sure any of you accustomed to save the document you&#8217;re working on every second or so. And the most important thing is - we could test software we&#8217;re building in most recent environment. That is just essential. You couldn&#8217;t develop a web application now without testing it on Firefox 3 and IE8, because that&#8217;s where your application is going to work very soon. You can&#8217;t just skip testing any Windows application on WinXP with SP3 and Vista with SP1. You can run tests within virtual machines while leaving your system clean and stable but it just not the same, you wouldn&#8217;t find as much that minor issues and incompatibilities as you could find living with the system all day long and developing on it.</p>
<p>Don&#8217;t get me wrong, you have to understand what you&#8217;re doing before upgrading. Just read release notes, google for a while to find out how stable the new system is. But when it exceeding some threshold of stability and you can actually live with it - go ahead and install it. It&#8217;ll help you fix any new system related issues now and not when the new system hits the market and your product suddenly stops working. On the other hand it&#8217;ll test your product in unstable environment, which is always a good thing to do.</p>
<p>So upgrade. To beta and maybe even alpha versions. Just be aware of the possible problems and make a backup, just in case.</p>
]]></content:encoded>
			<wfw:commentRss>http://atlygin.com/ideas/2008/04/upgrading/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SSD disks</title>
		<link>http://atlygin.com/ideas/2008/04/ssd-disks/</link>
		<comments>http://atlygin.com/ideas/2008/04/ssd-disks/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 19:43:39 +0000</pubDate>
		<dc:creator>vava</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://atlygin.com/ideas/?p=8</guid>
		<description><![CDATA[Every developer has to be geek inside. It is just natural and stops most of us from thoughtless actions like applying for Oracle or any other Enterprise Level company. But as geeks we love everything new and shiny that somehow related to computers, software, hardware, 
cool gadgets, we love all this stuff especially when they [...]]]></description>
			<content:encoded><![CDATA[<p>Every developer has to be geek inside. It is just natural and stops most of us from thoughtless actions like applying for Oracle or any other Enterprise Level company. But as geeks we love everything new and shiny that somehow related to computers, software, hardware, 
<a  href='http://www.codinghorror.com/blog/archives/000353.html' onclick="javascript:pageTracker._trackPageview('/external/www.codinghorror.com/blog/archives/000353.html');" >cool gadgets</a>, we love all this stuff especially when they just hit the market. But some of them might be ridiculously expensive. I don&#8217;t know why 
<a  href='http://www.apple.com/macbookair/' onclick="javascript:pageTracker._trackPageview('/external/www.apple.com/macbookair/');" >Macbook Air</a> cost that much although I won&#8217;t rant about it having one USB or lack of other ports. Be mature, there are tons of USB hubs everywhere and in couple of years all the devices would be either USB or wireless. But here you at least know what you are paying for - prettiest laptop ever built.</p>
<p>But there are other examples. Quad Core CPUs is one of them. Cool things for sure but 
<a  href='http://www.codinghorror.com/blog/archives/000655.html' onclick="javascript:pageTracker._trackPageview('/external/www.codinghorror.com/blog/archives/000655.html');" >do you need them</a>? Modern systems are fast and unless you don&#8217;t run ray tracing constantly or 
<a  href='http://www.codinghorror.com/blog/archives/001103.html' onclick="javascript:pageTracker._trackPageview('/external/www.codinghorror.com/blog/archives/001103.html');" >compiling C++ applications</a> all day long you aren&#8217;t going to notice much benefits even from Dual Core systems. Of course the second core does have sense when some of your application goes crazy and you can just stop it without experiencing jumpy mouse movements or waiting an hour for Task Manager to start. But that about it and sometimes they just don&#8217;t give you much more value than a P3 CPU. Well, you don&#8217;t really have an option here, Dual Core is a slowest available processor out there but I think it just enough.</p>
<p>But you can find tons of articles about that and you couldn&#8217;t find almost any about SSD disks. It does looks like a great technology and it will be big in the future. SSD doesn&#8217;t have moving parts so you can shake or drop it without any risk of loosing your data. But the greatest benefits of them suppose to be read/write speed and less power consuming, it is just memory, isn&#8217;t it?</p>
<p>Believe me or not I though so myself until recently. Turns out they aren&#8217;t that great at all. One of the Russian company did a 
<a  href='http://www.fcenter.ru/online.shtml?articles/hardware/hdd/23761' onclick="javascript:pageTracker._trackPageview('/external/www.fcenter.ru/online.shtml');" >research</a> and found out that they actually 
<a  href='http://www.fcenter.ru/img/article/hdd/Samsung_and_Gigabyte/116773.png' onclick="javascript:pageTracker._trackPageview('/external/www.fcenter.ru/img/article/hdd/Samsung_and_Gigabyte/116773.png');" >slower in write operations</a> and consume almost 
<a  href='http://www.fcenter.ru/img/article/hdd/Samsung_and_Gigabyte/116830.png' onclick="javascript:pageTracker._trackPageview('/external/www.fcenter.ru/img/article/hdd/Samsung_and_Gigabyte/116830.png');" >as much electricity as 2.5&#8243; HDD</a>. Well, yes, they 
<a  href='http://www.fcenter.ru/img/article/hdd/Samsung_and_Gigabyte/116831.png' onclick="javascript:pageTracker._trackPageview('/external/www.fcenter.ru/img/article/hdd/Samsung_and_Gigabyte/116831.png');" >two times more economical</a> during operation time but it doesn&#8217;t give you much since disks most of the time actually idling, it is easy to proof, just look to your IDE activity indicator while you&#8217;re debugging. And what does 2x means anyway, how much time would it give to your laptop battery life? 
<a  href='http://www.anandtech.com/memory/showdoc.aspx?i=3287&#038;p=4' onclick="javascript:pageTracker._trackPageview('/external/www.anandtech.com/memory/showdoc.aspx');" >-8 minutes</a>. Yes, there is a minus here.</p>
<p>But why is that? How come HDD that spins a disks at 7200 RPM is more efficient than couple of microchips? Why moving an operation that implies a moving of a small piece of metal around is slower than switching electronic routes? Could be a 
<a  href='http://en.wikipedia.org/wiki/Difference_engine' onclick="javascript:pageTracker._trackPageview('/external/en.wikipedia.org/wiki/Difference_engine');" >Babbage device</a> faster than a modern CPU? Obviously an answer for the last question is no but you knew it already, didn&#8217;t you? But why SSD performing that poorly?</p>
<p>Well, there is a short answer, evolution. HDD is around for more than 50 years now, over all those years thousands of people worked hard to improve them. They&#8217;ve put a lot of accessories inside that makes disks perform better, consume less, turn off in case of forthcoming drops and hits and a lot of others. SSD on the other hand is just in the beginning of their life, they eventually will be polished but years should pass before that will happen. It will eventually, mechanic stuff couldn&#8217;t be as efficient as electronic components but not today. Not tomorrow. Not this year.</p>
<p>Be aware of that and the next time you would think about buying new laptop with SSD just turn that thought down and go with good ole HDD. You will have to replace the whole notebook in a year anyway and maybe engineers would fix flash issues during that time.</p>
]]></content:encoded>
			<wfw:commentRss>http://atlygin.com/ideas/2008/04/ssd-disks/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Marketing</title>
		<link>http://atlygin.com/ideas/2008/04/marketing/</link>
		<comments>http://atlygin.com/ideas/2008/04/marketing/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 20:12:14 +0000</pubDate>
		<dc:creator>vava</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://atlygin.com/ideas/2008/04/good-developer/</guid>
		<description><![CDATA[I won&#8217;t tell you how to be good at marketing. I simply don&#8217;t know, I am a developer, not a manager. But since as a developer I should also understand the whole life cycle of software project I do know a little about that. &#8220;A little&#8221; also means I could see when it is done [...]]]></description>
			<content:encoded><![CDATA[<p>I won&#8217;t tell you how to be good at marketing. I simply don&#8217;t know, I am a developer, not a manager. But since as a developer I should also understand the whole life cycle of software project I do know a little about that. &#8220;A little&#8221; also means I could see when it is done wrong.</p>
<p>You (or you company of course) should be able to benefit from every project you push into the market. If it couldn&#8217;t give you money at least you should get a respect from other fellow developers which means the project have to be open source or either how do you impress everybody with you code that nobody could see? Ok, it could be open source and still bring you money from advertisement and other code unrelated stuff. But if you don&#8217;t benefit from it you wouldn&#8217;t support and extend it so it would be stillborn. Dead. That&#8217;s it. Nobody would use it anyway. Maybe someone can breathe new life into it later but I wouldn&#8217;t count on that.</p>
<p>But then there is two major ways to make some cash out of project - you either sell it or put advertisement on it. It is dead simple with selling model, you do project, customers pay you money and use it. There is of course can be a light free version and trial period for full-blown one which makes it more popular and increase your sales. That will help 
<a  href='http://www.ericsink.com/bos/Closing_the_Gap_Part_2.html' onclick="javascript:pageTracker._trackPageview('/external/www.ericsink.com/bos/Closing_the_Gap_Part_2.html');" >closing the gap</a> between your product and customers. But on the whole your product use only the people who paid for it. Wrong pricing is a most common issue here but it is covered by 
<a  href='http://www.joelonsoftware.com/articles/CamelsandRubberDuckies.html' onclick="javascript:pageTracker._trackPageview('/external/www.joelonsoftware.com/articles/CamelsandRubberDuckies.html');" >Joel</a> and 
<a  href='http://www.ericsink.com/bos/Product_Pricing.html' onclick="javascript:pageTracker._trackPageview('/external/www.ericsink.com/bos/Product_Pricing.html');" >Eric Sink</a> and they know a lot more than me.</p>
<p>On the other hand with the advertisement model customers themselves doesn&#8217;t pay you anything. You revenue would depend on them, sure, but not that much. So your relations with customers should be different, you don&#8217;t want to work on 
<a  href='http://www.ericsink.com/bos/Starting_Your_Own_Company.html' onclick="javascript:pageTracker._trackPageview('/external/www.ericsink.com/bos/Starting_Your_Own_Company.html');" >vertical market</a> since the customer base is strictly limited but you want to have as much of them as possible. And you can more easily since they wouldn&#8217;t pay a dime for you. That said I don&#8217;t understand people who lock their web products to US only viewers. Ok, American ads might not make sense for people in China but you wouldn&#8217;t loose your US viewers because of that. You might as well get more of them since people talk worldwide nowadays. And region specific advertisers would find you sooner if the product has some reputation, no need to pay sales teem for contacting them. So no bad things going to happen to you, only good stuff.</p>
<p>There is also web shops that sells digital content only in number of countries. Yes, they selling, but that not the point, they restrict they customer base without any good reason. They might think there&#8217;s not enough customer in other countries but how do you know without trying to reach them? Is it that hard to accept any credit card? Does wiring a song to Russia would cost you a fortune? No, not really, you&#8217;ll make as much profit from it as from one shipped in US. One country might not give you much but there are hundreds of them. Just like Amazon makes a fortune from 
<a  href='http://www.wired.com/wired/archive/12.10/tail.html' onclick="javascript:pageTracker._trackPageview('/external/www.wired.com/wired/archive/12.10/tail.html');" >The Long Tail</a> of books you might do the same from the long tail of people in not that rich countries. Digits doesn&#8217;t care where they being wired anyway.</p>
<p>There is a lot of others mistakes like wrong positioning, ignoring customers needs, messy GUI, premature advertising and others. I couldn&#8217;t give you advises here, I have never managed a company in my life so I just have no experience with them and don&#8217;t know how to avoid them. But nonetheless even if you couldn&#8217;t spot them yourself just ask your customers what they think about your product. If a hundred of people would say the same thing then maybe they right.</p>
]]></content:encoded>
			<wfw:commentRss>http://atlygin.com/ideas/2008/04/marketing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>APIs documentation</title>
		<link>http://atlygin.com/ideas/2008/04/apis-documentation/</link>
		<comments>http://atlygin.com/ideas/2008/04/apis-documentation/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 11:59:42 +0000</pubDate>
		<dc:creator>vava</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://atlygin.com/ideas/2008/04/apis-documentation/</guid>
		<description><![CDATA[Today I want to talk about documentation, especially about APIs documentation since it is most useful kind of it. People rarely read user documentations, FAQs and other stuff until they are in trouble. But developers read API reference before that since they couldn&#8217;t even get into trouble without it. I mean how could you call [...]]]></description>
			<content:encoded><![CDATA[<p>Today I want to talk about documentation, especially about APIs documentation since it is most useful kind of it. People rarely read user documentations, FAQs and other stuff until they are in trouble. But developers read API reference before that since they couldn&#8217;t even get into trouble without it. I mean how could you call a function in a wrong manner if you don&#8217;t know how it&#8217;s called?</p>
<p>On the other hand API references is arguably a hardest kind of docs, it should be cross-referenced, indexed, user should be able to find a function she needs even if she doesn&#8217;t know a thing about it. It is really hard to manage. In fact I never seen an API reference that is good. Yes, even &#8220;good&#8221; level is hard to achieve. If your API is consist from 10 classes with 10 methods in each one it&#8217;s ok. I have never have a problem with 
<a  href='http://haxe.org/api/' onclick="javascript:pageTracker._trackPageview('/external/haxe.org/api/');" >haXe API reference</a> although it lacks even slight presence of comments. Yes, you have to look in the code sometimes but it&#8217;s ok for a small code base anyway.</p>
<p>But when your code base grow you have to do something about documentation. You don&#8217;t want developers re-implement stuff from your library, do you? And if it is easier for them than to find a right standard function they&#8217;ll do it all the time. And will rant to you and others that API lacks all sorts of basic stuff even if it don&#8217;t. That might hurt library carma a lot.</p>
<p>I mean look at MSDN. Sometime ago it was reasonably good, oh, I mean so-so, tool. You could find a lot of info for any WinAPI or C++ standard function in no time, see how they related and stuff. And now&#8230; Just try find something about .NET libraries. I mean, common, that is one of most used libraries out there. It has thousands of classes, methods and so on. And if I search for a <code>String</code> class what do I get? &#8220;Represents text as a series of Unicode characters.&#8221; Huh, is that all? Are you kidding me? What if I have MBCS string in CP-936 encoding, how do I convert it to this string? Ok, let&#8217;s see constructors. <code>String (SByte*)</code>. Looks nice. &#8220;Initializes a new instance of the String class to the value indicated by a pointer to an array of 8-bit signed integers. Supported by the .NET Compact Framework.&#8221; Ok. What encoding should that array of bytes be in? I mean encoding is the 
<a  href='http://www.joelonsoftware.com/articles/Unicode.html' onclick="javascript:pageTracker._trackPageview('/external/www.joelonsoftware.com/articles/Unicode.html');" >most essential property</a> of a String, it just doesn&#8217;t make sense to have a string without knowing which encoding it is in.</p>
<p>I think I know why that happened. It&#8217;s all Java fault. Java-doc to be precise. Yes, it is a nice feature but it wouldn&#8217;t work with any programmers. You have to make them write a good comment and they will try to avoid that as much as possible since it is just boring. I know since I also think that way, thanks god I don&#8217;t work on public API. And that is a half of the problem with .NET actually, the other one is lack of the sources. XXI century. Open source is everywhere. Java comes with sources of the library from day one. MFC was distributed with sources. How horrified should they look for .NET library that Microsoft decided not to show them? You say, ok, but it doesn&#8217;t related to documentation. But it is. What if you just happen to be in the situation when you have to know for sure what <code>String (SByte*)</code> does? If the sources were there you could look it up by yourself. In fact I often do that for MFC and STL and mostly for any other library I know. Just because API reference is always suck. That&#8217;s essential property of a thing.</p>
<p>
I couldn&#8217;t say that things are better in Java world. Yes, they provide a lot more information about methods, they have sources shipped with it. But they lack of such useful search-as-you-type facility for method and class names that MSDN provides. There at least you could find a function you need. Here you couldn&#8217;t survive without google at all. Lets hope they do something similar at least on their online  reference since it is really impossible without server side anyway.</p>
<p>I think at the end I should mention two big and honorable projects that doesn&#8217;t really care about documentation at all. Yes, they have some but it is just not developer oriented. Which is really strange for API reference, don&#8217;t you think?</p>
<p>One is Emacs. Yes, it has 
<a  href='http://www.gnu.org/software/emacs/manual/' onclick="javascript:pageTracker._trackPageview('/external/www.gnu.org/software/emacs/manual/');" >manual</a>. But it is a mix of user oriented and developer oriented docs which makes it really hard to find a thing you&#8217;re looking for. Sources aren&#8217;t helping here much too since they are in Lisp. I&#8217;m not a Lisp developer so they hardly make sense to me.</p>
<p>Another one is 
<a  href='http://dojotoolkit.org/' onclick="javascript:pageTracker._trackPageview('/external/dojotoolkit.org/');" >Dojo</a>. Great project but it is too overcomplicated. JavaScript library should be lightweight. That one just not. It has everything you ever imagined to do with JavaScript already done and tested. Except it is really hard to start using it. There is a 
<a  href='http://dojotoolkit.org/book/dojo-book-1-0' onclick="javascript:pageTracker._trackPageview('/external/dojotoolkit.org/book/dojo-book-1-0');" >book</a> with simple examples that does not make it any clearer how to write more advanced ones which makes it useful for marketing not developers, 
<a  href='http://api.dojotoolkit.org/' onclick="javascript:pageTracker._trackPageview('/external/api.dojotoolkit.org/');" >api reference</a> with less information than in MSDN, and really complicated and unnatural for JavaScript techniques that makes sources unusable. How convenient. But at least it is free and comes with the sources so it still better than .NET. Oh well, everything better than .NET anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://atlygin.com/ideas/2008/04/apis-documentation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Blogging with Emacs</title>
		<link>http://atlygin.com/ideas/2008/04/blogging-with-emacs/</link>
		<comments>http://atlygin.com/ideas/2008/04/blogging-with-emacs/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 15:48:04 +0000</pubDate>
		<dc:creator>vava</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://atlygin.com/ideas/2008/04/blogging-with-emacs/</guid>
		<description><![CDATA[Emacs is a great text editor, the best there is. Although you have to commit couple of months of pretty painful experiences with it but after that you wouldn&#8217;t change it for anything else. Especially if you don&#8217;t have mouse.

Sometimes though it is missing some features but then if you are the programmer it&#8217;s when [...]]]></description>
			<content:encoded><![CDATA[<p>Emacs is a great text editor, the best there is. Although you have to commit couple of months of pretty painful experiences with it but after that you wouldn&#8217;t change it for anything else. Especially if you don&#8217;t have mouse.</p>
<p>
Sometimes though it is missing some features but then if you are the programmer it&#8217;s when Emacs great power of exensibility comes to rescue. You can do everything and it&#8217;s not just figure of speech. Want to highlight your self made language? Change the formatting rules? 
<a  href='http://steve-yegge.blogspot.com/2008/03/js2-mode-new-javascript-mode-for-emacs.html' onclick="javascript:pageTracker._trackPageview('/external/steve-yegge.blogspot.com/2008/03/js2-mode-new-javascript-mode-for-emacs.html');" >Parse JavaScript</a>? Nothing stopping you except maybe your own laziness.</p>
<p>So since I decided to use that great editor as a tool for my blogging I was trying to make it as useful for me as possible. First of all I used 
<a  href='http://cvs.savannah.nongnu.org/viewvc/*checkout*/weblogger/lisp/weblogger.el?root=emacsweblogs' onclick="javascript:pageTracker._trackPageview('/external/cvs.savannah.nongnu.org/viewvc/*checkout*/weblogger/lisp/weblogger.el');" >weblogger.el</a> which is a really handy tool for writing and publishing the articles (you could find a little how-to 
<a  href='http://peadrop.com/blog/2007/05/11/blogging-with-emacs/' onclick="javascript:pageTracker._trackPageview('/external/peadrop.com/blog/2007/05/11/blogging-with-emacs/');" >here</a>). But it lacks one really important feature - you have to write your posts with HTML markup. And it is really annoying. So I wondered around a little and found couple of different text formatting techniques which are supported by Emacs, that is 
<a  href='http://en.wikipedia.org/wiki/Textile_(markup_language)' onclick="javascript:pageTracker._trackPageview('/external/en.wikipedia.org/wiki/Textile_(markup_language)');" >Textile</a> and 
<a  href='http://daringfireball.net/projects/markdown/' onclick="javascript:pageTracker._trackPageview('/external/daringfireball.net/projects/markdown/');" >Markdown</a>. Textile is looking a little bit better from my perspective so I found a 
<a  href='http://dev.nozav.org/textile-mode.html' onclick="javascript:pageTracker._trackPageview('/external/dev.nozav.org/textile-mode.html');" >mode</a> for it and gave it a try. It looked nice, but it was a major mode so I couldn&#8217;t use it directly with weblogger and it doesn&#8217;t have a translation to HTML which makes it kind of useless for my tasks.</p>
<p>Nonetheless I remembered that I am a developer for gods sake so I could fix it. And I did. I&#8217;ve created a 
<a  href='http://code.google.com/p/textile-minor-mode/' onclick="javascript:pageTracker._trackPageview('/external/code.google.com/p/textile-minor-mode/');" >textile-minor-mode</a>. It doesn&#8217;t do much yet and I don&#8217;t think it&#8217;ll become big anytime soon but it does work for my needs fine and it my work for yours too. By the way if you think it is limited you are welcome to write me a letter and I would give you the rights to code repository so you could fix it <img src='http://atlygin.com/ideas/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So here is little guide how to use it. First of all you download it from 
<a  href='http://textile-minor-mode.googlecode.com/svn/trunk/textile-minor-mode.el' onclick="javascript:pageTracker._trackPageview('/external/textile-minor-mode.googlecode.com/svn/trunk/textile-minor-mode.el');" >there</a> and put it in your site-lisp directory (or anywhere where it could be discovered by Emacs automatically, site-lisp have this property by default). Then you add following code into your .emacs file</p>
<pre>
(require 'textile-minor-mode)

(add-hook 'weblogger-entry-mode-hook 'textile-minor-mode)
</pre>
<p>
First line just loads mode into Emacs and the second one starts it when weblogger starts.<br />
By the way you don&#8217;t have to restart Emacs to try this new code, just select it and M-x eval-region and you&#8217;re ready.</p>
<p>Try it out, start new blog post with M-x weblogger-start-entry and then use textile all over. It gets nicely highlighted. When you&#8217;re done, call M-x textile-to-html-buffer-respect-weblogger and check generated markup. Then just press C-x C-s and your post is out there!</p>
<p>PS. Just for the sake of it, the code from my .emacs that helping me with blogging</p>
<pre>
(require 'weblogger)
;;Saving is just an instinct, it happens every 5 sec,
;; I don't want to publish that often.
(define-key weblogger-entry-mode-map "\C-x\C-s" 'weblogger-send-entry)

(require 'textile-minor-mode)

(add-hook 'weblogger-entry-mode-hook 'textile-minor-mode)
(add-hook 'weblogger-entry-mode-hook 'flyspell-mode)

(defun publish-post ()
  (interactive)
  (textile-to-html-buffer-respect-weblogger)
  (weblogger-publish-entry)
 )
</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://atlygin.com/ideas/2008/04/blogging-with-emacs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Compilers and why they are evil</title>
		<link>http://atlygin.com/ideas/2008/04/compilers-and-why-they-are-evil/</link>
		<comments>http://atlygin.com/ideas/2008/04/compilers-and-why-they-are-evil/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 11:52:50 +0000</pubDate>
		<dc:creator>vava</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://atlygin.com/ideas/2008/04/compilers-and-why-they-are-evil/</guid>
		<description><![CDATA[I want to make something clear from the start, compiler for me is something that translates program to byte codes before I could run it. So interpreters are not compilers in that sense since they do that on the fly and I adore them.
But I hate compilers as much as I believe any other C++ [...]]]></description>
			<content:encoded><![CDATA[<p>I want to make something clear from the start, compiler for me is something that translates program to byte codes <i>before</i> I could run it. So interpreters are not compilers in that sense since they do that on the fly and I adore them.</p>
<p>But I hate compilers as much as I believe any other C++ programmer out there. Didn&#8217;t you ever after a quick fix which takes a second was waiting for half an hour for program to compile so you could see you was wrong and should fix just a little bit more? Isn&#8217;t it just a huge waste of time?</p>
<p>I know, Java advocates that it compiles much faster since it doesn&#8217;t have that much dependencies over files. That&#8217;s true. For some extend. You know, &#8220;Hello world&#8221; programs compiles instantly. But when the code grows compiling tends to become slower and slower and then ant thrown into equation which makes it a lot slower almost as slow as C++. It always happens with big projects, code is shared and you have to be sure all the parts that is using at least it compiles.</p>
<p>But why? Why do we have to wait? Why it couldn&#8217;t compile only the parts we are looking at much like JSP actually does? Why check everything all the time?</p>
<p>That&#8217;s static typing for you. Compiler want to be sure everything is correct so it has to look everywhere your changes could make the difference and it is usually huge piece of a project. When there an ant script in place it doesn&#8217;t even check and recompiles everything. Just in case. You know, better check it early as they say. Never mind it takes forever.</p>
<p>But it is wrong. The reason of early checks is coming from fact that later you might forget the context of the fix so you would have to spend significant amount of time to get it back. But I do forget it while this stupid compiler checks everything and I have to make myself coffee or read something since I couldn&#8217;t just hibernate. Even more, if it wouldn&#8217;t do that I fix the issue faster and still be in context if one of tests would break. Or at least as much as I am after compiling time anyway.</p>
<p>So it just not worth it. But you couldn&#8217;t just throw compiler away if there are static types. It just makes your classes depend on each other so you have to compile all of them. Huh, poor me.</p>
<p>There are another types of compiles, so called preprocessors which converts some of super set of the language to the language itself. C++ preprocessor is a simplest one I know. 
<a  href="http://chumsley.org/jwacs/" onclick="javascript:pageTracker._trackPageview('/external/chumsley.org/jwacs/');" >jwacs</a> is pretty complex one more like a compiler. They&#8217;re usually fine except they wants me to do one more step between writing code and running application. They could easily avoid that by doing everything on demand since they work on per file basis. I really want something for JavaScript and XUL which would work like that. Maybe even converter from JSON to XUL. Need to make some modification to Thunderbird and Firefox in order to do that though.</p>
<p>Ok, today we learn that compilers are evil since they just stealing our time, writers of preprocessor languages too lazy to make them usable by making them work on demand, static typing sucks and dynamic languages rules. See you later!</p>
]]></content:encoded>
			<wfw:commentRss>http://atlygin.com/ideas/2008/04/compilers-and-why-they-are-evil/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Inheritance is for n00bs</title>
		<link>http://atlygin.com/ideas/2008/04/inheritance-is-for-n00bs/</link>
		<comments>http://atlygin.com/ideas/2008/04/inheritance-is-for-n00bs/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 10:46:13 +0000</pubDate>
		<dc:creator>vava</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://atlygin.com/ideas/?p=3</guid>
		<description><![CDATA[Wow, first post and that controversial! Some people might be piss out, I&#8217;m sorry, it&#8217;s not really my fault, 
Steve Yegge, that is your target, go yell at him  Anyway, I do agree with him, more experienced you are, less metadata you use since you could get everything from the code itself. That means [...]]]></description>
			<content:encoded><![CDATA[<p>Wow, first post and that controversial! Some people might be piss out, I&#8217;m sorry, it&#8217;s not really my fault, 
<a  href="http://steve-yegge.blogspot.com/2008_02_01_archive.html" onclick="javascript:pageTracker._trackPageview('/external/steve-yegge.blogspot.com/2008_02_01_archive.html');" >Steve Yegge</a>, that is your target, go yell at him <img src='http://atlygin.com/ideas/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Anyway, I do agree with him, more experienced you are, less metadata you use since you could get everything from the code itself. That means that compilers appears to be dumber than you since they couldn&#8217;t do the same. Isn&#8217;t that wrong? Yes but even more annoying, so you start looking at dynamic languages which do not have compilers (or at least could be used without them) which gives you shorter write-test loop which benefits your performance which in turn makes you feel better.</p>
<p>But how does this correlate with the theme of the post? Easy, inheritance itself is just metadata. You don&#8217;t need it at all. Wanna proof? Just look at the cases when you use it.</p>
<ol>
<li>You want use a set of classes interchangeably.</li>
<li>You are using two classes and want one of them to reuse some code from the other.</li>
<li>You want to create a new class on the base of another one but change it&#8217;s behavior a little.</li>
</ol>
<p>That&#8217;s all, any other cases is just combination of these three. Heck, even third one is actually a combination of first two. But do we really do want to use inheritance here?</p>
<ol>
<li>No, since dynamic languages gives you ability to duck typing. It&#8217;s much more flexible. Even C++ tries to use it with templates so it must be good.</li>
<li>No, since that is a bad practice anyway. Go get any of OOP book and it is usually said that you must use inheritance only to reuse the interface, not the code. Aggregate not inherit.</li>
<li>Well, that is combination of previous two so it could be solved by combination of aggregation and duck typing. But since most of dynamic languages respect not only classes but object instances too and could modify them on the fly you could just change set of objects you need when you need it.</li>
</ol>
<p>So no luck inheritance, I don&#8217;t want you. And even though 
<a  href="http://ejohn.org/blog/simple-javascript-inheritance/" onclick="javascript:pageTracker._trackPageview('/external/ejohn.org/blog/simple-javascript-inheritance/');" >John Resig wrote</a> the awesome piece of code to support you in JavaScript I would never use you there. No luck for me in C++ though, templates are nice but couldn&#8217;t be used in every situation. And again, coworkers would be angry at me anyway <img src='http://atlygin.com/ideas/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://atlygin.com/ideas/2008/04/inheritance-is-for-n00bs/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.982 seconds -->
