Contents tagged with Programming

  • Book Review: "Ajax in Action"

    Let me first preface this review by saying this is the first technical book that I've read cover to cover TWICE prior to posting a review. I had to make sure the stuff stuck, because the material covered in Manning's very excellent "Ajax in Action" is really deep. But bringing the next evolution of user experience, giving your web applications a rich client feel, isn't completely easy. This won't scare you away from using Ajax in your existing applications, but make you aware of exactly what to expect.

    The book first starts out by presenting a healthy discussion of the key components of remote scripting - CSS, the DOM, JavaScript's XmlHttpRequest object and client callbacks - and how they interact within the scope of your project. Before diving into full-on Ajax development, authors Dave Crane and Eric Pascarello discuss the need for object-oriented JavaScript programing, which will be foreign and awkward to most developers, even those coming from procedural backgrounds like Java and C++. The authors familiarize you with the various ways of composing the unconventional constructs available (JSON-RPC, prototypes) for optimizing remote scripting.

    Best practices are encouraged throughout the chapters and enforced in all code snippets. The use of patterns like Observer, Command and MVC and refactoring and module-based programming (mainly .NET assemblies and Java servlets) permeate the entire work. The actual meat of the book doesn't get started until Chapter 9, which the authors clearly state, dealing with the aforementioned discussion of raw JavaScript programming that'll be completely new to most people. But for those not wanting to engage in the massive task of writing syntax by hand, the major libraries available are thankfully referenced.

    The book also isn't a "copyist's" title, one that can provide working code right out of the gate. Also, the audience for this work should be fairly sopisticated and experienced with modern-day web programming, as the book assumes a certain level of competency and doesn't waste time with rudimentary concepts or examples. Crane and Pascarello take a platform-agnostic look at incorporating Ajax-style programming into web applications, citing examples in PHP, Java and .NET, and accordingly the examples are all partial and abstracted, to be implemented in whatever platform the developer/reader is familiar with.

    This is also one of the few books that I've ever recommended people read the appendices in addition to the chapters. Most titles have supplementary info that doesn't match the flow of the chapters, or exclusionary stuff you can skip, but this book is really a tome of good reading. Appendix B is an outstanding discussion on JavaScript OOP, providing an introduction to and examples in JSON.

    Ajax programming is a lot more complex than it lets on, but not as daunting as you might think. This book is critical in your understanding of how to make the next big thing in web development to work for you. A must-have.

    Read more...

  • Accessing Word documents programmatically with an ASP.NET web form

    I'm trying to incorporate a new feature into my company's CMS that doesn't require population of form fields in a web page.  Basically, the system will read a DOC/RTF file from a directory and programmatically extract data to be inserted into a database, based on a predefined structure within the document (title, author, body).  Sounds like the perfect candidate for BizTalk Server, doesn't it?  Unfortunately, I'm not that lucky.  So, I'm attempting to do so by hand.

    It's simple enough to do, but examples don't exactly abound on the Web, so I'm doing some testing of some new concepts I've developed about reading/extracting the contents of such a binary file and using it via an ASP.NET web form.  This is going to further automate an already-speedy proces for getting news from our newsroom management system to our CMS to the public World Wide Web.

    Pretty geeky way to spend a Sunday night, eh?

    Read more...

  • The personal portal battle: Google's personalized homepage vs. Start.com

    I've been objectively playing with and testing the personalizable portal concepts from Google and Microsoft a lot over the last week, and I'm not alone (Ben Askins, Eric Hammersley, and Adrian Sutton have a few of the better blogged tests).  I've been a big fan of the web parts portal framework concept ever since I saw it in early bits for ASP.NET 2.0, and I'm glad to see some production-quality apps finally available for public consumption.  Trying to use the "Remember the Digital Dashboard?" or "Think of Rainbow, it's kinda like that…" or "Why you should really consider Windows SharePoint Server" examples to a neophyte audience was getting nowhere.  

    (If you have no idea what I'm talking about, thanks for proving my point.)

    Both Google's personalized homepage and Microsoft's Start.com initiative exhibit slick DHTML powering animation and drag-and-drop features that are very cool, and both ship with a ton of pre-configured content (weather, stocks, national news), in addition to supporting subscriptions to external RSS feeds.  Each gets a slight nod over the other for certain aspects of its shipped content (Start.com supports more global locales for weather, Google's movie service is more localized; Google makes it way easier to add content to a page, while Start.com's preview pane is a really neat way to get an abstract of a feed without leaving the page, etc.).  

    Surprisingly, Google's portal naively allows a user to subscribe to the same RSS feed multiple times - whether inadvertently or deliberately - while Start.com detects the presence of a specific pre-existing feed and intuitively only permits a single subscription.  Start.com also supports the importation of OPML files for auto-subscription to existing lists, which Google doesn't at the moment do.

    As far as speed goes and in lieu of any formal and scientific testing, Start.com, it would appear, would be the better performing service.  It just seems to execute more efficiently, carrying out operations and rendering content to a page faster.  Maybe this implies a superiority of the ASP.NET 2.0 engine over Java/Python.

    That having been said, accessibility is the determining factor that puts some real competitive distance between the two for me, and the reason I personally prefer Google.  I really dig the fact that being a true membership-oriented web app, Google's homepage enables roaming and can be accessed with your customized profile from any PC (and hopefully sometime, any device).  I normally jump around on at least 8 computers of varying OS and browser at work, so it's nice to be able to get at my GMail account, search history and RSS feeds wherever I am without any additional configuration or setup, other than a one-time login.  Start.com evidently uses a per-machine server-side cookie to persist customized content, so a personalized portal using Microsoft's offering at the moment can't be accessed if you use a PC adjacent to you, in another building, or on the other side of the world.

    Further, because the Start.com cookie is resident only on the web browser that first set it, a customized portal can't even be accessed on a different browser on the same machine without setting it all up again from scratch.  The concept of network usability is lost.  This means if I setup some content areas different from the default load, add some RSS feeds, and change some program parameters in MSIE, I can't see the same page in Firefox and have to repeat the actions.  And continue doing so for cross-browser maintenance over time.  This is a big letdown, in my opinion.  

    But the main thing that brings Start.com down for me also delivers an implied benefit I think is cool.  I realize not everyone has multiple PCs and workstations at their disposal, and most users are content relying on a single browser.  So it's nice that Start.com supports configuration without membership via anonymous personalization, and people can setup customized experiences without having to signup for anything.  This is good, and I initially predicted unavoidable, as programmatic anonymous personalization was one of the first things I tried to achieve with the early preview bits of ASP.NET 2.0.

    With both being in beta, there's still work to be done.  And while increasing customer feedback and incorporation/integration into existing products lines for both Start.com with MSN and Microsoft tools and Google's page with…well, Google, the more the products begin to differentiate from one another the more they'll become even more similar.

    Read more...

  • Generating maps dynamically with Google Maps and ASP.NET 1.x

    I spent part of the weekend tapping the Google Maps API, developing a custom ASP.NET 1.x app that pinpoints some of the more memorable locations during my brief residency in Seattle (see my sample here).  Bill Pierce created a .NET custom server control to use Google Maps in ASP.NET 1.x, which basically acts as a wrapper for the public API so that you can use server-side event handlers that automatically generate client-side code that display a map.  Bill's process really makes the effort easy. 

    Read more...

  • Neat little CSV with US/territorial zip & area codes

    Bill Bercik has a nice little Ajax programming tutorial in PHP for dynamically displaying city names and area codes after a user specifices a zip code.  The key component of the downloadable source code is a CSV that contains nearly 42,800 zip codes and area codes for U.S. cities and cities within U.S. territories, which can be easily imported into a database.  It's a great source for data if you're developing apps or utilities involving geocoding.

    Read more...

  • Manning publishes "what is Ajax?" screencast

    I got an e-mail from Manning Publications about a "screencast" (I'm not sure exactly what that is, but I'm guessing a series of screenshots set against narrated audio) for a "What is Ajax?" presentation.  It's 4 minutes long, so it'll be a nice break while you download today's podcasts or synch your PDA.

    Check it out:
    http://www.manning-sandbox.com/category.jspa?categoryID=229

    Read more...