[ Content | Sidebar ]

Archives for dbcdb

wrote cli tool to edit sql

Up until a few months ago, the way I would, say, add a new book to the list of books I’d read was to edit a file (WriteDbc.java), compile it, and run its main, which would write out HTML pages directly from the Java data structures that it built up.
Then, a few months ago, I [...]

help me with my sql query!

Currently, I’m performing SQL queries that look something like this:
select id from books where author_id in
(select * from
((select 106 id) union all
(select id from compound_authors where author_id = 106))
as extended_authors);
I have a hard time believing that the select * from bit is really necessary, but I can’t find a way to get rid of it [...]

intrusive collections

Each of my dbcdb web pages corresponds to an instance of a class called Entity. And each entity has a key, which is the number used in the web page. The class Collection represents the collection of all the entities.
Currently, each entity knows its key. As part of the change that I’m about [...]

(badly) generating html from sql

I’m now generating my HTML pages based on the data in the SQL database. I’m still first assembling all the data in memory using Java method calls, and writing that out to an SQL database, but then I throw away the in-memory copy and regenerate it from the database.
I can’t really say that that step [...]

populated database

I’m now fully populating the database with information from my collection. It took longer than I expected; I’ll keep that in mind the next time I plan to work in a unfamiliar area. (It wouldn’t have been so bad, of course, if I were working in chunks larger than an hour or two [...]

go jdbc!

Hey, this JDBC stuff really works!
I could really do without checked exceptions, though: every single time I call a JDBC function, I have to add four lines of try/catch wrapper code, because an SQLException could be thrown at any time. Sigh. And I can’t think of a good way to avoid that, given [...]

my first sql statements

I wrote my first SQL statements today. I haven’t gotten as far as actually inserting data yet - they just create the tables as described here. But it’s a start, and I also started doing the modifications to the code to dump the data to the database. I’m definitely past my programmers’ [...]

ready to start using sql

I’ve finished working through the examples in that SQL book, I’ve read a JDBC tutorial, and I’ve downloaded a JDBC connector for MySQL. So I guess I don’t have any excuses not to start getting my fingers dirty. (I first typed “getting my features dirty”; I hope that isn’t a Freudian slip…) [...]

books without authors

Despite appearances, I have been making progress on dbcdb recently; it’s just been taking a little while to go through the examples and exercises in Learning SQL, and I was busy last weekend. (As I am this weekend, but I’ll find time tomorrow somehow. I have a big backlog of posts to write [...]

sql schema

Despite my earlier planning, I still haven’t done any work towards switching dbcdb to an SQL backend. Part of this is other things intervening in my life, but most of this is the inertia of starting something new, and that I haven’t broken tasks down enough.
Today is a holiday, so I can spend some of [...]

sql

I finished reading an introductory SQL book. (Which seemed decent enough.) So now I don’t really have many excuses to avoid starting the transition of dbcdb to an SQL back end.
Which I don’t really feel like doing, even though it’s clearly the right thing to do next. This means one thing: I [...]

video games

And now you can see the video games I’ve played recently.
There’s still a little bit of refactoring to do on the code that I’ve checked in, and a little bit more code to write. But the previous constructs held up reasonably well; easy enough to add the new item types (video games, game consoles, [...]

that was fast

Okay, now I understand, at least a little. It would seem that, if A depends on B, using a part of B’s implementation that, say, returns an object of type C, then modifying C doesn’t cause the depend task to rebuild A unless you set closure to be true. Which is a little [...]

dependency checking

I finally have dependency checking right; I don’t know how I missed ant’s depend task before, but I’m using it now. I’m still a little surprised that the tutorials that I looked at didn’t point it out, and that it’s an optional task; on the other hand, there are enough C and C++ build [...]

book index

I added a book index. Pretty straightforward cutting and pasting, followed by some refactoring.
The refactoring was a little different from normal. For one thing, it was my first experiment with writing generic classes in Java. (I’d written a generic function before, but not a generic class.) I learned a little more [...]

more html explorations

I recently lamented the design that I came up with for outputting HTML: I was combining a class accumulating HTML together with static methods that spit it out as text, leading to an unhappy marriage that I thought I knew how to deal with in C++ but couldn’t in Java.
As I said at the end [...]

what i’m reading: the css spec

If you look at my recently read page, you’ll now see what I’m in the middle of. Which took about 5 minutes to implement.
My internet explorer problems are an IE bug: the fifth item in the list of rules in the CSS spec on float positioning says that “The outer top of a floating [...]

internet explorer css problems

I did some more cross-browser testing; it turns out that my pages look like crap under Internet Explorer, and probably have for a while. Specifically, on the book card section of the page, the headers (Title:, Author:, etc.) look fine, but all the values are lined up horizontally in a row. I suspect [...]

sidebar

My pages now have sidebars. And are a bit more colorful. Yay.
It didn’t turn out the way I envisioned. At first, I was planning for there to be a darker color (grey, which turned into pink) across the top and left, and for there to be white not just in the data [...]

i miss destructors

As threatened, I’ve extracted an HtmlWriter class. And certainly the code is an improvement, though there’s one thing about it I don’t like.
The class has a couple of core responsibilities: it knows how to close the currently open tag, and it knows how to indent. (One could argue that it’s a bit pointless [...]