Saturday, January 31, 2009

 

Just a link for NetBSD

NetBSD running new sidekicks

I love it!

Labels:


Sunday, January 18, 2009

 

wxPerl update

I would like to report that I learned about Wx::Panel and Wx::FlexGridSizer (for some reason, added to a Wx::BoxSizer) and got pretty good results from Wx.

My complains still hold that it's kind of silly, but I guess it's not too hard once you follow the tutorials. For no good reason I had to defined my own OnInit subroutine, two packages, and subs to get the values from my text boxes (you'd think that would be a default thing people did with text boxes on button presses). However, these were not that hard to copy or figure out and I can see why some people would prefer the wx method since you have to take more full control from the very beginning, while Tk gives you reasonable defaults out of the box.

Labels: ,


 

mt_diff.sh 1.0

I have finished the initial write of mt_diff.sh, which will take two NetBSD destdir's and use the mtree files to create a package for updating from one to the other. It's slow as hell because it does tons of passes with awk through all of the mtree files, but I was just trying to get the concept right before anything else. I need to update mt_pkg.sh to get it reading the new patch format (I'm trying to preserve which set files came from so backing out is easier), but it should be pretty easy to update.

Anyway, if you get a chance to check it out, you can find the current rev here:
mt_diff.sh

And of course, you can ready about the mt_pkg.sh idea and script here:
http://mspo.com/blog/2009/01/mtpkgsh-posted.html

Labels: ,


Tuesday, January 13, 2009

 

Perl remove leading and trailing whitespace

This is a really common task for perl and I mostly see bad solutions online, so I thought I would offer my own:

s/^\s*(.+?)\s*$/$1/g

Iterate through an array:

@b = map { $_ =~ s/^\s*(.+?)\s*$/$1/g; $_ } @a;

This works by looking for:
The beginning of the line followed by zero or more whitespaces (^\s*)
non-greedy match and capture of anything except newlines ((.+?))
And finally zero or more whitespace followed by the end of the line (\s*$)

We need to use non-greedy (.+?) or it will grab the trailing whitespace and you'll lose the value of \s*$

Labels:


Monday, January 12, 2009

 

perl/wxWidgets vs perl/Tk

Okay, so I've been using perl tk for a project at work and then I learned that I had to support os x. Normally, I would think of this as a top priority anyway, but then I found out that os x doesn't ship with Tk and I can't even package a cocoa version of my app with perl/Tk at all!

Thus, I am forced to use wxPerl, which is kind of annoying. Tk has a nice automatic layout that is definitely Good Enough (tm) and Tk requires a lot less code.

Now that I'm using wx I have to use a special #! for wxPerl or Aqua doesn't get any window manager hints to the point of not being able to select the app. I'm looking into Platypus.app for help with packaging my script into its own .app (I'm using pp --gui for windows), but I still need to figure out wx layouts.

Labels: ,


 

Google slow?

Has anyone else noticed that google's response time for initial page load has been really slow for the past few weeks? I've noticed this at home and at work, so I'm wondering if it's just in the southeast, or what.

It really looks like getting a connection going is the main problem. The name resolves quickly, the ip is accessed, and then I wait.. so frustrating!

Labels:


Saturday, January 3, 2009

 

mt_pkg.sh posted

Today I posted my idea for using mtree as a simple pkg database for the netbsd base install. I haven't gotten any replies yet, so I'm not sure if anyone likes the idea, or if the subject doesn't work for them, but let me know what you think:
Message to tech-userlevel

I also have the script located here:
mt_pkg.sh

Labels: ,