This blog has moved! Redirecting...
You should be automatically redirected. If not, visit http://scrolls.mafgani.net/ and update your bookmarks.

Friday, February 24, 2006

Prosper & PDF Output

Prosper cannot be used with PDFTeX and hence PDF files must be obtained via the DVI -> PS -> PDF route. The default ps2pdf conversion, however, generates a PDF with pages that are a bit too narrow. This is easily remedied by specifying the size of the output desired to the ps2pdf program:


$ ps2pdf -dDEVICEWIDTHPOINTS=x -dDEVICEHEIGHTPOINTS=y somefile.ps


Where 'x' is the width in and 'y' is the height in 1/72" units. So, for an approximately A4 size output, 'x'=595 & 'y'=842.

Thursday, February 16, 2006

Important locations in Linux

For a beginner migrating from Windoz, this is pretty confusing. So, I'm just going to put some information here that comes from a December 2, 2005 mail to the Fedora list.

Basic executables: /bin

Userland executables: /usr/bin

System executables: /sbin and /usr/sbin

Personal programs: ~/bin

Some programs end up in /usr/local/bin or /opt/bin.

Few are hidden in /lib and /usr/lib and some other places.

To find where a command resides, do:


type commandname


A list of the commands built into the shell can be gotten by typing "help" to the command prompt.

Non-builtin commands documentation is available by typing "man commandname".

The Linux Documentation Project (TDLP in short) provides a lot of information - especially for users migrating from Windoz to Linux.

Tuesday, February 14, 2006

BASH Commands

Thursday, February 09, 2006

Removing old kernels using yum

I found this neat and tidy method of removing old kernels. Before, I used to do this:


[root@localhost ~]# rpm -e kernel_name


But I have just come across a way of doing the same using yum. That way, you save time because you don't have to remove each one manually. It also prevents you from making mistakes and leaves the latest two kernels intact. First, you need to get "yum-utils".


[root@localhost ~]# yum install yum-utils


Then, simply remove all your old kernels!


[root@localhost ~]# package-cleanup --oldkernels


And you're done already! To check which kernels your system still retains, do:


[root@localhost ~]# rpm -qa | grep kernel


Nice, no?

Friday, February 03, 2006

Tesselated Cells

Finally .. a script that will generate a square field of tesselated cells in MATLAB. The script take as input the desired cell radius and the dimension of the square field.

Generating a cell is simple enough. The corners are simply R*exp(j*(-pi:pi/3:pi)+pi/6)/cos(pi/6). The additional pi/6 is needed to rotate the resulting hexagon. The real challenge is in the tesselation. In order to achieve that, two base vectors that govern the tesselation must be defined:


vi = 2*R;
vj = 2*R*(cos(pi/3) + j*sin(pi/3))


Using these base vectors, the centers of every cell in the tesselation can be defined:


for a = 1:x
for b = 1:x
centr(a,b) = a*vi+b*vj;
end
end


One we have the centers, use the MATLAB repmat function to replicate the corners around each of the centers to get the tesselated cells:


cells = repmat(corners.', 1,...
numel(centr))+repmat(reshape(centr.',1,...
numel(centr)),length(corners), 1);


A plot of the cells can be achieved using:


plot(real(cells),imag(cells));


This will however, generate a tesselation that is skewed. The linked *.m file takes care of that issue to generate a square tesselated field.