Tuesday, August 2, 2016

Whoo hoo! Replaced a dying hard drive

I have a Toshiba Satellite. It took longer and longer to boot, and I started getting ominous messages about not finding a hard drive. 

Part of my monthly maintenance is to use Paragon Backup and Recovery 12 Compact. I back it up to our home file server over the network. When the laptop finally did boot, I saved my financial files and some of my current school project; then I proceeded to do a full backup with Paragon. 

The time to finish the backup stayed around five hours, no matter how many hours of wall time passed. It was simply not moving forward. I asked Glary Utilities to do a check disk and boot defrag when it rebooted. Alas, it never rebooted. 

Now I had a 640 Gb 2.5" internal drive that was at death's door. I shopped at Newegg and Amazon and found a 1 TB Hybrid internal drive. The hybrid combines some Solid-State memory for part of its drive and uses a traditional disk for the remainder. The advantage is that the machine sleeps and wakes up quickly, since many of the operating system files reside on the SSD (Solid-State Drive) portion. 

So it wouldn't boot, but could the old drive be read? I placed the old drive and the new drive in a desktop, and then booted the desktop with a Linux-based tool called Clonezilla. 

Clonezilla recognized the old 640 Gb and the new 1 Tb drives. I went through the beginner's prompts to clone the disk; however, the request to perform a check disk on reboot blocked Clonezilla from doing its job. 

I had to drop into Clonezilla's command prompt mode and run a handy linux tool called fsck (file system consistency check). (And yes, the name lends itself to being used as a curse.) 

Then I ran Clonezilla in expert mode, told it to fix sectors as necessary. It cloned the disk in about two hours.

I replaced the drive in the laptop, and while it took a long time to boot the first time, it came up with all files in tact. (I was overjoyed to see it get all the way to my main screen.) I ran Glary utilities again with a hard disk check, and it found a few bad sectors, which it repaired.

Lessons learned

  • I will keep doing the monthly backups. 
    • I will record the time it takes to back up the drive.
    • Lengthening time may indicate impending drive failure
  • I need to burn a Paragon recovery CD. 
  

Sunday, July 17, 2016

Raspberry Pi summer camp

Josh wanted to go to a programming summer camp, but the Unreal Engine 4 was sold out.

So I wondered if we might get our own programming camp going. Maybe invite a few of his friends who are in the 13- to 15-year-old range. 

Here are some of the things we'll need.

Hardware


The basic computer-on-a-board will set you back about $36. You will have to buy the following to get it going:
  • Micro USB power supply (the kind that powers many cell phones; see if you have one lying around the house)
  • A Micro SD card (about $12)
  • Cat 5 (network) cable, to plug the computer into your LAN at home (about $2)
  • HDMI cable, so your computer can display on your big, home TV (about $6)
  • OR (this will help you watch Netflix and let your mad scientist work in his room)
  • A keyboard and mouse (for example, https://smile.amazon.com/Logitech-Desktop-MK120-Mouse-keyboard/dp/B003NREDC8/, about $15)
  • Optional:
    • A USB hub and a USB to Micro adapter cable to provide power
    • You could also attach your mouse and keyboard here
    • A Raspberry Pi case. (Note that 13- to 15-year-olds have the right kind of Legos to build their own Raspberry Pi case.

They also have starter kits that include the Raspberry Pi, a power supply, and a case, such as https://smile.amazon.com/CanaKit-Raspberry-Premium-Supply-Listed/dp/B01C6EQNNK/ ($50). But you still have to  buy the other required items, and you might be happier doing this with your kid. 

Books

Adventures in Raspberry Pi (about $22). This one gets you started with sprite animation in a basic adventure-type game. It also teaches you the Python language, has some basic text-based games, has some Minecraft programming, and ends with a flashing LED. Each child should have his own. 

Raspberry Pi Projects for the Evil Genius (about $17). This one starts with the flashing LED and has projects combined with Python code. Some projects are fairly involved, and require the use of a breadboard to wire together components like motors and lasers. 

What the camp might look like

I'm thinking that we could all buy the Raspberry Pi kit and the Adventures book and work our ways through it. Maybe the first week we could set up one Raspberry Pi at someone's house and then the kids could help each other set up the rest. Everyone would take his computer home. Then we're off to the races.

Second week would be some homework + kid work + dad work as we download software and turn the kids loose on the adventure game. Let's continue working through the chapters of the Adventures book, have the kids go to each other's houses to debug and program, while dad's cheer them on with a beverage in hand. Maybe weekly meetings to show off what everyone has done and get everyone on the same page. 

Fourth or fifth week would be to build the flashing LED project. Then, on to the Evil Genius book, and have the kids pick what would be their favorite project. Each family would order their own parts and breadboard. Then we'd work from the simplest project to the most complex, with a small army of teenagers blazing the trail. 

Thoughts? Questions? 


Tuesday, May 17, 2016

My dad passed away on Thursday, May 12

George K. Chacko (1930-2016)
My father, Dr. George K. Chacko, passed away last Thursday, May 12, at age 85. He and my mother had been married for 58 years.

He is survived by his wife, Yo; his son, Rajah;  and daughter, Ashia; and six grandchildren: Hannah, Josiah, Rebekah, Sarah, Joshua, and Anya.

My mom, Yo, lives at
Brighton Gardens
6000 Park South Dr
Apartment 325
Charlotte,  North Carolina 28210



Friday, May 20, 2 to 4 pm
Viewing at Poe Funeral services
http://kennethpoeservices.com/
1321 Berkeley Avenue
Charlotte, North Carolina  28204

This looks like a regular house. You can park on the street. 

He will be buried on Saturday at the Cemetery across from church.

Saturday, May 21, 3:00
Memorial service
Providence Presbyterian
10140 Providence Church Lane
Charlotte, NC 28277
704-846-1079


After the service
Fellowship hall
Enjoy some time reminiscing about George

Tuesday, July 14, 2015

Portfolio Weights for 3Q15

The Agora Focus list for the third quarter has only 8 stocks. That makes my job easier.

Ticker Name  Recommender  Newsletter Weight
SPX Market 16.89%
adap Adaptimmune Therapeutics Stephen Petranek Breakthrough Technology Alert and Technology Profits Confidential 16.73%
al Air Lease Chris Mayer Mayer’s 100x Club and Mayer’s Special Situations 6.79%
cry CryoLife Rick Pearson Agora Financial’s Catalyst Trader 11.28%
exel Elexlixis Ray Blanco Technology Profits Confidential and Agora Financial’s FDA Trader 9.42%
hcn Health Care REIT Zach Scheidt Lifetime Income Report and Income on Demand 9.95%
nbl Noble Energy Byron King Outstanding Investments, Real Wealth Trader and Military-Tech Alert 4.66%
newt Newtek Business Service Jonas Elmerraji Penny Stock Fortunes, STORM Signals 13.32%
wtr Aqua America Jim Rickards & Dan Amoss Rickards’ Strategic Intelligence 10.96%

I didn't sell all stocks when turning over the portfolio. I held onto one, the AIG warrants, for a couple of reasons. First, it seems to have more to run left in it. Also, for tax reasons, it would be nice to go into long-term capital gains. 

I'm not investing the amount in SPX, but instead, distributing it among the remaining (or keeping stocks that I like). 

Here are a few questions that folks have asked me. 
Q: How do I execute the orders?
A: I am mostly trading a Fidelity Market basket. This allows me to trade all the stocks from a single screen. Those are market orders, My IRA is with another company, so I'm trading one stock at a time.
Q: Do you put a stop loss on the stocks?
A: No, I just let them ride for 90 days. In a sense, I have a time stop instead of a price stop.
Q: How does correlation work?
A: Correlation is a statistical function between -1 and +1. When it's close to 1 (e.g., Fannie Mae and Freddie Mac in 1Q15 had a correlation of .98) the two stocks move in tandem. When it's close to -1, they move inversely. When it's close to 0, then the movement of one is almost independent of the second.

Friday, July 10, 2015

Portfolio Performance for 2Q15

Portfolio performance for the quarter ending July 1 was the best ever: 26.3%. (Yes, those are numbers for the quarter, not annualized.)

Symbol Description Total Gain/Loss Percent Recommender Newsletter Weight
AAWW ATLAS AIR WORLDWIDE HOLDINGS INC COM NEW 23.00% Jonas Elmerraji Penny Stock Fortunes, STORM Signals 3.38%
AIGWS AMERICAN INTL GROUP INC WTS EXP 01/19/2021 15.41% Chris Mayer Capital & Crisis 8.82%
GG GOLDCORP INC COM NPV ISIN #CA3809564097 SEDOL #2676302 -14.84% Byron King Outstanding Investments, Real Wealth Trader and Military-Tech Alert 19.06%
GILD GILEAD SCIENCES INC 9.03% Rick Pearson Agora Financial’s Catalyst Trader 10.20%
ONCE SPARK THERAPEUTICS INC COM ISIN #US84652J1034 SEDOL #BVGCLQ9 -5.30% Stephen Petranek Breakthrough Technology Alert 5.90%
RTN RAYTHEON CO COM NEW -10.20% Byron King Outstanding Investments, Real Wealth Trader and Military-Tech Alert 8.85%
SGYP SYNERGY PHARMACEUTICALS DEL COM NEW ISIN #US8716393082 SEDOL 139.25% Ray Blanco Technology Profits Confidential 18.05%
WHOSX WASATCH HOISINGTON US TREASURY -8.76% Jim Rickards Strategic Intelligence 11.23%
BX Blackstone Group LP Zach Scheidt Lifetime Income Report 0.00%

Of the 9 stocks, 4 were down between 5% and 15%. One was up 9%, one was up 15%, one was up 23%, and one was up 139%.

Please don't praise my stock-picking skills. Just a math finance major running the programs. Other, smarter people picked the stocks. I chose the weights using whatever my programs told me to pick. I kinda doubt I'm going to see this performance again.

Saturday, April 18, 2015

Portfolio weights for 2Q15

My process remains the same. A whole lotta data massaging.

  • Get recommendations from Agora's Focus list.
  • Get historical data for the stocks from Google.
  • Calculate correlations in Excel.
  • Add dividends from Yahoo! Finance.
  • Put expected returns and correlations into Matlab.
  • Publish the weights here.

SymbolNameRecommenderNewsletterWeight
SPXMarket14.50%
WHOSXWasatch-Hoisington U.S. Treasury FundJim RickardsStrategic Intelligence11.23%
GGGoldCorpByron KingOutstanding Investments, Real Wealth Trader and Military-Tech Alert19.06%
RTNRaytheon Byron KingOutstanding Investments, Real Wealth Trader and Military-Tech Alert8.85%
BXBlackstone Group LPZach ScheidtLifetime Income Report0.00%
AIG.WSAIG Warrants (AIGWS). FAQ at http://www.aig.com/Warrant-FAQ_3171_438029.htmlChris MayerCapital & Crisis8.82%
AAWWAtlas Air Worldwide HoldingsJonas ElmerrajiPenny Stock Fortunes, STORM Signals3.38%
GILDGilead SciencesRick PearsonAgora Financial’s Catalyst Trader10.20%
SGYPSynergy PharmaceuticalsRay BlancoTechnology Profits Confidential18.05%
ONCESpark Stephen PetranekBreakthrough Technology Alert5.92%

I ignore the S&P weight, as I usually have something that I want to keep in the portfolio. 
I'm a little surprised the Blackstone Group got 0% weighting. 

I'll try to get these into a Fidelity basket next week.

Friday, April 17, 2015

Portfolio performance for 1Q15

Let's take a look at how the portfolio did last quarter.

symbolnamerecommenderweightgain
fnmaFannie MaeChris Mayer0.00%0%
fmccFreddie MacChris Mayer14.04%16.61%
aveoAveo TherapeuticsPaul Mampilly14.99%69.48%
cryCryoLifeRick Pearson5.56%-1.73%
kiteKite PharmaStephen Petranek8.09%-13.68%
swirSierra WirelessRay Blanco3.53%-0.53%
atmlAtmelRay Blanco6.10%-0.71%
infnInfineraRay Blanco5.38%21.28%
atnmActinium PharmaRay Blanco10.58%-47.24%
gsvcGSV CapitalJonas Elmerraji8.04%7.61%
ozmOch-Ziff Cap ManagementZach Scheidt6.89%12.70%

Remember than Fannie and Freddie track each other very closely, so there's no need to have both in the portfolio.

Of the 10 stocks, 4 were unchanged, 1 was down 47%, 1 was down 14%, 1 was up 7%, 3 were up in the double digits.

The portfolio underwent an 11.9% gain for the quarter.

Here's a helpful graph.


Portfolio weight vs. gain

The scatter plot shows a positive slope, meaning that the stocks with heavier weights performed better.

Wednesday, January 21, 2015

4Q14 portfolio performance

Here's my 4Q14 portfolio performance. I'm going to repeat the algorithm as described in the last post.
SymbolDescriptionOrig weightTotal Gain/Loss Percent
AKGASANKO GOLD INC COM ISIN #CA04341Y1051 SEDOL #B7Y5P5910.97%-17.42%
CMRXCHIMERIX INC COM4.64%27.45%
CRYCRYOLIFE INC7.52%14.52%
EVERPRAEVERBANK FINL CORP DEP SHS REPSTG 6.75% 12/31/2049 PFD ISIN 7.99%0.44%
ICONICONIX BRAND GROUP INC8.61%-7.56%
INFIINFINITY PHARMACEUTICALS INC COM ISIN #US45665G3039 SEDOL #B5.18%11.94%
NLNKNEWLINK GENETICS CORP COM ISIN #US6515111077 SEDOL #B4LHRV78.90%103.82%
RYAMRAYONIER ADVANCED MATERIALS INC COM NPV8.33%-28.14%
SESPECTRA ENERGY CORP COM8.62%-10.25%
SNMXSENOMYX INC11.72%-23.99%
SRPTSAREPTA THERAPEUTICS INC COM3.86%-38.46%

There were some fairly diverse results, including one stock doubling (up 103.8%) and another down by 38.5%. Overall, the portfolio was up a weighted 2.32%.

Wednesday, January 7, 2015

IntelliJ, Android, and Spring Integration

I spent a good part of the day using IntelliJ to build a Hello, World program using Spring Integration messaging. Here is well written article at JavaWorld.

Tonight, I am trying to do something similar, using IntelliJ to guild a Hello, World program for the Android. Here are a series of videos from IntelliJ.

I ran into a problem with permissions for the Android SDK.  The error was:

I solved the problem by restarting IntelliJ in admin mode. It had a built-in link to load the correct version of the SDK. You may read more about my solution at Stackoverflow.

Saturday, January 3, 2015

Portfolio allocation for 1Q15

Agora came out with their Focus list for 1Q15. I ran it through the Google drive / Excel / Matlab process described in the 30Dec14 blog entitled "Modern Portfolio Theory and the Regular Guy's portfolio."

They recommended 11 stocks again. Here are the weights I came up with:

Ticker    weight    name
SPX      16.82%    standard & Poor
fnma      0.00%    Fannie Mae
fmcc     14.04%    Freddie Mac
aveo     14.99%    AVEO Pharmaceutic
cry       5.56%    CryoLife, Inc. Co
kite      8.09%    Kite Pharma, Inc.
swir      3.53%    Sierra Wireless
atml      6.10%    Atmel Corporation
infn      5.38%    Infinera Corporat
atnm     10.58%    Actinium Pharmace
gsvc      8.04%    GSV Capital Corp
ozm       6.89%    Och-Ziff Capital


Because Fannie Mae and Freddie Mac have a correlation of .98, it chose Freddie and disregarded Fannie. One is a proxy for the other, and there is no need to have both. (Note that a correlation of 1.0 means that you're getting the same thing twice; they are perfectly correlated.)

As I did before, I'll probably drop the S&P index and spread the weight among the others.

Wednesday, December 31, 2014

Infix notation and Live templates



IntelliJ lets you complete code statements in several different ways.
  1. Infix notation.
  1. To create a loop that goes over each variable, try typing the variable name, a .fori. It should expand into a for loop that creates an index.
  2. To create a loop that creates a foreach, type the variable name and then a .for. It will expand into a foreach loop.
  1. Live templates. Look at Settings -> Live templates.
  1. With these, you can ifn or ifnn and a tab to get if null or if not null constructs.
  2. You can also construct your own.
  1. I added a logging category and set logdecl to private final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(this.getClass());, as I had done before, in Eclipse.
  2. You can also add variables. I set logstart to be log.info("Entering $METHOD$.");. Then I pressed the Edit Variable button and told it that the expression to use was a predefined methodName().

Tuesday, December 30, 2014

The H2 database

I installed H2 on my work desktop. I tried to use Spring Data JPA, but ended up making a plain Maven project.

One of the problems that we have in software development is reading and writing information from a database. You don't want to use your regular database for reading, because you'll have to put test data into your regular database. You don't want to use it for writing, because you'll leave your test data on a database.

Enter H2.

The advertising says that I can set it up in memory, load it up with test data in Maven test phase, run my unit tests against it, and then have it all go away when I'm done. 

So far, I have set up a basic in which I start up the H2 database in one window and then run a Java test in my IntelliJ IDE. It's reading the single record from the single table like a champ.

Next step will be to have Maven start up H2, run the test data, and then politely go away. Should be fun.

Modern Portfolio Theory and a regular guy's portfolio

I took a course at UNCC called Statistical Techniques in Finance. There was enough math to make strong men weep, but there was a gem of a section about Modern Portfolio Theory (MPT). A quick search on MPT will tell you that Harry Markowitz got a Nobel Prize for the theory. 

Here's a quote from Wikipedia about MPT:
The fundamental concept behind MPT is that the assets in an investment portfolio should not be selected individually, each on its own merits. Rather, it is important to consider how each asset changes in price relative to how every other asset in the portfolio changes in price.
So I started from a list of assets from Agora Financial (their Focus stocks for 4Q14). I normally have a dilemma in trying to figure out how to buy these stocks: Fixed dollars of each? Fixed percentage of each? Look for the best story? The lowest risk? A high dividend? 

The list, usually about a dozen, is picked by all different money managers with quite different outlooks. By design, some are high-yield stocks, some are pharmaceuticals, some are military, some are undervalued. 

Instead of picking and choosing, I let the math do the work for me. I had Google Finance create a spreadsheet that retrieve the past 520 trading days, had the market return (SPX) as one of the stocks, and then had Excel line up the prices so that they were all the same date. 

Then I ran the correlation function in Excel, which returns a number between 1.0 (perfect correlation) and -1.0 (inversely correlated). In my Focus set, the maximum correlation was 0.27 and the minimum was -0.197.

MPT says that risky, uncorrelated stocks will give you a better return with a lower proportional risk than unrisky, correlated stocks. (By the way, when I say risk, I am referring to the square of the Standard Deviation of the return.)

Then I took the correlations and their log returns and tossed the numbers into Matlab. The program I ran did some optimization of risk to return, using linear programming (a branch of operations research). 

Anyway, here is what Matlab said the optimal weighting would be.

        Ticker      Original weight     name      
        SPX         13.66%              Standard & Poor   
        SE           8.62%              Spectra Energy    
        ICON         8.61%              Iconix    
        RYAM         8.33%              Rayonier      
        AKG         10.97%              Asanko Gold   
        SNMX        11.72%              Senomyx   
        EVER-A       7.99%              Everbank      
        INFI         5.18%              Infinity Pharma   
        NLNK         8.90%              NewLink Genetics      
        SRPT         3.86%              Serepta Therapeutics      
        CRY          7.52%              Cryolife      
        CMRX         4.64%              Chimerix       


The results were surprisingly good. 


Monday, December 29, 2014

UML Class Diagrams, IntelliJ, and automatic code generation

I built a small class diagram with a class and a subclass in IntelliJ. (This capability is found in the Ultimate Edition, but apparently not the (free) Community Edition.)

I added some class fields, constants, methods. Then I created a subclass. I also had the opportunity to refactor the code and pull up some things from the subclass to the parent class.

Then, without fanfare, I press F4 to jump from the diagram to the code. I expected that it would whirr and crank for a bit before it jumped to the code that was yet to be generated, but it generated the skeleton and displayed the code before you could say "Bob's your uncle."

I didn't save the UML diagram, but it was easy to regenerate it.

I also found that I could generate a JUnit or TestNG code by selecting the method and pressing Ctrl-Shift-T (or Navigate => Test).

If you're curious about the details, you may view details on my IntelliJ wiki on GitHub.

Very cool stuff.

Sunday, December 28, 2014

This day and that Day

“There are two days in my calendar: This day and that Day.”
― Martin Luther

Heard this in a sermon this morning. I can't find out where Martin Luther said it, so I will be a little suspect until I find the original. 
I think it means that "this day" is today. I'm not worried about yesterday or the future. 
I think "that Day" refers to the Judgement Day. 
Martin Luther was saying that I need to live today in light of how it will be viewed on Judgement Day.
 

Repurposing the Windy Poplars blog

Yes, that was one long pause between blogs. I talked to my friend, Todd S, about why he wanted to blog about theological issues. I decided that I might want to start blogging to remember things for myself and share things that may or may not be important to you, dear reader.

I realized that I often repeat stories to my friends about what 
  • I've read, 
  • I've learned, or 
  • I've experienced.
Also, sometimes I would draw conclusions from this list. You might (or perhaps might not) benefit from this wisdom (hah!).

Looking forward to 2015, I may end up talking about these topics.


  • What I'm reading
  • Software development
    • Architectural ideas
    • Agile / Extreme programming
    • Design patterns
    • Work at my place of employment
  • Grace abounding 
    • Relationships
    • Redemption Groups
    • Church
    • Theological issues
  • Music in the church
  • What I'm learning in grad school
  • Setting systems for myself
    • Spiritual life
    • Mental life
    • Physical life (esp. food and exercise)
  • Stock trading
    • Thinking of a portfolio return, rather than an individual stock
    • Rotating in and out of weightings
  • Futures trading
    • Working with CFRN
    • Trading Russell and soybeans
    • Gaining repeatability
    • Working towards increasing contracts traded

Sunday, May 10, 2009

And here's my little garden...


I must confess I'm a little impatient for my vegetables to grow. The broccoli especially is looking very good! Here's our little square foot gardens, growing fairly well, despite the shady trees on our property. Can't seem to get the grass to grow, but I guess I have a lot to learn!



Anybody know how to get rid of ants in the strawberries? They came right in and made a nest in my oregano, and strawberry patch!! Vinegar? Black Pepper? Boric Acid? What's the best treatment, all you farmers out there? How about some good advice?

Chickens!


Our adopted new family members? Perhaps. Twelve Gold Comet chickens from a small poultry farm northwest of Charlotte. The hens were almost old enough to lay, so we had to scramble (pun not intended) to build an area for them. I would love to let them free-range, but we are too close to a development and that might cause problems.


They seem happy with their food and their run. It's interesting to observe "chicken politics." Clearly some of the chickens don't get first pick of the food or water, but they manage to get by.
The kids like to watch the "chicken jousting." Two chickens line up on opposite sides of the run and charge at each other. Not sure what that's all about. Their beaks are clipped though, so they can't really hurt each other.

We purchase a used coop from a local man through Craig's List. Rajah cut a trap door into the side to allow the chickens access to a small run. He also added three nesting boxes into the coop. For some reason, the chickens use only one of the boxes for laying, the others seem to be toilets? Go figure. They are happily laying about 6-7 eggs a day for us now. Lots of omelets!





Friday, April 10, 2009

Need an AC disconnect for the solar panel

The Duke Energy engineer determined that we would need to have an AC disconnect, even though the Fronius inverter automatically disconnects when it detects a power failure. Here is the AC disconnect, which is waiting to be connected.




Here are some pictures of where the disconnect will go, namely in between the meter and the Fronius.... notice the dual-meter "can" with only one active meter (the one that feeds our house).