I'll be taking a couple of weeks off from hacking on my pet project as I'll be in the US for a friend's wedding, but in the meantime, I can still have ideas percolating in the back of my mind. What I'd like is some of your ideas percolating in the back of my mind.
Maybe you love adventure, you're bored with your home country, you prefer the politics of other countries, you want to travel, etc. Whatever your motivations, you probably have been annoyed trying to find "one stop shopping" for information about moving to other countries. Turns out it's a hard thing to do, but there's a lot of possibilities out there, if only you had the information.
Most Web sites dedicated to this topic restrict you to a single country or are old school sites like www.expatriates.com or hideous commercial sites like www.escapeartist.com with no social aspects.
I think it would be interesting to build an online community of world travellers (or would-be travellers) with an ability to share stories, experiences, tips, etc. Search for countries by ease of entry, languages spoken, government stability, job prospects, immigration laws, etc. If such a Web site appealed to you, what would you want to see in such a site?
- Location:London, UK
- Mood:
curious - Music:Gary Numan | She's Got Claws
The site is running from the built-in Catalyst server on a friend's box and the database is SQLite, so don't hammer it too hard :)
Naturally, the source code is public.
- Mood:
accomplished - Music:Amduscia | Ashes of Betrayel
For LJ readers:
Note that because the use.perl journal appears to have a bug in it where it does not allow me to post a journal entry where comments are disallowed, I'm posting this here and linking to it from there. Most of you can feel free to ignore this.
( The use.perl post )- Mood:
disappointed
I threw this together last night. If you don't understand OO programming, it will make no sense. Heck, it will still probably make no sense, but them's the breaks. This is not a tutorial. It's primarily an exploration of why inheritance is such an awful idea and how roles solve the problems found.
Roles are also known as "traits" in SmallTalk, but these are not the same thing as traits in C++. They are also not abstract classes, Java interfaces or Ruby mixins. I really wish people would stop saying they're the same. It's like saying a Lamborghini and a tricycle are both modes of transportation.
- Mood:
accomplished - Music:Saul Williams | Black Stacey
Having gotten a bit tired of seeing bad examples in OO code, I decided to write a tool which makes it easier to detect bad OO code in Perl. I call it Class::Sniff (also available on github). Currently it looks for and reports on the following:
- Overridden methods (not always bad, but you want to see if you've overridden something you didn't know about)
- Multiple inheritance
- Unreachable methods
- Exported subroutines (exporting croak into your class makes it available as a method)</p>
- Duplicate subroutines (experimental "cut-n-paste" detection based on op trees)
Those are often "code smells" and I explain each on in the docs. Sample report after the cut.
( Sample report for deliberately bad class )- Mood:
accomplished
Got an annoying little problem. I wrote the following Greasemonkey script. What this does, when I go out to the Web site use.perl.org is ignore one particularly obnoxious user by simply erasing his comments.
// ==UserScript==
// @name ignore.use.perl
// @namespace http://publius-ovidius.livejournal.com/
// @description Hide Annoying Users
// @include http://use.perl.org/*
// ==/UserScript==
(function() {
var user = 'some_user_name';
var href = '//use.perl.org/~'+user+'/';
var divs = document.evaluate(
"//div[@class='full']/div/div[@class='details']/a[@href='"+href+"']",
document,
null,
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
null
);
for ( var i=0; i < divs.snapshotLength; i++ ) {
var node = divs.snapshotItem(i).parentNode.parentNode.parentNode;
node.innerHTML = '<p><strong>Ignoring '+user+' via GreaseMonkey</strong></p>';
}
})();
In other words, until they restructure use.perl, I will never have to see that user's comments again. However, the code is annoying the heck out of me. I had to write:
var node = divs.snapshotItem(i).parentNode.parentNode.parentNode;
That's because of how the XPath is written:
"//div[@class='full']/div/div[@class='details']/a[@href='"+href+"']",
Because I have to descend several levels deep into the node structure, I have to keep calling parentNode to walk back up the tree. With Perl regular expressions, we have 'positive look ahead assertions'. These allow me to match text which is followed by some other text, but ignore that other text for purposes of capturing data. If I had that with XPath, I could say "match any top level node followed by other nodes, but ignore those other nodes. Then I wouldn't have that awful series of parentNode calls. Is this possible in XPath?
A while ago, the Lisbon, Portugal conference committee asked some programmers to make videos explaining why the next YAPC::EU should be in Lisbon, Portugal. I thought they were asking for something longer than what they were, so my video comes in at a minute and a half. They were happy with it anyway and apparently sent it with their proposal along with brian d foy's compilation. I might add that if you don't know Perl or the Perl community, some of this won't make sense, so there's a quick glossary after.
- YAPC
- Pronounced "yap-see", it stands for "Yet Another Perl Conference"
- PHP
- Another programming language with a friendly (and sometimes not-so-friendly) rivalry with Perl
- Greg
- One of my brothers, who's far more intelligent than the video would suggest. I'm grateful he let me portray him as a complete idiot.
- Mood:
cheerful
- Mood:
cheerful
Still working out some work permit details, so I don't know exactly when I'll start at the BBC. One little issue is that once the permit is issued, I need to mail off my passport for another "Entry Clearance" (similar to a visa). Of course, I'll be on a cruise later this month, so that's not going to happen then.
Still getting calls from recruiters and I think they're slowly learning that no, I'm not looking for work. I do, however, still get email from jobs.perl.org. This is great because of several things I can keep tabs on:
- What skills are employers demanding?
- Where's the work?
- How much does it pay?
- How much work is there? (very subjective, of course)
- What industries are using Perl?
Right off the top of my head, I can tell you that most of the work is in London, New York, Chicago, various places in California, etc. (That's an English language site, so there's a bias). The pay varies widely. Senior programmers in London earn roughly between £45,000 ($90,000) and £65,000 ($130,000) but that can go much higher, depending on the industry. New York is typically offering between $100,000 and $150,000 (these numbers seem high, but remember, these are some of the most expensive cities in the world -- though I often find that Java and C++ programmers get offered more for similar work). The industries are typically internet or the finance industry. Employers typically want strong Perl, OO, and database skills though, perversely, they often have a great deal of difficulty evaluating these abilities.
So it's fair to say that, off the top of my head, I've some idea of what's out there in the Perl world. That's why I was a bit surprised to see the following ad:
Posted: October 11, 2007
Job title: Quantitative Equity Research -- Developer / Programmer
Company name: Continuity Partners
Location: United States, New York, New York
Pay rate: $250,000 +
Travel: 0%
Terms of employment: Salaried employee
Hours: Full time
Onsite: yes
<snip>
That's right. Earn a million dollars in four years. Not even a leadership position. You'd just be another grunt. I've turned down really well-paying jobs (not this well paying) in the finance industry because so often they expect massive overtime and I think quality of life is more important, but damn! A quarter million dollars! I don't have the qualifications they're looking for and even if they did, I've no intention of leaving London, but damn! A quarter million dollars!
- Location:The Poor House
- Mood:
surprised - Music:Transvision Vamp | Tell That Girl to Shut Up
I need to do two things. First is to get a better camera. Second is learn how to use it. The following photos do a lousy job of showing off the beauty of Vienna. It's a lovely city which made me think "if only".
There are 39 photos behind the cut, so they'll take a bit to load. When photos were clearly featuring people, I made sure to explain that I was going to be posting said photos, but I can think of at least one individual I may not have mentioned it to. If you see your photo an would like it removed, please drop me a note. I'll happily do that.
Also, the writing's lousy. I'm busy catching up from a week off and can't be bothered :)
( Vienna )The beginning has some awkward editing jumps, but it gets smoother again. Most of you won't give a damn about the topic. It'll put you to sleep pretty quickly. For those of us it impacts, it's pretty exciting.
We're boring.
If you're not a Perl geek into testing, this won't make sense to you. I've posted this here for them to see since I can control the formatting here.
Here's the output from the latest version of my TAPx::Parser software, a testing tool designed to replace Test::Harness and the prove utility bundled with it.
work $ runtests -lcq t/00-load..................ok t/cp_demo_lib..............ok t/cp_lib...................ok t/db_connection............ok t/dh_password..............ok t/dh_server................Failed 1/61 tests t/domain_lib...............ok t/datacentre_install.......ok t/install_sql..............ok t/general_lib..............ok t/order_lib................ok t/platform_utils...........ok t/pod-coverage.............ok t/pod......................ok t/reset_vars...............ok t/rpc_action...............ok t/rpc_dedserver............ok t/server_stock_manager.....ok t/sql_stripper.............ok t/template_tree_process....ok t/test_class_tests.........Failed 2/186 tests (less 1 skipped test: 183 okay) Test Summary Report ------------------- t/dh_server.t (Wstat: 256 Tests: 61 Failed: 1) Failed tests: 52 t/pod-coverage.t (Wstat: 0 Tests: 42 Failed: 0) Tests skipped: 3, 8, 34, 37 t/test_class_tests.t (Wstat: 512 Tests: 186 Failed: 2) Failed tests: 2, 5 Tests skipped: 3 Files=21, Tests=859, 32 wallclock secs (12.82 cusr + 2.90 csys = 15.72 CPU) |
So I started writing a post about my "fantasy" Christmas list. One idea was the idea of buying a bottle of cheap whiskey and a pack of fags for the elderly mother of my long long adopted brother and sister. However, my present list got offensive enough that it offended even me! So I'll just say that after wrapping a few presents for family members, I am having a thoroughly pleasant evening drinking rum and Coke and working on Perl 6. All I can say is that Perl 6 rocks!
# P12 (**) Decode a run-length encoded list.
#
# Given a run-length code list generated as specified in problem P11.
# Construct its uncompressed version.
sub decode(*@list) returns Array {
gather {
for @list -> $elem {
take $elem.isa(Array) ?? $elem[1] xx $elem[0] !! item $elem;
}
}
}
decode( [4, "a"], "b", [2, "c"], [2, "a"], "d", [4, "e"] ).perl.say;
And if you don't think I'm totally cool, just check out my "current music".
In other news, why the hell do I feel so guilty for not doing more to promote Perl 6?
- Mood:
drunk - Music:Massive Retaliation | Sigue Sigue Sputnik
Some of you may have heard of the infamous Black Perl poem. This poem, written for Perl 3, appeared on April Fools day, 1990 on Usenet and was purportedly from Larry Wall, though as I recall, the headers were forged. However, it's for such an older version of Perl that it hasn't been able to compile for years. So I tweaked it. It still doesn't do anything, but it compiles.
BEFOREHAND: close door, each window & exit; wait until time.
open spellbook, study, select it, confess, tell, deny;
write it, print the hex while each watches,
reverse "its length", write again;
kill spiders, pop them, chop, split, kill them.
unlink arms, shift, wait & listen (listening, wait),
sort the flock (then, warn "the goats". kill "the sheep");
kill them, dump qualms, shift moralities,
values aside, each one;
die sheep, die, reverse system
you accept (reject, respect);
next step,
kill next sacrifice, each sacrifice,
wait, redo ritual until "all the spirits are pleased";
do it ("as they say").
do it(*everyone***must***participate***in***forbidden**s*e*x*).
return last victim; package body;
exit crypt (time, times & "half a time") & close it,
select (quickly) & warn next victim;
AFTERWORDS: tell nobody.
wait, wait until time;
wait until next year, next decade;
sleep, sleep, die yourself and
rest at last
And from a friend of mine, Sparky, for whom I wound up rewriting this because of a couple of misconceptions of his (email reprinted with permission):
I was at a dive bar tonight. They had a poetry reading, open mic. and allowed non-original poetry.
I got on the net and looked up Black Perl.
I read the version at http://internet.ls-la.net/comppoems/blac
BROUGHT DOWN THE HOUSE!
Before the read I asked, "Show of hands, how many here are computer programmers?". No hands went up. Then, "How many people here have heard of the programming language 'perl'?". A couple of cheers from the crowd.
I then told the crowd, "perl stands for 'Practical Extraction and Report Language', or, as those who actually program in the language call it, 'Pathologically Eclectic Rubbish Lister'"
After explaining that the following poem was written by the creator of perl, I explained, "This poem is NOT written in English. It is written in the programming language 'perl' ", and read.
It won two awards, Best Nonoriginal Poem, and Best Poem of the night. I won Best Presentation. Kudo's to Larry, he made me look good. ;-)
After the reading I was approached by a person who said that the peom couldn't possibly compile. I invited him to download perl from ActiveState and download a copy of the poem written for the version of perl that he downloaded and test it for himself. He told me, 'That was a great poem and poems do not compile'. Then came the Zen moment, I said. 'That poem is not a poem'. From one atheist to another, I swear to GOD that is what I said!
He is probably still blinking. ;-)
- Mood:
amused
Yes folks, I take requests. Thank you very much. I'll be here all week and don't forget to tip your waitresses.
retrofire thought it would be interesting to see superimposed graphs of Bush and Blair approval ratings, so I threw one together. The data are taken from the links provided in that post.
Full disclosure on assumptions made in the graph, since "news" organizations don't typically give this: the line for Blair (the lower, green one) is much smoother than Bush's line simply because I didn't have enough data. Also, note that the approval swings appear greater than they actually are because if the graph was fully from 0% to 100%, the lines would be smoother and you'd lose detail. Also, if the poll was taken over several days, I simply took the last date. You should also check back to the original sources to understand how the approval questions were phrased. I took a bit of liberty with them to make them fit together, but I don't think the graph is too far off.

If anyone can point me to quality, longer-term data for these two, I'd be happy to see if I can put it together similar to this chart.
Update: you might notice that the graph looks different. That's because someone spotted a bug in the date handling. I've fixed the bug and updated the graph.
( And for the truly geeky, here's the hacked together program )- Mood:
geeky
I know a few Perl programmers read this blog and on the off chance that they read this and don't see it elsewhere ...
It's that time again! If you have an idea for doing some work for the Perl community and you think it's worthy of a grant, please send your grant entry to tpf-proposals@perl-foundation.org. Grant applications must be in by the last day of July and we will be awarding the grants at the beginning of September.
First, please read about how to submit a grant. Read that carefully as grants are often rejected if they don't meet the criteria. For example, if you want to submit improvements to a well-known project but there's no evidence that you have at least tried to work with the maintainers of that project, the grant will likely not be approved. You can also read through our rules of operation for a better idea of thee grant process.
To get an idea of what sorts of grants are generally accepted, you can read through past grants for 2001, 2002, 2003, 2004, 2005 and 2006. You can also read through the grant-related postings to the Perl Foundation blog. As a general rule, a properly formatted grant proposal is more likely to be approved if it meets the following criteria:
- It has widespread benefit to the Perl community or a large segment of it.
- We have reason to believe that you can accomplish your goals.
- We can afford it (we rarely approve anything more than a couple of thousand dollars).
The thorniest issue, as always, is the grant amount. If you do not include a grant amount, the grant will not be approved. So how much do you ask for? While we have information in this posting about the grant committee, the reality is fairly simple. We're a non-profit organization and we are not flush with cash. If you charge us a typical hourly rate, we probably cannot afford it. Typical grant awards are generally in the $500 to $3000 range, but we have gone under and over those amounts, depending on the grant. As a general rule the less expensive it is, the more likely it is that we can afford to fund it. For highly speculative grants (in other words, projects whose benefits may be unclear or have a high chance of failure), we are unlikely to risk large amounts of our donor's money.
Cheers,
Ovid
New address of my CGI Course.
- Mood:
geeky
On the off chance that any Perl folk read this journal instead of my technical journal and are interested in Class::CGI, you can join the mailing list to help contribute to its design and to ask questions about its use.
( Details ... )Last night I received an email from one of the coordinators. He was trying to plan things, wanted photos for flyers, etc. That's when I found out I was on the list. Surprise! I don't mind since I'll be free on Saturday, but I admit that I'm caught a bit off guard.
And since I'm a geek, I must confess that I noticed something interesting about the Powell's Web site. It's probably a bad interesting and not a good interesting, but then, I don't know the technical reasons for the decision.
Let's a take a look at one of their hyperlinks:
<a href="http://www.powells.com/biblio/059
Hmm, what's that number in the URL? The link goes to this page and that number is featured prominently. It's the ISBN of the book. The use of that number immediately struck me as a potentially bad decision because you don't want to use identifying information for links like this. When new editions of books are put out, the ISBN number sometimes change (and they definitely change when a different publisher puts the book out).
I suppose they did this because you can easily link to a specific edition of a book. This is handy if there's a new edition you want to highlight. However, what happens if you have 20 ISBNs for a book, you have books in stock for 19 of those ISBNs but not for the ISBN you linked to? What if the book was published before ISBNs were introduced? (1966) Worse, what if an ISBN needs to be changed (perhaps it was entered incorrectly or the book is recalled and reissued)? Then the ISBNs on the Web site might need to be changed in multiple places rather than a single place in the database. If the hyperlink had simply used a non-identifying ID (a UUID or a database ID with an optional ISBN for a "default" edition), these problems would simply go away.
Of course, it's quite possible they've considered and eliminated all of these problems, but I strongly suspect they didn't (because I see mistakes like this all the time). If they did anticipate these problems, they probably had more work to do since they use identifying information in the first place.
- Mood:
thoughtful