Load-bearing paint (alt: structural paint) is a term that I've heard in relation to house remodeling where the existing structure is, shall we say, questionable. Things are so poorly constructed, or more often, modified (shoddy repairs on top of shoddy remodeling on top of more shoddy remodeling) that what seems to be purely cosmetic is in fact an integral part of what is holding things together. It works - for now, just barely, as long as you don't stress it too hard - but to do anything reasonably with it you need to tear the whole thing out and start fresh. And that takes time and money... so why not just add a new coat of paint, to strengthen it up a little?
Now imagine this as a piece of software.
Nov 24, 2014
Jul 24, 2011
Help, my CEO is a better programmer than me!
Ha ha, no, he just read "Learn Visual Basic in 21 Days" (well, he skimmed the first few chapters) and he thinks he can program. And he's a "hands-on" type, and feels that if he's not mucking around in everything, he's not doing his job. (Mind you, he actually *is* good at his real job - executiving and shit - he's just not a programmer)
For dealing with such people, have you ever thought about leaving in some really obvious awful stuff that they can point at and say "Hey! Fix that!" and they can go away feeling useful and you can save the buffer that already had that change made and get on with work? Or does that nagging doubt that maybe he *won't* see it - or worse, will like it - prevent you from taking such action?
For dealing with such people, have you ever thought about leaving in some really obvious awful stuff that they can point at and say "Hey! Fix that!" and they can go away feeling useful and you can save the buffer that already had that change made and get on with work? Or does that nagging doubt that maybe he *won't* see it - or worse, will like it - prevent you from taking such action?
May 31, 2011
Yahoo Mail - what happened to GBS?
Yahoo's YUI has a great idea called "Graded Browser Support". Read about it at http://developer.yahoo.com/yui/articles/gbs/
In short, it says "we know specifically what browsers suck, and specifically what browsers don't suck, and if we don't know about it, we assume you're a geek and your browser doesn't suck." Or in their terms, C-Grade, A-Grade, and X-Grade.
The problem is that Yahoo Mail - generally a great product - isn't on board. They're about to release their "All-New" new mail ui. And they've sent out lots of messages about it, to avoid surprising users. Yet their browser detection fails to figure out that Seamonkey - a Gecko-based browser, pretty much the same as Firefox internally - should get the fancy stuff. By my reading of GBS, Seamonkey should be X-Grade, which gets all js and css. But instead they give me "Upgrade to a supported browser!"
I understand that they don't want to answer tons of support crap about "it doesn't work with IE6!!". That's the whole point of GBS. I know the risks. The current "all-new" yahoo mail also doesn't recognize seamonkey, but it at least gives a "go ahead anyway" option. Now could they just do the same and let me at least try it with my almost-Firefox browser?
In short, it says "we know specifically what browsers suck, and specifically what browsers don't suck, and if we don't know about it, we assume you're a geek and your browser doesn't suck." Or in their terms, C-Grade, A-Grade, and X-Grade.
The problem is that Yahoo Mail - generally a great product - isn't on board. They're about to release their "All-New" new mail ui. And they've sent out lots of messages about it, to avoid surprising users. Yet their browser detection fails to figure out that Seamonkey - a Gecko-based browser, pretty much the same as Firefox internally - should get the fancy stuff. By my reading of GBS, Seamonkey should be X-Grade, which gets all js and css. But instead they give me "Upgrade to a supported browser!"
I understand that they don't want to answer tons of support crap about "it doesn't work with IE6!!". That's the whole point of GBS. I know the risks. The current "all-new" yahoo mail also doesn't recognize seamonkey, but it at least gives a "go ahead anyway" option. Now could they just do the same and let me at least try it with my almost-Firefox browser?
May 30, 2011
The difference
The difference between perl programmers and java programmers, presented with the same problem:
The perl programmer thinks, "I can solve that in one line with regexp".
The java programmer thinks, "I can solve that by adding in a new framework."
The perl programmer thinks, "I can solve that in one line with regexp".
The java programmer thinks, "I can solve that by adding in a new framework."
Oct 7, 2010
Online Poker
I've been thinking about a scheme for online poker where cheating is impossible.
By cheating, I mean strictly two things:
- no proper subset of the players can control the cards dealt
- no proper subset of the players can know any cards dealt to any players outside of the subset
In other words, the dealer can't stack the deck, even with help; and you can't peek at other players' cards, even if you control the server. An immediate consequence of this is that there is no single trusted entity, house or otherwise.
Here is the basic scheme I propose:
Each player generates a secret encryption key (K).
The dealer shuffles the deck and encrypts each card with his key.
[the dealer now has complete knowledge of the deck, but no one else does]
Each player in turn repeats this process (shuffle, encrypt).
[now no player can tell what any card is by looking at it, and the order has been randomized so it is different from the dealer's original shuffle]
The encrypted deck is visible to all.
To deal a card, the card is given to each player, who partially decrypts that card with their own key and passes it to the next player who does likewise, ending up with the recipient of the card who decrypts it ending up with the real card. In this way, each player other than the recipient sees only a card that has been encrypted by one or more keys.
When the hand is over, all players can reveal their secret encryption keys so the encryption steps can all be verified.
This scheme requires an encryption method that can be applied multiple times with different keys, and that can be decrypted with those same keys in any order, such that decrypting with fewer than all the keys provides no information about the fully decrypted message.
The simplest example of such an encryption method I can think of is a caesar cipher. Each player picks a number between 1 and 52, and rotates each card by that amount. To decrypt, they each rotate it backward. But this has a few flaws. The relative positions of the cards stay the same (a king is always one more than a queen, etc.) And revealing any single card reveals all cards belonging to that player. So something stronger is needed.
Clearly, each card must be encrypted by itself. A caesar cipher plus a keyword (a Vigenere cipher) won't work, since it is position sensitive, and the cards get reordered.
A simple one-time pad approach should work, where the pad is a permutation of the numbers from 1-52, and each number is replaced with the number in that order. The pad is completely private, so there is no problem with exchanging them. Implementation would be straightforward.
The devil with encryption is that there are potentially so many non-obvious flaws. Are there any places where my proposed scheme fails?
An abstract example:
There are 3 players, A, B, and C. A is the dealer. He shuffles the deck, encrypts each card with A, passes it to B. B shuffles the deck, encrypts each card with C. C shuffles and encrypts and returns the deck to the dealer. Now the deck is in a random order, and each card is encrypted with ABC(c).
A deals a card to B: he first decrypts the card with his own key, leaving BC(c). He gives the card to C, who decrypts it with C leaving B(c). The card is then passed to B who can decrypt it leaving plain c.
A deals a card to C: he decrypts it with A, leaving BC(c). He gives it to B who decrypts it leaving C(c). The card is passed to C who can decrypt it to plain c.
A deals a card to himself: he passes the card ABC(c) to B, who decrypts it leaving AC(c). It is passed to C which decrypts it leaving A(c). It is returned to A, who can decrypt it to plain c.
By cheating, I mean strictly two things:
- no proper subset of the players can control the cards dealt
- no proper subset of the players can know any cards dealt to any players outside of the subset
In other words, the dealer can't stack the deck, even with help; and you can't peek at other players' cards, even if you control the server. An immediate consequence of this is that there is no single trusted entity, house or otherwise.
Here is the basic scheme I propose:
Each player generates a secret encryption key (K).
The dealer shuffles the deck and encrypts each card with his key.
[the dealer now has complete knowledge of the deck, but no one else does]
Each player in turn repeats this process (shuffle, encrypt).
[now no player can tell what any card is by looking at it, and the order has been randomized so it is different from the dealer's original shuffle]
The encrypted deck is visible to all.
To deal a card, the card is given to each player, who partially decrypts that card with their own key and passes it to the next player who does likewise, ending up with the recipient of the card who decrypts it ending up with the real card. In this way, each player other than the recipient sees only a card that has been encrypted by one or more keys.
When the hand is over, all players can reveal their secret encryption keys so the encryption steps can all be verified.
This scheme requires an encryption method that can be applied multiple times with different keys, and that can be decrypted with those same keys in any order, such that decrypting with fewer than all the keys provides no information about the fully decrypted message.
The simplest example of such an encryption method I can think of is a caesar cipher. Each player picks a number between 1 and 52, and rotates each card by that amount. To decrypt, they each rotate it backward. But this has a few flaws. The relative positions of the cards stay the same (a king is always one more than a queen, etc.) And revealing any single card reveals all cards belonging to that player. So something stronger is needed.
Clearly, each card must be encrypted by itself. A caesar cipher plus a keyword (a Vigenere cipher) won't work, since it is position sensitive, and the cards get reordered.
A simple one-time pad approach should work, where the pad is a permutation of the numbers from 1-52, and each number is replaced with the number in that order. The pad is completely private, so there is no problem with exchanging them. Implementation would be straightforward.
The devil with encryption is that there are potentially so many non-obvious flaws. Are there any places where my proposed scheme fails?
An abstract example:
There are 3 players, A, B, and C. A is the dealer. He shuffles the deck, encrypts each card with A, passes it to B. B shuffles the deck, encrypts each card with C. C shuffles and encrypts and returns the deck to the dealer. Now the deck is in a random order, and each card is encrypted with ABC(c).
A deals a card to B: he first decrypts the card with his own key, leaving BC(c). He gives the card to C, who decrypts it with C leaving B(c). The card is then passed to B who can decrypt it leaving plain c.
A deals a card to C: he decrypts it with A, leaving BC(c). He gives it to B who decrypts it leaving C(c). The card is passed to C who can decrypt it to plain c.
A deals a card to himself: he passes the card ABC(c) to B, who decrypts it leaving AC(c). It is passed to C which decrypts it leaving A(c). It is returned to A, who can decrypt it to plain c.
Mar 18, 2010
Of bicycles and go-karts
In the realm of small transportation, there are (among many other choices) bicycles and go-karts. They are different beasts, built different ways for different purposes. Some may consider bicycles more elegant and precision machines, and go-karts can sometimes be a bit sloppy, held together with duct tape and baling wire, but they can go pretty fast. (Yes, bicycles can go quite fast also but there are different approaches to making them fast and they can be quite variable)
So, if you take someone who is a decent bike builder and show them a go-kart, explain the basic principles of operation, give them the parts to build a go-kart, and suggest that they use the parts to build a go-kart and expect that their general mechanical knowledge from building bikes will be sufficient to let them actually handle the building process, then you would expect them to build a go-kart, right?
NO.
They will use the parts you gave them to try and build a bicycle. However, go-kart parts are not bicycle parts, so they will try to make do.
A bicycle has 2 wheels, but their parts box has 4 (that are qiute different). So they'll put one in front and one in back, and then since there's 2 extra, they'l put those in the back too.
A bike doesn't have an engine, so they won't quite know what to do with it. But it has to be there, so they'll strap it to the front. Not connected to anything, just strapped there. For propulsion, a bike uses pedals and a chain; there's a chain drive from the engine that looks like a bike chain (only a lot shorter), so that will work. And the brake and gas pedals look can double as bike pedals in a pinch, so those get strapped onto the chain somehow.
A go-kart frame is rather square-ish compared to a bike frame, but that'll have to do. Stuff can get bolted onto it somehow. The seat goes sort of sideways in the middle, right?
The steering wheel is a common enough thing that they realize it's for turning the wheels, even if it's different than bike handlebars. It gets bolted in there too and wired up to the single front wheel.
So after all this you have a go-kart frame all bent out of shape in such a way as to sort of resemble a bicycle, that you have to pedal very ineffectively, with no brakes, that you can barely control, and carrying the extra weight of a useless engine, that you can't make go very fast. But it DOES go.
And the builder?
They complain that the parts you gave them don't make a very good bicycle.
So, if you take someone who is a decent bike builder and show them a go-kart, explain the basic principles of operation, give them the parts to build a go-kart, and suggest that they use the parts to build a go-kart and expect that their general mechanical knowledge from building bikes will be sufficient to let them actually handle the building process, then you would expect them to build a go-kart, right?
NO.
They will use the parts you gave them to try and build a bicycle. However, go-kart parts are not bicycle parts, so they will try to make do.
A bicycle has 2 wheels, but their parts box has 4 (that are qiute different). So they'll put one in front and one in back, and then since there's 2 extra, they'l put those in the back too.
A bike doesn't have an engine, so they won't quite know what to do with it. But it has to be there, so they'll strap it to the front. Not connected to anything, just strapped there. For propulsion, a bike uses pedals and a chain; there's a chain drive from the engine that looks like a bike chain (only a lot shorter), so that will work. And the brake and gas pedals look can double as bike pedals in a pinch, so those get strapped onto the chain somehow.
A go-kart frame is rather square-ish compared to a bike frame, but that'll have to do. Stuff can get bolted onto it somehow. The seat goes sort of sideways in the middle, right?
The steering wheel is a common enough thing that they realize it's for turning the wheels, even if it's different than bike handlebars. It gets bolted in there too and wired up to the single front wheel.
So after all this you have a go-kart frame all bent out of shape in such a way as to sort of resemble a bicycle, that you have to pedal very ineffectively, with no brakes, that you can barely control, and carrying the extra weight of a useless engine, that you can't make go very fast. But it DOES go.
And the builder?
They complain that the parts you gave them don't make a very good bicycle.
May 15, 2009
The death of blogging
From technolope:
What do you think?
Why does it seem like the comments on some blog posts are just quotes from, and links to, other blogs posts that reference the first one? While the comments section has always been something of a collective cry for attention, it is occasionally funny and interesting. But when it's all just other bloggers looking for any traffic they can grab, it becomes pathetic.
What do you think?
Feb 6, 2009
Kickin it old school
Early this week I found myself writing a CGI script. An old-style CGI script.
Ok, I'm not talking like Matt's Script Archive full of security-holes
Nowadays I mostly use HTML::Mason for anything interesting, it's just so much more natural to type the needed HTML code as ... well, HTML. And, to complete the circle, yesterday when I needed to extend the functionality of my hack, I rewrote it in Mason. I feel better now.
Ok, I'm not talking like Matt's Script Archive full of security-holes
&format(*INFO); old-style; I at least use-d CGI.pm. But it was still chock-full of print "<tr><td>"; and the like. Did we really build the early web on this crap? (although I bet a lot of java servlets are still written this way...)Nowadays I mostly use HTML::Mason for anything interesting, it's just so much more natural to type the needed HTML code as ... well, HTML. And, to complete the circle, yesterday when I needed to extend the functionality of my hack, I rewrote it in Mason. I feel better now.
Feb 3, 2009
The end of trivia?
I'm getting to really hate wikipedia and google.
It used to be that a person with a good memory for random facts could occasionally impress people by whipping out something like "The hundred years war actually lasted 116 years," or "Light takes 8.3 minutes to get from the sun to the earth," or reciting entire passages from "The Princess Bride." I used to fill my brain up with facts like these from the kind of books that you can open to any page and start reading (bathroom readers, Guinness Book of World Records, etc.) or by watching the movie over and over again.
But now, anyone can find this kind of info faster and more accurately (or at least with citations) with a quick google search, which usually lands you on wikipedia. And with the prevalence of iPhones and the like that can access google from anywhere, we're not even safe in bars anymore.
Tell me, is there a place for an old-fashioned trivia buff anymore?
I guess I'm not the only one
It used to be that a person with a good memory for random facts could occasionally impress people by whipping out something like "The hundred years war actually lasted 116 years," or "Light takes 8.3 minutes to get from the sun to the earth," or reciting entire passages from "The Princess Bride." I used to fill my brain up with facts like these from the kind of books that you can open to any page and start reading (bathroom readers, Guinness Book of World Records, etc.) or by watching the movie over and over again.
But now, anyone can find this kind of info faster and more accurately (or at least with citations) with a quick google search, which usually lands you on wikipedia. And with the prevalence of iPhones and the like that can access google from anywhere, we're not even safe in bars anymore.
Tell me, is there a place for an old-fashioned trivia buff anymore?
I guess I'm not the only one
Dec 23, 2005
Intelligent Design, Evolved Stupidity
Why do 'intelligent design' proponents attack the evolution of life? It seems much easier to attack things that just "are" perfectly so. Like, eπi+1=0 ... There seems to be a suspicious amount of design in this system of mathematics to make such a random equation turn out so neatly. Or cosmology - why are the various physical constants "just so"?
There are two core principles of ID, "irreducible complexity" which is also known as demonstrable ignorance, and I forget the other, but I think it is also demonstrable ignorance. The real answer is that Genesis doesn't mention the cosmological constant, but it really undermines any shallow credibility the ID folks might have. Wheras not asking "how did this complex system arise" but instead "where did the framework to create this complex system come from" strikes me as alot more profound.
For example, look at genetic algorithms. The final solution can be ridiculously complex, in such a way that no one understands how they work, only that they do (for example, the GA-created cube-root function curcuit. From a certain level of ignorance that could probably be proved to be irreducibly complex.) The final product was not created by any intelligence. BUT, the *framework* to evolve the complex design WAS created by intelligence.
But no, it's always "What good is half an eye?" or "Look at the motorboat flagellum, that couldn't possibly have evolved by random chance!"
Ok, I appear to be showing my own ignorance here - the wikipedia article on intelligent design (all hail wikipedia) does make reference to this concept, calling it the "fine-tuned universe". However, I had to go looking for that. All the press reports on ID only ever mention the biology angle.
There is of course a simple explanation for this: Genesis doesn't mention the cosmological constant, relativity, complex math, or even gravity. It only explains in irrefutable form that God created all life as we know it. "But ID isn't about religion, it's real science!" they say. And it is mere coincidence that every single ID proponent is a fundamentalist
Christian, and that they all had their religious awakening before accepting ID and not the other way around.
The use of 'ID' to abbreviate 'Intelligent Design' is not in any way Freudian. Honest.
-EO
There are two core principles of ID, "irreducible complexity" which is also known as demonstrable ignorance, and I forget the other, but I think it is also demonstrable ignorance. The real answer is that Genesis doesn't mention the cosmological constant, but it really undermines any shallow credibility the ID folks might have. Wheras not asking "how did this complex system arise" but instead "where did the framework to create this complex system come from" strikes me as alot more profound.
For example, look at genetic algorithms. The final solution can be ridiculously complex, in such a way that no one understands how they work, only that they do (for example, the GA-created cube-root function curcuit. From a certain level of ignorance that could probably be proved to be irreducibly complex.) The final product was not created by any intelligence. BUT, the *framework* to evolve the complex design WAS created by intelligence.
But no, it's always "What good is half an eye?" or "Look at the motorboat flagellum, that couldn't possibly have evolved by random chance!"
Ok, I appear to be showing my own ignorance here - the wikipedia article on intelligent design (all hail wikipedia) does make reference to this concept, calling it the "fine-tuned universe". However, I had to go looking for that. All the press reports on ID only ever mention the biology angle.
There is of course a simple explanation for this: Genesis doesn't mention the cosmological constant, relativity, complex math, or even gravity. It only explains in irrefutable form that God created all life as we know it. "But ID isn't about religion, it's real science!" they say. And it is mere coincidence that every single ID proponent is a fundamentalist
Christian, and that they all had their religious awakening before accepting ID and not the other way around.
The use of 'ID' to abbreviate 'Intelligent Design' is not in any way Freudian. Honest.
-EO
Jul 12, 2005
Swatting flies
Old cliches don't die, they just get older. An old cliche mentions the futility of "swatting flies with an elephant gun". There are worse ways to swat flies.
A commentator on a radio show I was listening to this morning about the war in Iraq and military recruiters defended the rights of anti-recruitment and anti-war groups to spread their message, but also called them out for not suggesting alternative other than "sticking their heads in the sand." The implication is that doing something is always better than doing nothing, and the the current war is at least doing something about terrorism (the dubious connection between the war in Iraq and terror groups notwithstanding).
I disagree. We should be opposing it, because the way we are going about it is worse than doing nothing, in that while it may make things a little better in the short term, is it almost certainly making things worse overall, and in time we will see and feel these effects. And more broadly, there is no military solution to terrorism - it is like swatting flies with .. well, you know the rest.
To draw a more complete analogy, consider acts of terrorism to be malaria, and those who commit such acts to be mosquitos. Mosquitos breed in pools of standing water. So we have some military folk come in and determine that we must eliminate the places for mosquitos to breed: we must destroy these pools of standing water. So naturally, we call in artillery strikes. They blast the pools with pinpoint accuracy, kill millions of mosquitos, and declare the problem solved. Excapt that the very tactic used to clear up the problem makes it worse. The artillery shells destroy alot that they weren't intended to. And they dig more holes in the ground, create more places for the water to pool, and next season the mosquitos will be worse than ever.
Of course, terrorists aren't mosquitos and they don't breed in pools of water. Instead, they breed in pools of despair. However, the military tactics we use against them have a very similar effect - short-term gains with much collateral damage, and I don't even want to think about what next season will be like.
A commentator on a radio show I was listening to this morning about the war in Iraq and military recruiters defended the rights of anti-recruitment and anti-war groups to spread their message, but also called them out for not suggesting alternative other than "sticking their heads in the sand." The implication is that doing something is always better than doing nothing, and the the current war is at least doing something about terrorism (the dubious connection between the war in Iraq and terror groups notwithstanding).
I disagree. We should be opposing it, because the way we are going about it is worse than doing nothing, in that while it may make things a little better in the short term, is it almost certainly making things worse overall, and in time we will see and feel these effects. And more broadly, there is no military solution to terrorism - it is like swatting flies with .. well, you know the rest.
To draw a more complete analogy, consider acts of terrorism to be malaria, and those who commit such acts to be mosquitos. Mosquitos breed in pools of standing water. So we have some military folk come in and determine that we must eliminate the places for mosquitos to breed: we must destroy these pools of standing water. So naturally, we call in artillery strikes. They blast the pools with pinpoint accuracy, kill millions of mosquitos, and declare the problem solved. Excapt that the very tactic used to clear up the problem makes it worse. The artillery shells destroy alot that they weren't intended to. And they dig more holes in the ground, create more places for the water to pool, and next season the mosquitos will be worse than ever.
Of course, terrorists aren't mosquitos and they don't breed in pools of water. Instead, they breed in pools of despair. However, the military tactics we use against them have a very similar effect - short-term gains with much collateral damage, and I don't even want to think about what next season will be like.
Jun 10, 2005
Life imitates art
Are these the plots of a hit movies, or news stories?
Terrorists attacks in NYC lead to egregious human rights violations in the name of national security, led by an arguable lunatic with a hidden agenda.
Repeated security violations dealing with computerized data lead people to demand the adoption of a system with hidden backdoors, in the name of better security.
Terrorists attacks in NYC lead to egregious human rights violations in the name of national security, led by an arguable lunatic with a hidden agenda.
Repeated security violations dealing with computerized data lead people to demand the adoption of a system with hidden backdoors, in the name of better security.
Jun 7, 2005
And so it begins...
Greetings, program
You wanna know what's wrong with ... well, just about everything? A lot. Got some time to sit around and listen? Good.
Traffic. Driving. Broken software. Stupid people. I think that about covers my morning.
See, the problem is basically that people can't be bothered. Can't be bothered to think, can't be bothered to do the right thing, can't be bothered to take responsibility for their own actions. It's gotta stop sometime.
We can do this the easy way, or the hard way. Now all I need to do is explain to people why they have them backward.
You wanna know what's wrong with ... well, just about everything? A lot. Got some time to sit around and listen? Good.
Traffic. Driving. Broken software. Stupid people. I think that about covers my morning.
See, the problem is basically that people can't be bothered. Can't be bothered to think, can't be bothered to do the right thing, can't be bothered to take responsibility for their own actions. It's gotta stop sometime.
We can do this the easy way, or the hard way. Now all I need to do is explain to people why they have them backward.
Subscribe to:
Posts (Atom)