{"id":115,"date":"2008-01-06T21:24:09","date_gmt":"2008-01-06T19:24:09","guid":{"rendered":"http:\/\/pocoproject.org\/poco\/blog\/?p=115"},"modified":"2008-01-06T21:24:09","modified_gmt":"2008-01-06T19:24:09","slug":"it-just-works","status":"publish","type":"post","link":"https:\/\/pocoproject.org\/blog\/?p=115","title":{"rendered":"It Just Works"},"content":{"rendered":"<p>I love things that &#8220;just work&#8221;. <a href=\"http:\/\/www.ubuntu.com\/\">Ubuntu<\/a> distro is supposed to be one of those things. Some time ago, I tried to install it on an old laptop and ended up with LCD panel split in three screens (I&#8217;m not kidding) and mouse popping up all over the place. Then I tried <a href=\"http:\/\/www.mepis.org\/\">Mepis<\/a> and I ended up with a crystal clear 1280&#215;1024 resolution &#8211; something I was never able to achieve myself (who the heck has time and patience for xorg.conf), not even with <a href=\"http:\/\/www.gentoo.org\/\">Gentoo<\/a>.<\/p>\n<p>Ah, yes, Poco::Data:<\/p>\n<p>I had one main thing in mind when I pushed for Poco::Data &#8211; I wanted to throw in a SQL and automagically get out whatever the heck I need &#8211; a HTML table, an XML document or whatever else an end user may need. After almost a year (bear in mind, this is still a hobby of mine) of development and tweaking, I finally got where I wanted to be, so we can do this now:<\/p>\n<p><code>std::cout &lt;&lt; RecordSet(session, \"SELECT * FROM Simpsons\", new HTMLTableFormatter);<\/code><\/p>\n<p>and get this out:<\/p>\n<table border=\"1\" cellspacing=\"0\">\n<tr>\n<th align=\"center\">Name<\/th>\n<th align=\"center\">Address<\/th>\n<th align=\"center\">Age<\/th>\n<\/tr>\n<tr>\n<td align=\"left\">Homer Simpson<\/td>\n<td align=\"left\">Springfield<\/td>\n<td align=\"right\">42<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">Marge Simpson<\/td>\n<td align=\"left\">Springfield<\/td>\n<td align=\"right\">38<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">Bart Simpson<\/td>\n<td align=\"left\">Springfield<\/td>\n<td align=\"right\">12<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">Lisa Simpson<\/td>\n<td align=\"left\">Springfield<\/td>\n<td align=\"right\">10<\/td>\n<\/tr>\n<\/table>\n<p>Now, ages may be inaccurate since I made them up, but the code works. For details, see <a href=\"http:\/\/poco.svn.sourceforge.net\/viewvc\/poco\/poco\/trunk\/Data\/samples\/RowFormatter\/src\/RowFormatter.cpp?view=markup\">RowFormatter sample<\/a>.<\/p>\n<p>Unicode (shudder) support code is in, for both Windows and *NIX. It has been fully tested on Windows only, since things are quite murky on *NIX with wchar_t being (mostly) 32-bit, unixODBC Unicode being 16-bit by default (with 32-bit option), iODBC being 32-bit (only) and drivers being all over the place. I&#8217;m still trying to make sense of that mess and come up with a coherent strategy.<\/p>\n<p>Comments, bug reports, opinions, flames, peanuts, &#8230; all welcome.<\/p>\n<p>Alex<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I love things that &#8220;just work&#8221;. Ubuntu distro is supposed to be one of those things. Some time ago, I tried to install it on an old laptop and ended up with LCD panel split in three screens (I&#8217;m not kidding) and mouse popping up all over the place. Then I tried Mepis and I [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-115","post","type-post","status-publish","format-standard","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=115"}],"version-history":[{"count":0,"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/115\/revisions"}],"wp:attachment":[{"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}