GC Log Gordon Chan Blog – An Ambitious Hong Kong Web Developer

1Jan/120

Happy New Year @ 2012

Happy New Year @ 2012

It is a difficult year, no matter to the world or to me. There are too many disasters, the financial crisis, making lots of people die or poor. And for my job, we finally make out company site launch. We got too many to work out in order to meet numerous deadline: Launch date, pre-sale, etc. But no matter what, this 2012 I am preparing for my new era. I hope to work our our future with my love. And I wish I can share my skills to help more people to work out more great sites.

Wish you all best in 2012!

Did you like this? Share it:
1Jan/120

Solution: java.security.AccessControlException: access denied (java.net.SocketPermission host connect,resolve)

I am not Java Applet expert, but I found this worth for sharing.

I was told by my boss to check for the resolved ip for CDN domain. As I know, the resolved ip for a CDN domain is vary from geographic to geographic.It does not work to place the detection code on a particular server.

JavaScript does not have such thing besides basic client IP. So I tried using Actioncript, and turn out that AS# does has net package, and sadly it works on AIR 2 but Flash. So my boss throw out an idea to look for the information through Java Applet.

I am a new comer of Java Applet. In my mind, Java Applet is evil, which crash my browser in old time, making my computer run slower. Despite that, I know Java Applet should be able to do this job.

My mind is that Java Applet run on JVM, which should be able to get the information on client side. I search for example and find the following code should help me get the resolved domain ip:

InetAddress thisIp = java.net.InetAddress.getByName("{cdn.domain.com}");
String ip = thisIp.getHostAddress();

I can run the code, generate the .class file. But I fail to make it runs in browser no matter how I try. Until I find out the Java control panel and the console log. I get the reason why it stop working:

java.security.AccessControlException: access denied (java.net.SocketPermission cdn.domain.com resolve)

Well, definite I try to test a valid CDN domain URL, however it just keep saying the access denied. Due to the knowledge about flash cross domain experience, I know this should be something about foreign domain issue. So I try to change the domain that I try to look up from CDN domain to my blog domain or some URL with snap-f.net as domain, and the result is: work!!!

Thanks god.

So how about if it has to look up a foreign domain? I am not sure but here has a website talk about keystore or cert that may help working out the purpose:

http://www.khattam.info/solved-java-security-accesscontrolexception-access-denied-java-net-socketpermission-host-connectresolve-2010-03-24.html

Did you like this? Share it:
Filed under: Java No Comments
5Oct/110

CodeIgniter 2.0 video tutorials by Big Name

With the famous PHP framework CodeIgniter upgraded into 2.0, I make use of this occasion to refresh my knowledge on this such great tool. Having an afternoon to surf in Google, I find a genius CI programmer kindly sharing his knowledge of writing some basic CI 2.0 tutorials, using the admin, blog, authentication scenario as demonstration. It really worth for people who wish to strength their PHP skill and programming logic like password validation, system flow.

Did you like this? Share it:
5Oct/110

New Lane Crawford site

It is incredible I have chance to participate in building up the Lane Crawford official site.

The visible website is just the tip of the whole iceberg. In the last 14 months, started from a 6 people team, we build up the whole project linking up various internal systems, collaborate with our vendor and overcoming different hardship. We finally come up with a presentable website. Yet it looks simple, the site aim to serve various browsers especially IE6. Yes, as its target audience is from the mainland...

Well, we finally have the site receiving order, having new income for the company. We still have lots of thing to work for, making the site run faster, using much elegant coding for page rendering are some of my new tasks. Not matter what, I have to devote my all kind of abilities to enhance the site.

Did you like this? Share it:
5Oct/110

Angelo’s Pizza is launched!!!

With an occasion brought by my colleague, I have a chance to offer my spare skill on building website for a well-known Italian restaurant, which open a new branch of dining service: Pizza Delivery - Angelo's Pizza.

The site is customized CMS driven, bilingual, provide web master easier way to manage the site content.

Its mobile version is coming soon.

Did you like this? Share it:
4Sep/110

IE6 Duplicate Character for float element

Throughout the last couple months, I keep working on fixing a corporate site styling, JS execution issue, site performance for which was being implemented quite buggy. Debugging and fixing other people code is always challenging as you need to accommodate other coder's styling, and try understanding what's the purpose of writing something you think mean nothing, and avoid hitting some easter-egg issues. But it worths for me the meet such site and picking up such a challenging task as I am actually learning more and much aware something that I may also normally miss-out when I code.

This time come to IE6 - duplicating character bug for float element. Which happen on a customer login page. There is a customerized checkbox and a text label next to it. And a  hidden message block appear upon checkbox checked.

<div style="float:left;"></div>
<input name="aHiddenValue" value="data" type="hidden"/>
<label style="float:left;">Some text being duplicated</label>
<fieldset style="display:none">
<!-- some HTML -->
</fieldset>

But it turns out some Text is being duplicated for the label:

 

With surfing Google I find the issue is because of IE6 bug, when having some element with float property plus some hidden element nearby them, some text for those floating element ill be duplicated.

Position Is Everything has a thorough write-up on the puzzling behavior, and Adrian Pelletier has a simplier solution for the issue. And why I still write this post as I find that, following Adrian solution cannot immediately resolve my case. Rather adding a display-none span after the element that have duplicate character, I need to further add that bug-fixing-display-none span inside the duplicating text.

<div style="float:left;"></div>
<input name="aHiddenValue" value="data" type="hidden"/>
<label style="float:left;">Some text being duplicated<span class='ie_fix'></span></label>
<fieldset style="display:none">
<!-- some HTML -->
</fieldset>

<style type="text/css">
.ie_fix{display:none;}
</style>

Hope people who struggle with this can gain more hint.



Did you like this? Share it:
8Mar/110

IE6 Countdown

http://ie6countdown.com/

It is too good to hear news from Microsoft take the active step in enforcing the development of web by putting off IE6. For normal web surfer they may not know why having such act, but for web developer it is really a gospel. IE6 brings us a lot of hard time during web development due to its non-web standard interpretation of web page, pool JavaScript engine, lack for developer-friendly debugging tools and poor handling for image, CSS.

Having IE6 to share smaller portion of the web market help business decision-maker no longer thinking 'we should support IE6 for our company' web page meanwhile aim at applying fancy effect to their website while IE can hardly run them perfect.

Well, it is actually not only IE6, but some other browser which also not following web standard for web page rendering should also be put off from the market gradually in he future. So that let more fancy web effects to be executed on best performing browsers.

 

 

Did you like this? Share it:
Filed under: Uncategorized No Comments
5Feb/110

Apple Boot Camp Bug: No response for disk burning

從 Apple 一月十四特價日買回來的 iMac 到新年前終於進行了開封儀式。雖然買了 Parallels 6,還是想看看傳說中的 Boot Camp 是什麼回事。

Parallels 6 是 Virtual Machine,用作把 PC Window OS 帶進 Mac 的世界,而 Boot Camp 有著類同的功用,讓 Mac 在開機之際讓用家選擇載入什麼視窗系統。兩著分別在於前者能夠讓用家在某一瞬間同時使用兩個不同的視窗系統,但電腦資源需要被瓜分,而後者則讓用家決定哪 一個視窗作業系統後,讓該系統完全利用整台電腦的資源執行作業。

使用 Boot Camp 需要執行 Boot Camp Assistant 程式,按程式指示一步一步做,到了一個地步被要求燒錄Window Drivers的光碟時遇上問題;放入了可寫入的光碟,按 "Continue" 卻沒有任何反應。

在 網上搜了一回,原來這是個已知但未修正的問題。在這個步驟其實只管選 "I already have a Mac Windows Driver disc",這當中所指的光碟正是隨 iMac 送來的 Mac OS Installation Disk。選了該選項後便依驟重新開機,進入 Window OS 進行安裝,選擇包含 BootCamp 字眼的硬碟,點選 Advance 再選 Format 來把硬碟由 Fat32 轉到 NTSF 格式以安裝 Window。

希望這篇文章可以讓遇到同樣情況的人有所幫助。

Did you like this? Share it:
Filed under: Apple No Comments
27Jan/110

NL:Nicholas Liu iPhone/iPad site

A jewellery designer client wish to expands his Flash website to be compatible with iPhone and iPad. I make another iPhone/iPad web site version for him.

http://nicholas-liu.com/

Did you like this? Share it:
Filed under: Uncategorized No Comments
27Jan/110

The YesterdaySkin v2

客戶的網站 The YesterdaySkin 商品進新貨了,縱然跟之前作對比充滿另一份感覺,然而亦依舊貫徹網站宗旨:Let me be your second skin.

Bringing the past back to present, The Yesterdayskin is a very personal label collecting reformed vintage pieces. We hand-pick forgotten outfits and accessories all over the world, restyle and reconstruct them into new fashionable looks. The pieces are unique yet affordable, we want to share with all fashion lovers the treasures we found from history.
We offer free shipping worldwide with no minimum purchase. Every piece exists in one sample only, you are welcomed to reserve any items here.

Online e-shop, PayPal supported

Did you like this? Share it:
Filed under: Uncategorized No Comments