-title Chouser's Blog -link http://n01se.net/chouser/blog/ -description The web log of Chris Houser -managingEditor chouser@n01se.net -item -pubDate -title ? -id ? -description [=http://images.ucomics.com/comics/ft/2003/ft030814.gif windows joke=] -item -pubDate -title My favorite Firebird extentions -id firebirdexts -description compact menu 1.5.0 flash click JavaScript Console Status JS Console link toolbar 05-04 live http headers mouse rocker nav ook 0.3 user agent switch 0.23 web dev 0.3 -item -pubDate -title Taxes -id taxes -description [=http://www.washingtonpost.com/ac2/wp-dyn/A10889-2003Oct10?language=printer David Broder missing the point about taxes=] It's not about whether or not the wealthiest 1 percent of Americans can afford higher taxes. Of course they can "afford" a higher percentage tax rate than those that have less money, if by afford you mean that they will not starve to death or go without a roof over their heads. The problem is that in a democracy, the minority (in this case the wealthiest 1 percent) is without power. In fact, the wealthiest 49% is a minority, and one could imagine the poorest 51% demanding no taxes for themselves and an extremely high rate for the wealthy. That would be a great relief to those downtrodden "poor" (for a while), and would represent the ultimate "progressive" tax structure. By the way, I am a proponent of progress in general, so to call this wildly unfair tax scheme "progressive" seems entirely inappropriate. Let's call it "scaled" instead. This extremely scaled tax formula isn't likely to happen for a couple of reasons. One is that the U.S. is a republic, not a direct democracy, so there is some chance that cooler elected heads would prevail, even if a bare majority of the voting public believed this ultimate progressive tax were a good idea. But most Americans wouldn't think this is a good idea because they are generally optimistic, and the wealthiest of the poor 51% probably have hopes and plans for becoming a little richer in the future, and would oppose taxing their future selves so heavily. The opposite extreme would be, I suppose, a flat tax rate that would apply to everyone, regardless of income or wealth. While I must admit I find its simplicity charming, I expect the best plan would fall somewhere between the extremes. So the question is, as it often is, where to draw the line? The engineer in me begs for something simple, some formula without a lot of exceptions, loopholes, tax lawyers, financial consultants, or paperwork. I have to believe that the simpler the system, the less benefit the rich would derive from being rich enough to hire people to find the exceptions and loopholes. But that's not really the point of this post, so I'll move on... Since the rich can "afford" high taxes, they're not actually the strongest proponents of flatter tax rates. The strong advocates are more likely to be those that are not yet rich, but are working and hoping to become richer -- the entrepreneurs, working people taking night classes to qualify for better jobs. ... -item -title retsubilif -pubDate -id retsubilif -description I watched several hours of the Senate debate last night. I think that says more about how much of a political junky I am than how interesting the debate actually was. So I'm going to quote some exerpts below, but first a disclaimer... There was obviously a lot of material to choose from witha wide variety of tone and quality. It would probably be possible to make any viewpoint by choosing the right exceprts. These quotes will obviously be reflection of my viewpoint. One more note -- each of the quotes below is separate. They occured in this order, but not contiguously. -blockquote Mr. Hatch (R): [T]here is a vocal minority of Senators preventing us from doing our constitutional duty to vote on judicial nominees. The American people need to know this, and although some of these folks have been moaning and groaning on the other side that we are taking this time, I suggest to them that there is hardly anything more important in a President's life. Mr. Schumer (D): The bottom line is very simple, we have supported and confirmed 168 judges whom President Bush has sent us. We have blocked 4. Mr. Feingold (D): Mr. President, I think we ought to be spending 30 hours on the manufacturing crisis in our country. Mr. Hatch (R): Every one of President Clinton's judges who hit the floor got a vote up or down, and only 1 out of 377 was defeated. But a minority of the Senate is rigging the system by engaging in an unfair set of unprecedented filibusters which are the culmination of an outright assault on the independence of the Federal judiciary. Mr. McConnell (R): Mr. President, my Democratic colleagues try to justify their unprecedented filibusters of President Bush's nominees by arguing that they want mainstream judges and that President Bush's nominees do not fit that criteria. Mainstream judges--I am a little puzzled by that assertion. I would think, for example, that Priscilla Owen is in the mainstream. She was rated unanimously well qualified by the ABA. She was endorsed by the past 16 Texas Bar Association presidents, both Democrats and Republicans. She has been twice elected to statewide judicial office in Texas, one of the States where they elect judges, and the last time, interestingly enough, she got 84 percent of the vote. Mrs. Feinstein (D): Let me name some of the Clinton nominees who were filibustered by one or two members of the Judiciary Committee. Elena Kagen, nominated to the District of Columbia Circuit, nominated by Clinton, June 17, 1999. The nomination was returned December 15, 2000. She waited 547 days without getting a hearing or a vote in the Judiciary Committee... The committee's rule in question contains the following language: -i The chairman shall entertain a nondebatable motion to bring a matter before the committee to a vote. If there is objection to bringing the matter to a vote without further debate, a rollcall of the committee shall be taken and debate shall be terminated if the motion to bring the matter to a vote without further debate passes with 10 votes in the affirmative, 1 of which must be cast by the minority. That enables the minority to delay a matter. It is in the rules of the committee to give it more time. This rule is not being followed. Mr. Durbin (D): Then, of course, there were 4 who were not approved--168 to 4... By any reasonable standard, this President is doing very well. Mr. Sessions (R): I think [Senator Durbin] misspoke when he said the Senate has said no to these nominees. What the Senate has said no to is an up-or-down vote. They have denied these nominees a vote. Mr. Sessions (R): President Clinton had 377 judges confirmed. One judge was voted down on an up-or-down vote on this floor, a majority voted no--only one. When he left office, there were 41 judges pending and unconfirmed--only 41. President Clinton personally withdrew the nominations of 18. That is how they get 60. -item -pubDate 2005-07-12T00:49:14.17-05:00 -title Building a fence. -id fence -description -raw
|
With this entry I narrowly escape leaving my blog dorment for an entire year. My wife took this picture as we began building a fence around our back yard. We're pretty much done now, but I haven't taken any more photos yet. |
|
This small tray sits in the lower-right corner of my screen and
gives me all the information I need -- systray icons, CPU meter,
and the current time and date. In the far right corner is also my
current virtual desktop number; more on that in a minute. That's
all that stays on my screen -- no start menu button, no desktop
icons, no annoying list of open windows -- nothing but this small
clean tray.
Litestep provides fully customizable menus, including a nice
root-menu so I can get to the normal list of programs by
right-clicking anywhere on the desktop. It also lets me bind
keystrokes so I can get to everything I need from the keyboard,
without even reaching for the mouse. It's all very nice.
I do need to mention the virtual desktops, though. Litestep can
provide virtual desktops via one of several plugins, any they
provide the very pretty feature of drawing miniature
representations of all your desktops. However, I chose not to use
these for a couple of reasons. The main reason is that they all
seem to hide the windows not on the current desktop by moving them
beyond the border of the screen. This as two negative
consequences: one is that all the windows on all the desktops show
up in my alt-tab list simultaneously; the other is that they get
very confused when my desktop changes size so that I end up with
pieces of windows hanging off the sides of my screen. The other
reason is the process-blocking issue I mentioned before; if the
same process provides all my menus and my virtual desktops, I
could become pretty badly stuck.
So I continue to use the excellent
[=http://www.windowspowerpro.com/ Windows PowerPro=] for my
virtual desktops, and it is actually what is drawing the desktop
number in the lower-right corner of my screen. I think it is
evidence of the quality of both Litestep and PowerPro that they
work so well together.
-item
-title That is called a theme.
-pubDate 2003-11-10T12:17:48.72-05:00
-id bushdemocracy
-description
[/With a strong sense of history, George W. Bush last week made
the case for "a forward strategy" of idealism in American
foreign policy... "From the Fourteen Points to the Four
Freedoms, to the Speech at Westminster, America has put our
power at the service of principle," Bush said. "The advance of
freedom is the calling of our time."/]
[/That is called a theme.../]
[/Most people did not have the chance to catch the whole speech
on cable, and found only snippets on broadcast TV; the longest
excerpt of the half-hour address ran less than four minutes on
prime-time network news.../]
[/[N]ot even The Times gave readers the chance to study the full
text in the paper. (It's on the
[=http://www.nytimes.com/2003/11/06/politics/06TEXT-BUSH.html?pagewanted=print
Times Web site=]...)/]
[/This speech clearly articulated the policy this Bush will be
remembered for. If you are interested in knowing where he wants
to take this country and why, you will find it worth reading all
the way through. Reading summaries and excerpts and critiques
lets editors and analysts do the thinking for you. Film snippets
of applause lines won't help you grasp the import, which you
should have even if you want to disagree knowledgeably./]
--William Safire,
[=http://www.nytimes.com/2003/11/10/opinion/10SAFI.html?n=Top%2fOpinion%2fEditorials%20and%20Op%2dEd%2fOp%2dEd%2fColumnists%2fWilliam%20Safire&pagewanted=print
The Age of Liberty=]
-item
-pubDate 2003-10-31T01:12:36.68-05:00
-title Tools to make Windows livable.
-id wtools
-description
Several months ago I accepted a new position where I work almost
exclusively in Windows. I've made peace with this and settled in,
at least until I can start helping with a Linux port. Here are
the tools that make living in Microsoft's world possible:
-dl
-dt [=http://www.vim.org Vim=]
-dd
An extremely comfortable interface to text in all its forms.
-dt [=http://www.chiark.greenend.org.uk/~sgtatham/putty/ putty=]
-dd
This is a very solid terminal emulator with telnet and ssh
built right in. Besides being wholly functional, it has the
little extras that make me feel at home, like select-to-copy
and right-click-to-paste.
-dt [=http://www.cygwin.com/ CygWin=]
-dd
All the little tools that every OS should provide, but
Microsoft left out. You know: grep, tail, xargs, ... gcc.
-dt [=http://perl.com/ Perl=]
-dd
Because sometimes a batch file just won't cut it. I'd be
happy to list [=http://www.python.org Python=] or
[=http://ruby-lang.org/en/ Ruby=] here, but as it turns out
even the non-unixy people around here already have Perl
installed.
-dt [=http://texturizer.net/firebird/ Firebird=]
-dd
For now, it's [-The-] web browser. Eventually it may just be
the [=http://mozedit.mozdev.org/ editor=],
[=http://xmlterm.sourceforge.net/ terminal emulator=], and
[=http://aspn.activestate.com/ASPN/Mozilla development
environment=] too.
I'll post my favorite extensions later.
-dt [=http://www.windowspowerpro.com/ Windows PowerPro=]
-dd
Once upon a time, I had three 21-inch Trinitrons on my desk,
and I used virtual desktops on each. Now I have a single
17-inch, so to be stuck on one desktop would mean constant
pain.
Windows PowerPro to the rescue: it provides solid virtual
desktops with a highly configurable interface. And I don't
mean skinnable, although it may be that too; what I mean is I
can set keyboard shortcuts and have it otherwise just stay out
of my way. It also has tons of extra little features I'm
barely using.
-dt [=http://rom.jalix.org/software.html#shidewin ShideWin=]
-dd
Of course something as powerful as virtual desktops couldn't
be possible in Windows without some kind of complication. As
it turns out, there appears to be no way to show or hide a
window without going through it's application's event loop.
Trash X-Windows if you want to, but it sure got this one right.
Anyway, this means that if an app is "not responding" (perhaps
because you're debugging it and at a breakpoint), the
desktop-switcher thread blocks waiting for the stuck app to
respond.
ShideWin is the handy little program I use to get myself
un-stuck in the situations. It's sad that I need it at all,
and worse that I use it almost every day, but it's just the
natural consequence of the "design" decisions embodied in
Windows.
Without these I could still do my job, I just wouldn't want to.
[/PS. Until I get trackback figured out, I'll have to link to
related posts manually.
[=http://www.livingtorah.org/journal/archives/2003_11.php#002263
Like this=]./]
-item
-pubDate 2003-09-29T17:16:52.04-05:00
-title Treason
-id coultertreason
-description
I didn't know that Senator Joe McCarthy's claims about Communists
in the State Department have turned out to be true. I didn't know
that many of those he accused not only had Communist beliefs but
were actually being paid by the USSR for information and
influence. I hadn't realized how many people believed that the
best we could hope for against Communist Russia was stalemate, and
never heard President Reagan's plans to crush Communism described
as a cohesive strategy.
But now I know, because I have been informed -- I just finished
reading [=http://anncoulter.com/ Ann Coulter=]'s latest book,
[=isbn:1400050308 [\Treason\]=]. If any of these statements have
surprised you, you should definitely read this book. It's easy to
follow, but is copiously footnoted which make continuing research
on your own much easier.
If you aren't familiar with Coulter's writing or are not already
persuaded by conservative ideas, you may have her style a bit
abrasive. She unfortunately attempts to use name calling and
exaggeration for humor. If these jokes bother you, just ignore
them; her arguments do not rely on [/ad hominem/] attacks.
Most of the book is about critical moments in the last 100 years
of American history, updated with recent findings and discussed in
the light of current events. You really ought to read it.
-item
-pubDate 2003-09-28T23:01:08.80-05:00
-title Nuclear option
-id senatenuclear
-description
Since Miguel Estrada withdrew his name from consideration for the
US Court of Appeals (a few weeks ago now), you may have heard more
mention of the "Nuclear option." Most media outlets seem to treat
this kind of thing as if it's too difficult for us to understand
the actual details, so they talk in metaphor and hyperbole. I
decided to see if I could figure out what's really going on.
Estrada is one of the judicial nominations made by President Bush
that the Senate Democrats have been keeping from getting a vote on
the Senate floor. When they had the majority in the Senate, the
Democrats didn't let the nominations out of committee. Now that
they no longer control the committees, they're using the threat of
filibuster to prevent the vote from happenning.
Time is set aside before most votes to give the Senators a chance
to debate that vote. A filibuster is just taking advantage of this
time to talk endlessly and prevent any other business from getting
done, including the vote itself. A cloture motion is a way to
force an end to the debate and move on to the vote itself. All of
this is laid out in the Senate rules which are agreed upon by the
Senators themselves. Senate Rule XXII (that's Rule 22 for the us
non-Romans) deals with cloture:
-blockquote
[T]he Presiding Officer shall, without debate, submit to the
Senate by a yea-and-nay vote the question: "Is it the sense of
the Senate that the debate shall be brought to a close?" And if
that question shall be decided in the affirmative by
three-fifths of the Senators duly chosen and sworn -- except on
a measure or motion to amend the Senate rules, in which case the
necessary affirmative vote shall be two-thirds of the Senators
present and voting -- then said measure, motion, or other matter
pending before the Senate, or the unfinished business, shall be
the unfinished business to the exclusion of all other business
until disposed of.
Thereafter no Senator shall be entitled to speak in all more
than one hour on the measure...
-- [=http://rules.senate.gov/senaterules/rule22.htm from Senate
Rule XXII=]
This "two-thirds" is the infamous "super-majority" that the Senate
Republicans do not have, which means the Democrats can block any
motion they decide is worth filibustering. Naturally, the Senate
Republicans are looking for ways to get these nominees past a
filibuster. I was surprised to find that they actually have a
couple different options here. I guess I didn't realize the
Constitution doesn't directly address this level of detail.
Senate Rules still have to answer to a higher law.
-blockquote
[Some] Members of the majority [are] saying they are going to
have this rule changed regardless of what the Rules Committee
does; that if it does not work out in the Rules Committee, they
are going to come here and have the Presiding Officer just say
what we have been doing is unconstitutional.
-- [=http://thomas.loc.gov/cgi-bin/query/z?r108:S09MY3-0008:
Senator Reid=]
Well that's an option, but it may not work. And if it [/does/]
work, would there be other consequences? Senate Minority Whip
Harry Reid continued...
-blockquote
[T]o say suddenly that you cannot have a filibuster because it
is unconstitutional, creates many different problems. Does that
mean if 11 members of the Judiciary--a majority--holds up a
judicial nominee, that that is unconstitutional and it can come
immediately to the floor? I think not.
This is what's being described as the "nuclear option". So maybe
we should set that option aside -- I very much doubt the Republican
leadership would go for it, anyway.
But there's another little loophole in Rule XXII. A motion to
amend the Rules only requires "two-thirds of the Senators present
and voting." So the Republicans could propose an amendment to
Rule XXII which would make it easier to break a judicial
nomination filibuster. Even if the Democrats hated it badly
enough to filibuster the amendment, perhaps the Republicans could
schedule a cloture vote when fewer Democrats were around, in which
case it might pass.
Feels like hacking, doesn't it?
But this is actually what Senate Majority Leader Bill Frist has
begun doing. Using concepts and language from amendments proposed
in the past by Democrats,
[=http://thomas.loc.gov/cgi-bin/query/z?r108:S09MY3-0006: Frist
proposed=] his own amendment to Rule XXII:
-blockquote
My proposal is similar to [one] by my
distinguished Democratic colleague from Georgia, Senator ZELL
MILLER, [and to one] offered in 1995 by the
distinguished Democratic Senators from Iowa and Connecticut, TOM
HARKIN and JOE LIEBERMAN...
My resolution... is more narrowly tailored [and] applies only to
nominations. It leaves the rest of rule XXII unamended. It
addresses the very specific defect that needs repair.
Although some news reports are erroneously describing this option
as being "nuclear" as well, Senator Reid (D) disagrees:
-blockquote
Now, I do say to the leader [Mr. Frist] that I think this is
being approached in a proper fashion. I think that to go to seek
a rules change is the way it should be done. If you don't like
what is going on here, try to change a rule.
-- [=http://thomas.loc.gov/cgi-bin/query/z?r108:S09MY3-0008:
Senator Reid=]
It'll be interesting to see where this ends up.
[/PS. Sorry for the long gap in blog updates. There are many
reasons for this, but none of them serious or commendable. Of
course I was afraid from the beginning that I would drop the ball,
but hopefully this post is the beginning of regular updates
again./]
-item
-pubDate 2003-09-04T13:03:50.58-05:00
-title Blog reloaded
-id reload
-description
Ok, the auto-reload system I
[=http://bluweb.com/chouser/info/blog/#bloggysog described
earlier=] is back on line. The design is fundamentally the same,
but the code now checks for a couple of common situations that had
been causing [=http://bluweb.com/chouser/info/blog/#diereloaddie
significant failures=] previously. For example if either the XML
version-number file or the blog page itself was "stuck" in the
browser's cache, my code would reload the blog wildly and
repeatedly.
Anyway, this and other problems should now be fixed. Let me know
if you see any more problems.
-item
-pubDate 2003-08-29T23:42:45.96-05:00
-title Auto-reload problems
-id diereloaddie
-description
A couple of readers have seen problems with this blog's
auto-reload feature; either it's not reloading at all (hi Aaron),
or it reloads constantly (hi Amby). This obviously won't do, so
I'm turning the feature off until I can kill these bugs.
Sorry for any trouble.
-item
-pubDate 2003-08-29T09:30:00.49-05:00
-title Mozilla goodies
-id mozgoodies
-description
I've wondered for a long time how to log my own custom
messages into Mozilla's JavaScript Console. Searching the web, I
was only able to find others asking similar questions, but no
answers. So I dug around; with the help of the
[=http://unstable.elemental.com/mozilla/ Mozilla cross-referenced
source=] and some experimentation, here is a solution.
Unfortunately, you need to enable higher privileges, and I have no
way of knowing if this is the easiest way. It's not as simple as
I'd hoped, but it works:
-pre
var PM = netscape.security.PrivilegeManager;
PM.enablePrivilege( 'UniversalXPConnect' );
var logString = Components.classes[
'@mozilla.org/consoleservice;1'
].getService(
Components.interfaces.nsIConsoleService
).logStringMessage;
That enables the privileges you need and grabs a reference to the
function you'll want to use. Now you can just call [.logString.]:
-pre
logString( 'Hello World!' );
By the way, I had forgotten this about JavaScript, but it's
important: Variables in JavaScript are [-global-], even when
first used inside a function, unless you specifically declare them
using [.var.].
While digging around for information about Mozilla and Firebird, I
stumbled across the [.about:cache.] and [.about:config.] URLs. To
try one out, just type it into Mozilla's address box. Using
[.about:config.] I was able to discovered Mozilla's strict
JavaScript mode. Very cool:
-pre
user_pref(
"javascript.options.showInConsole", true );
user_pref(
"javascript.options.strict", true );
Also cool are all [=http://texturizer.net/firebird/tips.html these
tips=] for making Firebird even more enjoyable than it already
was.
-item
-pubDate 2003-08-28T10:23:20.85-05:00
-title Mothra the Blogmonster
-id MtB
-description
One problem from [=http://bluweb.com/chouser/info/blog/#mozrss
Monday=] was that setting the XML document's [.onload.] handler
only worked once. Subsequent loads weren't handled at all, until
I switched to using [.addEventListener.] instead. I think the
only other problems that caused the behavior I saw on Monday were
all related to not enabling UniversalBrowserRead privileges
everywhere that I should have.
So now it's working! It places blog entry guids in your browser
history to keep track of which ones you've read, and it uses a
single cookie to store your own personal list of subscriptions. I
still haven't figured out how to sign it, so if you want to use it
you need to restart your browser with the following line added to
your [.prefs.js.]:
-pre
user_pref(
"signed.applets.codebase_principal_support",
true);
Once you've done that, you can
[=http://bluweb.com/chouser/info/blog/mtb.html give it a try=].
Use [.<space>.] to page down or advance to the next unread
entry. There is currently no automatic refresh at all, so you'll
have to do a page reload while holding down [.<shift>.] to
refresh all the feeds.
Don't get too carried away adding subscriptions, because the URL
to Mothra may change, and your cookie may not match once that
happens. If you really want to, you can download both
[=http://bluweb.com/chouser/info/blog/mtb.html [.mtb.html.]=] and
[=http://bluweb.com/chouser/info/blog/mtb.js [.mtb.js.]=] and run
them from your local machine. Then you can upgrade manually in
the future without losing your subscription list, and you won't
have to "trust" anything else from my site.
As an interesting puzzle to solve,
[=http://bluweb.com/chouser/info/blog/mtb.html Mothra=] is a
success. You'll have to let me know whether you think it's a
success as a useful application. Also, look for more details on
code signing once I figure out how to do it.
[/PS. Thanks to [=http://www.css.tayloru.edu/~abrooks/ Aaron=] for
help on the name./]
-item
-pubDate 2003-08-25T23:46:08.20-05:00
-title Mozilla meets RSS
-id mozrss
-description
So after playing around with loading XML files from within
JavaScript for my [=http://bluweb.com/chouser/info/blog/#bloggysog
auto-refresh=] system, I was inspired. Why not load full RSS
feeds this same way? I could build a full RSS blog reader right
in [=http://mozilla.org mozilla=]!
I'm not exactly sure why I'm doing this. Perhaps it's just the
fun of solving an interesting puzzle. It's not like there's
[=http://www.lights.com/weblogs/rss.html too few blog readers=]
out there.
Anyway, if I can get this working, it will be cross-platform (pure
mozilla -- JavaScript, CSS, etc.), highly "skinnable", use the
beautiful gecko engine for rendering content, and "installing" it
will be a matter of adding a link to your bookmarks.
The basics were surprisingly easy, and I've got a
[=http://bluweb.com/chouser/info/blog/img/blogread01.png
screenshot=] to prove it. But I'm now bogged down in mozilla
security model issues. I can't figure out how to get the
privileges I need to load an XML RSS feed from any ol' URL on the
web.
[=http://www.mozilla.org/projects/security/components/signed-scripts.html
This page=] got me started, and I'm using [-codebase principal-]
until I can get everything else working. To do this I had to add
a line to my [.prefs.js.]:
-pre
user_pref(
"signed.applets.codebase_principal_support",
true);
I then believe I need to enable some privilege from within my
JavaScript, like this:
-pre
netscape.security.PrivilegeManager.enablePrivilege(
"UniversalBrowserRead");
Doing this makes the security errors go away, but the XML document
never gets loaded, or at least the [.onload.] handler never gets
called. Until I figure out why that is, this is pretty much
useless.
-item
-pubDate 2003-08-21T16:24:23.62-05:00
-title Bloggy sog.
-id bloggysog
-description
The HTML-based version of this blog now has an automatic refresh
system. I hope it will keep your copy of my blog from getting old
and soggy. The page uses JavaScript to periodically fetch an
extremely small XML file. The XML is never displayed on the
screen, but instead is used by the JavaScript to determine if a
reload is necessary. This is my first attempt to use this kind of
background data-fetch on a web page.
Periodically, an XML file named [.blogv.xml.] is fetched from the
web server. It contains a number describing the latest version of
this blog that has been uploaded. For example, it might contain:
-pre
<v>42</v>
One of the [.<meta>.] tags in the HTML file also contains a
version number, like:
-pre
<meta name="version" content="42" />
When the XML file is reloaded, once every half-hour, its fresh
number is checked against the version number in the older HTML
file. If the numbers don't match, the HTML page currently in the
browser must be out-of-date, so the page is re-loaded.
You can check to see if this is working for you by scrolling to
the bottom of this page. The date and time marked as "Last
auto-sync" is when your browser last fetched [.blogv.xml.] and
confirmed that the page you're looking at is the latest version.
If you see "none succeeded", it's probably because your browser
doesn't support the XML features needed (ie. you're using IE or
some other non-gecko browser), or perhaps you have JavaScript
turned off.
Most of the work is done by
[=http://bluweb.com/chouser/info/blog/reloader.js
[.reloader.js.]=]. In order to allow the same JavaScript to be
used by multiple web pages, it gets all the information it needs
from the HTML page header:
-pre
<meta name="version" content="42" />
<link rel="latestversion"
href="http://bluweb.com/chouser/info/blog/blogv.xml" />
<script src="info/blog/reloader.js"
type="text/javascript">
</script>
The web page also kicks off the sync timer from its [.<body>.]
tag:
-pre
<body onload="startreloader()">
Finally, the date and time are included at the bottom using an
element with [.id="checkdate".]:
-pre
Last refresh auto-check:
<span id="checkdate">
none succeeded
</span>
This was all inspired by [=http://www.css.tayloru.edu/~abrooks/
Aaron=], who noted that a 50K page reloaded every hour generates
at least 1.2MB of traffic per day. Instead, this system downloads
less than 250 bytes per sync, including all the HTTP headers.
Adding in one full 50K page per day for when I've actually posted
something new, a whole month of traffic would come out to about
1.7MB. That's a pretty dramatic improvement. Thanks, Aaron!
-item
-pubDate 2003-08-19T16:08:27.41-05:00
-title A viscous cycle
-id englisherrors
-description
I just stumbled upon [=http://www.wsu.edu/~brians/errors/ Common
Errors in English=], and I'm very much enjoying it, especially the
[=http://www.wsu.edu/~brians/errors/errors.html list of errors=]
and [=http://www.wsu.edu/~brians/errors/nonerrors.html
Non-Errors=]. It's full of useful, witty answers and careful
detail. Of course, I would never hurl
[=http://www.wsu.edu/~brians/errors/epigram.html epitaphs=] at
those who make silly mistakes,
[=http://www.wsu.edu/~brians/errors/irregardless.html
irregardless=] of the cause. In fact, I
[=http://www.wsu.edu/~brians/errors/care.html could care less=]. I
don't think it's worth banging on a
[=http://www.wsu.edu/~brians/errors/podium.html podium=] at those
who are [=http://www.wsu.edu/~brians/errors/flounder.html
foundering=] with the language. Life is enough a
[=http://www.wsu.edu/~brians/errors/veil.html veil of tears=]
already.
Also fun:
-ul
-li American [=http://www.wsu.edu/~brians/errors/emigrate.html
emigrants=].
-li Start from [=http://www.wsu.edu/~brians/errors/zero.html
ground zero=].
-li [=http://www.wsu.edu/~brians/errors/confusionism.html
Confusionism=].
-li [=http://www.wsu.edu/~brians/errors/depreciate.html
Depreciated=] features.
-li Getting caught in a
[=http://www.wsu.edu/~brians/errors/vicious.html viscous
cycle=].
-item
-pubDate 2003-08-18T13:15:19.24-05:00
-title private? static? unnamed?
-id staticfunction
-description
The first C++ project larger than a small class assignment that I
ever worked on was for my
[=http://www.bluweb.com/us/chouser/proj/magiclens/ senior
project=] in [=http://www.css.tayloru.edu/ Computer Science at
Taylor=]. As I worked, I became frustrated with the consequences
of some of my design decisions which had seemed obvious when I
made them. In desperation I went went to a bookstore (Borders, I
think) to some C++ book to help, but I was totally overwhelmed by
the number of books available, most of which didn't look like they
would help me.
After flipping through the first couple pages,
[=http://dev.gentoo.org/~agriffis/ Aron=] suggested
[=isbn:0201633620 Large-Scale C++ Software Design by John Lakos=].
I was under no illusions about my class project being truly
"Large-Scale", so I didn't think the book would help me. I was so
wrong. It answered every question I had at the time, and educated
me on questions that I [/should/] have been asking, but wasn't.
It educates me to this day.
-h4 private?
Here's a little gem. Hopefully most C++ programmers are already
familier with this point, but I know I sure wasn't taught anything
like this in school:
-blockquote
...all other things being equal, it is better to insulate a
client from an implementation detail than not to do so--even if
only to reduce the clutter in the physical interface...
Private member functions, although encapsulated logical
implementation details of a class, are part of the physical
interface of a component...
Sometimes functions are made private members not because they
need private access but because the private section of the
header file is a good place to store these factored helper
functions. That is, some private helper functions can do all of
their work using only the public interface of the class. In
these cases, the transformation from private member to static
free functions is easy and quickly accomplished...
[Lakos 6.3.3]
-h4 static?
I was struggling with this today because I thought that all free
functions (i.e. global, not member functions) were static by
default and that by default they are accessible to other object
files when linked (i.e. have external linkage). In fact, my
[=isbn:0201514591 C++
reference=] says:
-blockquote
All global objects have storage class [/static/]. [Stroustrup
3.5]
So if a static free function is just a default global function,
and by default global functions have external linkage, how does
this accomplish the privacy Lakos thinks we should have?
Well, Stroustrup thought that might confuse me:
-blockquote
The word "static" has two basic meanings in C and C++. One is
"allocated once at a fixed address" (as opposed to allocated on
the stack once per function call); the other is "local" (as in
local to a translation unit or "in class scope"). These two
meanings interact and frequently cause confusion. [Stroustrup
7.1.1]
BTW, a "translation unit" is a basically a [..c.] file and all of
the files it [.#include.]s.
So now it starts to make sense. By default, functions have
[/storage class static/], but that's not the same as being
"local". As it turns out, the rules for determining whether
something will be local or global are not trivial:
-blockquote
A name of file scope that is explicitly declared [.static.] is
local to its translation unit and can be used as a name for
other objects, functions, and so on, in other translation units.
Such names are said to have internal linkage. A name of file
scope that is explicitly declared [.inline.] is local to its
translation unit. A name of file scope that is explicitly
declared [.const.] and not explicitly declared [.extern.] is
local to its translation unit. So is the name of a class that
has not been used in the declaration of an object function, or
class that is not local to its translation unit and has no
static members and no noninline member functions. Every
declaration of a particular name of file scope that is not
declared to have internal linkage in one of these ways in a
multifile program refers to the same object, function, or class.
Such names are said to be external or to have external linkage.
Typedef names, enumerators, and template names do not have
external linkage.
Static class members have external linkage.
Noninline class member functions have external linkage. Inline
class member functions must have exactly one definition in a
program.
Local names explicitly declared [.extern.] have external linkage
unless already declared [.static.].
[Stroustrup 3.3]
Ok, well that's all a bit of a mess. The simple point is that
although the storage class of all file-global declarations is
[/static/], those that are specifically declared [.static.] are
private to that translation unit. Or as Stroustrup puts it:
-blockquote
A name specified [.static.] has internal linkage. [Stroustrup 7.1.1]
-h4 unnamed?
A final thought... Lakos does mention another way to write free
functions for use within a single translation unit:
-blockquote
We will be able to achieve this same effect more elegantly using
unnamed namespaces... once this relatively new language feature
becomes more widely available. [Lakos 6.3.3]
In fact, global [.static.] functions are actually deprecated in
C++:
-blockquote
Unnamed namespaces make global [.static.] redundant. For
example:
-pre
namespace {
void f(); // accessible from this
// translation unit;
// inaccessible from
// other units
}
[Stroustrup 3.3.1.5]
-item
-pubDate 2003-08-16T09:31:59.83-05:00
-title What a punny name!
-id svnarch
-description
[=http://subversion.tigris.org/ Subversion=] is meant to be a
successor to [=http://www.cvshome.org/ CVS=], and I've just
started using it. Another system competing to replace CVS is
[=http://regexps.srparish.net/www/ [.arch.]=], which I have
explored using in the past. So why have I chosen Subversion (at
least for now) over [.arch.]?
Perhaps the most important reason is that there appears to be a
good deal more momentum behind the development of Subversion
than [.arch.]. Regardless of the reason for this, it has some
important consequences including more frequent bug fixes, new
features completed sooner, etc. Even if the [/current/] product
is less mature or lacking in features (I'm not saying it is),
these consequences may allow it to overcome any current
shortcomings.
My other reasons are slightly more embarrassing. For one,
Subversion has a less radical paradigm than [.arch.]. This
isn't necessarily good, but it does mean it's easier for someone
who is familiar with CVS to start using Subversion. Also,
Subversion has better support for running on Windows, and I'm
afraid that has enough of an impact on my reality right now that
it also factored into my decision.
Subversion was easy to set up (with the help of
[=http://svnbook.red-bean.com/ this handy book=]) and is now
successfully keeping my blog files synced up. Of course it's
too soon to know how things will end up, but so far using
Subversion has been a positive experience.
-item
-pubDate 2003-08-15T09:35:11.27-05:00
-title And the winner is...
-id shortsortwin
-description
The [=http://bluweb.com/chouser/info/blog/#shortsort shortest C
sort function=] contest has concluded. We have a tie at 62 chars.
[=http://www.css.tayloru.edu/~abrooks/ Aaron=] gets top billing
for a solution that even works with zero-length arrays:
-pre
S(a,c)int*a;{for(;c;*a>a[c]?*a^=a[c]^=*a^=a[c]:0)S(a+1,--c);}
[=http://www.css.tayloru.edu/~bbell/ Bob=] uses an independently
engineered but identical test-and-swap clause, identical function
definition syntax, and weighs in at the same 62 chars, but his
loop doesn't like zero-length arrays:
-pre
S(a,n)int*a;{for(;--n;S(a+1,n))*a>a[1]?*a^=a[1]^=*a^=a[1]:0;}
Michael Sterrett (aka Mr. Bones) came in a close 3rd with
65 chars:
-pre
S(int*a,int c){for(;c--;S(a++,*a>a[c]?*a^=a[c]^=*a^=a[c],c:c));}
My solution came in a dismal 4th place at 66 chars, and still
breaks for zero-length arrays:
-pre
S(int*a,int n){--n?S(a,n),S(a+1,n),n=a[1],n<*a?a[1]=*a,*a=n:0:0;}
Sterrett and I failed to discover the default parameter-type trick
that Aaron and Bob used, but after seeing it we could both shorten
our solutions to a [/very/] close 63 and 64 chars, respectively:
-pre
S(a,c)int*a;{for(;c--;S(a++,*a>a[c]?*a^=a[c]^=*a^=a[c],c:c));}
S(a,n)int*a;{--n?S(a,n),S(a+1,n),n=a[1],n<*a?a[1]=*a,*a=n:0:0;}
Aaron submitted some of his earlier attempts as well. Here's a 64
char solution using double-recursion (doesn't do 0-arrays):
-pre
S(a,c)int*a;{--c?S(a,c),S(++a,c),*a<(c=*--a)?*a=*++a,*a=c:0:0;}
When he added 0-array's to the above, he ended up with 66 chars:
-pre
S(a,c)int*a;{--c>0?S(a,c),S(++a,c),*a<(c=*--a)?*a=*++a,*a=c:0:0;}
While we're looking at non-winners, here's my 50 char solution
that breaks key rules of the contest (uses a library and
constrains the array to 99 entries:
-pre
S(int*a,int*b){return b>99?*a-*b:qsort(a,b,4,S);}
-item
-pubDate 2003-08-14T21:54:39.67-05:00
-title Slimy Donkeys
-id blogsd
-description
Neither [=http://www.yaml.org/ YAML=] nor
[=http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/74043
RedCloth=] is working out for me, as I described
[=http://bluweb.com/chouser/info/blog/#blognotyaml
yesterday=]. So I've attempted to create a solution that is good
at describing both structure and document text and is also easy to
edit in a text editor, especially [=http://www.vim.org vim=]. For
now, I'm calling my new file format "SD".
-h4 Symbolic Data
An SD document represents an ordered hash (sorry Brett) which can
be thought of as a list of key/value pairs (PairList). Each key
is a string, and each value is either a string, or another
PairList.
-raw
-title Chouser's
-item
-id head
-title Genesis
-item
-id foot
-title Apocalypse
In this example, the top-level PairList includes a pair whose key
is [.title.] and value is [.Chouser's.]. It also includes two more
pairs, both of which have keys of [.item.]. Each pair with a key
of [.item.] has a value that is a PairList of length two.
This is quite similar to XML (except XML tags can have
attributes). And like XML, there's a bit of ambiguity about
whether the key is an object name or a type name. For example
[.id.] and [.title.] both have values that are generic strings, so
they're acting as object names. However, [.item.] shows up a
couple times in the same PairList, so it can't really be an object
name. Instead, each [.item.] value contains the same list of
keys, so [.item.] is acting more like a type name. This is an
ambiguity I'm willing to accept for the sake of brevity in the
document itself. It doesn't seem to have hurt XML too badly
(yet)...
-h4 Synthetic Document
So far, this is just sort of a weak YAML. So to help tip the
balance toward document text, SD provides a special syntax for
key/value pairs when the key is nil. The special syntax is to
leave out the key:
-raw
-item
-id head
-title Genesis
Value whose key is nil.
A second value whose key is nil.
This is still part of the second value.
-pubDate today
This item has 5 pairs, and two of them (the 3rd and 4th) have
nil keys. How the value of a nil-node is used is
application-specific, just like how an [.item.] or [.title.] is
used is application-specific. But it sure would be convenient for
nil-nodes to be used for paragraphs of text.
-h4 Simple Delimiters
Another feature I wanted is inline markup for hyperlinks, bold,
italic, etc. This is what RedCloth had been trying to do for me,
before I gave up on it. SD provides a small set of punctuation
that can be used for inline markup:
-ul
-li [.[/[/emphasized/]/].]
-li [.[-[-strong-]-].]
-li [.[.code.].]
-li [.[\[\citation\]\].]
-li [.[=[=http://bluweb.com/ http://bluweb.com/=] hyperlink=].]
-h4 Structured Dashes
That's all there is to it. I've written a parser package in Ruby,
along with some code that can generate HTML fragments from SD
document fragments, and a vim syntax file. It tries to leave HTML
tags alone and escape other punctuation, so that anything SD can't
do for you, you can still do with some HTML of your own. I've
also written Ruby programs that use the parser to generate the RSS
and HTML formats of my blog from
[=http://bluweb.com/chouser/info/blog/blog.sd SD source=]. The
parser API and the SD format are both [-extremely-] young; I
really only started a couple days ago. I'll include links to the
code below, but don't rely on any of this being stable or staying
consistent. As always, [=mailto:chouser@bluweb.com comments are
welcome=]. I'll post more details and updates as events warrant.
-ul
-li [=http://bluweb.com/chouser/info/blog/blog.sd This blog in
SD format=]
-li [=http://bluweb.com/chouser/info/blog/sd.rb SD parser and
HTML utilities in Ruby=]
-li [=http://bluweb.com/chouser/info/blog/sd2rss.rb Tool to
convert my SD blog to RSS=]
-li [=http://bluweb.com/chouser/info/blog/sd2html.rb Tool to
convert my SD blog to HTML=]
-li [=http://bluweb.com/chouser/info/blog/sd.vim SD syntax file
for vim=]
[/P.S. I didn't realize until nearly done with this post that I
was unconciously copying my headline style from Charlie's
[=http://www.livingtorah.org/~csebold/emacs/why.phtml EMACS=]
page. Sorry for the Simple-minded Duplication, Charlie!/]
-item
-pubDate 2003-08-13T11:49:19.40-05:00
-title Like I need a hole in my head
-id blognotyaml
-description
What the world needs now is another structured text file format.
Our current options ([=http://www.langdale.com.au/SOX/ SOX=],
[=http://www.yaml.org/ YAML=],
[=http://www.triptico.com/software/grutatxt.html Grutatxt=],
[=http://www.stalphonsos.com/~attila/remark/ remark=],
[=http://bradchoate.com/past/001653.php Textile=],
[=http://ettext.taint.org/doc/ettext.html EtText=],
[=http://txt2html.sourceforge.net/ HTML::TextToHTML=], and oh-yeah
[=http://www.w3.org/XML/ XML=]) are entirely insufficient.
Of course I'm being a bit facetious, but I'm not entirely kidding.
The [=http://bluweb.com/chouser/info/blog/#blogyaml "YAML with a shot of Textile"=] quip should have
been a clue. Each of the packages I just listed leans rather
heavily toward either [/data-structure/] representation (SOX,
YAML) or [/document/] representation (all the others).
Unfortunately, my blog is a mixture of the two. As a whole, it is
a data-structure -- a title, author, etc. and a list of entries
each of which has a date, title, etc. However, the body of each
entry is of course a sort of miniature document. This can be
quite adequately [/represented/] in the more disciplined formats
(XML, YAML, SOX), but it is not necessarily easy to [/edit/] in
any of them. Someday there will be an XML editor that does this
for us, but that's another story...
So I thought that YAML for structure and Textile for the text was
a good plan. YAML allows an indented structure that
[=http://www.vim.org vim=] is quite happy with, and Textile
translates easy-to-type markers into HTML (like *bold*
into [-bold-]). The fact that YAML and
[=http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/74043
RedCloth=] (Textile for [=http://ruby-lang.org/en/ Ruby=]) seemed to
work well together, I think, helped obscure the weaknesses of
both.
It was RedCloth that cracked first. It's got some implementation
issues, but once I started pulling that thread the whole thing
unraveled. It's goals are a bit too lofty, and it's design is
[/far/] too complex. It uses multiple passes through the text to
apply all of it's various formatting rules, which means each pass
can have undesired effects on the following passes. The code
attempts to correct for these, but it quickly becomes a big hairy
mess.
Since I really didn't need all of Textile's features, I looked
around at the other options available. None of them seemed to be
a really good fit, and my needs (I thought to myself) were quite
modest. So I set about writing my own alternative. This is where
YAML started to fall apart. Apparently it does some amount of
processing on text blocks itself, merging paragraphs into long
lines, deleting blank lines, and generally wreaking havoc. Trying
to correctly process my text blocks was turning out to involve a
whole lot of fighting to get back information YAML had lost or
obscured for me.
What the world needs now is new structured text file format.
To be continued...
-item
-pubDate 2003-08-12T10:40:31.61-05:00
-title Contest: shortest C sort function
-id shortsort
-description
Here's a fun little puzzle proposed by
[=http://www.css.tayloru.edu/~abrooks/ Aaron=]. What's the
shortest C function you can write that sorts an array of int's?
Your function should work when called as: S(int *array, int
length)
You can't use any #includes or libraries in your function, and
it must compile in gcc with no command-line flags, although
warnings are ok. It can't assume anything about the array
values; duplicates, zeros, negative numbers, etc. should all be
handled correctly.
Give it a try; it's fun! At least a half-dozen of Aaron's
friends are working on this, and I'll post the results here
later this week. If you'd like to have your entry listed here,
just [=mailto:chouser@bluweb.com send it to me=]. So far we've
got three entries under 70 bytes long (that includes a newline
at the end of the function definition).
Here's the program your function needs to work in -- you just
write your own "sort.c":
-pre
#include | Required | Optional | Slurpy | |
|---|---|---|---|
| Positional | $ | ?$ | *@ |
| Named | + | *% |