Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

david m (9460)

david m
  (email not shown publicly)

I am a graduate student in Physics at the University of Illinois where I study synchronization and other nonlinear stuff. I play around with Perl and PDL when not working, running, or visiting my fiance.
+ -

  Journal: Is Perl5's Object System Really That Bad? on 2009.12.22 9:12

Journal by david m on 2009.12.22 9:12
User Journal

I come from a C++ background and I'll admit that Perl's object system really confused me initially. The camel book - bless it's heart - really doesn't explain things well at all. I've occasionally thought about learning Moose, but whenever I try to wrap my head around it, I find myself more interested in just using traditional hash-based or inside-out objects. The notion of requiring thousands of lines of code to use an object system just doesn't sit well with me. I'd rather use an object

Read More 1 comments
Comments: 1
+ -

  Journal: Write-up on creatign real-time simulations using PDL and SDL on 2009.11.06 14:58

Journal by david m on 2009.11.06 14:58
User Journal

I've written a write-up on PDL's wiki about using PDL and SDL to create responsive, animated simulations. You can read more about it here: http://sourceforge.net/apps/mediawiki/pdl/index.php?title=Animation_with_SDL. The script at the bottom of the page gives you a simulation of a bunch of noninteracting particles in a box, for which you can change the particle size, change the time step, or even reve

Read More 0 comments

+ -

  PDL Usage and Installation Survey on 2009.11.04 13:31 david m

Submitted by david m on 2009.11.04 13:31
News
david m writes "Hello everybody. The PDL developers have written a short, 7 question survey about installing and using PDL. If you've tried to install PDL, whether you've succeeded or not, we'd like to get your thoughts! You can find the survey here: http://www.surveymonkey.com/s.aspx?sm=MJKdOtMGh_2bGB5zO9ZBlFWA_3d_3d. Thanks!"
Read More 0 comments

+ -

  Journal: PDL Usage and Installation Survey on 2009.11.04 13:31

Journal by david m on 2009.11.04 13:31
News
Hello everybody. The PDL developers have written a short, 7 question survey about installing and using PDL. If you've tried to install PDL, whether you've succeeded or not, we'd like to get your thoughts! You can find the survey here: http://www.surveymonkey.com/s.aspx?sm=MJKdOtMGh_2bGB5zO9ZBlFWA_3d_3d. Thanks!
Read More 0 comments

+ -

  Journal: Troll feeding: PDL vs Matlab and the Standard Hammers on 2009.11.04 2:47

Journal by david m on 2009.11.04 2:47
User Journal

One of the members of the pdl-users mailing list asked for some help for an upcoming talk. He'd like to compare PDL and Matlab. I used to call myself a C++ programmer, and I've written a number of analysis scripts in Matlab before getting fed up with all of it and switching to Perl/PDL. So, well, here goes...

 

Read More 1 comments
Comments: 1
+ -

  Comment: Re:Your description of PDL makes me want to avoid (Score 1) on 2009.10.27 0:05

Here is a module that checks if your OS has installed some package through its installer instead of directly via cpan, and here is an interface to Debian's apt. I envision something more like the latter, but something that works for many systems so that you could specify a hash like:

require_external({
   type => 'lib',
   name => 'PLplot',
   Windows => 'PROGRAM_FILES/plplot/plplot.dll',
   Windows_inst => "http://sourceforge...",
   Linux => 'plplot.so',
   src => "http://sourceforge...",
   Ubuntu => libplplot.so',
   Ubuntu_inst => "http://getdeb...",
   version => 2.1,
   # etc, etc
});

Then it would call the installer for your OS. If the dependency could be satisfied (specifically, the version requirement) it would make the OS install it. Otherwise, it would download the source and compile it, or download an installer and run it.

Read More 6 comments
Comments: 6
+ -

  Comment: This would be great... (Score 1) on 2009.10.26 22:33

by david m on 2009.10.26 22:33 (#70983)
Attached to: Strawberry Professional, Padre, and Ashton's Law
I'm sure it's been discussed at more conversive places, but I've just got to say that this sounds great to me. I work on Linux almost exclusively, but I have done some work on Windows (something for scanning Outlook, actually) and found Strawberry Perl was perfect for my needs. I learned to program in Visual Studio so I like having powerful IDEs, so having that sort of option automatically installed with Strawberry Perl would be even more than I thought to ask for.
Read More 9 comments
Comments: 9
+ -

  Comment: Re:Your description of PDL makes me want to avoid (Score 1) on 2009.10.26 21:00

Ha! So I just read what you had to say about Chocolate Perl. So you are quite serious when you say you're thinking about including PDL in a bigger project...

As I said, it works out-of-the-box from CPAN. I've dropped a note on the Perldl mailing list about making the installer even smarter, but since a lot of optional PDL stuff depends on external libraries, it would be nice to have some way to interact with the OS and make it install its version of the desired library.

Read More 6 comments
Comments: 6
+ -

  Comment: Re:Your description of PDL makes me want to avoid (Score 1) on 2009.10.26 20:34

Sure, that's fair. I'm afraid I didn't really stress that you can install PDL from CPAN without doing anything special that I discussed above. (I've edited my original post to reflect this.) PDL's installer will detect if you've got OpenGL or PLplot installed, and skip those steps if it doesn't find it. You really only need to do the special stuff if you want to visualize your data or use the GSL.

You do raise an important point, of course. Suppose you wanted to write a module or program that uses PDL to make plots using PLplot. The installer could then check if you (or your user) has the PLplot libraries installed, and offer to download and build them if you don't. It is quite likely, however, your OS's package manager has a package for the library that PDL wants. Perhaps PDL should learn to detect if you're running Windows, Mac, or Linux, and either download and install the appropriate installer or work through your OS's package manager. Has anybody written a Perl module that can do this? That would be awesome!

Read More 6 comments
Comments: 6
+ -

  Comment: PPM Stuff (Score 1) on 2009.10.26 20:16

For those of you using ActiveState's ppm, detailed instructions are given in the tarball's win32/INSTALL file. Since you probably won't have much use for said tarball, I've included the lowdown here. If you need more details... I guess you'll have to downlaod that tarball and take a look at the file yourself.

First up install Astro::FITS::Header by running:

ppm install Astro-FITS-Header

Then install the OpenGL, PGPLOT and PDL modules from the uwinnipeg rep by running:

For perl 5.8:
  ppm install http://theoryx5.uwinnipeg.ca/ppms/OpenGL.ppd
  ppm install http://theoryx5.uwinnipeg.ca/ppms/PGPLOT.ppd
  ppm install http://theoryx5.uwinnipeg.ca/ppms/PDL.ppd

Or for perl 5.10:
  ppm install http://cpan.uwinnipeg.ca/PPMPackages/10xx/OpenGL.ppd
  ppm install http://cpan.uwinnipeg.ca/PPMPackages/10xx/PGPLOT.ppd
  ppm install http://cpan.uwinnipeg.ca/PPMPackages/10xx/PDL.ppd

(Note that the ActiveState ppm for PDL currently lacks some of the functionality that is available in the above PDL ppm packages from uwinnipeg.)

The install file also contains more detailed installation instructions for Windows users if you want to customize stuff, so for a different take than what I juts gave here (above, in the original post), check it out!

Read More 6 comments
Comments: 6
+ -

  PDL 2.4.5 is just released, and here's how to inst on 2009.10.25 0:01 david m

Submitted by david m on 2009.10.25 0:01
Module News
david m writes "Chris Marshall has recently released PDL v2.4.5, a stepping-stone in the Perl Data Language. Chris has led the charge to get cross-platform OpenGL support for PDL. In the past, PDL has used its own GL code, but with Chris's work it now uses Perl's Open GL module, affectionately known as POGL.

In this journal entry, I go through the steps necessary to get PDL installed and working. The Perl Data Language is a language extension that adds number-crunching and numerical array capabilities to Perl that is on par with C in terms of speed and memory consumption. This is good, but the project is quite complicated and some manual work is probably necessary to get PDL to work the way you'd like. That's what I'll discuss here. I will perform this tutorial using my cpan shell, but hopefully the instrucitons I give will be decent enough that you can perform the installation manually if you cannot use cpan.

Step 0: Install Perl's OpenGL dependencies. The OpenGL module requires freeglut. If you're on Windows, you don't have to do this because POGL (Perl's OpenGL) will download everything it needs. If you're on Linux, you'll need to check your package database for it's library or get it from Sourceforge.

Step 1: Install Perl's OpenGL module. You should be able to get this on cpan without trouble by issuing:

get OpenGL
make OpenGL
test OpenGL
install OpenGL

If you run into trouble, look at the INSTALL file by typing look OpenGL in cpan and then examining the file. Hopefully a few manually issued commands will solve your problem.

If you don't use cpan, you can still get the tarball from cpan's web page. If you download the tarball, you'll need to unpack it somewhere, open a command prompt in the unpacked directory, and issue the following commands:

perl Makefile.PL
make
make test
make install

The last command will probably have to be run with root privileges.

Note that on some platforms, you may need to replace make with a similarly named utility. I believe it's dmake for Strawberry Perl. If it's not, you probably know who you are and what it's called. I'm sure Google can help. (If you've got ActiveState's Perl, I believe you'll just have to wait for ActiveState to package PDL for you. Can anybody suggest a better idea?)

Step 2: Check out the new PDL code (but don't install yet!). From the cpan shell, simply type get PDL. If cpan is not available to you, you can download the source code from cpan's web page for PDL or from sourceforge. Either way, you'll get a tarball that you'll have to open up somewhere.

Step 3: Take care of the prerequisites. As long as you've got a C compiler, PDL should work out-of-the-box. However, you can enable a great deal of optional functionality by ensuring you've got a few dependencies installed. To figure out what these dependencies are, go to the directory containing the (untarred) distribution (in cpan, you do that by typing look PDL) and examine the DEPENDENCIES file. Make a list of the various dependencies that you'll have to install. I recommend installing these before you install PDL. Here's an overview of the dependencies that I deem important. To read about all of the dependencies, check out the DEPENDENCIES file. If you have any questions about dependencies I don't discuss here (or about stuff I do discuss here, for that matter), you can send a query to the PDL mailing list, which you can find here.

Term::ReadLine
Makes your PDL shell a more pleasant experience
OpenGL
Already discussed - needed for OpenGL stuff
PLplot
This is useful for 2D plotting (which I hope to write about some time in the not-so-distant future). You'll need the PLplot libraries, which you can hopefully install for your system with your package manager; otherwise you can get them from sourceforge.
GSL
The GNU Scientific Library contains all sorts of useful stuff. I'm not entirely sure what how much is bound to PDL, but chances are good that if you do any scientific computing, you'll want it.
FFTW2
If you ever take Fourier transforms (which is easy to do in PDL, by the way) you'll need a copy of this library.

Remember: PDL has many other optional features that have their own prerequisites, such as SLATEC and Minuit. Please check the DEPENDENCIES file for details on what's available and what it requires.

Step 4: Install PDL. Now that you've got all the prerequisites out of the way, go ahead and install PDL. You can use the same commands you used when you installed POGL above. If you run into trouble here, take a look at the perldl.conf file, which will allow you to tweak the installation process a bit more to your liking.

The build process can take a while, but you'll want to pay attention. The process automatically detects various libraries. This is particularly important if it misses an important library for you, in which case you will probably need to tweak the perldl.conf file. The file has lots of internal self-documentation so hopefully you'll be able to figure out what to try to fix your problem. However, if you run into trouble, check out the BUGS file for instructions on how to report bugs or other trouble to the PDL developers.

Step 5: Learn more about PDL. The documentation for PDL isn't great for beginners, but it gets the job done. Check out the wiki, which not only has documentation fo PDL but also has links to some good external documentation. If you find some feature to be somewhat under-documented, please let me know and I'll try to tackle it some time in one of my journals. Then, hopefully, I'll propagate the documentation back to the wiki and the POD files.

I hope this helps those of you who have been curious about PDL but have not put in the effort to get it to work. If you have any questions, the readers of the PDL mailing list are usually happy to help. Check here for those email addresses.

"
Read More 0 comments

+ -

  Journal: PDL 2.4.5 is just released, and here's how to install it on 2009.10.25 0:01

Journal by david m on 2009.10.25 0:01
Module News

Chris Marshall has recently released PDL v2.4.5, a stepping-stone in the Perl Data Language. Chris has led the charge to get cross-platform OpenGL support for PDL. In the past, PDL has used its own GL code, but with Chris's work it now uses Perl's Open GL module, affectionately known as POGL.

Read More 6 comments
Comments: 6
+ -

  Comment: Re:perl and graphics (Score 1) on 2009.10.23 10:38

by david m on 2009.10.23 10:38 (#70958)
Attached to: Why I signed-up on use Perl, or, why I like PDL

As I understand it, PDL had its own OpenGL implementation. However, there is a Perl module for OpenGL and Chris has undertaken to get PDL to use the Perl module rather than the PDL-specific one. I'm on the PDL mailing list so I've been seeing emails going back and forth about this stuff, but I don't use OpenGL so I haven't been paying too close attention to it.

I think my next step will be to write an article on PDL for Perl programmers, and then go into setting up and using PLplot. Once I've tackled that, I'll spend some time looking into the OpenGL stuff and write-up what I figure out.

If you have any other ideas for things that you'd like me to write about, I'm all ears. :)

Read More 6 comments
Comments: 6
+ -

  Comment: Re:perl and graphics (Score 1) on 2009.10.22 23:06

by david m on 2009.10.22 23:06 (#70948)
Attached to: Why I signed-up on use Perl, or, why I like PDL

Yes, PDL does have plotting capabilities. The two semi-standard plotting modules are PGPLOT, which was kinda the original PDL plotting setup, and PLplot, which is the new semi-standard. However, neither of these work out-of-the-box.

The maintainer of PDL - Chris Marshal - has put a lot of effort lately into getting the OpenGL stuff working well with PDL, so I think that 2D and 3D plotting should soon be something that does work out-of-the-box. I can look into this and write about it some time, if you like.

Read More 6 comments
Comments: 6
+ -

  Journal: Why I signed-up on use Perl, or, why I like PDL on 2009.10.21 8:13

Journal by david m on 2009.10.21 8:13
User Journal

I started to give serious time to learning and using Perl this summer. It all started with my frustrations at Matlab. I am a graduate student in Physics and I was trying to analyze some data I had taken. My matlab scripts did an excellent job analyzing data, but I continually found new parameters that needed to be tweaked or held fixed. Since I believe my filenames should be descriptive, the names of my data files kept changing in nontrivial ways.

Read More 6 comments
Comments: 6