Stepan
This user hasn't shared any biographical information
Homepage: http://www.stehil.com
Posts by Stepan
developer.apple.com runs on… PHP?
Jan 10th
I thought Apple was luvin’ it’s own bread, I mean, WebObjects… but seems like that’s not the case:
http://developer.apple.com/enroll/selectEnrollmentType.php?t=cm
Not quite as shocking as seeing .asp there would be, but still I cannot help but wonder what’s happening behind those closed doors?
copylocale and Windows 7
Dec 20th
Copylocale runs like magic and tells you that it has copied everything just fine. Great. But the files are not there. Ah, you’re running W7, an extremely secure system. Duh, you have to enable admin mode on your command prompt before you run evil stuff like copylocale.
Apache Archiva 401 error
Dec 20th
So, your Maven settings.xml is perfect (you’ve checked like six times that the user/pass/serverId is right) but you are still getting a 401 error trying to do mvn deploy:deploy-file?
Well, once upon a time, there was this particular Archiva repository that required that I change a password for my user – it wouldn’t let me upload without changing it.
Why so strict, Archiva?
Setting up Chrome with Flash Player debugger
Oct 7th
Adobe has this covered in two KB’s, but they might be bit hard to find:
1. Installation
2. How to sort out this popup: “The following plug-in is unresponsive: Shockwave Flash”
No. 2 is a deja-vu of a similar issue in Firefox, the solution there is different though.
Pain with ArrayCollection addItemAt
Jun 29th
ArrayCollection has some nifty functionality, but it isn’t always a smooth sailing.
Gotcha 1: addItemAt doesn’t work if the ArrayCollection is sorted. Well, it does make sense, but there are situations when we could take advantage of the fact that sorting doesn’t happen before a refresh() call. Anyway, something that IMHO should be mentioned in the docs rather than only in ListCollectionView source: “if we’re sorted addItemAt is meaningless, just add to the end”.
Gotcha 2: Well, say, that we insist of using our collection, and so we try to remove the sorting to be able to do a meaningfull addItemAt. We set ac.sort=null; but instead of a great success, things explode on addItemAt. Well, the internal logic of ListCollectionView requires you to do a ac.refresh() after setting sort to null; if you don’t do that, it’s internal vars are out of whack and null references creep in. IMHO ArrayCollection should be smart enough to handle removal of sort without a subsequent refresh call.
Gotcha 3: Well, we call the ac.refresh() after setting ac.sort=null but now our item order is all screwed up. Epic phail. So, let’s just give up and copy the collection instead, shall we?
1 | var ac1:ArrayCollection = new ArrayCollection(ac0.toArray()); |
Simple example – Flash (AS3) and FormMail.cgi
May 29th
I’ve just created a little sample for a friend. He is a designer and “just needed something” that would allow him to capture the data that users enter. FormMail.cgi fits the bill – no need to touch any server files or databases, just point your Flash to a FormMail script that is already installed on your server and off you go – you are sending emails from Flash. It feels bit 90-ies, but it works.
What will you need:
- Flash CS3 or newer (download free 30 days trial from Adobe)
- URL to FormMail.cgi. Many hosting providers have installed FormMail.cgi for you – you will definitely have it if you have cPanel, look under Scripts to find the right path to yours. Otherwise ask your hosting provider or pinch somebody else’s FormMail (not recommended
).
Here are instructions that any Flash designer should be able to follow:
- Create a AS3 Flash document.
- Create your text inputs. My code is using 3 Text Inputs named: messageTI, nameTI, emailTI. You can create more, or rename them, but then you will have to add/modify the code a little bit.
- Create a button and name it sendB
- Create a dynamic text and name it statusTF
- Create an Actions layer and in the first frame put the following code, than modify the FormMail URL and recipient’s email:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | import flash.events.MouseEvent; import flash.profiler.showRedrawRegions; import flash.net.URLRequest; import flash.net.URLRequestMethod; sendB.addEventListener(MouseEvent.CLICK, sendData); function sendData(e:MouseEvent):void { if (messageTI.text.length > 3 && nameTI.text.length > 3 && emailTI.text.indexOf("@") > -1) { //very, very basic data validation (as this is not a data validation tutorial) var r:URLRequest = new URLRequest("http://YOUR-URL-TO-FORM-MAIL/FormMail.cgi"); //modify this URL var v:URLVariables = new URLVariables(); v.recipient = "YOUR-EMAIL@DOMAIN.com"; //put your email here v.subject = "My FormMail test"; //this will be the subject of the email v.email = emailTI.text; v.realname = nameTI.text; //user's name will be appended to his/hers email to form a From field of the email. v.theMessage = messageTI.text; //theMessage is a custom key. If you need more Input fields, just make up more custom fields like this one r.data = v; r.method = URLRequestMethod.POST; var loader:URLLoader = new URLLoader(); loader.addEventListener(Event.COMPLETE, completeHandler); try { loader.load(r); } catch (error:Error) { statusTF.text = "Unable to send data."; //we could definitely do more in terms of error handling, however this is not a error handling tutorial } } else { statusTF.text = "Please enter all required information."; } } function completeHandler(event:Event):void { statusTF.text = "Data submitted."; var loader:URLLoader = URLLoader(event.target); trace("completeHandler: " + loader.data); } |
Notes:
- You can place your components (Button, TextInputs & Dynamic Text) anywhere you like on a page, style them anyhow you like, but make sure they are in the first frame and have the correct names (case sensitive).
- If email is getting send but you are not receiving any – check your spam folder.
- You are too lazy to copy/paste? I hear you. Here is the sample flash file.
Flex SDK bug: The first color in ColorPicker (black) cannot be selected
May 21st
Ha, I found a bug in the SDK! (Well, OK, I didn’t find it, one of the testers did
. Let’s be very nice; let’s put it in Adobe’s Bug System, describe it and suggest a workaround
.
Dodgy Mini DisplayPort to DVI adapter
May 13th
You get such great deals on Ebay, or do you? Like this adapter from Hong Kong for less then $10 incl. postage when a new original Apple one is $45. Well, it did work great for 3 months and then, one day, the MacBook just showed me a little disco – the display was flashing in rapid succession; somehow the switch sequence to external display was failing and it kept on trying… after a while it stopped trying. So, I dished out $45 for an original Apple adapter today and was relieved that it was indeed only an adapter issue and not a broken port on the notebook.
Still, I do consider $45 for this little adapter to be an epic rip off; that’s like you get 8 adapters for same money as a little netbook. Hmmmmm.
ADL doesn’t open the Air application
May 9th
So, you are writing an Air app (or more likely just imported one from somewhere), you try to debug it and the AIR Debug Launcher (ADL) just sits in the Dock (on Mac) and doesn’t open any window, doesn’t throw an error, nothing. Well, you will want to check that you are not using a Flex application class but rather the Air application class; i.e. <s:WindowedApplication>. Duh
Codewars disaster
May 6th
I’ve just failed my poor teammate at Webdu Codewars. So sorryyyy!
Anyway, rather than write a million excuses, here is what it was supposed to look it like after that 20 minutes of coding.
(The original task was to code, in 20 minutes, an “App that would make Steve Jobs relax” or something along those lines).
Please note that the link above is rated QR. It contains some violence and silly jokes and is not really recommended for any audiences.
