JF make 260
JF Nav
JF Nav
Creation Date: 2003-02-18
Exciting times here at AltSci. I wasn't able to do either Particle Works, polygon reduction in Terrain Works, or Collision detection this five day weekend, but the things that I did accomplish were quite enough. Today I was able to finish the tar and gzip support for AltSci3D. I got it to run using a data.tar.gz file. What was cool was the way I went about it. I wrote a very short testing program using my cpp_arg class and a TarFile class. int main() simply grabbed a tar, parsed it, and gave you the contents of the file you asked for. When I finished, I renamed it tcat. Why tcat? Have you used Linux before? There's a command called cat. It opens a file and returns the contents to the console. It's very useful, especially with the Linux console which is so mighty and powerful (specifically pipelines and in/output redirection). Well, there's also a program called zcat. It takes a file.gz and decompresses it outputting the contents to the console. It's very useful when you are using gzipped files. Why do you use gzipped files? That is the lesson for today, but not yet. Before I release it, I am going to get support for all files in the data.tar.gz file. That way the AS3D data is self-contained. What use is that? Say you want to show your AS3D manga to a colleague? Send him/her this one .tar.gz and then they can just drop it onto AS3D and it will show up. Currently it's kinda weird and stuff. Everything is relative path and it doesn't work unless you run it from the console in the directory above the data directory. Ugh, huh? Well, this will allow easy access to good directory structure. And since I still have support for files as it was in old, I think it will be good. Backup is good.

Gzipped files are useful because hard drives and intra-net-works have a maximum output of approximately 100 Mbps (12 MBps) with DMA _and_ one device at a time. Usually my DMA UATA/66 HD goes at 5 MBps. On the other hand, the RAM and CPU usually can do 800 Mbps average. Guess which you'd rather use? Even if gzip requires ten instructions per byte, it is _faster_. It doesn't matter that it is RAM rather than hard drive. What matters is that it is faster. If one person is loading something from his/her hard drive and you have compressed it, you load it and decompress it and it is on the screen before the other person sees anything. Compression is not always the best system, but for now, assume that it is. If something is uncompressed and not in RAM already, it is slow. So when someone says to you: "Don't compress that file, it will be slow loading," you after taking into account the compression ratio can tell them: "Not only do I save space, but I will gain a factor of four speed by compressing it." Lossy compression is usually far better at this. Ogg/Mp3 are good examples. CD Audio (44.1 kHz, 16 bits/sample, stereo) is 1378.12 kbps. Ogg/Mp3 are ~128 kbps. While they aren't perfectly lossless, they are quite acceptable (I almost ashamed that I trade quality for compression whenever I can even if it requires a large loss in quality). It's a factor of ten in size, so that translates in a factor of ten loading from disk. Then you have the decoding. How much does it take? Ah, but here is the really amazing part about compression! When do you need your compressed music to be compressed? When you need it, of course. For music, you need 44.1 k samples per second. If each sample takes 1,000 instructions, you need 44,100,000 instructions per second. Can your cpu handle it? Well, if your computer is 40 MHz, it can (486/66 anyone?). If your computer is a computer rather than a calculator, it can handle it very easily. There is a downside however. If it takes 44.1 Mips, what happens when you want to encode or decode a song as quickly as possible (non-realtime)? Let's do the math. A song is usually 5 minutes, so 44.1*5*60=13,230 Mega instructions. That means it will take your computer a few minutes. Ripping a CD takes a good fifteen minutes or so (since you have to load the uncompressed data from CD-ROM at ~36x). So one must sigh everytime they start ripping a CD. It is the uncompressed data that slows us down.

If the record companies would get on the ball and start offering compressed music on the internet, we might not rip them and trade them. But maybe if Saddam gave away his oil, we wouldn't bomb his country. ^_^ That's a good parallel, isn't it? "If you support P2P, you are supporting the war on terrorism!" Depending on whether you like P2P and whether you like the endless war with massive civilian casualties against an enemy whose only definition is 'evil', it could be bad or good. Think about that: if you like P2P and you dislike the war on terrorism (like me), you dislike my slogan because it is totally absurd to think that P2P is similiar to murder/genocide/grand theft/shoplifting/ip infringement. If you like P2P and you like the war on terrorism (eg. interesting+5/troll-1 on slashdot), you like my slogan because it makes sense that to root out terror and to free music goes hand in hand. If you dislike P2P and you like the war on terrorism (ie. my father), you think my slogan is insanity since P2P doesn't give people the money they deserve, while the war on terror gives everyone in foreign countries what they deserve: a quick death. If you dislike P2P and the war on terror (liberal libertarian ^_^), you think that my slogan is perfect, explaining how absurd both infrigement on profit and murder for profit are*. *Wait a minute... profit is good while murder for profit is bad? How does Ayn Rand resolve these issues? Ayn Rand justifies indirect murder (starvation) for profit in her book, Atlas Shrugged because those who are are in need (starving) hold no claim on the profit of those who earned it rightfully. Her characters simply go on strike which leads to the downfall of society which causes starvation. If the CEOs were to continue to live in servitude, people would not starve. By their refusal to live in bondage, their are indirectly murdering those who starve. Is it right? Does their ability imply duty to those who are in need? Does that mean that a person who has two arms and two legs has the duty to work his whole life until s/he dies? At what point does that person have no more duty to others? At 40 hour per week? Who decides this? Ayn Rand likens government mandate of this (income tax) to slavery because it suits her and it makes sense to those who slave away at a job knowing that half of their income is going to the government (and half of that is going to the military that is murdering thousands of people per year, by the way). So the questions I asked cannot be answered without personal opinion. Ayn Rand is correct in saying that she will not allow a government answer any of these for me. I will not allow anyone tell me the answer because just for me, one day the answer is yes and the next it is no. I have paid income tax once in my short life (in 1999, I paid ~$2000 income tax and ~$1000 Social Security on $9000 earned through hard labor, $1000 went to murdering Serbs in Kosovo which I am ashamed of). This year (2002), I won't even pay social security. Why not? Because I haven't worked for pay this whole year. For the first half of the year, my parents (capitalists in every sense of the word) paid for my food and rent. I thank them for their aid, I did not exactly earn what they gave me, so I know that supporting me was by their choice and shows the good nature of capitalists.

The second half of the year, I noticed that I was getting a lot of credit card offers. That's right, I'm currently playing the credit card game and let me tell you, I am winning. ^_^; Okay, maybe not. But the credit card companies have finally earned a deep respect from me. One of my favorite movies, Fight Club explains destroying the credit card companies will erase the debt history and will allow those in bondage to their life of 'luxury' be freed. Well... What if I'm not in bondage to a life of luxury in the first place? What if I want to live a life of freedom? What if I have no money? Well, the credit card companies are even more happy to give me money than my own parents. That's right! They've given me $6,500 this year compared to my parents who generously gave me $5,000. (Put your trust fund baby comments aside, 5G is lost in a sea of 15G I have paid and 15G I have on loan). So I am living free due to the "bondage" that the credit card companies gave me willingly, that I voluntarily took. So what are people whining about credit card bondage and wage slavery? They are explaining that they are living a life of luxury that they cannot afford that is subsidized by the credit card company. In exchange, the credit card company wants a hunk of change. To pay that chunk of change, they are forced to work as a slave to their rent, food, and luxury. Here in suburban America, wage slavery is a myth created by those who want undue power over business (socialists). In other countries and in some American ghettos, it is actually true that many people live in wage slavery which is 'unpleasant' to say the least. *nod* But if you want to blame wage slavery on someone, ask some third world governments what supports their existence (wage slavery, WTO, IMF, WB!).

And guess what? Capitalism holds the answer. I'm not going to give you the answer because I've given it on these pages of JF twenty or thirty times. Instead of searching JF, read some economics books. Look for competition and low-profit margin.
JF Nav
Home Characters Making Of Technical Mail News Links |< First < Prev Next > Latest >|  bandwidth version Goto Scene