Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

potyl (8582)

potyl
  (email not shown publicly)
Jabber: emmanuel.rodriguez@gmail.com
+ -

  Journal: Pexeso game now on CPAN - Game::Pexeso on 2009.10.24 2:54

Journal by potyl on 2009.10.24 2:54
User Journal

I've finally packaged the Pexeso game as a CPAN application: Game::Pexeso. Now there are no excuses for not playing it!

The source code is available on github: pexeso git repo.

Remember that if you want your face to be in the game that you have to create a CPAN account!

Read More 0 comments

+ -

  Comment: Re:It's a pity none of these games are on CPAN (Score 1) on 2009.10.24 2:47

by potyl on 2009.10.24 2:47 (#70964)
Attached to: about a future of Perl

The game is now on CPAN: Game::Pexeso.

Read More 3 comments
Comments: 3
+ -

  Comment: Re:It's a pity none of these games are on CPAN (Score 1) on 2009.10.20 1:38

by potyl on 2009.10.20 1:38 (#70922)
Attached to: about a future of Perl

Hopefully by the end of the week, if I get the time to package the game.

I was thinking of naming the package Game::Pexeso. What do you folks think of this? Any suggestions?

Read More 3 comments
Comments: 3
+ -

  Comment: Re:global bad, lexical good (Score 1) on 2009.10.19 12:27

by potyl on 2009.10.19 12:27 (#70918)
Attached to: Declarations and Scope followup on Chromatic's post

This certainly is covered in Damian Conway's PBP: "5.1. Lexical Variables Avoid using non-lexical variables."

I'm not referring to lexical variables (my), as you pointed out that part is covered by the best practices. I was referring to writing a single script from the top to the bottom with out localizing all variables. Remember that my only declares the variable for the life time of the current block. If the variable is not declared in a block then the file is the block scope, making the variable global. This is no matter if the variable is written in all caps or in lower case

I think that we have learned that declaring all variables as global is a bad programming practice. We are lucky with Perl that we don't need to do so. We can even declare our variables just before we need to. Other languages, C for instance, are not that lucky and are trying to address this in some way or another (C99 is doing it, a bit too late).

I like wrapping all my code inside a function, it limits the scope of the variables and doesn't allow me to cut corners. If I need something global it has to be pulled out manually from the block. Moving bits of code from the main function to another function is easier because if I forget a variable use strict; will spot it right away. Without this refactoring code that omits a variable will pass unseen as all variables are global.

Read More 5 comments
Comments: 5
+ -

  Comment: Re:Scope bashing? (Score 1) on 2009.10.19 0:18

You're right that I haven't chosen my words properly. I should have said scope discussion.

Please accept my apologies.

Read More 5 comments
Comments: 5
+ -

  Journal: Declarations and Scope followup on Chromatic's post on 2009.10.18 3:44

Journal by potyl on 2009.10.18 3:44
User Journal

Chromatic as a good post on Declarations and Scope. I'm glad to see that I'm not the only one that follows this best practice. Which by the way I was surprised to not see in Damian Conway's Perl Best Practices.

Read More 5 comments
Comments: 5
+ -

  Comment: Re:touchfreeze & unclutter (Score 1) on 2009.10.09 13:34

by potyl on 2009.10.09 13:34 (#70832)
Attached to: Enable/Disable touch pad

I got confused because this is what I found with google: touchfreeze. I guess that I wasn't feeling lucky :)

Read More 6 comments
Comments: 6
+ -

  Comment: Re:Possible fixes for your issues (Score 1) on 2009.10.05 12:09

by potyl on 2009.10.05 12:09 (#70791)
Attached to: Enable/Disable touch pad

I don't know about MacBooks, but my MacBook Pro's iSight works just fine if I load the right driver.

The latest version of the MabBook Pro has no problem with the video camera. But under the latest MacbBook it doesn't work.

Seeing one CPU is most likely a result of using the wrong kernel.

The missing CPU is not related to the kernel type. It's a well known kernel bug which causes the MacBook not to boot.

As surprising as it might seem the latest MacBookPro works better under Linux than the latest MacBook. A colleague has the new MabBoookPro and installing Ubuntu there was quite easy, when I tried to install the same OS in the MacBook I was set for a nice ride!

You may want to look into the options on syndaemon.

Definitely!

Read More 6 comments
Comments: 6
+ -

  Comment: Re:touchfreeze & unclutter (Score 1) on 2009.10.05 6:10

by potyl on 2009.10.05 6:10 (#70786)
Attached to: Enable/Disable touch pad

Cool but that program works on windows :( On the other hand the documentation says that it works like syndaemon on x-window! I should give it a try!

Read More 6 comments
Comments: 6
+ -

  Journal: Enable/Disable touch pad on 2009.10.05 1:50

Journal by potyl on 2009.10.05 1:50
User Journal

I use a MacBook as my main computer. I work on that laptop and do all my random hacking on it as well.

Read More 6 comments
Comments: 6
+ -

  Journal: Log::Log4perl now supports %R on 2009.09.28 13:46

Journal by potyl on 2009.09.28 13:46
User Journal

Log::Log4perl 1.25 has been released and it has two interesting enhancements:

  • Color configuration and attribute support added to ScreenColoredLevels
  • Patternlayout now supports %R, which returns the time elapsed from the last logging event
Read More 0 comments

+ -

  Comment: Re:GCC-XML (Score 1) on 2009.09.28 0:12

by potyl on 2009.09.28 0:12 (#70680)
Attached to: Finding uncovered XS functions in Perl bindings

Thanks for the pointer! I will take a look at the program.

At the time I though one of writing a parser for C header files and XS files, but I didn't find a grammar module in CPAN that was convincing enough. Now that Damian Conway has released Regexp::Grammars I guess that the job could be easier.

Although, I did find an advantage in scanning the .so libraries. As it clearly shows which functions are made "public" in the C API. It's nice for finding "private" functions that haven't declared as static.

Read More 2 comments
Comments: 2
+ -

  Journal: Finding uncovered XS functions in Perl bindings on 2009.09.26 16:09

Journal by potyl on 2009.09.26 16:09
User Journal

As I've said in my previous posts. I have two CPAN modules that provide bindings for C libraries.

One thing that I have I realized while I was writing these bindings is that sometimes C functions pass under my eyes unnoticed and that I forget to provide bindings for them. This can happen for various reasons:

  • The C library failed/forgot to document some functions.
  • New functions are added without being announced during the development.
Read More 2 comments
Comments: 2
+ -

  Journal: Writing Perl bindings for GObject based libraries on 2009.09.24 13:27

Journal by potyl on 2009.09.24 13:27
User Journal

I have in CPAN two modules that provide Perl bindings over two existing C libraries: Gtk2::Unique and Champlain. These two modules both wrap C libraries that use Glib's GObject framework. I don't want to go too much in the details of explaining how GObject works, so I will just keep it brief. What's important to know is t

Read More 0 comments

+ -

  Journal: Champlain is now using Clutter 1.0 on 2009.09.19 16:34

Journal by potyl on 2009.09.19 16:34
User Journal

I finally had the chance to resume my work on the Perl bindings for libchamplain which had a major release 0.4. The major change in this new version is the port to Clutter 1.0.

Read More 0 comments