Monday, March 09, 2009

Apparently I am not not alone

Hey Google,

I really hate that as soon as I sign in to write (which inevitably leads to a few searches for links) you start recording every search result I click on.

Where's the "No evil for me, thanks" checkbox?

Blog end

Labels: , , , , , ,

Sunday, March 08, 2009

What'd they say?

While I was writing this blog, these are some of the quotes I was reading.
They are not all profoundly earth-shattering, but if they don't raise a few smiles then I am afraid your experience is insufficient for the current position.

Unix stores the smarts in the user; Windows stores the smarts in the OS.
If you can't traumatize a child at least once a day, what's the point of having them?
This absence of a defined way to manipulate test results for later display means that you have to take over the running of the tests if you want to do something interesting with the report
I would argue that the smartest programs -- the kind we want running on our machines at Amazon -- are programs that are self-aware enough to know when their fundamental assumptions have been violated, and to have at least some decision-making ability built in for handling such situations. I think it goes without saying that you'd rather have your program tell you when things are going wrong, rather than have your customers telling you, perhaps days later.
We learn idioms and then apply a kind of pattern-matching to recognise problems that can be solved with an idiom we already know. Some idioms are easier to express than others in each programming language.
The journey from genetic code to behavior can be circuitous and capricious, whether that code belongs to a fish or a fisherman. We have to be very careful in slicing the fat of instinct away from the bone of intelligence, lest we have nothing left to sink our teeth into.
That [study on relative brain size to body mass] puts sharks and rays in the same vicinity as birds and mammals. It makes you doubt whether sharks really 'mistake' a surfer for a seal on a crunchy cracker, doesn't it?
The carnivores have stayed ahead at each stage of evolution, as Jerison has shown using cranial fossil casts of extinct herbivores and carnivores. Interestingly, in South America, which is devoid of advanced carnivores, the herbivores have tiny brains. Unchallenged by the mind behind the hungry jaws, these grass munchers lived fruitfully and multiplied in blissful ignorance. In any contest of wits, never bet on the llama.
The Great Chain of Being is, in one sense, a generalization gradient of rights, with species more proximal to us favored with protection and species more distant flavored with sauces
Inconvenient experiences don’t have Web-scale potential, and platforms which monetize the gigantic scale of the Web is the only way to compete with the control you’ve lost, the only way to reclaim value in the music industry. If your consultants are telling you anything else, they are wrong.
every workplace is crazy; the trick is to find a place that matches your kind of crazy.
Since large programs grow from small ones, it is crucial that we develop an arsenal of standard program structures of whose correctness we have become sure -- we call them idioms -- and learn to combine them into larger structures using organizational techniques of proven value.
the Buddhist concept he’d been considering, and that the notion that anything was without context wasn’t really plausible
custom medicines per dose will head toward the free (but you’ll pay for your DNA profile)
There is already a good deal of syntax in Lisp. It's not necessarily bad to introduce more, as long as no one is forced to use it.
Programming is difficult to teach and most programmers learn their chops by looking at working code and using it as the basis for building their own programs.
Finding a bug in one’s code isn’t so much a surprise as a feeling of déjà vu.
Ohhhh yesssss, I remember thinking I should check that condition
Shorter code is more readable when it is shorter by dint of expressing the underlying relationship, without irrelevant details.
There are no metaphors at all in software and this is exactly why building software is so damn hard
That’s a people problem. It’s solved by four feet of rubber hose in the car park

"If you already know what recursion is, just remember the answer. Otherwise, find someone who is standing closer to Douglas Hofstadter than you are; then ask him or her what recursion is."

HTML is CICS with fonts

I wasn’t sure what I was going to tell an old-Europe industrial airline company but the gig was in Amsterdam so naturally I accepted


The plural of anecdote is not data

Good design is often slightly funny. This one may not always be true. But Durer's engravings and Saarinen's womb chair and the Pantheon and the original Porsche 911 all seem to me slightly funny. Godel's incompleteness theorem seems like a practical joke

By delaying learning VRML, I avoided having to learn it at all

When someone is working on the code to either add functionality or fix bugs, they usually have lots of feedback (sometimes involving large hammers)


Each journalist has about twenty awards on his or her desk - that's just armour plating for their egos

The Stone Age didn't end because we ran out of stone

They might as well have written the book in Klingon -- ehh, no I guess not, too many geeks can read Klingon

I sometimes think that it would be a good marketing trick to call it an improved version of Python. That sounds hipper than Lisp

Strangely enough, if you want to make something that will appeal to future generations, one way to do it is to try to appeal to past generations

According to Hackett, code scavenging is worth re-visiting because the Web makes it easier to find code and re-use it. He points to sites where massive amounts of existing code are available for potential scavenging such as Google code search, Sourceforge, Code Project, Microsoft's Codeplex, and O'Reilly's Code Search. Others include the Free Software Foundation (FSF), FreeVBcode.com, Freecountry and Freshmeat.

I think the reasoning here is flawed, in that it supposes that reflection on how we think is an accurate way of describing how we think

Consciousness is actually a fairly deep tower of self-awareness, and it's for the most part utterly absent in computer programs

I’ve been thinking a lot about content and context lately. As it turns out, there is only context

The acts of the mind, wherein it exerts its power over simple ideas, are chiefly these three: 1. Combining several simple ideas into one compound one, and thus all complex ideas are made. 2. The second is bringing two ideas, whether simple or complex, together, and setting them by one another so as to take a view of them at once, without uniting them into one, by which it gets all its ideas of relations. 3. The third is separating them from all other ideas that accompany them in their real existence: this is called abstraction, and thus all its general ideas are made.

John Locke, An Essay Concerning Human Understanding (1690)

So what does Hardy mean when he says there is no permanent place for ugly mathematics? He means the same thing Kelly Johnson did: if something is ugly, it can't be the best solution. There must be a better one, and eventually someone will discover it. ("best" means "most beautiful", which means ...)

Cognitively, "think" is just search for a solution in a high-dimension of variables, so we can consider all thought as a type of search

Unskilled users don't mind a bit of syntax. People have a natural ability to ignore the things they don't understand, that's how children learn to speak

Because each trick works in different situations, our power stems from being able to shift from one trick to another. To ask which meaning is correct - to count, or match, or group - is foolishness. Each has its uses and its ways to support the others. None has much power by itself, but together they make a versatile skill-system

In order to be shared, information is extracted from natural language, reduced to its distinct informational elements, and tagged into a database

..., it often depends on some background knowledge; once you have that knowledge, it's blindingly obvious and trivial, but without it, you just get confused

Every teacher knows that; trying to teach someone who doesn't care is a painful chore, but when you have a student who does, you have to work hard to keep information flowing to them as fast as they're eating it up. And those are the ones who make the whole process of teaching worthwhile

An article in Fortune magazine a couple of years ago compared the academic qualifications of people in business and found the qualification that correlated most highly with success was a philosophy degree

Babies are born with the desire to learn about the beings who populate their world and the ability to store information about each individual separately. They do not expect all adults to behave like their mother or all children to behave like their siblings. Children who quarrel incessantly with their brothers and sisters generally get along much better with their peers

The human brain is a marvel of associative processing, but in order to make associations, data must be loaded into memory


ASTONISHING, said Death. REALLY ASTONISHING. LET ME PUT FORWARD ANOTHER SUGGESTION: THAT YOU ARE NOTHING MORE THAN A LUCKY SPECIES OF APE THAT IS TRYING TO UNDERSTAND THE COMPLEXITIES OF CREATION VIA A LANGUAGE THAT EVOLVED IN ORDER TO TELL ONE ANOTHER WHERE THE RIPE FRUIT WAS?

Indeed, it is hard to imagine that linguistic communication could take place if our species could not mindread

Show me a switch statement as if it had been handled with a set of subclasses. There is underlying deep structure here. I should be able to view the code as if it had been done with switch or as if it had been done with polymorphism

Although we here in this room are computer users and we are thus stuck with the same annoyances, distractions, and addictions as all computer users, we are also developers and programmers, and for us, the computing experience should be intrinsically different. Programming is the most empowering thing we can do on a computer, and that’s what we do. We write the code that makes the whole world sing

While the Borg pattern works in Python, I do not see it a either necessary or interesting.

If I were in the dynamic language camp, I would argue that if you only want one instance of an object, make sure that you only create one instance of the object. This is clearly in the spirit of dynamic typing

Everyone agrees that one of the most important elements of writing self-documenting code is giving your variables and objects meaningful names

Global variables are basically gone in object-oriented programming, except that fields are now the new global variables, and they can be abused just as badly

Now, there are various ways to get in trouble

“Do the dumbest, simplest thing that almost works”

After a coder has spent a week or so writing a couple thousand lines of code it is not a good idea to then suddenly say to him/her that you want to do something different

Freedom of expression matters more to me than a little extra static checking

If any intelligence at all is put into the code, it's typically "protected" by compile-time or runtime flags that allow you to turn it off, so your program can run in Stupid Mode

Every computer program is a model, hatched in the mind, of a real or mental process

That's your stockholm syndrome talking. The saving should happen automatically-- saving your work should be the default, not throwing away your work! How insane is that?

The developers who put a lot of effort into optimizing things and making them tight and fast will wake up to discover that effort was, more or less, wasted, or, at the very least, you could say that it “conferred no long term competitive advantage,” if you’re the kind of person who talks like an economist.

Unlike programs, computers must obey the laws of physics.

Without user testing, you are designing by guesswork and superstition.

A programming language is a collection of programs.

The next time that you complain that languages don't contain enough novel new features, try and remember the language designers quandary


All programming languages are arcane and cryptic, in different ways and to varying degrees.


In the history of programming languages a surprising amount of effort has gone into preventing programmers from doing things considered to be improper.

Hackers share the surgeon's secret pleasure in poking about in gross innards, the teenager's secret pleasure in popping zits.

They will still strive fiercely -- almost instinctively -- to exercise all options open to them to change their minds.

That's how programmers read code anyway: when indentation says one thing and delimiters say another, we go by the indentation.

In practice, the way to get fast code is to have a very good profiler, rather than by, say, making the language strongly typed.

We made bloated class heirarchies for the imagined benefits of reuse.

While the choice of programming language is typically a sensitive subject, the truth is that it is not the language, but the libraries that come with it that make a difference.

If we ask 800 billion questions today and expect to get instant answers, where were those 800 billion questions 20 years ago?


Simplicity for the writer can mean work for the reader. Putting an added burden on the writer can simplify things for a learner. Simplifying for the writer is the most counter-productive form of introducing simplicity.

Simple code is code that does exactly what it appears to be doing. Simple code is not code that looks simple and then goes and does something different.

You're an amateur developer until you realize that everything you write sucks.

I forgot Pascal 15 years ago. This is not the same as never having learned it. For one thing, you mutter under your breath a lot more.

But you know there's nothing quite as permanent as a temporary stop-gap.


Actually, there are languages that do it even worse than COBOL. I remember one Pascal variant that required your keywords to be capitalized so that they would stand out. No, no, no, no, no! You don't want your functors to stand out. It's shouting the wrong words: IF! foo THEN! bar ELSE! baz END! END! END! END!

It's fairly unusual for any of our projects to have any plan more elaborate than "fix the current bugs and chase the next shiny thing we see".

You can spend years creating mountains of class hierarchies and volumes of UML in a heroic effort to tell people stories about all the great code you're going to write someday.

But in practice a good profiler may do more to improve the speed of actual programs written in the language than a compiler that generates fast code.

Consider this (real) example:

ASSERT(pFoo = NULL);

Not only does the assert not do what it was supposed to do (check that pFoo is NULL), but it accidentally fixes the problem it was meant to detect. If pFoo is wrong (not NULL), this assert will set it to NULL, obscuring the problem. If the ASSERT is compiled away in a release build, the code will start working worse than it did in the debug build.

A language that wants to capture the hearts and minds of the blue-collar programmer needs to work very hard to have rules that are always simple and straightforward.

But parsing techniques are not greatly valued in the LISP community, which celebrates the Spartan denial of syntax.

I think a part of the problem is that traditional languages make us feel that we're productive because we can generate lots of code quickly in them. But is this a good thing?

Labels: , , , , , , , , , , , , , , ,

Saturday, March 07, 2009

Are we there yet?

Found an interesting project over there, but their wiki set me off a-ranting, and reminded me of some other blogs which got me a-thinking about languages, and if I can't rant here then WTF?

The interesting project is "enough", and their goal is to "design and implement the computing platform of the future"

Let's set up some points of agreement first (as in: if you don't agree with me on these, there's no point to you reading this, I'd recommend that instead)
  • No programming language is less ambiguous than natural language, because the former are all defined and standardised using the latter. People may often use natural language more sloppily, but they do that in the programming languages too!
  • The "most natural way to express" any idea is multi-paradigmatically. Outside of programming no-one ever expresses themselves using only objects, or only functions, or only ...
  • If "the best way to describe a system is the easiest for a programmer to use", then there can not be one best way to describe a system - apart from homework assignments.

Readability is the only problem. Enough code has already been written - the problem now is to understand enough of it in order to re-use the most relevant parts.


Maybe I've just been reading different books - but it seems to me the problems described on this page have more in common with the ideas of Chomsky, Jackendorf, Pinker, ... than Knuth, Wall, Fowler, ... Because the former group are much more aware of the fact that the real problem is *how people think*, not how they express themselves, nor how machines compute.

Unskilled users don't mind a bit of syntax. People have a natural ability to ignore the things they don't understand, that's how children learn to speak.
Surely also a programming platform can be inducted into ignorance of some superfluous ambiguity?

Labels: , , , , , , , ,

An bhfuil "Hello World" gesagt agat?

[[ Darf ich dul go dtí an little boy's room. Please. Miss! ]]

These links don't just grow on trees you know, please support our sponsors:
I think perhaps the most important problem is that we are trying to understand the fundamental workings of the universe via a language devised for telling one another when the best fruit is
Ok, back again ? The redditors are gone, and that brief drunken fling with ysh is past-ish, so let's refocus on language(s).
  • What is it?
  • Which is it?
  • How are magical and mythical languages related?
  • What are it's characters' motivations?
  • Which framework should I ... should I use a framework ?
  • Why is it so shallow?
  • You were expecting answers? In a blog?
  • Why are there so few free multi-language tools (and why are the commercial ones so, ..., otherwise engaged) ?
  • How are magical and mythical languages related?
Languages suggests frameworks like a joker suggests chaos, you'd want to become a symbol to differ.It doesn't have to be that wayknow that a language signifies nothing that another one couldn't just as, usually nearly as, easily signify. And any saved geek (noun: "a geek who sees beyond the religions like vi and emacs (and uses vim anyway)") would've noticed the same squandering of significant signification in perl v python v ruby.

  • The language that I am using means nothing that any other couldn't usually as easily mean
  • If you wish to consider meaning, language is irrelevant
  • Let's just consider that for a moment
  • Whoa, back up a minute there


"The collection plate is at the
...
END of The Congregational Hall

Hope to
...
See you all next week
"

Labels: , , , , , , , , , , , , , , ,

What's the difference?

The first time you do something it's Science. The second time, it's Engineering. The third time it technol, ..., just being a technician.

I'm a scientist, once I do something I want to do something else.
I'm a Software Engineer. When I do something I want to repeat it
  • readably
  • reproducibly
  • reliably
so that the technicians can do it.

There are 10 kind of people
  • Those who don't know binary
  • The assholes who think that is funny
  • The rest of us

Labels: , , , , ,

Friday, December 12, 2008

When did they kick in ?

So there I am working away tonight, trying to install the latest build on some server, from home, with a dodgy net connection. ysh is still raising NotImplementedErrors so I'm taking the full log by copy-and-paste-and-run-and-copy-and-paste.

Yes, I've heard of screen and the like, but I prefer going back-to-basics when considering a new feature, as it allows much more flexibility in discarding use cases. Comes from doing so much building, installing and testing I guess. When your edit-compile-run cycle is measured in days, not minutes, it makes you fussier about wasted effort. And putting effort into doing it the right way for some app, when we might not end up using that app, is wasted effort. So a new feature always brings me back to the bash command line
  1. type in command to terminal
  2. run command
  3. copy everything from terminal, paste to log
And next time I open that log and
  1. copy command from old log to terminal
  2. run command
  3. copy everything from terminal paste to new log
Add in vim for commenting and hiding, and that's as far as automation goes; until I'm happy that I have gathered the requirements of the new feature, and designed enough of it to start coding.

So I'm still there, pasting to the log command by command, when the connection goes, losing the log completely. So I set it all up again, and I'm there again pasting to the log command again by command again, when (you guessed it) the connection goes again. As does the log, again.

Such a dumb error even my current wife can tell me how to fix it. Unfortunately it's not the log that I'm really losing - it's the logging in, find right tarball, edit the config file, ... and all the commands that are required to set up the test I'm trying to verify. And the new feature I haven't written yet is supposed to save that.

That's when the blogs kicked in.

The Internet has added layers to my programming. Google it did a few years ago, after which I threw away manuals. Copy the error message from command line to browser, and (usually) find the answer. Now programming blogs are adding more layers.
So there I (still) am with the lost logs when it hits me: next one will be the third. But it's an expensive loss if it happens again, so maybe I should write a program now, or perhaps step back to consider the whole process? And instead of just repeating the same old error prone solution I spend a while blogging about it, finding more interesting links, listing quotes, re-combining other posts, ... until eventually Zebedee arrives.

Tomorrow I'll get up, go to office, and the problem will be solved, with no need for any code at all, at all.

What I learned from reading programming blogs that made me a better programmer:

Don't write so much

Labels: , , , , , , , , ,

Tuesday, November 25, 2008

Is the internet back yet ?

The internet came back half an hour after I left for the office but the water was gone by the time I got home again. Got a few hours kip, woke up this "morning" and my wife was gone. Got a slice of toast, the peanut butter was gone. Tried asking you but I don't think you were reddi yet.

But I keep coming back to the same old questions:

When you get right down to it, what've you got, right, down, up a bit, more, There, aaaah, ... ?
Why do my socks have big holes when I always compost them at the first tear ?
Why has my retirement-fund halved the fees today, if banks are in such shit ?
Why does the screen always go black at the start of writing a new program ?
Why am I so much better at sorting this list than most algorithms I know ?
Wow ! That line was typed in at the best guess place, before I knew ...
How many visitors do you need to see what's going on outside the prison ?
Which of these questions will you take as the subject line of an email ?
Who is converging on The Palace of Culture, panting and slobbering ?
How do you design a brain when all you've got control of is genes ?
How many Ministers for Energy does it take to change a light bulb ?
Why is Natural Language mischaracterized as inherently ambiguous ?
How can you expect to be taken seriously (Extended Danse Mix) ?
Why do men need nipples, is it some kind of memento matris ?
When you get down to the wood today, what will you saw ?
Why is petrol back down to less than 1 euro per litre ?
How many Big Macs does it take to sink an empire ?
How does it work when you program in English ?
How can one live well in a badly-run world ?
When do the floor-cleaning robots arrive ?
Whatever will become of the likely lads ?
How many angels can be fit into a PIN ?
Where have all the children gone ?
Which are the magical languages ?
What were we wanting without W ?
Who would you like to beat (up) ?
Does my thumb look big in text ?
Who are you talking to, inside ?
How much do you miss the goal ?
Sorry, what were you saying ?
What do you do, in the bath ?
But I'm mumbling again't I ?
How much do I stink by now ?
Why do crocodiles crawl ?
How to get rich, slowly ?
What was I looking for ?
Have a dream on me !
Onde está o Oisín ?
Where's the craic ?
You want it when ?
Why am I here ?
Why coo ?
WTF ?

Labels: , , , , , , , , , , , ,

Thursday, November 13, 2008

Easy cache

No bailouts required.

And if you don't believe it,
    you can copy and paste this to a doctest file:


>>> class Cacher:
... def __init__(self):
... self.value_in_database = 0
...
... def very_slow_database_access(self):
... return self.value_in_database
...
... @property
... def show(self):
... result = self.very_slow_database_access()
... self.show = result
... return result
...
>>>

Create an instance
>>> cacher = Cacher()

Someone writes to the database

>>> cacher.value_in_database = 9

Call show for the first time,
which will get the value from the database

>>> print cacher.show
9

show is now cached

show is not a method so
if someone else writes to the database
we will not see the change

>>> cacher.value_in_database = 7
>>> print cacher.show
9

To force another read from the database
delete the string attribute

>>> del cacher.show

Next time we try to use the attribute
Python will find the method again

>>> print cacher.show
7

Labels: , , , , , , ,

Saturday, September 20, 2008

Installing Cisco VPN on Mandriva 2008

As you are following the standard procedure to install the Cisco VPN client you will come to an instruction which says you must run
./vpn_install
Stop

Have you tried that already and seen errors like
  • when you start the vpn service
    cisco_ipsec.ko -1 Invalid module format
  • dmesg shows errors like
    $dmesg | grep cisco
    cisco_ipsec: version magic '2.6.22.9-1mdvcustom SMP mod_unload 686 ' should be '2.6.22.9-laptop-1mdv SMP mod_unload 686 '
?

Then you should check that your kernel source version agrees with your kernel version. For example, my kernel version was
$ uname -a
Linux localhost 2.6.22.9-laptop-1mdv #1 SMP Thu Sep 27 04:17:10 CEST 2007 i686 Intel(R) Pentium(R) M processor 1600MHz GNU/Linux
And my kernel source showed:
$ grep "EXTRAVERSION =" /usr/src/linux/Makefile
EXTRAVERSION = .9-1mdvcustom
  • 2.6.22.9-laptop-1mdv
  • 2.6.22.9-1mdvcustom
This must be fixed before proceeding with vpn installation
$ cd /usr/src/linux
$ sed -i -e"s/EXTRAVERSION = .9-1mdvcustom/EXTRAVERSION = .9-laptop-1mdv/" Makefile
$ make oldconfig
$ make modules_prepare
$ make prepare
$ cd /usr/local/src/vpnclient
We now return you to the main procedure
$ ./vpn_install

Labels: , , , , , , ,

Tuesday, October 04, 2005

Why AI ?

AI is agitatingly interesting.

I just can't get it out of my head, it has such arresting implications, and actual implementations. But still has room for mailing lists full of tomes that start with "I believe ...".

Of course there is no such thing as "Artificial Intelligence", because there is no agreed definition of intelligence. Hence poor ol' Deep Blue takes on the champeen o de worl', beats him, and ... is not "intelligent" after all. And many algorithms will suffer the same applied ignominy as it turns out their solutions aren't "intelligent" after all. Like Jane in Michael Jackson's story.

All of which shall continue in the great world out there, but in here I am going to apply insights derived from the field to the more awkwardly immediate problem of PI - programming intelligence.

Why should PI be a more immediate problem than AI ? Because I need it daily, and the tools I have to work with are so fucking primitive. With one or two honourable exceptions, the tools I use for programming, are nothing to do with programming !

Ok, ok, caveats galore again - I do use compilers, and build systems, and debuggers, but for two out of these three I don't use them directly, they happen behind the curtain. And, now that I think of it - I haven't used a debugger in months. Not since I switched to Python.

So I can reasonably repeat - the tools I use for programming know nothing about programming.

Enhanced by Zemanta

Labels: , , , , , , , ,