News for hackers. Stuff that matters.

its2010already

Re:Show HN: Business.txt - Standard Proposal on Monday August 27, 2012 @01:39PM (#4439864)
Shouldn't we be using XML for this???
Re:Meet Korma, a SQL DSL for Clojure on Wednesday November 02, 2011 @04:37PM (#3188826)
It does make sense to be able to define business/application logic as reusable query components.

For example, if your PERSON entity has TITLE, FIRST_NAME and LAST_NAME fields, that little bit of logic that concatenates them together in the right way to form a full name is something that is useful to define. Likewise, setting up a join of tables that is used many times in your application is something that Korma will let you do.

Even though these components may be implementable on the database side (as user defined functions or views), it may not always be possible (or desirable) to do that way.

Re:Solar-panel "trees" really are inferior on Saturday August 20, 2011 @12:29PM (#2906968)
All I have to say is the guy writes pretty darn well for a 13-year old. Perhaps his experiment is flawed, but I was very impressed by his writing skills, and I know it will serve him well in the future.
Re:Stop hating Java on Friday July 22, 2011 @11:49AM (#2793999)
I have a question...

The article states:

... Whenever you needed a pluggable system in your code you had to abstract away some concepts in order to make it work. Ruby lets us do it much easier and that’s cool. ...

Can someone give a concrete example of this?

Re:Google search volume by language (WebGL) on Wednesday May 25, 2011 @12:28PM (#2584525)
Interesting - around Idaho there is a orange spike. Wonder where and what exactly that is.
Re:Lisp: a cult I almost joined (2005) on Friday March 25, 2011 @10:36AM (#2368585)
Surely this proves Lisp is a cult: http://pics.livejournal.com/codedot/pic/0002t3b1
Re:I always forget the argument order of the `ln -s` command on Wednesday December 08, 2010 @05:12PM (#1984853)
My mnemonic for this is to remember that the link name is optional. When you specify only one argument the link name is the base name of the target (in the current working directory). Therefore the link name must be the second argument.
Re:Using 4LW to reach sites with domains seized by the DHS on Sunday November 28, 2010 @10:58AM (#1947519)
How about just putting those entries in your /etc/hosts file?
Re:Utterly sensible HTML templating in Common Lisp on Tuesday November 16, 2010 @06:10PM (#1912134)
The problem I always see with practically all templating systems is the lack of proper escaping of input data.

For example, the function 'tag-name' really needs to HTML-escape the input parameter content. The simple example (tag-name "div" "Hello world") breaks down when "Hello World" is replaced by a variable reference.

Fortunately this is an relatively easy problem to solve. A better definition for tag-name is something like:

(defun tag-name (name content) (html (format nil "<~A>~A</~A>" name (to-html content) name))

The function to-html will return the HTML-escaped version of content. The function html returns an object/string that marked as already being HTML-escaped. They work together so that (to-html (html x)) just returns x.

A similar type system can be set up to handle url escaping rules.

If the templating system doesn't keep track of what is escaped and what isn't then that burden is left to the programmer with all of the associated risks of producing malformed output and creating opportunities for injection attacks.