Archive for the ‘Random’ Category

CSV file detected as SYLK file in Excel

Working on some CSV export code and encountered this weird error when opening the CSV file in Excel,

Excel has detected that 'test.csv' is a SYLK file, but cannot load it. Either the file has errors or it is not a SYLK file format. Click OK to try to open the file in a different format.

The file was certainly a CSV file; I had no clue what an SYLK file was.

The issue, as I discovered here, is due to the first 2 letters in the file being “ID” (which was the name of the first column); change this to something else (e.g. “Id”) and the file loads correctly without any warnings or errors.

Net. Flix.

Netflix CEO Reed Hastings on streaming content:

“We had set up the whole business essentially for streaming, but the network wasn’t big enough years ago,” he said. “But in 2005 we clicked on YouTube and watched cats on skateboards — and we thought, it’s here! Since then, we’ve had so much fun finally delivering on our name: Net. Flix.

The Craftsman

I loved the music in Unreal, Unreal Tournament, and particularly Deus Ex, so I was happy to stumble across the the website of Alexander Brandon recently. I love his work and enjoyed listening to the new music he’s posted to Bandcamp. Below is one track I particularly like.

For a bit of nostalgia, if you have Unreal, Unreal Tournament, or Deux Ex lying around, grab the Modplug Player which will allow you to play the umx files within the music directory of those games.

Todd Replogle interview

I don’t remember what I was searching for, but I came across this interesting interview with Todd Replogle, programmer and co-creator of the Duke Nukem series. The interview was done by Peter Bridger in December 2001, well after Replogle’s retirement from the industry in 1997.

Todd, how do you pronounce your last name?

Good question. The name originates from Germany, I think. The first syllable ‘Rep’ the ‘e’ is short, as in ‘rep’resentative. The next, ‘lo,’ is pronounced ‘low.’ The final syllable ‘gle’ is tricky. It’s pronounced ‘gull,’ as in sea’gull.’ Rep-low-gull. There were times when I was embarrassed during the first day of school where new instructors had a tough time pronouncing my name. Very embarrassing at first to hear my last name pronounced Rep’loogie.’ I often had to correct him/her. After the name sinks in however it seems the name ‘Replogle’ is difficult to forget once one hears it for the first time. Its uniqueness makes the name stand out from the rest, I suppose.

How’ve you been doing since Duke3D?

Wonderful! I found a small town in Oregon to live in, where I’m slowly buying up the surrounding land at fair prices. My goal is to dig several new home sites for families optimistic about the future, and for the elderly (who aren’t so optimistic.)

Do you still have that ‘I NUKUM’ licence plate?

No, the misspelled plate vanished when I sold the NSX. Lately I’ve been owning larger cars (without custom plates.)
Much more safer than a low-to-the-ground vehicle. I’d rather drive a car that’s taller than the tires of a big rig.

What stands out in your mind as a key moment, or moments even, of your time spent developing Duke3D?

Inventing/programming subways. I enjoyed laying the laser trip-mines along side the walls and watching the subway charge through the tunnel, setting each one off one at a time. Very cool to watch! I also enjoyed (and now miss) working with such an excellent group of people.

If you could go back in time now, with the knowledge you have now, what would you do differently in making Duke3D?

Hum, I’d have to say rework the sounds effects at higher sample rates (44khz) and have Jim Dose find a way to get the sounds effects to not sound ‘choppy.’ There was something about the sounds that didn’t seem right… I guess another issue would be in the actor AI field. After Ken programmed the DukeBot my actor AI seemed even more redundant and boring.

How easy was it to build on all the sound, control, weapons, monster etc.. code for Duke3D, on top of Ken Silverman’s BUILD engine?

Working with Ken’s BUILD engine was very simple to work with. Ken understands that interfacing with engine must be effortless, with routiens that are easy to understand and implement.

Are you surprised by the way Duke3D took off, both commercially and with the community?

No. I knew that both Duke’s smart mouth attitude, well-written/distinctive code and fun gameplay would take Duke3D to new heights with the video game community.

It’s June 1991, Apogee have just released Duke Nukem (the original side scroller), the sound effects made by Scott Miller. Should he write some PC speaker sounds effects for DNF?

HAHAHA! Speaker sound effects are only appropriate with computers lacking digital sound capabilities, something uncommon in all but the oldest tabletop PCs and laptops. Scott also did all level design for Vol. I of Duke I too. Scott and George, unlike me, are good level designers, and know what the customer wants with respect to puzzles and indepth gameplay.

Do you plan to get back into the games industry?

No. I’m not sure there is a future for the video game industry. Unless one has the capability of using both the left and right hands independantly, I doubt video games will sell like they used to.

If John Carmack called you up today, and offered you a job at id software, would you take it?

No. I’d be a tempting offer. Again, what is the future of video games? Oh BTW, John deserves credit for helping me code some low level code in Duke Nukem One. I’m not a very good assembly language programmer, and John was kind enough to help make Duke successful with well-written optimal assembly.

What are your plans for 2002?

Make money through property ownership and management, I hope. 馃檪 I also found a shifty way to take gold and silver away from the American public (including J.P. Morgan/C, Goldman Sachs) by both ‘shorting’ the metals market at the right time, then taking delivery during minor ‘squeezes.’ Paper money is not wealth, IMHO. I’d also like to raise a family some day.

Thanks for taking time for this interview Todd, happy Christmas!

Thank you Peter. Happy Christmas and a merry new year to you too.

Baidu Maps

Truly impressive: Baidu (“the Google of China”) doesn’t use satellite imagery for its maps, instead it uses isometric, Simcity-style sprites.

Baidu map of Shanghai

It’s beautiful to look at, and with the crystal clear delineation of buildings, roadways, and landmarks, it’s likely a very effective navigational tool as well. The sheer scale of this blows my mind. I can’t even begin to fathom how much time and effort went into creating this much artwork to paint an entire city.

Bing’s bird eye view is the only service I can think of that comes close to this, but is far from impressive at times,

Bing map of Shanghai

h/t ronnestam.com, VisualJournalism

#NewTwitter API

So a few interesting, or rather frustrating things, about the current state of the Twitter API.

I spent way too much time fucking around with a couple of PHP Twitter API libraries to do some automated tweeting. The change late last year of requiring OAuth authentication seems to have left most libraries broken. TwitterOAuth seemed to support OAuth and I saw it mentioned in a couple of blog posts, so I gave it a try. It seemed to work well and I got the access tokens, but subsequent requests resulted in a “Incorrect signature” error. So I used the Twitter class by Tijs Verkoyen, which did the trick.

With the new web client supporting media attach to tweets, I figured surely there must be some way to do this from the API. There isn’t. Only content from one of Twitter’s media partners is attached. The term “media partners” should have probably been a red flag to developers regarding the shape of things to come. To add insult to injury, the client-side code for this is ridiculously easy to extend (creating a new twttr.mediaType).

Finally, the recent announcement with Twitter coming out against third-party clients. I can’t say I’m surprised at all, especially as Twitter moves further towards selling ads and actually making a profit, for which they’ll need tighter control. Why third-party clients were allowed in the first place is questionable beyond it being a bait-and-switch tactic to lure developers and users. Personally, I use the web client, so I don’t care that much as a user and my recent development efforts have just revolved around server-side tweeting, so I don’t care that much as a developer, but to those burned I’d say suck it up and learn from it. Twitter, Facebook, bit.ly, whoever… pretty much every company out, they doesn’t make an API for your sake, but for theirs. Invest too much time, energy, and/or money and your almost definitely going suffer disappointment and betrayal. If your project is important to you, be ready to pull the plug and build your own platform or ecosystem; use them, don’t let them use you.

Quake 3

I have a bunch of old video game magazines I’m sorting through. I love the old issues of PC Gamer and it’s awesome to see some of the old ads and articles. Here’s a gem from the September 1999 issue:

quake 3 ad from Sept. 1999 issue of PC Gamer

I didn’t play Quake 3 until well after release, as the case is with most games I play, but for Quake 3 in particular I couldn’t play it until I got a Voodoo 3 as it required 3d hardware acceleration. I didn’t play online much, but I had a blast playing thru the single-player tiers. That said, I was disappointed with the lack of CTF, the dialog from the bots seemed stupid (attempting and failing badly to mimic how players talked online), and the lack of variety in level design was disappointing (transitioning only between the tech arenas and the hellish, fog-filled ones)… perhaps not an issue in multiplayer, but in single-player, the maps took a front seat to your soulless opponents. A solid game and great deathmatch experience nonetheless, but I remember playing Unreal Tournament much more, both online and off.

Flexible Binary Format

Another project I worked on a long time ago but never released. The goal of Flexible Binary Format was to create a file format and library for dealing with (tree) structured binary data (in the same vein of what XML does for textual data). This was a reaction both to the verbose and non-binary-friendly nature of XML and to the ugly chunk-based structuring done in many binary file formats.

The code for the C++ library is now up.

I’ll do a high-level, quick-and-dirty tutorial in this post to show how things work.


include FBF.h

#include "FBF.h"


Build a data tree

FlexibleBinaryFormat::DataTree        dt;
FlexibleBinaryFormat::TreeBuilder    dataTreeBuilder(&dt);


Attach a node to the data tree

dataTreeBuilder.AttachNode("root/vertex");


Make a vector of nodes and sub-nodes

dataTreeBuilder.AttachNode("root/vertex");
dataTreeBuilder.AttachNode(
"root/vertex");
dataTreeBuilder.AttachNode("root/vertex[0]/xyz");
dataTreeBuilder.AttachNode(
"root/vertex[1]/abc");

Note: We created 2 nodes on the same path (root/vertex). We access them individually using an index number within brackets.


Attach data to nodes

dataTreeBuilder.AttachDouble("root/vertex[0]/xyz", 0.12345);
dataTreeBuilder.AttachDouble(
"root/vertex[1]/abc", 54321.0);

Once data is attached to a node, you can’t attach a sub-node to it.
(i.e. data is stored on the leaves of the data tree)

The following methods of FlexibleBinaryFormat::TreeBuilder are available to attach data to a node:

  • AttachString()
  • AttachBool()
  • AttachByte()
  • AttachSByte()
  • AttachDouble()
  • AttachFloat()
  • AttachShort()
  • AttachUShort()
  • AttachInt()
  • AttachUInt()
  • AttachInt()
  • AttachUInt()
  • AttachLong()
  • AttachULong()


Write the data tree out to a file

FlexibleBinaryFormat::FlexibleIO    flexio(&dt);
flexio.WriteToFile(
"test.fbf");


Read a data tree from a file

FlexibleBinaryFormat::DataTree        dt2;
FlexibleBinaryFormat::FlexibleIO    flexio2(&dt2);
flexio2.ReadFromFile(
"test.fbf");


Read data from a node

double v0xyz = dt2.GetData<double>("root/vertex[0]/xyz", 0);
// second arg is always 0;
// arg is a leftover from some deprecated stuff in older versions and will be removed

Chicago

Photo by Mihai Iacob for the 2010 National Geographic Photography Contest,

chicago, photography by Mihai Iacob, 2011 National Geographic Photography Contest

I happened to be in the right place at the right time when I took this picture. The place was Nichols Bridgeway leading to The Modern Wing of The Art Institute of Chicago, with beautiful views of downtown Chicago, while the time was sunset. I love the architecture, the vibrant city life and the light, all captured in the same frame.

The last IPv4 blocks

A somewhat historic moment, the last IPv4 blocks were allocated to regional registries last week. We now move to IPv6 or the internet stops growing (well, sorta, putting aside things like virtual hosting, NAT, etc.).

last IPv4 blocks allocated