Saturday, December 29, 2012

The Wake

My martial arts teacher studied under his own master for more than thirty years. His master died on Christmas day, and I attended the wake three days later.

Apparently, when someone dies the Chinese purchase paper models for the deceased to use in the afterlife. I saw a paper house, big and palatial, too big to fit through the door. There were even paper vehicles. Inside, there were people busily stamping paper with a gold rectangle in the middle. I was told that this represented gold; here, it was paper but on the other side it was the real thing. It all struck me as not about saying goodbye; it was like the deceased decided to go to a faraway place to live a new life and everyone in the family was helping to make that new life as comfortable as possible.

We weren't supposed to say goodbye when it came time for us to leave; I was told by my teacher that if you needed to go, you didn't need to announce your intention. You just left. What a wonderful tradition, I thought. At any point, life consists of comings and goings - and even at the wake of family they do not forget this. Those who are here now, look twice and see that they are gone: those ghosts from a person's past, come together this one time to reminisce and to grieve.

It did not feel like how the wake of a great warrior should be. There were no dire portents. I passed so many people going on their own business and I remember thinking - Don't you know? A real martial artist just died. A wonder just left this earth, and you didn't even know. He was lucky to have had the opportunity to study the things he mastered. He was crazy enough to surpass his own teachers. Will we ever see anyone of his like again?

I saw a lot of authentic martial artists in the time I was there. They had strong handshakes and sturdy frames; even there they were still talking about martial arts. It's an honor to have been invited to join them.

Friday, December 28, 2012

Playing with Fullcalendar


The Fullcalendar jQuery plugin is great to work with, it has so many features and I became amazed at how much work must have been put into it. I've had occasion to use the plugin and encountered a particularly thorny issue about selectively getting the date to change color, like the example above. What made things difficult was that each individual cell of the calendar did not have a unique id. Furthermore, the calendar uses the same cells for each month, so each changed cell had to be returned to normal before new information could be rendered. The plugin was being used along with the viewmore code; it was really tough finding a way to make the effect happen but a solution was eventually found. For this, I really have to thank Mr. Vishal Jadhav for pointing me in the right direction (you can see his blogs here and here). The code though didn't work as is so some tinkering had to be done:


The properties of each event object were set and the whole list was passed through JSON from the Controller; the event title property was used to set the markup of the event. The script would search for calendar events with the holidayRemark class, then figure out which cell in the calendar the events fell on; after it did that the script would then add the holiday class, which would turn the calendar cell's date and text red. Mr. Jadhav actually does a better job of explaining how the solution works, and you can view that here.

Now, in order to remove the date colors when the user cycles between months a rather inelegant workaround was used: see, each cell has a class .fc-day#, where # is a number from 1 to 42. The date number is in a div with class .fc-day-number, the div in turn is a child element of the div that has .fc-day#. We just put a for loop in the section of the viewmore code handling cycling between months, removing the holiday class from the particular .fc-day-number div. The code is below:


As I recall, this was around line 74 of the plugin code. As a final reminder, please be informed that the calendar renders incorrectly in Chrome because the browser orders the events based on the start and end properties of each event. Events which have the same start and end time get rendered in the proper cell, but in what appears like random order (more information here). My workaround was to add the index of the event from the list that came from the database to the minutes of the start and end date of the event; if additional entries need to be added that have to be below that specific event, one can add an arbitrary number of seconds to the start and end properties.

Lastly, here are the holiday and holidayRemark classes used:

.holiday
{
    font-weight: bold;
    font-style: italic;
    color: Red;
}

.holidayRemark
{
    font-style: italic;
    color: Red;  
}

UPDATE: Mr. Jadhav's work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported license. Clicking on the link will take you to the page listing the license's terms.

Thursday, December 27, 2012

So I've been playing around with Eric Hynds' Multiselect Widget and I've encountered a pretty interesting situation that I think deserves mention. What the widget does is it hides the select tag and replaces it with a button, and it also appends a list of links that display the options in the original select list (this is of course a simplification, but for our purposes we just need this much detail). The widget provides links for a Check All and Uncheck All of the options, but in my case the page always scrolled up when clicking the links. It was most likely a result of the widget interacting negatively with the other stuff in place - the project was using MVC 3 and a host of other plugins/scripts/etc. As a workaround, I decided to overwrite the native code for the click event, but as it turns out the list of links that the widget appends to the body doesn't provide the div with an id attribute; worse, unlike the demos Mr. Hynds has on his site the appended lists weren't anywhere near the select list. I wouldn't be able to specify the parent-child path for the jQuery code.

I initially used the .ui-multiselect-all selector, but that posed more problems since I had two of the multiselect lists in the same page, and both used the same set of classes. Investigating the code provided a possible solution: in hiding the select list the code made use of an el variable, which was provided with a title property. The title property can be set in the select list.

So in the code, I added an id attribute for the menu that had a value equal the the title of the select list:



Then, I just needed to add a title attribute to the original select list:

<select id="selectID" class="classes" multiple="multiple" title="titleForMenu">
.....................
.....................
.....................
</select>

And now I had the proper id attributes to distinguish between the two multiselect lists' Check All and Uncheck All links.


$("#titleForMenu .ui-multiselect-all").click(function() {
     $("#titleForMenu .ui-multiselect-checkboxes input:checkbox").attr('checked', 'checked');
     $("#selectID").multiselect("getButton").text($("#titleForMenu .ui-multiselect-checkboxes  
                input:checkbox").length + " selected");
     return false;
});

$("#titleForMenu .ui-multiselect-none").click(function() {
     $("#titleForMenu .ui-multiselect-checkboxes input:checkbox").removeAttr('checked');
     $("#selectID").multiselect("getButton").text("Select options");
     return false;
});





Wednesday, December 26, 2012


I am now on my second run-through of Hitman: Absolution. I'm playing on Normal, and this time am particularly focused on getting Suit Only and Infiltrator challenges. At times I find myself wondering why I'd want to replay the same missions; even though getting things perfect seems reasonable, we are talking about a video game here. And each mission can't be completed without several hours of grief - that is if you're really talking about being perfect.

My standards have gone down a bit since playing this game. It's a consequence of having been a Thief player. I want to "ghost" through the entire level - nothing moved, nobody knocked out, nobody killed except for the target, no disguises, no NPC becoming suspicious. Just relying on timing to move through the level provides for great amounts of frustration until one accepts that the designers probably didn't design the thing that way. It's taught me much about patience and focus, playing as a bald genetically-engineered super-assassin; not to mention it's a pretty good distraction. So much so that the game has started to really eat into my training time so now I'm cutting back; thirty minutes a day should do it. Even then my mind occasionally strays, especially on some of the stickier points of execution.

For example, I've been recently trying to find a way to get the evidence in the Barber Shop part of the Shaving Lenny mission. On Normal, the evidence is on top of a widescreen TV that has four people surrounding it. Depending on which entrance you take those four may be joined by two more people, standing behind the four at angles that overlap blind spots. Beside the TV are stairs that lead up to an open area that has three hostiles, two playing pool and one seated to the side watching the other two. There is a room adjacent to the TV that opens to stairs; lingering on the stairs will invite an alarm as you are still within the line of sight of at least one guard.

The TV is up these stairs, to the right.

The answer, which I found after nearly sixteen hours of trying (I kid you not), was to leave a bomb that you start the level with in one of the upstairs rooms. Detonate the bomb once there are only six people in the room (which means you need to eliminate the two targets and subdue Lenny/wait for him to go on patrol first). Doing so will make them all look in the direction of the blast:



When this happens, take cover at the side of the leather chair that is closest the doorway beside the TV.


From here, and this is vitally important, WAIT. Usually, only one guard will run up the stairs, followed by a second or two before some others follow. This is the best outcome, and you can then go take the evidence, go back to that precise spot for cover, then walk through the door you came out of. However, it is still possible for all of them to start going for the stairs, and this is why the cover is important - you might get accidentally spotted so it's best to hang back and change your avatar's placement depending on who gets a whiff of you. The absolute worst scenario is if the guy who was sitting on the chair you're hiding behind turns around. In that case you have no choice but to reload - you only get one bomb, and any of the other incendiary devices in the level can't be detonated remotely. Not unless you're a good shot and can shoot a petroleum tank near the rooms I was talking about on the second-floor walkway from the first floor after distracting the NPC who'll be otherwise looking directly at you while you're aiming.

That was just for getting the evidence, by the way... Completing the other level objectives would take about the same amount of time to explain for each goal. It would be so much simpler to kill everybody in the building, and I myself am not proud to say that I copped out on my first playthrough and took the easily accessible Barber disguise. I guess to someone who's more used to the conventional type of games they would think that this is a whole lot of bother, and it is that, oh my yes. But the Hitman: Absolution world is quite a well-designed, complex one, and playing with that world is tons of fun. Take note that I used the word complex - there's a lot of rules that are not immediately apparent when you start out, and even with a thorough exploration it's still possible for the game to surprise you. A group of NPC's might move to investigate the sound you made, but they might not move in the order you saw on your last game, or maybe only a couple might move since the object you lobbed bounced after it landed.

To other beginner players - yes, NPC's will stop at the place that they last detected made sound - whether it be at the spot you suddenly stopped running or where that screwdriver landed after it bounced. Typically, the closest NPC will move to investigate anything less than an explosion - and for the purposes of keeping your sanity remember that when bouncing things off walls the thickness of the wall may as well be zero to the NPC you're trying to lure. )

That kind of randomness is something quite familiar. Difference being, when we screw up we can just reload the game; and with the game, we are very sure that we can win, by definition. Sticking to a higher standard seems easier then since the stakes aren't really that high.

Thursday, December 20, 2012

Imagine an office worker coming home after work. It's been a long day and though the job is bearable it's still work. He's looking forward to a simple but hearty dinner and time to himself until he sleeps and wakes up the next day. He seems like he's walked that same route for years. He walks alone at a steady pace. He doesn't notice the light turn green, he just walks when the vehicles disappear. He sees her, and it is a classic double take; she's talking to someone on her phone and isn't paying attention either. And somehow, she sees him. Those seconds were so long to him; were they the same for her?

She looks down, and a half-smile appears. Time restarts.

She smiled.


Sunday, December 16, 2012

There was a point when I had really begun to believe that all the amazing things had already been discovered,   that there was no more place for Thomas Alva Edisons in this world. A recent browse through a science magazine's archive of articles changed that - there were so many breakthroughs that occurred recently, it's possible that by the end of the current decade the face of the world would be completely different again. I say again because I managed to live through the technological revolution that started in the 1990's.

Perhaps it wasn't much of a revolution for most, but it was certainly an upheaval, those days: from having Internet service that you had to plug into your phone line and that gave that distinctive sound when connecting to 3G and WiFi technology. Cellphones, come to think of it - from blocky monsters that you could brain someone with to sleek multi-purpose PC's-in-a-pocket. I lived through the World Wide Web becoming a well-designed commercial sphere from its humble beginnings as a collection of static, painful-to-look-at pages.

There was a lot to create and find out then, and there is so much of the same going on today. Humanity is on a great adventure right now. Yet it seems like most of us are just along for the ride, and the reason I thought that there were no more Edisons was that they were too beyond me to be seen.

These people who have mastered their fields and open up new frontiers... how hard must they have worked for that privilege. How lucky they must have been to have things open up for them. How talented they must be, to recognize the opportunities come their way and make something out of what would ordinarily defeat others.

Mastery. It gives special powers over things pertaining to one's field, but is so difficult to achieve. I've read (and-re-read) Robert Greene's new book on the subject, hoping to find that moment of clarity by which one can establish structure to the chaos that is a life. I would recommend it to anyone, it is quite a good read; he has very reasonable things to say about developing oneself. But I do have misgivings: mastery is certainly something to aspire for, but I wonder if it is an automatic purveyor of fulfillment.

Reaching the pinnacle of your art requires so much sacrifice, and even then there is no guarantee that what you attained would affect anyone, much less last long enough to do so. Bruce Lee, for instance, died so young - what would his legacy have been if he did not have students like Taky Kimura or Dan Inosanto to continue his work? It's part of a trend in the martial arts - within any art's history you would see a handful of martial luminaries who are remembered and venerated by the later generations of students. No one seems to remember much about those who came between, those masters who bridged the gap and passed on their knowledge to the next generations. I suppose they would be of import in the sense that remembering their names helps establish the lineage of a teacher...

Even if you had the resources and luck to be the very best, there is still the question of whether it can support you, to pursue mastery of that area at all.

Mastery is a solo enterprise in the early phases of development, but it seems to me that upon reaching journeyman status the pursuit of mastery ceases to become an individual undertaking and more of a social one. A master's work must call to people, and people must in turn provide feedback to the master about his work. A master's work is never done, in that he must constantly strive for improvement; in this constant change it is still quite possible to deviate, no matter how old a hand one is. "Count no man happy until the end is known," and perhaps the same thing applies for mastery as it does happiness.

Saturday, December 15, 2012

I have been playing the Hitman: Absolution game the past month and just finished the story mode today. I've been a fan of the series since it began; I've played every single game, several times for some of them.

The first time I saw Hitman: Codename 47 it was the last disc the store had on stock. It was for display purposes since the game was already scratched. I had a choice between buying this or Thief: Gold; at the time I was looking for a new game to play and had fallen in love with the idea of stealth games. I would play Thief later on.

There is something about stealth games for me. I suppose at first it was being a cool character temporarily, being able to wield amazing toys and being scarily competent with them. The first stealth games were quite influenced by the standard first-person shooters, but had this twist - you had to figure out the line of sight of the target, get into a good position, not be detected, etc. It made for frustrating trial-and-error, especially later on when statistics got to be added to the mix. At that point "perfection" became of paramount importance.

I just wanted to play Hitman: Silent Assassin on a lark, just to see how things changed from the original. The missions were more interesting, the story was quite engaging enough to make me want to keep playing on. That game was what got me thoroughly hooked. In contrast, Hitman: Contracts was a slight letdown; I've only played it one-and-a-half times. Hitman: Blood Money was a joy - and that is all I have to say about that, it's just that good.

I've gotten so old, haha... the concept of Downloadable Content is so new to me. Hitman: Absolution is a different experience for me as well. Agent 47 moves so fluidly now, hiding behind things was so awkward before. He makes you feel even more like an elite operative. You can see where the development team tweaked the features that made Blood Money what it was - throwing things is not a hit-or-miss operation now, and NPC's reaction  to sounds are more natural (as well as easier to base strategies around). The whole thing has shades of the cinematic, and the range of what 47 can do has become so great. The HUD and player prompts have also been upgraded, but still betray their connection to Blood Money.

Far from its FPS roots, Hitman games have become more exercises in puzzle-solving. You explore the world and notice elements, evaluate them and figure out the proper execution of events to do something like get that final piece of evidence or get the body to that storage container at the other end of the level... There's minimalism involved as well - how to do it in the least time, without hurting or pacifying anyone other than the target, while affecting the environment only in the slightest. Hitman: Absolution surprised me in that there's a bit of improvisation involved - sometimes NPC's don't behave the way you expect them too, or they behave too erratically and you have to adjust. Maintaining cover against hunting enemies could be a minigame in itself.

There's a lot to master and do in the game, and I look forward to playing it over and over in the coming months. It's certainly given me an interest in learning about actual escape and evasion tactics.