Powered by
Movable Type 3.38 mod_perl/2

 October 2009 Archives

2009, October 04 (Sun)

Programmierung calling C++ bind-bound functions with variable parameters

/*

Consider this following small example program.

*/
#include <functional>
#include <iostream>

using namespace std::placeholders;

/*

We write a subroutine that outputs the multiple of its arguments, a and b.

*/
void multiple(int a, int b, const std::string & who) {
  std::cout << who << ":\t" << a << "×" << b << "=" << a*b << std::endl;
}

int main() {
  /*

We then call it from main.

 */
  multiple(2,3,"direct");

  /*

Next, we want to use bind to bind some arguments and call it. Unsurprisingly, the output is the same.

 */
  std::bind(multiple,2,3,"bind")();

  /*

We can also store this bound function and call it:

 */
  auto bound(std::bind(multiple,2,3,"bound"));
  bound();

  /*

Things get wicked, when we want to predefine only one parameter, though :(

 */
  //std::bind(multiple,2,_1,"bindp")(3); // you wish!
Continue reading “calling C++ bind-bound functions with variable parameters ” »


2009, October 10 (Sat)

Linux Disable ZeroCD on Huawei UMTS USB-sticks

The Huawei E1552 (and other) UMTS USB-stick provides a ZeroCD called flashdrive, which provides drivers and utilities. To disable it (and prevent it to be mounted all the time), you can use the following AT-command:


at^u2diag=0

(Source: Huawei forums)


2009, October 30 (Fri)

Linux screencast with ffmpeg

ffmpeg can record the X server screen for you and store it directly for example in Flash Screen Video format. This is much more favourable than some other solutions in my opinion :-)

example: ffmpeg -f x11grab -s 1024x600 -r 120 -i :0.0 -vcodec flashsv /tmp/out.flv

1024x600 is the screen size and 120 the rate. Important is the .flv-extension for the suitable container format.

Linux Unihan-Wtpen SCIM chinese character handwriting recognition under Linux

Chinese character handwriting recognition under Linux using the Chrasis Input Pad for SCIM and the Unihan-Wtpen recognition engine by Wintone (Beijing).

Continue reading “Unihan-Wtpen SCIM chinese character handwriting recognition under Linux” »

Linux Linux中文手写输入法使用Chrasis的SCIM写字板和汉统/北京文通的辨识软件

Linux中文手写输入法使用ChrasisSCIM写字板和汉统/北京文通的辨识软件。

Screenshot FLV