Dec 26, 2010

Google Spreadsheet + Apps Script = Best Task System Ever

Probably it's same for a lot of people out there.  I always have a lot of chores to do by certain date and I always wanted to have a good program which keeps track of my task list with deadline.  Also it should notify me a daily or weekly summary, preferably via email.

So I've tried a bunch of different things, including GMail Tasks, Google Calendar and some mobile apps.  But neither of those satisfied me. For example, with GMail Tasks, you can't set up email notification, so you will have to remember to open your task list regularly to see if you have anything due this week.  (and trust me, you will always forget it..... well at least I did) With Google Calendar, you can set up email notification, but it makes your Google Calendar looks so messy if you also use it for your personal calendar and you can't easily get a nice list of all the TODO list which you can easily sort in any way you want.  With mobile apps, .... uh..... I'm just not so much mobile phone person and I hate to enter anything on mobile phone.  Gimme a nice full-size keyboard. Then my chubby fingers will be happy...

So with all this failure, I actually gave up.  And I decided to put all my tasks in Google Spreadsheet, instead.  If I had to regularly open a webpage to see my tasks, I wanted it to be just a Google Spreadsheet: I was ready to suck it up.  But later I found there's something called Google Apps Script which allows you to write a JavaScript code with Google API Accessibility.  With this, you can access any of your google docs and do whatever you want to do.  You can even run the script on scheduled time.  So I just made my own script which goes through all the tasks in my TODOs spreadsheet, and emails me the list of tasks which are due in 7 days(or already due in the past).  I get only one email per week, but I can easily change it to daily notification if I see the need.

This is the most efficient personal task program(?) I have had used so far.  It doesn't require me to open a program or go to a webpage to see my task list: all I need is just my webmail account open, which is the case most of the time anyways.

Sometimes, it feels so good to be a programmer lol

Steve asked for the script.  So here it is.  First, the spreadsheet looks like this:

Note: you can put "done" for tasks you've finished.  These tasks won't be included in your digest email.  Or just delete the row once you are done.

Now the script:

function todoAlert() {
  // tasks due in these days will be shown
  var days = 14;  

  var date = new Date();

  var key = "YOUR_SPREAD_SHEET_KEY";
  var docLink = "" + key;
  var sheet = SpreadsheetApp.openById(key );
  sheet.sort(2, true);
  var range = sheet.getDataRange();
  var data = range.getValues();

  var upcoming = "<h3>In " + days + " Days</h3><ul>";
  var nodate = "<h3>No Dates</h3><ul>";
  var sendNodate = false;
  var sendUpcoming = false;
  for ( i = 1; i < range.getLastRow(); ++i )
    var task = data[i][0];
    var deadline = data[i][1];
    var status = data[i][2];
    var deadlineDate = new Date(deadline);
    // empty
    if ( status != "done" )
      if ( deadline <= 0 )
        sendNodate = true;
        nodate += "<li>" + task + "</li>";
      else if ( deadlineDate <= date )
        sendUpcoming = true;
        upcoming += "<li><b>(" + (deadlineDate.getMonth() + 1) + "/" + deadlineDate.getDate()+ ")</b> - " + task + "</li>";

  upcoming += "</ul>";
  nodate += "</ul>";
  var text = "";
  if ( sendUpcoming )
    text += upcoming + "<br/>";
  if ( sendNodate )
    text += nodate;
  // if set to true, only logger message
  var debug = false;
  if ( text.length > 0 )
    text += "<a href='" + docLink + "'>See TODO List</a>";
    if ( debug )
      MailApp.sendEmail("", "TODOs", text, {htmlBody: text});

You need to fill in YOUR_SPREAD_SHEET_KEY and YOUR_EMAIL_ADDRESS.  You can find the key from your spreadsheet's URL look for "&key=blaablaablaa".  Once you add this script in the script editor, you just need to set the trigger.  That's it.

Dec 17, 2010

Merged 2 Blogs Together

I have been maintaining my professional and personal blogs separately for a while.  The main motivation behind this decision was to prevent people from thinking I'm unprofessional after reading my personal blog because I don't live up to other people's fake professionalism.  Also I'm a bit of emo which people don't expect from a professional software engineer.  I was not really afraid of what other people think: I just didn't wanna waste my time to explain.

But I found it was more time-wasting to keep two blogs.  So I merged those two into one, so this blog won't be only focused on game coding anymore.  At least I made new categories called Coding and Personal, so use them to filter out what you are not interested in.


Dec 12, 2010

Opening Questrade Account

So I've finally decided to open an account with the cheapest online broker in Canada: Questrade and I was really surprised how easy it was.  (one of the reasons why I finally did it was to shuffle around my TFSA as suggested by this article) It was 2 years ago when I opened an online brokerage account last time with ( now ) and it involved mailing of an application form and a void cheque.  With Questtrade, I was able to use e-signature and online banking bill payment service, instead.  I still had to send my photo ID, but Questrade accepts any document through their file upload system, so I didn't have to send anything via mail!  It is definitely the kind of service I love to use!  (I prefer to deal with business through email and web than in-person... too much hassle, you know)

So I was able to open my account in 15 mins without dropping anything to the red post box! That's exciting.  I'm not sure how I would like Questrade compared to ScotiaiTrade, but according to MillionDallarJourney, it seems promising.  (Oh also there is $50 coupon on that web page, so if you want to sign up, make sure you take advantage of it).

I'll keep you posted how I like Questrade.  (well, I can't help but ranting here if any company sucks, anyways :P )

p.s. btw, don't get confused.  This is not QTrade.

Dec 10, 2010

Coincidental Agreement

It always surprises me how multiple people can come up with same idea independently.  I've always thought that I think independently free from other people's or media's influence.  For that reason, I have very different moral standards from other people.  For that reason, I have very different views on a lot of things.  I think I'm right, but I don't necessarily think other people are wrong: it's right for me, and I don't care what it's for other people.  After all, I'm very individualistic.

The book I'm reading, or listening to, nowadays is Atlas Shrugged. And I'm very surprised to see there was someone (read it as author) who shared same thoughts with me 55 years ago.

Seeing people can come up with the same idea independently, current patent system doesn't sound right...

Aug 17, 2010

Most Obvious Keyboard is Not Available?

As a computer programmer, I use computer keyboards pretty much anytime when I'm awake.  And it's absolutely blowing my mind that there is no perfect keyboard for what I want out there.

A standard 101(or 104, or whatever) keyboard takes up too much desk space and not so much ergonomic-friendly.  You really want your G and H keys in the middle so that you can type the keyboard without weirdly tilting or bending your body.  At the same time, you don't wanna stretch too far right to grab and move mouse.  But, can you do it with a standard 101 keyboard? Not really. If you center align your G and H keys, your keyboard sticks out to much to the right because of those arrow keys, home/insert/pageup-n-down keys and keypad.

Can I live without these arrow keys and pageup/down keys?  No.  These are the keys I use all the time, so I need'em.  What about numeric keys on numpad?  Oh yeah.  I don't really use them.  So if I can find a keyboard without the numpad, probably I can be ergonomically happy.

So is there any keyboard out there offering this simple demand?  Not really.  Most of keyboards without the numpad have one(or more) of these problems:

  • the size of key is smaller than standard (84 mm, I believe)
  • the layout of keyboard, especially arrow keys and pageup/down, is different from the standard.
  • they are wireless.
The only keyboards that do not have the above problems are Microsoft Sidewinder X6 and HP Modular USB Spanish Keyboard Assy.  The HP keyboard is Spanish, so it's out of question.  And Sidewinder X6 is like $60 because it's branded as a gaming keyboard with lots of macro keys and not-so-useful functionalities for me.

Seriously... Can I just have a full-size keyboard with standard layout minus the numpad.. Am I asking too much?

Jul 27, 2010

This and That: Future Graphics in Games

Some interesting game-related news that I've ran into for the last few weeks:
  • Crytek's talked about Future Graphics in Games:  It's interesting to see how they are already using Sparse Voxel Octree in CryEngine 3.  Remember? John Carmack from  Id software once talked about this technique about 2 years ago?
  • Hansoft 6.1 is released: I had chance to use it for a short period of time under a scrum setting and I really loved it.  This is the best project management program I've used so far.  So give it a try.
  • Lagoa Multiphysics engine is teased: I have ran into this teaser video for very amazing physics simulation engine.  Although it claims it can be used in game, I'm a little bit skeptical at this moment without any further information.  But I'll definitely stay tuned.
  • Autodesk bought Beast tech: Autodesk has been trying to increase their presence in gaming scene and I think this is possibly one of the smartest buy-out for them.  (well at least smarter than their AI middleware I think.)  Anyone wanna play Mirror's Edge?  :P
  • Nvidia Parallel Insight is released: it promises so many things it seems.  But the only thing that really catches my eyes is shader debugging in Visual Studio.  I haven't tried it yet, but it sounds useful.  Hope I'd have chance to try it one day. 

Jul 7, 2010

This and That: Video Game Optimization

  • NVIDIA Texture tool 2.0.8 is released: Do I see anything special? No.  I really wish they would re-implement the sharpen filter, which used to be available on Texture Tool 1, soon.  It's scheduled to be done in version 2.2. (who knows how long it will take though?)
  • GPU Pro is out.  I heard this will replace the long running ShaderX series.  The name is little bit snobbish, I think. :)
  • Eric, the author of Real-Time Rendering, recommended this book, Video Game Optimization.  I'm not aware of any book which is dedicated to video game optimization.  So I'll surely check it out sometime soon
  • Python 2.7 is out.  Despite of C#'s growing popularity I believe people still use Python in game industry?  So enjoy.

Jun 21, 2010

This and That: Dark Art of Shadow Mapping

Jun 11, 2010

This and That: Use Decals to Crash Your Car

Some recent interesting news and stuff:

  • July 2010 issues of Game Developer Magazine has an interesting article on Decal Tessellation:  The author's showing off how to crash a car with this type of decal.  You need DX11 for this.
  • There are 3D gaming pushes from both PS3 and X360: I don't see it getting bigger than a small niche market any time soon.
  • If you are using PCF filter for shadow map.  This is a great reading on how to make it faster by using deferred shadow mask. However, I don't agree with the measurement on the paper since the scene used for benchmarking is fairly simple and half of it is just pure sky.  I wish it had more realistic measurement with typical game scene
  • Seth Gordon shares his opinion on Hourly Work vs Linchpin Work: He says "if there are no short term substitutes, then you don’t pay what the market will bear, instead you pay what someone is worth".  Hopefully this will give some lessons to game studio owners.
  • BC government finally passed tax credit for game studios(and for other digital media companies): It is 17.5%, which is lower than other provinces in Canada.  But it's definitely better than nothing and a good start.

May 26, 2010

Isn't Flash's Next Step So Obvious?

There has been a lot of cockfight between Adobe and Apple recently, and sure.. now we all know it's not about technology but about market dominance.  In summary, Apple blames Flash's stability and claims HTML5 is the future.

So to me, it's very obvious what Flash will do next.  Support HTML5 export from Flash designer suite.  Adobe was so close to make iPhone export feature happening anyways so doing it for HTML5 won't be that hard.  And since HTML5 is an open standard, Apple can't do anything about it: if anything is running on HTML5 that's it.

Also there is no good "graphical" HTML5 editors out there in market yet.  So Flash can be the first developer environment for both graphics and codes for HTML5 era.

Let's see if Adobe is smart enough to go down that path and not letting Flash die.

May 19, 2010

Template Designer Is Impressive

I've known that blogger introduced template designer a few weeks ago, and today I tried it on my blog here... and the result is very amazing.  I'm definitely pleased with it: it means I don't have to manually change anything in code level.

So how do you like my new layout (made in template designer)

Mar 14, 2010

Another Tax Return Done

Even with all those investment income, capital gains and employment income, it was such a breeze with Studio Tax.  It even supports NETFILE with no cost at all for individuals.  If you haven't, try it.  It's amazing.

Mar 3, 2010

Thoughts on Cloud Gaming

So it looks like cloud gaming service OnLive is getting more popularity.  I thought about this whole cloud gaming stuff while I was in shower this morning and I became to wonder what types of services can be on cloud.

Apparently OnLive is like this.  You have your controller at home.  Your controller input is sent to OnLive server.  Video and audio are streamed back to you.  So the only data packages transfered between you and the cloud are

  • controller input (very small data)
  • video (basically screen resolution x frames per second / compression magic)
  • and audio (sampling rate x bit per sample x number of channels / compression magic ).

So this is what determines if a cloud gaming service is viable or not:

  • Amount of data sent back and forth is well must be under what your internet connection can handle
  • Network latency should be not noticeable

Then what other cloud gaming services can we do?  Apparently OnLive is running the whole game on their side and stream only audio/video.  But it might be possible to run a very specific component of a game running on cloud.

How about physics?  Can we run very simple physics on your local gaming console, while running more complicated physics on the cloud?  Then if you are offline or can't get the result you want from the cloud in timely manner, you will just rely on your simple physics running on your own console.  On the other hand, if you can get all the information from your cloud physics server on time, you can use it and make your games look much better?

Maybe there might be too much data to be transfered for this physics system.  We might come up with really nice compression for this. (as if we did for audio/video)  No matter what I feel like there are a lot of small things we can run on the cloud.

Edit(June 30th, 2010):

Feb 2, 2010

Pre-multiplied Alpha

When batching particles in order to boost the performance, we usually make texture pages, or sprite sheets, (it is a giant texture which contains all textures used for the particles. you can easily use the sub images you want by playing with UV coordiate on vertex data), to minimize the number of draw calls.  However, you can go one step further and even batch particles with two different blend modes, alpha and additive blend mode, together and draw'em as one draw call.

That's when pre-multiplied alpha becomes handy.  I was planning to write about this, but Shawn Hargreaves already covered this topic a couple of months ago.  So here is the link.  Enjoy :)

Jan 31, 2010

Real-Time Normal Map DXT Compression

I had change to read this paper recently, and found it's really helpful, not just for real-time normal map DXT compression, but also for normal map DXT compression both for Tangent and Object space.

Jan 17, 2010

Wrote a Piece of Piano Music

I have been always driven by moderate creativity, which have been realized in the form of music or writing.  My recent retro-adventure is music.  So I have been playing piano for about 3 months now and I wrote my first piano song (well first song in the last 10 years, to be precise).  I'm pretty happy with it, and people around me like it a lot too.

I'll try to upload it one day once all the minor modifications I'm adding are finalized.

So finally I uploaded it.