Category: Software

  • My views on Steve Jobs’s biography – Microsoft is here to stay

    I am reading Steve Jobs’s autobiography. Quite a detailed memo of Steve’s background as person who he was. The book is fantastic, and I recommend everyone should read it (atleast those in IT).

    One thing that got me thinking was the philosophy behind Apple’s products. These are never intended to replace any Microsoft products – ever! So why the heck do these seem in competition?

    As (it seems) Steve himself used to say ‘Good artists copy, great artists steal’, it easily could have been the case where Windows copied Mac. No point in arguing that further. But for how long?

    Windows 8, surface tablets, Androids, Dell Ultra books and so on … all trying to sell the same piece of technology and making wild predictions on attacking the same user base which Apple has.

    Personally, I’d be happy to use iPhone as a iPhone, and my Windows as a Windows machine. I wish they didn’t bother ordering what they think I need for me anymore.

  • Is recent IT talk just a show of hands

    I recently attended Oracle Events at Westin Hotel here in Ebisu. My topic of interest was to see what’s the future for a product we’re using that now has been acquired by Oracle.

    Quite interestingly the first session from a senior, hi-ranking Oracle official failed to woo me. I mean, c’mon. Just piggybacking on stuff that’s so prevalent nowadays with Apple doesn’t really make a case for Oracle to progress ahead. Big words were just thrown out on every page, every sentence. I sometimes wonder do these guys actually value much as far as the company is concerned. Oracle seems to be calling their new (but nothing novel) buzz as “Oracle Experience” to demonstrate an end to end service to their customers. Every experience you know about purchasing a thing is the exact same thing Oracle wants to offer?

    Just what is the customer these days? A lump of flesh, an idiot, or a baby who needs your constant attention, and love to continue using your product? Much recently, the Apple has garnered alot of attention, craze, hysteria within the so call consumer market. Now everyone wants to try it out – suddenly everyone’s got ‘it’.

    The Oracle Event was a prelude to their sudden attention to their customers. Surprisingly, I didn’t come across a single presentation that meant anything for the ‘customer’. Every statement was proclaimed as seen from where Oracle stands. At times I felt trouble just bearing the innate nonsense these guys keep churning about every keynote presentation they make.

    Make a genuinely good product that last forever, satisfy what the customer needs, and …

    just stay out of the way for f*k’s sake.

  • Jawbone – Data structures in Javascript

    I have just posted a project for essential data structures using Javascript. These data structures form the backbone (hence the name jawbone) of many advanced formats to store, retrieve data

    The project is hosted on GitHub as well as Google Code

    Happy learning!

  • Complexity in software programming

    I believe most of complexity in today’s software programming arises mainly due to decisions – conditions present in if, while, for loops. The decisions are not the only factor, but I believe this contributes to majority of the complexity. It is very easy to visually see a condition working in front of you, indirectly building checkpoints in the program flow.

    I do a lot of program code reviews, analysis as part of my job. With majority of IT software built by eager, champion programmers, the fallacy of writing a simple condition in an ‘if’ decision is not apparent till expectations of the same piece of code grow over time Full Article.

    Even with well-seasoned OOP practitioners, unless the discipline to avoid decisions within program code is followed, old-style procedural programming flavor creeps unconsciously into OOP programs before one realizes it.

  • Friendly urls

    Just had a random thought if you could type keywords in your browser bar, and press a button that takes you to correct website. The concept is not new, even FireFox jumps from your address bar to Google search. I was thinking a further step, similar to using “I’m Feeling Lucky” button on Google search. One way to directly jump to first known correct website by typing keywords in search bar in FireFox would be to tweak about:config, and set keyword.URL, keyword.enabled as in below screenshot.

    Another option is using bookmarklet concept to select some keyword on screen, and directly jump to first known correct website. To do so, right-click Friend.ly, and choose Add to Bookmark. That’s it! Whenever browsing a page, you can select the keyword using your mouse, and click Friend click over here now.ly link on Bookmarks Toolbar. It will directly take you to most logically correct website that Google would recommend.

  • Javascript image slideshow

    My Impressive Animations blog is a collection of impressive images as the name suggests :-). I keep on adding images, in-spite of the fact that the blog page grows longer, and takes a while till all images are shown. This was a problem. Could all my images just become a slideshow without any changes to my blog?

    This made me search on WordPress, and on Internet for any simple, easy to use slideshow tools. In fact, I found quite a few, but these were a little over-complicated to use. Some were using Flash, some pure Javascript, but the trouble I had was (perhaps due their maturity) too many options, or few installations to get them using. Being somewhat impatient, I thought maybe I could create this for myself. And that’s what I did.

    I give you Image SlideShow (Javascript, CSS). It’s very easy to use, just follow these 3 simple steps-

    1. Add jQuery
    2. Add Image SlideShow (Get Javascript, CSS here)
    3. Change your existing <img> tags to include class=”slideshow”
    4. [Optional] For multiple separate slideshow blocks on same page, enclose your set of images with <p></p>, or <div></div> tags
    5. That’s it!

    Take a look at my blog where I’ve used this, and you’ll get the idea on how it works. This has made it a lot easier for me to add new images to my blog, and let everyone enjoy the slideshow.

  • Setting tabindex in HTML for arbitrary, disparate elements

    I hit upon a picky need by a user to have specific tab-order for a HTML page. For most part we usually would organize the layout itself to allow for default left to right, top to bottom tabbing of elements. Or we could always explicitly set tabindex to specific order.

    Trouble was, having limited capability to influence the HTML generated by the package, the only option was do some post UI alteration using JS, or CSS only. Not surprisingly, CSS is about formatting, not navigation hence there isn’t any CSS property for tabindexes. The only option in hand was JS, so I was playing with a couple of approaches to look at the problem

    • Request user to live with the default tab order – Not an option 🙂
    • Use CSS – Not possible to set navigational properties such as tabindex
    • Use JS
    • Hack onfocus, onblur to attach/de-attach custom tabindex – didn’t work for set of controls, since one can enter any control using mouse, still custom tab order needs to be maintained. Another issue was controls appearing after custom tabindexed controls didn’t get any focus any more.
    • Use onkeyup, onkeydown events, detect TAB – didn’t work because onkeydown, onblur occurred on element having focus, then onfocus, keyup occurred on element receiving focus. While logically correct, my sample code quickly became a mess of booleans tracking keyup and tab key, then clearing it onfocus, but again similar to previous issue this didn’t work either.
    • From a completely different perspective, surround required elements in containers, like div, span or fieldset. This would automatically take care of tab order, but trouble is the elements I had to work on were in table row cells, and HTML doesn’t allow interleaving of containers (which is logical).
    • Had to work simply across all browsers without differences in implementation. I came across some posts suggesting setting required tab order through java script for all known elements. Another post improved this thought by suggesting to have tabindexes with incremental gaps say 10, so that additional elements could be put in tabindex later on.
    • So my final working approach took both of the above, and mistakes in approach to come up with a very simple solution as below
      <script type="text/javascript" language="javascript" src="prototype-1.7.min.js"></script>
      <script type="text/javascript" language="javascript">
      //<![CDATA[<!--
      // Requires prototype.js
      document.observe("dom:loaded", function() {
      /* Specify elements in order of required tab index, cte= custom tab elements */
      var cte= $('select7', 'select9', 'select10', 'searchkb', 'select8');
      /*
      * Logic to set custom tabindexes for elements
      * First set tabindexes for all known input-able elements in with gaps in between
      * For required elements, set tabindex in that gap range
      */
      var idx= parseInt(1000), incr= parseInt(10); // Begin with any suitable base number, idx= index, incr= suitable increment gap to allow assigning tabindexes in sequence
      $$('input', 'select', 'option', 'textarea').each(function(el) { try { el.writeAttribute('tabindex', idx+=10); } catch(err) { void(0); } });
      var fi= parseInt(cte[0].readAttribute('tabindex')); // fi= tabindex of first element
      cte.each(function (el) { el.writeAttribute('tabindex', fi+=1); }); // Rest of the elements receive sequential tabindex
      });
      //-->]]>
      </script>

    I was leaning on using jQuery’s attr to write tabindex, but for some reason (I know that’s not an excuse) it didn’t work. Perhaps it should, however prototype’s writeAttribute, readAttribute worked, so I ended up using that. Also note that not all elements support tabindex,  though I’ve limited to input-able elements, so setting this throws error which I’ve deftly gobbled up; not a good practice but if someone knows an elegant way to find if element supports some property that would be great. On other hand, I would prefer jQuery, or prototype hiding such intricacies behind their APIs instead of me having to do it since it’s javascript anyways. The try, catch could be altogether removed though.

    BTW, I used YUI’s excellent javascript compressor to minify prototype’s javascript. Google’s CDN didn’t provide a minified prototype.js, I wonder why …?

    I believe my goal of having a simple, yet elegant way to override tabindex, taborder especially if you have no control over HTML was achieved. Perhaps this helps you in some way as well.

  • .NET v4.0 building missing targets

    C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(847,9): warning MSB3644: The reference assemblies
     for framework “.NETFramework,Version=v4.0” were not found.

    If you end up building .NET projects outside of Visual Studio, just using the .NET v.40 runtime, you may (will?) hit the above warning, but who likes warnings from systems, anyways? You have the option of either installing Visual Studio, but then what’s the point if you had to ship build files in the first place. This is not an option on production systems, and needs resolution.

    It seems, the full framework alone doesn’t install the correct target libraries when using a non-VS build environment (MSBuild.exe). I was lucky to find in a forum about a working fix, and it works like a charm.

    1. Download and save the  Windows SDK v7.1 32-bit x86 ISO image from Microsoft.

    2. Copy the ISO image to the server using the local network

    3. Download Virtual CD-ROM Control Panel v2.0.1.1 from Microsoft

    4. Unzip Virtual CD-ROM Control Panel and follow readme.txt instructions to install and mount the ISO image.

    5. Uncheck everything except .NET Development > Intellisense and Reference Assemblies in the installer.

    6. Finsh the install.

    If you now try to build, no more warnings are generated, and you’re good to go.

  • Paradigm shift

    Something got me thinking about how we think to handle a problem. This happened yesterday when I was watching a McGill University videocast on “Inflammation and Cancer – by Maya Saleh“. The video was interesting, technical enough, though confusing if you start focusing too much on lingo, or try to remember every acronym the speaker remembers.

    To summarize the whole video as I understand – the human body responds to any injury, disease by inflammation (soreness, heat, itch, numbness) as a self-protective measure. The amount of inflammation reaches an appropriate stage, disease is curbed, and  inflammation vanishes. In an imperfect world, there are exceptions, and this is same with inflammation. Sometimes, the inflammation worsens and why does it worsen is the point explained with over-intricate details in the videocast.

    But even with the details, all the research & effort spent on finding this, what struck to me as odd was the fact that it concludes with same point as it started with, namely the question about why does inflammation worsen? In other words, yet there is no answer.

    And this is where it got me thinking about our paradigm bias with which we approach a (or any) problem. The ultimate goal of our approach is to prevent something bad from happening through process of understanding details on why bad happens. Isn’t that the way we see things by attempting to understand, and interpret it by comparing with something tangible? Even in software (which is my main area, not medicine :-)) the pattern of thought is exactly similar. Bug prevention, disaster recovery, backup strategies … and it goes on.

    Trouble is the focus of this approach is protect from bad.

    Instead, something else got me thinking. Could this approach be changed? Say, instead of prevent could we prepare. For instance, instead of a malicious data entry corrupting our system, trying to prevent, could we detect and use this to our advantage by injecting more bad data to shutdown the system itself? This is like putting bad guys in charge of taking care of other bad guys … but the analogy may give you a wrong impression.

    I believe my thought is based on the same fundamental desire to protect, but by trying to take advantage of allowing things to happen. Instead of fighting against, fight using them.

    As another example for analogy, in outsourced IT systems, things often go against clients expectations because of clients desire to control more of the outsourced vendor process. Be it a goal to achieve cost cutting, squeeze out more work, or even the noble notion of making systems better in long run (anybody thinking “win-win”), I think the reason we aren’t succeeding in any industry with this thought paradigm.  The main players are presence of control over something, prevention of something (safe guarding interests etc).

    What if we could still have control, but in a way that doesn’t get in the way of preventing something bad to happen? Could we shift the focus from preventing bad to something inside out way of reversing this idea?

    Maybe the idea of medicine preventing inflammation by curbing some microflora, or cells, then discovering heuristically that medicine needs to improve to target something else seems a little waste of time to my appeal. That said, the promise lies if 80%-90% of disease cases being cured, while 10% are exceptions seems an accepted, un-challenged pattern in any field we see today. Majority wins, minority loses.

    I want to start fresh off with something simple, something which is already present – in nature. The moment someone claims we know something completely be it medicine or technology, that is the tipping point for me to confidently say that we are already lost going totally  someplace else. Our world, with it’s eco-system, with the human beings inhabiting it, with the environment surrounding it, with all it’s nature is designed to be self-sustainable. We have unnecessarily over-complicated everything imaginable with our falsely impressed thirst for knowledge, more so because our focus always has been finding problems, then going in circles finding answers to the same, and creating more problems that didn’t originally exist.

    I have a simple question – why hasn’t nature changed anything for so long? why are we same as many generations before have been? why don’t we see anything new in nature than what previous generations have seen? If we focus on understanding this, without trying to intervene with man-made heuristic approaches, we could have a much thorough, and guaranteed way of living in harmony with the way we humans are – imperfect yet perfect.

    I admit I am going all over the place with this. And I admit that I am not satisfied with the way things are today. There is something I sense is not fundamentally answered, and looked over.