<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Ben Ogle's blog. Yeah!</title>
	
	<link>http://blog.benogle.com</link>
	<description>This is the blog I made.</description>
	<pubDate>Fri, 03 Jul 2009 19:55:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/BenOgle" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Sync your contacts between your Mac and LG phone</title>
		<link>http://feedproxy.google.com/~r/BenOgle/~3/HW-RUj4yiVY/</link>
		<comments>http://blog.benogle.com/2009/07/03/sync-your-contacts-between-your-mac-and-lg-phone/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 19:24:34 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
		
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://blog.benogle.com/?p=142</guid>
		<description><![CDATA[So I broke down and braved the iPhone 3GS line at Apple San Francisco after work yesterday. Once I got my shiny new 16GB phone home, I began the time-consuming process of setting it up to make me feel warm fuzzies. This setup included attempts to transfer the numbers in my contacts from my old [...]]]></description>
			<content:encoded><![CDATA[<p>So I broke down and braved the iPhone 3GS line at Apple San Francisco after work yesterday. Once I got my shiny new 16GB phone home, I began the time-consuming process of setting it up to make me feel warm fuzzies. This setup included attempts to transfer the numbers in my contacts from my old LG-VX8350 phone to the shiny iPhone. Ramon at Apple told me just to connect via bluetooth, then use iSync. Ok, easy enough. Wait, no.</p>

<p><span id="more-142"></span></p>

<p>It turns out that virtually none of the LG phones are supported in iSync. So I ended up using an application called <a href="http://www.bitpim.org/">BitPim</a> to pull the contacts, then I imported them into my Mac&#8217;s address book. When I plugged the iPhone into the laptop, they all were magically synced. Cool.</p>

<p>So the more detailed steps are as follows:</p>


<ul>
<li>Download <a href="http://www.bitpim.org/">BitPim</a> and drag it into the application folder.</li>
<li>Turn on laptop bluetooth (strange icon on apple bar next to the wireless icon).</li>
<li>On the <span class="caps">VX8350, </span>go to Menu -&gt; Settings &amp; Tools -&gt; Bluetooth Menu and turn on the bluetooth</li>
<li>Go through steps on laptop and phone to get the two connected.</li>
<li>Open BitPim; have the phone auto-recognized.</li>
<li>Click the Cellphone-with-arrow-to-the-right icon in BitPim to load the phone&#8217;s phonebook data.</li>
<li>Wait</li>
<li>Eat some oatmeal</li>
<li>Wait</li>
<li>Select the contact names I want to keep and click the File -&gt; Export -&gt; vCards&#8230; menu item.</li>
<li>In the save dialog, I selected &#8216;Apple&#8217; in the &#8216;dialect&#8217; list box and saved my new vcard with LG contacts</li>
<li>Ate more oatmeal</li>
<li>Open Address Book application and import my new vCard</li>
<li>Plugged in iPhone</li>
</ul>



<p>I hope this helps someone avoid entering them by hand.</p><img src="http://feeds.feedburner.com/~r/BenOgle/~4/HW-RUj4yiVY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.benogle.com/2009/07/03/sync-your-contacts-between-your-mac-and-lg-phone/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.benogle.com/2009/07/03/sync-your-contacts-between-your-mac-and-lg-phone/</feedburner:origLink></item>
		<item>
		<title>Simple CSS shiny progress bar technique</title>
		<link>http://feedproxy.google.com/~r/BenOgle/~3/fvICjxjTw1Y/</link>
		<comments>http://blog.benogle.com/2009/06/16/simple-css-shiny-progress-bar-technique/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 23:05:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.benogle.com/?p=113</guid>
		<description><![CDATA[
.meter-wrap{
margin: 0 auto 1em auto;
    position: relative;
}

.meter-wrap, .meter-value, .meter-text {
    /* The width and height of your image */
    width: 155px; height: 30px;
}
            .meter-wrap, .meter-value{
           [...]]]></description>
			<content:encoded><![CDATA[<style type="text/css">
.meter-wrap{
margin: 0 auto 1em auto;
    position: relative;
}

.meter-wrap, .meter-value, .meter-text {
    /* The width and height of your image */
    width: 155px; height: 30px;
}
            .meter-wrap, .meter-value{
                
                background: #bdbdbd url(/wp-content/uploads/2009/06/meter-outline.png) top left no-repeat;
            }
            
.meter-text {
    position: absolute;
    top:0; left:0;

    padding-top: 5px;
                
    color: #fff;
    text-align: center;
    width: 100%;
}
</style>

<p>I&#8217;ve recently come up with a simple way to make a decent looking, css colorable progress bar/meter out of a couple divs and an image. This is what mine looks like:</p>

<div class="meter-wrap">
    <div class="meter-value" style="background-color: #4DA4F3; width: 40%;">
        <div class="meter-text">
            Text Here!<br />
        </div>
    </div>
</div>

<p><span id="more-113"></span></p>

<p>Basically, you have three divs: a container for the grey, non &#8216;populated&#8217; section, a div for the colored value, and a div for the text. Both the container and the value div have your image as a background. This image uses mad awesome png transparency to show some of the div&#8217;s background color through.</p>

<h3><span class="caps">HTML</span></h3>

<p>The <span class="caps">HTML </span>is simple:</p>



<pre class="prettyprint">
&lt;div class=&quot;meter-wrap&quot;&gt;
    &lt;div class=&quot;meter-value&quot; style=&quot;background-color: #0a0; width: 40%;&quot;&gt;
        &lt;div class=&quot;meter-text&quot;&gt;
            Text Here!
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</pre>



<p>Notice the style attribute in the .meter-value div. The background color is the color of the progress bar, and the width is set to the percentage of progress. Easy peasy.</p>

<h3><span class="caps">CSS</span></h3>

<p>Oh yes, in all of its glory:</p>



<pre class="prettyprint">
.meter-wrap{
    position: relative;
}

.meter-wrap, .meter-value, .meter-text {
    /* The width and height of your image */
    width: 155px; height: 30px;
}

.meter-wrap, .meter-value {
    background: #bdbdbd url(/path/to/your-image.png) top left no-repeat;
}
            
.meter-text {
    position: absolute;
    top:0; left:0;

    padding-top: 5px;
                
    color: #fff;
    text-align: center;
    width: 100%;
}
</pre>



<h3>The Image</h3>

<p>Here is my image. I&#8217;ve placed it on a colored background so you can see the corners. It simply has completely opaque white corners, and uses a gradient for the center that goes from transparent white to completely transparent. An image like this is very easy to construct in a vector drawing application such as <a href="http://www.inkscape.org/">Inkscape</a> .</p>

<p style="background: #4DA4F3; padding: 10px 0;">
<img src="/wp-content/uploads/2009/06/meter-outline.png" alt="" height="30" width="155" style="margin: 0 auto; display:block;" />
</p>

<h3>Examples with JavaScript!</h3>

<script type="text/javascript">
$(document).ready(function(){
    var ex1running = false;
    var ex2running = false;

    $('#meter-ex1').click(function(){
      if(!ex1running){
        ex1running = true;
        var $this = $(this);
        var count = 0;
        var inter = null;
        function run(){
            count++;
            $this.find('.meter-value').css('width', count+"%");
            $this.find('.meter-text').text(count+"%");
            if(count == 100){
                clearInterval(inter);
                ex1running = false;
            }
        }
        inter = setInterval(run, 50);
      }
    });

    $('#meter-ex2').click(function(){
      if(!ex2running){
        ex2running = true;
        var $this = $(this);
        var gb = 'A4F3';
        var r = 0;
        var inter = null;
        function run(){
            r++;
            var rhex = r.toString(16);
            if(rhex.length == 1) rhex = "0"+rhex;
            var color = "#"+rhex+gb;
            $this.find('.meter-value').css('background-color', color);
            $this.find('.meter-text').text(color);
            if(r == 255){
                clearInterval(inter);
                ex2running = false;
                $this.find('.meter-text').text('click me!');
            }
        }
        inter = setInterval(run, 10);
      }
    });
});
</script>

<p>Now, so you can see what it can do, I&#8217;ve put together a couple of super rad jQuery examples.</p>

<p>Click the bar below to see the it go from 0% to 100%! Coooooool!</p>

<div id="meter-ex1" class="meter-wrap" style="cursor: pointer">
    <div class="meter-value" style="background-color: #4DA4F3; width: 0%;">
        <div class="meter-text">
            click me!<br />
        </div>
    </div>
</div>

<p>Or maybe this one that runs through a range of colors.</p>

<div id="meter-ex2" class="meter-wrap" style="cursor: pointer">
    <div class="meter-value" style="background-color: #00A4F3; width: 90%;">
        <div class="meter-text">
            click me!<br />
        </div>
    </div>
</div><img src="http://feeds.feedburner.com/~r/BenOgle/~4/fvICjxjTw1Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.benogle.com/2009/06/16/simple-css-shiny-progress-bar-technique/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.benogle.com/2009/06/16/simple-css-shiny-progress-bar-technique/</feedburner:origLink></item>
		<item>
		<title>Hobbes the firecat is gone :(</title>
		<link>http://feedproxy.google.com/~r/BenOgle/~3/8QsgKtWAs5Q/</link>
		<comments>http://blog.benogle.com/2009/05/22/hobbes-the-firecat-is-gone/#comments</comments>
		<pubDate>Fri, 22 May 2009 23:43:36 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
		
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://blog.benogle.com/?p=107</guid>
		<description><![CDATA[My found main coon, Hobbes, is gone. He was a cool cat. He was crazy and had one of the best personalities of any cat I have even known. His greatest strength was probably the cause of his downfall. Everything was his buddy. He didn&#8217;t know coyotes should be avoided. They were just another animal [...]]]></description>
			<content:encoded><![CDATA[<p>My found <a href="http://en.wikipedia.org/wiki/Maine_Coon">main coon</a>, Hobbes, is gone. He was a cool cat. He was crazy and had one of the best personalities of any cat I have even known. His greatest strength was probably the cause of his downfall. <em>Everything</em> was his buddy. He didn&#8217;t know coyotes should be avoided. They were just another animal to hang out with.</p>

<p><span id="more-107"></span></p>

<p>Here he is approving of my choice to develop in FireFox.</p>

<p><img src="/wp-content/uploads/2009/05/firecat.png" alt="hobbes likes firefox" height="480" width="605" /></p>

<p>And here he is wading through the 2 feet of snow we got in less than 24 hours in December.</p>

<p><img src="/wp-content/uploads/2009/05/snowcat.png" alt="hobbes likes snow" height="480" width="605" /></p>

<p>Poor kitty. He made it to about a year.</p><img src="http://feeds.feedburner.com/~r/BenOgle/~4/8QsgKtWAs5Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.benogle.com/2009/05/22/hobbes-the-firecat-is-gone/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.benogle.com/2009/05/22/hobbes-the-firecat-is-gone/</feedburner:origLink></item>
		<item>
		<title>HTML2Markup: Convert HTML to Textile in C#</title>
		<link>http://feedproxy.google.com/~r/BenOgle/~3/qiO9_TsBtZ4/</link>
		<comments>http://blog.benogle.com/2009/05/15/html2markup-convert-html-to-textile-in-c/#comments</comments>
		<pubDate>Fri, 15 May 2009 23:12:26 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://blog.zunama.com/?p=5</guid>
		<description><![CDATA[Are you making an application where you want to allow users to chose between either the most awesome textile markup language or an RTE for content editing? Are you building said applicaiton in C#? A little while ago, I needed to do this as well. I approached it the same way as a few folks [...]]]></description>
			<content:encoded><![CDATA[<p>Are you making an application where you want to allow users to chose between either the most awesome <a href="http://textism.com/tools/textile/">textile markup language</a> or an <span class="caps">RTE </span>for content editing? Are you building said applicaiton in C#? A little while ago, I needed to do this as well. I approached it the same way as <a href="http://blogs.bytecode.com.au/glen/2008/05/01/writing-a-wysiwyg-wiki-editor-with-yui-and-grails.html">a few</a> folks <a href="http://debuggable.com/posts/how-to-transform-html-to-textile-markup-the-cakephp-textilehelper-revisited:480f4dfe-a258-4b54-a31b-4933cbdd56cb">before me</a>. I decided to always save the content in the DB as textile then convert back and forth as necessary. For an <span class="caps">RTE </span>to work in this environment, you will need a fancy-pants html-to-textile parser to convert the <span class="caps">HTML </span>before database insertion. </p>

<p><span id="more-5"></span></p>

<p>There are textile to <span class="caps">HTML </span>converter libraries for just about <a href="http://en.wikipedia.org/wiki/Textile_(markup_language)">every language</a> including C#. Much to my disappointment, however, there seems to be no C#/.net library going the other way: html-2-textile. I was able to find libraries in various states for other languages such as <a href="http://jystewart.net/process/2007/11/converting-html-to-textile-with-ruby/">ruby</a>, <a href="http://aftnn.org/content/code/html2textile/">python</a>, and <a href="http://debuggable.com/posts/how-to-transform-html-to-textile-markup-the-cakephp-textilehelper-revisited:480f4dfe-a258-4b54-a31b-4933cbdd56cb">php</a>, but no love from the .netters. After I found <a href="http://wiki.developer.mindtouch.com/SgmlReader"><span class="caps">SGMLR</span>eader</a>, I decided to write my own.</p>

<p>What I ended up with will hopefully serve as a framework for those six people who need this functionality in the .net world. I say framework because <span class="caps">HTML2M</span>arkup is built with extension in mind. By writing a new class defining your markup language (markdown, wiki syntax, etc) and plugging it in to <span class="caps">HTML2M</span>arkup, you can make this library work for your markup language of choice.</p>

<h3><span class="caps">HTML2M</span>arkup Textile Conversion Features</h3>


<ul>
<li>Handles i, em, b, strong, s, del, strike, sub, sup, cite, code, h#, p, blockquote, a, img, and br tags.</li>
<li>Handles lists including nested lists</li>
<li>Handles tables</li>
<li>Handles style attributes</li>
<li>Ignores style attributes like float, position, attributes with expression, etc.</li>
<li>Ignores all tags it doesn&#8217;t recognize which is nice for sanitization</li>
<li>Gets the newlines right producing very elegant, readable textile. Yeah!</li>
</ul>



<p>Ok, so how do you use it? It is pretty simple. To use our textile definition:</p>



<pre class="prettyprint">
using HTML2Markup;

void SomeFunct(string html)
{
    string textile = MarkupConverter.HTML2Textile(html);
}
</pre>



<p>Or using the object:</p>



<pre class="prettyprint">
using HTML2Markup;

void SomeFunct(string html)
{
    Parser p = new TextileParser();
    string textile = p.HTML2Markup(html);
}
</pre>



<h3>Extending <span class="caps">HTML2M</span>arkup</h3>

<p>You can use <span class="caps">HTML2M</span>arkup for any <span class="caps">HTML</span>-to-something-else conversion. For this post, I will just tell you to checkout the TextileParser.cs file and mod as necessary. If there is a little interest, I will write a more in-depth post on extending <span class="caps">HTML2M</span>arkup.</p>

<p><span class="caps">HTML2M</span>arkup is under the <span class="caps">MIT </span>license.</p>

<h3>Download</h3>

<p>The project is on GitHub: <a href="http://github.com/benogle/html2markup">http://github.com/benogle/html2markup</a>. It contains three Visual Studio 2008 projects: <span class="caps">HTML2M</span>arkup, <span class="caps">HTML2M</span>arkup.Test, and <a href="http://wiki.developer.mindtouch.com/SgmlReader"><span class="caps">SGMLR</span>eader</a> 1.8.2.<br />
You will need NUnit to run the tests.</p>

<p>Form there, you can download just the <a href="http://cloud.github.com/downloads/benogle/html2markup/HTML2Markup_0.1.zip">binaries</a> if you&#8217;d like.</p><img src="http://feeds.feedburner.com/~r/BenOgle/~4/qiO9_TsBtZ4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.benogle.com/2009/05/15/html2markup-convert-html-to-textile-in-c/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.benogle.com/2009/05/15/html2markup-convert-html-to-textile-in-c/</feedburner:origLink></item>
		<item>
		<title>CSS Round Corners</title>
		<link>http://feedproxy.google.com/~r/BenOgle/~3/9RgaOMWhzTU/</link>
		<comments>http://blog.benogle.com/2009/04/29/css-round-corners/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 03:02:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.benogle.com/?p=76</guid>
		<description><![CDATA[Note: this post has been moved from the yosle.com blog, which I am in the process of taking down.

Round corners. Something that should be easy, right? Not so much. It seems they were left out of the CSS (less than 3) specification. No matter, there are a couple of ways to hack them out and [...]]]></description>
			<content:encoded><![CDATA[<p style="font-size: .75em; color: #777 !important; font-style: italic;">Note: this post has been moved from the yosle.com blog, which I am in the process of taking down.</p>

<p>Round corners. Something that should be easy, right? Not so much. It seems they were left out of the <span class="caps">CSS </span>(less than 3) specification. No matter, there are a couple of ways to hack them out and make them look good. Basically there are two techniques: layering a few empty tags, and using images. There are some ways to do it with javascript as well, but I wont cover them because javascript is unnecessary. The layering technique is the most concise and clean, <span class="caps">IMO, </span>so that&#8217;s what this post will focus on.<br />
<span id="more-76"></span><style type="text/css">
.b1, .b2, .b3, .b4{font-size:1px; overflow:hidden; display:block;}
.b1 {height:1px; background:#888; margin:0 5px;}
.b2 {height:1px; background:#ddd; border-right:2px solid #888; border-left:2px solid #888; margin:0 3px;}
.b3 {height:1px; background:#ddd; border-right:1px solid #888; border-left:1px solid #888; margin:0 2px;}
.b4 {height:2px; background:#ddd; border-right:1px solid #888; border-left:1px solid #888; margin:0 1px;}
.contentb {background: #ddd; border-right:1px solid #888; border-left:1px solid #888;}
.contentb div {margin-left: 5px;}

.b1f, .b2f, .b3f, .b4f{font-size:1px; overflow:hidden; display:block;}
.b1f {height:1px; background:#ddd; margin:0 5px;}
.b2f {height:1px; background:#ddd; margin:0 3px;}
.b3f {height:1px; background:#ddd; margin:0 2px;}
.b4f {height:2px; background:#ddd; margin:0 1px;}
.contentf {background: #ddd;}
.contentf div {margin-left: 5px;}

.b1t, .b2t, .b3t, .b4t, .b2bt, .b3bt, .b4bt{font-size:1px; overflow:hidden; display:block;}
.b1t {height:1px; background:#aaa; margin:0 5px;}
.b2t, .b2bt {height:1px; background:#aaa; border-right:2px solid #aaa; border-left:2px solid #aaa; margin:0 3px;}
.b3t, .b3bt {height:1px; background:#aaa; border-right:1px solid #aaa; border-left:1px solid #aaa; margin:0 2px;}
.b4t, .b4bt {height:2px; background:#aaa; border-right:1px solid #aaa; border-left:1px solid #aaa; margin:0 1px;}
.b2bt, .b3bt, .b4bt {background: #ddd;}
.headt {background: #aaa; border-right:1px solid #aaa; border-left:1px solid #aaa;}
.headt h3 {margin: 0px 10px 0px 10px; padding-bottom: 3px;}
.contentt {background: #ddd; border-right:1px solid #aaa; border-left:1px solid #aaa;}
.contentt div {margin-left: 12px; padding-top: 5px;}
</style></p>

<h3>Err&#8230; No images? No javascript?</h3>

<p>The line-layering technique uses no images and no javascript, only display: block bold tags layered on top of each other. We simply create lines with decreasing side margins, stick them on top of each other and we have a well-emulated round corner. First I&#8217;ll show, then explain.</p>

<b class="b1f"></b><b class="b2f"></b><b class="b3f"></b><b class="b4f"></b><div class="contentf"><div>Do you want round fill??</div></div><b class="b4f"></b><b class="b3f"></b><b class="b2f"></b><b class="b1f"></b><br />

<p>And the code</p>



<pre class="prettyprint">
.b1f, .b2f, .b3f, .b4f{font-size:1px; overflow:hidden; display:block;}
.b1f {height:1px; background:#ddd; margin:0 5px;}
.b2f {height:1px; background:#ddd; margin:0 3px;}
.b3f {height:1px; background:#ddd; margin:0 2px;}
.b4f {height:2px; background:#ddd; margin:0 1px;}
.contentf {background: #ddd;}
.contentf div {margin-left: 5px;}
</pre>





<pre class="prettyprint">
&lt;b class=&quot;b1f&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b2f&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b3f&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b4f&quot;&gt;&lt;/b&gt;
    &lt;div class=&quot;contentf&quot;&gt;
        &lt;div&gt;Round FILL!!&lt;/div&gt;
    &lt;/div&gt;
&lt;b class=&quot;b4f&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b3f&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b2f&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b1f&quot;&gt;&lt;/b&gt;
</pre>



<p>You notice that there are four b#f definitions. Each one represents a single 1px tall line. Element b1f is shorter than all the other lines, b2f is a little longer, b3f is longer still, and b4f is almost the size of the main content element. This is easy to see if we change the color of each line.</p>



<pre class="prettyprint">
.b1f, .b2f, .b3f, .b4f{font-size:1px; overflow:hidden; display:block;}
.b1f {height:1px; background:#F00; margin:0 5px;}
.b2f {height:1px; background:#0F0; margin:0 3px;}
.b3f {height:1px; background:#00F; margin:0 2px;}
.b4f {height:2px; background:#F0F; margin:0 1px;}
.contentf {background: #ddd;}
.contentf div {margin-left: 5px;}
</pre>



<style type="text/css">
.b1fc, .b2fc, .b3fc, .b4fc{font-size:1px; overflow:hidden; display:block;}
.b1fc {height:1px; background:#F00; margin:0 5px;}
.b2fc {height:1px; background:#0F0; margin:0 3px;}
.b3fc {height:1px; background:#00F; margin:0 2px;}
.b4fc {height:2px; background:#F0F; margin:0 1px;}
.contentf {background: #ddd;}
.contentf div {margin-left: 5px;}
</style>

<b class="b1fc"></b><b class="b2fc"></b><b class="b3fc"></b><b class="b4fc"></b><div class="contentf"><div>Each bold tag class is a separate color. The box doesn&#8217;t look round here, eh?</div></div><b class="b4fc"></b><b class="b3fc"></b><b class="b2fc"></b><b class="b1fc"></b><br/>

<p>Now that we have the basics down, this technique is easy to extend. Maybe you want a block with a border. Thats pretty easy too. We just add 1 pixel side borders to the b2f, b3f, b4f, and content definitions.</p>

<b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b><div class="contentb"><div>A border perhaps?</div></div><b class="b4"></b><b class="b3"></b><b class="b2"></b><b class="b1"></b><br/>



<pre class="prettyprint">
.b1, .b2, .b3, .b4{font-size:1px; overflow:hidden; display:block;}
.b1 {height:1px; background:#888; margin:0 5px;}
.b2 {height:1px; background:#ddd; border-right:2px solid #888; border-left:2px solid #888; margin:0 3px;}
.b3 {height:1px; background:#ddd; border-right:1px solid #888; border-left:1px solid #888; margin:0 2px;}
.b4 {height:2px; background:#ddd; border-right:1px solid #888; border-left:1px solid #888; margin:0 1px;}
.contentb {background: #ddd; border-right:1px solid #888; border-left:1px solid #888;}
.contentb div {margin-left: 5px;}
</pre>





<pre class="prettyprint">
&lt;b class=&quot;b1&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b2&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b3&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b4&quot;&gt;&lt;/b&gt;
    &lt;div class=&quot;contentb&quot;&gt;
        &lt;div&gt;Round Border!!&lt;/div&gt;
    &lt;/div&gt;
&lt;b class=&quot;b4&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b3&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b2&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b1&quot;&gt;&lt;/b&gt;
</pre>



<p>Can we go further? I think so. It could be that you want a box with a special color for the header. Well, it turns out thats not very difficult, either.</p>

<b class="b1t"></b><b class="b2t"></b><b class="b3t"></b><b class="b4t"></b><div class="headt"><h3>Here is your Header!</h3></div><div class="contentt"><div>Look ma, no images!</div></div>
<b class="b4bt"></b><b class="b3bt"></b><b class="b2bt"></b><b class="b1t"></b><br/>



<pre class="prettyprint">
.b1h, .b2h, .b3h, .b4h, .b2bh, .b3bh, .b4bh{font-size:1px; overflow:hidden; display:block;}
.b1h {height:1px; background:#aaa; margin:0 5px;}
.b2h, .b2bh {height:1px; background:#aaa; border-right:2px solid #aaa; border-left:2px solid #aaa; margin:0 3px;}
.b3h, .b3bh {height:1px; background:#aaa; border-right:1px solid #aaa; border-left:1px solid #aaa; margin:0 2px;}
.b4h, .b4bh {height:2px; background:#aaa; border-right:1px solid #aaa; border-left:1px solid #aaa; margin:0 1px;}
.b2bh, .b3bh, .b4bh {background: #ddd;}
.headh {background: #aaa; border-right:1px solid #aaa; border-left:1px solid #aaa;}
.headh h3 {margin: 0px 10px 0px 10px; padding-bottom: 3px;}
.contenth {background: #ddd; border-right:1px solid #aaa; border-left:1px solid #aaa;}
.contenth div {margin-left: 12px; padding-top: 5px;}
</pre>





<pre class="prettyprint">
&lt;b class=&quot;b1h&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b2h&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b3h&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b4h&quot;&gt;&lt;/b&gt;
    &lt;div class=&quot;headh&quot;&gt;
        &lt;h3&gt;Here is your Header!&lt;/h3&gt;
    &lt;/div&gt;
    &lt;div class=&quot;contenth&quot;&gt;
        &lt;div&gt;Look ma, no images!&lt;/div&gt;
    &lt;/div&gt;
&lt;b class=&quot;b4bh&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b3bh&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b2bh&quot;&gt;&lt;/b&gt;&lt;b class=&quot;b1h&quot;&gt;&lt;/b&gt;
</pre>



<p>There are some drawbacks to this technique, however. If you want a box with big radii on the corners, you will be creating a lot of bold elements for each box. As the radius gets bigger, it also becomes harder to figure out the margin for each line. Another drawback is the &#8217;sharpness&#8217; of the corners. Images will produce smoother, anti-aliased corners. If the corner radius is small, its hardly noticeable, though.</p>

<h3>Images</h3>

<p>Images are the more versatile alternative. They are a bit more difficult to use and are much more clunky code-wise unless your boxes are a fixed size. The general approach for variable size boxes using my favorite technique, the <a href="http://www.modxcms.com/simple-rounded-corner-css-boxes.html">thrashbox</a>, is about as follows: make an over-sized image of the complete box, anchor one corner of the image, then overlay the other three corners in their respective places.</p>

<p>No sense in explaining it in depth as its been hashed out many times. I will, however, point you to the most awesome site regarding the technique. The site is called <a href="http://www.spiffybox.com">SpiffyBox</a>. Not only does it show you how to do it, it has a little app that creates images for you based on your criteria! Cooool. The image creator was the selling point for me.</p>

<p>Another image technique is to use four separate images. <a href="http://kalsey.com/2003/07/rounded_corners_in_css/">This post</a> outlines how its done very nicely.</p>

<h3><span class="caps">CSS3</span></h3>

<p>There is a border-radius property in <span class="caps">CSS3.</span> Check out <a href="http://www.the-art-of-web.com/css/border-radius/">this post</a> for more information.</p><img src="http://feeds.feedburner.com/~r/BenOgle/~4/9RgaOMWhzTU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.benogle.com/2009/04/29/css-round-corners/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.benogle.com/2009/04/29/css-round-corners/</feedburner:origLink></item>
		<item>
		<title>Simple web sites with django == win</title>
		<link>http://feedproxy.google.com/~r/BenOgle/~3/yUtjqfKGDt8/</link>
		<comments>http://blog.benogle.com/2009/04/26/simple-web-sites-with-django/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 18:04:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.benogle.com/?p=54</guid>
		<description><![CDATA[Last night I put the main benogle.com site up. I have been looking for an easy way to create a simple website for a while. All I wanted was a couple things: quick setup with low cruft, pages editable from the browser, and quick, easy extension with god like power. Making a website is such [...]]]></description>
			<content:encoded><![CDATA[<p>Last night I put the main <a href="http://benogle.com">benogle.com</a> site up. I have been looking for an easy way to create a simple website for a while. All I wanted was a couple things: quick setup with low cruft, pages editable from the browser, and quick, easy extension with god like power. Making a website is such a common occurrence, you&#8217;d think there would be a whole heap of options available that are stupid easy to use. I bet you are thinking, &#8220;gee, there are <em>tons</em> of <span class="caps">CMS </span>apps out there!&#8221; You&#8217;re right. I have used <a href="http://typo3.com/">Typo3</a>, <a href="http://textpattern.com/">textpattern</a>, WordPress, and I have evaluated even more of them. Each one has been too heavy. They want to do too much in all the wrong places. On top of that, extension requires digging through their obscure plugin <span class="caps">API </span>and scouring their forums for something that should be simple. Oh, the pain.</p>

<p>I am happy to say that I have finally found a solution: <a href="http://djangoproject.com/">Django</a>. While I am sure it excels in building large-scale apps, it has been a completely perfect tool for creating a simple website such as benogle.com. I am surprised that, despite having never used Django before, it took a little over 6 hours (spread over several days) to construct, plus a couple hours for writing content. Wow! It took longer to build the <em>theme</em> for this WordPress blog! I recently built a site with about the same complexity for a family member with textpattern. I have four to five times more time and effort in it. </p>

<p><span id="more-54"></span></p>

<p>Why does it fit so well? Three reasons: </p>


<ul>
<li>My web dev skills transfer in that I don&#8217;t have to learn a really complex plugin/theme architecture. Django&#8217;s template language is <em>simple</em>. I make templates. My views call them. Yessss.</li>
<li>I add only the stuff I need. With the blog and <span class="caps">CMS </span>packages, I spend soooo much time tying to figure out how to hide data I don&#8217;t care about or add a little extra data I do. With Django, I just create a model with the data I need. syncdb. Done.</li>
<li>The instant admin interface. Oh, it knows about my foreign keys and presents choices in a dropdown? Epic. Cruft? None.</li>
</ul>



<p>The best part it is that there is soooo little code. I&#8217;ve made a <a href="http://github.com/benogle/bogle-site">public git repo</a> containing said code. Included is a Django app called simplesite which has all the &#8216;business code&#8217; goodness. </p>

<p>The site has multiple pages (no, really), and those pages may have a different header image, left-hand fluff image, and sidebar. So I needed a Sidebar table, an Image table, and a Page table. Here are the models:</p>



<pre class="prettyprint">
class Sidebar(models.Model):
    name = models.CharField(max_length=30)
    content = models.TextField()
    
    def __unicode__(self):
        return self.name
    
    def gethtml(self):
        return textile.textile(self.content)
    
class Image(models.Model):
    name = models.CharField(max_length=30)
    filename = models.CharField(max_length=50)
    
    def __unicode__(self):
        return self.name
        
    def geturl(self):
        return '%s%s' % (settings.IMAGE_URL, self.filename)
    
class Page(models.Model):
    title = models.CharField(max_length=30)
    slug = models.CharField(max_length=100)
    header_image = models.ForeignKey(Image, related_name=&quot;headers&quot;)
    accent_image = models.ForeignKey(Image, related_name=&quot;accents&quot;)
    sidebar = models.ForeignKey(Sidebar)
    meta_description = models.CharField(max_length=256)
    meta_keywords = models.CharField(max_length=100)
    content = models.TextField()
    
    def __unicode__(self):
        return self.title
        
    def gethtml(self):
        return textile.textile(self.content)
</pre>



<p>Cool. Now we need code to display pages from model. This is the <em>really</em> easy part.</p>



<pre class="prettyprint">
def index(req):
    page = Page.objects.get(id=settings.INDEX_PAGE_ID)
    return render_to_response('index.html', {'page': page})
    
def page(req, page_slug):
    page = get_object_or_404(Page, slug=page_slug)
    return render_to_response('page.html', {'page': page})
</pre>



<p>And the template that displays a regular page:</p>



<pre class="prettyprint">
{% block content %}
&lt;div class=&quot;entry-page&quot;&gt;
	&lt;div class=&quot;entry-image&quot;&gt;
		&lt;img src=&quot;{{ page.accent_image.geturl }}&quot; alt=&quot;fluff image&quot;/&gt;
	&lt;/div&gt;

	&lt;div class=&quot;entry&quot;&gt;
		&lt;h2 class=&quot;entry-title&quot;&gt;{{ page.title }}&lt;/h2&gt;
		&lt;div class=&quot;entry-content&quot;&gt;
			{{ page.gethtml|safe }}
		&lt;/div&gt;

	&lt;/div&gt;
&lt;/div&gt;
{% endblock %}
</pre>



<p>Done! Ok, well, I&#8217;ve left out the contact form handling code and the url map list. The rest of the work was in translating my static <span class="caps">HTML </span>template to a Django template. Oh man, do I like their template language. The inheritance makes for clean <span class="caps">HTML, </span>and the filters keep the garbage out of the templates.</p>

<p>What can I say, I am loving Django. I will be using the simplesite app, or some clone of it, for any more simple sites I build from now on. I have even started writing another, more complicated, application with Django just to try an explore the power and awesomeness. It feels so great to find a library that just &#8216;clicks.&#8217;</p><img src="http://feeds.feedburner.com/~r/BenOgle/~4/yUtjqfKGDt8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.benogle.com/2009/04/26/simple-web-sites-with-django/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.benogle.com/2009/04/26/simple-web-sites-with-django/</feedburner:origLink></item>
		<item>
		<title>jQuery pong</title>
		<link>http://feedproxy.google.com/~r/BenOgle/~3/vAlf4mj44ww/</link>
		<comments>http://blog.benogle.com/2009/04/20/jquery-pong/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 04:47:37 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://blog.zunama.com/?p=3</guid>
		<description><![CDATA[I like jQuery. A lot. The only thing I like more than jQuery is the community of crazy plugin developers. It reminds me of the python community: anything I need to do, there is a module, and the modules are pretty easy to use. So I thought I would add to the mix.

I wanted to [...]]]></description>
			<content:encoded><![CDATA[<p>I like jQuery. A lot. The only thing I like more than jQuery is the community of crazy plugin developers. It reminds me of the python community: anything I need to do, there is a module, and the modules are pretty easy to use. So I thought I would add to the mix.</p>

<p>I wanted to release something that would take the &#8216;web 2.0&#8242; world by storm. Something that any jQuery jockey could include in his/her app and boost productivity at least by 20%. So I thought, &#8220;dude, new-school thought believes downtime, <span class="caps">R&amp;R, </span>and even <a href="http://web.cs.wpi.edu/~claypool/iqp/games-prod/">games increase productivity</a>.&#8221; Then I pondered. And I pondered. And while I was pondering, I totally made jquery pong (ok, so I retrofitted gameplay from <a href="http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=2968&amp;lngWId=2">one I found</a>). <script type="text/javascript" src="/wp-content/themes/zunamatheme/js/jquery.pong.js"></script><script type="text/javascript">
$(document).ready(
  function(){
    $('#pong1').pong('/wp-content/uploads/2008/08/circle.gif'); 
    $('#pong2').pong('/wp-content/uploads/2008/08/circle.gif',{ballSpeed: 10,compSpeed: 10,playerSpeed: 2, paddleHeight: 20});
  }
);
</script></p>

<p>Here is one with all the defaults: </p>

<div id="pong1" style="margin: 0 auto;"></div>

<p>The code:</p>



<pre class="prettyprint">
$(document).ready(function(){
    $('#pong1').pong('circle.gif');
});
</pre>



<p>And here is one in which you will lose:</p>

<div id="pong2" style="margin: 0 auto;"></div>

<p>The code:</p>



<pre class="prettyprint">
$(document).ready(function(){
    $('#pong2').pong('circle.gif',{
        ballSpeed: 10,
        compSpeed: 10,
        playerSpeed: 2,
        paddleHeight: 20
    });
});
</pre>



<p>Here are all the options:</p>



<pre class="prettyprint">{
    targetSpeed: 30,  //ms
    ballAngle: 45,    //degrees
    ballSpeed: 8,     //pixels per update
    compSpeed: 5,     //speed of your opponent!!
    playerSpeed: 5,   //pixels per update
    difficulty: 5,
    width: 400,       //px
    height: 300,      //px
    paddleWidth: 10,  //px
    paddleHeight: 40, //px
    paddleBuffer: 1,  //px from the edge of the play area
    ballWidth: 14,    //px
    ballHeight: 14,   //px
    playTo: 10        //points
}</pre>



<p><a href="/wp-content/themes/zunamatheme/js/jquery.pong.js" title="uncompressed">Download it</a> and you&#8217;ll need the <a href="/wp-content/uploads/2008/08/circle.gif">ball too</a>. Have fun!</p><img src="http://feeds.feedburner.com/~r/BenOgle/~4/vAlf4mj44ww" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.benogle.com/2009/04/20/jquery-pong/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.benogle.com/2009/04/20/jquery-pong/</feedburner:origLink></item>
		<item>
		<title>Use Wordpress custom fields for your meta tags</title>
		<link>http://feedproxy.google.com/~r/BenOgle/~3/GqNez4rH1-4/</link>
		<comments>http://blog.benogle.com/2009/04/12/use-wordpress-custom-fields-for-your-meta-tags/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 07:21:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://blog.benogle.com/?p=24</guid>
		<description><![CDATA[Today I realized my posts needed proper jargon in the description and keywords meta tags for uber SEO magic. What is the &#8216;right&#8217; way to do this in WordPress? I found a bunch of plugins and other complicated methods, but I thought there should be an easy way with custom fields. I ended up on [...]]]></description>
			<content:encoded><![CDATA[<p>Today I realized my posts needed proper jargon in the description and keywords meta tags for uber <span class="caps">SEO </span>magic. What is the &#8216;right&#8217; way to do this in WordPress? I found a bunch of plugins and other complicated methods, but I thought there should be an easy way with custom fields. I ended up on a <a href="http://wordpress.org/support/topic/186372">forum post</a>, which was exactly what I was looking for. You just create a couple custom fields: description and keywords, then print out the values of the fields in the header. So I dumped this into my theme&#8217;s header.php:</p>



<pre class="command">
&lt;meta name=&quot;description&quot; content=&quot;&lt;?php if(get_post_meta($post-&gt;ID, &quot;description&quot;, true) !='' ) echo get_post_meta($post-&gt;ID, &quot;description&quot;, true); else bloginfo('description');?&gt;&quot; /&gt;
&lt;meta name=&quot;keywords&quot; content=&quot;&lt;?php if(get_post_meta($post-&gt;ID, &quot;keywords&quot;, true) != '') echo get_post_meta($post-&gt;ID, &quot;keywords&quot;, true); else echo strtolower(get_bloginfo('name'));?&gt;&quot; /&gt;
</pre>



<p>It works on the single post page, but it does not properly display the default on aggregation pages like the front page. This is fixed by adding the is_single() function to the if statements:</p>



<pre class="command">
&lt;meta name=&quot;description&quot; content=&quot;&lt;?php if(is_single() &amp;&amp; get_post_meta($post-&gt;ID, &quot;description&quot;, true) !='' ) echo get_post_meta($post-&gt;ID, &quot;description&quot;, true); else echo 'My description';?&gt;&quot; /&gt;
&lt;meta name=&quot;keywords&quot; content=&quot;&lt;?php if(is_single() &amp;&amp; get_post_meta($post-&gt;ID, &quot;keywords&quot;, true) != '') echo get_post_meta($post-&gt;ID, &quot;keywords&quot;, true); else echo 'my, keywords, here';?&gt;&quot; /&gt;
</pre>



<p>Yay.</p><img src="http://feeds.feedburner.com/~r/BenOgle/~4/GqNez4rH1-4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.benogle.com/2009/04/12/use-wordpress-custom-fields-for-your-meta-tags/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.benogle.com/2009/04/12/use-wordpress-custom-fields-for-your-meta-tags/</feedburner:origLink></item>
		<item>
		<title>REMPL: push playlists to remote WinAMP install</title>
		<link>http://feedproxy.google.com/~r/BenOgle/~3/Dxhx2qRirvg/</link>
		<comments>http://blog.benogle.com/2009/04/10/rempl-push-playlists-to-remote-a-winamp-install/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 07:42:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.benogle.com/?p=12</guid>
		<description><![CDATA[Here&#8217;s the question: how do I control a box running WinAMP over my little home network? I have a music server box in the spare bedroom running sockso to serve up the ol&#8217; music collection, and I have a stereo in the living room controlled by a laptop that usually plays music from the previously [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the question: how do I control a box running WinAMP over my little home network? I have a music server box in the spare bedroom running <a href="http://sockso.pu-gh.com/">sockso</a> to serve up the ol&#8217; music collection, and I have a stereo in the living room controlled by a laptop that usually plays music from the previously mentioned server via WinAMP.</p>

<p>The real problem is that I am really tired of getting off my booty, walking alllll the way to the laptop, sitting awkwardly on the edge of the coffee table, and hunching over to find something. Ugh! There must be a better way. I want to control the stereo laptop via some other machine on the network, dammit! Ideally WinAMP would be able to run as a server on the stereo machine, then the WinAMP instance on another machine would have some &#8216;run as client&#8217; setting that points to the stereo laptop. Then I could just use WinAMP like normal, but have the awesomeness of it running on my stereo. I got all excited when I heard about WinAMP remote, thinking it was this functionality. But no, my enthusiasm was curbed when I found out it basically does what sockso does for me. No good.</p>

<p>So I hunted for a plugin to do something similar and I actually found quite a few. Unfortunately, most looked pretty cheesy or were dead. I eventually settled on <a href="http://ajaxamp.com/">AjaxAMP</a>. It is pretty cool in that it is a webapp that is basically a stripped down version of winamp. But it doesn&#8217;t totally fit the bill because it is basically a stripped down version of winamp in a browser. It has no support for importing playlists, I can&#8217;t browse the internet radio stations, and there is, of course, no sockso integration. I just cant win, man.</p>

<p>The good part is that it is all Ajax-y so each time I, say, add a song to the playlist, some javascript makes a request to the server running on the stereo machine and says &#8220;hey stereo, add this song.&#8221; Yay. And his JS is not compressed so I was easily able to figure out how to use the params for each command. Double yay. All I needed to do was write a little library that makes the same requests for playlists from sockso and my beloved <a href="http://somafm.com/">somafm.com</a>. </p>

<p>My creation is a python script called rempl (<b>rem</b>ote <b>pl</b>aylist). You call it by specifying your AjaxAMP server and the playlist to push (pls or m3u) as params. It will then play or enqueue the playlist. Example:</p>



<pre class="command">
python rempl.py myplaylist.pls
</pre>



<p>Ok, so now I could add a local playlist to the remote WinAMP instance, but it was too cumbersome. From sockso, I&#8217;d have to download the playlist, then run the script on the playlist. The easiest fix I could think of was to run the script as a helper app in the browser for m3u and pls files. Firefox errors out when just running a py script as the helper app in windows, so I wrapped it in a batch file. The only problem is that firefox starts the batch file in the firefox dir, so the path to the python script must be absolute. It sucks, but you&#8217;ll get over it.</p>

<h3>How to use it</h3>

<p>Install <a href="http://ajaxamp.com/download">AjaxAMP</a> on your stereo machine, then <a href="http://cloud.github.com/downloads/benogle/rempl/rempl-0.1.zip">download rempl</a> (<a href="http://github.com/benogle/rempl/tree/master">project page</a>).</p>

<p>You can use it from the command line:</p>



<pre class="command">
python rempl.py -s http://192.168.1.101:5151 myplaylist.pls
</pre>



<p>add the &#8216;-e&#8217; param to just enqueue:</p>



<pre class="command">
python rempl.py -e -s http://192.168.1.101:5151 myplaylist.pls
</pre>



<p>Or you can use it with a browser:</p>

<p>If your client machine runs windows, open up the rempl.bat file from the download and edit <span class="caps">AJAXAMP</span>_ADDR to the url of your AjaxAMP machine, and edit <span class="caps">REMPL</span>_PATH to whereever you put the python script. Then in firefox, open a playlist (eg. <a href="http://somafm.com/play/indiepop">somafm.com/play/indiepop</a> for pls), click the Browse button, and find the rempl.bat file you edited. The file dialog ignores bat files, so you will need to find the dir that holds rempl.bat, then type rempl.bat into the filename box. Check the &#8216;do this from now on&#8217; checkbox, click ok, and listen to the awesomeness of your stereo changing. </p>

<p>If you are using linux or a mac, first set the <span class="caps">DEFAULT</span>_SERVER var in rempl.py to your AjaxAMP server. Make the .py file executable (<code>chmod u+x rempl.py</code>), then in your browser, browse to a playlist file (eg. <a href="http://somafm.com/play/groovesalad">somafm.com/play/groovesalad</a>), then open it with rempl.py and check the &#8216;Do this automatically from now on&#8217; box.</p><img src="http://feeds.feedburner.com/~r/BenOgle/~4/Dxhx2qRirvg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.benogle.com/2009/04/10/rempl-push-playlists-to-remote-a-winamp-install/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.benogle.com/2009/04/10/rempl-push-playlists-to-remote-a-winamp-install/</feedburner:origLink></item>
		<item>
		<title>Hello World!</title>
		<link>http://feedproxy.google.com/~r/BenOgle/~3/tW53szgNYnQ/</link>
		<comments>http://blog.benogle.com/2009/04/08/hello-world/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 06:17:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://blog.benogle.com/?p=7</guid>
		<description><![CDATA[My blog is up. Finally. I&#8217;ve been meaning to set up a website and blog for ages. For some reason I can&#8217;t just go for the blogger account. I must go complicated with my own domain, my server, and, of course, the simplistic design that took me longer to perfect than I&#8217;d like to admit. [...]]]></description>
			<content:encoded><![CDATA[<p>My blog is up. Finally. I&#8217;ve been meaning to set up a website and blog for ages. For some reason I can&#8217;t just go for the blogger account. I must go complicated with my own domain, my server, and, of course, the simplistic design that took me longer to perfect than I&#8217;d like to admit. Yay!</p>

<p>The rest of the website is in the works. Django is my new buddy.</p>

<p>Hopefully I can get a post up a week, minimum. Yeah. This week will have two. So to that one guy who might stumble here on accident, you&#8217;re getting a treat. :p</p>

<p>Here is some obligitory code so I can get the junk to look right:</p>



<pre class="prettyprint">
def parsem3u(f):
    
    lines = getlines(f)

    files = []
    
    for i in range(len(lines)):
        if not lines[i].startswith('#'):
            
            fileinfo = {'filename': lines[i]}
            
            #previous line has title info
            if lines[i-1].startswith('#EXTINF:'):
                fileinfo['title'] = getm3utitle(lines[i-1])
            
            files.append(fileinfo)
    
    return files
</pre>



<p>Ben</p><img src="http://feeds.feedburner.com/~r/BenOgle/~4/tW53szgNYnQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.benogle.com/2009/04/08/hello-world/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.benogle.com/2009/04/08/hello-world/</feedburner:origLink></item>
	</channel>
</rss>
