Safe Travels

Though many are sticking around to take in all that Madison has to offer, many others are headed back home from YAPC::NA 2012.  Safe travels to you all.

[From the YAPC::NA Blog.]

Ternary Logic and Digital Computing

Martin Becker will give a talk at YAPC::Europe 2012 described as

Ternary or three-valued logic is a logic in which there are three truth values indicating true, false and some third value, often used to denote uncertainty or indefiniteness. A three-valued information unit is called a trit.

It would be technically feasible to build digital systems based on trits, using memory units with three distinct states (flip-flap-flops) and logic circuitry with three distinct input/output levels, like positive, negative and zero voltage.

This talk explores basic operations and other important properties for a hypothetical ternary computer, as implemented in the Perl library Math-Logic-Ternary. It turns out that ternary logic gives rise to uniqe features such as a very simple and symmetric numeral system.

MIME::Base64 and pearlclutching

I've been working on WhiteHat's new sourcecode scanner, and one of the things we need to do is transmit snippets of source code around inside of XML. Since many XML parseres are notoriously sensitive to non-ASCII characters, even in CDATA, we decided that the simplest thing to do was Base64-encode them. This shouldn't be a problem, right?

Well, no. Turns out that MIME::Base64 is very picky itself about encoding things properly. If you hand it UTF-8, it screeches, "Characters with more than 8 bits?! Heavens!" and falls over. There's an incantation noted it its documentation that will let you handle it, but it didn't, at least for me, work all that dependably.

A little poking around turned up Encode::Encoder , which works like a charm, and is very clean:

Perlybook.org - Read Perl module documentation at the Preikestolen

Hi @all,

a couple of weeks ago, we started perlybook.org. It is a service that creates ebooks for your favourite Perl module documentation. So you would be able to read the Moose documentation while you sit on the Preikestolen (The "Move to Moose hackathon" will be right after YAPC::Europe).

It makes heavy use of the MetaCPAN API, so we do not need to have our own cpan mirror. To create the ebooks, we use EPublisher with its epub and mobi plugins.

We will use this blog to announce news regarding perlybook.org and the modules it depends on. And we will create a list of the hottest ebooks each week.

YAPC:NA Day 3

YAPC::NA’s talks for Day 3 begin at 9am, with the plenary starting at 8:40am. Yesterday was a big success, but now it’s sort of sad that we’re already to day 3. Oh well, there’s always next year! Here’s to hoping that we go out with a bang in day 3.

Don’t forget that you can watch live on the web for free:

[From the YAPC::NA Blog.]

CPAN Dependency Heaven

Jon Allen will give a talk at YAPC::Europe 2012 described as

Installing CPAN modules and managing their dependencies has got much easier over recent years thanks to tools like cpanm. But what about the DarkPAN, i.e. all the code that *isn't* on CPAN?

In this talk we will look at how to build our own private CPAN, upload our own DarkPAN modules, and easily mix private and public dependencies.

From this we will build cross-platform installation packages which can be used on any system with Perl installed (no external dependencies or even Internet access required).

Read my book online for free

This is for a limited and unknown amount of time, but you should be able to read my book online for free. Read on for a bit of explanation about what's going on and for some important caveats (and the URL).

Look, I Just Paid the Bill

If you visit the Silicon Valley Perl Mongers Meetup site, you'll see that I'm now listed as the organizer. This is not strictly true - Ian Kluft is still our primary organizer, but due to the fact that Meetup sends out a metric buttload of mail - I have now witnessed this as organizer - he missed the "OMG SVPERL GONNA DIE" message that got sent, repeatedly, to all the SVPerl members when the Meetup bill was due in a week.

Everyone was getting nervous, so I jumped in and paid the bill, partly because everyone was getting nervous we hadn't heard from Ian, and partly because WhiteHat Security, my current employer (who I love, and you should come work here if you are a good Perl programmer - heck, if you're a good Python or Ruby programmer, come and we'll teach you Perl) said they'd pick up the tab.

So, woo, I'm an organizer. I just like having an excuse to give talks!

An Arduino/Dancer-enabled mobile-enhanced door

So you're sitting at home, preparing for a karaoke night, waiting for your friend to arrive. She comes in, rings the doorbell and you're thinking "fuck! I'm upstairs, and she's downstairs and I have to open the door for her (because it's locked) but I'm busy changing my clothes." What do you do? WHAT DO YOU DO?

What if you could let her in using you phone while you're still upstairs getting yourself ready? Arduino could be used for that. And the following is a theoretical (and slightly bit practical) explanation on how you could use Arduino and Dancer to accomplish this.

Arduino is a basic unit. You can set bits on and off. You can hook the bits to other devices (sound, video, screens, you name it!). You can write firmware to it. That's awesome. You can hook up more shields (components) to it. That means you can have additional hardware like an ethernet hookup or whathaveyou.

Labyrinth Is/Isn't A Web Framework

Barbie will give a talk at YAPC::Europe 2012 described as

Labyrinth is a codebase for presenting websites, originally designed and developed in 2002. It's original design goal was to be a "Website In A Box", meaning that it could be installed on a web server ready and complete to server a website. However, it can additionally be extended, providing a framework for those who wish to add their own requirements to the workflow and functionality.

As such, this talk is an introduction to both the web framework and stand-alone aspects of Labyrinth.

Further Reading For The YAPC::NA 2012 Keynote

This is a placeholder post to house links to further reading from my YAPC::NA 2012 keynote.

The raffles are a big hit so far. If you’re at YAPC::NA...



The raffles are a big hit so far. If you’re at YAPC::NA this year, be sure to get your chance to win the nearly $10,000 worth of prizes we have in our raffles. 

[From the YAPC::NA Blog.]

Announcing Marpa::R2

What is Marpa?

I am very pleased to announce Marpa::R2 -- "Release 2" of the Marpa parser. For those unfamiliar, the Marpa algorithm is something new in parsing -- it parses anything you can write in BNF and, if your grammar is in one of the classes currently in practical use, it parses it in linear time. Marpa::R2's parse engine is written in optimized C, so that Marpa::R2's speed is competitive with parsers of far less power.

An important feature of the Marpa algorithm is "situational awareness". Marpa knows at every point in the parse exactly how far it has progressed in each rule, and can share this information with the application. The advantages of this go beyond error detection -- Marpa's situational awareness is accurate, graceful and fast enough to be used as a parsing technique in its own right -- Ruby Slippers parsing.

Announcing Marpa::R2

Talks accepted!

We finally fixed a bug in our voting app, so we were able to vote the talk proposals. We have accepted lots of talks (thanks for the great proposals). Even those talks that have not been accepted yet are not rejected at all. They will be reconsidered in the next round of voting...

So today and in the next few days, you'll see a lot of blog posts introducing the accepted talks.

How many of your dists are in Debian?

Here's a small script which I whipped up just now. I thought of trying out MetaCPAN::API, but after about 5 minutes of trying to find a way to list an author's distributions (and failed), I resorted to a quick hack using Mojo::DOM.

Here's a sample output:

Vegan Food Options in Madison

From guest contributor Dave Rolsky:

There are a ridiculous number of vegan options in Madison at YAPC::NA 2012. Some of the highlights:

  • Dandelion is an all vegetarian and mostly vegan food cart on the Library Mall
  • Kabul, Buraka, Himal Chuli, Med Cafe, Dobra Tea, and Ian’s Pizza all have vegan options, and are a 5-10 minute walk from the conference
  • Further out there are multiple places with vegan breakfast like tofu scrambles, hashes, and biscuits & gravy at Monty’s Blue Plate Diner and Willalby’s Cafe
  • The Chocolate Shoppe is an ice cream shop offering at least 6 options (4 sorbets and two soy milk-based flavors). Paciugo has multiple vegan gelato options.
  • Vegan desserts are available at The Green Owl, Monty’s, Mother Fools coffee house, Dandelion, Willy Street Co-op, and probably others I haven’t found yet.


I suspect I won’t even scratch the surface before I leave on Saturday, but I’ll do my best.

[From the YAPC::NA Blog.]

HTML-Tree 5: Now with weakref support

HTML-Tree has long been a source of memory leaks for programmers who weren’t very careful with it. Because it uses circular references, Perl’s reference-counting garbage collector can’t clean it up if you forget to call $tree->delete when you’re done. Perl added weak references (a.k.a. “weakrefs”) to resolve this problem, but HTML-Tree has never taken advantage of them. Until now.

HTML-Tree 5.00 (just released to CPAN) uses weak references by default. This means that when a tree goes out of scope, it gets deleted whether you called $tree->delete or not. This should eliminate memory leaks caused by HTML-Tree.

Unfortunately, it can also break code that was working. Even though that code probably leaked memory, that’s not a big problem with a short-running script. The one real-world example I’ve found so far is pQuery’s dom.t. In pQuery 0.08, it does:

Webfusion sponsors YAPC::Europe 2012

Please welcome Webfusion as a silver sponsor of this years' YAPC::Europe.

webfusion_blog.png

Established in 1997, Webfusion is one of the UK's leading web hosting groups. We offer cost-effective, feature-rich hosting packages for everyone from businesses, web developers, designers and hobbyists. With 24/7 technical support, robust Firewall server protection and a state-of-the-art UK based data centre with Webfusion your website is always in safe hands.
www.webfusion.co.uk

open module under cursor in vim

Inspired by http://www.slideshare.net/c9s/perlhacksonvim I wrote (well ... copied for the larger part) a script to open the Module currently under the cursor in vim.

Typing \fm will lookup the first Module found in available Perl library paths (plus current working directoy . '/lib')

I did search for some time and read a bit about ctags and pltags but ended up confused. add this to your vimrc


""""""""""""""""""""""""""""""""""""
" find module in perl INC and edit "
""""""""""""""""""""""""""""""""""""
function! GetCursorModuleName()
    let cw = substitute( expand(""), '.\{-}\(\(\w\+\)\(::\w\+\)*\).*$', '\1', '' )
    return cw
endfunction

function! TranslateModuleName(n)
    return substitute( a:n, '::', '/', 'g' ) . '.pm'
endfunction

function! GetPerlLibPaths()
    let out = system('perl -e ''print join "\n", @INC''')
    let paths = split( out, "\n" )
    return paths
endfunction

function! FindModuleFileInPaths()
    let paths = [ 'lib' ] + GetPerlLibPaths()
    let fname = TranslateModuleName( GetCursorModuleName() )

    for p in paths
        let f = p . '/' . fname
        if filereadable(f)
            exec "edit " . f
            return 1
        endif
    endfor

    echo "File not found: " . fname
endfunction

nmap fm :call FindModuleFileInPaths()

CAVEATS


  • returns only the first found module
  • "local" modules not found unless current working directory has the lib/ dir as child

The job fair is in full swing.



The job fair is in full swing.

[From the YAPC::NA Blog.]

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.