2006/01/13

[JavaScript] Quick cheatsheet

comments:
// comments
/* comments */

keywords:
break, do, if, switch, typeof, case, else, in, this , var, catch, false, instanceof, throw, void, continue, finally, new, true, while, default, for, null, try, with, delete, function, return

reserved words:
abstract, enum, int, short, boolean, export, interface, static, byte, extends, long, super, char, final, native, synchronized, class, float, package, throws, const, goto, private, transient, debugger, implements, protected, volatile, double, import, public

variables:
var variableName = assignedValue;

objects:
var o = new Object();
o.x = 1; o.y=2;
o["x"]=1; o["y"]=2;

arrays:
var a = new Array();
var a = new Array(10);
var a = new Array(1,2,3,4,5);
var a = [1,2,3,4,5];

functions:
function abc() {
// methods
}

JavaScript in HTML:
<script language="javascript">
//code
</script>

<script language="javascript" type="text/javascript" src="source.js"></script>

Event handlers:
<tag onclick="alert('Hello');">

2006/01/05

[Mac] ShortCut for Screenshot

Useful shortcut for capturing screenshots on a Mac

Apple + shift + 3 => Full Screen
Apple + shift + 4 => Selected Area
Apple + shift + 4 + space => Selected Window

2006/01/04

[Mac] C++ Programming

Do C++ Programming in a Mac machine

Here is a simple code (Hello World): Save file as test.cpp

#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!\n\n";
return 0;
}


Compile:
(make output file named test.out)
g++ test.cpp -o test.out

Excute output:
./test.out

2006/01/03

[Mac] Remote Windows Desktop

Remote Desktop Connection Client for Mac
from Microsoft
This is a remote desktop client for mac user.

Connect Steps:
  1. Download the client software from the link above.
  2. Make sure Windows remote control access is allowed.
  3. (My Computer->Properties->Remote->check "Allow users to connect remotely to this computer"->OK)
  4. Open Remote Desktop Connection -> type remote IP address
  5. Enter Windows access username and password
  6. Control Remote Windows!