December 2011
1 post
Extending native Java array types to Clojure...
; Copyright (c) Daniel Kwiecinski. All rights reserved.
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this...
November 2009
1 post
With OOP you’re set up to do the wrong thing....
This is splendid. Rich Hickey is talking about OOP in second part of Clojure for Java Programmers. At 35:40 he says: [With OOP] you’re set up to do the wrong thing. From the concurrency standpoint its complete catastrophe. It’s a disaster. It’s unworkable. Eventually you’ll die with locks. You either die trying make them work or to try to understand them or just from the stress.
I second...
October 2009
1 post
Why VanadiumJS is different
Recently I got an email which sugessted some people still don’t get what the VanadiumJS is all about. Here is my explanation:
> Vanadium won’t replace the need for server side validation but the client side instant notification is great for usability.
< Vanadium is not intended to replace the server-side validation. But it is not the client-side validation toolkit only. The real...
September 2009
1 post
erlang records json
JSONERL is published. It is simple tool for turning your erlang records into json and back. Here is an example of the usage of jsonerl:
-include("jsonerl.hrl").
-record(artist, {name, year_of_birth, city, photo, movies}).
Artist = #artist{name = <<"Luc Besson">>, year_of_birth = 1959, city = <<"Paris">>, photo = <<"http://is.gd/3pYJF">>, movies =...
August 2009
2 posts
VanadiumJS.com is live !!!
I’m pleased to announce that the first version of demo site presenting my client-side validation toolkit Vanadium is on the go.
Vanadium is declarative, client-side validation toolkit. There is no need for coding. Just use simple markup in side class attributes (or if you are HTML purist you may prefer to attach it as external configuration file in json format).
E.g. for required field one can...
The BeeBole Erlang/Web Tutorial, Webmachine-Style
Justin Sheehy posted here his webmachine version of a small but fun web application created originally in mochiweb by Hughes Waroquier from BeeBole. Hughes posted it in a form of neatscreencast tutorial. It’s worth watching.
Justin’s version is dated from October 22, 2008 and at that time webmachine version was < 1.0. Since that time the webmachine progressed and API has changed. Moreover,...
July 2009
3 posts
Note to myslf: there is bitstring comprehensions...
It easy to handle streams of bytes in Erlang. For example consider the following simple task: given a stream consisting of 3-byte chunks we want to return a stream consisting of those 3-byte chunks whose first byte is zero.
This can be written in the following manner:
keep_0XX(Bin) -> << <<0:1,X:2>> || <<0:1,X:2>> <= Bin >>.
I like it, I hope...
Simple HashMap in JavaScript
I’ve implemented HashMapJS, a simple hash map like implementation. The project is located at github.
Here is the code with the usage examples:
/*
=====================================================
@license MIT
@author Daniel Kwiecinski
@copyright 2009 Daniel Kwiecinski.
@end
=======================================================
*/
var HashMap = function() {
...
Dynamically scoped variables in Ruby
Recently I had a need to use routing definition of one RoR from the other one (don’t ask why it’s irrelevant to this post ;) )
As you may know Rails routing mappings are stored in global variable ActionController::Routing::Routes. So together with Craig McMillan I’ve hacked really evil piece of code ;) but it does the job!
So here it goes:
# evil Ruby dynamic variables
class DynamicValue
...