Pages

August 27, 2010

Providing GWT with the browser's locale at runtime

I think it's my first post on GWT (Google Web Kit) so bear with me, I come in peace :).
I came across a problem where I've created a localization support for a project but wanted my generated code to obtain the browser's locale (note: not the system locale) and act accordingly on runtime.
Now GWT supplies 2 formal way on setting the locale for the web page; one is with a query string on the URL request and the other is adding the metadata on the host page and set the GWT property.
Both option are not satisfying since the a simple HTML cannot access the browser locales (security issues as far as I've looked), so the web pages cannot obtain the locale. You can use GWT to fetch the locale and reload the page with the right locale concatenated to the URL, but that will cause the page to flicker… nhaaaa, not good enough.
The solution is rather simple - having the server analyze the http request and get the browser's locale from it. You don't want you page to flicker, but rather generate the metadata on the host page which holds the locale information for GWT.
Comes JSP.
Since the project runs on J2EE application server, I was able to create a simple JSP page, to be used as the host page for GWT, and have a code inside that will generate the metadata for the locale derived from the request.
Here is the code
<HTML>
<HEAD>
<meta name="gwt:property" content="locale=<%= request.getLocale()%>">
</HEAD>

<BODY>
<%
out.println("Languge:");
out.println(request.getLocale());
%>
</BODY>
</HTML>

Hope this help you guys, I spent some time searching for an elegant solution on the web but couldn't find anything specific, so there you go.
Cheers!

August 19, 2010

OT: ומחר... עוד הכבדה בחום

מזמן לא השתלחתי, ובטח שלא בשפת אימי, אבל אני חושש שהגיעה העת לתקתק מספר מילים עבור העונה המיותרת הזו, הנקראת קיץ וכמובן לסיפטום המטונף שלה הנקרא חום.
פעם מזמן, שעוד היינו זבי חוטם, מאד אהבנו את העונה המיוזעת הזו. כמובן שאז, ואני מדבר על שנות השמונים, הקיץ לא היה טאבון אנושי אלא יותר עונה חמימה עם ימי שרב בודדים. אהבנו גם את הרעיון של חופש בן-חודשיים בו רובצים כמו רד-נקס מול נילס הולגרסון, עם קרטיב לימון בשבעים אגורות. ומעבר לכך, היותי ירושלמי העניקה לי קיצים הרבה יותר נעימים, ללא לחות. מה יותר טוב?
והנה עברו השנים ואני מוצא עצמי באיזור גוש דן, שלדעת רבים עדיין נחשב כבית השחי של אלוהים, הלא היא המטרופולין המבאישה, בירת הגו'קים הנצחית וטמטמת גיל האחרי צבא - תל-אביב.
הקיץ כאן, רבותי, הוא לא עונה. הוא נמשך 12 חודשים שלפרקים יורד גשם-ערפיח, שזה סוג חדש של גשם שבא ללכלך את הרחובות ולגרום למאותגרי נשימה שכמותי לחרחר את שנתם הטרופה. הקיץ כאן הוא מכה שאלוהים חסך מפרעה פן תאבד תרבות הספינקס. ובמדור גיהנום שבע הזה, ישנם חודשיים שלמים בהם המפזר-חום של כדוה"א נשאר דולק על MAX, כשהכנפיים שלו מכוונות לשפלה שלנו. יולי-אוגוסט הם חודשים שצריך להוציא מחוץ לחוק.
מעבר לכך שבני הנוער החשופים למשעי והטיפשים להפליא פוקקים כל ספסל רחוב, החום והלחות פשוט מעבירים אותך על דעתך. כך אני מוצא עצמי מסתובב בדירתי, שפיתחה סוג חדש יכולת המורכבת מספיחת חום במשך היום ויציקתו אל פנים הבית במהלך הליל, כולי לח כמו חתיכת ג'ילדה של מוסכניק תאב בצע, עצבני כמו שרק דמויות מאנגה יכולות להביע ולא יודע איך לפתור את הכבשן בו אני חי.
אי אפשר להתרווח על כורסה, כי גם היא לחה. ואם אני אקנה ארטיק הוא יהפוך לשלולית כימית אחרי הביס הראשון. נילס מזמן לא מככב, וכל שנותר לי הוא לראות את יונית לוי מביטה בי במבט שאפילו עגל מתקשה להעלות, מדברת על מסמך הרמטכ"ל, שבנינו... מעניין לי את המקש לשמאלו של "ס".
הו אז מגיח לו מהטלוויזיה אדון מר דני דוייטש, חזאי ופיגורת-סלב, ומספר לי במתק שפתיים שמחר תחול עוד הכבדה בחום, מה שמביא אותי לחשוב, בחמסין הנוראי הזה, על מקצוע חזאות האויר, שהוא ללא ספק המקצוע הכי מיותר בעולם. מקריא מה שכל ילד בן שנתיים יכול לגגל. כן? הכבדה בחום? אחרי מחקרים הגיעו למסקנה שהקיץ הזה הוא הנוראי ביותר מאז ומעולם? לא צריך מחקרים חתיכת אמבצילים! תראו את האנשים שמתאדים בחוץ כאילו הופצצו בחמישה טונות של נאפלם. אתם כל כך חכמים שאפילו לגרף הטמפרטורות יש זקפה.
שהחזאים יעשו לי טובה, ויסתמו את הפה שלהם עד שגל החום הזה יפסק! אם כרגע אין ירידה משמעותית בחום, אני לא רוצה לשמוע או לראות, לא את דני דויטש, לא את דני רופ ולא את המתבייצת הסדרתית - שרון וקסלר. מחר הכבדה בחום בחצוצרה הימנית שלך!
אתה מדליק מזגן, והמכונה המסכנה הזו כבר לא יכולה לספק לך אויר הרים צלול כיין, וכל הזמן רצה לך בראש המחשבה שחברת החשמל המסכנה שלנו בוכה על זה שהיא לא מוסגלת לספק את הצרכים של המדינה הזעירה הזו. אולי אם הם היו מפסיקים לשרוף פחם כמו קטר במהפכה התעשייתית, ולא מאירים כל גשר-כביש מצ'וקמק כאילו היה חזיון אור-קולי במצדה, היה לנו פחות אפקט חממה ויותר חשמל, נכון דירקטור וולט?!
ועל כל אלה בא המרענן הרישמי של הקיץ - צביקה הדר ונבחרת "כוכב נולד", שמנסה ללא הצלחה להעביר שיר אחד בלי לזייף, וכל זאת עם מודולציה צפויה כמוות לקראת סופו, בעיבודו הניצחי של האדם הבנאלי ביותר בסצנת המוסיקה הישראלית - עמוס בן-דוד.
ומי מאושרים, מי? הג'וקים. וודאי שהרי בשבילם זו יריית הפתיחה של חגיגות המעוף והנחיתה בדירות. הריצה הבהולה שלהם אל מקומות המסתור מהם יגיחו באישון לילה בכדי לטמא את המטבח שלכם. כל תחלואות הארץ, הרמשים והשקצים פורחים בלהט המחורבן הזה. אתה פותח את דלת הפח השכונתי, ומגלה שהפרעת לרייב פארטי מטורף של חמש-מאות תיקנים, בעוד שגל צחנת פחים מבושלים הודף אותך לרצפה.

די!
כמה אפשר?!
לא נותר אלא לצוטט את הצב החכם מכל אדם, הלא הוא בץ מ"פרפר נחמד", ששר בדכאון:

"קיץ, קיץ תיגמר
חורף חורף בוא מהר
חם מלמטה, חם מלמעלה
חם ביום וחם בלילה"

עד גל החום הבא,
סלאמת.

July 24, 2010

Why Browsers?

I've read it somewhere that if Karl Benz was asking people at the time what would they want in terms of mobility, they would probably say "a faster horses". Why horses? Because this is what the knew at the time.
Faster horses can be "created" if you somehow breed them and mess with their genes, but what Benz did was to create a different thing altogether - the car.
The reason I'm telling you this geeky story is because I feel we're kinda behaving like those people back in those days. "In what way?" you might ask. Let me elaborate.
Big companies are asking us what do we want in terms of Internet browsing. What would enhance our experience, what will make it richer. They are asking us all they can and we answer according to what we know and understand - we want a better, faster, more interactive… browser.
Lets add to the pot the whole HTML5 saga. You've probably asked yourself why is HTML5 appears to be the future of web technologies, right? No? ok, anyway, the main reason for people to believe that HTML5 will rule the future of the web is that it will make our browsing experience better, faster and more interactive and it will be a standard for all the… browsers.
Again, browsers.
Here is a thought - given that the browsers are the standard for web browsing today, do they all interpret JS the same way? CSS in the same way? HTML? The answer is no. so what kind of a standard is it?
The W3C is setting up the standard for the web but can't really enforce their standard to be fully respected with no differences among the browsers on the market. Cause eventually it all comes to whether your browser supports it or not. That's all.
But if we're putting HTML to the side for a sec, let me ask you this - don't you feel a bit caught in the past when writing an HTML tag? No really… I mean, Body tag again? Header? This must be extra painful for the Flashers/Flexers among you guys, don't you feel like going ten years back in time? Do you feel that writing ASP,JSP is writing in biblical glyphs?  Well, I do.
So we're coming to the question that hangs on the top of this post. Why browsers? Is that the way we should be consuming our web content in 2010? I may be naive but I don't think so.
I think that HTML on all it's variations had it's time and it is high time we moved into something that fits our web needs better.
I don't have the answers to what can be the "car" for us horse riders, but I feel that our horses don't do the job anymore. We need more speed, more interaction, more abilities, more.
HTML5 is a faster horse, but still - a horse. It is not the answer. As long as it relies on that same old engine, our web experiences will never go past and meet our needs, until the web Benz will come and create something that will blow our minds out into thinking - how the hell we didn't think of it until now?! I will even go as far as saying that having us depend on HTML is kind of having humanity depend on Oil. We all know that there are many far better alternatives out there but somehow, we chose (do we?) not to use them. I'm thinking to myself, maybe it's the same as in with the Oil, where global corporation prevent us from using a better solutions for their own reasons and interests. Luckily, the web is not as rigid as the global energy consortium, right?... I sure hope so.
Something to think about...

Cheers.

June 08, 2010

Is this the time for a security flop, Adobe?

Adobe just recently published that it found a critical (as Adobe claims) security issue regarding Flash Player and Acrobat reader and what can be a better time for this new findings, just after Steve Jobs claimed that Adobe's Flash is not secured enough in that long "mail" he wrote the world.
I mean… come on guys, I can't even find the right metaphor to describe how pathetic this whole matter makes you look like, Adobe. No really, if someone had asked me I would say the Jobs has people inside the Flash Player team, cause it sure feels like there couldn't be a more horrific timing than this.
I think that the people responsible for this security breach should be held responsible for making Adobe appear to the world as an amateur software company. Steve Jobs can now easily say "ha! Told ya!" and the man would be right.
I write these words with pain, guys. I love Adobe but I don't think the love will save the day here.
I know that this breach has workarounds, but let me tell you this Adobe - telling your customers to download a Beta version of the Player is unacceptable. Work day and night, eat, dream, breathe the solution for this matter as fast as humanly can, cause guys… you can't afford to shake the boat, now that the whole RIA world is examining you with a fine lens microscope.

Simply can't.

May 19, 2010

OT: English it is

As you might have noticed, the recent post were given in English, and English alone.
Once upon a time I wrote in Hebrew (my native language) only, and then I decided to translate the posts and have them in Hebrew and  English, cause it might be of assistance to English readers as well, but bringing myself to write both in Hebrew and in English on the same post (cause I can't quite rely on Google's translate) was getting harder and harder. I had this wonderful idea to write about, but when thinking about having to double-write it made me go: "oh well, maybe later".
It came to the point where I've written about my lingual pondering but I've recently decided to go for English.
I love writing in Hebrew and I think I do express myself better in my mother's tongue, but since this is a technical blog, I truly believe it will achieve it's goal better if written in English.
Hope this goes well with you guys.
Have a good one.

Cheers.

May 14, 2010

Adobe's loves freedom of choice. do you?

You've probably read it already, but if you didn't then please do.
This letter from Adobe came as a response to Steve Jobs letter about Flash and Adobe (if you haven't read it, then look it up yourselves :)).
I've decided to put it on my blog to get the idea through. Adobe's has always been a creator of tools for enabling one's inspirations. It's like getting a box of Lego where you can build whatever comes to mind using the building blocks handed to you. I don't think that Adobe thought for a second that Flash is going to replace HTML, I don't think they even directed it in that way. Even as you read, Adobe's evangelists are still giving presentations and demos on Mac machines…
Apple might be a great force in technology, but when you take this power and use it to forcibly lead users like cattle towards your technology, your simply cutting the branch you're sitting on, not to mention disrespect your customers - that means, you guys...
Think about it.

May 08, 2010

Oh boy - JavaScript and Flash really ARE on the same thread

Yeah, I know… this is something trivial that everyone knows, right? but I had to check it out.
The question I was presented with was: If I call a JavaScript function from Flash, will Flash UI keep on rendering or wait for a "response" from JS to continue?
The answer, as sad as it may be, is YES, it will stop rendering.

Here, check out the code below. It's a little test I did, where I have a button to launch an Alert from JS. I've also added a progress bar with it's indeterminate property set to "true" in order to see clearly if it stops, and there I have it. Once the Alert is up, the progress bar stops from rendering.
Hmmm… I don't like this. I don't like this at all.

Here is the Flex Application code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical">

<mx:Script>
<![CDATA[
private function onClick(event:MouseEvent):void {
if (ExternalInterface.available) {
ExternalInterface.call("showAlert");
}
}
]]>
</mx:Script>

<mx:Button
label="Show JS Alert"
click="onClick(event)"/>

<mx:ProgressBar indeterminate="true"/>
</mx:Application>

And here is what I've added to the HTML template:
function showAlert() {
alert("Flash UI stops from rendering!");
}

May 05, 2010

Those who don't know their history are bound to repeat it

It's no secret - I don't like what Steve Jobs is doing with this whole Flash on Apple mobiles, and to be honest, I don't like the guy at all. He always appeared to me so full of himself.  As a matter of a fact, I don't like anyone who impose their power upon others just because they can.  Jobs, for one who stood up against Microsoft when it used it's power to set standards in the computing market, is now appearing to do exactly the same.
As the articles pile up about Apple and Adobe, I found myself wondering into the past of Apple, and more precisely into the past of Mr. Jobs. I found the following YouTube short documentary, that I urge you to watch. But if you don't have the time to spare check out below to see what I see and gather from it:



1977 (1:50 in the movie) - The apple II computers are a huge success for Apple. 2 million units sold (back then it's an amazing figure) and it became the standard for computers around the world. Kind of like the iPhone, right? Yeah… I would say.

1981 (2:35 in the movie) - IBM enters the market, and present a competition for Apple and Jobs. Kind of like Google Android and Nexus One?

Later Jobs is putting his trust in Graphic User Interface. A new and innovative feature that was sure to change the way people are interacting with computers - Kind of like the touch screen interface, no?

(3:35 in the movie)  - Job's picks Pepsi's  executive John Scully to lead the Apple business.

1984 (4:00 in the movie) - Apple Macintosh is released. Affordable, but more expensive than the IBM's. customers loved the interface but the availability of software on the new platform was a critical issue. Many software companies preferred writing for IBM's - Kind of like preventing Adobe's Flash on iPhone and iPad and by that preventing a lot of applications from these platforms users, I would say. Could people prefer Google's and other vendors that do support Flash?

1985 (4:40 in the movie)  - Apples sales decline, due to lack of software availability on it. Hmm… interesting.

(4:58 in the movie)  - The market started to realize that maybe the Apple computer were more attractive than the IBM's, but the IBM computers support the things the market wanted to do - Need I say more?

(5:35 in the movie)  - Jobs blames John Scully for Apple failure. Sells all his shares and leaves the company - Sounds a bit childish to me, but hey… that's the guy.

Can history repeat itself? I will let you decide...
Cheers.

April 30, 2010

Loading classes to main application domain from a child SWF

Hi guys,
As part of loading applications in the form of SWF using SWFLoader as a child applications we sometimes encounter a scenario where we need to load classes to the main application domain , in order for all the SWFs to use the same class definitions between them. The thing is, we don't our "shell" application to know all the classes of it's potential children, so we thrive on getting the child application to load their class to the main application domain.
Possible? Well, yeah :).
Here is a code snippet to show you how. The idea is to have a SWF that has the classes declared on it, and load it from the child application, when defining the application domain of the loader context to be the main application domain. How do we get the reference to the main application domain? Easily:

var loader:SWFLoader new SWFLoader();
var context:LoaderContext = new LoaderContext();
context.applicationDomain = systemManager.topLevelSystemManager.loaderInfo.applicationDomain;
loader.loaderContext = context;
loader.source = "your-classes-swf-path";

The code is pretty basic to understad (but let me know if something isn't clear).
Enjoy your weekend.

April 25, 2010

Flash & Flex Israel Convention on Apr 25, 2010

מזה כחודש ימים המייל שלי לא מפסיק להקיא מיילים מאחד, שמו אלמוג קורן, לגבי כנס פלקס שנרשמתי אליו משכבר. בתחילה זה היה "לא יודעים איפה זה יהיה", אח"כ זה היה "תאשרו שוב"... ואז "תדפיסו את הכרטיס", ו"לא, רגע, עכשיו תדפיסו את הכרטיס", ו"מה זה השם הזה Flashmattic, צריכים את השם המלא", ומי ומה ומו... ויא אללא, בואו נרגע, שהרי זה כנס פלקסיסטים לא ועידת וונזה, ימח שמם הגויים.
בסופו של דבר, נסגר שהכנס יתקיים במתחם Yes Planet של קניון אילון, משעה 10:00 עד שעה 16:30.
10:00 בובקר זה עוד סביר בהחלט, אבל פקקים של ר"ג זה משהו שצריך לשבת עליו מדיטציה במנזר שאולין. אין ספק שלעבור לאט לאט דרך רחוב המוסכים התוחם את הקניון גרם לי ללטף קלות את הגה מכוניתי, ולרעוד נוכח הפלאשבקים מטיפולי הרכב של העבר.
לאחר שעברתי בידוק שלא היה מבייש את משמר הכנסת (ראבק, זה לפטופ, לפטופ!) הייתי די אבוד באשר לאן פניי, אבל חוש הנווט החד של עבדכם הנאמן גרם לי לזהות את החנון הראשון נושא הלפטופ ולעקוב אחריו, היישר אל מתחם הקולנוע.
מתחם קולנוע, ובייחוד זה בו נערך הכנס, הוא ללא ספק אחד המקומות המועדפים לערוך בהם כנסים. האווירה החגיגית משהו עם כל מודעות הסרטים (ופוסטרים של נותני החסות, והיו כאלו, ולא מעט), הצבעים החזקים, השולחנות למינגלינג והשאר, פשוט מעלים את איכות האירוע בכמה רמות. הארגון נראה מקצועי לחלוטין בכל הקשור לעמדות שתייה קלה, קפה ותופינים.
ניגשתי לקבלה ומיד קיבלתי את חבילת ה"עט, מדבקה ופנקס" עם תג שנשא את השם Flashmattic Flashmattic מחברת... Flashmattic. וזאת אחרי המיילים ששלחתי עם שמי המלא. גם כן, בירוקרטיה.
המקום החל מתמלא ונראה היה שיש בסביבות ה- 100 פלוס איש, שזה מספר נאה לכל הדעות. אחרי מעט קפה, ודיבורים קלים, כוונו אל עבר אולם הקולנוע להשקת האירוע.
אגב, באולמי קולנוע אין WiFi שזו מגבלה שממש לא מתאימה לאירועים מהסוג הזה. אנשים רוצים לכתוב לבלוג ולהמשיך לקבל מיילים (שהרי זו שעת עבודה לכל דבר), אנשים (משועממים) רוצים לצייץ בטוויטר שלהם לגבי טעם הקפה או הנפיחה האחרונה שלהם ולא יכולים. זה פשוט לא לעניין... לאחר שהתישבנו לנו בניחותא, האירוע יכול היה להתחיל:
תחילה עלה אלמוג קורן, שהוא מנהל הקבוצה של Flash & Flex Israel (מתחרים של פלאשו? לא... קנאת סופרים תרבה חכמה, ומעבר לכך, אין לפלאשו מתחרים, אבל יש לה שני לינקים :)). אלמוג הציג את האג'נדה של היום וכמובן את הדוברים: מיכאי קורלן (עליו כבר כתבתי), הלל קורן ופיטר אלסט. הדס, מנכ"ל קוויקסופט, שהם הנציגים של אדובי בארץ וגם נותני החסות לאירוע, עלתה לשאת דברים מטעם החברה. קוויקסופט מתפארים בכך שהם מעלים כנסים והרצאות ומספקים את נקודת התיווך הטובה ביותר בין המפתחים בארץ לאדובי, אך לצערי מה שקורה בפועל לא כל כך זוהר. מנסיוני, מעט מאד מפתחי פלאש ופלקס מכירים את השם קוויקסופט ופחות עושים את הקישור בין החברה לאדובי וחבל. קוויקסופט צריכה לשאוף לכך ששמה יקשר קשר אדוק עם שם אדובי. המגמה הנוכחית של תמיכה בכנסים רק מקדמת את העניין, צריך עוד והרבה. הדס רמזה על כנס גדול שיערך בהאנגר 11 בעתיד הלא רחוק עם שיתוף פעולה מצד אדובי. יאללא בכיף.
נותני החסות לא חוסכים שבטם, וכך מגיעים got friends? לפודיום ומודיעים שהם כבר תפסו כמעט את כל מי שמתעסק בפלאש/פלקס ועכשיו הם מוכנים ליישב אותם מחדש (נכון שהבנתם? ברור). מיד אחרי עולה אמיר לביא מנכ"ל sortfix, ומספר בהתלהבות של גלולת וואבן- פורטה על המוצר שלהם. שתי המלצות חמות אמיר: לא צריך פאורפוינט סלייד לכל מילה ושנית, אם אומרים "אני מתרגש" (וכמובן שזה כתוב גם במצגת) כדאי לומר זאת בטון שהוא מעט יותר עליץ מזה של טקס יזכור בית ספרי (ואני עדין פה, האמן לי).
אחרי אמיר עלה נדב אברהמוב, ממקימיי WIX, והציג שוב את המוצר המוכר והטוב שלהם. כל הכבוד לחבר'ה הללו. שאפו. ויאללא לדיבורים...
מיכאי דיבר על דיבוג בפלאש בילדר 4, ובעיקר התרכז ב-PHP שלא ממש מעניין את עבדכם הנאמן, וגם היה נראה שלא את הסובבים אותו. כאשר הוא שאל מדוע חלק מהקהל לא עבר לפלקס 4, הוא לא ממש חיכה לתשובות. ואז עוד PHP ועוד דיבאגינג ועוד ועוד... מעט משעמם, כשאני שם לב שהמכונה שלי מצביעה על 13 דק' שנותרו לה לחיות. טוב טוב, אני אשתמש בפנקס הנהדר שחילקו לנו.
שלב השאלות עבור מיכאי הוא כרגיל המעניין ביותר, למשל אפשר לגלות שבגרסת הפרימיום של הבילדר ניתן להתקין אותו על השרת בו מתנהל הבילד של המוצר שלך, ואז להריץ את הבילד של פלקס עליו כחלק מה- integration build. נחמד. שאלתי את מיכאי אם יש עוד קומפוננטות העומדות בתור להיות מומרות ל- SPARK והוא אמר שכרגע עובדים על DataGrid ו- Tree. מצויין, עדיף מאוחר מאף פעם לא.
הפסקה קצרה ותורו של הלל קורן הגיע. הלל קורן הוא בחור אמריקאי חובש כיפה שפשוט עשה את כל הכנס הזה לשווה. משטף הדיבור, ניהול המצגת, ההסברים והדוגמאות מבחינים שהלל הוא מקצוען אמיתי. בלי זחיחות מיותרת שלא במקומה, עם פוקוס על הנושא הלל הצליח להעביר בפחות משעה את עיקרי הפיתוח בפלקס, את הרעיונות מאחורי באזים שרצים ברשת באשר מתודולוגיות ופריימוורקים, מה כדאי ומה לא, איפה נופלים איפה צריך להזהר. הנסיון של הלל מדבר מגרונו וכנראה זו הסיבה שהוא זכה לתשואות כשסיים. ולא יעזור, כשאתה רואה אפליקציה כמו קניית מילים בספר התורה (שכרגע אני לא מוצא את הלינק שלה), זה עושה משהו לנפש יהודי, לא?
הפסקת צהריים קלה ונזרקנו כמו סטארטאפיסטים אל עבר פיצות קרירות אבל אין על תחושת הנוסטלגיה. בלי שום קשר, שאפו שוב, בלי שמץ של ציניות, על אירגון האוכל לאירוע. מאד מתחשב ונכון לעשות. אך שום דבר לא יכל לרכך עבורינו את הבאות...
עכשיו על הבמה נמצא מארגן האירוע והבנאדם שעומד מאחורי כל ההפקה, אלמוג קורן, ושוב אני מציין - כל הכבוד, אלמוג, אבל...
אלמוג הבהיר לנו כמה וכמה (וכמה) פעמים שהוא זה עתה הגיע לישראל (מזה כמה שנים אבל מי סופר?) ושהוא בכלל בא מאמריקה וליתר דיוק לוס אנג'לס, אבל בכדי רק לחדד את העניין נשאלה השאלה האם אנחנו רוצים שההרצאה תתנהל בעברית או בשפת-אמו (כך מסתמן לפחות) הלא היא האנגלית. מפאת הנימוס הצבענו אנגלית. מעט ידענו לאיזו קונגיאדה פינת תעלת בלאומיך הצבעה זו תביא. אלמוג מדבר מהר. אלמוג מדבר מהר מאד ולא ברור, וכל זאת בעברית. כשעוברים לאנגלית זה פשוט טרטור הגובל בבנייה במזרח ירושלים. באמת, אני לא בעניין להכנס בו סתם ולחינם, אבל זה היה פשוט בלתי נסבל בעליל, אלמוג. אי אפשר, באמת אי אפשר לסיים כל משפט ב and what not. לצערי גם התוכן היה לוקה בחסר. חלק ניכר מהמצגת הועבר על פועלו של הנ"ל וחרג מגבול הטעם הטוב.רובנו גם מכירים את AIR ובטח לא צריכים שיראו לנו עוד ועוד אפליקציות בטכנולוגיה. שיווענו להפסקה, ירדנו על ברכנו וזעקנו שתחדל החריקה הנוראית הזו על לוח המורה ובסוף זה נגמר.
עכשיו עלה פיטר אלסט. את השם פיטר אלסט אני מכיר עוד מתקופת הפלאש המוקדמת. הבנאדם היה תמיד בחוד החנית של הפיתוח ולכן ההרצאה שלו נראתה כאחת שאסור לוותר עליה. פיטר סיפק את הסחורה ודיבר בעיקר על הפיצ'רים הקיימים והחדשים של AIR. הרצאה ממוקדת עם דוגמאות קוד פשוטות שמבהירות את הנושא. הקטע עם ה network monitoring מגניב. אמנם היה נראה שאין לו ממש קשר עם הקהל, אך אולי זה נובע מנסיון רב שיש לבחור באירועים מהסוג הזה בהם הוא לא נותן לקהל להסיט אותו מהנושא. חדי העין גם הבחינו שאדון אלסט פתח לפנינו את פוטושופ CS5 וכנראה זו הפעם הראשונה שענינו נחות על הגרסה (אני לפחות).
וזהו... מספיק לא?
לא, אז יש הגרלות וחבר'ה קיבלו ספרים וחולצות ורשיון לפלקס וזה תמיד קטע נחמד וטוב. יאללא הביתה, עם כאב ראש קל, עט חדשה והשראה משהו.
אם לסכם, אני חושב שכל מפגש שכזה הוא מבורך וכן ירבו עוד שכמותו. מה שכן, חייבים איכשהו לשמור על המפגשים הללו מלהפוך לבמת חסויות דורסת. אישית, אני אשמח לתכנים מעט יותר מעמיקים, בהם נוכל להכנס קצת לקוד ואמפלמנטציות. הבאת "אמנים" אורחים מחו"ל זה אקט מבורך וככל שהם יותר קרובים לאדובי כן ייטב. למי שאין מה לומר, בבקשה שלא יעשה את זה על הזמן שלי.
שוב, כל הכבוד ל Flex & Flash Israel על האירגון המשובח ובעיקר לאלמוג, שנראה כמו שנתן מספר ימים כלילות בעבודה.
יאללא, חפרתי די והותר...
And what not.
:)

April 23, 2010

OT: כנס פלאשו להכרזת פלאש בילד 4

אהלן אהלן,
אתמול התנהל כנס פלאשו לטובת ההכרזה על פלאש בילדר 4 וחברים. המיקום - בפארק הירקון ליד הגולפיטק (מודה, פעם ראשונה שאני שומע על המקום, ואולי בגלל שאני לא מבין את המשחק האנמי הזה). התוכנית - שתי הרצאות, אחת של מיכאי קורלן מרומניה, שהוא פלאש-פלטפורם אוונג'ליסט (אנחנו עוד נגיע למינוח הזה...) והשני הוא ליאור ברודר מטעם אינטרביט, שהוא מפתח פלקס ותיק, VP משהו ועוד כמה ראשי תיבות שאיבדתי על הדרך.
בכל מקרה, ההגעה לשם כנראה היתלה בהרבה מהמשתתפים, שמשום מה חשבו שמדובר ביריד הכנסים. מבחינתי, כל האיזור הזה, של שד' רוקח, זו חתיכת חידה מתמטית שלא מעניינת אדם, איכשהו אני תמיד מגיע לאותו הפתרון של יריד הכנסים או איך שלא קוראים למקום. אני בטוח שרוקח מתהפך בקברו.
בירות זה טוב, וכך התחיל לו הכנס, עם בירה וסיגריה ואיזה תצלום חפוז באפליקציית פלקס (איך לא? בעצם... איך כן, לעזאזל?). ומשם התמנגלות עם אנשים מעניינים מהתחום, ואני מוכרח לציין שהאירועים הללו הם קרקע פורייה לשיווק רעיונות, גיוס מוחות חדשים, חשיפה לרעיונות וטכנולוגיות חדשות ובכלל... תקראו לזה צלוחית-פטרי של חיידקי חנאנות פלאשיסטים. סבבה.
מיד אחרי התבחבשות בסביבת הפלייר נכנסנו להרצאה הראשונה של מיכאי קורלן, הלא הוא הפלקס אוונג'ליסט. רבים (כולל עבדכם הנאמן) לא ממש סגורים על הגדרת התפקיד "אוונג'ליסט". שכן לי זה תמיד מתחבר לאמנות בכלל, ולמרות שחלק (קטן והזוי) בקהילת המפתחים רואה בקידוד אמנות רנסנסית משהו, אני לא מוצא ולא רוצה למצוא את הקשר בין השניים. בכל אופן, היינו באוונג'ליסט, ומסתבר שזהו אדם שתפקידו הוא לתור בעולם ולהפיץ את המחלה. חלק יקראו לזה מסיונר של אדובי. אני אפילו מואשם על בסיס יומי בכך, אבל אני מאמין שמסיונר תפס, אפעס, קונוטציה שלילית ולכן הא לכם האוונג'ליסט. מעבר לדברים אלו, זהו ג'וב שזורק אותך לכל מיני פינות בעולם בכדי להעביר מצגות שנכתבו מראש, עם דוגמאות שנכתבו בד"כ ע"י אחרים, וכל זאת עבור קהל שממילא מאמין במה שאתה אומר. מטיף למקהלה? אכן. בורדל של ג'וב? בהחלט.
מיכאי החל לדבר על הפיצ'רים החדשים של פלאש בילדר 4, שעבור כל מי שמתעניין בנושא, נטחנו דק מזה כבר כמה חודשים. אני לא אומר שהדברים לא היו מעניינים, ואני מניח שלחלק אף היו חדשים, אבל הערך האמיתי היה לדבר עם אדם המקורב לעניינים באדובי. מה שכן, כאשר נשאל שאלות נוקבות לגבי מהירות קומפילצייה, מימוש מולטי-ת'רדינג, workflow של פלאש קטאליסט ופלאש בילדר, הוא מעט נחנק ונתן תשובות מאד דיפלומטיות. "אנחנו לא הבטחנו" זו תשובה שלא נעים לקבל בשום מצב. אם אדובי עובדים על שיפור העבודה בין מעצבים למפתחים, יש שם חור אדיר בהעברת FXG מפלאש בילדר חזרה לקאטליסט. זה פשוט לא עובד. זה חור קריטי בפונקציונאליות, שגורם לפתרון הזה להיות חלקי ולא מספק. תשובה כמו "לא הבטחנו" הייתה גורמת לי לפטר אנשים. מאוחר יותר תפסתי אותו ושאלתי אותו "למה להשתמש בפלאש בילדר אם יש IntelliJ בשטח?", הוא לא ידע לענות לי. מבחינתו, בתור מפתח Java לשעבר, הוא הנהן בראשו והסכים ש IntelliJ פשוט לא רואה את הבילדר ממטר ובתנאי ראות אופטימאליים. גם כן אוונג'ליזם.
הפסקה קצרה, עוד סיגריה, עוד דיבורים ויאללא להרצאה הבאה של ליאור ברודר.
כשהוצג בתחילה, זהר בבין (ממנהלי פלאשו וממארגני המפגש) סיפר על כך שליאור הוא הפיגורה הכי מקצועית בפלקס בארץ, וקיבל הנהון הסכמה מליאור בחזרה. וזה בהחלט מישהו ששווה לחכות למוצא פיו, שכן אין הרבה מומחי פלקס בארצנו הקטנה (האמינו לי). ההרצאה הייתה אמורה להיות עוד התפרצות לדלת פתוחה, בה ידובר על מדוע כדאי לעבור פלקס 4, ולבילדר החדש.
בפועל, ליאור דיבר על good practices עבור פרוייקט ואיך פלקס 4 תורם לכך... בערך. האמת, ששום דבר חדש לא נאמר שם. בין קאטצ' פרייזז של יועץ מחד לבין "בחברה שלנו עושים..." מאידך התוכן היה רדוד למדי, ולפרקים משעמם. לא הייתה נגיעה בפיתוח עבור Enterprise (שלעניות דעתי, זהו השוק הגדול והרציני של פלקס), לא היו דוגמאות קוד להבהרת רעיונות והיה נראה כאילו הבשורה הגדולה של פלקס 4 היא התמיכה ב L10N טוב יותר וזהו. מקולות ולחשושים סביבי היה נשמע כאילו הרצאה הייתה מיותרת, וחבל שהזמן הזה לא נוצל לעוד Q&A מול מיכאי. תוסיפו על כך שזה מגיע מהפיגורה המקצועית ביותר שיש היום בארץ ותקבלו גל אכזבה בואכה צונאמי.
ואז הוגרלו הפרסים שזו מסורת פלאשואית נושנה וטובה ויאללא הביתה. מיכאי שהביע רצון עז ללגימת בירה לאורך כל ההרצאה שלו, רצה, באופן מפתיע, ללכת ולשתות....בירה. אז יצאנו כמה חבר'ה מאוחר יותר, לבאר באיזור והמשכנו לדבר כמו חבורת חנאנות. היה נחמד מאד. באיזשהו שלב, מיכאי יצא לעשן סיגר בחוץ (כי כנראה זה מה שמעשנים אוונג'...? ליסטים, נכון), כנראה מפני שהעדיף לחנוק עצמו למוות מאשר לשמוע עוד מילה על פלאש.
All in all, היה אירוע מוצלח ביותר מבחינת האירגון. אינטרביט, שנתנו חסות לכל העניין, עשו זאת באופן מכובד ביותר, עם פרסומות גלויות אבל מעודנות משהו. כן ירבו עוד אירועים מהסוג הזה.
וכן, יש אירוע גם ביום ראשון, נראה מה יהיה שם...
סופ"ש רגוע ואוונג'ליסטי.

March 19, 2010

FlexPMD on Maven

Scroll down for English translation...

מכירים PMD? לא?!
לקצר את ההסבר, זהו כלי מצויין לווריפיקציה של קוד, כלומר, עובר על הקוד שלנו ומוצא בו הפרות של קונבנציות וכיו"ב לפי סט של חוקים שאותם אפילו ניתן להגדיר בצורה קאסטומאלית.
מצויין, אז יש את PMD, ויותר מכך, יש PMD עבור פלקס, שעובר על הקוד שלנו ומוצא לנו את המפתח הסורר שהכניס שטויות לקוד שאח"כ כולנו נשלם על כך. זה גם אחלא כלי ללמוד ממנו קונבנציות קוד ו- good practices.
יש 3 דרכים עיקריות להפעיל את flexPMD - ע"י CMD, ע"י ANT וע"י MAVEN (אני בכוונה מתעלם מהדרך ה MACית בשלב הזה). אני רוצה להתרכז באחרון.
בשביל להכלול את הדו"ח של PMD, אנחנו צריכים להוסיף חלק קוד קטן ל POM שלנו. בצורה שאדובי ממליצים עליה, הדו"ח יווצר בשלב של ה reporting, שקורה כשבונים את ה site בעזרת מייבן (mvn site). זה לא ממש עוזר לי, כי אני מעניין שהיצירה של הדו"ח תעשה בזמן הווריפיקציה של מייבן (אתם יכולים לקרא פה על "שלבי החיים" של מייבן). בכדי לעשות את זה, אני הוספתי את הפלאגין של מייבן כך - תגללו מטה ותראו את Code 1.

אחלא. אז יש לנו יצירה של PMD, לתוך ספריית target/pmd.
את ה PMD הזה אנחנו יכולים לראות באחד ה viewers המוצעים, אחד מהם של אדובי. זה די טוב, ברם הייתי רוצה שהבילד שלי יכשל קליל ברגע שיש הפרה של PMD, ולכן הוספתי בקונפיגורציה של הפלאגין את השורות הבאות - תגללו מטה ותראו את Code 2.

מה שזה עושה הוא, שברגע שיש הפרה הכי מינימאלית, תעיף את הבילד. אבל, אליה וקוץ בה. הפלאגין של אדובי לא ממש מכבד את הקונפיגורציה הזו, אז סאחבק פתח באג (שוב, איזה גלעד ארדן אני, הא?), ממש פה, ובאופן מפתיע כבר עובדים על תיקונו ועוד מעט אני אדע בדיוק באיזו גרסה התיקון נעשה.
זה הכל להפעם, אנשים. מקווה שתשכילו להשתמש בכלי הנהדר הזה ו... סופ"ש נעים.

Do you know PMD? You don't?
To make a story short, it's an excellent tool for varifing code, which means that it goes over our code and finds conventions violations according to a set of rules which you can even be custom defined.
So great! We have PMD and even better, we have FlexPMD that goes through our code and finds the remains of a misfit developer that we're all going to pay on later. It's also a great tool to learn code conventions and good practices.
There are 3 main ways to invoke flexPMD - command line, Ant and Maven (I'm not mentioning the Mac way on purpose). I would like to talk about the later.
In order to include reporting for PMD we need to add a bit of code to our POM file. In the manner that Adobe suggests, the report will be generated in the reporting phase, which occurs when building the Maven site (mvn site). This doesn't really help me, cause I want the report will be generated on the "verify" phase of Maven life cycle (you can read about Maven's life cycle here). In order to do that I've added the Maven plug-in like so - Scroll down to see Code 1.

Good. So now we have PMD report generation into the target/pmd directory. We can view this report in one of the offered PMD viewers. You can check out the one offered by Adobe.
It's pretty good, but I eould like my build to fail on violating the rule set of PMD, therefore I've added these following line to the plug in configuration - Scroll down to see Code 2.

What it does is, that when there is a minimum violation of PMD rules, Maven should fail the build, but unfortunately Adobe's plug-in does not respect this code, so I've opened a bug (yet another one...) right here, and supprisingly enough they started working on it and soon we shall now in what version the fix resides.
That's all for now. Hope this tool will help you write better code and… have a good one.

Cheers.

Code 1

<build>
...
<plugins>
...
<plugin>
<groupId>com.adobe.ac</groupId>
<artifactId>flex-pmd-maven-plugin</artifactId>
<version>1.0.RC5</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<outputDirectory>${basedir}/target/pmd</outputDirectory>
</configuration>
</plugin>
...
</plugins>
...
</build>



Code 2

<failOnViolation>true</failOnViolation>
<failurePriority>0</failurePriority>
<verbose>true</verbose>

March 06, 2010

Flex SDK 4.0.0.13875 bug on Flash Builder

Scroll down for English translation...

באגים, באגים, באגים...
טוב, נו, האמת שלא כל כך הרבה אבל הנה אחד שממש עצבן.
אני בונה פרוייקט בפלאש בילדר 4, ומשתמש בגרסת ה-SDK היציבה האחרונה שיש: 4.0.0.13875 .
מסתבר שכאשר אתה מנסה לעשות אימפורט ל MouseEvent למשל, פלקס אומר שהוא לא מכיר את החיה הזו בכלל. חפירה קצרה הביאה אותי להבנה שהתוכן של Playerglobal.swc לא נכלל ב- lib path של הפרוייקט. כמה מתסכל, הא?
בכל אופן, פתחתי באג ב Jira של פלקס ואשמח אם תצביעו עבורו, ואם אתם נתקלים בבעיה הזו, פשוט תייבאו את ה SWC לבד מספריית ה SDK. זה פותר את הבעיה.
שבוע טוב!


Bugs, bugs, bugs…
Well, not that many, really, but here is one that really pissed me of. You see, I'm building a project using the Flash Builder 4, and I use the last stable release of the SDK for it: 4.0.0.13875.
It appears that when you try to import the MouseEvent class for instance Flex tells you that it doesn't know it at all. A little digging helped me understand that the content of the flashplayer.swc is missing from the project lib path. How frustrating, right?
Anyhow, I've opened a bug on flex's Jira and I will be happy if you vote for it, but in the meantime, if you encounter this problem all you need to do is to import the playerglobal.swc yourselves from the SDK directory.
Have a good on!

February 06, 2010

A skin for each button icon in Spark!?

Scroll down for English translation...
אהלן, מה קורה?
האמת שהיה לא רע כל כך, עד שנתקלתי בעובדה פלקסאית חדשה שמעט ערערה אותי.
אתם מבינים, אני לאחרונה חופר מעט ב-Spark, בקטע של "need to know basis". מה שאני צריך אני בודק, בלי לפתוח אתר ארכיאולוגי. ת'כלס עניין אותי הכפתור החדש, מה קוראים אותו s:Button.
העובדה הראשונה שמטרידה את עבדכם הנאמן היא העלמות הפתע של המאפיין הנחמד icon. כמה קל זה היה להצמיד אייקון לכפתור? בלי בעיות ובלי נעליים, שים את האייקון על הטאג וסגור עניין. אז זהו, שלא עוד. אז מה עושים?
או! מכיוון שהכל ב- SDK 4 הוא מכוון Skins and Styles, מהנדסי אדובי החליטו שגם את האייקון ל Button החביב יגדירו ב Skin. על פניו, החלטה נכונה, הגיונית ויושבת טוב עם כל האינטגרציה שהם עושים עם Catalyst, אמה-מה? זה אומר שלכל כפתור שאני רוצה לתת בו אייקון, אני צריך לבנות Skin.
שמעתי נכון? לכתוב סקין לכל כפתור שרוצה אייקון? זה אבסורד. תחשבו, שכאשר תבואו לשדרג את ה SDK של הפרוייקט הקרוב לביתכם, כל כפתור נושא אייקון, יצטרך עכשיו סקין אישי. לפני שנאמר דבר בנושא, ולפני התחכמויות - גרוע.
אז לא. באים המתחכמים ואומרים, עשה לך Class אשר יורש מ- Button, ופתח API להגדרת האייקון שנמצא עליו. במילים פשוטות - תכתוב את ה Button הישן של mx, רק עם המאמבו-ג'אמבו של Spark.
שוב, שמעתי נכון? למה?! אני מבין את הרעיון לאפשר את הגמישות הזו, אבל מה המחיר, אדובי? כבר עכשיו צצות להן כל מיני קומפוננטות שמרחיבות את Button, שכל יעודן הוא לאפשר הצגת אייקון על כפתור. אתם יכולים לדמיין לעצמכם את האנדרלמוסיה הגרסאתית שנוצרת פה? איך קומפוננטה כל כך בסיסית הופכת למשהו שהוא קאסטומאלי ולא חלק מהפריימוורק של פלקס?
הגמישות פה אכן משחקת תפקיד מפתח, כי אם בעבר אייקון על כפתור נראה ומוקם בצורה מאד מסויימת, היום אין קץ ליצירתיות, אבל לדעתי היום צריכים לשמר את הפונקציונאליות הבסיסית כחלק מהקומפוננטה.
אני לא יודע כמה מכם כבר נחשפו לעניין, אבל בתור מפתח פלקס (ותיק, אם יורשה לי) אני מוצא את הרעיון כ- overhead רציני, ועוד נקודה טובה עבור המקטרגים על פלקס. משהו שאני עוד צריך ללעוס, אבל בינתיים, סאחבק לא מרוצה.
סופ"ש רגוע שיהיה...

Hey, How's it going?
To be honest, I wasn't that bad until I bumped into a Flex fact which shook be a little bit.
You see, I'm lately lightly digging in Spark, in the "need to know basis". What I need I check out, with out opening an archeological site over it. Bottom line, I was interested in the new Button offered by Spark, what you call s:Button.
The first fact that disturbs me is the sudden disappearance of the "icon" property on the Button. How easy was it to just place an icon on a button, right? No trouble there mate, put it on the tag and there you go. So that's it for that. No more. So what do we do?
Right! Since everything in the new Flex SDK 4 is Style and Skin oriented, Adobe engineers decided that the button icon should be defined in a skin. On the surface it looks like the right thing to do, that sits well with all the Catalyst integration, BUT is means that for each button with an icon I need to create a custom skin.
Did I hear right? Write a skin for each button that needs an icon? This is absurdity. Think, when you come to upgrade your nearby project, every button that has an icon on it will need a new skin now. Before anything is said - this is bad.
So wait! No. Developers come and say "hey! Make yourself a Class that inherits Button and enable and API to define the icon that is on it". In other words - write the same old mx:Button only with the Spark component definitions.
Again, did I hear right? Why?! I understand the idea of enabling this flexibility to the components, but for what cost. Adobe? Even as we speak, extended component are emerging , that extend the Button component, destined to enable the displaying an Icon on the button easily. Can you imagine the version mess that is being created? How come that such a very basic component is something that is custom made and not part of the framework?
Flexibility does play a key roll here, cause if in the past the icon on the button would be place in a certain manner, today you can really go far with what can be done, but in my opinion, the basic functionality should have been kept as part of the component.
I don't know how many of you were exposed to this matter, but as a Flex developer (senior, if I may) I find the idea as a major overhead, and yet another good point for all of these that talk trash about Flex out there.
This is something I still need to chew on, but in the meantime - yours truly is not happy at all.
Have a good on...


January 08, 2010

Flashmatticomponents - now also at RIAForge

Scroll down for English translation...

מה המצב?
הודעה ממש קצרצרה - לפני מספר ימים העלתי פרסום של Flashmatticomponents לאתר האירוח RIAForge.
בלי שום קשר, האתר הזה הוא אחלא מקום למצוא פרוייקטים של Open Source בכל מה שקשור ל RIA ובעיקר לפלקס.
אתם יכולים לקפוץ לביקור.
בינתיים אני יכול לספר לכם שעד כה היו קרוב ל 50 הורדות של הספרייה שיצרתי. בינתיים, אף אחד לא מצא לנכון להעיר על התוכן (אם מחוסר עניין או אולי מחוסר באגים.... לאאאעע... לא יכול להיות), ככה שאני מבסוט :).
מקווה שאמצא זמן לעדכן בשאר הדברים שעוברים לי תחת היד.
סופ"ש רגוע

How's it going?
A really short message here - a several days ago I published my Flashmatticomponents project over the RIAForge hosting site.
Regardless, this site is a great place to find Open Source project related to RIA and especially Flex. You can check it out for yourselves.
In the meanwhile, I can share with you that the are approximately 50 downloads of the Library I've created and so far nobody commented about the content (whether they didn't find it interesting or may it's because there aren't any bugs… nhaaaa… can't be), so I'm happy :).
Hope I'll find the time to update you with the other stuff I'm working on.
Have a good one!
Cheers.

November 11, 2009

Add support to informative steps for the Flashmatticomponents Wizard

Scroll down for English translation...

טוב, זה יהיה קצרצר.
הוספתי לאחרונה, ל- Wizard Framework, את התמיכה בצעדים שכל תכליתם היא אינפורמטיבית.מה הכוונה? הכוונה היא שיש צעדים שלא אמורים להכלל בסיכום, בסופו של ה- Wizard. כל יעודם הוא להיות איזה Disclaimer או אולי המלצה מסויימת. מה שקורה בפועל הוא, שברגע שאין לאותו צעד data שהוא אמור לייצג, הוא פשוט לא נכלל בסיכום של ה- Wizard.
את קוד הפרוייקט החדש אתם יכולים להוריד מפה.
שימו לב שההורדה הישירה של ה- SWC גם עודכנה, אבל כרגיל, אני ממליץ להוריד את הקוד ולקמפל לבד.
תבלו.


Ok, this will be a quick one.
I recently added, to the Wizard Framework, the support for informative steps. What do I mean by that? I mean that there are steps that are not supposed to be included in the Wizard Summary. Their all purpose is to be some kind of a Disclaimer or some kind of a recommendation. What happens is that when these steps don't have a data representation, they will simply won't be included in the summary step.
You can download the project code from here.
Please note that the direct download of the SWC file was also updated, but as always, I recommend downloading the code and compiling it yourself.
Take care.

October 15, 2009

A Single Thread that can kill Flash

Scroll down for English translation...

זו רטינה.
אמנם לא חסרת תכלית, אך אם באתם בתקווה למצא פתרון, אני מצטער לאכזב אתכם הפעם.
מאד דרמתי מצידי, אבל אני חושב שזה מן ההכרח להצביע על המלך הנודיסט הוותיק - הרי הוא הת'רד היחיד של פלאש.
העובדה שפלאש יודעת לנהל רק ת'רד אחד בניגוד לסביבות ריצה אחרות (.NET, Java וכיו"ב) תמיד הייתה שם ברקע, אך מעולם לא נתפסה כטיעון מהותי נגד הטכנולוגיה. יש הטוענים שאם אתה מתכנת לפלאש פלייר ומצאת עצמך מנסה לנהל ת'רדים, אתה כנראה עושה משהו לא נכון. הוסיפו על כך את העובדה שבכדי לנהל ת'רדים, ה-VM של פלאש אמור לגדול בנפח, וקיבלתם את השיקול העסקי של אדובה לא לגעת בבייבי שלהם.
ברם, RIA, ומעבר לכך - AIR.

מה הבעיה ש'ך?
קחו את התרחיש הבא, בו אפליקציה כלשהי אמורה להשתמש ביכולות גישה ל- File System, ולעשות איזו איטרציה מסויימת על קבצי מערכת, משהו סטייל "ספר לי מה יש שם". תרחיש שיכול להיות בן-בית אהוב באפליקציות AIR, למשל, לא? עכשיו, בכדי שהלקוח שלנו יהיה מרוצה, אנחנו רוצים גם לתת לו חווית משתמש טובה (כי אנחנו מאמינים שאפליקצייה טובה לא נגמרת בארכיטקטורה פונקציונאלית), שתעזור לו להבין שמשהו קורה. progress bar נשמע כמו רעיון מבטיח.
אתם כבר מזהים את הבעיתיות? הרי יש לנו לולאה רקורסיבית שלא עושה הרבה בתוכה, אבל עדיין יכולה לרוץ פוטנציאלית פעמים רבות, מה שייתקע את הת'רד היחיד של פלאש, ושיגרום לכך שדבר, אבל דבר(!) לא יזוז על המסך והפלייר יתקע כמו אוטוביינקי בקסטל. אנחנו נחלוק מזל גדול אם ה- Progress Bar יעלה בכלל לתצוגה.

מכעיס?
עכשיו תגידו לי, האם הת'רד הגלמוד הזה הוא משהו שאדובה צריכים לשים בראש סדר העדיפויות שלהם במירוץ אל עבר כיבוש פסגת האפליקציות רשת העשירות ואפליקציות הדסקטופ? ברור שכן!
זה נחמד מאד שהפלייר הוא קטן, וזה מאד התאים לאתרים ברשת, אבל הזמנים משתנים ואי אפשר לקפוא על השמרים עם הטיעון של "הפלייר שלנו קטן", בייחוד שהמתחרים תומכים גם תומכים בת'רדים מרובים.
אדובי סמכו ועדיין סומכים על קהילת המפתחים האוונג'ליסטית שלהם, שעמלה ימים כלילות במציאת workarounds לכל מיני הגבלות של הפלייר (עברית, מישהו?), אבל הפתרונות לת'רדים מרובים שלא מוטמעים בסביבת הריצה של פלאש הם מסורבלים, יקרים ובכנות? לא אמורים להיות משהו שאנחנו אמורים לפתח.

טוב נו, מה אפשר לעשות?
בשיטוטי לא נתקלתי עדיין בהתייחסות לעניין מצד אדובי בכל המדובר ב- roadmaps לעתיד הפלייר. אני גם לא הייתי שם יהווי על העניין. אתם יודעים. אישית, אני עדיין מחכה לתמיכה ב- Timezones שהובטחה בפלייר 10.
הפתרונות המוצעים בד"כ מדברים על לולאות פשוטות ולא רקורסיביות. איזה מין תמימות המבקשת לפרק לולאות פשוטות לחלקים קטנים יותר ולהריץ אותם בהתחשב בברינדור הפריימים. דוגמה לכך תוכלו למצא בפוסט מצויין של אלכס הרואיי (חובה לקרא את התגובות).

Pixel Bender
נחפש עוד קצת ונמצא את פתרון ה- Pixel Bender. בקצרה, Pixel Bender נועד ליצור אפקטיים חזותיים כמו פילטרים וכדומה על bitmaps, וקטורים ועוד. ת'כלס? אופרציות מתמטיות שמעבדות ביטים, ורצות על ת'רד נפרד. רגע, רגע, אז זה בדיוק מה שאנחנו צריכים לא? יש לנו ת'רד נפרד ועליו נריץ את מה שאנחנו רוצים, לא? ובכן התשובה היא לא. אפשר להריץ שם חישובים מתמטיים אבל לא לולאות. מה שגם, צריך לבנות עבור פעולות מיוחדות קרנלים (כן, Kernels, זוכרים מלינוקס? איזה כיף הא?... בואו נחולל קרנלים!), אז הפתרון הזה נחמד ויפה למניפולציות גראפיות או סאונדיות, כל עוד אין לולאות בעניין. לא טוב לנו. אתם יכולים לקרא על זה פה.

HTML
הלאה, כי אנחנו לא ילדות, ואני מנסה לפתור את העניין עם HTML. עובדה מעניינת אחת היא שאם תטמיעו HTML באפליקציית AIR שלכם, ותקראו לפונקציית JS שתרים Alert, אתם תופתעו לגלות שהת'רד היחיד של פלאש לא משחק שם תפקיד (מן הסתם) וה- Alert עולה כמו נינג'ה. מה שכן, אנחנו לא ממש מעוניינים ב-Alert. אנו רוצים משהו יותר בכיוון של חלון חדש שנפתח, עם פלאש פלייר אחר בתוכו, שיפעל בת'רד הבודד שלו. אתם יודעים מה? עזבו פלאש, אני מארגן progress bar שהוא AJAX נטו בפנים, יותר טוב מזה? אין.
כינים.
בשביל שה-HTML הנחמד שלנו ירונדר הפלייר צריך (ניחשתם נכון) לרנדר אותו, אבל הוא תפוס על הפעולה הרקורסיבית שלו, ושום דבר לא יעזור, ה-HTML לא מראה דבר וחצי דבר.

עוד פתרונות?
אין לי. לכן אני פה, כועס ורוטן. יש לכם? אשמח לשמוע...

סיכום
ישר ולעניין, יש טכנולוגיות מתחרות שתומכות בת'רדים מרובים. עד כאן יש? אחלא.
אם אדובי מעוניינים לשמור על היתרון היחסי שלהם בעולם ה- RIA ובעיקר באיזור ה- Desktop Applications, אני מציע בצניעות שייקחו את עניין הת'רד הבודד של פלאש לתשומת ליבם ובזריז, כי מיקרוסופט לא מחבקת עצים בזמן שהם משתעשעים בכנסי MAX.




This is a mutter
Not completely useless, but if you came here in search for a solution I'm sorry to disappoint you this time.
It's very dramatic of me, but I think it's high time to point out the so obvious fact that Flash has only one thread.
The fact that Flash can run on a single thread only, as opposed to other running environments (.NET, Java etc.), was always on the backgrounds but never was conceived as a major argument against the technology. Some might claim, that when you find yourself in need of multiple threads when developing for Flash, you're probably doing something wrong. Add that fact that in order to manage threads, the Flash player VM needs to grow in volume, and you get the business consideration for Adobe to not touch their little baby.
But then comes RIA and to top it off - AIR.

What's your problem?
Take the next scenario, where there is an application that supposed to use the file system API, and do some kind of an iteration over files. Something like "tell me what's going on in that directory". A scenario that can be a native resident in any AIR application.
Now, for our customer to be happy, we also want to give her a nice UX (cause we truly believe that an application does not end in a mere functional architecture) that will help her understand that some process is running. A Progress Bar sounds like a great idea.
Can you smell the rotten egg already? We have a recursive loop that doesn’t do much inside, but still can potentially run many times, what will eventually stuck Flash single thread and cause that nothing will be renderered on the screen. The player will be jammed and we will be considered lucky if our progress bar will be added to the stage (not to mention, show the progress).

Does it make you mad?
Now you tell me, does this lonely thread is something that Adobe needs to put high at their priority list when racing to conquer the RIA and Desktop Applications realm? Hell yeah.
It's very nice that the player is small, and it goes well with poor Web-Sites, but times are changing and you cannot be stagnated with the argument that "our player is small", especially when the competitors are supporting multi-threading.
Adobe has leaned and still leaning on the evangelist developers community, that works day and night in finding workarounds to many player limitations (RTL someone?), but the solutions to multi-threading support are awkward, expensive and to be honest? Not supposed to be something that we should develop.

Ok then, what can be done?
Roaming the web, I didn't find any reference to the issue from Adobe where it comes to Roadmaps for the future of Flash player. I wouldn't put my money there either. I'm still waiting for the Time zone support promised for Flash player 10.
The solutions suggested usually speak about simple loops and not recursive ones. A naïve approach to divide these loops into smaller routines and run them while considering the frame rate. A sample of that you would find in an excellent post by Alex Harui (reading the comments is a must).

Pixel Bender
If we look a little more we would find the Pixel Bender solution. In short, the Pixel Bender purpose is to create a dynamic visual effects like filters and such, on bitmaps and vector graphics. In a nut shell? Mathematical operations on bits that run on a different thread than the one used by the Flash player.
Hold on! This is exactly what we need, isn't it? Well, the answer is no. you can run mathematical calculations but not loops, and you also need to generate Kernels (yeah, remember that Linux fun?), so this solution is nice for graphic or sound manipulations, but as long as there no support for loops it doesn't really help us. You can read about it here.

HTML
Going on, cause we're not giving up that easily, I try to solve the issue with embedded HTML. One interesting fact is that if you embed HTML into your AIR app, and call a JS function that pops up an Alert, you will find out that Flash single thread doesn't get in the way and the alert goes up when asked, but I want something nicer, like a window. You know what? I don't even need Flash inside that window, I did it all in pure AJAX. Does it get any better than this?
Nothing.
In order to render HTML, the player needs to render the HTML container, but it is caught up in it's loop so nothing happens.

More solutions?
I have none. This is why I'm here… complaining. If you have some, I will be sure happy to hear them.

In conclusion
Straight and to the point, there are other technologies that do support multi-threading.
If Adobe wishes to keep their relative advantage over the competitors, in the RIA section and mostly in the Desktop Applications, I humbly suggest that they will take the matter of multi-threading into consideration, and fast, cause Microsoft ain't gonna wait until the next MAX convention.


September 20, 2009

You open, You see :: Curly Braces

Scroll down for the English translation...

מה המצב? איך עובר עליכם החג? בטוב? יופי.
אז ככה, אתם יודעים שמקום העבודה הוא אחת הזירות הטובות ביותר להעלות תהיות ומחלוקות. וכך קורה ששאלות תמימות (או לעיתים לא ממש) הופכות לדיונים סוערים, שאפשר להפיק מהם בעיקר תובנות ותשובות.
הנה משהו שקולגה שלי העלה וחשבתי שיהיה נכון (כמובן, ברשותו האדיבה) לשתף אתכם בו:
בזמנו, כל ביטוי action script בקובץ MXML היה צריך לחיות בתוך סוגריים מסולסלים, אבל מאז עברו מעט מים בנהר והסוגריים המסולסלים הם לא ממש הכרח. מתי לא? מתי שהצפי הוא עבור אובייקט, או מתודה, או אם להיות יותר מדויק כל מה אמור לייצג מחרוזת. סוגריים מסולסלים קיבלו מקום בעיקר עבור Binding, וכולנו יודעים שהן בעצם מורות לקומפיילר לייצר אקסטרה קוד שאמור לנהל את ה- Binding במקןם הנתון.
ובכל זאת, אנחנו עדיין רואים מפתחים משתמשים בסוגריים מסולסלים, כאשר הם למשל מגדירים event handlers, הו-אז נשאלת השאלה הבלתי נמנעת: האם כאשר אנחנו מגדירים event handler בתוך סוגריים מסולסלים אנחנו למעשה כופים על הקומפיילר ליצור אקסטרה קוד עבור Binding לא נחוץ בעליל?
בפשטות? לא.
למטה תוכלו למצא את קטעי הקוד המג'ונרטים (ברוך המוציא generated מן הקומפלייר), פעם אחת עם סוגריים מסולסלים ופעם בלי. כפי שאתם רואים, ההבדל הוא, באופן מפתיע, סוגריים מסולסלים. אז מעתה אתם יכולים להיות רגועים ולהרגיע את הסובבים אתכם – זה בסדר.
שנה טובה.



How’s its going?
So, you know that the working place is one of the best places to raise thoughts, wonderings and debates. And so it happen that innocent questions (or some time not that innocent) become a great argument, which sometimes you can benefit from.
Here is question that my colleague raised and I thought it would be great (with his generous permission) to share with you:
At the time, any ActionSctipt expression on an MXML file would have to be inside curly braces, but since then time has passed and the curly braces are not mandatory. You ask “when?” – Well, whenever the expression is not meant to define a String. Curly braces got the honorable rule of defining Binding (in general), and they instruct the compiler to generate extra code to handle the binding on the spot.
Still, we see developers using the curly braces when they define Event handlers, for instance. Then, one might ask, when you define an event handler inside curly braces, do you still instruct the complier to generate extra code, to no need?
Simply answered? Nop.
If you look, below, you would see the code and the generated code snippets for both using curly braces and not using them. As you can see, the only difference is, well, the curly braces. So from now on you can relax… it’s ok… it’s ok :).

Cheers.


Without curly braces


/**
* @private
**/
public function ___CurlyBraces_Application1_creationComplete(event:mx.events.FlexEvent):void
{
onCreationComplete(event)
}


With curly braces


/**
* @private
**/
public function ___CurlyBraces_Application1_creationComplete(event:mx.events.FlexEvent):void
{
{onCreationComplete(event)}
}

September 16, 2009

Flashmatticomponent direct SWC download

Scroll down for English translation...

אהלן,
אם תקראו את התגובות על הפוסט בו הצגתי לראשונה את Flashmatticomponents, תוכלו להבחין באחת המלינה על כך שאין אפשרות להוריד את ה- swc ישירות, אלא חייבים להוריד את הקוד ולקמפל לוקאלית.
נכון, ואללא נכון. הסיבה שעשיתי זאת כך היא מפני שהרבה יותר קשה לנהל את הגרסאות בצורה הזו, ויש מצב שה-SWC שאפשר להוריד ישירות לא יהיה הכי-הכי מעודכן.
בכל אופן, זה יהיה נכון לשים שם את גרסת ה-SWC, וזה מה שעשיתי. תרגישו בנוח לגשת לאיזור ה-download של אתר הפרוייקט ולהוריד את ה-SWC.

יאללא ביי.


Hey guys,
If you'll read the comments on the post where I first published the Flashmatticomponents, you'll notice one that complains about not having a direct download option in the project site, for the SWC file, but rather the option to download the code and compile it locally to get the artifact.
True, yeah… The reason I did it so is because it's a lot harder to manage the versions that way, and a situation might rise, where the direct download SWC will not be as updated as the one generated by compiling the code.
In any case, it would be a good Idea to put a direct download link to the SWC, which I did. Feel free to go there and download it.

Cheers!






September 10, 2009

FlexPMD from Flex Builder

Scroll down for English translation...

שלום שלום, מה קורה?
וודאי רובכם יודעים שאדובה הוציאה את FlexPMD לשוק הפתוח, ואם נהיה כנים - זה אחלא של דבר! למי שלא מכיר, אפשר לקרא פה, אבל בכל זאת הנה העיקר:
מוצא קוד שלא בשימוש.
מוצא קוד לא יעיל.
מוצא קוד שהמורכבות שלו מוגזמת.
מוצא רוטינות קוד ארוכות מדי.
ועוד יותר...

תשמעו, אתם מריצים את זה על הפרוייקט והוא מוצא תחלואות שלא היו מביישות את סומליה. ממש ממש כלי טוב, פשוט ויעיל העוזר לייצר קוד טוב יותר, ברם (ואתם ידעתם שזה יבוא), אליה וקוץ בה.
זה מגניב שאפשר להפעיל את זה אפילו מהמטבח של גיל חובב (mvn, ant, cmd) אבל אני רוצה דרך מהירה ויעילה להפעיל את העניינים. משהו של "קליק אחד ויאללא לרפואה", משהו של "מתוך פלקס בילדר ולעסק", וזה נכון שאדובה אומרים שהם עובדים על פלאג-אין לפלקס בילדר, אבל סאחבק לא נודע בשל חיכיונו למשיחי-תוכנה החל לתור אחר פתרון.
External tools!
מה שעוללתי הוא external tool בתוך Flex Builder, שיקרא Create PMD, והוא ידע לפנות ולבצע את הפעולות, נכון למיקום הבחירה בעץ הפרוייקט. כלומר, אם תבחרו את ה root, קובץ ה- PMD יופיע שם, אם תבחרו package, הקובץ יופיע בה.
תעקבו אחר הצעדים בתחתית הפוסט (הם באנגלית, אני יודע, אבל אתם תתמודדו), ובשלוש דקות יהיה לכם כפתור שמייצר PMD בקליק אחד. בכדי לחזות בתוצאות באופן נהיר, אדובה מציעים לנו את ה viewer שלהם. כל שצריך הוא להעלות את ה- PMD אליו וחזות בזוועות הקוד.
אם יש בעיות עם ה- tool, דברו איתי :).


Hi guys,
Recently Adobe has launched a new open source project called FlexPMD. You can read all about it here, but here are the highlights:

“FlexPMD is a tool that helps to improve code quality by auditing any AS3/Flex source directory and detecting common bad practices, such as:

* Unused code (functions, variables, constants, etc.)
* Inefficient code (misuse of dynamic filters, heavy constructors, etc.)
* Over-complex code (nested loops, too many conditionals, etc.)
* Over-long code (classes, methods, etc.)
* Incorrect use of the Flex component lifecycle (commitProperties, etc.)”

Well this is multi-nice, but it seems that we need a better/quicker way to invoke it on our projects than have it on the Maven site/Ant/CMD. This is something that we need on a day-to-day, hour-to-hour basis.
So until the Flex Builder plug-in will be out (they are working on it), here is my solution, and you are all welcomed to adopt it for better coding:

STPES:

Download the “command-line” version from adobe and extract it onto your local machine.
Open Flex Builder.
On the top menu, go to Run > External Tools > Open External Tools Dialog…
Create a new External tool and call it “Create PMD”.
Fill it according to the following:
  • The Location is where the java.exe can be found
  • The Working Directory is set to a variable which is the selected resource on the project tree (the variable name is “resource_loc” and can be found on the variables list).
  • The Arguments are where the flex-pmd-command-line-1.0.RC3.jar is found, the source (“s”) and output (“o”) folders which are set to be at the same location as the Working Directory.
Ok – all you need to do now, is to select a resource on the project tree and run this tool.
After the tool has completed its work – you will see a pmd.xml file on the same folder you’ve selected on the project tree (if you don’t, refresh the tree, it’s there…).
Launch Adobe PMD viewer URL.
This is the viewer for PMD that Adobe created (If you’re really lazy, you can open the viewer directly from Flex Builder… but that's another story).
Load the file onto it and witness the HORROR :)

If you encounter any trouble with the tool, please let me know.
Cheers.