I’m still here!

January 7, 2009 at 10:01 | Posted in Perl, Perl, Summer of Code | 1 Comment

Another semester is over and another is about to begin. From today until school begins in 2 weeks, I will be working on wxCPAN for at least 1.5 hours a day. Work seems a little slow, so I will be able to do some work on wxCPAN while in the office (don’t worry – it’s cool with the boss). I plan on ironing out some bugs in my code, mainly with the list populatiion algorithms. I will also be working on aesthetic bugs as well.

As for getting Strawberry Perl and  wxCPAN to work in Windows Vista – no luck, yet! I had to install Vista 64bit in order for all my RAM to show up, nad it doesn’t seem to want to work. Anyways – i am still hopeful, and may end up helping to speed up development of Strawberry Perl if all else fails.

See you in the funny pages 😉 !!!

Week[8] Report: More Fixes

July 28, 2008 at 19:53 | Posted in Perl, Summer of Code | Leave a comment

This week has pretty crazy. I finally got the Update Wizard working. It seems to work pretty well, but I need to address a few issues that may be related to my system configuration. I also decided to create a new class for the Wx::ListCtrl which is my Actions list, mainly because I used it in the Update Wizard as well. My philosophy is: “if I use a similar control twice, why not create a new class?” However, as of today, there are still a few bugs in the Actions List.

I have also added more methods to ModuleTree and ModulePanel. I created ModulePanel, to keep with OOP principles. The new class handles the Information pane and the Module List. It should still work fine. I am testing a lot these days, while i am re-writing for OOP. So when I finish with any piece of the project, it is tested at least a dozen times! This should reduce the number of  problems I may ecounter down the road.

I am ordering a new laptop this week (hopefully thursday), and am going to install Fedora 9 on it, as well as Windows Vista or XP (have’t decided which, yet). It should arrive monday or tuesday. So next week I will be testing and coding on a new system! My current system is running Fedora 7, and has been ever since the day FC7 was released. I think I may have jumbled up some things in the system, so it will be nice to start clean, in order to see what problems, with wxCPAN, someone may encounter with a fresh install.

This coming week, I plan on sifting through all my code to take advantage of some of the new routines I created last week. I also plan on cleaning up and commenting a lot of code. I will be squashing a lot of bugs, as well. This week will be tedious, but at least it will be a much needed break from scratch coding. Going through my code will allow me the chance to write testing routines, and will release my module to CPAN on Saturday or Sunday!

The following week, I plan on implementing tools for CPAN authors, since I will have a module on CPAN to test it out.

Week[7] Report: AUTOLOADing OOPs…

July 18, 2008 at 22:20 | Posted in Perl, Summer of Code | Leave a comment

I have been working really intensely on re-writing the code for ModuleTree.pm, in order to be more object-oriented. I have created a new class, ModulePanel, which handles all the UI update functions that ModuleTree Handled. It is the Panel object uder the Modules tab in the main window. With this new scheme, anyone can embed the panel into any Wx-Perl application! So far, there are two Wx::Panel classes for embedding: one for the PODReader (CPANPLUS::Shell::Wx::PODReader::Embed), and one for the modules panel (CPANPLUS::Shell::Wx::ModulePanel). The ModulePanel still needs the MainWindow.xrc file to be loaded. This may change later, but I highly doubt it. If it does, I will create a new xrc file with just the appropriate widgets.

I have used a new Perl construct (new for me, anyway) for ModulePanel: AUTOLOAD. If ModulePanel can’t handle a method, it passes it on to the ModuleTree inside it. I did this to make everything a lot easier: all I have to do for my Frame is change the reference for the ModuleTree to point to the new ModulePanel instead.

My re-write isn’t fully completed yet, as I have come accross a few problems, mainly having to do with a previous change which dealt with limitations of the $cp->module_tree() function (see previous entry). In order to accomodate handling different versions of modules, I have added a _get_mod() method to ModuleTree. It has been a little difficult designing the interface to this function, even though the function itself is quite small. I started writing it this morning, and am still not finished with it. It started as $tree->_get_mod( $module_name|$module_object ), and I went through many incarnations to arrive at (hold your breath):

$tree->_get_mod( $modObject|$name [,{[version=>$version,] [mod=>$modObject,] [getname=>0|1]}])

Here is an explanation of the method:

The first parameter is either the name of a module or a module object. Pretty simple, as we need to know what module we want to deal with.

The optional second parameter is a hash reference to different options. I chose this method keeping in par with the perl style guidelines for functions with multiple parameters. The options are:

  • version: Float. The version number you want, otherwise we use the current version on CPAN.
  • mod: Same as the first parameter. If used, you can omit the first parameter.
  • getname: Boolean. Only return the name of the module. returns $modObject->package_name. If set to 0 or undef, returns the module reference.

Even with these problems, I am going to upload to CVS, so be warned: a lot of crashes may happen if you get this version!

This has been a very trying week, as I thought it would not be so difficult! Instead, I have worked very hard and long, only to feel I have accomplished nothing. But when I really think of all the new ideas I have used and created, I feel like a stronger programmer. I am going to a family reunion this weekend, at White Lake, NC, for some much needed rest and relaxation. Hopefully, It will give me the freshness I need for tackling next week’s (this week’s continuing) problems!

Week[6] Report: Wizards roll 1d12 for saving throw!

July 14, 2008 at 10:04 | Posted in Perl, Summer of Code | 1 Comment

This week has been really confusing for me. A lot of jumping around frantically, trying to get something more usable by the community. I have added a bit and taken away a bit. Here is a lit of random stuff I have done this week:

1. Moved SVN to trunk. I deleted all the files under the development branch, and have moved them all to the trunk, as per recommendation of SVN organization standard.

2. Switched UI development to wxGlade. I have previously rebuilt all of the UI under wxGlade, so the community can better take advantage of my development files. I have also removed some code in Configure.pm to make use of this change.

3. Fixed Preferences Window. Some items in the Preferences window were not working properly. When I changed the code for wxGlade, I noticed a few UI elements were not working properly. This has been fixed. The Preferences window is now fully functional, except for a tab I plan to add specifically for wxCPAN.

4. Enabled gettext support. I went through all the code so far and enabled gettext support using Wx::Locale. Now I can create a simple translation, probably in Spanish, unless someone else would like to translate the strings.

5. Added UI for Wizards. I have created an Update Wizard, which is used to update CPANPLUS, using CPANPLUS::Selfupdate. The UI is built with wxGlade and outputs perl code, because wxGlade doesn’t support Wizards. (It doesn’t work, yet – that’s coming this week.) I have also added a menu item for a First Time Wizard, which will be used if the user hasn’t used CPANPLUS before.

6. Tester Fixes. Some testers have reported that the requirements are too high. I have begun going through my code to try to lessen the requirements for wxCPAN. I have also changed all the wxGlade project files so they output code which can be used with wxWidgets 2.4.

7. Using old wxWidgets 2.4 API. Since I don’t see anything in wxWidgets 2.8 that is very useful, I am now using the API for wxWidgets 2.4. This should relieve some of the requirements, as reported by the testers. However, I see in the Changelog for Wx::Perl that most of the code is used with wxWidgets 2.6-2.8, so I really shouldn’t have to do this, but will, since it is not a big problem.

8. Moved files around The Shell::xrc directory has been moved to Shell::Wx::res. I changed the name because the directory holds images and other resources, not just xrc files. It has been moved down a level to conform with the CPANPLUS::Shell::Wx namespace.

9. I am now a CPAN Author! I got my acceptance from CPAN to be an author. I have registered the CPANPLUS::Shell::Wx namespace, and hope to publish my module as soon as I have finished the UI.

I am almost finished with the UI. All I have left to do is build the Wizards, the Preferences tab for wxCPAN, and a window for CPAN authors’ module administration. Then – on to the Bug Squishin’!


week[5] Report: Watch for Snowballs!

July 5, 2008 at 10:53 | Posted in Perl, Summer of Code | Leave a comment

It seems that my project is coming along a lot faster than my project schedule says, as development has snowballed as expected! As the Google Summer of Code is almost midway completed, here is a few highlights of what i have accomplished so far:

  • I believe the search functionality is 100% complete.
  • The preferences window appears to be complete, insofar as it is an interface to the CPANPLUS configuration. More additions are coming that pertain to wxCPAN, which will be stored in the same config file as CPANPLUS.
  • Module installation works! You can also step through the installation procedure using the ‘Actions’ tab at the bottom of the window. (The other Actions tab is a list of actions for unsupervised installs, which is not imlemented yet.)
  • There is a documentation reader for perl, which is an interface to perldoc. There are two versions of this – a windowed version, and a pane which can be inserted into any wxPerl application. This is 100% complete, and is modelled after the PerlDoc panel, as supplied by the EPIC plugin for Eclipse (http://e-p-i-c.sourceforge.net/).
  • Most of the information tabs at the bottom are 100% complete.
  • The toolbar is 100% complete.
  • Optimized list sorting. Note: this still takes a while for some operations, as there are over 55,000 modules in CPAN!

I still have a few major items left to do, mainly a window for module authors, and documentation.

The gSoC (wxCPAN) is probably the most fun programming project I have ever worked on. I have been in contact with the author of CPANPLUS, and I never imagined I would be taken seriously as a developer by so many people! My mentor has been great help, even though I haven’t had to contact him too much so far. However, I will definitely be contacting him a lot in the last half of my project, as I will need guidance on becoming a CPAN author (I have already applied via their website), as well as other aspects of module development and deployment.

Happy coding everyone!

Fixed Prerequisites, Module List Fully Works

July 4, 2008 at 09:07 | Posted in Perl, Summer of Code | Leave a comment

After much consternation over not being able to get the prerequisites for a module until installation, I have finally come accross a solution! I have added a method to ModuleTree.pm, `$mod_tree->GetPrereqs($modulename)`, which properly returns the Prerequisites of a module. It does this by using the YAML module to parse the META.yml file which can be found at search.cpan.org. This method is a lot faster than downloading each module’s archive, then getting the META.yml file from the downloaded file. I have also added a method to update the display of the prerequisites tree in the info notebook.

I have also added the appropriate code so all the toolbar items work! You can now display modules in the following ways:

  • All modules by Module Name
  • All modules by Author Name
  • All modules by Category
  • Installed modules by Module Name
  • Installed modules by Author Name
  • Installed modules by Category
  • Uninstalled modules by Module Name
  • Uninstalled modules by Author Name
  • Uninstalled modules by Category
  • Updated modules by Module Name
  • Updated modules by Author Name
  • Updated modules by Category

Also, there are a few more bugs I need to work on, but I am hoping to have my first successful install using wxCPAN by this weekend!

POD Reader Finished!

July 1, 2008 at 21:01 | Posted in Perl, Summer of Code | Leave a comment

Lately, I have spent so much energy and time on getting bugs out of existing code, i had to take a break from bug-squishing and try to start something new. I decided to give a try at creating a POD reader for wxCPAN. I didn’t put too much time into it, and am pleasantly surprised with the outcome. I used the HTML POD parser, and the wxHTMLWindow for displaying the output. The biggest challenge was figuring out how to handle the links so we can pass the values to the Search() method. As a caveat, there are two basic versions, a Frame for a dialog, and a Panel, which can be used for embedding into a notebook or anything else. Here is a screenshot of how it is embedded into wxCPAN. It looks a little weird with the two search bars, but it’s intuitive, at least.

wxCPAN With the POD Reader Embedded into the main Notebook.

Week[4] Report: Tests and Squishes

June 29, 2008 at 11:22 | Posted in Perl, Summer of Code | Leave a comment

This week has moved kind of slow. I have completed this week’s goals, and have tried to squash some bugs.

Today, i am working on the “Search by All” type of search.

The big hurdle this week is in UI design and wait times. Since CPANPLUS takes time to fetch a few desired attributes from CPAN, I have modularized a lot of the code that happens when the user selects a module from the main module list view. (As of last week, when the user selected an item, she had to wait while CPANPLUS retrieved several files from CPAN.) There are now a few more tabs in the info pane, and only the ‘Info’ tab gets updated when the user makes a selection. This sped up the selection process from about 45 seconds to less tha 1 second. Most of my time this week was used up in testing various methods for retrieving data (threads, progressbars, etc.). But I decided on placing a button in every tab in the info pane which retrieves that pane’s information. A typical selection process is outlined here:

1. The user selects a module from the module list and the Info tab gets populated immediately.

2. If the user wants to read the module’s README file, they can click on the Readme.txt tab and click on the Get README button in that tab.

3. If the user wants to populate all the tabs in the pane below the list of modules (the info pane), they can click on the button labelled “Get Extended Info” in the Actions tab.

I plan on adding a button to display the appropriate POD in the POD Reader window (coming soon!).

I have also added a couple of pages to the wiki on googlecode this week. One page lists all the CPANPLUS modules and their methods/accessors, as well as where to get the information using the GUI and whether it is fully implemented or not. I am using this as a checklist of all the remaining work that needs to be done.

Another page lists ideas for future implementation. These items are to be done after gSoC’08, and will be a roadmap for future development. They are mainly feature requests from other people I have discussed this project with. (There is only one so far – a pretty big undertaking!)

Look for more big decisions and big designs in the week to come!

Week[3] Report: On-Schedule and More Features!

June 22, 2008 at 14:21 | Posted in Perl, Summer of Code | Leave a comment

This week has been exciting for me! I have completed the code for listing all installed modules by Name, Author, and Category (‘chapterid’). Here is a list of features I have also implemented:

I finished the search algorithm. You can search by exact query, or search with regex, using ‘/$searchtext/$mods’, just like regular regex in perl. I am going to implement an “Any” function for searching within any of the required type for CPANPLUS’s search() function.

The toolbar now works. If you are downloading the code, the XRC file specifies the tools in the toolbar, but since I can’t update the icons, I delete them all, then insert new tools. I plan on removing the ‘Update List’ button later, as I am using it for testing purposes.

The Module List
I worked very hard on the code which lists the modules by the various information. It still needs some work, but will do for now. Listing the modules by category was the hardest part. (See previous entry for explanation.) I poured over the code, and re-worked a bit of it to get the actual sorting routine from 4 minutes average, down to 1.5 minutes. A more than 50% reduction in time! The routine that inserts the items into the list originally averaged 30 seconds, (no icons in list), but now averages 1 minute, with the icons displayed. I think this is acceptable. Overall, my execution went from 5-8 minutes, down to 2-3 minutes. Not bad! As for improving this, I am not sure I can, except to give the user the option of displaying icons, but there will be no way to tell the module’s status, except for clicking on it and waiting for the other information to update. Eventually, I am going to put a reference to the generated list in the ListCtrl module, so if the user goes back to a previous view, the update won’t take so long.

The Actions Collector [placeholder]
This tab was added to the main display. It is not implemented yet, but will hold all a list of all the actions a user has selected, so if she wishes to do a mass update/install/remove, she will be able to review her changes before it begins. The “Update List” toolbar item will be changed to “Update Installation” (or something like that).

Status and Information Tabs
I have almost fully completed this. The method to update the display takes 5-10 seconds to complete. I have several information-related tabs: Info, Actions, Files, Readme.txt, Status, and Prerequisites.

Info [works]
displays various module-related information, like author, package, etc.
Actions [not implemented yet]
This is where the user can install different versions of a module or remove it.
Files [problems]
This lists all of the files in an installed module. Apparently, the CPANPLUS::Module::files() method only works for the installed version, so I need a way to get the module object for the installed version.
Readme.txt [works]
This is where the module’s README file is displayed. wxPerl v0.83 is preferred, as previous versions seemed to have a limit on text size in a TextCtrl. This is an unverified claim, but when I updated wxPerl to 0.83, the full file displayed properly.
Status [problems]
This is where most of the information from $module->status() is displayed. It is mostly checkboxes and textfields. I am not sure where or even if there is a problem, but almost all modules return a status object with all values set to undef. Maybe status() is only used during installation? Needs further testing – possibly ask Mr. Boumans, but I don’t want to waste his time.
Prerequisites [major problems]
This is a tree display of all the prerequisites for a module. It doesn’t seem to work with any modules. I am attempting to fix this.

Here is a screenshot to show what the main window looks like as of today.

wxCPAN in action!

GUI Decision: Progress in Status Bar vs Dialog

June 20, 2008 at 16:11 | Posted in Perl, Summer of Code | Leave a comment

I have been working on an algorithm to sort various data (installed modules, updated modules, etc.) into different categories, as it is on http://search.cpan.org. Since CPANPLUS::Module does not have a ‘chapterid’ section, I have had to write my own method to sort data into the 27 different categories, called ‘chapters’. This ‘chapterid’ information is stored in a file called 03modlist.data.gz. Since CPANPLUS DOES download the file, i can read the already downloaded file’s contents, which is nothing more than an array reference with all the data I need. Then I sort the data into the different categories. This was fairly easy.
Then came the difficult part. It takes a long time, about 3-5 minutes, to sort the data into categories, then another 2 or 3 minutes to populate the wxTreeCtrl with the data. So I needed a way to communicate to the user what’s going on. Initially, the whole UI would freeze while all this sorting was taking place. So I looked into a few solutions for this:

Solution 1: Threads
I immediately thought about threads, because I like to use them when i can. They are a great feature if what you’re doing doesn’t depend on anything else. I read quite a bit about Perl’s thread support, and found out that it works best if the Perl Modules you are using also support threads. Wx has its own thread support through the Wx::Thread class. I tried both Wx’s and Perl’s threads,and they both worked equally well. They solved the initial problem (both with object access warnings), but nothing was telling the user what was going on, and I didn’t want the user to sit there wondering what was happening for eight minutes, so I needed something more.

Solution 2: wxStatusBar
I tried updating the main window’s Status Bar with and without threads. Without threads, the UI wouldn’t even display anyhting. With threads, the Status bar worked, but the UI worked sporadically, as the Status Bar’s text was updated, which was quite frequently. So I shortened the update, which, to my dismay, did not solve the sporadic UI problem. Also, I noticed about a 33% increase in the time it took to sort all those modules. I did not want this. I needed something that would tell the user what was happening, and not freeze the UI.

Solution 3: wxProgressBar or wxProgressDialog?
Finally, I looked into using a ProgressBar. Wx has two flavors of progress bars: a single progress bar that you can use in any window, or a Dialog Box with a progress indicator. This was a design decision that was quite difficult to make. Should I use a wxProgressDialog, or put a wxProgressBar right in to the main window? Since the user isn’t really supposed to do anything while the sorting is taking place, I decided on a wxProgressDialog. Programmatically, it is easy to use and doesn’t require a redesign of any windows. It has all the functionality i needed: A progress bar and text to let the user know what’s going on. (That’s all the features a wxProgressDialog has.) Whe I tested it, I was amazed! I expected the main window to freeze, like before, and the dialog to update accordingly, but, to my surprise, the main window did not freeze. I also expected the sorting time to decrease substantially, because of all the progress bar updates, but the decrease was negligible. I took out all the threading code at first, because I did not know how the progress dialog would respond to threads. As it turns out, threads were unneccessary.

Overall, this experience was very educational, both for the Wx widget set and for Perl’s threading support. I am still having sorting issues, but at least the user has something to look at while she waits!

Look for my Week[3] report in the next couple of days!

Next Page »

Create a free website or blog at WordPress.com.
Entries and comments feeds.