I've installed the VMWare server, and as many, hit the issue of an empty screen.
It appears to happen upon the subsequent logins. Obviously "empty screen" can be caused by a lot of errors, but in my case it seems to be some SSL-related issue, in /var/log/vmware/hostd.log I saw:
[2009-12-07 11:58:12.150 'Proxysvc' 1093462352 warning] SSL Handshake on client connection failed: SSL Exception:
[2009-12-07 11:58:12.316 'Proxysvc Req00102' 1081919824 warning] PendingServerStrm: client write-completion error: SSL Exception: error:00000001:lib(0):func(0):reason(1)
[2009-12-07 11:58:12.573 'Proxysvc Req00101' 1081919824 warning] PendingServerStrm: client write-completion error: SSL Exception: error:00000001:lib(0):func(0):reason(1)
What seems to help - is holding the Control key and hitting the "reload" button when I am on the page that does not show anything.
Then the page reloads fully and I get the login prompt to login into the VM.
Hope this is useful to someone.
I later tried on the ff-3.5, and there Ctrl-Shift-R for reload, apparently did the trick as well.
Monday, December 7, 2009
Tuesday, November 3, 2009
Recording sound and video from a webcam
I've found a lot of questions on the internet on how to record the sound and video at the same time from the webcam. Here's the magic incantation that worked well for me (it assumes you do not have any video capture devices besides the webcam and already have one ALSA soundcard besides the mic of the webcam - if not, adjust accordingly). This is a single long line:
mencoder tv:// -tv driver=v4l:width=320:height=240:device=/dev/video0:fps=30:forceaudio:alsa:adevice=hw.1 -ovc lavc threads=2 -ffourcc xvid -oac mp3lame -lameopts cbr=128 -o recording.avi
EDIT: with a purchase of the Sony Playstation Eye camera, the above does not work all that well at all - at the high rate my mencoder misses too many frames. Something I found that is a bit better:
gst-launch v4l2src ! 'video/x-raw-yuv,width=640,height=480,framerate=(fraction)25/1' ! mux. alsasrc ! audioconvert ! 'audio/x-raw-int,rate=44100,channels=2' ! mux. avimux name=mux ! filesink location=test.avi
This lacks the compression, and the voice is a bit dragging compared to video - but gives more or less the 30fps that the webcam sends.
mencoder tv:// -tv driver=v4l:width=320:height=240:device=/dev/video0:fps=30:forceaudio:alsa:adevice=hw.1 -ovc lavc threads=2 -ffourcc xvid -oac mp3lame -lameopts cbr=128 -o recording.avi
EDIT: with a purchase of the Sony Playstation Eye camera, the above does not work all that well at all - at the high rate my mencoder misses too many frames. Something I found that is a bit better:
gst-launch v4l2src ! 'video/x-raw-yuv,width=640,height=480,framerate=(fraction)25/1' ! mux. alsasrc ! audioconvert ! 'audio/x-raw-int,rate=44100,channels=2' ! mux. avimux name=mux ! filesink location=test.avi
This lacks the compression, and the voice is a bit dragging compared to video - but gives more or less the 30fps that the webcam sends.
Sunday, June 14, 2009
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
A fairly odd message, especially given that 'which cpp' shows another location.
The solution is:
The solution is:
sudo aptitude install build-essential
Thursday, May 28, 2009
F*ctor - a 0-dimensional Turing tarpit.
Following a post of one of my friends to the http://manage.yore.ma/eso/, I felt a bit inspired,
so I wanted to write up something fun. So, here's the experiment - an imaginary language which holds the entire program and data memory in a single variable!
The F*ctor machine has only other elements are a single instruction, and a single variable which holds the Program, and Data, and the machine state, in just a single natural number X. The "single instruction", however, is a bit difficult to describe, so I will attempt to describe it in terms of smaller "micro-operations" - they do not really change nor are visible to the user, they are here mostly for the sake of explanation. The temp variable in the pseudocode is just for the sake of ease of comprehension.
The machine can really efficiently calculate Prime(N) (being the Nth prime, that is Prime(0) == 2; Prime(1) == 3, Prime(2) == 5, etc.)
Also it can count how many times is the given number divisible by some prime: CountPrime(V, P); CountPrime(2,2) == 1, CountPrime(9,3) == 2; CountPrime(13,3) == 0.
Finally, the third operation is the destructive divide: DivideBy(V, P) - try to integer-divide V in-place by a prime P ith no remainder, and return True if we were successful, and False if no remainder-free division is possible.
The remaining operations that comprise the single cycle are some trivial arithmetics.
the single cycle of execution:
So running the program consists of repeatedly executed "X = one_cycle(X)".
If we take a closer look, then this is nothing more than a folded version of Reverse-subtract and skip if borrow single-instruction machine, with "memory contents" at location N being the number of times the X is divisible by Nth prime number. As it is visible, the accumulator is memory-mapped at 0 (see these divisions/multiplications by 2?) and the program counter is memory-mapped at 1 (see the multiplications either by 3 or by 9 ?)
So, unless I made a bug somewhere in the logic, we have a Turing-complete absract machine squashed into a single variable.
so I wanted to write up something fun. So, here's the experiment - an imaginary language which holds the entire program and data memory in a single variable!
The F*ctor machine has only other elements are a single instruction, and a single variable which holds the Program, and Data, and the machine state, in just a single natural number X. The "single instruction", however, is a bit difficult to describe, so I will attempt to describe it in terms of smaller "micro-operations" - they do not really change nor are visible to the user, they are here mostly for the sake of explanation. The temp variable in the pseudocode is just for the sake of ease of comprehension.
The machine can really efficiently calculate Prime(N) (being the Nth prime, that is Prime(0) == 2; Prime(1) == 3, Prime(2) == 5, etc.)
Also it can count how many times is the given number divisible by some prime: CountPrime(V, P); CountPrime(2,2) == 1, CountPrime(9,3) == 2; CountPrime(13,3) == 0.
Finally, the third operation is the destructive divide: DivideBy(V, P) - try to integer-divide V in-place by a prime P ith no remainder, and return True if we were successful, and False if no remainder-free division is possible.
The remaining operations that comprise the single cycle are some trivial arithmetics.
the single cycle of execution:
one_cycle(X) {
local CurrentP = CountPrime(X, 3);
while(DivideBy(&X, 2)) {
if(not DivideBy(&X, Prime(CountPrime(X, Prime(CurrentP))))) {
return X * 3 * 3;
}
}
return X * 2^CountPrime(X, Prime(CurrentP)) * 3;
}
So running the program consists of repeatedly executed "X = one_cycle(X)".
If we take a closer look, then this is nothing more than a folded version of Reverse-subtract and skip if borrow single-instruction machine, with "memory contents" at location N being the number of times the X is divisible by Nth prime number. As it is visible, the accumulator is memory-mapped at 0 (see these divisions/multiplications by 2?) and the program counter is memory-mapped at 1 (see the multiplications either by 3 or by 9 ?)
So, unless I made a bug somewhere in the logic, we have a Turing-complete absract machine squashed into a single variable.
Saturday, May 16, 2009
A "nod" X11 linux interface
Today I wanted to spend the evening doing something different and fun, and came up with an idea to play around with some of the opencv's functions. Well, did not play that much - just slightly tweaked the facedetect.c, to get what I called a "nod interface".
When you compile and launch the program, it pops up the screen with the video. If all goes well and you are sitting in front of your camera, you should see a circle around your face. If you do not see it - move closer and/or get a smoother background.
The few lines of pretty silly code that I've added does the following: calculates the two averages of the last N points of the center of the detected face object - "fast" (N=4) and "smooth" (N=8).
If you don't move your head the delta between these will be almost 0 - it gets forced down to zero by a simple check against the threshold.
If you nod - then obviously the "fast" average moves down faster than the "smooth" one - so if you nod energetic enough, the computer will notice it and will send a few "arrow down" synthetic events via the XTest X11 extension. If you manage to "nod up" (unnatural, but somewhat doable) - then it will send the equivalent number of "arrow up" events.
The counter-movement (returning the head back after the nod) is compensated by another simple logic - it's needed to have at least 4 "zero-delta" cycles in order to let the detected delta through.
The end result is that with some amount of luck you might manage to read things from your laptop hands-free. Should be good for reading the /. threads :-)
this file is the tweaked facedetect.c - the long line to feed to the compiler is in the comments in the beginning.
Depending on the speed of your computer, you might need to adjust some of the thresholds.
Enjoy!
When you compile and launch the program, it pops up the screen with the video. If all goes well and you are sitting in front of your camera, you should see a circle around your face. If you do not see it - move closer and/or get a smoother background.
The few lines of pretty silly code that I've added does the following: calculates the two averages of the last N points of the center of the detected face object - "fast" (N=4) and "smooth" (N=8).
If you don't move your head the delta between these will be almost 0 - it gets forced down to zero by a simple check against the threshold.
If you nod - then obviously the "fast" average moves down faster than the "smooth" one - so if you nod energetic enough, the computer will notice it and will send a few "arrow down" synthetic events via the XTest X11 extension. If you manage to "nod up" (unnatural, but somewhat doable) - then it will send the equivalent number of "arrow up" events.
The counter-movement (returning the head back after the nod) is compensated by another simple logic - it's needed to have at least 4 "zero-delta" cycles in order to let the detected delta through.
The end result is that with some amount of luck you might manage to read things from your laptop hands-free. Should be good for reading the /. threads :-)
this file is the tweaked facedetect.c - the long line to feed to the compiler is in the comments in the beginning.
Depending on the speed of your computer, you might need to adjust some of the thresholds.
Enjoy!
Thursday, May 7, 2009
Saturday, May 2, 2009
A very compact renderer
Been a while since I babbled something here.
So to ensure I'm still alive and kicking - here's something neat: a renderer in under 600 lines of code.
Minilight has a bunch of implementations in various languages.
A very nice toy.
So to ensure I'm still alive and kicking - here's something neat: a renderer in under 600 lines of code.
Minilight has a bunch of implementations in various languages.
A very nice toy.
Subscribe to:
Posts (Atom)