Dijkstra Archive: A Short Introduction to the Art of Programming (EWD 316), Chapter 9 9. The problem of eight queens The problem is to make a program generating all configurations of eight queens on a chess board of 8 * 8 squares, such that no queen can take any of the others. This means that in the configurations sought no two queens may be on the same row, on the same column or on the same diagonal. We don't have an operator generating all these configurations: this operator is exactly what we have to make. Now a (very general!) With the aid of the generator (3) for the elements of set B, the elements of set B can then be generated in turn; they will be subjected to the decision criterion (2) which decides whether they have to be skipped or handed over, thus generating elements of set A. Three remarks are in order. 1) If the whole approach makes sense, set B is not identical to set A and as it must contain set A as a (true) subset, it must be larger. In a moment of optimism one could think that this is an easy matter, thinking of the following technique. Note. How?
The Hacker Manifesto by +++The Mentor+++ Written January 8, 1986 Another one got caught today, it's all over the papers. "Teenager Arrested in Computer Crime Scandal", "Hacker Arrested after Bank Tampering"... Damn kids. They're all alike. But did you, in your three-piece psychology and 1950's technobrain, ever take a look behind the eyes of the hacker? I am a hacker, enter my world... Mine is a world that begins with school... Damn underachiever. I'm in junior high or high school. Damn kid. I made a discovery today. Damn kid. And then it happened... a door opened to a world... rushing through the phone line like heroin through an addict's veins, an electronic pulse is sent out, a refuge from the day-to-day incompetencies is sought... a board is found. Damn kid. You bet your ass we're all alike... we've been spoon-fed baby food at school when we hungered for steak... the bits of meat that you did let slip through were pre-chewed and tasteless. Yes, I am a criminal. I am a hacker, and this is my manifesto.
Why Learn Assembly Language? Introduction "Assembly language? Isn't that the hard to read instructions on how to assemble your brand new computer desk?"... No.. What is Assembly Language? x86 Assembly is a programming language for the x86 class of processors (specifically the 32bit x86 processors IA-32 - Background I thought assembly was a dead language, why waste the time? Though it's true, you probably won't find yourself writing your next customer's app in assembly, there is still much to gain from learning assembly. So why should you care? Points of Interest Wirth's Law I remember dialling into a BBS on my 486 with my brand new 2400bps modem. My Eyes are Open! I realize now that learning assembly language will teach me about the inner workings of the computer. So if you are serious about getting a leg up on the competition in your field, I'd recommend trying to learn assembly language. Resources on Learning Assembly How To Use Debug -
New programming slang - Programming A question recently posted on stackoverflow.com asked for people to submit programming terms that they or their team have coined and have come into regular use in their own circles. Below are the most popular answers Yoda Conditions The act of using if (constant == variable) instead of natural if (variable == constant),; for example, if (4 == foo). Because it is like "if it is the blue – this is the sky" or "if that is tall – this is a man." Pokémon Exception Handling When you catch all the exceptions and then you try somehow to analyze them. try{ //code }catch ( Exception ex){ if( ex instanceof SubException){ //code }else if(ex instanceof SubSubException){ //code }else{ //code } } Discuss an example here Egyptian brackets This is the style of brackets, when an opening bracket is placed at the end of this line: if (a == b) { printf("hello"); } Why do we call this style "Egyptian brackets?" Different types of bug reports Stringly Typed It is a riff on strongly-typed. Other types of errors
How Speeding The "Most Important Algorithm Of Our Lifetime" Could Change This Modern World Last week at the Association for Computing Machinery's Symposium on Discrete Algorithms (SODA) a new way of calculating Fast Fourier Transforms was presented by a group of MIT researchers. It's possible that under certain situations it may be up to ten times faster than the current way we do these. At this point you are probably wondering: What the hell is he talking about? Let me explain, because improving these three little letters--FFT--may change your life. Here's a quickie explainer: Fourier transforms are a mathematical trick to simplify how you represent a complicated signal--say the waves of sound made by speaking. How so? Now, you should remember that sound waves, and both picture and video signals, are all handled by processors in your TV, PC, and phone, and that the radio waves that whizz through the air to keep us all connected to the Internet need digital processing too. So calculating FFTs up to ten times faster is a big deal. [Image: Flickr user hazure]
Low Level Details When I started programming many of the elements we take for granted now, did not exist. There was no DirectX and not many compatible libs were available for the free compilers of the day. So I had to write my own code for most basic programs, keyboard handlers, mouse handlers, video memory accessors, rasterizers, texture mappers, blitters… the programs I wrote then were 100% my own code and I had to be able to handle anything and everything. Personally I’ve always been interested in what was going on under the hood so this suited me just fine. I always dug into the details and I almost always end up programming as close to the bone ON the hardware (or OS) as I possibly can both to eek out as much performance as possible AND to satisfy my own hunger for knowledge. Over the last decade I’ve been involved in the hiring process at many studios and in more recent years I’ve noticed a pattern. It depresses me that so much of what I consider to be essential is simply not being taught anymore.
Signs that you're a bad programmer - Software Engineering Tips Why was this written? Most of these faults were discovered the hard way by the author himself, either because he committed them himself or saw them in the work of others. This paper is not meant for grading programmers, it was intended to be read by programmers who trust their ability to judge when something is a sign of bad practice, and when it's a consequence of special circumstances. This paper was written to force its author to think, and published because he thinks you lot would probably get a kick out of it, too. 1. Reasoning about code means being able to follow the execution path ("running the program in your head") while knowing what the goal of the code is. Symptoms Remedies To get over this deficiency a programmer can practice by using the IDE's own debugger as an aide, if it has the ability to step through the code one line at a time. 2. Object Oriented Programming is an example of a language model, as is Functional or Declarative programming. 3. 4. 5. 6. 1. 2. 3. 4. 5. Symptoms
MIT crowdsources and gamifies brain analysis There are around 100 billion neurons in a human brain, forming up to 100 trillion synaptic interconnections. Neuroscientists believe that these synapses are the key to almost every one of your unique, identifiable features: Memories, mental disorders, and even your personality are encoded in the wiring of your brain. Understandably, neuroscientists really want to investigate these neurons and synapses to work out how they play such a vital role in our human makeup. Unfortunately, these 100 trillion connections are crammed into a two-pound bag of soggy flesh, making analysis rather hard. At the moment we know that neurons trigger an electrical signal, and that hormones affect the speed at which signals cross between synapses, and that somehow this results in a mental image of a naked Kristen Bell from her Veronica Mars period, but that’s about it. MIT wants to change all that by tasking thousands of people with analyzing a 0.3-millimeter slice of mouse retinal tissue.