One thing I love about git it how you have control over your local environment. Need a pre-commit hook? Just add the damned thing. Need it for Subversion and you're not the admin of the subversion server? Sucks to be you. Fortunately, having a reasonable command line lets you work around this. And I needed to because I broke the build. Twice. In a week. Buying the donuts for this would be slightly less annoying if it weren't for the fact that I get to "enjoy" low-calorie yoghurt bars instead. (Though I'm now below 82 kilos for the first time in a couple of decades).
So no more breaking the build. Right. On my previous team, if I needed a module, I could usually add it. On this team, it's a bit painful, so I just use what I need locally and then break the build when I forget and commit use Test::Most 'die';. So I wrote a little bash scrip to make svn less brain-dead.
Open development seems to be percolating into the arts. A friend of mine, MG Lord, is on a team
commissioned by the LA Opera to write an opera about LA's 110 Freeway.
They (MG, her co-librettist Shannon Halwes, and composer Laura Karpman)
are putting 110 on the Web one aria/overture/intermezzo at a time,
as they workshop it. In effect, they're blogging the opera.
Have you ever needed to create an application server quickly? Maybe you tried SOAP? It's never a fun experience, and if you're like me you may have ended up reinventing the wheel a lot due to poor quality modules on CPAN, or confusing documentation. Today I'm announcing JSON::RPC::Dispatcher. It's a super easy way to create JSON RPC 2.0 web services. It's built on top of Plack so you can easily deploy it anywhere you need.
How easy is it to create an app server? This easy:
Yesterday and today I released to CPANCantella::Worker and Cantella::Worker::Role::Beanstalk. I am very happy with these two packages. They are the culmination of about a month of on-and-off playing around with different approaches to having distributed event-driven worker processes. As an added benefit, I can also run a pool of beanstalkd servers in case I need to bring one down for maintenance or I have some unexpected downtime.
The only thing conceivably unique? It's triply-linked, thus allowing multiple traversal orders. I'm confused. How is this different from a directed graph?
Last week I started using github, forked a project, and read some of miyagawa's beautiful code. Later on the weekend, I imitated a particular style I found from his code to improve my own code.
And then I realized: during the course of many years as a programmer, I really really seldom read other people's code, especially real-world code. Sure, I do whenever I have to patch something. But other than that, practically never.
Other than code, I do read an awful lot: books, magazines, mailing lists, forums, blogs, web pages. I have never doubted the benefits of reading for improving knowledge and understanding, so why haven't I read more code? A couple of reasons I can think of:
1. We programmers are not paid to read code. We are paid to write programs, to churn out lines upon lines of code. Heck, we're not even paid to write good code, we're paid to get the job done.
Not thinking that any Perl books would be available for Kindle, I searched anyway. I can get at least Learning Perl and Mastering Perl from the Kindle store. I'm thinking about this because I'd like to see what I can do with an iPad Kindle app.
I'm on a trip with severe weight requirements for luggage, so I've been trying the Kindle app for the iPhone. It seemed weird at first, but after a couple chapters of the first book, I don't mind it anymore. The tech books are a bit different. If you're used to the beautiful and understated typography that is one of O'Reilly's hallmarks, you're going to think the Kindle is a bit odd. I think I have it slightly nicer on the iPhone, but it's still different.
I've been a google user ever since giving up AltaVista back in the day. I've heard good things about bing, laughed at their funny TV advertisements, and have deep-down (in a weird sort of way) wanted a search product from M$ to be a success.
I decided a few days ago that I'd give bing.com a try for a complete month - to see if it could win my heart. After 2 days I must say that I'll be going back to google.
I was reminded of the "Perl is Alive" meme last night after watching this video. I decided to search for Perl is Alive on my now default search engine to see how wide-spread this effort/search term had become.
Many years ago, when I was... roughly 15 (I think), I met Theodor Ts'o (one of the first hardcore Linux Kernel hackers, since version 0.90, I believe) at a Linux event IBM organized in Israel. I should note that he is a very nice person.
After the event, we got to talk a bit. We talked about our favorite games. Mine was "avoiding segfaults". This was back when I was programming in C.
Today I wrote the following regex: qr/^([\w|\.]+)\s+(?(\d+)\s+)?(\w+)\s+(?:(\d+)\s+)?([\w|\d|\.]+)$/;
Then got a Segmentation fault
Can you spot the error?
Here's a hint: it is missing a colon (:).
This is perl, v5.10.0 built for i486-linux-gnu-thread-multi
Hailo has been converted from a Moose application to a hybrid Mouse/Moose application for release 0.20.
This brought its memory usage from 28MB to 20MB. Hailo is around 4.000 lines and the patch required to make it Mouse + Moose compatible (including testing both at make test time) is just under 500 lines.
As well as reduced memory use another big plus is the reduced startup time. hailo(1) starts with Mouse in around 250 ms flat whereas with Moose it hovers around 530 ms. The difference in startup time is clear when running the testsuite with Moose & Mouse:
We had to hack around there not being a MouseX::StrictConstructor analogous to MooseX::StrictConstructor and I fixed a bug in Mouse which caused Mouse's Int type not to support values larger than 2^32 on 32 bit systems.
In my module code, I want to be as flexible as possible. I want to be as detached from implementation details as possible.
I just want to generate a log message (or a notification, or an audit entry). I don't want to care where it ends up, how it is sent, how it is filtered/categorized, who the recipient(s) is/are, what medium(s) is/are used, etc. Let whoever uses the module configure it all.
And I don't want to reinvent the wheel, I want to use an existing framework. A logging framework seems to be a sensible choice. Let's use Log::Any for example. This is a snippet from a module for a file-manager-type web app:
As I'm working on my Veure project, I've used DBIx::Migration to handle database migrations. If you're familiar with this module, this might seem like a surprising choice since it is, well, awful. However, I know exactly what the limitations are and since I'm so familiar with it, I now have a custom Veure::DBIx::Migration. There are several things I find useful about this.
It's not tied into a specific ORM.
It's very simple.
It's easy to fix and make PostgreSQL-specific hacks I need.
Way back in 2005 I posted my first CPAN module (Log::WithCallbacks). It had proved useful on several different projects, and I thought it would be nice to share. I struggled a bit with namespace selection and was never able to resolve a nasty permissions problem with the tarball I submitted. I got busy with other things, and my poor module got neglected.
Warning: something's wrong at /home/sawyer/code/private/KiokuDB-Backend-DBI-0.08/lib//KiokuDB/Backend/DBI.pm line 563.
Really? I could've never figured something was wrong there. I wouldn't assume you feel like... telling me what's wrong, would you?
Oh, and whoever read my last post via RSS and wondered why there's no code, it's because I was using Github Gists and it doesn't pass some RSS readers. Open the entry and you could view it.
Thank God for cpanminus. Now that I'm free from having to use them, allow me to rant, no, bitch about them.
1. Bad defaults. Some default values might make sense 10-15 years ago, but not so much nowadays. For example, I'd argue that "follow" should now be default. See #2.
2. Too developer-oriented. For example, I believe "notest" should be on by default. This is compounded by the fact that installing Perl modules is so damn-slow already. See #3.
3. Too slow. Startup takes around 10-30 seconds or more. Installing Moose usually takes minutes (but with cpanminus, it only takes about 1 minute with --notest on my PC). Autocomplete takes one to a couple of seconds.
4. Too interactive, too verbose. The older clients are getting better but not quiet enough, cpanminus is such a breathe of fresh air.
5. Too bloated (which is the reason why cpanminus was developed in the first place).
The older CPAN clients are an embarassment if we compare it to "apt-get", "yum", "urpmi", which are way faster, way quieter, way less interactive. There's no reason why a CPAN client cannot be like those. And fortunately cpanminus proves it.
The 3rd Belgian Perl Workshop will take place on June 26, 2010 nearby the touristic area of Brussels.
The workshop is targeted towards everyone either developing with or interested by Perl.
Obviously, the workshop is only as good as its talks, your talks.
We are interested in all talks about Perl itself or about Perl related topics, and especially talks that would apply to this year's theme.
The theme for this year's workshop is "The Renaissance of Perl", which we hope will inspire submissions on this and related topics. Also it gives any speaker a very good opportunity to practise a talk for YAPC::EU 2010. ;-)
The submission deadline for your 5, 20 or 40 minute talks is June 01, 2010.
Lingua Franca for the talks is English (unless you manage to give the presentation in Dutch, French and English in 1 go ;-) ).
and was ready to go.
Spreadsheet::WriteExcel has very good documentation (excellent examples included), is very complete and is really a pleasure to use.
Besides: Use Spreadsheet::WriteExcel::Utility to convert between different cell notations. A1 <-> (0, 0) and be aware that one is base 1 ("base A", respectively) and the other base 0.
So now when users download and run my programs/scripts for the first time, instead of failing with the dreaded message:
Can't locate Foo/Bar.pm in @INC (@INC contains: [a dozen or more of paths....]).
BEGIN failed--compilation aborted at /some/path line 123
which users or even Perl novices have no clue on how to fix, the program will instead automatically download every necessary CPAN modules into the user's home directory and runs out-of-the-box on the first try!