Visual Studio (2010?) Keyboard Shortcut Trick (ala Resharper F12 and Alt+Enter)

I used to code using Resharper previously and have gotten used to the F12 key to navigate to the next problem area / errors in my code and then pressing Alt+Enter to quickly fix the problem.

This is very useful and speed up my coding time considerably when doing TDD style development.

 

Missing Resharper in Visual Studio 2010, I was determine to find a way to replicate this.

After messing around a while with Tools, Options, Keyboard and Macro and what not, I found a way to do this.

It turned out my keyboard scheme was set to Visual Basic 6 for some reason instead of C# and the thing that I’m looking for was not bind to any key.

 

In C# scheme, the View.NextError command is bound to Ctrl+Shift+F12.

In VB6 scheme, View.NextError is not even bound.

 

After fixing the scheme, I was able to work much faster.

 

1. Code as usual per TDD, some squiggly lines will show up as you typed in class / method name that has not been defined yet.   Keep going until done.

2. Press Ctrl+Shift+F12, it will jump to the first squiggly.  Click Ctrl+. or Alt+Shift+F10 to show the smart tag options.

3. Choose the action that I want (Generate stub, etc.) and hit Enter.

4. Press Ctrl+Shift+F12 again to go to the next squiggly, repeat the process until I am done.

 

Awesome!!

emoticon

 

I might remap the keyboard shortcut to how Resharper setting (F12 and Alt+Enter).  So used to those settings and less keystrokes involved.

Share this post: | | | |
Posted by Jimmy Chandra | with no comments
Filed under: ,

if (you is CSharpDeveloper) Read(this) //Hidden Features of C#

public class CallToAction
{
    abstract class CSharpDeveloper { }
    class You : CSharpDeveloper { }
    string ReadTheContentOf(System.Uri url) { return string.Empty; }
    System.Uri URL = new System.Uri("http://stackoverflow.com/questions/9033/hidden-features-of-c");

    public CallToAction()
    {
        var you = new You();

        if (you is CSharpDeveloper)
            ReadTheContentOf(this.URL).AndLearnTonsOfStuffs();
    }
}

public static class MyExtensions
{
    public static void AndLearnTonsOfStuffs(this string input) { }
}
 
 
emoticon
”This compiles by the way.  It won’t do squat, but it compiles!!

Go spend half a day or a day and read that post, all the answers, the comments and the links within it.  I promised you won’t regret it and you might actually learn a thing or two about C# that you don’t know about.  I know I did.

 

Hint: the URL in the code above is actually clickable if you didn’t notice.  Or if you are hyperlink-challenged, you can cut and paste the following URL to your browser:
http://stackoverflow.com/questions/9033/hidden-features-of-c

 

Enjoy…

emoticon
Share this post: | | | |
Posted by Jimmy Chandra | with no comments
Filed under: ,

Currently Pondering On…

“New request is not allowed to start because it should come with valid transaction descriptor.”

"Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.”

“Internal .Net Framework Data Provider error 60.”

and…

“Object of type 'System.Decimal' cannot be converted to type 'System.Int32'”


Hmmm…

The first three has something to do with MSDTC, orphaned transaction and connection pooling I think…

The other one is really puzzling me.  I can’t think of anything that might result in that particular exception, but apparently something did…

My head is starting to hurt…


 

Need to figure out a different way to approach this problem…

Hmmm….

Share this post: | | | |
Posted by Jimmy Chandra | with no comments
Filed under:

Interesting JavaScript Optimization Pattern

Bumped into this a while back, but haven’t got a chance to use it so I sort of forgot about it.  It’s been floating around in the back of my mind.  I found this one pattern to be quite clever in helping with JavaScript function optimizations, especially when doing browser specific code and some other code that might only require a one time hit and sort of cache the result in the function afterward.

The code is as follow:

function A() {
    //Do some initial calculation of some sort...
    var returnValue = GetValueFromWebService("...");
 
    //Rewrite A to actually return the calculated returnValue
    //and stop going to the web service ever again
    //In essence, caching the inital returnValue for subsequent calls
    A = function()  {
        return returnValue;
    } 
 
    return A();
}

Very neat :)
Share this post: | | | |
Posted by Jimmy Chandra | with no comments
Filed under:

On Windows 7 RC (build 7100) 64 bits & Loving It!

I finally found a quiet time in my busy schedule to perform an upgrade on my Lenovo T61P work laptop.  I decided to give 64 bit Win7 another try.  Remember I posted a while back about being on Windows 7 Beta 64 bit and had some driver problems with it?  Well, I’m glad to inform you that I have all my peripherals working perfectly now under 64 bit RC :), including the ZTE 3G Modem, Fuji Xerox DC 236 printer / scanner and whatever else that thing can do, and my Gigaware webcam.  Woot!!

For the ZTE 3G modem, it’s as easy as running the software that comes with the modem.  This also applied to the Gigaware webcam.  Previously they weren’t recognized at all.

The network printer was a bit tricky since I had to manually installed it as an IP printer and chose the FX DC 236 PCL 6 driver to make it work.

Now… just need to get my RAM to 8 GB…

Share this post: | | | |
Posted by Jimmy Chandra | with no comments
Filed under:

Sprucing Up My Windows Mobile 6.1 Device (& Yours… Maybe)

Like many Microsoft employees, I was provided with a Windows Mobile device.  Mine is a Samsung Omnia SGH-i900.  Main reason for me to choose this from the plethora of choices of Windows Mobile devices was the huge… I mean HUGE storage capacity that comes with the device…. 16 GB huge :).  I chose a device with this capacity since I listen to a lot of podcasts and believe me, 16 GB is plenty of space for keeping lots of podcast around without need to get a secondary MP3 player (which is another reason… I don’t want to carry lots of gadgets on me.  So if one gadget can fulfill most of my needs, like time, phone, sms, camera, game, video and listening to podcasts and songs, the better.)

Ok, I’m digressing from the topic :).

The standard installation that came with Omnia (Windows Mobile 6.1 and some other Samsung added software), work okay, but sometimes I found them a bit lacking.  So I tried to look around for additional software that might spruce up my Omnia, and I found some…

They are:

SPB Mobile Shell 3.0

This shell is awesome and it works on most Windows Mobile devices.  You should give it a try if you own a Windows Mobile device.  The UI is so smooth that I don’t feel like going back to Omnia standard UI.

Resco Keyboard Pro

This soft keyboard is my finger friendly keyboard of choice these days.  For those that uses iPhone, it offers similarly skinned keyboard that is quite pleasant to use.

Resco Sudoku

This touch friendly Sudoku puzzle game is my favorite time waster when I’m waiting or not doing anything in the middle of nowhere.  Must have :)

Route 66 Samsung Navigator

This GPS mobile navigation system is so far my favorite.  In my opinion, it’s better than the Garmin one.

 

On another topic,  I found out that after upgrading my Omnia BIOS / ROM to DXIA5, it works much better.  It used to hang on me previously from time to time, but after the latest upgrade, my Omnia is as smooth as butter :).  I haven’t found the need to force reset it for quite some time now.

Share this post: | | | |
Posted by Jimmy Chandra | 7 comment(s)
Filed under:

Important 3 Sided Development Project Tools

Been eating and hawking stuffs related to Application Lifecycle Management lately, especially Microsoft Solution Framework, Visual Studio Team System and Team Foundation Server.  During the workshop that I delivered, I often mentioned certain things that seem to be very useful to know.

Amazingly, they all have 3 sides to them.  I’m sure you all have heard about it somewhere during your career as a developer or what not, but nevertheless, I think I’ll share what I’ve learnt and I’m sure you can benefit from this if you don’t already know them.

1. The Iron Triangle of Time, Scope and Cost


Most development project owner will want to control all three sides of this “Iron Triangle” and they sometime can be unreasonable about it.  It’s your job as the development team to educate / reason with the project owner that in all eventually, they realistically can only control two out of three and will have to sacrifice the third to achieve the other two.

So, if the project owner want all the features implemented and at a fixed monetary cost, they will have to compromise on time needed to complete the project. 

If he / she chooses to have the project completed with all the scope specified and within a fixed time (according to their schedule, not what is estimated by the development team), then they will have to pay extra cost (it will be more expensive since you might need to get a more proficient team member or tooling).

Another variation of this triangle is Cheap, Good, and Fast (heard it from Chad Hower in TechEd SEA 2007).  If you want it done Cheap and get it done Fast, then for certain you won’t get a Good product.  If you want it Cheap and Good, then be prepare to wait for it (perhaps due to your cheap labor will need to ramp up on the technology to deliver your product first).  If you want it Good and want it delivered Fast, then be prepared to pay a lot more (it’s not going to be Cheap).

One other note on this, adding more human resources in a middle of an ongoing project will NOT help you speed up the delivery time most of the time since the new resources will need to time to get up to date on the current project situation, technology, etc.  There will be some knowledge transfer time incurred when you do this that will impact the deadline.

In most development project, it is often suggested to cut scope in favor of paying additional cost and time (Cost & Time are fixed, since most of the time it will be a fixed cost contract and the client have certain timeframe in mind).

Amazingly, one promise of Scrum (heard from Jeff Sutherland’s InfoQ Root of Scrum presentation) is the ability to break this triangle and basically offer the project owner the ability to “have the cake and eat it too”, so to speak.  Some people argued whether such thing is really possible or not, but I’ll leave it out to you to decide if it’s true or not.

2. The Three Legged Stool of People, Process and Tool

Ridi wrote about Distributed Extreme Programming not too long ago, in there he mentioned a model of Tools, Method and Process.  He also mentioned something about communication being important, etc. (which I think is also important… the people aspect).  So let’s put them together….

1. Tools

2. Method & Process (I often think these two are actually one and the same)

3. People

Each of these three can be viewed as the each leg of the three legged stool.  If any one of them is not present, your stool will certainly become unbalanced and will fall down.

For example, you have the best tool and the best process in the world, but the people doesn’t want to use the tool or the process (too complicated or what not).  Your project will not be successful.  Or you have the best people and the best tool in the world, but your process is a mess, you will also fail, etc.

As one of my mentors said to me, keep them in your pocket and pull them out when you need them :).  I hope you can use these two three sided tools / knowledge to your advantage and success of your project.

Share this post: | | | |
Posted by Jimmy Chandra | 1 comment(s)
Filed under:

BizTalk and SAP Adapter and Head Scratching…

Note to self…

 

When you see this Application event log entry:

 

Event Type:     Warning

Event Source: BizTalk Server 2009

Event Category:          (1)

Event ID:         5743

Date:               6/26/2009

Time:               8:06:42 PM

User:               N/A

Computer:      CSD-Labs

Description:

The adapter failed to transmit message going to send port "SAPPortBilling" with URL "sap://CLIENT=999;LANG=EN;@a/99.99.99.99/00?RfcSdkTrace=False&AbapDebug=False". It will be retransmitted after the retry interval specified for this Send Port. Details:"System.ArgumentNullException: Value cannot be null.

Parameter name: key

   at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)

   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)

   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.CreateChannelFactory[TChannel](IBaseMessage bizTalkMessage)

   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.InitializeValues(IBaseMessage message)

   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2..ctor(IBaseMessage message, WcfTransmitter`2 transmitter)

   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfTransmitter`2.GetClientFromCache(String spid, IBaseMessage message)

   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfAsyncBatch`2.BatchWorker(List`1 messages)".

 

Make sure you have entered something in the Action part when configuring BizTalk SAP Adapter Send Port.

Share this post: | | | |
Posted by Jimmy Chandra | with no comments
Filed under:

Rambling on False Sense of Security and Cause and Effect

On Security Half Ass Done

Where should I begin…  Let’s take Pacific Place Mall in Jakarta for a start.  Recently, I am sure most of us in Jakarta already know about a particular incident in this place where a young lady was murdered inside the mall.  OMG.  This place is one of the high class shopping centre in Jakarta, with expensive security screening and checkpoints clearly visible on the mall entrances (or some of entrances).  So let’s see where the security flaws are…  If you come by car, as you try to enter the parking lot in the basement, the security staff will “search or put a facade of attempting to search” for suspicious things in your car, but as most of us know, this sort of thing if not done properly is just half-ass done and this is the case most of the time.  So say if I have a concealed weapon in a bag which is inside the car, they don’t really going to find them.  Oh but wait… after you park your car in the basement and try to enter the building … There is a security guy at the door, but … he doesn’t do anything.  You can just waltz yourself into the building and go on your merry way.   Another point of entry into the mall is a strip of underground tunnel from Jl. Jendral Sudirman into the mall.  There is a security checkpoint there, but again, I’ve seen enough people going through the checkpoint and causing the alarm to beep, but… no extra security check was performed by the guard.  Of the latest, I’ve seen it in a lot at other places as well.  Totally, totally false sense of security.

On Cause and Effect

In a nearby rich neighborhood from where I live, oh heck, let’s just call it by name, Kebun Jeruk Intercon, one family home was robbed.  The detail is not important.  It just happened to involve a small kid, maid of the house and stranger pretending to know the owner of the house and was granted access into the house by the maid or something like that.  One thing that you should know is that this particular neighborhood connects two major roads (Joglo Raya and Meruya) and a lot traffic is taking advantage of it by passing through the neighborhood to get from one road to the other.  Not long after the incident, the usual passageway through the neighborhood were blocked (at least from Joglo Raya side).  No more traffic can get through from that side.  I’m sure as a community, the neighborhood has put a lot of thought before closing itself to the public, but I don’t think they thought about the effect of such action.  All the traffic, and I mean a lot of it, that used to go through that connecting road now has to be redirected somewhere else.  The problem is, the other supporting roads are just inadequate to receive the new traffic flow and walla, the already hellish traffic area is now becoming more unbearable.  Where it used to be a pretty smooth 10 to 15 minutes ride through Srengseng, now becomes 45 minutes to 1 hour to go through.  And the funny thing is, even though they plugged the main entrance, there are a lot of other ways to get in / out from that complex.  I can think of 2 to 3 already.  And Indonesian being resourceful as we are can’t help but to take advantage of these “jalan tikus” (alternate roads).  The people using these alternate small roads are so many that they are causing more traffic jam in Joglo Raya that is as I said already a hellish road, especially one narrow part of it.  Do the people in Intercon deserve to feel safe?  Of course, they do, but … are they really safe now that they have closed that particular road entrance?  I think not.

What’s the Point?

My point for this rambling is that, in the end, you just can’t depend on other for security.  You have to take it seriously on your own.  Be aware of your surrounding and the lack of security there of.  Be proactive and less reactive.  Knee jerk reaction like in the second story will only cause more problems, if not for you, then for a lot of others and really… in that particular example, it’s not even a complete safety solution.

Share this post: | | | |
Posted by Jimmy Chandra | with no comments
Filed under:

Rambling on Annoying Traffic Things

On Roundabout Sillyness

Who the h*#% invented this useless thing?  At least of every places that I've been to, I've only seen one that actually work properly and that is certainly not in this country (Indonesia).  All the roundabout locally is nothing but a huge trap for traffic jam / slowdown since nobody actually put any sane thought on how to do correct traffic flow for it.  For those who does not know what I'm talking about, roundabout is that circle structure in a middle of a 2 or more ways road intersection.  For example:  Bundaran HI or the one in Kelapa Gading or wherever else you can think of. *sigh*

emoticon

On Silly Road Design or Lack of It

Every day of the week since I got back to Indonesia (let see, counting this year, it would be already 5 years), I have to endure one silly portion of the road that is called Joglo Raya.  Let see, how should I begin...  Okay, imagine a 4 lane (officially) road, 2 going to one direction and 2 going the other direction which suddenly narrow down to 2 freaking lane (1 going one way and one going the other way) which will go on for about 1 km or so and suddenly becoming a broad 4 lane (officially) again. Can you say... BOTTLE-FREAKIN'-NECK???

Combine that with the unruly Jakarta's motorists... remember, I mentioned 4 official lanes... unofficially, it's 6 or 8 freaking lane, meaning you squish 4 lanes of traffic into one that supposed to be only 2 lanes going the same direction.  Can you say LACK OF TRAFFIC-*#$%&-CONTROL & PLANNING???

I don't think I have to say anything more on this subject. *sigh*

emoticon

On Queueing or Lack of It

One thing that I freakin' hate is that people who just don't understand about queueing etiquette.  Surprisingly, I've seen sticker / banner on this topic somewhere (forgot where I've seen it... maybe at the airport, not sure) in big big letters.  Something like ...BUDAYA NGANTRI...  But, apparently Indonesian public or most that I've encountered anyhow are totally foreign to this concept.  This, more than anything is one of the most annoying habit that I found of the local people, especially on the road, but not constrained to one.  Yesterday alone, I've encountered numerous of this, on the road and when queueing for food... say at Es Teler 77 or after church trying to buy a street vendor's food.  *sigh*

emoticon

Are You a Lemming / Cartman Wannabe?

Oh while we are on the topic, how come I get the impression that Indonesian public mentality is similar to those video game characters in Lemmings.  You know... if the one in front is jumping off a cliff the rest will basically follow the one in front.   Plenty of proof of this that you can see every single freakin' day.  Don't believe me?  Just pay attention the motorists on your way to work or back.  One of them will run over a traffic light and about 6 or 10 others will follow closely behind.  COME ON, PEOPLE!! Stop the Cartman - me first and screw you all - mentality (If you don't know what I'm talking about, look up South Park somewhere) already *sigh* 

 

Lemmings
Share this post: | | | |
Posted by Jimmy Chandra | 1 comment(s)
Filed under:

Podcasts: The Good, The Bad, and The …

As I posted in a previous post (a while back), one of my hobby is listening to technical podcasts (especially during commuting).

Of late, I’ve added a couple more podcasts to my usual list. 

New to the list…

One of them is Stack Overflow podcasts where Joel Spolsky and Jeff Atwood enlighten us on bunch of topics related to IT industries.  I found this particular podcast both controversial and enjoyable to listen to.  Invoking emotion such as what the hell is he thinking to let’s just agree to disagree.   In one episode they decided to bash on SOLID principle, and another on what the heck is software architect for, and you must know English to be truly be a programmer.  Occasionally, you’ll pick up word of wisdom that you can apply to your job also.  So, I really recommend this one.  The quality is very good (almost similar to those by PWOP).

Herding Code is another good podcast with 4 hosts.  So you get a lot of opinions from different perspective.  This is more like your ALT.NET crowd.  The podcast is actually quite excellent and cover quite large range of development related topic, mostly on web development (not necessarily .NET related).  The sound quality for this one is quite good most of the time.

Polymorphic Podcast is good if you want to focus on  ASP.NET Web Development.  Too bad it’s far and between for each podcast, not updated often enough, but the content make it worth it to listen to.

The old list…

If you are interested in architecture type of podcast, there is Arcast from Channel 9 which was started by Ron Jacob, but now is maintained by others (nowadays available as Arcast TV, but you can still download an audio only portion of it).  Content wise they are good, but the sound quality most of the time are bad.  Nevertheless, they are worth listening to.

Of course, the one that started it all for me is .NET Rocks.  This one is a must for any .NET developer.  It’s basically the most professionally done podcast that I’ve known out there, both in quality and content.  It is published twice a week with world reknown guest list.  My favorite so far is show 300 with Richard Campbell (the current co-host).

Along with .NET Rocks, I also subscribe to Hanselminutes and RunAsRadio.  Hanselminutes provides interesting views and interviews by Scott Hanselmann and RunAsRadio is another must for those of us who are also interested in the IT side.

The sometimes list…

Some other podcasts that I listened to from time to time are Ajaxian podcasts and OpenWeb podcasts.  These are interesting to listen to if you want to keep up w/ other web technology that is not necessarily .NET related.  The only bad thing is, most of them have a very bad sound quality (too soft and not too clear).

The fun one…

To complement all the technical stuffs, you also must have some humor.  For that I turn to Mondays.  It’s hilarious and refreshing, brought to you by the familiar staffs of .NET Rocks and the whacky Mark Miller from Developer Express.

For those of us who prefer Indonesian language podcasts…

Untuk teman-teman yang lebih suka mendengarkan podcast IT berbahasa Indonesia, silahkan coba Teman Macet.  Situs podcast ini dikelolah oleh teman sekampung (eh, senegara) kita yang sekarang lagi bekerja di Dubai di sebuah perusahaan yang bernama Infusion Development (if you listen to .NET Rocks, this should sounds familiar).

 

So, my call to action is, stop wasting your time listening to useless music and start learning while you are on the road.  It’s fun.  It’s informational and it will actually help you work better :).

Anybody know any other podcast worth listening to?

Share this post: | | | |
Posted by Jimmy Chandra | 2 comment(s)
Filed under: ,

How to Display Huge Amount of Data in a Web Grid Quickly

A Little Background

A client was asking me for a potential solution on how to display huge amount of data (say 10,000 records) in a web grid quickly.  They have implemented similar solution using ASP.NET AJAX and were complaining about its performance.  I had a couple of untested idea in mind on how to solve such a problem; so I spent some time to play around with the idea. 

 

On Pulling Data & Bottleneck

To avoid pulling data from an actually web service / database tier,  I created a quick in page random data generator that will spurt out x amount of JSON objects in an array. After doing some testing, I know the bottleneck has nothing to do with data generation but mostly due to browser rendering process.

 

The Prototypes

Finally, armed with JavaScript and jQuery, I proposed a couple of prototypes.

Prototype 1 (The Not So Fast and Furious, but Still Hella Damn Fast):

I don’t particularly like this solution since it relies on the browser (IE) quirk mode, but it sort of work. 

To Block Or Not To Block

In quirk mode, I found out that I can push tons of non block elements such as SPAN very fast into the browser rendering pipeline.  Changing the element to block elements such as DIV will tremendously slow down the rendering process.  I believe that this is caused by the browser layout engine, where it will re-layout the web page each time a block element is inserted into the DOM.

One Two Punches Combo

Additionally, I added a function to transform / render the JSON object array into the appropriate screen element using JavaScript array and string concatenation.  Testing further for bottleneck, I also found that this part was very fast (pushing 10,000 JSON object into a bunch of SPANs in a string) and concluded that the real bottleneck is still on the browser rendering pipeline.  In the end of this transformation process, I have an array of strings with each string containing roughly 1,000 rows of HTML elements ready to be injected into the DOM.

To further relieve some pressures from the processor during the screen rendering, I utilize setTimeout to batch the DOM insertion periodically. So, roughly, the rendering happened 10 times across a period of time (for 10,000 total rows) and each insertion call will insert about 1,000 rows of HTML elements into the DOM at one time.  I found that using IE’s insertAdjacentHTML method worked faster than utilizing jQuery append method so I branched the code to do browser specific code.

Previously, the client had a lot of controls in each of the grid row to further slow down the browser rendering.  To mitigate this problem, I decided to make the initial display as read only and create a single row template containing the necessary controls for editing.  When needed (I.e. when the user click on a particular row), I overlay this control template on top of the particular read-only row and push the underlying data into the control template for editing and push it back once editing is done to the read-only row behind the template.

The Good Stuff

Using this technique, we have a pretty lightweight grid that can render huge amount of data to the screen quickly.

The Bad Stuff

Disadvantage for using this method is when you are dealing with row lower down in the grid (i.e. record # 10,000), there seems to be a noticeable slowdown when navigating to that particular record.  Also, it’s relying on the quirk mode that won’t guarantee compatibility in the future.

Prototype 2 (The Viewport):

I don’t know if most of us still remember the old day of programming console-based application such as DataFlex, where screen estate is basically limited.  Sometimes you only have 80 character by 25 row to a screen, but still, even in the old days, you still need to display more data than there are screen space.  So, what do you do?  The answer to this question is what I like to call a viewport.  A viewport is sort of like what paging will do for you, but the nice part is you can scroll it one record or multiple records at a time.

Show What?

The way it work is when it’s time to scroll, you’ll literally re-render x amount of data back to the screen to simulate the scrolling.  So, if your viewport can only display 15 rows at a time, you’ll just re-render 15 records starting from record x (depending whether you go down or up, etc.)

The Good Stuff

This method is quite fast since you always showing limited number of items at any given point in time.

The Bad Stuff

Disadvantage for this method is you need to create a keyboard handler or any other method for scrolling items in the viewport.

And So…

Some more test still need to be done to lessen the lag time when pulling data from a real data source.  In my opinion, if you can pull all the (necessary) data across in the first try or in some kind of asynchronous data batching mechanism, it might net you more performance gain (or at least the appearance of one, which is, most of the time, will give perception of performance to the user of the application).  But then again, this will be a design question which better left to the solution architect.

Anyone got better ideas?

The Examples

Included in this post are the prototype examples for the solutions. 

Both prototypes were tested only on IE8 and FF3 (on Windows 7 Beta).  Mind you the code is a very rough prototype and might cause blindness when read.  You’ve been warned ;-).

Share this post: | | | |

Clone VHD, MSDTC and SID Trouble!!

Eh, without going into too much detail, if you are cloning a VHD (Hyper-V / VPC / Virtual Server) to create a new VM, make sure to run NEWSID Sysinternal tool after you run the VM the first time to avoid headache.  Ran into this while trying to use MSDTC on the cloned VHD.

Basically, I decided to create a common base VHD with Windows 2008 installed on it and then cloned the VHD (copied it) and create new VM using the cloned VHD.

MSDTC apparently does not like the identical SID on multiple systems.

Share this post: | | | |
Posted by Jimmy Chandra | 3 comment(s)
Filed under: ,

MMORPG Tactics = Software Architecture???

I used to play a high level cleric a while back in an MMORPG game called EverQuest.   As with most high level characters, I was in a raiding guild.  For those who didn’t know what a raid is like, basically, you get together with other players (usually in the same guild), usually around 20+ players with different skill sets and you work together to kill high level NPCs that required a whole lot of different tactics and cooperation between the raid members.

One aspect of this game that fascinates me is the tactics / strategies that are required for the raid to be a successful raid (minimal casualties and goal reached / NPC killed).

For example, as a cleric one of my main task is to keep our main tank alive (a tank is a primary punching bag for the NPC mob).  If you miss casting your healing spell because you’re out of mana (magic energy) or you didn’t use the right healing spell (takes too long or doesn’t have enough healing power), your tank will most likely will dead in no time and most likely everyone else in the raid will die as well.

Amazingly, the system work in the smaller scale (2 to 6 people group) as well as in larger scale (20+ people raid).   However, at a larger scale (raid), you need to adjust your tactic.  For example, a single cleric will not be sufficient to heal the main tank by his / herself, due to healing spell speed, maximum mana constraint, etc.  So you need to have a cleric chain / queue, in which 2 or more clerics take turns healing the main tank in turn.  Sometimes you also need to have spot healers (with quick, casting time wise, healing spells ready) just in case the main tank is suffering too much damage.  Here you can see, similarly in software architecture, depending on the software, you will need different scaling strategy between small scale system and large highly scalable system.  In a web application, you can think of this as a web farm / cluster sort of thing.

Even this sometimes is not enough due to the constraint of maximum mana pool per cleric.  In this case, the game have other specialized classes like mage who can create a mana injector rod and necromancer who can regenerate mana faster than any other classes at the expense of their own health and transfer them to whoever they wish / need it.  So you can see here that the cleric chain is being served by additional chain of mages and necromancers (to supply them with mana so they can continue healing the main tank).  Here, you can make a connection to one layer of service is depending on a lower level service to feed them data / information, sort of like tier / layer separation.

Sometimes the raid will require redundancy just in case.  For example, the raid leader will nominate a primary tank (the one that is getting hit the most by the NPC mob) and also a secondary tank just in case the primary tank goes down / die.  Can you say active / passive cluster failover?

Communication can be served in different channels.  For example, the raid clerics will have their own channel so they can communicate effectively.  I.e. Notified the rest of the cleric chain that they are out of the rotation due to out of mana quickly before their turn to heal so the next cleric in chain can take up the responsibility.  Or to notify the next cleric that his / her turn is up next.  A different channel is being used to announce to the other support classes like necromancer that a particular cleric is in need of rapid mana transfer.  Or a one to one / many mapping between a particular cleric with his / her own support staffs (mage / necromancer) can be established when needed as well.  You can easily make a similar analogy to this in software architecture… let say… Enterprise Service Bus / Publish Subcribe mechanism where each cleric in the chain subscribe (join) to a particular communication channel and they can publish (send their message / notification) to that channel so other clerics / interested party can react to it in whatever manner they deem necessary.

Execution order is also part of the strategy.  For example, the main tank will start hitting the NPC mob, and then when he is down to 50% of his health, the first cleric in the chain start healing.  This is kind of similar to that of an SLA in software / service architecture, where a certain service level agreement is establish that the tank should never fall below 30% of his / her health (which depends on the mob that is being raid) and for him / her to not fall below that number, the cleric should start healing when they can monitor that the tank is at 50% of his health.

Just food for thought… Isn’t that fun? Hehehe.

Share this post: | | | |
Posted by Jimmy Chandra | with no comments
Filed under: ,

Windows 7 64-bit & Fuji Xerox Document Centre 236 Printer Driver

Long story short, when I started at Microsoft, I was given a loaner laptop (a Toshiba Tablet PC).  I sort of miss the old loaner tablet PC now after I got a Lenovo T61p, finally.  The loaner has a very crappy battery live, like 5 minutes worth of battery only and then it just shutdown on you *LOL*.  Well, so much about being mobile… you basically have to tie yourself up to an electric outlet to use that thing.  However, I was getting used to the small keyboard and the tablet PC aspect of it.  Although it was not powerful enough to do any serious programming exploratory stuffs, it was very nice for note taking.  The sucker only had 2GB of RAM and meager 40GB hard disk space.  Yeah, not enough to spawn and support multiple virtual machines.  I wonder if that’s a long or short story…anyhow…

So, now that I got my “new” aka slightly used (or was it heavily used) Lenovo T61p notebook (someone quit and they handed it down to me, hehehe).  Nice machine.  4GB of RAM and quite plenty of space.  Too bad it didn’t come with 8GB of RAM…That would kick ass :).  Looked around for a 4GB SODIMM online and that thing cost a fortune, gah.. USD 340 each, and you will need two of them.  Maybe later… Guess I’ll live with 4GB for now.

So… I decided to install Windows 7 Beta (Build 7000) 64-bit on it.  It installed smoothly enough.  With standard install without scrounging for other drivers I was able to use most of the stuffs that I need, meaning video driver and audio driver straight from Windows Update.

I went online hunting for whatever drivers that I was missing and got most of them, including the UPEK fingerprint biometric driver and some other stuffs from Lenovo website (which have a pretty neat System Update utility, sort of similar to Windows Update).

At the end, I was still missing a couple of necessary 64-bit drivers, one for printer (Fuji Xerox Document Centre 236) and another for my IM2 broadband modem (ZTE MF622).  Basically I was looking for either Windows Server 2008 / Windows Vista 64-bit drivers.

After downloading a bunch of drivers from Fuji Xerox website and trying them (which amount to a hill of printed garbage, well, exaggerating here, but that’s how I feel).  I finally settled down on  a Fuji Xerox FX DC-II 5010 PCL that came with Windows 7 itself, which seems to work just fine for me.  Fuji Xerox website itself recommended a 64-bit PostScript driver that are available from their website (for W2K8 / Vista 64-bit), but that didn’t work for me.

Now… the only 64-bit driver that I’m still missing is my IM2 ZTE MF622 3.5G modem.  Anyone got any clue on this one?

Share this post: | | | |
Posted by Jimmy Chandra | 8 comment(s)
Filed under:
More Posts Next page »