Better HN
topnewbestaskshowjobs
Log inSign up

its2010already

22 karma · joined Nov 16, 2010 (16y ago) · 12 submissions

Submissions

comment 14y ago · link · parent

Shouldn't we be using XML for this???

2.

How we reduced our Rails test runtimes by 10x(engineering.socialcast.com ↗)

2 points · by its2010already · 14y ago · discuss

3.

Ql.io - declarative aggregation gateway for HTTP APIs(infoq.com ↗)

1 points · by its2010already · 14y ago · discuss

comment 15y ago · link · parent

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.

comment 15y ago · link · parent

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.

comment 15y ago · link · parent

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?

comment 15y ago · link · parent

Interesting - around Idaho there is a orange spike. Wonder where and what exactly that is.

comment 15y ago · link · parent

Surely this proves Lisp is a cult: http://pics.livejournal.com/codedot/pic/0002t3b1

9.

Ask HN: Why can't I read HN with my Blackberry?

5 points · by its2010already · 15y ago · 2 comments

comment 15y ago · link · parent

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.

comment 16y ago · link · parent

How about just putting those entries in your /etc/hosts file?

comment 16y ago · link · parent

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.