Monday, July 31, 2006

[Matlab]Functions

B = squeeze(A):

Remove the singleton dimension;
Remove the dimensions of size 1;
Remove the redundant dimensions.

B = repmat(A,[m n p...]):

Replicate and tile an array

B = sub2ind(size,sub1, sub2, ...);
B = ind2sub(size, index);

Convert subscripts to index or vice versus

profile on;
...
profile viewer;

Profile execution time for function

[ENGL] Old Chinese Saying

An artisan must first sharpen his tools if he is to do his work well.

Thursday, July 27, 2006

Tuesday, July 18, 2006

Monday, July 17, 2006

[Matlab] reshape

OUT = reshape(IN, [m n p ...] );
For input matrix IN, the data to be taken is of the following order:

IN[1,1,1,...];
IN[2,1,1,...];
IN[3,1,1,...];
...
IN[1,2,1,...];
IN[2,2,1,...];
...

Similarly, the data to be assigned in output matrix OUT is of the following order:

OUT[1,1,1,...];
OUT[2,1,1,...];
OUT[3,1,1,...];
...
OUT[1,2,1,...];
OUT[2,2,1,...];
...

Monday, July 10, 2006

[CPP] Using const

Source:
Declaring a const variable
  • General Rule: The 'const' qualifier works on everything on the left of it.
  • Convention: If a type T is not a reference or a pointer, a constant variable of type T can be declared by putting 'const' in front of T
Passing reference-to-const v.s. passing pointer-to-const
Taking the pointer to a temporary is not allowed but it is possible to pass a temporary to a function as a reference-to-const:
void foobar(T const&);
foobar( T() ); // Allowed.
Constant/non-constant method and constant/non-constant returned value
class Foo
{
public:
/*
* Modifies m_widget and the user
* may modify the returned widget.
*/
Widget *widget();

/*
* Does not modify m_widget but the
* user may modify the returned widget.
*/
Widget *widget() const;

/*
* Modifies m_widget, but the user
* may not modify the returned widget.
*/
const Widget *cWidget();

/*
* Does not modify m_widget and the user
* may not modify the returned widget.
*/
const Widget *cWidget() const;

private:
Widget *m_widget;
}
  • Const method: A method that does not modify the member variables of a class. Calling non-constant methods within a const method is not allowed.

Friday, July 07, 2006

[FINANCE] Site Links

MarketingShift

San Diego Source | San Diego Daily Transcript

I saw some investing info from the columnist Brent Wilsey

楚狂人的Blog

(Trad. Chinese)

Thursday, July 06, 2006

[HTML] Special Characters

Source:

http://www.w3.org/MarkUp/html-spec/html-spec_13.html

REFERENCE DESCRIPTION
-------------- -----------
� -  Unused
	 Horizontal tab

 Line feed
 -  Unused

 Carriage Return
 -  Unused
  Space
! Exclamation mark
" Quotation mark
# Number sign
$ Dollar sign
% Percent sign
& Ampersand

' Apostrophe
( Left parenthesis
) Right parenthesis
* Asterisk
+ Plus sign
, Comma
- Hyphen
. Period (fullstop)
/ Solidus (slash)
0 - 9 Digits 0-9
: Colon
&#59; Semi-colon
< Less than
= Equals sign
> Greater than
? Question mark

@ Commercial at
A - Z Letters A-Z
[ Left square bracket
\ Reverse solidus (backslash)
] Right square bracket
^ Caret
_ Horizontal bar (underscore)
` Acute accent
a - z Letters a-z
{ Left curly brace
| Vertical bar
} Right curly brace
~ Tilde
 - Ÿ Unused

  Non-breaking Space
¡ Inverted exclamation
¢ Cent sign
£ Pound sterling
¤ General currency sign
¥ Yen sign
¦ Broken vertical bar
§ Section sign
¨ Umlaut (dieresis)
© Copyright
ª Feminine ordinal
« Left angle quote, guillemotleft
¬ Not sign
­ Soft hyphen
® Registered trademark
¯ Macron accent
° Degree sign

± Plus or minus
² Superscript two
³ Superscript three
´ Acute accent
µ Micro sign
¶ Paragraph sign
· Middle dot
¸ Cedilla
¹ Superscript one
º Masculine ordinal
» Right angle quote, guillemotright
¼ Fraction one-fourth
½ Fraction one-half
¾ Fraction three-fourths
¿ Inverted question mark
À Capital A, grave accent
Á Capital A, acute accent

 Capital A, circumflex accent
à Capital A, tilde
Ä Capital A, dieresis or umlaut mark
Å Capital A, ring
Æ Capital AE dipthong (ligature)
Ç Capital C, cedilla
È Capital E, grave accent
É Capital E, acute accent
Ê Capital E, circumflex accent
Ë Capital E, dieresis or umlaut mark
Ì Capital I, grave accent
Í Capital I, acute accent
Î Capital I, circumflex accent
Ï Capital I, dieresis or umlaut mark
Ð Capital Eth, Icelandic
Ñ Capital N, tilde
Ò Capital O, grave accent

Ó Capital O, acute accent
Ô Capital O, circumflex accent
Õ Capital O, tilde
Ö Capital O, dieresis or umlaut mark
× Multiply sign
Ø Capital O, slash
Ù Capital U, grave accent
Ú Capital U, acute accent
Û Capital U, circumflex accent
Ü Capital U, dieresis or umlaut mark
Ý Capital Y, acute accent
Þ Capital THORN, Icelandic
ß Small sharp s, German (sz ligature)
à Small a, grave accent
á Small a, acute accent
â Small a, circumflex accent
ã Small a, tilde

ä Small a, dieresis or umlaut mark
å Small a, ring
æ Small ae dipthong (ligature)
ç Small c, cedilla
è Small e, grave accent
é Small e, acute accent
ê Small e, circumflex accent
ë Small e, dieresis or umlaut mark
ì Small i, grave accent
í Small i, acute accent
î Small i, circumflex accent
ï Small i, dieresis or umlaut mark
ð Small eth, Icelandic
ñ Small n, tilde
ò Small o, grave accent
ó Small o, acute accent
ô Small o, circumflex accent

õ Small o, tilde
ö Small o, dieresis or umlaut mark
÷ Division sign
ø Small o, slash
ù Small u, grave accent
ú Small u, acute accent
û Small u, circumflex accent
ü Small u, dieresis or umlaut mark
ý Small y, acute accent
þ Small thorn, Icelandic
ÿ Small y, dieresis or umlaut mark

[SOFTWARE] List of my favorites

ExamDiff

http://www.prestosoft.com/ps.asp?page=edp_examdiff
A freeware to compare text or binary files.

PSPad

A free text editor for various programming languages. Download

VirtuaWin

Virtual Desktops for Windows

Personal Brain

A thought mapping tool. Download