July 2012 Archives

Announcing Galileo - A minimal but modern CMS

I am happy to announce that Galileo CMS is now available from CPAN! This project has been my on-train side-project, but its come a long way in a short time. The most exciting thing for me is that its entirely installable from CPAN. To try it out, simply do

$ cpanm Galileo
$ galileo setup
$ galileo daemon

of course, you can also run it using the servers provided by Mojolicious, or using your favorite psgi-compliant server (as long as they support websockets).

Authorized users edit pages using markdown with a live-preview. All updates to pages, menus and users are sent via websockets. Styling is courtesy of Twitter’s Bootstrap library.

By default it uses an SQLite database, and indeed this is all its been tested on, but in principle it can use anything that DBIx::Class supports. All other dependencies are available from CPAN, with the exception of the javascript libraries, which are bundled with the distribution.

Some things that are still on the list:

  • Other than the database, it is not tremendously configurable yet, but I don’t think that should be hard to do. With a few changes it might be decently themable by overloading the styles defined by Bootstrap.
  • Images cannot be uploaded yet, but they can be linked to from external sources, or at least that should work :-)

Unfortunately I missed the deadline for Perl Weekly, but I did get it out before I go on vacation tomorrow, and I’m excited that I made that goal. So please, try it out; though probably not for anything mission-critical yet.

Let me know what you think!

Alien::Base Perl Foundation Grant Report Month 5

After another busy month outside of the Perl world, I have gotten a little more time in the last week to work on Alien::Base. I must especially thank fellow WindyCity.pm member David Mertens for working with me on some of the Mac problems involved.

N.B. I also want to thank him for PDL::Graphics::Prima, which made the rest of my $work easier this month! If you need interactive plotting, give it a look! Also Chicagoans, WindyCity.pm is tomorrow, topic: Dancer.

Ok so after much tinkering, I have made enough changes to have the test suite passing on Mac, however, it gives warnings which make me think that while it is “working” in the blib directory, that it won’t work once installed. To this end I have been putting together some “real” Alien::Base modules to be released into the ACME:: namespace (if you care, look for ACME::Alien::DontPanic (which consumes Alien::Base) and ACME::Ford::Prefect which depends on it). To make this a more real test case, I have been working to convert my libdontpanic shared library to the proper autotools chain. I have spent the day learning about autoconf/automake/libtool etc, and let me say, if you never need to learn this, then consider yourself lucky!

Hopefully these test modules will illuminate the real problems in relocating the .dylib files, and perhaps other non-Mac problems too!

Sometimes computing is difficult

I rarely rant on this board, and I try not to rant whenever I can stop myself. With that in mind I am going to try to phrase this rant as a question and see if people agree with me or not. Note that for the remainder of this post I am going to be speaking in broad generalities and I know that there will be notable exceptions. Ok here goes.

This started while responding to a post from awncorp, but it really isn’t the same topic. I want to know, is the focus on “user-friendly” or “ease of use” or “one-click” hurting users in the end? Not even from a teaching standpoint, but actually in their day-to-day computing? My assertion is that some things in computing are inherently difficult, and that they should be, and people might to well to embrace that.

For example, my mother was telling me how a neighbor took a desktop computer to a store and they fixed it by reinstalling the OS and charged her $70. When I told her that that task is rather easy if you take the time to try, my mom became quite mad at the store for ripping off her friend. I told her to rethink this. Changing your brakes is easy but most people pay to have an expert do it, either for the fear of messing with a safety device or the hassle.

I don’t want my mom’s friend to be charged $70 to get her OS reinstalled, but I do want her to learn enough about computers to know that she needs to do a little routine maintenance or else. Also she should be glad that they didn’t tell her it was too old and convince her to buy a new one!

Sometimes in order to make computing easier or more interesting, additional security holes are opened. ActiveX controls still worry me. Who thought that putting a JS engine in a PDF reader was a good idea? Now the rise of cloud computing and social networks has people believing that they are safe throwing their personal data around the web, when even that is difficult, as security breaches often show.

Computers make hard things easier and that’s good. However when they get so easy that you take them for granted, you forget that the task they do IS really hard. Why do so many people use Windows when few people seem to actively like it and most people know that it has security problems? Because it comes pre-installed and they already know how to use it. Is this a good reason to risk viruses, trojans, bot-nets, and all manner of other problems? I don’t think so.

I cannot say that I want computing to be harder, but also I wish people would learn that when you take a complicated system for granted, you are likely to get whats coming to you. Perhaps what I wish is that people who use their computers, or worse, make computing decisions for others (this is a Windows shop!) would take the time to learn the factors involved.

I don’t know what I want from this post. I guess I just had to say that. I am interested in people’s feelings on the matter.

Oh and to all those people who were irate over the last twitter outage (nobody who would read this blog I’m sure), stop reading the news on the latest celebrity divorce and learn something about webapps!

Welcome all scientists and friends to perl4science.github.com

This week has been an exciting week for the small but dedicated group of scientists in the Perl community. This is because this week we saw the roll-out of two science related Perl sites:

As gizmo_mathboy has already announced his group, I though I should make my site official too!

I wish we could say we had a big roll-out plan, but not so. We had discussed these things, decided we liked both ideas, and should keep them both, and somehow, this week, they both went live.

A little bit about the Perl4Science site: Its hosted on GitHub pages, mostly because its free, but it also fosters that GitHub feel of “lets share our code” which is a major part of using open source for science. Futher it uses Jekyll for a rendering engine and a cool project called Octopress to manage the Jekyll stuff. The details are in the site, including details on how you can contribute.

For now it contains some links to a few Perl science-related modules, and some links to the science related talks at YAPC::NA 2012. I want to see both lists grow. If you know of good modules or good talks please fork the site repo or mention in the comments here. I also hope to share some useful code snippets, but I don’t have a place for that just yet.

Finally, and I wish I didn’t have to mention this, but we are working on a set of standards for inclusion in both sites. For now, lets just say, if you are going to contribute, lets keep it professional and Perl/Science related, and the site owners will make final ruling on what is added. Hopefully we don’t have to use that power often.

So that bit of legaleese aside, please come and enjoy both sites. I hope people learn and people teach others. Lets make Perl (good Perl) relevant in the science community again!

Response to "Scientific papers and softwares"

Recently leprevost posted a comment on requiring better software in science. Its a good plea, read it! In response I started a comment, which got a bit too long, here it is:

A few of us have been talking about how to increase the use of Perl in the scientific community. While our efforts are in their infancy, we hope to fight this very problem. Some new sites are

  • Perl4Science, my stub site/org, to be expanded
  • The Quantified Onion, Joe Kline’s brand new Google Group, not sure if it’s been announced, guess it has now :-)

In the meantime, all I can do is contribute that good code, and put it on GitHub and CPAN for people to see and use.

There are many more projects, both written by me and others for this purpose. PDL, BioPerl etc. I really would like to reclaim some of the scientific computing that has been going to Python by default. It makes me very sad to read that when someone does choose Perl, that they would use that opportunity not to show off new modern Perl, but that old Perl that scares people away.

If you are a Scientist, you are more than welcome to contact me, David Mertens and others about how to interact with the scientific community in Perl. Even if you don’t want to do this, however, please, write Perl code that shows off the language we love.

Having fun with some modern web technologies

Edit: MojoCMS has been renamed to Galileo and released to CPAN. Enjoy!

Over the holiday break, I decided to have a little fun learning some things about the web. I usually get my Perl fix through science, but several upcoming projects might have some web involvement; so I thought I should brush up. The following are some reflections on that experience.

The task I set myself was to make a micro CMS (it is currently named MojoCMS, but I’m not sure I like that), leaving most of the heavy lifting to freely available Javascript libraries. I didn’t think I would be especially good at writing the actual interface, but rather the routing and functionality would be my task. In a strange way, the result was a kind of nostalgic Perl experience; Perl was the glue in my project again, not the main/only language involved.

I used several great libraries, jQuery of course, jQuery-UI for a small part, HumaneJS for notifications (works great for websocket responses!) and PageDown for a real-time markdown renderer. FYI, PageDown is the editor from the StackOverflow team. These projects make life much easier, I can’t imagine writing that kind of Javascript by hand!

I must say, Javascript still eludes me. I can parrot it, but I’m sure I’m not doing it correctly. I think the problem lies with its dependence on the HTML/browser that is running it; the odd way that the language doesn’t have a use command, and that “page”-globals can be used, still feels odd. I can definitely see the need for jQuery, but that adds even further cognitive dissonance. Anyway, I think most of this is my shortcoming, not its.

HTML5/CSS3 on the other hand is brilliant. Its easy to make the markup do what you mean without too many machinations. Of course I pull in some libraries for that too, namely Bootstrap.

Back to the Perl of it though, I must say I have high marks for Mojolicious, for many reasons, but the highest are for Websockets! Now I know Mojolicious didn’t invent them, but it makes them easy. Using Websockets I was able to make the “save page” and “update main nav” windows save without reloading. That was rather cute and feels modern.

The biggest point I want to make (long ramblings aside) is my most recent addition: DBIx::Class. I’m a scientist, not a database admin. I have setup some PHP CMSes and have used mysql just enough to get them started; terrified the entire time. So much so that I started my CMS project with the idea of using DBM::Deep for as long as possible. Soon enough though, I was nesting hash-keys three deep and wishing I had objects; if I hadn’t needed persistence I would have reached for Moose long before.

I investigated KiokuDB, and while I had some hope for it, I think I would need someone sitting in on the setup process with me. Then I remembered, throughout YAPC::NA along with the list of my favorite Modern Perl modules, everyone else adds DBIx::Class. Ok they can’t all be wrong. They weren’t. Sure the syntax is a little different from Moose, but its not that hard. The payoff for me started even before running the site, in the deploy command. With a simple script I can create all the necessary tables and inject sample content without ever needing to write SQL! After this the ORM quickly and easily replaced the DBM::Deep vestiges throughout the code, and just like that I have readable, OO structures for users, pages and the menu configuration.

Anyway, if anyone wants to play with MojoCMS (or suggest a better name!) feel free. It is still very rough but I may try to see it forward a little further. Passwords are stored in the clear for now, so be careful! But this is my next task. After that and some other work on users (like being able add them through the website!) the thing might even be able to host a small site. Not bad for a one-week side project!

Windows CPANtesters, please test Alien::Base

Hi everyone, normally I talk to you all, but today I have a special request for all of you who are CPANtesters on Windows. I have been waiting for a couple weeks now for the automated systems to get around to filing tests for Alien::Base but the waiting is starting to hinder progress. I wanted to wait until I got the passing tests on windows before I both

  1. Dive deeper into handling Mac’s problems
  2. Announce an alpha version

So if you are a Windows-based CPANtester or have thought about becoming one and could move Alien::Base up your queue, I would be eternally grateful!

About Joel Berger

user-pic As I delve into the deeper Perl magic I like to share what I can.