Monday, September 4, 2023

ALMOND BUTTER

 Almond butter is a product derived from almonds. The butter can be made from sub standard almonds mixed with good almonds. The nuts has to be roasted because the roasted nuts emits more flavor and the roasted ease the almonds for crushing as the moisture in the almond is removed. The roasted almonds are tastier as  the sweetness in the almond has increased a bit. The roasting increases the sugar content in the almond because of the reaction between the heat and the almond. The almonds have natural oil in them all the nuts have natural oils. The almonds have natural that's why almonds have saturated fat but very low saturated fat but high in unsaturated fat. Almond oil are  not useful in cooking since they cannot tolerate because of low saturated fat.  Almond oils can be used for dressing on salads and food. The Roasted almonds when crushed at high pressure becomes almond butter. The almond butter is produced. Once the almond is collected and stored in a jar the oil floats on the top and the flesh of the almond sinks to the bottom because of the weight. It is recommended to stir the almond butter before spreading. The  trick is to put the spoon all the way to the bottom of the jar and stir them with a butter knife. The oil will drizzle out of the butter knife. The fleshy part of the almond will stick to the butter knife and will not fall down as it doesn't have much oil. The fleshy sticked almond to the butter knife  can be used to spread it on the bread or anything. Take  some oil from the jar floating on the top and mix it with fleshy part while spreading on the bread. This gives an opportunity to use the oil and almond equally. When the jar is half full or half of the jar is used we end up using the oil a lot not the almond and the other half of the almond butter in the jar will be dry and the texture will not be smooth rather dry.  So it's better to be careful this way.  The almond butter when consumed at low quantities like one or two spoons are actually filling and chances of eating more food is restricted which in turn controls the calorie intake and becoming obese. 

Monday, July 5, 2021

Independence Day 2021 celebrations

Hi,

July 4th 2021 falls on a week end giving an extra holiday without a break. Parents can plan a short trip as Monday will be a holiday giving that luxury of  having an extra day . If July 4th falls on a week day except on friday, parents have to take days off till the independence day which might be too much days for a short trip. I thought if Independence day  is to be celebrated  on that day why is there a necessity to give Monday a holiday if ID falls on the week end. The significance is to celebrate with community as a whole not an individual or family celebration. At times I contradict myself  one of the perils of the human mind.

My neighbor was talking to my wife  about the list of  places where  ID will be celebrated with in the county. As the nation is recovering from COVID pandemic not many places are celebrating ID. I wonder why? actually this should be the occasion and in fact a good reason to celebrate as we are recovering from the pandemic and economy is back on track at least in DC belt. We finally decided on a place to celebrate the ID with unknown people. The ID was celebrated  on a Giant field which has the capacity to park few thousands of cars. We in USA Celebrate ID  watching fire crackers at play lit by the county police or fire man for about 20-25 minutes. The County Collected 5 dollars for each car collected by  school volunteers and no bills were issued. The Volunteers can actually pocket few dollars and can give  a treat to their friends. There are no counts on the number of cars that came to the field. 

Food trucks were present in the park since 5'0 clock and people started coming in slowly. The moment was built step by step as more people started coming in and forming a queue to order ice cream, hot dogs and sausages. Most of the people came up with camping chair and towels to sit on them as the field grass is so thick probably a native variety. Our family was an outlier coming up with food which was available there rather than chair or towels. An important lesson is go with a thick towel or camping chair to watch the fire crackers, This gives so much comfort to sit and watch the fire crackers without much itching. 

The county  arranged for a music show, an amateur artist was singing country songs and to my surprise many people were watching while licking their ice cream and hot dogs. The music show went on for more than an hour and it wasn't that bad which kept the environment alive without much boredom. The instruments were guitar and drums. The singer played guitar while singing which is an impressive skill because it's tough to do  2 incredibly hard things at the same time very efficiently and effortlessly. I have no idea about the songs or lyrics but the environment made it much more enjoyable. Music, food and fire crackers can bring people of different races together as we are all genetically wired to incredible but similar things to enjoy. I remember a dad and his 4 year old son were simply jumping for the drum beats. The father was enthusiastically jumping with his son  and giving his son a work out to exhaust all his energies so that the father can be at peace while watching the fire works.

The environment was buzzing with people. To my surprise lot of I saw lot of interracial couples with their grown up children indicating that racism gap is been bridging for quite some time. To my surprise dogs were missing in action it seems they might be scared of the sound of fire crackers but to be honest the sound wasn't that loud. The dog could poop once they see the grass or urinate if they saw a post. Either way it's hard to control them on a crowded environment. Apparently I saw few of them so no restrictions by the county to bring the dogs. 

The fire crackers started at 9:00 clock on an open field. A new experience as I always watched the fire crackers from the residential area and found very hard to find a parking spot. this was on the field and a good experience of driving my CRV on a decent country road with car head lights but no road light. I could see the firemen lighting the  fire crackers one after the other. The FM were lighting the next Fire crackers when the previous one was about to end so at times two different fire crackers were on the sky at the same time drawing beautiful flowers on the space emitting harmful fumes which were travelling up as it never touched the people watching them from quite a distance. The flowers on the sky were a treat to watch and science behind this art is fascinating and ironically we all celebrated the ID with fire crackers Made in China. The ID celebrations lasted for 25 minutes short but sweet. They end with some special FC at the end which I didn't know so my observation all these years were poor or I was thinking how to find the car and get out once the celebrations are over.

We waited for some time for the traffic to clear out. My son was pestering me to go to the car but I was hesitant seeing the backed up cars waiting to speed away to their home. Anyhow we came and found the car (a surprising thing) and drove to home with all our hearts content ending the week end in a style.







Tuesday, June 8, 2021

Brother Printer

 My printer MFC-J491DW started printing in light gray color instead of normal black and white color. I restarted my printer a couple of times to see whether the default print options would be restored but it's not and felt stupid as the print options are saved in the printer storage system. The google search led me to try couple of options one is try setting the printing preferences and here is the link

https://support.brother.ca/app/answers/detail/a_id/83445/~/the-printed-pages-are-faint%2C-light%2C-or-faded.-how-do-i-improve-print-quality%3F

I followed the instructions but I wasn't able to find print density option on my windows 10 machine. The instructions on the site is not good as it didn't had any instructions if the required option is not there and not any alternate solutions. Technology has become easy to use and complicated  to debug. In these ERA of DIY, instructions has to be precise and clear so that the customer is not stressed out in fixing the problem and not wasting his time. If a customer doesn't know to fix such simple things they will end up in throwing and buying similar product wasting money when a simple fix would have solved the problem. 

I had  new cartilages so I replaced the old one with the new ones. This printer require four cartridges they are yellow, blue, maroon and black. The model is LC3013XL. I thought may be the printer ran out of ink though the printer will alert you on low ink ahead of time before the ink runs out. I was stupid here as well thinking that the replacement would work but it  didn't. So I was angry and stressed out because printer has become a necessity as we buy product from amazon and we end up returning some of the product. To return a product at a UPS store requires sometimes a printed label and sometimes the store do not accept QR Code on the smart phone. Googled multiple times to find a solution but found nothing. 

I played with the printer options on the printer looking for a key word density as that's the solution came up in many sites. I saw an option clean the head and  said Ok to clean the head. The machine cleaned the head and tested the print out still no luck. The machine cleaned the head again but this time it worked. The printer was printing in normal thickness.

1. Click on setting in the printer.

2. Click on general set up.

3. click on maintenance

4. click on Print Head cleaning.

5.Choose the color.

6. I chose the black color.


The printer accumulates lot of dirt over a period of time and it's required to clean the printer header periodically to get good quality print outs and save money without buying new ones. The brother printer cleaned the head but I think it uses some cleaning solutions which should be inside the printer. The cleaning solution will run out as it will be used the printer to clean the head. Here is the link to start looking for printer head clean solution. 


https://www.amazon.com/BEST-PRINTERS-Print-Head-Cleaning-Epson-Canon/dp/B07K1B4GSJ


bottom line try the following approaches to fix the issue.

1. Play with printer options both on the printer and computer

2. The printer is smart enough to alert you to change the printer but still go ahead and trying  putting new cartridges.

3. Try targeted not generic  print head cleaning solution specific to the printer brand. different manufacturer might use different technology to manufacture head so one size fits all will not work.

4.Check with some one who knows about gadgets. We have too many geeks around us like neighbors, colleagues and friends who can hand a solution without much soul searching on our part. This will save a lot of time and frustration. The mantra is get help to fix the issue. 

The instructions what we find on the internet is not good enough to fix some of the problems that we face using electronic gadgets.



Tuesday, March 30, 2021

knights tour

 using System;

using System.Linq;

using System.Collections.Generic;


public class Program

{

static int[] rowArray = new int[8] {2, 2, -2, -2, -1, 1, -1, 1};

static int[] colArray = new int[8] {-1, 1, -1, 1, 2, 2, -2, -2};

//static int[] rowArray = new int[8]{ 2, 1, -1, -2, -2, -1, 1, 2 };

//

    

//static int[] colArray = new int[8] { 1, 2, 2, 1, -1, -2, -2, -1 };

private static bool[,] knights = new bool[8, 8];

private static List<string> placedKnightsCount = new List<string>();

public static void Main()

{

setKnightToFalse();

placedKnightsCount.Add("0,0");

knights[0,0]=true;

placeKnights(0,0);

int index=1;

foreach(var move in placedKnightsCount)

{

System.Console.WriteLine(index.ToString()+"::"+move.ToString());

index++;

}

System.Console.WriteLine(placedKnightsCount.Select(x=>x).Count());

}

private static bool  placeKnights(int row, int col)

{

if (placedKnightsCount.Count() >= 64)

           return true;

  for (var array = 0; array <= 7; array++) 

{

      if (rowArray[array] + row >= 0 && rowArray[array] + row <= 7

        && colArray[array] + col >= 0 && colArray[array] + col <= 7 &&

        knights[rowArray[array] + row,colArray[array] + col] == false) 

{

knights[rowArray[array] + row,colArray[array] + col] = true;

placedKnightsCount.Add((rowArray[array] + row).ToString() + ',' + (colArray[array] + col).ToString()

   +"::rowArray"+rowArray[array].ToString()+","+row.ToString()

  +"::cola=Array "+colArray[array].ToString()+","+col.ToString()

+","+"::cola=sum "+(colArray[array]+col).ToString()

);

var b = colArray[array] + col;

if (placeKnights(rowArray[array] + row,b))

{

 

return true;

}

else 

{

knights[rowArray[array] + row,colArray[array] + col] = false;

System.Console.WriteLine("FAILED::rowArray"+rowArray[array].ToString()+","+row.ToString()

  +"::cola=Array "+colArray[array].ToString()+","+col.ToString());

}

  }

}

return false;

}

private  static void setKnightToFalse() {

    for (var row = 0; row <= 7; row++) {

      //this.knights[row] = [];//

      for (var col = 0; col <= 7; col++) {

       

        knights[row,col] = false;

      }

    }

   //System.Console.Write(knights[7,7]);


  }

  


}


 

eight queen problem

 My dream of solving this eight queen problem has come true. Recursion is always challenging.


using System;

using System.Linq;

using System.Collections.Generic;


public class Program

{

static int[] rowArray = new int[8] {2, 2, -2, -2, -1, 1, -1, 1};

static int[] colArray = new int[8] {-1, 1, -1, 1, 2, 2, -2, -2};

//static int[] rowArray = new int[8]{ 2, 1, -1, -2, -2, -1, 1, 2 };

//

    

//static int[] colArray = new int[8] { 1, 2, 2, 1, -1, -2, -2, -1 };

private static bool[,] knights = new bool[8, 8];

private static List<string> placedKnightsCount = new List<string>();

public static void Main()

{

setKnightToFalse();

placedKnightsCount.Add("0,0");

knights[0,0]=true;

placeKnights(0,0);

int index=1;

foreach(var move in placedKnightsCount)

{

System.Console.WriteLine(index.ToString()+"::"+move.ToString());

index++;

}

System.Console.WriteLine(placedKnightsCount.Select(x=>x).Count());

}

private static bool  placeKnights(int row, int col)

{

if (placedKnightsCount.Count() >= 64)

           return true;

  for (var array = 0; array <= 7; array++) 

{

      if (rowArray[array] + row >= 0 && rowArray[array] + row <= 7

        && colArray[array] + col >= 0 && colArray[array] + col <= 7 &&

        knights[rowArray[array] + row,colArray[array] + col] == false) 

{

knights[rowArray[array] + row,colArray[array] + col] = true;

placedKnightsCount.Add((rowArray[array] + row).ToString() + ',' + (colArray[array] + col).ToString()

   +"::rowArray"+rowArray[array].ToString()+","+row.ToString()

  +"::cola=Array "+colArray[array].ToString()+","+col.ToString()

+","+"::cola=sum "+(colArray[array]+col).ToString()

);

var b = colArray[array] + col;

if (placeKnights(rowArray[array] + row,b))

{

 

return true;

}

else 

{

knights[rowArray[array] + row,colArray[array] + col] = false;

System.Console.WriteLine("FAILED::rowArray"+rowArray[array].ToString()+","+row.ToString()

  +"::cola=Array "+colArray[array].ToString()+","+col.ToString());

}

  }

}

return false;

}

private  static void setKnightToFalse() {

    for (var row = 0; row <= 7; row++) {

      //this.knights[row] = [];//

      for (var col = 0; col <= 7; col++) {

       

        knights[row,col] = false;

      }

    }

   //System.Console.Write(knights[7,7]);


  }

  


}


 

Saturday, March 27, 2021

binary search

 Here a simple binary search works with typescript.  The following conditions before the search start using binary search technique starts.  The search list should be sorted else  this technique is not effective at all. why because this technique basically narrows down the result set to search let say if you a list [2,4,6,8,10] first the technique will start from the middle of the list which is 6 in the list and index is 3. The algorithm will compare with number to be searched whether it's larger or smaller or equal. if searched number is smaller than 6 then we assume the searched number lies between index 0 and index 2. So search list is narrowed to indexes between 0 and 2. If the searched number is greater than 6 then we assume the searched number lies between index 3 and 4 so the search is narrowed to searching the indexes between 3 and 4. The list narrows down after each iteration either possibly finding the right index or terminating the search. The terminating the left hand side should be less than or equal to right.


class binarySearch {
  list = [];
   left = 0;
   right = 0;
  no: number;
  private index : number=0;
  findNumber() {
    console.clear();
    if(this.list.length ==0 || this.no == undefined)
      return
    while (this.left <= this.right) {
       var middle = Math.trunc(Math.floor(this.left+this.right)/2);
       console.log(middle,this.left,this.right)

      //conditions begin
      if (this.list[middle]<this.no)
          this.left = this.left+1;
      if(this.list[middle]>this.no)    
          this.right = this.right-1;
      if(this.list[middle]==this.no || this.index> this.list.length)    
      {
        console.log(middle,this.list[middle])
        break;
      }
      this.index++;
    }
  }
}
var bs  = new binarySearch();
bs.list=[4,7,8,9,10,11,12,99as any;
bs.no = 4;
bs.left = 0;
bs.right=bs.list.length-1;
bs.findNumber();


simple linked list with traversal forward and back ward

 The bare simple sample code shows how a simple linked list works. It also traverse the linked list.

both forward and backward.  I


class linkedList {
   no: number;
   next: linkedList;
   previous : linkedList;
}
  

  




class consumer {
  head = new linkedList();
  tail = new linkedList();
  createLinkedList() {
    //initialize head
    this.head.no = 1;
    var previous = this.head;
    var current = new linkedList();
    for (var i = 3; i <= 10; i++) {
       current = new linkedList();
      current.no = i;
      previous.next = current;
      current.previous = previous;
     
      previous = current;
      
    }
    //this.head.previous = current;
    this.tail = current;
    current =  this.head;
    while(current.next != null)
    {
      console.log(current.no)
      current = current.next;
    }
    console.log(current.no)
    while(this.tail.previous != null)
    {
      console.log(this.tail.previous.no);
      this.tail = this.tail.previous;
    }

    
  }
}
var consume = new consumer();
consume.createLinkedList();

type List = {
  no: number;
  next: linkedList;
}