Reminiscing the difficulties of predicting the future or how the iPhone 5 made it all come true

A few year back, at the height of the iPod boom, I predicted its swift demise.
I might have titled this said blog post something like Why the iPod must die!

So back then I was predicting the death of single purpose devices such as MP3 players in general and the iPod in particular. Well… I was wrong, but not all the way. The iPod is still around, but sales are declining. As a matter of fact they have been declining every year since my prediction was made in 2008:

Why do I want to warm up old toast you ask? Good question. Another thing I mentioned towards the end of the aforementioned blog post was about, how I believed, Apple could make boatloads of money, not with the iPod itself, but with the control over the connection mechanism, the 30-pin dock.

Most “i” devices Apple introduced up to iPhone 4S have this connection mechanism. A whole supporting universe of accessory makers has emerged that use that 30-pin standard to connect anything from stereo systems to zebra pattern 3d printers (I made this one up, don’t Google needlessly!).
However, Apple, like Sun, when it missed the JVM for the trees, missed to monetize the 30-pin connector handsomely. While normally very astute in locking in consumers and partners alike, this was a big miss, indeed, for Apple. Also contributing to this was the ease with which people could reverse engineer the connector.

But fret no more, under the guise of improving user experience, Apple introduced the new “lightning connector” and closed this loophole with the iPhone 5. Though I have not heard any of my friends or co-workers ever state that they had trouble or needed a new way to connect, it is now a fact of live that we will have to buy many adapters or replace existing gadgets.

Now, the life of the 3rd party accessory maker has changed drastically as well. No longer can they use simple analog techniques to reverse engineer this. There is an encryption chip specific to the connector that needs to be dealt with. Why would you need an encryption chip in the docking connector? To control its use of course. IMHO this thing is so complicated that it delayed the launch of the promised lightning to Apple dock adapter.
Thus, for manufacturers the only viable alternative is to check with Apple to see what the terms of licensing lightning technology would be. This, in turn, translates into revenue in the future for Apple, and my prediction made many years ago, finally comes true !

Cheers,
B.

NCDevCon 2012: Regional Developer Conference with focus on Mobile, Web, and ColdFusion

Ok. Now it has been a cool four years that the Triangle Area
ColdFusion User’s Group (TACFUG) is putting on a conference NCDevCon 2012
(September 29./30.) for regional developers (everyone is welcome). The user group members are putting
in countless volunteer hours to create a conference for developers that
everyone can benefit from.
Though, as every year, there is some effort to focus the
presentations. This year the focus areas are Mobile, Web, and ColdFusion,
though there is a good selection of general topics as well.
Thus, the conference continues to manage to have broad coverage of
many relevant areas of ColdFusion, Web and Mobile development while also giving
beginners options for hands on sessions.
All this is available for a small fee ($200) compared to $800 to
$1000 of dollars we commonly pay. So this is definitely a deal in light of the
knowledge that is being shared.
I have been selected to do a
presentation on the Mobile side. This
year’s topic is “Design MVC Mobile App Visually In Hours”. I am doing a walk-through
of the Sencha architect tool as well as some other GUI development for mobile.
Lots of demoing so nothing will ever go wrong ;o)
There is still time to book and space available so I hope to connect
with everyone there.
Cheers,
-B

Internet Explorer and the case of the vanishing Forms

So we ran into the problem of a customer’s users’ not being able to use our application. The users happen to use Internet Explorer and IIS (Internet Information Server) and the behavior was intermittend.
We thought, this is a network issues for sure; so we put sniffers on client and servers sides and observed that nothing was conclusive.
Another thing that threw us was that using an alternate browser such as Chrome everything seemed to be working.
When things did not work, however, we saw that IE (version 6 through 9) would not send any HTTP form information along. So even with simple HTML page that had two form fields “FirstName” and “LastName”, we would see through the protocol capture that IE started an HTTP post, but no form fields and values. They had vanished. Poof !
Our further suspicion of maybe a plugin, proxy or firewall stripping this data out was also eliminated and we started staring at each like we are all going crazy. And, of course, we googled. Nothing there either. (Google, oh Google, why did you fail us!)…
Then, a little break, we discovered, that everytime things stopped working and Forms started vanishing, the user had just entered a secured area of the site and returned to an unsecured area. The security access was transparent as IIS was setup to use “Windows Authentication” similar to “Integrated Authentication”; thus, IE was doing this in the background. Thereafter, even if the user returned to the non-secure areas of the site, IE would refuse to send Form data. After more digging we found that this seems to be intentional; we even found an old web-page that descibed this as good feature for IE6. The behavior is this: after, IE authenticates to a site via NTML / Kerberos (i.e. some integrated way), all traffic to that site has to be secured and as part of the security mechanism no plain text form submission is allowed. Great !
The solution to this was to move the secure portions to a seperate site on IIS and thus everything started working as it should. IE was happy, customer was happy, and we could go to sleep.

Hope you don’t have to spent as much time on troubleshooting knowing this.

B.

NCDevCon: Presentation Slides and Code

The NCDevCon 2011 conference is on its way to be concluded. Many interesting and well rounded presentations. Meeting friends from all over again and chatting about the best and worst way of doing things.
I am continuing to be impressed what the team (Dan Wilson, Jim Priest, Shawn Dunning) is able to do with so little resources. Way to go team.

As promised I am posting the links to the slides to my presentations:
Practical Application Security:
Practical Application Security Slides
I posted the code for URLEncoder on RIAforge as open source project.

Client Side MVC with Sencha Touch:
Client Side MVC with Sencha Touch Slides
Download Sencha MVC code. Please review the Readme_first.txt file on how to get this going.

Please feel free to explore code and slides.
The conference also posts the video of the presentations.

Cheers,
 -B.

NCDevCon 2011: Developer Conference coming up Setp 17-18, Raleigh, NC

For the last three years an amazing thing has happened. The Triangle Area ColdFusion User’s Group (TACFUG), has put a lot of blood, sweat and tears into organizing a conference, NCDevCon, that has ColdFusion at its center.

This by itself is an amazing feat; especially given that the large ColdFusion specific conferences are faltering and Adobe, the main source of CF, does not have an independent gathering focused on this topic.

On top of this, the conference manages to have broad coverage of many relevant areas of Colfusion and Web development while also giving beginners options for hands on sessions.

This is a major, major (yes two majors!) achievement. So definetly cudos to the organizers.

All this is available for a very small fee ($60) compared to the several hundreds of dollards we commonly pay. So definetly a deal in light of the knowledge that is being shared.

I have been selected to do two presentations this year on very different topics. The first one on Application Security, I can see eyes already glazing over, nope we’ll provide some practical code here as well.

The other one is on mobile application developement with Sencha Touch and ColdFusion. This one is harder to organize as I have lots of material I am trying to decide what to cut out at the moment.

Hope to see you there.

Cheers,

-B

Facebook and Automatic Granting of Permissions to Applications via Mobile Devices

I make it a policy of conduct not to install any Facebook application or grant any Facebook apps rights to my Facebook account. Call me paranoid (many have).

So, needless to say, I was surprised when I was looking at my settings page under application how many applications I seem to have granted access.

There they were, a little more than half a dozen apps that seem to have access to my information and friends, not remembering, having granted any of them the right to do so.

This baffled me to no end. How did this happen?

Well, the only thing that seemed to be a common pattern for these apps is that I had loaded similarly named application on my iPhone from the Appstore. Ahh, yes, here is where the plot thickens. Thus the best I can explain this is that the terms of acceptance of these apps includes that they can access my Facebook profile. Thus, if they detect the Facebook app loaded on your device they establish connection and register themselves as authorized apps with Facebook.

I might get this all completely wrong, but this is the only explanation I can come up with, since I got this policy of no apps etc.

Yes, some of you may now say that I was too trusting a soul, and this, too, might be true, so I am now checking more regularly to see whether I am being hoodwinked into approving this type of behavior.

I am now checking regularly what the Facebook app settings page looks like (see below) and killing the permissions. I truly wish that FB had explicit lock on this type of stuff as this is very sneaky behavior in my opinion.

As usual would appreciate some feedback.

Cheers,

-B.

tomcat: Another way to connect IIS and Tomcat

If you were working with tomcat and IIS for a while you know things are getting a little long in the tooth. The last principle update to how IIS and Tomcat interact was made in early 2000. In the meantime many changes have occured to IIS and Tomcat with more capabilities added.
So, I thought it would be time to also update the way IIS and Tomcat connect.
I just published a project on RIAForge whose goal is to modernize this part:

Lastest Release Available on Github.

Online Documentation is regularly updated.

Here are some reasons to consider a new connector:
• no ISAPI code
• no IIS6 vestiges or backward compatibility elements needed on IIS7
• all managed code using the modern extensibility framework
• works on IIS6 and IIS7
• speed improvements
• easier control by file type on IIS side
• no virtual directories and virtual mapping needed
• configuration can be inherited to sub-sites and virtual sites
• easy install/uninstall
• support partial stream sending to browser (automatic flushing) with faster response to client
• support both 32/64 bit of Windows with same process and files
• transfer of all request headers to servlet container
• build in simple-security for web-administration pages

Happy experimenting,
B.

XJS: Using the debugger command to start a debugging session

The ability to kick of the an in-line step-by-step debugger was introduced in JavaScript early on. Since before JS version 1.5, I believe. However, practically speaking there were few client-side debuggers that could take advantage of this.
Thus, the use of it has not been heavy even after the more ready availability of Browser development support and in-line debuggers. Today, all browsers support some sort of step-by-step debugger that can be used in concert with the debugger command to more effectively debug code, so perfect time to remind us of this option.

Why would we need to use it?. Let use this snippet as an example:

for (var i=0; i <= 10000; i++) {   
if (i==98) {

debugger;
}
}

Using conventional in-line debugging you would have to set a break-point, then iterate along until you reached the loop condition that you were interested in, i.e. 98. Using the debugger statement, you simplify this drastically.

Expanding this principle into use with ExtJS is easy. Giving the nested nature of much of the ExtJS code and heavy use of complex configuration objects setting breakpoints is sometimes a game of hit-and-miss.
Using the debbuger statement you will still able to halt the execution at the right place even if you did not hit the correct break-point in your debugging tool.

For example:

 1: listeners: {
2: render: {
3: fn: function(){

4: //stop for debugging here
5:
debugger;
6:
7: Ext.fly(clock.getEl().parent()).addClass('x-status-text-panel').createChild({cls:'spacer'});

8:
9: //Kick off the clock timer that updates the clock el every second:
10:
//Would need to be set in application format
11:
Ext.TaskMgr.start({

12: run: function(){
13: Ext.fly(clock.getEl()).update(new Date().format('g:i:s A'));

14: },
15: interval: 1000
16: });

17: },
18: delay: 100
19: }
20: }

Here we can stop when then rendering is activated to investigate code execution further.

The debugger statment works in most browsers, i.e. Firefox with Firebug, IE 8, Chrome. In IE you will have to explicitly put the browser in debugging mode by clicking the “Start Debugging” button in the developer tools.

Happy Debugging,
B.

XJS: Avoiding of Anonymous Functions Example

One of the difficulties one faces quickly using the ExtJS framework is the code organization. Any project quickly grows into a jungle of anonymous functions and heavily nested configuration objects. Hard to read and hard to maintain.
Examples commonly start simple but as soon as more elements are added they turn off newbies. A configuration object spanning multiple screens is not easy to digest, but this is how most online examples are presented. This, according to my informal survey, discourages new developers from proceeding.
This, in my opinion, is one of the greater roadblocks to learning the framework and making scalable ExtJS apps. I understand that changes in ExtJS 4 will introduce a more mature MVC based application framework; however, the examples I have seen are still heavily reliant on multi-level nesting and anonymous functions.
It is of course, a matter of preference, but I do find organizing code written in that fashion harder to read and manage long term.
For once, common mistakes, such as missing a semicolon, comma, or bracket closure, result in disproportionate debugging time. On the other hand, having multiple team members working in their own “sandbox” is hard to do if everyone is trying to change the same file.
Thus, I was looking for alternate organization but could not find a simple example to show that another approach was possible.

Take this common ExtJS code as example (this is a fairly simple example in ExtJS realm). It draws a border layout based viewport:

Ext.onReady(function(){
new Ext.Viewport({

layout: 'border',
items: [{
region: 'north',

html: '<h1 class="x-panel-header">Page Title</h1>',
autoHeight: true,

border: false,
margins: '0 0 5 0'
}, {

region: 'west',
collapsible: true,
title: 'Navigation',

width: 200
// the west region might typically utilize a TreePanel or a Panel with Accordion layout
}, {
region: 'south',

title: 'Title for South Panel',
collapsible: true,
html: 'Information goes here',

id: 'southPanel',
split: true,
height: 100,

minHeight: 100
}, {
region: 'east',

title: 'Title for the Grid Panel',
collapsible: true,
split: true,

width: 200,
xtype: 'box'
// more nested code could be added here, e.g a GridPanel

}, {
region: 'center',
xtype: 'tabpanel', // TabPanel itself has no title

items: {
title: 'Default Tab',
html: 'Tab conent'
}
}]
});
});'

The formatting is nicely done, but still requires some getting used to. Only a few nested elements in this one yet the complexity can be already seen. What if you had a team of developers each working on one of the panels?

I prefer a more verbose but easier maintainable format that achieves the same result while allowing easier developer task separation (the use of multiple script tag is optional, I wanted to show a sense of separation of code):

<script type="text/javascript">
//we define a namespace to use for organization. This is optional.
Ext.namespace('startup');
</script>

<!-- panel definitions could be in another file -->
<script type="text/javascript">
// each panel could be seperate script file maintained by seperate developer or dynamically included via

// app server such as PHP / Railo / etc.
startup.northpanel = {
region: 'north',

html: '<h1 class="x-panel-header">Page Title</h1>',
autoHeight: true,

border: false,
margins: '0 0 5 0'
};


startup.westpanel = {
region: 'west',
collapsible: true,

title: 'Navigation',
width: 200
};

startup.southpanel = {

region: 'south',
title: 'Title for South Panel',
collapsible: true,

html: 'Information goes here',
id: 'southPanel',
split: true,

height: 100,
minHeight: 100
};


startup.centerpanel = {
region: 'center',
xtype: 'tabpanel', // TabPanel itself has no title

items: {
title: 'Default Tab',
html: 'Tab Conent.'

}
};

//assemble panels here into array, alternatly this array could be the items definition
startup.aItems = [startup.northpanel,startup.westpanel,startup.southpanel,startup.centerpanel];

</script>

<script type="text/javascript">
startup.DoInit = function () {

//create view port
var bport = new Ext.Viewport({
layout: 'border',

items: startup.aItems
});
}
</script>


<script type="text/javascript">
//the actual ExtJS onReady function remains very small
Ext.onReady(function(){
startup.DoInit();

}); //end onReady
</script>

Of course, there is the element of preference and argument about throw away functions, e.g. only run once; I would still prefer good naming and definition as this is the long run makes my life easier.

Feel free to comment.

Cheers,
-B

XJS: Sencha 2010 con impressions

I am attenting the Sencha (formerly ExtJS) developer conference to learn about the future. Overall good energy at this conference. Definite feel of excitement about product and company from the developer community. Here are some early impressions:
  • Lots of activity since the company got funding
  • Company is trying to grow up and it shows: products are beeing build out, revenue model is being decided on / experimented with, business processes look raw around the edges. Overall this puppy is growing up.
  • Sencha has many projects in the cooking pot with some very innovative ones in the mix while still putting good improvements into the existing ones. The question will be, is the company going to be able to pull all this off or are they overloaded. Deliveries could slip, quality could suffer etc.
  • Their bread and butter ExtJS 4 is getting a dose of good overwhaul inlcluding things I have been griping about for a while. The main thing for me is that a best practices application structure is now supported out of the box, so you can finally organize your code for larger apps in a meaningfull way. (Yeah!!!) . My impression is that there are still some challenges to overcome with backward compatibility which they are working on. Many more good things of course, hope they can pull it off.
  • The developer interest is increasing, 3 x the number of developers attended this year.
  • Keynote from at&t cto John Donovan (he loves all phones and all people, yeah very politically correct answers all the way). The nugget from him was the statement that HTML5 is a viable application plattform and mobile apps will be written in it more the future and at&t will support it on many devices with native device library connections. If you believe this, the future of Flash and Flex would look limited. Another conference attendee said “Adobe is the dead man walking”. Wow!
  • The Sensha touch platform for mobile apps is going to be free. Cool.
  • Common Annoyance: “It works in webkit” myopia. Understandably browsers supporting HTML5 are cooler from developer perspective but many examples given did not work or broke when another browser was used (Firefox, IE). This is poor for any platform claiming universal compatibility. Hopefully this will improve next year.
Cheers,
-B