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.

CFWheels URLRewriting on Tomcat through Apache

UPDATE
The initial post worked but submitted forms did not. :-/ What’s a web app without form submission? (rhetorical)

So, the configs are updated below and I have tested this locally on Tomcat 7 and on a centOS server w/ Tomcat 6. The issue was with the 2nd to last line and the last. They needed to be swapped. The 2nd to last forces a 301. Swap them…all good! 😀

I really need to stop with the long titles but they are so informative! 😀

This has been a major pain for me and others, it seems. I think I found a solution and would like to lay it out for you and get feedback to see if it works for others as well.

(more…)

Apache Authentication with Proxy

I’m purely pointing to a blog post by Jamie Krug (@jamiekrug), who is getting a huge man hug from me today. It saved me from a firestorm where a dev url was posted publicly but wasn’t password protected (lazy me!). Apache wasn’t playing nice since it passed off the ColdFusion files to Tomcat. Just before I went crazy with Tomcat changes…I found this. I hope it helps someone else.

https://jamiekrug.com/blog/index.cfm/2009/8/6/apache-authentication-with-proxy

CFWheels: Redirecting non-authorized access after login

CFWheels always seems to make me smile with certain features. It isn’t 100% perfect (what is?) but it really makes CF dev fun. In this case, we’re taking a simple scenario of a user attempting to access a non-public url while not authorized to login. It could be from a bookmark or them simply trying to “hack” your system. Either way, once the user logs in they should automatically get to the page they want. Here’s how you can do it in Wheels.

(more…)

Bogus Antennagate Response Videos

I’m overly bored with antennagate to start with but these response videos are annoying me. Yes, I could not watch them but the tech dude deep inside, well…maybe not that deep, is interested in the technology aspect of it. What annoys me is when someone shows the now infamous “death grip” but they are showing the “grip” in a not so normal way. On Twitter I mentioned it looked like they were getting ready to “throw a rock” and after watching a few more…I still feel this way.

I think what bothers me most is folks like @gruber are eating this up and using it as a bullet point to say “see…Apple was right, others suck too” but they are only half-right. Apple was correct about other devices, the industry knows this, but the iPhone is by far worse at exposing the fault.

Just watch some of these videos:

Notice how they have to hold the device to make it happen. People…this is not the same thing as the iPhone 4 where you can use 1 finger to destroy your call quality.

The point is…Apple blew it. No matter how many crappy videos show other devices with “death grip” problems…the iPhone 4, as Jobs stated, put a big X on it to which they can’t take away a free bumper will take away. I’m pleased with Apple’s response (free bumpers; not just us…everyone) as a business person. I thought they did a great job of deflecting but the issue still stands.

Either way Apple will continue to make boat loads of dough but I am willing to bet Apple makes significant changes in the antenna design next year. To save face, I bet the overall structure is exactly the same but they do something to prevent attenuation when held the “right way” this time (different external material around it?).

Why Android blows away the iOS, for me.

I have contemplated this blog post for a couple weeks now (and worked on it for longer), since I first started using my new Evo 4G. The title may read that of a new convert going fanboy over a new toy but trust me…I’ve seriously spent time considering both sides of this coin and I’m thoroughly convinced: Android blows away iOS. Don’t believe me? You don’t have to but I’ll still explain my points. Keep in mind, while reading, this is my opinion and is 100% based on an iPhone 3G vs the Evo 4G.

(more…)

AS3 Tip: Pass …rest arguments w/ other arguments to a function

That’s about as good a title as I could come up with here. 🙂

Background

Let’s say you have a function expecting …rest arguments. Firstly, if you’re not familiar with …rest arguments, read this. Here is a code example of the issue (hand-written and untested):

protected function fun1(...rest):void{
	fun2.apply(null, rest);
}
 
protected function fun2(some:*, thing:*, here:*, ...rest):void{
	trace(some, thing, here, rest);
}
 
fun1("here", "are", "my", "args", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);

This code passes 14 arguments to fun1, which is completely legit. fun1 then passes all 14 arguments to fun2. The trace output would be:

"here", "are", "my", "args", [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

That’s easy, right?  Let’s throw a monkey wrench in this puppy real quick.

The Problem

Taking the previous example, let’s swap the calls. fun2 will not call fun1 and the initial function call will be to fun2. Here is the code:

protected function fun1(...rest):void{
	trace(rest);
}
 
protected function fun2(some:*, thing:*, here:*, ...rest):void{
	var newArg:* = 1;
	fun1.apply(null, [some, thing, here, newArg, rest]);
}
 
fun2("here", "are", "my", "args", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);

Now, you may say: “What’s wrong with that?” To that I’d say: “A LOT!” The monkey wrench is newArg. See, apply(..) takes an array as the second argument which works well unless you’re passing in rest.

The trace would be:

"here", "are", "my", "args", [1, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]

This is very subtle but notice the last part of the trace is a multidimensional array consisting of newArg and the rest argument passed from fun2.

A Solution

This is a quick and easy way to solve this problem. What you want to do is actually pass in every argument in the rest argument as a single argument, not as an array, but we’re still passing in an array to the apply(…) function. Here is one way to tackle this puppy using array manipulation:

protected function fun1(...rest):void{
	trace(rest);
}
 
protected function fun2(some:*, thing:*, here:*, ...rest):void{
	var newArg:* = 1;
	fun2.apply(null, [some, thing, here, newArg].concat(rest));
}
 
fun2("here", "are", "my", "args", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);

Ahh…notice the second line of the fun2 function. we’re passing in an array of arguments and concatenating the rest argument with the arguments array.

Here is the output trace from that:

"here", "are", "my", "args", 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

That is exactly what you want to see, in this case. 🙂

Conclusion

This one just bit me in the butt so I thought I’d blog it to help someone else.

What other ways do you use to solve this problem? I’m sure this isn’t the only way.

Every web developer is now a mobile developer

Ok…maybe it isn’t 1:1 in terms of skills/knowledge but consider the age of today. 5 years ago mobile stylesheets were the rave and were dang near required for every mobile device out there. Now? Nope. With Webkit running rampit on smartphones and smartphones becoming the normal end user phone, with the surge of iPhone and Android devices on the market, there is a shift from doing strict mobile development to making sure your site works on the web and Webkit.

This is pretty key and very interesting in terms of the direction our industry is heading right now. Mobile dev’ is not gone though. You still have a need to provide a scaled down version of your site, depending on what it is and depending on whether you’re using some device that can’t deliver the “whole web” or not (lol; yes, that’s a jab), for mobile devices. I much prefer not having to load non-mobile optimized ads or a two-mile navigation when attempting to load a simple blog, hint hint…mine. 😉

Either way…the point of this post is to have web developers now consider the market and device changes bringing more mobile to your web experience. Consider mobile when building your sites.

Proof, meet Pudding. #stevejobs

Just a quick note here. The videos speak for themselves. They prove the marketing wheel is a big beast and people flock to what is believed to be true vs what is true, reference to Seth Godin’s book as enlightened by @simpulton. Think for yourselves people!

Steve Jobs HTML5 web experience on the iPad
– @iBrent

https://www.youtube.com/watch?v=rfmbZkqORX4

HTML5 vs Flash – Developer Perspective
michaelsv10

https://www.youtube.com/watch?v=aVjIsL8qwNw

Disclaimer:
I in no way am discounting every point Jobs made. He made some good one’s but he is far from being accurate, IMO.

Flex 4 Release Party Preso Recap

Last night I spoke at the AZFPUG and AZCFUG Flex 4 Release party. I am thoroughly happy I did!

What fun it is talking about something you’re passionate about and Flex 4 is definitely something I thoroughly enjoy working in and talking about. With that said, most of what I talked about was pulled directly from Flex 4 in Action. I had my fair share of plugs for the book throughout the meeting. 😉 Hey…it is a great book, biased or not.

Technically something always happens and, according to @nathanstrutz, I didn’t have enough dongles. 😉 I was missing my display connector(s) but thankfully @simpulton saved the day by bringing a couple and one worked. Big props to Ron Haberle for buying one. It wasn’t the right one but the effort must be awarded some kudos.

One example failed to work. It was about rotating an image around the center and the rotate not affecting the layout. Well…I ran the same exact code today…worked! BOGUS! To demonstrate, I put the code online for all to see how it works (view source is included). For simplicity, here is the mxml for the swf:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="https://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" viewSourceURL="srcview/index.html">
  <s:layout>
    <s:VerticalLayout paddingLeft="100" paddingTop="100" />
  </s:layout>
  <fx:Declarations>
    <s:Rotate id="effect" target="{image}" angleBy="45" 
              applyChangesPostLayout="true" autoCenterTransform="true" />
  </fx:Declarations>
  <s:BitmapImage id="image" source="@Embed('images/flex.jpg')" />
  <s:Button id="mybutton" label="Click Me!" click="effect.play()" />
</s:Application>

Other than that, everything was pretty smooth and I filled up 2 hours showing off Flex 4 and Flash Builder 4 goodies. What’s crazy is I had even MORE to talk about. Flex 4 is a beefy upgrade and solves so many problems. It shines a light on the fact that more online tutorials, videos, etc are needed. Ahem…maybe I’ll get some done soon. 🙂

#azfpug and #azcfug, thanks for having me. Catching up with everyone was a true treat. Keep rockin’ guys and keep @simpulton out of the weight room. That dude is lookin’ buff!!! lol

UPDATE

Here are some tweets about the preso:
@lavonwoods – here
@simpulton – here
@bwohl – here and here
@nathanstrutz – here
@alanrother – here

Preso on 4/28/2010: Flex’ing in Phoenix! #azfpug

This is going to be a huge treat for me. I’m flying to AZ for the first time since I left AZ for TX to attendee speak at the Arizona Flash Platform Users Group April 2010 meeting, their official Flex 4 release meeting.

Since I’m friends with the majority of the group, I’ll be pretty informal but still keeping a planned preso together. I like keeping it lose cuz those guys know their stuff and they always have excellent questions/requests of me (remember the Command Pattern in 10 minutes impromptu preso? That was interesting. lol). With that said, it probably will not be recorded but I gladly will if they are OK with that.

Either way…AZ will be bumpin’ some Flex 4 come Wednesday!

Testing @Anywhere

Twitter just launched @Anywhere and I’m testing to see if it works.

@johncblandii
@katapultmedia
@shadowtactics

All of these twitter id’s should now show you a hover box with stats and a follow button. Let me know how it works for you.

iPhone Packager apps are blocked…what next? #331rally?

Aight…Apple’s turned in 3.3.1 and I’ve accepted it. What next?

Adobe has publicly stated they are not removing the iPhone Packager from Flash CS5. This means people will still see the feature. It means they will use the feature. It means apps might still get pushed to the App Store.

The big question for those who are 3.3.1 aware: Should we still build iPhone apps with Flash CS5?

Let’s talk rally for a sec. Oh wait…maybe I should say: Good people of Flash Land…lend me your ears! 😉

(more…)

mxunit 1.0.8 index.cfm is broken

A while back I starting building cfgithub and noticed I was, technically, writing unit tests but poorly. I then took a dive into CF-based unit testing frameworks and finally dove into mxunit. It was kicking my butt! Nothing in it was working properly but I finally got it working perfectly fine. I posted my issues on Twitter how I felt it was “…outdated, IMO…” to which @MarcEsher responded asking how to which I’m finally responding tonight. 😀

At a minimum the homepage should work perfectly fine. Unfortunately, the homepage has some code issues. In order to get this page working, it takes a few tweaks. I’ve posted these tweaks on the the Google Code issue tracker so those guys can get the builds together. It, honestly, looks like quality control wasn’t done on this build before publishing since these are so blatant you can’t miss them.

So…I’m off to see if I can get the rest of mxunit working. We’ll see how well this goes since my last attempt(s) were feeble but mainly because of the mxunit failures.

Disclaimer:

I can write test suites without a problem. That works perfectly fine. I hit walls when I attempt to use the Stub Generator, etc from the /mxunit site (not the .com but the actual site built within the /mxunit folder).