Posts

Showing posts from December, 2006

Using "ls" in Windows

As my professional life moves into a more UNIX direction I have found myself more and more often trying to execute UNIX commands in Windows. One such command is "ls" - to list the contents of a directory. I know that cygwin binaries can be compiled for Windows to get ls functionality, but I decided to solve the problem a different way. I've written a batch file that wraps the "dir" command in windows. To work properly, both "ls.bat" and "getstrlen.bat" from an earlier post on this blog, will need to be present in your PATH. I don't have time to explain this code right now, but I will make an effort if anyone asks. ls.bat: @echo off if not "%1"=="" goto gotargs echo Executing: dir /b&dir /b goto done :gotargs set ARGS1=%1 set CHECK=%ARGS1:~0,1% if "%CHECK%"=="-" (set CURROPT=%ARGS1% & goto parsearg1) if not "%9"=="" (echo Executing: dir /b "%1 %2 %3 %4 %5 %6 %7 %8

How different is 1080i from 1080p really?

I've had a lot of people ask me about the new HD buzz words floating around on the Internet and in store ads. There seems to be a lot of confusion on the subject of whether or not 1080p is better than 1080i by a large enough margin that the discerning consumer needs to be careful of them. Most recently this question came in the form of an email, and I thought I'd share my answer. Question: What is the loss of quality between 1080p and 1080i? Answer: That actually depends on the source material and the monitor - it's a very complicated question to answer but all things being equal the loss of quality would be half of the horizontal resolution. Another way of putting it: 1080i: 1920x540 pixels displayed at once 1080p: 1920x1080 pixels displayed at once But this isn't an exact comparison. The Long Explanation: Video recorded natively at 1080i will be broken down into two separate fields (540 lines x2). One field (commonly called Field A) will consist of all of the e

String Length with Windows Batch

I've often found myself needing a reliable way to determine string length with windows batch files. I know there are probably add-ons or third-party solutions, but I prefer to do things with the base system whenever possible. Since I wasn't able to find any solutions, I figured I'd contribute one now that I've written it. This is my code, I don't care if you use it or what you use it for. I hope it works for you and if not, sorry. It relies on the set /a command, which I believe is exclusive to XP (it might work in 2000 but I no longer have a box to test it on.) getstrlen.bat: @echo off REM Sets the variable "strlen" to the length of the first argument. REM REM Usage: REM getstrlen  if "%1"=="" (echo getstrlen error: no argument &goto lengthset) if not "%2"=="" (echo getstrlen error: too many arguments &goto lengthset) set count=1 set strlen= :checklen echo>%temp%\checker.bat set STRING=%1 echo>>

Wii

Over the weekend of November 17th to November 19th, I was able to acquire both of the most sought after consoles, the Wii and the PS3. Personally I consider it unfair to compare the two because the PS3 is such a powerful beast, and the Wii is so much more fun. You can go pretty much anywhere on the 'Net and find opinions about the two systems, and this blog is no exception! I will, however, attempt to provide information that I haven't seen elsewhere. Due to a strange sequence of events, I actually acquired my PS3 later in the day on the same day I acquired my Wii. And since I'm an unapologetic Nintendo fanboy, I'm reviewing the Wii first. Nintendo prefers for some reason that the system simply be called Wii and not "Nintendo Wii". I'm sure it figures into the rantings of some social engineering plot designed to cement the system into the hearts and minds of the world, but it also saves me typing so I'm going along with it. While many people campe

Merry Christmas, scratch that, Happy Jesus' Birthday!

A couple of years ago when the traditionalists and Christians were really starting to get miffed about the politically correct neutering of Christmas greetings, I decided to try a reverse-psychology approach with a friend of mine. Knowing that he was a Christian and not at all bashful about it, I approached him in mid-December and told him "Season's Holidays!". He fixed me with a flat stare and replied "Happy Jesus' Birthday." to rhyme with "Tonight you sleep with the fishes." That is one of my most cherished Christmas memories.