Where does the time go?

There are 168 hours in a week. (7 x 24).

I sleep 63 hours. 105 hours.

I work 40 hours. 65 hours.

I spend 5 hours each week getting up, getting ready, and leaving for work. 60 hours.

I commute 5 hours each week. (Pretty sweet, eh?). 55 hours.

I spend 10 (non-work) hours eating each week. 45 hours.

At least 20% of the remaining time, I am so tired all I can do is watch TV or surf the web. 36 hours.

So… I have 36 free, awake (but non-contiguous) hours each week. Where does that time go? Stay tuned….

 

 

 

The “right” way to javascript

I try to avoid arguments about curly braces, variable names, and other low-level code practices. But when it comes to javascript, I do have opinions.

Consider adopting the jQuery Style Guide. I don’t observe every last bit of it, but I’d be willing to conform for the sake of consistency with the rest of a team.

Here is my own style as per jsCode.org. (Hint: If the code sample looks ugly, try reloading.) You can generate your own style at jsCode.org. It would be fun to compare and contrast.

In particular, variable names should be camelCase. They should only have initial caps if they are a constructor function.

I don’t care how you indent, as long as you do. My editor automatically converts to 2-space indentation when I open a file. But I am sympathetic to other styles.

Opening curly braces do not get their own lines. Sorry. First, the javascript community has overwhelmingly adopted the “same-line” convention. Second, this. Please save “separate-line” style for the days you write java.

“if” and “for” bodies must be wrapped in curly braces. Javascript is not python.  If you omit curly braces: 1) I will have to read your code very, very slowly to understand it. 2) We can never minify your code safely. Do the right thing.

Use jshint to check your code. There are some arguable warnings, but try to fix as many as possible.

Think hard about globals. Jshint flags them. You should be able to defend every global it surfaces.

Use the array iterator functions: forEach, map, reduce, and filter. Next time you are about to write another “for” loop, ask yourself if you could use an array iterator.

Consider using an IDE. It will flag many javascript issues before you get a chance to check in.

FTP on your Centos server

If you run WordPress on a Centos server, you will discover that you need an ftp server to support automatic updates. There is a good article on how to do that here:

https://www.digitalocean.com/community/articles/how-to-set-up-vsftpd-on-centos-6–2

However, you also need to follow the instructions in the comment by nest.u333:

https://www.digitalocean.com/community/articles/how-to-set-up-vsftpd-on-centos-6–2#1372265397

And with that, you can use WordPress auto-update.

 

PHP’s future is… meh.

Acknowledged:

  • PHP is used in many, many companies.
  • PHP is used in some big companies like Facebook and Yahoo.
  • PHP has many developers.
  • PHP has apps that are not going away in the foreseeable future.
  • PHP has apps that are never going away. (WordPress and Wikipedia, to name two. There are more.)

Yes, yes, yes, yes, yes. All true. But if you are a PHP developer, now would be a good time to start learning something else…

My argument hinges on the idea that no growing company “switches” to PHP. You either start with it, and grow the company, or you never do use it.

See, if you scan the links at TechCrunch.com, you’ll never see a startup that launches on PHP. Actually, I don’t think I’ve seen one in a decade now. (Does Identi.ca count?) Starting around 2006, PHP startups were replaced by Rails startups, which gave way to Python startups, which gave way to nodejs startups. Not being part of the startup scene means that no companies are going to suddenly grow big, and find themselves supporting an installed base of PHP (as Facebook did).

I hope you’ll agree that none of today’s startups are going to switch to PHP at some point. Twitter switched from Rails to Java/Scala, for example. Not to PHP.

Which, I submit, means that PHP will slowly (ever so slowly) fade away.

But take heart my PHP friends! If you just need to eke out another decade or so until retirement, I think you have plenty of runway. There are countless organizations with WordPress/Drupal/Joomla.

Did you know that Hawaii built their state-wide Obamacare site on WordPress? How neat is that? At the same time, I think it exposes the glass ceiling for PHP: cost-constrained organizations, that will accept something “good enough”, and have reasonable scaling requirements (Hawaii has just 1.4MM people, same as San Diego).

Meh.

 

No market for mid-range chromebooks

I reluctantly convinced myself that there is no market for mid-range chromebooks. In fact, there is no high-end market either, despite the existence of the Chromebook Pixel.

In the world of computers, there are:

  1. high-end, pricey, powerful models
  2. low-end, affordable, frustratingly underpowered model
  3. mid-range models, that cost somewhat more than the low-end, but perform so much better

Those who know their stuff buy and recommend mid-range computers. The extra money is well spent.

The Pixel is crazily overpriced for what you actually get. It is clearly a boutique product, sold and supported by the sugar-daddys at Google. Note that we are going on a year now, and no one else has moved to produce a high-end chromebook. Enough said.

Low-end chromebooks are the breakout success story of 2013. Acer announced that chromebooks are their best-selling products. Seemingly every PC maker has one, or is announcing one. Weirdly, no one is trying for the mid-range…

Let me define my terms: A mid-range chromebook has 4gb of ram, 32gb (or more) of storage, and a high-resolution display (say, 1920×1080).  It sells for $400+.  Who makes that today? No one. Who has a announced something in that category? No one.

Look around the current offerings. Everyone is stuck on 1366×768 screens. I don’t understand. The Nexus 7 (2013) has 1920×1200. The Samsung Galaxy Note 10.1 (2014) has 2560×1600. Why do android tablets routinely trounce chromebooks on screen quality?

As for ram, you basically have to settle for 2gb. Walmart and Costco both offer versions of the HP 14 that have 4gb. The Costco version, with 32gb of storage comes closest to my mid-range machine. It is dragged down by that crappy screen.

Acer, whose C720 series won all the awards last year, briefly sold a 4gb edition. Then they stopped. The 4gb edition is now only available from ebay resellers, at premium pricing.

Price is king in the land of chromebook. Straying above $300 is risky, based on what I see out there. I’d love to get a mid-range chromebook, I just don’t expect to see one for a couple of years.

 

Node on CentOS 5

You can easily install node on CentOS 6 using yum. On CentOS 5? Not so much.

My journey began on this page, which is half right. You need to install python 2.7, just so:

wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar -xf Python-2.7.3.tgz
cd Python-2.7.3
sudo yum install gcc
./configure
make
make altinstall

The second half of that page describes a way of installing node that no longer works (because nodejs.tchol.org no longer exists). So…

Visit http://nodejs.org/download/, and copy the download link for the latest node tarfile (ie, http://nodejs.org/dist/v0.10.25/node-v0.10.25.tar.gz). Next:

wget http://nodejs.org/dist/v0.10.25/node-v0.10.25.tar.gz
tar -xzf node-v0.10.25.tar.gz
cd node-0.10.25
python2.7 configure
sudo yum install gcc-c++
make -j5
sudo make install
node --version

Voilà!

The vast right wing conspiracy to suppress RAM

14 months ago, I bought a new laptop. It only has 4GB, and it’s not upgrade-able. But it was only $600, and I figured I’d be able to buy a better one in a year or so, passing this one down the family food chain.

Really, 4GB is a minimal configuration on a modern Windows machine. I thought for sure the trend would be towards 8GB by now. In fact, desktop PCs all come with more than 8GB now. But search in vain for an 8GB laptop.

Oh, they are out there. For premium prices. In the under-one-thousand-dollar category, you seemingly get the choice of heavy + RAM, or light + no RAM. Adding insult to injury, the new “thing” is to solder the memory to the motherboard, preventing upgrades.

Let me spell it out for you: I want a light laptop, with 8GB, for under $800. I haven’t seen one yet.

Meanwhile, over in Chromebook land, they are stuck at 2GB. Again, this is really the rock-bottom minimum. You can have a much nicer Chromebook experience with 4GB. But there are only a couple of models that offer that, and they are either perpetually out of stock, or priced well above Chromebook’s value proposition.

And don’t get me started on these so-called Windows 8 tablets with just 2GB. Remember single-tasking? You will if you buy one of these tablets.

There is also a conspiracy against increasing screen resolutions. But I’ll save that for another rant.

 

Costco Bourbon

Another in my tradition of reviewing by quoting others.

I bought a bottle of Costco’s bourbon tonight. The label says it is a 7-year-old small batch. The internet is rife with theories on what it really is. I’m not qualified to say. Instead, I’ll selectively quote from “‘s” review:

At 103 proof, the stuff is extremely hot when drunk straight; what few notes come through the alcohol burn are overpoweringly oaky and sour.  Adding a bit of water, or serving it on the rocks, helps some; the flavors open up, allowing some charcoal and molasses notes through and giving it a bit more complexity.  It does, however, still burn significantly on the way down; this is pity party bourbon of the first degree.

In all fairness, it’s not without its charms – it mixes up into a perfectly decent whiskey sour, and the strong flavor would probably work very well in bourbon lava cakes.  But I wouldn’t really recommend it straight, unless you enjoy the sensation of having your taste buds scalded into submission.

 

 

“Derek” – cut and paste review

I learned, long ago, that anything I watch or read has been reviewed by someone more pithy than me. Accordingly, I present my cut-and-paste review of Ricky Gervais “Derek”:

(Cutting and pasting from Brian Lowry’s review in “Variety.”)

Gervais himself is the weakest link in what’s otherwise a thoughtful, sometimes-moving seven-episode run.

Hey, no kidding, After two episodes, I started ignoring everything Gervais does on screen. He has gone full retard in this role, and it is not pretty.

Stick with it, though, and “Derek” begins zeroing in on significant issues — the power of kindness, the nature of mortality and the notion of caring for those who can no longer do so for themselves.

This is the worthwhile part. Derek is not a comedy, it is a drama. A good one.

The title notwithstanding, the real star here is Godliman as Hannah, who is both terribly protective of Derek and so committed to her job she risks sacrificing a potential romance that has come into her life. Wonderfully relatable, tough yet vulnerable, it’s easily the best female character to come from Gervais.

Agreed. You keep watching this show to find out what happens to to Hannah, not Derek.

Unexpectedly poignant and only sporadically funny. … Although it takes awhile to grow accustomed to Gervais’ character — a seemingly autistic man working in a struggling convalescent home — the show is filled with a beguiling sense of melancholy, and a knockout performance by Kerry Godliman as the facility’s caring administrator.

Yep.

 

 

What if there was a Microsoft iPod Touch?

It occurred to me that if Microsoft sold an iPod Touch-like device, but with Metro interface and apps, I’d buy one. Metro is slick. It would be really nice to use it on a small, affordable (sort of) touch screen.

But then I thought some more… Microsoft would, of course, only allow syncing via a proprietary, non-great music store app. And that app would transcode all my mp3s into wma. After which, I would be locked in the Microsoft trunk.

So… nevermind.