Gallery Separation with WordPress Lightbox Gallery Plugin

While working on a friend’s blog, I ran into a bit of a problem with having multiple Lightbox galleries on a page in WordPress: all images on a page will be in the same gallery despite being from different posts. It would basically mean that clicking on an image from one post’s gallery will allow a reader to navigate to all images on a page.

There was a simple fix, but it was rather manual. It involved taking the gallery shortcode for WordPress:


And adding a class to separate the galleries:

[gallery class="gallery2"]

However, this was a manual process and I was sure that there was a way to make it more automated so that I wouldn’t have to add a class for each gallery, perhaps using the post ID as the class name to separate them?

After some digging around, I found this in /wp-content/plugins/lightbox-gallery/lightbox-gallery.php:

	'order'      => 'ASC',
	'orderby'    => 'menu_order ID',
	'id'         => $post->ID,
	'itemtag'    => 'dl',
	'icontag'    => 'dt',
	'captiontag' => 'dd',
	'columns'    => $columns,
	'size'       => $size,
	'include'    => '',
	'exclude'    => '',
	'lightboxsize' => $lightboxsize,
	'meta'       => 'false',
	'class'      => 'gallery1',
	'nofollow'   => false,
	'from'       => '',
	'num'        => '',
	'page'       => $page,
	'before' => '<div class="gallery_pagenavi">' . __('Pages:'), 'after' => '</div>',
	'link_before' => '', 'link_after' => '',
	'next_or_number' => 'number', 'nextpagelink' => __('Next page'),
	'previouspagelink' => __('Previous page'), 'pagelink' => '%', 'pagenavi' => 1
), $attr));

A simple change with the ‘class’ part of the the array do exactly what I need:

	'class'      => "'" . $post->ID . "'",

Ta-da! Multiple Lightbox galleries on a single page are now automatically separated by post ID without any extra manual fuss. Photos in each post will now remain sandboxed inside of each post, regardless of how many are listed on a page.


A Cautionary Tale for PC Builders & A Sad Rant

Almost two months ago, near the tail end of June, I had made the decision to purchase all of the parts I would need to build a computer rig that would be strong enough to play the latest and greatest computer games that were coming out. That’s all I wanted out of it.

That’s right, I was joining the ranks of PC builders everywhere.

I chose to purchase practically everything from NCIX because they have convenient locations for me, their prices were great, and I’ve purchased some gaming-related peripherals from them before without any issues. Sure, there was that initial snafu of “your motherboard isn’t ready yet, so… wait a week, thanks” which was fine by me, I was off to Los Angeles for a week, so I could afford to wait.

I came home and picked up all of computer parts on July 11th, a day after I got back, and promptly assembled my computer. It booted up, I installed everything onto it, and it ran like a dream.

An hour after I finished installing all the right drivers, I was off playing the Counter-Strike: Global Offensive beta. Perfect.

Problems? Let’s get some.

Fast forward three weeks: I had been playing co-op Borderlands, when I started noticing some weird artifacting on the screen. I didn’t think much of it, maybe chalking it up to a one time glitch or the graphics card, an MSI Radeon HD 7950, may have been running hot that one time, so I slept on it.

I woke up, they were still present, to the point that my Flash player was no longer working and any sort of process that involved the graphics card could (and would) crash my computer. Checked the temperatures and the graphics card would run at 35 degrees MAX, so it wasn’t overheating or anything.


Sent an email to my local NCIX to ask what the hell is going on, and they suggested bringing it in. I brought in my entire tower into NCIX on August 7th, being told almost immediately that my graphics card was defective (was showing artifacts ALL over the screen during testing) and that I could exchange it.

Fun fact: did you know that you can’t do a straight exchange without a box?

I did not know that, being used to just dumping my Apple computers onto the desks of those Geniuses at Apple Stores and being given replacements, so imagine how awful I felt after learning this and having thrown away the boxes the week before. Yes, exactly one week before.

After learning that fun fact, they said an exchange was still possible. Oh good, good good. The real problem: they didn’t have any MSI Radeon HD 7950 Twin Frozr cards in the store. Or in Ontario. D’oh!

Good news: they could take my card (as my 30 day warranty wouldn’t last until the cards came) and hand me a new one as soon as they got them in the store. Their predicted date was August 13th, as they had already placed their orders.

Awesome, I could wait five days. Five gaming-less days. No problem.

Oh, today is August 27th. Where has the time gone?

In the span of the 21 days that I have had a useless gaming computer, I spent 11 of those days (weekdays since the 13th) calling my local NCIX to check if they have it in stock yet (nothing in Ontario still!) and I have tweeted and have been in contact with their Customer Care department.

Nothing has happened. At all.

This week marks an interesting intersection in lengths of time: I have been able to use my gaming computer for just as long as it has been non-operational. I take full responsibility for not having the box (which prevented me from getting a replacement card) but I could have flown to Vancouver, picked up a new graphics card from NCIX, and flown back here to make the exchange.

So a few lessons for those of you who want to build a computer:

  • Do not throw away boxes. I had no idea this was an actual issue, but I guess when you’re just the retail part of a supply chain, you don’t have much say in the matter.
  • A 30-day warranty is not enough. If this graphics card failed after the 30 days that NCIX gives each purchase, you can definitely bet that I would be completely out of luck considering I had no box.
  • Customer Care cannot do a damned thing. They are all great people manning the phones, emails, and Twitter at NCIX, but all they can ever do is investigate. I have had zero progress through any of these channels.
  • Compensation wouldn’t mean much for this. Maybe my situation is a bit on the super-rare side, but I’m not even sure how to feel anymore. An apology would be nice, but I don’t think I could even ask for anything to compensate. What are they going to offer, the crappy AR drones their phone system keeps advertising?

If you plan on building a computer anytime soon, I hope you can avoid the frustration that I have had to suffer through. This isn’t a cautionary tale against NCIX, just an example of some of the stupid things that can happen.

Best of luck.

Why Can’t I Focus?

I take pride in being realistic in my abilities, my goals, and my confidence. I live my life with this knowledge: I am probably not smarter than you, I am probably not stronger or faster than you, but I make sure that I do my best to work harder than you. However, working harder than someone else doesn’t necessarily translate into doing better than them, or even doing better than mediocre levels of success.

I think that most people are driven to succeed. They want to provide for themselves and their family, and feel proud of their accomplishments at the same time. Myself included. However, we also want to create balance for important aspects of our lives like family, friends, love, and extracurricular activities like sports and hobbies.

Given that we usually use 8-10 hours a day for “work,” how can we maximize what we accomplish within those hours?

Throughout my years of attempted greatness, there has been one thing that people tell me to do, every single time without fail: focus. It usually comes in a few different flavours: hustle, stop slacking off, be relentless, focus on one thing and one thing alone. You get my drift.

Every time I hear this, I cringe and remember why I don’t succeed at a lot of things: too much aimless focus. I have an idea, get really excited about it, pour on lots of energy into building the foundation for it and simply fizzle out as soon as the work starts to happen.

Sound familiar?

If I were to go back in time and have a talk with younger me, I would tell him this: everyone will tell you to focus, to put your head down and get shit done. It’s important that you do, but the step before focus? Planning.

You can focus all you want, but remember that if you have nothing to focus on, you’re basically ramming your head into the wall and hoping that something comes out for you to focus on. You need to be able to wake up in the morning and say “Alright, today is awesome, here’s what I need to do for today.” because you’ve planned the entire thing out months and months (maybe even years) in advance. After all, how can you put your head down and focus if you’re just making it up as you go along?

Time Management from xkcd
From: xkcd – Time Management

I recently left my job (despite my short time there) with one goal in mind: build something. As vague as that sounds, I wanted the freedom to work on something fun and challenging, that puts food on my table, at my own pace, my own schedule, on my own terms. That’s the long term goal.

To get there, however, I need three things: the ability to build, the ability to design, and the right ideas to build. Given that, I’m in the process of creating a three month curriculum for myself to become a better developer (I’m currently terrible), a better designer (couldn’t design my way out of a box), and to spend ample time creating a process to brainstorm the right ideas to build. In addition, I’ve set a demanding set of goals that I must accomplish by September of 2013, exactly one year from when I start my curriculum.

The important part of this whole process is that given the long term goal (build something fun and challenging, put food on the table), I created a goal for the medium term (one year), and then I created a month-by-month set of goals that incrementally get me to the goals I set for one year, which then spawned a week-by-week set of goals that get me to the monthly goals.

At the very worst, I will have given myself plenty of time to learn new skills, hone my craft, and take a serious crack at “building something.” After all, now that I know what I need to do for the next year, the next logical step?


The CTV Olympics App and AirPlay Mirroring

If you’re like me, you want to watch very specific sports and events at the Olympics, and what they play on the television channels isn’t always what you want to watch.

Well thank goodness CTV made an app for that, called CTV Olympics London 2012. You can watch any event that is currently playing, and I was thrilled. I immediately went to the men’s basketball game that was going on (USA vs France) and the video loaded up and started playing.

CTV Olympics London 2012


Then I tapped the video to AirPlay it onto my Apple TV so I could enjoy it on a larger screen while I went about my day.

Oh, what’s that? CTV built a custom video player UI that blocks any sort of volume control and AirPlay options? Trying to force AirPlay (via the iPad task bar controller) doesn’t work?

CTV Olympics London 2012 Video Player

Well that’s not nice.

Thankfully, there’s a way around that.

CTV Olympics London 2012 iPad AirPlay Mirroring

  1. Double tap the Home button on your iPad to bring up the task bar.
  2. Swipe left on the task bar until you get to the controls section.
  3. Tap the AirPlay button, and put it on your Apple TV or AirPlay-enabled devices.
  4. Turn ‘Mirroring’ on.

And ta-da, the 2012 Olympics are now playing on my TV!

Remember CTV, restricting my ability to improve my experience with your apps is not a great way to go about doing business. People will rebroadcast your streams regardless of having access to AirPlay, the only people you are making it harder for are legit viewers like myself. Don’t think I didn’t catch the fact that you let an ad play over AirPlay before causing an error.

Be nice to your viewers, content holders.

UPDATE: It appears that you also cannot scan through a video replay of an event. Attempting to scan through the video causes it to start from the beginning. Don’t cripple our experiences, CTV.

The Price Difference Between Book and Kindle Prices on Amazon

Price Difference Between Book and Kindle Prices on Amazon

Since my last post about Amazon, where I found a price disparity between two versions of the same Kindle book, my interest in e-book pricing and publishing has been rekindled (no pun intended) and I spent a bit of time putting together a few numbers to illustrate the instability of pricing models in the world of e-books.

My method was simple: take a look at the top 10 books in specific genres, curated by Amazon, and record the book price and the e-book price of each book on the list.

Here are a few notes I should mention:

  • Price selection: I decided to grab the cheapest Amazon price I could find for the physical copy of the book, as well as the cheapest Kindle price I could find for the e-books. This ensured that the prices were fair, making sure they were being sold by Amazon, and it would be consistent throughout.
  • Book selection: I went with the Amazon list because they were the most convenient to find, I will be spending time later on for the other e-reader platforms to ensure that I have a complete look of the landscape throughout ALL providers. Amazon is just the largest and most influential, so it was the best place to start.
  • Price difference: The “Price Difference” column is the Kindle Price minus the Book Price. This number gives us an idea of how much more expensive the Kindle prices are compared to the physical book prices, with red signifying the Kindle version is more expensive than the physical version.

Now that’s out of the way, let’s dive into the lists by genre as provided by Amazon.

Science Fiction & Fantasy

Title Author Book Price Kindle Price Difference
Ready Player One Ernest Cline $10.99 $12.02 $1.03
The Magician King: A Novel Lev Grossman $10.88 $12.28 $1.40
Inheritance (Inheritance Cycle, Book 4) Christopher Paolini $18.47 $16.39 -$2.08
A Dance with Dragons (A Song of Ice and Fire, Book 5) George R.R. Martin $9.99 $17.48 $7.49
Embassytown China MiƩville $10.88 $15.30 $4.42
Among Others Jo Walton $10.19 $12.62 $2.43
Akata Witch Nnedi Okorafor $12.23 $17.99 $5.76
Leviathan Wakes (The Expanse) James S. A. Corey $10.87 $9.99 -$0.88
The Wise Man’s Fear (Kingkiller Chronicles, Day 2) Patrick Rothfuss $11.49 $12.37 $0.88
Vortex Robert Charles Wilson $10.40 $7.39 -$3.01
Quick Stats: Science Fiction & Fantasy
Average Book Price: $11.64
Average Kindle Price: $13.38
Average Price Difference: $1.74
Largest Price Difference: $7.49

Literature & Fiction

Title Author Book Price Kindle Price Difference
The Art of Fielding: A Novel Chad Harbach $10.99 $9.99 -$0.20
1Q84 Haruki Murakami $16.62 $18.58 $1.96
The Marriage Plot: A Novel Jeffrey Eugenides $10.88 $10.92 $0.04
The Tiger’s Wife: A Novel Tea Obreht $10.20 $14.20 $4.00
The Night Circus Erin Morgenstern $9.00 $13.11 $4.11
The Lover’s Dictionary: A Novel David Levithan $10.40 $12.62 $2.22
Lost Memory of Skin Russell Banks $10.19 $9.99 -$0.20
The Sisters Brothers Patrick deWitt $10.19 $9.68 -$0.51
The Cat’s Table Michael Ondaatje $10.20 $11.99 $1.79
Please Look After Mom Kyung-Sook Shin $10.17 $15.30 $5.13
Quick Stats: Literature & Fiction
Average Book Price: $10.80
Average Kindle Price: $12.64
Average Price Difference: $1.83
Largest Price Difference: $5.13

Mystery & Thrillers

Title Author Book Price Kindle Price Difference
Before I Go To Sleep: A Novel S. J. Watson $10.19 $13.47 $3.28
Reamde: A Novel Neal Stephenson $12.91 $14.96 $2.05
Feast Day of Fools (Hackberry Holland) James Lee Burke $9.99 $13.64 $3.65
11/22/1963 Stephen King $13.59 $16.99 $3.40
Sister: A Novel Rosamund Lupton $10.99 $12.02 $1.03
A Trick of the Light: A Chief Inspector Gamache Novel Louise Penny $13.70 $12.68 -$1.02
The Most Dangerous Thing (P.S.) Laura Lippman $10.19 $11.97 $1.78
The Night Strangers Chris Bohjalian $10.20 $15.30 $5.10
Turn of Mind Alice LaPlante $10.20 $17.48 $7.28
The Affair: A Jack Reacher Novel Lee Child $9.99 $12.02 $2.03
Quick Stats: Mystery & Thrillers
Average Book Price: $11.20
Average Kindle Price: $14.05
Average Price Difference: $2.86
Largest Price Difference: $7.28

Given my small sample of data, it’s hard to draw any real conclusions. What was apparent from this small sample is that Kindle e-books are priced significantly higher than physical books on Amazon, but the reason for that is difficult to figure out. I am sure publishers could blame piracy, or immaturity of the e-book market, or antiquated supply chains that haven’t become accustomed to publishing and promoting digital content.

Regardless, I hope that prices for digital books come down to reasonable levels. While “reasonable” can be subjective, I personally think that it’s reasonable for e-books to be priced below the price of the mass market paperback.

For my next research project, I’m going to run the same books through the Nook and Kobo stores and compare their prices, so we can get an idea if this problem is just for Amazon or accross the board.

Thanks for reading, please feel free to give feedback or ask questions in the comments!

WTF, Amazon. What The (Price) Fix?

Hi Amazon,

I love to read, and so it should come as no surprise that I am a huge fan of your Kindle. It’s wonderful: it’s portable, I can load it with thousands of books, and the battery life is amazing. It’s the device that every reader should seriously consider.

However, here’s what I am not in love with: the ridiculousness of e-books in your store.

I understand that e-books may or may not be cheaper than the paper versions, for whatever reason, but people have to feed their families. I understand.

What I don’t understand is, what the heck are you trying to pull with us loyal customers?

Background: I am in the middle of reading this amazing series, The Malazan Book of the Fallen by Steven Erikson, and I just finished book seven: Reaper’s Gale. Despite being the longest series I have ever read, the books have managed to keep me captivated thus far and I was very excited to start the next in the series, Toll the Hounds.

There was a link, at the end of the Kindle version of Reaper’s Gale, to go buy Toll the Hounds in the store, so I clicked on it and noted the price for the book was $12.65. Wanting to make sure that the price was correct, I go to my computer and look at the listing, and I can confirm that it is the same price.

Oh okay, everything checked out.

However, I am a rather cautious fellow. I opened up Incognito mode in Chrome and Googled ‘amazon toll the hounds kindle’ and… what’s this?

Hold on, why was there an option that I was never shown? Why was it significantly cheaper than the one shown to me, someone who has bought 48 e-books in the past year and a half that I have owned my Kindle?

Here are the key differences between the two listings:

  • Cover Image
  • Publication Date

They are virtually the same otherwise. Just to prove it, I sent myself a sample of the more expensive version after I bought the cheaper, older version. Older version on the left, newer version on the right.

Can you spot the actual difference? Yup, the font.

So Amazon, please answer me this: as a loyal customer, why would you want to sour my experience with this practice?

UPDATE: It was pointed out on Reddit that, in the area that shows all of the different types of mediums that the book is purchasable on (Kindle, Hardcover, Mass Market, etc), you can click on the plus sign next to the medium type to get an expanded list for that particular medium.

As I responded on Reddit, I consider myself rather technically capable and observant, and I still had no idea that existed. Now you know!

Canadian Streaming TV Apps: Report Cards!

Television watchers in Canada usually get the short end of the stick when it comes to watching shows, on-demand, online. If we aren’t being restricted because we don’t live on American soil, then we’re being restricted for not having a specific type of account.

To give you an idea of what we’re dealing with, I spent a bit of time with four of the only streaming TV apps that work well for *any* Canadian who has an iOS device or a computer. In addition, I’ve tested out how each of the apps handles AirPlay and what happens to the quality of the video upon doing so; a useful metric for those of us who own an Apple TV.

NOTE: If you want to see the combined report cards, go directly to the Canadian TV Streaming App Report Card page!


I visualized the data into a “report card” of sorts to give you a side-by-side comparison of features and offerings. Here’s how to read the report cards:

Canadian Streaming TV App Report Card Reading Instructions

  1. App Info
    The name of the app and who it is published by. This is also an indicator of which of the major media companies in Canada happens to own this channel and app.
  2. Device Availability
    From left to right: iPhone, iPad, Web, and Airplay. Certain apps are only available on certain platforms. If it is not available, that given platform will be greyed out, such as AirPlay in this instance.
  3. Measurement Minimum
    For the given section, in this case the “Number of Shows,” this is the minimum number for the measurement. For both instances, it will be zero.
  4. Measurement Maximum
    For the given section, in this case the “Number of Shows,” this is the maximum number for the measurement. This is determined by the highest number I encounter while measuring.
  5. Measurement Average
    For the given section, in this case the “Number of Shows,” this is the average number measured across the board.
  6. Video Quality Indicator
    For a given device, I took a look at the video quality available for a user across multiple shows and made my judgment. This is rather subjective, but if it is passable quality (not full of artifacts and jaggies) then it is given a checkmark. An ‘X’ will only be given if it is not available in the first place, and/or it is of very poor quality.
    NOTE: Quality, for most of these apps, was great on iOS devices and so-so on the web at full screen.
  7. Advertisement Usage
    An indicator of when and where advertisements show up, in relation to watching a television episode. Some apps, such as the CTV app, will actually interrupt you as you are using the app and looking for a show to watch.

General Comments

While using these apps, it became increasingly apparent that “on-demand” was a term that could only be loosely used by these apps. There seems to be a general trend, with web content from large media companies, where they will only store a handful of the most recent episodes (if that) and the rest are nowhere to be found. In fact, CTV had the highest show count of the four apps, but had the lowest “average number of episodes available” count because they just had so many shows that had zero video content.

In addition, there can be some misleading content in these apps. For example, I don’t believe a collection of your season finale episodes count as a “show,” CBC. And 245 videos labeled “Season X, Episode Y,” but are actually just 2 minute clips, do not count as episodes, CTV. Not to mention, certain platforms do not show all content actually available; CBC had a handful of shows only available on their website but not on the CBC TV app.

With “on-demand” apps like this, it would be a great way to reduce piracy of your shows while receiving some advertising revenue. However, you are forcing consumers to either purchase DVDs (which I assume is the reason to not put full catalogues online) or to pirate shows. I would suggest a re-evaluation of how content is provided to consumers, because you are only making it more difficult for us.

Additional Notes

As I mentioned in the opening paragraphs, I only spent time with these four apps. For the sake of full disclosure, you should know that there should have been a fourth: Rogers Anyplace TV. There were two reasons, on my part, to exclude a valid television streaming service: 1) you need a working Rogers account to access the site, which not all Canadians have. 2) even if you have a Rogers account, the tablet app is restricted from you if you are on a monthly plan.

Rogers Anyplace TV

That made no sense, so they were not included.

In addition, I do not hold any of the copyrights for the app icons used in the report card, they are owned by their respective media companies.

You can also find the data I collected here. It contains all of the shows that can be found in the apps themselves, along with episode numbers, and any notes I may have made along the way.

I am happy to answer any questions that might come up, as well as add analyses of any apps that I may have missed.

Thanks for reading!

NOTE: If you want to see the combined report cards, go directly to the Canadian TV Streaming App Report Card page!


The Humble Indie Bundle #5: 5 Awesome Reasons To Buy

I put together a quick and dirty overview of the lineup for The Humble Indie Bundle #5: Amnesia, Psychonauts, Limbo, Superbrothers: Sword & Sorcery EP, and Bastion.

For those unfamiliar with The Humble Indie Bundle: it’s a really great initiative to bring together an assortment of high-quality, cross-platform, independently developed games and letting the consumer set the price they pay for the bundle. Did I mention it’s DRM-free and Steam unlockable as well?

As a consumer, you set the price level of the bundle and then decide how to allocate the money between the three entities: the developers involved, charity, and the Humble Bundle team themselves.

Overall, it’s an amazing initiative for games that you may not have otherwise played, so definitely check it out and pick it up – you’re getting five amazing games, you help support charities, and you have the ultimate power as a consumer.

Happy gaming!

On Saying Goodbye

Tonight, I found out that my grandmother has passed away.

I’ve mentally prepared myself for this since I visited her in the hospital in San Francisco with my family, and yet this is not any easier. I’ve never had to deal with this in my life, so to put it bluntly: this is not easy.

While standing by her side in that hospital, I realized that I was getting angry. Very angry. Angry at the world. Angry for taking a loved one and putting them under such duress. Angry for bringing concern and worry to the lives of her children. Angry for bringing an entire family to tears.

How could the world do such a thing?

And then I took a look around and realized: my grandmother is a part of each and every single member of my family. Her children, nieces, and nephews have all created wonderful families. Each of us possesses a bit of her in our blood, in our minds, and in our hearts, and that will never change.

You are a part of all of us, grandma, and that gives me peace. Please say hello to grandpa for me.

I love you.

Rest in peace, Elisa Q. Lim.

Money, Evil, and Pragmatism

Why not worship money?

At least its rewards are obvious and immediate. But no, that was simplistic. [Their] worship was more subtle, its ethics bound to those traits and habits that well served the acquisition of wealth. Diligence, discipline, hard work, optimism, the personalization of glory.

And the corresponding evils: sloth, despair and the anonymity of failure. The world was brutal enough to winnow one from the other and leave no room for doubt or mealy equivocation.

In this way, worship could become pragmatism, and pragmatism was a cold god.

From: Udinaas, Midnight Tides: Book Five of The Malazan Book of the Fallen, Book 5