A Django site.
November 14, 2008

Jesús del Carpio
jj
Jj's blog
» Django cheap pages

Sometimes I end up using Django for the wrong thing, just to dispatch pages and put all my content in the templates. Flatpages are too flat and other DB based content tools are too complex. I just want to use the dispatcher, and the templates (I know, I could use web.py, or whatever other Python tool).

So, In order to save myself some time, I made cheap_pages.py, which is a wrapper for the patterns() method that will populate it with direct_to_template calls.

So instead of doing this:

>>> url(^name/$,
...    direct_to_template,
...    {'template': 'name.html'},
...    name='name')

I can do this:

>>> page('name')

Or instead of this:

urlpatterns = patterns('',
    url(^pages/page1/$,
       direct_to_template,
       {'template': 'page1.html'},
       name='page1')
    url(^pages/page2/$,
       direct_to_template,
       {'template': 'page2.html'},
       name='page2')
    url(^pages/page3/$,
       direct_to_template,
       {'template': 'page3.html'},
       name='page3')

)

I can do this:

urlpatterns = build('pages/', ['page1', 'page2', 'page3'])

I’ve added the file to Google Code under Django-cheap-pages, in case anyone is interested in improving it :) .

November 10, 2008

Jesús del Carpio
jj
Jj's blog
» Open-selector

I’ve been thinking about doing this this for a while eve since I saw Ma.gnolia’s login screen. Finally found time toput it together this week, its pretty simple though.

Open-selector logo

Open-selector is a piece of Javascript that takes your regular OpenID login box

OpenID login box

and turns it into a provider list so people can choose an OP and give their user account for that provider. Behind scenes Open-selector builds the identifier URL and makes submits it as a regular OpenID login.

Open-selector combo Open-selector provider list

It is an alternative to ID Selector with a slightly different approach, and hides the OpenID URL complexity to people that still can’t understand an URL as an indentifier :? .

Here is how to use it (note the Jquery dependency):

<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/open-selector.js"></script>
<script type="text/javascript">

   // ID for the OpenID form
    open_selector.openid_form_id= 'openid_form';
    // ID for the OpenID URL box
    open_selector.openid_box_id= 'openid_url';
    open_selector.init();
</script>

Just include the js file, and call the init() method.

The source code is available on Google Code.

Thoghts?, ideas?, improvements? all welcome :D .

October 9, 2008

Antonio Ognio
gnrfan
Gnrfan.org
» Installing Cherokee 0.9.x on Ubuntu Hardy

The Chrerokee Web Server is an extremely fast modular opensource HTTP daemon written by my good friend Alvaro Lopez Ortega from Spain. The project has recently been making great progress towards the 1.0 release. The product has been very stable for years and since version 0.6 includes a web-based administration interface so you can avoid tweaking text files manually like you still have to do with Apache, Lighttpd or nginx.

Installing the latest Cherokee package in Ubuntu Hardy can be a little tricky. The version that’s included with the distribution is mantained by the MOTU team and based on the Debian version mantained by another good friend Gunnar Wolf from Mexico.

The packages for the latest version of Cherokee are mantained by Leonel Nuñez, also from Mexico, and are found in his PPA apt repo so in order to install them on Hardy you have to follow these steps:

STEP 1) Add the PPA repo to /etc/apt/sources.list

Simple adding this two lines to the files does the trick:

deb http://ppa.launchpad.net/leonelnunez/ubuntu/ hardy main

deb-src http://ppa.launchpad.net/leonelnunez/ubuntu/ hardy main

STEP 2) Configure the prefered version of the packages at /etc/apt/preferences

This is the most tricky part, simply add these lines in this file. If you don’t have it just create it.

Package: cherokee

Pin: version 0.9.4-1*

Pin-Priority: 999
Package: cget

Pin: version 0.9.4-1*

Pin-Priority: 999
Package: libcherokee-base0

Pin: version 0.9.4-1*

Pin-Priority: 999
Package: libcherokee-base0-dev

Pin: version 0.9.4-1*

Pin-Priority: 999
Package: libcherokee-config0

Pin: version 0.9.4-1*

Pin-Priority: 999
Package: libcherokee-config0-dev

Pin: version 0.9.4-1*

Pin-Priority: 999
Package: libcherokee-server0

Pin: version 0.9.4-1*

Pin-Priority: 999
Package: libcherokee-server0-dev

Pin: version 0.9.4-1*

Pin-Priority: 999

When a newer package appears in the PPA repo it will be installed or upgraded. Version 0.9.4-1 is there simple because it was the current packaged version at the time of writing this blog post. The important bit is having Cherokee 0.9.x and not Cherokee 0.5.6 installed in your box.

STEP 3) Update your APT sources and install Cherokee

$ sudo apt-get update

$ sudo apt-get install cherokee

That’s it. Give it a try! I’ll be using it for serving static content here on my blog.

October 1, 2008

Jesús del Carpio
jj
Jj's blog
» CSS sin C

  1. El único elemento al que se puede agregar atributos “id” o “class” es DIV
  2. Cada elemento debe ser estilado específicamente
  3. La hoja de estilos sólo asignará estilos a clases o elementos por ID, nunca a nombres de elementos
  4. Nunca se asignarán estilos a elementos dentro de elementos identificados
  5. Asignarás atributo “id” al elemento BODY de cada página para diferenciar los estilos
  6. Nombrarás los estilos de acuerdo al aspecto visual y no al significado en la página
  7. No harás reuso de estlilos
  8. No combinarás clases en un elemento

Y sobre HTML sin semántica

  1. Usarás tablas para mostrar elementos secuenciales
  2. Usarás párrafos para diseñar menus
  3. Los únicos elementos que existen son DIV, P, A, B, I, IMG, FORM e INPUT
  4. Los atributos “title” y “alt” son irrelevantes
  5. Terminarás las discusiones son “así se ve bien”.

Más ideas?

Ojo que éste es un post sarcástico.

September 15, 2008

Antonio Ognio
gnrfan
Gnrfan.org
» On microblogging or why do I post stuff on Twitter?

I’ve explored this topic some three or four times chatting with geeky friends. The last time was a couple of days ago after a very nice lunch at El Huarique peruvian seafood restaurant in Miraflores. So I want to elaborate a bit about my reasons but, for the impatient, the basic idea is I do like the whole microblogging concept because I think it adds value to the web and Twitter is perhaps the most widely known microblogging tool today.

So why do I post stuff on Twitter? Because I think it lets me share almost immediatly stuff worth sharing with people who might care about it. Yes, as anyone else I might be posting superfluous stuff are some cryptic message that only matters to me but I try to balance the usefulness of the service as a thought sink and a news wire.

I’ve been using twitter since the first days the service went live and have updated my status around 2600 times since then. I admit I have many times shared stuff that is only relevant to my friends that also happen to follow me or to people living in my city or country but I’ve seen new people follow me regularly, at the rate of one and sometimes two need followers per week. I have now 192 followers which seems to prove I’m getting read, at least by some of them :)

Many people quit using Twitter because they feel they have too much stuff to read and too little of it is useful for them. It’s the well known signal/noise ration thing. I’ve somewhat solved that problem by just reading the last few pages of the feeds from people I follow only from time to time, when I have some time to do it. For me, microblogging is much a write-oriented activity than a read-oriented one. It works nicely that way for me so I don’t feel it like a big interruption.

The Web was created to share experience and ideas

The World Wide Web was created on top of previously existing Internet infraestructure by a scientist with the single purpose of instantly sharing papers and the details of very costly experiments so teams in the other side of the world could avoid repeating the work. All other uses including porn are posterior :) I’m sure most web users of today miss this point since they are most likely to have become web surfers for accessing a public service like Hotmail, reading the newspaper for free, get some electronic banking done or sharing pictures with friends and family. So yes, the web should be all about sharing your knowledge and experience with colleages around the world but that didn’t happen for mere mortals until blogging became widespread.

Blogs saved the Web

I can’t trace the phrase to the place I first read it but the idea is this: before blogs and blogging became popular the web was becoming an increasingly boring place where only the corporations were publishing content reflecting their views and opinions. Those days If you were an individual and wanted to push some content to the web you had to be some sort of HTML geek and learn at the very least how to use a web form to upload pages to Geocities if you wanted to avoid the hassle of using FTP. So publishing content was mostly hard to the average Internet user and something only a few geeks knew how to do and the fewer geeks actually were doing. The picture today is very different. Blogging is some sort of viral thing and lots of people have a blog because their friends have a blog or have been inspired to start blogging by reading someone else’s blog. Today the problem does not seem to be the technical details of blogging but finding content worth sharing with the world :)

Blogs save my day. Everyday.

At least in the world of computer geekery I live day to day blogs are generally a key resource for having some task completed. Blog posts are serving many times this days as the drafts for some documentation Before blogs the only sources for technical help were books, the vast majority of them not freely available on the web, magazine articles, also only a very small part available on the web, public archives or mailing lists or news groups, most available but not generally formatted as articles and irc channels, great for interactivity but not useful for long detailed explanations. Yes, I’m not forgetting the technical articles at public knowledge bases that the big IT transnationals usually have but with the advent of opensource a lot of products you use do not come from corporations and don’t have this kind of knowledge bases available. It is true that blogs are not the only tools that helped improve considerably the general availability of technical articles: Wikis serve today a key role in creating and mantaining community-generated content but they are generally community-owned resources and not private property people get to do as they think it’s best like with their own blogs.

People has been sharing short pieces of text for years

People have been posting links together with a very brief explanations of the content on IRC for ages. If you post even a medium-sized chunk of text on an IRC channel you’re most likely piss someone else off since your text will probably take most of the available screen space rendering the other participant’s messages unreadable. When you do IRC you quickly learn to post in the short using services like Pastebin to make bigger pieces of text available to your peers.

IM users learned quickly to alter their status message to reflect their mood or publicize something. MSN Messenger users came to the point of chatting by continously changing their status in the occassion of the service being broken and not letting the users exchange direct messages.

So my point here is before Twitter and the whole microblogging ball got rolling Internet users had been exchanging self-contained short pieces of text effectively.

Microblogging is a valuable subset of blogging

Microblogging is still very new. By definition it’s all about blogging short pieces of text generally short enough as to have one microblogging post pushed to cellphones with just one SMS message. This is precisely what Twitter offered and since then it has quickly become an extremely popular service, at least among Internet geeks surely not the general public.

You can very accurately think of microblogging as the plain posting of very short self-contained text bodies. By self-contained I mean a piece of text that is not dependent on the reading of some other piece of text in order to understand it’s whole meaning. That’s why microblogging is useful for expressing your mood, sharing a remarkable quote, posting a link and answering a question like Twitter’s What are you doing? :)

The whole microblogging thing is not dependent on a service like Twitter. It could have been easily implemented just by creating short blog posts under a certain category in order to have a separate syndication feed and have others aggregate it on any feed reader perhaps ignoring the title. Yes, this would lack the SMS and IM gateways but that’s not something that can’t be solved by adding some extre code to the blog engine as a plug-in.

Blogging and microblogging are not just talking to yourself

Comments are as important in a blog as the post body. When someone blogs something that is hot you’ll see how people will comment and add useful additional information, their own experience, corrections, suggestions and possibly challenge the very idea of the post. This is great for the reader and a great service for the casual community of readers that forms around a blog post. When this happens your feed gets added to people’s feed readers and your posts get linked by people’s post having Google bring more and more readers to your blog as an important effect.

I’ve experienced something alike happens with microblogging. If you post stuff that is only relevant to yourself you’ll get no responses and people will become tired of following you removing your stream from their list. When you post useful stuff, interesting ideas or just amusing thoughts you’ll get responses, conversations started and even more followers.

Yes, since the way current microblogging tools work is essentially a feed reader it’s somewhat close to a popularity contest: you’ll end up following those guys who most of the people you follow (e.g. your friends) are also following and you’ll stop being followed if you don’t do the microblogging thing often or mostly post boring stuff.

Blogging is hard, microblogging is easy

That’s exactly why writting a good blog post is so hard and writing a bad microblogging post is so easy :) Both blogging and microblogging can suck a lot of your time. It’s just they suck it in a completely different way.

Writing a good blog post is not just about having a good idea. You have to match it with a good writing technique and decent style. The length of the article is also key: it must be long enough to engage the user and provide useful details but not that long as to have the user only scan the text or go straight to the conclusions. It sucks your time by writing, reading what you have written, rewriting and correcting and getting the post in good shape. It takes some serious time for most of us. I must be writing this post for at least one hour already.

Writing a good microblogging post instead is much more about picking the right stuff to share. Yes, it also takes skill in writing in a concise way and services like Tinyurl help a lot in fitting long urls in the very reduced space but the good taste on picking what to share perhaps remain the key part of it.

But the thing I find great about microblogging is being able to share something really quickly, almost instantly once you conclude it’s something worth sharing. With microblogging, I have posted links to blog posts, new software or news items just after reading a few lines for friends to pick’em up and have received valuable feedback and comments by the time I had finished reading the piece.

With a blog, you have to invest the time need to round a decent post. Before microblogging became a bit popular I think I was missing sharing many things I wanted to share. I’m the kind of person who takes the time to post something interesting to a forum or mailing list I participate at from time and like to comment with my friends in person stuff I’ve found and I think is useful or noteworthy. For me this microblogging thing is more about accomplishing the same thing but with a new level of efficiency or at least a different dimension.


It says in Spanish “God created the world in six days and in the seventh He twitted.”

Microblogging usage patterns and available tools

In a future post I’d like to explore some microblogging usage patterns including mine and also review some of the available tools. I suspect some of the tools are there only they are not widely known and others simple don’t exist. I’d love to be able to easily read what other microbloggers are saying about Linux, Python or Mac OS X, all of them topics I am interested in but can’t think of a tool helping with that for example.

Conclusions

I find microblogging valuable and it’s benefits worth the price you pay in time. For me, microblogging is just like regular blogging only in a much shorter format so it’s faster and easier to share stuff. The quality of the your posts matters as much as in regular blogging and my advice is to balance the use of the tool for expressing your thoughts, mood and opinions and as a medium to quickly push interesting and valuable stuff to friends and the general public.

July 25, 2008

Antonio Ognio
gnrfan
Gnrfan.org
» TinyURL got custom aliases

I’ve just realized TinyURL got custom aliases, that is, you can customize the part of the URL beyond their domain to point to the desired URL. I like it. I had that idea myself some time ago. So now http://tinyurl.com/gnrfan redirects to this blog. Pretty neat, huh? The only problem, in this specific case it’s I’ve got a 17 characters url shortened to 25 :)

It looks like not all words are available. When I tried to point to the RIAA homepage using the custom alias “suckers” I got a message telling me that custom alias is not available and no, it’s not somebody grabbed it before. Seems fair.

What are you waiting for? Go grab your custom alias now!

July 14, 2008

Cesar Villegas
slayer
» Web de Panamericana Television suspendida por falta de pago

Que verguenza realmente, el otrora canal mas importante de la Televisión Peruana esta con tantos problemas que no puede ( o no quiere) pagar los costos de mantener su portal de internet, tal es asi que sus acreedores no tuvieron mejor idea que ponerles este letrerito:

Web de pantel suspendida

No es broma, hasta el preciso instante de la publicación de este post, ese mensaje aparece en su portal: http://www.pantel.com.pe/

No es ninguna leyenda urbana que “Genaro NO PAGA”

March 30, 2008

Jesús del Carpio
jj
Jj's blog
» Help us help you

Hopefully non geeks and non tech people will land in this site and read it and undestand it and download a decent browser and actually use it in order to save us.

Tell your friends about the new Internets they are missing using a 7 year old browser!

http://www.savethedevelopers.org/

January 31, 2008

Jesús del Carpio
jj
Jj's blog
» Where does your web developing time go?

Web design time pie chart

Vía Patrick Logan

January 24, 2008

Jesús del Carpio
jj
Jj's blog
» Looking for Chuck Norris?

  1. Anda a http://www.google.com/
  2. Tipea “find chuck norris”
  3. Dile a Google que estas con suerte (click en I’m feeling lucky)

Encontrado en el blog de Andre Noel

January 6, 2008

Jesús del Carpio
jj
Jj's blog
» Lack of moderation :(

It’s sad and funny to see what happens when you trust on the Internets for feedback.

This is what I ran into when looking at the Vote for sexiest geeks in 2007

Sexiest geek? WTF???

Other than that, most of the girls on the list are quite hot!

November 24, 2007

Jesús del Carpio
jj
Jj's blog
» Problema actualizando la base de datos de Wordpress?

Anoche quise entrar a moderar algunos comentarios de spam que han caido por acá, y me encuentro que al entrar a wp-admin, Wordpress me indica que la base de datos esta outdated y necesita actualizarse.

Muy extraño debido a que no he hecho ninguna actualización, tengo la misma versión de Wordpress y la bd se mantiene intacta desde mi última actividad, salvo que mis amigos en Aureal hayan estado moviendo versiones de PHP, dbms o algo por el estilo.

Bueno, dado el mensaje procedí con la actualización y me encuentro con un error de BD, que decía:

WordPress

WordPress database error: [Unknown column 'user_nickname' in 'field list']
SELECT ID, user_nickname, user_nicename FROM wp_users

Fuí a ver la tabla wp_users y efectivamente no tiene la columna “user_nickname” lo que me pareció extrañísimo… esperaría que si tenga tal campo, así que con un ALTER TABLE lo parché y quise volver a intentar el upgrade.

Ahora ya no me mostraba el error, pero tampoco mostraba nada, nada de nada, así que tampoco fué esa la solución, borré la columna que acababa de crear para volver a como estaba.

Claro, también actualicé mi blog a la última versión de Wordpress estable disponible, pero tampoco fué el problema.

Luego de quedarme sin mayores ideas de qué pudo estar pasando, fuí a Google a buscar la solución, puse el query que Wordpress intentaba hacer a la tabla wp_users comoc riterio de búsqueda y caí en unos foros en portugues de un chico con mi mismo problema.

Ahí encontré un vínculo a una página donde estaba la solución a mi problema :D, contenía el siguiente comando SQL para solucionar

UPDATE `wp_options` SET `option_value` = '5183' WHERE `wp_options`.`option_id` =73 AND
`wp_options`.`blog_id` =0 AND CONVERT( `wp_options`.`option_name` USING utf8 ) = 'db_version' LIMIT 1 ;

Al ejecutar tal cual en mi db no encontraba ningún registro… con un poco de SQL encontré que en mi caso el parámetro “option_id” debía estar en “89″

mysql> select option_name,option_value,blog_id,option_id from wp_options  WHERE  wp_options.option_name  >
+-------------+--------------+---------+-----------+
| option_name | option_value | blog_id | option_id |
+-------------+--------------+---------+-----------+
| db_version  | 1            |       0 |        89 |
+-------------+--------------+---------+-----------+
1 row in set (0.00 sec)

Así que modifiqué el parámetro y listo :D

< .`blog_id` =0 AND CONVERT( `wp_options`.`option_name` USING utf8 ) = 'db_version' LIMIT 1 ;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

Regresé a la actualización de Wordpress y luego de proceder todo terminó adecuadamente y pude volver a entrar a mi Dashboard.

October 26, 2007

Jaime Wong
jgwong
Sueños de Azul
» Me gusta el logo de Mozilla Prism

Me gusta mucho el nuevo logo de Prism.

Logo de Prism

Prism, antes conocido como WebRunner es un proyecto de Mozilla para presentar aplicaciones web (e.g. GMail, Google Calendar) como una aplicación de escritorio más. Es, en esencia, una ventana de Firefox que contiene cierta página específica sin barra, decoraciones ni botones de navegador. Lo interesante es que piensan facilitar a las aplicaciones web el funcionamiento offline (desconectado) así como acceso al hardware 3D.

July 31, 2007

Jesús del Carpio
jj
Jj's blog
» Pownce invitations

So I've got 6 Pownce invitations to give away. I am willing to send them to anyone who comments on this post and does these 3 things:

  • Puts their email in rot-13
  • Adds a link to their picture displaying sexy underwear being worn that I can confirm it's theirs and not just some random picture from the Internets.
  • Say how cool I am

OR, you could also try InviteShare :) .

Continues...

July 25, 2007

Jesús del Carpio
jj
Jj's blog
» Django Master Class

Django Master Class

Wow, what a great great Django lesson!, touches your heart and topics such as:

Continues...

July 12, 2007

Jesús del Carpio
jj
Jj's blog
» Web Authoring Statistics by Google

The other day I ran into this analysis made by Google about web authoring statistics.

It is quite interesting to know which tags are frequently used, and what attributes are used the most with those tags, what is the number of css classes used by page, as well as how much have fscked up authoring applications markup has invaded the web :)

Continues...

May 8, 2007

Jesús del Carpio
jj
Jj's blog
» A ver muchachos, por un punto en el examen…

(08:31:40 PM) J: ~
(08:32:36 PM) lau: toy en examen
(08:32:38 PM) lau: q es la web 2.0
(08:32:45 PM) J: hahahahaha
(08:32:51 PM) J: tienes a decir "nadie sabe"

Ahora los examenes vienen con preguntas capciosas!

May 4, 2007

Jesús del Carpio
jj
Jj's blog
» No more Yahoo Photos

Good bye Yahoo PhotosAccording to Techcrunch, Yahoo will be anouncing the closing of Yahoo Photos later today replacing it with Flickr, now that they made all of us old fellows switch to the Yahoo ID login :?

It was about time, it was pointless to mantain both services. I just wish Flickr was a Google product, for some reason I just not in love with Picassa yet :( .

Continues...

April 27, 2007

Jesús del Carpio
jj
Jj's blog
» Gmail Text areas and Firefox

I was never too confortable with Gmail’s text areas for composing mails, I felt I had to fit my email in that tiny box with those thin letters.

Gmail compose text area - Arial

Continues...

April 25, 2007

Jesús del Carpio
jj
Jj's blog
» Comments behavior

I do not intend to talk about how to behave when commenting on a post. This is not about that. This is about how comments themselves behave on the Internet, they seem to get lost.

I am running into this situation more and more, as I get comments, or as I make them on other blogs.

Continues...