-s|src|source path
the path where search for jpg files to be loaded
Can be modified in the Tk interface

-d|dest|destination path
path used to save files
Can be modified in the Tk interface

-debug
print more information on the screen
Can be modified in the Tk interface

-pr|phratio floating point
the ratio used to display the current photo
Can be modified in the Tk interface

-wr|winratio floating point
the ratio to size the window where the photo is displayed
Can be modified in the Tk interface

-p|preload integer
how many photos load in memory after and before the current
one. Can increase drawing speed time

-x|gridx integer
how many columns in the thumbnail grid

-y|gridy integer
how many rows in the thumbnail grid

-nothumbs
does not load thumbnails at all

-e|extension jpg|gif|png|gd|gd2
the exstension of saved files
Can be modified in the Tk interface

-quality|jpegquality 0-100
the quality of the file used by GD when saving the current
photo in jpeg format
An empty value let GD to choose a good default
Can be modified in the Tk interface

-pngcompression 0-9
the compression factor used by GD when saving the current
photo in png format
-dateformat|df string
the format used for dates. It defaults to %Y_%m_%d_%H_%M_%S
in such way resulting pics can be ordered correctly.
See C<strftime> in L<POSIX> to more hints about formatting.

The program is aimed to let you to easely choose among photos and save one (or more) copy in the preferred format (jpg as default; gif png gd and gd2 are also available). The name of the copy is crafted using the timestamp when the photo was taken.

Basically the program will load all jpg files found globbing the path given with command line parameter -source or entered in the graphical interface, and foreach file will examine some exif tags to get sizes, timestamps and the thumbnail (if not present showing a black empty one).

Orientation of the image is handled automatically for thumbnails and main photo.

Advanced options are available to manipulate how many photos are copied, in which format and let you to postprocess via exiftool each created image.

The program uses GD for image manipulation and Image::ExifTool to load infos from photos and in the postprocess of them.

A main control window and a display one are created. Optionally a third window is created to access the advanced copy options. The display window tends to take the focus being the program focused on displaying photos.

all controls to manipulate the photo list (&#39;browse&#39;&#39;new list&#39;&#39;view list&#39;&#39;add to list&#39; and &#39;clear list&#39;) Note the that the &#39;browse&#39; does not fill the list; you need to use &#39;new list&#39; or &#39;add to list&#39; after using it.

an entry to choose the destination folder (that will be checked for existence)

the photo ratio and the window ratio controls and the debug switch

an informative text about the current displayed photo or about the grid of thumbnails

the editable name of the current photo (and an eventual suffix) used to save it

an information text about the status of the main program (with only relevant information about copying and loading operations as eventual errors)

The display window will starts showing a grid of thumbnails. The first one is selected. You can navigate the grid using right arrow and left arrow of the keyboard to move the current selection on or back.

up arrow and down arrow let you load previous or next grids of thumbanails.

Enter key will open the currently selected thumbanil in a bigger resolution ( determinted by photo ratio parameter) photo filling the whole window.

When just one photo is displayed right arrow and left arrow of the keyboard can be used to show next and previous photo while up arrow and down arrow bring you back to the thumbnail view.

In both control and display window space bar can be used to save the current photo and p key can be used to toggle autoplay. If autoplay is active the time between photos can be set in the control window. Please note that specifying a short amount of time (shorter than the time needed to load photos data) can produce weird showing behaviours.

This menu lets you to have a granular control about how original photo will be copied.

The allow overwrite if checked silently overwrite a photo wich has the same name of what is composed for the current one.

bypass original file elaboration (simple copy) make a copy of the original file using the new name but without processing it with GD

output file type lets you to choose among different file fomrmats (jpeg, gif, png, gd and gd2) and to set the quality (0-100) for jpeg ones. For png files the compression factor (0-9) can be specified only via the command line parameter -pngcompression

enable multiple copies is trickier. If enabled lets you to choose to copy the file many times, each one with a different resolution. In the multi copies pattern you can specify different resolutions in the format widthxheigth as in 800x600 or 1024x768 and for each format a copy will be created.

enable post processing can be used to postprocess every image with exiftool program that ships with Image::ExifTool module. You can use alternative program to postprocess your image inserting the full path in the program field. Arguments to such program can be also specified where $ can be used to refer to the full path of the original image. In the exiftool command line you can also specify @ to refer to the current file. So you can postprocess every copy using the following arguments:

This exiftool command will be issued for every copy made, overwriting each exif tags in the copy, removing them all but taking some tag frome the original file and applying them to the copy. See the exiftool page for a lot of options this wonderful program lets you to use.

The program was tested against few different camera formats; i dont know if exif tags extracted are widely valid.

The autoplay feature does not plays well with little time intervals: infact when the interval is smaller than the overall time taken to load the the photo and to redesign the display i'll notice photos and information skipped and the timer going on. I tried fixing this using waitVisibility Tk method, with no luck.

A coworker (on MS Windows) was cursing he couldn't see what symbol names might be hidden in a non-text configuration file for a proprietary, 3rd party tool he has to use. Since I didn't want to risk being constantly asked to "dump symbols" using my Lunix system, I took a few minutes to write the following program in Perl. Made him happy (for now, at least).

Note: The tool being used only supports ASCII characters, so I didn't bother with encodings. Probably didn't need to specify ":bytes" in the open statement, but no harm in doing so.

The following is a parallel demonstration for the fasta benchmark on the web. It runs nearly 3x faster versus the original code.

Although nothing is relayed between workers, the relay capabilities in MCE is helpful for running a section of code orderly. A shared-scalar variable is used for retaining the $LAST value between chunks and subsequent runs.

Today, moritz asked on IRC whether there was anything like Devel::Trace on a package / namespace basis. I had never used this module before, installed it, looked at the code - hey nifty! - and whipped up the patch in a few minutes, it's just a few lines of code. Later, I looked at the TODO section and did do them, too.

Dominus, being a busy man, might or not apply the patch I sent him, so I am leaving this here as a drop-in replacement, complete with the updated POD section. Comments welcome, enjoy ;-)

<update>
There are always bits to improve...

- add statement modifier to $TRACE $FH $FORMAT @ORDER since they might have already been set

Calling perl -d:Trace -MyDebug foo.pl will restore STDERR and log the trace lines nicely to trace.out or to somefile using -MyDebug=somefile.

Of course these bits could have also been handled within Devel::Trace, but that would require changes to its import() semantics, which change is forbidden for a drop-in replacement.
But why yDebug.pm? well, because -MMyDebug looks like stuttering ;-)</update>

The following demonstrations show-case the use of MCE for the spectral-norm benchmark on the web. Both run on Perl compiled without threads support. The MCE::Hobo example largely resembles the threads version by Mykola Zubach.

$ cpanr Path::Tiny
Reviews for Path::Tiny
Reviewer: Michiel Beijen
Review date: 2014-12-17 @ 03:13:06
Module version: 0.061
Rating: 5/5
Comment: I really, REALLY like this module. It makes managing files so+ much easi
er. Just opening them, reading them into a scalar or array, printing t+hem out. O
f course it STARTED out as a true ::Tiny module but as seems to happen+ with thos
e it is now not so Tiny anymore, it even has support for stuff on plat+forms as A
IX and such. I wrote a platform for managing Video on Demand files and+ had to lo
ad and process a whole lot of XML metadata files, images, and videos. +I used thi
s module extensively to crawl directories, read files and so on. It ha+s helped m
e a lot writing code faster while also making my code much easier to r+ead and ma
intain. Thanks a LOT for this module!
Reviewer: Keedi Kim
Review date: 2013-11-21 @ 18:34:22
Module version: 0.044
Rating: 5/5
Comment: Awesome module. I can't believe this is tiny module. It has a+lmost ever
ything related in file and directory. It doesn't have another dependen+cy except
core modules just as you expected. And documentation is very detailed +and has ma
ny examples. There is no reason not to use this module at all.

and have the specified lines from somefile read into your current buffer after the line of your cursor.
To do the same with emacs, ask LanX, he knows the proper Ctrl-Shift-Meta-Alt-X encantations to do so.
This code is self-modifying: it places the filename it is invoked upon after the __DATA__ token, so if you want to include more lines of the same file, it suffices to say

We use an application at $work that uses XML internally for everything. The applications that feed it often wrap the files into a single line, which is a nuisance. vi won't display them, and grep will return the entire file on any match. I've created the code below, based almost entirely on sample code from others, to extract some key information from files.

The first interation (everything below except line 13) worked great until I encountered the namespace prefixes. It didn't take long to find out the solution, but I did not see it implemented in actual code. I guess everybody else thought it was obvious! The Namespaces => 1 in the constructor tells the parser to pull the namespace prefixes from the tag names (they are stored elsewhere), and for my simple example, that's all I need.

Program notes: %interesting is the list of tags the parser will store as it parses the file. The values are stored in the hash %message with the tag as key. In my end handler, I choose a subset of tags based on the document type to display.

What

This is a battleship solitaire puzzle generator.
It creates a puzzle grid with a random number of clues. It also
can display the corresponding puzzle solution. The solution has 10 ships on
a 10x10 grid.

Why

Mostly because I felt like it. Also because I could not find anything that
already existed online to easily do exactly what I wanted. There are some
puzzle generators available which have GUI's with nice features, but they
limit you to one puzzle per week (or month, or whatever), and it is
difficult to annotate hard puzzles on the screen. This generator allows
you to play as many puzzles as you want and to print them on paper to make
annotations.

How

Run the generator and redirect the output to a file. You can edit the file
and fill in the ships directly in your editor. Or, you can print the file
onto a piece of paper. Alternately, you could redirect the CSV output to a
file, then use the conversion script to create an Excel file. Then you can
complete the puzzle in Excel or print the Excel file onto paper.

Status

Consider this alpha code. Since I did not create any tests to
automatically check the code, there are likely bugs. The approach is
probably naive, and the ASCII representation is ugly. Any suggestions for
improvements are welcome.

Code for generator

Code for Excel conversion

Searched the fine web and didn't find a quick answer to how to redirect an http request to https in Mojolicious.
I wanted to insure that logins were always secure. Finally cobbled together a solution and thought I should share and maybe get some improvements.

Run 2 webservers: one to handle http and the other to handle https, which for me is two incantations of hypnotoad

All the sub does is redirect the request to the new protocol at the same url. I've seen a method in the docs to a is_secure method which could be useful somewhere. Also, I tried using $r->any('/login'), but it doesn't work for me and I'm moving on.

Yes, I probably could've gotten a better answer inside 2 minutes on IRC (people are so very helpful), but it never occurs to me until afterwards.

Sometimes I can think of 6 impossible LDAP attributes before breakfast.

Anyway, I thought I'd throw something together that's kind of silly to play around with it. A couple of points: a) I know this isn't the proper way to web-scrape, it's just an example ;) b) forgive the global variables. The interrupt code in wiringPi library does not allow you to pass in any parameters, so until I submit a possible patch, globals are all I have. This was not meant to be prod code :D

The following code, infinitely looping every 60 seconds, scrapes my number of posts and XP from PerlMonks (in a *very* crude way), collects up the current time, then prints the data out onto an LCD display attached to my Pi:

We introduce a button connected to a pin, when pressed, triggers an interrupt, and the interrupt handler rewrites the bottom line with the amount of XP remaining until my next PM level, instead of current XP (changes from x: 10361 to r: 1638. Every button press flips this back and forth.

My larger project, RPi::WiringPi, which is currently in feature-freeze to give me time to finish unit tests and documentation, will take that much further, and make it much easier to do things. It should hit v1.00 (stable) within the next week. At that time, I'll make another announcement... I do have an initial basic howto written so far that covers some of the basics. Note that this distribution may not be stable until v1.00 is released.