SATA > IDE
Posted by admin in Uncategorized on June 28, 2010
Turns out sata is 4x faster than ide.
/dev/sda: Timing buffered disk reads: 80 MB in 3.07 seconds = 26.06 MB/sec
hdparam -t /dev/sdb
/dev/sdb: Timing buffered disk reads: 314 MB in 3.00 seconds = 104.53 MB/sec
Reading websites with PHP
Posted by admin in Computer Science on June 7, 2010
Fuppes Slackware 13.2 x86_64 with ffmpeg transcoding
install ffmpeg
install lame, mad, faad libraries
Spacepirates: Ship Layout
Generator, provides W = J/s = N*d/s
Engines, output has a max horsepower output. 1/2 mv^2 = W*dt + 1/2 m v^2
1 electrical motor hp = 746 W
Railgun, charges at J/s with a maximum capacity.
Radar, quadruple power to double range
1 MW generator, 1000 hp engine, 1 MJ railgun
Railguns, how fast can you go
E = 1/2 m v^2
A railgun has a limited length, to shoot faster, the railgun needs to be longer.
If a 1 kg projectile is shot at 1,000 m/s, it will change the speed of a 1000 kg object by 1 m/s due to conservation of momentum.
Hard Drive Prices
The 3 cheapest hard drive prices for each capacity from newegg. 1.5 TB is still the sweet spot. The slope is much steeper too making 1.5 TB extra sweet. The $/TB went down about $15 from two months ago from ~$80 to ~$65.
Putting Octave Plots in LaTeX
I like vector based formats for my plots if the data is vector based. I input png and pdf to latex. I can output png, eps and pdf from Octave. The problem is that the pdf outptut has extra whitespace. To get around the whitespace, I can copy and paste into powerpoint and save as pdf with a specific page size or I can do the following.
Plot the figure with size on paper set
> fh = figure(‘papersize’,[6 4],’paperposition’,[0 0 6 4]);
Output as a colored encapsulated postscript
> print(‘-depsc2′,’figure.eps’)
Turn EPS to a PDF with proper size. You can edit the pdf later if need be.
$ ps2pdf -dEPSCrop figure.eps
Add figure to paper with proper size
\includegraphics[width=6in]{figure.pdf}
References
ps2pdf bounding box & page size problem – LinuxQuestions.org
LAPACK
Posted by admin in Computer Science on March 29, 2010
$ cp make.inc.example make.inc
$ make blaslib testing
$ make
http://icl.cs.utk.edu/lapack-forum/archives/lapack/msg00046.html
add current directory to library search path
$ gcc -L . -lm -llpack file.c -o executable_file
DSL Video Streaming
The cheapest DSL from AT&T is limited to 768 kbps for downloading. They call it broadband, but with all the video content on the web now, I think people need more bandwidth. If I max out the DSL video streaming, then I can do 128 kbps audio and 640 kbps for video.
Lossless video
I like to use Big Buck Bunny, because it is completely free in terms of copyright and licensing. All the source files are provided, so you can generate an arbitrary resolution movie. Thankfully xiph.org has taken the time to render all the frames in 1080p in an uncompressed png format. The audio is also offered in 5.1 lossless flac format.
Here’s a test run for the first 15 seconds of the movie into a completely lossless ffv1 video codec and flac audio vodec avi.
$ ffmpeg -t 15 -r 24 -f image2 -i BBB/BBB-1080-png/big_buck_bunny_%05d.png \ -i BBB/BigBuckBunny-stereo.flac -vcodec ffv1 -s 1280x720 test.avi
The result however is difficult to play, because of the immense amount of data that needs to be read off of the hard drive. I need to try reading this off a RAID or a solid state drive.
video stats
- frames: 14315
- fps: 24
- duration: 9:56.5 minutes
- bytes for video (uncompressed): 89,050,752,000
- bytes for frames (lossless compression): ~30,292,344,000
- bytes per frame (uncompressed): 6,220,800
- average bytes per frame (lossless compression): ~2,116,100
- video bitrate (uncompressed): 1,194,393,600
- video bitrate (lossless compression): ~406,296,196
audio stats
- 48000 Hz
- 24 bit
- bytes for stereo audio (uncompressed): 229,040,000
- bytes for stereo audio (lossless compression): ~150,000,000
- audio bitrate per channel: 1,536,000
- audio bitrate per channel(lossless compression): ~1,005,900
| Uncompressed | Lossless compression | Lossy compression | |
| Video (mbps) | 1,194.4 | 406.3 | 10 |
| Audio (kbps) | 1536.0 | 1005.9 | 192 |
It’s a factor of 3 to go from uncompressed video to lossless, then another factor 0f 40 for lossy.
It’s a factor of 1.5 to go from uncompressed audio to lossless, then another factor of 5 for lossy.
Video might have compressed more since this is a computer generated animation. 90 gigs uncompressed to 30.5 gigs lossless to 800 megs lossy. lossy compression is very important if you want filesizes to be manageable. I have to applaud the creators of these various codecs for being so effective. If I actually tried to encode the video with a lossless codec (ffv1), I would probably get more than a factor of 3 compression.

