Wrapping up 2008

It’s that time of the year, where one reminisces, remembers, recalls, regrets, reflects, and other activities starting with re’s. I was going through the posts I wrote this year, and some of the posts made me react with “Huh, I wrote that?”, “What was I thinking?!” and other epic reactions. So here are some of the posts, and if I can remember them, the unsaid reasons for writing them.

The post on Fibonacci sequence and its relation to the golden ratio was quite popular. It still comes up in search results every now and then. The story of the thriving rabbit population came from a childhood encyclopedia (yes, I still have the entire set).

The barber paradox is one of my favourite concepts. I read about it when flipping through my university textbook on logic. Basically, if you hit a stumbling block in your logic, you might find that challenging your original assumption reveals the answer to the stumbling block.

In May 2008, I managed to dupe persuade Guy Kawasaki into including me in the Programming section of Alltop. That was awesome, since I was trying to improve awareness of my blog and the concept I’m pushing for (multi-disciplines). Getting listed helped.

I also created a new site called Ragnarok Code. It was meant to be a code playground for me. I do a lot of .NET work and I want to do some stuff that I can’t on this blog (though there are ways to get around my PHP problem…). Wanted to code something with Silverlight and I never really got to it… That said, check out the OpenStreetMap application by Philip. It’s totally awesome.

Then I tried my hand at mixing storytelling and puzzles with the Mind Trap series. I planned for 5 parts, but failed to find interesting puzzles to weave into the story. In the end, I only had 3.

Alas, the full story of our trapped hero Ryan may never be revealed…

I also started a mini-series dubbed “Please ConvertToEnglish()“. It’s a play on the .NET functions such as Convert.ToInt32() and so on. What I had in mind was to explain certain code or human behaviour (mainly because of code) in simple English. I don’t see an end to it, since I draw inspiration from what I encounter… *smile*

There’s something else that came up often in my search results: The puzzle on 7 points and 6 lines (and the 2nd solution with corrections from a reader, Eric).

Then came the first (known) hack attempt on my blog. It was targetting SQL Server, so I was safe… I think… That analysis involved the use of a few pieces of information.

I also had a visit from Raymond Chen for something I wrote about rotating a matrix, which is different from a rotation matrix. Read the proof by Mathew which is simpler than mine, and it even looks like what I would write on paper with all the subscripts and superscripts.

My next embarrassing public humiliation was when I asked for advice on field of view (FOV). I was called on my article by two people no less (thanks to David and Jason aka xero)… That article sprung up from a university assignment, and was one of those questions where I never really got an answer. Like the one on using pointer arithmetic instead of array syntax. Wait, I didn’t write about that one…

In October, I wrote what I think was my crowning achievement then, the article on the use of bilinear interpolation in image rotation. It required the combination of a few pieces of information to work:

  • Knowledge of raster, Cartesian and polar coordinate systems
  • Linear interpolation and as a corollary, bilinear interpolation
  • The “direction” of assignment

Strangely, the post on the digital clock puzzle came up moderately frequently in search results. I guess a lot of people were stumped… Great answer by Steven, though I couldn’t award him any prizes. I’ll have to get my hands on some noteworthy gifts…

I also started to get involved in the Singapore social media slash blogging scene. Got to know some really nice people, and there were also a few programmers too!

Then I tackled the hitherto unimaginable math problem on swinging doors. It was interesting. It was spontaneous. It was … alright, I was a bit bored. I also made a major mistake while discussing that, which I corrected with another post. Talk about barber paradoxes…

I finally came to terms with the lengthy name of my blog, and shortened what I am to being a Polymer. I still want to publish something more on it, maybe a manifesto. Still collecting my thoughts on this…

And I was a guest in a Tech56 podcast, a local production about technology and general geeky stuff. I was also at their 100th episode celebration/podcast event.

On the topic of podcasts, I submitted a question which was answered in Stack Overflow podcast episode 33. I asked for an opinion on reducing costs (in a software business, since Jeff and Joel probably won’t know much about the industry of the company I’m working at). In summary, the answer was to stop worrying about reducing costs and start thinking about increasing value.

Recently, I talked about digital image processing. It was something I wanted to write about for a long time, but never really got down to it. I also didn’t do justice to the topic, and I originally planned for something more fleshed out. I’ll leave it as it is till I can’t stand it anymore and I’ll follow up on it. And that image processing course I took was one of the most interesting classes in my entire university life.

And that’s 2008 for me. Have fun with the rest of December, and I’ll see you next year.

Christmas equals Halloween

You might already know how Christmas is equal to Halloween. You don’t? Well, I came across this some time ago, and it took me a few moments to figure out how Christmas can be equal to Halloween. Now, let me prove to you the truthfulness of that statement.

We have Christmas on 25 December. Let’s put that here:
DEC 25
= 25 [let’s focus on the day, ok?]
= 24 + 1 [it’s obvious I know…]
= (8^1) * 3 + (8^0) * 1 [some fancy arithmetic]
= 31 [of base 8. Much easier to work with than base 3]
= OCT 31 [let’s use the short form of octal]

Wait a minute, OCT 31 looks awfully familiar… Hey it’s Halloween, which falls on 31 October! Thus is Christmas equal to Halloween.

Q.E.D.

Alright, in case you’re not following, the “proof” transformed Christmas and Halloween into their date representations. The date representations happen to be of the form “base-short-form number”. So Christmas became decimal 25, and Halloween became octal 31.

Here’s a lesson to take away. Sometimes, the problem you’re working on is easier to solve when it’s transformed into another representation. For example, rotating an image is easier when you transform all the coordinates from raster to Cartesian to polar, and then rotate in polar coordinates. Or change a colour in RGB format into HSL, so you can change colour just by varying the “hue” part.

That’s it for now. Happy holidays!

Matching textures with heuristics

I was in my 4th year in university. The course was on digital image processing, touching on both theory and application in equal measure. There were only 3 students, including me.

The course was interesting, albeit mind-numbing when some of the equations march into the lecture. The programming assignments were more fun, since we got to apply the theories. One of them was a rotating-an-image assignment, which formed the basis of my bilinear interpolation code. That was fun.

There’s this assignment where the professor gave us a set of texture images as samples. I can’t remember how many there were, so let’s say there were 200 of them. Then he gave us, say, 50 images. The assignment was to match those 50 images with the controlled set of textures. All textures were greyscale to simplify the assignment.

The 50 unknowns didn’t match pixel for pixel with the controlled samples. But they were of the same texture. For example, the controlled samples had one of marbled floor. One of the unknown images was taken with that marble floor, but in a different position. Of course, the professor could have given us red herrings to match, but he said all 50 were taken from the sample set.

Then there’s the fact that he wanted to play with his new camera back then (he admitted to it), and took lots of pictures to give us as assignments… There was an assignment with a picture of a rubber ducky…

I can’t remember exactly all the tests I used to match the textures. What I did was come up with a theory/test, and compute that test for all the samples. Then I did the same thing for the unknown textures. Then I match the unknowns with the knowns. If they were within some threshold of acceptance, that unknown texture was deemed matched to the respective sample texture.

Basically, I’m matching the textures using heuristics.

One of the tests used histograms. Basically I charted from 0 to 255 the number of pixels with a specific greyscale value. Pure white pixels have a value of 255, and pure blacks have 0 value. Then I matched the unknowns with the samples using mean squared error. If the sample matched with the least error was less than some threshold I set, then that sample was the matched texture.

I had another test involving Fast Fourier Transforms (FFT). I think I discarded the complex values and matched the unknowns using the real values part.

There’s another test involving median filtering. The idea was to capture the groups of neighbouring pixels as some usable data. So instead of a 128 by 128 pixel sample, I reduced it to a 16 by 16 matrix. You know, this one’s a bit iffy… I can’t remember whether I actually did it, or I just came up with it writing this…

Anyway, there’s a test to capture “pattern” data. The histogram test involves all pixels. The median filter test (if I actually did one) cluster pixel information in groups. Let me see if I can explain this better…

Marble texture

In the image above, the top right corner has more black swirly thingies close together than other parts of the image. The histogram test cannot detect that the top right corner has more black. It can only detect how much black in total there is in the image. Positional information is lost. Hence the need for a pattern test.

The histogram test is objective. Test results are verifiable and repeatable. However, matching the unknown textures require that I set a threshold. This is where the tests become subjective. Who’s to say a particular threshold value is more accurate than another?

In the end, I think I had 5 or 6 tests, and gotten a 94 (or was it 96?) percent accuracy. I was tweaking my threshold values so I could yield higher accuracy rates. See how subjective those tests of mine were? *smile*

The programming language of choice was MATLAB (yes, Will?), as dictated by the professor. So everything was coded in MATLAB. Which was good, because I’d hate to implement FFT on my own…

There’s something else too. I weighted those test results. Say test A was supposedly more accurate than test B. Then I gave the results of test A more weight in my final calculation. Thus, roughly speaking, if 3 tests out of 6 say texture A was the one, then that’s the one. It could also mean 2 tests had more sway if both carried high weights, and the other 4 tests weren’t conclusive enough.

One of my classmates got higher accuracy rates (97 or 98 percent) than I did, no matter how much I tweaked threshold values and weights, no matter how many kinds of tests I added (or took out).

But here’s the thing, and I want you to note this. Given a larger sample size, and a different set of unknown textures to match, my set of tests might actually yield better results than those of that irritatingly smug classmate of mine.

Here’s another takeaway. No one test can conclusively confirm and match the unknowns (even with some error margin). It took a few tests working in concert to obtain a relatively high accuracy rate. Think about that.

Digital image processing is mostly for aesthetics

I intended to write an explanation of some digital image processing methods, followed by the point of this article’s existence (see title). Since I can’t remember much about the topic already, I rummaged through my pile of stuff to find my university textbook. Found it, and skimmed over the content pages to see what I needed to research on.

I am ashamed to say, I have forgotten a lot about the topic already… This is hard! There’s graphs, functions, formulas, integration, summations and matrices.

The book is “Digital Image Processing” (second edition) by Rafael C. Gonzalez and Richard E. Woods, published by Prentice Hall. Unfortunately, it’s not for sale in USA, Mexico or Canada, so if you’re from those countries, sorry. But it’s really good.

[UPDATE: Commentor Will has pointed out that Gonzalez’s and Woods’ book is in fact available in the United States. Go get it.]

Anyway, I was planning on stunning you with my brilliance on histograms, median filtering, Gaussian blurs, pixel neighbours and the like. Sadly, I’m woefully ill-equipped to do that… At least, not without doing some serious reading and research first. Well, I can’t do that and still write about it in one night.

But I want to tell you about something my professor said. There are many things we do to process images. We apply median filtering to remove noise. We do some operation to sharpen images and blur them. Images can be modified to black and white, or set to a faded tone to simulate old photographs.

There are other kinds of information we can extract after processing images, such as detection of edges, shapes and even faces. But as far as I can tell, they are mostly subjective. Subjective because it is up to us, humans, who finally dictate whether the final image is what’s required.

For example, noise reduction. Simply put, image noise is the small specks of “something” in the image. They could be caused by an inferior camera, or simply because of the environment (such as in space images). Median filtering means for each pixel, check out the neighbouring pixels, and if they are mostly of one colour, then that’s the “correct” colour to be.

But there are different strengths when applying the median filter. The software cannot tell you how strong the filter should be. It can guess, it can have default values, it can apply the strength most commonly used. But it’s ultimately up to the user to decide when enough is enough. Perhaps at the highest strength, the algorithm produces an image that’s somehow pleasing (or useful) to the user, even if that result isn’t what the user wanted originally.

And this was what my professor said. Image processing is mostly about aesthetics, digital or analog. Digital computations just make it faster and easier to play around with the images. You can physically process images to produce sepia tones. Or you could do it digitally.

I’m introducing the concept of image processing because I have another story to tell you. And it’ll make more sense if you know about image processing first.

Have you written code to do image processing before? Please share your experience with your comments.

Thoughts on Stack Overflow podcast 33

I submitted a question to the Stack Overflow podcast, hosted by Jeff Atwood and Joel Spolsky, and it’s answered! Hear about it at podcast 33. I’m at around the 49m50s mark. I sound only marginally better than the Tech65 podcast I was in… So some thoughts about the discussion in the podcast…

24 by 7 on call

For a period of time in my programming career, I was to be available, 24 by 7, to attend to some rare disaster in the unlikely event that critical programs failed spectacularly. Usually it’s a program malfunction or data problem. When I first received my pager (yes, it’s a long time ago…), I was apprehensive. I placed it on a stool and moved the stool beside my bed, just in case I couldn’t hear the beeps when I was asleep.

After a while though, it turned out that the crises were critical, but not that critical. I could still attend to them the next day. The staff on shift duty would page me, and all they really needed was for me to tell them that the error was duly noted, and that I’ll attend to it the next day.

And being the dedicated fella that I am (was?), during one such fine day, when it was a public holiday, when my home country was celebrating her birthday, I returned to the office to attend to one such error after receiving such a page. *bows floridly*

Killer triggers

I agree with Joel Spolsky on this. Triggers should never have been invented. I’m maintaining an application that relied heavily on triggers to do business logic. I’d be firing some innocuous insert statement, and many other tables get updated.

This gets very irritating when you’re testing out code, and you need some data in that first table. It gets worse when you factor in foreign keys and so on… It’s a nightmare…

The only reasonable use for triggers is for logging an audit trail. Even then, I believe SQL Server has in-built capabilities to do that, so you don’t need to create an actual table to store the audit logs. Too bad I’m using Sybase…

That favourite word

It’s just an observation. Alright, I get a little irritated about it. I find it pathological that Jeff Atwood has a pathological fondness for the word “pathological”. There. Although, in his defense, he didn’t use the word in the last couple of podcasts. Some of his blog posts on the other hand…

There was a period of time, when the programming sites I visited had a fad of using the word “egregious”. It means bad, like what-in-tarnation-were-you-thinking bad. Usually used in the context of WTF-like code. Perhaps the programmers felt a need to exert their linguistic capabilities…

If you watch travel documentaries, you might have come across Samantha Brown. I love her Passport to Europe series. She too, has her favourite word. It’s “quintessential”. As in “This is the quintessential town”. I started watching out for when she uses the word.

I’m starting to do that for Jeff and “pathological” too. You know, that’s pathological of me… let me go find something better to do. At least I listen to the podcasts in a safe environment. Jeff nearly killed someone who was driving.

Chop off their heads

He looked cautiously around, examining every little detail in the room. Each step he took was slow and calculating. His eyes stared at the space above the floor, as if he could see the passing of his quarry through that very space. Raising his right arm, he negligently rested the head of a blood-stained axe upon his shoulder.

He stood still. A drop of blood dripped from the axe for what seemed an eternity, and splattered the floor. He turned, and light glinted off the axe where it wasn’t bloody. A gasp escaped from the closet. He grinned, and shrugged the axe onto both his hands.

He’s cold-hearted. He’s cruel. He’s a murderer.

Axe on chopping block
[image by Geoffery Holman]

No, I’m not writing a horror story. That wasn’t quite scary enough. Although what I’m going to tell you is frightening enough… It was a dark and stormy night… uh…

It was some data patching task. I was to delete some data from a table. I entered the SQL statement

delete from ImportantTable

and promptly executed that statement without providing the where clause!

Oh in the name of all that is good! My heart was pounding like I just finished running a marathon. My hands started sweating. I felt a heat spreading from my neck to my head. “What have I done!”

Luckily, I was using TOAD, a user interface for accessing Oracle databases. And in Oracle, as much as I hate it, any changes to database tables are not committed till you specify it so. There’s a commit button in TOAD. You can also type in “commit” and execute that.

So what I did was roll the changes back, with a handy “rollback” button. Whew…

Like I said before, I prefer any SQL statement I execute to be, you know, really executed. I’ve had experiences where I was debugging my web application and was wondering why the data wasn’t refreshed. The select query using TOAD returned the correct set of data. Why wasn’t the web application doing so too? Because the changes in the database weren’t committed. A waste of 2 hours of my life…

But that’s with Oracle. The other databases aren’t so forgiving. But I like that. Anyway, from then on, I’m very careful about executing update, insert and delete statements.

Still, that wasn’t enough for my paranoid mind, oh no no no. What if I need to have several statements on screen, and a few of them are updates and deletes? Perhaps you would suggest commenting them out. Well, in Query Analyzer (of SQL Server), all you need to do is highlight the statement and you can execute only the highlighted section. If you don’t highlight the commenting syntax (2 dashes or 2 forward slashes), the statement gets executed.

Well, this won’t do at all. So I came up with a fail-safe method; I chopped off the heads of any SQL statement performing “dangerous” operations. So all my “dangerous” statements look like this:

nsert into ImportantTable
values('CODE0001','Very important code')

pdate AnotherImportantTable
set id_desc='An alternative description'
where id_code='IMPT0001'

elete from SuperImportantTable
where price < 500

I add the appropriate header alphabet when I'm going to execute the statement. After execution, I lop the header alphabet again. This leaves the statement still on screen so I know what I did. And in the unfortunate event that I accidentally execute the entire statement when I wasn't supposed to, the execution will fail, because the statement isn't properly formed.

So that's my method of handling SQL statements. When in doubt, chop off their heads first.

Deciphering column types in design documents

When I first started working, I’ve never even heard of design specifications. The few sentences of a programming question for a university assignment barely made it as design requirements. I think the longest description went slightly over half a page, and that’s because it was explaining some scientific logic behind the question.

So when I was first handed the design documents of an existing application system, my eyes kind of glazed over the arcane language… The first few pages were usually full of important-sounding sentences but really means very little to the programmer. Well, most of it anyway. They’re about how this application was to do X, because Y happened and Z wasn’t very happy about it, and application A could almost do the same thing except for condition B.

It wasn’t a critical period when I joined the team, so things were a bit quiet and I had time to learn. Have I told you I didn’t know a single thing about SQL at the time? I was picking that up too.

Flipping through the pages, I found a table describing column information. There were input files, and that table described the columns in the file. This was a few years ago, so the input files were what was termed “flat files”.

Each line in those files were of a fixed length, and each column occupies a specific position and a specific length in a line. The usual line types were the header, trailer, and data. The header and trailer lines were usually shorter than the data lines.

The header probably contains information such as

  • Timestamp of file (usually just the date it was generated)
  • Name of file
  • Application code (not our kind of code. Short acronym identifier of program)

The trailer probably contains information such as

  • Number of data lines (for reconciliation purposes)
  • Sum totals of stuff (monetary amount, duration and so on)
  • … you know, I think it’s usually just the above 2

Now the data lines were more interesting. They were loaded into the database, so the columns in the file usually match closely to that of the database table. Here’s where I both learned to read design documents and file formats, and picked up SQL all at one go…

Here are 2 examples:

9(8) with comment “ccyymmdd”. It means “8 numerals”, and the comment hints at … ? Century, last 2 digits of the year, the month, and the day.

9(6) with comment “ccyymm”. It means “6 numerals”, and I’m sure you can figure out what the comment means.

The “9” is a notation used to denote digits or numerals only. The number within brackets denote the number of digits. Let’s try…

X(9) which means 9 alphanumeric characters.
X(57) with comment “filler”. It means … ? 57 alphanumeric characters, probably just spaces because this column is a filler.

I have no idea why “X” denotes alphanumeric… For that matter, I don’t know why “9” is used to represent digits too. As for the filler column, remember the header and trailer lines? They are shorter than the data lines, so a column is specially made so that each line, whether it’s a header, data or trailer line, can fit snugly into one line. No, XML wasn’t invented yet… I think.

Now for some obscure ones…

9(7)v99 which means there are 7 digits, followed by 2 digits.
9v9(5) means 1 digit, followed by 5 digits.

If they are all digits, what’s with the weird notation? The “v” means there’s an implied decimal point. So “9(7)v99” means a number which is up to 7 digits long, followed by 2 digits representing a number (below one) up to 2 decimal places.

Confused? “9(7)v99” is equivalent to numeric(9,2) in SQL-speak. 1234567.89 is an example.

So what’s the implied decimal point for? If I understand it correctly, the notations came from programming practices in COBOL, and the banking industry was making use of flat files to transfer data around. Since transmitting data was expensive (they didn’t have 500 gigabytes of hard disk space then…), every single byte counted.

Since it was understood that the figure in that particular column was a money value, the decimal point was taken out to save space. Tada! Instant saving of, I don’t know, tens and hundreds of kilobytes. And that practice flowed to other industries.

It’s a good thing my current team uses notations such as “char(8)”, “numeric(15,2)” and “int” to define column types. Hey wait, those look familiar…

Rotate backwards to stay level

It was a university programming assignment. I was to write an OpenGL program to render a Ferris wheel. The requirements were simple. There had to be 7 spokes emanating from the centre, each at an equal angle from each other. At the end of each spoke, there was to be a carriage. No outer rim was required. All 7 spokes and 7 carriages were to be simple cuboids. The wheel was to turn slowly. Colour aesthetics up to the individual.

I’ve already had lessons on simple rotation and translation operations in OpenGL. Ambient colouring, materials and shading were also taught. And simple cuboids were like basic rendering stuff.

The hard part that my fellow students found was in keeping the carriages level, while rotating the Ferris wheel.

My professor, being the evil mind that he was, chose 7 spokes, so the angle between each spoke was “weird” (no nice number). Believe it or not, that confused a heck of a lot of students… Rendering the spokes were easy. Render a long cuboid with one end at the origin, and rotate multiples of 360/7 degrees. The carriages on the other hand, needed some work…

A simple way of orienting the Ferris wheel is to align it with the XY plane, with the centre of the wheel at the origin. There are then 2 methods to render the carriages. The first is to calculate the XY coordinates of centres of all the carriages, and simply translate them there. Yes, there will be sines and cosines in the calculation. I’ll leave it to you as an exercise. If you were able to follow the article on bilinear interpolation in image rotation, you can do this.

The second method is to just use the rendering engine’s in-built functions. For example, you render a vertical spoke with one end at the origin, and the other end along the positive Y-axis. Then you render a carriage at the latter end of the spoke.

Then what do you do? Render the 2nd spoke-carriage combination exactly the same as the 1st, but rotate the whole thing 360/7 degrees clockwise. Here’s where the problem comes. Since the carriage is “tied” to the spoke, the rotation operation affects the carriage as well.

To keep the carriage level, you have to undo the rotation operation. How do you do that? Rotate the carriage in the other direction with the same angle.

Let’s leave the spokes out of the picture. To render a carriage in the correct position, at the correct angle, this is the series of steps to take (assuming the carriage is at the origin):

  • Rotate -i * (360/7) degrees (anti-clockwise)
  • Translate len units in positive Y direction
  • Rotate i * (360/7) degrees (clockwise)

where i is the number of multiples required, and len is the length of the spoke.

If you’re following this with OpenGL or DirectX, take care. That series of steps have to be reversed, because the 2 rendering engines apply the transformations in reverse order.

Hmm… that was a long story…

The one about chicken heads

Did you know chickens have this ability to keep their heads stable, even if their bodies are moving? Check this video out.

I believe chickens use a similar principle as discussed in the Ferris wheel. For example, if a chicken’s body was moved forwards (in the direction of its head), to keep its head in the same position, it has to move its head backwards.

A fluttering thought

To stay the same in the face of change, one must replicate and execute the change in the opposite manner.

Sort of like Newton’s First and Third Laws combined.

I was just thinking, in the face of changes in these times, staying the same is actually more tiring than going with the flow. I mean, you expend the exact same amount of effort to stay the same, and you have to expend more to improve (on business, on technology and so on). That doesn’t quite make sense…

It’s a cliche, I know, but the only constant in life is change. Expect it. Embrace it. Besides, staying the same is boring at some level…

A simple experiment

To convince yourself of the “backwards” principle discussed in the rendering of a Ferris wheel, try the following.

  • Stand up straight, face and body forwards
  • Turn your body, from the shoulders down, clockwise
  • You must keep your head still facing the same direction as at the start

Did you have to turn your head anti-clockwise to keep facing the same original direction?

Guest on podcast about Windows 7

Recently, the Tech65 team invited me to talk about Windows 7 on their podcast. I thank them for letting me join in. It was a fun experience.

I’m saying it right now; I’m not an expert on Windows 7. I follow the developers’ blog. I read Raymond Chen’s blog. That’s about the extent of my knowledge on Windows development (7 or not).

The reason I’m invited to the podcast recording was I saw a Windows 7 demo, presented at a PHP Meetup (thanks Michael for inviting me!) at Microsoft Singapore. And that I follow the Windows 7 developers’ blog. And that I watched a video of a Windows 7 demo at the PDC.

If you haven’t already clicked on that link to the podcast, here it is again:
Tech65 podcast – Windows 7

I was just listening to myself in the podcast and I found that I spoke too softly, compared to the rest of the team. 1 minute in and I couldn’t bear to listen anymore… I was terrible! I was nervous! I need more practice… In the meantime, I’ll stick to writing stuff here…

There were 3 Tech65 members at the podcast. We were recording at Geek Terminal, a cafe geared for uh, geeks. There were power sockets practically everywhere, to make it easy to power up laptops, notebooks, netbooks, Mac books and what-not. I was the only one without any fancy gadgets. Does a mobile phone count?

Anyway, it was a short discussion on Windows 7 (about 10 minutes or so. I didn’t count. Too embarrassed to find out where my part ended. Luckily, show notes are provided). Then the team moved on to other technological and gadget news. There were 2 other pieces of information I wanted to share, but the opportunity didn’t present itself. I even had accompanying funny lines to go along with the tidbits.

The first one is that in Windows 7, you can drag a document to the extreme left and the document automatically resizes to fill the left half of the screen. Then you hold onto another document and move it to the right and that document fills the right half of the screen. It’s to make it easy to do comparison of document content. Plus dragging windows around is fun, because I like to move it, move it!

The second was about quick focusing of windows. Suppose you have 5 windows open on the desktop. There’s one particular window you want to work on, and you want the other 4 windows to be minimised. All you have to do is grab hold of the title bar of that window, and Shake shake, shake shake, shake it! and the other 4 windows shimmy to the taskbar. Want them back? Shake shake, shake shake, shake it! again.

*Cue tumbling ball of dried roots in barren wasteland. Cue squawking crows.*

You know, it’s a good thing I didn’t try to crack jokes at the podcast. I would have failed miserably… If you have anything to say regarding the Windows 7 information I gave (perhaps I was blatantly wrong and I don’t know about it), please send in comments here, or do so at the Tech65 post.

Autonomous intelligent loading of scene objects

Is slow loading of scene geometry still prevalent? I’m not sure. Based on some observations of mine on the current games (console and computer), it seems that huge scenes with many complex objects are rendered with nary a hitch.

I remember when cutting down the number of polygons of an object was necessary to quickly load it and render it. This was why viewing volumes and fog was used, to provide a better experience for the player. Is this still critical?

I was thinking, if this was still an issue, what if the commonly rendered objects were preloaded? Suppose there are a few towns in the game. If the player frequently travelled between towns C and E, it makes sense to preload the objects between towns C and E, so rendering them is faster.

It doesn’t make sense to load every single object in the game into memory. But frequently loaded objects can be loaded first, even if they aren’t always rendered. They are just more frequently rendered when the player plays the game.

This “frequency habit” is captured by the game. So each player has a different “frequency habit” list saved. Thus the game seems to be intelligently “guessing” where each player is going to go, and automatically and quickly rendering the scene.

This can apply to applications too. It’s even implemented already. The history list of a web browser. The recent list of documents.

I’m not sure if this has any impact or usefulness. I’m just sharing an idea that occurred to me. I’d appreciate it if you could share your thoughts, particularly if you’ve been developing games or had solved similar problems. Or if object loading was even a problem. Thanks.