The things you own end up owning you

“The things you own end up owning you.” - Chuck Palahniuk.

I was minimalist. It was very easy and stress-free life. I did own many things but but only after careful planning and I was quick to sell things that didn’t meet my expectations or once I stopped using them.

I also used to live well below my means. I felt free because loss of job or any other financial crisis would not affect me much.

Favorite Movies

  1. Oppenheimer
  2. The Matrix
  3. Vivarium
  4. The Social Network
  5. Joker
  6. Moneyball
  7. The Founder
  8. The Big Short
  9. The Wolf of Wall Street
  10. Dil Se
  11. Taare Zameen Par
  12. 3 Idiots
  13. Crash
  14. Crouching Tiger, Hidden Dragon
  15. Life Is Beautiful
  16. Pan’s Labyrinth
  17. Scarface
  18. Pulp Fiction
  19. Fight Club
  20. The Lion King
  21. Raiders of the Lost Ark
  22. Enterglatic

Parenting is hard

Only when you have wrong expectations.

It is so easy to know what is right action but sometimes so hard to do it.

Ayden is having rough morning. Well he was having good morning until we took him to his soccer match. He got shy and didn’t want to play. I spend 45 minutes encouraging him. Getting frustrated. Getting embarrassed. Getting angry.

I wanted to leave.

I don’t know what is right behavior. What should have I done. Is it too much to expect your child to do what they wanted to do. If you don’t push your child will they never get out of their comfort zone and never grow. If you push too much will that cause them unnecessary anxiety when they will naturally grow up at their own pace.

Credit cards vs Pokemon cards

Ayden: I don’t want to lose my Pokémon cards

Amer: ok

Ayden: Pokemon cards are very important

Amer: how so?

Ayden: they have all the information about Pokemon. They are not like credit cards. They are better than credit cards.

The Highly Sensitive Parent by Elaine Aron

Could you be highly sensitive person? A highly sensitive person is someone who can get overwhelmed by various senses such as noise, smells, clutter that would not bother most people.

I got two kids and sometimes they both are crying and screaming at the same time. Their screams causes my neck, shoulders and arms to get stiff and I feel tingling or pins all over my arms. This sounds like heart attack and I am going to doctor to have it checked but quick search showed that this might be due to High Sensitivity towards noises or screams. And that’s when I learned about Highly Sensitive People aka HSP.

It is so hard to choose

Ayden deciding his career:

“There are so many cool job, I want to be fireman, goalie, dad, police officer, monster truck driver.”

Backup VPS

Here are simple steps to backup your VPS.

Backup MySQL database

Create a directory to store the backup files. Then run mysqldump command to backup your database.

mysqldump -u your_mysql_user -pyour_mysql_password your_database_name > /path/to/dump_$(date +\%Y\%m\%d\%H\%M\%S).sql

Or you run it as supersuer and backup all databases in once.

sudo mysqldump --all-databases > /path/to/dump_$(date +\%Y\%m\%d\%H\%M\%S).sql

To automate this, schedule a cron job that will run this command on a daily basis.

crontab -e

Insert the following line to execute the mysqldump command every day at midnight.

A quick script to build and deploy hugo site on VPS

I had been using GitHub and Netlify for this site but lack of some features such as access to server logs finally got too much. So I decided to move this blog to my VPS.

One thing I really love about using Github is CI/CD and Github Actions. But I wanted something even simpler with less dependencies. So I decided to use a simple bash script to build and deploy the site.

Past Performance Does Not Guarantee Future Results: A Reflection on Human Nature and Trading Strategies

It’s both intriguing and somewhat disheartening to observe how trading concepts often mirror human behavior. Here’s how:

Follow the Trend

In the investment world, the saying “past performance does not guarantee future results” is well-known. Despite this warning, many successful trend followers have found that stocks moving up generally continue to do so, and vice versa.

Interestingly, this concept applies to humans as well. Those who are happy and kind often continue in the same manner or even improve, while those who are miserable tend to spiral downward.

Zygo: Finally listen to everything while swimming

I love swimming but it is hard to swim for more than 30 mins, not because I get tired but because it gets boring.

I had been looking for headphones for swimming but almost of all them are essentially mp3 players. That is because Bluetooth doesn’t pass through water very well. You need to pre-load songs or mp3s. Which would be fine if you only care for music. But I am mostly listening to news or audiobooks. It seems like too much work to use those headphone for anything but music.

Hello Facebook

This is a test post and that’s okay.

Minimalist and Maximalist

In my view, horizontal spaces should be minimalist and vertical spaces can be maximalist. This way you will have a lot of horizontal space to sit at, write on. And walls covered in art to entertain you and also reducing echos and creating quieter space.

Fake Plastic Plants

To me fake plastic plants means that one is too lazy to take care of real plants but they want to pretend to be someone who they are not.

Nothing wrong with not wanting to take care of real plants. But why not decorate your place in a way that reflects who you are.

How to find the other end of deck drains?

In our backyard lay a series of deck drains that perennially harbored standing water. Despite my best efforts, tracing the end of these drains proved to be an elusive task, seemingly due to the fact that it was compacted and buried beneath layers of earth.

I even ventured to employ a drain snake to address the issue, but the screws securing the drain covers were victims of rust, rendering them immovable.

Favorite Movies

My favorite movies in no particular order:

  1. Matrix
  2. Automata
  3. Lion King
  4. the Pursuit of Happyness
  5. The Social Network
  6. Jobs
  7. Scent of Woman
  8. John Wick
  9. Wild
  10. Hangover
  11. Apollo 10 1/2
  12. tick, tick, BOOM!
  13. taare zameen par
  14. The Founder
  15. My Octopus Teacher
  16. Hachi

Script inherits from native type ‘RigidBody2D’, so it can’t be assigned to an object of type: ‘Node2D’

Getting this error while following this tutorial in Godot v4.0.1.

In my case, I had added Node2D. The fix was to right click on the problem node under scene and click Make Scene Root. And then delete Node2D.

Here is what diff looked like:

diff --git a/2d-game-tutorial/Mob.tscn b/2d-game-tutorial/Mob.tscn
index 9eb1630..e720d7f 100644
--- a/2d-game-tutorial/Mob.tscn
+++ b/2d-game-tutorial/Mob.tscn
@@ -48,20 +48,18 @@ animations = {
 radius = 36.0
 height = 100.0

-node name="Mob" type="Node2D"]
-script = ExtResource("1_73gb4")
-
-node name="RigidBody2D" type="RigidBody2D" parent="."]
+node name="RigidBody2D" type="RigidBody2D"]
 collision_mask = 0
 gravity_scale = 2.66454e-15
+script = ExtResource("1_73gb4")

-node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="RigidBody2D"]
+node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
 scale = Vector2(0.75, 0.75)
 sprite_frames = SubResource("SpriteFrames_c1yjy")
 animation = &"walk"

-node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D"]
+node name="CollisionShape2D" type="CollisionShape2D" parent="."]
 rotation = 1.5708
 shape = SubResource("CapsuleShape2D_h1pjc")

-node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="RigidBody2D"]
+node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]

Throwback: Skydiving in DFW

This was in 2011. More than 12 years ago. Still one of my favorite memory.

View from skydiving plane just before jumping Skydiving in Dallas Skydiving in Dallas Skydiving in Dallas Skydiving in Dallas Skydiving in Dallas Skydiving in Dallas Skydiving in Dallas Skydiving in Dallas Skydiving in Dallas Skydiving in Dallas Skydiving in Dallas Skydiving in Dallas Skydiving in Dallas Skydiving in Dallas Skydiving in Dallas Skydiving in Dallas

Minimalist Wardrobe as suggested by GPT-4

A minimalist wardrobe for a 42-year-old man who works from home should be focused on versatility, comfort, and style. Here’s an itemized list of wardrobe items, including the suggested quantity of each item, colors, and styles:

  1. T-shirts (6-8)
    • Colors: Black, white, gray, navy
    • Style: Crew neck or V-neck, fitted or slightly loose
    • Colors: Black, white, gray, navy
    • Style: Crew neck or V-neck, fitted or slightly loose
    • Colors: Black, white, gray, navy
    • Style: Crew neck or V-neck, fitted or slightly loose
  2. Long-sleeve shirts (4-6)
    • Colors: Black, white, gray, navy
    • Style: Henley or crew neck, fitted or slightly loose
  3. Button-up shirts (4)
    • Colors: White, light blue, chambray, a subtle pattern or plaid
    • Style: Collared, long-sleeve, slim or regular fit
  4. Sweaters (2-3)
    • Colors: Gray, navy, black
    • Style: Crew neck or V-neck, slim or regular fit
  5. Hoodie or zip-up sweater (1-2)
    • Colors: Black, gray, or navy
    • Style: Minimalist design, slim or regular fit
  6. Jeans (2-3)
    • Colors: Dark wash, medium wash, black
    • Style: Slim or straight fit
  7. Casual pants or chinos (2)
    • Colors: Navy, khaki
    • Style: Slim or straight fit
  8. Lounge pants or sweatpants (2)
  9. Colors: Black, gray
  10. Style: Slim or regular fit, comfortable material
  11. Shorts (2-3)
    • Colors: Navy, khaki, gray
    • Style: Flat front, mid-thigh or knee-length
  12. Underwear (10-14)
    • Colors: Black, white, gray, navy
    • Style: Boxer briefs or briefs, comfortable material
  13. Socks (10-14)
    • Colors: Black, gray, white
    • Style: Ankle or crew length, some dress socks for formal occasions
  14. Sleepwear (2-3)
    • Colors: Black, gray, navy
    • Style: Comfortable pajama sets or sleep shorts, soft material
  15. Casual shoes (1-2)
    • Colors: Black or brown
    • Style: Minimalist sneakers or loafers, versatile and comfortable
  16. Dress shoes (1)
    • Colors: Black or brown
    • Style: Oxfords or Derby shoes, appropriate for formal occasions
  17. Sandals or flip-flops (1)
    • Colors: Black, brown, or navy
    • Style: Comfortable and practical for warm weather
  18. Jacket (1-2)
    • Colors: Black, navy, or gray
    • Style: Lightweight or medium weight, versatile design (e.g., bomber, Harrington, or denim jacket)
  19. Coat (1)
    • Colors: Black, navy, or gray
    • Style: Warm and stylish, such as a wool overcoat or a parka
  20. Accessories (minimal)
    • Belt: One black and one brown, matching the color of your shoes
    • Watch: One versatile and minimalist wristwatch with interchangeable straps (black and brown leather, or a metal band)
    • Scarf: One or two scarves in neutral colors (black, gray, or navy) for colder weather
    • Hat: One casual hat (e.g., beanie, baseball cap) in a neutral color for sun protection or warmth
    • Sunglasses: One pair of classic, versatile sunglasses (e.g., aviators, wayfarers) with a neutral frame color

Zayn's Words

Dada - Dolphin

DoDo - Shark

Kaka - Orca

Meow - Cat

Moo - Cow

Kaykey - sticker

How much can you really get out of a 4$ VPS?

I am a big fan of cheap VPSs. I start many personal projects, bring up a VPS, play around and then wipe it. Never have to worry about accidentally running up bill in 100s or 1000s of dollars. I run this blog on $4 server.

So this was interesting to read how far can a cheap VPS go.

Blue Thunder and Moon

Ayden was a curious and adventurous five-year-old boy who loved nothing more than riding in his favorite monster truck, Blue Thunder. He spent hours each day practicing and perfecting his skills, always dreaming of one day becoming a professional Monster Jam driver.

One day, as Ayden was practicing his jumps in the backyard, he suddenly found himself soaring higher and higher into the air. Before he knew it, he was hurtling through the atmosphere, leaving the Earth far behind.

Everyday is a vacation

I think a lot of people would love to live their life as if they are on a permanent vacation. Before I was married, I didn’t make a lot of money but felt like that everyday was a vacation.

For me, vacation means:

  1. Eating out/not cooking
  2. Not cleaning
  3. Spending time outside
  4. Not working
  5. Ready to travel

Eating out is cheaper than cooking, if you are not picky. I ate mostly fast food. Of course, it is not healthy but it is vacation. Also it is still better than overeating home-cooked meals.

Ultra light dev setup

Simplification of dev setup:

  1. VPS
  2. Docker
  3. vim/neovim
  4. iPad Pro 11 + Keyboard
  5. Blink shell

Apps to develop

  1. web apps
  2. apis
  3. text generator using ai
  4. number crunching/data science python/R
  5. blogs
  6. command line games and apps
  7. php/js/go/python/ruby/c/c++

Time to plant

Yesterday, I ordered some tissue culture and planting supplies.

Indoors plants market is huge. There is a lot to learn. There are new terms, new communities to join. But it is pretty exciting.

The main reasons I decided to explore this space is because:

  1. It is slower paced. Cannot pull all-nighter to make plants grow faster.
  2. My kids should enjoy it. And I can get them involved.
  3. There are interesting methods to master like creating perfect environment for optimal growth, growing exotic plants, etc.
  4. It can be scaled to more commercial operations, renting a greenhouse or something similar.
  5. Plants are good for the planet.
  6. If it fails, I will have plants for our home.

Heros

Follow up to my last post, the people I admire the most are usually startup founders or business people. And then creators of open source softwares.

This weekend, I also met my engineer turned entrepreneur friend and saw Jobs movie. It seems I know what I should do.

I want a business that gives a lot of freedom, especially freedom to be with my kids. If I can involve kids in the business, it would be even better. Would love low stress business but it is not a requirement.

What you should do with your life

“What should you do with your life”, this the question I almost ask myself daily. I am still not sure what should be my long-term goals.

I have gone back and forth between pursuing my hobbies as a career, focusing on corporate career, and starting businesses.

Recently, I learned a simple question that can provide you insights into your deeper aspirations. The question is:

Who are your heros?

Ask yourself who are your heros, who do you feel inspired by, who do you read about, and who were your heros when you were a child.

My heart is growing bigger

Driving to Ayden’s first Monster Jam show earlier this, as AT&T stadium got in our view, he is getting excited. His heart was probably beating faster and he could probably feel it. He said the cutest thing ever, “Baba, my heart is growing bigger.”

Why Midlife Crisis?

I am not sure if women experience midlife crisis but I know several men who have experienced or are still in middle of midlife crisis. I have a theory that every 20 years, men need a big change.

Usually, there is a big change in 20s, people are moving out of their parents’ homes, going to college or starting their careers.

And when people turn 60, they are getting ready to retire. Downsize their homes.

Don't buy the house

We just recently bought a beautiful single family home. Before this, we lived in a townhouse. And before townhouse, I have lived in apartments. Buying a townhouse was a big step but buying single family home is a whole new beast.

First, buying a house is probably a sound financial decision. There are plenty of articles and research that shows people who own homes are financially better off.

But very few people talk about negatives of homeownership. And I think because lack of that information, a lot of people make incorrect decisions and end up regretting their home purchase. I did. I had huge buyer’s remorse the day we moved into our new home. I am still getting over it.

Oven Baked Beef Ribs

Found this receipe online, modified it a little and it is our favorite food right now.

Ingriedient

  1. 3 lbs meaty beef ribs, (grass-fed)
  2. 2-4 tablespoons olive oil
  3. 1 tablespoon garlic powder
  4. 1 tablespoon onion powder
  5. 1 tablespoon cajun seasoning
  6. 2 tablespoons sugar
  7. 1 teaspoon chili powder
  8. 1 teaspoon salt
  9. 1 teaspoon paprika
  10. 2 teaspoons oregano

Instructions

  1. Rinse ribs and dry COMPLETELY with paper towels.
  2. Lightly coat ribs in olive oil.
  3. Mix together seasoning and sprinkle generously over ribs, front and back.
  4. Place the ribs in a large ziplock bag or covered bowl and marinate in the fridge for 1-2 hours.
  5. Preheat the oven to 250 F.
  6. Place the ribs on a foil lined baking tray in a single layer.
  7. Add another piece of foil on top to create a pouch for the ribs to cook in. Be sure to seal the edges of the foil so that it’s tight and steam won’t seep out.
  8. Bake on the middle rack of 3 1/2 -4 hours.
  9. When the ribs are done to your liking, drain off the excess fat.
  10. Serve hot and enjoy!!

via https://divascancook.com/easy-oven-baked-beef-ribs-recipe-bbq/

10 Years Goals

There is a saying that we overestimate how much we can do in days but underestimate how much we can achieve in years.

Nothing makes a father as proud and happy as his children. My biggest guiding principle for my long term goals is to provide Ayden and Zayn an environment where they can grow to be happy and successful. Also it is important to realize that I cannot make anyone happy or successful. Only thing I can do is create an environment for them to grow in.

Digital Minimalism

Just the other day, I happened to skim a blog post, “My awakening moment about how smartphones fragment our attention span.” It struck a chord, and I realized that I’m in the same boat. It’s been ages since I’ve properly read a book. Even when I have audiobooks on, I’m doing something else and hardly ever genuinely enjoy them.

I’ve got this habit too, of kicking off loads of projects and then ditching them once it’s time to roll up my sleeves and do the detailed work. Setting up a new project is a rush, but finishing something? That’s a snooze fest.

It's What I Do: A Photographer's Life of Love and War by Lynsey Addario

It’s What I Do” by Lynsey Addario is probably in my top 10 favorite books. As someone who always wanted to be a serious photographer who would use images to make the world better place, I felt a real connection while reading this book. While reading it, I imagined myself being in the situations that Lynsey was in and I really don’t know if I would have been able to handle those situations.

Nightmares of 4 years old

  1. We are in our house on second floor. There is a giant lobster outside.
  2. There is Amazon delivery truck. There is a package. There is a car. The delivery truck is crushing the car and possibly package.

Be the people that Evan's be

Last year, Ayden got into Minecraft thanks to Evan Storm’s channel.

So we bought Minecraft on PS4 and started to play. I preferred to play in 1st person perspective but Ayden preferred 3rd person. But he didn’t know how to ask me change the perspective. So he would say, “Be the people that Evan’s be.”

Can you bring toys back home?

Tonight, I was reading Puss in the Boots bedtime story to Ayden. Story begins with Old Miller dying.

Ayden asked me if people die in real life. I am not ready for this conversation but I also didn’t want to lie. I said yes and hoped we can move on quickly.

Ayden’s eyes turned teary. In crying voice, he asked, “Why?”

“It just the way it is.” I said.

I watched him as he processed this new information about life. He has seen dead worms, read stories with death in it, but never connected that with people.

Can you bring toys back home?

Tonight, I was reading Puss in the Boots bedtime story to Ayden. Story begins with Old Miller dying.

Ayden asked me if people die in real life. I am not ready for this conversation but I also didn’t want to lie. I said yes and hoped we can move on quickly.

Ayden’s eyes turned teary. In crying voice, he asked, “Why?”

“It just the way it is.” I said.

I watched him as he processed this new information about life. He has seen dead worms, read stories with death in it, but never connected that with people.

Avicii - Wake Me Up

Lyrics

Feeling my way through the darkness
Guided by a beating heart
I can't tell where the journey will end
But I know where to start
They tell me I'm too young to understand
They say I'm caught up in a dream
Well life will pass me by if I don't open up my eyes
Well that's fine by me
So wake me up when it's all over
When I'm wiser and I'm older
All this time I was finding myself, and I
Didn't know I was lost
So wake me up when it's all over
When I'm wiser and I'm older
All this time I was finding myself, and I
Didn't know I was lost
I tried carrying the weight of the world
But I only have two hands
Hope I get the chance to travel the world
But I don't have any plans
Wish that I could stay forever this young
Not afraid to close my eyes
Life's a game made for everyone
And love is a prize
So wake me up when it's all over
When I'm wiser and I'm older
All this time I was finding myself, and I
Didn't know I was lost
So wake me up when it's all over
When I'm wiser and I'm older
All this time I was finding myself, and I
I didn't know I was lost
I didn't know I was lost
I didn't know I was lost
I didn't know I was lost
I didn't know

Source: LyricFind

Junoon - Main Kaun Hoon

Lyrics

Jab aasman girnay lagtay hain
Aur zameen jalnay lagtee hai
Aik chhupa huwa khwaab janam leta hai
Sehraon main awaaz aati hai

Mein kaun hoon
Tum kaun ho
Mein kaun hoon
Tum kaun ho
Gham geen hoon
Aur tum mazloom ho

Jab bhook nachtee gaatee hai
Aur nafratein jashan manatein hain
Aik chhupa huwa khwaab janam leta hai
Sehraon main awaaz aati hai

Mein kaun hoon
Tum kaun ho
Mein kaun hoon
Tum kaun ho
Majboor hoon
Aur tum bay naam ho

Aik chhupa huwa khwaab janam leta hai
Sehraon main awaaz aati hai

Mein kaun hoon
Tum kaun ho
Mein kaun hoon
Tum kaun ho
Gham geen hoon
Aur tum mazloom ho

Tum kaun ho
Mein kaun hoon
Tum kaun ho
Gham geen hoon
Aur tum bay naam ho
Tum kaun ho
Mein kaun hoon
Tum kaun ho
Majboor hoon
Aur tum bay naam ho

Poet: Sabir Zafar

Swedish House Mafia ft. John Martin - Don't You Worry Child

Lyrics

There was a time
I used to look into my father's eyes
In a happy home
I was a king, I had a golden throne
Those days are gone
Now they're memories on the wall
I hear the songs from the places where I was born
Up on a hill across the blue lake
That's where I had my first heartbreak
I still remember how it all changed
My father said
Don't you worry, don't you worry, child
See heaven's got a plan for you
Don't you worry, don't you worry now
Yeah
Don't you worry, don't you worry now
Yeah
Don't you worry, don't you worry now
Yeah
There was a time
I met a girl of a different kind
We ruled the world
I thought I'd never lose her out of sight
We were so young
I think of her now and then
I still hear the songs reminding me of a friend
Up on a hill across the blue lake
That's where I had my first heartbreak
I still remember how it all changed
My father said
Don't you worry, don't you worry, child
See heaven's got a plan for you
Don't you worry, don't you worry now
Yeah
Oh-oh-oh-oh-oh-oh-oh
Oh-oh-oh-oh-oh-oh-oh
Oh-oh-oh-oh-oh-oh-oh
Oh-oh-oh-oh-oh-oh-oh
Oh-oh-oh-oh-oh-oh-oh
Oh-oh-oh-oh-oh-oh-oh
Oh-oh-oh-oh-oh-oh-oh
See heaven's got a plan for you
See heaven's got a plan for you
See heaven's got a plan for you
Don't you worry, don't you worry, child
See heaven's got a plan for you
Don't you worry, don't you worry now
Yeah
Oh-oh-oh-oh-oh-oh-oh
Oh-oh-oh-oh-oh-oh-oh
Oh-oh-oh-oh-oh-oh-oh
Yeah

Source: Musixmatch Songwriters: Steve Angello / Sebastian Ingrosso / Axel Hedfors / Martin Lindstrom / Michel Zitron / John Martin

Ask HN: What book changed your life?

Saw this post on Hacker’s News. A lot of interesting books to read.

Book Links
The Stormlight Archive (series) by Brandon Sanderson https://news.ycombinator.com/item?id=30739083
Jacob’s Room, Virginia Woolf https://news.ycombinator.com/user?id=thatjoeoverthr
Dune
Man’s Search For Meaning
How to Practice: The Way to a Meaningful Life - the Dalai Lama
Surely you’re joking Mr. Feynman
Gödel, Escher, Bach: an Eternal Golden Braid
Debt: The First 5000 Years
Crucial Conversations: Tools for Talking when Stakes are High by Kerry Patterson
Difficult Conversations: How to Discuss What Matters Most

Luther Vandross - Dance With My Father

Lyrics

Back when I was a child
Before life removed all the innocence
My father would lift me high
And dance with my mother and me and then
Spin me around till I fell asleep
Then up the stairs he would carry me
And I knew for sure I was loved
If I could get another chance
Another walk, another dance with him
I'd play a song that would never ever end
How I'd love, love, love to dance with my father again, ooh
When I and my mother would disagree
To get my way I would run from her to him
He'd make me laugh just to comfort me, yeah, yeah
Then finally make me do just what my momma said
Later that night when I was asleep
He left a dollar under my sheet
Never dreamed that he would be gone from me
If I could steal one final glance, one final step
One final dance with him
I'd play a song that would never ever end
'Cause I'd love, love, love to dance with my father again
Sometimes I'd listen outside her door
And I'd hear how my mother cried for him
I pray for her even more than me
I pray for her even more than me
I know I'm praying for much too much
But could you send back the only man she loved?
I know you don't do it usually
But dear Lord she's dying to dance with my father again
Every night I fall asleep and this is all I ever dream

Wheels and Engine Sound

Last year, we took Ayden to monster truck show. We didn’t know how loud these trucks can be. So we bought ear protection headphones for him. He was still feeling a little scared.

Later he came up with idea that sound of engine comes from the tires. He would keep telling me that monster trucks tires are loud or they made it louder after he put on his headphone.

How to backup Kubernetes’ Config

The easiest solution seems to be following script by Stackoverflow user, Timothy Perez

:

  <pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">#!/bin/bash

# NAMESPACED EXPORTS
 for  ns in  $( kubectl get ns --no-headers | cut -d &#34; &#34;  -f1 ) ;  do
  kubectl --namespace = &#34; ${ ns} &#34;  get -o = json bindings,cm,ep,ev,limits,pvc,po,podtemplates,rc,quota,secrets,sa,svc,controllerrevisions,ds,deploy,rs,sts,localsubjectaccessreviews,hpa,cj,jobs,leases,ev,ds,deploy,ing,netpol,rs,pods,netpol,pdb,roles,rolebindings |  \
       jq '.items[] |
     select(.type!=&#34;kubernetes.io/service-account-token&#34;) |
     del(
         .spec.clusterIP,
         .metadata.uid,
         .metadata.selfLink,
         .metadata.resourceVersion,
         .metadata.creationTimestamp,
         .metadata.generation,
         .status,
         .spec.template.spec.securityContext,
         .spec.template.spec.dnsPolicy,
         .spec.template.spec.terminationGracePeriodSeconds,
         .spec.template.spec.restartPolicy
     )'  >> &#34;./ ${ ns} .json&#34;
 done

# NON-NAMESPACED EXPORTS
kubectl get -o = json cs,ns,no,pv,mutatingwebhookconfigurations,validatingwebhookconfigurations,crds,apiservices,tokenreviews,selfsubjectaccessreviews,selfsubjectrulesreviews,subjectaccessreviews,csr,psp,nodes,psp,clusterrolebindings,clusterroles,pc,sc,volumeattachments |  \
       jq '.items[] |
     select(.type!=&#34;kubernetes.io/service-account-token&#34;) |
     del(
         .spec.clusterIP,
         .metadata.uid,
         .metadata.selfLink,
         .metadata.resourceVersion,
         .metadata.creationTimestamp,
         .metadata.generation,
         .status,
         .spec.template.spec.securityContext,
         .spec.template.spec.dnsPolicy,
         .spec.template.spec.terminationGracePeriodSeconds,
         .spec.template.spec.restartPolicy
     )'  >> &#34;./cluster_non-namespaced_export.json&#34;

Script copied here under CC BY-SA 4.0 license

Crispy-Skinned Baked Chicken Drumsticks

Ingredients

  • 8 (4 oz each) skin-on chicken drumsticks (about 2 lb. total weight)
  • 2 tablespoons olive oil
  • 1 teaspoon salt
  • ½ teaspoon black pepper
  • 1 teaspoon garlic powder
  • 1 teaspoon onion powder
  • 1 teaspoon smoked paprika
  • 1/4 teaspoon chilli pepper

Instructions

  • Preheat your oven to 400 degrees F. Line a rimmed baking sheet with parchment paper and arrange the drumsticks in a single layer on the parchment.
  • Make the seasoning paste: In a medium bowl, use a fork or a spatula to mix the olive oil, salt, pepper, and spices.
  • Using a pastry brush or your hands, coat the chicken pieces with the seasoning paste.
  • Bake the drumsticks uncovered until their internal temperature reaches 165 degrees F, about 40 minutes.
  • Baste the drumsticks with the pan juices using a clean pastry brush. Serve immediately.

Via https://healthyrecipesblogs.com/wprm_print/22974

LeetCode 605. Can Place Flowers

/**
 * @param {number[]} flowerbed
 * @param {number} n
 * @return {boolean}
 */
 var  canPlaceFlowers   = function (flowerbed , n ) {
     for  ( let  i   =   0 ; i  < flowerbed .length ; i  ++ ) {
         if  (flowerbed [i ]  ==   0
            &&  (i   ==   0   ||  flowerbed [i  -  1 ]  ==   0 )
            &&  (i   ==  flowerbed .length  -  1   ||  flowerbed [i  +  1 ]  ==   0 )) {
            n  --
            flowerbed [i ]  =   1
             if  (n   <   1 )
                 return true
        }
    }

     return  n   <=   0
};

LeetCode 1268. Search Suggestions System

/**
 * @param {string[]} products
 * @param {string} searchWord
 * @return {string[][]}
 */
 var  suggestedProducts   = function (products , searchWord ) {
    products .sort ((a , b ) => {
         if  (a   >  b )  return   1
         if  (a   <  b )  return   -  1
         return   0
    })

     const  r   =  []

     for  ( let  i   =   1 ; i  <= searchWord .length ; i  ++ ) {
         const  arr   =  products .filter ((s ) => s .startsWith (searchWord .substring ( 0 , i ))).slice ( 0 ,  3 )
       //console.log(searchWord.substring(0, i))
         r .push (arr )
    }

     return  r
};

LeetCode 253. Meeting Rooms II

Lack of built-in Priority Queues in JavaScript makes it a bit hard to do problems like this. I end looking at the solution:

/**
 * @param {number[][]} intervals
 * @return {number}
 */
 var  minMeetingRooms   = function (intervals ) {
     if  (intervals .length   <   1 )  return   0

     const  startTimes   =  []
     const  endTimes   =  []

     for  ( let  i   =   0 ; i  < intervals .length ; i  ++ ) {
        startTimes [i ]  =  intervals [i ][ 0 ]
        endTimes [i ]  =  intervals [i ][ 1 ]
    }

    startTimes .sort ((a , b ) => a  - b )
    endTimes .sort ((a , b ) => a  - b )

     let  startPtr   =   0
     let  endPtr   =   0
     let  rooms   =   0

     for  ( let  i  =  0 ; i  < intervals .length ; i  ++ ) {
         if  (startTimes [i ]  >=  endTimes [endPtr ]) {
            endPtr  ++
        }  else  {
            rooms  ++
        }
    }

     return  rooms
};

git error: github.com:abc/xyz.git did not send all necessary objects

I was getting following error when running git pull

git pull
fatal: bad object refs/heads/master 2
error: github.com:abc/xyz.git did not send all necessary objects

I tried running git gc

git gc
error: bad ref for .git/logs/HEAD 2
fatal: bad object refs/heads/master 2
fatal: failed to run repack

The fix was to remove above to files under .git

rm .git/logs/HEAD\ 2
rm .git/refs/heads/master\ 2

After that I was able to run gc and do git pull

LeetCode 937. Reorder Data in Log Files

/**
 * @param {string[]} logs
 * @return {string[]}
 */
var reorderLogFiles = function(logs) {

    const sorted = []
    const numLogs = []
    const charLogs = []

    for (let i = 0; i<logs.length; i++) {
        const log = logs[i]
        const tokenized = log.split(&#34; &#34;)
        if (Number.isInteger(parseInt(tokenized[1]))) {
            numLogs.push(log)
        } else {
            charLogs.push(log)
        }
    }

    charLogs.sort(function (a, b) {
        const stra = a.substr(a.indexOf(' ') + 1)
        const strb = b.substr(b.indexOf(' ') + 1)
        if (stra > strb) {
            return 1
        }
        if (stra < strb) {
            return -1
        }

        const ida = a.substr(0, a.indexOf(' '))
        const idb = b.substr(0, b.indexOf(' '))
        //console.log({ida})
        if (ida > idb) {
            return 1
        }
        if (ida < idb) {
            return -1
        }

        return 0
    })

    return [...charLogs, ...numLogs]

};

LeetCode 49. Group Anagrams

/**
 * @param {string[]} strs
 * @return {string[][]}
 */
var groupAnagrams = function(strs) {
    const map = []

    for (let i = 0; i<strs.length; i++) {
        const str = strs[i].split('').sort().join('')
        if (!map[str]) map[str] = []
        map[str].push(strs[i])
    }
    const ans = []
    for (let k in map) {
        ans.push(map[k])
    }
    return ans
};

LeetCode 71. Simplify Path

/**
 * @param {string} path
 * @return {string}
 */
var simplifyPath = function(path) {
    const simple = [];
    const splitPath = path.split(&#34;/&#34;).filter(x => x.length>0 && x !== '.')

    for (let i = 0; i<splitPath.length; i++) {
        if (splitPath[i] === '..') {
            simple.pop()
        } else {
            simple.push(splitPath[i])
        }

    }

    return `/${simple.join('/')}`
};

Avicii – the Nights

Lyrics:

Once upon a younger year
When all our shadows disappeared
The animals inside came out to play
Went face to face with all our fears
Learned our lessons through the tears
Made memories we knew would never fade

One day my father, he told me
"Son, don't let it slip away"
He took me in his arms, I heard him say
"When you get older
Your wild heart will live for younger days
Think of me if ever you're afraid"

He said: "One day you'll leave this world behind
So live a life you will remember"
My father told me when I was just a child
"These are the nights that never die"
My father told me

When thunder clouds start pouring down
Light a fire they can't put out
Carve your name into those shining stars
He said: "Go venture far beyond the shores
Don't forsake this life of yours
I'll guide you home, no matter where you are"

One day my father, he told me
"Son, don't let it slip away"
When I was just a kid, I heard him say
"When you get older
Your wild heart will live for younger days
Think of me if ever you're afraid"

He said: "One day you'll leave this world behind
So live a life you will remember"
My father told me when I was just a child
"These are the nights that never die"
My father told me

"These are the nights that never die"
My father told me
My father told me

LeetCode 50. Pow(x, n)

I got stuck on this problem, even after looking at answers, I could not follow algorithm. Following video really helped me understand it:

Here is my solution after watching this video:

/**
 * @param {number} x
 * @param {number} n
 * @return {number}
 */
 var  myPow   = function (x , n ) {
     if  (x   ==   0 )  return   0

     if  (n   ==   0 )  return   1

     if  (n   <   0 ) {
        x   =   1  / x
        n   =   -  1   *  n
    }

     const  half   =  myPow (x , Math.floor (n  /  2 ))
     let  ans   =  half   *  half

     if  (n  %  2   ==   1 ) ans   =  x   *  ans

     return  ans
};

LeetCode 1570. Dot Product of Two Sparse Vectors

My solution in JavaScript:

/**
 * @param {number[]} nums
 * @return {SparseVector}
 */
 var  SparseVector   = function (nums ) {
     const  x   = new  Map ()
     for  ( let  i   =   0 ; i   <  nums .length ; i  ++ ) {
         if  (nums [i ]  !=   0 ) {
            x .set (i , nums [i ])
        }
    }
     this.map   =  x
     this.length   =  nums .length
     return this
};


// Return the dotProduct of two sparse vectors
/**
 * @param {SparseVector} vec
 * @return {number}
 */
SparseVector .prototype .dotProduct   = function (vec ) {
     let  ans   =   0 ;

     for  ( let  i   =   0 ; i   <  vec .length ; i  ++ ) {
         if  (vec .map .has (i )  && this.map .has (i )) {
            ans   +=  vec .map .get (i )  * this.map .get (i )
        }
    }

     return  ans
};

// Your SparseVector object will be instantiated and called as such:
// let v1 = new SparseVector(nums1);
// let v2 = new SparseVector(nums2);
// let ans = v1.dotProduct(v2);

Kubernetes not passing full path to Nodejs

I spent hours troubleshooting why url path was getting stripped from requests in our Nodejs/Expressjs based app. The reason was this line in Kubernetes’ Ingress:

nginx.ingress.kubernetes.io/rewrite-target : /

Removing it fixed the issue. Check Kubernetes documentation

for more details.

Ask HN: Those making $500/month on side projects in 2021 – Show and tell

I love these kind of posts. Here are some interesting ideas for side-gig:

  1. Books. There are quite a few books there, books for babies, books about iOS dev etc.
  2. Mining Cryptocurrency. This comment got a lot of attention.
  3. Apps. Too many but was glad to see Mac apps generating decent income.
  4. Music. Decent income from YouTube content ID payments according to this comment.
  5. DIY biologist. Seems fun.
  6. A lot of SaaS or content sites.
  7. Flipping items from thrift stores on eBay.

Web 3.0, DeFi, NFT, Metaverse

I don’t really have much understanding of these terms in the headline. I mostly associate NFT with scams, metaverse with Second Life in VR. But recently I have been thinking about all the times I lost big opportunities because I didn’t understand innovations.

Back in late 2000s, I had a friend who was talking about Bitcoin and how it will change everything. I think he even send me some. But I didn’t understand it and didn’t really wanted to learn it. Of course, in 2018, I was searching my emails and texts trying to find those bitcoins.

ROI when using your primary residence as rental too

Calculating rough ROI on rentals is easy:

For example, let’s say one buys $500,000 single family home and rent it out for $3000 per month. Since it is investment property, they will need to make at least 20% down payment. On $400,000 loan, their monthly payment would be about $2750 at 3.25% interest rate, with $10,000 in property taxes per year and $2000 yearly insurance.

($36,000 – $33,000) / $100,000 = 0.03 or 3% return.

Hotel California

Hotel California is such a beautiful song. And it’s deep meaning can apply to pretty much any situation. I have been especially thinking of last line, “You can checkout anytime you like, but you can never leave.”

A lot of people think this song is about about drugs and Hollywood life that is hard to leave. But it can apply to anything. One can never leave their corporate life, they are stuck there forever because they got bills, family, and fear of going on their own. So they can mentally checkout anytime they like, but they can never leave.

Leetcode 92: Reverse Linked List II

Here is my leetcode solution in JavaScript:

/**
 * Definition for singly-linked list.
 * function ListNode(val, next) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.next = (next===undefined ? null : next)
 * }
 */
/**
 * @param {ListNode} head
 * @param {number} left
 * @param {number} right
 * @return {ListNode}
 */
var reverseBetween = function(head, left, right) {
    let currPos = 1;
    let currNode = head;
    let startNode = head;
    let endNode = null;

    while(currPos < left) {
        startNode = currNode;
        currNode = currNode.next;
        currPos++;
    }

    let newList = null;
    let tail = currNode;

    while (currPos <= right) {
        const next = currNode.next;
        currNode.next = newList;
        newList = currNode;
        currNode = next;
        currPos++;
    }

    startNode.next = newList;
    tail.next = currNode;

    if (left > 1) {
        return head;
    }

    return newList;


};

Link to problem.

Ayden & Simba go to the Moon

Ayden and Simba were playing when they saw the moon. Ayden wanted to go to moon but didn’t know how. Then Simba remembered their friend Rocky the Red Rocket can take them to the moon. They went to Rocky’s house but he was not there. Simba said let me find him because he can find anyone by sniffing their smells. Simba sniffed and sniffed and found Rocky swimming in the pool. Once upon a time, there was a little boy named Ayden and he had a little dog called Simba. One day Aydne said to Simba, he lute’s go to moon. Since said that is an excellent idea. So Ayden and Simba went to their friend, Rock the red rocket’s house. They knocked on the door but no one answered. Simba sniffed and sniff and found Rocky at the pool. “Hey Rocky, how are you?’ asked Ayden. “I am good fellas, what are you guys up to” replied Rocky “We really really want to go to the moon, when you go to moon next time, can you please take us with you?” Ayden asked politely. Rocky said, oh guess what, I am going to moon right now. Let’s go now, if you can.” Simba nd Ayden got excited and they jumped in the Rocky. 3, 2, 1, Blast off!!! Rocky went into space and then landed on the moon. Moon was so beautiful, Ayden and Simba got out and started to play on the moon. It was very bouncy and it was red. And it smelled like a cheese. So Simba licked the moon’s surface and said moon tastes like cheese too. Ayden took a small bite of moon and guess what, moon is indeed made out of cheese. Simba and Ayden ate a lot of moon. They got so full. Rocky called them and said it is time to go back home. Rocky took them back home and Ayden and Simba thanked Rocky. And then took a nice big nap!

Blue Bus and Yummy Apples

One day, Blue Bus wanted to eat yummy yummy apples. He looked in the fridge but there were no of apples. He went to Target to buy apples. But Target was out of apples too. Then Blue Bus went to Red Bus but Red Bus was out of apples too. She had just eaten the last apple Blue Bus then went to Green Bus’s home. Green Bus was out of apples too. Blue Bus then went to Yellow Bus. Yellow Bus had just got back home from his work. Blue Bus asked if he had any apples but Yellow Bus was out of apples too. But Yellow Bus had just dropped Ayden at his home and Ayden had a big bag of apples. Blue Bus finally went to Ayden’s home. He asked if Ayden had any apples. Ayden said, “yes I do, right here in my pockets”. Then Ayden gave one apple to Blue Bus. Then all the buses came, Ayden shared his apples with everyone and they all ate apples together.

Broken Dreams/Bheegi Yadein by Junoon

As I turn back, my eyes dampen

When I realized my incomplete life

My life became clear to me

Broken promises

Deserted dreams

Broken promises

Seek time’s tender shade

Yesterday too, was in ruins

Now is deserted as well

Life asks for a moment of support

Damp memories

Won’t let me sleep due to grief

Damp memories

Won’t let me live.

By Junoon

Yellow Bus and Red Car

Once upon a time there was a Yellow bus. Yellow bus was very fast, but there was a Red car which was faster. One day, Red car challenged yellow bus for a race. They decided to race from Dallas to Houston. It was the longest race ever. All the cars gathered around the highway. Referee said 1, 2, 3, Go! Yellow bus goes zoom zoom. But red car goes zoom zoom zooooom. And Red car was faster and it was winning. After a while Red car looked in its rearview mirror and didn’t see Yellow bus at all. Red car’s engine was overheating, and it was running low on gas. Up ahead was a gas station. Red car decided to pull into gas station to refill gas and and cool down the engine in a shade. While resting in the shade, it fell asleep. Yellow bus, however, didn’t stop. It kept going and going until it crossed the finish line. Red car woke up and realized, it slept for too long. It raced to finish line but Yellow bus had already won the race. Red car was surprised and asked how did you not take a break, Yellow bus said by going fast but not too fast. They laughed and then went to eat ice cream. Moral of story, go fast but not too fast.

A Poem by Mirza Ghalib

Mirza Ghalib was the one of the greatest Urdu poet from 19th century. I translated this poem for a school project.

I look at the joys of this world, as I look at the dust.



Crying used to give me pleasure but now my eyes have gone dry.



When I am dead, wind might take my dust to my destination.



Because now I have no more strength to continue.



For whom are these preparations of welcome, who is this lover from the heaven?



All I see is flowers, and nothing else.



My love has left me capable of nothing.



Now I just wish to live quietly somewhere.



Asad, my poetry is for times past.



It is useless to write, when no one understands.<br />

I

Who is that is I



Still lost in my mind.



Trying to find my purpose,



When there might not be one.



The first thing was writing



Can words truly change anything?



Why should I write,



When there is so much noise



Are you in that house,



Or are you out here.



I will give up now,



This desert is just too vast.



My voice will not reach you,



Is this even a language.



What is music when there is no rhythm.



Why should I write,



When I have nothing to say.

Wrote this poem long time ago, it seems it is still applicable.

A poem by Mir Taqi Mir

Stop crying, this is just the beginning of love.



Hold on and see what will be next.



In the morning, there were voices in the caravan.



Let’s move on and let the sleeper sleep.



On this ground nothing can grow.



Please stop planting seeds of hopes in your heart.



These are marks of true love, they remain forever.



It is not possible to wash them away from your heart.



Time was more important than anything else in my life.



And Mir, I wasted my time foolishly.<br />

This was another college project, I translated this poem by Mir Taqi Mir.

A Poem by Mir Dard

It was a school or temple, or was it Makkah or a church.
We were all guests, only you were the host.



Oh! How sad it is. I found just before death.
It was only a dream, what I saw. It was only a fairy tale, what I heard.



How sad it is that autumn is in the garden.
There was some grass, which was my friend.



This place is getting chaotic with all these people coming and going.
My heart used to be the place for your peace.



It is useless to remember them, try to be happy.
Dard, it is not important if they remember me or not.<br />

Mir Dard was a sufi poet from India. I translated this poem for college project.

A poem by Allama Iqbal

You are neither for earth nor for the heavens.

The world is for you; you are not for the world.

This garden is the place for pain and prayer.

Not for picking flowers or building a nest.

How long will you stay in the rivers of Ravi, Nile, and Farat?

Your ship was built for infinite oceans.

It was nothing, what we have exaggerated.

We made it more, just for our fantasies.

About

Hi,

I am a dad to two amazing boys. I am married to a beautiful woman, and we have a tiny 7 pound dog. We live in Dallas. I am lucky enough to work as software engineer and make living with my hobby.

At one time, I dreamt about making video games. Now I am lucky if I get to play them.

But I have better and more fun things to do now, that is playing with my kids. Taking them out and showing the world is one of the greatest joy of life.

Oneness of Humanity

O my friend, a heart does not need hate.
All love good but do not even hate bad.
Who does not want the softness of flowers?
But do not be afraid of sharpness of thorns.
There is same blood in the veins of the thorn.
It is brought up by same evening breeze of the spring.

Do not throw away dying flowers.
Yesterday, they were the glamor of the garden.
Once they were also part of the world of perfumes.
O passerby! Do not kick dust on their leaves.
Though they are no longer in the feast.
They were raised in the laps of same morning breeze.

Cigarette

Feeling so empty, and hollow inside,
Cannot believe I am writing a poem to a cigarette,
but I feel so unsatisfied, unfulfilled,
like this poem, half-finished.

Once I Fell in Love

In this hot desert heat,

you were a cool breeze

gone in a moment just as you came,

left me behind to wonder if you will ever return

to mess up my hair,

to touch my thirsty lips softly

you were a sweet dream,

vanished with the stars in the morning

leaving me to wake up in the blinding sunlight,

to look for a shade where there are no trees

Stars & Moon

This poem was written by my favorite poet Allama Iqbal. I translated it for my English class during my freshman year.

“The view up here is the same as ever.

We are tired of shining and shining.

Our work is to walk, day and night.

Walk and walk and walk forever.

Everything in this universe is anxious.

Peace, whatever it is, does not exist.

Everything is being tortured by time.

think hard

Other day while putting Ayden to sleep, he looked like as if he was intensely thinking. I asked him, “Are you thinking something?”

“Yes” he replied.

“What are you thinking?” I asked

“I don’t know what car to play with in the morning, baba!”

Simple Man – Lynyrd Skynyrd

Lyrics

Mama told me when I was young Come sit beside me my only son And listen closely to what I say And if you do this it’ll help you Some sunny day oh yeah

Oh take your time don’t live too fast Troubles will come and they will pass Go find a woman yeah and you’ll find love And don’t forget son there is someone up above

And be a simple kind of man Oh be something you love and understand Baby be a simple kind of man Oh won’t you do this for me son if you can

Fast Car

Lyrics

You got a fast car
I want a ticket to anywhere
Maybe we make a deal
Maybe together we can get somewhere
Any place is better
Starting from zero, got nothing to lose
Maybe we'll make something
Me, myself, I got nothing to prove

You got a fast car
I got a plan to get us out of here
I been working at the convenience store
Managed to save just a little bit of money
Won't have to drive too far
Just 'cross the border and into the city
You and I can both get jobs
And finally see what it means to be living

See, my old man's got a problem
He lives with the bottle, that's the way it is
He says his body's too old for working
His body's too young to look like his
My mama went off and left him
She wanted more from life than he could give
I said, somebody's got to take care of him
So I quit school and that's what I did

You got a fast car
Is it fast enough so we can fly away?
We gotta make a decision
Leave tonight or live and die this way

So I remember we were driving, driving in your car
Speed so fast, I felt like I was drunk
City lights lay out before us
And your arm felt nice wrapped 'round my shoulder
And I-I, had a feeling that I belonged
I-I had a feeling I could be someone, be someone, be someone

You got a fast car
We go cruising to entertain ourselves
You still ain't got a job
And I work in a market as a checkout girl
I know things will get better
You'll find work and I'll get promoted
We'll move out of the shelter
Buy a bigger house and live in the suburbs

So I remember when we were driving, driving in your car
Speed so fast, I felt like I was drunk
City lights lay out before us
And your arm felt nice wrapped 'round my shoulder
And I-I, had a feeling that I belonged
I-I had a feeling I could be someone, be someone, be someoneYou got a fast car
I got a job that pays all our bills
You stay out drinking late at the bar
See more of your friends than you do of your kids
I'd always hoped for better
Thought maybe together you and me would find it
I got no plans, I ain't going nowhere
So take your fast car and keep on driving

So I remember when we were driving, driving in your car
Speed so fast, I felt like I was drunk
City lights lay out before us
And your arm felt nice wrapped 'round my shoulder
And I-I, had a feeling that I belonged
I-I had a feeling I could be someone, be someone, be someone

You got a fast car
Is it fast enough so you can fly away?
You gotta make a decision
Leave tonight or live and die this way

Wealth Lab Pro Earning Play Screener

This is a quick script that I use to find options to buy or sell.

 using  System;
 using  System.Collections.Generic;
 using  System.Text;
 using  System.Drawing;
 using  WealthLab;
 using  WealthLab.Indicators;
 using  Community.Components;

 namespace  WealthLab.Strategies
{
	 public class  MyStrategy  : WealthScript
	{

		 protected override void  Execute()
		{
			DataSeries maFast = EMAModern.Series(Close,  50 );
			DataSeries maSlow = EMAModern.Series(Close,  200 );
			DataSeries maFast_1 = EMAModern.Series(Close,  10 );
			DataSeries maSlow_2 = EMAModern.Series(Close,  50 );
			DataSeries ma = EMAModern.Series(Close,  10 );
			DataSeries maFast_3 = EMAModern.Series(Close,  10 );
			DataSeries maSlow_4 = EMAModern.Series(Close,  50 );

			PlotSeries(PricePane,EMAModern.Series(Close, 50 ),Color.Red,LineStyle.Solid, 2 );
			PlotSeries(PricePane,EMAModern.Series(Close, 200 ),Color.Green,LineStyle.Solid, 2 );
			PlotSeries(PricePane,EMAModern.Series(Close, 10 ),Color.Blue,LineStyle.Solid, 2 );
			PlotSeries(PricePane,EMAModern.Series(Close, 50 ),Color.Red,LineStyle.Solid, 2 );
			PlotSeries(PricePane,EMAModern.Series(Close, 10 ),Color.Blue,LineStyle.Solid, 2 );

			//for(int bar = GetTradingLoopStartBar(201); bar < Bars.Count; bar++)
 			 int  bar = Bars.Count -  1 ;
			{
				 if  (IsLastPositionActive)
				{
					Position p = LastPosition;
					 if  (p.EntrySignal.Contains(&#34;Group1|&#34; ))
					{
						 if  (CrossUnder(bar, maFast_3, maSlow_4))
						{
							SellAtMarket(bar +  1 , p, &#34;Group1&#34; );
						}
					}

				}
				 else
				{
					 if  (maFast[bar] > maSlow[bar])
					{
						 if  (maFast_1[bar] > maSlow_2[bar])
						{
							 if  (Close[bar] < ma[bar])
							{
								 if  (EarningsDate.InWindow( this , bar, &#34;earnings per share&#34; ,  7 ,  0 ))
								{

									BuyAtMarket(bar +  1 , &#34;Group1|&#34; );
								}
							}
						}
					}

				}
			}
		}
	}
}

Old bookmarks

This is slightly a mess, basically various links my bookmarks are here.

  1. http://nautil.us/issue/45/power/against-willpower
  2. https://ubiquity.acm.org/article.cfm?id=3310318
  3. https://www.nytimes.com/2018/10/26/style/phones-children-silicon-valley.html
  4. Ask HN: Developers with kids, how do you skill up? – https://news.ycombinator.com/item?id=13816627
  5. Ask HN: How can I learn how to paint? – https://news.ycombinator.com/item?id=19375624
  6. Children aren’t born smart. They’re made smart by conversation. – https://slate.com/technology/2013/09/childrens-language-development-talk-and-listen-to-them-from-birth.html
  7. Maker Faire and Science Education: American kids should be building rockets and robots, not taking standardized tests. – https://slate.com/technology/2012/06/maker-faire-and-science-education-american-kids-should-be-building-rockets-and-robots-not-taking-standardized-tests.html
  8. https://www.npr.org/sections/goatsandsoda/2018/06/21/621752789/a-lost-secret-how-to-get-kids-to-pay-attention
  9. On Parenthood – https://blog.codinghorror.com/on-parenthood/
  10. reddit: parenting reading list – https://www.reddit.com/r/Parenting/wiki/reading
  11. Resistance Training May Lower Type 2 Diabetes Risk: Study – https://www.menshealth.com/fitness/a26799275/moderate-strength-training-diabetes-risk-study/
  12. Everything You Wanted to Know About STEM for Toddlers – https://preschoolsteam.com/stem-activities-toddlers/
  13. Plano Is the Happiest Place in America – https://www.dmagazine.com/frontburner/2019/03/plano-is-the-happiest-place-in-america/
  14. Good Vibes Are Contagious – https://www.outsideonline.com/2391572/send-good-vibes
  15. Teens and Young Adults Are More Depressed Now Than in the Mid-2000s – https://gizmodo.com/teens-and-young-adults-are-more-depressed-now-than-in-t-1833295562
  16. How Inuit Parents Raise Kids Without Yelling — And Teach Them To Control Anger – https://www.npr.org/sections/goatsandsoda/2019/03/13/685533353/a-playful-way-to-teach-kids-to-control-their-anger
  17. Expert Says Don’t Teach Kids to Code – https://hackaday.com/2019/03/14/expert-says-dont-teach-kids-to-code/
  18. The Longevity Research Institute – https://thelri.org/blog-and-news/melatonin-s-effect-on-skin-and-hair/
  19. https://yourkidstable.com/about/
  20. When Ancient Societies Hit a Million People, Vengeful Gods Appeared – https://www.livescience.com/65039-punishing-gods-rise-with-complex-societies.html
  21. A morning fitness routine that’s good for your brain, too – https://www.cnn.com/2019/03/21/health/fitness-routine-brain-morning-exercise-mansour/index.html
  22. Teaching Children to Walk Independently! – One of the first reassurances I can give families is that Motor Milestones exist on a continuum. Each child achieves these skills at their own time, in their own way. Though we learn motor development from textbooks positing neurodevelopment theory to explain skill acquisition and motor patterning, the manifestation of this progression takes on distinct characteristics when we look at each child as a unique creation. – http://blog.dinopt.com/independent-walking-kids/
  23. Posture Power: How To Correct Your Body’s Alignment – https://www.bodybuilding.com/content/posture-power-how-to-correct-your-body-alignment.html
  24. Best Camping Near Me | Hipcamp’s Interactive Map of Private and Public Land – https://www.hipcamp.com/discover/texas/cedar-hill?lat=33.0304&lng=-96.8777
  25. How to increase serotonin in the human brain without drugs (2007) | Hacker News – https://news.ycombinator.com/item?id=19482241
  26. Scientists have also administered cognitive tests right after exercise—for example, measuring the flicker fusion threshold (the rate at which a flashing light begins to look like it’s steadily glowing) and found the same thing: After exercise, one’s senses are heightened and thus can detect the flashing at a higher frequency than before exercise.Taken together, these findings indicate that “people see more clearly and immediately after exercise,” Maddock says. “They can make finer visual distinctions; their perceptions are sharper.” – https://www.outsideonline.com/2186146/your-brain-exercise
  27. https://theweek.com/articles/830490/rise-snowplow-parenting
  28. How do I ensure my only child isn’t socially isolated? – https://www.washingtonpost.com/lifestyle/on-parenting/as-my-only-child-grows-what-is-my-role/2019/03/25/12b18e26-4a57-11e9-b79a-961983b7e0cd_story.html
  29. https://www.wellandgood.com/bodyweight-vs-weights-workouts/
  30. Atomic ML | Resources to help you learn data science and machine learning. – https://www.atomicml.com/
  31. https://metroplexsocial.com/2019/03/16/best-playgrounds-in-dfw-to-take-your-kids/
  32. https://www.nytimes.com/2019/04/04/magazine/how-asmr-videos-became-a-sensation-youtube.html
  33. A five-minute workout called Inspiratory Muscle Strength Training (IMST) lowers blood pressure in middle-aged to older adults; it also improves artery function and scores on memory tests, according to new research. – http://www.sci-news.com/medicine/inspiratory-muscle-strength-training-blood-pressure-brain-07077.html
  34. https://aeon.co/essays/how-to-live-a-values-driven-life-in-the-face-of-dark-emotions
  35. Notably, most improvements in GI symptoms were maintained, and autism-related symptoms improved even more after the end of treatment. Important changes in gut microbiota at the end of treatment remained at follow-up, including significant increases in bacterial diversity and relative abundances of Bifidobacteria and Prevotella. Our observations demonstrate the long-term safety and efficacy of MTT as a potential therapy to treat children with ASD who have GI problems, and warrant a double-blind, placebo-controlled trial in the future. – https://www.nature.com/articles/s41598-019-42183-0
  36. Anything you can do to keep from packing up your shit and leaving is called love. – http://a.co/7cPPwc2
  37. It is hard sometimes to keep in mind the growth-promoting potential of the mismatches between parent and child goals because the parents’ empathy for the child can make them feel as if it is their fault that they cannot fulfill the child’s wishes. – http://a.co/cbhTMiO
  38. The basic premise of attachment theory is that toddlers can grow into happy and competent children if they can rely on at least one adult who makes them feel safe and protected. From this basic feeling of security in relationships grows the impetus to explore how things work in the world and to try out new skills. – http://a.co/1QjXVtb
  39. Toddlers walk through life like we all wish we could: confident, demanding, and 100 percent positive that they are the center of the universe. – http://a.co/7nddWp3
  40. http://www.optionstrading.org/strategies/a-z-list/
  41. Ask HN: What is your money-making side project outside programming? | Hacker News – https://news.ycombinator.com/item?id=19712057
  42. https://www.cbc.ca/parents/learning/view/parenting-isnt-that-hard
  43. https://discover.dc.nihr.ac.uk/content/signal-000711/aerobic-exercise-is-an-effective-treatment-for-depression
  44. https://www.wellandgood.com/good-sweat/power-in-fitness/
  45. It has been said that children need to take 3,000 steps or cover 24 foot ball fields before they can learn to walk by themselves. Lets just say they need to do 100’s of steps/day -best if it is in a condensed period of time- to learn to walk. – https://maryevanspt.wordpress.com/2016/12/14/how-to-get-your-baby-and-toddler-to-walk/
  46. https://blog.usejournal.com/things-you-learn-after-1-year-of-day-trading-for-a-living-a97bbc8d19fa
  47. Trading and Data Science – http://www.algonell.com/blog
  48. https://algodaily.com/lessons/solving-the-health-problems-of-software-engineers
  49. https://greatergood.berkeley.edu/article/item/why_attachment_parenting_is_not_the_same_as_secure_attachment
  50. The dangers of over-parenting – https://www.valleynewslive.com/content/news/The-dangers-of-over-parenting-509683601.html
  51. Evidence-based parenting: how to deal with aggression, tantrums and defiance – https://theconversation.com/evidence-based-parenting-how-to-deal-with-aggression-tantrums-and-defiance-95439
  52. No matter what you accomplish, achieve or do, somebody is always up to something far more epic than you are if you live your life through the lens of your Facebook news feed. – https://medium.com/the-mission/why-excessive-consumption-limits-your-creativity-6e925dd66daa
  53. https://www.macstories.net/stories/beyond-the-tablet/
  54. https://www.optionsprofitcalculator.com/
  55. https://seekingalpha.com/article/4254004-rentals-vs-reits-best-way-invest-real-estate-practical-case-study
  56. Ask HN: Should I quit my job? | Hacker News – https://news.ycombinator.com/item?id=20024943
  57. https://www.learning-mind.com/only-child-syndrome-signs-effects/
  58. Ask HN: What is the real Value of Real Estate Agent? | Hacker News – https://news.ycombinator.com/item?id=14301230
  59. Do you ever get that feeling when listening to a great song that makes all the hairs on your arm stand on end? – https://www.indy100.com/article/music-goosebumps-some-people-science-research-emotions-psychology-study-harvard-7926781
  60. The key to physical fitness isn’t exercise, it’s movement — Quartzy – https://qz.com/quartzy/1641863/the-key-to-physical-fitness-isnt-exercise-its-movement/
  61. https://www.aaii.com/journal/article/a-comparison-of-backtesting-tools
  62. How to Automatically Backup a Linux VPS to a Separate Cloud Storage Service | Hacker News – https://news.ycombinator.com/item?id=20146648
  63. How to parent more predictably (2018) | Hacker News – https://news.ycombinator.com/item?id=20173675
  64. It also appears that belonging to the London cluster made writers substantially more productive. Mitchell finds that the average writer in London saw their productivity go up by 12 percent. By comparison, writers in smaller clusters, in Dublin, Edinburgh, Oxford, and Cambridge, saw no such gains. Furthermore, being part of the London cluster increased the likelihood of an author having their work published in any given year by 24 percent. – https://www.citylab.com/life/2019/06/british-irish-writers-london-clustering-dickens-woolf/590884/
  65. Research led by the University of Exeter, published in Scientific Reports and funded by NIHR, found that people who spend at least 120 minutes in nature a week are significantly more likely to report good health and higher psychological wellbeing than those who don’t visit nature at all during an average week. However, no such benefits were found for people who visited natural settings such as town parks, woodlands, country parks and beaches for less than 120 minutes a week. – https://medicalxpress.com/news/2019-06-hours-week-key-dose-nature.html
  66. The difference a dad can make – https://www.evoke.org/articles/june-2019/Data-Driven/Fresh_Takes/the-difference-a-dad-can-make
  67. Ask HN: Has anybody successfully changed their career to become a writer? | Hacker News – https://news.ycombinator.com/item?id=16495718
  68. Ask HN: Have any former developers successfully changed careers? | Hacker News – https://news.ycombinator.com/item?id=20318965
  69. Ask HN: How do I get into electronics from scratch? | Hacker News – https://news.ycombinator.com/item?id=20300037
  70. Ask HN: If you were a coder who successfully changed careers, what do you do now? | Hacker News – https://news.ycombinator.com/item?id=14847646
  71. Ask HN: What do I tell my students about starting Freelancing? | Hacker News – https://news.ycombinator.com/item?id=20304980
  72. so you want to be a writer? by Charles Bukowski: https://poets.org/poem/so-you-want-be-writer
  73. The 10 books that changed my career as a software engineer: https://storyforj.com/s/dk79PY
  74. In May 2012 I made a commitment that changed my career: A simple task, completed every day, that skyrocketed my blog and allowed me to make over $30,000 in 6 weeks: https://nathanbarry.com/commitment-changed-career/
  75. What is the Average Profit on a House Flip? – https://investfourmore.com/average-house-flip-profit/
  76. How This Real Estate Agent Made $100,000 In One Month From His YouTube Channel – https://www.forbes.com/sites/jrose/2019/07/15/how-this-real-estate-agent-made-100000-in-one-month-from-his-youtube-channel/
  77. Vonnegut: Can you believe this guy? He makes more money in a single day than we’ll make in our entire lives. And you wrote Catch-22! > Heller: Sure, but I have something he’ll never have. > Vonnegut: Yeah, Joe? What’s that? > Heller: Enough: https://news.ycombinator.com/item?id=20436934
  78. Books for Quants – Towards Data Science – https://towardsdatascience.com/books-for-quants-1b0f51dd7745
  79. The deliberate dog body language of curving is used in polite greetings, negotiation, or as a calming signal. A head-on, frontal approach can be seen as confrontational. The curving could be the curving of the dog’s body (which makes a slight c-shape), or a directional curve in the path the dog walks on approach. Some have described it as a ‘banana walk’, an easy descriptive way to imagine the direction of walk, due to the shape of the path taken by the dog.
    https://www.silentconversations.com/dog-body-language-curving-silent-conversations/
  80. These writers got their start after age 35—there’s still hope for you: https://theamericanscholar.org/35-over-35/
  81. 6 Alternatives To Freelancing For Engineers – https://medium.com/@AndrewPierno/6-alternatives-to-freelancing-for-engineers-f6e56d20f793
  82. How Long It’s Safe to Leave Food Unrefrigerated – https://www.thekitchn.com/how-long-can-you-leave-cooked-foods-unrefrigerated-kitchen-facts-218225
  83. Anxiety Looks Different in Men – https://www.wsj.com/articles/anxiety-looks-different-in-men-11564494352
  84. The $61,392 Book Launch That Let Me Quit My Job: https://adamwathan.me/the-book-launch-that-let-me-quit-my-job/
  85. “The most important emotional accomplishment of the toddler years is reconciling the urge to become competent and self-reliant with the simultaneous and sometimes contradictory longing for parental love and protection.” — The Emotional Life of the Toddler by Alicia F. Lieberman – http://a.co/ahiuBee
  86. The Essential 6 Month Calisthenics Workout Plan – http://www.barbrothersgroningen.com/calisthenics-workout-plan/
  87. Pop culture lionizes the dazzling brilliance of money managers on the autism spectrum. Reality rarely measures up: https://www.institutionalinvestor.com/article/b1gq9tqwk8z108/They-Get-Fired-All-the-Time-And-They-Have-No-Idea-Why
  88. “It is neither possible nor desirable to be always attuned and responsive to the moods and wishes of children.” — The Emotional Life of the Toddler by Alicia F. Lieberman – http://a.co/fwr0A4E
  89. Most knowledge worth having comes from practice. It comes from doing. It comes from creating. Reading about the trade war with China doesn’t make you smarter—it gives you something to say at dinner parties. It gives you the illusion that you have the vaguest idea what is happening in our enormously complex world: https://tjcx.me/posts/consumption-distraction/
  90. “but the often observed increased involvement of fathers in the toddler years may be linked to findings that fathers as a group are more likely than mothers to promote the adventurous exploration and challenging play that toddlers are now ready to join.” — The Emotional Life of the Toddler by Alicia F. Lieberman – http://a.co/89HPMXr
  91. “One study, for example, found that children who showed a secure attachment to their fathers by seeking them out for comfort when feeling stressed had fewer behavior problems and showed more competence in school and peer groups than did those who had an insecure relationship with their fathers.” — The Emotional Life of the Toddler by Alicia F. Lieberman – http://a.co/5KTWPMl
  92. Living cells in the human body experience forces of various frequencies (for example breathing, heartbeats, walking, running, jumping and singing), typically ranging from 0.2 hertz to hundreds of hertz,” the researchers wrote. At the highest frequencies, cells became stiffer and the enzymes that guide gene transcription could not bind to the DNA, the team found.Cells’ immediate responsiveness to force makes sense from an evolutionary perspective, Wang said.”Cells must be able to respond quickly to things in their environment so they can survive,” he said. – https://phys.org/news/2020-04-physical-spurs-gene-reveals.html
  93. Senate Stock Watcher – See What Senators are Trading: https://senatestockwatcher.com/
  94. Analyzing HN readers’ personal blogs | Hacker News – https://news.ycombinator.com/item?id=22822401>
  95. Six super-short sci-fi stories that explore the post-COVID-19 world. – https://sudowriters.com/anthology/fever-dreams/
  96. How A Goat Farmer Built A Doomsday Machine That Just Booked A 4,144% Return: https://www.forbes.com/sites/antoinegara/2020/04/13/how-a-goat-farmer-built-a-doomsday-machine-that-just-booked-a-4144-return/
  97. How long does it take to beat your favorite games? – https://howlongtobeat.com/#search1
  98. Find out how to entertain a two-year-old here! 40+ best activities for two-year-olds. Inside you will find indoor play ideas, sensory play prompts, and painting play activities. – https://www.dayswithgrey.com/blog/top-activities-two-year-olds
  99. An important point to note here is that automated trading does not mean it is free from human intervention. Automated trading has caused the focus of human intervention to shift from the process of trading to a more behind-the-scenes role, which involves devising newer alpha-seeking strategies on a regular basis: https://blog.quantinsti.com/learn-algorithmic-trading/
  100. In this article we’ll look into a real options trading strategy, like the strategies that we code for clients. This one however is based on a system from a trading book. As mentioned before, options trading books often contain systems that really work – which can not be said about day trading or forex trading books. The system examined here is indeed able to produce profits. Which is not surprising, since it apparently never loses. But it is also obvious that its author has never backtested it: https://financial-hacker.com/algorithmic-options-trading-part-3/
  101. Algorithmic Trading at home – how should I get started? | QuantNet Community: https://quantnet.com/threads/algorithmic-trading-at-home-how-should-i-get-started.3611/
  102. This is the fourth part of a series of articles on backtesting trading strategies in Python. The previous ones described the following topics:introducing the zipline framework and presenting how to test basic strategies: https://towardsdatascience.com/algorithmic-trading-based-on-technical-analysis-in-python-80d445dc6943
  103. Algorithmic Trading Bot: Python – Towards Data Science: https://towardsdatascience.com/algorithmic-trading-bot-python-ab8f42c37145
  104. If you’re considering algo trading as a career then be sure to talk to a lot of people doing it. I spent several years trying to break in to the industry at a few prop firms with only middling success. Here are my observations:1. The vast majority of firms only hire people with CS or math degrees from top 10 schools, with an MS being the minimum. There are few exceptions.2. Nobody is making as much money as they used to.3. Depending on what firm you end up at you will probably spend a lot less time building cool strategies and a lot more time trying to shave off a few microseconds here and there.4. Be prepared for a pretty rough work environment. Swearing, violent outbursts, people being secretive and not sharing ideas.5. If you’re lucky, management will be STEM people. If you’re not, they will be former floor traders who have managed to stay alive this long. – Ask HN: How do I get started with Algo trading? | Hacker News – https://news.ycombinator.com/item?id=11332960
  105. Ask HN: How to launch an algo trading side project? | Hacker News: https://news.ycombinator.com/item?id=16376015
  106. I write (program, paint, animate, market, and so on) computer games like this one1. The recent economic troubles haven’t effected me negatively that much, instead it’s been a positive thing as more people are home and playing more games. I don’t necessarily want to ‘profit’ from all the hardship around, but I’m glad to provide products that entertain and hopefully make the current situation a bit more bearable – that feels good.I got started over 10 years ago now, making Flash-based games and licensing them to various web portal and publishers, which was good money for a student back then! A little indie game developer golden age where you’d get a lot of players and also a few thousand dollars per game without too much trouble. I went on from there doing self-published games that anyone can buy on Steam or the Mac Store, both of which provide about 90% of my revenue, and the remaining 10% are from smaller stores and game distributors.1 https://store.steampowered.com/app/654960/The_Eldritch_Zooke… <- My current project. – Ask HN: Successful one-person online businesses? | Hacker News: https://news.ycombinator.com/item?id=22858035
  107. Ask HN: Those making $500/month on side projects in 2019 – Show and tell | Hacker News: https://news.ycombinator.com/item?id=20899863
  108. Ask HN: What is your passive income 2019? | Hacker News: https://news.ycombinator.com/item?id=21389776
  109. Build a Day-Trading Algorithm and Run it in the Cloud Using Only Free Services – https://medium.com/automation-generation/build-a-day-trading-algorithm-and-run-it-in-the-cloud-for-free-805450150668
  110. How To Be A Professional Author And Not Die Screaming And Starving In A Lightless Abyss – Chuck Wendig: http://terribleminds.com/ramble/2019/09/17/how-to-be-a-professional-author-and-not-die-screaming-and-starving-in-a-lightless-abyss/
  111. How to Find Consulting Clients: https://chrisachard.com/how-to-find-consulting-clients
  112. Introduction to Algotrading (2011) [pdf] | Hacker News: https://news.ycombinator.com/item?id=19215026
  113. Questions to ask a company during a job interview | Hacker News: https://news.ycombinator.com/item?id=20916749
  114. Toddler Development: What Every Parent Needs to Know: https://theeverymom.com/toddler-development-what-every-parent-needs-to-know/
  115. What’s good career advice you wouldn’t want to have your name on? | Hacker News: https://news.ycombinator.com/item?id=21150930
  116. Ask HN: Why did you leave tech industry? | Hacker News: https://news.ycombinator.com/item?id=22876241
  117. Ask HN: What did you do to get extra streams of income for yourself? | Hacker News: https://news.ycombinator.com/item?id=23010294
  118. Using Reinforcement Learning in the Algorithmic Trading Problem | Hacker News: https://news.ycombinator.com/item?id=23022864
  119. Analysis of 41k dev agencies with hourly rates, team size and tech stack | Hacker News: https://news.ycombinator.com/item?id=23115364
  120. Ask HN: Mind bending books to read and never be the same as before? | Hacker News: https://news.ycombinator.com/item?id=23151144
  121. Things You Learn After 1 Year of Day Trading for a Living: https://blog.usejournal.com/things-you-learn-after-1-year-of-day-trading-for-a-living-a97bbc8d19fa
  122. Early Child Development Abilities by Age: https://pathways.org/all-ages/abilities/
  123. Youtube Workouts for Every Activity and Fitness Level | Outside Online – https://www.outsideonline.com/2412248/best-youtube-workout-videos-channels
  124. Ask HN: Ways to generate income when you’re at home without pay? | Hacker News: https://news.ycombinator.com/item?id=23258111
  125. Lots of Oppurtunities to make money online: https://www.lotsofopps.com/
  126. Ask HN: If you could work remote where would you live? | Hacker News: https://news.ycombinator.com/item?id=23294799
  127. Autism severity can change substantially during early childhood: https://health.ucdavis.edu/health-news/newsroom/autism-severity-can-change-substantially-during-early-childhood/2020/05
  128. Ask HN: I recently lost my job, I want to pursue blogging as a career. Thoughts? | Hacker News: https://news.ycombinator.com/item?id=23431466
  129. Ask HN: How do I start my own consulting firm? | Hacker News: https://news.ycombinator.com/item?id=13845681
  130. Ask HN: I implemented the life I designed: perfect but I feel lost. What now? | Hacker News: https://news.ycombinator.com/item?id=23450110
  131. Ask HN: What is the smartest career path to take? | Hacker News: https://news.ycombinator.com/item?id=23458316
  132. Some possible career goals: https://jvns.ca/blog/2018/09/30/some-possible-career-goals/
  133. Ask HN: Is working as a developer on technical route until retirement feasible? | Hacker News: https://news.ycombinator.com/item?id=23503947
  134. Machine Learning Field Guide: https://www.kamwithk.com/machine-learning-field-guide-ckbbqt0iv025u5ks1a7kgjckx
  135. Aging on Nautilus: Why You Can’t Help But Act Your Age: http://aging.nautil.us/feature/218/why-you-cant-help-but-act-your-age
  136. deerawan/react-native-flashcard-app · GitHub: https://github.com/deerawan/react-native-flashcard-app/tree/master/utils
  137. GitHub – wesbos/burner-email-providers: A list of temporary email providers: https://github.com/wesbos/burner-email-providers
  138. Ask HN: Consulting in tech. How to start? | Hacker News: https://news.ycombinator.com/item?id=23740167
  139. Ask HN: If given freedom to choose, what full-time job would you choose and why? https://news.ycombinator.com/item?id=23772648
  140. Learnings From A Year of Being Indie: https://ryanashcraft.com/a-year-of-being-indie/
  141. DIY Video Hosting: https://tyler.io/diy-video-hosting/
  142. Why Helicopter Parenting Fosters Failure | Psychology Today: https://www.psychologytoday.com/us/blog/the-baby-scientist/202007/why-helicopter-parenting-fosters-failure
  143. How you attach to people may explain a lot about your inner life | Science | The Guardian: https://www.theguardian.com/science/2020/jan/10/psychotherapy-childhood-mental-health
  144. Tech Jobs for Good helps you find tech jobs at mission driven companies around the US: https://techjobsforgood.com/?q=&impact_areas=Environment&impact_areas=Food+%26+Agriculture
  145. Ask HN: Former software engineers, what are you doing now? | Hacker News: https://news.ycombinator.com/item?id=23951850
  146. GitHub – jeltehomminga/pubquiz: pubquiz: https://github.com/jeltehomminga/pubquiz
  147. Why Success Won’t Make You Happy – The Atlantic: https://www.theatlantic.com/family/archive/2020/07/why-success-wont-make-you-happy/614731/
  148. Is Making Advanced GUI Applications with Godot the Future? | by Erik Engheim https://medium.com/swlh/what-makes-godot-engine-great-for-advance-gui-applications-b1cfb941df3b
  149. 50 Magazines and Anthologies That Pay for Horror Fiction: https://www.freedomwithwriting.com/freedom/uncategorized/50-magazines-and-anthologies-that-pay-for-horror-fiction/
  150. I Quit My Job. Here’s How I Planned the Start as an Entrepreneur | by Sjors van Dongen: https://medium.com/@sjorsvandongen/i-quit-my-job-heres-how-i-planned-the-start-as-an-entrepreneur-7bc546631431
  151. How do you find your passion? Am I off course? | Hacker News: https://news.ycombinator.com/item?id=15993395
  152. Notes on “Anthropology of Childhood” by David Lancy: https://thewholesky.wordpress.com/2020/08/27/notes-on-anthropology-of-childhood-by-david-lancy/
  153. Most favorited Hacker News posts of all time: https://observablehq.com/@tomlarkworthy/hacker-favourites-analysis
  154. Algorithmic Trading Using Logistic Regression – Hands-Off Investing: https://handsoffinvesting.com/an-algorithmic-trading-strategy-using-logistic-regression/
  155. Ask HN: What is your favorite motto? | Hacker News: https://news.ycombinator.com/item?id=24436135
  156. Texas Agent FAQ’s | Park and Refer: https://parkandrefer.com/texas-agent-faqs/
  157. All 149 Combined Ark Invest ETF Holdings: https://cathiesark.com/ark-funds-combined/complete-holdings
  158. https://marketstream.io/

I Took a Pill in Ibiza

Lyrics

I took a pill in Ibiza
To show Avicii I was cool
And when I finally got sober, felt ten years older
But fuck it, it was something to do
I'm living out in LA
I drive a sports car just to prove
I'm a real big baller 'cause I made a million dollars
And I spend it on girls and shoes

But you don't wanna be high like me
Never really knowing why like me
You don't ever wanna step off that roller coaster and be all alone
You don't wanna ride the bus like this
Never knowing who to trust like this
You don't wanna be stuck up on that stage singing
Stuck up on that stage singing
All I know are sad songs, sad songs
Darling, all I know are sad songs, sad songs

I'm just a singer who already blew his shot
I get along with old timers
'Cause my name's a reminder of a pop song people forgot
And I can't keep a girl, no
'Cause as soon as the sun comes up
I cut 'em all loose and work's my excuse
But the truth is I can't open up

Now you don't wanna be high like me
Never really knowing why like me
You don't ever wanna step off that roller coaster and be all alone
You don't wanna ride the bus like this
Never knowing who to trust like this
You don't wanna be stuck up on that stage singing
Stuck up on that stage singing
All I know are sad songs, sad songs
Darling, all I know are sad songs, sad songs (hey)

I took a plane to my hometown
I brought my pride and my guitar
All my friends are all gone but there's manicured lawns
And the people still think I'm a star
I walked around downtown
I met some fans on Lafayette
They said tell us how to make it 'cause we're getting real impatient
So I looked 'em in the eye and said

You don't wanna be high like me
Never really knowing why like me
You don't ever wanna step off that roller coaster and be all alone
You don't wanna ride the bus like this
Never knowing who to trust like this
You don't wanna be stuck up on that stage singing
Stuck up on that stage singing
All that I know are sad songs, sad songs
Darling, all that I know are sad songs, sad songs

Be As You Are

Lyrics

Virginia Woolf and poetry
No one seemed to notice me
Being young was getting so old
Cheap beer and cigarettes
Life was like a movie set
And I seemed to be given no role

But in times of trouble
I can turn to my mother
And I know that she gon' understand
So at age 18
I cried to my mother
And she told me, "young man"

"There are moments when you fall to the ground
But you are stronger than you feel you are now
You don't always have to speak so loud, no
Just be as you are
Life is not always a comfortable ride
Everybody's got scars that they hide
And everybody plays the fool sometimes, yeah
Just be as you are"

They played me on the radio
And everything was changing, so
I thought I was all the way grown
But I can still remember in that cold November
When I realized I'm all alone

But in times of trouble
I can turn to my mother
And I know that she gon' understand
So at age 22
I cried to my mother
And she told me, "young man"

"There are moments when you fall to the ground
But you are stronger than you feel you are now
You don't always have to speak so loud, no
Just be as you are
It doesn't matter if you become some star
Life is better when you open your heart
You don't always have to act so hard, no
Just be as you are"

"There are moments when you fall to the ground
But you are stronger than you feel you are now
You don't always have to speak so loud, no
Just be as you are
It doesn't matter if you become some star
Life is better when you open your heart
You don't always have to act so hard, no
Just be as you are"

Oculus Quest 2 Review

I was debating between PS5 and Quest 2 (Affiliate link), and yes it is like comparing apples and oranges, but in the end Quest 2 won. I will likely buy PS5 at some point though. But before I buy PS5, I need a new TV with 4K and HDR. It seems pointless to play PS5 on 1080p TV from early 2010s.

Quest 2 is not my first experience with Virtual Reality. I tried PSVR about 2-3 years ago but the mess of wires really turned me off with the idea of VR. When I found out that Quest 2 is completely wireless, I got interested in it again. I was not very excited about needing Facebook account to use it though.

To Sufi by Allama Iqbal

I translated this poem in my freshman year for my English class.

    This is a world of miracles for you.

    But for me, this is the world of randomness.

    The world of fantasies is poor,

    But poorer is the world of births and deaths.

    It is no wonder that your gaze will change it all,

    The world of possibilities is calling you.

Bulla ki jaana main kaun

Lyrics with Translations

Bulla ki jaana main kaun Bulla ki jaana main kaun

Na main moman vich maseetan Na main vich kufar dian reetan Na main pakan vich paleetan Na main andar bed kitaban Na main rehnda phaang sharaban Na main rehnda mast kharaban Na main shadi na ghamnaki Na main vich paleetan pakeen Na main aaabi na main khaki Na main aatish na main paun

Bulla ki jaana main kaun

New Career Direction

Today Ayden said, “Jack (his friend) wants to be firetruck driver and I will be ambulance driver. Jack will put out fires. I will take people to hospital. It will be so much fun.”

Father & Son

Lyrics

It's not time to make a change
Just relax, take it easy
You're still young, that's your fault
There's so much you have to know
Find a girl, settle down
If you want you can marry
Look at me, I am old, but I'm happy

I was once like you are now
And I know that it's not easy
To be calm when you've found
Something going on
But take your time, think a lot
Think of everything you've got
For you will still be here tomorrow
But your dreams may not

How can I try to explain?
When I do he turns away again
It's always been the same, same old story
From the moment I could talk
I was ordered to listen
Now there's a way
And I know that I have to go away
I know I have to go

It's not time to make a change
Just relax, take it slowly
You're still young, that's your fault
There's so much you have to go through
Find a girl, settle down
If you want you can marry
Look at me, I am old, but I'm happy

All the times that I've cried
Keeping all the things I knew inside
It's hard, but it's harder to ignore it
If they were right I'd agree
But it's them they know, not me
Now there's a way
And I know that I have to go away
I know I have to go

Genius Annotations

Journey to the Microcosmos

Journey to the Microcosmos is a YouTube channel all about looking at microscopic organisms through microscope. Videos are beautifully produced and narrator explains what you are looking at in a calm soothing voice. These videos are educational and interesting. Highly recommended.

Growing Up by Macklemore

Lyrics

They say boys don't cry
But your dad has shed a lot of tears
They say I should be a strong man
But baby, I'm still filled with fear
Sometimes I don't know who I am
Sometimes I question why I'm here
I just wanna be a good dad
Will I be, I have no idea
They say girls shouldn't be tough
And moms should raise their kids at home
But baby, I know that that isn't true
'Cause your momma's the toughest person I know
I wanna raise you to be like her
And watch you show the world how to do it on your own
I'm still tryna figure out who I am
I don't wanna mess this up or do this wrong
I'm gonna be there for your first breath
I don't know if I'll be there for your first step
I can promise you that I'll try to work less
But the tour's routed, and I got this album
Put in so many hours, and I just want the outcome
To be something that I can look back and I can be proud of
Don't wanna be a dad that's living in FaceTime
But I've got a world to sing to and you at the same time
I won't spoil you, you can trust that
For your sweet sixteen, you get a bus pass
Had your heart broken, been there, done that
I love you and I can't give you enough of that
Get back to community that raised you up
Read Langston Hughes, I suggest A Raisin in the Sun
Listen to Sam Cooke, a change gon' come
You put the work in, don't worry about the praise, my love
Don't try to change the world, find something that you love
And do it every day
Do that for the rest of your life
And eventually, the world will change

I'll be patient, one more month
You'll wrap your fingers round my thumb
Times are changing, I know, but who am I if
I'm the person you become
If I'm still growing up, up, up, up
I'm still growing up, up, up, up
I'm still growing up

I recommend that you read The Alchemist
Listen to your teachers, but cheat in calculus
Tell the truth, regardless of the consequence
And every day, give your momma a compliment
Take your girl to the prom
But don't get too drunk hanging out the limo
Slow dance with your woman in your arms
Sneak her in after but boy, you better tiptoe
Don't wake your mom up, do yoga, learn 'bout karma
Find God, but leave the dogma
The quickest way to happiness learning to be selfless
Ask more questions, talk about yourself less
Study David Bowie, James Baldwin and 2Pac
Watch the sun set with best friends from a rooftop
Wear a helmet, don't be stupid, jaywalk, but look before you do it
If it snows, go outside, build a jump, get some help
Get a sled, thrash the hill with your friends, 'til it melts
Go to festivals, camp, fall in love and dance
You're only young once, my loved one, this is your chance
Take risks, 'cause life moves so fast
You're only young once, my loved one, this is your chanceI'll be patient, one more month
You'll wrap your fingers round my thumb
Times are changing, I know, but who am I
If I'm the person you become
If I'm still growing up, up, up, up
I'm still growing up, up, up, up

I'll be patient, one more month
You'll wrap your fingers round my thumb
Times are changing, I know, but who am I
If I'm the person you become
If I'm still growing up, still growing up, still growing up
If I'm still growing up, still growing up, still growing up

If I'm still growing up
I'm still growing up, ooh
I'm still growing up
I'm still growing up

Circle of Life

Lyrics

Nants ingonyama bagithi baba
Sithi uhm ingonyama
Nants ingonyama bagithi baba
Sithi uhhmm ingonyama
Ingonyama
Siyo Nqoba
Ingonyama
Ingonyama nengw' enamabala
Ingonyama nengw' enamabala
Ingonyama nengw' enamabala
Ingonyama nengw' enamabala
Ingonyama nengw' enamabala
Ingonyama nengw' enamabala (se-to-kwa!)
Ingonyama nengw' enamabala (asana)
Ingonyama nengw' enamabala (se-to-kwa!)
Ingonyama nengw' enamabala (se-to-kwa!)
From the day we arrive on the planet
And, blinking, step into the sun
There's more to see than can ever be seen
More to do than can ever be done
There's far too much to take in here
More to find than can ever be found
But the sun rolling high
Through the sapphire sky
Keeps great and small on the endless round
It's the circle of life
And it moves us all
Through despair and hope
Through faith and love
'Til we find our place
On the path unwinding
In the circle
The circle of life
Ingonyama nengw' enamabala
Ingonyama nengw' enamabala
Ingonyama nengw' enamabala (se-to-kwa!)
Ingonyama nengw' enamabala (se-to-kwa!)
Ingonyama nengw' enamabala (se-to-kwa!)
Ingonyama nengw' enamabala (se-to-kwa!)
Ingonyama nengw' enamabala (se-to-kwa!)
Ingonyama nengw' enamabala (se-to-kwa!)
Ingonyama nengw' enamabala (se-to-kwa!)
Ingonyama nengw' enamabala (se-to-kwa!)
Ingonyama nengw' enamabala (se-to-kwa!)
Ingonyama nengw' enamabala (se-to-kwa!)
Ingonyama nengw' enamabala (se-to-kwa!)
Ingonyama nengw' enamabala (se-to-kwa!)
Ingonyama nengw' enamabala (se-to-kwa!)
Ingonyama nengw' enamabala (se-to-kwa!)
It's the circle of life
And it moves us all
Through despair and hope
Through faith and love
'Til we find our place
On the path unwinding
In the circle
The circle of life

Source: LyricFind

What do you want to be when you grow up

Yesterday, after I picked up Ayden from his daycare, he said, he didn’t know what he wants to be. I guess they asked him this question in his class. I told him he has plenty of time to figure it out. There is no rush.

Then later at night he said, “Baba, I know what I want to be. I want to be a Tow Truck Driver.” He said it would be so much fun to tow cars.

LeetCode 206. Reverse Linked List

Here is a quick solution to Reverse Linked List problem.

/**
 * Definition for singly-linked list.
 * function ListNode(val, next) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.next = (next===undefined ? null : next)
 * }
 */
/**
 * @param {ListNode} head
 * @return {ListNode}
 */
var reverseList = function(head) {
    let curr = head;
    let prev = null;

    while (curr) {
        let next = curr.next;
        curr.next = prev;
        prev = curr;
        curr = next;
    }

    return prev;
};

LeetCode 560. Subarray Sum Equals K

Brute Force Solution to Subarray Sum Equals K problem from LeetCode:

/**
 * @param {number[]} nums
 * @param {number} k
 * @return {number}
 */
var subarraySum = function(nums, k) {
    let ans = 0;

    for (let i=0; i<nums.length; i++) {
        let currSum = nums[i];
        if (currSum === k) ans++;
        for (let j=i+1; j<nums.length; j++) {
            currSum += nums[j];
            if (currSum === k) ans++;

        }
    }

    return ans;
};

Optimized solution after cheating a bit:

/**
 * @param {number[]} nums
 * @param {number} k
 * @return {number}
 */
var subarraySum = function(nums, k) {
    let ans = 0;
    const m = new Map();
    let sum=0;
    m.set(sum, 1);

    for (let i=0; i<nums.length; i++) {
        sum += nums[i];

        if (m.has(sum-k)) {
            ans += m.get(sum-k);
        }

        if (!m.has(sum)) {
            m.set(sum, 1);
        } else {
            m.set(sum, m.get(sum) + 1);
        }

    }

    return ans;
};

Runtime: 96 ms, faster than 94.76% of JavaScript online submissions for Subarray Sum Equals K.

LeetCode 2. Add Two Numbers

Here is my solution to Add Two Numbers problem in PHP:

/**
 * Definition for a singly-linked list.
 * class ListNode {
 *     public $val = 0;
 *     public $next = null;
 *     function __construct($val = 0, $next = null) {
 *         $this->val = $val;
 *         $this->next = $next;
 *     }
 * }
 */
class Solution {

  /**
    * @param ListNode $l1
    * @param ListNode $l2
    * @return ListNode
    */
    function addTwoNumbers($l1, $l2) {
        $ans = new ListNode(0, null);
        $p = $l1;
        $q = $l2;
        $current = $ans;
        $carry=0;

        while ($p != null || $q != null) {
            $x = isset($p) ? $p->val : 0;
            $y = isset($q) ? $q->val : 0;
            $sum = $carry + $x + $y;
            $carry = (int) ($sum/10);
            $current->next = new ListNode($sum%10);
            $current = $current->next;
            if ($p != null) $p = $p->next;
            if ($q != null) $q = $q->next;
        }
        if ($carry > 0) {
            $current->next = new ListNode($carry);
        }

        return $ans->next;
    }
}

Docker in 5 minutes

I have been using Docker and Kubernetes for several years now but never really took any time to really read about it. There were a lot of gaps in my understanding of how Docker works and what really is possible with it. Just recently my employer started to offer Udemy’s subscription, so I took Hands on Docker course. Here are some of the important things I learned in this course.

Where do you run Docker containers

You run these in Windows or MacOS but most likely you will use Linux in production. And unlike Windows and MacOS, you can run Docker on Linux VPS.

LeetCode 7. Reverse Integer

My initial solution for Reverse Integer problem:

/**
 * @param {number} x
 * @return {number}
 */
var reverse = function(x) {

    let ans = '';
    if (x<0) {
        ans = '-';
        x*=-1;
    }

    str = x.toString();

    for (let i=str.length-1; i>=0; i--) {
        ans += str[i];
    }

    ans = parseInt(ans);
    if (ans>2**31-1 || ans<(-2)**31) {
        return 0;
    }
    return ans;
};

Results

Runtime: 104 ms, faster than 34.78% of JavaScript online submissions for Reverse Integer.

Memory Usage: 40.5 MB, less than 33.80% of JavaScript online submissions for Reverse Integer.

LeetCode 3. Longest Substring Without Repeating Characters

Here is my solution in PHP to this problem.

class Solution {

  /**
    * @param String $s
    * @return Integer
    */
    function lengthOfLongestSubstring($s) {
        $n = strlen($s);
        $ans = 0;
        $i = 0;
        $j = 0;

        $arr = [];

        while ($i < $n && $j < $n) {
            if (!in_array($s[$j], $arr)) {
                $arr[] = $s[$j++];
                $ans = max($ans, $j-$i);
            } else {
                array_splice($arr, 0, 1);
                $i++;
            }
        }


        return $ans;
    }
}

And here is solution JavaScript based on this Udemy lesson:

Json_error_ctrl_char

I was using mcrypt to encrypt json_encoded data.

On other side, mycrypt was able to decrpyt data but json_decode was not working. It would throw JSON\_ERROR\_CTRL_CHAR error.

However, without mcrypt, json_decode worked flawlessly.

After some trial and error, I found that applying trim function after decrypting data would let me use json_decode without any issues.

Find Large Directories on AIX

I usually run it from under a partition which is running out of space. It can take a while.

du -g | sort -n -r

Error Xcode Select Error Tool Xcodebuild Requires Xcode Active Developer Directory Command Line Tools Instance

Playing with Cordova, I was getting this error when building iOS version:

Error: xcode-select: error: tool 'xcodebuild' requires Xcode,
but active developer directory is a command line tools instance

Even full install of Xcode didn’t fix this error.

The solution was to run following command to use full Xcode instead of command line tools version that I had installed earlier:

sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer

Setup Outgoing Email on Lightsail Ubuntu VPS

I followed instructions here: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-18-04

Everything seemed okay but email were not getting delivered. Logs showed me that smtp connections were timing out:

tail -f /var/log/mail.log
May  3 12:28:10 postfix/smtp[3160]: connect to gmail-smtp-in.l.google.com[172.217.197.27]:25: Connection timed out
May  3 12:28:10  postfix/smtp[3160]: connect to alt1.gmail-smtp-in.l.google.com[2800:3f0:4003:c00::1a]:25: Network is unreachable
May  3 12:28:40 postfix/smtp[3160]: 4984C41A1E: to=<xxxx@gmail.com>, relay=none, delay=3246, delays=3186/0.01/60/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[2a00:1450:400b:c00::1a]:25: Network is unreachable)

However, I could ping any of above ip addresses just fine.

hsts Neterr_cert_common_name_invalid

Without full understanding, I had enabled HSTS on amerkhalid.com with option includeSubDomains. I had a subdomain that was used as “Custom Domain” to SmugMug site. After enabling HSTS, these subdomains started to throw NET::ERR_CERT_COMMON_NAME_INVALID.

The fix is of course simple, don’t use includeSubDomains. But that opens up your top level domain to man in middle attacks.

For now, I decided to follow the best practices and leave includeSubDomains enabled. And decided to not use custom domain for my SmugMug site.

TypeError: require.extensions.hasOwnProperty is not a function

While playing with https://github.com/alexa/interactive-adventure-game-tool, I ran into following error:

> interactive-adventure-game-tool@1.0.0 start /Users/amer/alexa/interactive-adventure-game-tool
> node node_modules/gulp/bin/gulp.js

/Users/amer/alexa/interactive-adventure-game-tool/node_modules/require-dir/index.js:97
            if (!require.extensions.hasOwnProperty(ext)) {
                                    ^

TypeError: require.extensions.hasOwnProperty is not a function
    at requireDir (/Users/amer/alexa/interactive-adventure-game-tool/node_modules/require-dir/index.js:97:37)
    at Object.<anonymous> (/Users/amer/alexa/interactive-adventure-game-tool/gulpfile.js:1:85)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at Liftoff.handleArguments (/Users/amer/alexa/interactive-adventure-game-tool/node_modules/gulp/bin/gulp.js:116:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! interactive-adventure-game-tool@1.0.0 start: `node node_modules/gulp/bin/gulp.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the interactive-adventure-game-tool@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/amer/.npm/_logs/2018-01-02T05_12_24_832Z-debug.log

The solution was to update require-dir to version 0.3.2 in package.json and run npm install again.

LeetCode 1664: Ways to Make a Fair Array

I tried to do this all by myself but got stuck, ended up transpiling this solution in PHP.

class Solution {

  /**
    * @param Integer[] $nums
    * @return Integer
    */
    function waysToMakeFair($nums) {
        $len = count($nums);
        $ans = 0;

        $leftOdd = 0;
        $rightOdd = 0;
        $leftEven = 0;
        $rightEven = 0;

        for ($i=0; $i<$len; $i++) {
            if ($i%2 === 0)
                $rightEven += $nums[$i];
            else
                $rightOdd += $nums[$i];
        }

        for ($i=0; $i<$len; $i++) {
            if ($i%2 === 0)
                $rightEven -= $nums[$i];
            else
                $rightOdd -= $nums[$i];

            if ($leftEven + $rightOdd === $rightEven + $leftOdd) $ans++;

            if ($i%2 === 0)
                $leftEven += $nums[$i];
            else
                $leftOdd += $nums[$i];
        }

        return $ans;
    }
}

LeetCode 20: Valid Parentheses

Here is my solution to this problem in PHP:

/**
 * @param {string} s
 * @return {boolean}
 */
var isValid = function(s) {
    const stack = [];
    const brackets = {
        '(': ')',
        '{': '}',
        '[': ']'
    };

    for (i=0; i<s.length; i++) {
        if (s.length === 0) return true;

        const c = s[i];
        if (brackets[c]) {
            stack.push(c);
        } else {
            const lastBracket = stack.pop();
            if (brackets[lastBracket] !== c) return false;
        }
    }

    if (stack.length > 0) return false;

    return true;
};

LeetCode 844. Backspace String Compare

Here is my solution Backspace String Compare problem.

/**
 * @param {string} s
 * @param {string} t
 * @return {boolean}
 */
var backspaceCompare = function(s, t) {
    s = processString(s);
    t = processString(t);
    //console.log({s, t})
    return s===t;
};

let processString = function(s) {
    const a = [];
    let skip = 0;
    for (let i = s.length-1; i >= 0; i--) {
        if (s[i] === '#') {
            skip++;
        } else if (skip > 0) {
            skip--;
        } else {
            a.push(s[i]);
        }
        //console.log({a, skip, i})
    }
    let re = '';
    //console.log({ a: a.length})
    while (a.length > 0) {
        re += a.pop();
        //console.log({i, re, a: a.length})
    }
    return re;
}

Results:

Runtime: 80 ms, faster than 73.76% of JavaScript online submissions for Backspace String Compare.

Leetcode 690: Employee Importance Solution

Here is another LeetCode solution for Employee Importance Problem.

/**
* Definition for Employee.
* class Employee {
*     public $id = null;
*     public $importance = null;
*     public $subordinates = array();
*     function __construct($id, $importance, $subordinates) {
*         $this->id = $id;
*         $this->importance = $importance;
*         $this->subordinates = $subordinates;
*     }
* }
*/

class Solution {
/**
 * @param Employee[] $employees
 * @param Integer $id
 * @return Integer
 */

function getImportance($employees, $id) {
  if (empty($employees)) return 0;
  $emap = [];
  foreach ($employees as $e) {
    $emap[$e->id] = $e;
  }

  return $this->recurse($emap, $id);
 }

function recurse($emap, $id) {
  $e = $emap[$id];
  $ans = $e->importance;
  foreach ($e->subordinates as $sub) {
    $ans += $this->recurse($emap, $sub);
  }
  return $ans;
 }
}

LeetCode 1249. Minimum Remove to Make Valid Parentheses

Here is my solution to this problem:

/**
 * @param {string} s
 * @return {string}
 */
var minRemoveToMakeValid = function(s) {
    const stack = [];
    const charArray = s.split(&#34;&#34;);
    const rightBracketsToRemove = [];

    for (let i=0;i<charArray.length;i++) {
        if (charArray[i] === '(') {
            stack.push(i);
        } else if (charArray[i] === ')' && stack.length > 0) {
            stack.pop();
        } else if (charArray[i] === ')') {
            charArray[i] = '';
        }
    }

    while (stack.length > 0) {
        const i = stack.pop();
        charArray[i] = '';
    }

    return charArray.join('');
};

Leetcode 13: Roman to Integers

Here is my solution to this problem in PHP:


    private $v = ['M' = > 1000, 'D' = > 500, 'C' = > 100, 'L' = > 50, 'X' = > 10, 'V' = > 5, 'I' = > 1];
  /**
    * @param String $s
    * @return Integer
    */
    function romanToInt($s) {
        $n = 0;
        $last = '';
        for ($i=0;$i < strlen  ($s  );   $i++)   {
             $n   +=   $this-  >v[$s[$i]];
            if (($s[$i] == 'V' || $s[$i] == 'X')  &&  $last == 'I') {
                $n = $n - 2;
            } elseif (($s[$i] == 'L' || $s[$i] == 'C')  &&  $last == 'X') {
                $n -= 20;
            } elseif (($s[$i] == 'D' || $s[$i] == 'M')  &&  $last == 'C') {
                $n -= 200;
            }
            $last = $s[$i];
        }

        return $n;
    }
}

Troubleshooting Kubernetes Ingress

Setting up Ingress is an easy process but when it doesn’t work it gets really painful. First, make sure you have Ingress Controller setup correctly. This is in addition to Ingress resource and should be automatically setup by your cloud provider. When I was trying to setup a Kubernetes cluster on IBM Cloud, I ran into a lot of issues. It seems due to my permissions level something went wrong during provisioning of Kubernetes and Ingress Controller was not setup correctly. I went through a lot of steps including recreating alb , ingress resources, etc. The final fix was to login to IBM Cloud as superuser to change Access Policies for the cluster. Once did that, everything just worked magically.

HackerRank: New Year Chaos

Here is my solution to New Years Chaos problem from HackerRank. The first solution had a bug:

  <pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js">function minimumBribes (q ) {
    let bribes   =  0 ;

    for  (let i  = 0 ;i   <q .length  - 2 ;i++ ) {
        if  (q [i ]  -  (i  + 1 )   >  2 ) {
           console .log ( 'Too chaotic' );
            return ;
        }
         // compare index to element, works great except when a smaller element is pushed way back
           if  (q [i ]  -  (i  + 1 )   >  0 ) {
         bribes   += q [i ]  -  (i  + 1 );
        }
    }
   console .log (bribes );
}

Second solution had O(n^2) complexity:

LeetCode 200: Number of Islands

I had to watch some YouTube videos for the solution to this problem. I am not sure if this is the best solution though, one day I will revisit it.


  /**
    * @param String[][] $grid
    * @return Integer
    */
    function numIslands($grid) {
        $count = 0;

        for ($i=0; $i < count  ($grid  );   $i++)   {
           for   ($j  =  0;   $j   <count  ($grid  [$i  ]);   $j++)   {
               if   ($grid  [$i  ][$j  ]   ==   &#34;1  &#34;)   {
                     $count++;
                     // zero out rest of 1s
                     $this-  >zeroOut($grid, $i, $j);
                }
            }
        }

        return $count;
    }

    function zeroOut( & $grid, $i, $j) {
        if ($i < 0   ||   $i  >=count($grid) || $j < 0   ||   $j  >=count($grid[$i]) || $grid[$i][$j] == &#34;0&#34;)
            return;

        $grid[$i][$j] = &#34;0&#34;;

        $this- >zeroOut($grid, $i-1, $j);
        $this- >zeroOut($grid, $i+1, $j);
        $this- >zeroOut($grid, $i, $j-1);
        $this- >zeroOut($grid, $i, $j+1);
    }
}

LeetCode 42. Trapping Rain Water

My solution to LeetCode 42. Trapping Rain Water in JavaScript.

/**
  * @param {number[]} height
  * @return {number}
  */
var trap   =  function (height ) {
    let maxLeft   =  0 ,maxRight   =  0 ;

    let left   =  0 ;
    let right   = height .length   - 1 ;
    let total   =  0 ;

    while  (left    <right ) {
        if  (height [left ]   <height [right ]) {
            if  (height [left ]  >maxLeft ) {
               maxLeft   = height [left ];
            } else  {
              total   += maxLeft  -height [left ]
            }
           left++ ;
        } else  {
            if  (height [right ]  >maxRight ) {
               maxRight   = height [right ];
            } else  {
              total   += maxRight  -height [right ]
            }
           right  -- ;
        }
    }
    return total ;
};

LeetCode 1089: Duplicate Zeros

LeetCode 1089: Duplicate Zeros solution in PHP.


  /**
    * @param Integer[] $arr
    * @return NULL
    */
    function duplicateZeros( & $arr) {
        $len = count($arr);
        for ($i=0; $i   < $len; $i++) {
            if (0 === $arr[$i]) {
                array_splice($arr, $i++, 0, 0);
            }
        }
        array_splice($arr, $len);
    }
}

LeetCode 11. Container With Most Water

Here is my solution to Container with Most Water in JavaScript.

/**
  * @param {number[]} height
  * @return {number}
  */
var maxArea   =  function (height ) {
    let left   =  0 ;
    let right   = height .length  - 1 ;
    let maxWater   =  0 ;

    while  (left    <right ) {
        const water   =  (right  -left )  *  Math.min (height [left ],height [right ]);

        if  (water    > maxWater ) {
           maxWater   = water ;
        }

        if  (height [left ]   <height [right ]) {
           left++ ;
        } else  {
           right  -- ;
        }
    }

    return maxWater ;
};

LeetCode 1: Two Sum

/**
  * @param {number[]} nums
  * @param {number} target
  * @return {number[]}
  */
var twoSum   =  function (nums ,target ) {
    const numsToFind   =  {};

    for (let i = 0; i<nums.length; i++ ) {
        const numToFind   = nums [i ];
        if  (numsToFind [numToFind ]   >=  0 ) {
            return  [i ,numsToFind [numToFind ]];
        }
       numsToFind [target   - numToFind ]  = i ;
    }
};

My solution for Two Sum problem in PHP.

LeetCode 88: Merge Sorted Array solution

Here is my solution for Merge Sorted Array problem in PHP. This is not the most efficient solution.

 class Solution {

  /**
    * @param Integer[] $nums1
    * @param Integer $m
    * @param Integer[] $nums2
    * @param Integer $n
    * @return NULL
    */
    function merge(&$nums1, $m, $nums2, $n) {
        if ($n == 0) {
            return;
        }

        if ($m == 0) {
            for ($i=0; $i  < $n; $i++) {
                $nums1[$i] = $nums2[$i];
            }
        }

        $i = 0;
        $j = 0;

        while ($i  < $m  &&  $j  < $n) {
            if ($nums1[$i]  < =$nums2[$j]) {
                $i++;
            } else {
                $this->array_insert($nums1, $i++, $nums2[$j]);
                $m++;
                $j++;
            }
        }

        while ($j   < $n) {
            $nums1[$i++] = $nums2[$j++];
        }

    }

    function array_insert( & $arr, $i, $num) {
        $endArr = array_slice($arr, $i);
        $arr[$i] = $num;

        for ($x=$i+1; $x < count  ($arr);   $x++)   {
             $arr  [$x  ]   = array_shift  ($endArr);
         }
     }
 }

LeetCode 26 – Remove Duplicates from Sorted Array

Here is my solution to Remove Duplicates from Sorted Array problem in JavaScript

/**
 * @param {number[]} nums
 * @return {number}
 */
var removeDuplicates = function(nums) {
    let i=0;

    while (i<nums.length-1) {
        if (nums[i] === nums[i+1]) {
            nums.splice(i+1, 1);
        } else {
            i++;
        }
    }

    return nums.length;
};

Results

Runtime: 108 ms, faster than 33.69% of JavaScript online submissions for Remove Duplicates from Sorted Array.Memory

Usage: 40.6 MB, less than 89.66% of JavaScript online submissions for Remove Duplicates from Sorted Array.

LeetCode #73: Set Matrix Zeroes

Here is my solution to Set Matrix Zeros

problem in PHP:

class Solution {

  /**
    * @param Integer[][] $matrix
    * @return NULL
    */
    function setZeroes(&$matrix) {
        $rowsToZeroOut = [];
        $colsToZeroOut = [];
        for ($i=0; $i<count($matrix); $i++) {
            for ($j=0; $j<count($matrix[$i]); $j++) {
                if ($matrix[$i][$j] === 0) {
                    $rowsToZeroOut[] = $i;
                    $colsToZeroOut[] = $j;
                }
            }
        }

        foreach($rowsToZeroOut as $r) {
            for($i=0; $i<count($matrix[$r]); $i++) {
               $matrix[$r][$i] = 0;
            }
        }

        foreach($colsToZeroOut as $c) {
            for($i=0; $i<count($matrix); $i++) {
               $matrix[$i][$c] = 0;
            }
        }
    }
}

Results

Runtime: 52 ms, faster than 13.33% of PHP online submissions for Set Matrix Zeroes. Memory Usage: 19.8 MB, less than 80.00% of PHP online submissions for Set Matrix Zeroes.

WordPress to Hugo to WordPress to Hugo

I moved all my blogs back to Hugo. I have gone back and forth between Wordpress and Hugo several times. WordPress makes it really easy to write and publish content. On this domain, I was using WordPress as a bookmarking service. With PressThis plugin, I was able to use a bookmarklet and publish a new post from any page on the web. But that plugin has not been updated in a while and it seems with every new WordPress release something would break. A few times, I was able to hack it to keep going. But lately, I cannot keep up with it. I will have to figure out a better way to bookmark but for now, I didn’t want to deal with WordPress. And easy bookmarking was the only reason why I was using WordPress.

Expiring vs. Permanent Skills · Collaborative Fund

Robert Walter Weir was one of the most popular instructors at West Point in the mid-1800s. Which is odd at a military academy, because he taught painting and drawing. Weir’s art classes were mandatory at West Point. Art can broaden your perspective, but that wasn’t the point. Nineteenth-century West Point cadets needed to be good at drawing because cartography was in its infancy. High-quality maps of the United States – let alone, say, Mexico – were scarce, if they existed at all. Military officers were expected to draw maps on the fly and record a battlefield’s topography. It wasn’t a niche; it was vital to war. Weir’s favorite student, who passed the time at West Point drawing river bends and mountain ranges, was Ulysses S. Grant. West Point no longer offers drawing or painting classes. Its sole cartography course emphasizes mapping software and technology, as you might expect. Drawing was an expiring military skill. Critical in one era, diminished in the next, unmentionable thereafter. A lot of things work that way. Every field has two kinds of skills: Expiring skills, which are vital at a given time but prone to diminishing as technology improves and a field evolves. Permanent skills, which were as essential 100 years ago as they are today, and will still be 100 years from now. Both are important. But they’re treated differently. Expiring skills tend to get more attention. They’re more likely to be the cool new thing, and a key driver of an industry’s short-term performance. They’re what employers value and employees flaunt. Permanent skills are different. They’ve been around a long time, which makes them look stale and basic. They can be hard to define and quantify, which gives the impression of fortune-cookie wisdom vs. a hard skill. But permanent skills compound over time, which gives them quiet importance. When several previous generations have worked on a skill that’s directly relevant to you, you have a deep well of relevant examples to study. And when you can spend a lifetime perfecting one skill whose importance never wanes, the payoffs can be ridiculous. Anything that compounds over decades usually is. A few permanent skills that apply to many fields: Not being a jerk. Being a jerk offsets being talented one for one, if not more. They don’t teach this in school, but it’s the single most important career skill. Part of this includes empathizing with jerks who are being jerks because they’re dealing with stress. The willingness to adapt views you wish were permanent. Accepting when expiring skills have run their course. A lot of what we believe about our fields is either right but temporary, or wrong but convincing. Sam Arbesman’s book The Half-Life of Facts makes this uncomfortably clear. “Medical knowledge about cirrhosis or hepatitis takes about forty-five years for half of it to be disproven or become out-of-date,” he writes. “This is about twice the half-life of the actual radioisotope samarium-151.” Getting along with people you disagree with. Equally smart people can come to different conclusions. And as Larry Summers once noted, “There are idiots; look around.” Some of these people can be avoided. Many can’t. You have to deal with them diplomatically. People who view every disagreement as a battle that must be won before moving on end up stuck and bitter. Getting to the point. Everyone’s busy. Make your point and get out of their way. Respecting luck as much as you respect risk. Acknowledging risk is when something happens outside of your control that influences outcomes and you realize it might happen again. Acknowledging luck is when something happens outside of our control that influences outcomes and you realize it might not happen again. Staying out of the way as much as you offer to help. You can add as much value by getting out of people’s way and minimizing your burden as you can by actively helping. This is especially important for two groups: new employees eager to get involved, and senior managers eager to get involved. Accepting a certain degree of hassle and nonsense when reality demands it. The ability to be comfortable being miserable. Frances Perkins, Franklin Roosevelt’s Secretary of Labor, said the most remarkable thing about the president’s paralysis was how little it seemed to bother him. He told her: “If you can’t use your legs and they bring you milk when you wanted orange juice, you learn to say ‘that’s all right,’ and drink it.” A useful and permanent skill in a world that’s constantly breaking and evolving. The ability to distinguish “temporarily out of favor” from “wrong.” Endurance is key because every industry is cyclical, and putting up with its dark days is the only way to ensure you’re part of the good ones. Gracefully exiting when you realize that whatever fueled past success doesn’t work anymore is also key. Warren Buffett says his favorite holding period is forever, then dumped $7 billion worth of airline stocks based on a few weeks of data. That might lo

“Have you ever watched Inside the Actors Studio? The host, James Lipton, invariably asks his guests, “What factors make you decide to take a particular role?” The actor always answers: “Because I’m afraid of it.””

— The War of Art by Steven Pressfield
https://a.co/byFeRJx

“Heaven and Earth are meeting in a storm that, when it’s over, will leave the air purer and the fields fertile, but before that happens, houses will be destroyed, centuries-old trees will topple, paradises will be flooded.”

— Aleph by Paulo Coelho
https://a.co/cfOu5ja

“When a sense of dissatisfaction persists, that means it was placed there by God for one reason only: you need to change everything and move forward.”

— Aleph by Paulo Coelho
https://a.co/0J87Lcb

““You’re not here anymore. You’ve got to leave in order to return to the present.””

— Aleph by Paulo Coelho
https://a.co/6FWXQN3

““There’s no point sitting here, using words that mean nothing. Go and experiment. It’s time you got out of here. Go and re-conquer your kingdom, which has grown corrupted by routine. Stop repeating the same lesson, because you won’t learn anything new that way.””

— Aleph by Paulo Coelho
https://a.co/6b8GNXf

“In India, they use the word ‘karma,’ for lack of any better term. But it’s a concept that’s rarely given a proper explanation. It isn’t what you did in the past that will affect the present. It’s what you do in the present that will redeem the past and thereby change the future.””

— Aleph by Paulo Coelho
https://a.co/0hVgS5H

““I’m filled with doubt, especially about my faith,” I say. “Good. It’s doubt that drives a man onward.””

— Aleph by Paulo Coelho
https://a.co/6r1XVVl

“My search for wisdom, peace of mind, and an awareness of realities visible and invisible has become routine and pointless.”

— Aleph by Paulo Coelho
https://a.co/hT3kZXY

“There’s a secret that real writers know that wannabe writers don’t, and the secret is this: It’s not the writing part that’s hard. What’s hard is sitting down to write.”

— The War of Art by Steven Pressfield
https://a.co/6sJg1aj

My experience with Open Water Scuba certification in Dallas

This year I crossed off one of my bucket list item, got Open Water Diver certification. I had done scuba diving before at Honolulu. It is among my top 3 best experiences. Ever since that vacation, I had been wanting to get into diving more seriously.

But since we live in land locked Dallas, I didn’t think it was possible or worth it. Then this year in February I saw Groupon from International Scuba and I decided to just go for it. I think Groupon was for $250 but then there was a fine print which said we need to buy our own mask, fins, snorkel, and boots. I bought all this gear from International Scuba as they offered free gear rental for checkout dives. But this added about additional $200.

“In my opinion, the most important lesson that you can learn from reading this book is that you will not get rich quickly by day trading.”

— How to Day Trade for a Living: Tools, Tactics, Money Management, Discipline and Trading Psychology by Andrew Aziz
https://a.co/fmI1u8k

iPad Pro as main machine after 2 years

I got my iPad Pro at the end of 2017. Before buying it, I had read many blog posts by various developers who were using iPad for programming and web development. But soon after I bought it, I realized that serious web development on iPad is hard. The biggest issue was debugging JavaScript and CSS without web tools.
At first, I was having buyer’s remorse but I loved the form factor of iPad and loved drawing on it. I am used to reading on Kindle and iPad was just too heavy for long reading sessions but it was very decent reading device for quick reading sessions. So I kept it.

“The things we really want to do are…

“The things we really want to do are usually the ones that scare us the most. The things you’ll not feel conflicted about are the choices that leave no one hurt.”

— What Should I Do with My Life?: The True Story of People Who Answered the Ultimate Question by Po Bronson
https://a.co/izynNz8

Ask HN: How do I start my own consulting firm? | Hacker News

Here are some things to consider about consulting:Sales/Selling is the last thing on your list and salesperson is only a maybe. Reverse all of your priorities because selling and relationships are the most difficult things to master for a consulting company and you will die without those skills.In consulting, tech talent < sales/relationship talent. In fact, if you’re great at the latter go ahead and get started now because there are lots of great tech people who don’t want to do it and will come work for you on a nice contract rate.To give you an example of this I once worked with a consultant who was a technical rock star, and another consultant who was supposed to be technical but was actually pretty below average. The below average guy was more successful because he was great when talking with the customers and they loved him. He knew enough to talk through problems at a high level, explained things well, and made them feel comfortable that things we’re on the right track. If he didn’t know something, no problem, he just went and found someone with the answer.Besides those soft skills he knew how to set and manage expectations. You may be used to the best results winning, but if you don’t manage and then exceed expectations it doesn’t matter. People love you when they expect 80 out of 100 and you deliver 88. They will not be happy and often fire you if expecting 100 out of 100 and you deliver 92. You will wonder how you just lost to a competitor who is not “as good” as you.Even if you have pretty good soft skills, do you want to spend time constantly using them? I thought you liked the tech side? If you like both then great because someone has to spends tons of time doing it to sell, maintain, and expand the work and your success depends on how good they are at it.For many people this will all be hard to believe, or they think it’s exaggerated, or that it’s easy to just hire someone to do it. That’s fine, I hope you have great success. Drop me a line in a couple years to say how things turned out.

“For would be entrepreneurs he calls them “wantrapreneurs”…

“For would-be entrepreneurs (he calls them “wantrapreneurs”), or entrepreneurs who’ve grown a little too comfortable, Noah has a recommendation—ask for 10% off of your next few coffees. “Go up to the counter and order coffee. If you don’t drink coffee, order tea. If you don’t drink tea, order water. I don’t care. Then just ask for 10% off. . . . The coffee challenge sounds kind of silly, but the whole point is that—in business and in life—you don’t have to be on the extreme, but you have to ask for things, and you have to put yourself out there.””

“I remember walking out of the station around…

“I remember walking out of the station around midnight. It was up on the top of this mountain, a beautiful place. I remember looking out and just saying, ‘Oh, my God, when am I going to like this? When am I going to really be happy with the work that I’m churning out?’ I look back on that all the time . . . if I could go back and just tell myself, ‘Don’t stress about it, it’s all going to work out in the end.’”

Reading a new book What should I…

Reading a new book, “What should I do now?”

I have been trying to figure out next steps in my career. On one hand, there is management track. Then on other side, I just like to code and not deal with meetings and all that. But then as a dev, my earning potential is limited. Been thinking of going solo as freelancer. Then I can focus on code and choose my own projects.

““I think we need to teach kids two…

““I think we need to teach kids two things: 1) how to lead, and 2) how to solve interesting problems. Because the fact is, there are plenty of countries on Earth where there are people who are willing to be obedient and work harder for less money than us. So we cannot out-obedience the competition. Therefore, we have to out-lead or out-solve the other people. . . .”

— Tools of Titans: The Tactics, Routines, and Habits of Billionaires, Icons, and World-Class Performers by Timothy Ferriss
https://a.co/62h4x27

““What could possibly be more important than your…

““What could possibly be more important than your kid? Please don’t play the busy card. If you spend 2 hours a day without an electronic device, looking your kid in the eye, talking to them and solving interesting problems, you will raise a different kid than someone who doesn’t do that. That’s one of the reasons why I cook dinner every night. Because what a wonderful, semi-distracted environment in which the kid can tell you the truth. For you to have low-stakes but superimportant conversations with someone who’s important to you.””

““Because most of us say yes to too…

““Because most of us say yes to too much stuff, and then, we let these little, mediocre things fill our lives. . . . The problem is, when that occasional, ‘Oh my God, hell yeah!’ thing comes along, you don’t have enough time to give it the attention that you should, because you’ve said yes to too much other little, half-ass stuff, right? Once I started applying this, my life just opened up.””

“DEREK “Well I meet a lot of 30…

“DEREK: “Well, I meet a lot of 30-year-olds who are trying to pursue many different directions at once, but not making progress in any, right? They get frustrated that the world wants them to pick one thing, because they want to do them all: ‘Why do I have to choose? I don’t know what to choose!’ But the problem is, if you’re thinking short-term, then [you act as though] if you don’t do them all this week, they won’t happen. The solution is to think long-term. To realize that you can do one of these things for a few years, and then do another one for a few years, and then another.”

Ask HN: Parents of HN, what are your best sources for evidence-based parenting?

Here is a list of parenting books recommended by members of Hacker’s News community. All links are affiliate links to purchase these books from Amazon:

How to Talk So Your Kids Will Listen, and How to Listen So Your Kids Will Talk

One of a few books that are recommended multiple times in this thread. 4.5 stars with 1000+ reviews.

Cribsheet: A Data-Driven Guide to Better, More Relaxed Parenting, from Birth to Preschool by Emily Oster

Another book that was recommended by multiple people.

More research on choosing dev stack for game dev

Last week, I had decided to use Swift/Apple’s ecosystem for initial gamedev. But I wasn’t feeling 100% okay with getting locked into Apple’s ecosystem.

So I spent last week doing more research on developing simple apps using Swift, Xamarin, Flutter, and React Native.

Since I use JavaScript at work, React Native would be the easiest way for me to get started but it feels too much like work and I am kind of tired of js/npm dependencies and build tools. One nice thing about staying in Apple’s ecosystem is that everything has really good documentation and feels more polished.

Baby vs Dog

It is amazing how having your own kids changes everything.

I love my my dog and because of him I love almost all dogs. I hated leaving him home, so much, that I would not go to restaurants that don’t let dogs in patio. (With Whiskey Cake being notable exception). Every grocery trip, I would buy him a new toy, many times had arguments with wife because he had too many toys. Every vacation we would have huge argument because I wanted dog friendly vacation where we can take our dog.

Developer Hegemony by Erik Dietrich

I am not sure how I found this book by Erik Dietrich. Maybe Google or Amazon recommended it. But I found it very inspiring. There are so many things in it that I agree with and so many new things that I am still having hard time believing.

As a developer, who is having a hard time figuring out his career, this book provided an interest perspective. The basic idea in it is that in any big corporation, developers are unlikely to find fulfilment. They may truly believe in their employer’s mission and try to climb corporate ladder. When they do that they will get stuck in middle management. They will keep working hard, hoping to move on to executive roles but very few would do by believing and hard work alone.

Git Simplified

One of most common technology that new professional developers struggle with is git.

Many junior developers are eager to start using all of the powerful commands of git and usually end up getting more confused.

Here are a few commands that I recommend to anyone learning git for the first time:

clone

This downloads entire git repo from a remote server, usually. You will get all revision history and branches.

Tools of Trade

I use 13-inch MacBookPro for personal projects and 15-inch for work. My personal MBP would be last traditional laptop, hopefully. Since most of my work can easily be done on Linux VPS. I have been using 10.5-inch iPad Pro with Blink shell for most my side projects. I like the form factor of iPad Pro and I am getting better at Linux administration. Now I am also setting up Docker images so I can bring up new images as needed.

You don’t need a web developer

Occasionally, when people find out I am a programmer, they ask me if I will build  them a website or an app on the side. As I spend all day programming at my work, I rarely have motivation to continue programming after work.

However, talking to most people, I realize they don’t need a programmer; most of their needs can be met by a simple SaaS solution. Recently, I directed a few friends to WordPress.com, SmugMug, Shopify, etc. They all were happy with the results and ease of use. Also I am glad they talked to me because one guy was ready to spend a few thousands on a developer for a WordPress-based site.

WordPress vs Hugo

Managing WordPress can get time consuming. I have tried to move to static website several times but kept going back to WordPress. But there are several advantages of static sites generators that I finally moved for good. I am also advising a lot of my clients to use Hugo especially when they know that they will rarely ever update their sites.

Here are some of main advantages of Hugo (or other static site generators) vs WordPress and other CMS.

iPad Pro for Programming & Fun

I finally bought 10.5” iPad Pro (Affiliate Link). It was mostly an impulse purchase. When first I started to use iPad, it felt blah. It is hard to find good apps or what apps you might want to try out.

My main goals with iPad was to have a really small laptop replacement. So I was hoping for a decent code editor. There are some code editing apps but there is no way to try them out before purchasing. So I am spending a lot of time reading reviews before I purchase any app.

Working Remotely

As a developer, I am lucky that I get to work from home as needed. But I have never been 100% remote; Lately, I have been reading a lot about working remotely, remote first companies, Digital Nomad lifestyle etc. This is compilation of various resources that I have found useful so far:

The Ultimate Guide to Working Remotely – I haven’t gone through whole guide yet but so far it has been very informative.

Upgrading to PHP 7.0 on Ubuntu 14

I upgraded PHP to version 7.0 on Ubuntu box. Running php -v on shell would show it as version 7.0. But Apache was still using PHP 5.6. I tried various methods to update settings for Apache but nothing worked until I issued following commands:

sudo a2dismod php5.6
sudo a2enmod php7.0
sudo service apache2 restart

Source: PHP 7.0 (and 5.6) on Ubuntu | LornaJane

Setting Up Laravel on MacOS

After 3 years, I am using Laravel again at work. Laravel has extensive documentation but sometimes it can be a bit verbose. Here are command to get you started as soon as possible. This assumes pretty much fresh install of MacOS.

Install Homebrew

Check the official site for latest command

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install PHP 7.1

brew install homebrew/php/php7

Install MariaDB

brew install mariadb

Set MariaDB to start as service at the end of installation.

The E-Myth Revisited by Michael E. Gerber

My biggest takeaway from this book was that most people start business to create a job for themselves. For example, a person who enjoys baking may start a cake shop. The problem with this approach is that one is working in the business, not on it. The right way to start a business is with a goal of eliminating one’s job. For example, the person above should figure out a way to hire someone else to do baking.

The Subtle Art of Not Giving a F*ck

I learned of Mark Manson through his blog, especially this post, 7 Strange Questions That Help You Find Your Purpose. Since then I have been on and off following his blog. He usually has a lot of good advice, so finally I decided to get his book. Makes it easier to have all information in one place.

I had no idea what Subtle Art of Not Giving a F*ck was about. It was an impulse purchase, perhaps to support his blog. It turns out to be a really good book. As a semi-regular reader of his blog, I sort of knew what his philosophies were. Still it was good to read everything in one place.

Ftp from Lightroom

I signed up on a few microstock sites hoping recoup some of cost of my camera. These sites provide FTP access for easy uploading photos. Lightroom doesn’t come with an easy way to publish or export photos to FTP site.

But Lightroom SDK comes with a free sample plugin that can export photos to a FTP site. It works really well and very easy to install. I learned this at LightroomSolutions.com.

The War of Art

I wasn’t sure what to expect when I picked up “The War of Art” by Steven Pressfield. It shows up on Hacker’s News and other entrepreneurs’ forums regularly as a recommended reading. Steven Pressfield is a novelist but this book is popular reading for anyone who is pursuing a goal.

The author’s main point is that the most important and the hardest thing is doing. Weather that be sitting down at desk to write a novel or software. Once you are at your desk, or at your office, the hard part is done. This can apply to anything; fitness, painting, photography, etc.

Lightroom & Smugmug Workflow

Now that I have a new fancy camera, I have tried to organize my photos better. Over years I have collected about 70GB of photos. It seems a lot to me but apparently there are many people with well over 1000 GB of photos. The biggest challenge with so many photos is that it is hard to organize them. Upon several recommendations and some searches on the web, it seems Lightroom is the best software for organizing and managing photos.

How to Fail at almost Everything & Still Win Big

How to Fail at almost Everything but still Win Big by Scott Adams (affiliate link) comes up on Hackers’ News a lot. Finally, I had a chance to read it.

This is a little different kind of book compared to my regular reads about ultra-successful business titans. I had no idea who Scott Adams was until I heard about this book. He created Dilbert comic. He gave very down to earth perspective on how he achieved success in this book.

Magento – Get All Products with Categories in a Flat View

     SELECT
        w1.website_id,
        w1.name  as  website_name,
        s1.store_id,
        s1.name  as  store_name,
        p1.entity_id  as  product_id,
        p1.sku,
        pname.value  as  product_name,
        url.value  as  url_path,
        small_image.value  as  small_image,
        msrp.value  as  msrp_price,
        price.value  as  price,
        p1.created_at  as  product_created_at,
        p1.updated_at  as  product_updated_at,
        visibility.value  as  visibility,
        pstatus.value  as  status,
         case
             when
                (pstatus.value  =   1
                     and  visibility.value  >   1 )
             then
                 1
             else   0
         end as  enable_flag,
        c1.entity_id  as  category_id,
        cname.value  as  category_name,
        c1.parent_id,
        c1.created_at  as  category_created_at,
        c1.updated_at  as  category_updated_at
     FROM
        catalog_product_entity p1
             inner join
        eav_attribute p_attr  ON  p1.entity_type_id  =  p_attr.entity_type_id
             and  p_attr.attribute_code  =  'name'
             inner join
        catalog_product_entity_varchar pname  ON  pname.entity_id  =  p1.entity_id
             and  pname.attribute_id  =  p_attr.attribute_id
             inner join
        eav_attribute p_attr2  ON  p1.entity_type_id  =  p_attr2.entity_type_id
             and  p_attr2.attribute_code  =  'url_path'
             inner join
        catalog_product_entity_varchar url  ON  url.entity_id  =  p1.entity_id
             and  url.attribute_id  =  p_attr2.attribute_id
             and  pname.store_id  =  url.store_id
             inner join
        eav_attribute p_attr3  ON  p1.entity_type_id  =  p_attr3.entity_type_id
             and  p_attr3.attribute_code  =  'small_image'
             inner join
        catalog_product_entity_varchar small_image  ON  small_image.entity_id  =  p1.entity_id
             and  small_image.attribute_id  =  p_attr3.attribute_id
             and  pname.store_id  =  small_image.store_id
             inner join
        eav_attribute p_attr4  ON  p1.entity_type_id  =  p_attr4.entity_type_id
             and  p_attr4.attribute_code  =  'msrp'
             inner join
        catalog_product_entity_decimal msrp  ON  msrp.entity_id  =  p1.entity_id
             and  msrp.attribute_id  =  p_attr4.attribute_id
             and  pname.store_id  =  msrp.store_id
             inner join
        eav_attribute p_attr5  ON  p1.entity_type_id  =  p_attr5.entity_type_id
             and  p_attr5.attribute_code  =  'price'
             inner join
        catalog_product_entity_decimal price  ON  price.entity_id  =  p1.entity_id
             and  price.attribute_id  =  p_attr5.attribute_id
             and  pname.store_id  =  price.store_id
             inner join
        eav_attribute p_attr6  ON  p1.entity_type_id  =  p_attr6.entity_type_id
             and  p_attr6.attribute_code  =  'visibility'
             inner join
        catalog_product_entity_int visibility  ON  visibility.entity_id  =  p1.entity_id
             and  visibility.attribute_id  =  p_attr6.attribute_id
             and  pname.store_id  =  visibility.store_id
             inner join
        eav_attribute p_attr7  ON  p1.entity_type_id  =  p_attr7.entity_type_id
             and  p_attr7.attribute_code  =  'status'
             inner join
        catalog_product_entity_int pstatus  ON  pstatus.entity_id  =  p1.entity_id
             and  pstatus.attribute_id  =  p_attr7.attribute_id
             and  pname.store_id  =  pstatus.store_id
             inner join
        catalog_category_product ccp  ON  ccp.product_id  =  p1.entity_id
             inner join
        catalog_category_entity c1  ON  c1.entity_id  =  ccp.category_id
             inner join
        eav_attribute c_attr  ON  c1.entity_type_id  =  c_attr.entity_type_id
             and  c_attr.attribute_code  =  'name'
             inner join
        catalog_category_entity_varchar cname  ON  cname.entity_id  =  c1.entity_id
             and  cname.attribute_id  =  c_attr.attribute_id
             and  pname.store_id  =  cname.store_id
             inner join
        catalog_category_product_index store1  ON  store1.product_id  =  p1.entity_id
             and  store1.category_id  =  c1.entity_id
             inner join
        core_store s1  ON  store1.store_id  =  s1.store_id
             inner join
        core_website w1  ON  s1.website_id  =  w1.website_id

OpenShift Error: Layer 7 Wrong Status, Invalid Response

I have been playing with OpenShift for past several hours. It looks great. But a while back I started to get 503 Internal Server error.

When I checked logs using rhc tail , I saw this error: Layer 7 Wrong Status, Invalid Response 404.

I spent an hour or so troubleshooting. Turns out the issue was Netbeans had added src/main/web/app/WEB-INF/jboss-web.xml when I ran the application locally on my machine. I committed this file, thinking I might need it. Deleting it from repo fixed the issue.

Filter Some Keys in Multi Dimensional Arrays in Php

/**
 * Cleans up multi-dimensional arrays.
 * 1st dimension is a simple index
 * 2nd dimension includes the desired keys
 *
 * @param mixed $array
 * @param mixed $keysToInclude
 */
public function cleanUpArray($array, $keysToInclude) {
    $returnArray = array();
    $i = 0;

    foreach($array as $item){
        foreach($keysToInclude as $key){
            $returnArray[$i][$key] = $item[$key];
        }

        $i++;
    }

    return $returnArray;
}

4 Hour Body by Tim Ferris

Slow Motion Workout

The technical term is 5/5 Cadence (5 seconds up, 5 seconds down). I tried this for the first time on Sunday, it is really intense. Momentum is not there to help you. You will feel every part of your muscle throughout the motion.

Weights

Tim Ferris showed a simple formula to figure out what should be the starting weight to workout with. Simply do regular sets. If you can do 5 rep, wait a minute & then increase the weight by 10 lb or 10%. When you fail a set, then take 70% of last 5 rep set and use that weight for slow motion workout. You can figure out weights to use by trial and error. This should prevent injuries or wasted time.

MySQL Update If Exist Else Insert Procedure

Are you tired of checking data in your code before inserting? Well MySQL procedures are here to rescue. This simple procedure shows how you can do that:

CREATE PROCEDURE   ` update_insert_user ` (  IN  uid2 int  )
 BEGIN
 DECLARE  last_login2 DATETIME;
 SELECT   ` last_login ` INTO  last_login2  FROM   `  user  ` WHERE   ` uid `   =  uid2  LIMIT   1 ;
 IF  last_login2  IS NULL THEN
 INSERT INTO   `  user  `  ( ` uid ` , ` last_login ` )  values  (uid2, now());
 ELSE
 UPDATE   `  user  ` SET   ` last_login `   =  now()  WHERE   ` uid `   =  uid2  LIMIT   1 ;
 END IF ;
 END

Codeigniter Creates a New Session With Each Page Load

Just spent 3 hours debugging a session bug in my webapp. CodeIginter was creating a brand new session with each page load. The issue was a misconfiguration with my config file.

Fix was simple, in /application/config/config.php, make sure correct domain is set for $config['cookie_domain'].

Codeigniter Out of Memory Error

Query Saving is a feature of CI’s database class that stores the results of every query in memory until the controller is finished executing. As it turns out, in version 1.6.0, the ability to turn this off was added. The addition of the save_queries variable is listed in the Change Log, but as of the latest release of 2.0.0 last week, it still hasn’t made the documentation.

$this->db->save_queries = FALSE;

via Undocumented CodeIgniter | Green Egg Media.

ssh_exchange_identification: Connection closed by remote host

I tried to login to my server tonight but kept getting following error message:

ssh_exchange_identification: Connection closed by remote host

The fix was simple, at least if you have access to server via cPanel. Just restart sshd service via cPanel/WHM.

Setting Up Pentaho BI on Windows Box

I am not sure if this works anymore or not. I don’t use Pentaho now but this post seems popular, so leaving it here for now. Contact me if this is incorrect and needs to be corrected or taken down.

  1. Download Pentaho BI Pre-Configured Installation from [http://www.pentaho.org/download/ga.php]
  2. Install JDK5.
  3. Open C:\pentaho-demo\pentaho-solutions\system\publisher_config.xml. Add a password for publishing reports.
  4. Delete all folders except reporting under C:\pentaho-demo\pentaho-solutions\samples.
  5. Delete all .xaction and .properties files under reporting.
  6. Copy JDBC driver for your database under C:\pentaho-demo\jboss\server\default\lib. I used Oracle 10g driver, it is called ojdbc.jar.
  7. Edit .jsp file to change the look of default Pentaho website under C:\pentaho-demo\jboss\server\default\deploy\pentaho.war\jsp.
  8. Add path to your JDK in start-pentaho.bat located under C:\pentaho-demo. For example, set JAVA\_HOME=C:\Program Files\Java\jdk1.5.0\_11
  9. Double click on start-pentaho.bat.
  10. Open C:\pentaho-demo\jboss\server\default\deploy\pentaho.war\WEB-INF\web.xml. Search for base-url and add your server’s ip.
  11. Now you should be able to publish reports to Pentaho using Report Wizard or Report Designer.
  12. Once you publish report, you will need to go to C:\pentaho-demo\jboss\server\default\deploy and open newly created data source file named something like ???????-ds.xml.
  13. If your database is Oracle you will need to change driver class property to oracle.jdbc.driver.OracleDriver
  14. And your newly published report should be accessible via Pentaho now.