<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hacking at 0300</title>
	<atom:link href="http://bililite.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://bililite.com/blog</link>
	<description>Thoughts on web design and programming from a very occasional volunteer webmaster</description>
	<lastBuildDate>Fri, 19 Feb 2010 18:31:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Jewish History from a Unique Perspective</title>
		<link>http://bililite.com/blog/2010/02/19/jewish-history-from-a-unique-perspective/</link>
		<comments>http://bililite.com/blog/2010/02/19/jewish-history-from-a-unique-perspective/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 18:29:39 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[Judaism]]></category>

		<guid isPermaLink="false">http://bililite.com/blog/?p=1159</guid>
		<description><![CDATA[My children's Jewish history teacher, Rabbi Yonason Goldson has been teaching at Block Yeshiva High School for many years and presents Jewish history with a mix of traditional and scholarly sources, always from a Torah-true perspective and always looking at the broad sweep of history and the Jews' role in it. He has now published [...]]]></description>
			<content:encoded><![CDATA[<p>My children's Jewish history teacher, <a href="http://torahideals.com/">Rabbi Yonason Goldson</a> has been teaching at <a href="http://blockyeshiva-stl.org/">Block Yeshiva High School</a> for many years and presents Jewish history with a mix of traditional and scholarly sources, always from a Torah-true perspective and always looking at the broad sweep of history and the Jews' role in it. He has now published his notes (which I have always found fascinating) in book form, as
<a href="http://www.judaicapress.com/product_info.php?products_id=731"><em>Dawn to Destiny: Exploring Jewish History and its Hidden Wisdom</em></a>. I'm looking forward to reading it.</p>
<p>From the publisher's summary:</p>
<blockquote>A comprehensive overview of Jewish History from Creation through the redaction of the Talmud, illuminating the intricacies and complexities of Torah tradition and philosophy according to the sages and classical commentaries, spanning the length and breadth of Jewish experience to resolve many of history’s most perplexing episodes, offering profound insights and showing their relevance to life in the modern world.  An invaluable resource for scholars and laymen.  A priceless tool for education and outreach.</blockquote>
<blockquote>How did the sin of Adam transform mankind and the world?  How were the prophecies of Noah fulfilled through the rise of the Greek Empire?  How did the builders of the Tower of Babel believe they could wage war against G-d?  Why did there have to be three patriarchs?  What was King David's crime regarding his involvement with BasSheva?  Why did some Jews oppose the construction of the Second Temple?  How can we trust the transmission of Torah if our scholars engaged in such fierce disagreements?  These and many other questions are answered in this unique volume.</blockquote>

]]></content:encoded>
			<wfw:commentRss>http://bililite.com/blog/2010/02/19/jewish-history-from-a-unique-perspective/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Engauge Digitizer Tutorial</title>
		<link>http://bililite.com/blog/2010/01/14/engauge-digitizer-tutorial/</link>
		<comments>http://bililite.com/blog/2010/01/14/engauge-digitizer-tutorial/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 21:58:49 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[Medical Informatics]]></category>

		<guid isPermaLink="false">http://bililite.com/blog/?p=1152</guid>
		<description><![CDATA[A simple walkthrough to use the Engauge Digitizer to pull values off a "printed" graph
There's a far more complete manual that comes with the download, but these are the steps I used to generate the data for the
webservices graphs. It assumes you've got a black and white image of the graph, with continuous lines for [...]]]></description>
			<content:encoded><![CDATA[<h3>A simple walkthrough to use the <a href="http://digitizer.sourceforge.net/">Engauge Digitizer</a> to pull values off a "printed" graph</h3>
<p>There's a far more complete manual that comes with the download, but these are the steps I used to generate the data for the
<a href="/webservices">webservices</a> graphs. It assumes you've got a black and white image of the graph, with continuous lines for the
data and orthogonal gridlines, and linear axes.</p><span id="more-1152"></span>
<p>We'll use the bilirubin risk levels from the <a href="http://aappolicy.aappublications.org/cgi/content/full/pediatrics;114/1/297">AAP bilirubin guidelines</a>:</p>
<a href="/images/bili.jpg"><img style="display: block; height: 20em" src="/images/bili.jpg" /></a>
<ol>
<li><h4>Open the digitizer</h4>
<p>You can't use <code>Open with...</code> from the context menu because the program expects filenames as part of the options;
you can read the manual to see how to modify the context menu. Click <code>Import</code>
on the toolbar:  <img src="/images/digitizer-import.png" alt="Import icon" /> and select your image file:</p>
<a href="/images/graph1.png"><img style="display: block; height: 20em" src="/images/graph1.png" alt="graph imported"/></a>
<p>Save your work (it's a <code>.dig</code> file) often. You don't need me to remind you.</p>
</li>
<li><h4>Set the axes</h4>
<p>Click <code>Axis Point</code> in the toolbar: <img src="/images/digitizer-axis.png" alt="Axis icon" /> and click on the origin
(lower left corner) of the graph and enter the x,y values for the origin in the units of the graph (not pixels!). Usually that's (0,0)
but can be anything. Click on the maximum of the y-axis (upper left corner), then the maximum  of the x-axis (lower right corner).</p>
<li><h4>Remove the grid</h4>
<p>Select <code>Grid Removal...</code> from the <code>Settings</code> menu. Select "Remove thin lines parallel to the axes" and play with
the "Minimum line thickness" until the gridlines are gone from the preview on the bottom but the real curves are still there.</p>
<a href="/images/removegrid.png"><img style="display: block" src="/images/removegrid.png" alt="remove grid window" /></a>
<p>Now the grid is gone and digitizing the curves will be easy:</p>
<a href="/images/gridremoved.png"><img style="display: block; height: 20em" src="/images/gridremoved.png" alt="graph without grid"/></a>
</li>
<li><h4>Create curves</h4>
<p>Select <code>Curves...</code> from the <code>Settings</code> menu. Create as many curves as you need (we have three). Give them descriptive
names if you like:</p>
<a href="/images/curves.png"><img style="display: block;" src="/images/curves.png" alt="curve window"/></a>
</li>
<li><h4>Digitize each curve</h4>
<p>Click <code>Segment Fill</code> in the toolbar: <img src="/images/digitizer-segment.png" alt="Segment icon" />. For each curve, select it
from the curve menu: <img src="/images/digitizer-curvemenu.png" alt="Axis icon" /> and click the points on the graph for that curve until
it is covered with points. There's no undo command. If a wrong point is included, use the <code>Select</code> tool:
<img src="/images/digitizer-select.png" alt="Select icon" /> to select the bad points and use the <code>Delete</code> key. To add individual points,
use the <code>Curve Point</code> tool: <img src="/images/digitizer-point.png" alt="Curve Point icon" />. In a few clicks, you have the fully
digitized graph:</p>
<a href="/images/curvesdigitized.png"><img style="display: block;height: 20em;" src="/images/curvesdigitized.png" alt="curve window"/></a>
</li>
<li><h4>Set up the export</h4>
<p>If you exported the data now, you'd have lots of points; probably far more than is justified from the original graph. Decide which x-axis
values should be exported (the program will interpolate appropriately if the digitized points don't land exactly). Select
<code>Grid Display...</code> from the <code>Settings</code> menu:</p>
<a href="/images/gridmesh.png"><img style="display: block;" src="/images/gridmesh.png" alt="grid window"/></a>
<p>The values to be specified are related by <code>count = (stop - start)/step</code> so you only need to specify three; select the one you
<em>don't</em> want to specify from the <code>Disable</code> dropdown menu. Make sure that the start and stop values are actually in the curve;
the program will happily extrapolate off the curve but it's probably not scientifically legitimate. Ignore the y axis grid lines.</p>
<p>Select <code>Export Setup...</code> from the <code>Settings</code> menu. In the <code>Points Selection</code> section, select
<code>Intepolate Y's at gridline X's</code>.</p>
<a href="/images/exportsettings.png"><img style="display: block;" src="/images/exportsettings.png" alt="grid window"/></a>
</li>
<li><h4>Export</h4>
<p>Click the <code>Export</code> icon in the toolbar: <img src="/images/digitizer-export.png" alt="Export icon" />. Pick a name and you now have a
<a href="http://en.wikipedia.org/wiki/Comma-separated_values">CSV</a> file with your data. Simple, no?</p>
</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://bililite.com/blog/2010/01/14/engauge-digitizer-tutorial/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Digitizing graphs</title>
		<link>http://bililite.com/blog/2010/01/10/digitizing-graphs/</link>
		<comments>http://bililite.com/blog/2010/01/10/digitizing-graphs/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 02:55:04 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[Medical Informatics]]></category>

		<guid isPermaLink="false">http://bililite.com/blog/?p=1138</guid>
		<description><![CDATA[I wanted to add Down Syndrome growth charts to the bililite.com webservices, but as far as I can tell, the charts are available only as images in the AAP's guidelines (and the original paper; subscription only). The often-cited growthcharts.com has charts, and Greg Richards was generous enough to share his data with me. However, some [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to add <a href="http://en.wikipedia.org/wiki/Down_syndrome">Down Syndrome</a> growth charts to the <a href="/webservices/">bililite.com webservices</a>, but as far as I can tell, the charts are available only as images in the <a href="http://aappolicy.aappublications.org/cgi/content/full/pediatrics;107/2/442"><abbr title="American Academy of Pediatrics">AAP</abbr>'s guidelines</a> (and the <a href="http://pediatrics.aappublications.org/cgi/reprint/81/1/102">original paper</a>; subscription only). The often-cited <a href="http://growthcharts.com/charts/DS/charts.htm">growthcharts.com</a> has charts, and Greg Richards was generous enough to share his data with me. However, some of the data are from a different study, and he got his data from the original charts the old-fashioned way: with pencil, ruler, and a blown-up copy of the paper. Nothing wrong with that; that's how I got my numbers for the <a href="/webservices/bili">bilirubin chart</a>, but I wanted all my charts to match the AAP's.</p>
<p>So how to get the numbers off the graph? I emailed the lead author of the original paper, but haven't gotten any answer. I can pull the graphs as gif's from the PDF of the paper (thanks to <a href="http://www.openoffice.org/">OpenOffice.org</a> and <a href="http://extensions.services.openoffice.org/project/pdfimport">Sun's PDF importer</a>; Adobe's reader seems to get more limited with each upgrade). I was afraid I would have to digitize the graph by hand; I read the cool article on <a href="http://sudokugrab.blogspot.com/2009/07/how-does-it-all-work.html">Sudoku recognition</a> and figured I could learn about <a href="http://en.wikipedia.org/wiki/Hough_transform">Hough transforms</a> to get the graph, and <a href="http://en.wikipedia.org/wiki/Discrete_Fourier_transform#Multidimensional_DFT">2-D Fourier transforms</a> to remove the gridlines, then <a href="http://en.wikipedia.org/wiki/Blob_detection">blob detection</a> to find the lines. Turning pixels into measurements would be the trivial last step. Sounds like fun, if I had an infinite amount of free time.</p>
<p>Luckily, I found <a href="http://digitizer.sourceforge.net/">Engauge Digitizer</a>. With almost no time reading the manual, I had it removing gridlines, digitizing the curves on the graph, and exporting values at x-values that I selected into CSV files. It was close to easy. Not quite automated, but with only 4 graphs to digitize, I was done in half an hour. Highly recommended. With my remaining free time, I'll write a quick tutorial so I don't forget what I did.</p>]]></content:encoded>
			<wfw:commentRss>http://bililite.com/blog/2010/01/10/digitizing-graphs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parsing the HTTP Accept: header</title>
		<link>http://bililite.com/blog/2010/01/06/parsing-the-http-accept-header/</link>
		<comments>http://bililite.com/blog/2010/01/06/parsing-the-http-accept-header/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 03:03:13 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://bililite.com/blog/?p=1126</guid>
		<description><![CDATA[I wanted the webservices to be as RESTful as possible, so they should use the Accept: header rather than file name extensions to determine the type. As I noted before, this won't work in general, because most browsers don't send the correct Accept: headers. Still, that's no reason not to use the header if no [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted the <a href="/blog/2009/12/31/bililite-com-webservices/">webservices</a> to be as <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">RESTful</a> as possible, so they should use the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1"><code>Accept:</code> header</a> rather than file name extensions to determine the type.<span id="more-1126"></span> As I noted before, this won't work in general, because <a href="http://www.newmediacampaigns.com/page/browser-rest-http-accept-headers">most browsers don't send the correct <code>Accept:</code> headers</a>. Still, that's no reason not to use the header if no extension is sent.</p>
<p>Parsing the header is straightforward; the mime-types are separated by commas (note that the top-level separation is the comma, not the semicolon) and within each mime-type description the parameters are separated by semicolons. The first field is the mime-type itself (with possible wild card '*'), the second (if present) is the quality factor, "q={number from 0 to 1}" which describes how much the requestor wants that particular mime-type, and the remainder of the fields are other parameters.</p>
<p>As the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1">specification</a> says, parameters in the <code>Accept:</code> header are rare, and my programs don't use them, so we will ignore them. That means that <code>Accept: text/html; q=0.8; level=2, text/html; q=0.2; level=1</code>
is interpreted the same as <code>Accept: text/html; q=0.2</code>; not exactly the same as the spec but easier to code.</p>
<p>The q parameter technically should be weighted by how much the <em>host</em> wants to send that type. Thus, <code>Accept: image/jpeg; q=1, image/gif; q=0.2</code> means "Send me a <code>png</code>; I'll accept
a <code>jpeg</code>, but I'll be only 20% as happy." If the host feels that the <code>gif</code> is 10 times better than the <code>jpeg</code>, it should rank the <code>gif</code> as 10*0.2 = 2 and the <code>jpeg</code> as 1*1 = 1, and send the <code>gif</code>. My code doesn't have such strong feelings and ignores such niceties.</p>
<p>A q parameter of 0 should be interpreted as "never send me this type" but my code simply ignores it and, if there are no other mime-types in the <code>Accept:</code> header, sends the default. If it's the default type that has the q=0, then the requestor loses.</p>
<p>One subtle trick from <a href="http://github.com/recess/recess/blob/master/recess/recess/http/AcceptsList.class.php">Kris Jordan's Recess</a>: wild card ('text/*' and '*/*') types should rank <em>below</em> more specific types with the same q parameter. We subtract 0.0001 from the stated q to push them lower; the specification says the value cannot have more than 3 decimal places.</p>
<pre><code class="language-php">function parseAccept ($accept){
	$mimetypes = array( // associate types with file extensions
		'*/*' =&gt; 'html',
		'text/*' =&gt; 'txt',
		'text/plain' =&gt; 'txt',
		'text/html' =&gt; 'html',
		'text/csv' =&gt; 'csv',
		'text/javascript' =&gt; 'js',
		'image/*' =&gt; 'png',
		'image/png' =&gt; 'png',
		'image/gif' =&gt; 'gif',
		'image/jpeg' =&gt; 'jpg',
		'application/*' =&gt; 'js',
		'application/json' =&gt; 'js',
		'application/xml' =&gt; 'xml'
	);

	$types = array();
	foreach (explode(',', $accept) as $mediaRange){
		@list ($type, $qparam) = preg_split ('/\s*;\s*/', $mediaRange); // the q parameter must be the first one according to the RFC
		$q = substr ($qparam, 0, 2) == 'q=' ? floatval(substr($qparam,2)) : 1;
		if ($q &lt;= 0) continue;
		if (substr($type, -1) == '*') $q -= 0.0001;
		if (@$type[0] == '*') $q -= 0.0001;
		$types[$type] = $q;
	}
	arsort ($types); // sort from highest to lowest q value
	foreach ($types as $type =&gt; $q){
		if (isset ($mimetypes[$type])) return $mimetypes[$type];
	}
	return 'html';
}</code></pre>
<p>The same sort of code would work for <code>Accept-Encoding:</code> and the other Accept-type headers.</p>]]></content:encoded>
			<wfw:commentRss>http://bililite.com/blog/2010/01/06/parsing-the-http-accept-header/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bililite.com webservices</title>
		<link>http://bililite.com/blog/2009/12/31/bililite-com-webservices/</link>
		<comments>http://bililite.com/blog/2009/12/31/bililite-com-webservices/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 03:51:48 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[Medical Informatics]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://bililite.com/blog/?p=1120</guid>
		<description><![CDATA[I've been spending my project time learning how to manipulate images in PHP to let me create custom growth charts and the like, with a RESTful interface that would allow them to be used as the source of &#60;img&#62; elements. I like the way things turned out; they are available at bililite.com/webservices/. It includes height,weight, [...]]]></description>
			<content:encoded><![CDATA[<p>I've been spending my project time learning how to manipulate images in PHP to let me create custom growth charts and the like, with a <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">RESTful</a> interface that would allow them to be used as the source of &lt;img&gt; elements. I like the way things turned out; they are available at <a href="/webservices/">bililite.com/webservices/</a>. It includes height,weight, head circumference, peak expiratory flow (for managing asthma), blood pressure and bilirubin levels. While it took a fair amount of trial-and-error to get things to work, I don't think there's much that's innovative enough programming-wise to write a tutorial.</p>
<p>I want to get it to parse the Accept: header, so  users can leave out the file extensions, but it looks like <a href="http://www.newmediacampaigns.com/page/browser-rest-http-accept-headers">browsers don't implement that correctly</a>, so I'll have to keep using extensions as well.</p>
<p>I still need to learn more about caching and effectively using eTags and all the headers that go with it. It always makes my brain hurt.</p>]]></content:encoded>
			<wfw:commentRss>http://bililite.com/blog/2009/12/31/bililite-com-webservices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hacked!</title>
		<link>http://bililite.com/blog/2009/11/17/hacked/</link>
		<comments>http://bililite.com/blog/2009/11/17/hacked/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 02:27:32 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://bililite.com/blog/?p=1117</guid>
		<description><![CDATA[Eternal vigilance is the price of liberty. Last month, the Young Israel site was hacked and destroyed. A little talking with my ISP's tech support reminded me that I had an old version of Wordpress on the site, in a folder called "wordpress," and that it contained a vulnerability that make the vandalism possible.
When I [...]]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://www.bartleby.com/73/1073.html">Eternal vigilance is the price of liberty</a>.</strong> Last month, the <a href="http://youngisrael-stl.org">Young Israel site</a> was hacked and destroyed. A little talking with my <a href="http://1and1.com">ISP</a>'s tech support reminded me that I had an old version of <a href="http://wordpress.org/">Wordpress</a> on the site, in a folder called "wordpress," and that it contained a <a href="http://lorelle.wordpress.com/2009/09/04/old-wordpress-versions-under-attack/">vulnerability</a> that make the vandalism possible.</p>
<p>When I <a href="/blog/2009/06/05/moving-the-blog/">moved this blog</a>, I kept it updated, so I don't think it is vulnerable, but I completely forgot to remove the old one. I just changed the links to refer to the new one. Stupid! And now I've paid the price.</p>
<p>Well, we got just about everything restored from backups (missing some old announcements that I don't think anyone will miss), and I <em>think</em> I've removed any vulnerable code. I also am now the proud owner of some cool-looking hacking software that was installed on the site that I want to try to take apart and experiment with. Just more tuition paid to the school of hard knocks.</p>]]></content:encoded>
			<wfw:commentRss>http://bililite.com/blog/2009/11/17/hacked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Column Widths in OOo Tables</title>
		<link>http://bililite.com/blog/2009/10/16/column-widths-in-ooo-tables/</link>
		<comments>http://bililite.com/blog/2009/10/16/column-widths-in-ooo-tables/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 06:07:13 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[OpenOffice.org]]></category>

		<guid isPermaLink="false">http://bililite.com/blog/?p=1114</guid>
		<description><![CDATA[Finding the width of a column in a table in OpenOffice.org writer is a bit of a black art, because the widths aren't stored anywhere, just the relative widths in arbitrary units. And if cells have been combined, then the object model has no concept of "columns" and there is no way to find the [...]]]></description>
			<content:encoded><![CDATA[<p>Finding the width of a column in a table in OpenOffice.org writer is a bit of a black art, because the widths aren't stored anywhere, just the relative widths in arbitrary units. And if cells have been combined, then <a href="http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Text/Tables">the object model has no concept of "columns" and there is no way to find the widths of cells</a>. But, based on the <a href="http://wiki.services.openoffice.org/wiki/API/Samples/Java/Writer/TextTable">table tutorial</a>, I've written this function:</p>
<pre><code class="language-vb">function colwidth (table, index) ' index is 0-based
	' need the table to be oriented (http://api.openoffice.org/servlets/ReadMsg?list=dev&#038;msgNo=12552) 
	table.horiOrient = com.sun.star.text.HoriOrientation.LEFT_AND_WIDTH
	' tricks from http://wiki.services.openoffice.org/wiki/API/Samples/Java/Writer/TextTable
	dim n
	n = table.columns.count
	if index >= n then
		colwidth = 0
	elseif n = 1 then ' single column table
		colwidth = table.width
	else
		dim ratio as double
		ratio = table.width / table.tableColumnRelativeSum
		dim pos
		pos = table.tableColumnSeparators
		if index = 0 then
			colwidth = pos(0).position * ratio
		elseif index = n-1 then ' last column
			colwidth = (table.tableColumnRelativeSum - pos (ubound(pos)).position) * ratio
		else
			colwidth = (pos(index).position - pos(index-1).position) * ratio
		end if
	end if
end function</code></pre>]]></content:encoded>
			<wfw:commentRss>http://bililite.com/blog/2009/10/16/column-widths-in-ooo-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenOffice.org FontDescriptor</title>
		<link>http://bililite.com/blog/2009/10/15/openoffice-org-fontdescriptor/</link>
		<comments>http://bililite.com/blog/2009/10/15/openoffice-org-fontdescriptor/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 05:57:00 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[OpenOffice.org]]></category>

		<guid isPermaLink="false">http://bililite.com/blog/?p=1110</guid>
		<description><![CDATA[OOo controls have a Struct FontDescriptor that contains all the information about the text (font name, point size, etc.) so one would hope that to make an editbox have the same font as the containing text range, all you would have to do is
textField.fontDescriptor = textRange.fontDescriptor
but no such luck. FontDescriptors apply to everything but actual [...]]]></description>
			<content:encoded><![CDATA[<p>OOo controls have a Struct <a href="http://api.openoffice.org/docs/common/ref/com/sun/star/awt/FontDescriptor.html">FontDescriptor</a> that contains all the information about the text (font name, point size, etc.) so one would hope that to make an editbox have the same font as the containing text range, all you would have to do is</p>
<pre><code class="language-vb">textField.fontDescriptor = textRange.fontDescriptor</code></pre>
<p>but no such luck. FontDescriptors apply to <a href="http://api.openoffice.org/docs/common/ref/com/sun/star/awt/FontDescriptor-xref.html">everything but actual text</a>; text has all those properties as part of the <a href="http://api.openoffice.org/docs/common/ref/com/sun/star/style/CharacterProperties.html">CharacterProperties</a> service, so each property has to be accessed separately:</p>
<pre><code class="language-vb">fontDescriptor = textField.fontDescriptor
fontDescriptor.name = textRange.CharFontName
fontDescriptor.height = textRange.CharHeight
' etc.
textField.fontDescriptor = fontDescriptor</code></pre>
<p>Note that you can't do <code class="language-vb">textField.fontDescriptor.name = textRange.CharFontName</code>, because <a href="http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Basic/Mapping_of_Structs">Structs are always copied</a>. Even if it makes no sense.<code class="language-vb">textField.fontDescriptor.name</code> creates a temporary copy of <code class="language-vb">textField.fontDescriptor</code> and modifies <em>its</em> <code class="language-vb">name</code>, leaving the original <code class="language-vb">textField.fontDescriptor</code> untouched]]></content:encoded>
			<wfw:commentRss>http://bililite.com/blog/2009/10/15/openoffice-org-fontdescriptor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preventing Irony Deficiency</title>
		<link>http://bililite.com/blog/2009/10/07/preventing-irony-deficiency/</link>
		<comments>http://bililite.com/blog/2009/10/07/preventing-irony-deficiency/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 19:45:23 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://bililite.com/blog/?p=1107</guid>
		<description><![CDATA[Today was the last day of a 3-month locum stint and they had a lunch for me. Ham and cheese subs.
And someone who knew what kosher meant brought in Cheezits (my main vice). But it's sukkot, so I couldn't eat those in the office either.

In all seriousness, I'm never offended when someone offers me nonkosher [...]]]></description>
			<content:encoded><![CDATA[<p>Today was the last day of a 3-month locum stint and they had a lunch for me. Ham and cheese subs.</p>
<p>And someone who knew what kosher meant brought in Cheezits (my main vice). But it's sukkot, so I couldn't eat those in the office either.</p>
<span id="more-1107"></span>
<p>In all seriousness, I'm never offended when someone offers me nonkosher food like this, and I try to discourage people from trying too hard. It's a lot easier to politely decline something clearly nonkosher, than responding to someone who worked really hard at getting it right but missed one detail. "Here&mdash;you can eat this!" always elicits a cringe.</p>
<p>For those who don't see the irony in thanking an Orthodox Jew with ham and cheese, see <a href="http://en.wikipedia.org/wiki/Kosher">wikipedia</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://bililite.com/blog/2009/10/07/preventing-irony-deficiency/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OOo Tutorial on Exporting to PDF</title>
		<link>http://bililite.com/blog/2009/10/06/ooo-tutorial-on-exporting-to-pdf/</link>
		<comments>http://bililite.com/blog/2009/10/06/ooo-tutorial-on-exporting-to-pdf/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 09:47:18 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[OpenOffice.org]]></category>

		<guid isPermaLink="false">http://bililite.com/blog/?p=1103</guid>
		<description><![CDATA[There's a great tutorial  on exporting from OpenOffice.org Writer to PDF, but as far as I can tell it's orphaned on the openoffice.org website; there's no link from the tutorials page. It documents all the properties of the export filter and goes through the process in great detail. Hopefully the link from this blog [...]]]></description>
			<content:encoded><![CDATA[There's a <a href="http://wiki.services.openoffice.org/wiki/API/Tutorials/PDF_export">great tutorial</a>  on exporting from <a href="http://www.openoffice.org/">OpenOffice.org</a> Writer to PDF, but as far as I can tell it's orphaned on the openoffice.org website; there's no link from the <a href="http://wiki.services.openoffice.org/wiki/API/Tutorials">tutorials page</a>. It documents all the properties of the export filter and goes through the process in great detail. Hopefully the link from this blog will help keep it from staying orphaned.]]></content:encoded>
			<wfw:commentRss>http://bililite.com/blog/2009/10/06/ooo-tutorial-on-exporting-to-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
