<?xml version="1.0" encoding="UTF-8" ?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc=" http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>briancarper.net (λ) (Tag: HTML)</title><link>http://briancarper.net/tag/55/html</link><description>Some guy's blog about programming and Linux and cows.</description><item><title>New layout done</title><link>http://briancarper.net/blog/new-layout-done</link><guid>http://briancarper.net/blog/new-layout-done</guid><pubDate>Sat, 17 Mar 2007 12:37:19 -0700</pubDate><description>&lt;p&gt;I was searching for sites on web design, and I came across a novel concept: The primary goal of a site's design should be to be easy to read.  Who would've thought?  This new layout is the first layout I ever made with that focus in mind.  Usually my design goal is &quot;Show off&quot;, or &quot;Try some new HTML/CSS tricks&quot;, or... well, that's about it.  &lt;/p&gt;

&lt;p&gt;I despise web design, as a rule.  But I always find typography to be somehow fascinating.  I remember over a decade ago sitting in Windows 3.1 on my first computer trying to make my own font files.  And of course I begged my parents for a calligraphy pen, which I had lots of fun with.  Serif vs. non-serif, letter height proportions, width proportions, spacing, those kinds of things, and their relation to easiness to read.  I thought this &lt;a href=&quot;http://www.alistapart.com/articles/whitespace/&quot;&gt;article about whitespace&lt;/a&gt; was really interesting, especially the part saying:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Less whitespace = cheap; more whitespace = luxury.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;My old layout was very cluttered and light on the whitespace, and it DID look cheap.  I wasn't going for &quot;cheap&quot; when I made it, more like &quot;informal&quot; or &quot;fun&quot;.  But same idea.  This time I wanted to go for something less cheap, so I have lots more whitespace.&lt;/p&gt;

&lt;p&gt;Regardless, I am not at all skilled at web design, or typography, or anything of the sort.  But it is fun to dabble sometimes.&lt;/p&gt;</description></item><item><title>Even more cow</title><link>http://briancarper.net/blog/even-more-cow</link><guid>http://briancarper.net/blog/even-more-cow</guid><pubDate>Sun, 03 Dec 2006 22:26:35 -0800</pubDate><description>&lt;p&gt;I updated my layout to be even more cow-like.  My girlfriend made me a cow-themed top banner which I think looks good enough to eat.  I often wish I had any kind of graphic design skill, but I don't.  Not nearly as good as her, anyways.&lt;/p&gt;

&lt;p&gt;It's always so hard to find a good balance between leaving something readable, and making it look good and catch the eye and stand out in some way.  As much of a geek as I am, even I will probably pass by a plain-looking site unless I know beforehand that there's something on it that's worth reading.  Putting some effort into making your site look nice shows that you actually give a crap about the site, I think.  And the more you give a crap about the site, the more likely there is going to be something worth reading on it.&lt;/p&gt;

&lt;p&gt;Wordpress impressed me today.  I remember a long time ago making a calendar (to list your post archives) was extremely painful.  Now you can do it with a single &lt;code&gt;get_calendar&lt;/code&gt; call, and it looks fine and works fine.  I like relying on Wordpress for this kind of crap because chances are they already worked out what works in IE and what doesn't.&lt;/p&gt;

&lt;p&gt;Which brings me to my next point.... dear God, IE sucks.  If you're looking at this site in IE right now, and you're using a screen resolution 1024x768 or lower, you'll notice that my site is so wide that it forces a horizontal scrollbar.  This isn't so in Firefox.  In IE though, the existence of &lt;code&gt;pre&lt;/code&gt; tags apparently causes everything to stretch, even when I indicate &lt;code&gt;overflow:auto&lt;/code&gt; or &lt;code&gt;overflow:scroll&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And IE interprets &lt;code&gt;border: 1px transparent solid&lt;/code&gt; to mean &lt;code&gt;border: 1px BLINDING_WHITE solid&lt;/code&gt;.  It makes you cry, after a certain point.  Also my top header image is a transparent png which looks like garbage in IE, but I'm not fixing it.  &lt;/p&gt;

&lt;p&gt;Whenever IE drives me into a murderous rage, I just pull up my site stats and suddenly everything seems right with the world:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/random/browser_stats.png&quot; alt=&quot;Browser stats&quot; /&gt;&lt;/p&gt;</description></item><item><title>Vim: fun with filters</title><link>http://briancarper.net/blog/vim-fun-with-filters</link><guid>http://briancarper.net/blog/vim-fun-with-filters</guid><pubDate>Tue, 22 Aug 2006 20:06:09 -0700</pubDate><description>&lt;p&gt;Vim lets you pipe text through an external filter.  There are some obviously nice ways to use this in Linux, like &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;:!sort | uniq
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;which will sort all your lines, and then get rid of duplicate lines.  But you can do things that are much more sophisticated if you write your own scripts which read from STDIN and output something back to STDOUT. &lt;/p&gt;

&lt;p&gt;For example I wrote this Ruby script.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/usr/bin/ruby

del = %r{#{Regexp.escape ARGV[0]}} if ARGV[0]
del ||= %r{\s+}
STDIN.each do |line|
    puts '(' + line.strip.gsub(/'/,&quot;''&quot;).split(del,-1).collect{|x| &quot;'#{x}'&quot;}.join(',') + '),'
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will take a line full of delimited fields, escape all the single-quotes, split into fields on the delimiter, wrap each field in single-quotes, put commas between the fields, wrap each line in (), and put a comma at the end of the line.  You can either specify a delimiter, or don't specify one and it'll default to splitting on whitespace.  I use this to turn a delimited ASCII file of data into a form suitable for an INSERT command in SQL.  So if I start with this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;bob|2|3|Some description
chester|1|4|Another description
sarah|99|0|Let's try an apostrophe
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and run this in Vim:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;:%!sql_wrap.rb '|'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I get this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;('bob','2','3','Some description'),
('chester','1','4','Another description'),
('sarah','99','0','Let''s try an apostrophe'),
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Or consider another simple example.  This script will HTML-escape text:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/usr/bin/ruby

require 'cgi'

STDIN.each do |line|
    puts CGI::escapeHTML(line)
end&amp;lt;/pre&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So it'll turn this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Is 5 &amp;gt; 3?  Yes, &amp;amp; isn't that neat?
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;into this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Is 5 &amp;amp;gt; 3?  Yes, &amp;amp;amp; isn't that neat?
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Data</title><link>http://briancarper.net/blog/data</link><guid>http://briancarper.net/blog/data</guid><pubDate>Mon, 19 Jun 2006 09:52:25 -0700</pubDate><description>&lt;p&gt;This will be one of my few &quot;happy&quot; rants.  &lt;/p&gt;

&lt;p&gt;I've known I wanted to be a code monkey since I was in high school.  But if you'd asked me what I wanted to do back then, I'd have likely said &quot;program games!&quot; or &quot;something flashy having to do with graphics!&quot;.&lt;/p&gt;

&lt;p&gt;When I got to college and studied computer science, I was at first horrified to learn that most of computer science was pushing data around.  A whole class on how to store data in hashes, stacks, and trees.  Another whole class on how to sort data once it was in those structures.  It was terribly boring to me at the time.  &lt;/p&gt;

&lt;p&gt;How interesting that pushing data around turned out to be so darned fascinating.  I think perhaps it was boring because I was no good at it before.  I just spent a couple days turning a flat HTML table into a normalized SQL table.  A couple years ago I'd have sat there copying and pasting from one file into phpmyadmin.  Now, I bang out some Perl, parse up the HTML, turn it into a SQL query, and run it.  I'm probably at least an order of magnitude more productive now at nearly EVERYTHING than I was even a few years ago.&lt;/p&gt;

&lt;p&gt;No matter what you want to do with computers, whether it be designing games or GUI design or web design or general software engineering or whatever, a huge part of it is going to end up being &quot;playing with data&quot;.  Getting data from here to there, and translating it along the way.  Storing and organizing the data so that you can do something with it.  Your source code itself is just another form of data, on one very important level.  The fact that I find all this so much fun is possibly one of the reasons I so love Perl.&lt;/p&gt;</description></item></channel></rss>
