Saturday 14 June 2008

Property prices in Colorado (Denver) and L.A. (California)

L.A. is pretty expensive, from what I have seen it is as expensive as London with prices around 400.000 for 1 bed flat in Santa Monica, Denver in Colorado on another hand is quite cheap, you can buy 1 bedroom flat for 120.000 american dollars. It makes me think that Poland is pretty expensive nowadays with prices around 100.000 american dollars for 1 bedroom flat in Szczecin!

Wednesday 11 June 2008

GWT Login applet

Thanks to my colleque from one of my previous work places I found out that the company I used to work for (NCDC) has recently open sourced a very nice GWT module. The module is very similar to gdm start up screen where you can select a user from a list and then you enter the password and voila you are logged in. This module has been released under Apache license so you can use it in a commercial project.

I am experimenting with this module because it is a perfect fundation for a set of GWT projects that I am expected to deliver for Shopzilla Europe in the next couple of months. In fact, I was thinking of writing something like that myself! I would probably struggle to convience my manager or a product manager though. Thanks NCDC chaps! In case of my application the major focus is to make sure it works with our Active Directory LDAP server, because our users hate to have different logins and passwords for different applications. This module (ncdc-web-login) does not provide LDAP authentication but I was told that there are plans to open source services like that as part of this or a different project. A really nice bell and whistle is that the widet (GWT module) supports avatars from LDAP server based on photo thumbnails! awesome!

Address to the project: http://code.google.com/p/ncdc-web-login/

Tuesday 10 June 2008

GWT problem and solutioon

I started to investigate GWT and I stumbled across a problem immediately with hello world application.

While trying to run Hello-Shell I got an exception:

mati@mati-ubuntu:~/local/gwt-linux-1.5.0/samples/Hello$ ./Hello-shell
** Unable to load Mozilla for hosted mode **
java.lang.UnsatisfiedLinkError: /home/mati/local/gwt-linux-1.5.0/mozilla-1.7.12/libxpcom.so: libstdc++.so.5: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1647)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1005)
at com.google.gwt.dev.shell.moz.MozillaInstall.load(MozillaInstall.java:190)
at com.google.gwt.dev.BootStrapPlatform.init(BootStrapPlatform.java:44)
at com.google.gwt.dev.GWTShell.main(GWTShell.java:355)
mati@mati-ubuntu:~/local/gwt-linux-1.5.0/samples/Hello$ mati@mati-ubuntu:~/local$ #

After few minutes of blogging it turns out that on Ubuntu 8.04 you have to install an additional package:

sudo apt-get install libstdc++5

that have resolved my problem!

Thursday 22 May 2008

JDK 6 update 5 has got a new JAX-WS 2.1

Java JDK 6 update 5 has got a new JAX-WS 2.1 version. JAX-WS 2.1 among many things has support for WS-Addressing.

JAX-WS 2.1 - Dynamically changing endpoint address for Yahoo Webservices

At Shopzilla I am currently developing an application that uses Yahoo Webservices (EWS 4.0). One frustration I had today was that they have a special location service that you need to call to get IP address before you can call any other service. I have used wsimport from JDK6 to generate JAXB annotated classes from WSDL document but then I realised that all WSDL documents apart from LocationService.wsdl have a fake port definition in their WSDL file. Something like. USE_ADDRESS_FROM_LOCATION_SERVICE. Now JAX-WS relies heavily on WSDL also at runtime so I couldnt dynamically change the endpoint address. I thought about downloading WSDL file and replacing this string: USE_ADDRESS_FROM_LOCATION_SERVICE with an actual endpoint address but this solution seemed to be hacked and I thought to my self -> there must be a better way of doing this. After researching, poking around and googling I found it!

In JAX-WS every port which you can get from XXXServiceService is a proxy that implements BindingProvider.

You have to cast your port to BindingProvider and get public abstract java.util.Map getResponseContext(); from it. Request context is just a map mapping a string to an object.
When you do that you have to put BindingProvider.ENDPOINT_ADDRESS_PROPERTY property to that request context with the full endpoint address and voila! It works like a charm!

ADOBE AIR: New Parleys.com website!

Parleys.com has launched today a new version of their website. It is built using Adobe AIR and I can finally watch presentation on my ubuntu box with power point presentations and before I was forced to use windows for that reason!

Monday 19 May 2008

Trip to the US

I am flying to America on 27th of May and I will be back on 7th June (11 days). I have B1/B2 VISA for ten years (sic!).

Monday 12 May 2008

VISA application and my visit to Shozilla in Los Angeles

My USA VISA application was successful and I will be flying to Los Angeles for two weeks.

Sunday 11 May 2008

Motley Fool and stock market investments

I am studying how to invest on stock exchange. I began my journey by reading a book Motley Fool -> Online Guide to Investing.
http://www.amazon.co.uk/Motley-Fool-Fools-Online-Investing/dp/0752218107/ref=sr_1_2?ie=UTF8&s=books&qid=1210504071&sr=8-2

Having read that I am reading now
http://www.amazon.co.uk/Motley-Fool-Investment-Workbook-Books/dp/0743229983/ref=sr_1_5?ie=UTF8&s=books&qid=1210504071&sr=8-5

This book is supposed to teach me how to evaluate financial position of the company. Learn how to interpret various metrics for quantative analysis and teach some obvious things happening on stock exchange. I have read half of the book and so far I must say half of it was childish but the other half is pretty decent and dives into what I was expecting to find in this book. Currently I am reading a chapter on analysis of financial statements of companies, which ought to be published every year. I must admit that some metrics might be misleading, for instance if company has got lots of Accounts Receiveable you would think it is good. That means that many other companies or people own money to company but company needs to collect that money. If that value increases and the current assets (cash) does not increase -> that means that company has problems collecting its debt and it is considered to be bad debt. There are many more metrics to analyse and I am really just scratching the surface.

Have you ever traded on stock exchange? Do you have any useful tips?

ESBs and Mule

At work I am creating one application and I am considering to use ESB in future. I am not sure if it is going to be a sensible approach to the problem I am trying to resolve. I was looking the other day on amazon Mule 2.0 book is going to be published soon. There are lots of books on ESBs and I have number of them but they are very generic, talk about message routing, message exchange patterns. ESBs might be a level of complication which we might not need so I will try to establish that. KISS principle will be a driving force but too much KISS also limits as well so it is a balance thing.

The reason I consider Mule is that I think we can free users from "pointless clicking" by automating data exchange between applications. The trick is that I still need to build few applications before I can start thinking about automating data exchange between them. The idea is that every application will have a user interface so that a human being can interrupt process and fix it but in addition every application will have an automated interface for internal inter-application data exchange. I must admit that one problem is also to decide on granuality of applications and services, which ones should be deployed in separate processes and which services should be part of the same application.

The other problem is that some changes might require cooperation with US and them exposing some services via REST or SOAP and they have different set of priorities so to sync all of this might be a challange.

I have seen number of presentation from parleys.com about Mule and ESBs in investment banking and I think I understand more about how it works. We have specific requirements in which we have lots of data exchange (huge files) so not every solution might work out.

Friday 9 May 2008

JMX and JManage

Since I joined Shopzilla I have been developing one application. As most applications this application has two parts, one is core and one is web application. I wanted to deliver something that is usable as quickly as possible for users. Users are in fact employees of the company so it could be quick and dirty but not much. Users I deal with don't like command like applications and don't have skills to install things like java, python, perl or ruby.

I found a brilliant solution, which has proven to be the right so far. It is JMX. JMX is bit techy but a lot boils down to a frontent application. One is limited in certain way, user interface cannot be as sophisticated as it could be if everything was developed from scratch but the speed at which you can deliver something that works is exceptional.

I have delivered a core and an useable graphical applications after 3 weeks of working. This already provides a business value and Shopzilla is able to monetize on that!

I recommend JManage to everyone it is also brilliant for monitoring of production applications (it was designed to be just that) but can be used for internal applications as user interface is really appealing.

http://www.jmanage.org



Wednesday 7 May 2008

Useful Linux commands

http://www.pixelbeat.org/cmdline_pl_PL.html

Finding a jar containing a class

I found a nice script that searches through all of your jar files and finds which jars have a particular class. It is a shell script:

mati@mati-ubuntu:~/.m2/repository$ find . -name *.jar -exec csh -c ' (jar tvf $1 | grep org.springframework.jdbc.UncategorizedSQLException) && echo "======= found in $1" ' '{}' \;

Tuesday 6 May 2008

IPod and Podcasts

I am a happy owner of 80GB IPod and I must say that I like it a lot. I use it mainly to listen to my favourite podcasts. ITunes is full of podcast feeds. My favourite podcasts are:
1. BBC Focus Podcast
2. Polskie Radio - Nauka
3. Polskie Radio - Radionowela - Motel w Pol Drogi
4. Software Engineering Radio
5. Bloomberg news
6. BBC's Digital Planet
7. In Our Time with Melvyn Brag (BBC Radio 4)
8. Parleys.com
9. Java Posse
10. Google's Developer Podcast
11. ThoughtWorks Podcast

Scrum

New job comes with new responsibilities but also knowledge. Here at Shopzilla they use Scrum and I must admit that so far I like this agile methodology. We have daily scrums in which we quickly tell each other what we are working on. We plan iteration in so called sprints. A lot of these practices I have been doing before but the whole thing was more chaotic, scrum introduces common sense project management practices worth following. I am still learning Scrum so don't consider to me an expert!

You can listen to this great scrum interview with Roman Pichler. It is worth listening.

http://www.se-radio.net/podcast/2007-06/episode-60-roman-pichler-scrum

Saturday 23 February 2008

Extrapolation

The problem that nettles me is whether it is possible to use extrapolation, aproximation (various kinds) only on historical data from stock market for discret companies to be able to get a yield of 12% each year. Why only on historical data and only on 12%? Well 12% year to year is a lot as long as it is stable. I am reading recently a book on investment on stock markets and one thing is said there is that since its beginning a stock market in the US gave yield of an average 12% year to year. Of course, some years it was 50%, some it was -40% what counts is the average. It must be said that the best online saving account in the uk gives an interest of around 6.50% (HiSaver account) -> see www.fool.co.uk). 6.50% is decent rate but there is tax on top of that, so nett it is about 5%.

I am aware that historical data should not be used as the only source of information that influences stock market prices. As a matter of fact there are many sources of information. For instance for agrocultural companies a very important source of information would be whether next year there will be a draught. The problem is that we need to get lots of semantically well defined data for computer program to be able to reason about the future. For that purpouse we can use SOA and let a computer system collect relevant data from many different sources to be able to reason about the future. Speaking in mathematical language we always want to have a function from now, known point (today) to some not so distant point in the future, lets say next day or a week. That function shape is determinated by many factors and to be able to build it from these factors first we have to have lots of data and then to write an algorithm that calculates this function from known set of data. Shape of the function will change based on current data but historical data will also be taken into account. I am sure many have attempted to write a computer system that would be able to do that. Well that would be my dream. I just want a stable yield of 12% year to year.

Wednesday 13 February 2008

Equality in Ruby - == eql? and equal?

The == comparison checks whether two values are equal

eql? checks if two values are equal and of the same type

equal? checks if two things are one and the same object.

How do I remember which is which ... The longer the operator, the more restrictive the test it performs

Example:

irb(main):013:0> val = 17
=> 17
irb(main):014:0> val == 17.0
=> true
irb(main):015:0> val.eql?(17.0)
=> false
irb(main):016:0> val.eql?(17)
=> true
irb(main):017:0> val.equal?(17)
=> true
(written 2006-12-14 16:49:47)

Monday 21 January 2008

Relativity

Polish zloty seems soo strange, driving on the left side seems so natural.... This is saying a person who was almost killed when crossing over roads when first in the UK!

Use Xvfb (fake xserver) to avoid AWT HeadlessException

Today I had a problem at work, one java application was supposed to be desktop environment agnostic but because it has bugs it throws AWT HeadlessException on ubuntu-server. As you know ubuntu-server doesnt have xserver installed.

I though that I could find an xserver implementation, which would be dummy and would fool my java application that is it running in desktop environment.

As it turns out ubuntu has in its repositories Xvfb type: sudo apt-get install xvfb
I dont think you even need xserver-xorg for this to work.

Example usage:
Xvfb :1 -screen 0 1024x768x8 &
export DISPLAY=":1"
java java_app.jar

Monday 14 January 2008

Vocabulary Reminder

Learning language is hard, it takes lots of effort to memorise various words, expressions and idioms. I realized that on a daily basis [at work] I could learn english if only I had an application that would distrub me and present a word, expression or idiom and it's polish transaction every x minites.
The key here is that it cannot be a dictionary from the internet, it needs to be my personal dictionary. I realize I cannot learn language by studying random words from a dictionary. My strategy is different, when I stumble across a word or an expression that I don't know I jot it down and then I look it up in dictionary along with an example. Rigid dicipline pays off, now I have three notebooks full of words from books, articles, Internet, movies from public television. Speaking of TV I really like Digitial Terrestial Television [DTT] in the uk as you can turn on subtitles for movies and programs and you can fit many channels in one analog channel band. Depending on encryption you can fit more than 8 channels, if there are just radio channels, number is huge thanks to using encryption. This is all MPEG2, so imagine if in future this will be replaced by MPEG4 or its successor, huge potential.

So much for a digression. Speaking of Vocabulary Reminder I already learned basics of ruby so I decided I will try this scripting language for proof of concept application. I used gtk (ruby gtk bindings) and in about half an hour or less I had a working proof of concept application. Parsing of XML is about 2-3 lines of code! I have created xml file and started process of transfering my private vocabulary from paper notebooks to xml.

I have lots of plans to improve application and design it properly, introduce 'I remember' and 'I forgot' buttons that will provide data on whether a priority for a certain word should be increased during word selection process. I am planning to use a roulette wheel algorithm for that purpouse, which is quite popular in genetics algorithms when individual units need to be selected in gene selection process. I also need to investigate glade app and whether I could use it to design a gtk form.

Ruby code:
require 'gtk2'
require 'rexml/document'

#author: Mateusz Szczap (Mateusz.Szczap@gmail.com)
#version: alpha 0.1

def show_window(english_word,polish_word,example_sentence)
Gtk.init
window = Gtk::Window.new()
window.set_title("Vocabulary Reminder")
window.set_window_position(Gtk::Window::POS_CENTER)
window.set_default_size(800,800)

vbox = Gtk::VBox.new
hbox = Gtk::HBox.new

english_label = Gtk::Label.new
english_label.selectable = true
english_label.set_markup("#{english_word}")

polish_label = Gtk::Label.new
polish_label.selectable = true
polish_label.set_markup("#{polish_word}")

example_label = Gtk::Label.new
example_label.set_markup("#{example_sentence}")

button = Gtk::Button.new("I remember!")
button.signal_connect('clicked') {
#window.destroy
}

hbox.add(english_label)
hbox.add(polish_label)

vbox.add(hbox)
vbox.add(example_label)
vbox.add(button)

window.add(vbox)

window.signal_connect('destroy') {
Gtk.main_quit
}

window.show_all

Gtk.main

end

def every_n_seconds(n)
loop do
before = Time.now
yield
interval = n-(Time.now-before)
sleep(interval) if interval > 0
end
end

def randomize(doc)
no_of_elements = doc.root.elements.size
random_index = (1+rand(no_of_elements))

return random_index
end

def lookup_random_voc
doc = REXML::Document.new(File.open('vocabulary.xml'))
random_index = randomize(doc)

english_word = doc.root.elements[random_index].attributes['english']
polish_word = doc.root.elements[random_index].attributes['polish']
example_word = doc.root.elements[random_index].attributes['example']

return english_word,polish_word,example_word

end

every_n_seconds(5*60) {
english_word,polish_word,example_word = lookup_random_voc
show_window(english_word,polish_word,example_word)
}
end of ruby code

You can alter the code in every_n_seconds and instead replace 5 with your desired number of minutes to display a screen.

Example of vocabulary.xml


Moving from jroller.com

I decided to move my blog from jroller to blogger.com