Jul 22 2010

jQuery: Novice to Ninja

I was recently given the opportunity to fly to Florida and hire people to clean up oil from the BP spill. Given that I had some long flights (I live in Salt Lake City, UT) I picked up a Nook from Barnes and Noble and had on my computer a copy of jQuery: Novice to Ninja. What better way to spend my flight time than reading a jQuery book! So I dug in.

I have been using jQuery both professionally and personally for about a year now but this book still brought a lot to the table.

Earle Castedine and Craig Sharkie have a great sense of humor, and obviously know their way around jQuery, CSS, HTML and the likes. The book uses some real world examples of creating image galleries and user interfaces. They break down the jQuery code to it’s basic forms, and then explain why things work the way they do. They don’t get too deep into Javascript except to note that jQuery is nothing more than a fancy framework on top of Javascript and uses Javascript for everything! I thought it particularly neat when they would show the “hard” way to do things, then the better way to do them, and then finally a plugin that made all the work you had just done seem useless, but it isn’t useless because you now understand how the plugin works better than if you had just slapped it in place in the beginning.

The book is quite deep about animations, AJAX actions, DOM manipulation and the sort. Even if you know Javascript and you have been using jQuery there is something in here that will make you go “ah ha!”.

To the folks over at SitePoint (an O’reilly company) good work!


Jun 4 2010

State of Zend Framework 2.0

Matthew Weier O’Phinney has posted about the State of Zend Framework 2.0:

The past few months have kept myself and my team quite busy, as we’ve turned our attentions from maintenance of the Zend Framework 1.X series to Zend Framework 2.0. I’ve been fielding questions regularly about ZF2 lately, and felt it was time to talk about the roadmap for ZF2, what we’ve done so far, and how the community can help.

He goes on to talk about the processes being taken to get Zf2.0 the exemplar of PHP 5.3 and to add namespaces to the project. He talks about his team, the road map and the struggles they have already expereienced:

After completing this process, my entire team — all three of us — started the work of migrating the code to namespaces. Ralph wrote a tool that scanned the library and created a map file of existing classes and suggested namespace/classname combinations. We then used this tool as a launching point for the migration, each of us working on a component at a time. This work was by no means automated — we discovered very quickly that such a tool only took care of the most cursory work. I detailed some of our findings a couple months back; we ran into a number of issues we never anticipated, and the progress has been far from speedy. At this point, however, we have migrated everything but theZend_Service classes, the MVC, and those components that build on top of the MVC (Application, Navigation, Form, etc.).

Finally he shares details about getting ZF2.0 available through Git and Github, and what the community can do to help:

A number of contributors are also starting to discuss rewrites and refactoring of components. Much of this is being done on the zf-contributors mailing list, and some on the #zftalk.dev channel on Freenode. If you are interested in contributing, I highly recommend subscribing to the list and dropping into the channel when you can.

You can read the post in it’s entirety at  http://weierophinney.net


Jun 3 2010

#hackUTOS June 2010

Ceiling Cat

Ceiling Cat

Ceiling Cat announces:

#hackUTOS is is happening tomorrow, Friday June 4th, at CoffeeConnection!

Here’s how it works. #hackUTOS is a gathering of the hacking inclined. There is a main project (ConMan) that is being hacked on for the purpose of volunteering for Utah Open Source Conference 2010. More details on ConMan in a minute.

If you are looking to generally gather with geeks then this is the premier event in June for your geekiness! We will be gathering at CoffeeConnection who has great caffeinated beverages for sale (as well as food) and we will be getting our Geek on.

Want to get your geek on, but can’t make it in person… we are going to be on IRC too! Find us on Freenode at #hackUTOS

If you are not interested in hacking on ConMan, we still encourage you to come on down! We want all geeks to come by and share in the glory of #hackUTOS. That means you can even bring your own project. Think of #hackUTOS as a Jelly or CoWork (for 1 night). Come share your project and your ideas, find people, network, and generally have a good time.

Now some details on ConMan!

ConMan is the Conference Management software used by UTOS for the UTOS Conference. It is written in Python, using the Django framework. It is hosted at GitHub and it is open to the public. If you don’t hack python do not turn and run just yet. We are in need of things besides python coding. We need folks who are willing to conceptualize, we need graphic designers to help make the app look pretty, we need people to help with bug reporting, and more. If you are reading this blog post you are more than qualified to come help us tomorrow (and at any other #hackUTOS event).

Alright… I am tired of typing, and Ceiling cat is starting to freak me out… see you at #hackUTOS


Feb 26 2010

Come Support Open Source!!!

Geek Lunch

Meet at the nearest location to you at 12:30pm this Friday, February 26, 2010.  If you have never been, look for the group with this logo at their table.  Geek Lunch is organized by the Utah Open Source Foundation, but you must pay for your meal.  We look forward to seeing all of you there.

When:

Date: Friday,February 26, 2010
Time: 12:30pm – 2:00pm

Where:

We have geeks all over Utah, and as such we like to spread the love to more than just 1 pub, so we have two (because Utah county is slacking) locations to choose from.

Salt Lake County
The Green Pig
31 East 400 South
Salt Lake City, Utah 84111
Website: http://www.thegreenpigpub.com/
Map: http://snipr.com/uhhox
Phone: (801) 532-7441

Weber / Davis Counties
Roosters
748 Heritage Park Boulevard
Layton, Utah 84041
Website: http://roostersbrewingco.com/
Map: http://snipr.com/uhizp
Phone: (801) 774-9330

Utah County
There is currently no place planned for in Utah county due to low turnout.  If you would like to help organize a Geek Lunch in Utah county, please email clint@utos.org.

ConMan Hack Night

Did you attend UTOSC last year? Are you going to attend this year? Did you like how the process to register and attend was super easy? That is all thanks to ConMan, the Conference Management software that the Utah Open Source Foundation created, and maintains.

If you want to make sure things stay smooth at the conference, and participate in an open source project then you are invited to come down and help us code the project to the next milestone!

Where:

Salt Lake Coffee Connection

1588 South State Street, Salt Lake City UT

Directions

When: 7pm – ??

You see the ?? means you can come and code as late as you want! The coffee house is open really late, and you are welcome to stay and code till they kick you out!

What:

So we get together each week to work on the project, cause we think ConMan can be the best conference management software ever! We simply would love to have some more people who love open source, and know python and django come down and contribute to the code base!

http://saltlakecoffeeconnection.com/map-directions/

Feb 16 2010

PHP, Soap and WSDL Caching

Today I was offered a free lesson in how PHP handles Soap, and more specifically WSDL caching.

When you instantiate a PHP Soap Class you pass it a WSDL (Web Services Description Language) and it looks like this:


$client = new SoapClient('http://example.com/services/thescript.php?wsdl');

Depending on how your caching is setup, this will go out to the WSDL provided, pull in the document and store it in a cache. The default cache for PHP is 86400 seconds. If you are familiar with time in seconds you know that that is 24 hours. So by default you only actually read the WSDL once in a 24 hour period. Normally this is not a problem.

What is a WSDL?

For that answer let’s turn to the W3 site:

WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information.

So in English that means it is a map to the services provided by the provider. Basically you get a copy of the map, and follow the endpoints to the answers you need.

One basic function of this is that it tells you want methods (services) are available on your fresh client.

When WSDLs go bad

So today one of my providers, without warning, updated their WSDL. This wreaked havoc on my system because I had cached the WSDL on my side for 24 hours (remember, the PHP default). The change was a super simple change, a change in URL for a service, that’s it!

The problem was that since PHP had already read the file within 24 hours it didn’t care that there was a new file, that the URLs had changed, and so it continued to work as it had before.

The real problem wasn’t that the URLs changed, that would have been fine if the provider hadn’t shut off the previously reported URLs.

Turn off the cache

So you are left with two options when something like this happens. First, you can sit and wait up to 24 hours for the problem to fix itself. This was not an option for us. The second is to clear your cache and try again.

Now PHP (on Linux) stores the cache for the Soap WSDL in /tmp and I wasn’t sure which one of the many files was the actual cache for this particular provider so I decided I would have to tell PHP to not cache the WSDL and try again.

Into php.ini I went, located the soap.wsdl_cache_enabled flag. I changed it from 0 to 1


soap.wsdl_cache_enabled=0

I saved the file and restarted Apache.

The service continued to fail. I was perplexed. I thought maybe I flubbed the save so I opened the php.ini again located my line and it was fine. So I looked around there to see if maybe I missed another important flag. The only thing I could find was soap.wsdl_cache_ttl listed as the “(time to live) Sets the number of second while cached file will be used instead of original one” I promptly changed this to 0 as well


soap.wsdl_cache_ttl=0

Restarted Apache, and finally my script stopped failing.

I have since re-enabled my cache ttl and enabled flags, as reading the WSDL every time is a resource hog that doesn’t need to be in place.

The Lesson Learned

The lesson learned by all today is be aware of your caching, and be aware of the changes you make to your live/production systems.


Jan 20 2010

PHP and Josso – Transparency Rocks!

Bogdan recently asked in my comments:

I can’t seem to find a call like josso_authenticate($name, $pass), returning an array to be appended to user’s SESSION. I was expecting such a method, because SOAP is already used everywhere, so it shouldn’t be too hard implementing this.

Has anyone had success implementing this kind of “transparent” login?

JOSSO simply doesn’t make it easy to log people in with a single call. Instead you need to make an interface to the API to do so. I just so happen to have an example of such a wrapper function.

Continue reading


Jan 11 2010

Let’s Get Open!

Being that it is Monday and I am really not feeling it today I thought I would dig up what is happening around the nets and share with you.

Chrome OS Zero

Looks like Hexxeh has been hard at work getting a cleaned up version of Chrome OS called Chrome OS Zero out to the masses. Reading through the Wiki and FAQ things look pretty nice and clean. I may take a stab at playing with this in the next week or so. Thanks Hexxeh!

Droids

Tim at CTRL-ALT-DEL Comic has this silly for us today:

Thanks Tim!

Nexus One

We all know about Google’s latest move in the Android field by now, right? Well it looks like the Nexus One is selling well, and people are having problems with the 3G service that T-mobile is offering on the Nexus One. Being a T-mobile customer myself I can tell you the problems are not limited to the Nexus One. My phone refused to stay on 3G this weekend too, oh well.

PHP

References

Johannes Schluter discusses how references in PHP work, and suggests that maybe we should not use them anymore.

Last year I spoke at eight conferences and attended a few more multiple times at most of them I found myself in discussions about references and PHP as many users seem to have wrong understandings about them. Before going to deep into the subject let’s start with a quick reminder what references are and clear some confusion about objects which are “passed by reference.”

Patterns

Giorgio Sironi has two new blog posts about patterns in PHP. The first is on Abstract Factory patterns:

The major problem that creational patterns try to solve is that objects need collaborators: we often pass them in the constructor of a Client class to aid decoupling, as every class should know only what it really needs to get its job done. With the verb know I mean that they just know that the other part exist at all.

The second is on Builder patterns:

The Builder pattern’s intent is to encapsulate the details (the new operators and other wiring) of the object creation process under a common interface. Though, the Builder can actually change the internal representation of an object, as it is not a black box.

Both blog posts were great reads, and I suggest all my UPHPU buddies hit them up.


Nov 25 2009

Coders At Work

Cover Art

Cover Art

I recently finished reading Coders at Work, written by Peter Seibel (@peterseibel), and published by Apress. What an amazing book to read, I can’t even begin to express how much I actually enjoyed this book, and I know I am gushing, but this was a real treat for me.

I have always been amazed by the past of computing, the idea of computers as large as houses, filling entire warehouses for simple punch card technology, hell punch cards! I love hearing the stories of how things were, getting the first networks going, writing the first program for any technology, making something that everyone everywhere now uses and doesn’t think twice about why it works the way it works.

In Coders At Work Peter Seibel interviews some of the legends of technology including Peter Norvig (Director of Research at Google Inc.), Jamie Zawinkski (major Mozilla contributor, @jwz), and plenty more.

Continue reading


Feb 10 2009

Beginning Silverlight 2

Beginning Silverlight 2: From Novice to Professional

Beginning Silverlight 2: From Novice to Professional

In web development, it’s important to keep current on new and updated technologies to avoid falling behind in the field. As a designer-turned-coder, I enjoy reading about and following up on the latest tools available for design and interface programming. Having designed and programmed in Flash for almost 10 years now, I was excited to read this book and see how Microsoft was tackling Rich Internet/Interactive Applications.

The author, Robert Lair, starts out the book with an introduction to Silverlight and the benefits of building interactive applications using Silverlight and its related tools. After the brief introduction, the real work begins and the reader is quickly involved in writing Silverlight applications. Robert does a great job walking the reader through the various tools available while building each application, and each example builds on or incorporates the previous examples, effectively ‘stair-stepping’ the reader up to building their own Silverlight applications. Continue reading


Jan 20 2009

firstPress Android Essentials (Apress)

firstPress Android Essentials by Apress

firstPress Android Essentials by Apress

Apress’s firstPress books are written as short and succinct as possible to engage the reader and provide them a starting point in a given technology. They are intented to be released and read as close to the technology release as possible to gain the maxiumum experience in the shortest amount of time. Unfortunately in some cases, this rapid-release structure doesn’t pan out so well, which is a flaw that this book suffers from. Thankfully this flaw does not render the book completely useless.

From the beginning of Android Essentials, it’s clear that Chris Haseman is passionate about mobile development and very excited about Android and its possibilities. He provides clear instructions and walks the reader through each part of an Android application, as well as providing hints and tricks within the Eclipse environment to make Android development even easier. While it’s not an instuction book on how to write Java, as Chris points out early on, most developers with a basic understanding of the language should be able to power their way through the examples and concepts. Chris doesn’t hold the readers hand through Java structure or development, but he progresses at a comfortable pace that should allow for any referential reading that may be  necessary.

The example code is where the reader may experience the most frustration. All code in the book was written using the M5-RC15 version of the Android SDK, which is two steps below the current release, 1.0-R2. While it may still be possible to run the M5 version of the SDK in a currect Eclipse installation, it is much easier and recommended to use the latest release so that any applications developed will work with current handsets. This means that only the first project in the book will actually build and launch correctly and all the others require small to moderately large adjustments. Anything from ‘add a line here and change that line there’ to ‘completely re-build this function from scratch’ is needed to get each example running. From a learning standpoint, this is where the book doesn’t hold up well. It can be difficult at best to find the correct solution, and even a web search may only yield a few hand-made solutions with the tag ‘your mileage may vary’.

Interestingly, this is can also be a saving factor for this book. Not everyone prefers to read a book where all the answers are laid out and available for download. Part of the enjoyment of development is knowing that you have created something for a purpose, and using this book’s code examples and the provided instruction is a great launching pad to discover your own way to build the same applications. So while it may take some extra time to make the examples work, the personal effort will usually leave a more lasting impression than just retyping the code into your favorite editor and verifying that the application does what it should.

Overall, I think that Android Essentials is a fair starting point for the beginning Android developer. For a serious developer, it’s a good book for idea reference, and for a beginner it’s a good start to see what is possible with Android. My final recommendation would be to wait and hope for an updated release of this book, or at least the code it contains. While I do enjoy discovering my own way through a particular application, more reliable starting code would have allowed me to spend more time developing my own applications instead of repairing another developer’s.