I hope to get a sense of, should I be fortunate enough to be the president, how my administration will react to the Middle East.
GWB
12 Oct 2000
From comments made in Winston-Salem, North Carolina.
23 March 2006
22 March 2006
Wisdom from David Parnas
Don't know the veracity, but this is what fortune attached to an outgoing email:
I've been getting some "it should work this way -- theoretically!" lately...
Whenever anyone says, "theoretically," they really mean, "not really."
-- Dave Parnas
I've been getting some "it should work this way -- theoretically!" lately...
OpenOffice Equations Don't Completely Suck
I was pleasantly surprised by the equation editor in OpenOffice. At first, I thought I was in some sort of menu hell, but after I got the first couple of items in place, I was able to hack rat-free. Yea! It's even a little TeXy:
left [ stack{x # y # z} right ] =
left [ stack{dx # dy # dz} right ]
+ left [ stack{1+s # rz # -ry}
stack{-rz # 1+s # rx}
stack{ry # -rx # 1+s} right ]
left [ stack{x' # y' # z'} right ]
Ambrose's Antidote: ALLIANCE
ALLIANCE, n. In international politics, the union of two thieves who have their hands so deeply inserted in each other's pockets that they cannot separately plunder a third.
daily dose of w
I've got a record, a record that is conservative and a record that is compassionated.
GWB
2 Mar 2000
As quoted by the New York Times.
GWB
2 Mar 2000
As quoted by the New York Times.
21 March 2006
Stupid OpenOffice Stunts
I'm using TWiki to keep notes, do quick formatting for ripping out decent looking PDF files and the like. I've started battling with Open Office to communicate with those who prefer PowerPoint and the like. So, thems that know me know that the first thing I'm going to do is design some sort of template so I can punt having to think about how it looks, and everything will be in some attractive and useful format. However, this conflicts with my innate desire to leave word processors be -- that' just time I'd rather be spending elsewhere (e.g., emacs). Anyway, in trying to strike a balance, I've gotten where I can take a twiki print page, do some html wrangling, and make a file that can be successfully inserted to new file created from an OO template. However, if a header follows a list, numbering gets thrown off and you're doomed doomed doomed. So, the html mangler inserts text between the list and the header that later needs deletion in OO, and the import goes fine. Well, if not fine, better.
Ambrose's Antidote: ALLEGIANCE
ALLEGIANCE, n.
This thing Allegiance, as I suppose,
Is a ring fitted in the subject's nose,
Whereby that organ is kept rightly pointed
To smell the sweetness of the Lord's anointed.
G.J.
daily dose of w
I glance at the headlines just to kind of get a flavor for what's moving. I rarely read the stories, and get briefed by people who are probably read the news themselves.
GWB
21 Sep 2003
Washington, D.C.
GWB
21 Sep 2003
Washington, D.C.
20 March 2006
Ambrose's Antidote: ALLAH
ALLAH, n. The Mahometan Supreme Being, as distinguished from the Christian, Jewish, and so forth.
For penetrating analysis, see WWGD.
Allah's good laws I faithfully have kept,
And ever for the sins of man have wept;
And sometimes kneeling in the temple I
Have reverently crossed my hands and slept.
Junker Barlow
For penetrating analysis, see WWGD.
daily dose of w
Look, this is a man. He's got great numbers. He talks about numbers. I'm beginning to think not only did he invent the Internet, but he invented the calculator.
GWB
3 Oct 2000
First Presidential Debate. Boston, Massachusetts.
I email the dose out to a small group of folks, and I just added an automatic random fortune cookie signature. Today was the first deployment, and the first fortune is appropriate:
We're overpaying him, but he's worth it. -Samuel Goldwyn
GWB
3 Oct 2000
First Presidential Debate. Boston, Massachusetts.
I email the dose out to a small group of folks, and I just added an automatic random fortune cookie signature. Today was the first deployment, and the first fortune is appropriate:
We're overpaying him, but he's worth it. -Samuel Goldwyn
19 March 2006
Assignment Operator = Considered Braindead
The more I think about it, the more I dislike the use of = for an assignment operator. I suppose in the old days when terseness was almost essential it made sense, or was at least understood to be a sensible compromise. But modern languages should punt it. From the time we're wee tykes we write = to mean "equal"; the stuff on the left of the = is the same as the stuff on the right. So, the first time you see:
you think (at least, you ought to):
resulting in a hearty WTF? Of course, you get used to it quickly. Kinda. Sorta. Here is how hideous it's gotten:
That's Visual Basic. Bletch. Defenders pipe up with "but it eliminates a whole class of errors!" While true in a narrow, twisted sense, this defense is beside the point: = shouldn't be an assignment operator in the first place. What should be? I really don't care. Either of these would be fine:
Hell, even this would be OK by me:
We can return = to its rightful, mathematically-meaningful place, and we should.
a = a + 1
you think (at least, you ought to):
a - a = 1
0 = 1
resulting in a hearty WTF? Of course, you get used to it quickly. Kinda. Sorta. Here is how hideous it's gotten:
If foo = 0 Then
foo = 1
End If
That's Visual Basic. Bletch. Defenders pipe up with "but it eliminates a whole class of errors!" While true in a narrow, twisted sense, this defense is beside the point: = shouldn't be an assignment operator in the first place. What should be? I really don't care. Either of these would be fine:
a := 3
b <- 4
Hell, even this would be OK by me:
c @ 5
We can return = to its rightful, mathematically-meaningful place, and we should.
Ask Dr Aybabtu: Interview Question Stumps VB Programmer
Dear Dr Aybabtu,
I recently had an interview with a company that was very strange. They asked me to write a function to reverse a string. I told them that there was a function called StrReverse in VB. Then they asked me to write it in VB 5, which doesn't have StrReverse, and that didn't make any sense to me. They thanked me for coming in and that was that. I haven't heard anything back from them. What do you think happened?
VBWiz
Dear VBWiz,
Dr Aybabtu doubts that you'll be hearing from that company any time soon, but Dr Aybabtu might be wrong. In the mean time, you might want to download Cygwin and learn how to do stupid things on purpose with C. C makes it very easy to do stupid things, so the operative concept is stupid on purpose. What do I mean? Let's take a variation on your problem. Let's interpret a string as a stream of bytes. How might we write a function that reverses bytes read in on an input stream? The UNIX program
Writing stupid functions can be great fun! Let's reverse some bytes held in a char array:
This is especially nice, because it will segfault if you don't give it something to chew on. That's OK, because we're being stupid on purpose. Let's gussy that code up a bit with some macros:
Pretty sexy stuff. The extra parens in the IF and ENDIF definitions are there to let me do even more stupid stuff, but we'll leave that for some other time. Now for some spectacularly stupid stuff that will actually consume a string and produce a string in the traditional
Not stupid enough? How's this:
All of that stuff compiles without error or warning with gcc and
HTH,
Dr Aybabtu
I recently had an interview with a company that was very strange. They asked me to write a function to reverse a string. I told them that there was a function called StrReverse in VB. Then they asked me to write it in VB 5, which doesn't have StrReverse, and that didn't make any sense to me. They thanked me for coming in and that was that. I haven't heard anything back from them. What do you think happened?
VBWiz
Dear VBWiz,
Dr Aybabtu doubts that you'll be hearing from that company any time soon, but Dr Aybabtu might be wrong. In the mean time, you might want to download Cygwin and learn how to do stupid things on purpose with C. C makes it very easy to do stupid things, so the operative concept is stupid on purpose. What do I mean? Let's take a variation on your problem. Let's interpret a string as a stream of bytes. How might we write a function that reverses bytes read in on an input stream? The UNIX program
tac does just this. Here's a stupid way to write it:
#include <stdio.h>
int
main() {
int b = getchar();
if (EOF != b) {
main();
putchar(b);
}
return 0;
}
Writing stupid functions can be great fun! Let's reverse some bytes held in a char array:
#include <stdio.h>
int
main(int c, char *v[]) {
(*v[1] ? ({
char c = *v[1]++;
main(0, v);
return putchar(c);
}) : ({
return 0;
}));
}
This is especially nice, because it will segfault if you don't give it something to chew on. That's OK, because we're being stupid on purpose. Let's gussy that code up a bit with some macros:
#include <stdio.h>
#define IF(x) ((x) ? ({
#define ELSE }) : ({
#define ENDIF }))
int
main() {
int b = getchar();
IF (EOF != b)
main();
return putchar(b);
ELSE
return 0;
ENDIF;
}
Pretty sexy stuff. The extra parens in the IF and ENDIF definitions are there to let me do even more stupid stuff, but we'll leave that for some other time. Now for some spectacularly stupid stuff that will actually consume a string and produce a string in the traditional
char* sense:
#include <stdio.h>
#include <stdlib.h> // malloc and friends
#include <string.h> // memmove
typedef struct {
void* car;
void* cdr;
} Pair;
#define CAR(p) (((Pair*)p)->car)
#define CDR(p) (((Pair*)p)->cdr)
Pair*
cons(void* car, void* cdr) {
Pair* p = (Pair*)malloc(sizeof(Pair));
p->car = car;
p->cdr = cdr;
return p;
}
char
PTOC(void* p) {
return (int)p;
}
void*
ITOP(int i) {
return (void*)i;
}
typedef struct {
char *s;
size_t len;
size_t alloc;
} String;
#define STR(x) (((String*)x)->s)
#define LEN(s) (((String*)s)->len)
#define ALLOC(s) (((String*)s)->alloc)
String*
new_string(size_t alloc) {
String* s = malloc(sizeof(String));
STR(s) = malloc(alloc * sizeof(char));
ALLOC(s) = alloc;
LEN(s) = 0;
return s;
}
void
alloc_check(String* s) {
if ((LEN(s)+1) == ALLOC(s)) {
ALLOC(s) *= 2;
realloc(STR(s), (size_t)ALLOC(s));
}
}
#define STRCHK(s) if (NULL == s) { s = new_string(256); }
String*
appendchar(char c, String* s) {
STRCHK(s);
alloc_check(s);
STR(s)[LEN(s)++] = c;
STR(s)[LEN(s)] = '\0';
return s;
}
String*
list_to_string(Pair* p, String* s) {
if (NULL == p)
return s;
else
return list_to_string(CDR(p), appendchar(PTOC(CAR(p)), s));
}
char*
rev(const char* s, Pair* p) {
if (0 == *s)
return STR(list_to_string(p, NULL));
else
return rev(s+1, cons(ITOP(*s), p));
}
int
main() {
puts(rev("abcdefg", NULL));
return 0;
}
Not stupid enough? How's this:
String*
pushchar(char c, String* s) {
STRCHK(s);
alloc_check(s);
memmove(STR(s)+1, STR(s), sizeof(char)*LEN(s));
LEN(s)++;
STR(s)[0] = c;
return s;
}
char*
rev2(const char* r, String* s) {
if (0 == *r)
return STR(s);
else
return rev2(r+1, pushchar(*r, s));
}
All of that stuff compiles without error or warning with gcc and
CFLAGS = -Wall -pedantic -std=c99, except the ?: tomfoolery. The more stupid things you can do the better, as long as you know you're being stupid and you're being stupid on purpose. Plus, you'll gain an appreciation for high-level languages and Greenpun's Tenth Rule that's been cultivated bottom-up.HTH,
Dr Aybabtu
17 March 2006
daily dose of w
I don't see many shades of gray in the war and terror. Either you're with us or you're against us. And it's a struggle between good and it's a struggle between evil.
GWB
8 Feb 2002
Speaking in Denver, CO at the 2002 Cattle Industry Annual Convention.
(Source: C-SPAN)
GWB
8 Feb 2002
Speaking in Denver, CO at the 2002 Cattle Industry Annual Convention.
(Source: C-SPAN)
Subscribe to:
Posts (Atom)