While people on the Internet are still fighting about npm vs bower, there are some packages that are only available for npm and some that are only available for bower. Unfortunately you will run into problems, sooner or later, just like I did today.

The package pdfmake enables JavaScript applications to convert text to PDF, both within a website as well as a NodeJS server application. However, they explicitly state that the bower version should be used for web applications, and the npm version for server applications.

But if you want to use npm and want to avoid bower (for whatever reason), then you will run into a problem.
Thankfully, somebody created a wrapper package for npm: https://github.com/AaronBuxbaum/pdfmake-client

You can install it via

npm install pdfmake-client --save

The Android SDK and also AVD Manager can be started from the commandline, if you have the Android SDK Tools installed.

For instance, on my system I have android-sdk-tools in ~/android-sdk-tools, therefore I only need to go into that directory (cd ~/android-sdk-tools) and use the following command:

./Tools/android avd # start android avd manager
# or
./Tools/android sdk # start android sdk manager

This can be used for creating start menu entries, e.g., for XFCE. Mine look as follows:
[Desktop Entry]
Name=Android AVD Manager
Exec=./android avd

[Desktop Entry]
Name=Android SDK Manager
Exec=./android sdk


One of the tasks I come across often is converting images from one format into another. For instance, I need to convert SVG to PNG.

This can be achieved easily by using the "convert" commandline tool (ImageMagick) and a standard for loop in linux (note that I wrote the *.svg statement in the for command on purpose and that I use "$f" on purpose):

for f in *.svg ; do
    convert "$f" "$f.png"

However, this produces ugly file names like "file1.svg.png", which could be desireable in some scenarios, but not in my case when I deploy it for a website. You can bypass this by using ${f%svg}png:

for f in *.svg ; do
    convert "$f" "${f%svg}png"

Essentially this tool can handle a lot of use cases, for instance you can specify the picture density and which color should be used as transparent:

for f in *.svg ; do
    convert "$f" -density 300 -transparent white "${f%svg}png"

If you only want your pictures to have a certain size, you can resize them, e.g. using -resize 64x64:

for f in *.svg ; do
    convert "$f" -resize 64x64 -density 300 -transparent white "${f%svg}png"

However, you need to be careful when doing this. For instance, when the source image is smaller than the destination image, you might run into problems, and need to use the command like this:

for f in *.svg ; do
    convert  -resize 64x64 -density 300  "$f" -resize 64x64 -density 300 -transparent white "${f%svg}png"

I recently came across some very odd behaviour in MySQL with German Umlauts (ö ä ü ß) and Unique Constraints. The problem is even documented as Bug #57860 on mysql.com. In short, MySQL (or rather utf8_unicode_ci) would suggest that foobär is the same as foobar. So the statement
INSERT INTO test (test) VALUES ('foobar'),('foobär');
where test is a column with a unique index/constraint would fail.

This behaviour might be desired in some languages, but particularly for the german language this behaviour is not optimal. I'm sure if you find this blog post, you came across the same problem so I do not need to come up with another example.

The solution is simple, though you should think twice before you use it:
Instead of utf8_unicode_ci, you could use utf8_general_ci or even the newer and more appropriate utf8_german2_ci (available starting with MySQL 5.6).

While USB Headsets are already supported by Ubuntu (15.10 in my example), there are some stumbling block. One of them was that the USB Headset is not recognized after (re)booting, only after plugging it out and back in.

To overcome this issue, the USB device needs to be entered in /etc/modprobe.d/snd-usb-audio (you might have to create this file first).

Step 1: Boot without the headset plugged in
Step 2: Run lsusb tool in commandline, copy the output to a text editor
Step 3: Plug in your USB headset
Step 4: Use lsusb tool in commandline to find out what USB devices you have, in my example:

Bus 002 Device 003: ID 0451:8046 Texas Instruments, Inc.
Bus 002 Device 002: ID 0451:8046 Texas Instruments, Inc.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 413c:301a Dell Computer Corp.
Bus 001 Device 005: ID 2034:0102
Bus 001 Device 004: ID 413c:2113 Dell Computer Corp.
Bus 001 Device 003: ID 0451:8044 Texas Instruments, Inc.
Bus 001 Device 002: ID 0451:8044 Texas Instruments, Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Step 5: Cross match the lsusb output from step 2 to find out which device your headset is, in my example it was
Bus 001 Device 005: ID 2034:0102

Step 6: Create the following entry in /etc/modprobe.d/snd-usb-audio (you might have to create this file first):
options snd-usb-audio index=2 vid=0x2034 pid=0x0102

Make sure to replace 0x2034 with the first ID of the lsusb output of your usb device, and 0x0102 with the second one.

Step 7: Reboot, enjoy!

A Comparative Study of DASH Representation Sets Using Real User Characteristics
C. Kreuzberger, B. Rainer, H. Hellwagner, L. Toni and P. Frossard
Published at NOSSDAV 2016 (co-located with MMSyS 2016), Klagenfurt, Austria, May 2016.

Link to Paper: PDF
BibTeX Cite: To Appear
Presentation: PDF

Paper Website: http://concert.itec.aau.at/NOSSDAV_2016/
Git Repo: https://github.com/ChristianKreuzberger/amust-ndnSIM

Ever wondered which representations YouTube is using for your video? Is it worth uploading your YouTube video with 20 Mbit/s at 1080p and 30 fps?

Find out by analyzing your YouTube videos MPD (Media Presentation Description) file, as explained in my new open source repository here: https://github.com/ChristianKreuzberger/extract-youtube-mpd

This is the result of one of my videos:

python extract.py https://www.youtube.com/watch?v=GTGUa4J8XKw aspen.mpd
Downloading HTML of https://www.youtube.com/watch?v=GTGUa4J8XKw 
Extracted MPDURL from HTML:  

This means my video is available at 4.1 Mbit/s at 1080p and 24 fps, 2.2 Mbit/s and 720p, 1 Mbit/s and 480p, etc... We have a paper submitted to NOSSDAV that shows a full analysis of YouTubes representations, so stay tuned for more information.

Due to the new release of ndnSIM (version 2.1) my last post about running ndnSIM without root has become obsolete. It is also no longer necessary to compile ndn-cxx as a separate library now. However, if you still want to use the (recommended) ndnSIM scenario template without having root access, here are the steps to follow (for version 2.1):

Step 1: follow the installation (requirements, etc...) instructions on the ndnSIM website until you have to type ./waf the first time.

For instance (after having installed all pre-requesits):
mkdir ndnSIM
cd ndnSIM
git clone https://github.com/named-data-ndnSIM/ns-3-dev.git ns-3
git clone https://github.com/named-data-ndnSIM/pybindgen.git pybindgen
git clone --recursive https://github.com/named-data-ndnSIM/ndnSIM.git ns-3/src/ndnSIM

Step 1.a: If you require BRITE, do this in addition:

hg clone http://code.nsnam.org/BRITE
export BRITE_HOME=$(pwd)
cd ..

Step 2: Create a directory where ns-3 and ndnSIM will be "installed" into, e.g.:
mkdir ndnSIM-build

Step 3: Go to the ns-3 subfolder and compile ns-3 and ndnSIM:
cd ns-3
./waf configure --prefix ../ndnSIM-build -d optimized

Note: --prefix ../ndnSIM-build tells the build-script to not install the libraries to the default location, but to ../ndnSIM-build.

Step 3.a: If you followed Step 1.a for BRITE, you will have to add --with-brite=$BRITE_HOME to the ./waf command:
./waf configure --prefix ../ndnSIM-build -d optimized --with-brite=$BRITE_HOME

Step 4: Grab a coffee, tea, beer, etc.! This step takes some time...

Step 5: Once this has finished, type
./waf install

Note: You did not have to use sudo! ns3 and ndnSIM are now being "installed" to ../ndnSIM-build

Step 6: Set up LD_LIBRARY_PATH and PKG_CONFIG_PATH for being able to use the scenario template
cd ..
export LD_LIBRARY_PATH=$(pwd)/ndnSIM-build/lib/

Step 6.a: You might need to add those exports to your ~/.bashrc file.

Step 7: Download and configure scenario template
git clone https://github.com/named-data-ndnSIM/scenario-template.git scenario
cd scenario
./waf configure

Step 8: Create your examples in the scenario template and run them!