Archive for the 'webdev' Category

Page 2 of 5

Storing the SQL queries in the database

I want to outline something I developed something like 5 years ago, and that I was kind of happy with at the time: a way of saving all SQL queries inside the database itself. The reason for writing this is that it would really fit in with all the RubyOnRails and other programming frameworks that are created these days. If someone feels like creating a component/plug-in for it, that would be so nice…

If you have no interest in programming and/or database management, go hug somebody and skip this article.

PRINCIPLE
In the most simple version, you have 1 extra table in your database that looks like this:

query_id   int % unique ID of the query
template   varchar(1000) % or even longer
var_list   varchar(255) % comma separated list of vars

An example:
[ 33 , "select * from users where user_id = %user_id% AND type = '%status%' " , "%user_id%,%status%" ]
Instead of constructing your SQL code in your (PHP) code by making one big string and then executing it, you call a function my_exec_query(query_id,array_params)
This function will

  • get the template text
  • walk through the comma-separated list var_list and for each variable inside, look the corresponding value up in the array array_params (or this can be a dictionary or a hashtable).
  • when all substitutions are finished, execute the SQL code and return the result as (connected/disconnected) recordset or an array.

Continue reading ‘Storing the SQL queries in the database’

Web-based web development

Writing code in your browser, it’s coming this way, I tell you! Some indications:

my own WikiRAD article (July 2005)
Playing around with PHP and wikis at the same time made me think on how web-based editing and compiling would be a good way to develop and run web applications
Feed43
Create an RSS feed out of any web page by using regular expressions with a nifty Web2.0 user interface. Lots of services are based on URLs and use RSS as input, so this can be the start of a first application. E.g. I just created an RSS feed for the Stubru playlist pages out of a Stubru Javascript file. Imagine I could now tell Feed43:
for each item in feed_that_I_just_created {
parse_the item_url
publish an rss feed for this item_url as feed_url_X
}

and then start working with that content too.
Amazon S3
web-based outsourced storage for any application, which made John Keyes and Peter Van Dijck to ask themselves: “Can you use Amazon S3 to create the new Flickr killer?”, and which made me think: but what if not only the storage, but the whole program was run by a 3rd party?
Iamalpha (via Richard McManus)
AOL’s new initiative for building microformat-based applications. It’s a bit early to grasp the extent what what they’re trying to accomplish, but I think it’s potentially more than just widgets. They don’t have a web-based IDE yet, but they do have a copy/paste code-validator. Most importantly: the applications are run by AOL!
YouOS (via Jeremy Zawodny)
YouOS: web-based IDE
a web-based OS that allows you to develop Javascript-based applications in a web-based IDE, with version control and compiling. It’s one of the products coming out of Paul Graham‘s Y-combinator startup incubator.

Continue reading ‘Web-based web development’

Barcamp Brussels: May 2006

Barcamp Brussel
Last year we organised a fairly successfull blogger’s dinner in Brussels, and now we’re gonna try something different:
next May we will have a Barcamp Brussels event.

WHAT IS A BARCAMP?

Barcamp NY
(photo by miss_rogue)

Barcamp was first organised in LA by Chris Messina and some buddies.

BarCamp is an ad-hoc un-conference born from the desire for people to share and learn in an open environment. It is an intense event with discussions, demos, and interaction from attendees.

It is not your regular conference:

  • No spectators, only participants: Attendees must give a demo, a session, or help with one. All presentions are scheduled the day they happen. Prepare in advance, but come early to get a slot on the wall.
  • No fixed agenda: talks, demos and topics are proposed by the attendees when they arrive on a central whiteboard.

Continue reading ‘Barcamp Brussels: May 2006′

Jakob Nielsen: design mistake #5


Jakob Nielsen has published his updated Weblog Usability: The Top Ten Design Mistakes. One that I recently have tried to fix (before Jakob published his article, honestly!) is #5: “Classic Hits are Buried”.

Highlight a few evergreens in your navigation system and link directly to them. For example, my own list of almost 300 Alertbox columns starts by saying, “Read these first: Usability 101 and Top Ten Mistakes of Web Design.”
Also, remember to link to your past pieces in newer postings. Don’t assume that readers have been with you from the beginning; give them background and context in case they want to read more about your ideas.

As you can see in the sidebar on the right (if I haven’t changed my layout by the time you read this), “This blog covers stuff like [...]“ and then I have some links that show up when you click the [...] button. I list some of the more typical posts (Podcasting with Blogger and Feedburner – Oct 2004 as well as tango moves) and some ideas/projects I launched (folksonomy, photofeed).

So what kind of links to your own posts could you make:

  • ‘classic’ posts: posts that are typical for the subjects you address
  • ‘remarkable’ posts: posts that are are maybe not typical, but that you are somehow proud of (in my case, “Imperial time units” comes to mind)
  • ‘popular’ posts: the posts that people visit most, link most to, have most comments on, …

The first 2 are probably links you better indicate yourself, the last one could be based upon aggregated stats. Let’s say you want to make each list as an RSS feed, so you can display it through PHP or Javascript on each blog page.

  • handpicked (‘classic’, ‘remarkable’, ‘controversial’) posts: put them in del.icio.us or furl and use the RSS feed
  • ‘popular’ posts: imagine a statcounter of somekind, that measures the #page hits and visitors, that also checks Technorati, Google Blog Search and Yahoo stats, that also uses the Feedburner item stats (if any) and the # of comments per post (don’t know where that could come from) and that aggregates these together according to your own wishes. The end result should be the Top 20 of your own blog posts, in RSS format.

Any ideas on this?

UPDATE: I created an overview page for my blog, linked from the blog homepage.

Technorati: stats