While looking at this question: Why all the Active Record hate? I found myself thinking of a general theme that ActiveRecord pattern is good when you have little or no inheritence in your objects, and DataMapper, while more complex, works much better if you do.
Given that its never possible to perfectly match objects to relational datab...
I'm planning on creating a game that contains a landscape with objects on it. The landscape will be defined using a heightfield, and the objects will move about on top of, and fly over the terrain. If you've ever played the old games Marble Madness and Virus/Zarch, that's the kind of complexity and style I'm trying to create.
I've seen ...
I have a page in my desktop app, and I've implemented simple grab-and-pan. It works great.
When you are panning in this way and you are release, the page stops dead where you dropped it.
I'd like it to continue slightly with some momentum, and stop eventually. Rather like the 'throw' in the iPhone UI, I guess.
I'm not really chasing...
I've become very curious lately, what is it about Java that made it so popular? I've avoided learning it in detail because it seems like a very poor language at a very basic level. A good language should make simple operations simple (not too much boilerplate to do something simple and common like loop over a collection, create a helpe...
I've been doing some simple rails Apps lately. I know ruby quite well, but when I started doing things "the rails way" I noticed that some things were done "just because" and It's hard for a (rails) newbie to know what does the code do.
Has rails missed the point and turned into some kind of 4th generation language? I mean, you HAVE to ...
I've been thinking about the definition of "simple" for a while now, spurred by things like "Real Simple" magazine, which is essentially a vehicle for advertisements for more stuff to buy that clutter up your life.
Some people see doodads, like remote controls, as simplifying your life, while others see the remote control as something ...
This may seems rather argumentative, but I just went through SQLAlchemy's ORM tutorial and ended up with the following code:
from sqlalchemy import create_engine
from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
eng...
In medical school they teach students:
"If you hear hooves, think horses not zebras".
In other words, look first at the simplest explanation for a problem.
What's a programming example of this?
...
In my travels in Oracle, the 'stragg' function, or 'String Aggregator' was life-saving when I had to create dynamic SQL queries on the fly.
You can read up about it here: http://www.oratechinfo.co.uk/delimited_lists_to_collections.html
The basic use of it was:
select stragg(fruit) from food;
fruit
-----------
apple,pear,banana,strawb...