Java Unconference in Crete. Day Zero.

The flight from Athens to Chania took less than an hour. Renting the car was quick too. The Hertz guy delivered the car and left it with the A/C on.  BTW, I usually drive cars  with stick shift when in Europe.  Then I took the driver’s seat, put the car in the first gear doing this spiel with the clutch and gas pedals – the car didn’t move. Then I pressed the gas pedal all the way to the floor. Nothing – the pedal was offline. I called the Herz guy saying that the pedal won’t work.  He gave me a strange look and quietly said, “Sir, it’s the engine. First you start the engine and then you drive.” I started laughing. At home I’m driving cars with quiet engines, and decided that the Hertz guy left the car running mistakenly taking the A/C noise for the engine’s. 

OK, the next goal was to find a small village were the conference hotel was located. To make the story short, I can give you an advise – if you’re planning to drive in Crete, say 20km have enough gas for driving 40km. You’ll get lost a couple of times, that’s for sure. Crete’s government is saving money on road signs. This may explain why Google included the following fragment in the local driving directions: 

Image

Here’s my today’s  conversation with the hotel’s clerk.
– How do I get to the beach?
– I can give you the map, but there are no local roads there.
– Can you please just tell me how to dive there?
– Sure, it’s very easy. Drive a couple kilometers on this road, then you’ll see a base (???) and turn to the left to the Stavros Beach.
-Is there a sign for Stavros Beach there?
– No, just turn there to the left.

I found the beach after a couple of wrong turns – the beach and the water were really nice.

In the evening  all unattendees of the JCrete unconference went to the local restaurant. The food was good and the conversations were interesting. Between the second and third glass of strong Cretan wine,  one of the possible topics for tomorrows discussion became more and more vivid: The Startups.  I have something to say on the subject too. We’ll see what happens tomorrow.

  After writing a couple of hundreds words in this blog I realized that it misses some technical Java related content. OK, here you go: 

System.out.println(“Hello Crete!”);

Don’t be surprised if in my tomorrow’s blog I’ll re-write this code snippet in Scala.

 

 

 

 

 

 

 

 

Java Unconference in Crete. Day -1.

Tomorrow I’ll be joining about 60 other Java folks and 20 members of their families in Crete – the largest island in Greece. This is the third annual Java unconference that takes place here.

If someone is not sure why savvy Java developers STILL go to conferences I’ll tell you – to attend parties. Of course, attending technical sessions is also useful, but this alone doesn’t justify spending several thousand dollars on technical sessions alone. JavaOne organizers are very good at offering free video recording of all presentations almost immediately after the conference’s over. So if you’re attending conferences just for the technical sessions you’re either wasting your time or are a speaker.

You have to meet people at the conference. Don’t want to? Stay home and watch recordings on Youtube.

Three months ago I went to Kiev, Ukraine to attend the Java conference called JEEConf. Why? First, Kiev was my home town many years ago. Second, I made two presentations there. Third, after one of my presentations I spent an hour talking to Ukrainian Java developers in the corridors besides attending a couple of parties. I love talking to people who share my interests – Java in this case.

Why I’m in Greece now? Last year at JavaOne I’ve attended (you got it!) a party where I met Heinz Kabutz. If you’re a Java developer you must have heard about his Java Specialists newsletter. In my opinion, this newsletter is the most advanced periodical about Java.

Heinz told me about his unconference and invited me. I gladly accepted. The word unconference means that the agenda is open. As of today, no one of these 60 people knows who will present and what will be the agenda. As far as I can guess, on Monday morning attendees will express their interests and vote for topics to discuss. I would assume that there will be some stickers on the wall where people will write their subjects of interest (I’ll let you know how this actually have happened after the fact). During the flight over Atlantic Ocean I’ve decided what to put on my sticker. Will people want to discuss these topics? Will they want me to present on any of these topics? I know as much as you are. I can share with you one fact though. Yesterday, I was dining in Athens in this restaurant with a great view of Acropolis.

SONY DSC

This should be a really nice vacation. I’m here with my wife, the technical sessions will last till noon, and after that people and their loved ones can enjoy the sea, the beaches, and the Greek hospitality.

Stay tuned!

Apple: Turning Negative to Positive

Three weeks ago my MacBook Pro started behaving weird. All of a sudden its LCD screen would turned off. After that, simple rebooting would never work from the first attempt, and sometimes it wouldn’t work at all unless it sat still for several hours. This reminded me of my first used car – I never knew if the engine would start or not.

This computer was not that old though. : Spring 2011 edition (15″, 500Gb HD, 2.4 GHz 4 core CPU). I’m sure Apple would like me to buy a new one, but I’m not the guy who simply shell off $2500 for a new notebook every two years. I’m cheap. In a good way.

After leaving my MacBook in the Genius Bar at thee Apple store overnight for some serious diagnostic tests, I got a message that the logicboard in my computer had to be replaced. I never buy this expensive $350 AppleCare 3-year protection plan (I’m cheap, remember?). I take my chances.

The term logicboard means motherboard. A friendly guy form the Genius Bar told me that if I’d be replacing it in Apple store, it would cost me $500. But if they’ll send to to Apple’s repair depot, they’ll replace it as a flat fee job for $310 and in 3-5 business days I’d get it back. Done deal, just do it.

Seven days later I got a call from Apple depot – the part is in back order and they need several more days. OK, I can live for several more days working on my 5-year old old MacBook Pro (btw, working on 4GB or RAM sucks).

After ten days passed, I called the Apple store – they didn’t have any dates for me. Called to Apple support – they told me that some part is in back order and they would try to expedite (I had to use a couple of strong arguments during this call).

Next day, I got a call from Apple depot – they’ve replaced the logic board, but the problem was not fixed. I was given a choice – either let them continue trying to find the problem or get from them a refurbished computer with the same technical parameters. I picked the latter. The guy started to browse his database trying to find the same model of the same year. He found one, but their HD was 5400 RPM, while mine was 7200. I rejected. Then he offered me a newer 2012 model with 500Gb SSD instead of HD. I’ve agreed as long as all this goodness would fit into the same $310 repair deal. Yes, it would. I paid, and two days later the refurbished computer arrived.

It looked like new. It was thinner than my old one though. To make the store short, it was a model with the retina display! What a nice surprise! When last year Apple announced these retina displays macbooks I said, “No”. But I never said, “No” to replacing an old MacBook with a new one with the retina display for free, did I?

Can life be all that rosy? There should be something wrong here, right? Wrong is the wrong word here. Let’s use the word “surprising”. I wanted to recover all my data from the external drive (in Apple’s world it’s called time machine). WAT? There is no firewire jack in this computer. Having two thunderbolt jacks is nice but… OK, went to the store and bought a firewire-thunderbolt adapter.

Then I took my network wire (it would give me a connection that was twice as fast than my wifi). WAT? There is no jack in this notebook for a network wire. Can you believe this? My first thought was to find an adapter for this cable too, but then I tested the speed of my new MacBook Pro – it was the same as my hard wire would give me in the past. On the photo, the new computer is on the right, and the old one (2008 edition) i on the left. They both go through the same WiFi router.

photo (7)

BTW, where is the slot for my DVD drive? None. Nada. OK, can live without it. Next. In the old MacBook I was getting an electric power from my 24″ Apple Cinema monitor. No good. They changed the power connector too to fit in the slimmer body. I can understand this.

The final surprise (at least I hope so) is that they’ve removed that line-in input. WHY? It was really small! Now there is only one headphone jack, which is a problem for me. I’m recording audio podcasts and screencasts using a professional microphone (Sure 7B) that goes into the voice processor (Aphex 230) that was connected to my old MacBook through the line-in jack via an optical cable. Now I need to buy some audio interface or adapter to route the sound via the USB port. OK, ok, I will. Despise all these little glitches, I consider this experience with Apple repair service as positive. Would you agree?

P.S. One more, I get a feeling that Google Chrome doesn’t really know how to properly maximize itself on the retina display. Am I just being a grumpy old man?

P.S.S. This new computer comes with a one year warranty from Apple, yay!

How serious is Google about Dart?

Developing applications in JavaScript is not overly productive. You can use CoffeeScript or TypeScript to write code that will be converted into JavaScript for deployment. We are also closely watching the progress with Google’s new programming language called Dart.

It’s a compiled language with an elegant and terse syntax, which is easy to understand to anyone who knows Java or C#. Although compiled version of the Dart code requires Dartium VM, which is currently available only in the Chromium browser, Google created dart2js compiler that turns your application code into JavaScript in seconds, so it can run in all Web browsers today. Google also offers Dart Editor – an IDE with debugger and autocomplete. You can event debug the Dart code in Dart Editor while running generated JavaScript in the browser.

Dart’s VM can communicate with JavaScript’s VM, so if you have a portion of your application written in JavaScript, it can peacefully coexist with the Dart code. You can literally have two buttons on the Web page: one written in JavaScript and the other in Dart.

W3C published a document called “Introduction to Web Components”, which among other things defines recommendations on how to create custom HTML components. Existing implementation of Web UI package includes a number of UI components and defining a new custom HTML element can be done in a declarative way. The following code sample I borrowed from the Dart Web site:

html

This code extends the Web UI element `div` and includes a template, which uses binding – the value of the variable count is bound to HTML span, so as soon as counter’s value increases, the Web page immediately reflects its new value. I remember those powerful curly braces from programming with Flex framework. The Web UI package will be replaced soon with the Polymer Stack built on top of Web components. In 2014, the popularity of Dart should increase if Google will remain committed to this project. Will it?

Yesterday, we had a meeting at Farata Systems discussing the possibility of developing new functionality to our insurance stack in Dart. During the meeting one person said that about 15% of our users are still working with older browsers and we don’t want to lose them if Dart-generated JavaScript won’t work in Internet Explorer 7 or 8. I immediately answered that this wouldn’t be an issue, because several years ago Google created a smart way to automatically download Chrome’s JavaScript VM if the application runs inside IE. The name of this smart solution is Google Frame.

The meeting went on, and I decided to see what’s happening with this really useful plugin for IE. A quick googling for Google Frame revealed the page that started with a message “We’re winding down Chrome Frame, and plan to cease support and updates in January 2014”. WAT? Google did it again. Remember Google Reader? Forget it. Millions of people were using it and now it’s discontinued. “All subscription data will be permanently, and irrevocably deleted”. Google became bored with this toy too.

Unless Google will seriously reconsider their policies of decommissioning software, Dart won’t fly in the enterprise world. I hope Google will provide some iron clad guarantees that their Dart project will be around for the next 5 years. If this will happen, I’m all for it, and will prepare a new proposal to O’Reilly Media for a book titled “Enterprise Web Development with Dart”, where Farata’s engineers will share their experience in developing enterprise-grade applications with this promising language.

Damaged by SmartPhones

When I saw the sign that in case of fire you should leave the building before tweeting about it, I smiled. But this is sad. I’m pretty sure that at least in the New York City most of the people in case of fire will either tweet or text about it.

First leave than tweet

Slowly but surely the young generation is moving into a virtual world where posting a funny message and getting more followers is more important than saving yours or someone else’s life in the real world. People witnessing a street fight will first post pictures on Instagram, and then, maybe call 911. Who cares, everyone knows that when a person gets killed, you can start a new game and get more lives! Just click, sorry, touch the button.

In rare occasions when kids get together, their bodies are in the same room, but their minds are occupied with manipulating smartphones. Check out this post titled “The day Einstein feared the most have finally arrived”. This is today’s reality that will only get worse.

A couple of years ago I was invited to a birthday party of one lady. We were already sitting in a restaurant, when her daughter and teenager-grandson showed up in the restaurant. The kid was holding the phone with both hands while quickly typing. His mom was slightly pushing him toward our table so he wouldn’t hit any obstacles on along the way. He didn’t even raise his head, and sat on the chair continuing typing. I know this family for years, his grandmother was raising the kid, and they both love each other. Well, she loves him for real, and he loves her back… virtually.

I know an employer, who had a job applicant who would agree to work on one condition: no communications in person or over the phone – only text messaging. This boy was a nice kid, but please let me talk to you!

I have two sons. The elder lives separately, and my wife often complains that when she calls him on the phone she always get his voicemail. But I’m glad that his phone is somewhere in the bag and not in his hands. Honey, he’ll call back soon. I want my younger son to do the same – live in the real world where people talk to each other while looking at each other rather than into this high quality retina display talking to Siri.

May be the day will come when people will be able to live in two worlds at the same time as in a great novel 1Q84 by Haruki Murakami. Unfortunately less and less people remain in the real world. Kids, come back!

Why I Didn’t Mention Flash Player

I was making a presentation to our client on mobile development. It’s a strong Flex-Java IT shop, and our company helps them with Flex development. I was comparing pros and cons of native vs html5. Spoke about the hybrids too. During the Q & A session one person asked me if I was avoiding mentioning Flash Player on purpose?

At this moment I realized, that it was probably the first time when I didn’t even plan to mention it. It happened naturally. I still like the technology, but it would be unfair to lie to the client.

I answered that we are still using the Flex framework and AIR in our own software product that’s being used in insurance industry, and our company will continue helping customers who need help with Flex. The desktop version of our product uses Adobe Flex, and for tablets we use Adobe AIR. But I don’t see commitment from the Adobe to Flex or AIR. The compiled AIR application works slower on tablets. Creating a build with AIR for iOS can take from 30 minutes to an hour. I also said (may sound pathetic, but this is what I honestly feel), that I spent 5 years of my life with Flex, but with tears in my eyes I say “Don’t do it”.
 
This product was abandoned by Adobe, support for new platforms/SDKs is weak, Flash Player crashes a lot more often than three years ago, eats up all the CPU – it seems that it’s been simply ignored.

Now Adobe has a new pet called PhoneGap. Similarly to Flex, Adobe donated PhoneGap library to Apache Software Foundation. But this time Adobe has a plan to monetize on such a gift – they created a Build PhoneGap cloud service, which can package your HTML5 or Hybrid Web application as a native app. I like PhoneGap, and wish Adobe to succeed with this product. But Flex is going away from the enterprise Web toolbox.

My today’s hope is for Dart – an interesting language from Google that can run either in the compiled mode in the Chromium browser’s VM, or (automatically) turn the app code into JavaScript and run as usual. The Dart VM is not in Chrome VM yet, but you can run the JavaScript code generated by Dart in any browser (see http://try.dartlang.org/).

How to Create the Next Facebook for Ten Bucks

Just got an email that the eBook “How to Create the Next Facebook” is on sale: $10 instead of $20.99. This raises lots of questions in my mind about the readers of this manuscript. If a reader a cheap bastard who couldn’t afford to pay the full price, what are your chances that you will actually create the next Facebook?

facebook

If the author of this book knows how to do it, why he “crystallizes the process” and provides “a guided blueprint” for us instead of doing it himself? The chances are that he has a big crystalized idea, but no money to implement it. Where to get the money? If a thousand naive people will shell $10 a book copy, it’ll add up to $10K. After the publisher recovers expenses, the author will get less than $1K in royalties, which can cover a dinner with a venture capitalist, where the author could ask for some investments into the next Facebook.

Nay, this doesn’t sound like the author’s plan. Most likely he hopes that this catchy book title will make ten thousand of simple people to part with their $10 (what’s the hell, it’s a price of one pack of cigarettes). Then the author will get $10K in royalties that will put some bread on his table for a short period, unless he’s planning on downshifting and settling down somewhere in a bungalow in Thailand where $10K is enough to get by for a year. Not exactly a Facebook style of living, but hey, it’ll give the author time to write another manual with even better title – something similar to this one:

photo (1)

I’m sure people will be waiting in line to purchase this piece of advice. By the way, anyone knows a country where cost of living is lower than in Thailand?

Which language is better: Java or JavaScript?

In one of my blogs a person asked me, “Can you teach a person to be a programmer within 6 months?”  I answered, “I can make a programmer out of any person within two weeks, but there is a chance that he’ll be asking questions like this: http://m.hotpot.hk/story.php?id=15689”.

I shared the above link with our software developers in the Skype chat. Some people laughed. One person responded with a popular link to a presentation that makes fun of JavaScript:

Another guy responded with this question:

var a=0.1
a=a+a+a
(a - 0.3== 0)  // false or true ?

 
After years on Wall Street, this was an easy one, “Of course, false!” Floating numbers precision makes the results unpredictable. We use BigDecimal. I’ve created a little fiddle for you. Just follow this link and press Run to see for yourself: http://jsfiddle.net/4nwdv/

For those who after running this fiddle say “WTF!”, here are the some details – I ran the same code in JavaScript console in Chrome Developers Tool:

addition

So Google Chrome’s Java Script engine truly believes that
0.1 + 0.1 + 0.1 = 0.30000000000000004

Maybe if you’ll run it in Firefox, the result will be different? Nope, I ran it in Firebug’s JavaScript console, which confirmed, that 0.1 + 0.1 + 0.1 = 0.30000000000000004.

addingff

By now, only the person who forgot to take his morning pill wouldn’t agree that this is a language problem and JavaScript is bad. What’s good then? This is another easy question: “Java and only Java!” Most of the Wall Street applications are written in Java and do the number crunching real well! Let’s see what will be the result of the same arithmetics in Java. I wrote this little program, ran it in the debugger and put a breakpoint right after the variable got the new value. Man, the result is the same as in JavaScript!

addingjava1_1

Just to complete the program I pressed the green button Resume to see the result of a-0.3 on the console. Well, it’s not exactly what I was expected to see, but pretty damn close, isn’t it?

addingjava2_3

This little experiment shows that the demand in software developers will only be increasing, because while regular Joe believes that (0.1 + 0.1 + 0.1) – 0.3 = 0, the savvy software developer would not be so sure cause it depends…

I’d appreciate if you’d run the same tests in other programming languages and share your findings. Together we can make the world a better (or at least more definitive) place!

Google Owns World’s Emails

After opening enrollment to online training classes I noticed that 85% of the students  who register have email accounts @gmail.com. Does Google become the main world post office for everyone or only for IT people? It’s scary to know that that there is a single company that can read all world emails. The big brother…

Improve your Search Skills with Snowden

The goal of this blog is to test advanced features of Google search. Let’s see if your really use Google to its fullest. I’ll be running various queries using special syntax, and we’ll see how many results Google comes up with.

We need to pick a combination of words that generate lots and lots of results. At the time of this writing the best candidates for this mini tutorial are the words Edward Snowden. If you are not reading this blog in the Summer of 2013, you may not know that this was the name of a contractor-traitor from National Security Agency. Let’s open Google and key in some queries:

Edward Snowden. This query returns 690 million of articles.

“Edward Snowden”. This gives 59.8M of results because double quotes mean that we’re interested only in posts that have these words next to each other in this particular order.

-Edward Snowden. This gives 490M. The minus sign in front of Edward means that I want to exclude the word Edward from the search. Hence I’m getting only those posts that include Snowden, but not Edward.At this point some smarty pants think what if I put this dash in front of each of these words. Don’t waste you time – if you ask google to exclude every word, you’ll get nothing back as shown below.

google

Edward Snowden:lenta.ru gives only 309K posts because after the colon I specified that the search has to be done only within the Russian news portal lenta.ru. In the unlikely event that you don’t read in Russian yet, try Edward Snowden:cnn.com to search within cnn.com, but you’ll have to sift through 56.8M articles to find something useful.

If you are still struggling with learning English, here’s another advice on how to learn this great language using Google.

Wow, Al Jazeera has 5.5M posts on the subject with Edward Snowden:aljazeera.com. Let’s search all Russian sites (they end with .ru). Edward Snowden:.ru gives 5.9M articles.

The wild card in searches means anything. It’s represented by an asterisk. For example, “Ed * Snowden” means find all articles that have ed followed by anything as long as it has Snowden after that. You’re going to get 133M results.

If all this sounds like a rocket science, then just click the link Advanced search at the bottom of any Google page with any results. You’ll get a form to will out, which will let you limit the searches without memorizing all these search formats.

By the way, at the top of your search result page there is a button Search tools. Click on it, and you’ll be able to filter your search results by the publication time, location and more.

Raise your hand if you started reading this blog hoping to find the whereabouts of Edward Snowden? I know. Sorry, can’t help you with this. I’m sure you understand that if the US authorities really wanted to get him, they’d do it long time ago. A quick operation (remember who they killed Osama?) in the Sheremetyevo waiting zone and Snowden is dead. The time didn’t come just yet. They need to get people involved into this “Where in the World Is Carmen Sandiego?” type hunt to draw public’s attention from what pissed off Mr. Snowden.

Finally, a million dollar question to Google. How do you explain that the search on sheremetyevo returns 4.65M articles, but sheremetyevo -Snowden returns 5.1M results? I’d expect the second number to be lower? This question should be asked during job interviews at Google. Stop asking already how many piano tuners live in San Francisco, will you?