Tuesday, August 1, 2017

Resources

OneNote

Repository


Links


Saturday, July 16, 2016

How to transfer Video (mp4 etc) to IPhone 6/6s/6 plus

Download the latest ITune (mine 12.4.16). Plugin your IPhone, select the phone icon as follows

1. On Summary Page, manually manage music and video


2. On Movies Page (under On My Device), just drag and drop will do.



Thursday, June 30, 2016

Gmail Cannot Retrieve Hotmail via POP3

If you cannot retrieve Your Hotmail Account in Your Gmail Account via POP3, and got the following information in gmail
「Authentication failure: unknown user name or bad password. [Error="ProxyNotA...」
that is because All Hotmail accounts are being moved to Office 365 Servers, and that turns off the POP3 service, to reenable it, do the following in Hotmail:

Settings -> Options -> POP and IMAP -> Yes -> SAVE
Viola! You are able to access your Hotmail in Gmail again. 
Btw, Hotmail now allows forwarding email to Gmail too, you can try it in Settings -> Options -> Forwarding. I try it, it works, just that those email is marked by Gmail with "This message may not have been sent by:".

Friday, February 12, 2016

How to embed all fonts in WinEdt for PDF

1. How to include all fonts

If you are using Adobe Acrobat Pro X and above:

Go to Tools>Preflight

Type in Embed in the keyword, you will get Embed fonts under PDF fixups, click Analyse and fix to fix it.

2. How to remove bookmarks

  • Remove the \hyperref pacakge in latex
  • Print the PDF into another PDF will do.
To check whether all fonts are really embedded, See how to check all fonts are embedded using adobe reader.

Sunday, January 31, 2016

How to Run in Cgywin from C#

Use the following code:

public  string runCygwin()
        {

            using (Process p = new Process())
            {

                /*Use the bash shell in cygwin folder*/
                ProcessStartInfo info = new ProcessStartInfo(@"D:\cygwin64\bin\bash");

                /*Put the command to be run in test.bsh*/
                info.Arguments = @"--login ""/cygdrive/D/C_Drive/Desktop/z3-str/tests.bsh""";

                /**Side Info:Content in test.bsh file**/
                string bshContent =
                    "/cygdrive/D/C_Drive/Desktop/z3-str/Z3-str.py -f " +
                    "/cygdrive/D/C_Drive/Desktop/z3-str/tests/Concat001";

                info.RedirectStandardInput = true;
                info.RedirectStandardOutput = true;
                info.UseShellExecute = false;
                p.StartInfo = info;
                p.Start();
                string output = p.StandardOutput.ReadToEnd();
                // process output
                return output;
            }
        }

Monday, January 11, 2016

Some JavaScript Special Scenarios

for (i = 0,j=0; i < 3, j < 2; i++,j++) {
    console.log(i+" "+j)
}
The answer is 0,0 and 1,1 only j<2 applies
function f(a) {
  var a;
  alert(a);
}

f(4);
The answer is 4, since variable in javascript only has local and global scope

Original source
    for (i = 0,j=0; i < 3, j < 2; i++,j++) {
        console.log(i+" "+j)
    }

The answer is 0,0 and 1,1
only `j<2` applies


    function f(a) {
      var a;
      alert(a);
    }

    f(4);

The answer is 4, since variable in javascript only has local and global scope

Saturday, January 9, 2016

How to Point GoDaddy Domain to Amazon EC2

You bought a domain from GoDaddy, and you have a server on Amazon EC2, perfect, follow the following easy steps to point Godaddy domain to Amazon EC2 server.

Get Elastic IP from Amazon
On EC2 Management console, click on “Elastic IPs”, click on Allocate New Address

Click Yes, Allocate




You got the New Address assigned.





Right click the elastic IP, click Associate Address.





Choose the instance you are running





Use the default values for all textboxes, Click Associate




Configuration for GoDaddy
Login into your godaddy account, Under the upper menu click “Domains” and then click “Manage my Domains”, Select the domain you would like to change by clicking the link to the domain on the table under “Domain Name” column.
When you see the following screen select DNS Zone File

Click on Edit Record under A(Host), Edit the record to point to the Elastic IP address you have set just now



After that click on Save Changes


 That's it, have fun!