Latest Posts

  • An elevator pitch for this blog

    Hey there interested reader

    I was just reading this book on how to take short steps to drastically improve a blog and the first tip was to come up with an elevator pitch both short and long. The short to make people get hooked and the long one to further educate them on the blog and maybe even, potentially, to convert them into avid readers of the blog.

    Defining the audience

    The things that I will be initially covering on this blog are programming stuff, philosophy and personal goals and projects that I will be working on. Having said that, things will change too and, who knows, even see the light of the day. What?

    So, I guess, the readers would be peolple interested in programming, philosophy, and related things. And these mostly would be professional people, that I can predict.

    Naming the website

    The title currently just says ‘hammad.blog’, same as the internet address. Let’s name this blog “The Lomekwian” after the 3.3 million years old tools discovered in Keyna. As I have discussed before on the blog, these are the oldest man-made thing known. One of the tools discovered is an anvil, so I guess a weird anvil would be an interesting logo for the site.

    Does this blog solve any real problems?

    I guess not really any problem that is critical at the moment. But I’ll be covering complete JavaScript and Haskell tutorials, they might come in handy.

    There you go: the short one

    “The Lomekwian is my personal blog. Reading it will make you wicked smart.”

    Here it is: the long one

    *The Lomekwian is a blog that exists, at large, as the thought product of its sole author, Hammad, a place where he shares his passions, projects, adventures and goals, and finally while leaning as a symbol of human presence”

    Using the elavator pitch

    I will try putting this on as a tagline below the website title and include it in the about page.

    Till then

    See you in the next episode.

  • A Blog Pitch

    Table of Contents

    1. Table of Contents
    2. Genesis
    3. The creation of a blog;
      1. Art direction
      2. Blogging as a medium
      3. Blogging goal: December 2019
    4. Studing history through internet history
    5. Keyboard Only
    6. Renaissance Man
    7. OCD
    8. Predicting behavior
    9. Aesthetics
    10. That’s all folks

    Genesis

    I have cut out many headings but it still is a lot. These are some of the few things that I intend to post here, on this blog. This post acts as a little collection of things to make me remember and easily achieve the 30 posts goal of this month. Sorry for this post being heavily unedited.

    The creation of a blog;

    In 2011, Sonia Harmond, a French archaeologist discovered the Lomekwi 3 stone tools in Kenya near the town of Lomekwi. These tools have been discovered dating to 3.3 million years, making them the oldest tools ever found. Lomekwi 3 is the name of the archaeological site where the tools have been found. Among the tools, are anvils. Anvils are metalworking tools. But the meaning of an avil below is beyond its use. It symbolises utility and technology and primitive tools.

    The oldest known cave paintings are as old as 44,000 years old. These are of animals like deers and bisons

    The Epic of Gilgamesh and the Pyramid texts are one of the oldest works of literature. These works tell stories that have become part of new cultures and have constantly been transfered throughout history and still remain alive. These stories try to make sense of what is means to be alive, have consciousness, to communicate with symbols, and run out of chaos.

    The Knap of Howar, a farmstead on an island of Scotland, is one of the oldest buildings in the world.

    These old thinggs are still with us and we might be made up of the same particles that the people who made the Lomekwi tools were made of. And that is absolutey crazy.

    Drawing a parallel, I’m like those people and thig blog as a whole and this post in particular is like an anvil or painting. And this thought fills my heart with deep peace.

    Art direction

    I was watching the Graham Norton Show the other day, and found the art direction to be better than most comedy talk talks. Everthing, the intro animation, music, the stage design, the host’s manner of talking, the jokes, the atmosphere and the mood established was unchanging and coherent throughout the show. I will experiment art direction on this blog to see how it goes.

    Blogging as a medium

    This blog will also explore as an art form. How blogging acts as a representation structure of the mind, the changing self, and the forever flow of symbols and everything. How the medium itself can be enhanced

    Blogging goal: December 2019

    The near-future goal is to publish at least 30 posts before 2020. And hopefully keep a strong pace and keep publishing throughout my life. Maybe hundreds of thousands of posts, who knows?

    Studing history through internet history

    Finding patterns in that time period because it is definitely the most documented epoch of time and the one we are currently living through.

    Keyboard Only

    I know many keyboard shortcuts and hardly even use the mouse/touchpad. But this time I’m going full keyboard meaning that I will gradually and gracefully reduce the usage of any graphical user interface like the file manager or the browser. I will keep updating here on this blog on any steps that I take to go Keyboard Only. Let’s call this Project K.

    Renaissance Man

    Before I turn 30, I plan to become a professional/academic/full-time renaissance man. This will include completing Khan Academy, reading Britannica, reading the dictionary, doing the material from edX/Coursera/MIT OCW, making projects and experimenting and doing everything. Let’s call it Project R.

    OCD

    OCD is kind of like a disability. I have dealt with mental rituals and visual symmetry anxiety since I was very young. All of these have subsided by now but caused a great lot of anxiety in older days. I will try to share my personal experiences and try to make sense of everything. Let’s call it Project O.

    Predicting behavior

    After I had finished watching Revolutionary Road, a drama directed by Sam Mendes based on the 1961 eponymous novel by Richard Yates, during some time thinking about the film, mainly based on the plot, I realized that human behavior can be completely mechanically predicted. Whether or not this is true, it sparked a deep fascination with being able to predict human behavior, in everything including meeting people to those of different kinds of professions to those of different eras and cultures. What makes one person laugh or other doesn’t? What is the nature of emotions, moods and atmospheres in a person? Maybe there can be mathematical forms for these kinds of things or not. I’m calling all activity in the domain Project B.

    Aesthetics

    What is the meaning of art? How art interacts with a person? Who makes art? Why do people make art? What defines a film or a painting or any art form? How do you differentiate art from anything else? What is the difference between a film on TV versus on a mobile phone? All these kinds of questions and other, I’m including in Project A.

    That’s all folks

    That’s is mostly what I’ll be sharing through this blog. I would love to see your comment and would try to reply to every single one.

  • Variables in JavaScript

    Table of Contents

    1. Table of Contents
    2. Introduction
    3. What is a variable?
    4. Declaring a variable
    5. Declaring multiple variables at once
    6. Changing the value
    7. Rules for declaring variables
    8. Constants

    Introduction

    In this tutorial, we are going to discuss JavaScript variables, what they are, how they are used and other tangential topics along the way.

    What is a variable?

    A JavaScript variable is a storage for data with a name. The data in a variable may be changed any number of time after set. You may think of a variable as a box with a label on it. Inside this box, you may put anything you want. And you may use this box for any purpose you can imagine. The idea of a variable is more visceral than it is definitive. You will probably completely grasp the its essence after using it a few times.

    Declaring a variable

    A variable can be declared, that is created , with the let keyword followed by the name of the variable, followed by an equal sign, follwed by the value, and that’s it:

    let puppets = 99;
    

    The above statement declares a variable named puppets and assigns it the number 99. That is not the only way to do it. You may first only declare the variable name. And then after that you may or may not assign a value to it. Like this:

    let bugs;
    
    bugs = 98;
    

    After a variable has been declared, it may be accessed if needed. Like you can alert the contens of a variable just by putting the name of the variable in between the brackets:

    alert(bugs)
    alert(puppets)
    

    Declaring multiple variables at once

    You can also declare an infinite number of variables with a single let keyword. Let’s have a look at this example:

    let ants = 97, peacocks = 96, sparrows = 95, butterflies = 94;
    

    While you can do this and get away with this so easily, yet may not grow up to adore this as much as you are doing now sitting there reading this. For the sake of readability, always consider declaring variables line by line.

    let ants = 93;
    let peacocks = 92;
    let sparrows = 91;
    let butterfiles = 90;
    

    Although, I got those numbers wrong, you may now have an appreciation for the readability this multi-line variant brings. Embrace it. Move on.

    Weird ways you can declare variables include doing these:

    let ants = 89,
        peacocks = 88,
        sparrows = 87,
        butterflies = 86;
    
    let what = 85
      , does = 84
      , it = 83
      , even = 82
      , mean = 81;
    

    Changing the value

    You may change the value of a variable any time you like:

    let bottles = 80;
    bottles = 70; // value changed
    alert(bottles); // outputs 70
    

    Rules for declaring variables

    Following are the rules for the legal ways to declare variables in JavaScript:

    • Variable names must contain only letters, digits, underscores (_), and/or dollar signs ($).

    • The variable butterfly is different from Butterfly. So, variable names are case sensitive.

    • Variable names cannot start with a digit. So 5fortune is an illegal name.

    • You cannot use reserved keywords as variable names. These inlcude words used by the language as syntax like: let, class, if, function, return, etc.

    Constants

    You can also declare objects which cannot change value. These are called constants. They are declared with the const keyword.

    const paintings = 79;
    

    Once the above statement is executed, the following statement would result in an error:

    paintings = 78;
    
  • Numbers in JavaScript

    Table of Contents

    1. Table of Contents
    2. Introduction
    3. Numeric Types in JavaScript
    4. JavaScript Numbers
    5. Scientific Notation
    6. Numbers & Strings
    7. Precision
    8. NaN (Not a Number)
    9. Infinity & -Infinity
    10. Hexadecimal

    Introduction

    Numbers are the building blocks of programming logic. Themselves being so simple, natural, and metaphysical, they prevade almost all programming tasks. In this tutorial, we’ll discuss how numbers are used in the JavaScript programming language.

    Numeric Types in JavaScript

    JavaScript has two numeric types: Number and BigInt.

    JavaScript Numbers

    Unlike many other programming languages, JavaScript has only one type of number that is, number, itself. Since JavaScript has dynamic types, any variable can be used to hold a certain data type such as number:

    const food_items = 13;
    

    Scientific Notation

    You can also use scientific notation to store numbers conviniently which would otherwise be difficult to maintain in plain notation. Here’s how you do it:

    const microorganisms_in_jelly = 7.89e13;    // 78900000000000
    const tiny_share = 9.7e-6;                  // 0.0000097
    

    Numbers & Strings

    What happens if you add a number and a string? String Concatenation.

    1 + "2" // 12
    1 + 2 + "3" // 33, since the JavaScript interpreter works left to right
    

    Precision

    In JavaScript, integers are only precise up to 15 digits.

    99999999999999999999999999999999 // 1e+32
    98989898989898998989899898989898989898989898989898989 // 9.8989898989899e+52
    

    NaN (Not a Number)

    NaN is a special value of Number, despite not being a number. This property indicates that the value is not legally a mathematical number. These cases show when it’s returned:

    99 / "two" === NaN          // true
    Math.sqrt(-1) === NaN;      // true
    parseInt('number') === NaN; // true
    parseInt('NaN') === NaN;    // true
    parseInt(NaN) === NaN;      // true
    

    Note:

    NaA === NaN         // false
    Number.NaN === NaN; // false
    // And
    99 / "2" === NaN    // false
    

    NaN is rarely used in writing a program.

    Infinity & -Infinity

    In JavaScript, Infinity and -Infinity are special values of Number. Positive infinity is greater than any other number including, Infinity, itself. The JavaScript infinity behaves similar to the mathematical infinity:

    Infinity * 3 = Infinity;    // any positive number times Infinity is Infinity
    Infinity * -3 = -Infinity;
    
    3 / Infinity = 0;           // any number divided by Infinity is 0
    1 / 0 = Infinity;
    

    Note:

    Number.POSITIVE_INFINITY ===  Infinity;    // true
    Number.NEGATIVE_INFINITY ===  -Infinity;   // true
    

    Hexadecimal

    Numbers are, by default, decimal in JavaScript. To have a hexadecimal number, just precede it with 0x:

    0x66 === 102;   // true
    0x4 === 4;      // true
    oxFA === 250;   // true
    
  • How to Write a Technical Tutorial

    Table of Contents

    1. Table of Contents
    2. Introduction
    3. Define the topic
    4. Define the scope and depth
    5. Define the reader
    6. Break it down
    7. Define the individual units of the tutorial
    8. Resources
    9. Content
    10. Group the units to form macro units
    11. Group macro units into form large parts
    12. Define a purpose
    13. Form a holistic narrative
    14. Edit the first draft
    15. Proofread
    16. Define a title

    Introduction

    This guide serves to lay out the process of writing the perfect tutorial and the art and science behind it.

    Define the topic

    Purposefully select a topic for a tutorial.

    Define the scope and depth

    Define the scope of the tutorial as to how much of the topic and what aspects of the topic the tutorial will cover.

    Define the reader

    • Someone who has never developed before
    • Junior developer
    • Mid developer
    • Senior developer
    • Old master

    Break it down

    Break the topic down into a table of contents

    Define the individual units of the tutorial

    Are there going to be examples, code samples, images, animated images, videos, quotes, etc

    Resources

    Gather the resources for reference.

    Content

    Fill those units with content

    Group the units to form macro units

    Group relevant units into macro units so they form a micro narrative that consistently flows as it is read.

    Group macro units into form large parts

    Group relevant macro units into large parts of the tutorial

    Define a purpose

    Define a singular and visceral purpose (may be composite of other purposes) of the tutorial

    Form a holistic narrative

    Form a holistic narrative and arrange all of the content in pertinence to the visceral purpose.

    Edit the first draft

    Edit the first draft with the purpose in mind.

    Proofread

    Proofread the tutorial in a site like Grammarly.

    Define a title

    Define a title that will both represent the tutorial itself and help the user find most easily.

  • The First Edge

    Photo by Nathan Shipps on Unsplash

    What makes you work today at peak performance may not work itself tomorrow. Do you need willpower or motivation? A todo list, a plan, a system, grit, perseverance, a the perfect routine(s)? Do you need all of them? When exactly will you get started on your plan? When will you start to remain true to it consistently? When, finally, will you evolve out of this anarchy into the special person you thought you always were? When will this picture of reality and that of the dream overlap to fully fit and not form some form of distorted misery? Maybe you are near. How will you get your special and ideal future self to share a shadow with you?

    This is my first post here and eventually one of the thousands. I plan to document my life, thoughts, and endeavors that I plan to pursue this year, in the posts to come. I actually have a lot of disconnected wires in my brain that are begging to get connected and be able to let a good amount of charge flow to the destination. It’s important to get those wires assembled because there is no destination without a journey. And the ugly part is that I focus too much on the destination without paying any heed to the journey itself. Those charges are a bunch of essential things that I must do on a rigorous schedule. But, unfortunately, I’ve only been paying a little amount of time on the most important things and when I do, it’s just a few minutes sooner or later in the day, in which I just get bogged down in the intricacies of the most unimportant parts of the most important things.

    To change the course of my life from going the unintended way, I’ve decided to refrain from the support of willpower, motivation and other such things as getting engrossed in making deep plans, systems or anything of that nature which holds me back from starting. And that start doesn’t have to be good. It’s to be a mere start. A small edge to get by. It’s to hold to small edges and finding other edges to strengthen your grasp. Sooner, you would be completely grasping it. And, one day you would be on top of it. Your real shadow would abide by the boundaries, size, and shape of that idealistic and futurist shadow of that special someone — the near future you.

    What you first need to do is to find an edge, not to do anything special, but to get a hold just enough to save you from falling. And, every day, you keep holding it and move ahead while being on the lookout for new edges, or maybe old edges you know but never had a swing from. For me, it is this blog post that’s the first edge.

    You must act now. You first edge maybe a post like this. It may be a small video, it may be a paragraph or a walk — you already know it, don’t you? Go take the plunge.

    Your failure to act may make you the person you never intended to be. Take control of your mind. Separate yourself from your body. Let your identity hold your consciousness accountable.

    Act.

subscribe via RSS