Psychology behind social networking sites

If you make a habit of reading programming blogs, chances are you have heard of Joel Spolsky and Jeff Attwood.  It will also not be news to you that these two have set up  Just in case this is news to you, stack overflow aims to be THE programmers’ reference.  At the moment it is in danger of becoming “facebook for nerds”.  The web-site itself is nothing like Facebook – it’s just that I’ve heard Facebook be described as “It is all about me world”. 

I recall that the two Js have stated that “Stack Overflow” will become what the community make of it.  They had an idea, but how it manifests itself will be up to the community to form.  One thing about the site is that it tries to be as un-obnoxious as possible.  Signing on is not necessary to view questions and answers.  There is no fee for using the service.  Site revenue is derived from advertising and this advertising is not overt or leery. 

It appears to be a well put together site and is certainly proving to be popular amongst programmers.  As long as site revenue is coming in, I guess it can be judged as successful.  Members of the site are awarded a series of “badges” and reputation points.  These things matter to nerds.  “Badges” are awarded for all sorts of site-interactivity.  Things like the first time you “vote up” a question or answer will earn you a badge.   When other people vote-up your questions or answers, your reputation points increase.

The more reputation points you have, the more “editing powers” you are granted.  You can correct questions and answers, re-assign questions to different categories etc. 

The problem with any points system is it is open to “gaming”.  With the correct scoring system in place, you can effectively set rules for your site.  It is a very passive way of controlling a community based site.  Get the rules wrong and people take the site in directions you didn’t intend them to.  I believe this is what is currently happening to Stack Overflow.  Where the community takes any web site is no more than a product of the rules you put in place.  Where there are rewards (in this case badges and points) people will seek the path of least resistance to gain them.

Questions and answers both earn you points when they are voted up.  If you ask a question such as: “How can I find the size of a file on disk  using C?” you will probably get around six answers before people run out of permutations on how to perform the task.  If however, you ask “What is the best music to listen to while programming?”, well everyone has an opinion!  “Let me tell you about how I do things”…  See how this starts to mirror “It is all about me world”? 

Any well written piece in answer to a subjective question tends to attract a lot of up-votes.  The problem is it is easy to ask subjective questions, and all questions start life evenly.  Even if your question attracts one or two down votes, these can be far out-weighed by the hundred up-votes you get by providing a humorous anecdote explaining why you have the best taste in music.  At the end of the day, despite the up-votes, no-one really cares about anyone else’s answer!  Put another way, have you ever felt the need to search the internet to know what music your peers listen to?

As mentioned earlier, increased reputation allows increased “editing powers”.  One of the powers bestowed upon users with a high enough score, is the ability to close a question.  Unfortunately, this is akin to “having your cake and eating it too”.  Get in early enough and you can game the system by answering your favourite subjective “I’m interested in you” style question, rack up the points and then close other people’s questions when they try and do similar.

The biggest fear is that the web-site could devolve into a surrogate social networking site of little worth.  Unless there is relevant searchable material, site visits will drop.  Whilst dynamic content keeps people’s interest, dynamic content of worth is even better.  Part of the problem Stack-overflow faces is in how to put the genie back in the bottle.  Trying to change the rules of a game in progress is essentially “cheating”.  You will offend people if you do it.  You risk your credibility.  They are only a young venture and yet the writing is already on the wall that they are going to be facing a difficult future. 

The fact that Stack Overflow is a “good idea” is a saving grace for them.  I just hope they tweak their algorithm in time to prevent a blowout in their “signal to noise” ratio. In the meantime, I want to know whether cats or dogs make the ultimate programmer’s pet…  😉

Balancing the Starter Valves on a VTec VFR

Last time around, I built a manometer, with which I could balance the starter valves on the VFR. The current model VFR has a chequered history with respect to fuelling issues. My pet peeve, is with the abrupt nature that the throttle travel starts. From closed, rolling on the throttle results in a “nothing… still nothing… BANG WE’RE ON” feeling from the engine. I’ll save some of you a lot of reading: After performing the starter-valve balancing procedure, the bike still has this light-switch style throttle. Subjectively, maybe the bike is a little better, but I wouldn’t dismiss “wishful thinking” may be biasing my opinion.

EDIT: After much consideration, I have revised my opinion. Rolling on the throttle from “closed” is still tricky to do smoothly, but it has become possible since performing this operation. I leave my original statement in the blog entry, but my revised statement is that this operation has definitely helped my bike and made for a more pleasurable riding experience.

Before I begin my walkthrough, there are several things I need to point out.

  • I am not a mechanic: Read my disclaimer.

  • When referring to the bike’s left or right, front or back, the directions will be orientated as they would be if you were sitting on the bike riding it.

  • I described fitting after market exhausts as “easy”. I would describe this job as moderately tricky. This walk-through is more about putting pictures to the procedure outlined in the workshop manual. There are risks associated with performing this task and if you never got past the disassembly / reassembly of some old equipment without having left-over pieces then I recommend you don’t try this one.

  • Balancing the starter valves should be done with the engine running at normal operating temperature. (presumably this is so the bike isn’t fast idling.) From experience I can tell you that it is possible to remove the parts of the bike required without burning fingers, or alternatively run the bike to warm it up when it is partially disassembled.

To get to the starter-valves, you need to lift the tank and remove the airbox.

The tank is hinged at the rear and can be lifted once the two 8mm bolts are removed from the front of the tank.

Tank bolts

The bike toolkit comes with a C-spanner and handle precisely the right length to get “maximum lift” from the fuel tank and despite its appearances is quite steady when in place. The tank has a “restraining wire” that prevents it being lifted too far. Pay heed and don’t attempt to lift it higher!

Once properly positioned, carefully remove the Number 15 vacuum hose from the variable air-intake diaphragm on top of the airbox. (i.e. make sure you don’t tear the rubber hose!)

removing vacuum hose

The airbox is in two halves (upper and lower). There are seven Philips head screws to be undone to remove the top half of the airbox.

Airbox screwAirbox screw

Screw locations

Once the top half of the airbox has been removed, the air-filter will lift straight out.

Remove the four air funnels in the airbox by undoing the two Philips head screws on each funnel.

Air funnels

On the left side, remove the PAIR air hose from (near) the rear of the airbox.

PAIR hose

Slightly lift the airbox and disconnect the white IAT sensor.

IAT sensor connector

The PAIR solenoid valve is attached to the rear of the airbox via a rubber strap. Slide this off the prong on the airbox.

The other end of the PAIR hoses connect to the cylinder head covers. These should be blocked off for performing the starter valve synchronisation. Rubber stoppers or even a bunched-up clean rag should be sufficient to do this.

PAIR reed valve cover

On the right side, remove the PAIR air hose from the rear of the airbox, the electrical connector from the MAP sensor and the vacuum line on the bottom of the MAP sensor.

MAP sensor and PAIR hose

About half way along the right side of the airbox is the bypass control solenoid valve. Disconnect the grey connector from the bypass control solenoid valve and the number 12 vacuum line from the one-way valve.

Grey connector

You should then be able to lift the bottom of the airbox off the bike.

Undo the MAP sensor from the airbox (held in place by a Philips head screw) and reconnect the vacuum hose and electrical connector. It wasn’t possible to access the screw that holds the MAP sensor in place until the airbox had been removed.

Now you’re ready to connect your manometer.

The four cylinder vacuum hoses are connected to a 5-way adapter. (The fifth line is the other end of the map sensor vacuum line)

5 way connector

Disconnect the four lines from the adapter and plug in your manometer. It’s not really important which hose connects to which tube, as long as it’s logical to you! You will need to know which vacuum line is attached to which manometer tube.

All hooked up!

The moment of truth starts here! With the bike in neutral and on the centre stand start the engine and cross your fingers! Well, actually, don’t cross your fingers – because you may need to turn the bike off in a hurry if something has gone wrong and oil starts travelling up the manometer tubing at an alarming rate. Note that the “FI” light on the dashboard will be showing. At a guess, this is because the ECU has detected that some of the sensors are “missing” / disconnected or are giving funny readings. This is hardly surprising given the amount of stuff we’ve disconnected.

There are three brass 7mm adjusters, allowing you to adjust the vacuum generated by each cylinder relative to the fourth cylinder. The aim is to have the same amount of suction on each cylinder, which means you will have even amounts of oil in each tube of the manometer.


The adjusters are on a spring-loaded ratchet style arrangement. That is, they turn in “clicks”. It’s a confined space and difficult to get tools in there neatly. Assuming you don’t have a tool that neatly fits in the area provided, the way I see it, you have three choices:

  1. You can “unload” the ratchet making the adjusters free to turn by hand, by pulling the brass adjuster “out”. (That is: pulling the adjuster away from the throttle body assembly) The problem with this method is that whilst the adjuster is “out” you have altered the amount of vacuum generated on that cylinder hose.

  2. You can use an open ended spanner. This works okay, but you are limited as to how far you can adjust each cylinder to around two clicks before you need to take the spanner off and reposition. If the starter-valves are a long way off being balanced, this can be a frustrating experience.

  3. You can use a socket on a T-bar that doesn’t sit squarely on the adjuster. Normally I wouldn’t condone such a practice as it is a great way of rounding off the edges of a nut. This is especially true seeing as though the adjuster is made from brass (and therefore very soft). However, in this case you don’t need to exert much force to overcome the “click”. As long as you are careful this technique works well.

Adjusting the adjuster!

Turning the adjusters changes the amount of air that can be drawn through two holes on the throttle body. The more the air is drawn through these holes, the less the suction will be on the cylinder vacuum hose.

Air hole

Turning the adjuster clockwise opens the air hole and thereby reduces the suction in the vacuum hose. (the oil in the manometer will drop). Turning the adjuster in the opposite direction causes the oil in the manometer tube to rise.

Now it’s just a matter of patience until you get the oil-levels in the manometer as even as possible.

There are a few tips I picked up along the way:

  • The procedure should be done with the engine running at 1200rpm. Use the throttle stop screw knob (on the right side) as necessary to keep the revs consistent. (The starter-valve adjustment can affect the idle speed).

  • When you first connect the lines, if one of the adjusters is a long way off correct, oil may drain quickly out of one of the manometer tubes. If the tube empties completely, air will be drawn into the manometer and this is a “bad thing”. To quickly force oil to be drawn back up the manometer tube, you can cover the air holes with your finger.

  • The workshop manual has the usual line of running the engine in a well ventilated area. They weren’t kidding! Leaning over the engine with it running exposes you to far more exhaust gasses than you normally get. Don’t take the suggestion of “well ventilated” lightly!

  • Running the bike at idle is not sufficient to recharge the battery. The Australian model VFR does not have a headlight switch. (they are “hard-wired” on whenever the engine is running). If you can’t turn off your headlights, it is a wise idea to disconnect them so that they are not drawing current from the battery. Depending on how long you run the bike for, or if you need to stop and restart the bike a few times, the process can be quite taxing on your battery.

The workshop manual also indicates you should reset the ECU after balancing the starter-valves. The (correct) reassembly of the bike will be sufficient to prevent the FI light from remaining on, but I can only guess that it keeps some “memory” of the sensors having been disconnected.

And that’s about it! As the manual states: “Reassemble in the reverse order”.

Good Ideas, Gone Wrong

Software is created off the strength of a “good idea”.  From inside the development process, “code quality” is often thought of in terms of the number of bugs present in the code base.  This is a useful metric, but it is not the only thing that determines the overall quality of the product.  How intuitively a feature is implemented is also a factor in code quality.

How intuitive a feature is in software, has so far managed to avoid a quantifiable measure.  That is, a “1 to 10 scale” that can accurately measure how intuitive software is, has yet to be developed.  This can make it difficult to know if you have done the right thing when the software has been built.  The phrase “to eat your own dog-food” is perhaps the best leveller for a new feature.  Force the developers / UI experts / architects (anyone who influences the look-and-feel of the product) to use their own software and pretty soon, the rough edges get polished out. 

I recently attended the Borland Inprise CodeGear Embarcadero product launch for Delphi 2009.  After many years in the marketing wilderness, it finally looks like they have found their niche market for Delphi and C++ builder.  Their tools are viable options for “native Windows” applications. – That is, there is still significant demand for applications that require the “raw power” available using “unmanaged code”.

Additions to the Object Pascal syntax in this newest Delphi edition, see it become a really cool language.   (Anonymous methods, closures and generics support).  It was quite a frank and honest product demonstration from Nick Hodges.  He was obviously keen to show-off the latest and greatest features of the product, but on the other hand open and responsive to suggestions and criticisms of the existing product.

One of the criticisms levelled against the current release (Delphi 2007) was about the product documentation (or lack thereof).  Since the advent of Delphi 2005, the compiler has supported an nDoc style commenting system, to allow developers to “roll their own”.  Nick made the passing comment that the developers were not particularly disciplined* to actually writing these comments.  On the surface of it, it seems like an obvious solution to the lack of documentation. 

Having since tried to use the feature myself, it becomes apparent why the developers are not bothering…  It’s a great example of a “good feature – but in need of polish”.  Here is my synopsis of what is wrong with it, the way it stands:

  1. I’m not belittling the efforts of those responsible for nDoc, but its formatting syntax is inferior to Java’s self-documenting comment system.  In my opinion, nDoc loses out by being fragments of XML, which make it less “human readable” than the Java equivalent.

  2. One difference between Delphi / Object Pascal and Java or C# is the fact that the declarations for classes and functions are specified in an interface section, separately to their implementation (same source file, just a different section).  The current nDoc parser used for Delpi’s HelpInsight feature (tool-tips that appear when hovering over functions) only finds comments that appear where the functions / classes are declared.  For publically accessible functions, this is in the interface section.  The most natural place to document the function is where it is implemented.  I can see that this would be technically more difficult for the parser to manage, but that doesn’t give the programmers an excuse to be lazy.

  3. The comments seem to need to be in units that are explicitly included in the project.  Despite the fact that the compiler can resolve/match symbols that appear in source files anywhere on the source path, the nDoc comment resolution can’t.  You need to add your unit with the comments to the Project (.dpr / .dproj) file.

  4. The nDoc parser appears to be buggy.  Most notably, the first function (Object Pascal still allows you to have functions that don’t live in a class) will not be found.  The way around this is to declare either a dummy function, or a dummy type.  Neither of these need to have their own nDoc commenting but it may help you to remember why you wrote in another declaration of the integer type…

 Nick Hodges invited the audience to contact him if we had ideas on how to improve Delphi.  Now I’ve had a chance to flesh out what I see as being wrong with HelpInsight, I might just do that!


* I’m paraphrasing here.  He definitely did not use this terminology…

Build your own manometer

The abrupt throttle response has bought much criticism of the current model VFR.  I trawled through many forum threads dedicated to why the off-on throttle transition would cause the bike to lurch forward.  Older models of the bike do not demonstrate this trait and even some current models don’t.  One common theory is that the “starter valves” are not balanced on the bike and when badly configured would cause issues in the initial throttle travel.

To balance the starter valves requires measuring the vacuum each of the four cylinders generates.  Typically his is done with a set of vacuum gauges.  Adjusting the starter valves is a fiddly process.  When you get any vehicle serviced, you can equate “fiddly” to “expensive”.  Likewise, buying a set of vacuum gauges to allow you to measure all four intake vacuum pressures is not “cheap”.  (Well, if you know in advance that this will fix the problem, it’s money well spent. Given the circumstances, that was a pretty big “if”)

One forum member came up with the cheap alternative: Build your own manometer.

“Basically, a manometer measures pressure (Mano- is the Greek term for “gas” or “vapor”). Many expensive manometers (like the Motion Pro or Carbtune) allow you to measure the vacuum of each cylinder in cmHg (centimeter of mercury). Since the starter valves on the VFR VTEC are supposed to be set equal to each other, then there’s no need to measure the vacuum of each cylinder. All we need to know is what the vacuum in the cylinders are, relative to the other cylinders.”

I decided that a home-made manometer was around the budget that I was prepared to spend “on a hunch” and thus I built my own.  Unlike “Darth Bling”, I was unable to source the adapters to use wider pipes, so I went with 4mm clear plastic tubing throughout.  I’m not presumptuous enough to claim that this is a better set up – in fact, I’m almost certain that it is worse, but it was one that was dictated by the limitations of local hardware shops.

The first manometer I built consisted of four tubes of around 2m in length, connected by two T-pieces.   On the other ends (the bit that connects to the intake vacuum hoses) I put 4mm “barbed” connectors.  This allowed for a fairly easy connection to the bike.   The good thing about using 4mm tubing, is that common garden irrigation/sprinkler systems use 4mm piping as well.  That means T-pieces etc are common.  The bad thing about using narrower pipes is there is a lower volume of oil.  I used some 4-stroke lawn mower oil, because (a) it was a pretty red colour, and (b) because I had some “lying around”. 

T-piece connections  Mower OilFillingVersion 1.0

Unfortunately, the vacuum pressure difference on my bike was such that all the oil was sucked out of a couple of the hoses when it was connected up. – I hit the kill switch before it had a chance to suck oil into the engine!  Once a tube empties, air gets introduced into the pipes and puts bubbles into the oil.  This makes the manometer ineffective as the oil levels will never be level in the hoses.  The quickest way to “reset” the manometer and remove the air-bubbles is to disconnect one of the hoses from the T-piece and drain all the oil from the system.

Lessons I learnt from making my first manometer:

  1. I had about 1.2 metres of hose above the level of the oil.  For my bike, this appears to be sufficient to mean a watchful eye will prevent oil being drawn into the engine.  (That is, you should have sufficient time to panic and hit the engine kill switch if something goes wrong)

  2. I needed more oil in the pipes.  A higher volume would mean less chance of all oil being drained from one pipe and thus less chance of introducing air bubbles into the system.  The additional weight of the extra oil should also reduce the effectiveness of the vacuum and make the oil levels change at a slower rate.

  3. A way to “bleed” air and oil from the system would make life easier.  (Or so I thought…)

  4. Knowing approximately how much oil your manometer will need makes life simpler when filling.  Do the calculation – it’s not hard! 

Volume = π xx h

(Of course, remember that the equation uses the radius, not the diameter and yet tubing you buy invariably is measured by diameter! – Something I’m embarrassed to admit I forgot. – Still, this blog entry is more about learning from my mistakes so hopefully you won’t make the same ones…   Also, apologies to all those stuck with the imperial measuring system…  Measuring things in metric makes life easier here:  If you specify all measurements in cm, you end up with cubic cm for the volume, where 1cc = 1mL. )

So… The second manometer I made used piping of around 3.5m per tube.  This was longer than intended, helped by the generosity of the local hardware shop that sold me 15m of tubing for the price of 12m.  For this device, I used three T-pieces.  The “middle” T-piece connected to a “tap” that could open and close, allowing me to bleed the system if necessary.

Each tube has just over a metre of oil in it, which equated to a measly 13mL of oil in each tube.   This time, the oil didn’t race straight up the pipe at an alarming speed and things were looking good… until…  After around twenty seconds, the levels of all four pipes started to rise!  Two seconds later, I managed to stop looking bewildered and noticed that air was being drawn back into the bottom of the manometer via the tap on my bleed hose!  So it turned out that I had introduced a double-edged sword.  Whilst the bleed line was a great way of removing air from the system, it was also a great way for putting air into the system!

So I hereby declare my first working version of the manometer to be Version 2.1.  It’s not what you would call a pretty manometer, as the excessively long tubing sits in an un-kept mess at the bottom…   But it works, doesn’t leak oil (or air) and thus serves the purpose of a more expensive piece of equipment. 

Manometer Version 2.1

Note:  I had just moved the manometer when I took this photo, and as the pipes were not tightly held in place, they possibly moved – thus explaining the differing levels of oil.  Given enough time, they would “re-adjust” such that all oil levels were… err… level!

Here’s the breakdown of the parts used in the construction (not including the tubing discarded along the way)

15 metres of clear 4mm tubing… $0.63 x 12m = $7.56

 3 Micro Joiner 4mm barbed T-piece adapters… $0.50 x  3  = $1.50

 5 Mircro Joiner 4mm barbed connectors… $0.31 x  5  = $1.55

~55 mL 10W40 Mower motor oil – sourced from existing supplies.

 8 cable ties – sourced from existing supplies

 1 piece of MDF board – sourced from existing supplies

 1 shoelace (to hang the manometer from) – sourced from existing supplies

Total: $10.61. 

In all honesty, if I factored in the prices for parts I already had, I might have bumped the price up to $20 – $25.  Also, for V2.1, I only strictly needed 4 connectors and two T-pieces, but you get the general idea…  By the way, a set of four vacuum gauges will likely set you back between $100 and $200.

As for how the balancing of the starter valves went and whether it improved the bike, well, that’s a story for another day…