Obsessed with pigeons

File:Pigeon portrait 4861.jpg - Wikipedia 

>  This seems to be the only interesting thing in the simulation.


> I love and adore this bird. It may appear a bit silly, but it’s actually quite intelligent.


> It doesn’t trust people easily, but once it bonds with you, you become its whole world.

> Often mistreated by humans, it’s unfairly disliked by city dwellers for no reason.

> When I heard Tesla was obsessed with pigeons few years before, I thought he was insane. Now I understand why he was so captivated.

> The most fascinating trait I’ve noticed is its seemingly nihilistic nature. Surrounded by predators, with limited food and water and slim chances of survival in the wild, it ignores all threats as though it has accepted its fate, staying calm even in the face of danger.

 

Nihilism be like : r/memes 

 

 


Share:

27 years of revolving around the sun

the below article is just my random thoughts..

Social Humour: Twitterati spots photo of a man leisurely smoking beedi,  turns it into a viral meme - The Times of India

The more i spend living my life, more it feels like a simulation. Its mostly like playing a boring game with no interesting stuff coming up. I am not even depressed or suicidal, i am content with myself. 


doug the lawyer I shouldnt be here (with text) fnaf - Imgflip


Sometimes i just feel like an NPC trying to do my part without questioning why I do what I do.

Share:

Leetcode milestone update, Reached 300



I managed to solve 300 in ~ 2 months, at this point i am quite comfortable with lot of topics. I am planning to focus my efforts on only solving hard rated challenges to improve my understanding. While i understand that it will be a frustrating experience, i would like to go through it :-)




Share:

Basic Calculator 2

 I always wondered about how to parse and execute complex numeric expressions, even though i did that my programming language agaram , i did that in a very different way ( using recursion ). So the problem statement here wants us to implement a program which parses the numeric expression. The expression consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces and they guarantee that the expression would be valid. 

Share:

LC trick to parse number from a list of characters

 Lets say you have a string "leet23code" and you want to parse the characters as number 23, and you are not allowed to typecast after collecting the complete number "23" as string.

Its not really a trick but its just a nice way to build the number from string. 

The obvious way to do this is by multiplying the position of digit in number and adding it, for example 23 can be represented as

(2 * 10 ^ 1 ) + (3 * 10 ^ 0)

we would need to keep track of the power of 10 to build the number

something like


power = 0
my_number = 0
for c in s:
if c.isnumeric():
my_number += int(c) + 10 * power
power += 1


 This is  nice and easy to  understand, but there is even a better trick than this

def parse_number(self, s):
my_number = 0
for c in s:
if c.isnumeric():
my_number = my_number * 10 + int(c)
return my_number

 This reduces the need for keeping track of power, because we knew power is incremented every time.


Share: