Flash Player 9 on Linux and Adobe marketing

This morning I ‘ve read the blog of Adobe ‘s technical Flex evangelist James Ward, who had a chance to try pre-alpha Flash Player 9 on his Linux machine. James was pretty impressed and his Flex 2 applications work and look the same as in Windows or Mac as expected.

Flash Player 9 on Linux is big milestone for Adobe. Some of my Java peers are loosing one of their strongest arguments against accepting the fact that Flex 2 does your mind and body good. Knowing Adobe ‘s alpha-beta numbering scheme, I can guess that later this month at MAX conference they will announce Flash Player 9 Alpha on Linux, and one standing ovation and three months later, we ‘ll see shiny eye-candy applications running on Linux. The technical crowd (myself included) will write about a thousand of exciting blogs on the subject and will start casually using the product. But where? In the basements where many geeks spend their evenings? The end users won ‘t notice anything, because they are sitting by Wintel machines. But how about enterprises?

Adobe (credit to Macromedia engineers) was able to build a strong and vibrant community of people who enjoy working with Flex. Adobe ‘s technical evangelists deliver impressive presentations at conferences. So the-boat-shaking is working fine. But unless Adobe wants to share the fate of Ruby, which generates loud noise on the streets, but can ‘t pass security officers and sneak into corporate buidings, they should invest some serious dough into marketing. Java is huge not only because it ‘s a great programming language, but mainly because Sun Microsystems, IBM, and other big guys heavily invested into promoting Java.

In the past, Adobe was not a well known name in the enterprise IT departments. Yes, everyone uses Acrobat Reader, but this is pretty much it. It ‘s not an easy job to change the perception of being a designer ‘s vendor. Some serious investments into marketing of Flex 2 for enterprises is required. Need to jump a bit higher to get noticed from the Wall Street highrises. The sooner the better.

How to work for 50c per hour

If I offer you a job for fifty cents an hour, will you take it? This is what I ‘m doing now, and this is OK as long as the results of my work will not be stolen. I ‘m talking about writing a book. Each day I spend several hours after my regular hours working on a book. This is not an easy job, but it gives you satisfaction, industry recognition and the like. So I would not complain, but when I see the sites that offer you free bootleg version of the book it gets me upset. Basically these thieves are stealing more than modest royalties from the technical book authors.

My former co-author James McGovern has found this site offering his book for free. After complains, this Chinese thief removed this book ‘s file, but other bootleg books that are available there. This thief found a new business model: donate for using stolen goods. He writes: “If you find some useful stuff on this site, please kindly click on the PayPal button to donate some bucks to help me keep the site going on. MUCH APPRECIATED. ” But I doubt that anyone who likes using stolen materials would ever donate anything to this thief.

Several years ago one of my students from India has shown me a very thin (rice paper) and low quality printed version of a software book.

People steal even free stuff. Earlier this year a guy from India has stolen all my free Java lessons – he just did not bother mentioning my name. After a chain of shame-on-you emails, he removed my content.

In Russia it ‘s considered normal to share online books and commercial software.

People in these poor countries are often finding an excuse that their low wages stop them from buying books. I do not think this is the real reason. Many people have this mentality “Steal if you can “. It seems natural for them.

In developed countries people steal as well, i.e. kids are stealing (a.k.a. sharing) music, videos, but in general, the don ‘t-steal factor works much better here.

I do not know if there is a solution to this problem, do you? I ‘m not a religious person, but maybe people should spend more time in churches, synagouges, mosques or talking to buddhas?

Pace University does not know Pink Floyd

Pace University arranges meetings between the real world practitioners and computer science students. It ‘s my second talk at Pace, and this time I was talking about Java technical interviews.

I started with a story based on my article Another Brick in the Wall. To my disappointment, none of the students could answer which album was this song from. Is there something wrong with Pace, or I ‘m getting too old? Probably both. But this was the only negative moment of the evening.

After a short intro, I conducted a public demo-technical interview with a volunteer student from the audience. This brave guy gave me his resume, and I briefly went through it suggesting some improvements. A good resume is a key artifact in the job search, and its main goal is to get you an interview… After 15-minute interview I did a post-mortem analysis of mistakes of this “job applicant “. This was a successful and useful experiment. At the end, we ‘ve discussed with students some other Java interviewing techniques.

Pace professors have invited me to come back next Spring, which I ‘ll do with great pleasure.

I saw Lenin… in Seattle, Washington

Seeing this huge Lenin monument casually standing on one of the streets of Seattle, was a real surprise for me to say the least. People who are as old as Internet may not know who Lenin was, so this is especially for you: would you be surprised to see a 7-ton monument of Fidel Castro standing on the street of New York? Oh, you do not know what 7-ton is? Well, it ‘s heavy, trust me on this, or just take a look (this is Vladimir Lenin):

Here ‘s the story. This 16-ft statue was erected (if you do not know the word, think of Viagra) in Slovakia back in 1988, and in 1989 it was toppled and was just laying face down on the ground. An American entrepreneur Lewis Carpenter ran into it and like it a lot. I mean really really liked it, so he even mortgaged his house to buy and transport the statue to Seattle. This statue is a bit unusual, because it shows the leader or the world proletariat not just holding a book or surrounded by smiling pioneers (a communist-crafted boy/girl scout organization), but standing in flames and guns. Anyway, for 28 Grand Lewis brought it to the USA. Unfortunately he died in a car accident in 1994 leaving his wife with an unpaid mortgage and Lenin. Lenin was standing in a flea market for a while with a price tag of $150000, but now it ‘s on sale for $250000 (inflation, you know).

I hope one of these New Russians will be able to shell out a quarter of a mil and bring the Grandpa Lenin back to Russia, where he belongs. Lenin succeeded in building a society of equally poor people, and it should be pretty upsetting for him standing in a city of unequally rich American people.

If 90 years ago one of the poor people returning from Moscow would say “I saw Lenin ” , he ‘d be the only game in town. People would invite and treat him just to listen to some stories about this idol. So here I am, back from Seattle proudly announcing: “I SAW LENIN! “

ActionScript 3: Dynamic Classes

In Java, if you “ve created an object from a particular class, you can use only properties and methods that were defined in this class. For example, if the following class:

class Person {

String name;

}

you can only manipulate with the name property:

Person p = new Person();

p.name = “Joe rdquo;;

System.out.println(p.name);

ActionScript calls such classes sealed, but it also has different animals: dynamic classes, which allow you to programmatically add new properties and behavior to classes during the run-time. Just add the magic keyword dynamic to the class definition:

dynamic class Person {

var name:String;

}

Now let “s add dynamically two variables name and age and the function printme() to the object of type Person:

Person p= new Person();

p.name= rdquo;Joe rdquo;;

p.age=25;

p.printMe = function () {

trace (p.name, p.age);

}

p.printMe(); // Joe 25

You do not have complete freedom though: you can dynamically add only public properties and methods. Of course, nothing comes for free and sealed classes are a bit more efficient in terms of memory consumption, because they do not need to create a hash table to store the properties and methods that are unknown during compilation. Another obvious restriction is that dynamically added functions can “t access private members of the dynamic class. Read the blog Programming In Style or an Elevator Pitch to see how by just declaring standard Flex component dynamic, the your code becomes more simple and elegant.

In AS3, any function can be attached to a dynamically created property of a dynamic object, for example

function calcTax():Number { hellip;}

var myObject:SomeObject = new SomeObject();

myObject.tax=calcTax; //add the tax property and attach the function calcTax()

var myTax=myObject.tax();

The delete operator destroys the property of an object and makes it eligible for garbage collection:

delete calcTax();

myTax=myObject.tax() // generates an error

Some of the Flex classes were defined as dynamic, i.e. Object, Array, MovieClip, NetConnection, TextField, and others. At the time of this writing, subclasses of dynamic classes are not dynamic by default.

Because of this, you may run into an ugly run-time error: imagine a sealed class S that extends a dynamic class D. If you create an object as

D myObj = new S(), an attempt to add a propery to myObj will produce a runtime error because the variable myObj points at a sealed object.

Let “s do a quick test. Create a new project in FlexBuilder and select ActionScript project as its type. Enter AS_Only_Project as the project name. In a couple of seconds you “ll see the auto-generated code that looks as follows:

package {

import flash.display.Sprite;

public class AS_Only_Project extends Sprite

{

public function AS_Only_Project()

{

}

}

}

Next, create a new class called D and check odd the Dynamic checkbox in FlexBuilder pop-up. You “ll get this class.

package {

public dynamic class D

{

}

}

Now, instantiate and test the dynamic nature of the class D by adding the constructor

public function AS_Only_Project()

{

var myD:D=new D();

myD.favoriteBand= “Pink Floyd “;

trace( “Favorite Band= “+myD.favoriteBand);

}

Run this application in the debug mode, and sure enough it “ll print

Favorite Band=Pink Floyd

Create one more sealed class called S inherited from the dynamic D:

package {

public class S extends D

{

}

}

An attempt to add properties on the fly to the instance of the class S fails miserably as expected:

var myS:D = new S();

myS.favoriteSinger= “Alla Pugacheva “;

trace( “Favorite Singer= “+myS.favoriteSinger);

ReferenceError: Error #1056: Cannot create property favoriteSinger on S.

at AS_Only_Project$iinit()[C:\TheRIABook\eclipse\AS_Only_Project\AS_Only_Project.as:13]

If you “ll try to instantiate your sealed class as follows:

var myS:D = new S() as D;

I have two news for you: the good news is that it compiles, and the bad (and expected) news is that it generates exactly the same runtime error.

Most likely Adobe “s gonna hire a hitman and kill me after the following statement, but I “m going to say it anyway (at least you “ll now who to blame) hellip; May be I should not? hellip;Life is so good, and I “d like to witness the success of Apollo hellip;I “m sayyyiiiinng this:

If you need to add new functionality to one of the existing standard Flex components (buttons, comboboxes and the like), do not bother extending them and creating new classes. Just create one simple empty subclass with the keyword dynamic and instantiate and add new properties on the fly as needed, as was shown in the Smalltalk version in this article .

A sound of a silenced pistol shot. Curtain.

My upcoming Adobe Flex classes

After teaching Java for years, I ‘ve added yet another great tool to my menu: Adobe Flex 2. Beside being a developer who uses Flex 2 for real-world projects, I ‘m a co-author of the upcoming advanced book on developing RIA using Flex 2 and Java , which was not enough to become a certified Adobe Flex Instructor. I had to sit through a five day “train-the-trainer ” class taught by Adobe ‘s excellent instructor and book author (Matt Boles). After this class I had to pass the teaching exam by conducting a one-hour stand-up class using selected topics from Adobe ‘s training manuals. This was done and now I ‘m officially entitled to teach Flex 2 classes and use the courseware from Adobe.

Below is the list of my upcoming Adobe Flex 2 classes:

1. New York University , Manhattan.

This class consists of five evening sessions (Thursdays) over five weeks . This is a hands-on class, where I ‘ll cover all materials from the class Flex 2: Developing Rich Client Applications . This is a really great way to start your RIA-career in a slower pace.

2. Farata Systems , Manhattan, Dec 4-8. This course consists of five long days of intensive training: Flex 2: Developing Rich Client Applications and Flex 2: Data and Communications .

The students of these two classes will have preference in enrollment to yet another three days of the Advanced Flex training that will be taught by my colleage and co-author Dr. Victor Rasputnis in January 2007 (details will be announced shortly). This unique offering is not available from any other training provider.

I ‘d like to extend a special invitation to all of my former Java and PowerBuilder students to consider enrollment into one of the above classes if you ‘d like to be ahead of the crowd in your career planning.

To schedule private corporate onsite training anywhere in North America and Europe send an email at yfain at faratasystems dot com.

On sharing the source code of reusable components

I ‘ve seen a couple of times the posts stating something like this: “Since I developed the XYZ component for my client, I can ‘t share the code with you “. I ‘m talking about something like a TreeView control with check boxes by each node, or a thread pool optimized for the use with long running transactions.

IMO, we can share the code developed for our clients as long as it does not reveal client ‘s specific information. The very word “reusable ” means that I can use these components in more than one project. I do not think that the members of Gang of Four were laying on the beach and came out with design patterns. Most likely they were working on the real projects for the brick and mortar clients.

Of course, you may remind me that Sir Isaac Newton,was sitting under an apple tree observing an apple fall to the ground, and when he saw the apple fall, he began to think about a specific kind of motion mdash;gravity. I ‘m sure, the corporate lawyers have already discussed this situation a million times, and Mr. Newton would not have a chance to share his invention with the mankind had he worked for a Fortune 500 company.

Anyway, what ‘s your take on this?

Eating in Seattle

It ‘s my second day in Seattle – I ‘m here on Adobe Flex training business. After being in the classroom from 8 to 6, having a nice dinner helps. I was told that Seattle is famous for seafood, and there was a seafood place called Bonefish right by my hotel (belongs to the Outback chain). Boring place and boring food. Today, I decided not to take chances and asked for referrals at the hotel ‘s front desk, and they ‘ve suggested a place called Pasta Freska. On my own, I ‘d never even noticed this place, which is a small rancho squeezed inside a road fork. It ‘s very simple inside as well. The owner of the place started the dialog:

“Is there anything you do not eat? ”

“No ”

“How about a glass of wine? ”

“Thank you, but I prefer beer tonight ”

“I ‘ll bring you Peroni from Italy ”

“OK ”

Then I realized that this place does not have a menu. A nice smiling girl stopped by bringing something in a frying pan.

“What ‘s this? ”

“Some appetizer ”

I do not know what it was, but iIt was good. Then she brought me a green salad with a home made dressing. When I finished the salad, there was a pasta appetizer, I guess…Then, a tasty chicken cutlet with cashew nuts. When they brought me a seafood, I asked for another beer, and the owner simply said, “I ‘ll bring you a little bit darker beer this time ” – I did not resist. I enjoyed this game. He gave me a beer called India Pale from Oregon.

“Check, please ”

“You did not leave a little room for desert? ”

“No, thank you ”

Total damage: $31 + tips.

I have a reservation in a fancy restaurant for Friday night, but I ‘ll definitely will come back to Pasta Freska again this week. This is an experience.

How to get rid of the coffee smell

Woke up and noticed a nice-looking coffee maker by the TV – complimentary from the hotel. How sweet! A sealed foil coffee bag is right there too. As per printed directions, I ‘m carefully tearing open package and removing filter pack. A really nice smell of a ground coffee fills the room.

The next set of directions is printed right on the coffee maker. Not a rocket science either. Pouring in a cup of fresh water, inserting the filter pack with coffee, pressing the red button…

Voila! One minute later, the fresh pure water was turned into a brown liquid with no taste, and more importantly no smell of coffee. Good job guys, you made it! This experiment always works in any hotel room regardless of the coffee or coffemaker brand.

The next destination is a street cafe where the coffee is not free, but has a taste and a smell.

On Google and free food

Fortune magazine has published an interesting article about Google called Chaos by Design . I ‘m not going to bore you with mumbling about how Google is still going up while Microsoft is definitely goes down. I ‘ll talk about important stuff: Google employees enjoy free food. Even the journalist of a solid financial publication, could not stop himself from literally starting the article from talking about free and festive cafeterias.

That ‘s remains a fact of life: the most important thing for any human being is food. And free food is a pinnacle of human life. Multi-billion deals are being signed just because someone took someone for a free lunch or dinner. Free is the magic word. It does not really matter that a person who was treated with a free lunch is a millionaire…

Have you ever thought of what ‘s the main difference between human beings and animals when it comes to eating habits? I did. Animals eat when they are hungry, while people eat when they see food available. Especially a free food. Please answer this question, but be honest: how many times do you re-fill your plate in all-you-can-eat buffets? I know, at least three. You ‘d never do this if you had to pay even $5.

Yesterday I was flying over from New Jersey to Seattle. The free food sucks on the planes these days. The beer or wine costs $5. I did not purchase the beer giving myself a lame excuse that I had to work on the book and drinking beer would lower my productivity. What a BS. Most likely, subconsciously, I was saving five bucks. What a shame! On the way back I ‘m buying two beers. The hell with the book.

Many years ago I was working with one of the former Pan Am managers. He told me that they were allowed to fly for free, and the food on the plane was great. So he ‘d check the Pan Am menus on various destinations, picked what he liked and spent a weekend flying, say to Italy and back just for food.

Ten years ago I was working for an oil company that had subsidized lunches: pay three bucks and eat anything you want, and the food was of a restaurant quality. One brave guy decided to ban himself from going to this cafeteria, because otherwise he would not stop eating and gained weight.

If you are running a company and want to attract top talents, offer free lunches to your employees. I ‘ll check your menu, and if it ‘s good, I ‘ll quit my current job and will work for you. Will work for food!