Mostly about my amusement

Year: 2012 (page 3 of 3)

Old content! Now in 3D!

The guys over at Wired re-published their old review of The Phantom Menace but with a difference. Using CSS and duplicating the content they were able to apply a 3D effect.

It’s readable if you have the glasses. And of course, I do have 3D glasses.

Naturally, I tried to do the same just for giggles. I was able to duplicate the content in both red and blue, but the entire container div uses “position: relative” so the height needed to be set manually.

That can be read as: I haven’t figured out the CSS to dynamically overlay text content on top of each other without the comment box sitting on top of the text. I can’t do it the same way as they do at Wired.

Google to the rescue! To get the effect I wanted, I’m using CSS to color the paragraph fonts a shade of blue while making the offset text-shadow red. For links I reverse that so they look different. It’s not a lot of CSS and if you apply it you better have your glasses ready. It’s easy to do but probably doesn’t work right with old browsers.

Forget old browsers. I opted for this simpler method and put the solution into a plugin.

The plugin inserts the necessary CSS into the head and when a post is tagged “Phantom 3D” the_content gets wrapped in a div  with the CSS class “redblue-text”.

Here’s the “Now in 3D!” part

  1. Download, install, and activate a copy of my plugin. It’s a zip archive with one file in it.
  2. Find an old post on your blog and edit it just by adding the tag “Phantom 3D” to the post. The spelling and case are important, the P and D have to be capitalized in the tag or this wont work.
  3. Poof! You’ve just brought new life to an old subject.

For purposes of readability I have not put that tag on this post. Not everyone has 3D classes by their PC.

But I do have an old post titled Adding Slimstats to WordPress from 2007 and that’s a good candidate.

The info in that post is horribly outdated (I mean come on, I recommended editing wp-config.php) and totally unnecessary these days. As indicated today in the comments, there are just better ways to implement Slimstat in WordPress that are supportable.

But we all know that by adding 3D everything is improved. I’ve made that post new and exciting not by updating the content but by simply applying a special effect.

If that’s good enough for George Lucas, then it’s good enough for me. 😀

The best support topics are the ones where I have to stretch

I spend time browsing the WordPress support forums to help out. The majority of requests are from new users who have a problem with a setting, they changed something they shouldn’t have, or an update broke their site.

It’s a very popular software platform and while mundane requests aren’t exciting, when you provide good answers you’re helping someone out. That’s a very cool thing. The answers provided there give someone an assist so that they can get out of a hole they put themselves in.

But the most satisfying topic is when someone is asking how to do something and I have to figure it out to support them. Especially when it involves something that I’m not too good at.

I’m a huge fan of child themes and I use them here on this blog. So when someone asked about modifying the Coraline theme, I was curious enough to ask for clarification. When the person explained by example and I saw that it was related to CSS, I got to work.

Using my test installation, I created a child theme for Coraline. I already had a copy of that theme and I started with what I already knew of CSS. I was close to getting it working but ended up searching via Google for the rest.

Armed with some new CSS information, I was able to get the my test install working satisfactorily and posted the solution. Total time spent was a little over 45 minutes.

Does that seem like a lot of time helping a stranger? It’s not.

I knew that what they were asking for was doable, but I’m horrible at CSS. It’s a creative thing for me and I’m just not good at it. But by helping that person out I was able to learn something new and stretch my own skills a little.

That’s how I learn, doing things that are outside of my experience. My little contribution is not earth shattering but it might help someone out and being able to pickup additional CSS is a bonus.

There are many really talented web designers that fully comprehend CSS and my own level of expertise will not match that. But by my accepting that forum topic as a challenge, I understand a little bit more than I did the night before.

Here’s the reply to my small effort.

You’re a genius, seriously. Thank you!

Concise, I like it. That’s not a bad result at all.

Kodak BW400CN Film

Just for comparison, I ordered two 36 exposure rolls of Kodak BW400CN film. This is a black and white film that, like Ilford XP2 Super 400, can be developed anywhere using the C-41 process. That means cheap film development at Costco.

Somehow the Kodak B&W film is cleaner. I’m going to explain it poorly, but the Ilford comes out developed with dust particles. Not every frame but some do.

At first I thought it was just a bad day at the developing machine but it’s not that. Every Ilford Super XP2 400 roll I have used has samples where you get that look of scratched film or small particles of dust.

I don’t mind it as it adds character, but the Kodak doesn’t have that. It generally looks sharper and cleaner to me.

Shooting in B&W remains a surreal experience. It’s not like using Photoshop to make the image black and white, it’s got a separate character to it. With digital photography I almost always do some adjustment. It’s an automatic part of my process and makes for better images.

Not so with film photography. Even though it’s digitized and modified by the developer/scanner I never make adjustments. I don’t crop or change anything although I have re-sized the images for presenting here.

I’ll keep ordering both B&W films but for now I think I appreciate the Kodak more than the Ilford version.

Force logout Mac users

Yet another one of those write this down Jan, it will come up again posts. There’s almost certainly a better way to force log out absent users on a Mac but heck, this works for me.

To kill off all the processes of a user named joe who’s left logged in but used the user switcher, open up the Terminal app and run these commands.

sudo su -
ps aux | grep ^joe | awk '{ print $2; }' | xargs -I{} kill -9 {}

In my kitchen is the community iMac and I have set up accounts for my whole family. Sometimes people come over and forget to log out but used fast user switching to go to the login screen or a different user.

That’s not too bad, but some software combinations I’m running often take up lots of CPU needlessly. Yes, Firefox and Adobe Flash I mean you. The whole iMac becomes slow and unresponsive.

That makes for a sad Mac. More importantly at 5:30 AM it makes for a sad me. As long as you know Joe’s user id then this will zap all of his processes and log him out as a result.

If some of those processes are stubbornly cling to life then rinse and repeat.

Holga 120 CFN for Christmas

For Christmas, one of my brothers gave me a Holga 120 CFN. This is a camera that takes 120 film and is entirely made out of plastic. Even the lens element is plastic.

Considering my infatuation with older film cameras, this really was a great gift. I’m always looking at eBay for a new vintage camera and this one is in that spirit. It’s all plastic; I’d never have bought one myself. But trying out 120 film was fun and I enjoyed shooting with it.

The Holga and the whole Lomography shoot-from-the-hip idea always struck me as silly. Switching to film still means you should still compose your shot and think about framing your image. While some out of focus images can be insightful, Lomography seems to me to be based on light leaks and poor photography.

That’s not to say that you can’t get good shots from one of these cameras, and I do admire the gallery. It’s just some of the examples look like the photographer wasn’t really trying.

After shooting a couple of rolls I can say that my opinion has been changed. The Holga is just for fun and intentionally taking soft picture is part of that.

This model comes with a built-in flash with color filters. You rotate the dial and get red, yellow, blue, or plain white. For black and white I used the white flash, for color I liked the yellow filter.

With 120 film there are two mask inserts, one for 6×6 cm and another for 6×4.5 cm. The 6×6 gets you 12 shots and the 6×4.5 gets 16. My first two rolls were shot with the 6×6 and I haven’t developed the 6×4.5 rolls yet.

Once thing I really need to watch out for is double exposures. On my 35mm cameras, the film advance cocks the shutter and you can’t take more than one exposure. On the Holga, the shutter and film advance knob are not mechanically connected. You can expose the same shot multiple times and that ability is part of the appeal.

I ruined a few of my B&W T Max shots because I hadn’t realized that I had already exposed that film. That’ll teach me to pay more attention.

Overall it was fun but I don’t expect this to replace my Olympus Trip 35. When the weather gets warmer I’ll take some outdoor shots with my remaining roll.

Using WP-PageNavi with the Elemin theme

Update: Added a conditional to ensure that wp_pagenavi() runs once.

The Elemin theme has it’s own built-in page navigation after the posts. It’s attractive, but not quite as flexible as the WP-PageNavi plugin. With this plugin you can put a page counter, link to the start and end pages, etc. It’s a cool add-on and I’ve gotten comfortable using it on my WordPress blog.

Adding support for that plugin to Elemin can be done simply by creating an includes directory for the child theme, and copying the elemin/includes/pagination.php file into the child theme includes directory. You then modify the copy with the wp_pagenavi() code and due to the magic of get_template_part() the child theme will pick that up.

Modifying a copy of a parent theme file isn’t too bad and that file is very small. But that’s not a very interesting solution. What’s more fun is to add support via hooking into the loop.

I’ve made many modifications to my child theme and not once have I had to copy and/or modify one of the parent theme files. For me, that’s the whole point of this exercise: creating a child theme that only uses functions.php and CSS.

So far using that method for this child theme I’ve been able to do the following:

  1. Add a random header image
  2. Made some CSS changes including a page background
  3. Added a fix for Internet Explorer 8 issues
  4. Created a front page view that shows the full content and then the excerpts and without using a front-page.php template

I’m having a great time doing it too. WordPress is very extensible and I’m picking up more and more PHP knowledge as a result of playing with my WordPress blog.

Here’s how I added support for WP-PageNavi to the Elemin theme. Read more