Sunday, December 30, 2012

Gambling - How much should you bring to the table?

I just came back from Atlantic city where we stayed at the Borgota.  We basically did three things:
  1. Ate steaks at Old Homestead - The steaks were tasty, but you definitely needed steak sauce.  I prefer it when steaks have enough taste that using sauce is unnecessary.
  2. Drank at the tables - The liquor was not top shelf.  I would've like some better options.
  3. Played blackjack and craps - Some of us won and others lost.
Since gambling is what we did for the majority of the trip, it's still on my mind.  One thing I noticed is that the losers started out with less money than the winners.  In gambling, as in life, the rich get richer and the poor die trying.

The reason that the players with smaller bankrolls tend to go bust faster is simple; they cannot survive even the smallest fluctuations.   After a few losses, these players hit 0 and cannot recover.  Players with bigger bankrolls are more able to survive downswings and make a run to actually make some money.

In my experience, I often go to the casino willing to use about 200 dollars a night.  If I play blackjack, I typically sit at a 10 to 15 dollar table.  This gives me 13-20 bets to work with it.  The question I have is: How long can I expect to play before busting out?  Of course, there may be times where I lose every hand and bust out after 13-20 bets, and there may be a time where I make so much that I will last through the night.

I'm sure there is a good mathematical way to express what is occurring here.  It is a random walk, with a weighted probability of losing slightly higher than winning each hand.  If I have some time, I'd like to:
  1. derive formulas that will give me the exact expected value of busting out over time.
  2. derive an easy way to get a quick back of the envelope calculation of the expected value.
  3. Write computer programs to simulate the results, which will confirm my formulas.
If I ever get some time to do the above, I'll update this post with the data or update with a link to another post.  If you know of this analysis already, please leave a comment.

Friday, December 28, 2012

HP Pavillion Laptop

I just bought a HP Pavilion g7-2238nr 17.3-Inch Laptop and a Microsoft Office Home & Student 2010 - 3PC/1User (Disc Version) for my aunt.


This post will just be a rundown of my first impressions of setting up the system.

Physical aspects
  • The screen is big and bright.  
  • The raised keyboard keys feel solid.  Each key feels like it can only be pressed up and down.  The keys on some other budget-friendly laptops I have tested felt like you could accidentally push a key sideways (if that makes sense).
  • The frame looks sleek, but the plastic feels cheap and it will probably feel cheaper over time.
  • The track pad has a nice grated texture.  However, given the huge size of the screen, the default mouse sensitivity or speed is too low.  If I start at one end of the screen and slide across the track pad, I can only make it about half way across the monitor before I have reached the end of the track pad. 
  • The mouse buttons below the track pad are a little hard to press.  I think this is good as they will probably loosen up over time.
  • The cd drive is very loud (as I ran it to install Microsoft Office).
System setup 
  • Initial setup was pretty painless.  It probably took a total of 15 minutes.
  • I used the express settings, as I often choose default settings anyway.
  • Since I am setting this laptop up for my aunt, I did "Sign in without a Microsoft Account".  
  • On first loading, there is a little tutorial, which is helpful for any new user to Windows 8.  
  • There is a lot of HP bloatware.  About half of the tiles on the windows 8 screen and all of the shortcuts on the desktop are to bloatware programs or links.  One particularly annoying program was the Norton Antivirus program, which kept popping open asking for me to sign up for something.  I eventually uninstalled the program.
Installing Office
  • I inserted the installation disk and then entered the product key when prompted.
  • After about 10 minutes of installation, I was told to restart the computer, which I did. 
  • After the restart, when I clicked on the Microsoft Office icon, the computer asked me if I wanted to install Office.  I thought I had already installed the program, so I'm not sure what's going on. 
  • I chose the option to activate my product.  When prompted, I entered the product code again.  I hope this isn't using more than 1 of my product key licenses, but I have no idea how to check.  
  • The Microsoft office set up program began running again and it took about 15 minutes again. 
  • It then prompted me to restart again. I did, and another status bar began again with the message "Completing Office Setup" and "Do not power off your computer".  It took a few minutes for the computer to shutdown and restart.
  • In total, it took me about an hour to install Microsoft Office.
Windows 8
  • There has been some criticism about Windows 8, so I won't rehash it or weigh in on whether it is better or worse than the past versions.  I encourage anyone who gets a Windows 8 computer to read through the tutorials in the tile "Navigating in Windows 8".  
  • One thing I learned from the Navigating in Windows 8 tutorial is that gestures with a laptop track pad are pretty cool.  Here are some that I would probably use.
    • Swipe from the right edge towards the middle to open an options menu, aka "Charms".  
    • Swipe from the left edge towards the middle to open the previously used app.
    • Slide up/down or left/right with two fingers to scroll the window in any direction.
  • Another thing I learned is that you can just press the power button on your computer and Windows should shut down properly.  So you don't have to go to click on any "Shut Down" button anymore.  This may be odd for a newcomer to Windows 8, but it is a very nice improvement.  
  • There is a lot more than could be said about Windows 8.  But it isn't specific to this laptop, so I'll just move on.
  • I tried a few times and the computer goes from completely off to ready to run in less than 10 seconds.  This might go down as you install more programs, but it's pretty good for now.
Conclusion
Overall, I am happy with this purchase and I think my Aunt will like it.  I imagine that her initial thought will be, "How do I use Windows 8", and she will immediately want to go to the "Desktop" view.

Nevertheless, if you are looking for a cheap laptop with a big screen, I think this is a pretty good option.

Thursday, December 27, 2012

Should every programmer have his/her own website?

I am a professional software developer.  I mostly work with C++ and JavaScript.  

I started this blog to practice writing, have some historical perspective on what I think about, and make some money with my AdSense account.  I am pretty sure that two of those three items are attainable.  But as I blog with blogger software, I think, should I be creating my own site that I build from scratch?  As a programmer, it just seems natural to make my own unique platform. 

I have decided against it because it would take time, and I'm always short on time. Also, other than the generic look, I think the blogger generated site looks OK.  There's definitely sites that look much worse.

I think I will end up building one if some of these conditions are met:
  • The experience of building and maintaining a web site seems like it would enrich my programming skills.
  • Blogger's platform impedes me from doing something I'd like to do.
  • I see some real value (from a monetary standpoint) in building one.

Thursday, December 13, 2012

Google App Engine - Hello World

This post is part of series about building something with the Google App Engine.
If you haven't done so yet, read an overview of these posts here.

In this post, I'm documenting the process of starting up my first application, as I follow the steps in the developer guide from Google.

1. Create a new Google Web Application project.

2. I named my project testproject, with a package name of com.refactoringproject.
3. After running the project, you should see a development window open in Eclipse.
4. If you click on that line, you should open the web app in a browser.
 5. Entering my name in gave me this.
This all worked very easily for me "right out of the box".

Thursday, December 6, 2012

Algorithms

I have been a professional software developer for a few years now, but I haven't had any formal training on the subject of algorithms.  So, I think it's about time for me to do some hard technical reading on the subject.

To that end, I am currently reading Introduction to Algorithms to learn about algorithms.  So far, I think the book is well written and pretty easy to read.  However, I think I will need to do some pen on paper or coding work to internalize the material and ensure that I get some long term value out of it.

I thought it would be pretty cool to write the code for various sorting algorithms, and then demo it in an Android app.  That must be a decent idea, as someone has already built an app that demonstrates sorting algorithms very nicely.

Please leave a comment if you'd like me to see some posts on algorithms or if you know of any other great resources to learn from.

Sunday, December 2, 2012

About this Blog

This blog is basically about me and what I'm working on.  Thus, there's a good chance that you don't find anything interesting here.  But, if you happen to like programming, basketball, and criticizing movies, I guess we have something in common.

Android Development

In this series of posts, I will show you how I built a simple Android App.  Specifically, I'll show you how to build different pieces of an Android App.  I assembled the components into an app that is the App Usage Monitor, which you can install from Google Play, but you can use the components in any way you like to make your own app.
Before I began building this app, I had never written a program in Java before, never built a mobile app, and never used Eclipse (the primary tool I now use to build apps).  Nevertheless, I was able to publish an app that has actually been installed by a few people.  I encourage you to give app building a try and to learn from the notes I have listed below.
Note, like most development projects, I'm still updating and improving the app.  Similarly, I will be editing the posts to make each more informative and easier to understand.

Here are some other posts about Android development.
Please feel free to leave a comment if you find anything unclear or would like me to cover any other material.

    Refactoring my apartment

    In the beginning
    I didn't have any furniture.  We (my wife and I) had a blank, one-bedroom apartment in New York City.  For the living room, we thought, let's get the essentials and fill out things as we needed.  This consisted of the following items:

    television
    television stand with storage
    couch
    dining table
    and some bookcases.

    Multi-purpose sucks
    One item we did not invest in was a desk.  I thought to myself, if I got a desk, then it would encourage working from home.  This was something I was already doing, and I didn't want to do more of.  So, whenever I had to do work at home, I worked with my laptop from my couch or dining table.

    However, things have changed, and I want a desk now.  Working from a couch is ergonomically crappy.  Working from a dining table creates a lot of clutter.  Finally, while I still don't want to take my work home with me, I do want to work on this blog and work on my Android apps.  So, I'm in the market for a compact, functional, clean, good-looking desk.

    The search is on
    I am looking for a desk that is less than 38 inches wide.  I plan to put a big monitor on the desk.  I also want to plug in a laptop into the monitor, so that I can work on a nice big screen.

    One candidate is onelessdesk from heckler design. It is the perfect width, but in its ambition to be as sleek as possible, it looks like using the desk to do some other tasks, like writing with pen and paper, is difficult. 

    Some other candidates that are all a bit too wide, are listed below.
    http://myturnstone.com/products/bivi-table-for-one-with-back-pocket/
    http://store.hermanmiller.com/Products/Airia-Desk
    http://www.bluelounge.com/products/studiodesk/

    I have also been considering re-purposing one of my bookcases into a desk area, but that might be more multi-purposing that I'm looking to get away from.  

    Lessons learned
    I am not good at picking furniture.  If you know what you want, in particular the name of the piece of furniture, it's pretty easy to find anything.  If you only have an idea of what you want, then searching for furniture is hard.