Sorry, the page you requested was not found. Really.

  • The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Saturday, 23 May 2009

Friday, 22 May 2009

Saturday, 09 May 2009

Thursday, 30 April 2009

Wednesday, 29 April 2009

  • HowTo: SoX Installation

    HowTo: Compiling SoX with read/write MP3 support in Ubuntu

    SoX describes itself as the "Swiss Army knife of sound processing programs," a well-deserved title given the amount of functionality outlined in the sox(1) man page - one can say it's the command-line version of Audacity.

    Due to patent issues and the typical legal mess, SoX binaries are distributed without MP3 support to avoid licensing fees  (I would prefer an unencumered open format such as Ogg Vorbis, but MP3 remains too common to ignore).  SoX can be given MP3 support, however, be recompiling it to use a third-party library such as LAME.

    Instructions here are specific to Ubuntu (8.10+) but may be adapted for Debian or any other distro that uses APT.
    1. Install packages required for the build environment (ensure that 'multiverse' and 'restricted' repositories are enabled in /etc/apt/sources.list).
      Note that, in Ubuntu 7.10 and 8.04, LAME development libraries are provided by liblame-dev instead of libmp3lame-dev.

      sudo apt-get install build-essentials fakeroot libmp3lame-dev
      sudo apt-get build-dep sox


    2. Retrieve and unpack SoX sources into a clean directory.

      mkdir sox
      cd sox
      apt-get source sox
      dpkg-source -x sox_*.dsc
      cd sox-*.*.*


    3. Remove the '--disable-lame' compiler flag; either use sed to automate the task or manually edit sox-*.*.*/debian/rules with a text editor.

      sed -i~ 's/--disable-lame//g' debian/rules

    4. Build the package.

      dpkg-buildpackage -b

      You should be able to see
      checking lame/lame.h usability... yes
      checking lame/lame.h presence... yes
      checking for lame/lame.h... yes
      checking for lame_init in -lmp3lame... yes
      <snip>
      LAME MP3 writer................... yes
      echoed in the terminal, although it is recommended you redirect stdout to a log file because the messages will likely escape the scrollback buffer before there is a chance to pause and read.
    5. The build will provide all SoX-related packages, but only certain local ones are needed to replace the repository versions.

      cd ..
      sudo dpkg -i sox_*.deb libsox-fmt-mp3_*.deb

    If all proceeds well, sox -h should give something like
    SUPPORTED FILE FORMATS: 8svx aif aifc aiff aiffc al alsa ao au auto avi avr caf cdda cdr cvs cvsd dat dvms fap ffmpeg flac fssd gsm hcom ima ircam la lpc lpc10 lu m3u m4a mat mat4 mat5 maud mp2 mp3 mp4 mpg nist nul null ogg oss ossdsp paf pls prc pvf raw s1 s2 s3 s4 sb sd2 sds sf sl smp snd sndfile sndt sou sph sw txw u1 u2 u3 u4 ub ul uw vms voc vorbis vox w64 wav wavpcm wmv wve xa xi
    Support for extra formats can be obtained through the libsox-fmt-all package.


    HowTo: Recompiling the latest SoX sources

    I found myself desiring the "norm" effect, but, unfortunately, the feature was introduced in version 14.1.0, while the 8.10 repository is stuck at 14.0.1.  In these cases, it becomes necessary to recompile the latest sources.
    1. Download and unpack the latest stable SoX sources for GNU/Linux (currently 14.2.0).  For expediency, wget is used here, but a regular web browser suffices.

      wget http://superb-west.dl.sourceforge.net/sourceforge/sox/sox-14.2.0.tar.gz
      tar -xvzf sox-14.2.0.tar.gz


    2. Set up the build environment.

      sudo apt-get install build-essentials fakeroot checkinstall libmp3lame-dev
      sudo apt-get build-dep sox


      Note that libmp3lame-dev is necessary for MP3 support through LAME, which is not automatically included among the SoX build dependencies due to MP3 patent/licensing issues.
      For Ubuntu 7.10 and 8.04, LAME development headers and libraries are provided by liblame-dev instead.
    3. Compiling involves the same standard procedure...

      cd sox-14.2.0
      ./configure
      make


    4. Due to some strange linking situation in which shared libraries were not detected correctly, the links need to be repaired after installing or SoX will not run.  (This took me a while to figure out.)

      sudo make install
      # Add /usr/local/lib to end of the include paths
      sed -i~ '$s/$/& \/usr\/local\/lib/' /etc/ld.so.conf
      sudo /sbin/ldconfig


    5. For easier uninstallation, checkinstall can create a deb package so APT can keep track of the installed files.

      sudo checkinstall

      Note that SoX is produced as a single package, rather than as multiple packages by repository conventions.
    Download for x64: sox_14.2.0-1_amd64.deb

Monday, 27 April 2009

Sunday, 26 April 2009

Saturday, 25 April 2009

  • Teh Stoopid, it eviscerates

    In observing wide range of opinions that people have expressed on the Internet, I have come to notice that one particular rule can be formulated from the chaos:
    As long as one is able to imagine the most hilarious/ridiculous/nonsensical position a person can possibly take on a certain issue, chances are that someone else on the Internet absolutely believes it.
    I just had the random curiosity to search "pollution is good," and, a couple hyperlinks later, I found old NPR story about a think tank called the "Competitive Enterprise Institute" that says...wait for it...not only is global warming not real, raising atmospheric CO2 levels is actually a good thing.

    What a catchy tagline for their ads: "They call it pollution.  We call it life."
    Since a little girl blowing on a dandelion is technically producing CO2, and little girls are (mostly) harmless, it must logically follow that CO2 is harmless.
    It reminds me of a Youtube comment (where else?) I once read, arguing we should pump more greenhouse gases into the air because the Northwest is way too darn cold.

    Interestingly, but not surprisingly, they have disallowed ratings on their Youtube videos.
  • Earth Day

    I watched the 10:30 PM showing of earth yesterday, which certainly had more eye-candy than the standard fare on television.

    There were obvious problems with projecting anthropomorphic emotions onto animals (no, polar bears cannot "remember" the spirit of survival their ancestors had), and the film was admittedly sparse in actual scientific commentary.  I'm not sure how one can speak about the diversity of life without some mention of the underlying evolutionary connections, but it was done.
    Narrative flaws aside, however, earth was very visually awe-inspiring, especially with the unique timelapse of seasonal changes and panoramic landscape shots.  It was also announced that Disneynature will be releasing another documentary that focuses on oceans next year.

    Now, with our purchase of three tickets, there will be three more trees in this world...except that the deforestation of the Amazon is occurring at about six football fields per minute.

Friday, 24 April 2009

  • Introducing JASon

    I needed some way to convert diagram specifications to/from plain text in the CSUF database modeler; for simplicity, I settled on the JSON format.  Yes, while I am aware that JSON cannot handle circular references (but I do have a solution), it is much easier to parse/generate than XML and neatly avoids the difficulty of defining an obscure binary.

    I chose not to use an existing library for a couple of reasons:
    1. Apparently, most Java libraries employ a DOM-like approach to serialize/deserialize Java objects.  A full DOM tree is convenient, but for my purposes it would unnecessarily duplicate objects.
    2. One learns more by doing, and, in any case, I crave the amusement.
    Thus, after a week of work, I introduce JASon (JSON API Simplified), a barebones stream parser/generator library that takes design cues from the SAX approach: it parses JSON in a single pass using callback methods for client interaction. This method is particularly memory-efficient since the entire document is never held in memory at once - advantageous when dealing with potentially complex diagram specifications.  It also includes a complimentary generator.

    Some features:
    • Compliant with RFC 4627
    • Validates input/output for well-formedness
    • Parser/generator objects "recycle" themselves to minimize unnecessary object creation.
    • If a DOM tree is desired, there is a DOM utility class that adapts the stream parser to produce one.
    The project is hosted at Launchpad, where the source code and JAR builds for the 0.1.0 release are available at the trunk and downloads, respectively.
    To get a local copy of the latest source code, run bzr branch lp:libjason (you need Bazaar for this).
    For the Javadoc, run bzr branch lp:libjason/javadoc (viewing raw files is currently not possible at Launchpad).

A0u

  • Visit A0u's Xanga Site
    • Name: A0u
    • Gender: Male
    • Member Since: 8/21/2007
Don't worry - your calendar is here… to see it in action just click "Save" above and refresh the page.