Code & Craft

Where algorithms meet narratives

Join me, as I build worlds with words and code
  • Posted on

    This story was based a prompt I found on Reddit. Here's the original prompt.

    Exactly 100 years ago, a massive obelisk appeared in the sky, idle and silent. Only today had it ever finally spoken, and when it did, it only uttered one word: “Complete.”

    The original thread can be found here. https://www.reddit.com/r/WritingPrompts/comments/ihvw3n/wp_exactly_100_years_ago_a_massive_obelisk/

    Nick stood there astonished at the sight. No amount of photos or reading about the object did it any justice. This was a dream a long time in the making. To come and see the "Pillar of Scilly". He'd saved enough money over the last 6 or so years just to come see this wonder. I am going to remember this for the rest of my life, thought Nick. He couldn't remember the last time he was happier.

    No one knew what the object was. Supposedly over a 100 or so odd years ago, the object had arrived from outer space and parked itself some 160 meters above St Martin's Island at the Isles of Scilly. It was definitely obelisk shaped. His friends back home in Greece were right. Nick had no idea why it was called a "Pillar". Maybe because it just floated so commandingly beige and upright. All 256 meters of it.

    The plaque next to the enclosure read

    "The 'Pillar of Scilly' arrived on Earth June 28th, 1908. No one knows its origins or where it came from. No attempts to communicate or evoke a response from the object has been successful. The object is inert in every way except gravity. The Pillar of Scilly has remained in position 300 meters above sea level ever since it arrived. Originally called 'Gods Column' it was renamed after a vote in 1933 to its present name. The object resists any attempts to extract samples of it for scientific studies"

    Nick had seen this plaque on the photos so many times. He clicked a photo of the plaque lazily before resuming photographing The Pillar. The path around the enclosure allowed people to walk around the object and see it from all directions. There was even a helicopter ride that would take you up to the object. £280 the board had read. For a 15 minute ride. He hadn't that much money.

    The time was only 10:15 in the morning and he until 5 to get to the boat. Nick was going to enjoy every minute of it just staring at the wonder. Nick was disappointed when his friends didn't want to come. The world had lost interest a long time ago at the object. It had become a part of the landscape. He glanced at the other tourists lazily walking around staring upwards. No one seemed to be asking questions about it anymore. How was it floating? Is there someone inside? Is this a message? A scout perhaps?

    Nick took a deep breath and decided to click a picture of the very tip of The Pillar. As he raised his camera to his eye, he felt a breeze. It smelled weird. Electric. A smell he knew so well from all the years as an electrician in Kalamaria. The breeze only picked up in strength. The smell too was now unmistakable. Like some kind of ancient motor had sprung to life. All around the path everyone had stopped and stared at the object. Some had held their noses at the smell.

    "COMPLET" came a booming word unmistakably from The Pillar. Nick didn't understand what it said but that's what it sounded like. He looked around inquiringly until a woman caught his eyes and she said.. "I think it just said Complete". "Complete What" asked Nick. She just shrugged.

    Nick was delighted he was there to witness the first activity of The Pillar. With a grin on his face, he changed his camera to video mode and started recording. "You guys are not going to believe this" he said in Greek. As he was recording he realized he couldn't keep it in frame. It was shocking to realize that the object had began to move. The grin now disappeared from his face. As he began to lower his camera to look at the Pillar directly he realized the object had gained height. Quickly he raised his camera back at the moving pillar.

    The smell had gone fainter but the breeze had definitely picked up. It was as if something big was revving up. There was no noise or sounds or whines Nick was expecting to hear. It was moving away. Moving upwards. It was getting smaller. There was no mistaking it.

    The blast knocked the wind out of Nick. The air smelled electric. Everyone standing around the path had been knocked to the ground. As Nick glanced upwards, he could see The Pillar ascending fast. Unbelievably fast. It was like watching a 747 taking off. Nothing this big should be able to move this fast he thought through the breathlessness.

    As quickly as the event had started it was over. The "Pillar of Scilly" had simply gone away. Vanished. Where to he couldn't even begin to guess.

  • Posted on

    I am bit frustrated with WordPress. Porting WordPress to a new hosting provider is a bit cumbersome. My previous blog was ported as per instructions, but it hasn't worked. Moreover WordPress tends to be a heavyweight content wise. Meaning it downloads a lot of content for just a blog. I am aware that there are other open-source lightweight alternatives to WordPress, but developing something my own might add valuable experience.

    I am still in the process of developing this and even though you see the blog posts below the development is not complete yet. It should all be ready in some time.

    Thank you for visiting.

  • Posted on

    Why write the blog at all? I understand it's a little late to be answering this question but I guess It needs to be said at some point.

    I have a vague recollection of my grandfather (Paddu Tatha) and whatever memory I have of him is of him either scolding someone or the other. He was short tempered and had very high expectations of people. I remember him scolding me a lot. Not his fault though, I was a stupid kid and I'd hate myself at that age if I saw him now. For example, I'd constantly steal the vegetable vendor's weighing scales and run away with it to home. Anyways he was a good man I have a good sense of the man from memory and from stories I have heard of him. Unfortunately he passed away when I was 7 or so.

    I have never seen my other grandfather (Seshadri Tatha). He passed away before I was born. From what I've heard he was very intelligent, was pretty wealthy and liked to play around with his kids a lot. He was pretty infamous too for a lot of things. I didn't really have a sense of who he was until one day my uncle showed me a letter that he'd written to the collector of the district asking for a permit to ply buses between Perambalur and Trichirapalli. It was in English and he'd written it beautifully. It had great penmanship and was written better than what you'd expect of someone who grew up in rural Tamil Nadu. As far as I can recollect It didn't have a single grammatical or spelling error.

    Writing is a window into the workings of a person's mind. You can see a side of a person that you normally don't get to see. For example I had this colleague back in Chennai who was generally very shy. We'd be lucky if we got two sentences out of him in a day while talking. But boy could he write. His emails would be perfect. You'd never see this side of him unless you spoke to him over an email.

    And that's why I blog. My grand children may never get to see me and I just don't want them to be curious as to who I was. Or where they come from. This is the intent of this blog. To give them a peek into my mind.

    That's all I had to say really.

    I think my next entry will be of all the stupid shit I have done.

  • Posted on

    Well, it has been a long time now since my last update. My apologies to my friends who visit my blog only to find no updates. I am more active on twitter and any blog updates will be tweeted.

    I saw the movie "Enakkul Oruvan" and was pleasantly surprised. I went in to the theatre with no expectations and came out glowing and with the biggest urge that this needs to be written about.

    If you know anything about Tamil movies, you'll know that this industry has patented that art of producing shit movies. Not exaggerating at all. Take a look at the recent movies released by the so called big name directors. (Actually no, don't take a look)

    Shankar's Ai was such a disappointment. I generally do not have a lot of hopes out of high budget movies and avoid them as much as possible. But when you have a family that has been amped up with constant visuals and adverts you have to give in. I went to see it with zero expectations but still was disappointed. How is that even possible? Who still makes movies where the high point of the movie is the extravagant and unnecessary songs. Shankar, that's who.

    Another big disappointment was KS Ravikumar's Lingaa. Why? Why go through the ordeal of making this? Why bother telling this very ordinary story? Why bother having 25 comedians and 400 characters? They are a big distraction and come in the way of whatever little story being told. This wasn't movie watching, this was an ordeal.

    Another weak story was Gautham Menon's "Yennai Arindhaal". This one made me go... "What year is it? 1990?" Who still makes movies that has the protagonist barge into a Mexican stand-off and declare "I am Satyadev IPS". That's where I lost it and stopped paying attention. And what was with the antagonist played by Arun Vijaykumar? I get that he's been building his body, but does he really have to take off his shirt every time the camera is on him? In a lot of places I felt as if Menon was trying to change the story or at least had multiple story lines in mind.

    Its not all bad though. There have been some movies that do make sense. Are coherent and hold your attention throughout. They are few, far between and are almost always low budget movies made by new directors and story tellers.

    We went to see the movie "Enakkul Oruvan" directed by debutant Prasad Ramar. This is a remake of a Kannada movie called "Lucia", also by the same director. First off though. This movie was advertised on TV with this song --> https://www.youtube.com/watch?v=ePwiT-RH2NY .

    Who the hell in their right mind will watch a movie that is advertised with this item song.

    So when I booked the tickets, once again for the family, I went with no expectations whatsoever. And it promptly blew our collective minds away. They say, don't judge a book by its cover. This is a prime example of the saying.

    This movie is still running in theatres, and for this reason I can't really give away anything without spoiling anything for you. I'll reserve the plot discussion for a post that I will make a month later.

    However, I will leave you with this quote and a poem.

    Maha-Vishnu then reclines in the waters of the Causal Ocean in a state of divine sleep, called yoga-nidra. Thus, it is said that the universal creation is but the dream of Maha-Vishnu - Rig Veda

    Once upon a time, I, Chuang Chou, dreamt I was a butterfly, fluttering hither and thither, to all intents and purposes a butterfly. I was conscious only of my happiness as a butterfly, unaware that I was Chou. Soon I awaked, and there I was, veritably myself again. Now I do not know whether I was then a man dreaming I was a butterfly, or whether I am now a butterfly, dreaming I am a man. Between a man and a butterfly there is necessarily a distinction. The transition is called the transformation of material things. - Zhuangzi

    Do watch this movie. You'll not regret it!

  • Posted on

    Ah the comfort zone!

    Oh how warm the comfort zone is!

    That chess strategy I never waver from but keep loosing, That wrist-watch I am always wearing but never bother checking the time, That washbasin at work that I always use no matter how much it splashes, The coding routine that I have That idea that I will never convert to an app because I am too comfortable fixing defects! Those Rubik’s cube algorithms I will never stray from That computer language I will always use as a bench mark

    Oh how satisfying you are my dear comfort zone. Like that itch I will keep scratching

    and oh how bitter the medicine of change.

    Change, forced or otherwise, you are the only enemy,

    Oh you uncomfortable pain-in-the-ass bastard!!

  • Posted on

    Have you ever seen one of these irritating, half-assed, Tamil dubbed versions of English movies on the various Tamil channels?

    I recently saw The Hitchhiker's guide to the galaxy dubbed into Tamil. Not only was it totally silly, they changed the story all together.

    Every dialogue was changed to something that didn't even resemble what was originally said.

    For instance, there's a scene where Ford Prefect warns the patrons of a bar that the Earth will be destroyed in 10 seconds. The Barkeep (originally) responds by asking him whether they should cover their head with a paper bag or something. In the Tamil Dubbed version, this was changed to the Barkeep asking Ford to stop his insanity. The joke of this moment is entirely lost on Tamil audiences.

    To someone who hasn't read the book or seen the original movie, I am sure watching it in Tamil would have been bewildering. Needless to say, I switched channels within 10 minutes.

    You know what would be great, take an entire movie that has been dubbed in Tamil and transliterate it back in English.

    That would be hilarious!!!

    I will do it someday.

    Oh and here's a transliteration for this month.

    Quote: Mayirai katti malayai izhu - vanthal malai ponal mayir (மயிராய் கட்டி மலையை இழு - வந்தால் மலை போனால் மயிர்) Intended meaning: Pull a mountain by tying a hair to it. If you succeed you will get a mountain, if you lose you will lose a hair. There is no harm in trying. Transliteration: Hair tie mountain pull - coming mountain going hair.

    Cheers!

  • Posted on

    Time, for a long time, was considered a construct of the mind. Not really existing outside of our minds. Time being an illusion is a common theme in Buddhist thought. Some philosophers even postulated that time, along with motion, and change were all illusions. Hindus had a concept of wheel of time, considering time as cyclical and consisting of events that repeat.

    Modern physics tells us otherwise. We now know that time is a dimension. And based on the special theory of relativity we also know that it is strongly connected to space itself, thus the term space-time (or the space-time continuum). So connected are these two, one can infer that from the point of view of a single photon, (there is no such thing, but go with it) space has 0 size. When a photon crosses the universe, from its point of view it takes no time at all (zero). From our point of view of course, it will take an infinite amount of time. This is what is called time dilation and it is wonderfully explained using the twin paradox.

    Another way we know time exists for real is because of Entropy. Entropy is a law that measures a systems progress towards thermodynamic equilibrium. A red hot ball of nickel which is in a higher state of energy than its surroundings will always lose heat in a predictive manner so as to reach room temperature. A closed (or otherwise called isolated) system always evolves towards thermodynamic equilibrium. Once equilibrium is reached that system has reached a state of maximum entropy. Simply speaking, Entropy is a law of nature in which everything (high energy) slowly goes into disorder (equilibrium).

    Energy is key here. The more energy a system has the farther away from entropy it is. Want to keep a ball of nickel hot, keep it torched. The only way water will stay up in the tank and now flow down is having valves or taps; in other words, convert the kinetic energy of the water as potential energy.

    Macro effects aside (fruit decay, water leveling or a red hot nickel ball losing heat), Entropy can be measured on the sub-atomic state as well. Free neutrons (neutrons not bonded in an atom) will spontaneously undergo beta-decay. Beta decay is a process that allows the atom to obtain an optimal ration of protons to neutrons.

    That’s how we know that time has a direction. There is a definite forward and there is a definite backward. Like temperature, living beings can’t see it, but we have an intuitive sense of it. We know if a movie is being played backwards. And we definitely know something is wrong if a ball of nickel gains heat just sitting there.

    So anyways. This post was not supposed to be about the physics of entropy or time. The idea was how Entropy can be observed in societies.

    A group of humans always stick together and organize themselves automatically and always form a society and create rules for said society. Humans don’t need an external entity to organize, they organize themselves. And I hypothesize on such self-organized societies entropy plays a major role. Given enough time a society will always degenerate. Always. When a society reaches maximum entropy they split themselves into groups. These groups then form their own societies and rules. These new groups can then be said to be in minimum entropy. How else would you explain so many countries, so many religions?

    Of course this is until there is external force acting on it. A group that has reached maximum entropy can be put together again if there is a threat to it as a whole. Indeed history is littered with examples of former rival groups getting together to fight a common enemy.

    I also think that the more energy (in the form of food, electricity, gas etc.) a group has access to, the more time it will take for that group to degenerate. But in the end entropy will always catch up.

    So that’s that actually. I thought it was a good explanation of what we observe in the world. And any problems you observe in a country can be explained by entropy.

    One last thought. You know the meaning of life? Or rather what life is? You see the universe is in a constant state of change from a high state of energy (think the Big Bang) to equilibrium (Heat death of the universe). Life is simply in the way

  • Posted on

    Two things will always amaze me.

    One is the fact that I am here.

    No one has defined what consciousness (No I am not talking about the soul) is but the closest someone has come to explain it is that self-awareness (and therefore consciousness) is an evolutionary trait that gives a creature the ability to plan and execute rather than react to immediate environmental changes. Turns out that there is no seat of self-awareness in the brain. I have an area in the brain that is responsible for my heart rate, vision, hearing and so on for all senses, but consciousness does not have a center in the brain. It comes from an interaction of all these senses. Consciousness is self-arising. Like birds in a flock. No one designs their beautiful patterns; they just arise because of a few simple rules.

    But the fact that I am here, out of a million different possibilities, and all of the histories starting from a single celled organism to Genghis khan have been responsible for me being here boggles my mind. The fact that I waste it away is an entirely different topic.

    The second fact that amazes me is that all of this will end. It will cease to be. There’s a tiny part in my mind that hopes that all of science is wrong and there indeed is a beyond. But the fact that I don’t remember anything from before being here is solid evidence for me that there is no beyond as well. That should make me sad. But in some strange way, it doesn’t.

    As long as I am amidst family and friends who care for me, I have nothing to worry about.

  • Posted on

    Am I the last person in the world to discover this?

    One way to round off numbers in Javascript is to use the parseInt method. Like so.

    var someRandomNumber = 123.1872;
    var roundedOff = parseInt(someRandomNumber);
    

    Remember though that parseInt does not actually round, it truncates the decimal portions of the number.

    But that's not the point. I don't know how good parseInt is performance wise, but an easier way to round off (or truncate the decimal parts) numbers in Javascript is to right-shift a number by 0. Like so.

    var someRandomNumber = 123.1872;
    var roundedOff = someRandomNumber >> 0;
    

    Both these examples yield 123 as the result.

    So I did some performance tests to see which one performed better. Each method was run a 1,000, 10,000 and 100,000 times and the time was noted. The tests themselves were carried out 20 times.

    I did not see a great deal of difference when the tests were ran a 1,000 times. Each method ran for more or less a millisecond, however I have to say that over 20 times, the right-shift edged out.

    There was still no big difference when the tests were ran 10,000 times. Still, right-shift edged out.

    The big difference was when it was run 100,000 times. The right-shifting outperforms parseInt as a method to round off (or truncate) number.

    Here's the result of 20 runs. Each run was 100,000 conversions.

    # ParseInt Right-Shift
    1 9 5
    2 4 1
    3 5 1
    4 3 1
    5 2 1
    6 3 1
    7 3 1
    8 3 0
    9 4 1
    10 3 0
    11 3 1
    12 3 1
    13 3 1
    14 3 0
    15 3 1
    16 3 1
    17 3 1
    18 3 1
    19 3 0
    20 3 1
    Average 3.45 1

    Here's the code if you want to do this yourself.

    var testing = "ParseInt - Right-Shift\n";
    for(j=0; j<20; j++)
    {
      var startTime = new Date().getTime();
      for(i=0; i<100000; i++)
      {
        var myVar = Math.random() * 1970;
        var roundOff = parseInt(myVar);
      }
      var endTime = new Date().getTime();
      var timeTaken = endTime - startTime;
      testing += timeTaken + " - ";
    
      startTime = new Date().getTime();
      for(i=0; i<100000; i++)
      {
        var myVar = Math.random() * 1970;
        var roundOff = myVar >> 0;
      }
      endTime = new Date().getTime();
      timeTaken = endTime - startTime;
      testing += timeTaken + "\n";
    }
    alert(testing);
    
  • Posted on

    So in other news, Bill Gates has regained his title of the world’s richest man with a fortune that is valued at 72.7 billion US dollars. That's right he's back on top of the list. The last time he was on top was in 2007. You know how much is 72.7 billion dollars? Read on.

    The words million and billion are used so frequently (often together), we fail to recognize just how big a billion really is. Perhaps it is because these words sound so similar to each other.

    So how much is a billion really?

    In the short scale, numbers progress such that a new term greater than million is a 1,000 times the previous term. Thus,

    A million is thousand thousands; that is 1,000,000

    A billion is a thousand millions; that is 1,000,000,000 and so on and so forth

    Here’s an exercise that is guaranteed to blow your mind. Let’s calculate how much is a million seconds. For the sake of readability I am going to round-even all calculations.

    A minute has 60 seconds, so dividing 1,000,000 by 60 gives us 16667 minutes.

    An hour has 60 minutes, so dividing 16667 by 60 gives us 278 hours.

    A day has 24 hours, so dividing 278 by 24 gives us more or less 12 days.

    That’s how big a million seconds is. 12 days.

    And if you thought that was big, let’s do the same thing a billion seconds.

    A minute has 60 seconds, so dividing 1,000,000,000 by 60 gives us 16666667 minutes.

    An hour has 60 minutes, so dividing 16666667 by 60 gives us 277778 hours.

    A day has 24 hours, so dividing 277778 by 24 gives us 11574 days. That doesn't seem right..... right? Nope. The math checks out.

    A month has, on an average, 30.5 days, so dividing 11574 by 30.5 gives us 379 months.

    A year has 12 months, so dividing 379 months gives us 32 years.

    That’s how big a billion seconds, 32 years.

    Mind blown yet? And don't even get me started on the long scale.