Tuesday, December 04, 2007

The class 'com.your.class' cannot be imported because its leaf name is already being resolved to imported class 'com.your.class'.

While I was refactoring some ActionScript2 code, I ended up with the above error message.
I searched the web and what I came up with was mostly the information that such a message actually exists.
so after figuring out why I got that error I decided to write about it here for your benefit. (Leave me a comment if it helped you).

well it turns out that this was cause by the following proccess:
I have an adbode flash source .FLA file which had inside its _root code two #include statements:

lets say
#include "fileA.as"
and
#include "fileB.as"

now each of those file in its turn had an import statement
import MyClass
where MyClass.as was a file that was on the same directory as the .FLA, fileA.as & fileB.as.

It worked fine.
But when I started refactoring and moved MyClass to become com.whatever.MyClass
(with all the required changes to MyClass, fileA and fileB) I suddenly got
"The class 'com.whatever.MyClass' cannot be imported because its leaf name is already being resolved to imported class 'com.whatever.MyClass'".

The solution was to remove the import statements from fileA.as and FileB.as
and just place one import directly in the .FLA.

(the #include files are on thair way out as well...)

My recomendation: Try to avoid #include, most likely you can get better results by using a static class.

Sunday, November 25, 2007

Will (or did) Live Documents copy Microsoft's UI ?

Live Documents , the new office suite rival say in the usability section:

"Live Documents gives you a familiar user interface - that of Microsoft Office - so that there is nothing new to learn. "

Can they realy do that ??

I am no xpert on any copyright laws and I am all for having the copy and paste buttons look the same on all apps.
but can you realy go and say "I have an office suite that is exactly like that of microsoft" and still walk free ??

What do You think ??

Saturday, November 10, 2007

Wildfire testimonial

On Gigya where I work as a System Architect with my hands deep into our Wildfire product we are running a forum for technical Q's.
One of the forum members (Joel Mirkin) just posted a Q and his oppinion on Wildfire along with it:
<snip-snip>
Also just to put my 2 cents in... I totally agree with what reverbnation said. I've looked at other similar services and none of them come even close to how easy it is to integrate and customize Wildfire (not to mention supporting AS3).
</snip-snip>

Just made me a few centimeters higher :)

Thank Joel.

Even when you know you have an excelent product its always nice to hear it again from someone objective.

Saturday, September 29, 2007

using arguments vs. an array parameter

This goes for both actionscript and javascript and I guess any language that lets you create functions without an arbitrary number of parameters (a syntax known as elipsis in some other languages).

It is very temping to use this syntax to write general functions such as Max or Min with an arbitrary number of parameters.

you would get something like (and this just an outline not code designed to work).

function maxOfN() {
var m=arguments[0];
for (var i=1;i if (arguments[i]>m) m=arguments[i];
}
return m;
}

you can then use this in a clean way:
var m1=maxOfN(4,8,3,9);

So what is the alternative?
Work on an explicit array of values

function maxOfN(arrValues) {
var m=arrValues[0];
for (var i=1;i if (arrValues[i]>m) m=arrValues[i];
}
return m;
}

and you get the less clean syntax:
var m1=maxOfN([4,8,3,9]);

so it looks as if its more "cool" to use the first option
but as I found out after writing some "cool" code there is a minor problem with this approach:

suppose you already have an array with the values you want to work on (as I did),
you will then have to use:

//
// values is set to an array of values by previous code
//
mar m1=maxOfN.apply(null,values);

Which:
0) Assumes you even have an apply in your language
1) Looks much worse then
var m1=maxOfN(values);
2) Actually means that you build an arry in your code, then call apply which takes the array appart, pushes it onto the stack just so that you can as for the arguments array and have all the parameters pushed back into the array you could have passed directly to begin with.

So my recomandation would be to pass the array explicitly and pay for the creation of the array parameter

var m1=maxOfN([4,8,3,9]);

This also has the advantage of being able to pass along more then a single array to a function and not being limited to having it as the last parameter of the function.

consider somthing like:
var sums=inPairs([1,3,5],add,[4,6,8]);
var products=inPairs([1,3,5],mult,[4,6,8]);

Anyone wants to guess what I would expect sums and products to be ?
Did i hear any one say "Excel" or "Array functions" ...

Thursday, September 06, 2007

Luciano Pavarotti died, God rest his soul.

71 yeas old Luciano Pavarotti,
one of the world famous 3 Tenors
died today.

Luciano Pavarotti on IMDB

Saturday, September 01, 2007

virtual pc "Use Physical Drive" grayed out

A few hours ago I downloaded virtual pc 2007 and decided to try my new vista ultimate.

The download and install of virual pc was quick and easy, and a very short time afterwards I had a virtual machine ready for the installation.

Well, as far as I could tell, the next thing to do was to put the vista cd into the DVD and boot the VM.

hmmm..
That didn't seem to work that well.
What am i missing? hmm...

A quick look at the PVC2007 menu and I saw I have a "Use Physical Drive F:" in there (which is my DVD) but it was disabled.
hmmm... again.

Another quick look and I see a CD icon at the bottom.
Now that took me for a short ride down the settings of the VM where I had the option of choosing between my primary or secondary IDE controller.
Nither made things better.

Well, It took me about another hour until I realized what was the real problem:
My original genuine fresh out of the litle plastic box with all the holograms and stickers aroundit vista ultimate dvd was just not working.
Had nothing to do with virtual pc.
but hey, it would be nice of VPC said something along the lines of "No media found" or something like this, and not just give me the impression that the problem is with not being able to connect to the drive itself.

I hope that if you are reading this it saved you some time,
go ahead, check your media - does it work on your host machine !?

(b.t.w. - I got the vista together with some more MS software - office 2k7 and such,
so when I found out that the vista DVD was f$&ked up I went along and checked all the other DVDs. No problems there... it was just the two copies of vista. I guess they come from some faulty batch. Now I have to contact MS to get a replacement ...)

Wednesday, August 29, 2007

The keys are always in the other pocket

I was wandering if anyone else noticed it.

Whenever I approach a locked door (of my car or my apartment) and I am holding something that disables one of my hands, be that my sleeping daughter or just grocery products, In about 75% of the times the keys are in my other pocket :(

I guess this is some private case of murphy's law.

I wander if there are other paralelisms to this.

Tuesday, June 19, 2007

flash cs3 - I can cut and copy but I cant paste

For about a month or so I am studying how to use flash,
Its nice to learn something new...

We bought the new adobe flash CS3 and this is the enironment I am using.

There are many complaints I can make about this environment,
following the issue of haveing no runtime errors and poor debugging environment
the biggest productivity killer for me was the fact that it is set to use ctrl-X,ctrl-C and ctrl-V for Cut, Copy and Paste respectively while my fingers are trained to use ctrl-Del,ctrl-Insert and shift-Insert for those actions.

Every copy and paste action that I do, I do twice ....

After asking about this in experts-exchange.com where I am active under the alias SnowFlake I was pointed to the "Edit, Keyboard Shortcuts..." menu.

For a few seconds I was very happy...
I went along and set up my favorites and not I can cut and copy using my favorite keys, paste (Shift-Insert) however, still refuses to work...

Anyone else has this problem ? Anyone else solved it somehow ??

Saturday, May 05, 2007

Microsoft SilverLight XML vs. JSON

As many others, I am also excited about SilverLight.
So I downloaded the beta and took a look at some examples.

well, I know microsoft is going the XML way, but I was somewhat disappointed at it.
It is SO big...

After working with JSON (Javascript Object Notation) for quite a long time I feel that IMHO siverlight would be much better off using JSON and not XML.

How can you compete with flash when the download is SO big :(

What Do you think ?

Sunday, April 29, 2007

about face

A friend just recomanded that I have a look at a book called "about face".
looking at amazone they have:


and


makes me wander - will people realy buy the old version when a new one is comeing out so soon ?

I guess I will buy the new one. I will probably post a review after I get and read the book...

Friday, March 09, 2007

Using google to restore stage.co.il content

Since I belive that most of the readers of this post will be hebrew reader,
This post will be in hebrew.


אתמול בערב קיבלתי דוא"ל מקרובת משפחה שלי,
במכתבה היא מספרת שפתחה בלוג חדש בתפוז:


ושהסיבה לכך היא שדף היוצר שלה באתר במה חדשה אבד באירוע של השחתת האתר,
כמו כן היא צירפה את הלינק הבא לסיפור המעשה:

http://www.ynet.co.il/articles/0,7340,L-3373961,00.html


בהיותי איש מחשבים החלטתי לנסות ולעזור לה לשחזר כמה שיותר מהתכנים שאבדו תוך שימוש בארכיונים של GOOGLE מה שנקרא באנגלית Cache או מטמון בעברית.

בתהליך השחזור נתקלתי בשתי בעיות שהראשונה בהן הייתה איתור הדפים בCache והשניה הייתה שגם אחרי איתור הדפים היתה בעייה בהעתקת המיידע שבהם החוצה כיוון שהעברית שבו הועתקה הפוך (למבינים הכוונה היא שהעברית הייתה ויזואלית ולא לוגית).

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

נתחיל באיתור הדף המרכזי של היוצר:
חיפוש בגוגל של רצף המילים "New Stage במה חדשה אתגר קרת" (ללא המרכאות) מחזיר לשמחתנו במקום הראשון (ובמקרה גם היחיד) את הדף שכתובתו stage.co.il/Authors/EtgarKeret אצל חלק מהיוצרים יתכן שבמקום יופיע מספר ולפעמים גם סימן שאלה עם תוספת אחריו.


נלחץ על קישור Cached או הועבר למטמון אצל אלו מכם שמשתמשים בGOOGLE בשפה העברית.

ונקבל את הדף הראשי של אתגר.

עכשיו יש לי שתי בשורות... אחת רעה ואחת טובה:
הרעה: לצערי לא מצאתי דרך להעתיק את התוכן של הדף הראשי עם עברית תקינה.
הטובה: ניתן להגיע לתכנים של הדפים הפנימיים ולהעתיק אותם עם עברית תקינה.
נסתכל למשל על הסיפור הראשון שמופיע בדף הראשי של אתגר,
זה הנקרא "שעועית מקופסא", אם נחפש בגוגל לפי שם הסיפור והמילים הראשונות של גוף הסיפור - במקרה שלנו "שעועית מקופסא איש אחד רעב" ונקבל רשימת תוצאות, כאן מגיע החלק שיכול לפעמים להיות קצת מעייף, צריך לעבור על רשימת התוצאות ולחפש את הדף המתאים, אבל שימו לב הפעם אנחנו מחפשים לינק שנראה כמו: stage.co.il/Stories/מספר?print_this=y וחשוב מאוד שהוא יסתיים כפי שמתואר כאן,
במקרה שלנו ברשימת התוצאות המקורית מופיע הלינק stage.co.il/Stories/100 שנראה כאילו הוא מה שחיפשנו ואם נלחץ על הקישור Cached שמופיע לידו נקבל דף שמכיל את הסיפור שחיפשנו - אבל אי אפשר להעתיק את העברית שלו באופן תקין.
אם עברנו על כל הרשימה ולא מצאנו את הדף שלנו נגיע לבסוף ללינק
repeat the search with the omitted results included, נלחץ עליו ונגיע לרשימה מחדש, הפעם הדף המבוקש stage.co.il/Stories/100?print_this=y נמצא שם ולחיצה על הקישור Cached תביא אותנו לדף שמכיל רק את הסיפור עצמו ובעברית שניתן פשוט לסמן ולהעתיק לתוך WORD או כל סביבת Windows רגילה אחרת.

ולא להבהל מהעובדה שכאשר נכנסים לדף הזה הוא רוצה להדפיס את עצמו... אולי זה אפילו רעיון טוב ... מי יודע, אולי בפעם הבאה המידע לא יהיה זמין בגוגל...
ומי שמעדיף לחסוך בדפים יכול פשוט ללחוץ Cancel.


רוצים לשלוח הפנייה לדף הזה לחבר:
תוכלו להשתמש בזה: (מוצר של חברת GIGYA שבה אני עובד)


 
Clicky Web Analytics