Laimonas Blog News Feed 
Monday, February 09, 2009  |  From Laimonas Blog

So it looks like my hosting company's partnership split into two parts and are fighting each other. I am receiving notices for billing, shortly after got a notice of billing system hijacking, then rebuking of that statement by another party, etc... Basically it is looking like a big nice mess. Don't be surprised if this site goes offline shortly.

Sunday, February 01, 2009  |  From Laimonas Blog

I am starting to look for yet another hosting solution. I know, I don't blog much to justify keeping this up, but I refuse to give up :)

The current host is discontinuing shared website hosting deals and is offering only VMs and dedicated server boxes (and more bigger stuff). Well that's what I would like to have, but it is way too pricey.

I looked into setting up everything on EC2. But a quick calculation shows that that option is a bit too pricey as well. Cheapest linux instance is $0.10/hour. So $0.10 * 24 * (365 | 366) = $876 | $878.4 per year. And that's not counting the bandwidth costs (considering the immense popularity of this thing it would be ... 0.10 cents :) ).

However I might just need to go ahead and bite the bullet and get at least a hosted VM from them. I have two projects that I want to showcase and run full-time, so I could do that as well if I had a dedicated machine.

Tuesday, January 20, 2009  |  From Laimonas Blog

Started to use twitter since mid December. I must say it is more enjoyable than I thought it would be. Also more useful than I expected. I find it great for catching some blimps on the products people are using and what they are working on. If it sounds interesting enough I proceed to do more in-depth research regarding the topic or ping the person for more conversation. So far so good.

Twitter profile

Monday, January 12, 2009  |  From Laimonas Blog

I noticed recently the increase in free source code repository services. Not really surprised. The advent of easily accessible cloud computing and cloud storage (thanks to amazon web services mainly) enables small companies to provide such services at a very low price.

The two services that are making the most noise in this area is Unfuddle and GitHub. I hear a lot of great things about GitHub and it seems to me this should be your number one choice (I hear stuff from people I trust). However they do not offer a free private repository, only public. Thus I went with unfuddle. I am hosting source code for two projects there right now and so far has been very happy with the service.

Repository hosting for the the two above mentioned services is just one piece of the business. Collaboration tools are included as well. I think this is great for starter developers to get used to using source control as well as for self-employed or hobbyists. I know I feel better that I am not responsible for my source repository backups.

Saturday, December 27, 2008  |  From Laimonas Blog

If you are using VPN to connect to a networks with mac OS, there is something you should keep in mind. Recently I tried to connect to my work server over VPN using MacBook Pro just to be rejected with generic "Authentication failed" message. Re-entered the password and got the same message. Only after some thought I realized that my password might have expired. But how come the VPN client didn't ask to renew the password or at least inform me of expiration? I went ahead and tried establishing the connection with a default windows VPN client. And as expected, it told me that the password is expired and asked me for a new password set to re-new.

So unless I missed something in mac configuration, be aware of this issue and do not get locked out of your servers.

Saturday, November 29, 2008  |  From Laimonas Blog

Let me write something different and review the collection of trance podcasts that I am subscribed to. I remember when I started with music podcasts the hardest part was finding the authors that release quality music on a consistent basis. During the last year I amassed over 30 trance music feeds and I think I got a decent collection going on at a moment. Here I will select some of my favorite ones, provide a short review, cons and pros, and also a link where you can enjoy the podcast yourself for free.

Of course when evaluating a podcast the most important thing is the content. But there are other important things to consider that might make one show preferrable over the other: release schedule, production quality, and how ease it is to consume the episodes. You want to release at least once a week to really get the listeners going and waiting for your podcast. Anything too long makes you forget the podcast completely. Another thing that I find important is the length of the shows. Personally the shows that release rarely but are big in size are the worst: hard to listen through the show at one sitting (or running session, or commute trip, etc) and the file size hinders transfer times, etc.

Keep in mind that more than likely the artists producing the shows below do not get compensated much if anything at all for all the great job that they do. So take time to thank them for their work. I sure am thankful.

So here is my podcast list:

BUZZ Podcast w/ Randy Boyer of EnMass has to be my favorite trance podcast out there. This show is as good as it gets. I mean you get the latest and greatest club hits and some of the best EnMass produced mixes. So far the releases are frequent, can really liven up your playlist!. Basically my favorite podcast.

Shake Down Trance Podcast - one of my favorite podcasts, used to be my #1 until BUZZ arrived.

Radio 538: Tiësto`s club life podcast - from the great DJ Tiesto. There is not much I can say about this show that you don't know already, just subscribe and enjoy.

Rotation with DJ Addisson stands out with its frequent releases and also it includes a large variety of music and artists. Really good stuff. Give it a spin.

Trance Lab Radio - A wide variety of trance music with great production. I have found some really good artists through this show. Out of all the podcasts listed here this show offers the greatest variety and rarely ventures into "pop" trance music (is there such a thing?)

O Red - slightly different from the pack as it often plays older trance songs or includes topical, themed, shows. Very good mixes though and the song selection and rythm is just great. I enjoy it a lot.

Elements 2 Dance - This podcast might be the most original of the bunch. One negative, if you could call it a negative, is that their shows are HUGE: 2-3 hour long.

Here are a few more that you might like:

A State of Trance Official Podcast

4Watt Electro Podcasts

The Offical DJ Cristo Podcast


Blistering Trance Beats

Techtronic Sound

ElectronicSessions Podcast

Strube Mixed

I am always interested to hear about other great feeds that I have missed. Shoot me an email or leave a comment (are comments working?).


Wednesday, September 24, 2008  |  From Laimonas Blog

I am sure anyone who has to do a secure copying (scp) from windows to linux machines are mostly using an excellent tool called WinSCP. Well I had been using it for over 3 years and only recently discovered that it has an awesome console mode! To start it in the console mode, in the command prompt run:

winscp /console

In the console mode use your basic ftp commands to operate (open, put, cd, lcd, pwd, lpwd, etc). You can even feed commands to the winscp in a separate file and it runs them upon startup. Very sweet indeed.

Tuesday, September 16, 2008  |  From Laimonas Blog

Check this piece of code:

public enum TestEnum
    One = 1,
    Two = 2

static TestEnum testMe;

What's the value of the testMe enum? Is it (TestEnum.One, value of 1)? No, it is zero. I just saw this somewhere being declared and thought I should mention it here. The above behavior is why sometimes I like to put a value of 0 in the enum, like this: Undefined = 0.

Thursday, August 28, 2008  |  From Laimonas Blog

Well was I happy when I accidentally shut down Firefox the other day. On the restart I was notified of a new Firebug version (still 1.2, but I believe it was b15 revision or something like that). One of the biggest reasons why I kept FX2 on my windows instance was that Firebug for FX3 was pretty much unusable and incredibly buggy. Especially when it came to Javascript debugging side of things (would hang trying to debug javascript, could not locate source lines properly from the command-line, etc.). It is looking real good now at least.

Saturday, July 12, 2008  |  From Laimonas Blog

'watch' linux utility is so simple yet has been so useful to me lately. I am monitoring several linux machines and this tool has come in very handy. Basically it "Executes a program periodically, showing output full screen".

One of the ways I use it is to monitor the log file and make sure that the 'PING' is written to it every x amount of time. 'watch -n 5 tail file.log' will output the last lines of the file.log every 5 seconds.

Wednesday, June 25, 2008  |  From Laimonas Blog

The Yahoo Sports site was in bad shape (tabs not working, bunch of javascript errors, UI quite messed up) when viewed with Firefox 3.0 for about a week. I was keeping a close eye on the situation simple because of amusement and trying to guess when they gonna fix it. I mean you would think they would run and view their site with beta releases of the browser so that there are no surprises, after all Yahoo Sports is a big site. But I guess they didn't.

I wish I knew what exactly changed that caused the site to be so crippled. And that's another good thing for open source software: they are free to innovate and change things without worrying much about breaking older stuff if the change is really worth it. I guess in short term the devs might suffer (as I am sure yahoo sports had to change their code), but probably all will benefit in the long run with taking advantage of a great browser like firefox.

Wednesday, June 18, 2008  |  From Laimonas Blog

I decided to blog today about one of my favorite (and least talked about) Firebug feature: Javascript Profiling. This could be become very relevant with web apps increasing in client side complexity and functionality. Also browsers are starting to support various advanced concepts and controls that will invite even more javascript development.
I personally don't do javascript profiling often. More likely I will use it to make sure that the rough numbers I see after profiling don't look anything out of ordinary. For instance, one of the web apps I was prototyping, I was using jquery to select various html dom elements in a very inefficient way. Since it was a prototype, I really didn't care as long as I got the functionality in and could see how things worked. Once time came for cleanup, I used profiling to see what places I am making incredible amount of calls needlessly.
So to get started, with Firebug up and visible (F12), click on "Profile" tab.


Click on "Profile" again to stop it. If you were running this on an empty page, you will see "No activity to profile." text. But if there was some javascript running (something running periodically for instance), you would see some timing data coming in. This is a great way to see what the site is running on a periodic bases by the way.
To illustrate time measurement I will use a silly example. Let me create a simple page that when clicked on a button will find all the spans with-in divs with attribute "doHide" set to true and hide them. To do this, I will use jquery for selecting:

  function hideThem() {
    $("div > span[@doHide=true]").hide();

I will start profiler running, click on the Hide them button and click on "Profile" again to get the results. Here is how they look:

So, 216 calls to hide some spans. That won't do. How about we just assing a special class to the spans and use that in selecting the spans to hide:



Kind of better since total time now is really negligible (unless the number of spans being hidden increases a lot). 168 calls, less, but still a lot.
Again, you do this only if you notice something is working slower than it should. Don't get bothered much with optimizing simple javascript, make it readable and cross-browser usable your first priority. But from time to time check your work if you feel that javascript is awefully slow and you are looking to speed it up. By using the profiler you will know where to speed it up.

Wednesday, May 21, 2008  |  From Laimonas Blog

This is very simple trick and I am posting this solely for the purpose that it might help a beginner developer.

While in a process of learning mvc I am building a sample website where I needed to store user selected days. Imagine input area that looks like this:

<input type="checkbox" name="days" value="Mon" />Mon
<input type="checkbox" name="days" value="Tue" />Tue
<input type="checkbox" name="days" value="Wed" />Wed
<input type="checkbox" name="days" value="Thu" />Thu
<input type="checkbox" name="days" value="Fri" />Fri
<input type="checkbox" name="days" value="Sat" />Sat
<input type="checkbox" name="days" value="Sun" />Sun

A good way to store this in your model and storage (DB, files, etc) is in a Flags Enum:

public enum Days
    None = 0,
    Mon = 1,
    Tue = 2,
    Wed = 4,
    Thu = 8,
    Fri = 16,
    Sat = 32,
    Sun = 64

Only one field required and no need to do string manipulations, just OR or ANDs to get the value selections. Again, very simple stuff, but might be not so obvious to some.

Tuesday, May 13, 2008  |  From Laimonas Blog

PostgreSQL database has this very neat free text search engine called tsearch2 that used to come as add-on, but now is part of the installation. When emitting a tsearch2 query you can specify which configuration to use (english, german, or something other special) which dictates how the words are parsed etc. Since the 8.3 release of postgresql which includes tsearch2 the 'default' configuration is gone and the existing code can break. I found a quick way to create a default one by duplicating any of the existing configurations (in my case english) by executing this:

    COPY = pg_catalog.english

Tuesday, May 06, 2008  |  From Laimonas Blog

So over the course of the last year I really got into podcasting. I recently reviewed my podcast subscriptions and was amazed to find out that I am subscribed to a total of 33 music podcasts! With the help of Mediafly I organized the subscriptions so that my music channel at all times has about 10-14 different episodes. Depending on what I feel like listening I can choose to go with a bit of rock, maybe sometimes with ambient, eclectic, of course Trance (dominating my subscription list), even classical music. I am almost reaching a point where I am thinking to do a review of the best of trance podcasts available with ratings in different areas. Let's see if I ever get around doing that. But I think it would be useful as right now if you are a new podcast listener you might choose shows that are not as well produced or get released very rarely.

Besides music the other big channel I have is Sports and then Comedy.

Friday, May 02, 2008  |  From Laimonas Blog

Reading is one of my hobbies, but I couldn't remember the last time I went to the bookstore before I did so last weekend. I needed to do a more in-depth check on the book I was considering buying and it being a nice day and all I decided to go to the closest Borders. Well let me tell you, I was amazed at how much the computer book area had changed. That particular borders some years ago had one of the best Software book section volume and quality wise. Now it is much smaller but most importantly the selection is miserable. Nothing beyond basic fluff.

Oh well, it didn't upset me at all. On contrary it was good to see a business enterprise adjust to the market conditions and repositioning their business to the changing customer needs (I saw much more open space, more inviting seating areas, cafe, etc that all the bookstore customers now look for).

Tuesday, April 29, 2008  |  From Laimonas Blog

After a long break of silence I am attempting yet again get back into blogging. I will start with sharing something I learned about two months ago related to the object serialization.

I imagine many intermediate to advanced programmers are well familiar with xml serialization. One of the areas where you can use this is in storing/retrieving configuration files. Take an instance of the class that represents some configuration settings and serialize it upon the save/exit of your application. The next time you run your app again you can deserialize from the hard drive to use in the appliation. However there are some gotchas to watch out for. One of the desktop apps I was working on from time to time was failing while running under Windows Vista. The exception stack trace gave the clues that the problem is with xml serialization, but the actual message was rather confusing, stating that the csc.exe process could not run from the default .net framework installation. I was puzzled thinking why is csc.exe process is being spawned here at all? Well it turns out that that's how XmlSerializer works. When you write the following:

    XmlSerializer s = new XmlSerializer(typeof(EmailConfig));
    s.Serialize(outputStream, config);

.NET Framework implementation will actually build a serializer at runtime for your class by inspecting the type's properties and will compile that serializer and run it. I never expected this behavior, but it makes sense. I just wasn't aware of it. If you have many places where you are de/serializing or if your app cannot spawn any other processes you could benefit from this little utility called sgen. It comes with the .net framework installation. Check more in the documentation on sgen options but in short you point sgen to a .net assembly and ask it to generate corresponding xml serialization assembly. Since your assembly might have a lot of types and you serialize only a few you can specify to generate serializers only for the specific type(s). Then, when you ship your application bits ship the serialization assemblies together. The XmlSerializer will first look for the XmlSerialization assemblies (named YOURASSEMBLYNAME.XmlSerializers.dll) and see if it contains the serializer for the type it needs. If it finds it, uses it, otherwise faults back to generating code at run-time with the C# compiler.

I ended up modifying the build to generate the required serialization assemblies with the needed types as a post-build step. And the mystery exception went away.

Monday, February 11, 2008  |  From Laimonas Blog

I just hooked up for running searches for this blog. I generate the search index offline and then uploaded it through FTP. The only thing I am missing is automating the generation and upload process. I shall add that soon as well.

If you want to learn more about, take a look at the documentation written for Java version of Lucene, since is a straight port of it. It might be not obvious at first and you will wonder where all the documentation is located. So just visit the Lucene java pages and you will find most of what you need there.

By the way, ever since I had the site down the last time the blog entries in the google reader are all out of order. Anyone has any ideas what I can do to force google reader to refresh the entries for this blog?

Tuesday, February 05, 2008  |  From Laimonas Blog

So, yesterday I took this blog down, upgraded the DB, and updated the blog code which was rewritten to use NHibernate instead of my own "home grown" ORM written way back in '04. The move went smoothly (although I do have some minor issues editing entries) with one glitch: the google reader subscription went all nuts. This morning I went to the reader and it showed this blog as having 64 new entries and the order is all out of whack. Oh well ... nothing really changed in the RSS output as the entry ids and guids didn't change. Maybe while the blog was down reader did some update and then did another one when it came back.

Saturday, February 02, 2008  |  From Laimonas Blog

There is a great series of blog posts being released on blog starting with "Three Rules for Database Work" post. In my first workplace we were running under very similar rules and concepts for versioning a database. For a quite large projects and 15-20 developers, it worked rather well. Of course you had to be disciplined as hell and couple of in-house built tools made the job a bit easier and more automated.

The rules and techniques the blog author is talking about really applies to the systems that are very database intensive, meaning complex DB schema, rules, integrity checks, etc etc etc (basically any solid application that uses database :) ). I have used a different approach to database versioning with Migrator for .NET. It is the port of migrations concept used in rails. The original author had abandoned the project. But just recently I found out that someone else is taking over and right now the source code is on google's code repository. I blogged about using Migrations before. I guess the official repository for the source and other project information now is located at .

 Laimonas Blog News Feed 

Last edited Dec 7, 2006 at 10:16 PM by codeplexadmin, version 1


No comments yet.