Archive for the ‘Education’ category

PDL Cheat Sheet

February 20, 2007
PDL 2.4.3 cheat sheet v2 by Lino Ramirez, Lino.M.Ramirez (at)
Piddles are stored in (column, row) order

perldl    exit    quit              help 'func'    ? 'func'
                                    apropos 'func' ?? 'func'
SHELL CONFIGURATION FILES           sig 'func'
$HOME/.perldlrc                     usage 'func'
PDL/default.perldlrc                demo
                              USING AUTOLOADER
WRITING PERL SCRIPTS          use PDL::AutoLoader;
use PDL;                      # environment variable PDLLIB defines
                              # the search path for AUTOLOADER module
new       pdl        topdl          TYPE CONVERSIONS
null      zeroes     ones           ushort    float    long  convert
identity  random     grandom        byte      double   short
randsym   sequence
xvals     yvals     zvals           FILE I/O
xlinvals  ylinvals  zlinvals        fits    wfits  rcols  wcols  rcube
rvals     axisvals  allaxisvals     rpic    wpic   rim    wim    rgrep

OPERATORS                           COPYING PIDDLES
+    -    *    /    **    >    <    $pnew = pdl( $pold );
>=   <=   ==   !=   <<    >>   &    $pnew = $pold->copy;
|    ^    +=   -=   *=    /=   %=
**=  >>=  <<=  &=   |=    ^=        EXTRACTING INFORMATION
<=>  !    %    ++   --              slice dice dice_axis diagonal

.=    assignation                   index  index2d   indexND    where
x     matrix multiplication         which  whichND   which_both

? vars    PDL->px    info           list      listindices      one2nd
dims      getdim     getndim        set       clip   rotate    xchg
howbig    nelem      at             reshape   mv     reorder   dummy
                                    transpose clump  splitdim
append   glue   cat   dog           ELEMENTARY MATH FUNCTIONS
                                    abs  acos  acosh asin asinh
VECTOR FUNCTIONS                    atan atan2 atanh cos  cosh
inner    outer    uniq              sin  sinh  tan   tanh sqrt
in       setops   norm              ceil floor rint  exp  log log10

stats   statsover   qsort           bessj0  bessjn  bessy0  bessyn
sum     sumover     cumusumover     erf     erfc    erfi    intover
max     maximum     maximum_ind     lags    lgamma  pcoef   simplex
avg     average     qsorti          fibonacci
min     minimum     minimum_ind
minmax  minmaximum  median          DATA INTERPOLATION
medover oddmedian   oddmedover      fitgauss1d  fitgauss1dr  fitpoly1d
prod    prodover    cumuprodover    interpol    interpolate  ninterpol
hist    histogram   histogram2d     interpND    lmfit
and     and2        andover         polfit      pvalue       polycoef
or      or2         orover          polyfit     polyvalue

inv  matinv eigens_sym  eigens      cquant rgbtogr rot2d med2d conv2d
svd  eigsys determinant det simq    warp2d rebin   convolveND

use PDL::Graphics::PGPLOT;          use PDL::Graphics::TriD;
dev  env  line  points  errb  bin   imag3d imag3d_ns imagrgb points3d
cont ctab vect  poly    imag        line3d lattice3d mesh3d grabpic3d
circle  ellipse    rectangle text   keeptwiddling3d  nokeeptwiddlin3d
legend  draw_wedge release   hold   twiddle3d  hold3d  release3d

use PDL::FFT;                       Cabs Carg Cp2r Cr2p i2C r2C
fft  fftnd  realfft realifft
ifft ifftnd cdiv    cmul            MISCELANEOUS FUNCTIONS
kernctr  fftconvolve                inplace  trace  thread
                                    band bandover bitnot bor borover
PDL MODULE DEPENDENCIES             all   any   isempty  zcheck
Perl 5.6.1+ (5.8.x recommended)
ExtUtils::MakeMaker (latest version)    LINKS
C-compiler   Fortran compiler 
PGPLOT libraries & C-binding (PGPLOT)
OpenGL or Mesa  (TriD)        
netpbm package (PDL::IO::Pic) 

Getting Started with PDL

February 13, 2007

Early this month, I wrote an introduction to the Perl Data Language (PDL). Here is the Introduction:

Imagine you, Just Another Perl Hacker, were assigned to this new project that involves heavy numerical computation. Most of your peers recommend you to use C or C++. Some others recommend you the language of the Snake -sorry I forgot the name ;-). What can you do if you really want to keep using Perl? Using PDL is the answer. The Perl Data Language (PDL) is a package that gives Perl the ability to compactly store and speedily manipulate the large N-dimensional data sets that are common in scientific and other data intensive programming tasks. To achieve such a great performance, PDL uses C (and sometimes Fortran) to efficiently handle multidimensional data sets. For the rest of the tutorial, I will assume you have a working copy of PDL already installed. Once you have PDL installed, you can use it in Perl scripts by simply declaring: use PDL;. If you have not yet installed PDL, I will recommend you to have a look at the Appendix for some of the pre-requisites for having PDL installed without problems. And if you get into troubles, I recommend you to ask in one of the PDL mailing lists or here at the Monastery. Now, we are ready to start.


The full tutorial is available at PerlMonks.




Programming systems for kids

January 19, 2007

I am starting to think about programming systems for kids. My son is 4 years old now. He likes to play with the computer, just like his dad. He also started to like the text editors I used when writing programs, specially because the colour of the words change depending on the combination of keys he presses. He is learning to read and write and I guess that he will be soon ready to start learning something more serious than playing Tux Racer. This brings me to the topic of this post, I recently read an article in the O’Reilly Radar about programming systems for kids. The comments for that post are including some good references, I will start checking in the near future. However, I would like to get other opinions. So, do you now of any programming system for kids that you would recommend? If so, please, tell me in the comments.



Perspectives on Free and Open Source Software

November 22, 2006

I found this Open Access Book: Perspectives on Free and Open Source Software. I believe that if you are reading this blog, that book will interest you. By the way, kudos to The MIT Press for providing a free version of the book.



A Beginners Guide to Fuzzy Rules-Based Systems

October 12, 2006

I just finished writing an introductory tutorial on Fuzzy Rules-Based Systems with Perl. I posted it on the Perl Monks’ website. This tutorial is part of a larger tutorial I am giving at the 4th World Forum on Free Knowledge this coming week in Venezuela.



Perl Monks, Granular Computing, and World Forum on Free Knowledge

October 1, 2006

Some days ago, I attained level 3 (Acolyte) in the Perl Monks. It is nice to see how my opinions are getting good reviews 🙂 . These days, I am working on a Granular Computing tutorial for the Perl Monks community. I plan to divide it into two posts:

  1. General Introduction: from information granules to granular computing; applications: image processing, data mining, signals processing, etc.; common frameworks for Granular Computing: Interval Analysis, Fuzzy Sets, Rough Sets; and finding information granules in a Fuzzy Sets framework.

  2. Plan for a Granular Computing Module: here I present what modules are needed in Perl to write a Granular Computing Module. My idea is that we should create several (small?) modules and combine them to create the Granular Computing module. For instance, we could have a Fuzzy Sets Module (there are already some modules in CPAN related to Fuzzy Sets, so our task would be to chose one and improve it), a Rough Sets Module, an Interval Analysis Module, and a Clustering Module (I already wrote a Fuzzy C-Means script, I certainly would be happy writing all the scripts needed in this area). Our Granular Computing Module would call on these modules and add some additional functionalities. The advantage of doing it this way is that if someone is interested only on an individual module (Fuzzy Sets, Interval Analysis, etc.) that person would not need to use the whole Granular Computing Module. Moreover, I expect it to be easier to maintain smaller modules. The only problem I see with this idea is related to dependences. In any case, I guess that I will be writing a lot of Perl code this coming year 😉

The last point on this post is related to the 4th World Forum on Free Knowledge. This Forum will take place in Maturin, Venezuela from October 17 to October 21, 2006. In the Forum, I will be giving a talk titled: Open Science: Utopia or Reality? In this talk, I describes what is needed to have a truly open science, muse on whether Open Science is attainable, and present some guidelines to help us make it a reality. In the Forum, I will also give a tutorial on Image Analysis using Free and Open Source Software. The tutorial focus on my research in using Granular Computing for image analysis. I will describe my experience with the ITK and the Perl’s AI::FuzzyInference module in my quest for finding a way to help content experts in analyzing images. I will post more on that later.



The Venezuelan Ministry of Education is taking Free and Open Source Software to every corner of the Country

July 18, 2006

The Venezuelan Ministry of Education is planning to take Free and Open Source Software to every public school in the country. Last week, the Venezuelan President inaugurated a CBIT (Bolivarian Centre of Information Technology) in a High school located in Caracas (Venezuela’s Capital City). The video of the event is available here. A CBIT is a computer centre using Free and Open Source Software runing on Linux that is available for students during the day and for the general public at night. This week, 227 CBIT’s will be inaugurated all over the Country taking the total number of CBIT’s in Venezuela to 664. The Ministry of Education is planing to take the number of CBIT’s to 1000 by the end of this year.

As a clarification note: about 150 CBIT’s that were inaugurated 3 years ago still run on Windows. The Ministry of Education is planing to migrate those CBIT’s to free and Open Source Software by next year.