|
THURSDAY, JANUARY 28, 2010
Is Factcheck.org not going to report on the State of the Union speech? Or, was the speech completely accurate?
I went to be about 20 minutes into it. My blood pressure was getting to high.
Posted by Chet at 10:07 AM1 Comment
FRIDAY, JANUARY 15, 2010
I went to Skycraft yesterday and got four things. A surplus LCD screen along with a "helper" board that I cannot figure out, a missile switch cover, a DC Jack (5.5 x 2.1mm) which fits the Arduino and lets me use a 9V battery, and a mono-multivibrator.
The multivibrator was sort of an accident. I was looking for a 8-bit shifter with ID# 74HC595, but I couldn't find any. I saw this chip with 74HC211, and hoped that since the numbers were close that they might be kind of the same thing. Nope, the 74HC series is a whole bunch of chips, so I pretty much had no chance of randomly finding a shifter. Anyway, I put the missile switch cover on my "nightplay distraction", AKA a camera flash. I soldered the DC jack to a 9V battery connector. Now I have to figure out how to get the LCD to work with the Arduino. I have read a lot about it, but have yet to build the circuit. It looks pretty straight forward though.
Posted by Chet at 4:19 PM0 Comments
THURSDAY, JANUARY 07, 2010
Ffmpeg is a program that sets you convert various multimedia file formats into other multimedia formats. For example, you can convert Ogg Vorbis to MP3, or back. You can convert avi video files into divx files, or back. There are dozens of supported formats.
The particular ability that I care about is converting m4a files to mp3 files. This is because iTunes provides m4a files, but my Sansa Fuse doesn't play them. M4a files are unprotected audio files, so it is pretty simple to convert them. I use something like this ffmpeg -i "input.m4a" -ab 256000 "output.mp3". This will convert the m4a input file to a 256Kbit mp3 file. The problem is that the metadata (title, artist, album, etc) is not converted in the process. However, I found a command line parameter that will allow it to do this. Just add -map_meta_data 0:0 to the command line (I usually do it before the output filename). There is another problem though. For some reason it maps the m4a "composer" field to the mp3 "artist" field, which isn't right. The biggest drawback to ffmpeg is that you, for the most part, cannot download the executable. It is only available as source code. I compiled the executable a few months ago but didn't have my development environment setup anymore. So, after much searching to see if there was a fix, I decided to install MinGW, MSYS, and the ffmpeg and mp3lame source code (using http://ffmpeg.arrozcru.org/wiki/ as my guide) on my machine and fix it myself. I don't know the "right" way to fix it, but the method that worked for me involved modifying the libavformat/mov.c file. In the mov_read_udta_string function is a mapping between the raw data "table of contents" and the human-readable tag name. In order to get the AAC decoder to give the tags to the MP3 encoder in a way that it would understand, I changed the key name. I changed "author" to "artist", and "year" to "date", since these are the tag names as MP3 knows them. I probably could have modified the libavformat/id3v2.c file to change the MP3 names into the AAC/M4A names, but I tried it the first way and it works. Now, I say that this might not be the right way because other downstream components (that I am not using) might not like the new tag names for the AAC format. But I don't care because it suits my needs.
Posted by Chet at 7:46 AM0 Comments
WEDNESDAY, JANUARY 06, 2010
I was reading the latest Gallup Poll questions for science. The second one is: "In fact, Charles Darwin is noted for developing the theory of evolution. Do you, personally, believe in the theory of evolution, do you not believe in evolution, or don't you have an opinion either way?"
This would be more accurate it is said that Charles Darwin is noted for developing a theory of evolution, and that it is a version that nobody (especially scientists) believe today. First, Darwinian evolution did not include genetics as we know it, he was only interested in natural selection. Darwin didn't know anything about genetics. Darwin's theory included pangenesis, as the method of transferring traits to offspring, which is no longer taught. The separation of natural selection with pangenesis and then combining it with Mendelian genetics is called neo-darwinism. This is what is taught in textbooks. Amazingly, many "godfathers" of evolution (Eldredge, Gould, Goldschmidt ) who wrote the textbooks do not believe that neo-darwinism works as a theory of evolution (mostly due to the fossil record). Punctuated equilibium is the most serious contender, with Hopeful Monster also considered a better theory when looking at the facts. All this to say, Darwin has become more of a mascot than anyone of substance. He didn't talk about the origin of species, but the survival of species. That is, he wrote about why certain traits continue and others do not--he did not write about how species came to be in the first place. Not only was his theory of speciation wrong, but so was the mechanism for trait transfer (genetics). What he wrote about isn't believed by any scientist today. So stop raising Darwin up as a hero. He was totally wrong. He replaced Lamarck's theory of evolution with something even more unworkable. You cannot even say that he provided the foundation of modern evolutionary theory, because modern evolutionary theory is punctuated equilibrium, not neo-Darwinism. If you want a good history of evolution from an anthropoligist, go to http://www.crownhillchurch.com/html/roger_chambers_audio.html and do a search for "evolution". There is around six (low quality) audio files there.
Posted by Chet at 3:36 PM0 Comments
TUESDAY, JANUARY 05, 2010
I did a Google search "php vs asp.net speed" just to see what they had to say. I don't really care since I use ASP.net exclusively nowadays. However, the first link had this to say:
"ASP.net is compiled into memory in binary code. So, when ASP.net is used for coding, it is evident that it takes much longer time to process since the codes need to be retrieved from memory. However, PHP is not compiled into memory like ASP.net is. It is interpreted at runtime. That is the reason why PHP coding leads to better speed and even efficiency. However, it must be said that both PHP and ASP.net can run at supreme speeds and efficiency when they are coded expertly." This makes no sense at all. It reminds me of Senator Ted Stevens calling the internet a series of tubes. Especially "it takes much longer time to process since the codes need to be retrieved from memory". Where else are the "codes" supposed to come from? Here is a very short lesson on interpreted languages vs compiled languages: Interpreted languages store the human-readable "instructions" *as is* in a file. The interpreter (like the PHP processor) loads the file into memory (it has to), then reads each line. Each line essentially tells the interpreter to modify its internal state a small bit (create a variable, add one to that variable you just created, write that variable to another memory location which will eventually sent to the client, etc). The interpreter does this by converting that instruction into a format that the CPU can understand. It does this on a line-by-line basis. The process goes like this: read line, determine what that line is asking for, perform the corresponding action, repeat. A compiled language converts (compiles) the file into a format that the computer can read directly (without interpretation) and this is stored in the file. When the program is executed, the entire file is loaded into memory (just like an interpreted language), but then it is run directly against the CPU. There isn't a layer there converting the human-readable instruction into a machine-readable instruction. Interpreted languages are notoriously and inherently slow. There is absolutely no debate about this. However, they provide big advantages in other areas:
There are surely more advantages, but none of them are speed. Now, ASP.net (really, any .NET Application) is compiled, but it is done so at runtime. This is called "just-in-time compliation" or JIT-compilion. The .NET "compiler" converts the human-readable source code into "bytecode" which is portable. This bytecode is then compiled to machine-code (not portable) when the executable is loaded. This load-time compilation causes the application to startup more slowly than a native application. People often use this as an attack on .NET's speed. However, they fail to realize that this speed hit only occurs when the application is first loaded. ASP.net web applications are loaded on the first request to a page, and then stay loaded. So, on a brute performance basis they are faster than PHP, which has to be read and interpreted line-by-line on every single execution of the page. So, the quote above is wrong on many accounts. ASP.net is not compiled to binary in the traditional sense. It is, however, converted to binary when the application is run. Also, binary code *always* runs faster than intepreted code. This notion that "it has to be loaded from memory" makes no sense. Both PHP and ASP.net have to be loaded from memory (the CPU can only read from memory). PHP has the added hurdle of being interpreted. ASP.net is the clear winner in brute performance, please check a good example of performance benchmarks. All this to say though, programmers don't determine which language to use based soley on speed. There is ease of use, how much the language provides "for free", how well it is supported, etc. According to the cited benchmarks, the only thing faster than ASP.net is C++/CGI. This makes perfect sense because that is bare metal. You also get nothing for free when you run C++/CGI. That article also says that PHP has very good support for object oriented programming but that ASP.net "is also very capable". This must be a joke. Just look at the PHP reference and you will see that it is driven by function calls. I am talking about what PHP platform provides, I know that you can develop objects in PHP. ASP.net is completely object-oriented. There are no areas that are not.
Posted by Chet at 5:46 PM0 Comments
Today Robbie is five weeks old. We are in the process of "weaning" him from the pacifier as a sleep prop. Basically, we let him fall asleep with it, but if it falls out it stays out and he can either fall asleep again, or cry. We check on him often while he crys to make sure he is ok. He is able to sleep well during the night well now (not through the night, he isn't old enough for that yet).
It used to be that we would have to hold the pacifier in his mouth, or keep getting up to put it back in. Now he just wimpers for a bit and then sleeps. However, at his 7:00PM nap he still crys. The last two nights he cried though the entire 7:00 sleep session. But when Amanda and I are ready for bed he does sleep, which means we are finally getting better sleep.
Posted by Chet at 10:35 AM2 Comments
FRIDAY, JANUARY 01, 2010
Looks like I haven't posted in a while. Amanda got me four things for Christmas
Two-way radio set ("adult walkie talkies"), ideally for capture the flag. Gettysburg, The Movie Star Trek TNG Season One. Brown t-shirt She probably also got me some small stuff I cannot remember, and candy. I got her some jewelry and MacGuyver season six, and some other miscellaneous stuff. My wife's family and we spent Christmas and News Years Eve at our house to make it easier for us. I pulled out my "marshmallow launcher" and fired it a few times just after 12:00AM (it actually shoots balls of duct tape since marshmallow is too sticky).
Posted by Chet at 12:46 PM0 Comments
|