Welcome to Barricane.
We hope you will find what you are looking for.
We hope you will find what you are looking for.
After having to reinvent this query three times, I'm actually blogging it this time. It always seems obvious afterwards, but takes me about half and hour to write fron scratch.
Here's a table:
CREATE TABLE foo (
id INT(10) NOT NULL AUTO_INCREMENT,
uid INT(10) NOT NULL,
value VARCHAR(50) NOT NULL,
PRIMARY KEY (`id`),
INDEX `uid` (`uid`)
)
containing:
id, uid, value
1, 1, hello
2, 2, cheese
3, 2, pickle
4, 1, world
The data represents two objects (uids 1 and 2) which go through a couple of values. (Google 'event sourcing' and 'CQRS' for more info.)
I want to make a view of the 'latest' values of each uid, to simplify querying.
It can be done with:
select id, uid, value
from foo as a
where a.id = (select max(id) from foo where uid = a.uid group by uid)
;
The above query produces:
id, uid, value
3, 2, pickle
4, 1, world
There is bound to be a more efficient way to do this, so I'll ask on StackOverflow...
Posted on 08 February 2012.I always forget how to create an openssl certificate, so here it is:
openssl genrsa -out privatekey.pem 1024 openssl req -new -key privatekey.pem -out certrequest.csr openssl x509 -req -in certrequest.csr -signkey privatekey.pem -out certificate.pemPosted on 24 November 2011.
I would a like a new tool to help with Javascript development, both in NodeJS and (possibly) on the browser.
What I want is to be able to run (and/or unit test) a NodeJS app (on the built-in V8). As an extra output I would like a transformed version of the source, annotated with Google Closure JSDoc Type Expressions.
I can't see any technical reason why this would not be possible.
Who will write this? It's probably a few weeks of fulltime work, or more if you don't already know the innards of V8.
Why would it be useful?
Please Google, Joyent, or Anyone Else, can you write this for us?
Thanks,
Chris.
Posted on 06 October 2011.I'm going to participate the the Ludum Dare October Challenge. Unfortunately I have just 3 hours per week for game development. I don't think there's any chance of meeting the end of the month (12 hours dev), so I'm giving myself a year (150 hours).
The game will be called Anastom, pronounced anAStom, as I have the domain and am not currently using it for anything.
It has the following design constraints:
I have the following ideas:
Platform:
I'll blog on progress each and every Friday, to keep my motivation up.
Lets see how I do...
Posted on 30 September 2011.I'd like to take a minute to thank Walter Bright for creating the D programming language.
I had a project, which I had previously written in Python, but which I now needed to port to a more runtime-efficient langauge (a single static executable and obfuscated source are also a bonus for a commercial product).
The standard library (for D 2.0) had all the file a directory manipulation functions I needed, easily as rich as Python and an awful lot easier to use than APR or POSIX.
I had initally attempted the port using C and the Apache Portable Runtime, but I found it hard work after years of Python and Javascript. I quickly got bogged down in memory pools, string handling and shared state.
I decided to give D a try:
There are a couple of issues:
Basically, if your now mostly a script programmer and think you need to do go back to C for some lower level work, give D a try.
Posted on 06 September 2011.All of our previous blog entries are available here.