Tuesday, January 28, 2020

A long term IRA Portfolio Journal


I made plenty of mistakes my first year, primarily through trading and not investing. Again I joined stock markets race during Y2k melt-up situations. Everyone is talking about stocks during break time & this is first job in USA & took trading route. Just to make some quick bucks here.  But after 15K losses, With marriage, my philosophy has changed. All investing is limited to spouse IRA and my 401K only.  It essentially remains thus: build a core of 5 diversified funds with low expense ratio and 10 dividend paying equities, reinvest the dividends and allow them to grow. I don't have a lot of hard and fast rules for my holdings other than they must pay at least 5%. Also if a stock/fund give more than 25% of profits, sell 50% of position and lock the profits.
Currently, the retirement Portfolio consists of five funds and 20 odd stocks. Most of the stocks picks are 5 years old. I am holding some of these funds for 15+ years.

List of funds are:
Ø  VEMAX( Vanguard Emerging Markets Stock Index Fund Admiral Sh )
Ø   VGENX ( Vanguard Energy Fund Investor Shares )
Ø   VGPMX ( Vanguard Global Capital Cycles Fund )
Ø   VGHCX ( Vanguard Health Care Fund Investor Shares )
Ø   VGSLX ( Vanguard Real Estate Index Fund Admiral Shares)
Ø  VFIAX ( Vanguard 500 Index Fund Admiral Shares)

List of stocks includes
BEP
BIP
AMZA
REML
DX
CHI
GUT
ARCC
CII
EXG
APLE
BGR
RRC
PCI
AM
VEON
BGCP
AWP
CHMI
AMLP
GDX


I am not a financial analyst. I am not an expert in money, monetary policy, investment theories, theorems. My blog article should not be taken as advice, financial or otherwise, or as a statement of the right or proper way to do things. What I am is a regular guy, middle-aged, with a life full of past mistakes, most of which, I hope, I have learned enough from to continue forward in a positive direction. I am certainly not an expert in anything, but I am willing to learn, to ask right questions and take some risks.

At the end of December, the IRA is 20 years & I portfolio returned ~4.5% over last 20 years. But my point with this blog spot is long term view really works.  Regularly invest from paycheck and diversify and stay calm and ignore all the noise. Also always keep 5% of money in cash form. Sometime, if you find real value in anything, this helps.


















Thursday, October 17, 2019

2019 Summer Everglades summer trip and some advice

Will post entire trip details this week.

But for now, i will start with few pictures.


What's the biggest financial mistake you see many people make all the time?


Back when I was 28 years old, year 2000, I was making nearly ~100K minimum a year in IT field.
Every weekend, visiting A place for entertainment & spending, buying cool gadgets(At some point 3 TVs, Desktop, laptops, half dozen audio players etc.) On tops, based on  TV news, jumped in to Y2K stock market madness. But when stock market crashed, newly married, after a loss of job with 10K credit card debt, and on H1B Visa. Many sleepless night for short few weeks.
Luckily I found a job & saved me the entire scene.
Thinking backwards, I acted so dumb. Buying stocks based on news ( with margin). In my case, i used credit card money. plane DUMB.  So much of stuff for no reason.
fast forward 2019……..
Today, I am more comfortable.
 I learned how to save, invest, buying absolutely required stuff. More later

Monday, July 15, 2019

Funny amazon prime deals ( so far)

See the pictures below.
Why in the world, someone buys 3LB?
Jackup price and give 35% off.

Sunday, July 29, 2018

My first Rome trip (between July 3ed to 6th) Day-1 & 2

Following is our complete trip summary

1) 3ed. We started from London Gatwick Airport and reached Rome around 10.30

I made earlier hotel reservation around  Vatican . So i at the airport,  we are walking towards bus station. However, on the way,  i nice shuttle operator stopped me and explains, i will offer $10 Euro ride to Vatican which cheaper than the train option. So i took Shuttle service for $40 ( family of 4)
We reached our apartment place. After quick refresh/baths and quick lunch ( yummy Pizza) we headed to Vatican  Museums
( i made reservation when i was USA, Following is the website. https://biglietteriamusei.vatican.va/musei/tickets/do_

Since, i have reservation, i simply walked directly to the entrance. 

( if you dont plan a head, then you will struck in long lines for 2+ hours. Lines under direct sun light.
Outside, i noticed lot's of people advertising, no lines. direct check etc for extra $)

Lot's of rush but we managed to enter the Museum by 2.30 PM. ( my actual timing was 3PM. But no one care. So many people, all they care is the entrance ticket)


Few advice to family folks. ( before entrance, eat a lot. + carry lot's of liquids. Water etc. 

During our visit time, temperature is around 33 degree C)

We stayed 3 hours in the  ( there is a short cut to reach  Vatican Basilica by skipping 40% of museum. But we choose to watch all rooms as much as possible.)


around 7PM we reached our hotel room. this 10 minutes walk to Vatican/Vatican Basilica)

After some refresh, we went to dinner.  Again pizza/ drinks for dinner.)

We wrapped our first day like this


2ed Day:

by 7.30 we finished our breakfast and walked to St. Peter's Basilica)
No many people even on Wednesday 7.30 AM.
We did spend quality time in the St. Peter's Basilica and outside. Nearly two hour gone just like that.

Later we walked to nearby but-stop and tourist center to purchase Roma passes. ( these centers are open from 9.30 AM.   Caution: they will not accept Cash So you have use Credit card only. For parent we bought Roma passes and for kids, i took 3 day bus passes only.  Kids under 18 are free for most of the attractions in our list. So we choose Roma passes for parents only.)

After that we picked a bus to Termi station and later one bus to catch Triva fountain.  (Initially finding bus numbers/stop is little tricky. But my older son cracked the code. Will write more on that topic later.)








Sunday, July 15, 2018

2018 summer vacation UK/ROme

Location:British Museum

Interesting  idols from INDIA/south Asia  gallery



.

2018 Summer UK/Rome trip cntd 2

Location:Stonehenge   Day-3

Will add more later




2018 UK/Rome trip - part 1

Location: Windsor Castle , UK.
Day 1

I will add more content later.






Windsor Castle Guard change demo (only one guard)


Thursday, March 15, 2018

VIN anonymization

Data anonymization is a type of information sanitation whose intent is privacy protection. It is the process of either encrypting or removing personally identifiable information from data sets, so that the people whom the data describe remain anonymous.
This is a sample to anonymize VINs i.e. systems sends vehicle data however it is difficult to trace-back to the original VIN except the source system,

Old code.. ( may be usefull. When i did this POC, i tested for 1 millions VINs.
SHA-256 hash function really worked well for this set. Never tested this for 20 million.. But based on N grams this model will work


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.StreamTokenizer;
import java.io.Writer;
import java.util.*;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;


///goal is to read  millions of vins and aonymization the last 7 digits.
///this way VIN & its data can be share to anyone. however souring systems needs to trace back to 
// original VIN ... Steps... Use Java crypto API hash function w.r.t. simple java function
//So far no collisions on one million.. in case collisions, 
///thoughts are generating deterministic N grams based on hashed string..

public class VINAnonymization  {

   
   public static void main(String[] args) throws IOException {
   String stringToEncrypt ="FIXME";
       int ctr = 0;
    BufferedReader br = new BufferedReader(new FileReader("D:\\demo\\lvins.txt")); 
    
  try{
  
       MessageDigest messageDigest; 
       messageDigest = MessageDigest.getInstance("SHA-256");
       HashMap anomVinMap = new HashMap();
   StreamTokenizer st = new StreamTokenizer(br);
   String line = null;

   int loop =0;
while ((line = br.readLine()) != null){

   messageDigest.update(line.getBytes());
   byte[] mdbytes = messageDigest.digest();

      StringBuffer hexString = new StringBuffer();
    for (int i=0;i
        hexString.append(Integer.toHexString(0xFF & mdbytes[i]));
    }
    
    String anoVin = null;
  String nGramString = LRNGramString(hexString,7,0);
  if ( nGramString == null){
  System.out.println(loop+++";"+hexString.toString());
  continue;
  }
  anoVin = line.substring(0,9).concat(nGramString);
  if ( anomVinMap.containsKey(anoVin) ) {
  System.out.println("Collionson for a VIN-->"+anoVin+ "K:"+0);
  ctr++;
  ///Do this for two times... generate 3 ot 10 N grams in single call  & loop it
  //For now this is OK
  nGramString = LRNGramString(hexString,7,1);
  if ( nGramString == null) continue;
  anoVin = line.substring(0,9).concat(nGramString);
  if ( anomVinMap.containsKey(anoVin) ) {
  System.out.println("Collionson for a VIN-->"+anoVin+ "K:"+1);
  }else{
  anomVinMap.put(anoVin, line);
  }
  ctr++;
  nGramString = LRNGramString(hexString,7,2);
  if ( nGramString == null) continue;
  anoVin = line.substring(0,9).concat(nGramString);
  if ( anomVinMap.containsKey(anoVin) ) {
  System.out.println("Collionson for a VIN-->"+anoVin+ "K:"+2);
  }else{
  anomVinMap.put(anoVin, line);
  }
  }else{
  anomVinMap.put(anoVin, line);
  }
    messageDigest.reset();
  }

///Dump the map to CSV file or text file for comparisons
  System.out.println("Anonymization VIN map count"+anomVinMap.size());
  String eol = System.getProperty("line.separator");

  try (Writer writer = new FileWriter("D:\\demo\\out1.csv")) {
  for (Map.Entry entry : anomVinMap.entrySet()) {
    writer.append(entry.getKey())
          .append(',')
          .append(entry.getValue())
          .append(eol);
  }
  writer.flush();
  writer.close();
} catch (IOException ex) {
  ex.printStackTrace(System.err);
      }

  

} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
if (br != null ){
br.close();
}
}

         
   }
   
   //validation later
   static String LRNGramString (StringBuffer orgString, int legth, int position ){
   if ( orgString == null ) return null;
   return orgString.substring(position,legth).toUpperCase();
   
   }

}

Saturday, December 23, 2017

Google finance "Create Portfolio from quotes"

For a while this feature, it is not working. Multiple time, i reported to the help section documentation  & as feedback. I guess no one is looking in to end user feedback.. If this is the case, why asking. Not sure................





https://finance.google.com/finance/portfolio/create?hash=XzZuRXIyV1NZYkgzSV9YY1UxdmFvS3NKWnJ3fDE1MTQwODgyNTY&ei=QCc_WrneEsywmAGV7Z_4DQ


400.
That’s an error.
The requested URL was not found on this server.
That’s all we know.

Friday, December 22, 2017

“The Disaster Artist “ Incredible homage to the best bad movie of Hollywood

The film is a story of friendship between Tommy and Greg from bay area film school.

Greg is baby faced young actors dreaming of big carrier in Hollywood and Tommy odd looking middle aged rich guy dreams of Hollywood. One fine day, they both movie to LA in pursuit of their Hollywood. After multiple unsuccessful attempt to get in to acting, finally they decide the make a movie “The Room”. Rest of the plot is around filming of the ‘The Room” movie. Tommy writes, produces and finally acts a lead actor in his story. Inspired based on 2003 Hollywood independent movie and subsequent book, this is a perfect homage. Loved every scene & one of the best comedy for this year. (at the end, during credits, they show both 2003 movie and 2017 movie scenes next to each other. Simply mind-blowing.)

Tuesday, December 05, 2017

emirates airlines USA to India air travel..(Inconsistent & poor Baggage allowance practices)

Last month, I went to India  ( from Austin,TX to Hyderabad)
My reservation confirmation e-mail says no fee for two check in bags and
no fee on CARRY-ON HAND BAGGAGE  & NO FEE CARRY ON PERSONAL ITEM.

From Austin to New York, travel is fine. From New York to Dubai is fine
However i am about to chicken Dubai to Hyderabad flight. 
At this point of time, group of people are weighing the carry-on & handbags and saying limit is exceeded & you have to pay.  My bad, i purchased few novels and books for reading/some food.. So i have to pay or drop 2 pounds of stuff.
I told, except books, i am carrying the same stuff from USA. but he is not listening. 
I clearly see racial profiling.  He simply allowed an american in the next line  without much screening.
Really felt bad for my situation. End-up throwing few items in to trash, ( finished novel, towel etc)

Now coming back from Hyderabad, again problem at Hyderabad. He simply saying, you have to take only one bag. No CARRY ON PERSONAL ITEM.. (I am carrying I7 based laptop ( little heavy) with charger, external mouse etc.) there is no space in other carry-on bag. basically this is small one even to put 15" laptop..
 This sucked so bad. end-up carrying laptop in the carry-on. ( leaving all laptop  bag etc.)

Emirates airlines needs to think/implement differently.

Seems to be "CARRY ON PERSONAL ITEM" is US domestic airline concept. If they are OK with this item in US outbound flights & they need to implement all way to destination by tagging or something else.
In my case, Dubai to Hyderabad. Emirate needs to act smartly for US outbound citizens.

In bound flight also, since the ticket is brought from US, they need to allow   "PERSONAL ITEM" from final destination.   My overall trip experience is spoiled with this kind of dump rules implementation.

2017 How not to do e-commerce (a case study)

This is based on my 2017 black Friday shopping experience.

Like many retails, frys.com, send promotion code to all the e-mail subscribers. So, I registered. Based on subscriber preference frys.com send daily e-mails. Up to this part, everything is OK.
For 2017 black Friday time also, I received e-mail with promo code. Both my kid’s laptop is not working so I decided to buy couple. Based on e-mails, I picked two laptops and I placed orders on 11/23/2017. After 10 or 15 minutes, I received an e-mail saying your order is ready for pickup. We are closed on thanks giving day & pick order on 11/24/2017.  I thought, wow. next day, I received the store around 10.15AM, went to straight checkout register line. After waiting for 90, minutes, I reached cashier and showed my order number. He took, my info went to back room and came back said, no one picked your items. Let me go and pick your items. After 40 minutes, he came back and said, one of your item is out of your stock. (standing with family, I was bit shocked.) finally paid bill and went to manager who is standing at service desk.  I show the order pick e-mail etc. He called someone & after 15 minutes, he said we are out of stock. Apologies. I told, if come next week, will you honor the prices. He said no. we don’t… So, dumb… while, I was standing, another customer came and he is saying, I came after driving 45 miles and his item is not there.  (like me so many disappointing parents.) after seeing this, I felt old circuit city stores experiance.  Absolute mess.

1)     If you are offering online sales, make sure your order processing system works.  (if ORDER is ready for pickup means they have mean it.)
2)     In my case, my chaser completed only two transactions per hour. Frys.com employees need to go to Walmart/target/kohls store. How quick they do the job.
3)     Don’t merge online order customer with in store promotion chases. There is is reason, we placed order online and we simply want to pick and go.  If you go to Kohls, even they have special parking slots for online customers and separate service line to process only ONLINE order. Please learn.

I will append more items later

2017 Back Friday experience with family

For past decade, I am not doing any shopping (At least visiting the physical store.) 
If required, I am purchasing via online.  However this year, I decided to give some experience to the kids. (Now they are in high/middle School) & they need laptops. SO I felt, this is the right time.  Basically they  are curious about one days record sales.  On thank giving day, I purchased couple of laptop from frys.com and for pickup, we went to store.  I will write one more post on frys.com ( how not to do e-commerce in today's world) however coming to main topic, on Fridays stores are opened at 6AM. We reached the store around 10.15 AM. Parking is mess. Based on my past experience, I told wife & kids to pick whatever you want come to line. I went directly checkout line. This is long. After sting 90 minutes in the line, I reached, cash register. ( in between, family wrapped, their pick & joined me.  Absolute shocking thing is my online order is not ready.  Cashier took, my order number and went on picking items for next 40 minutes. After spending 40 minutes, he came back and said one of my laptop is out of stock.   Finally we are out of the store around 12.15… My kids first feedback it, let’s avoid Black Friday shopping & in particular Frys. Let’s go to lunch.  

Tuesday, July 18, 2017

My Kiva updates after a decade

Today at Kiva we celebrate YOU!
10 years ago today, you joined Kiva to change lives around the world.











Friday, July 14, 2017

PDF to CSV file generator

few years back, when I  was working on Apache TIKA POC/evaluation/bench mark for document indexing with SOLR,
At the same time, i was exploring pdf document parsing with apache.pdfbox framework.
At that time, i wrote sample code to see the PDF box capabilities.
Exactly last year, my niece asked some help in parsing the PDF file. 
I fixed the java file for her need. Keeping it here for any later uses. 


import java.io.*;
import java.time.Duration;
import java.time.Instant;

import org.apache.pdfbox.cos.COSDocument;
import org.apache.pdfbox.pdfparser.PDFParser;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.util.PDFTextStripper;

public class PdfToCsvGenerator {

    public static void main(String[] args) {
        String string = null;
        BufferedWriter out = null;
        PDDocument pdDoc = null;
        COSDocument cosDoc = null;
        PDFTextStripper pdfStripper = null;
        try {
            System.out.println("Processing PDF file. please wait.");

            Instant start = Instant.now();

            PDFParser parser = new PDFParser(new FileInputStream("C:\\xxx\files\\final_result.pdf")); //TODO
            parser.parse();
            cosDoc = parser.getDocument();


            FileWriter fstream = new FileWriter("C:\\xxx\\files\\out.csv"); ///TODO this is output file
            out = new BufferedWriter(fstream);

            pdfStripper = new PDFTextStripper();
            pdDoc = new PDDocument(cosDoc);
            pdfStripper.setStartPage(1);
            pdfStripper.setEndPage(3); //TODO for now parse only first two pages. once everything is ready..extend it for all
            String parsedText = pdfStripper.getText(pdDoc);
            String lineSep = pdfStripper.getLineSeparator();
            String[] lines  = parsedText.split(lineSep);
            for ( String aLine : lines){
                if ( aLine!= null){
                    String trimLine = aLine.trim();
                    if (trimLine.matches("^[A-Z].*$")) {
                        System.out.println("Ignoring input line:"+trimLine);
                    }else{
                        String htno=null,subcode=null, subname=null, internal=null, ext=null, credit = null;
                        StringBuffer buf = new StringBuffer();
                        if (trimLine.contains(" ")){
                         String[] fields =    trimLine.split(" ");
                            boolean isSubject = true;
                            int i = 0;
                            for ( String s : fields) {
                                if (i == 0) {
                                    htno = s;
                                    i++;
                                    continue;
                                }
                                if (i == 1) {
                                    subcode = s;
                                    i++;
                                    continue;
                                }
                                if (isSubject == true) {
                                    //StringBuffer buf = new StringBuffer();
                                    if (s.matches("[A-Za-z-&/]+")) {
                                        buf.append(s+" ");
                                        i++;
                                        continue;
                                    } else {
                                        subname  = buf.toString();
                                        isSubject = false;
                                        internal = s;
                                        i++;
                                        continue;
                                    }
                                }
                                ext = s;
                                credit = fields[fields.length - 1];
                                break;
                            }
                            out.write(htno + "," + subcode + "," + subname + "," + internal + "," + ext + "," + credit + "\n");
                           // System.out.println("htno:" + htno + " subcode:" + subcode + " subject name:" + subname + " internal:" + internal + " ext:" + ext + " credit:" + credit);
                        }else{
                            System.out.println("Ignoring 2ed stage input line:"+trimLine);
                        }
                    }
                }
            }
            if (out != null) {
                out.flush();
                out.close();
            }
            System.out.println("processing is complete. Check output file.");
            Instant end = Instant.now();
            Duration timeElapsed = Duration.between(start, end);
            System.out.println("Time taken: "+ timeElapsed.getSeconds() +" seconds");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {

        }

    }

}

Few dumbest SOLR/Cassandra implementations

1      I was in the Architecture review board and a project came for review.
It is kind of upgrade or tech refresh project.

Core ides is they moving simple Web application is moving old version of OS, WebLogic (yes. still companies use this king of heavy weight containers
IT BOM contains SOLR too. (Moving from Solr 3.2 to Solr 6.2)
Since I am not well versed with business domain, after meeting. I was asking
What is the motivation to go to Solr 6.x?
Answer was simple refresh & may be we will use new features. Solr cloud etc.
I asked how it is deployed. Answer was SOLR is running 3 different contains separately and they are load balanced.  I was asking it is master/slave etc. Answer is no.
We index all the content separately and monthly we update the content on each web logic instance. I said, this is incorrect thing. Are you going to fix with new Cloud architecture etc?

Answer is no. Still 3 isolated SOLR instances running separately in separate Elephant container and load balanced. I was shell shocked.  
Pure dumbest to the core.

I will expand this post later with more dump roll-outs.

Walmart (Free Pickup + Discount) rocks

Lately I end-up buying too many items from Walmart with Free Pickup + Discount option.
For most of the standard products, walmart.com prices are good and above pickup/discount is too good.
Amazon became more of prime member only.

Few example buys:
1) Product Title

Schlage FE595VCAM716ACC



Amazon is offering this one for prime members for ~$80 and Walmart
offered at same product 
with free pickup/discount offer.  

Similarly CATAN game.
( free pickup/discount is too good. in all my purchase
 it is matching or beating amazon prices.
at the same time, it is fast for me.

Nowadays, Amazon became to cleaver for non prime members. ( for free shipping, it says 5 to 8 business days)
and on 7 or 8 days, it is shipping. Kind of luring to buy prime.
At this point, still i am debating myself. $100 for prime &
$100 for sam'sclub membership. this list goes on.