Tuesday, September 29, 2009

Google Web Toolkit RPC serialization error and Collections.EMPTY_LIST (Collections.emptyList())

Well, heading made my day.
Actually java.util.Collections.EMPTY_LIST and java.util.Collections.emptyList() are not GWT-serializable and will cause SerializationException being thrown on attempt to transfer them across the wire.

Beware!
Use new ArrayList() instead

Monday, September 14, 2009

Integrating Google Analytics and GWT

Problem is that GWT apps are single-paged by their nature; they are applications. Though, having way to track user's action would be good. No one cancelled custom-written stuff, but mature analytics tools such as Google Analytics would give you much more functionality.

Fast, and easy. Have not tried it yet - need to get rid of some pending work.
here's link to google groups discussion - http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/61912b40a2ca7b2a/

Shortly, you just load analytics script to your single-paged site as external script, and then manually call 'log' method from them to create records in analytics database. Pretty easy, huh?
Nice thread on GWT and SEO on GWT group.
You might have seen Ian Bambury on the web, with his http://examples.roughian.com/#Home GWT example site.

In this thread Ian describes way his application is indexed. Think this is cool, especially real-world experience in long-running gwt seo :)

Thanks Ian.









Friday, September 4, 2009

Design anti-patterns

I have not had so much fun for some time.
If you know what are design patterns - take some time to read through the document, I am sure you'll notice many wel-known real-life examples of this.

That's where life meets theory:
http://brajeshwar.com/2005/resign-patterns-ailments-of-unsuitable-project-disoriented-software/

Tuesday, August 18, 2009

Metrics - good or bad?

Outside world example
When participating in software projects, people like to speak about metrics.
This is caused by the nature of the software projects. Program develipment oftenly turns to the research task.

You can easily track progress for the bridge construction. It's very easy. You can do 2 things:
  • Get financial documents and reports and see how it's going.
  • Go to the construction place and see how it works.
  • Ask constructors for report. Constructors would tell you, that 'Bridge is complete for 23.56%, first phase is done for 98%, seconds phase - for 33%'
  • Also - there are some numbers about quailty. For example, 4% of weldings need to be redone, 1.23% of surface paintings fails, etc...
Business people are happy. They have numbers. Using these numbers they can see progress, make plans and feel them pushing the thing.

Metrics in software projects - good or bad?
What about software projects?
You can not go to the construction place. You can ask programmers about 'How it's going?', and you'll get the answer 'Doing ok.'

You need numbers to show to business people. Business people will become upset very soon if you will tell them for a month that 'Progress is good!'

Also, having numbers stimulates programmers.
Here are several examples:
  • Code coverage. Percentage of code lines 'covered' with unit tests. Covered means here that when tests execute, this line is reached by execution.
  • Commit percentage. Mr. Alex is committing (putting code to repository) 3 more times than mr. Andrew. We need to punish Andrew!
  • Usually, work breakdown exists in form of tickets - bugs, feature requests, development tasks. People LOVE having metrics on these. For example - 299 work items done, 1020 left for work. Or - this milestone is completed for 50% - 144 of 288 tickets closed.
  • Easiest - count of the code lines produced by a developer.
The Main Thought
Metrics can do both things - indicat process, or hide it. As a business person, you can get positive reports during 2 months, showing that codebase grows speeds up and speeds up. But after those 2 month you'll face real f**ck-up.

Metric should be sane and wise.

You would not decide hospital to go to basing on the average temperature among all patients, would you?

Thursday, August 13, 2009

GWT Canvas widget - drawing in a browser

Story

I believe many of you felt that some thing are hard to acquire with pure DOM objects and maniputllation. DOM puts you into hard fram. If you ever tried make something round-cornered, you know that count of the libraries doing this exceeds any reasonable task.

Methods used there are different: some use colored graphic corners, but don't allow you for selecting any color you want. Some of them need JavaScript runing on a page. Some need some weird markup, and tricks with the HyperText controls for IE. Some simply don't work well.

So, why not just to draw?

So, (how) can I draw in browser?
HTML 5 Canvas elements allows some drawings. But, making a web-application today, I'd not use this as a production decision. Simply because some old bad browsers don't know it.

And we don't want to make people feel lost because they are using IE6, do we? There's a solution, though. It's name is VML. It's Micro$oft answer to the SVG. (by the way, SVG is not that a good standard itself, too). Internet E$plorer does support VML, but the API is quite different from Canvas.

If we take 2 coverage areas - one of browsers already covered with Canvas tag (FireFox, all webkits, Opera) and VML (IE's) - we'll have plenty solid browser coverage.

The problems yet to be resolved is a cost of development. In order to get something working, you'll have spent more than twice more time than for single Canvas or for VML only.

So, (how) can I draw in browser? (GWT way)

When someone says about masking differences between the browsers, I always think of GWT. That's the best thing I love in it.

And, I used to search for vector graphics library for Google Web Toolkit.

I found one (just as a proof-of-concept) in the GWT-Widgets library. (There's also an interactive demo for the Canvas widget - you can draw different shapes over image just in a webpage without any flash, java or any other hard stuff).

Actually, I liked it.
Also, after incorporating the GWT-Widgets Canvas to a project, I found another one. This is demo for newer Canvas wrapper, and this is gwt-canvas project home page

The least I wanted to show you is the sample of Canvas working in the real world. The following is a way to see it (it's in Cyrillic, so I'll do verbose notes :) )
  1. The site is about calculation of the metal-plastic windows cost basing on different selections from user.
  2. Open up http://osnova.ks.ua
    It loads slowly, but wait until all the stuff is loaded.
  3. In the top navigation menu, select 'Посчитай!' item. This means 'Calculate' in english. It is the fourth item from the left, and it has vivid red background.
  4. You'll see a 'Выберите тип конструкции...' blue link underlined in the center of screen. Click on it.
  5. You'll see basic shape selector. The shapes themselves are drawn with canvas.
  6. Select one - and you'll get it big. Big shape with all sizes is also drawn with the help of canvas widget.
That's all for this site.

What I found good and bad in drawing on the webpage with GWT and Canvas

Pros:
  • It works
  • It works in different browsers
  • It works fast enought
  • Instrument palette is enough for many basic features
Cons:
  • As it is PoC, there are some issues. I've seen that sometimes wide lines disappeared in IE, leaving wireframe only.
  • You can NOT draw text. The text you see there - it is just images with letters. Actually, there's a solution for this - but it's weird. There's a pair of client and serverside script. Client sends request to the server with the phraze it wants to get. Serverside has the text with all the alphabet as an image, and then glues the phraze, thus creating image with the desired text, and then passes that by to client.
    That's too heavy for such a simple task
  • It can be done more easily with Flash, but this is a double-sided penny. You'll need your users to have Flash installed. From the statistics of people coming to this blog, 3 of 80 don't have flash installed. That's too bad for big amount of people. :)
Hope this stuff will be useful for you!

Friday, July 24, 2009

How to deal with big GWT applications

Well, this is a bit of personal experience.
Instead of making extra-large GWT app having all the functions at one place I would use 'mixed' approach.

'Mixed' means that we install different app features on different pages (yes, user would need to change page from time to time) and exchange data through server session storage.

This would give us several good points:
  1. Page is (oftenly) refreshed, thus freeing memory :)
  2. Not that much code to load/execute
  3. Ability to make more clean code (not so much intermodule communications)
  4. More structured and less complex code (no 'overhead for common'). That's the main, I believe.
  5. Ease of content rendering.
Bad things:
  1. It's not that sleek and smooth.
  2. Lots of requests to server. Additional files loaded (.cache, .nocache, all dependenices all the time. it's cached, yes, but anyway...)
  3. Weird compilation. Having 7 gwt compilations is even worthe than 1, I think. Though, can be well-automated with ant.
  4. Can not use anymore stateless server (so, not that easy clustering/performance scaling)

It's something that can be considered as 'good practice', and 'personal opinion'.
If I were starting large GWT project now, I'd design it as described here.

Btw, take a look at LinkedIn. :)

Thursday, June 25, 2009

Turn on English locale in psql PostgreSql client

Problem with encoding (unicode PSQL and cp1251 terminal)

That's kinda strange.
When you run the psql - PostgreSQL RDBMS console client - it picks up your current language (the one set up in your system). That's really cool, but it works in unicode, and if your terminal is not unicode (for example, cmd.exe on windows), you'll see something weird.
That's the example. (take a look at weird symbols after the 'count' results. I really think this is analog of 'row' in Russian)
The easiest solution of psql/terminal encoding problem you'd think of ever
Just type in
set LC_MESSAGES=en
in windows, or
export LC_MESSAGES=en
in UNIX, and you'll get it working. The cool thing is that it is written in psql documentation, but kinda not-that-easily-found. :)

Enjoy!

Tuesday, June 23, 2009

News from python struggle field

Decided not to use templating yet, but generate the html imperatively with the custom module, based on the JAxml.
Module should have simple notions of:
  • Atomic elements - paragraphs, links, text, &c
  • Grids (customizable and agile)
  • Automatic resolution of the attached pictures (through href="cid:picture1")
Don't have much time now really, hope to get on this after we release on the work :)

Friday, June 19, 2009

Searching for a good email/html....

Well. I'm searching for a good templating engine for python. For filling data (such as reports).
May be not only html, but full reporting library/set of routines.

If anyone knows - let me know.

Once I find it - I'll post results here :)

Learning python

I think I like Python very much...

I spent several days reading book about 2hrs a day, and wrote small script which reads database, prepares report, generates html content and sends this content as an email message (both html and text version, for old/specific clients).

The script is scheduled with the CRON and it just worked. So, i think this is really good result for the language you don't know.
  1. understand execution model
  2. incorporate database querying support (with named parameters, yeah :)
  3. understand how to generate html (I'm using jaxml module, it's kinda cool. creating html document just looks like doc.html().body(color="red").p(string, align="center") )
  4. understand how to send e-mail message (yes, mime knowledge gives good help, but neretheless. I'm sending this through GMAIL - so, SSL support is also here)
  5. understand how to work with dates (that's a bit ugly now, I'm sure there's better way of obtaining today timestamp than time.mktime(datetime.date.today().timetuple()) )
All this, resulting in a working solution, took for me about 6-7 hrs from the start. Without language knowledge at all :) : )

Learn python!

Tuesday, June 16, 2009

What's up with me

One may be interested in what's really going on...
I'm working. Working really hard, and have no minute of free time to drop something to blog :(

So, just as there is free second, I'll continue on this.

Btw, this message should better go to Twitter. Maybe, need to create an account there...

Wednesday, May 27, 2009

CMD replacement with some nice features

Just found out how much I dislike the standard Windows XP command prompt (cmd.exe).

So, found project named Console. Here's brief list of its features:
  1. Support for tabs
  2. Transparency (don't think anyone _needs_ this really, but, anyway - that's a feature)
  3. Can make long lines unwrapped. But did not find a way to scroll to the right :)
  4. Good fonts from the start :)
  5. Lines selection model instead of box selection model in cmd.
And that's really strange:
  1. Yes, it supports resizing, but does not support maximization. I found this weird

Generally speaking, this is useful, especially when used together with UnixUtils.

Tuesday, May 26, 2009

GWT FlexTable bug

Just faced a complex and really bad bug with GWT's FlexTable.

It tends to forget about the cells removed! So, if I remove some cells, and then add some more, the old ones randomly appear.

Problem is that I was developing really complex layout with dynamic cell manipulation and hard use of rowspan/colspan. And spent 4 hrs fixing algorithm :( :( :(..

Technical details
  • Methods FlexTable::clearRow() and FlexTable::clearCell() seem to be broken (at least in GWT 1.5). They do their job, but sometimes deleted cells reappear in table. That's frustrating.
  • This is also stated on the Google code tracker : Issue 1766
  • I avoided this problem by replacing calls to clearRow and clearCell to FlexTable::clear(). Yes, that's a heavy solution - but it did fit for me :)

Tuesday, May 19, 2009

Hibernate IN statement

Problem with hibernate selections of ranged values (sets)

update (2009-05-19):
Thanks to Denis Tsyplakov, found HQL in expression :D. Problem comlpetely closed. So, one should better user HQL, not criteries.


Disclaimer: there's nothing really new in this article. You might know everything which is written here. This posting is mostly for myself and people facing the same problem (with memory :) I just forgot how this should be done. Thanks to colleagues returning me to the right way. Here is the problem described:
  1. We have a mapped Hibernate entity.
  2. This entity has some field. :) For example. Let it be some enumeration (status?).
  3. We need to select the entities with several statuses.
Here's example of such entity:

@Entity
@Table(name="entity")
public class Entity {

@Id
@Column(name="entity_id")
private long id;

@Column(name="entity_status")
private Status entityStatus;

// Getters and setters.

}

and example of the enumeration:
public enum Status {
STARTED, COMPLETED, NOT_STARTED;
}

We need, for example, select all STARTED and COMPLETED entities, not touching NOT_STARTING.

Solution
There are 3 valid ways I see:
  1. We make a query for STARTED entities, and then other query - for NOT_STARTED. After the results are gathered the result objects are mixed.
    Cons: you'll need to do N queries for N statuses. Quite bad, isn't it?
    Pros: don't really know. Maybe, it's simple? ;)

  2. We construct a query, with OR statement in the middle. That how it should look like:

    select e from Entity e where e.status=1 or e.status=2
    I'm using the 1, 2 numbers and not the enum names especially to make statement less complicated.
    Cons: single query, but static. That means that if you need to form the list of statuses to load at runtime (set of checkboxes?), you'll need to glue HQL. And any query gluing smells very bad.
    Pros: simple, and if you are sure the list of statuses to load would never change... if you are SURE.



  3. And the least one I see. We may perform selection using the Criterion Hibernate API, not the query language. The 'query' itself would look like the following code:

    List statusList = new ArrayList(); statusList.add(Status.STARTED); stausList.add(Status.COMPLETED);
    Criteria c = session.createCriteria(Entity.class). add(Restriction.in("status", statusList)); c.list(); // get the list of entities with corresponding status.
    Cons:uses Criteria API, which really is a code. So, if you plan to store HQL queries in a (properties) file, this way is not for you.
    Pros: fast, simple and dynamic. That's what I left with.

Tuesday, May 12, 2009

Splitting blogs

So, I decided to split the blog to two separate 'threads'.

This leaves for technical things, as well as some interesting reports, everything related to work, IT, outsourcing, java and Unix. And the new one (http://way-up-only.blogspot.com/) is designated for personal things.

Yes, the new one is cyrillic. :)

So - welcome!

The first 'real' posting will be about our trip to Crimea mountains. Soon, really soon... :)

I'm back!

Just got back from the trip to Crimea mountains. That is really cool!
Photos will be soon.

Also, I'm feeling this blog became less technical. So, I think, I'll split it to two :)

Wednesday, May 6, 2009

PdfChm - find the freshest books for FREE

The PdfChm resource is a large collections of books on programming, science, maths, law, photography and lots more. There are even books on crime.

So, enjoy. Registration is free, but you can download no more than 2-3 books per day.

There are pdf, chm :) , ps, djvu, and other formats available.. Readable anyway.

Monday, April 27, 2009

Good practices vs Bad practices

If you are software developer, or designer, or photographer, or engineer, &c, you may have heard following:
– there are good practices and bad practices, and you should always - i said ALWAYS - use good practices.
That's wrong. You should use good practices in 90% only. Not more. And also you should apply your head when deciding if to use that cool design pattern in this place.

Have a look around, and you'll find tons of the examples.
  • You may have heard of database normalization. Basically, this is the way of developing DB schema powered by straight mathematic researches form relation theory. Idea is that if you follow that theory you'll never get data inconsistency. Opposed to this, there is denormalization, which is used 10 times more rarely than normalization, but brings beatiful performance shifts.
  • Rule of thirds in photography - split the frame into 9 common parts and situate the object in the crosses of the splitting lines. You'll concentrate viewers' attention on the object.
    - yes, that's true. And now go to any more or less interesting photo museum, and look how frames are organized. Basically, this is the second level of harmony ;)
  • You know - you should never use magic numbers. NEEEEVER! If i see something in your css code saying offsetWidth = (width - 16) + "px" I would not be happy with that.
    But nature owns all of us :) Following picture describes that very well.
    Explanation:
  • Google uses different stylesheets for different browsers.
  • Internet explorer handles 100% widths awfully. If you embed some element with paddings and margins into other element, it will take more than 100%, because IE does not use padding and margin values when calculating 100%
  • Width of the scrollbar in IE is 17px
  • There is a way of doing correct 100% width with IE. It utilizes IE css "expression" facility, and recalculates the width on each page event (even mouse move). This would be canonical way.
  • Although, Google decided to use -17px right margin just to stop loosing performance. It's easier, and better for both user and developer.
Don't you think it is beautiful?


P.S. There's no attempt to reverse-engineer Google code - just attempt to learn how big guys work. No IP violated :) Google is a registered trademark of Google Inc.

Thursday, April 23, 2009

Typetester - a little free service form choosing a font

So, you need to select a font for your
  • Blog
  • Site
  • Publication
  • Page on the web
  • ...
Or even worse - you have done that work partially, but now (after 2 month) you want to restore the work. And you just can't figure out what font you've used before :)

If you are not professional in printing, I don't really think you'll be able to notice difference between Bitstream Vera Sans and Sans.

So - typester is a solution for selecting correct font.

Hope this will be useful.

Tuesday, April 21, 2009

And finally - moved

All right, we've got where to live now.

The only thing left is to buy something to sleep on. Currently we are sleeping on a half (upper:) of the bed, which lies on the wide piece of cardboard.

By the way, do you know why beggars love cardboard that much? It is really warm :)

And - some photos.

1. View of the facade of our app (looking from the yard)
2. Balcony:

3. And, surely, we still need to make some order in the house: :)

4. Real owner of all the stuff:

Thursday, April 2, 2009

Moving...

I'm moving to new apartment.

This has huge impact on time I can spend in front of monitor, so indexable GWT site demo is delayed...

Wednesday, March 25, 2009

Google Alerts: watch the web growing

Google has very cool service, which is now that widely used as mail, or docs...
It is Google alerts. Basically, idea is very simple - you just get to their website and enter keywords you want to get notified about.

Once Google bot indexes page, which may be relevant to the search query you've provided - you get an e-mail message about that. Some kind of 'Google bot news' :)

You can tune the service to send you updates on each encounter of relevant page, or pack these pages to daily/weekly digest.

This things becomes very useful, when you watch some activity on the web - for example, your partner's website.

Google Alerts is an example of minimalistic interfaces (as for me), and that's why it has this tag granted :).

Tuesday, March 24, 2009

Different TRAC workflow for individual ticket types

TRAC is a tracking software, used to store and work with different issues during software development process - let it be bugs, development tasks, requirements, or feature requests.
It is free, flexible, has good SVN integration (as for me), and is quite minimalistic in its design.

And - yes it heavily uses wiki markup everywhere, making all linkable to all.
But - if you want to setup custom workflow, and you want it to be different for different ticket types, you'll hit a wall. This is currently not implemented in trac workflow.

The good news are that TRAC is python-based, and thus its sources can be changed easily.

Different workflows for different ticket types in TRAC (TRAC ticket link:) ) describes how one can solve the problem, with minor application of patch command. Have not tried it yet, but will report soon...

Denyhosts for Unix

I've had a Linux box standing on the Internet (uptime~=180days). It just had Ubuntu server installed, Tomcat and SSHd.
And I never looked at security logs...

Security logs (/var/log/auth.log) were full of invalid login attempt messages!
I apparently got there to see who was accessing the machine during this time, and found that log is full of invalid login attempts through ssh - hjackers seem to try to brootforce the box.

So, I just found Protect your ssh-servers, ban offending hosts article about protection - great thanks to authors. And in two minutes all the offending hosts were in hosts.deny file (denyhosts figured them out, and banned), and auth.log stopped to grow because of invalid attempts.

What I've learned from that.
So basic idea is to setup little tool, which blocks connections from some hosts, and automatically adds hosts to deny list if they have stepped through the threshold of invalid attempts.

And - never. Never open direct root access from the ssh. Ubuntu has deeper facility - AFAIK there's no possibility to perform direct interactive login as root (only sudo is ok), but nevertheless - close this down.

Monday, March 23, 2009

Google Web Toolkit (GWT) Search Engine Optimization (SEO) demo will be soon

I'm going to create a little demo showing how one can make ajax-loaded content indexable by search bots.

Basic idea is to create "secondary site" - static one - showing EXACTLY the same content as primary one. If bot gets to secondary site, it can index it well because of static nature.
If user gets to the specific page crawled by bot, it just gets redirected to the dynamic version of the site, showing the same content.

Here are some key tools I'm going to use:
  • OpenSymphony SiteMesh - good decorating filter. It would allow us to wrap the entire page into some kind of template. For example, we could put navigation header/footer for bots and old browsers and redirect statement for modern browsers, deciding on user-agent.
  • Some Java-based CMS for generating/accessing content. Not decided yet. Even better is to use Wiki engine.
  • Google Web Toolkit, surely.
  • Tomcat as a servlet/jsp container.
Right now it seems to me that I don't need anything more.
So, waiting for a demo. Hope I'll have several spare hours to get hands on this interesting stuff.

By the way, there's one interesting problem I can see now: If I put static content inside HTML panel, this would cause problems with navigation and links. For wiki, especially. Any link displayed would lead us out of the dynamic application, which is not desired.

Alternate solution is to put content to the IFRAME element. Don't think I really like it, but...

Friday, March 20, 2009

.NET 1.1 LDAP performance: System.DirectoryServices.DirectorySearcher lags!

This short posting describes performance problem with .Net 1.1 LDAP (in particular, System.DirectoryServices namespace). Problem was solved.

VB.NET 1.1 performance problem with System.DirectoryServies.DirectorySearcher
While working on one of my projects (VB/C# .Net 1.1), I've run into strange performance problems. Controls were loading slowly. After some research, I narrowed the problem - server made several requests to ActiveDirectory through LDAP protocol. Each of those requests took about 7-8 seconds to complete. Same program, written on Java, worked blazingly fast.
Honestly saying, I spent several days fixing this problem.

Problem is caused by DirectorySearcher implementation
Problem was actually caused by System.DirectoryServices library (really a COM wrapper) having some lags with memory allocation, or something like that. I'll add a link once find it in bookmarks.
So, each time request is performed, it at first spends 7 seconds for authentication, or something like that.

Possible solution (worked for me)
Honestly: I did not manage to make this correct. What I've done, is just a plain caching. So, I just saved link to System.DirectoryServices.DirectorySearcher in the static (even not instance, byt in Class variable!), and pinged it in some period.

Caching for DirectorySearcher gave expected results
Yes. First query was awfully long. But subsequent calls were re-using the initialized object, and thus were working blazingly fast! As there are no side effects yet - application is web application, its uptime is more than 2 months.

Useful links on DirectorySearcher performance problem

Wednesday, March 18, 2009

Afraid of being banned by google for 'cloacking?'

Cloacking, basically, is idea of presenting different content to normal users and to bots. This malicious technique is used by bad people to increase their ranking at Google, and get traffic, while presenting to user content, which was not really requested by user. And there are some good news in the end of the article :)

Example of Cloacking (do not do like this!)
Here is just a rough example. Imagine, there's a page on the web with url http://exampledomain.url
If Google crawler gets to this page, it is presented with one version of page - clean, structured, full of text, headings, etc. This version of the page has lots of keywords, say 'free software download'. It is ranked good by Google bot.
It is possible to understand, who is 'knocking on the door' - machine or real user.
So, if an internet user comes to this page, he sees a face of some PR company showing up.

This is considered to be cloacking, and site may be removed by Google personnel from Google indices once they discover such bad behavior.

Problems for good guys
Ok, this anti-cloacking technology makes search indexes more clear, readable and reliable. But what if you have fully-dynamical site? Yes, site which is fully powered by javascript, or flash?
If its navigation done with javascript - you have problems.
If your application is build with the Single Page Interface - there's no correct way to make it indexable. (this is how guys from Redmond understand SPI)

Good news (for good guys only)
"The only hard and fast rule is to show Googlebot the exact same thing as your users."
These is very good news (yes, for me it's news. I know that posting has been published @07). This means, that your site will not go banned, if you show the same content for same URLs, but in different way.
So, some links:
Ok. Gone for now - will post something on this topic soon...

SEO and GWT

I'm going to research a bit what's going on the gwt and seo world now...
If you understand you don't know any of those words, GWT stands for Google Web Toolkit - tooling for creating rich web applications, and SEO stands for Search Engine Optimization.

So, getting hands on it...
In this posting, just 2 links to the documents I'm going to work on at first:
  1. GWT Google Group posting about SEO and GWT. Quite an old thread, something may have changed from those times. People which are well-known to the GWT society are writing, such as Sanjiv Jivan and Ian Bambury.
  2. A whitepaper on GWT and SEO from BackBase. I've only started reading it, so can not yet tell my opinion.
Hope that SEO is applicable for such complex and cool applications as ones built with GWT :)

Tuesday, March 17, 2009

Spiral Universe school management system

I'm not interested in school software.

But this startup - Spiral Universe School Management System - seems to be emerging fast and might be interesting.

As usual, such systems tend to solve some specific tasks, like schedule management or class journal or medical log, but this system incorporates social network idea together with the school management tools.
Business model seems to be agile enough - you can use this system for free, but for additional services/support you may pay some money. Also, additional user space for media can be bought.

This startup seems to be fresh-technology-oriented. I found out GWT on Spiral Technologies page, so - here it goes.

Waiting for a live demo or a start to try this out :)

Monday, March 16, 2009

Forests-Forever are CLOSING

There are only two weeks left to watch out the gratitude of the forest all over the world.
I'm not promoting it - just give it a try.

There are really beatuiful pictures of the forests from all over the world. I mostly liked the ones from Ural, Russia. They give you a little of the fresh air.

While watching those photos I wanted to leave that job, get out of the city and just be there...

So, only two weeks left for Forests Forever. Don't miss it.

Getting UNIX to work

I like the UNIX operating system family. I would not switch to window$ now, maybe I could live with Mac (it's BSD, :)).
As you could hear before, UNIX can be hard to get working as you want it to work. It may require some ... actions from you :)
I got this picture from Kirill Scorp Malyshev ;).

Example of the job done with GWT

Just found out site I've been developing some time ago.
It's done with pure gwt, when I was completing it, it seemed to me veery cool.

For english-speaking guys: sorry for cyrillic :)

So, here's link: Металлопластиковые окна в Херсоне: ТМ Основа

It is very easy. It incorporates usage of the GWT history support (try clicking back button) , and it has some heavy-duty stuff done with GWT and modified Canvas widget from GWT widget library.

To see it, you can go to Посчитай!->Выбрать тип конструкции.

The wireframe pictures of the window shapes are drawn here, on the client! For Opera/Safari/Mozilla element is used, and for the IE6/7 - VML. Looks good, isn't it?

Friday, February 20, 2009

Exceptional recursion


Eclipse.
Error seems to be sometimes caused by not-enough-free-memory. Very valuable diagnostic information, don't you think?

Wednesday, February 18, 2009

Liquid Rescale gimp plugin

Liquid rescale is "content-aware resizing". You can make your picture wider or narrower with cutting unnecessary picture element and resampling filling elements, so they keep looking good. This posting is just an example of practical use of the effect. All the mathematical grounding and much more samples can be found on official site of corresponding GIMP plugin

Original picture
Here you can see original picture, with three men walking out of sea. It was taken on the Black Sea coast. We want to remove central man, as his photo is fragmental and has no sense here. It is easily done with Clone Stamp - we just need to fill place taken by the man by water elements taken nearby. Doing so would consume lots of time, if we want picture look realistic. And, I think, there are not that much people who like spending hours stamping the picture. Also, I tried doing this with stamp - and failed :).
There is another solution. We can make this task faster, much faster with Liquid resize. By its nature, LQR cuts off those parts of picture which are considered less valuable. More explanation on how LQR calculates value of a pixel path, can be found here (Russian :) ).

Practical view
Now we are going to enhance this picture with just single effect applied. I already have LQR plug-in installed. If you wish to install it for your Gimp, go here.
Now, we start Liquid rescale plug-in from Layers menu, and create two layers. First layer will hold object masks to be saved during resizing, another one - to be deleted.
I have painted in red in deletion layer, and in green in preservation, in order to see future picture composition easily.
Now, starting the resize...
It takes some time - calculations are not that lightweight.
Also, before running plug-in you can decide to store all the path being cut in separate layer so you could see which pixels are cut.



Resulting image
And this is the image after effect application. Just after single action, without sitting for hours and clone-stamping picture. Et voila.
Better examples can be found on the official plugin example page (even with video).

Here is my useage pattern - if you have some photo with elements that you don't like, and the picture itself is not that valuable to spend a day or two on enhancing it, you can use LQR for quick fixes.

Blog purpose

For anyone reading this - I am going to use the weblog for storing some interesting and non-straightforward technical solutions - mostly not to forget about them.

Sunday, February 8, 2009

Awesome

Awesome
Awesome is not just an exclamation - it is a name for perfect window manager utilizing tiling windows concept. It can be used for X windows systems on the *nix and BSD systems. I'm using it now, and I would like to share awesome experience.

Background
The idea of multiple windows shown at the same time on the single screen is known for times. Curses, TurboVision creates interfaces capable of showing pseudo-windows with ASCII characters. Bunch of software called terminal multiplexers (see Terminal Multiplexers on Wikipedia) is used for showing several text program outputs on the same text terminal. The best use case I can see is tailing several log files to monitor distributed activity in runtime. Or I can run some commands in the active console, and watch their output (which goes to file :) ) on other virtual terminal.

Nowadays people mostly use graphical user interface. In the Unixes X Window system makes all the low-level work on rendering data and basic manipulating windows. In the Redmond-like GUIs we got used to window decoration, overlapping windows, task bar showing tasks being executed, ability to drag and resize windows with mouse. All this stuff in the Unix world is done by Window Manager (WM). There are different WM's doing their job in different way.

You might have noticed monitor aspect ratio change trend. Monitors are going wider. Resolution goes higher. Have you ever tried maximizing any file manager on the 1920x1200 resolution? One may feel uncomfortable and lost in such a wide space with lots of icons. There is not that much tasks that really require that much information shown on-screen simultaneously. On the other side, if you open lots of windows to utilize informational space, you can run into problems with finding appropriate one.

Tiling window managers
The descendants of the terminal multiplexers are tiling window managers. General idea is to split the screen into non-overlapping areas, and put each window into appropriate area. With this concept, you can see all the information at the same time. And you don't need press Alt+Tab all the time :).
Tiling concept is extended with various features, such as different focus models, static or dynamic window arrangement, virtual desktops/tags, tabs to arrange windows in the single slot, and much, much more.
I am using Awesome window manager.

Awesome features
  • Dynamic layout model. When new window gets opened you do not need to position it somewhere manually. Awesome decides where to put it based on the windows role, current configuration and layout.
  • Full keyboard control. You can do everything with keyboard. Move focus forward/backward, switch layouts, rearrange windows, change cell size, etc...
  • Full mouse control. In addition to keyboard, you can do all the stuff mentioned above with your mouse. It is very handy when working with graphic editors, for example.
  • Tags. You might have heard of virtual desktops - concept, used heavily in Unix desktop environments. Tags are different. Instead of setting single virtual desktop for window you can assign several tags to it, and window will be shown in each of these tags. This feature allows you to show some important windows on all the tags (so they are visible all the time)
  • Layout models. Awesome allows to assign different layouts for tags. Windows can be arranged vertically, horizontally, full-screen, maximized, centered (active window is in center of screen, all other are in background tiled vertically), spiral, flying. The least one is the layout all of us got used to - overlapping windows. Yes, for some tasks it is very handy.
  • Performance. Awesome does no windows decoration. No borders, no headers. Awesome uses XCB - the fastest way of talking to X server by now. Size of the program is 8 MB. Even when I do full compilation of my project, and both kernels are fully loaded, I can manage windows normally.
  • Programmability. Awesome itself is written in C, but all less important features (menu, key bindings, tag switcher, task bar, tray icon, clock, etc...) are written in Lua - scripting language. You can easily change anything you want. This does not even require recompilation.
Screenshots
Here are some screenshots made on my workstation.
1. Vertical layout. Red border across top window (FireFox) indicates focus. Top line is the task bar. Small icon is the menu icon, 1-9 are tags. Taskbar is long, and spans across all free space. Clock is the widget i wrote myself in Lua. The lease element is the system tray having Skype and Pidgin icon.
2. Dual-monitor setup. The left screen has several IM windows with horizontal tag layout, the right part has Thunderbird and terminal opened. Two monitors are my laptop primary screen (15" 1680x1050) and external Dell monitor (24" 1680x1050). The Awesome setup shown here is outdated for me.
3. Current layout in centered mode. One window is in center, but allows seeing other. Yellow border is a mark border. You can perform single operation to several marked windows. So, window group operations are supported in Awesome, too.

Hope this posting may help someone find own way :) at least in computer interfaces.

Wednesday, February 4, 2009

Developer hell

The one who knows would understand me veeery well.

I'm now working on the project which looks in the following way. It started to be developed 8 years ago. There were about 4 teams of long-term hired outsourcers and a couple of consultants sustaining that sh%t-code for these 8 years.

And now - just listen - the code looks the following way.
  • .Net 1.1 windows application, which has a tree on the left, and different panels showing up on the right, depending on the node selected in the tree.
  • Sometimes on the right .Net winforms components are shown. Sometimes, ASP.NET 1.1 pages within hosted browser (IE ActiveX) are shown.
  • There is a couple of situations, when inside that ASP.NET 1.1 pages shown within IE Activex shown within Windows Forms application, Visual Basic 6 ActiveX control gets up.
  • Haven't you lost the story thread yet?
  • And - the best one. Where do you think does that custom VB6 ActiveX take data? You'll never believe. From the ASP.NET 2.0 Web service, which is published on the same server where the ASP.NET 1.1 pages containing that VB6 ActiveX are published.
Have you ever thought this is possible.
And - the last.

Users of this system were completely satisfied with this state for almost 2 years, and only after that lifetime system started to slow down...

Would you like such a job? :D

Monday, January 26, 2009

Google Docs

This is not an advertisement.
It's just a short story of how today's services can be used in order to perform some daily tasks for free.

So, here's an example.
We have:
  • Document in M$ Word format, created elsewhere
  • Laptop with Linux installed on it
  • OpenOffice on linux which does not open correctly the M$ Word document (styles are shifted and paragraphs are misplaced with text
  • Need to port this document to PDF in order to e-mail as CV.
Instead of installing Word application on the virtualized XP, we can do much simpler thing:
  • Just forward an e-mail with document attached to the specific email address which is found in the Google Docs setup page, on Upload tab.
  • Log into Google Docs.
  • Open the document (it is already imported - Google has imported all the attachments as separate pages.)
  • And from menu select Save-As PDF File
  • That's all - you can now dl it!
So, economy is completely understood. How much does Microsoft Word license cost?