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.


LeetCode 88: Merge Sorted Array solution

Here is my solution for Merge Sorted Array problem in PHP. This is not the most efficient 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);
        //print_r($endArr);
        $arr[$i] = $num;
        
        for ($x=$i+1; $x<count($arr); $x++) {
            //print_r($arr);
            $arr[$x] = array_shift($endArr);
        }
    }
}

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.


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.

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.

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


Finding childcare through your employer

It is amazing how hard it is to find childcare. There are a lot of Facebook groups to find nannies and babysitters. We had been looking for babysitters there but there is high rate of people showing initial interest and then disappearing for a week. We cannot hire someone like that to watch our son.

We decided we should signup with care.com or sittercity.com. However, my colleague reminded that our employer, IBM, has some sort of program to find childcare. That’s when we discovered that IBM indeed has really great options for this. We talked to some of our friends at other companies and turns out pretty much all much employers provide a lot of great options to find childcare. Here three different options that many employers provide.

Daycares

A lot of employers have discount deals with major daycare chains and independent daycares. We get up to 10% discount.

Babysitters or Nannies

There are various types of options here:

Free memberships

We get free membership to sittercity.com to search for babysitters or nannies. Some friends had access to other internal tools for this.

Nanny Placement

While you can search for nannies on sittercity.com, you will need to interview, run background checks, etc. You can hire a Nanny Placement agency that will handle all the initial interview and vetting process for you. They usually charge $1000+. We get 30% or up to $300 off placement fees and found similar discounts at our friends companies.

Day Camps

Again another option for childcare. Many employers have 20-30% discount deals with various day camps.

Emergency Backup Care

This is a life saver. My company subsidize cost of emergency childcare during work hours. Total out of pocket cost for in-home babysitter is $6/hour for us for up to 25 days a year. Our friends also had similar deals. Some friends didn’t had restrictions that it was for only during work hours. So they can use their service for date night etc.


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.


Real Estate

I work as a part-time REALTOR for White Rock Realty. I specialize in new construction homes. Currently, I am offering up to 50% of my commission in buyers’ rebates. If you or you know someone who is buying a new home, please contact me. Visit my site here to search for New Build homes.

If you want to buy a preowned home, I may not be able to help you but I know some great Realtors. Looking for a home with a REALTOR is like going on a date, if you are not a good match, it will make whole process a little less fun. Contact me and I can refer you to someone who will make this complicated process fun and easy for you.

Even if you are not buying or selling a home, feel free to contact me if you have any questions regarding real estate. I love discussing and exploring DFW. I can run reports for you, help you understand real estate processes, contracts, etc. Whatever real estate related question or concern you have, I will help you.


About

Hi,

This is a personal blog of a father, husband, software engineer, and real estate agent. I am based in Dallas, Texas. Over years focus of this blog has changed. These days, it is focused on parenting, exploring DFW, real estate, and programming. I love being father. It is one of the greatest joy of life. We got a small Bichon Frise and Poodle mix. Pool is our natural habitat.

Over years I had many hobbies but I was lucky that programming was one of my hobbies. Now programming pays for all my other hobbies. Lately, I am challenging myself to relearn all basic computer science algorithms and enjoying LeetCode exercises.

In addition to programming, I work as a REALTOR. I really enjoy discussing real estate and it gives me opportunities to explore Dallas and meet great new people. I specialize in new constructions, if you know anyone who is looking for a new home, please let me know. Feel free to ask me any question related to real estate.

Around the web

Here are direct links to my profiles on various social mdeia and other websites:

Social

  1. https://www.facebook.com/amer.khalid/
  2. https://twitter.com/amerkhalid
  3. https://www.instagram.com/amerkhalid/
  4. https://www.linkedin.com/in/amerkhalid/
  5. https://www.youtube.com/c/AmerKhalid/featured
  6. https://news.ycombinator.com/user?id=amerkhalid

Code

  1. https://github.com/amer3000

Photography

  1. https://www.flickr.com/photos/amerkhalid

Sidehustles

  1. https://www.facebook.com/amerkrealtor
  2. https://www.redbubble.com/people/amer2017/shop
  3. https://amzn.to/3yKaJDA (Affliate link)
  4. https://stock.adobe.com/contributor/205880508/ak2015