I’m John C Bland II

Husband, Father, Tech Author, Deacon.
Founder of Katapult Media, and full-stack polyglot developer.
Political Free Agents Podcast Host.

I create. I launch.

YouTube Channel

I post regular fun on YouTube like me playing the bass and anything else I find fun. 

Get Something Built

All project work goes through Katapult Media. Business is open. Let’s chat.

OSX Lion: Scrolling

I figure I’ll start blogging more since I’m off Twitter, for the most part, and what better way to kick off blocking again than to talk about my latest “toy”: OSX Lion.

Scrolling is weird on Lion but I truly think with time it will be natural. I get the change though. Everything about Lion is iOS’esque. Look at the animations, Mission Control sliding [aka Spaces 2.0], Launchpad, and scrolling.

In Lion when you slide your finger down on your trackpad or Magic Mouse it pulls the page [or app screen] down. When you slide your finger up it pushes the page up.

It isn’t scrolling, per se. It is more like you’re grabbing the page and moving it in a natural way. If this was a physical page I was writing on write now and wanted to see the bottom, perhaps covered by a book, I would take my finger(s) and push the page up.

That’s how scrolling in Lion works. Apple was bold with the change [I’m sure some folks, including myself initially] ranted about it but I truly think it will become my preference within the next week.

How do you like the scrolling?

Mizzou Football: Wallpaper

Yeah, I’m amped up to start playing NCAA Football 2012. Before I begin I have to get my game tight by having a wallpaper on my backup MacBook Pro [employee uses it mainly but I slide over to it every now and then].

So, I thought I’d share it here as well [as G+]. Let me know what you think. 🙂

OSX Lion Gotcha! – /etc/hosts file

I had the hardest time setting up Mura today on my 2008 MacBook Pro. It wasn’t even the fault of Mura, Apache, or Tomcat/Railo but of my hosts file.

This post got me over the hump: Mac OS X Lion /etc/hosts file.

What a weird change. I also hit a wall with some Apache config file changes but I’ll fool w/ those later.


Due to the linked site not working any longer, I am copying the post here. The original post is from Gargoyle’s Blog.


Just doing some early testing with Lion to make sure I can get all my dev environment up and running and have just came along a little quirk.

This is how the default hosts file looks:-

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1	localhost

255.255.255.255	broadcasthost
::1             localhost
fe80::1%lo0	localhost

Nothin unusual. However, if you are used to adding lines like:-

"127.0.0.1 local-test-app"

to the end of the file, then it might throw you off a little bit as it seems you now have to have them above the fe80::1%lo0 line.

PHP Quick Tip: Pretty Debug Printing

I’ve been using this for years [circa 2002] and in helping a friend with some PHP probs I pulled it out of my code vault to share and figured I should put here.

function dump($var){
	print "<pre>" . print_r($var, true) . "</pre>";
}

This will print an array in a vertical layout as opposed to a horizontal one. Keep in mind there is a pre there [Wordpress isn’t playing nice so replace html equivalent values, lt and gt, with an actual less than/greater than symbol] so you could add a class to it so you can style your debug, float it, or do whatever.

Here is an example of using the file:

function dump($var){
	print "<pre>" . print_r($var, true) . "</pre>";
}
 
dump($_GET);

I put this code in dump.php, loaded https://localhost/dump.php?x=1&y=2&z=3, and here is the output:

Array
(
    [x] => 1
    [y] => 2
    [z] => 3
)

Two great versions came from this function by my friend Guillermo A. Fisher (@guillermoandrae):

/**
 * This function prints information about an expression.
 * Elevate specialty ;).
 * @param	mixed	expression to be dumped
 * @param	boolean	whether or not to dump detailed information
 * @return	void
 * @access	public
 */
function dump($expression, $verbose = FALSE) {
	if ($verbose) {
		echo('&lt;pre style="text-align:left"&gt;' . var_dump($expression) . '</pre&gt;');
	} else {
		echo('&lt;pre style="text-align:left"&gt;' . print_r($expression, TRUE) . '&lt;/pre&gt;');
	}
}
 
// ------------------------------------------------------------------------
 
/**
 * This function prints information about an expression and stops script 
 * execution. Another Elevate specialty.
 * @param	mixed	expression to be dumped
 * @param	boolean	whether or not to dump detailed information
 * @return	void
 * @access	public
 */
function fatal_dump($expression, $verbose = FALSE) {
	die(dump($expression, $verbose));
}

All of this came out of working with one of my favorite design firms Elevate.

I hope this helps someone. What are your ways of dumping values to debug your pages?

Flex Quick Tip: UrlRequest Basic Auth

I am building a mobile app [will release soon] and Basic auth is required but all the normal approaches were failing on my devices until I started looking through the available UrlRequest properties and wound up finding a gem.

URLRequestDefaults.setLoginCredentialsForHost(host, username, password);

Yes, I’m serious. No more Base64 encoding, appending text, etc to authenticate a UrlRequest. Know this is only for AIR 1.0+ but that means it works for mobile. 🙂

There isn’t anything special required. Just call the method with the appropriate details [host means domain name not protocol (http, https, …), etc]. Peep the docs and enjoy!

Railo Consulting FTW

For starters, I’m no server guru. I know some things and can get ColdFusion [Adobe/Railo] setup w/ ease but will it be optimal? Nope. This was proven true with a recent launch. I went with a general setup of Apache 2 -> Tomcat [via AJP] w/ Railo.

Most of my problems came, unbeknownst to me, by way of Apache being outdated and using the prefork mpm [opens a whole new Apache to cover requests based on your settings] vs the worker mpm [threaded; opens new threads only, not entire Apaache instances]. 2.2.3 was installed which used an older AJP module and by default used prefork. Simply upgrading to 2.2.16 wasn’t the push of a button or clicking of a few keys because centOS [via Yum] only grabs specific versions; in this case, 2.2.3. With a botched launch and days of outages for the next week+, I spoke with our team about bringing Railo Consulting in to fix things up.

(more…)

Where Android blows itself away, for me.

This is a follow-up to my Why Android blows away the iOS, for me. post. It covered my basic loves for the things I first saw in Android and loved! All of those points are still valid and honestly I still think Android beats iOS, IMO. (Don’t worry iOS fanboys fans…I’ll briefly explain what I mean shortly.)

After almost a year of use on an HTC Evo, I have come to learn a few things about the Android life. Many of them I love…some I loathe! This post focuses on the loathing part. 😉
(more…)

Site Moved

So, I finally got around to moving the site to @MediaTemple’s (gs) service. I’ve wanted to do this for quite some time but since I commented on @gruber’s posts every now and then I really wanted to just to make sure I didn’t get “fireball’ed” [site crash due to too much traffic]. 🙂 lol.

Jokes aside…I’m a huge fan of @mediatemple and their services. Eventually all of my personal and all @katapultmedia sites will be on @mediatemple.

Aight…1st post on the new service is done. I’ll have a new post up soon w/ details on why I’ve been so quiet. 🙂

BlackBerry Playbook may be a hit…start dev’ing!!

I’m impressed. BlackBerry devices have never been a desire of mine but I find myself seriously considering putting my Galaxy Tab and iPad desires on hold to see where Blackberry stands price-wise.

What’s most impressive is the Playbook runs on the Adobe AIR runtime. This means AIR developers are 90% prepared to build these apps. I give the other 10% to learning the dev approach [simulator, signing, sdk, etc]. I predict the Playbook as being a big deal very soon.

I wanted to post links to dev resources so you can get started developing or porting current apps to the Playbook:

  • Flash Platform Development for BlackBerry Tablet OS [link]
  • BlackBerry Developer’s Blog [link]
  • Tablet OS SDK for Adobe AIR [link]

That’s a great start but what is even better is the promotion RIM is running to help entice us to start dev’ing Playbook apps: BlackBerry PlayBook Developer Promotion Information. Here is the skinny on the promotion:

“…the plan is to provide one free BlackBerry PlayBook to every registered vendor with a BlackBerry App World-approved AIR application that is available for the BlackBerry PlayBook prior to launch.”

Now, who says the Flash Platform is going to die? 😉 Rock on RIM!

Flex 4 in Action – Hot off the press!

IT’S ALIVVVVVVVE! 😀 Go get it!

Writing is a beast. It is truly a long road but it is well worth it for this moment right here [well…royalty checks aren’t bad either; lol].

This book will enhance your knowledge. There is some really great information in there to pull your Flex 4 skills to top notch. The goal is to take you from Beginner to Winner in ~25 chapters.

If you’d like to discuss the book, visit the forum.

Also check Dan Orlando’s thoughts on the release.