Java Unconference in Crete. Day 2.

The second day of the JCrete unconference started as usual – after the breakfast we’ve entered the main room, where Heinz and Dmitry made announcements about four tracks of having the afternoon fun. I picked visiting of a “secret beach”. Then people expressed their interest in attending one of the four technical sessions. This is when the final rooms assignment was made. The session conveners are where standing in the corners of the room, the topics were announced topic and people where gathering in the corner of their choice.
Interestingly enough the main room has the same number of the corners as the number of tracks. The final actual room/session assignment was done when people are gathered at a particular corner. “It seems that we have the largest crowd in this corner – they’ll get the main room.” Is this simple or what? The KISS principle in action!

The first session was about making software simpler. The consensus was that in Java installing the required for the project is more complicated than it should be. The npm installer was used as an example of the proper way to do it.

I was running a session “Living and running in a virtual startup”. I’ve shared my own experience, and then we’ve discussed the issues that every startup is facing: where to get the money, where to find the right people, why people even create startups, and if the country laws are favorable for the entrepreneurship. It seems that Greece is the most tough place for startups from the laws perspective.

One person expressed a typical concern: “I have a nice job, but want to create startup. Should I just quit and take a risk?” One capitalist from South Africa answered that this is exactly what he did.

Never use your house as a loan collateral to fund your next great idea.
Try to sell the idea of you startup to your wife before quitting a well paid day job.

Then I said that we work with contractors from Eastern Europe – this is where we can find good developers willing to work at lower rates. One socialist from South Africa said, “Arn’t you exploiting these people using the fact that the salaries in their countries are low?” This reminds me of a great Indian tale about seven blinds and the elephant. I looked at it differently – we help these great developers and their families substantially improve their lifestyles without the need to leave their countries.

BTW, there are three people from Italy in the conference none of which lives in Italy – the IT market is weak there. Belgium is the money cow now!

Here is another comment from the same session, “I’m and idealist and like startups where people would work without pay just because they are passionate about the software and the idea.” IMO, there should be at least one pragmatic person in the startup otherwise either the time will be lost on developing of an unneeded product or capitalist sharks will eat these idealists for breakfast.

Then I’ve attended participated in a session about lying profilers. It was good to have a reassurance that even though the tools helps, the humans is still da man in the software optimization field.

In the afternoon my wife and I has joined the group of people who went to a secret beach. Another winding road and a pretty steep descent (ok, ok, Heinz’s mom did it last year) lead us to a beautiful blue lagoon. To see the picture of this place, click on the third letter “e” the first mentioning of the word “beach” in this blog.

Another group went to the Pirate Bay, which increased the budget of one of the local hospital by 560 euros. Manik is back in business in no time. Special credits to Kirk for knowing what to do in extreme situations!

In the evening, most of the conference had a dinner in a beach taverna. After 10PM a large crows has gathered by the pool. We had some beer and wine talking about women software. In particular, I had a chat with a geek who makes a living by improving performance of the software systems. When I asked about some numbers he said “It’ll be at least 10 times more responsive”. I trust this guy.

Java Unconference in Crete. Day One.

The conference takes place in the resort hotel. Even though there are only 60 of us, this unconference can have up to four tracks. This is how the main auditorium looked at 8:45AM.

SONY DSC

We sat down, the conference organizers explained the rules and gave each of us markers and a pack of yellow stickers to write down the suggested topics. You don’t have to be the subject matter expert in these topics – you may just want to learn more about them from others. This is what I wrote:

SONY DSC

The mike went around the room, and those who wrote something on the stickers had a chance to explain what their proposed topic was about. Some people simply presented their topics as simple as this: “I know nothing about XYZ, and am looking for your help in understanding it.”
Then the stickers were given to the organizers, and I’ve learned something new right away. Mattias Karlsson noticed that most of us don’t know how to peel the stickers off. He was kind enough to share this useful technique:

Peel off the sticker with a left-to-right movement. If you do it as most people do – bottom-up – the sticker will curl-up, and it will be hard to read its message when the sticker is placed on the board.

Thank you, Mattias! WHile people were introducing the possible topics, the organizers were placing them on the left board to group the similar topics together. At 10AM the initial version of the schedule (on the right) was ready:

SONY DSC
I participated in two sessions: “Working remotely” and “Application Design wars”. Again, not attended, but participated. Each of them had a dozen participants, and everyone has something to say on the subject. I really enjoyed every moment of these discussions. It’s hard to explain it in the blog – you have to be in the room filled with professionals to appreciate the fact that people know what they are talking about, respect other’s opinions and get everyone a chance to speak up. And let me assure you:

Geeks can speak. Geeks can listen.

Since each session was audio-recorded I can guess that at some point they’ll be published on the Internet. I’d love to hear the conversation that took place in each end every room. At 12:30PM the technical part was over and some people signed up for going to remote beaches while other went to see an archeological cite (we’re in Greece, remember?).

I was one of the drivers of three cars that took a dozen of people to a remote and beautiful beach in the Sooth-West of Crete. There were two couples in our car – my wife and I and Andres Almiray with his wife, who being a resident of the Swizerland did a great job explaining us why Mexico is a great country. On the side note, there is probably a dozen Java Champions here at JCrete, right Heinz? As you can see, the beach was full of nice looking Java developers:

SONY DSC

This was a rather long drive mainly in the winding roads in the mountains. Actually there was a part of a highway driving where I learned a new for me style of driving, which I called “Speeding on the shoulder”. The highway had one (or rather one-is) lane in each direction. But slower moving vehicles (Why have I rented that small and weak Fiat?) are supposed to move to the right to let the real drivers drive fast. So for the most part of the highway leg I’ve been driving at the speed from 60 to 90 km per hour on the shoulder. In the USA I’d get a substantial fine and four points on my driver’s license for this. Oh those Greeks!

FInally, I want to give credit to a nice iOS application called CityMaps2Go recommended me by one of the readers of my blog (thank you, Alex!). It’s an offline map app. I’ve downloaded the map of Crete in advance, and while I was driving my wife was watching how a little blue marker was moving on the map. You may ask, how is it possible if this was an offline map and I was not connected to the Internet? Smartphone have GPS. Becides, my iPhone had a phone connection, and most likely the position of the device was quickly calculated based on the distance to the closest cell towers (A-GPS).

Till tomorrow!

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!

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:

https://www.youtube.com/watch?feature=player_detailpage&v=THERgYM8gBM#t=88s .

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?

What Gas Stations and Yoga Schools Have in Common

In the past two days I attended a party with Gas Station owners, and then a Yoga school. These two events gave me the material for this blog. So what do a gas station and a yoga school have in common? Both types of small businesses use software. What a revelation! To be more specific, in both cases I saw the room for improvements in software.

Actually, I started writing about gas stations eight years ago. Senior (literally) Java developers may remember the times when reading printed glossy magazines on software development was a norm of life. Eight years ago I wrote a series of articles under the category “Yakov’s Gas Station”, which was printed in Java Developers Journal. You can still find them online.

Anyway, during the party conversation my wife mentioned an episode at a gas station that happened a couple of years back. We live in New Jersey, which is one of two privileged states where people are not allowed to fill gas tanks themselves. You pull down to the pump and keep sitting in a car like a tsar. The gas attendent will come over and will do the rest. He started filling my wife’s car at one price, then changed the price (increased) on their large billboard, then came back to the car trying to charge this transaction at a new price. My wife didn’t agree, and after a short and colorful conversation she won (what’s new?).

Our friends (gas stations’ owners) told us that in New Jersey it’s illegal to continue pumping gas if the the gas station owner needs to change the price. The owner should stop operating all pumps, change the price, and then resume work. This is how it should work in theory. But in the real life, you may lose customers if they’d be asked to wait. I was surprised that the gas station owners didn’t see it as a big deal.

I started to tell them that there is a better software solution, which could be implemented allowing continue pumping gas and changing the price without affecting the customers who are in the process of getting filled. Software developers know that I was thinking of implementing proper synchronization locks that would freeze the price that was in effect when the pumping started. Why it was not done? Software architects didn’t care about these small business owners, which would accept that “This is how the system is set up and we’ll use it this way“.

Now the Yoga school. They sell various types of monthly and yearly memberships that would allow attending unlimited classes – as many as you want. The problem is that I don’t need this all-you-can-eat option. Going there twice a week it more than enough for me. Any other options available? Yes, you can purchase 10 sessions at a discount price and attend them on an a la cart basis.

Now we are talking! Can I buy these 10 tickets and share them with my wife? No, the system is not set up this way. Sure, they’ve designed the database linking these tickets to the members’s ID. It’s a wrong software solution again. Why not keep things simple? A ten-session ticket is supported by a single database table with two columns: tktID and RemainingSessionsCounter? The customer comes in, hands the ticket to the girl who scans or enters the ticket number into that computa, and the program decreases the counter. Simple? Yes. Good for the business? Yes. Good for the customers? You bet!

The problem is that software creators have to build their systems based on what the customers needs. Yes, the customer may not know any better, but what about you?

Four years ago I was a part of a small group of people who created a startup for automating small-scale insurance business – the agencies. Back then agents were using a mediocre software that was available. We had almost no knowledge about how the small insurance businesses operate. But we didn’t like what we saw. Insurance agents also didn’t know any better. Today, more than a 100000 agents across the country are using our software called SureLC. They are happy, we are happy.

Steve Job once said, “People don’t know what they want until you show it to them.” So if you are about to automate a business, don’t just have write software implementing existing workflows. Think about the customers, and when your next system will go in production, people will say, “Wow, we didn’t know it was possible!”

Hack: iPhone, USB, Macbook, Web Server

If you are developing a Web application for a mobile device, it’s great if you can run it on  a real device. Sure enough, you can deploy your app on the remote publicly available server and then enter the URL of that server from your mobile device. This strategy works for any mobile device.

But I had a more specific case: I have two Apple devices: MacBook (my development machine) and iPhone – my mobile device.  I wanted to connect to the Web Server running on my MacBook from my iPhone connected to the USB port of MacBook. To put it simple, I wanted to eliminate the step of deploying the Web app on a remote server.

I’ll share with you all experiments I’ve done this morning till I made it work. I’ll appreciate your feedback if can offer some explanations of the Web server weirdness I had to overcome.

1. Both devices have to be on the same Wi-Fi network.

2. You need to know the IP address of your MacBook on this local network – this is the part of the URL to enter in the browser of your iOS device. There are two ways of finding this IP address: either open System Preferences | Network – the IP address is shown right under the Wi-Fi connection or run the Network Utility to see it there. In my case it was 10.0.1.3.

3. Start the local Apache Web Server that comes with Mac OS.  Prior to Mountain Lion doing that was easy – System Preferences | Sharing | Web Sharing.  Now Apple removed this option, but Apache Web Server is still there. you can start it from the Terminal as “sudo apachectl start” and stop with “sudo apachectl stop”.  After start, enter http://localhost, and you’ll get this given you’re Mr. Fain: webserver

4. The document root directory of this server is /Library/WebServer/Documents. This is where you need to deploy your HTML files.

5. Here’s the problem: if you’ll try to access this Web server from your iPhone (e.g. http://10.0.1.3), you’ll get the error “Safari Cannot open page because it could not connect to the server”. Adding the port 80 to the URL didn’t help.  The interesting part is that when I tried to start another server on my computer – it was Apache Tomcat running on port 8080, I was able to connect to it from my USB-connected iPhone. This gave me a hint there there is something wrong with the port 80.

Disclaimer 1. I still don’t know what kind of setting should be changed on the Web server to allow such connection. If you do – please share.

6. Change the default port where your Apache Web server runs. Change to the directory /etc/apache2 and edit the configuration file httpd.conf  using  “sudo nano httpd.conf”.  Find the line that reads “Listen 80 ” and change 80 to another port number, for example 8000.

Now my iPhone can reach my local Web server via the USB connection by entering the URL: 10.0.1.3:8000.

Update: I just got a hint that instead of IP you can use the computer name shown on top of the Sharing screen in System Preferences. In my case the URL would look like http://Yakov.local:8000

photo

What’s left?  To deploy your Web applications under any Web server that runs on any port but 80.  It doesn’t have to be  internal Apache Web server.  As I said before, you can  use Tomcat or  any easy to install and start Apache Server packaged with XAMPP (again, change the port).

Disclaimer 2. I don’t know why the internal server that comes with Aptana IDE and runs on port 8020 still doesn’t respond to my iPhone-USB setup.  If you do,  please let me know.

But the good news is that you don’t have to use the internal Web server with Aptana IDE. you can configure it to use Apache Web – I’ve described the process in Chapter 5 of our upcoming book on Web development in the sidebar “Configuring Aptana IDE to use Apache Web Server”.

Do you know if a similar setup is possible with Android devices without the need to install any heavy SDKs?

 

Mixed Feelings and Java for Kids

Nine years ago I’ve written an e-book “Programming in Java for kids, parents, and grandparents“. If was a self-published book, which I offered for downloads free of charge. A year later fellow software developers from France translated it to French. Last year, a group of developers from Eastern Europe translated it to Russian language. All these versions are available for free, and I’m really glad that non-programmers of all ages can start learning this widely-used programming language without the need to have any serious background in programming.

Today, I got a message that my book is pretty popular among Russian-speaking people. The Russian translation of my eBook is #2 with 13667 downloads from this site, and the original English version is #13 in this bestellers list.

2fd68a23

Only Herbert Schild is ahead of me at this point. Yay, time to celebrate! But there is a bitter taste in my mouth. The reason being that this statistics was taken from the torrent site rutracker – the main site for downloading of illegal content. I’m really glad to find myself among a very respectful group of Java authors, but most likely my book is the only one in this list that’s offered without violations of the copyright.

There was this joke that “Mixed Feelings is when your mother-in-law gets into a serious car accident while driving your new Mercedes”. It seems that I can offer a new definition of what the Mixed Feelings mean…