Friday, December 2, 2016

Entrepreneur

The objectives and targets always came from us. Who's giving them to him now?
Scary version? He is.

Friday, November 11, 2016

You are what you eat

By knowing what is your natural food is, you can improve your health and your lifespan.

People who live longer do so precisely because they are in better health than others of the same age. This means having a healthier body, a stronger immune system, and lesser cell degradation.

Do you know that vegetarians live 9 years longer than meat eaters of similar environmental and genetic makeup?
That it takes 25x times more resources to feed a meat eater, than a vegetarian?
That the meat industry creates more green house gases than all other industries put together?
That we are brutally killing 2 billion intelligent and sentient beings a week, for food that is slowly killing us as well as the planet?

There is an immense amount of misinformation put out there by people with vested interests. Do the research yourself, and you can live a healthier happier life while doing more good for the planet.

Thursday, November 10, 2016

Justice and Revenge

Justice is about balance, not revenge. Revenge is a waste of time and energy. It's a purely emotional reaction.

Where is the justice in imprisonment? It doesn't help the victim. It consumes valuable taxpayer money. Imprisonment is more revenge than justice.

Real justice is in getting the perpetrator to compensate the victim, in a manner satisfactory to the victim.

Monday, November 7, 2016

Strength is the first virtue

“Strength is the first virtue,” Alera said. “That is not a pleasant fact. Its distastefulness does not alter the truth that without strength to protect them, all other virtues are ephemeral, ultimately meaningless.”
― Jim Butcher, First Lord's Fury

Sunday, November 6, 2016

Dishonesty

Most people lie — not because they're bad people but — simply because it's usually the easier option.

Honesty and Integrity come with significant short-term costs.

Most people simply don't have the strength of character (except on screen) to bear that cost and do the right thing, or the foresight to realize that the long-term costs of dishonesty are higher.

Then there is the more specific issue of lying to oneself.

Denial may cost one victory, but it does make defeat easier to handle. So put simply, denial is a strategy that works whether one wins or loses. Given a lower probability of victory, denial is the more practical strategy.

Or as the ancients simply said, ignorance is bliss.

Friday, November 4, 2016

The Myth That Plant Based Foods Are Poor Sources of Protein

Some of the toughest and longest-living animals are herbivores, while carnivores usually hunt in packs and live relatively short lives.
Carnivores typically have short digestive systems, whereas humans have longer digestive systems similar to those of herbivores. Human canines too are closer to those of apes, which are primarily for self defense.

This is the reason meat eaters are more prone to colon cancer and other serious health issues, age faster, and — on average — live 9 years less than vegetarians.

A plant-based diet that includes oats and beans covers all essential amino acids in quantities sufficient even for bodybuilders. A plant-based diet also reduces stress, and provides one with plenty of dietary fiber and other valuable nutrients.

Thursday, October 27, 2016

Shortest Code For Generating Prime Numbers

<?php


for ($i = 1; $i < 1000; $i++)
{
    $print = TRUE;
  
    // Optimized till square roots
    for ($j = 2; ($j*$j) <= $i; $j++)
    {
        $print = FALSE;

        if ($i % $j == 0)
            break;
      
        $print = TRUE;
    }

    if ($print)
        print $i.',';
}


?>

Wednesday, October 26, 2016

The Essence of Computer Programming

Computers are basically for the automation of repetitive work.
So programming computers is essentially the art of automation of repetitive work using loops.

Thus, the most essential thing one needs to understand to program computers is how to write loops.
That covers everything essential.

PS: Recursion is assumed here to just be a more advanced form of a loop, which is just a more elegant solution for certain types of problems.

C Code for Numerology 9999

Got a strange request from a friend:

Generate all 4 digit numbers whose recursive sums evaluate to nine, and whose non-zero digits are in ascending order.

Anyway, here's the code.

First run as usual :-) Apart from a few syntax corrections.
No logical errors.

<?php


for ($i = 9; $i < 10000; $i++)
{
    if (isAsc($i))
    {
        if (isSumNine($i))
        {
            if ($i < 10)
                print '000'.$i.PHP_EOL;
            else if ($i < 100)
                print '00'.$i.PHP_EOL;
            else if ($i < 1000)
                print '0'.$i.PHP_EOL;
            else
                print $i.PHP_EOL;
        }
    }
}


function isSumNine($num)
{
    $temp = $num;
    $sum = 0;

    while ($temp > 0)
    {
        $sum += $temp % 10;
        $temp = floor($temp / 10);
    }

    if ($sum > 9)
        return isSumNine($sum);
    else
        return ($sum == 9);

}


function isAsc($num)
{

    $temp = $num;
    $digit1 = 0;
    $digit2 = 10;

    while ($temp > 0)
    {
        $digit1 = $temp % 10;
        $temp = floor($temp / 10);

        if ($digit1 > $digit2)
            return false;

        if ($digit1 > 0)
            $digit2 = $digit1;
    }

    return true;
}

?>

Easiest Way To Run Code on Mac OSX

Most links will tell you to install XCode so that you can use GCC to run C / C++ code.

You don't need to. The easiest way is to use the existing PHP program on your Mac OSX.

Monday, October 24, 2016

New Perspectives and Pigs

"I learned long ago, never to wrestle with a pig. You get dirty, and besides, the pig likes it." 
- George Bernard Shaw

It's important to keep and open mind, and expose oneself to new perspectives.

But it's also important to understand when a certain perspective is simply wrong. Or in other words, at some point, you just have to stop wrestling with pigs.

Saturday, October 22, 2016

Indian American Hypocrisy

I see the same Indian Americans who wholeheartedly support Hillary and abhor Trump express horror when their kids — who they've spent 100s of thousands of dollars educating — turn into gay hippies.

Thursday, October 20, 2016

Why Avoid Political Arguments

Different degrees of knowledge, confidence, and no clear results.
Somewhat similar to why involvement in politics itself can be fruitless.

Only have political discussions, not arguments.

Tuesday, October 18, 2016

Why HR Has No Place In A Tech Organization

Here's another typical tech interview, which seems like any other interview I've faced.

The recruiter knows so little that there isn't even any point to the conversation.

This is why I believe that HR — which has its roots in the manufacturing industry — has no place in an innovation focused tech organization. HR is obviously a natural fit for software services.

But you can't replace a race horse with two cart horses.

Then there's the whole issue of legislation driven employment, which is probably on its last legs anyway.

Saturday, October 15, 2016

Jobs Are For Women

Men have a genetic predisposition for risk taking, and are inherently better suited for Entrepreneurship than for jobs.