— Shang Liang

Archive
Others

I’m very sick of this Flash session issue. I thought I had the perfect solution of passing the session id into Flash and fix the session by appending all the request, then the bomb drops to me. It doesn’t work in an iframe in IE. Apparently, IE doesn’t trust cookies set from an iframe so there goes the session. The solution is to add a header information in the backend code. Something like this for PHP.
header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
It’s not hard to find the code for other languages in Google.

Read More

http://en.wikipedia.org/wiki/Suffix_tree

Here’s the speed test. The speed boost is not obvious for daily usage but it’s very significant when the word base get larger, or it’s searching against long sentences.

Suffix tree search speed test

Read More

Facebook parameters passed to applications’ iframe is changed from GET to POST. It’s unclear whether this will be permanent. If your Facebook application uses iframe and tries to check parameters view GET method, it’s very likely to be broken now.

Many iframe applications  check ‘fb_sig_in_iframe’ to determine whether the user is accessing the app directly, not going through Facebook. Such applications will go into a looping re-directing.

To be safe, you can try to get the parameters via both GET and POST in case Facebook change it back to GET in the future.

 

Read More

I was using ASIHTTPRequest and encountered the following error

Incorrect NSStringEncoding value 0×0000 detected. Assuming NSStringEncodingASCII. Will stop this compatiblity mapping behavior in the near future.

After I tried various ways of setting the encoding of the NSString, nothing really worked. I then dug a bit more and realized I didn’t initialize ASIHTTPRequest properly. The only right way to initialize it is through calling initWithURL. The “init” function is empty and it does not set the instance into the working state. The error is raised when you try to call setURL function of when it’s not initialized properly.

What I was trying to od is to reuse one instance of ASIHTTPRequest. After I looked into the source code, I chose not to play around with it and initialize separate instances when needed and destroy them afterward. The class is very complicated because of the threadings happening inside it. I’m sure there’s a better solution of reusing an instance, for example calling a “close” function of the instance. But I can’t find the right function at the moment.

Read More

The problem has been noted in SWFObject’s issue log. If you encounter any problem with flashvars not showing up in IE, downgrade SWFAdress to 2.2 will solve the problem. You can download other versions of SWFAdress from SourceForge.

Read More

I was always wondering how to use PureMVC for website development. Today, I’ve finally got a chance to try it.  I’ve read the documents many times but never really understand it so clearly after this small hands on practice. The example is the most typical scenario, some clickable buttons on the stage and click at one button will show the corresponding content.

source

Read More

Great stuff! Very inspring!

Read More

The people there are really happy with their solution.

Read More

Read More

This will enable code auto-completion feature for AIR API in FlashDevelop

Project->Properties->Compiler Options->Intrinsic Libraries, click at the “…” button and put these lines there

Library\AS3\frameworks\FlashCS3
Library\AS3\frameworks\AIR

Read More