Archive for January, 2006

Testing Method Signature

Friday, January 27th, 2006

Today I had some new interesting testing task. What I needed was to ensure that some method has public and non-static signature. The method plays role of hook in OPML import utility class — the hook, which is used to create Reader object for a given URL. By default, it uses simple InputStreamReader wrapper, but the client application may wish to have something more sophisticated. So, the task was clear — to ensure that this method does not lose its signature, because it already happened once when I was reviewing the code and noticed that this method had unjustified public modifier. That time I changed it to “private static” and the application using this library lost its encoding detection skills.

Today, when I was looking for a bug in encoding detection it was a sort of revelation to see that the code even doesn’t get called. Yeah, sort of blown off the entire leg instead of simply shooting off the boots. So, traditionally I fixed the signature and put some warning for the future, but… the next thought was how to make an automated test to be one hundred per cent sure about it. It appeared simple and I would like to share it with you just to encourage.

public class ImporterTest extends TestCase
{
  // lots of other stuff skipped ...

  public void testCreateReaderForURLDefinition()
    throws NoSuchMethodException
  {
    Method crfu = Importer.class.getMethod(
      "createReaderForURL", new Class[] { URL.class });

    assertEquals("Method should be public and non-static.",
      Modifier.PUBLIC, crfu.getModifiers());
  }
}

Easy and bulletproof.

BlogBridge 2.12 — The Publisher

Wednesday, January 25th, 2006

Today we release the next version of BlogBridge under the code name “The Publisher”. What makes it special is that it finally has Reading List Publishing support. Yahoo!

Reading Lists publishing became really accessible now and you even don’t need your own site for that as we will host and take care of the load, we will pay for your traffic and do maintenance for you. Everything for your purest enjoyment!

All you need is a service account, which is free for now. Now check out the quick tutorial by our lead — Pito — and start publishing like crazy! What? Still reading!?

Among other things we have significantly improved our synchronization service, performance of some operations and made several tweaks noticeable to Mac users. But still the Publishing support is the major one.

Don’t forget to tell us about your experience via embedded feedback facility (see Tools), or via forum, or contacting us directly, whatever fits best. And… enjoy!

Detroit Digital Vinyl

Wednesday, January 25th, 2006

We all know how it’s bad to download illegal copies of music pirated by someone else, but we are not rich enough to get all what we want in a legal way, unfortunately. Yeah, nothing new here.

What I saw this morning was an announcement of a “Detroit Digital Vinyl” store, specializing on Detroit techno. The store works with several well-known techno labels and sell tracks in high bit rates (192 / 320 kbit) or even in raw WAV format if you need. Plus they have high bit rate prelistening, plus they offer some bonus tracks which are not available on the original vinyl, and plus, and plus… Yes, and the tracks they provide aren’t rips of the original plastic, they are original digitally mastered copies free of clicks and noises!

Amazing!

Go check out Detroit Digital Vinyl.

Some Positive Spam

Monday, January 23rd, 2006

I never payed too much attention to what is in the spam messages I get. Well, until this morning. I briefly scanned the spam from two last days and was surprised with what I discovered. I am winning in at least two lotteries daily, each of which brings me about a million. Now look at it from the funny side.

It’s inconceivable how cool am I that I even don’t bother watching what and when I win, putting it in spam folder all together? I’m just too lazy to grab all this cash. :)

Have a good day… and see you soon!

What I Like About Ruby Language

Thursday, January 19th, 2006

I’ve been reading “Programming Ruby: The Pragmatic Programmer’s Guide” for couple of days already and learnt some interesting facts about the language. As a Java programmer with several years of hard-core non-stop programming experience, I find it pretty amazing to see how new languages adapt to what we really need, not what the classics say.

First thing to notice is the iterators. Yes, this is a state of art! Now that I learnt how they work they look like a blessing. It’s so natural and in conjunction with the second feature — the code blocks — can do miracles.

Also I liked the way the property accessors and modifiers are declared. If you wish, you can write method bodies, if not — just tell attr_reader :somefield and/or attr_writer :somefield and you are done. It’s usually a pain in the neck to create holder-objects and wrap every of its hundred properties with accessor / modifier. Of course, modern IDEs provide convenient means of automating this task, but you still have to document these methods, don’t you?

Well, not too much so far. I’m still in the very beginning of the book as I have to work sometimes and, I suspect, we all do. But I continue reading and soon hope to come up with more thoughts and impressions.

BTW, I still has got no feeling that it can be a replacement for such languages as Java or C. What I’m not sure about yet is the performance of the interpreter. Does it comparable to what modern JVMs offer and how it’s comparable to the native code? Any personal experiences?

Mid-January News

Thursday, January 19th, 2006

Well, it’s been a long while since I wrote to this blog for the last time. Not that I’m lazy, really, I was distracted by some other shiny objects. These first few days of the year are always deciding. How you do them decides how the whole year will go… and I worked my fingers to the bone to make them full of action.

I finally finished my detroit-technoish track for the party that will take place this Saturday in Simferopol. It sounds just gorgeous and matured, yet for some mysterious reason Kate doesn’t like it. Maybe she is just a bit jealous about it? Who knows? Anyway, I’m going to send out a promo to various techno labels once I finish the other no way less exciting pounding groove I started already. That would be a nice couple!

Well, other news… We were making some A1-format posters again for the party performance. Now it’s not printed pictures we took in heavy technological zones, but something slightly different. I created a very simple minimalistic picture made of lines and shapes and Kate created a collage this time. It looks interesting. It’s a mix of her shots in grayscale with lots of small and even smaller details all over the canvas. Hope the guys at the party will like that.

And of course there are very interesting and promising changes in the BlogBridge world. You can learn more about them from the dedicated blog.

Oh, almost forgot… Here’s the quotation by George Aiken I saw some days ago and I really like it:

If we were to wake up some morning and find that everyone was the same race, creed and color, we would find some other cause for prejudice by noon.

That’s all news for today. Until next time!

What I Played In Late 2005

Friday, January 6th, 2006

Yesterday I finished playing one wonderful game — Mystery Case Files: Huntsville — and decided to quickly outline what interesting on this front happened in my late 2005 life.

Mystery Case Files: Huntsville

Wonderful game with average graphics, but very good idea. You are a detective and you are assigned to several cases. Each case consists of two stages and should be solved in the given time frame. The first stage is finding things you need to get to the other. Things are named in the list on the right of the screen. You should find them in the main area and click to get into your brief-case. Sounds simple? Yes, but in fact it isn’t so much. Things are intelligently hidden all over the playground so that you always need a sharp eye to find them. The next stage is the puzzle where the square pieces of an image are mixed and you have to exchange them with each other to restore the original look.

The game is gripping and for us, English learners, it had another important value — it helped us to learn and remember many words. After I finished playing I started to think where could I get something similar to continue this fun education.

Memory Loops

To describe it quickly, the balls are rolling on the curly path the the hole in the ground. When the time comes, they are given another power-push and roll a little faster for a second. Once they reach the hole, the game is over. Your goal is not to let them reach the hole by removing pairs of the balls from the chain. The most interesting part (and the title gives you a tip) comes here. The balls are all of the same color and with no graphics. You have to turn the ball to see the picture painted on it, then turn the other to see if the picture matches. If it is both balls are removed, otherwise they are turned back to no-picture-state. Of course, there are tip balls with trace of the picture on the upper side, lots of different bonuses, like explode, show all pictures, roll back etc.

There are several stages with several levels within the stage. With each next stage the complexity raises. It all starts with three or four types of pictures to match which is pretty easy, but then every other stage adds new picture plus speed boost and it becomes really hard. I’m still somewhere on the eight stage and continue playing.

Tumblebugs

The game play is mainly the same. The same balls rolling from one hole in the ground to the other, but this time the balls are colored and in the middle sits the bug throwing similar colored balls in the rolling chain. Your goal is not to allow the balls get to the end of the path by removing groups of three or more. It means that you need to quickly match the colors to be successful. The whole set of various bonuses is present so that you will never get bored.

There’s nothing to describe specifically. But I would like to give it A for its graphics. It’s really well-thought and well-painted. Amazing game play!

Well, that was my little favorites list. I really enjoyed and continue to enjoy playing these games.
By the way, not only me. My father, sister and Kate are also big fans of all ball-rolling-games.

Hope it was interesting and helpful. ;)

OPML Oddity and Tricks

Thursday, January 5th, 2006

About two months ago David Winer presented his first version of the Guidelines for validating OPML. Since that time it has been updated two more times, but it is not the point. The point is that the document denotes two possible types of outlines for building directories: link and rss.

In my opinion, there are several problems with it. The major flaw is that RSS link is also a link. Type rss clearly states the type of the resource, but link is very general. Here’s the cut from the document. Read it carefully:

When a link element is expanded in an outliner, if the address ends with “.opml”, the outline expands in place. This is called inclusion. A validator should check that the OPML file being pointed to is accessible, and may wish to validate the pointed-to file as well.

If the address does not end with “.opml” the link is assumed to point to something that can be displayed in a web browser.

(from guidelines)

The main flaw is that lots of OPMLs today use link type when pointing to the RSS feeds. Yes, they could use the rss type, but they don’t. Why? Because it’s easier to always set type link as it works for every type of links well and the validator has no objections. Do you understand what it means for the users and the developers of different aggregators and outliners? Certainly you do. The users immediately become unable to use significant number of OPMLs in their favourite applications and the developers… they are good guys, they always have to follow all these breathtaking twists of a plot.

Today we almost freed ourselves from specific extensions for the feeds. For example, now we have Feedburner service for the feeds which gives us the links, like http://feeds.feedburner.com/noizZze, where we don’t have any specific extensions, like “.xml” or “.rss”. Our blogging web-applications generate feeds on-the-fly. So why I would need extension for my OPML? Just to fit the rules of an OPML directory formation my pet OPML might never be included in? Sorry, but it’s laughable.

Well, where are the tricks? As I was finishing this writing I decided not to include any tricks just because it is already tricky enough.

All this teaches me a good lesson, another lesson about thinking of possible implications. Got to go. The OPML parser is still waiting for my attention…