HT-AJAX e jQuery
1 de Junho de 2008 @ 17:46 - LucindoArquivado sob common lisp, programação, javascript, web | Sem Comentários | Link desta publicação | Enviar por e-mail
HT-AJAX (documentação aqui) é uma extenção do Hunchentoot que permite exportar suas funções lisp de modo que elas podem ser acessadas via JavaScript, usando AJAX. Um pequeno exemplo de uso dessa biblioteca está nesse post.
HT-AJAX suporta vários AJAX processors, como Prototype e Dojo, mas não jQuery. Então fiz um pequeno patch adicionando suporte a jQuery.
Download: ht-ajax_0.0.7-jquery.patch
About State
31 de Maio de 2008 @ 21:57 - LucindoArquivado sob common lisp, programação | 1 Comentário | Link desta publicação | Enviar por e-mail
Two options for lispers:
Logo legal
22 de Maio de 2008 @ 19:44 - LucindoArquivado sob programação, erlang, web, computação | Sem Comentários | Link desta publicação | Enviar por e-mail
Logo do IRRLAB (site pessoal do Ivan):

State: you’re doing it wrong
22 de Maio de 2008 @ 18:20 - LucindoArquivado sob programação | 2 Comentários | Link desta publicação | Enviar por e-mail
I’m completely convinced that mutable objects and the whole approach that is sort of implied by the design of Java, C#, Python, all the languages that followed along this path, is very much the wrong way to do most things… it is ok to do somethings, but it’s the wrong way to do most things.
Mutable objects are the new spaghetti code, and by that I mean that you eventually, with mutable objects, create an intractable mess, and encapsulation does not get rid off that, encapsulation just means: well, I’m in charge of this mess. But the real mess comes from this network you create of objects that can change, and your inability to look at the state of a system and understand how you got there, how to get there to test it next time… so it’s hard to understand the program… it’s very hard to test it. I think that’s interesting in telling all the emphasis on test driven design. I think people are driven to this because they know their systems are completely intractable…
Rich Hickey - Screencast: Clojure Concurrency (”transcrição” do minuto 21 ao 23)
The Zen of Python
1 de Maio de 2008 @ 15:32 - LucindoArquivado sob programação, python | Sem Comentários | Link desta publicação | Enviar por e-mail
marvin:~ lucindo$ python Python 2.5.2 (r252:60911, Apr 26 2008, 14:32:15) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! >>>
Para lembrar sempre
30 de Abril de 2008 @ 14:00 - LucindoArquivado sob programação | Sem Comentários | Link desta publicação | Enviar por e-mail

Hunchentoot e REST, parte 2: suporte a ETags
27 de Abril de 2008 @ 17:18 - LucindoArquivado sob common lisp, programação, web | 2 Comentários | Link desta publicação | Enviar por e-mail
Bom, esse post é mais um snippet de como implementar um serviço REST usando Hunchentoot. Dessa vez adicionei suporte a ETags no código do outro post. Ficou assim o tratamendo das requisições:
(defvar *data-id* “e8d8993494ffc11:b8e”)
(defun get-data-id (target)
“get the last id for requested data”
*data-id*)
(defmethod handle :around (request-method)
“ETag support for all methods”
(let ((data-id (get-data-id (script-name)))
(last-id (header-in :If-None-Match)))
(setf (header-out :ETag) data-id)
(if (and last-id (equalp last-id data-id))
(setf (return-code) +http-not-modified+)
(call-next-method))))
Fazendo um request normal:
GET /rest HTTP/1.1 Host: eddie HTTP/1.1 200 OK Content-Length: 3 Content-Type: text/html; charset=iso-8859-1 Date: Sun, 27 Apr 2008 20:07:53 GMT Server: Hunchentoot 0.15.6 Etag: e8d8993494ffc11:b8e GET
Agora o cliente passando o ETag:
GET /rest HTTP/1.1 Host: eddie If-None-Match: e8d8993494ffc11:b8e HTTP/1.1 304 Not Modified
Suportar ETags é muito fácil e se o cliente do seu serviço souber usar é muito útil para os dois.
Download: rest.lisp
Testes unitários
27 de Abril de 2008 @ 16:44 - LucindoArquivado sob programação | Sem Comentários | Link desta publicação | Enviar por e-mail
As to your real question, the idea of immediate compilation and “unit tests” appeals to me only rarely, when I’m feeling my way in a totally unknown environment and need feedback about what works and what doesn’t. Otherwise, lots of time is wasted on activities that I simply never need to perform or even think about. Nothing needs to be “mocked up.”
Donald Knuth em entrevista a InformIT
Mudança de planos
22 de Abril de 2008 @ 16:09 - LucindoArquivado sob programação, python | Sem Comentários | Link desta publicação | Enviar por e-mail

David Heinemeier Hansson na Startup School 2008
20 de Abril de 2008 @ 21:10 - LucindoArquivado sob web | Sem Comentários | Link desta publicação | Enviar por e-mail
Como programador ele é um ótimo businessman
(blog ‘lucindo) | http://blog.lucindo.com.br