I just updated the site for my perl charting library, Chart::Clicker, with lots of new examples. All the old ones had been added over time and things needed a consistency overhaul. Enjoy!

I just updated the site for my perl charting library, Chart::Clicker, with lots of new examples. All the old ones had been added over time and things needed a consistency overhaul. Enjoy!
Sometimes once isn’t enough. Perl programming plus whatever else piques my interest.
One of the more entertaining part of working in e-commerce is dealing with PCI compliance. I say interesting because the standard is a mix of good things and inane things. Regardless, it’s required. One of the sections deals with authentication and authorization. We’ve traditionally done that sort of business internally, but the newest PCI standards gave us quite a few requirements that we didn’t feel like adding. Instead, we opted to offload that functionality onto our Windows machines. We already had some experience with this, as our internal Trac talks to Active Directory to ease our administration when interfacing with the other departments.
Enough backstory. I had some hassle getting Catalyst::Authentication::Store::LDAP working with Active Directory. I wanted both authentication and roles, so here’s what I ended up with:
Plugin::Authentication:
default_realm: members
realms:
members:
credential:
class: Password
password_field: password
password_type: self_check
store:
class: LDAP
ldap_server: dc1:389
ldap_server_options:
timeout: 30
binddn: cn=SomeAccountYouSetup,ou=Accounts,dc=domain,dc=com
bindpw: password
user_basedn: ou=Accounts,dc=domain,dc=com
user_filter: (userPrincipalName=%s)
user_field: mail
use_roles: 1
role_basedn: ou=Groups,dc=domain,dc=com
role_filter: (member=%s)
role_scope: sub
role_field: name
role_value: dn
role_search_as_user: 0
role_search_options:
deref: always
I’m not really participating in Matt’s Iron Man but the flurry of Perl posting does leave me feeling a bit guilty for not saying a bit more about my language of choice.
UPDATE: I’ve changed the configuration a bit to show what you need to change.
I’ve been doing a lot of reading for the last 6 months. It all started when I switched jobs last year. I was working with a lot of smart guys who knew (and still know) significantly more than I do about practically everything with regards to programming languages.
My first adventure was with Paul Graham’s ANSI Common Lisp. I really enjoyed the concepts that the book introduced but I was very frustrated by the syntax and nomenclature. Practically all my programming experience has been with “C-style” languages so Lisp is something of a leap. Overall I think the biggest things I brought away from my time with this book were: functional languages are really cool and recursion is much cooler — and a lot easier — than I’d thought.
My next book wasn’t CS related. I devoured Neal Stephenson’s Anathem. It was a great read but I’ve been itching to go back lately and read it again. The more I read Stephenson’s books the more I pick up from them. Anathem was very dense and I probably missed a lot of the good stuff.
Next on the agenda was Programming Groovy. I had no practical reason to use Groovy but I had been spending a lot of time using Java for work and was interested in what Groovy brought to the table. The simplified syntax and heavy use of autoboxing made Java feel nimble and interesting.
Finally we’ve arrived at the present day. Sitting beside me is a queue of books. The current one is Programming Erlang: Software for a Concurrent World. I’ve got a list of programming languages I want to learn about and reading this will check one off the list. I sat this one down because I wasn’t feeling some of the more complex “protocol” examples it got into. Luckily I mustered up some more tuits and skipped that chapter. The next one began processes and I’m really impressed with what Erlang can do. I even thought of a project I could write in Erlang if I wasn’t so busy right now.
The next book on my list Practical OCaml. I’ve got it on loan from my friend Stevan and the quick glance I gave it piqued my interest. I’ll proceed to this after finishing the Erlang book.
Looking back it’s amazing how much information I’ve absorbed in the last 6 months. In the next few days I’ll post another category of books I’ve been reading.
I just returned from the Orlando Perl Workshop. The conference was on the smallish side but I enjoyed the day of talks. My two went well and I got to spend some time with friends that I’d either never physically met or that I hadn’t seen in quite a while.
The highlight of the weekend was probably hanging out at a pub that promised live soccer: Harry Rambsbottom’s. We caught half of the Hull v Arsenal game and helped to run their cask of Old Thumper dry. If we weren’t at the venue or on a go-kart track then we were at Harry’s.
The conference gave us a bit of time to talk about Enlightened Perl. I had some good conversations about QueryLog, Perl performance and various other tidbits. One of the things that I got from the conference was the desire to talk a bit more about how Magazines.com — and less so, me as a manager — get things done. I’m going to start this week by writing out some of the stuff I’ve been doing in my spare time then working my way toward how out systems work. This came up a few times during the weekend and I’m interested to hear how others do things.
So check back in a few days, I’ll have some thoughts up.
If you are reading this then welcome to my new host. I’ve been meaning to move to my Linode for a year. I took the time to do it today. Yay!
I work for magazines.com and we are looking to add to our team!
We’re a Perl shop, located in Franklin, Tennessee. We sell magazine subscriptions online. This year we’ve got a lot to do and I’m looking to add some developers to our ranks. I’m not sure how many yet, but I can give the following details:
We aren’t looking for a particular job level. I’m interested in juniors to seniors. The candidates we choose will depend on the choices we have. If you are interested then drop an email to me via cwatson at magazines dot com.
I’m really excited about our work in 2009. I’m opening the year with two talks at the Orlando Perl Workshop and a commitment to work with the Enlightened Perl Organisation. I’ll eventually post this opportunity on jobs.perl.org but wanted to start here. Give me a shout!
Jackson tagged me with a “7 things about yourself” meme. I made the mistake of scanning feeds right before bed and now I feel compelled to satisfy my obligation before bed, so here goes.
I’m not reposting the rules, but I am going to tag Jay Shirley.
We’ve used NetApp hardware for our NAS needs for the last few years. My boss bought two a few years ago and they’ve been rock solid. They have gotten a little long in the tooth and our capacity needs have grown, so we decided that this was the year to upgrade.
Around the time that I started thinking about what to buy, Sun started making noise about their Sun Storage 7000 line. These bad boys pack a bunch of disks in a nice chassis, pump it full of Solaris (Open? not sure), format the whole shebang with ZFS then gussy the whole thing up with a nice web interface.
And they only cost $10k. Nice.
Wait! They even have a 60-day Try and Buy offer! They ship it to you (free) and you can play with it for 60 days! Like it? Buy it for a 20% discount. Don’t like it? Mail it back! (free)
So I sign up and a week or so later I test it out. It’s everything I hoped it would be! I spent way too long emailing around trying to find out how to actually buy the damned thing. I’ve got the approval and a credit card in my hand. It took me a few hours to find out who to talk to.
I finally get the right person and I say “This thing is great. Give me two!”
Sorry sir, you’ll have to fill out paperwork for another Try and Buy to get the discount on the second unit.
Huh? Seriously. Seems so. What a pain in the ass! Have you looked at your stock price lately? Why are you making it so hard for me to give you money? I feel like I’m standing at the door, leaving breath fog on the glass with money clenched in my hot hands. Why do I have to take 30 minutes out of my day to fill out paperwork again?
So, resigned to my fate, I add “Fill out Sun’s stupid fucking paperwork” on my TODO list and go back to work. Guess what happens. NetApp calls! They come out and talk to us and we send them away with instructions to send us a quote in 2 days, as we like the Sun gear.
Lucky for Sun, NetApp came back with too high a price. Even though NetApp would’ve taken my money happily and given me what I wanted, I decided to go with Sun. Consider that a dodged bullet, Sun. You might want to consider if this “open” push is at odds with your ridiculous bureaucracy. You should not make it hard for me to give you money. But thanks for the sweet Try and Buy.
I recently rejoined my team at magazines.com and have been pretty busy getting back into the groove there. It’s a busy place in Q4, so side stuff has taken a back seat. Well, that’s mostly WoW’s fault.
While I’m at it, if you are a LAMP System Administrator in Nashville (or nearby) and are looking for a great opportunity, drop an email to cwatson at magazines dot com!
On a side note, my first entry of the 2008 Catalyst Advent Calendar went up today. Enjoy!
It’s been on the CPAN for a few weeks, but I’ve not taken the time to pontificate about what exactly Graphics::Primitive and its cadre of helpers are.
I started working on Chart::Clicker quite a while back. I’d just come from a job as a senior Java developer and still had AWT and Swing on the brain. I’d developed a custom charting package in perl a few months before but wasn’t happy with the results. I sought out a solid charting package to emulate and was heavily inspired by JFreeChart. One of the side effects of this was my disappointment with the availability of general graphics packages on the CPAN. I was jealous of the simple classes in Java that reduced a lot of the work in making graphics: Point, Rectangle, Color and more.
I released Chart::Clicker and was happy. I had emulated a lot of the ideas inside Clicker, writing general Component, Font, Color and Border classes, to name a few. As time went by and people began using Clicker it because clear to me that these concepts could be generalized and turned into a general framework for creating graphics. Thus became Graphics::Primitive.
Graphics::Primitive is a collection of objects that allow you build a 2d “scene”. The building block of these scenes is a Component. It has a width and height, colors (fore and back), borders, insets and padding. A Container builds on Component and yields a component that can contain other components. To allow for more than plain ol’ boxes Graphics::Primitive provides TextBox, Canvas and Image. While these entities are all pretty simple, but you can create complex results by nesting them.
Graphics::Primitive is really just a data structure. It doesn’t actually do any drawing. Drawing is done by Drivers. The only driver at present is Cairo. It makes a great first driver, however, as it provides PDF, PostScript, PNG and SVG output.
Graphics::Primitive also doesn’t concern itself with laying out your components. Graphics::Primitive will leave components wherever you put them if left to its own devices. To handle automatic layout management I created Layout::Manager. As you add components to a container you can provide constraints for them. Then you can ask an instance of Layout::Manager to “layout” your container (and any containers contained in it). This concept is borrowed from Java’s layout managers. It is worth noting that each container has it’s own Layout::Manager so you can choose the one that is most fitting for the look you desire.
Graphics::Primitive allows you to separate your data from your presentation. Creating an artifact in Graphics::Primitive allows you to change the output format. Need a PDF and a PNG? There’s no reason to rely on a conversion tool or a separate rendering path. Simply clone the component to pass it to each driver.
The aforementioned Chart::Clicker is made using Graphics::Primitive. You can look over examples of its output. The examples are all pngs but any of those can be converted to any of the formats supported by the Cairo driver by changing a single parameter.
There is a Catalyst view, which I released onto CPAN today. This allows you to serve your components via HTTP.
Document::Writer aims to abstract the underlying Graphics::Primitive components into an API friendly to creating documents. It will likely change quite a bit as I refine the ideas and increase underlying features.
I created a handful of other modules in an effort to reduce the work others might do when building similar code.
Graphics::Color provides simple objects for various color spaces. I’ve got a list of color spaces to add, as well as conversion routines.
Geometry::Primitive provides simple geometry entities such as Point, Circle and Rectangle. These objects serve as the base for Graphics::Primitive.
I’m currently sitting on code that allows serialization of a Graphic::Primitive scene using MooseX::Storage, but some API conflicts are stopping me from releasing until I work them out.
Document::Writer will be getting lots of new features as I back out a lot of my crappy text code for a more robust text-layout engine based on Pango. There are supposedly bindings coming for perl that are not tied to GTK+.
Graphics::Primitive has been a lot of fun. If I’d known what I was getting into I probably would’ve run away screaming. There have been many nights that I couldn’t sleep because a problem was rolling around my brain and I had to get up and hack on it for a few hours.
Please check it out and feel free to hit me up with ideas and suggestions. I’ll be giving a talk, hopefully, at PPW 2008. The presentation itself is made in Graphics::Primitive, just for extra oomph.
I updated the examples on the Clicker page. Cross posting in case anyone is interested.