Thursday, February 23, 2012

How to include a bitmap file in LaTeX

http://www.tug.org/pipermail/texhax/2007-February/007805.html

Graphics(jpg) Inclusion:
http://mactex-wiki.tug.org/wiki/index.php?title=Graphics_inclusion

How to input a graphics to latex file
http://en.wikibooks.org/wiki/LaTeX/Importing_Graphics


\begin{figure}[htb]
\centering
\includegraphics[width=0.8\textwidth]{image.png}
\caption{Awesome Image}
\label{fig:awesome_image}
\end{figure}


Monday, February 20, 2012

Dynamic Allocation Array Size & Linux getch

http://www.eecs.harvard.edu/~ellard/Q-97/HTML/root/node55.html#mem2cC


#include <stdlib.h>
#include <stdio.h>
#include <termios.h>
#include <unistd.h>

//#include <conio.h>

int mygetch(){
struct termios oldt,
     newt;
int ch;
tcgetattr( STDIN_FILENO, &oldt);
newt = oldt;
newt.c_lflag &= ~( ICANON | ECHO);
tcsetattr(STDIN_FILENO, TCSANOW, &newt);
ch = getchar();
tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
return ch;
}

int main(){

int* array;
int n,i;
printf("Enter the number of elements: ");
scanf("%d",&n);
array = (int*) malloc (n*sizeof(int));
for (i=0; i<n ;i++){
printf("Enter number %d: ", i);
scanf("%d", &array[i]);
}
printf("\nThe Dynamic Array is: \n");
for (i=0; i<n; i++){
printf("The value of %d is %d\n", i, array[i]);
}
printf("Size = %d\n", i);
// mygetch();
free(array);
return 0;
}

References:
http://www.roseindia.net/c-tutorials/c-dynamic-array.shtml

Substitute getch() with mygetch()
http://cboard.cprogramming.com/faq-board/27714-faq-there-getch-conio-equivalent-linux-unix.html

Termios.h
http://pubs.opengroup.org/onlinepubs/007908799/xsh/termios.h.html

General Terminal Interface:
http://pubs.opengroup.org/onlinepubs/007908799/xbd/termios.html

What is termios?
Terminal Concepts in GNU/Linux:
http://frank.harvard.edu/~coldwell/terminals/



Chip's Homepage:
http://frank.harvard.edu/~coldwell/
Paul Horowitz Seti Group in Harvard
http://seti.harvard.edu/

Linux Device Driver (Chinese Version):
http://oss.org.cn/kernel-book/ldd3/
http://oss.org.cn/html/index.html


Saturday, February 18, 2012

gcc to g++


gcc +file
Report error:

/tmp/ccBX1Jz9.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

switch to g++