Thursday, September 22, 2011

An Apache Ant Problem

  Hi all, today I had a very strange problem. I was trying to make Apache Ant work on my PC, but somehow it was not coming along. The problem was that the JAVA_HOME environment variable was not set correctly. I got the following error message:

  Perhaps JAVA_HOME does not point to the JDK. It is currently set to "C:\Program Files\Java\jre6"

  I spent about 30 minutes trying to figure out what I was doing wrong. After a reboot, several "echo %JAVA_HOME%" commands in the command prompt of Windows 7 and sheer wondering what might have gone wrong I finally realized it. I have set the variable correctly with one minor detail that was preventing Ant from working. I have added a semicolon (;) at its end, thus preventing Ant from finding the "javac" executable file. Hope this post helps someone out there, trying to cope with the same problem.

Tuesday, September 6, 2011

Sylveth


Her name was Sylveth.
She was not beautiful.
In fact, she was rather ordinary - nothing special about her at all.
Her hair was the usual length. Her eyes were of the predominant color in her country.
She was neither too tall, nor too short.
One could say that she was just another girl.

  One would be right, except that she wasn't normal in one aspect. She somehow was forced in a situation of being the outcast, being the odd man out. The other teenagers at her school always made fun of her. Not that she was provoking them in some way, it was more like a routine to them. Someone started doing it at one point and it kind of stuck. Now it was deemed inappropriate for anyone to even talk to her. The youngsters had no evil intentions, it just happened that way. Like a pebble that you kick unintentionally on the street - it rolls and bounces and finally it lands in the middle of a puddle, spraying a little mud and water on the trousers of an unsuspecting stranger. A small thing, no big deal.
  It was really not a big deal for everyone, for everyone but her. For her this was a nightmare. She had no one to talk to, she had no one to share her thoughts with, she had no one at all, except for the teachers of course, but somehow she didn't think that she could become friends with them. So her life continued that way for several years - her grades dropping at a gradual rate, her heart dying a little day after day, especially when the boy she liked laughed to the stupid jokes about her.
  One day at school the homeroom teacher came and announced that they were going to have a day off the next day. She explained that group of small orphan children was going to visit the school and instead the usual sports festival they were going to have a dancing and singing contest. The kids were to dance with all of the students, which, as the teacher explained, was intended to let them feel at ease in meeting new people. It was also to prevent any isolation or boredom. The students were to try their best to entertain them under the supervision of their teachers. Finally the homeroom teacher told them that at the very end of the event, all of kids were going to select a king and queen of the night, choosing from a few students, selected by a jury of the teaches. At this particular point everyone began speaking and the uproar was so big that it took the better part of half an hour to continue with the usual classes for the day.
  When she went back home she imagined for a second how nice it would be to be selected as the queen of the night. Maybe then she could even dance with Brian (the boy we mentioned before) like a normal girl, without him being ashamed and without hearing strange giggles from all over. This was of course not going to happen - in her class there were several exceptional beauties, all of which were far better dancers than she was. Also they were from a richer families, meaning better clothes and all. She had only one official dress, a present from her grandmother for her last birthday. It was nothing fancy, but she really liked it, all the more so because it was her favorite color - green.
  When the next day arrived everyone was dressed in their best clothes. Somehow this event was turned into a competition of who has the slickest costume or who has the best hairstyle - it was like a mini-prom, so to say. She, of course, didn't have any fancy hair-style or in fact anything fancy about her at all. Only her green dress and her sad smile. Today nobody was telling jokes about her, the girls were preoccupied evaluating who has the tallest shoes, the longest nails, the brightest hair color or the best lipstick. The boy - well they were not so much into the event, but she could see some them looking at the girls with bright eyes, while pretending to talk about games and other boyish stuff. The event was not to be held in the classroom, but in a big concert hall, rented from the school with money from... well from somewhere.
  The orphan kids arrived a little bit after the students. They were also officially dressed and had a little anxious expressions at first. When the dancing and singing begun their faces turned to smiles and their eyes began to shine. Since she could not sing, she remained on the dance floor during the whole event. The best part was when she danced with the little kids, they were not judging her or making fun of her, which made her smile more than she did for the past two years at school. In the singing pauses there was no dancing, so that people could concentrate on the songs. All of them were beautifully performed - almost like by real professional singers. Finally there was one last round of dance, in which she danced with one little girl for the second time. The girl's name was Katy and she was dressed in small draped pink dress. The only difference from the last time they danced together was a small stain on her belly that looked suspiciously much as peanut butter. The girl didn't seem to care and was far more talkative than the first time they danced. At the end of the song, the little girl hugged her and ran of to the other kids, where they were being gathered by the teachers. After a five minute pause the jury selected five girls and five boys from all of the students and told them get up on the podium for everyone to see. Two of the girls and Brian were from her class. She wondered if he will have to kiss the queen in case he was selected as the king. Soon she dismissed that thought as being absurd and something the teachers will never allow. After everything was ready each of the small orphans were given two flowers, and they were told to go on the podium and give one of them to one of the girls and the other to one of the boys. Whoever had most flowers at the end would be the winner.
  The kids were enthusiastic that they were going to decide who the kind and queen would be, especially because afterwards they were promised a photo with them, which was to be printed as a big poster and hung up in their orphanage to remember this night by.
  Katy was last - when she got to the podium she walked up to one of the boys and gave him a daffodil, she then turned to the girls and seemed a little bit confused. She looked at the other students watching her, while the silence was covering everything like a blanket. When their eyes met Sylveth made an encouraging smile at her. For everyone's surprise Katy smiled back and jumped off the podium, darting towards her. When she reached her destination, she placed the remaining rose in Sylveth's hand and smiled even wider. One of the teachers at the orphanage said: "Katy, you are supposed to give the flowers only to the people up there." At that Katy simply shrugged her shoulders and replied: "I know, I just felt like she deserves one flower too." At that moment the world for Sylveth became blurry and then warm wet streaks rolled down her cheeks.
  Later after the king and queen were selected and everyone was preparing to go home, Sylveth went to Katy and with small trembling voice said: "Thank you so much for the rose, but why me?" "Your smile is beautiful and you smell nice."- said the little kid and went outside with the others.
   After that at school things didn't change noticeably but somehow that didn't bother her anymore. Each time she felt lonely and sad she just remembered in her head: "Your smile is beautiful and you smell nice."

Her smile was really beautiful and her heart even more so. After high school Sylveth graduated from university and got married to Brian, not the same one from her school years but another one, one who appreciated and loved her. He gave her a lot of occasions to show her shining smile to the world!

Thursday, August 11, 2011

Walking away

Different,
Strange,
Bizarre,
Unexpected,
yet lying there...
...on the ground
...in the corner
...sleeping soundly
...breathing softly

Turn around and it is done,
only the fleeting memory remains.

Step by step, towards the goal,
step by step - far away.
The pace is slow, but constant,
time passes by, disinterested.

Away and then further, and then some more.
Going and never stopping,
fleeing without even thinking.

A moment consumed with depth,
a revelation dulled by time,
then you know it,
you've know it all along!
The thing you left...
was your soul...
your being...

Monday, August 8, 2011

A Runlet

Had we tears we could cry
Had we cried we could smile
Had we smiled we could live
Had we lived we could see
Had we seen we could act
Had we acted we could feel
Had we felt we could pray
Had we prayed we could love
Had we loved we could be

Tuesday, August 2, 2011

How to handle MouseOut action in GWT with inner layers

Recently i had to face the following problem:
I had one panel which contained a picture with some other functionality. Additional two panels were to appear on top of that panel when the mouse was over the first panel and disappear when the mouse left it. Sound simple enough but the problem was that when one moved the mouse over the inner panels the MouseOut event was still triggered, which cause flickering of the panels and unwanted behaviour.

My solution:

I took all three panels and wrapped them up in one parent panel while setting their positions with CSS (if you use an AbsolutePanel you can also position them using the supplied methods like: 'setWidgetPosition(w, left, top)').

Once that I had the parent panel I did the standard 'sinkEvents(Event.MOUSEEVENTS);' in the constructor, in order to forward the needed events. Finally i added:

@Override
public void onBrowserEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEOVER: {
/* Show the two panels */
break;
}
case Event.ONMOUSEOUT: {
if(Element.is(event.getRelatedEventTarget())) {
/*
Get the related target, which is the element being entered, and
then cast the EventTarget to com.google.gwt.user.client.Element.
*/
Element el = event.getRelatedEventTarget().cast();
boolean toHide = true;
/*
Go through all the elements in the tree towards the root, in
order to be sure that 'el' is not a child of the current class.
If it is a child we should not hide the other two panels
*/
while(el != null) {
if(DOM.isOrHasChild(getElement(), el)) {
toHide = false;
break;
}
el = (Element) el.getParentElement();
}

if(toHide) {
/* Hide the two panels */
}
}
break;
} default: {
}
}
}

Note that the code is not complete, omitting the details from my implementation.

Links:
relatedTarget method
GWT Widget
Element
Event
NativeEvent

A forest picture

Footsteps
clear smell
a veil of raindrops
green forest

Cool air
soft breeze
blue sky
crystal eyes

A moment
rotating world
darkness
closed eyes

Warm smell
sweet touch
tender smile
soft arms

Unspoken words
Silent hug
Sunset
and a hue of red.

Who are we

Why is up down from the roof?
Why is here there from the bridge?
Why is nothing filled with sorrow?
Why is no yes in the morrow?

We see.
We eat.
We go.
We stay.
We cry.
We dance.
We pray.

Pray for love,
happiness,
life.
Pray for nothing and everything alike.

We are blind.
We are gluttonous.
We are lazy.
We are asleep.
We are hypocrites.
We are in a trance.
We are I.

We are many, yet we know us not.
We are together, yet we are alone.
Alone we are ... not,
for Someone is always watching,
caring
loving,
curing,
giving,
feeding,
forgiving.

We think we know, yet we fail to comprehend.
We think we are smart, yet what fools we are.
We think we are different, alas not true.
We think we are the same, indeed a lie.

To understand you have to forget who you are,
to live the life of the other -
to see with his eyes,
to smile with her smile,
to feel their hearts,
to remember our path.

We live, we love, we are happy!
For happiness is nought other than love
and what is love but happiness, indeed.

Sunday, June 5, 2011

How to copy your contacts from Nokia 5800 XM to Google's Nexus S

Hi all, well i had some trouble finding it all in one place so i decided to write this short tutorial to help you get the job done.
First of all this may not work on all firmwares, so here is the information about the devices i used:
Device: Nokia 5800 XpressMusic
Software version: 51.0.006

Device: Samsung Nexus S i9023
Android version: 2.3.4

Note that even though this tutorial is for Nexus S it should also work on other android devices. Now let's get the job done.

1. Go to the 'Contacts' menu in your Nokia.
2. Go to 'Options -> Mark/Unmark -> Mark all'.
3. Click on 'Options -> Copy business card -> To other memory -> Memory card'.
4. After the process is done, connect your phone to the computer as a mass storage device. Navigate to 'Other\Contacts' on your phone and if all went well you should see your contacts as a bunch of .vcf files.
5. Copy those files somewhere on your HDD (this step is optional)

This concludes the exporting of your contacts part.
Now you have two main options for how to import those contacts in your phone. You can either choose to do it with some file manager (the one I use is called 'Dual File Manager' program) or import them from your E-mail. Either one works.

If you choose to import them via a file manager (In the example i will use 'DFM', but basically it shouldn't be any different from any other FM out there):

1. Connect your Nexus S (android phone) to the computer in 'USB storage'
2. Copy the .vcf files to your device (preferably in a folder somewhere).
3. Turn off the 'USB storage' mode.
3. Open the 'Dual File Manager' app.
4. Navigate to the folder where you placed your .vcf files.
5. Open the files by tapping on them - you may be prompted for an account on which you wish to save the contact to.
6. Done.

If you choose to add your contacts via Google Mail:

1. Log-in to your mail (the one where you have your phone registered).
2. Click on 'Contacts' (in the current setup it is right below 'Mail' on the left side of the screen.
3. Click 'More actions -> import' and browse the file you wish to import.
4. Done.

The second approach has the advantage that it offers you the ability to merge the contacts together when they have the same number.

That's it.

Wait a minute, there must be more, right? Both approaches only show how to import a SINGLE VCF file into your contacts list, what if you have, say 1000 such files? In that case you can to the following (Windows only):

1. Open you command prompt ('windows key + r -> type "cmd"')
2. Navigate to where your vcf files lie.
3. Now you can choose to merge all the files together or to merge only some of them. Use 3.1 for all and 3.2 for selected files only.
3.1. copy /b *.vcf (output-file-name).vcf
3.2. copy /b (your-file-name-1).vcf + /b (your-file-name-2).vcf (output-file-name).vcf

What 3.1 and 3.2 do is basically concatinate the files into one super file. The original files are not deleted.
Now you should be able to import all your contacts in your Nexus S without any trouble.

Sources:
How to transfer contacts from a Nokia Symbian phone to HTC Desire
Accept a VCF file? Import it?
How to concatinate the vcf files
More on the 'copy' batch function (in German)

Thursday, June 2, 2011

Hi all, I just found out an interesting video on the internet and thought that i will share it with you. It is about a Japanese toilet at a fish market. I know it sounds strange, but just watch it and then think about the public toilet near your place. Enough said, here is the link:

Sunday, May 22, 2011

Greetings

Hi all, I finally decided to create my own blog.
...awkward silence...
Over and out.

  Hmmm i guess this just won't do for a first post. Ok, what is this blog all about? I guess it is really about everything and about nothing in particular. I will probably post random messages, mixed with some other information or just post a link to something that made me smile, laugh, ponder or just caught my attention. 

  About me? I am a computer science graduate, who studied in Germany. For now I will not disclose any more personal information - like that I am still living in Germany or that I am interested in learning Japanese.

  I hope you have a fun time reading my blog and also learn something useful from time to time.

  So I guess this much information should suffice for the time being. 

Take care and be well!

Ayrinth

PS.
Всички стихотворения и разкази в този блог са авторски (със съвсем малки изключения на съавторство :))
Every story or poem, posted here - in this blog, is written solely by me (with minor exceptions of coautorship)