<?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>Muddled Ramblings and Half-Baked Ideas &#187; geek</title> <atom:link href="http://muddledramblings.com/tag/geek/feed" rel="self" type="application/rss+xml" /><link>http://muddledramblings.com</link> <description>A blog about a geek trying to make a living as a writer</description> <lastBuildDate>Fri, 30 Jul 2010 20:19:53 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>Google Calculator</title><link>http://muddledramblings.com/observations/google-calculator</link> <comments>http://muddledramblings.com/observations/google-calculator#comments</comments> <pubDate>Tue, 01 Jun 2010 19:05:17 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Observations]]></category> <category><![CDATA[awesome]]></category> <category><![CDATA[geek]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=8548</guid> <description><![CDATA[Here&#8217;s a little trick I discovered by accident a while back: Go to Google, and put 250-(tan(4pi/6))^2 into the search field. Hey presto! It does the math. This came in handy yesterday as I was evaluating things like E.x = Origin.x + sqrt(1/((rv2/rh4)(tan2θ) + 1/rv2) To find the point on an ellipse where the tangent [...]]]></description> <content:encoded><![CDATA[<p>Here&#8217;s a little trick I discovered by accident a while back: Go to Google, and put <span
style="white-space:nowrap;">250-(tan(4pi/6))^2</span> into the search field. Hey presto! It does the math. This came in handy yesterday as I was evaluating things like</p><p>E.x = Origin.x + sqrt(1/((r<sub>v</sub><sup>2</sup>/r<sub>h</sub><sup>4</sup>)(tan<sup>2</sup>θ) + 1/r<sub>v</sub><sup>2</sup>)</p><p>To find the point on an ellipse where the tangent is at a given angle. My little calculator widget was not remotely up to the task.</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/observations/google-calculator/feed</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Cascading Style Sheets (CSS) and PHP</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/css-style-sheets-and-php</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/css-style-sheets-and-php#comments</comments> <pubDate>Sun, 30 May 2010 20:07:21 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[geek]]></category> <category><![CDATA[Internet]]></category> <category><![CDATA[php]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=8486</guid> <description><![CDATA[Obvious in retrospect.]]></description> <content:encoded><![CDATA[<p>Often when dealing with Cascading Style sheets, or CSS, I find myself wishing that the CSS mechanism included variables. This is especially true when dealing with colors, since you want the same color applied to lots of different things. It can be a real pain to go back through an old style sheet and find the code for the color you want. I was quietly surprised that no one making up how CSS worked had addressed something like this.</p><p>Then, a while back I was giving a buddy of mine a few exercises to introduce him to the exciting world of Web programming, touching on CSS, HTML, PHP and MySQL. I gave him pretty much no guidance; I just thought up plans that would introduce him to the concepts and gave him a list of my favorite references. (I&#8217;ll be posting those exercises here in the nearish future.)</p><p>Anyway, without me to tell him how to do things, he went and dug around and one of the first style sheets he sent me for evaluation had a .php extension rather than .css.</p><p>Bingo! Once you see it in action, it&#8217;s obvious. PHP can be used to generate CSS files just as easily as it can be used to generate HTML files. Now my style sheets can change based on external conditions or can simply define a set of colors that all the style definitions share. Why did it take me so long to figure this out? It seems like this technique should be a <em>lot</em> more common than it is.</p><p>Here&#8217;s a quick code snippet for those who want to try it for themselves:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Type: text/css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$header_back_color</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#dddddd'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
#corner_table th {
	background-color:<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$header_back_color</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>;
	text-align: center;
}</pre></div></div><p>A couple of notes: the &lt;?php MUST be the very first thing in the file. No empty lines, no spaces. The reason is that the next line, with the header() function, has to be called before the server sends any page content. (Once the server starts sending content back to the browser, it&#8217;s too late to be fiddling with the headers. Any whitespace outside the &lt;?php tag will be considered content.) The header line is necessary because you need to tell your browser that what you are sending really is a css file.</p><p>In the &lt;head&gt; of the html file, you call the style sheet just like normal, but of course the file you fetch will have a php extension:</p><div
class="wp_syntax"><div
class="code"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot;
      href=&quot;http://yourdomain.com/css-tables.php&quot;
      type=&quot;text/css&quot;
      media=&quot;screen&quot; /&gt;</pre></div></div><p>That&#8217;s all there is to it. Why have I not done this with <em>every</em> css file?</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/css-style-sheets-and-php/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>New Features here at MR&amp;HBI!</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/new-features-here-at-mrhbi</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/new-features-here-at-mrhbi#comments</comments> <pubDate>Tue, 30 Mar 2010 16:54:31 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[blog]]></category> <category><![CDATA[geek]]></category> <category><![CDATA[plugin]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[words]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=8185</guid> <description><![CDATA[Not only that, but you help decide how one of them works!]]></description> <content:encoded><![CDATA[<p>First, allow me to call your attention to the episode immediately before this one. You might notice the little icon is a camera. &#8220;huh,&#8221; you might be saying to yourself, &#8220;I don&#8217;t remember seeing that one before.&#8221; Very observant, Buckaroo! It&#8217;s for a new category, Photography, that I added. &#8220;But,&#8221; the even more observant amongst you might say, &#8220;There are already a handful of episodes in that category.&#8221; Right again, Wisenstein! I recategorized a couple episodes that were under The Great Adventure and found a couple in Idle Chit-Chat that were better filed under the new category. I expect there are plenty more; the trick is finding them.</p><p>The icon is actually my camera sitting on an opened unabridged dictionary. That may seem staged, but that&#8217;s actually where we keep the camera these days. Yes, we have an unabridged dictionary open on a stand at all times. No, that does not make us geeks.</p><p>Second, way down at the bottom of the sidebar, there&#8217;s a section called Other Muddled Stats (or something like that). That&#8217;s a wordpress widget I made that counts all the words in all the episodes, and keeps a tally of how many comments there have been as well. I plan to add other stats as well next time I have the hood open. Perhaps the number of times I&#8217;ve said &#8220;You don&#8217;t have to thank me,&#8221; or the number of times I&#8217;ve blamed the Chinese for things. (Hm&#8230; haven&#8217;t done that in a while&#8230;) Anything you&#8217;d like to know? The number of letters typed? Words in comments? Most prolific commenters? If it&#8217;s on these pages, I can count it.</p><p>The WordPress plugin itself is hand-crafted by yours truly. I started by downloading a different word-counting plugin, but it counted the words on every page load and didn&#8217;t have a sidebar widget. All it was was a database query and a loop. My version only counts when the relevant value changes &#8211; it only counts words when a new episode is posted, for instance. Once I tidy it up I&#8217;ll be adding it to the WordPress repository, so others can also gather useless stats about their blogs. It&#8217;s all about sharing the love.</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/new-features-here-at-mrhbi/feed</wfw:commentRss> <slash:comments>9</slash:comments> </item> <item><title>Lost in Translation?</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/lost-in-translation</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/lost-in-translation#comments</comments> <pubDate>Fri, 05 Mar 2010 23:25:33 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[geek]]></category> <category><![CDATA[php]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[suck]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=8056</guid> <description><![CDATA[The mere existence of the message implies a history, as well.]]></description> <content:encoded><![CDATA[<p>Even if you&#8217;re not a programmer, take a look at the following lines of code:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> sendCommunication<span style="color: #009900;">&#40;</span><span style="color: #000088;">$oCommunication</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">emailMode</span> <span style="color: #339933;">!=</span> EMAIL_TEST_MODE_NONE<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">emailMode</span> <span style="color: #339933;">==</span> EMAIL_TEST_MODE_LOGGED_IN_ONLY<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// DO NOT COMMENT OUT THE FOLLOWING LINES</span>
            <span style="color: #666666; font-style: italic;">// EVER</span>
            <span style="color: #666666; font-style: italic;">// FOR ANY REASON</span>
            <span style="color: #666666; font-style: italic;">// INSTEAD CHECK THE TEST MODE AND SET THE ADDRESS FIELDS ACCORDINGLY</span>
            <span style="color: #000088;">$oCommunication</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">to</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$oCommunication</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">from</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$oCommunication</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cc</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span></pre></div></div><p>Now, I ask you, even if you&#8217;re not a programmer, you know there&#8217;s one thing you would never, ever, do to the above code. Right? Now let&#8217;s say you are a programmer, a professional, being paid because of your ability to find solutions to problems and express them in an abstract language.</p><p>Now further imagine that changing the above code can lead to the customers of the people paying for this work getting spammed with confusing emails with our client&#8217;s name on them.</p><p>Yeah, you guessed it.</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/lost-in-translation/feed</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>In with the Old</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/in-with-the-old</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/in-with-the-old#comments</comments> <pubDate>Fri, 05 Feb 2010 09:27:56 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[geek]]></category> <category><![CDATA[Haloscan]]></category> <category><![CDATA[iBlog]]></category> <category><![CDATA[WordPress]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=7968</guid> <description><![CDATA[I got a message today that Haloscan is closing down. That is the service that provided refreshingly spam-free comments on my old blog. A year ago I finally abandoned iBlog for WordPress, and I&#8217;m glad I did. At the time, however, I didn&#8217;t want to tackle moving the old comments over into the new system. [...]]]></description> <content:encoded><![CDATA[<p>I got a message today that Haloscan is closing down. That is the service that provided refreshingly spam-free comments on my old blog. A year ago I finally abandoned iBlog for WordPress, and I&#8217;m glad I did. At the time, however, I didn&#8217;t want to tackle moving the old comments over into the new system. In my conversion I embedded a link into each of the old episodes to the legacy comment system, and left it at that.</p><p>It is fortunate I found out about Haloscan when I did. Another week and 8500 comments would have been lost forever. That&#8217;s a big part of the underlayer of this blog, the part people sink gradually into as they hang around more, and they realize that this isn&#8217;t just about me. There are some pretty interesting conversations, observations, poems, and even stories in those comments. With the timer running I set to work to get the comments out of Haloscan and into WordPress.</p><p>The move turned out to be pretty straightforward. (Simpler, perhaps, than it had been to put the links into the posts.) I&#8217;ll go into the technical details in an episode tomorrow, but for now, why don&#8217;t you pop into the archives for 2004 or so and find an old episode with good comments? Maybe you&#8217;ll find something interesting someone said once. Maybe you&#8217;ll see the name of someone you haven&#8217;t thought of in a while. Maybe you&#8217;ll see something you want to comment on, even.</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/in-with-the-old/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>MacPorts and GIMP</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/macports-and-gimp</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/macports-and-gimp#comments</comments> <pubDate>Sat, 09 Jan 2010 23:15:33 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[geek]]></category> <category><![CDATA[technology]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=7883</guid> <description><![CDATA[MacPorts is an awesome innovation for getting all the little pieces to work together. Usually.]]></description> <content:encoded><![CDATA[<p>Setting up a new computer can be a tedious task; there are all kinds of settings and programs and files and whatnot that need to be passed from old to new. When you work with Web development things can get even more cumbersome, as one finds oneself descending deep into the world of IT. There are programs to install that all have to talk to each other, and configuration files to be tweaked. Many of the applications that are required have no user interface of their own, they simply run in the background and answer requests from other applications.</p><p>I found myself facing (for the third time in three months) the need to install the latest Apache (and set up virtual hosts), PHP, Pear, MySQL server, PHP email addons, Propel, and on and on. For many of these items, the instructions for installations go something like:</p><p>1) Download the source code<br
/> 2) Configure the build<br
/> 3) Compile the application</p><p>And the instructions go on from there. For most of the above there are shortcuts, and probably-recent-enough versions of some things come built-in with the Mac OS, but when you install it yourself you can get everything where you want it and avoid conflicts. Still, this can be a long, tedious, pain in the butt to get going. And when you install something and it doesn&#8217;t play well with the others, finding that one line in the secret config file that&#8217;s causing the problem can be a real pain.</p><p>Enter MacPorts. MacPorts is a project that has developed a system that does all the steps of the installation for you, and puts everything in standard places so everything else installed with MacPorts can find it and talk to it. There&#8217;s still some configuration to do (tell PHP where the database server&#8217;s socket is, and set passwords for instance), but overall things are much simpler, and there are very good instructions out there for tweaking and troubleshooting MacPort installs. Since the person writing the instructions knows where all the files are in the standard install, instructions can be much more specific.</p><p>With MacPorts installing php 5.3.1 was a simple matter of typing &#8220;sudo port install php5&#8243; and letting the MacPort system do the rest. Hooray! Setting up a server is suddenly much simpler.</p><p>As an aside, MySQL didn&#8217;t work when I used MacPorts to install it on a previous machine. Don&#8217;t know why. Ran the install, followed the instructions, nothing. After a few hours banging my head against it, I went and got the excellent binary installer. It worked without a hitch. This time around I didn&#8217;t bother with the MacPorts version at all.</p><p>Anyway, thanks to MacPorts, I was able to get a complete development system up with nary a hitch, in a fraction of the time. Knowing where all the config files were this time around helped as well. I found several useful links on the Web, particularly from <a
href="http://hivelogic.com/categories/tutorials">HiveLogic</a> and my new buddy <a
href="http://danilo.ariadoss.com/how-to-setup-apache-php-mysql-on-mac-os-x-105-leopard/">Danilo Stern-Sapad</a> who took a little grammar rant from me with grace.</p><p>On that note, I read the phrase &#8220;How to setup&#8230;&#8221; so many times in so many places it&#8217;s amazing I still have teeth.</p><p>Last night I realized I hadn&#8217;t installed GIMP on this computer yet. GIMP is an open-source graphics program that wishes it rivaled Photoshop but it doesn&#8217;t really. It&#8217;s free, however, and when you consider the incredible amount of work that went into it, you have to be impressed. I don&#8217;t do a whole lot with graphics, so GIMP is usually adequate for my needs.</p><p>I went to the Web site for GIMP there were a couple of options for installation, including MacPorts. Just type &#8220;sudo port install gimp&#8221; into the terminal and that&#8217;s that. Pretty sweet.</p><p>One thing about a program like GIMP: it&#8217;s really a collection of a bazillion smaller parts. Many of those parts require other bits to work. When you run a traditional installer, all the parts are already there and they&#8217;re already tied together in a neat bundle. MacPorts does things a little differently; each part knows what parts it depends on to work, so when you say &#8220;install gimp&#8221; it first looks at the parts gimp needs, then at the parts those parts depend on, and so forth. You get to watch (if you choose to pay attention) the parade of all the little pieces as they&#8217;re installed, each the product of an individual or small group of people who have allowed their work to be exploited for free.</p><p>For GIMP, the list of dependencies goes very deep. I watched as X11 was installed. X11 is already on my computer, but ok, this is MacPorts and they keep their own realm and that way they can update parts without worrying about how that will affect non-MacPort installations. It&#8217;s redundant, but that&#8217;s why God made big hard drives.</p><p>Then I saw Python 2.6 install. Later, Python 2.5 went by. One of the little pieces seems to depend on an earlier version of Python. This probably means the person in charge of that bit just hasn&#8217;t updated it recently. On the installation went. After a while the Gnu Compiler Collection came down the pipe. gcc is a collection of compilers for building programs, and I watched as gcc was built&#8230; using the gcc already installed on my machine. Hm. And what&#8217;s this? Fortran! Yep, somewhere in the great tree of dependencies (maybe &#8216;root system&#8217; would be a better term), someone decided that a Fortran compiler was necessary to run GIMP.</p><p>Actually, that&#8217;s not quite fair; the piece that loaded the Fortran compiler might need it for other tasks not related to GIMP. Just because GIMP uses a library doesn&#8217;t mean that&#8217;s the only use for it. Still, I ended up with a lot of stuff I don&#8217;t need. It&#8217;s all invisible and I&#8217;d never know it was there if I hadn&#8217;t watched the install (which took hours), so it&#8217;s not a disaster or anything. And next time I need Fortran I&#8217;m ahead of the curve!</p><p>Time slipped past, the install continued. I went to bed. When I got up this morning to check if the build was finished, I discovered there had been an error. Yep, the MacPort version of gimp-app doesn&#8217;t currently compile on 64-bit operating systems. All that other stuff that was installed? Python 2.6 <em>and</em> Python 2.5, the Gnu Compiler Collection (including Fortran), libgnome and libbonoboui and tkl and tk and gd2 and dozens of other things I don&#8217;t know what are, they&#8217;re still there, waiting to be useful in some way.</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/macports-and-gimp/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Need More Computing Power</title><link>http://muddledramblings.com/get-poor-quick-schemes/need-more-computing-power</link> <comments>http://muddledramblings.com/get-poor-quick-schemes/need-more-computing-power#comments</comments> <pubDate>Tue, 17 Nov 2009 01:45:18 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Get-Poor-Quick Schemes]]></category> <category><![CDATA[geek]]></category> <category><![CDATA[technology]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=7743</guid> <description><![CDATA[So why does that mean getting rid of my computer?]]></description> <content:encoded><![CDATA[<p>I&#8217;m working with several products from Adobe corporation right now. That means several things: first, getting used to various &#8216;quirks&#8217; in the user interface that no other company does the same way. I occasionally say, &#8220;There&#8217;s the Mac way, the Windows way, and the Adobe way.&#8221; The Adobe way doesn&#8217;t necessarily mean the same thing in different Adobe products, alas.</p><p>Second, running multiple products from Adobe, along with their infamous memory leaks, means that my little Mac Mini is severely challenged. Adobe makes big products, and seems much more worried about features than performance. I have an income (made in part from using Adobe products), and can justify upgrading hardware at some point, but then what happens to the old machine? There&#8217;s still plenty of computing left in the little guy. It&#8217;s actually pretty fast.</p><p>Then it occurred to me that the perfect answer would be a second mini just like the first, that I could connect in such a way that they could share the workload. Suddenly my upgrade gets a lot cheaper and I&#8217;m not getting rid of a perfectly good computer.</p><p>I know that there is a supercomputer built from a bazillion macs all hooked together and sharing the load, so why can&#8217;t I get some of that action? What would it take to get two macs hooked together to become a single computer? It seems just too damn obviously a good thing to not exist.</p><p>I&#8217;m filing this under Get-Poor-Quick Schemes, since it&#8217;s probably one of those ideas that looks good on paper but is in fact a major PITA. Still, what a great OS feature that would be.</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/get-poor-quick-schemes/need-more-computing-power/feed</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Filling a Need</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/filling-a-need</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/filling-a-need#comments</comments> <pubDate>Tue, 27 Oct 2009 05:47:27 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[geek]]></category> <category><![CDATA[Internet]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=7604</guid> <description><![CDATA[A little diversion becomes a big hit.]]></description> <content:encoded><![CDATA[<p>I dragged my sorry butt out of bed just before 7 a.m. Big meeting. I put on my fuzzy bathrobe and plunked down in front of the computer while my sweetie made me tea. Then she went back to bed. We stayed up way too late last night.</p><p>Skype lit up and away we went. The meeting was more about my employer and the evolution of their corporate character than about technology, deadlines, or the transient issues of the day. How do you make a company run smoothly when you span from San Jose to Moscow? How do you make sure everyone is having a good time while you&#8217;re at it?</p><p>At one point in the conversation I was asked for bio data for my employer to put up on their Web site. I thought I would throw them a link to the bio page here here first, as a joke and also to let them learn a little more about who I am (or who I want to be, at least). I popped over here and saw&#8230; that this site had been suspended by my Web host. I checked my email. No notice. I checked my account on MMHosting&#8217;s site. Suspended, no reason given.</p><p>Some Mondays are Mondayer than others.</p><p>I sent off an urgent help request and spent the rest of the day bouncing between databases, php server code, and Flex client code, generally trying to be smart enough to deserve what they are paying me. Eventually I got a message back from MMHosting.</p><p>First, they said they had in fact sent an email. I searched everywhere I know how to search, and I couldn&#8217;t find it. No matter; they also turned the site back on. The guy said that some of my php files (code that runs on the server and builds these pages) was loading bazillions of times and slowing down the server. Uh, oh! Looks like some plugin I&#8217;m using ran amok. The people sharing the server with me probably weren&#8217;t happy.</p><p>That&#8217;s what I thought until I started looking at the numbers, anyway. Runaway software? Not at all! It turns out <a
href="http://muddledramblings.com/table-of-css3-border-radius-compliance">this table</a> I wasted way too much time on got mentioned in a prominent place, and twitter and digg took care of the rest. When you look at the graph, remember that the site was <em>down</em> for much of the time during that traffic spike. Holy Schnikies!<br
/><div
id="attachment_7605" class="wp-caption aligncenter" style="width: 558px"><img
src="http://muddledramblings.com/wp-content/uploads/2009/10/traffic.png" alt="Traffic for the last month. The bulge at the beginning is from Cyberspace Open traffic. Things have been slow since I started working - until today!" title="traffic" width="548" height="216" class="size-full wp-image-7605" /><p
class="wp-caption-text">Traffic for the last month. The bulge at the beginning is from Cyberspace Open traffic. Things have been slow since I started working - until today!</p></div><br
/> I really did put a lot of work into that dang table, so I&#8217;m glad people are picking up on it. Maybe there are other CSS3 features I could tote up &#8211; transform and shadow come to mind.</p><p>Boy, I sure wish I had a killer episode at the top of the blog to hook some of these visitors. Oh, well.</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/filling-a-need/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>None of Your Cheese Wax</title><link>http://muddledramblings.com/idle-chit-chat/none-of-your-cheese-wax</link> <comments>http://muddledramblings.com/idle-chit-chat/none-of-your-cheese-wax#comments</comments> <pubDate>Tue, 20 Oct 2009 05:44:25 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Idle Chit-Chat]]></category> <category><![CDATA[geek]]></category> <category><![CDATA[photo]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=7553</guid> <description><![CDATA[Idle hands do the mathematician's work.]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been pretty busy for the last week, coming up to speed on the project, fixing bugs, and generally stressing over the fact that I failed to provide instant lift. I <em>always</em> provide instant lift. Not this time. While I was familiar with all the tools used in this project, putting them all together at once was a lot to assimilate. So I&#8217;ve been sitting in this chair, typing on this keyboard, but not doing much to advance the Media Empire.</p><p>I have busy fingers, however, and I will always find something on my desk to fiddle with while I&#8217;m thinking. On day one of this project my sweetie brought me lunch at my desk, gave me some words of encouragement, and left me to mutter at the screen. One of the items in my lunch was a little round of soft cheese, wrapped in red wax. I love those things.</p><p>My meal finished, I started to play with the leftover wax, and I made a little sphere. The next day, another cheese, another shape, this time a cube. A tradition was born. Each day I would start to fiddle with the wax, never sure what I&#8217;d end up with. Here is the result of my first week on the job:<br
/><div
id="attachment_7554" class="wp-caption aligncenter" style="width: 310px"><a
href="http://muddledramblings.com/wp-content/uploads/2009/10/cheesewax.jpg" rel="lightbox[7553]"><img
src="http://muddledramblings.com/wp-content/uploads/2009/10/cheesewax-300x175.jpg" alt="Cheese Wax Figures" title="cheesewax" width="300" height="175" class="size-medium wp-image-7554" /></a><p
class="wp-caption-text">Cheese Wax Figures</p></div><br
/> The dumbbell-shaped one was the most recent; I&#8217;m breaking out of the simple geometric mold. What will be next?</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/idle-chit-chat/none-of-your-cheese-wax/feed</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Rounded Corners and CSS3</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/rounded-corners-and-css3</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/rounded-corners-and-css3#comments</comments> <pubDate>Wed, 23 Sep 2009 11:27:56 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[geek]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=7182</guid> <description><![CDATA[As long as I'm learning this CSS stuff, I think I'll share it. There is some misinformation out there that maybe I can help clear up. We'll see.]]></description> <content:encoded><![CDATA[<style type="text/css">code {
		white-space:nowrap;
	}
	.corner_code_sample {
		font-family: 'Courier New', Courier, fixed;
		font-size: 1.1em;
		white-space:pre;
		color: black;
		background-color: #eeeeff;
		border:solid 1px black;
		padding: 1em;
	}
	.corner_code_sample .code_result {
		float:right;
		width:100px;
		height:100%;
		text-align:center;
		margin-right:0;
		white-space: normal;
		background-color: #ddeedd;
		border:solid 1px black;
		padding: 5px;
		-webkit-box-shadow: 2px 2px 6px rgba(0,0,0,0.6);
		-moz-box-shadow: 2px 2px 6px rgba(0,0,0,0.6);
	}
	.corner_code_sample .code_result .result_caption {
		width:100%;
		font-family:'Lucida Grande', Verdana, Arial, sans-serif;
		font-size:80%;
	}</style><div
style="margin:1em 3em; background-color:lightgray; border-radius:10px; padding:1em;"><strong>NOTE</strong> —  June 7, 2010:<br
/> This page is a little out of date; the main Webkit browsers now work <em>better</em> with NO prefix on the styles. It&#8217;s time to say goodbye to <code>-webkit-</code>. In the following discussion, using the standard syntax will work with Chrome, Safari, and Opera as well. The table referenced below has been updated to reflect the newer browsers.</div><p>If you poke around this site you will see boxes with rounded corners. If you use Safari or Firefox, you will see even more.</p><p>Rounded corners are implemented here in two different ways. The main boxes with the drop shadows are done the old-fashioned way, the way that works on most browsers. Each corner is a graphic with an alpha-channel shadow, and the edges are yet more graphics, repeated as needed to span the distance between the corners. The boxes expand and contract infinitely in both directions. It&#8217;s not bad. It&#8217;s also a pain in the butt.</p><p>Yet, I <em>like</em> rounded corners. They seem friendlier. I have broken down, therefore, and in a few places I have added browser-specific style information to create a softer-feeling blog. Since the rounded corners are purely cosmetic — everything still works just fine in browsers that don&#8217;t support <code>border-radius</code> — I&#8217;m not too worried about it.</p><p>However, while I was looking into the border-radius CSS property, I discovered several sources that didn&#8217;t get it right.</p><p>Here&#8217;s the deal. The <a
href="http://www.w3.org/TR/2008/WD-css3-background-20080910/#the-border-radius">CSS3 standards draft</a> includes a property called <code>border-radius</code>. Exactly how that property is going to work has not been finalized, but it&#8217;s not likely to undergo any more major revision. Meanwhile, Firefox and Safari have already worked out their own <code>border-radius</code> implementations, called <code>-moz-border-radius</code> and <code>-webkit-border-radius</code> respectively. Other browsers see the -moz and the -webkit prefixes and ignore the property.</p><p>Unfortunately, neither implementation matches how the proposed <code>border-radius</code> property will act. Oh, dear. When the browsers are updated to match the standard, those <code>-vendor-border-radius</code> properties may break. A lot of Web designers out there don&#8217;t seem to realize that.</p><p>NOTE: probably at this point you should open up <a
href="http://muddledramblings.com/table-of-css3-border-radius-compliance" class="newWin">this handy table</a> to follow along.</p><p>It&#8217;s not all doom and gloom, however. As long as people using the vendor-specific border-radius properties keep things really simple, there won&#8217;t be a problem. Here&#8217;s the skinny:</p><div
class="corner_code_sample"><div
class="code_result" width="100"><img
src="http://muddledramblings.com/wp-content/uploads/2009/09/std-br-15.png" alt="std-br-15" title="std-br-15" width="62" height="62" class="size-full wp-image-7195" /><div
class="result_caption">All four corners with 15px radius</div></div>&lt;style type="text/css">
.roundedBox {
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
}
&lt;/style></div><p>will put a nice rounded corners on any block element of class roundedBox. Safari 4 and Firefox 3.5 (the browsers I have to test on) will work today, and when the formal <code>border-radius</code> is adopted and the other browsers support it, everyone will be happy. (Remember, of course, that in the meantime a large part of your audience will still see squared-off corners.)</p><p>The tricky part comes when one wants to specify <em>elliptical</em> corners, or specify different radii of curvature on different corners. When you start getting fancy, things get a little messed up. Let&#8217;s tackle the second one first, because it&#8217;s possible to find a way to specify the different corners that makes everyone happy. It&#8217;s just long-winded.</p><p><code>border-radius</code> is really shorthand for four properties: <code>border-top-left-radius</code>, <code>border-top-right-radius</code>, and so forth. Therefore it&#8217;s perfectly safe to specify each corner independently, and all the browsers will act the same way:</p><div
class="corner_code_sample"><div
class="code_result" width="100"><img
src="http://muddledramblings.com/wp-content/uploads/2009/09/moz-br-20-10.png" alt="moz-br-20-10" title="moz-br-20-10" width="62" height="62" class="size-full wp-image-7198" /><div
class="result_caption">top-left and bottom-right 20px radius, others 10px</div></div>&lt;style type="text/css">
.roundedBox {
-webkit-border-top-left-radius: 20px;
-webkit-border-top-right-radius: 10px;
-webkit-border-bottom-right-radius: 20px;
-webkit-border-bottom-left-radius: 10px;<span
style="color:orange;">/* different! */</span> -moz-border-radius-topleft: 20px;
-moz-border-radius-topright: 10px;
-moz-border-radius-bottomright: 20px;
-moz-border-radius-bottomleft: 10px;border-top-left-radius: 20px;
border-top-right-radius: 10px;
border-bottom-right-radius: 20px;
border-bottom-left-radius: 10px;
}
&lt;/style></div><p>Note that the names of the four corner properties are different for Mozilla. Aargh. All the more reason to hope the spec is finalized soon. I put the four properties in the order the software considers them when parsing the shorthand notation, just to get into the habit.</p><p>All those lines of CSS can be a pain in the butt, but it&#8217;s bulletproof and will work on into the future. But wouldn&#8217;t it be nice if you could use shorthand for the border radius the same way you do for margins and padding? The boys at Mozilla thought so, and the CSS3 standards team thought so, too. Webkit (Safari) seems content to only support the long-winded method for now (at least support it properly &#8211; more on that later).</p><p>Before talking about the differences between the browsers and the CSS3 spec, let&#8217;s take a quick look at the theory. As with properties like <code>border</code>, the <code>border-radius</code> property is just a shorthand so you don&#8217;t have to specify each corner individually. If you use one number, like <code>border-radius: 10px;</code> the style will be applied to all the corners. If you supply four values, the four corners each get their radius set, starting with the upper left and working clockwise. So far, so good, but there&#8217;s trouble ahead.</p><p>[The following has been edited since it was first published. I first said that Mozilla was doing the following drawing wrong, but it looks like they have it right and Safari is wrong. Sorry for any confusion. To make up for it I added <code>box-shadow</code> here and there for browsers that support it. They're sweet!]</p><p>The difference is elliptical corners. CSS3 calls for them, but the draft isn&#8217;t very well-written. The mystery lies in what should happen when two values are specified: <code>border-radius: 20px 10px</code>. When you are specifying a single corner, the result will be an elliptical curve. When using the shorthand, however, Safari draws all four corners with the same ellipse, but Firefox (and the CSS3 spec) draw round corners that turn out just like the example above.</p><p>According to the spec (by my reading), when using shorthand if you don&#8217;t use slashes you don&#8217;t get ellipses.</p><div
class="corner_code_sample"><div
class="code_result" width="100"><img
src="http://muddledramblings.com/wp-content/uploads/2009/09/std-br-20-10.png" alt="std-br-20-10" title="std-br-20-10" width="62" height="62" class="size-full wp-image-7200" /><div
class="result_caption">All four corners with elliptical curvature</div></div>&lt;style type="text/css">
.roundedBox {
/* four elliptical corners */ <span
style="color:red;">-webkit-border-radius: 20px 5px;</span> moz-border-radius: 20px / 5px;
border-radius: 20px / 5px;
}
&lt;/style></div><p
style="padding:30px;color:#aa4444;text-indent:-30px;">NOTE: The most recent builds from webkit.org match the spec. I don&#8217;t know when those changes will reach Safari, but sites using the two-value shorthand may have to deal with some inconsistencies between browser versions. Not sure, but I would avoid using that syntax just in case.</p><p>What about if four values are specified?</p><div
class="corner_code_sample"><div
class="code_result" width="100"><img
src="http://muddledramblings.com/wp-content/uploads/2009/09/std-br-20-10-5-30.png" alt="std-br-20-10-5-30" title="std-br-20-10-5-30" width="62" height="62" class="size-full wp-image-7202" /><div
class="result_caption">All corners different</div></div>&lt;style type="text/css">
.roundedBox {
/* four different circular corners */<span
style="color:red;">/* no effect! */
-webkit-border-radius: 20px 10px 5px 30px; </span> -moz-border-radius: 20px 10px 5px 30px;
border-radius: 20px 10px 5px 30px;
}
&lt;/style></div><p>Once again Webkit-based browsers like Safari and Chrome fall short. The Webkit team seems content to get the longhand method of specifying corners right, but not the shorthand. Mozilla, in the meantime, has worked out the most complex and versatile form of the shorthand, but disagrees with the spec fundamentals.</p><p>To use shorthand to specify four different elliptical corners, you would use something like:</p><p><code>-moz-border-radius: 20px 10px 20px 5px / 5px 10px;</code></p><p>where you specify up to four horizontal radii and then up to four vertical radii. The numbers before the slash are the horizontal radii, starting from the top left. If only two numbers are given, they alternate. Three numbers means top-right and bottom-left share. The y-radius values are the numbers after the slash, and are distributed the same way. Clear? Good.</p><p>I have read that if the text rendering is vertical, the horizontal and vertical parts are reversed, but I see nothing about that in the proposed specification.</p><p>This will make a lot more sense if you study the twoblue-shaded lines of <a
href="http://muddledramblings.com/table-of-css3-border-radius-compliance">the table</a>.</p><p>While we&#8217;re looking at the table, note that Safari is perfectly capable of displaying the most complex borders, but they have not implemented the shorthand notation (except for the bit they did wrong). They&#8217;ve done the hard part, but left out the one-day coding job of parsing the shorthand strings into the properties for each corner. Odd. The rules are really very simple for a machine.</p><p><strong>So what does this all <em>mean</em>?</strong></p><p>In conclusion, while it&#8217;s <em>possible</em> to write different sets of <code>-vendor-border-radius</code> CSS properties and get what you want, things start to get quite messy. It&#8217;s a lot of effort for aesthetic touches that half your audience won&#8217;t see for the next couple of years. I&#8217;d advise just staying away from elliptical corners for now, and specifying round corners individually if any are different. It&#8217;s a bit more typing, but it&#8217;s a lot safer. <strong>Stay away from <code>-webkit-border-radius:</code> with two values.</strong></p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/rounded-corners-and-css3/feed</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 20/35 queries in 0.018 seconds using disk

Served from: muddledramblings.com @ 2010-07-31 04:20:39 -->