As you may know today Google released Friend Connect
. I decided to give it a try. It took about 20 minutes to set up my blog with 4 gadgets: Members, Sign In, Rate/Review, and Wall/Comments. It took about 30 minutes to separate the skin from all these widgets, and set up the Canvas so users can see gadgets in a separate window, if they want to.
Google Friend Connect doesn’t have any server-side components on user’s server — everything is handled by Google. All you have to do is to deploy 2 (two) static HTML files, and add various snippets that can be customized and generated on the Friend Connect’s web site. The resulting snippets are simple, and can be easily understood and restructured.
In the previous post
we explored “array extras” and how they can help us to write concise yet performant and clean code. In this post we take a look at generalizing recursive algorithms with recursion combinators — high-level functions that encapsulate all boilerplate code needed to set up the recursion. These functions were added to dojox.lang.functional and will be officially released with Dojo 1.2.
In general the recursion is a form of iterative problem solving in the same category as loops. There are two major natural sources of recursive algorithms: recursive data
structures (lists, trees, and so on), and recursive definitions
(factorial, Fibonacci numbers, the GCD algorithm, etc.). The
recursion plays a prominent role in the functional programming (FP),
and one of the best articles on this topic is “Recursion Theory and Joy”
by Manfred von Thun
, the creator of Joy
(a purely functional
programming language with Forth-like syntax). Manfred’s article
explains intricacies of recursion including the venerable Y
combinator
, recursion combinators in general, and introduces a practical set of recursion combinators, which will guide us in this post.
Finally: my open source JavaScript project DCL
is built on ideas described in this article. Available for node.js and modern browsers, it implements OOP with mixins and AOP at "class" and object level. Read documentation and background articles on www.dcljs.org
, clone its code on github.com/uhop/dcl
, and follow @dcl_js
.
If we look at the history of computer programming languages, we can see that practically all new programming methodologies were about one thing: taming complexity. The anarchy of earlier days of procedural programming
(example: Fortran) gave way to structured programming
(Pascal), which was refined with modular programming
(Modula), and was reformulated when object-oriented programing
went mainstream (C++, and much later Java). And it stopped there. The focus shifted to different branches of computer programming, namely to functional programming, and, to a lesser degree, logical programming. The only major development in this branch was the rise of aspect-oriented programming
(AOP) paradigm. Let’s take a look at AOP in our favorite language: JavaScript, and how Dojo helps the language with dojox.lang.aspect package.
Yesterday Google announced
its new offering: Google App Engine
. These are my random notes I did yesterday when I studied the new service.
Google didn’t go the same way as Amazon with its AWS
. The former offers a form of shared hosting (think “distributed WebFaction
”), while the latter offers a virtualized environment (think “distributed SliceHost
”). So basically we are talking about more high-level approach to web applications, which is easy even for novices. On the other hand AWS is more flexible and more enterprise-y.
As you all know by now Dojo 1.1 was released in the wild
. You can get a lot of useful links and info from James Burke’s post on Dojo 1.1
, but let me tell you why you should be excited:
- Dojo 1.1 is the first official release, which contains dojox.lang.functional
. It was available in the trunk for awhile, but now you can use it without deploying Dojo courtesy of AOL CDN
. I am psyched about it!
- Improvements in animation, animation helpers for dojox.gfx. A good examples of animation in action is dojo.moj.oe
by Pete Higgins
(internals were detailed in the blog post
, and in the great Dojo Campus article
), an example for dojox.gfx animation is the career test
. Finally we are getting to the point when we create attractive GUI cross-platform without plugins.
- The Dojo API tool
. As you know Dojo is essentially a federation of JavaScript modules. Every module can be a library on its own. Now we have a simple way to navigate them, read developer’s documentation without diving into the source, and understand the API. When comments will be added to it shortly, you can add your own notes, and ask pointed questions. Developers are getting an essential tool to see how their modules are documented, what questions are raised most frequently, and so on. This tool will help us to document Dojo even better. All in all Neil Roberts
and Tom Trenka
did a great job!
- Numerous improvements and bug fixes — this is always good. The API is mainly unchanged, so the migration to Dojo 1.1 should be a no-brainer for most users.
I am pleased to see that social aspects of Dojo are getting attention: the redesigned Dojo web site
, the Dojo API tool
, Dojo Campus
is always fun, Dojo forums
are active, even the Dojo archive
is now easy to navigate!
What makes JavaScript so different from other languages? Is it its
dynamic nature? Its prototype-based funky inheritance? No. The most
unusual thing for newcomers is how JavaScript programs handle the
workflow. The program looks like a bowl of spaghetti. There is no start
or end of the program. What we have here is a bunch of functions, which
are called in response to some external events. In most cases we have
no way to predict the order of these events. And we know that all
callbacks are called from a single thread. Of course we know that it is
not a nature of JavaScript but rather a limitation imposed by a
specific container of JavaScript programs — web browsers. Majority of
JavaScript code is written for browsers and now we have a perception
problem. But let’s dig deeper to understand the problem better.
I just finished the first cut of the dojo.dnd 1.1 technical documentation
. Let me use this post to remind you about the dojox.gfx 1.1 documentation
. I hope I satisfied the curiosity of many developers, but the ultimate proof will be the number of simple questions on Dojo Forum
. Let’s hope it will go down. And don’t forget that the Dojo Book
has a DnD chapter
too.
Both documents are hosted on Google Docs
, and are “live” documents — as soon as I update the document it is updated for you too. I intend to update them on regular basis to track the current version.
Everybody knows that JavaScript is a multi-paradigm language, and it can be used to program functionally. Practically all functional idioms can be used directly: higher-order functions, recursion, closures, and so on. The recent resurgence of Functional Programming (FP) brings functional methodologies in the mainstream. FP fundamentals gave us a lot of powerful idioms: iterative functions, which can replace loops, list processing in general, function manipulations, and many other things, which helps us to keep our code small yet concise, more powerful, and more fun. Let’s take a look at how Dojo helps to leverage the functional paradigm in the Core, and in the extended DojoX package (dojox.lang.functional).
I published first day pictures from PyCon 2007. They are raw, unedited, I didn’t put descriptions yet. You can recognize Django guys, people from multiple Python web frameworks, and, of course, the BDFL with OLPC. But why wait for pictures to be prepped? Dig in while they are raw and fresh:
Yes, this is Steve Holden sporting a Django t-shirt.
Introduction
Web 2.0 brought on us an onslaught of new server-side web frameworks, and made it OK to put some code on the client side as well. Yes, I am talking about Ajax
. While elements of Ajax were available (and used) for a long time now, 2005 was the crucial year for this relatively old technology fueled by proliferation of modern browsers with proper support of JavaScript and HTML DOM, which, in turn, gave a rise to numerous Ajax toolkits. As always new exciting technology polarizes people — you can find ardent supporters of Ajax and a booing horde of naysayers. The latter crowd points out real and imaginary problems with Ajax. Some problems are real enough but stem from a misuse of the technology. One of them is a performance of a web application. In this article I will show how to improve a performance of a web application with Ajax and how to optimize an Ajax web application. Specifically I will show how to optimize a Dojo
-based high-performance web application. I will use Django
and Apache
as examples of a server environment.
How long does it take to do a project? Software developers are asked this very question on regular basis. This is how every project begins. Why is it important? Because “time is money” and many software projects are priced mostly by time spent on the project. “We will take your project estimate in hours, multiply them by your rate in $/h, and we have our price.” Ask any consultant or IT staffer about that. Let’s look at estimates in the Real World(tm).
This is the 2nd part of Setting up tools on Windows
— notes mostly for myself. (No, I don’t run Django with MSSQL under IronPython
. Yet.)
In this installment I add more stuff to Eclipse, and set up my apps under FastCGI on Linux-based shared host (I use DreamHost).
Eclipse
This section was updated on 9/30/2006.
I already set it up with PyDev and Subclipse. Now I want to add HTML/CSS editing. And I want to do AJAX.
Today I converted three web sites to the latest Django’s trunk formerly known as the magic-removal branch. It was a very positive experience in general. New Database API with lazy database queries (courtesy of QuerySet) rocks! Direct interaction with model classes allows doing a lot of things much simpler than it was before. A lot of small improvements, which makes a big difference like explicit template extensions (use whatever is appropriate for your content), more transparent new Admin inner class, natural overriding of model methods (no more _pre_save() and _post_save() hooks!), and, of course, no more pluralization guessing.
Yes, another Google SoC
is upon us. I signed up as a mentor with Dojo
and Django
. Both projects are on the leading edge of new wave of web-based applications doing extremely cool stuff. I anticipate that some smart students will bridge both projects, but individual projects are fine too.
What is Google SoC? Read the FAQ
. Who can apply? Any student anywhere in the world
can apply. You don’t have to be Comp. Sci. major to participate. Why should I apply? You will gain a real world experience with open source projects on the bleeding edge of modern technology. Your code will be used by high profile projects (it will look spiffy on your resume). You will meet new people who "do it" instead of "talk about it". And you will earn $4,500 USD
and a cool T-shirt as a proof of your participation.
By popular demands I am publishing pictures of my JTAG, which I made to revive a wireless router
some time ago. Just click on the picture below to see it in all ghetto-style glory with some explanations of my "design decisions".
You can see that it is very basic. It was made in ~3 minutes and costs ~$6 (the most expensive part was the cable — $3.99). It was assembled according to this diagram
. You can find a full description of details here
.
Let me give you one more definition of what computer programmers do: they design, build, and maintain complex systems
. In many cases computer programs are more complex than “Hello, world!” examples. Way more complex. I am talking about the systems
- that have more branching possibilities than atoms in the universe.
- that cannot be verified using any formal methods in any practical timeframe.
- that cannot be tested with 100% code coverage in our lifetime.
- that cannot be completely understood in all details by their creators.
- that can handle real life requirements.
So what?
I found some time to finalize my pictures and notes on PyCon 2006. I tried my best to identify people in my pictures. Now you can see their names and links to their blogs. I added links to official descriptions of their talks, as well as to excellent detailed notes of some talks by Steve Holden
. I advise to visit his blog, because he has notes on some talks I didn’t attend.
I added more pictures from PyCon 2006
. Enjoy.
Now time for a blog roll of my photo models (far from complete):
I know I missed some blogs, please let me know your blog address, and I will add it.
Here in Dallas PyCon 2006 gave us an opportunity to meet many "virtual" people from Python community, and put faces to names. For those who couldn’t attend I am publishing pictures and small notes on Flickr
. I will add more pictures tomorrow. If anybody’s name is misspelled, or missing (I didn’t catch all names), or you want me to remove your name or picture, please contact me and I will change notes. I am planning to add blog addresses to people’s names as well.