use Data::Rmap qw(:all);
use JSON;
use Data::Dump;
use Clone;
use boolean;
my $arg = from_json(q{{"1":true,"2":false}});
# convert JSON booleans to boolean's booleans
rmap_all { bless $_,"boolean" if ref($_) =~ /^JSON::(XS|PP)::Boolean$/ }, $arg;
dd $arg;
Hint: it's one character long.
In fact, this piece of code is full of Perl's traps (from Perl's lack of booleans obviously, to less obviously having to clone and rmap not working), it disgusts me.
One ring to rule them all, one ring to find them,
One ring to bring them all and in the darkness bind them.
One Idea to Rule Them All
Ever since the 50's,
the fashion in language design
has been minimalism.
Languages were designed around paradigms,
and paradigms were judged on elegance.
If your choice of paradigm was lists, the result was LISP.
If you decided on strings, you invented SNOBOL.
Arrays, you wound up with APL.
If your reasoning led you to logic, you ended up with Prolog.
If you thought that descriptions of algorithms
must be the basis of programming,
then your fate was Algol.
As part of an ongoing project to improve the woeful state of Qualitative data analysis software, I've already put together some tools to meet my needs. The tools are very much at the prototype stage, and will remain so for the foreseeable future, but I'm using them to prepare publishable work.
For the data management end of things I use a super-simple SGML format to tag chunks of text that I'm interested in, and use my Text::TranscriptMiner library to retrieve data. I use Git for version control, as a kind of high granularity lab book. I also have a web application which deals with the data visualisation side of things.
If you have some hard-copy issues of The Perl Journal (Jon Orwant's magazine), I'd like to trade you something for them, whether that's money or something else. I'd especially like to take a complete set off someone's hands. Send me some email if you have some you want to get rid of.
After my last post about Installing Bricolage 2 on Mac OS X 10.6 "Snow Leopard," I realized that there are a few more important steps that should be documented for those that was to hack on Bricolage CMS vs. just running it. The following instructions link up your git clone with the application itself, making it easy to apply changes, test them, and push them upstream.
After 6 months of development work, following 2 years worth of design and preparation, CPAN Testers 2.0 is finally live.
With the rapid growth in CPAN Testers environments and testers over the past few years, the previous method of posting reports to a mailing list had reached a point where the scalability was no longer viable. This was recognised several years ago and discussions for a new system had already begun, with the view that reports should be submitted via HTTP.
At the Oslo QA Hackathon in 2008, David Golden and Ricardo Signes devised the Metabase, with the design work continuing at the Birmingham QA Hackathon in 2009, where David and Ricardo were able to bring others into the thought process to work through potential issues and begin initial coding. A number of releases to CPAN and Github followed, with more people taking an interest in the project.
Everyday the Internet becomes faster, and everyday new and more complex content is provided via web applications. The problem is that sometimes (maybe most of the times) these rich and complex content applications aren't fast enough to answer big flows of requests. One trick that is often used to improve throughput of slow applications is caching. Instead of always processing requests, that often require some data from one or more external sources, a possible solution is to cache the entire output to answer upcoming requests, or cache smaller components that can be used together to produce the final output.
Memcached is one of the most famous cache engines on the web. It can be used to cache any arbitrary pair key/value, later on in the process you need to know the key to retrieve the stored value. This is one possible caching solution easily to use in Perl. To start using Memcached you can use the following module for example:
no my next ubercool software project isn't called bread, i mean real bread. the bread i bake since nearly a year. and there is just my reciepe, partially as answer to the perl 6 enthusiast sushee.
first of all - why I'm doing that: partially because most breads i ate suck badly (bad taste, cheap ingredients, unnecessary gimmick ingredients, poor manufacturing). I want to stay healthy and these morons try to ruin it. time to gain control here. Another reason is: I want to learn to manage my life. i mean earn money isn't enough - i can't eat money. and its good to put your love into the things you use or give your friends anyway. my motivation clearly isn't to save money since my ingredients cost me as much a bread from the bakerman.
Use some modules:
use Gtk2 '-init'; # basic
use Glib qw/ TRUE FALSE /; # makes for easier source reading
use Gnome2::Vte; # generic terminal widget, will come in useful
Then we create a new window:
my $window = Gtk2::Window->new;
$window->set_title('cpang');
$window->signal_connect( destroy => sub { Gtk2->main_quit } );
$window->set_border_width(5);
That set the title, a nicer border line and also, if someone closes this window, it will ask Gtk2 to close the application entirely. That comes in handy!
Now we'll create a vertical box and put it inside the window we created:
my $vbox = Gtk2::VBox->new( FALSE, 5 );
$window->add($vbox);
The first is a flag for homogeneous - I'm honestly not sure what it means. It has a spacing of 5.
Then we create a horizontal box and put it inside the previously created vertical box:
my $hbox = Gtk2::HBox->new( FALSE, 5 );
$vbox->pack_start( $hbox, TRUE, TRUE, 5 );
Now we'll start filling the horizontal box. Starting with a label:
my $label = Gtk2::Label->new('Module name:');
$hbox->pack_start( $label, FALSE, TRUE, 0 );
Today I noticed that I had a module outdated, named Starman. I have no clue about what it is (ok, now I have), so I typed 'perldoc Starman'. My Mac OS X is not case sensitive (unfortunately). This resulted in the documentation of the command 'starman' to be shown. The man page says "see also, Starman".
Now, the question is... how can I get the documentation for the module, using perldoc?
Since there isn't much I've noticed blogged about the perl interpreter itself, I'll add some notes that could be of interest. In particular, like CPAN Testers, there are some people contributing tests of perl itself albeit with a lower profile and without the snazzy web site. Toward the goal of testing, I made a post to revive the "make test.valgrind" capability perl had:
In the wake of my last blog post, rurban told me Magic was more of a 'last resort', and that everything necessary for making type objects could be done with perl's pack and unpack functions, which precipitated a day or two experimenting and trying to get my head round those. Also fixed up the fundamental Ctypes::_call to return larger types properly on 64bit systems.
We have an open position here at EF Johnson Technologies in Irving, Texas. You have the opportunity to work in a fast-paced, challenging environment with a team of highly motivated, brilliant and geeky people as a part of the Engineering department's Infrastructure team. The opening is for a Senior Software Engineer and requires an in-depth knowledge of Perl. The job has been posted at jobs.perl.org.
Okay, I admit it: Bricolage CMS -- the open-source enterprise-class content management system -- takes a few hours to install. The upside? A well-deserved sense of accomplishment.
Seriously, as someone who works with Bricolage regularly and likes to contribute to the project (when time permits), it's incredibly helpful to be able to have it running locally on my laptop from the latest Github source.
Unfortunately, the Bricolage installation documentation for OS X needs some serious love. There are at least three contradictory resources at the moment: David Wheeler's post "My Adventures with Mac OS X" from 2002 (OS X 10.1), the README.MacOSX that Bricolage comes with, and the "Installing Bricolage on Mac OS X wiki page on Github, which only covers OS X 10.3. Thankfully, Theory (David Wheeler) is easy to find in the #bricolage channel on irc.perl.org and can be cajoled into providing helpful install hints.
All that said, installing Bricolage 2.0 on the current version of OS X -- 10.6.4 "Snow Leopard" -- was actually quite straightforward. So, before diving into updating all of the install documentation, I wanted to capture the basic process here and get some feedback on next steps. If you want to help with feedback, just jump to the Questions section at the end of this post.
The Perl Foundation is looking at giving some grants ranging from $500 to $3000 in August 2010.
In the past, we've supported Adam Kennedy's PPI, Strawberry Perl and Perl on a Stick, Nicholas Clark's work on Perl internals, Jouke Visser's pVoice, Chris Dolan on Perl::Critic and many others (just check http://www.perlfoundation.org/grants for more references).
You don't have to have a large, complex, or lengthy project. You don't even have to be a Perl master or guru. If you have a good idea and the means and ability to accomplish it, we want to hear from you!
Do you have something that could benefit the Perl community but just need that little extra help? Submit a grant proposal by July 31.
As a general rule, a properly formatted grant proposal is more likely to be approved if it meets the following criteria