Jim's Blog Ramblings about novels, comics, programming, and other geek topics

29May/080

Free wi-fi from at&t

Google AdSense

Starbucks (along with other stores) offers free Wi-Fi for Apple iPhone owners, but there's a simple trick that you can do to emulate the iPhone on your laptop. Just install User Agent Switcher for FireFox and add the iPhone user agent string and then switch to that user agent and browse the Internet.

[Tip via LifeHacker]

You can use this tip at any at&t Wi-Fi spot such as Starbucks, Barnes & Noble, Coffee Bean & Tea Leaf, Airports, McDonald's, etc.

16May/083

IIS returns HTTP 404 for file downloads

Google AdSense

This is kind of an old issue, but since I mostly work on corporate projects, we're a bit slow on adopting new versions of anything.

I ran into this issue with Microsoft Word 2007 documents, but the same error will occur with any other file type that isn't properly configured on the web server.

7May/085

Iron Man (Movie Review)

As a sucker for Marvel movies, I couldn't pass up Iron Man. Even though I didn't follow the Iron Man comic books when I was younger, I was still familiar with the basic storyline and characters.

The movie starts off by changing some of the original story to a more modern day story involving Tony Stark (Robert Downey Jr.) running into a few IEDs and his HMMWV convoy getting attack in Afghanistan.

The original Iron Man story was written by comic god Stan Lee. Tony Stark was injured in a similar incident during the Vietnam War. He was also based on Howard Hughes. In his early years, instead of fighting terrorists, Iron Man focused on fighting communists.

6May/08Off

How to set variables in a DOS for loop

I unexpectedly ran into this issue. Thinking about how most modern programming languages work in relation to setting of variables, I forgot how older languages work.

In today's languages, you can simply do something like:

   int myVar = 1;
   for(int i; i<4; i++)
      myVar = myVar + i;

However, that requires the variable of "myVar" to be evaluated/expanded during the assignment. This is something we take for granted. If "myVar" is not evaluated/expanded during the execution, then the result will not take the current value of "myVar" into consideration during the assignment/execution.

5May/082

Monday’s Moment of Programming Enlightenment – Part 4

Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
-Jamie Zawinski, in comp.lang.emacs

This statement is an all-purpose adage that can be attributed to nearly any problem where the solution might end up just creating a new problem.

As a software engineer, developer, or programmer, everyone needs to realize that their solution might just end up complicating things and making a bigger problem or more problems than they started with.

References:
2May/080

Four pint principle

For years, [Garrett Oliver, brew master at Brooklyn Brewing in New York City and author of "The Brewmaster's Table"] has advanced the "four pint principle." "If you have one of my beers, I want you to want four pints," he said. "That doesn't mean you have to have four pints, or that you should have four pints. But you want to have more."

I've enjoyed the taste of good beer for a long time and there's a lot of good local breweries around San Diego. A few include:

1May/08Off

How to write a DOS batch file to loop through files

I used to write DOS batch files like this all the time, but after a while you start to forget the DOS syntax and the tricks. So this post is almost for as much for me as it is for anyone searching for how to do this.

The goal is to create a DOS batch file that can loop through a set of files and call another batch file or executable and pass the filename as the argument.

In this example, I'm going to use two (2) batch files, but in your real world solution, the second batch file might be an executable (.exe).