Tagger# – command-line media tagger based on TagLib#

October 1, 2012

Like I mentioned a couple of times, I like listening to and recording internet radio. Sometimes the radio shows I record are streamed in WMA format. Using Streamrecorder.NET, I’ve scheduled a weekly recording and so I have a folder filled with them. Now, the file names are timestamped, which means I can easily tell the date of each show. However, this radio station (and I suspect many others) has the nasty habit of changing the Title and Artist tags to the station’s name. This means that when I open this folder in my favorite audio player, all the files display as Some station – Some station which is pretty annoying. The solution appeared simple enough, just strip the WMA tag information from the file, right? Sure, but the only problem is that to the best of my knowledge, for around 10 years there hasn’t been a single windows command-line tool that is able to edit (or even display) WMA metadata. I haven’t seen anything for Linux and Mac as well, though I was less thorough in my search there. In any case, there is one now:

https://sourceforge.net/projects/taggersharp/

It’s basically a command-line wrapper over TagLib#, supporting most of its cross-format tagging options. To use it as a post processor in Streamrecorder.NET for the purpose I mentioned above, enter {in} -e in its arguments field. Check it out !

TaggerSharp

Recording internet radio

September 30, 2012

I’ve previously blogged about StreamRecorder.NET, which is useful for recording internet radio shows. However, sometimes you want to actually listen to the radio while you’re recording. You’d might also want to record tracks to separate files. Since StreamRecorder.NET is a front-end for other utilities, you could conceivably find a constellation that works for these cases as well. However, existing programs provide better alternatives. Screamer Radio is very nice, as is RadioSure. However, my favorite would be a far less known program: XMPlay. It is very minimalistic and does everything I want (I especially like its global shortcuts). Funny story, before I was aware of it I started writing a radio player of my own, based on the same library XMPlay is based on (BASS). You can see the result here. Suffice to say, I’ll be sticking with XMPlay for now :)

Working with the new SourceForge svn+ssh protocol in Windows

September 30, 2012

I’ve been using TortoiseSVN and AnkhSVN for quite some time with SourceForge. Both have been working flawlessly. However, SF recently updated their SVN system to use SVN over SSH (svn+ssh) for read/write access. For TortoiseSVN, this meant entering the password on every commit. AnkhSVN simply stopped working (something about not being able to open a tunnel to the repository). The recommended, secure fix for these problems appeared to be SSH keys. However, setting up my keys did not yield consistent results. TortoiseSVN worked, but most of the time it still asked for my password, which was annoying. AnkhSVN still didn’t work (it started plink which appeared to be stuck). I also didn’t like having Pageant running in the background all the time. Luckily, I’ve found another way. It may not be as secure, since you’re storing your password in plain text, but it’s good enough for me:

  1. Download plink.exe from http://the.earth.li/~sgtatham/putty/latest/x86/plink.exe
  2. Place the plink.exe in your windows installation directory (%windir%)
  3. Open the following file using Notepad %APPDATA%\Subversion\config
  4. Add or Replace the following line in the [tunnels] section (replace login and pwd with your sourceforge login and password) ssh = c:\\windows\\plink.exe -batch -l <LOGIN> -pw <PWD> (note the double backslash)
  5. Save and close the file

Note that in step 4 I wasn’t able to use environment variables, even though the comments suggested it was possible. YMMV.

 

WinRABCDAsm – Flash ABC (ActionScript Bytecode) disassembly and reassembly made easy

September 30, 2012

RABCDAsm is an excellent collection of utilities for assembling and disassembling actionscript 3 flash (SWF) files. Since using it requires a bit of work in the command line, and I’m very lazy, I’ve created a GUI front-end for it: WinRABCDasm. Once you enter your RABCDasm path in the settings window, the workflow is very easy:

  1. Drag the SWF file to WinRABCDasm to disassemble it.
  2. Navigate the disassembly tree and find the file you wish to modify.
  3. Double click to open it in your favorite editor, and make your changes (for syntax highlighting use asasm.hrc in Eclipse)
  4. Repeat steps 2-3 for all the files you wish to modify.
  5. Hit Reassemble (alt+R) to rebuild the SWF file. Backup your original SWF file before this step as it will overwrite it!

WinRABCDAsm

Zotero – exporting Unicode and LaTeX constructs to BibTex

June 20, 2012

Zotero is a great reference manager, especially if you’re using Firefox. Its BibTeX export is invaluable for LaTeX / LyX users. However, it has a couple of sticking points whose solutions are not well documented. These issues can be especially annoying for researchers working in exact sciences (math, physics, etc.)

Problem 1: Article info contains special Unicode characters (such as é). As BibTeX doesn’t support Unicode, LaTeX compilation fails.

Solution:

  1. Zotero Preferences -> Export -> check Display character encoding option on export
  2. Whenever you export your database, pick a non-Unicode character encoding such as ISO-8859-1

Zotero will now convert the Unicode characters to their native LaTeX equivalents (for example, é will be converted into \’{e}).

Note: You could also solve this on the LaTeX side by using Biblatex and biber. However, I wasn’t able to make them work under LyX.

Problem 2:Article info contains Latex constructs (e.g. $O_{3}$). Zotero escapes these and so they appear verbatim in the reference (e.g. $O_{3}$ instead of O₃)

Solution:

  1. Locate your Zotero data directory and open translators\BibTeX.js with your favorite text editor
  2. Change the following:
     var alwaysMap = {
     "|":"{\\textbar}",
     "<":"{\\textless}",
     ">":"{\\textgreater}",
     "~":"{\\textasciitilde}",
     "^":"{\\textasciicircum}",
     "\\":"{\\textbackslash}"
    };  

    to the following:

     var alwaysMap = {
     "|":"{\\textbar}",
     "<":"{\\textless}",
     ">":"{\\textgreater}" //,
    // "~":"{\\textasciitilde}",
    // "^":"{\\textasciicircum}"
    // "\\":"{\\textbackslash}"
    }; 
  3. Change the following: 
     value = value.replace(/[|\<\>\~\^\\]/g, mapEscape).replace(/([\#\$\%\&\_])/g, "\\$1");  

    to the following:

     value = value.replace(/[|\<\>]/g, mapEscape).replace(/([\#\%\&])/g, "\\$1");  
  4. Save the file.

Escaping of ~, ^, \,$,_ is now disabled, preserving your LaTeX constructs.

References and further reading

http://forums.zotero.org/discussion/5324/bibtex-and-greek-characters/

http://groups.google.com/forum/?fromgroups#!topic/zotero-dev/U9fGc1f3TO8

http://gist.github.com/956623

http://www.rtwilson.com/academic/autozotbib

Adding syntax highlighting for new languages to Eclipse with the Colorer library

May 26, 2012

Say you have an HRC file containing the syntax and lexical structure of some programming language Eclipse does not support (for example D).

Using the EclipseColorer plugin, you can easily add support for it. For this tutorial I’ll be using Eclipse Classic 3.7.2 32-bit.

  1. Go to Help -> Install New Software and click Add..
  2. In the Name field write Colorer and in the Location field write http://colorer.sf.net/eclipsecolorer/
  3. Select the entry you’ve just added in the work with: combo box, wait for the component list to populate and click Select All
  4. Click Next and follow the instructions
  5. Once the plugin is installed, close Eclipse
  6. Copy your HRC file to [EclipseFolder]\plugins\net.sf.colorer_0.9.9\colorer\hrc\auto\types
  7. Use your favorite text editor to open [EclipseFolder]\plugins\net.sf.colorer_0.9.9\colorer\hrc\auto\empty.hrc
  8. Add the appropriate prototype element. For example, if your HRC file is d.hrc, empty.hrc  will look like this: 
     <?xml version="1.0" encoding='Windows-1251'?>
     <!DOCTYPE hrc PUBLIC
     "-//Cail Lomecb//DTD Colorer HRC take5//EN"
     "http://colorer.sf.net/2003/hrc.dtd"
     >
     <hrc version="take5" xmlns="http://colorer.sf.net/2003/hrc"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://colorer.sf.net/2003/hrc http://colorer.sf.net/2003/hrc.xsd"
     ><annotation><documentation>
     'auto' is a place for include
     to colorer your own HRCs
    </documentation></annotation>
    <prototype name="d" group="main" description="D">
     <location link="types/d.hrc"/>
     <filename>/\.(d)$/i</filename>
     </prototype>
    </hrc> 
  9. Save the changes and close the text editor
  10. Open Eclipse and go to Window -> Preferences -> General -> Editors -> File Associations
  11. In the file types section, click Add.. and fill in the appropriate filetype (for example .d)
  12. Click OK and click your newly added entry in the list
  13. In the associated editors section, click Add.., select Colorer Editor and press OK

All done! Now you can open your new language files in Eclipse and enjoy syntax highlighting and parsing.

Adding new language support to FAR manager (plugin) and Midnight Commander (plugin) is similar.

References

http://colorer.sourceforge.net

http://colorer.sourceforge.net/eclipsecolorer/

http://colorer.sourceforge.net/other/Color5Eclipse_Newlanguagedoc.html

http://thecybershadow.net/d/colorer/

http://mcnptips.blogspot.com/2011/08/mcnp-input-file-syntax-for-farcolorer.html

http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-124.htm

ClipCycler – Cycle through past clipboard clips (and swap Hebrew / English mistypes)

July 16, 2010

Some of you may be familiar with the clipboard cycling feature of Visual Studio, which basically stores recent clipboard items and lets you cycle through them. Personally I like this feature a lot, so I’ve created ClipCycler (opensource) to introduce it to all windows applications.

Simply copy text items as you would normally, they are all kept within ClipCycler. You can browse them as well as cycle forward and backwards with configurable hotkeys (e.g. Win+V)

As a bonus (mostly for Israelis), you can swap English and Hebrew characters in cases where you typed in the wrong language by mistake.

You can get ClipCycler at SourceForge:

http://sourceforge.net/projects/clipcycler/

Using your mobile phone as a remote control for your PC / Laptop (via Bluetooth)

April 14, 2010

I was looking for a free utility to do this, and after some googling I bumped into JM2PC.

Following the instructions in its Readme.TXT file, you can have your mobile remote control up and running within minutes, so I definitely recommend it.

Another interesting freebie is MobileWitch, which at first glance seems similar, so you might want to check it out as well.

If you’re willing to pay (I’m not a great believer of paid software), Vectir might be what you’re after.

Easy workaround for the USB random connect / diconnect / reconnect issue

March 28, 2010

Symptom: your laptop makes the USB connect/disconnect sounds randomly, even when no USB devices are connected to your computer

Cause: Probably some loose innards connecting an internal USB device in the laptop

The issue has been discussed in several places, for example:
http://forum.notebookreview.com/showthread.php?t=178071

But I haven’t seen a solution posted, not even a workaround…

I’ve encountered this phenomena with a Dell Inspiron 1520, where the USB camera would do this constantly. It was easy to tell since the camera light / indicator flashed each time it did, but in other situations it might not be trivial to tell which device is the culprit

In any case,  you’d think disabling the defective device in the device manager would stop the annoyance – well, in my case, it didn’t

Fortunately, Nir Sofer comes to the rescue:

  1. Download USBDeview and run it
  2. Sort the list by the “last plug/unplug date” column (is this guy a genius or what) – the problematic device is immediately identified
  3. Right click on it and choose “disconnect selected devices”

You’re done. Until you get the hardware fixed (if ever), you are no longer plagued by that infernal sound. I’m not sure if the disabling persists reboots (haven’t rebooted yet), but if not, USBDeview has a command line interface – so you can place a simple shortcut in your startup to disable the device every time the system starts

StreamRecorder.NET

March 26, 2010

As far as I know, the most robust, free solutions for recording streams of all types today are MPlayer and VLC. Both require some command line arguments which, for many users, would be difficult to use (and find!). In addition, they do not cater to many streaming needs. For that reason, I created StreamRecorder.NET – a free, open source windows GUI front end for several programs (most notably MPayer and VLC), that provides the following features:

  • Records, joins and post processes stream using the tools you choose – recommended defaults are supplied
  • Full Command Line Interface (CLI) allowing scheduling and automation
  • Keeps the recording process alive (restarting when necessary)
  • Time stamps file names to avoid overwrites
  • Logs recorder output to file
  • MP3 and Windows Media easy presets
  • Complete Tool tip coverage explaining all functionality

Enjoy !
https://sourceforge.net/projects/streamrecnet/

Main window (see sourceforge for more screenshots)

If you have feature requests or bug reports, please use the appropriate mechanisms here:
http://sourceforge.net/projects/streamrecnet/support

(This has also been posted on the VideoHelp forums)


Follow

Get every new post delivered to your Inbox.