The joys of backtracking

I'm pleased to say that Parrotlog is now at a point where it can actually do stuff. It can call predicates and backtrack (more on that in a moment). Unification probably works as well.

Now, backtracking is tricky to get right. Currently Parrotlog has a problem with cuts. A cut is supposed to remove all choice points encountered after the currently executing predicate was invoked. Parrotlog's cut prunes all choice points since the invocation of the last predicate that matched successfully. Close, but no cigar.

YAPC::NA 2010 Survey : Final Week

For the last few weeks the YAPC::NA surveys have been running. In that time we've had received a total of 94 Conference Surveys submissions and 431 Talk & Tutorial Evaluations. While that is certainly a great response, we'd like more. Out of 298 attendees, that's only 31% of possible responses, while last year we managed 45%. So, if you haven't responded so far, please think about doing so. A mail has gone out to all those attendees who haven't responded yet, containing their personal keycode login, so please check your spam filters if you haven't received it. If can't find a copy of the email, and you definitely attended YAPC::NA in Columbus, please contact me directly (barbie [at] cpan.org).

Check SSH keys on your VPS

Today, during a routine check of a new server, a co-worker found an authorized_keys file that isn't ours. The keys in the file (two of them) were of the VPS company that provided the server. One of them is of a specific user there and the other is a generic one.

This grants them password-less access to our server. We have no idea if the private keys are shared between people and whether they are even password protected or not. If they aren't password protected and shared between users (which is likely), it means that we have a completely unknown number of people who can seamlessly access our server and if the key is stolen or ill-gotten somehow, it's much much worse.

Promoting Perl is fun

A year and a half ago, on the private mailing list of the White Camel recipients I was accused that I am trying to promote myself by promoting the White Camel award, that I am trying to turn it into a cheap marketing trick. It was done by someone I very much appreciated.

A few weeks ago, I was accused that I want to tax the funds of the Perl community.

Then in a private, "conversation" on IRC I was compared to some female body parts because I was "attacking" the above person. Apparently that happened, when I wrote that his words were offending me.

Most recently I have been accused that I am trying to use the Perl community to promote my business.

After every such event I spend hours, days, and sometimes even weeks wondering: Are they the few speaking the opinion of the majority? Is this what the Perl community thinks about me and my actions? If not, then why do I get these?

It takes ages to get in balance again.

Luckily there are many people who support the things I have been doing and express their support privately or publicly.
Thank you!

Thoughts on a Ctypes::Type object API

For the past few days I've been considering and experimenting with the design of simple Ctypes::Type objects. These are objects which, funnily enough, represent C data types for manipulation in Perl.

The reference implementation

Looking at the Python ctypes module, there were various things I didn't like. Python's simple types [0] can be summarized thusly:

>>> i = c_int(42)
>>> print i
c_long(42)
>>> print i.value
42
>>> i.value = -99
>>> print i.value
-99
>>>

Having to specify i.value seemed cumbersome for an object which essentially represents just that value and some rules for what kinds of values it can contain. So I started trying various things with tie'ing and overloading. Indeed, I was about to start a fourth project branch on types [1] before reigning in and having another think about fundamental behaviour.



Metaphor clash

Parallel programming with fork() and tail()ing logs

I' ve worked on a small freelance project recently. It was a log watcher and another tiny program watching it (watcher watcher). Basically, it's an extended `tail -f` watching over multiple logs generated by some persistent programs simultaneously and sending alerts based on configuration data. So there are two main problems before starting coding:

  1. Use threads or use fork()?
  2. Hand craft tailing code or check if there is already a module for that?

Kephra under Linux

Because of technical problems I was stuck to xp but recently using more and more my ubuntu boot partition. That was the main reason it was not on top of my priority list to to fix the remaining problems Kephra had. But finally, 0.4.2.33 is the first version that installs like a breeze. Of course its a dev release but a stable/testing release will come soon (1 blocker left).

But when you run Kephra, you will get a bag of GTK errors. That's not because i can't code. It's because i was too quick. I thought of features that in the end GTK considers as bugs. So i will rethink the autogenerated menu builder - event table - bridge. I have to do it anyway to speed up the pop velocitiy of the main menu under windows and to finalize some parts of the upcoming plugin API. But for now you can safely ignore the warnings, they're harmless. It should be also work for mac, but it's not tested, yet. (any volunteers? :) )

Put up or Shutup, part 1: Starting somewhere

My ranting and raving from the previous post, which I expected to only receive shun, flame and troll turned out to have a positive side effect: being told to actually do something about the things I was complaining about. So instead of disappearing into /dev/null or somewhere equally as stupid, and despite my own inabilities to do them all, the least I can do is something which is greater than being a clown on the internet.

The things I bitched about boil down to a few key bits:
  • Usability and experience on Perl related websites need significant improvement
  • Monitoring the effectiveness of the usability and reach along and iterating changes on the websites to improve usability for new comers and regular users
  • A greater effort to aggregate and supply high quality recordings of talks and screen casts.

Firefox/Chrome/Safari - Beautiful Examples of Objects

You may not have heard of Ralph Johnson and Joe Armstong, but they've been programming longer than most of us have, including OO programming longer than most of us have. It's fair to say that after you've been doing something a while, you tend to form opinions about it. Mssrs. Johnson and Armstrong have opinions and this interview with Ralph Johnson and Joe Armstrong is full of said opinions. It's brilliant. There's a great bit from Joe Armstrong where he explains what he thinks "OO" should be about. Though he doesn't use the Web browser as an example, I will. But first, it's important to quote him at length.

Albany.pm - Capdist, NY Perl Mongers meeting

There will be a Albany, NY Perl Mongers meeting the last week of July 2010 to get things rolling again after a very long hiatus. Sign up on the mailing list, or stop by on irc (irc.perl.org / #albany.pm) to find out more details!

Callbacks done, weird 64bit libffi issue?

The week has been frustrating, funny, yet ultimately fruitful.

Research, enhancing C function signatures

I had callbacks to Perl almost working at the start of the week, but couldn't seem to get variables updated 'in place'. The example function I was using to test callbacks, the C standard qsort, takes as its arguments a pointer to an array, the number of items in the array, the size in bytes of one item, and a reference to a function which will be passed two items from the array at a time and decide how to sort them. It returns void, and the original array ends up sorted.

I had the arguments passing to Perl and returning all right, but couldn't see how to update the array itself, so I spent a long time reading the C source for Python's ctypes to try and figure where or how it did so. I learned a lot, about Python internals in general and about its ctypes implementation.

The "M" word is the wrong word.

If you are offended, angered or feel I am mistaken, I welcome dialogue on this topic. No doubt what I will say might piss someone off.

BETA - An Example (of Failure)

The BETA project started in 1976, briefly escaped into the real world and was quickly beaten to death only to have its corpse revived in academia. It's one of quite a few languages which seems destined to never catch on. It's kind of a shame as it's an interesting language, but I'm certainly in no position to change this and, in any event, am not certain I would want to.

Yesterday I posted an example of OO in BETA. Prior to that, I posted an interesting quote from the BETA researchers. In the quote, they talked about how BETA was for modelling and they didn't like inheritance for code reuse. BETA is all about modelling things properly. They talk about this a lot.

Yet Another Perl 6 Logo

I recently saw Sebastian Riedel's designs for Perl logos, which I like quite a lot, and it reminded me of some of my own ideas in this area.

When the Camelia logo came out I created a few designs for a variation on the butterfly logo based on twin infinities. I don't really have the skill to render them as artistically or as polished as I would wish but the basic idea was something like the following:

Perl6_inifinities_01.jpg

Or with the lower half smaller to emphasise the butterfly shape:

Perl6_inifinities_02.jpg

Or with rotation:

Perl6_inifinities_03.jpg

If you like this idea and have some artistic flair maybe you could create some more colourful and or polished variations on this theme.

iCPAN: CPAN on your iPhone

When I've got a few minutes here and there, I like to browse the CPAN for new, interesting modules. I wanted a way to do this quickly and easily on my iPhone, without needing to get online to do it. This app did not exist, so @ioncache and I set about creating it. iCPAN has been available in the Apple app store for about 4 weeks now and we're currently working on updates for the next version. (Our lightning talk slides have now been posted as well.)

iCPAN works on your iPhone, iPod and even your iPad. Our initial release of the app allows you to:

  • search CPAN documentation by module name
  • bookmark your favourite modules
  • view your recent searches
  • browse the docs offline


The next release will add the following:

  • Example code snippets in docs will be formatted via PerlTidy
  • These codes snippets will also feature syntax highlighting

one liner history command counter

Wondering what commands you use the most, try this one liner:

$ history | perl -ne 'END { map {print ++$i.": $_\n";} splice(@{[sort {$h{$b}<=>$h{$a}} (keys %h)]},0,5); } m/\s+\d+\s+(.*)/; $h{$1}++;'

In one of the servers I use I got:

1: ls
2: fg
3: cd ..
4: sudo tail -f /var/log/httpd/error_log
5: cd


Well, I actually added:

alias j=jobs
alias vl='sudo tail -f /var/log/httpd/error_log'


To my .bashrc after this.

BETA - An Example

I've kept meaning to post an example of how the BETA programming language handles inheritance and now I have a touch of time to do so. It may seem very strange to you, but one you see what's going on, it actually makes sense.

CPAN Testers 2.0 and the metabase-relayd

So CPAN Testers 2.0 was announced and further here.

Big kudos to all concerned

When I met David Golden and Ricardo Signes at the Birmingham QA Hackathon in 2009 and discussions were happening about Metabase and how submissions would be made to it, I'd expressed concern about the weight of the dependencies that would be required to make Metabase submissions.

I came up with the idea of a Metabase relay server, something that would act as an intermediate between smokers and the Metabase. The smokers would use an very lightweight transport to submit reports to the relay, which would then forward the requests on to the Metabase server.

And that was as far as it went until the beta testing of Metabase started. I wrote Test::Reporter::Transport::Socket which would be installed on the smoker. This takes as options the address of a relay server and the TCP port to connect to. The data is passed using Storable's nfreeze function and unfrozen at the relay.

Gambling

Just when thought this proxy/web-filter was as dumb as it could get: Screen shot 2010-07-13 at 09.02.32.png

Perl-Critic in Depth


Jeff Thalhammer will be back to speak about Perl-Critic again on July 27nd at 7pm, at the office of LookSmart.

As any Perl developer will tell you, There's More Than One Way To Do It. But over time, we all learn that Some Ways Are Better Than Others.

Perl-Critic is a static source code analyzer based on Damian Conway's book Perl Best Practices. In this presentation, you'll learn how to use Perl-Critic to improve the quality and maintainability of your code. We'll cover the perlcritic command-line tool and the Test::Perl::Critic module, as well as tips for policy selection and incorporating Perl-Critic into your development culture. We'll also demonstrate how to extend Perl-Critic with your own custom policies.

Perl-Critic - http://perlcritic.com/

Jeff Thalhammer's CPAN page - http://search.cpan.org/~thaljef/

Announcement posted via App::PM::Announce

RSVP at Meetup - http://www.meetup.com/San-Francisco-Perl-Mongers/calendar/14082571/

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.