Perl Mongers' Site

Houston.pm

🌐
Content About πŸ—ΊοΈ
❓
πŸ”‘

A Report on YAPC::NA 2006 πŸ”—
1153440000  

🏷️ presentations 🏷️ news
July 2006
Presenter: Will Willis
Presenter: Jeremy Fluhmann
Will and Jeremy presented their experiences at YAPC::NA this year in Chicago. Jeremy also gave an update on the current state of our proposal for YAPC::NA 2007 in Houston.

An Overview of Subversion and Introduction to Caching πŸ”—
1150848000  

🏷️ presentations 🏷️ news
June 2006
Presenter: Paul Archer
Paul covered two separate topics this month. The first was a quick overview of the Subversion version control system. Afterwards, he explained the topics of caching and memoization as discussed in the book Higher Order Perl.

What Every Perl Programmer Should Know: tips, tricks, and common knowledge, part 2 πŸ”—
1148169600  

🏷️ presentations 🏷️ news
May 2006
Presenter: G. Wade Johnson
We concluded our discussion on Perl common knowledge, tip, and tricks. Plus, we discussed some gotchas relating to context and dubroutines.

What Every Perl Programmer Should Know: tips, tricks, and common knowledge πŸ”—
1145577600  

🏷️ presentations 🏷️ news
April 2006
Presenter: G. Wade Johnson
Wade lead a discussion on common Perl features, tips, and tricks that every Perl programmer should know.

Accessing a USB device from Perl, part 3. πŸ”—
1142899200  

🏷️ presentations 🏷️ news
March 2006
Presenter: Paul Archer
Paul concluded this series of presentations on libusb for control the USB Visual Indicator from Perl. We used the current prototype to control two separate USB VSI devices on the same laptop and solved some difficulties with Inline::C and modules.

Accessing a USB device from Perl, part 2. πŸ”—
1140480000  

🏷️ presentations 🏷️ news
February 2006
Presenter: Paul Archer
Paul continued the group programming session using Inline::C and libusb to control the USB Visual Indicator from Perl. In this installment, we worked around discrepencies in the documents and provided a Perl-friendly interface to a low-level function. Once again, audience participation was half the fun.

Delcom VSI/LibUSB Project πŸ”—
1138816162  

🏷️ files 🏷️ project

For the January 2006 meeting, Paul Archer presented a new project he was working on. The idea was to provide Perl access to the USB Visual Signal Indicator from Delcom Engineering. This project was based on a set of articles in the Linux Journal. For more information on the origin of the project, see the notes on the first presentation.

Since the Delcom VSI is a USB device, controlling it from Perl requires a Perl interface to USB. At the time Paul began working on this there was a minimal module on CPAN for access to USB, but nothing complete. There is a C library for accessing USB devices libusb. In order to use this library, we need to be able to call C code from Perl. Paul decided to use the Inline::C module to provide this access.

The February meeting continued the group development of some prototype code that was able to exercise the device. Some work was accomplished to clean up the code for accessing the libusb library, but the main focus was on the VSI itself. Since that time, Wade has been adding some time and potential help to the project, focusing mostly on the LibUSB interface and a possible language-based interface to the VSI library. We have also elicited interface design help from the group at large.

The March meeting concluded the sessions on this project. There is still development to do, but as the project moves from a prototyping phase into more traditional development, it appears to be less interesting in a meeting setting. We did a few new experiments and had a bit more discussion about issues relating to getting the LibUSB module ready to be released.

Project Code

This is the latest version of the code developed for this project. Since it is a work in progress, don't be surprised if it is not complete.

Lessons Learned

The Delcom documentation is mostly useful. But it did contain a few discrepancies that made life more difficult. In many cases, the text would contain a description of parameters to be passed and then an example to clarify. These two often did not match. In general, the text seems to be right and the example is wrong.

The Delcom documentation is also quite specific about the request type in being 0x08 when making a usb_control_msg call. Unfortunately, not only does that value not work, but example code that does work uses a value of 0xc8. It turns out that the request type actually encodes three pieces of information, not just an address. In our case, the value should be 0x48 for sending data to the device and 0xc8 when requesting data from the device. When just using the function to set control parameters (which is most of what we do) either parameter appears to work.

Although the Inline::C module has been extremely helpful in accessing libusb from Perl, it has also been the source of some difficulty. Since the Inline::C parser is not a full parser, we have seen some cases where function prototypes did not act as expected. In particular, a function with no parameters cannot be declared with void as the parameter list.

Also the "DATA" approach to declaring the C code inline works great in a script, but it does not work so well in a module. The names of functions declared in the inline portion will not be available in the module. This problem can be solved either by moving the code to a here document or directly calling the Inline->init() method after your use Inline call.

References


Accessing a USB device from Perl πŸ”—
1137801600  

🏷️ presentations 🏷️ news
January 2006
Presenter: Paul Archer
Paul led a group programming session using Inline::C and libusb to control a USB-based programmable light from Perl. The device was fun, the code was interesting, and a good time was had by all.

Graphics in Perl πŸ”—
1129852800  

🏷️ presentations 🏷️ news
October 2005
Presenter: Bill Dillon
This month, Bill presented a talk combining Perl, Graphics, programming metrics, and astronomy. He showed how easy it is to produce various charts with the GD::Graph Perl module. We saw how to convert a data set into line, bar, point, and pie charts. In the process, we also learned a bit about cataclysmic variable stars and amateur astronomy.

Development Tools for Perl πŸ”—
1127260800  

🏷️ presentations 🏷️ news
September 2005
Presenter: G. Wade Johnson
This month was planned as a discussion of development tools for use with Perl and a discussion of projects we are working on. These slides list a few tools that work well with Perl, including editors, an IDE, and version control tools.
Topic: Project Help
Presenter: G. Wade Johnson
One of the members had some questions about Perl program design involving a program from work. We spent about an hour discussing issues of Perl code design.

Text::Query and Getopt::Long πŸ”—
1124582400  

🏷️ presentations 🏷️ news
August 2005
Presenter: Paul Archer
Paul discussed his program for manipulating keywords in image files, focusing on the modules Text::Query and Getopt::Long.

Perl Module: Regexp::Common πŸ”—
1121904000  

🏷️ presentations 🏷️ news
July 2005
Presenter: G. Wade Johnson
After a couple of months of regular expressions, we take a month off and learn how to not write regular expressions. The Regexp::Common module provides relatively easy access to a fairly large number of common regexes for your matching pleasure.
Topic: General Perl Discussion
Presenter: G. Wade Johnson
We had some extra time this month, so the members started a interesting discussion of a number of Perl related topics, including CPAN, pack and unpack, and the modules in the standard Perl distribution.

Basic/Intermediate Perl regular expressions (part 2 of 2) πŸ”—
1119312000  

🏷️ presentations 🏷️ news
June 2005
Presenter: G. Wade Johnson
This month, we finished the discussion of Basic/Intermediate Perl regular expressions. The presentation covered some of the lesser used options and anchors, regex surprises, and some optimization considerations.

25 most recent posts older than 1119312000
Size:
Jump to:
POTZREBIE
Copyright © 2003-2020 Houston.pm.
Except as otherwise noted, this site is licensed under a Creative Commons Attribution 2.5 License.
The use of the camel image in association with the Perl programming language is a trademark of O'Reilly & Associates, Inc. Used with permission.