Custom Search

Tuesday, April 11, 2017

530 Valid hostname is expected.

When connecting to IIS7 using FTP you get the following error.
Response: 530 Valid hostname is expected.
Error: Could not connect to server
Reason
When you set up name-based FTP services IIS7 wants the site name defined with the username so that IIS7 can associate the username with the site they wish to log in to.
Host: Mydomain.com
User: Mydomain.com|Username
Works with Filezilla

Sunday, August 14, 2016

Heal

Take the time to fully develop.
Rejection breeds Obsession
Blame people for all the good.

Monday, September 21, 2015

Adobe Flash CC with Kinect v2 problem

When I test movie in Adobe flash, the Kinect BodyBasicsWPF acts a little crazy and goes into a multiple loop. It also crashes my Windows 10 machine over time. The blue screen of death appears and shows some video problem.

However, compiling it in adobe air and running the exe file is ok.

I'm using sockets to send the hand coordinates to flash.


Thursday, July 25, 2013

Adobe CS6

While Adobe has been pushing their Creative Cloud, I am one of the unfortunate ones stuck with CS4,CS5,CS5.5 and CS6 licenses.
Recently, an update from CC made my adobe media encoder which is installed in Flash Professional CS6 unable to encode f4v files. There are just too little information on troubleshooting AME CS6. Therefore, I am posting this. 
only works for CS4 and strangely enough, I found the shortcut to CS4 under the folder C:\Program Files\Common Files\Adobe\dynamiclink. 
Anyway, I had to uninstall and reinstall Flash Pro with Media Encoder inside. Still no luck!
After that I tried looking at the encoder and realised that it works for 5.1 level under video settings! This is probably due to the high resolution of the video which was 3072 x 768.

Monday, August 13, 2012

Using OpenSSL


WARNING: CAN’T OPEN CONFIG FILE: /USR/LOCAL/SSL/OPENSSL.CNF


In Command Prompt type the following before running the openssl command

set OPENSSL_CONF=c:\[PATH TO YOUR OPENSSL DIRECTORY]\bin\openssl.cfg

then whatever... The following was lifted from adobe:
http://help.adobe.com/en_US/as3/iphone/WS144092a96ffef7cc-371badff126abc17b1f-7fff.html


Convert an Apple developer certificate to a P12 file on Windows

To develop iPhone applications using Flash CS5, you must use a P12 certificate file. You generate this certificate based on the Apple iPhone developer certificate file you receive from Apple.
  1. Convert the developer certificate file you receive from Apple into a PEM certificate file. Run the following command-line statement from the OpenSSL bin directory:
    openssl x509 -in developer_identity.cer -inform DER -out developer_identity.pem -outform PEM
  2. If you are using the private key from the keychain on a Mac computer, convert it into a PEM key:
    openssl pkcs12 -nocerts -in mykey.p12 -out mykey.pem
  3. You can now generate a valid P12 file, based on the key and the PEM version of the iPhone developer certificate:
    openssl pkcs12 -export -inkey mykey.key -in developer_identity.pem -out iphone_dev.p12
    If you are using a key from the Mac OS keychain, use the PEM version you generated in the previous step. Otherwise, use the OpenSSL key you generated earlier (on Windows).

Thursday, January 19, 2012

《天與地》 片尾曲 《年少無知》

After watching this Hong Kong Drama, it shows how real dramas can be.
My ex-partner was a liar and planned his exit 6 months before he quit. He registered an Interactive Technology company (even the company write up was similar to mine) in 2010 under the name of his friend and cousin (based on his lies) and claimed that he was only a technology consultant to them while he was a partner and employee drawing a salary from my company.
In order to free himself of more time to do projects for his other company behind my back, he got his wife to fake a case of catching him cheating on her and giving him hell. Threatening to divorce him etc. His wedding was happily held in 2011. Photos of the projects he did for his cousin's company was on Facebook and some had his wife in it as well. With a big smile of course.
He claims that he was caught in-between kinship (his cousin) and his partner,me. Therefore he did not disclose anything to me. And that he was obliged to help his cousin. That ass should have just quit. Now he is just a liar, betrayer and his conscience will prick him one day. I don't have to do anything to him. May he wake up one day and realize that he has done me wrong.

《天與地》 片尾曲 《年少無知》

作曲:黃貫中
填詞:林若寧
編曲:黃貫中、劉志遠
歌曲監製:黃貫中
主唱:林保怡、陳豪、黃德斌

林︰年少多好 頑劣多好
Good to be young, Good to be wild
不甘安於封建制度裡 迷信上街真理會達到
Not contented with the feudal system, believing that the truth will be found on the streets
旗幟高舉 群眾聲討
Rally with banners, despite public condemnation
不惜犧牲一切去上訴 權貴的想法太俗套
Sacrifice everything to appeal/promote, good ideas are too conventional
只可惜生活是一堆挫折 只可惜生命是必須妥協
It's a pity that life is a string of setbacks, a pity that we need to compromise in life

陳︰年少多好 貧困多好
Good to be young, good to be poor
一蚊積蓄足以快樂到 廉價結他抒發我暴躁
When a cent can make you happy, and a cheap guitar can express your frustrations
財富得到 年歲不保
When fortune is gained, life has passed
捐輸不必講究有回報 人世間總會有異數
Don't need to expect anything when you give, there will always be surprises in life
只可惜生活是一聲發洩 只可惜生命是一聲抱歉 怕追到
Its a pity that life is a howl of frustrations, a pity that life is but a word sorry, when the time comes.
合︰如果 命運能選擇
If we can choose our fate
十字街口 你我踏出的每步更瀟灑
We can navigate our crossroads with more flair
如果 活著能坦白
If life can be lived with honesty
舊日所相信價值 不必接受時代的糟蹋
Old values will not succumb to anachronism.

黃︰年少多好 朋友多好
Good to be young, good to have friends
一番爭執不會有被告 遊戲競爭不會記入腦
no dispute without a defendant, rat race will not be remembered
年歲增長 無法修補
Grow older, no way to make amendments
青春的詩總會老 時間多恐怖
The young chief poet will grow old, time is a scary thing

合︰如果 命運能選擇
If we can choose our fate
十字街口 你我踏出的每步無用困惑
We can choose our paths at the crossroads without confusion
如果 活著能坦白
If life can be lived with honesty
舊日所相信價值 今天發現還未老
Old values, not too late to realize them today.
如果 命運能演習
If fate can be practiced
現實中不致接納 一生每步殘酷抉擇
Don't need to accept the reality of, the brutal choices of every step in life
留守 過去的想法
Remember the past experiences
我會否好像這樣 生於世上 無目的鞭撻
Will I be like this, living on this earth, in eternal torture.

Translation of lyrics done by JC. please give me your comments. thanks

Thursday, August 18, 2011

Winsock Error 11004

The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for.

When the socket client shows this error, one of the issues might be due to a duplicate computer name in the same network. Change the computer name and it should be ok.


Thursday, April 7, 2011

Solution to Contacts Appearing Offline on Windows Live Messenger 2011.

I experienced this problem when I had to urgently send small files to and from my partner. We were working on a website project where he did the design work and I did the PHP programming. Boy do I hate website programming. Simple layouts, arranging text, fonts, all the mundane stuff. I prefer C++ with all the socket programming, image processing, mathematical algorithms etc.
Anyway, I tried Step 1 and 2 below but it still didn't work. So step 3-5 is for the people who had the same unfortunate experience as me.
Good Luck!


  • 1
    Sign out and exit MSN 2011
  • 2
    Go to Control Panel >> Programs >> Programs and Features >> Choose Windows Live Essentials 2011 and click on Uninstall/Change, Finally in the popup window, choose Repair All Windows Live Programs.
  • 3
    Go to C:\Users\WINUSERNAME\AppData\Local\Microsoft . Delete the Windows Live Contacts folder (AppData is a hidden folder so be sure to change your folder settings)
  • 4
    Go to C:\Users\WINUSERNAME\ delete the Contacts folder
  • 5
    If after signing in the problem persists go to C:\Users\WINUSERNAME\AppData\Local\Microsoft\Messenger . Backup the entire folder yourmsnuser@hotmail.com and then proceed to delete it. If you have emoticons and display pictures you will then be able to restore them from the backup.
  • Tuesday, March 29, 2011

    Adobe Flash CS5 AS2 problem some characters not showing in Dynamic text box

    I am experiencing the same problem as below:

    Problem:
    if (day() == Saturday){
    tomorrow.text = "Sunday";
    }
    displays Suday instead of Sunday

    Solution:
    Try selecting the text field, the hit "character embedding" in the property inspector. Select basic Latin and Latin I

    Select selection tool ---> select the Text Field ---> Go to the Properties pannel ---> Anti-alias ---> Use Device Fonts

    1) Select the dynamic textbox that isn't showing up when your swf is published.
    2) In the Properties panel under Character, click the [Embed...] button
    3) Name your font symbol exactly the same name as the base font. If you're using Arial Bold, call it Arial. Any other name didn't work for me. (I don't know what happens if you need Arial and Arial Bold in the same file)
    4) Select the character ranges and enter any custom characters to include.
    5) Click the ActionScript tab at the top of the dialog & check "Export for ActionScript" - the Identifier should populate with your font name.
    6) In the Properties panel under Character, change the Family selection to your new custom font (it should appear near the top of the list as Fontname*

    Based on other suggestions in this thread, I turned off "selectable text" as an option. (Properties panel, small icon in the Character group, lower left hand corner). Text then displays OK in player - I did not make any other changes.



    Found these solutions online but haven't tried it yet. Will try soon.

    Friday, March 18, 2011

    Data Execution Prevention pop with Windows Explorer

    My Windows XP SP3 recently had a weird problem. Any video file that I click on in windows explorer triggered the Data Execution Prevention message keeps popping up and closing my windows explorer.
    I overlooked the option to turn OFF DEP when both options say Turn on DEP etc etc....
    Only on a desperate second look did I find out that the second option had the word "except"! argh!

    Tuesday, February 22, 2011

    127 hrs of programming

    Here are the problems encountered with the latest projects especially when Windows when all cranky with me.

    Temp profile when I logged in. After searching, the answer was to backup everything, delete the temp profile under the following
    control panel -> Advanced System Properties -> Advanced -> User Profiles -> Settings
    and delete the temp profile.
    Reboot.

    When this happened, all the links in Visual Studio and some stupid programs like grapheditplus requires you to register again.
    Using #include iphlpapi.h

    was a pain cos you have to link the include and lib path all over again.
    then add

    #ifndef WIN32_LEAN_AND_MEAN
    #define WIN32_LEAN_AND_MEAN #endif  
    #include windows.h

    So that it will use winsock2.h instead of winsock.h

    Grayscale

    "In computing, although the grayscale can be computed through rational numbers, image pixels are stored in binary, quantized form. Some early grayscale monitors can only show up to sixteen (4-bit) different shades, but today grayscale images (as photographs) intended for visual display (both on screen and printed) are commonly stored with 8 bits per sampled pixel, which allows 256 different intensities (i.e., shades of gray) to be recorded, typically on a non-linear scale. The precision provided by this format is barely sufficient to avoid visible banding artifacts, but very convenient for programming due to the fact that a single pixel then occupies a single byte."
    Life is Grayscale. I tried living life with 1's and 0's. The only thing I got was misery. Betrayal, Breach of trust, Deception, Dishonesty, Jealousy, Dissatisfaction, Discontent, Uneasiness.
    Everybody is bad and good at some point in time. If you calculate the number of 1's or 0's for a person, you get more 0's than 1's. Using 0-255 in Grayscale would be better. You can paint the person literally.
    The problem is when there's a large dark patch its hard see the rest of the Grayscale image properly. The trust is gone, disappointment kicks in, the guard comes back up, the mask is on. Back to the game of life. Humor me.
    Stereotypes of categories of people always seem to be true. Classification, horoscopes, palmistry, micro-espressions, nurture, family background, education, etc. Combine everything and the Grayscale image is mapped out. Usually, its the corrupted image of the devil.
    Some traits are so innate that regardless of society and nurture, the person is still that stereotypical shade of gray. Damn! how i hope that friend didn't turn out that way. Too bad that's life.
    If you think Windows is unpredictable, think again... its nothing close to your closest friend.

    Wednesday, January 5, 2011

    Jealousy

    The warped human mind. An emotion typically of negative thoughts and feelings of insecurity, fear, and anxiety over an anticipated loss of something that the person values, such as a relationship, friendship, or love.
    The talent I have, the passion I have in computer programming, the creative problem solving skills that has proven to be triumph with every memory leak I solved, every database conflict I resolved with vendors providing amateurish coding skills and employees with supposedly good logical programming skills.
    I used my savings from being a researcher to start my small passion and I'm still struggling in this world 7 months after I started. 17 months ever since I started planning for it. Constantly multi tasking between multi touch technologies and my father's business.
    How heaven plays with people. A god sent "son". My age, my talent but a different field. A money making one. One that my father would love. On the way to marriage with a gorgeous wife. A trap he laid perfectly to allow my father to let him use his fortune to build his own.
    Why do I care? Why am I jealous? My father has seen what I can do. He has seen what this pseudo-son of his do...or has he? The game has just begun. He has no idea what this pseudo-son has up his sleeve. With his guard down with my father triumph? I warned him. I have done my duty to warn him. Its up to him to pay for his lesson.
    I want to stick to my passion. I can take over his business. I can join the money making entrepreneurial passionless rat race or know that my interactive technology is never going to be scalable with the meager capital. Never in time at least before I have to join the rat race that my father needs me to take over so that he can retire. Time is running out.

    Saturday, November 27, 2010

    Samsung Galaxy Tab M1 settings

    Name: sunsurf internet
    APN: sunsurf
    Proxy: not set
    Port: not set
    User name: +65
    Password: user123
    Server: Not Set
    MMSC: http://mmsgw:8002
    MMS proxy: 172.016.014.010
    MMS port: 8080
    MCC: 525
    MNC: 03
    Authentication type: None
    APN type: internet + mms


    Friday, November 26, 2010

    Flash Export to Quicktime mov

    When exporting to Quicktime movie, make sure that there is no stop(); inside the as code. If there is, it will hang at "Recording Flash content".
    This export function works for timeline written Flash and not purely AS written Flash. I exported a movie that loaded everything with Flash and it was only a clip that is half a second long. Therefore, you will have to specify the length of the movie manually.

    Monday, August 30, 2010

    php mail() function

    When using smtp.gmail.com, gmail will automatically change the From: field to the account.

    $receiverName = "receiver name";
    $to = "to@hotmail.com";

    $senderName = "sender name";
    $senderEmail = "sender@hotmail.com";

    $subject = "Hi $receiverName, Email From $senderName";

    $fileatt = 'image.jpg';

    $fileatttype = 'image/jpeg';

    $fileattname = 'image.jpg';

    $file = fopen( $fileatt, "r" );

    $data = fread( $file, filesize( $fileatt ) );

    fclose( $file );

    $dataencode = chunk_split(base64_encode(file_get_contents('image.jpg')));

    $mime_boundary='==Multipart_Boundary_x'.md5(mt_rand()).'x';

    //reply to field allows the reply to one sender.
    // but from field will still show 2 senders

    $headers = "From: $senderEmail \r\n" .
    "Reply-To: $senderEmail \r\n".
    "MIME-Version: 1.0\r\n" .
    "Content-Type: multipart/mixed;" .
    "boundary=\"$mime_boundary\";\n\n"
    ;

    $message = "--$mime_boundary\n";
    $message .= "Content-Type: text/plain; charset=UTF-8\n";
    $message .= "Content-Transfer-Encoding: 8bit\n\n";
    $message .= "Thank You.\n\n";

    $message .= "--$mime_boundary\n" .
    "Content-Type: image/jpeg;\n" .
    " name= image.jpg \n" .
    "Content-Disposition: attachment;\n" .
    " filename= $fileattname \n" .
    "Content-Transfer-Encoding: base64\n\n" .
    $dataencode . "\n\n" .
    "--$mime_boundary--\n";
    $message1 = "test";

    $mail_sent = @mail( $to, $subject, $message1, $headers."From: $senderName<$senderEmail>");
    //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
    echo $mail_sent ? "Mail sent" : "Mail failed";


    Will result in the From field being your gmail regardless of what you key in.

    However, if you use Yahoo email smtp server, the From: field will not be automatically changed and the result will be your desired one.

    change the mail function to the following when using gmail smtp servers:

    $mail_sent = @mail( $to, $subject, $message1, $headers."From: $senderName<$to>");

    So that your default gmail account will not be seen. However, in the original message properties, it will still be shown for both yahoo and gmail.

    Tuesday, August 17, 2010

    smtp server settings

    gmail

    smtp.gmail.com
    Port 465, Implicit TLS. Protocol always starts with TLS.

    smtp.bizmail.yahoo.com
    Port 25, Do not use TLS

    smtp.mail.yahoo.com
    Port 25, Do not use TLS

    smtp.live.com
    port 25, SSL enabled

    Sunday, August 8, 2010

    How to connect your iphone to your laptop wifi ad-hoc

    Some hotels don't have wireless internet connection and they only have a wired LAN and unfortunately, iphone can't connect to the internet via the usb unlike windows mobile phones.

    Here's how to setup a wireless adhoc network on windows xp and connect your iphone to your laptop to use the LAN.

    Go to wireless network connection properties,

    Add... a new Preferred networks:

    Enter a new SSID, wireless network key of your choice,

    Then click ok

    Next, Highlight both your LAN and Wireless Network Connection

    Right click and create a network bridge

    Done!

    You should see that your wireless Network Connection is not connected but the Network bridge is connected when you connect your phone.

    This should work like a normal wireless router and no additional configurations should be needed on your phone.

    Cheers!

    Wednesday, February 24, 2010

    opencv read xml file contents

    I spent 1 hour trying to find out what was the problem of reading the contents of an xml file.

    When reading a single parameter,

    eg. 0

    you have to use cvReadIntByName

    When reading multiple parameters

    eg. 0 30 200 10 3

    you have to use CvSeq* s = cvGetFileNodeByName(fs,0,"calibration")->data.seq;

    then cvReadInt( (CvFileNode*)cvGetSeqElem(s,index) );

    My problem was I was reading a single parameter and I used the second method but specifying index = 0. This doesn't work! CvSeq* s returns rubbish when there is only 1 parameter.


    Thursday, February 11, 2010

    Create EXE from SWF

    Create a new project Flex project
    Application Type web application (not Desktop Application which becomes *.air)

    In your Flex SDK folders you should see a 'runtimes\player\win\FlashPlayer.exe' which is a stand alone Flash player. Open your SWF with that and you'll see a 'Create Projector...' menu item in the File menu which will create the stand-alone EXE.