Friday, August 12, 2011

DOM Button Elements

While working on one of my projects I ran into a problem using the javascript:history.go(-1) script in an onclick event handler. After clicking the button my page wouldn't change.

After spending a while trying to figure why Chrome was the only browser to do this, my friend Jeff and I discovered the cause of our problem was the <button> tag. After further investigation we found that <button> by default has its type set to "submit" which causes postback behavior.
In order to work around this you have to specify the type as you would in an form input field: type="button".

We noticed in Chrome at least, that the button didn't cause any postback behavior when it wasn't wrapped in form tags.

Tuesday, July 26, 2011

Propel ORM

After searching for good database abstraction systems for PHP I found a cool ORM called Propel. Some stuff that interested me right off:
  • Ability to gen data access classes right off of an XML schema
  • Simple structure
  • Awesome syntax
Anyway, on my path to being a Propel expert (right...) I ran into a few snags. At first, after not reading the dependency requirements, I fought to get a local pear installation working. After not being successful with that installation I read through the documentation again and saw the only required dependency was Phing.

I followed Phing's non-pear installation instructions and then followed Propel's non-pear installation. When I went to execute the Propel generator batch file it said it could not locate 'phing.bat.' After opening the batch file I found this line:

22 if "%PHING_COMMAND%" == "" set PHING_COMMAND=phing.bat

I changed it to:

22 if "%PHING_COMMAND%" == "" set PHING_COMMAND=[MyPathToPhing]\bin\phing.bat

After doing so... I ran the batch file again and ran into another problem, it was saying it couldn't find some of the files required to run Phing. This was because the environmental variables required to run Phing need to be added to the batch file phing.bat. I added these commands to the top of my phing batch file:

set PHP_COMMAND=C:\php\php.exe
set PHING_HOME=C:\phing
set PHP_CLASSPATH=C:\phing\classes

And... whala, it worked!

XOOM vs iPAD Part 2

Due to overwhelming requests our company decided to purchase iPads instead of Xooms.

We still feel Android's interface is less user-friendly than iOS. We've also seen several problems with the XOOM crashing in the operating system's built-in modules. Android's built-in browser also has noticeable screen lag when inputting data via the virtual qwerty keyboard. Despite flash support, several multimedia websites such as Hulu and Netflix won't run on the XOOM due t copyright agreements.

Some of the major benefits we saw when shopping for the XOOM are quickly fading. SD external storage, for example, seems much less useful when you can sync files over wifi. I've had my XOOM for about 2 months now and never saw the need to use this feature.

Hopefully Android will step up and make their operating system more robust. Presently it seems it was rushed into the consumer market before a stable OS environment existed.

Friday, May 27, 2011

The iPad, the Xoom, and the Trash Can.

My department has recently been assigned the task of determining the best tablet solution for our organization. Due to the fact that the ASUS eee Transformer has been out of stock everywhere, we decided to test out the iPad 2 and XOOM tablets.

Coming from previous experience with iOS I was a little biased and confused when I received my XOOM. Despite the definite advantages the XOOM offers ( expandable storage, open file downloads and application installation, and desktop widgets ) I was disappointed by Android's user interface; it felt anything but intuitive and there was next to no documentation to explain it.

The quality of Android 3 applications also diminishes the appeal of tablets supporting this operating system. I have never seen so many applications crash, and so many applications with pitiful functionality and user interfaces.

Unfortunately the only hope for the XOOM is that application developers step up their game. We've already found several high quality applications for the iPad and hope to see them on the XOOM in the near future.

iOs Applications we like:
  • Quick Office Pro - Word processing, presentations
  • iAnnotate - Note taking, allows you to highlight sections of PDF files
Android Applications we like:
None currently

Wednesday, February 23, 2011

Forcing canonical hostnames

Due to the restrictions of WCF services I was sent on a quest to find out how to manage allowing and It wasn't as easy as I had hoped until I found this article.

I have seen all over the place that it is best practice to force canonical host names. This means should be redirected to The problem with simple redirection is that it doesn't appear to redirect query strings so old links will break on you if you just use 301 redirects.

I asked around and found out you can accomplish redirection and keep query strings using the rewrite module for IIS. You can download it here.

The module simply sits in IIS's main features view. You can easily set it up to redirect all of your pages to using the following settings:

Wednesday, February 2, 2011

WCF Service References

Today, I learned how much of a pain it is to deal with back-end security and Ajax. Not liking the idea of exposing my data using JSONP I decided to create a WCF service that I could call through an MVC model/controller.

It was a major pain in the butt.

I am still not sure about the security modes as I am very new at WCF but at least I got it functioning. One thing I discovered is if you are disabling security in wsHttpBinding's you need to include this: <servicesecurityaudit messageauthenticationauditlevel="None"> under your behavior and then add


        <binding name="wsHttpBinding">

          <security mode="None"/>




I just did this for testing purposes and will definitely get it changed when I decide what authentication mode I want.