MarcEdit 5.0.2574.28817 Update

By reeset / On / In MarcEdit

I’ve posted a new update to MarcEdit 5.  The update includes the following changes:

  1. Added a Sort by Title to the MarcEditor and rearranged the sort commands
     
    I’d been asked by a few folks to add the ability to sort a results set by title — this new function allows that.  To make this work, I’ve had to include a new option in the Program options.  On the “Other” tab, I added a tag for title.  This was done so that users not working with MARC21 can set the appropriate title tag. 
      
    The value must always include a 3 digit tag + subfield in the following format: 245$a.  The program will utilize the filing characters when sorting the title.  This isn’t the fastest function in the world since the program has to maintained a linked list between the sorted title and metadata — but for files around 20 MB and smaller — this should work fine.
  2. Added title sorting to the Selected MARC records and Delete Selected MARC records.  This will allow title sorting here as well.
  3. MARCJoin — stupid error — if the file was left empty, it would throw an error.
  4. Swap Field Function — Updated swap field function to allow for wildcards.
  5. Work on the delimited text wizard
  6. Various bug fixes with the UI.

The program can be downloaded from: MarcEdit50_Setup.exe

 

–TR

MarcEdit "rosettastone"

By reeset / On / In MarcEdit

I’ll likely change the name, but I’ve been creating a simple SOAP service that will be able to migrate metadata directly between 7 known metadata formats — or user defined formats, in addition to the ability to harvest OAI to MARC, MARCXML or user defined.  I’m note sure how useful something like this could be for folks since this is really being designed as a tool for interactive metadata translation, but we’ll see soon.  At this point, I don’t have the service on a public server, but I’ve posted a sample of the development WSDL file HERE (btw, don’t use it — it doesn’t link to anything) for those that are interested. 

Calling the service from within C# is pretty easy.  I’m thinking that it will be easy within Java or languages that allow binary data types via a soap response.  For languages like Ruby, which doesn’t if you utilize the actionwebservice gem, I’ll likely create an XML only translation api.  The binary data type gets utilized when passing MARC data to and from the webservices.  Anyway, here’s an example of how it will be called using C#:

 


private void button1_Click(object sender, System.EventArgs e)
{
	localhost.MarcEdit objMarc = new WindowsApplication14.localhost.MarcEdit();
	string xmlData = "";
	byte[] marcData;

	System.IO.FileStream objStream = new System.IO.FileStream(@"c:\documents and settings\reeset\My Documents\book\record.mrc", System.IO.FileMode.Open, System.IO.FileAccess.Read);
	marcData = new byte[objStream.Length];
	objStream.Read(marcData, 0, System.Convert.ToInt32(objStream.Length));
	objStream.Close();
	
	
	xmlData = objMarc.MARC2XML(marcData, localhost.XML_TYPES.oaidc);
	this.richTextBox1.Text = xmlData;

}

private void button2_Click(object sender, System.EventArgs e)
{
localhost.MarcEdit objMarc = new WindowsApplication14.localhost.MarcEdit();
byte[] marcData = null;
//string marcData = "";
marcData = objMarc.OAI2MARC("http://digitalcollections.library.oregonstate.edu/cgi-bin/oai.exe", "bracero", "", "", localhost.XML_TYPES.oaidc, localhost.CHAR_SET.MARC8);
//xmlData = objMarc.MARC2XML(marcData, localhost.XML_TYPES.oaidc);

this.richTextBox1.Text = System.Text.Encoding.UTF8.GetString(marcData, 0, marcData.Length);
}

private void button3_Click(object sender, System.EventArgs e)
{
localhost.MarcEdit objMarc = new WindowsApplication14.localhost.MarcEdit();
//byte[] marcData = null;
string marcData = "";
marcData = objMarc.OAI2MARCXML("http://digitalcollections.library.oregonstate.edu/cgi-bin/oai.exe", "bracero", "", "", localhost.XML_TYPES.oaidc);
//xmlData = objMarc.MARC2XML(marcData, localhost.XML_TYPES.oaidc);

this.richTextBox1.Text = marcData;
}
}

–TR

Ruby and Date classes

By reeset / On / In ruby

I’d seen this somewhere before, but thought I’d benchmark it to see if it was true.  Ruby has 3 classes for doing dates.  There is Date, DateTime and Time classes.  In languages like C# and PHP, the equivalent DateTime class is the one that is generally utilized to do date/time manipulations.  However, in Ruby, DateTime and Time are nearly identical classes, the difference being that DateTime is a convenience class.  Benchmarking shows the DateTime class to be 20-25 times slower than the native Time class.  After doing a little research, the reason is clear.  The Time class is a native class developed in C, the DateTime is a wrapper class written in Ruby.  So while I rarely have occasion to do time manipulation in a loop — it would seem that the DateTime class should pretty much always be avoided.  In fact, I can’t see why the DateTime class exists.  I don’t see what it does that isn’t available in either the Date class or Time class. 

 

–TR