No problem. Take your time. If you have problem, just reply here or send me a PM.
Thank you!
|
|
|
Oh cool, that you actually want to pay me something! My address is:
1Q3DhCvgcgMKtQJGQMPZGLZaueWaTps7wh
Ok, back to your questions...
You'll most likely use the bash shell. That shell is not simply a terminal, but it also contains a pretty much complete programming language, so you can write (shell) scripts with it!
The line:
for f in *pbm ; do convert -quality 100 $f `basename $f pbm`jpg; done
is such a (small) script.
The shell expands *pbm to the list of pbm file in your directory, so it evaluates to
0.pbm 1.pbm 2.pbm ...
The 'for' commands lets you loop over this list of filenames, so the variable f becomes one of the filenames in each iteration. During the first loop iteration f is 0.pbm, then it's 1.pbm etc.
The 'do' part simply describes what to do in each loop iteration. So we call a program called 'convert', which is part of the imagemagick package and converts image files. So in the first iteration, we call
convert -quality 100 0.pbm 0.jpg
, because $f simply means 'the value of f' , which is 0.pbm at the time. `<command>` is a construct to run a command and use it's return value. So basename is just a program to a) remove a path from a filename and b) remove a suffix from the filename. So "basename 0.pbm pbm" is just a way to remove the pbm suffix from the filename. Then we add jpg to the filename and 0.pbm becomes 0.jpg.
So this whole line is just a short way to execute convert -quality 100 0.pbm 0.jpg convert -quality 100 1.pbm 1.jpg etc... So we convert each pbm file with quality 100 (no quality loss) to a jpg file.
So you should have the files 0.jpg 1.jpg 2.jpg ... in your directory and you could use them as the input of ffmpeg or mencoder to create a movie from them.
PS: if you don't know what a command like 'convert' does, just type 'man convert' and you'll get a manual for this program. Use 'q' to leave the manual.
So, you your jpg files now as the input to ffmpeg:
ffmpeg -r 30 -b 1800 -i *.jpg output.mp4
, which calls ffmpeg with *.jpg (all the images) as the input (the part after -i is the input), a framerate of 30 fps (-r 30 means rate 30), a bitrateof 1800 kbit / second and and outputfile named 'output.mp4'.
The %02d was actually an error by me, since it means '2 digits', but this wouldn't match for your first files 0.pbm, but only for 00.pbm, 01.pbm etc.
Does this help you a bit further?
You could also send me the files, if you want, so I could create the video, but I thought you want to learn bash...
Ciao, Andreas
|
|
|
http://electron.mit.edu/~gsteele/ffmpeg/tells you quite exactly what to do. Convert the file to jpg and then encode them to a movie. for f in *pbm ; do convert -quality 100 $f `basename $f pbm`jpg; done should loop over your files and convert them to jpegs. You could then try mencoder or ffmpeg to create the movie: mencoder mf://*.jpg -mf w=800:h=600:fps=30:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output.avi ffmpeg -r 30 -b 1800 -i %02d.jpg output.mp4 The best parameters for the output (resolution, bitrate) depend on your input files obviously (the resolution of the images or how move movement you have in your movie). h264 might be the best encoder for HD quality these days, so I'd consider it, if you want HD quality.
|
|
|
Thanks! So far I just made up my own schema. If another format turns out to be widely accepted, I can change the format later.
|
|
|
Hi!
I fetch the mtgox data in an app and would like to store them, so I don't have to fetch them completely again. Is there a standard XML format to store trades and orders?
TIA, Andreas
|
|
|
It seems, there are no OpenCL drivers for this card, so all the popular GPU miners won't work.
|
|
|
A SHA256 isn't hard to compute, its just that you have to do a ton of them to verify a block If you know a simple way to compute a sha256, please let me know, so I can finally mine with my GeForce 7. So far it takes to many instructions for a shader... Ciao, Andreas
|
|
|
A hash value is just a number, that identifies a block of data somehow. Example: if you have 10 bytes, you could just add all those byte without carry and get a 1 byte hash value for those 10 bytes. You could than add an additional condition to this hash value, like 'must be < 10' and try to find all blocks, that have such a hash value. The hash rate would be the number of blocks you could check per second, if their hash value fulfills this condition.
The sha256 hash value is much more complicated to compute, so you need quite some computing power to check a reasonable number of bitcoin blocks per second.
|
|
|
I also interested in any stats on Java development.
|
|
|
The ruby code seems to use the 0 API?
|
|
|
Is there more info available on format of the returned json data? I.e. the structure of the open orders.
TIA, Andreas
|
|
|
fleurop.de delivers flowers to any location in Germany.
|
|
|
Like the mtgox API? Currently most of the stuff is under trading, I guess. But there are a few technical questions, that don't really git there in my eyes, so an API subforum would be cool...
|
|
|
Hi! I kinda want an R-Type game (top down shooter) with upgrades purchaseable for LTC...might be a bit easier for me to code than the farmville thing.
I've thought about that concept: buying upgrades with LTC in the game. Would help pay game author and contribute game rewards for the players as well. Buy 20 missiles for 1 LTC to kill level-end enemy, or so.
|
|
|
Thanks for your reply! Maybe the 10s delay is not really an issue and I should continue work on the Java API. Thanks for the encouragement!
|
|
|
Looks nice! I wrote some early Java code for the mtgox json API, since I'm also interested in tradebots. But the problem is the delay in the mtgox json api, so my concern is, that a bot would simply react much too late to be efficient?
|
|
|
Wouldn't it be easier to get the json server update more often? How quick is enough 'real time'?
|
|
|
|