Ubuntu: Audio Editing

Just a quick note on audio editing under Ubuntu. I just wanted to cut and reassemble different songs. At first I tried Audiacity. Maybe I did not give it enough process priority or I missed some settings, but it kind of lagged and the playback was somewhat indeterministic. 

A very well working alternative is Ardour. At least it did everything I wanted it to. Which was not much, I admit :)

I found a list of audio programs for Ubunut / Linux here:

https://help.ubuntu.com/community/UbuntuStudio/Audio

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

Chrome Caching JavaScript Files When Debugging

Oh my ... I just wasted an hour to notice that Chrome caches JavaScript files! I was debugging a web application changing something on a static JavaScript file. When looking at the file in the built-in debugging suite those changes where not visible. Accessing the file directly revealed that those changes were present. I looked around a little bit and found this: http://superuser.com/questions/36106/force-refreshing-only-javascript-files-in-firefox-and-chrome

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

Hadoop: Secondary Sort / Sort by Value

Explanation should be extended ... but the essentials are described here:
* http://www.riccomini.name/Topics/DistributedComputing/Hadoop/SortByValue/
and here:
* http://www.mail-archive.com/core-user@hadoop.apache.org/msg05675.html
Also have a look at the example here:
* https://issues.apache.org/jira/browse/HADOOP-4545
* https://issues.apache.org/jira/secure/attachment/12396159/h4545.patch

Now they do a good job explaining how, but something I was not clear about was why do we need a Partitioner. Should the Comparator set by Job.setGroupingComparatorClass(Class) not take care of this? Well, no. Why?

* '''Partitioner''': After the mapping phase key-value-pairs are distributed to their respective Reducer (each may run on a physically different machine). Which key-value-pair goes to which reducer is determined by the Partitioner. The default Partitioner is the HashPartitioner which partitions by hash key derived from the key (http://developer.yahoo.com/hadoop/tutorial/module5.html#partitioning). The key-value-pairs assigned to a Reducer are called a "partition".
* '''GroupingComparator''': A partition may either be processed by a single call to the Reducer.reduce(...) method or it might be grouped - again by key. Each group will be processed in its own call to the Reducer.reduce(...) method. The grouping is done by the Comparator set by Job.setOutputValueGroupingComparator(Class).
* '''KeyComparator''': The key-value-pairs iterated over by the Reducer.reduce(...) method are sorted. This sorting is taken care of by the Comparator set by Job.setOutputKeyComparatorClass(Class).

The example here does the partitioning and grouping the same way. Thus each Reducer.reduce(...) is only called once for each Reducer.
* http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/mapred/Reducer.html

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

Ubuntu: ASCII Codes

This is how to input ASCII codes in Ubuntu: http://wiki.ubuntuusers.de/Sonderzeichen.

Basically use the Alt Gr and Alt Gr + Shift with some keys :)

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

WKT: Continents

I am probably just stupid, but I could not for the live of me find well-known text representations of the world's continents. I finally did it myself. Very, VERY coarse, mind you using the OpenLayers WKT Example and Wikipedia as a reference. This works for my purposes. Feel free to tell me were I can find better more suitable data! Here are my results:

Asia
POLYGON((96.15234375 85.078125, 179.82421875 80.859375, 179.47265625 36.2109375, 129.19921875 5.2734375, 130.25390625 -10.546875, 105.29296875 -16.875, 52.20703125 9.140625, 51.85546875 13.359375, 44.82421875 11.953125, 32.16796875 33.3984375, 28.30078125 35.15625, 25.13671875 39.375, 29.00390625 42.1875, 49.74609375 41.8359375, 52.91015625 51.6796875, 60.29296875 52.03125, 68.02734375 69.2578125, 65.21484375 71.71875, 80.68359375 85.78125, 96.15234375 85.078125))

Australia
POLYGON((108.10546875 -32.6953125, 107.05078125 -17.2265625, 130.25390625 -9.84375, 128.49609375 6.328125, 179.47265625 -2.8125, 178.76953125 -58.359375, 129.19921875 -54.4921875, 108.10546875 -32.6953125))

Europe
POLYGON((-27.0703125 64.51171875, -21.796875 69.08203125, 7.734375 83.14453125, 69.2578125 86.30859375, 71.71875 75.76171875, 63.6328125 71.89453125, 68.203125 69.08203125, 59.0625 51.15234375, 53.4375 52.55859375, 49.21875 43.76953125, 50.2734375 40.60546875, 37.96875 41.66015625, 30.5859375 42.36328125, 29.00390625 42.71484375, 25.3125 39.7265625, 27.421875 34.1015625, 17.2265625 33.75, 9.84375 38.14453125, -11.25 35.68359375, -12.12890625 46.93359375, -27.0703125 64.51171875))

Africa
POLYGON((-18.984375 20.56640625, -8.0859375 35.68359375, 10.8984375 38.14453125, 18.45703125 31.9921875, 21.62109375 34.27734375, 31.81640625 32.16796875, 35.15625 25.48828125, 42.5390625 13.7109375, 44.6484375 11.42578125, 52.20703125 12.65625, 51.6796875 -31.9921875, 16.875 -39.0234375, 2.8125 -2.8125, -17.2265625 5.625, -19.3359375 11.953125, -18.984375 20.56640625))

North America
POLYGON((-178.59375 51.328125, -168.75 60.46875, -161.71875 86.1328125, -12.3046875 86.1328125, -20.0390625 68.5546875, -35.15625 63.28125, -56.6015625 11.6015625, -75.5859375 13.7109375, -81.2109375 1.0546875, -139.21875 21.796875, -178.59375 51.328125))

South America
POLYGON((-82.6171875 -2.4609375, -75.5859375 14.0625, -56.953125 11.25, -30.9375 -5.9765625, -61.171875 -58.359375, -77.6953125 -60.46875, -82.6171875 -26.71875, -82.6171875 -2.4609375))

Resources

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

LaTex: floats inside framed box environments

I tried to put float environments into framed box environments. All my attempts failed though. In the end I had to do it the other way around and put the boxes into the float. This was awkward because I tried to combine a conditionally hidden environment and a framed environment. So

\begin{framed}
\begin{table}[ht]
...

became

\begin{table}[ht]
\begin{framed}
...

I tried several packages and workarounds:

  • framed,
  • the mdframed,
  • a combination of newenviron and the fbox command or tikz and
  • a combination of newenviron and tikz.

I guess it really does not make sense to do that anyways. So my final solution was to use a combination of the minipage environment and the capt-of package (or caption package which contains the capt-of package):

\begin{minipage}{\linewidth}
	\centering
	content
	\captionof{table}{caption ...}
\end{minipage}

Note that the table keyword in \captionof can be replaced by figure to use a figure caption instead of a table one.

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

Eclipse WTP: Folder Mappings

It is possible to make any folder appear in some path of the web application without actually putting it into the WEB-INF folder. This is possible in the Dialog Properties > Deployment Assembly.

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

Recursively removing .svn folders

I was trying to get rid of all .svn folders in some project of mine. Here is how its done:

$ rm -rf `find . -type d -name .svn`

Source: http://www.anyexample.com/linux_bsd/bash/recursively_delete__svn_directories.xml

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

Ubuntu: RDP - Copy & Paste

I was trying to use Ubuntu's build-in RDP client rdesktop to connect to a Windows machine. The login password of the user contained a ASCII code sign. This I was not able to produce. Copy-paste did not work. The a AltGr-key-combinations did not produce the ASCII sign in the client as it did using plain Ubuntu. This was probably some kind of key mapping issue. I also tried a few flags including the -u, -p, -d in order to log in via the terminal. This did not work either.

In the end I installed the RDP client Remmina using the option to directly specify username, password and domain in the connection profile. This solved the log in problem. So far I did not get lucky solving the issue concerning the ASCII codes though.

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

yes | nohup

I had a script querying me for input (simple returns). It turned out the yes utility was the answer. I used it this way:

(yes '' | nohup python install.py > out 2> err) &
VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)
Return top
 

Warning: array_filter() [function.array-filter]: The first argument should be an array in /var/www/web41/html/hp_fstyle/wordpress/wp-content/plugins/wordpress-tweaks/tweaks.php on line 650