Mysterious but cool “to” top level domain on Google DNS

Well, Google is vying for more control of the Internet.  I suppose some might see it that why but I just honestly appreciate fast domain name resolution.  I also gloat in the satisfaction of knowing that my divorced parent’s will both now being using Google DNS instead of that service originally provided by their respective ISPs, who both are suckers for AT&T (formerly BellSouth who weren’t any better).   Why am I relishing at this?  I’ve recently accepted that I am and always have been a Google fanboy and that I need to stop hating on Mac fanboys because I’m just the same with allegiance to a different paradigm.  If Apple appeals to those who bask in luxury looking items that are riddled with overly engineered software interfaces, then Google appeals to those who just want simple.  If you’ve ever been concerned about not letting your browser redirect you following the failure of DNS returning domain’s IP address then look no further.

Why choose Google DNS?  They tell you the simple answer straight up.

I recommend listening to Google's simple answers; it's nimble and legitimate.

I think that this is definitely one of Google’s best ideas and really emphasizes their honest aim at net neutrality.  I trust the company and believe in their policies regarding DNS and private information.  Any reason why someone would likely not use their DNS servers is likely afraid of private information in corporate hands.  What are you so paranoid about?  Google hires the best engineers and I trust them more than I do my parent’s ISP’s DNS team. Anyway, try Google DNS out.

The Mysterious “to.” top level domain

One of the cooler URLs I just stumbled upon claims to be the world’s smallest URL shortener.  The address is http://to./!  Very cute Google, let me try :) . Of course this is a Google hacker having fun with the fact that he or she has the power of some people’s internets so long as they set their DNS servers (either IP address can go in you’re control panel’s primary or secondary DNS server text box; see Google help) 8.8.8.8 and 8.8.4.4 which by the way is by far the coolest domain name (so nerdy, ha).  I wonder if the domain name choice is a swipe at China’s total control of their DNS system (“The Great Wall of China”) because 8, eight, the number is lucky in Chinese cultures and Google is making a point of net neutrality with their DNS setup. Who knows.

The Mysterious "to" TLD on Google DNS

The Mysterious "to" TLD on Google DNS

If you are using Google DNS:

http://to./

Hmm… who do we ask?

  • Share/Bookmark

The new BlackBerry Application Guide

I recently posted my opinion about the excellent QuickLaunch application from NikkiSoft and mentioned that I was going to post another article about certain applications you shouldn’t download because their claims are either not true or misleading. Instead of creating a one-off post, I’ve created a website called the BlackBerry Application Guide which is intended for users who buy and/or download BlackBerry applications. The site is very much a work in progress but it will contain guides on where to buy applications, how to research whether applications do what they say they do, installing and removing downloaded apps and much more. The highlight of the site is the “Questionable Apps” list which I intend to be a frequently updated list of applications that you should stay away from and the technical reasons why.

Screengrab of the BlackBerry Application Guide homepage.

Screengrab of the BlackBerry Application Guide homepage.

The only applications that I intend to list are those that I’ve tried myself or have received trusted reports from other users. This is where you come in! If you are a BlackBerry handset owner, the BlackBerry Application Guide website could use your help! Have you ever bought a BlackBerry application that you felt didn’t live up to the product description? Were you ever fooled by customer reviews you suspect to be the work of the software vendor themselves? Please use the website’s contact form to get in touch with me if you would like to list your application. I will help you research the technical reasons why the application doesn’t do what it claims to be able to do or if you know why, feel free to explain the reasons to me so I can post them for all users. I want this website to be a trusted guide on those applications which your fellow BlackBerry users should probably stay away from or at least use at their own risk.

In addition to sending me product reports, if anyone reading wants to help write a new guide or add to or edit an existing one, please feel free to contact me using the BlackBerry Application Guide’s contact form.

I sincerely hope this project can grow so new BlackBerry owners can buy and download applications with confidence. Cheers!

  • Share/Bookmark

Review of Version 3 of AdSense from Google

Greetings all!

Maybe I’m on some Google beta tryout list (I wish!) but I received the following e-mail this morning regrading the new Google AdSense interface:

—–Original Message—–

From: adsense-noreply@google.com

Date: Mon, 23 Nov 2009 16:24:02

To: <….>

Subject: New AdSense interface enabled for your account

Hi,

We’ve launched a limited beta test of our new AdSense account interface to a select group of AdSense publishers, and

we’d like to let you know that it’s been enabled in your account. The new version includes the following changes from

the previous AdSense interface:

- Graphical performance reports: Earnings stats are now displayed in a graph format, and can be broken out by ad types,

targeting types, and bid types.

- Account maintenance improvements: Common tasks now take fewer clicks, including updating contact information and

making bulk changes to ad units.

- In-product help: A help box now appears on every page.

- Online resources: The Resources page has been redesigned with feeds from the Inside AdSense blog, YouTube channel,

and AdSense Twitter.

When you log into your AdSense account at www.google.com/adsense, you’ll see the legacy interface and a ‘Try new AdSense’

link in the upper right-hand corner of your screen. Clicking this link will bring you to the new interface, and you can

switch between the two versions at any time. You’ll also notice a ‘Feedback’ link in the upper right-hand corner, which

you can use to send our team comments and suggestions about the new interface.

Please keep in mind that certain features in the current AdSense interface may not be available yet in the new version.

More information is available at https://www.google.com/adsense/support/as/bin/answer.py?answer=164489, and we’ll be sure

to announce any updates on this page.

If you need help with the new interface at any time, please visit

https://www.google.com/adsense/support/as/bin/topic.py?hl=en&topic=25399.

Sincerely,

The Google AdSense Team

Email preferences: You have received this mandatory email service announcement to update you about important

changes to your AdSense product or account.

Google Inc.

1600 Amphitheatre Parkway

Mountain View, CA 94043

Needless to say, I am very excited to try out the new interface and will be posting reviews over the Thanksgiving Break. If only I could still be living the in the address where Google sends the verification PINs these public service announcements you see now to your right will go away! This is one aspect of the interface I hope will addressed.

Cheers,

Ryan!

  • Share/Bookmark

QuickLaunch by NikkiSoft for the BlackBerry and Other Apps

As I mentioned in an earlier post, I recently bought a BlackBerry Bold 9000. Since my purchase, RIM and its associate mobile phone service providers have launched the slimmer Bold 9700 (the “Onyx”) but I’m not fretting even though the reviews have been positive. From what I hear in the CrackBerry.com forums, some users lament the loss of the large “Bold 1″ keys and its bulky but luxurious feel (hey — it’s got a leather back instead of plastic :) and I am very happy with the handset I currently have. I am not happy with the state of BlackBerry applications as third-party stores affiliated with sites like CrackBerry.com (a very respected BlackBerry information website but I don’t recommend it!) sell shoddy, unsigned applications by developers who either don’t know what they are doing and think their application is capable of doing the impossible, or are trying to lure in unsuspecting customers. For more information on this which will be the subject of a future post (including the posting of all e-mails between the developer and I which is always fun!), please see my post in the CrackBerry.com forums. Nevertheless I would highly suggest using BlackBerry’s own store, called App World, to buy your handset software. Some users misconstrued my comments thinking I was blasting CrackBerry.com itself which is not true. I wanted to know why such an esteemed site in the BlackBerry world would want to associate itself with a store that sold applications by said developer. Anyway, before I end up writing that future post let’s get back to the topic at hand.

Thus far I’ve downloaded at least twenty-five applications for the BlackBerry, all for free. Among my favorites is Dictionary.com’s application (visit the preceding link in your mobile browser and download the application using the link on the page) which provides an interesting feature called “Word of the Day” in both Spanish and English and you can hear the pronunciation of the English word (not the Spanish word unfortunately) with a click of the trackpad.

Dictionary.com app's "Word of the Day"

Dictionary.com app's "Word of the Day"

In addition to this feature, the Dictionary.com app offers other familiar services like a dictionary (duh), a thesaurus, plus a useful history list so you can revisit words you’ve looked up in the past. Simple features but a nice interface. My only gripe is that you can select and copy text you find in the main window of the app using the context menu but you can’t paste it in the search input widget!

What does "listless" means? It could be easier to find out.

What does "listless" means? It could be easier to find out.

So let’s look at the screenshot above. I’ve used the thesaurus to look for synonyms of indolent. I view the results in the main window and let’s say that I don’t know what listless means. I could scroll to it, select it, copy it, and then you would think I could move the cursor up the the search text input widget and paste it but you can’t. I’ve e-mailed Dictionary.com in hope of them fixing this little “bug” but who knows if they really read customer responses.

Another great free application for the BlackBerry I just downloaded from App World is Thompson Reuters News Pro powered by Handmark which provides all types of news. The interface is well designed and you can customize the look and feel of the app using a comprehensive set of options. It it a nice application for your news needs.

News in the palm of your hand.

News in the palm of your hand.

The final free application for the BlackBerry I will mention before turning to QuickLaunch is QuickPull Free. This is a must have for all BlackBerry owners. DO NOT BUY ANY APPLICATIONS PURPORTING TO INCREASE YOUR MEMORY! THEY ARE ALL BOGUS AS THE BLACKBERRY API IS NOT CAPABLE OF PERFORMING ACTIONS CLAIMED BY COMPANIES THAT SELL SUCH SOFTWARE! BEWARE! Seriously, don’t buy an application that says it can tweak your BlackBerry handset because it can’t and there is proof. Some say they are a scam and I agree. Again, I will cover this scam in an upcoming blog post but for now I will leave you with this public service announcement: DO NOT BUY APPLICATIONS FROM EMOBISTUDIO.COM INCLUDING MEMORY UP PRO AND NETWORKACC for the BlackBerry (see here for the reasons why). QuickPull Free is exactly what you need and it is legitimate (and free!). From the developer:

Unlike the red power button on your phone which merely reloads your device, QuickPull will actually refresh the device, freeing up memory and increasing performance!

QuickPull Free has more than 1,000,000 customers to date. Schedule to run a QuickPull at a certain time each day, or multiple times each week with new convenient scheduling features to keep your memory and performance running at its best.

You can even set a memory threshold that will allow QuickPull to alert you when your available memory drops too low. Compatible with all BlackBerry devices with OS 4.5+!

Download it to your device now and use it to reset your BlackBerry should you notice performance degradation. I would recommend performing a device reset (you won’t lost any of your data or settings) once a week which you can actually schedule. There is a Pro version available but I think the free one is sufficient though I haven’t used the former.

QuickLaunch by NikkiSoft

I can finally turn to the main application I want to discuss in this post called QuickLaunch by NikkiSoft. While not free like the above apps, it only costs $4.99 at the App World store and I guarantee you it is worth that small amount of money! Microsoft Windows (plus all other desktop operating systems like the various Linux flavors running Gnome, KDE, or Xfce, etc. and Mac OS X) has always had a useful little widget likewise called Quick Launch in Windows parlance that sits in the Taskbar — you know, the big bar at the bottom where the Start menu is located.

Windows Vist's Quick Launch in the Taskbar

Windows Vist's Quick Launch in the Taskbar

This little widget is the key to increased productivity. The applications I use most are located there so I can easily access them without having to sift through directories in the start menu (which I don’t use anyway and instead move to a separate “Programs” directory”). Unfortunately, BlackBerry OS 4.6 does not include such a ubiquitous feature found in modern desktop operating systems so instead you will need to shell out $5.00. Big deal. The increases in productivity you will gain are very noticeable.

QuickLaunch for the BlackBerry is a full featured, customizable menu that allows you to quickly access your favorite applications, websites, pictures — whatever! — with at least two key presses. I set the left button below the power input on my Bold 9000 to open QuickLaunch and QuickLaunch itself defaults to using that button to close the app. This makes ergonomic sense: use the same button to rapidly open and close QuickLaunch. Here is what it looks like when I press that button:

The main QuickLaunch menu.

The main QuickLaunch menu.

Notice how elegant the white on black text looks (the colors can be changed to a few preset colors) and its right side location (which can also be changed the left). I leave it on the right because the standard BlackBerry context menu comes up on the left and this provides good visual contrast for each menu. At the top of QuickLaunch is the optional date and time plus the current weather! These options aren’t enabled by default and if you do enable them, you won’t be able to add as many applications to the main menu because of the loss of some screen real estate but that’s okay because you can create submenus!

"Tools" submenu in QuickLaunch

"Tools" submenu in QuickLaunch

In addition to submenus, you can also create horizontal ruled spacers between menu items. Clicking the BlackBerry menu option lets you move items around which is a little clunky but it does the job. When moving item menus around, the application has a hard time visually indicating where the item is actually going to move to but if you keep track of its location in your head and practice a few times, you should be just fine figuring out where the item will end up. Items can of course be moved to submenus and the aside from the little item-moving issue, the GUI is intuitive.

Items themselves can be…

The screenshots above were actually taken by an application that comes with the software. Unfortunately it seems a bit difficult to capture menus like “Settings” and “Add Item” so that is why I list them above. I can’t complain too much about this because I am trying to use QuickLaunch on itself and of course this isn’t the typical use case. Nevertheless the settings are highly customizable and NikkiSoft actively updates the software (I received an update two weeks after my purchase). QuickLaunch can be opened from any context (at least it seems that way) meaning if you are busy using BlackBerry Messenger you can still open QuickLaunch just as if you were on the home screen. In addition, every item can be assigned a unique shortcut key which makes productivity even faster! For example, if I want to write a new text message, I press the left button (the aforementioned button on the left side of the phone) and press the “T” key and a blank text message pops up. When I press “D,” Dictionary.com’s application launches and I can quickly look up words.

The only downside thus far is that when BlackBerry OS updates occur, your settings are wiped out. This isn’t limited to QuickLaunch but they recognize the problem and have an option to backup your menu configurations to a text file which is created in the root of my MicroSD media card. Make sure you back up your QuickLaunch settings or they will be gone after an OS upgrade.

This product is amazing so sack up and drop five bucks on this worthwhile application. Comments, questions, hate mail, whatever — use the comment form below and I will get back to you ASAP! Thanks for reading!

NOTE: I am not at all affiliated with anyway of the companies listed above and am conducting an independent review of the third party BlackBerry apps.

  • Share/Bookmark

Mastering Django (part 1)

Motivation

I first attempted to learn how to use Django a little less than a year after it was first released, in the summer of 2006 when I was 19 years old. Young and still finding my footsteps with Python I, like many other Django users, grew tired of creating slightly different web application frameworks for each project (code reuse at that point hadn’t had its impact on me). Whenever I created a web application, I simultaneously ended up creating a dictionary-based (read: sprintf() like string substitution) templating system while the applications themselves were powered by mod_python. And then I heard about Django and gave it a shot. As a programming framework, I had to sacrifice API control and “buy in” to their system, but almost four years later, I’m glad I did!

Django’s motto is “the web framework for perfectionists with deadlines” and while I now believe this is a true reflection of its capabilities, at first I certainly didn’t. Like many now seasoned Django developers, I started learning with the tutorial on djangoprojects.com but I ended up quitting immediately. The context of the tutorial at that time didn’t make much sense to me especially as it showed off Django’s features on the command line and that seemed a far cry away from a website. A few months later however, I bit the bullet and gave it another shot and this time succeeded (and then the command line examples made sense). I used the improved documentation, learned where to ask for help, and read the source code to see how it all worked. Django has grown a lot since that time (it’s been amazing to see the growth). There are many entire books on the framework, scores of useful external websites, and countless applications available for you to take advantage of in your own project.

This article is intended to be a collection of resources for a Python programmer who wants to learn Django. You don’t need to be an expert, but I assume that you have read an introductory book on Python and know the basics. I hope this guide will prevent other programmers from giving up on Django like I first did and help them master the web application framework. After all, had I not taken a job where I needed to use Django, I probably would never be writing this. Now it is a pleasure to code Django applications and I wish to spread the joy to all who wish to use the world’s simplest web application framework.

I am dividing this article into three sections relating to the types of resources available to Django newcomers. The first is the print medium which is described here and is aimed for those who are beginners to Django development. I discuess a few of the books available and where to find them and then discuss my favorite one, Django 1.0 Web Site Development (read this first). The next installment will cover resources available on the official Django website (as well as official resources not on the site) and is intended for intermediate Django users (i.e. those have read a book on it and are familiar with the API). The third part will go over third party websites and other places on the web that contain valuable Django information and can be used by any Django developer. The last part will unveil resources to even the most experienced Django developers. I hope these articles will be useful to programmers with all levels of experience.

Django Books for the Beginner

Django started out as a proprietary framework and its founders were granted permission by their employers to release the code under an open source license (don’t we wish there were more of those types of bosses!). I doubt its founders would one day imagine the range of books printed on the web application framework but indeed the list is growing. When I first started coding using Django, there weren’t any books on it and I instead relied on shoddy documentation. If my knowledge of Django were suddenly erased however (but not my memory of trying to learn it), I would start out by reading a book.

The first major book on Django, The Definitive Guide to Django, now in its second edition, was written by Adrian Holovaty and Jacob Kaplan-Moss and is open source (i.e. it is freely available on the web but also published by Apress). While I haven’t looked at the second edition too much, the first edition was very much related to the documentation (no surprise there since its authors are also the founders of Django). I definitely recommend checking that site out as a more in depth, example driven accompaniment to the official documentation.

The book that I recommend to beginners however is called Django 1.0 Web Site Devlopment by Ayman Hourieh. Published by U.K. based Packt Publishing, I would recommend any book published by them as they are always about cutting edge technologies. This is of course a huge risk because the book might be quickly outdated as the API or paradigm of the project changes. Cleverly though, they seem to recognize that most projects strive for backwards compatibility and their bets seem to be paying off. In addition, while all of Packt’s books are available in print form, they also distribute eco-friendly e-books. The books are DRM free and are delivered in seconds via Adobe Acrobat which means you can copy and paste code samples from your favorite PDF viewer. While I’m a sucker for print books, Packt has an especially cool deal where for a little more money you can download the e-book version while the book is being shipped to you! Overall the company has a penchant for publishing books on open source topics and delivering the books in the most flexible manner possible (free shipping anyone?) and I like that.

Django 1.0 Website Development

Django 1.0 Website Development

NOTE: I want to first be up front about my Django book selection and say that I received this book for free in return for a review of it on my blog. However, there wasn’t anymore to it then that and I could have written a separate post about it and not have recommended it in this Mastering Django series of articles. In other words, after reading it, I really do think this is the best Django book available for beginners which is why I am highlighting it in this set of articles. While I haven’t read every Django book, I have those published by Apress and Packt (i.e. the best ones in my opinion) and I think I justify my selection just fine. Now that that is out of the way… let’s get back to the show.

About Django 1.0 Website Development

My favorite aspect of the book is its format. Most of the other Django books I’ve read or glanced over cover each topic in a disparate fashion using petty examples here and there. Mr. Hourieh makes it clear that all Django topics will be covered in terms of how they relate to the development of a social bookmarking project. This is my favorite format for introductory programming books as they best model real world development. The only trivial downside is that you probably couldn’t easily just open up to a chapter and begin coding along with the book. This is perfectly fine for the beginner because you should read the whole book anyway so you have maximum exposure to the Django API and learn how easy it is to extend your project with existing code. In addition, the author steers clear of discussing, for example, different arguments you can supply to different functions and focuses on feature based development, introducing new concepts as opposed to alternative or slightly different ways of doing the same or a similar task.

Social bookmarking is good topic for introducing Django because its core is very simple and that is where you start. Of course such a project can easily add m0re features and this is the approach Mr. Hourieh takes. Obligatory introductory material is of course present as is installation help in the second chapter. Chapter three goes over Django’s MVC paradigm all in one swoop whereas other books tend to take too much time on discussing this and its differences between MVC, etc. Immediately after, readers jump right into the most popular part of django.contrib (Django’s contributed applications — in the spirit of Python’s all batteries included model) and the author discusses how to use the django.contrib.auth application (the user management module) in chapter four. Template tags are covered in chapter five and Django and Ajax is then covered in chapter six. This chapter is especially refreshing. Using the popular jQuery framework which is briefly described, topics like in-line editing, “live” searching (i.e. dynamically loading results), and finally Ajax powered search auto-completion now common on many websites like Google and Bing (I’ve tried several Ajax toolkits and jQuery is the best and most users seem to agree. In the spirit of publishing books that are on hot topics, check out Packt’s Learning jQuery 1.3 for a great introduction). Chapter seven continues to add to the application by implementing bookmark sharing between users as well as introducing django.contrib.comments (Django’s comments application). Chapter eight presents the Django administration interface, user and group permissions, and also discusses how to customize the admin. The remaining chapters cover the rest of the API such as RSS feeds, advanced database querying, internationalization, caching, deployment, and much more. Chapter twelve goes over other parts of django.contrib that are available to the user but no examples are given which is fine considering the depth the other topics receive.

So there is an overview of the book’s organization. I hope it is clear that the book is project oriented which in my opinion makes it all the more practical to a beginner who perhaps isn’t yet sold on Django’s API. You start out with the basics and then immediately jump into Django’s contrib applications. This approach differs from The Definite Guide to Django in that API nuances aren’t discussed as much. You spend your time creating a website as opposed to playing with objects in the terminal which is only really useful if you have prior experience with Django (this might seem like an overstatement but I really think that playing with objects in the terminal is confusing to budding web developers). While Adrian and Jacob’s book is certainly interesting and well written, again, it is very documentation-like, and Mr. Hourieh does a great job at engaging the reader by including material on how to accomplish some of the more popular features found on the web today like tag clouds and object sharing between users. In short, the structure of Houieh’s book is better than The Definitive Guide to Django’s in that is “newbie” friendly.

Another great idea of the author was to keep HTML and CSS coding to a minimum (except where required by Ajax). This keeps the book focused on Django and again reflects real world applicability as the people coding Django applications are usually not those writing the CSS to the XHTML template design.

Final Thoughts

I hope that if you are new to Django, you know what books are available to you and why I chose Django 1.0 Web Site Development as the best for beginners. Don’t be put off by the fact that Django’s current stable release is 1.1.1 — all the examples will work just fine as Django strives hard to maintain backward compatibility in the development process. Despite being given this book for free by the publisher, I am happy to receive it because it is the best in that focuses on how to make a cool “Web 2.0″ website using what modules Django has to offer. Once you have read this book, you are ready to explore in depth Django’s website (including its trac site at code.djangoproject.com). Part II of mastering Django will explore the project’s homepage in detail (as well as Django’s presence on Google Groups and its IRC channel). For those who have read Django 1.0 Web Site Development, the next part will help you fill in the cracks and aforementioned API details deliberately left out to keep you focused on rapid development. I think this book is completely in tune with Django’s slogan as it guides you on how to create a feature filled website quickly.

Now that Django has books published on it, beginners or casual coders can read them as a first step into becomming Django masters. I welcome any and all comments and am especially curious on what users thought of some of the other Django books out there and how they related the Django newcomer. Stay tuned for part 2!

  • Share/Bookmark

Google’s Homepage Now Loads in Pieces

Google seems to have updated there homepage recently. The change is subtle (well, maybe not to geeks!)  and it is an optimization for low speed connections. The essentials of the search page load instantly in the first request. This entails a the ubiquitous Google logo as well as the search form with only the character input HTML widget and no buttons (about time!) though also gone is the “I’m feeling lucky!” button that directed you to the first hit. I assume the latter feature was not popular with advertisers if popular with users in the first place. Anyway, the optimization enables you to start typing your query concurrently with the rest of the page loading. This is actually quite useful for users with slower connections. Some rail against Google’s user interface design changes but they are always for the better even if unorthodox. Google shows a willingness to cater to the wealthier user (i.e. one with a broadband connection) and those with a dial-up connection without making the experience any worse for either category of users.

All of this is the result of extensive use of AJAX technologies within the Google citadel of web applications. Following the quick return of only a few kilobyes (I will measure this later), additional XMLHttpRequests are made to load up the rest of the already simple interface. Using a useful measuring tool at WebsiteOptimization.com, Google’s front page checks in at just over 15Kb in four requests. This enables a fast connection to grab the page very quickly and slower connections can now retrieve the small page in pieces. Now, using the same tool, I decided to check out Bing.com, the latest name for Microsoft’s search comptetitor and surprisingly it served 11Kb in one request (Google took four). The Bing homepage has many graphics so I will need to do a more detailed analysis when I get home to Firebug (the best webpage/JavaScript/CSS debugger/analyzer ever)

The Microsoft engineers are certainly doing a better job at optimizing but I will refrain from any judgements until a more detailed survey is carried out on my personal computer (I’m typing this in the Tuft’s Tisch Library). I can’t help asking myself a feq questions though… given Microsoft’s extensive “Decision engine” advertising following the Bing re-branding, apparently better engineering, and a bite in Google’s search monopoly market share, is Google getting nervous? What are the next Google Products? I will discuss my feelings about Google products in a future post, especially now that I have been playing around with Wave since the first developer preview and also use Google Voice. I hope to present objective analysis of the company from an open source users point of view. Google’s motto of “Don’t be evil” needs to be severely scrutinized. Something inside says all the free things they give away mask their eviler side but more writing to come.

  • Share/Bookmark

Writing from my BlackBerry Bold

Greetings! I am excited to be posting from my new BlackBerry Bold. While I haven’t been posting too often recently, Wordpress for BlackBerry has revived me and given me new capabilities when it comes to Internet communications. The BlackBerry Wordpress application is simple to use but elegant elegant in design. Wordpress, of course, has an excellent adminstration interface but the application’s designers have included the bare bones core features to mash up into a nifty mobile app. My only complaint is that there isn’t yet a way to post links (i.e. anchor tags) in the post. I like to link to all the contents’ resources since I appreciate the same. One possible imementation might use the restructured text formatting supported by web applications like Google Code project hosting, Trac, and other such wiki components. UPDATE: When I began to type http… signifying the start of a link a BlackBerry dialog comes up and automatically inserts the HTML anchor tag. Note the singular. I should read the docs because there probably is a solution but restructured text would still be cool since typing HTML on a BlackBerry is not fun.

The best app for the BlackBerry is the cadre of prograns that make up Google Mobile — check out m.google.com/go for the great products.

The first Google app I will mention is Gmail which appears first in the Google Mobile base application menu. I don’t use Gmail too often but if it is like the rest of the apps I mention here, it is great!

Google Maps, ubiquitous on the web these days with it’s nice API, really shines on the BlackBerry. It has GPS enabled in the form of a dot on the screen as well as am arrow indicating the direction you are headed. You can get directions from your current location to any other location on the map either pinpointed using the trackball or searched via a text address. This makes navigating the highways of New York much easier!

After typing this much, either my speed is slow or writing a long post just isn’t fun but I’d like to give a shout out to the Google Voice team for creating such an innovative product. However, is it not possible to call or SMS text directly from the BlackBerry contacts app? This would be akin to modifying the Windows Explorer context menu to check in a file with Subversion — you know, the right click menu. That would be a step in the right direction. You hear me Google overlords?!

  • Share/Bookmark

RyanKaskel.com Internet Consulting is no more!

There use to be a small link at the top of this page that led you to an unfinished, ghost town of a site called RyanKaskel.com Internet Consulting. I intended it to be a “catch all” company that would provide casual small business (or users of any type) users who wanted a web presence or advice on their current websites. I customized Wordpress blog instances, built Django applications, and helped with smaller computer/network related tasks. Today, this small business is closed.

You might think I am sad or disappointed that the business didn’t work out but that is not the case. During my time developing one particular website which I am no longer working on, I was able to learn so much about the in and outs of Django, running a tech business including communicating with customers, and plenty of other development related details. That is such a positive for me. I love learning above all else and the half a year or so of the little business’s existence enabled me to do plenty of that.

I also learned what I am good at, what I can specialize in, and what I can’t do nor do I ever want to do again. At twenty-two years old, this couldn’t have been a better time for it to happen (especially since I’m in school — I am a history major so this was more like an extracurricular activity as I want to be a professor in that field). I am not an XHTML/CSS designer. I know how to do it, how to edit existing designs, and the like but I am not an artist. This has been a major realization for me. I couldn’t create a master template that was beautiful. Customers don’t care about the code powering their site, they care about the look of the site. I on the other hand put 80% of my effort into the site’s applications instead of design, which is only natural given my skill-set. What I like doing is developing network enabled applications especially those relating to the HTTP protocol using Django. Now I can focus only on what I love, and that is coding those types of programs for the masses.

The backbone of the Django powered system I built for clients was called “POWER” but at the heart of that was my replacement for Django’s simple flatpage application with a more complex app called “django-staticpages.” I can finally be honest with myself and only invest my “tech time” in projects that I truly love (such as django-staticpages, django-chatterbox, django-adminordering, and pysukari). All of these projects are coded by me but are for everyone. I am an open source junkie and that is my calling in the technology world. I simple don’t want to involve myself in the business part of it.

One client, John Doe, requested that his site be upgraded to JohnDoe.com “2.0.” Now for anyone in the tech world, anything web “2.0″ instantly draws images into the head of a web application powered website that operates like a CMS, has RSS feeds for every “object,” and is overall interactive and database intensive. Usually such sites are complex, or their complexity is abstracted into an elegant design. The point is that my client didn’t want a “2.0.” In his mind he had an entirely different vision because he wasn’t technically inclined. Maybe “2.0″ just meant an simple update. There was a huge disconnect between developer and client. The client didn’t want to know about the technological side of the website but that is what “2.0″ implies to me: enhanced functionality through technology. Like any project, applications needed to be modified to accommodate client edits (see the django-staticpages page for a technical understanding of why version 0.9.3 needed a 0.10 upgrade — the new features of 0.10 would accommodate the edits he wanted). I couldn’t communicate such issues because the client doesn’t care about the code but about how things look on the front. If that is all he cares about, then I clearly have the wrong job.

When it comes to developing websites, I find myself unable to communicate with clients when that client refuses to invest a little time into learning about his web presence and how it works. This sounds like a “no brainer” but I just spent the last four months of my life doing things (i.e. creating a 2.0 web presence) when the work required really should have taken a month. I can’t help saying to  myself “No, you did not hire a web artist. You hired a web application developer which creates ‘2.0′ application powered websites when you really just want a ‘1.1′ face-lift.” It would take a week to actually do what the client wanted since it involved no interactivity, no database, just plain HTML 4 table web design. So I got fired. W h a t e v e r. This saga is over and at last I can free myself from the chains of business relationships and devote my tech time to giving back to the open source community.

  • Share/Bookmark

I’ve Been a Bit Busy Lately, but Here are Some Python/Django Project Updates

I’ve been a bit busy lately, between schoolwork and web design but here are the latest updates…

If anyone finds their own interests colliding with these projects and wants to help in any way, contact me (this can even just be a quick note that your logo on Google Code sucks, here is a better logo). These are the three projects that will be taking up my time for the next six months. I’ve decided to stop offering any services to potential clients because of the difficulty with devoting the full time needed to a web project and my school, and I need to prioritize the latter for the next few months.

  • Share/Bookmark

Model Development Tips for Django Projects

In this post I want to present a few tips for Django model development that have turned out to be quite useful for my own projects. But first I want to pause and ask my readers a simple question (skip this digression if you care only about the title’s subject :) :

Do you capitalize all words in a blog post title? Now I don’t mean capitalize every letter, but instead use the normal conventions for English grammar in titles? I searched Google and found a post about the issue and the consensus was that bloggers do. I haven’t been following this rule lately for whatever reason and can consciously remember switching from standard title capitalization after seeing other blogs that don’t. Now I am though, because I should default to correct grammar. End of digression.

I have a project called POWER. It’s nothing particularly special, just a collection of reusable Django apps. Now some of these applications are written by me and others aren’t. When I develop applications, all my models take advantage of Django’s recent addition of model inheritance in the simplest of ways but ultimately, as I’ve learned from experience, useful despite a small performance tax.

I call the abstract model that all my POWER applications inherit CommonAbstractModel. Creative, right? Here it is in all it’s glory:

# Abstract models used by various application specific models
import datetime
from django.db import models
 
class AutoDateTimeField(models.DateTimeField):
    def pre_save(self, model_instance, add):
        return datetime.datetime.now()
 
class CommonAbstractModel(models.Model):
    added = models.DateTimeField(default=datetime.datetime.now(), editable=False)
    modified = AutoDateTimeField(editable=False)
    active = models.BooleanField(default=True)
 
    class Meta:
        abstract = True

A quick note on the above code. If you follow the comments below, I was warned about the safety and stability of using the documented auto_now_add and auto_now parameters for the models.DateTimeField. After much searching, I decided to play it safe since I use this in open source projects and client code and created the simple AutoDateTimeField which just subclasses DateTimeField’s pre_save() method and no matter if it was added or not, it always saves the current date and time (the same functionality as auto_now). For the added attribute, a simpler solution was used: set the default to datetime.datetime.now(). The code behaves the same as before. In order to discourage using auto_now and auto_now_add, I will not show the old code but if you follow what I’m saying it should be trivial to figure out: don’t do it. It just isn’t reliable for reasons I don’t quite understand and the core developers feel it breaks the DRY principle. For the developer conversation, please see this post in django-developers (note: don’t post how do you do this or why doesn’t this work in my Django project in the developer mailing list, use django-users instead).

To use the new class, simple replace the usually inherited models.Model with CommonAbstractModel (e.g. class Link(CommonAbstractModel) instead of class Link(models.Model)). This code is fairly simple yet so powerful, and for many cases, if you use it for all models, you add support for common functionality. For example, I recently open sourced a simple project to extend Django’s flatpages called django-staticpages to a more powerful system that includes support for menus. This enables a secondary level of navigation of grouped pages given a base template that has a static main navigation menu. I considered a simple case: What if I wanted to keep a StaticPage object but “turn it off?” Well, this is exactly what the active attribute provides. For any situation that requires on/off, show/hide and other such binary examples, this common base class provides it.

Similarly, often times you want to only display blog posts written between August, 1 and August 15 (or any arbitrary date range), this class provides not only support for when the posts were added, but you could also include a more in depth search for posts when they were updated. Attributes added and modified add this functionality. These types of decisions are so common and use cases are endless in supply that why not use such a base class? One answer might be performance. This may be reasonable (but systems are quite fast these days but we shouldn’t make any assumptions). You don’t have to use it. I do hope though that for pluggable models such conventions become common so countless use cases can be taken care if you’d like to add functionality to a project. And don’t worry, Django can handle more than one ABC. Now let’s talk about abstract base class’s a little more.

As you can see, this type of inheritance employs an abstract base model and therefore does not create any extra tables (inheriting from a non-abstract model does). Instead, it just adds the fields in the “abstract base class” to the children that inherit it. I put abstract base class (ABC) in quotes because Python now supports abstract base classes (ABCs) in version 2.6 (the latest version) but Django does not use this as it needs to support versions earlier than Python 2.6 and I’m not even sure its implementation provides what Django needs. While browsing some code, I saw a legacy Set import (it’s now built in to the type system) to support version 2.3, which is the lowest version you can use and you should really think about updating your code if it is that dependent on that older version. If your web host limits you, change hosts immediately :).

To add the fields from the abstract base model to the subclassed model, it uses nifty code found in django.db.models.base (lines 124-162 in SVN revision 10955 and later) and it is this sort of code that really highlights the dynamic power of Python (and the intellect of the Django devs):

        # Do the appropriate setup for any model parents.
        o2o_map = dict([(f.rel.to, f) for f in new_class._meta.local_fields
                if isinstance(f, OneToOneField)])
 
        for base in parents:
            original_base = base
            if not hasattr(base, '_meta'):
                # Things without _meta aren't functional models, so they're
                # uninteresting parents.
                continue
 
            parent_fields = base._meta.local_fields + base._meta.local_many_to_many
            # Check for clashes between locally declared fields and those
            # on the base classes (we cannot handle shadowed fields at the
            # moment).
            for field in parent_fields:
                if field.name in field_names:
                    raise FieldError('Local field %r in class %r clashes '
                                     'with field of similar name from '
                                     'base class %r' %
                                        (field.name, name, base.__name__))
            if not base._meta.abstract:
                # Concrete classes...
                while base._meta.proxy:
                    # Skip over a proxy class to the "real" base it proxies.
                    base = base._meta.proxy_for_model
                if base in o2o_map:
                    field = o2o_map[base]
                elif not is_proxy:
                    attr_name = '%s_ptr' % base._meta.module_name
                    field = OneToOneField(base, name=attr_name,
                            auto_created=True, parent_link=True)
                    new_class.add_to_class(attr_name, field)
                else:
                    field = None
                new_class._meta.parents[base] = field
            else:
                # .. and abstract ones.
                for field in parent_fields:
                    new_class.add_to_class(field.name, copy.deepcopy(field))

This code is certainly scary if you don’t understand the context, but given the abstract base model (which is a class) above, it should start to make sense (reading the whole file might be useful since this is the heart of the Django Model class). In fact, Django implemented its own abstract class system before Python did using the power of metaclasses. This is an advanced topic and originally was hard to grasp but by studying Django’s code, its applicability, and potential (as demonstrated in this case), use cases become more obvious and implementation less taxing on the developer with such a good reference project at hand. Python’s abstract base classes use iterators and certain new special methods and decorators (see the PEP, or Python Enhancement Proposal for more details about Python’s implementation) but the two systems seem somewhat similar but fulfill different needs (someone please correct me). While Django strives for backward compatibility, eventually, just like Python did, some changes are going to be forced upon programmers who choose to stay current with the language or framework. I can only presume that Python might refactor its current implementation of ABCs using Python’s built in support (maybe not!). I’m sure the guys and gals behind Django will provide tools and helpful documentation to aid the changes. Alas, they aren’t here yet and will come with plenty of warnings so don’t panic.

One final word about models. I briefly touched on hosted Django environments. Since models encapsulate database functionality, you may want to add a line to your settings file to make your database more efficient. By default, MySQL uses the MyISAM engine but the InnoDB storage engine is probably much better for Django given the amount of keys Django uses (‘id’ is created as a primary key by default) and any non-trivial Django application will surely heavily rely on model relationships and hence keys and indices which InnoDB handles better.

If you use MySQL and the default storage engine is MyISAM and you don’t have the privilege to change that setting, add this following line of code below your DATABASE_ settings:

DATABASE_OPTIONS = {'init_command': 'SET storage_engine=INNODB'}

Django will now automatically create all tables and set them to use the InnoDB storage engine (the option couldn’t make this more clear :) .

I’ve recently started to post topics on Django to a wider audience so all I hope for is that I help at least one person along there Django trek. As always, please comment with corrections, comments, concerns, curses — whatever! I love feedback and appreciate you taking the time to get to this line.

In my next Django article, I will write about one method (the one I used) to learn Django, which should be very effective for all projects really. I’ve already touched on this learning method in this entry but I will go much more in depth. It may not suit everyone, but surely at least one person will benefit!

Cheers,

Ryan Kaskel

  • Share/Bookmark