Browsed by
Category: Programming

Perl Tk TableMatrix Update

Perl Tk TableMatrix Update

I had previously posted some issues I have been having with the TableMatrix module for Perl Tk. I had assumed that the errors were with ActiveState’s version of perl. But I have discovered that TableMatrix is not compatible with Tk-804. TableMatrix 1.2 causes an error in widget.pm on line 190. It appears that it is expecting a reference to a hash and is being passed a reference to something else.

Does anyone know what the change was in Tk-804 that would cause TableMatrix to break and possibly how to fix it? I sent a note to the creater on CPAN but have not had any response yet. Thanks all.

Perl ID3::Tag and Errors with Cover Art

Perl ID3::Tag and Errors with Cover Art

First off let me apologize for the stupid graphic on this post. I was getting a little lazy.

Now my question is for anyone who has used the MP3::Tag module on ID3v2 tags. At the moment when I use the module to edit a ID3v2 tag with an embedded cover art image I end up with a corrupt tag. I have not further diagnosed to see what version of ID3v2 it actually is. ID3v2 does have the ability to read these coverart frames so I am confused why this causes an error.

I have searched and found nothing, so if anyone knows the answer why this happens I would appreciate it.

Perl Tk TableMatrix Widget Help

Perl Tk TableMatrix Widget Help

I was told that perl/tk is a nice perl gui but is very badly documented. Well I can confirm I was told correctly.

Most recently I had some trouble with Tk:TableMatrix which is very poorly documented. The biggest annoyance I had was that TableMatrix is not compatible with ActivePerl 811 the most recent version. I found on a non english site that TableMatrix is compatible with 809. And I found that answer after a few hours of trying to figure out why my script would not run.

I also found out that when the documentation says to pass 4 values to -bd to describe {left right top bottom} border they really mean a refence to an array with four variables.

So I hope the posting of the following code will help others with TableMatrix.

Read More Read More

Perl Text Comparison/Similarity Final

Perl Text Comparison/Similarity Final

I have received a couple of suggestions via email in regards to how best compare two text strings. In my most recent post I discussed a the String::Compare module. Since then I have found some additional modules that do similar things.

I did my own personal test and review of each of the following modules and a few additional concepts. Some of the included modules are: String::Similarity, Text::Levenshtein , String::Approx, Text::Similarity, Algorithm::HowSimilar, Compressed file concept.?

Read More Read More

Allmusic ID3 Tag Fixer

Allmusic ID3 Tag Fixer

Introduction:

One of the major problems with using Allmusic.com as a metadata source is the difficulty in searching for the correct ablbum. Ideally we want to be searching for both Artist and Album together. However Allmusic.com only allows for searching of either album or artist not both. So the best way I have determined to match the album "Greatest Hits" is to first search for the artist and then search the discography for that album.

Part 2: Downloading Artist ID from Allmusic

Allmusic.com uses individual sql IDs to identify each artist and album. So what we need is a script to search and parse out the correct sql ID and add it to our mySQL database. I decided to use perl over php because this script will be run from a command prompt and not a browser because of the lenght of time necessary to complete it’s task.

Read More Read More

Multiple Genres in MP3 ID3 Tags

Multiple Genres in MP3 ID3 Tags

I know that ID3v2 supports adding multiple genre tags to a file but does any software support this? I have not seen any that does and I don’t understand why. Most music belong in multiple sub genres, take Fleetwood Mac for instance, it belongs in Rock, but also a sub category of Classic Rock. Most people just classify it as Classic Rock, but what if you want to here a mix of all Rock songs, then you would have to select each subgenre of Rock. Also imagine the issue of a song that people can not agree on what the subgenre is.

I know I am not the first to talk about this problem, but for some reason I have not seen a whole lot of activity in this area. I know most of us do not have our music classified with subgenres, but if no software supports them then how are we ever going to start.

I know that there are other technologies such as smart playlists, but until we incorporate the use of the ID3v2 tag the way it was meant to be used I don’t think it will be a mainstream feature. Does anyone know of a player/library that uses this technology? I have not tinkered with what happens on my iPod yet but I imagine it will only see the first genre and not the others.

Perl ID3 Tag Completer/ Populater Chapter 4567

Perl ID3 Tag Completer/ Populater Chapter 4567

The next step in the never ending saga. Alright after some poking and proding I have gone back to using AllMusic. While using the TowerRecords site gave me a more accurate search the underlying metadata was pretty bad. As I said before they were not even consistent in genre naming. I also know that other people will want to use the AMG info to add more metadata.

The New Theory

1. Search for the Artist Key
2. Do a string compare on the artist name and research if low.
3. Load the artist discography
4. Do a string compare of each album in the database to the discography
5. Load the album page and populate the metadata

Perl Text Comparison

Perl Text Comparison

Does anyone know of a perl module or perl example of a quantitative text analysis. Such as comparing STR to an array and giving numeric results of its similarity to each string in the array. Such as is if the comparision is a difference of case it would score very low and a comparison where the strings did not even contain the same characters would be very high?

This is an akward concept. But I am sure there are papers out there on this subject. This is what enables large search engines to work. Please comment if you know of any. Thanks.

Read More Read More

Subnetting Tutorial

Subnetting Tutorial

The Basics: If Internet addressing remained as it was originally designed, it is likely that the number of hosts today would far exceed the available IP addresses. The problem with the standard classed addressing scheme is that the network ID length is predetermined by the class of the IP address. This also predetermines the number of hosts on each network. Below is a table of the standard classed IP address scheme:

Class From IP To IP Maximum Networks Maximum Hosts
A 1.0.0.0 126.255.255.255 126 1,677,216
B 128.0.0.0 191.255.255.255 16,384 65,536
C 192.0.0.0 223.255.255.255 2,097,152 256

It is obvious that a Class A IP range is unrealistic in its number of hosts. A network with this much traffic on the wire would crawl to a halt. This system does not allow more than a two tiered structure for IP addressing, this does not really match the actual layout of the Internet. Subnetting allows for differing lengths of network IDs. This means that Any IP class range can be divided up into multiple network IDs. The subnet mask essentially tells the router what part of the IP address to use as a network ID, as demonstrated in the following table using binary:

IP Address 10000000 00000001 0001 0001 00000001
Mask 11111111 11111111 1111 0000 00000000
Result 10000000 00000001 0001 N/A
Logical Address 128 1 1 N/A

The logical address is exactly what the router sees and it uses this to determine where to send the packet. This enables the CMC network to divide the Class B IP address range into class C subnets. This means that at a maximum there is only 253 hosts on one line. This subdivision enables added security within the network and organization of the network structure.