Monday, June 30, 2008

multiple pictures in a post

I found that it's tricky to insert multiple pictures in a post and have it look decent, as in this post. I wanted to have the pictures near the text, so I had to do the following:

  • I alternate placement of pictures on the left and right sides. I tried placing some in the center but there isn't enough space and it can cause some of them to overlap.
  • I put plenty of new-lines between the sets of paragraphs and pictures so they generally stay together.
  • When a paragraph begins with a short word (like "so" or "we"), I follow it with an " " instead of a space. If I don't, that first word often shows up alone in the margin or between pictures, far away from the paragraph.

Thursday, June 19, 2008

ways to fix a Subversion comment

The first is if your log message is just one line, the second will open up your text
editor to edit the log entry directly, and the third is if your
log message is an a text file.

  • svn propset svn:log --revprop "My corrected log message" URL -r REVISION
  • svn propedit svn:log --revprop -r REVISION
  • svn propset svn:log --revprop -F FILE-WITH-CORRECTED-MESSAGE URL -r REVISION

Friday, June 13, 2008

using code examples in

Including code snippets is always a mess in blogger; here's what I've found by trial and error:

  • Encode things with an HTML encoder such as this one. There's really no easy way to just paste what you want without this kind of preprocessing.

  • I prefer to use <pre> for formatting because it won't wrap:

like this example that preserves display but goes off the end of our narrow little page very quickly

  • Use <code> if you don't care that it wraps:

so here we have an example with the monospaced font, but it wraps to the next line as it gets to the end

  • The <blockquote> will give you indentation, but usually that pushes you off the screen, so I wouldn't use it:

like this example that quickly spirals out of control and out of the short bounds we have in this thing....

  • Don't even try to use <xmp> tags; they will get processed into mush when you jump back-and-forth from from 'Edit Html'.

such as this example using the &amp;amp;amp;amp;amp;amp;amp;amp;lt;xmp&amp;amp;amp;amp;amp;amp;amp;amp;gt; tag

export/import contents of a single table in FrontBase

Jon found this:

The WRITE TABLE statement is a way to dump just the content of a table into a flat-file.


WRITE TABLE <table name>
OUTPUT('<path of output file>' [, '<column sep>', '<row sep>']);


INSERT INTO T0 VALUES (1, 'Smith'), (2, 'Jones');
WRITE TABLE T0 OUTPUT('/tmp/T0.txt', '~', '~\n');

Resulting file (T0.txt):

<table Expr>
1 "C0","~"
2 "C1","~\n"

This file can then be imported into some other table by executing:

INSERT INTO <table name> FROM 'FrontBase' INPUT('/tmp/T0.txt');

Please note that if the column names of the table the data is to be imported into are different, you will have to edit T0.txt accordingly.

A while ago WRITE TABLE was actually enhanced to, in addition to a table name, accept a table expression, i.e. a way to dump out the result set of a SELECT.


WRITE TABLE SELECT C1 FROM T0 WHERE C0 < 2 OUTPUT('/tmp/T0.txt', '~', '~\n');

WRITE TABLE VALUES('3⁄4?') OUTPUT('/tmp/T0.txt', '~', '~\n');

The latter example is a good way to see how FrontBase expects national characters to be represented:

<table Expr>
1 "_VALUES001","~\n"