My first YAPC (Yet Another Perl Conference)

Last week, I went to Sofia, Bulgaria for attending YAPC::Europe, my first technical conference ever and it was next to awesome! I’m writing this blog post late, because I’ve been extremely busy with office work, house search etc. :(. Further in this post, I’ll describe each day of the conference! Oh and even before conference! :)

Meeting people at the airport/flight!

I flown to Sofia from Amsterdam, along with 4 other awesome colleagues, namely Sawyer X, Abigail, Valerie & Eugenia on 21st August. After reaching Sofia airport, we saw some other people (but didn’t meet! They all were new to me). Then in the taxi, I met Matt & one German guy (I don’t remember his name :(). Then in the hotel elevator, I met two guys, they both were wearing onion’s t-shirts, I asked them are they here for YAPC::Europe and the answer came out to be YES. One of those two guys was Diego (don’t remember the name of the other guy :(). In the evening, I met Theo. Then we both went to the other hotel to meet some other people. On our way to the other hotel, we met Leon (the guy behind File::Map, Module::Build::Tiny, libperl++ and threads::lite). In the other hotel, I met Su-Shee, Alex (a Greek guy), Getty & Salve. We all went to the beer party by a noisy train of Sofia :).

Pre-conference event

On the evening of 21st August, there was a beer meeting. All the beer was sponsored by this awesome company :D.

I met so many Perl people for the first time even before reaching the venue. When we got out of the train station & were finding our way to the venue. We met Yana, a Bulgarian girl, who got to know that we were there for YAPC::Europe by t-shirts of some of us. She took us to the venue & also ordered vegan french fries & baked potatoes for me :).

In the bar, I met lots of people, so here is the list:

  • Abigail (I introduced myself to him again, because of my poor memory :()
  • Curtis Poe
  • Olivier Mengué
  • H. Merijn Brand (aka Tux) & his wife
  • Jeff Goff
  • Marian Marinov
  • Peter Rabbitson
  • Maya
  • Hristian
  • Markov
  • Rick Deller
  • Alex (a Bulgarian girl, working for Eligo Recruitment in London)
  • Julian
  • R. Geoffrey Avery
  • Julian F.

I met some more people, but I don’t remember their names :(. Their description is as follows:

  • A Bulgarian guy, working at some Bulgarian company. He told me that his company uses so much of old Perl things. He also told me that he hates Moose, because of so many dependencies.
  • Another Bulgarian guy, me, Hristian & him were discussing similarities between India & Bulgaria, legalisation of drugs in Netherlands etc.
  • A French girl, whom I bugged a lot (asking about how she got her food :)).

First day of the conference

Talks

  • Perl secrets by Mihai Pop
  • Some Dist::Zilla::Plugin:: best practices by Olivier
  • How to Fake a Database Design by Curtis
  • Video and audio with Perl and DLNA (and Chromecast) by Max Maischein
  • Open source deep sky images using perl by StrayTaoist
  • Get Me to the Pub Please by Sue Spence

People I met

  • Amalia Aida Pomian
  • Gianni Ceccarelli aka dakkar
  • Tadeusz Sośnierz aka Tadzik
  • bulk88
  • Mihaela Gordon
  • Some girls from Romania
  • Tatsuro Hisamori
  • Ilmari
  • Kang Min Liu
  • Ksenia Bobrova
  • Two Bulgarian guys in the car (again, don’t remember their names :()
  • A Romanian girl who came to the Booking.com’s booth, but again my terrible memory! :(

Food!

Unfortunately, I didn’t like the food served at the dinner. There were only salads for vegans :(. But the dessert was awesome! :). Also, there were fantastic Bulgarian dance performances, which everyone enjoyed a lot.

Second day of the conference

Talks

I came late to the conference, because I had to practice for my talk (which was on the third day of the conference) & I was too tired last night! :(. I didn’t attend any talks today, except lightning talks & Mst’s keynote.
I myself gave a lightning talk, so I had to prepare for that also. It was not pre-planned at all, Hakim & Karen Pauley (on IRC) asked me to present a 1 min session about GNOME’s Outreach Program for Women, but when I started working on it, I realized that it’s a good topic for a lightning talk because the information was too much to present in 1 min. I made slides one hour before the talk & gave the talk with a little bit of preparation. If you didn’t like it, then blame Hakim & Karen for encouraging me to present it :P.

Also, I got my copy of Ovid’s Beginning Perl signed by him, though the message he wrote was not good :P. I got a copy of Programming Perl from Sawyer & Ovid, thank you both :).

People I met

  • Xan Tronix
  • Wendy
  • Liz
  • Robert (a guy from Sweden)
  • Jonathan (not Jonathan Worthington)
  • Two Bulgarian guys who helped me with setting up everything before my lightning talk, again my terrible memory :(

I met many other people also, but again my terrible memory! :(

Food!

Food was good. We (Sawyer, Theo, Maya, Peter, Robert, Jonathan, Julian, Tux & his wife) all walked for around 45 or so in search of a good vegan place & we found one, thanks to Peter & Maya :D. I had Indian daal-bhat here & embarassed myself by giving a wierd look when waitress brought my dish :D. But food was not bad. We all enjoyed a lot there.

Third (& last :() day of the conference

Talks

I saw Sawyer’s talk about Plack for fun & profit, but mostly profit, it was a good talk. After that, I gave my main talk which was about Moose structured exceptions work I did last summer as part of the GNOME’s Outreach Program for Women. I’m not going to share the video & embarass myself, because I’m too loud in that video, sort of shouting :(.

People I met

  • A guy from Czech Republic, who asked a question about my lightning talk. Again, my terrible memory!
  • Robert Rothenberg, who asked how we can use structured exceptions for dealing with HTTP form handlers. I’ll email you the concerned material soon (after taking permission of the concerned person :)).
  • Some Spanish people, who will organize YAPC::EU next year at Granada, Spain. Again, my terrible memory! :(
  • Kamen Naydenov

Food

I had tasty rice and vegetables in a restaurant booked by conference organizers. Beside the restaurant, there was a beautiful place & everyone got busy in capturing it in their cameras.

Conclusion

After attending my first technical conference, I learnt some things, which will be helpful for me (and probably you as well) in my future conferences:

  • Wear your conference t-shirts, it helps a lot in recognising you!
  • I should take some fruits with me everytime I go to a conference. Because, some countries are not really vegan friendly & the vegan dishes they serve are not as per my Indian taste
  • I should low down my voice while talking.
  • I should spend more time with my colleagues, if not in the office, then may be at these conferences! I have got awesome colleagues like Eugenia, Sawyer, Gugod, Abigail & Valerie, they all helped me a lot. I’ve not yet met one of my colleagues who was present at the conference, looking forward to meet him in office sometime! :)
  • I should keep attending such conferences, because it’ll be a good exercise for my terrible memory. I’ll be able to remember people if I’ll meet them again and again!

Slides of my talks:

  • Moose structured exceptions : Source -> in this gist, slides -> here
  • Lightning talk about GNOME’s Outreach Program for Women : Source -> in this gist, slides -> here

THANKS

I want to say thanks to these organizations because sponsored my trip:

  • The GNOME Foundation
  • The Perl Foundations
  • Enlightened Perl Organization

A big thanks to the conference organizer Marian Marinov for organizing such a fantastic conference! :)

STAY IN TOUCH

At last, I want to say to all my folks who I met at the conference that please stay in touch & keep making such conferences awesome. See you all at Granada next year! :)

Back with a BANG

I’ve not blogged about anything since past 6-7 months or so (no energy to check out the actual date). I’m writing this post inspite of my tiredness, because I’m really excited & I just can’t stop myself from writing it. Please pardon me for my bad english & all grammatical mistakes! Also, like my previous blog posts, this blog post will also be full loads of redundant smilies! So here it goes:

This is what I’ve done in past 5-6 months

  •  Searching for a paid job
    • I started my job search & preparation in february-march.
    • I applied to quite a few companies, but didn’t get any calls from any companies except one company, which is booking.com.
  • Interviews season
    • They (Booking.com) are one of the prominent Perl shops in Europe. Their IT department is located in Amsterdam, Netherlands.
    • They interviewed me on phone on April Fools’ day :D
    • After some days, they invited me to Amsterdam, Netherlands for two in-person interviews on 2nd June.
    • All these interviews were technical. I was informed that I’ll have one HR interview as well, but I won’t call it an interview, it was more of a casual chat with their HR! :)
  • Post interview
    • I got to know that I’ve got selected on the in-person interview day itself i.e. on 2nd June.
    • Since then I’ve been preparing for relocating to Amsterdam :D.
    • But this preparation have come to an end now, because location of this post :)
  • Relocating to Amsterdam:
    • One of the best things about booking.com is that they’ve made relocation to Amsterdam very easy.
      • Booking.com paid for all my travels & my luggage (which is 4 big travel bags).
      • If you’ve pets and a partner, then booking.com will help in relocating them as well. But in my case, I’ve moved alone.
      • They help in moving big things as well in 15ft containers. But I had 4 travel bags only.
      • They provide a temporary accomodation for a period of 2 weeks until you find a house for yourself. This temporary accomodation period could be extended to 4 weeks maximum.
    •  Bad experience
      • If you’re moving to Netherlands or some other country for job or studies, then you need to get your documents apostilled.
      • I had to run a lot to government offices for getting my documents apostilled.
      • It takes a lot of time & effort to get these things done. Even indefinite time & I mean it! :(
      • I’ll write another post about it in detail.
      • Lifting 4 travel bags for a while, because I’m not that strong :D
  • Apart from job hunting, moving etc., I’ve learnt or still learning:
    • Flask, a web framework written in Python
    • SQLAlchemy, an ORM written in Python
    • LaTeX, a type-setting system, which is very useful for making documents, presentations etc.

The FUTURE

  • Excitement…so many reasons…
    • Booking.com is one of the best Perl shops in the world.
    • They contribute a lot to the Open source world.
    • World’s best Perl (but not only Perl) programmers are working there, who contribute a lot to open source. I’m not going to give you the list, it’s too long & I’m tired.
    • Living on my own in a beautiful city like Amsterdam.
    • Lifting 4 travel bags for a while, because I’m not that strong physically :D
  • Oh! What I’ll be doing at booking.com!
    • I’ll be a Software Developer trainee for an year.
    • First month is critical
      • Yep, it is!
      • First month will be the probationary period & they people could send me back to my country if I won’t do well.
      • So, this will push me to give my best! Hope so! :)
    • On 6th August, my future team lead sent me a welcome email :)
    • I’ll be working on image and text processing.
    • I’ll need to learn:
      • HTML::Mason templating system
      • Class::DBI ORM
      • Scrum process for software development
      • JQuery.
  • Nervousness…
    • MEETING SO MANY FAMOUS & ROCKING PEOPLE AT BOOKING.COM :D

How to upload a perl module on CPAN using Dist::Zilla?

Today, I released my second CPAN module. While writing my first CPAN module, I used Dist::Zilla for uploading my module to CPAN, but when I looked into it today, I had to go through some dzil plugins again. So, I thought that I should write a blog post about this.

Basic directory structured of the module:

Assuming, my module name is X::Y::Z, I need to create a directory with name X-Y-Z. Output of find command should look like this:

lib               # all code goes in lib/
lib/X             # code for X will go here
lib/X/Y           # code for Y will go here
lib/X/Y/Z.pm      # code for Z will go here
t/                # all tests will go here
dist.ini          # explained below

For example : see this module.

Writing dist.ini:

Following is my dist.ini. I’ve pasted it below with comments for explaination (starting with ‘;’).

name = Plack-Middleware-FixMissingBodyInRedirect
version = 0.01
author = Upasana <me@upasana.me>
license = Perl_5
copyright_holder = Upasana

; this plugin gathers all files in a dist,
; if root is not given it defaults to where dist.ini is located
[GatherDir]

; this plugin will add META.yml file to the dist
; META.yml contains information related to dist like abstract, author,
; which modules are required for building & testing the dist,
; which modules are required during runtime,
; pre-requisites etc.
[MetaYAML]

;for removing unwanted files, e.g. files starting a '.'
[PruneCruft]

; This plugin builds Makefile.PL, that uses ExtUtils::MakeMaker
; ExtUtils::MakeMaker create a module Makefile.
; (I found this thing very lengthy & very complicated,
; I've myself not understood it well).
[MakeMaker]

; will create a META.json, for replacing old style META.yml
; META.json contains same information as META.yml, but in JSON format
[MetaJSON]

; adds a LICENSE file containing the full text of dist's license
[License]

; adds a README file to the dist,
; citing the dist's name, version, abstract % license
[Readme]

; This plugin rip apart your kind of POD & reconstructs it as old real POD
; (I really don't know the difference between the two kinds of PODs though)
; By default, it'll modify the files under:
; :InstallModules - .pm/.pod files under lib/ directory
; :ExecFiles - executable files in the distribution
[PodWeaver]

; This plugin will read MANIFEST.SKIP file &
; skip all the files decalred in it, while building the dist
; My MANIFEST.SKIP contains this text:
; ^.*~$
; because I want to skip backup files, which starts with any character,
; but ends with '~'
[ManifestSkip]

; This plugin checks POD coverage of all subs,
; to indicate that some subs should be treated as covered,
; even if no documentation can be found, you can add:
; =for Pod::Coverage sub_name other_sub this_one_too.
; It generates xt/release/pod-coverage.t file
[PodCoverageTests]

; for checking POD syntax
[PodSyntaxTests]

; This plugin runs before a release happens,
; It'll extract to-be-released archive into a temporary directory,
; run all the tests, if tests fail then it'll abort the release,
; else it'll release the dist to CPAN & clean-up the temporary directory
[TestRelease]

; This plugin checks for correct line endings in the dist
; It generates xt/release/eol.t file
[EOLTests]

; This plugin allows the "dzil release" command to upload the dist
; to CPAN. It'll look for PAUSE account configuration in dist.ini
; (I would suggest to use the latter options for saving PAUSE configuration)
; or in ~/.dzil/config.ini in the following format:
; [%PAUSE]
; username = YOUR-PAUSE-ID
; password = YOUR-PAUSE-PASSWORD
; If above configuration doesn't exist, then it'll look into ~/.pause
; in the following format:
; user YOUR-PAUSE-ID
; password YOUR-PAUSE-PASSWORD
; If none of the above exists, then it'll prompt you for PAUSE credentials
[UploadToCPAN]

; This plugin prompts the author whether or not to continue before
; releasing the distribution to CPAN. It gives authors
; a chance to abort before they upload.
; The default is "no", but you can set the environment variable
; DZIL_CONFIRMRELEASE_DEFAULT to "yes" if you just want to hit enter to release.
[ConfirmRelease]

; This plugin will automatically extracts pre-requisties from your modules
; You can manually add pre-requisites by using Prereqs plugin
[AutoPrereqs]

Releasing dist to CPAN:

After writing dist.ini, you should test & build your dist & see if everything is fine in resulted tarball. For testing & building your dist, do

dzil test --all
dzil build

If everything goes well with the above commands, you can release your dist to CPAN, by doing

dzil release

Source:
I’ve taken most of the explanation from PODs of various Dist::Zilla::Plugin::* modules.

DrRacket rocks!

Life after GNOME’s Outreach Program for Women

My previous post was about the end of my OPW internship task. I’ve tried learning so many different things post OPW:

  • Rust language (studied it for a while, then left)
  • Computer networks from Unix Network Programming (Enjoying… )
  • Advanced data structures (Enjoying…)
  • Dancer : I tried learning it, but didn’t get far with it!
  • PSGI/Plack : Still learning it
  • Scheme from SICP : I’m studying SICP from past few weeks now, but at times I got frustrated with it. Reason is that its exercises, examples were taking so much of my time. I told some perl people about it and asked if it’s normal or I’m being too dumb. Then Mark told me that he spent around 3 yrs (from 1998-2000) in studying that book & it’s normal if it’s taking time. So, I decided to read SICP slowly & without getting frustrated.

Oh evil parentheses :'(

Also, it was a bit difficult for me to understand lisp syntax, especially when to use parentheses & when not to use parentheses :D. Then, this person suggested me to try DrRacket mainly for two reasons:

  • DrRacket is used in production
  • It’ll help me understand lisp syntax better.

Parentheses are my new buddies :)

Yes! They’re! Atleast, from past two days.
So, I started learning DrRacket the day before yesterday and till now I’ve found it awesome.
The best thing I liked about DrRacket is that it deals with images the same way it deals with numbers, booleans etc., which really impressed me. Till now, I’ve never seen this feature in any other language.
For example, if you want to animate a falling rocket, then it’s so easy to do it with DrRacket, using this code:

(require 2htdp/image)
(define (create-rocket-scene height)
(place-image rocket 50 height (empty-scene 200 200)))
;You need to right-click on the image, click on the "Copy image" & paste it in DrRacket's definition area.
(require 2htdp/universe)
(animate create-rocket-scene)

This’ll produce a very beautiful animation. You don’t need to install anything apart from DrRacket for doing this B-)
I stole the above example from here

Conquered the monster named “Documentation” :D

I think the title says it all!

It was boring initially :(

Past two weeks were quite boring initially, as I am at the verge of finishing my internship tasks, only some (around 44) boring (boring because I am not getting their cause easily & not able to understand them completely) exceptions & documentation were left.

As far as exceptions are concerned, I have no other way but to write them manually.

Thank you mentor for giving an awesome & interesting idea

I told my mentor about the boredom I am facing & he asked me to write a documentation generator for the exception classes which I have written, to kill that boredom :D.

Exceptions which I have done till now:

Here are the closed issues of exceptions, which i have done.

Documentation generator:

You can see the documentation generator which I have written, here, please read the description of gist to know purpose of each file.

When I started writing documentation generator code first, I was parsing the exception classes’ code for getting the attributes, but my mentor asked me to load the classes instead of parsing. This made my work very very easy. You can see that horrible parsing in the revisions.

Other problem which I faced was due to use of variables in the exception messages & regular expression escape sequences & quantifiers. For getting rid of these two problems, mentor asked me to annotate such tests, you can see it in the gist.

I think that’s all for now!

GNOME’s OPW status update

Past weeks were quite smooth for me except a few last days, so here is the report:

Accomplishments:

This the list of the issues which I have done till now. Most of them are about writing a structured exception for an error, except some selected or better to say horrible ones :D, which I’ll discuss next.

Major accomplishment:
Working on this inline exception. I took around 4-5 days for this. Here is the log of commits related to this exception.

Why it was tough?

  • Reading the generated inline code: Reading and interpreting inline code was a big deal for me, because it had nested if statements, improper indentation etc. Here is a sample of inline code (only first file). Jesse asked me to install Perl::Tidy module, I did and then the code became legible.
  • Understanding how inline code is generated: In Moose, inline code is generated through eval blocks, which are generated in sub _eval_environment (it’s generated in other places also, but for this exception it’s generated in Moose::Meta::Attribute::_eval_environment):
    sub _eval_environment {
        my $self = shift;
    
        my $env = { };
    
        $env->{'$trigger'} = \($self->trigger)
            if $self->has_trigger;
        $env->{'$attr_default'} = \($self->default)
            if $self->has_default;
    
        if ($self->has_type_constraint) {
            my $tc_obj = $self->type_constraint;
    
            $env->{'$type_constraint'} = \(
                $tc_obj->_compiled_type_constraint
            ) unless $tc_obj->can_be_inlined;
            # these two could probably get inlined versions too
            $env->{'$type_coercion'} = \(
                $tc_obj->coercion->_compiled_type_coercion
            ) if $tc_obj->has_coercion;
            $env->{'$type_message'} = \(
                $tc_obj->has_message ? $tc_obj->message : $tc_obj->_default_message
            );
    
            $env = { %$env, %{ $tc_obj->inline_environment } };
        }
    
        $env->{'$class_name'} = \($self->associated_class->name);
    
        # XXX ugh, fix these
        $env->{'$attr'} = \$self
            if $self->has_initializer && $self->is_lazy;
        # pretty sure this is only going to be closed over if you use a custom
        # error class at this point, but we should still get rid of this
        # at some point
        $env->{'$meta'} = \($self->associated_class);
    
        return $env;
    }
    

    In the above code, $env is a HASH reference. We need to initialize key-value pairs of variable names and their values which we want in our inline code. Thank you Jesse for explaining it to me.

  • Making either metaclass object or class name available in the inline code: Using metaclass objects in the inline code leads some problems because of some circular dependencies in Moose. So I was trying to pass class name to the exception, because I can easily get the metaclass object of a class if I know its name.
    Long time ago, my mentor, Shawn asked me to work on this issue. At that time, I didn’t totally understand the reason of making that modification to Moose::Exception::Role::Class, but now I have understood why Shawn asked me to do that. Lines 169 to 187 of this gist has the concerned code.
  • Making existing tests pass: After I made changes in the code, my next task was to make all existing tests pass. Here, I did a mistake, after committing my changes, I didn’t run the test suite, I did it after 1 day (may be because of frustration) :(. I committed a lot of other code in the meantime, so it was hard to tell which commit is the cause of test suite failure. Shawn told me about git bisect, which uses binary search algorithm. It’s a very good tool for debugging (will try to explain in a different post). I used it for getting the commit which was the cause of the test suite failure. Thank you Shawn for telling me about such a good tool.

Next?

I’ll try to finish non-inline exceptions first, because I think my mind can’t cope with sudden transitions from inline to non-inline exceptions and vice-versa :D. After that, I’ll again do horrible inline exceptions :D