Memory Management

Zen Digest

  • Outsource the task of remembering lots of short-term tasks
  • Be mindful of how you’re using memory (both technical and human)
  • 7 is the magic number of things we can remember

The Whole Picture

According to Miller’s Law, the human brain can store between 5 and 9 (most commonly 7) objects in short-term active memory.  I’ve always tried my best to be a man of my word, and in doing so, I needed to ensure that I remembered to do everything I agreed to do.  In business meetings, I did this by always taking notes.  I even have a system for marking items that are follow-up questions, tasks, etc.  But, in my personal life, it’s not very convenient to carry around a notebook and take notes during conversations – so I use my phone.

In a previous post, I noted about how I use an app called Any.do, which is a very simple task-management (really it’s just a list maker app) and it has been great for me to offload short-term memory management.  For tasks that are time-sensitive – “switch over the laundry” for example – I create a calendar item with a reminder.  An hour or so later, I get a notification that I need to move the laundry.  I free my mind from having to remember about the laundry.

This sort of outsourcing is wonderful as it not only frees up processing and storage in your brain, it also reduces stress – as you never have to worry about remembering little things (or worse, forgetting things).

Now we get technical.  Computers are similar to your brain in that they have two different types of memory – RAM (similar to short term) and a hard drive, similar to your long-term memory.  RAM is extremely fast, but much more expensive than a hard drive (as of writing this, you can get a 1,000 GB hard drive for $50 or 4GB of RAM for $45.  While 4GB is quite a bit of storage, it can get used up very quickly, especially when writing inefficient or sloppy code.  While web programming doesn’t give you much control over how to do memory management, the rules by which the browser does manage memory is well defined.

Whether you are programming or simply trying to remember a grocery list, it’s important to determine the best way to store that information to keep yourself and your code efficient.

Share

Responsibility

Zen Digest

  • We have a responsibility to do the right thing
  • Our responsibility is derived from a desire to persist the human race

The Whole Picture

When we produce, we affect the world around us.  Every action we have has consequences.  Every plant we plant reduces carbon in our atmosphere, while every mile we drive in our car increases carbon.  Every mile we walk instead of drive saves potential emissions.

But there are less black and white cause and effects.  I started my corporate life in the Finance industry.  For the most part, the products we created helped the rich get richer.  At the end of the day, I wanted to have a more positive impact on the world around me, so I got back into the start-up world working on products that provided more value to general consumers.

But, on an even smaller scale, the decisions we make – such as build or buy – when it comes to software or technology make a great difference.  You could upgrade your phone every 2 years, or every 3.  The amount of waste saved by upgrading every 3 truly adds up.  Also, when faced with having to create your own solution to a problem, if you can find an existing solution, you can save yourself days of work with simply a small amount of up-front research.  This time can be spent solving bigger and more complex problems.

Education is the crux of all of this.  We must constantly learn about how our world works.  Everything we do has a cost, and it isn’t always in dollars.  In fact, it’s often the items that cost the least amount of money that have the greatest overall cost to the world.

Share

Compression

Zen Digest:

  • Basic breakdown of different types of compression

The Whole Picture:

If you’ve ever worked with images (either by sending digital photos, or building anything with a graphical component) you’ve probably encountered some of the major image file formats such as GIF, JPEG (jpg) or PNG.  Those are some of the most common ones, but there are probably a few dozen different image file formats.  They are all a little different and what differentiates them is compression and quality.

A digital image is essentially a list of colors.  Each color maps to a pixel, and when those pixels are put next to each other, they comprise the image you see.  Since today’s cameras (even on your smartphone) take pictures in megapixels (the latest iPhone takes pictures that contain 8.7 million pixels).  If you wanted a rich set of colors, such as 16-bit color (about 32,000 unique shades), you’d end up with a 16 megabyte image for every picture.  That would be unnecessarily huge.

(If you want to know which image file format is best to use, check this out)

Now we get to compression.  So much data is redundant.  For example, instead of the full 32,000 colors, you could limit the amount of color choices and greatly reduce the file size.  This is obvious – less options, less size.

Then, we get a little more thrifty.  Since frequently, two pixels that are next to each other may be the same color (or very very similar) you could simply combine them into one pixel.  Now, if you had 3 or 4 in a row, you could just say “repeat this color 4 times” and use 30% of the space that repeating the color 4 times would use.  If your image frequently re-uses the same color, this could lower the file size from 16 megabytes down to 3 or 4.  At this point, this is where “lossy” and “lossless” compression come in.  Lossless would require that the two pixels be exactly the same color (hence no actual information was lost).  Lossy would say “as long as the colors are close.”  Most of the internet uses lossy compression for images.  It is much more efficient at reducing file size, yet it produces a bit of a blurring effect.

The last way to compress an image is to create an index.  For this method, a program analyzes the image and comes up with a set number of colors – usually 8, 16, or 64 (although any multiple of 2 is possible).  It scans the image and assigns every pixel to be the closest match to the 256 colors it chose.  This allows the image to remain fairly crisp, but reduces the color range greatly.

The final isn’t really compression, but it’s about reducing file size.  Often a 10+ megapixel image is simply gigantic (3000+px by 2000+px).  This is extremely large and more than what most monitors and screens can even display, so what you see is the image shrunk down.  By simply reducing the file size (although always try to do it by a factor of 4), you can reduce the file size greatly without losing much quality (although you lose the ability to zoom in with high quality).

Share

Check the Obvious

Zen Digest:

  • When diagnosing a problem, let go of assumptions.
  • Check things that would make you say “I can’t believe it was that!”

The Whole Picture:

Growing up, my family had a tradition of putting up Christmas lights.  We were hardly the Griswolds but we had enough lights and surface area to cover to require an entire day of untangling clusters of lights, determining a pattern, and getting everything working.  This was many years ago, and we bought the budget lights, so if one bulb went out, the entire string didn’t work.  With my father’s desire to fix things that are broken, if a cluster of lights went out, he was determined to find the bulb that was broken (or fuse that was blown) and replace it.

Most years went smoothly with only a small amount of clusters out, but one year was exceptionally bad.  It was a year where my sister and I were a bit more grown up, so the excitement of putting up lights began to wane.  My father, determined to keep the spirit up (and/or driven by my mother asking him to put up the lights), decided to start putting the lights up in the front of the house.  An hour or so after untangling and laying out the lights, my father came inside and hunted for every spare bulb and fuse he could find.  He went back outside to find the illusive burnt-out bulb.  More time passed and he came back inside to grab the car keys – he was off to the store.  He came back with $40 worth of spare parts.  Mind you – he probably could have bought a whole new set of lights for the front for that price – but he was determined to solve the problem at hand.

At this point I was awake (or had come back from whatever activity I was doing that morning) and he asked for my help.  Whenever I was around he tried to set a good example, so normal corner-cutting (measure-once cut-twice, taking small risks, etc) got sidelined.  For him, rule #1 when working with anything that plugs in is to unplug it.  We go outside with the spare parts and he gave me instruction #1: “Go unplug the lights.”  I walked over to the plug and noticed the lights were already unplugged.  “Hey dad.  They are already unplugged.”  I stared at the plug and placed it in the outlet.  The lights magically turned on.  My father had set everything up and simply forgotten to plug them in.

We get wrapped up in our tasks, and frustration can often blind us to possible solutions.  “The last time this happened, X was the solution,” leads us to try X, then when X doesn’t work, we look for more obscure of difficult problem/solutions – because we assume the simple solutions were covered.  In programming, forgetting a period or semi-colon can cause an entire application to crash or behave incorrectly – such a simple thing.  Ever leave your keys in the lock?  Always check the obvious.

 

Share

Heartbleed

If you haven’t already heard, a very large security issue was discovered in the past few days and it’s been named Heartbleed. I’ll spare the technical details, but, what it allows someone to do is to access data that is in a server’s memory.  The worst part of all is that, while we know how many major websites were affected by this, we have no idea how many hacks there have been.  It could be that this issue was found out before any data was stolen, or it could mean that a few hackers/governments now have all your passwords to major sites (and possibly credit card info).

Should you freak out?  What should you do?

Don’t freak out.  The only thing you should really do (and you should be doing this anyway) is reviewing your credit card once or twice a month to ensure all the charges on it are yours.  This is a good idea anyway.  Most credit cards handle fraud very quickly and easily and let you get a new card number quickly if something does happen (along with refunding the charge).

What is affected.  The number of affected sites is unknown, but, the majors are Facebook, Instagram, Pinterest, Tumblr, and Google, Yahoo, Amazon, and Dropbox.

What should you do?  Based off the type of data that could have been stolen, the best thing you can do if you wish to maximize your protection is to simply change your password (I would change it next week, to ensure all these sites have updated and patched for the fix).

I’m curious – what was the actual issue?
To put it in non-computer terms, imagine that a website has a large guest log, like a hotel (servers actually do).  Now, In this guest log, you have to verify that you are who you say you are to access the hotel.  When you come in, you give your name, your address, and your personal information to confirm your identity.  In the future, if you want to back, you can simply say hello to the guard, and the guard will say hello back.  Now, in this case, the security guard would normally use their hands to cover up the other guests information (as you shouldn’t be seeing other people’s information).  What this bug did, was allow you to essentially move the security guards hands so that you could see a few more rows in the guest log.

Now, this guest log contains much more than just log in information, it contains requests for pages, encryption keys, etc.  But, it is all sensitive information in some fashion.  Put in a visual form: http://xkcd.com/1354/

Share

Agile or Overhaul?

Many development shops today use a methodology called Agile programming.  It breaks the traditional release cycle and allows you to put out small updates on a daily or weekly schedule, as opposed to bigger releases every few months.  This has many benefits, such as making it easier for users to transition (lots of small change is easier than big change all at once), and it allows you to get user feedback and address user issues quickly.

The downside is that you ultimately become stuck to the foundation that you built.  Take a house – if your purpose is to raise a family of 4, a 3-bedroom should be more than enough.  You can continuously make improvements, redo the bathroom, change the kitchen, but if you suddenly decide to let the inlaws live with you, major work will need to be done on the house.  That major work cannot really be done in tiny chunks.

Ultimately, any tech company needs to find a balance – release a product and iterate, iterate, iterate while also working on building the next foundation.

The same goes for business processes.  You should continually tweak, but, if your task, team, or situation has changed, you may need to do a complete overhaul.

Share

Oculus Rift

You may have heard of the Oculus Rift recently.  Most likely because it was acquired by Facebook for $2B.  But what exactly is Oculus Rift and why does facebook want it?

Oculus Rift is a wearable set of virtual reality goggles.  Not only do they display a 3d image for the user (two unique images, or for each eye, in a way to feel 3d), but they also track movement, so when you turn your head left, the view moves to the left.  So, unlike 3d glasses that let you watch a movie in 3d, these also let you directly interact with this 3d world.

If you want to see a 90 year old using them and being amazed, check out this video: https://www.youtube.com/watch?v=pAC5SeNH8jw

Ultimately Oculus Rift was built for gaming, and it’s focus has been gaming.  The reality is, such immersion and quality virtual reality extends way beyond video games.

While I cannot comment on why Facebook bought Oculus Rift (because I am not facebook and cannot speak for their intentions) I can tell you some of the things that I see virtual reality enabling.

1) Freedom from the screen – All our devices are limited in size.  Sure, we can have big-screen monitors, but they have edges and limitations.  With VR, it will be possible to allow the screen to engulf the entire world around you.

2) Deeper social connections – ever since science fiction brought us the holodec (a holographic projector) we have been waiting for scientists to create one.  Virtual Reality could actually provide something that is one-step ahead.  A camera could digitize a likeness of yourself and allow you to interact in a 3d world with the digital likeness of other people.  No longer is a conference call limited to the blurry image from someone’s webcam.  Many people can now sit in a virtual room, share a virtual whiteboard, and interact.

3) Immersion – The connections we make with the software we’re using has become very superficial.  Software has gotten easier to use, and the number of distractions and cat videos has increased.  Virtual Reality offers the ability to create a higher level of engagement that happens with your whole body, and not just your fingers and your eyes.  A more engaged user is a more valuable user.

Have a great weekend.

Share

Net Neutrality

With the latest merger between Comcast and Time Warner Cable, as well as some moves taken by cell phone providers, there has been a great deal of discussion around Net Neutrality.  While I have my opinions, I’ll try to be as factual and concise as possible and explain a bit of what Net Neutrality is and what businesses are attempting to do.

For the sake of explanation, lets think of the physical wiring of the internet as roads – it is ultimately infrastructure.  Large internet providers own cables that send data from our computers and devices to and from servers.  So, like a family vacation, if we want to get from our home to some destination, we have to take roads.  The internet is the same.

A few years back, the largest internet companies – Google, Verizon, etc, got together and agreed that they were not going to restrict traffic flow.  In short, they agreed that if you have a car, you can drive on the roads.  If there is heavy traffic, things will slow, and if you have an open road, you can drive fast.  It is a bit more complicated than that, but I on a general scale, that covers it.

Just recently the US Government warranted that these large companies did not have the power to create/enforce such an agreement – mainly because the action was considered collusion.  Despite the agreement being beneficial for consumers, the logic is sound.  The US Government resolved that only the FCC could make such rules/restrictions about internet traffic/use.  Since that ruling, no laws have been put in place to enforce any sort of neutrality.

Since then, a few telecom companies have taken steps that have had the Net Neutrality community upset.  The proposal was that the cell phone company would allow a business to pay for an individual’s wireless usage.  Going back to the real-world car example, that is like saying if you drive a Honda, you can gas up for free, but not Fords.  The telecom companies are the ones who control who gets free gas, so you can see that this would make Honda a more favorable car.  Many argue that it gives an unfair advantage to large companies, who can afford to do such large-scale deals.

And – since I mentioned it above, the merger between TWC and Comcast is of concern to people because it merges two very large providers into one.  Incentive for that newer company to increase speeds, reduce price, and provide better service is reduced.  Reality is, there is no immediate threat to Net Neutrality by this merger, just many people concerned of poor service.

Share

Bitcoin

Lately there has been alot of talk of Bitcoin in the news (driven by the shutdown of the drug-selling site Silk Road, and now the shuttering of Mt. Gox).  But for most, Bitcoin – and cryptocurrency – is really just some cyber mumbo-jumbo.  The ultimate question is – how does this actually matter?

First, we must understand what Bitcoin is.  Bitcoin is a type of cryptocurrency.  I’ll spare the nitty gritty of how it works, but the short explanation is that each piece of currency is ultimately a unique set of letters and numbers.  Similar to the serial number on your paper money.  This unique number is validated by a huge amount of people who (in exchange for a small amount of bitcoins) run servers to check and validate the ownership and transfer.

Head spinning?  Try this example.  Lets say we get 10 people in a room and make up our own money system.  The computer spits out a number and tells me that I have $1 and the ID is 1A.  I tell everyone: “I have 1A.”  Everyone nods in agreement.  Later, if I want to buy something from someone else, I simply shout “I’m giving 1A to Bob.”  Everyone nods.  Because multiple people listen, as long as a majority agree that I have 1A (and soon Bob will) the transfer can go through.  So, the system works on redundancy and agreement.

There is no agency that controls the flow of cryptocurrency, and it’s supply grows at a set rate, which controls the supply from getting out of control.

But do you have to care?

No – not yet at least.  For now, the best way to view bitcoin and any other cryptocurrency is as a risky investment.  Lots of money can be made, and if you want to set up your machine to be a validation node, you can even earn a few bitcoins here and there, but there are major risks involved, and like all risky investments, you should really understand it before jumping in.

The future is unclear though.  Since cryptocurrency has no government backing, it is protected from government defaults and fluctuations.  At some point, it is reasonable to consider that a cryptocurrency will be on the same standing as the US dollar, the Euro, the British Pound, etc, but it is unlikely that it will replace those currencies – at least not until there is a global government (should such a thing ever happen).

 

Share

Tech Goals

What are your tech goals for 2014?  What do you want to learn?  What would you like to improve?  How can I help you get there?

Share