Computers: October 2005 Archives
Apple still won't learn that shared music is not evil music. iMovie and iPhoto have never worked with shared playlists in iTunes. iTunes doesn't even work properly with shared playlists: you can't get artwork from them, you can't use them with your "Party Shuffle," and so on.
And now Front Row too doesn't work with shared playlists. Because why would you want to keep your music on a central server and share it through the house, especially from a server to the computer connected to your TV?
Yes, I am well aware that I can use file sharing to load in the library, but that is lame for many reasons, most of which have to do with the fact that it is constantly more work to keep it running. The server goes down, you add new music on the server end, and so on. Multiply this by the several computers I might have connected to the server at once, and it's just not a good option.
Another problem with Front Row is that they don't show very many characters on the screen for the titles and such. I know they want to make it readable, and are considering low-res NTSC TVs, but I would use this on HD monitors. And it sucks.
My happening script, which runs in the background and sets my iChat status etc., generates neat pictures for the Mac OS X screen saver that look like this. I prefer this -- combined with IR remote control support for iTunes through Keyspan, and a Bluetooth mouse handy -- to Front Row for now.
And now Front Row too doesn't work with shared playlists. Because why would you want to keep your music on a central server and share it through the house, especially from a server to the computer connected to your TV?
Yes, I am well aware that I can use file sharing to load in the library, but that is lame for many reasons, most of which have to do with the fact that it is constantly more work to keep it running. The server goes down, you add new music on the server end, and so on. Multiply this by the several computers I might have connected to the server at once, and it's just not a good option.
Another problem with Front Row is that they don't show very many characters on the screen for the titles and such. I know they want to make it readable, and are considering low-res NTSC TVs, but I would use this on HD monitors. And it sucks.
My happening script, which runs in the background and sets my iChat status etc., generates neat pictures for the Mac OS X screen saver that look like this. I prefer this -- combined with IR remote control support for iTunes through Keyspan, and a Bluetooth mouse handy -- to Front Row for now.
Now Playing: Eric Clapton - Alberta
Games-Baseball-Scorecard-0.03 has been released. Download it from the CPAN or SF.net.
(Note: it may take time for the release to propagate to the various download mirrors.)
Changes:
(Note: it may take time for the release to propagate to the various download mirrors.)
Changes:
0.03 Thu Oct 20 21:48:38 2005Posted using release by brian d foy.
- Some syntax changes for play_ball
- Add init() parsing/handling to play_ball (see example3.plx)
- Put in some sanity-checking for outs, balls, strikes, and fouls
- Make sure totals() can be called only once
- Make sure that totals are properly tabulated even if a batter's
totals cannot be printed
- Allow pdfopen() to take a filename to open as an argument
- Moved examples to examples/ directory, and added more
People are making way too big a deal out of Tedy Bruschi's decision to return. He is not returning "too soon." The doctors say there is no medical reason to wait. People say he should wait, but there is literally no reason to. He has only two options: return to play, or retire.
No, he doesn't need to make that decision now, but he's made his decision: he will not retire. Since he has his decision, there is no reason to wait to implement it.
No, he doesn't need to make that decision now, but he's made his decision: he will not retire. Since he has his decision, there is no reason to wait to implement it.
Mac-Apps-Launch-1.92 has been released. Download it from the CPAN or SF.net.
(Note: it may take time for the release to propagate to the various download mirrors.)
Changes:
(Note: it may take time for the release to propagate to the various download mirrors.)
Changes:
* v1.92, Friday, October 14, 2005Posted using release by brian d foy.
IsRunning() now returns PSN, which can be useful.
Various functions check to make sure $Process{$psn} returns a valid
value before trying to use it, which was causing some errors.
Now Playing: Lost Dogs - Honeysuckle Breeze
I fetched the CSV version of the Boston Bruins schedule, and then wrote this script to import it into iCal using Mac::Glue. Hooray.
Update: The CSV file has incorrect dates for when the time is past midnight, so it has games going from 10 p.m. on the 4th to 1 a.m. on the 4th. Oops. Also added quick DST calculation.
Update: The CSV file has incorrect dates for when the time is past midnight, so it has games going from 10 p.m. on the 4th to 1 a.m. on the 4th. Oops. Also added quick DST calculation.
#!/usr/bin/perl
### first make empty "Bruins" calendar in iCal!
use strict;
use warnings;
use Date::Parse;
use Mac::Glue ':all';
my $ical = new Mac::Glue 'iCal';
my $bcal = $ical->obj(calendar => whose(title => equals => 'Bruins'));
my $bloc = location(end => $bcal);
my($dsts) = str2time('April 2 2006');
my($dste) = str2time('October 30 2005');
while (<DATA>) {
next unless m{^(Boston Bruins (at|vs\.) ([^,]+)),((\d+)/(\d+)/(\d+),(\d+):(\d+):00 ([AP]M)),((\d+)/(\d+)/(\d+),(\d+):(\d+):00 ([AP]M)),};
my($summ, $start, $end) = ($1, $4, $11);
$start = str2time($start);
$end = str2time($end);
$end += 86400 if $start > $end;
my $adj = 3600 * ( ($start < $dsts && $start > $dste) ? 4 : 3 );
$_ -= $adj for ($start, $end);
# printf "%d : %s : %s : %s\n", $adj, $summ, scalar(localtime $start), scalar(localtime $end);
# next;
$ical->make(
new => 'event',
at => $bloc,
with_properties => {
summary => $summ,
start_date => $start,
end_date => $end,
}
);
}
#Subject,StartDate,StartTime,EndDate,EndT ime,Alldayevent,Reminderonoff,ReminderDate,Reminde rTime,Description,Location,Priority,Private,Sensit ivity,Showtimeas
__END__
Boston Bruins vs. Montreal,10/5/2005,7:00:00 PM,10/5/2005,10:00:00 PM,FALSE,TRUE,10/5/2005,12:00:00 PM,,TD Banknorth Garden,Normal,TRUE,Normal,0
Boston Bruins at Buffalo,10/7/2005,8:00:00 PM,10/7/2005,11:00:00 PM,FALSE,TRUE,10/7/2005,4:00:00 PM,,Away,Normal,TRUE,Normal,0
For years we've had these things called "formkeys" in Slash, which are small tokens that sit in a form and make sure you can't submit a form without getting one first. It's tied to your account or IP address, and you can't use a form without one.
Also, formkeys allowed us to easily make sure you have not used a form more than $n times, or more often than $x times in $y seconds, and so on. It helped us curb lots of different sorts of abuse.
Well, formkeys have lots of problems, including that they were hard to use (and so often were not used), could be abused by exploiting lack of atomicity, were hard to add new checks to, and so on.
So enter reskeys. A reimplementation of the same basic idea.
You have a resource (say, journal) and that resource has certain requirements: you must be a registered user, with seclev greater than 0; you cannot use more than 30 forms in four hours; you cannot submit more than one journal every 30 seconds; and so on. Each of these checks is implemented by a class, and a table in the database keeps track of which classes to check in order to create reskey (get a new form), touch a reskey (preview the journal), or use a reskey (save the journal entry). And a bunch of variables are defined in another table, which are used by the classes.
So to use reskeys in the code, you just add those rows to the database tables, then call my $rkey =$reskey->key("journal") in your code, then call $rkey->create (or touch, or use) as appropriate. Call [% PROCESS reskey_tag %] in your form. And if there's an error (because the call to create/touch/use returned false), call $rkey->errstr to get the error string to show to the user.
Simple and neat. So now Zoo and Journal are ported to Slash::ResKey. If this journal entry gets posted, it means SOAP is working with it, too. And if you get any problems about invalid resources etc., do let me know.
Also, formkeys allowed us to easily make sure you have not used a form more than $n times, or more often than $x times in $y seconds, and so on. It helped us curb lots of different sorts of abuse.
Well, formkeys have lots of problems, including that they were hard to use (and so often were not used), could be abused by exploiting lack of atomicity, were hard to add new checks to, and so on.
So enter reskeys. A reimplementation of the same basic idea.
You have a resource (say, journal) and that resource has certain requirements: you must be a registered user, with seclev greater than 0; you cannot use more than 30 forms in four hours; you cannot submit more than one journal every 30 seconds; and so on. Each of these checks is implemented by a class, and a table in the database keeps track of which classes to check in order to create reskey (get a new form), touch a reskey (preview the journal), or use a reskey (save the journal entry). And a bunch of variables are defined in another table, which are used by the classes.
So to use reskeys in the code, you just add those rows to the database tables, then call my $rkey =$reskey->key("journal") in your code, then call $rkey->create (or touch, or use) as appropriate. Call [% PROCESS reskey_tag %] in your form. And if there's an error (because the call to create/touch/use returned false), call $rkey->errstr to get the error string to show to the user.
Simple and neat. So now Zoo and Journal are ported to Slash::ResKey. If this journal entry gets posted, it means SOAP is working with it, too. And if you get any problems about invalid resources etc., do let me know.