<?xml version="1.0" encoding="UTF-8"?>
<?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:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Bearfruit</title>
	
	<link>http://www.bearfruit.org</link>
	<description>Matthew Nuzum's Blog</description>
	<lastBuildDate>Wed, 28 Dec 2011 20:34:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2-bleeding</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/bearfruit" /><feedburner:info uri="bearfruit" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>41.637638</geo:lat><geo:long>-93.616366</geo:long><item>
		<title>How to turn $10 into $100</title>
		<link>http://feedproxy.google.com/~r/bearfruit/~3/Qf9uv-yVeNY/</link>
		<comments>http://www.bearfruit.org/2011/12/28/how-to-turn-10-into-100/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 20:34:02 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Humor]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://www.bearfruit.org/?p=543</guid>
		<description><![CDATA[It&#8217;s called &#8220;work.&#8221; It&#8217;s good for you.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s called &#8220;work.&#8221; It&#8217;s good for you.</p>
<p><a href="http://www.bearfruit.org/wp-content/uploads/2011/12/20111226_105356.jpg"><img class="alignnone size-medium wp-image-545" title="A shovel" src="http://www.bearfruit.org/wp-content/uploads/2011/12/20111226_105356-225x300.jpg" alt="" width="225" height="300" /></a></p>
<img src="http://feeds.feedburner.com/~r/bearfruit/~4/Qf9uv-yVeNY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.bearfruit.org/2011/12/28/how-to-turn-10-into-100/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.bearfruit.org/2011/12/28/how-to-turn-10-into-100/</feedburner:origLink></item>
		<item>
		<title>If the latest news is upsetting you</title>
		<link>http://feedproxy.google.com/~r/bearfruit/~3/OJYeS1JEACs/</link>
		<comments>http://www.bearfruit.org/2011/12/19/if-the-latest-news-is-upsetting-you/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 18:29:56 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://www.bearfruit.org/?p=538</guid>
		<description><![CDATA[I just want to remind everyone in the USA that this is a special time in our political process. Election season is beginning soon, and furthermore, there is an incumbent in office. Therefore the opposing party&#8217;s #1 goal is to show that the existing president is doing a poor job. It is their only chance. [...]]]></description>
			<content:encoded><![CDATA[<p>I just want to remind everyone in the USA that this is a special time in our political process. Election season is beginning soon, and furthermore, there is an incumbent in office. Therefore the opposing party&#8217;s #1 goal is to show that the existing president is doing a poor job. It is their only chance.</p>
<p>What this means is that every little mistake and unpopular decision, and believe me, everyone in authority makes mistakes and/or unpopular decisions, will be magnified as much as possible.<span id="more-538"></span></p>
<p>Also keep in mind that now, as ever, the media is in the business of selling advertisements and therefore needs to pull out all the stops in order to get your eye-balls on their ads. The aforementioned unrest gives them a lot of opportunities to write tantalizing and alarmist headlines.</p>
<p>This can be quite discouraging to the general public. It will take effort on the part of readers to discern between real news and parading. It will require great self control not to fall into the trap of forwarding the latest ghastly headline or being outraged at the audacity of such events.</p>
<p>Definitely keep up on what&#8217;s happening, speak out against what is wrong, but remember to keep a cool head and don&#8217;t get too upset. If you find yourself getting a little discouraged, remember to <a href="http://youtu.be/WlBiLNN1NhQ">always look at the bright side</a>.</p>
<img src="http://feeds.feedburner.com/~r/bearfruit/~4/OJYeS1JEACs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.bearfruit.org/2011/12/19/if-the-latest-news-is-upsetting-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.bearfruit.org/2011/12/19/if-the-latest-news-is-upsetting-you/</feedburner:origLink></item>
		<item>
		<title>UI considerations for 2 factor authentication</title>
		<link>http://feedproxy.google.com/~r/bearfruit/~3/eXMk9m-sTk8/</link>
		<comments>http://www.bearfruit.org/2011/05/18/ui-considerations-for-2-factor-authentication/#comments</comments>
		<pubDate>Wed, 18 May 2011 20:07:43 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Cool Stuff]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.bearfruit.org/?p=524</guid>
		<description><![CDATA[As an experimental work project, my team is evaluating the yubikey as a 2 factor authentication device for login.ubuntu.com. The user interface suggested by Yubico leaves me wishing for something better. Here is an idea I have, please let me know your thoughts.]]></description>
			<content:encoded><![CDATA[<p>As an experimental work project, my team is evaluating the <a href="http://www.yubico.com/start">yubikey</a> as a 2 factor authentication device for <a href="https://login.ubuntu.com/+login">login.ubuntu.com</a>. The user interface suggested by Yubico leaves me wishing for something better. Here is an idea I have, please let me know your thoughts.</p>
<p><iframe src="http://www.youtube.com/embed/vwk33dkKgoc?rel=0" frameborder="0" width="560" height="349" style="width:560px; height:349px"></iframe></p>
<img src="http://feeds.feedburner.com/~r/bearfruit/~4/eXMk9m-sTk8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.bearfruit.org/2011/05/18/ui-considerations-for-2-factor-authentication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.bearfruit.org/2011/05/18/ui-considerations-for-2-factor-authentication/</feedburner:origLink></item>
		<item>
		<title>Does the Bible say the world will end May 21st?</title>
		<link>http://feedproxy.google.com/~r/bearfruit/~3/LmumRx_QXXc/</link>
		<comments>http://www.bearfruit.org/2011/05/18/does-the-bible-say-the-world-will-end-may-21st/#comments</comments>
		<pubDate>Wed, 18 May 2011 14:14:47 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[bible]]></category>
		<category><![CDATA[Biblical]]></category>
		<category><![CDATA[Church]]></category>
		<category><![CDATA[Theology]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://www.bearfruit.org/?p=516</guid>
		<description><![CDATA[Here in America and likely abroad you may have seen billboards or heard news that the world is ending May 21st. The scale of the advertising campaign proclaiming this event lends a little bit of credibility to it. A website erected for this event contains detailed arguments and expositions explaining how this man, Harold Camping, [...]]]></description>
			<content:encoded><![CDATA[<p>Here in America and likely abroad you may have seen billboards or heard news that the world is ending May 21st. The scale of the advertising campaign proclaiming this event lends a little bit of credibility to it. A <a href="http://www.ebiblefellowship.com/outreach/tracts/may21/">website erected for this event</a> contains detailed arguments and expositions explaining how this man, Harold Camping, came to the date. Unfortunately Harold&#8217;s arguments have a very simple flaw that completely ruin this entire premise.<span id="more-516"></span></p>
<p>Unfortunately, to understand the flaw you have to decide where you stand. There are three responses to the claims,</p>
<ol>
<li>You don&#8217;t really care</li>
<li>You believe that God cannot lie and everything he says is true</li>
<li>You think that it is possible for there to be encoded, hidden messages in the text of the Bible</li>
</ol>
<p>Points 2 and 3 don&#8217;t sound like opposites but God says in <a href="http://www.biblegateway.com/passage/?search=Isaiah%2045:19&amp;version=NLT">Isaiah 45:19</a> &#8220;I publicly proclaim bold promises, I don&#8217;t whisper obscurities in some dark corner.&#8221; Therefore if you believe option #2 then you can safely assume that God&#8217;s word is plain and there are no hidden obscurities.</p>
<p>In Hebrews 6:18 it says that &#8220;it is impossible for God to lie.&#8221; Therefore I feel safe in the confidence that when Jesus said of God in <a href="http://www.biblegateway.com/passage/?search=Matthew%2024:36&amp;version=NLT">Matthew 24:36</a> that &#8220;Regarding the [date and time] &#8230; only the Father knows,&#8221; and in <a href="http://www.biblegateway.com/passage/?search=Acts%201:7&amp;version=NLT">Acts 1:7</a>, regarding the date and time the world would end &#8220;&#8230;it is not for you to know,&#8221; he was speaking the plain and simple truth: there is no encoded message about the date the world would end.</p>
<p>The surest way to identify a cult is by the leader proclaiming to have some special, secret knowledge that is not easily found in the Bible. Again, referring back to <a href="http://www.biblegateway.com/passage/?search=Isaiah%2045:19&amp;version=NLT">Isaiah 45:19</a> &#8220;I would not have told [them] to seek me if I could not be found.&#8221; Again in <a href="http://www.biblegateway.com/passage/?search=Psalm%20119:104-105&amp;version=NLT">Psalm 119:104-105</a> &#8220;Your commandments give understanding&#8230; your word is a lamp to guide my feet.&#8221; I could go on and on, you don&#8217;t need special revelation to comprehend God&#8217;s word.</p>
<p>Anytime someone says there&#8217;s a secret hidden in the bible that only a super-smart person (or a person with a special angel or revelation) can locate, they are lying.</p>
<h2>So there&#8217;s nothing to fear, right?</h2>
<p>The end of the world could be today or next week or next century. God has said there will be an end (cf <a href="http://www.biblegateway.com/passage/?search=Revelation%2021:1&amp;version=NLT">Revelation 21:1</a>) and no one but Him knows when it is. Or you very likely could die before the end of the world. In either case, when the time comes you will fall into one of two camps:</p>
<ol>
<li>Those that know Jesus as the son of God</li>
<li>Those that don&#8217;t</li>
</ol>
<p>There is no division for people who were really nice or had good intentions or didn&#8217;t commit any horrible crimes. There&#8217;s not even a special category for people who don&#8217;t believe in God. Either you will stand in front of the throne of glory and be declared righteous because of the great thing that Jesus did, able to offer your good deeds as a gift to lay at God&#8217;s feet, or you will stand in front of the throne of judgement and will be shown unworthy to be in the presence of God.</p>
<p>When your life has ended there is no more that can be done for you, either by yourself or others on your behalf. Follow the <a href="http://www.biblegateway.com/passage/?search=Luke%2023:40-43&amp;version=NLT">example of the thief on the cross</a> next to Jesus. He realized who Jesus was, felt shame for living a life in opposition to God and asked Jesus to remember him. Jesus assured him that he would join Jesus in heaven. That is all it takes. Don&#8217;t wait until the day of your death though.</p>
<img src="http://feeds.feedburner.com/~r/bearfruit/~4/LmumRx_QXXc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.bearfruit.org/2011/05/18/does-the-bible-say-the-world-will-end-may-21st/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.bearfruit.org/2011/05/18/does-the-bible-say-the-world-will-end-may-21st/</feedburner:origLink></item>
		<item>
		<title>Django: sorting by popularity</title>
		<link>http://feedproxy.google.com/~r/bearfruit/~3/sdj4ShwUzg4/</link>
		<comments>http://www.bearfruit.org/2011/04/28/django-sorting-by-popularity/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 02:35:46 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.bearfruit.org/?p=509</guid>
		<description><![CDATA[Imagine you have a list of categories and you want to sort them by popularity, so that the most used categories are first. Django&#8217;s documentation left me scratching my head a bit. It took some time and fiddling to work out a good way to do it, I hope this is helpful and clear to [...]]]></description>
			<content:encoded><![CDATA[<p>Imagine you have a list of categories and you want to sort them by popularity, so that the most used categories are first. Django&#8217;s <a href="http://docs.djangoproject.com/en/1.3/topics/db/aggregation/">documentation</a> left me scratching my head a bit. It took some time and fiddling to work out a good way to do it, I hope this is helpful and clear to you.<span id="more-509"></span></p>
<div class="highlight">
<pre><span style="color: #007020; font-weight: bold;">class</span> <span style="color: #0e84b5; font-weight: bold;">Pet</span>(models<span style="color: #666666;">.</span>Model):
    user <span style="color: #666666;">=</span> models<span style="color: #666666;">.</span><span style="color: #007020;">ForeignKey</span>(User)
    animal <span style="color: #666666;">=</span> models<span style="color: #666666;">.</span><span style="color: #007020;">ForeignKey</span>(Animal)
    name <span style="color: #666666;">=</span> models<span style="color: #666666;">.</span><span style="color: #007020;">CharField</span>(max_length<span style="color: #666666;">=</span><span style="color: #40a070;">40</span>)

<span style="color: #007020; font-weight: bold;">class</span> <span style="color: #0e84b5; font-weight: bold;">Animal</span>(models<span style="color: #666666;">.</span>Model):
    legs <span style="color: #666666;">=</span> models<span style="color: #666666;">.</span><span style="color: #007020;">IntegerField</span>()
    fur <span style="color: #666666;">=</span> models<span style="color: #666666;">.</span>BoolField()
    name <span style="color: #666666;">=</span> models<span style="color: #666666;">.</span><span style="color: #007020;">CharField</span>(max_length<span style="color: #666666;">=</span><span style="color: #40a070;">40</span>)

animals <span style="color: #666666;">=</span> Animal<span style="color: #666666;">.</span>objects<span style="color: #666666;">.</span>annotate(popularity<span style="color: #666666;">=</span>Count(<span style="color: #4070a0;">'pet'</span>))<span style="color: #666666;">.</span>order_by(<span style="color: #4070a0;">'-popularity'</span>)</pre>
</div>
<p>You see here that Animal is not related to Pet directly, so you need to do a reverse lookup. Whenever I see Django do this I think it must be magic. Notice that there is no field named &#8220;popularity.&#8221; Instead, we define it with our annotation. Then we can sort by it with our order_by.</p>
<img src="http://feeds.feedburner.com/~r/bearfruit/~4/sdj4ShwUzg4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.bearfruit.org/2011/04/28/django-sorting-by-popularity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.bearfruit.org/2011/04/28/django-sorting-by-popularity/</feedburner:origLink></item>
		<item>
		<title>4 hour work week: another way</title>
		<link>http://feedproxy.google.com/~r/bearfruit/~3/T60plpHxhbk/</link>
		<comments>http://www.bearfruit.org/2011/04/22/4-hour-work-week-another-way/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 15:50:12 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Cool Stuff]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Humor]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://www.bearfruit.org/?p=502</guid>
		<description><![CDATA[There was a book that made a lot of ruckus a while back called &#8220;The four hour workweek&#8221; by Timothy Ferriss. The premise was that you could do some clever stuff and live comfortably now instead of waiting until you retire. I recently had an idea on a different way to enjoy the four hour work week, [...]]]></description>
			<content:encoded><![CDATA[<p>There was a book that made a lot of ruckus a while back called &#8220;<a href="http://amzn.to/eiPt5z">The four hour workweek</a>&#8221; by Timothy Ferriss. The premise was that you could do some clever stuff and live comfortably now instead of waiting until you retire. I recently had an idea on a different way to enjoy the four hour work week, but first we need to revisit some basic principles of high school physics.<span id="more-502"></span></p>
<p>Remember basic electricity concepts? You can dim a light bulb by adding some additional resistance. This is of course the worst way to dim a bulb because it doesn&#8217;t actually use any less energy. The power that would have gone to make the bulb bright is instead going to the resistance and being turned into heat. There&#8217;s a much better way.</p>
<p>Imagine that you could switch the bulb on and off very fast. If you turned it on for 1/100&#8242;th of a second and then back off for 1/100th of a second constantly then it would effectively be on half the time and off half the time. Therefore it would only receive half as much power and would be half as bright. If you turned it on for 1/100th of a second and off for 3/100th&#8217;s of a second it would only get 25% of the power and would be 1/4th as bright.</p>
<p>This is called <a href="http://en.wikipedia.org/wiki/Pulse-width_modulation">pulse width modulation</a> and is in fact how dimmers work (basically). This is also the proper way to slow down motors.</p>
<p>So this is my principle. If you work just 6 seconds out of every minute for 8 hours a day over the course of a 40 hour week you&#8217;ll work the equivalent of only 4 hours per week. (6 out of 60 seconds is 10% duty cycle and 10% of 40 hours is 4) Maybe you can get 10 jobs at once using this technique and retire in only 3.5 years.</p>
<p>I&#8217;ve not actually tried this yet, since I believe I should actually be working the full time I&#8217;m getting paid to work. Therefore I&#8217;m tossing this idea out into the public domain. Feel free to use it to get rich and famous.</p>
<img src="http://feeds.feedburner.com/~r/bearfruit/~4/T60plpHxhbk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.bearfruit.org/2011/04/22/4-hour-work-week-another-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.bearfruit.org/2011/04/22/4-hour-work-week-another-way/</feedburner:origLink></item>
		<item>
		<title>3 Things I Learned From my Grandma</title>
		<link>http://feedproxy.google.com/~r/bearfruit/~3/LKKiBp6SNrY/</link>
		<comments>http://www.bearfruit.org/2011/02/24/3-things-i-learned-from-my-grandma/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 01:33:00 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Diary]]></category>
		<category><![CDATA[Testimony]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://www.bearfruit.org/?p=496</guid>
		<description><![CDATA[Last week my Grandmother died and we had her funeral today. The pastor suggested that we discuss the things about her life that shaped us. During the reception I really didn&#8217;t get a chance to do that but I have put some thought into it and I&#8217;ve come up with 3 things I&#8217;ve learned because [...]]]></description>
			<content:encoded><![CDATA[<p>Last week my Grandmother died and we had her funeral today. The pastor suggested that we discuss the things about her life that shaped us. During the reception I really didn&#8217;t get a chance to do that but I have put some thought into it and I&#8217;ve come up with 3 things I&#8217;ve learned because of her.<span id="more-496"></span></p>
<p><strong>When life knocks you down, get back up and keep going.</strong></p>
<p>Yes, a cliché, I know, but it is always more meaningful when you see it in real life. One day, when she was 12 years old, the oldest of a big family, the parents left for a bit. While playing outside in a tree, her 8 year old brother fell and fatally broke his neck. It was very hard on her, but she kept going. Later in life, as the mother of 5 kids, her husband had an affair and left her and the kids. She was forced to raise them on her own. And somehow, she did. For many years she lived in the country and drove into the city to work the night shift as a nurse. Somehow, she found the strength to keep going.</p>
<p>I don&#8217;t think it would be hard to despair and yield to the temptation to give up. But she did not give up.</p>
<p><strong>Work with what you have</strong></p>
<p>Raised during the depression, spending many years on a farm later in life, raising 5 kids on her own, she learned to waste nothing and to get by with what she had. She took great pride in how well she could stretch a dollar. Her heirs are left with an ample supply of recycled wrapping paper, gently used aluminum foil and countless other treasures that have plenty of life left in them. I would not call her stingy, I would just say she got as much use as humanly possible out of everything that she had. Before &#8220;living green&#8221; was a buzz word, she had over 50 years experience doing it.</p>
<p>Her accountant paid her the best compliment she could hope for when he told her he was afraid the government would doubt her tax statements because they would not think she could live on the small amount she was reporting.</p>
<p><strong>You can do better than just &#8220;get by&#8221;</strong></p>
<p>She did get by, despite the challenges in life that she faced. But <strong>she went beyond</strong> that, <em>she enjoyed life</em> and she worked to <em>make the world a better place</em>. I remember a time as a child when we walked by the river near where she lived. We found a place where someone had a picnic and left their litter covering the ground. She suggested we clean up the trash (she always carried a plastic grocery bag for that purpose). After we were done, we discovered on the ground 5 wadded $1 bills. That was more than enough for us to enjoy a trip to Burger King. For fun crafts, we&#8217;d assemble broken bits of jewelry into new, sometimes unusual, pieces to give as gifts. She volunteered to help at hospice and facilities for the disabled, doing laundry, keeping people company and helping out however she could.</p>
<p>She discovered many ways to enjoy life and to make the world a better place.</p>
<p>Growing old is hard, and it was especially tough to see her frail and painfully ill in the final months. We saw the end coming with plenty of advanced notice and when she had passed it was sad, but at the same time a relief. In once sense, I will miss her, but in another, she is so much a part of me that I don&#8217;t feel like she&#8217;s really gone. And even though my son hardly knew her, he&#8217;s already inheriting her influence through me. I would not be surprised to see her continue on for generations to come.</p>
<img src="http://feeds.feedburner.com/~r/bearfruit/~4/LKKiBp6SNrY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.bearfruit.org/2011/02/24/3-things-i-learned-from-my-grandma/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.bearfruit.org/2011/02/24/3-things-i-learned-from-my-grandma/</feedburner:origLink></item>
		<item>
		<title>Quick speed test between php and django</title>
		<link>http://feedproxy.google.com/~r/bearfruit/~3/48YU7bMpuYw/</link>
		<comments>http://www.bearfruit.org/2010/12/03/quick-speed-test-between-php-and-django/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 19:57:07 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[backend]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Cool Stuff]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.bearfruit.org/?p=486</guid>
		<description><![CDATA[PHP is a programming language for web applications but Django is a full-fledged framework that provides database abstraction, caching, authentication and a host of other services. Comparing the performance of the two is not a fair, apples to apples comparison. However I want to do it in order to better decide what I should use [...]]]></description>
			<content:encoded><![CDATA[<p>PHP is a programming language for web applications but Django is a full-fledged framework that provides database abstraction, caching, authentication and a host of other services. Comparing the performance of the two is not a fair, apples to apples comparison. However I want to do it in order to better decide what I should use for an application.</p>
<p>I created a light-weight HTML page, a &#8220;hello world&#8221; php app (no db or sessions) and a light weight &#8220;hello world&#8221; django app using mostly default values (sessions are enabled). I then ran the apache benchmark (ab) on the three using a small VPS w/ 512 MB of RAM from localhost (so no latency is involved giving ideal conditions).<span id="more-486"></span></p>
<p>Apache is configured with a max clients of 40 so I tested with a concurrency of 40.</p>
<ul>
<li>Static HTML:<br />
Requests per second:    3249.36 [#/sec] (mean)<br />
(no measurable impact on server load)</li>
<li>PHP:<br />
Requests per second:    2786.73 [#/sec] (mean)<br />
(no measurable impact on server load)</li>
<li>Django:<br />
Requests per second:    157.97 [#/sec] (mean)<br />
(no measurable impact on server load)</li>
<li>Static HTML using SSL:<br />
Requests per second:    10.30 [#/sec] (mean)<br />
(during this, server load rose uncomfortably high)</li>
</ul>
<p>What do we understand from this? First, considering the added functionality of the Django framework, I&#8217;m quite comfortable with the performance here. If I need as lean of an app as possible, I may want to consider not using a framework. Carefully crafted PHP is probably going to be faster.</p>
<p>However, with a concurrency of 40 the Django app was able to support 157 connections per second. The server load and memory utilization indicates that this VPS can probably handle a higher value for max-clients.</p>
<p>I&#8217;m quite shocked at the poor SSL performance. I have no idea why the VPS would perform so poorly. I wonder if the VPS technology forces the server to offload SSL decryption to a virtual network adapter. The CPU of the VPS is an Intel Core 2 Quad @ 2.4GHz.</p>
<p>This is an OpenVZ VPS running Ubuntu 10.04 LTS, Apache 2.2.14, PHP 5.3.2, Django 1.2.3 on Python 2.6.5 using mod_wsgi 2.8.</p>
<p>You can get a <a href="https://service.burst.net/aff.php?aff=1511">good deal on a VPS at burst.net for $5.99/mo</a> (this link uses my &#8220;refer a friend&#8221; feature so I get credit). I&#8217;m extremely happy with the quality of their service and have had <em>0 downtime</em> in the few months I&#8217;ve been a customer.</p>
<img src="http://feeds.feedburner.com/~r/bearfruit/~4/48YU7bMpuYw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.bearfruit.org/2010/12/03/quick-speed-test-between-php-and-django/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.bearfruit.org/2010/12/03/quick-speed-test-between-php-and-django/</feedburner:origLink></item>
		<item>
		<title>Facebook listens to the users</title>
		<link>http://feedproxy.google.com/~r/bearfruit/~3/wYXa7geoXjc/</link>
		<comments>http://www.bearfruit.org/2010/11/15/facebook-email/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 18:54:59 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.bearfruit.org/?p=482</guid>
		<description><![CDATA[I sent this e-mail to my colleagues back on August 13th, 2010, on the subject of Google Wave (which had just announced it would end): I think that wave was only slightly ahead of its time. I expect we&#8217;ll see it re-incarnated into other products. Something I&#8217;ve come to realize in the last few months [...]]]></description>
			<content:encoded><![CDATA[<p>I sent this e-mail to my colleagues back on August 13th, 2010, on the subject of Google Wave (which had just announced it would end):<span id="more-482"></span></p>
<blockquote><p>I think that wave was only slightly ahead of its time. I expect we&#8217;ll see it re-incarnated into other products.</p>
<p>Something I&#8217;ve come to realize in the last few months is that in the minds of those aged 22 and younger, email is a dinosaur. It is old fashioned, slow and basically for old people and spam. They prefer immediate forms of communication like IM, text messages and facebook.</p>
<p>In this context, wave makes a lot of sense and also explains why the only people who I know who used it were high school and college students. It had many of the good things about email but you could see people&#8217;s responses immediately.</p>
<p>Also, like facebook, even for non-real time communication, you only receive messages from people who you know and trust. Spam is pretty much impossible unless you&#8217;ve befriended a spammer. And in that case you can unfriend them and your spam problem goes away.</p>
<p>Beyond those benefits, you had the most rich communication and sharing experience I&#8217;ve heard of. Graphics, videos, maps, drawings and more are shared instantly and effortlessly.</p>
<p>I know why I didn&#8217;t adopt it; I didn&#8217;t want another inbox. But I suspect like DVRs and HD TV even our parents will use something like this soon. Whatever replaces Wave (and I bet something must come to replace it) will bridge the gap between the way we have been doing it and the way the next generation wants to do it.</p></blockquote>
<p>Today <a href="http://www.guardian.co.uk/technology/blog/2010/nov/15/facebook-announcement-live-coverage">Facebook announced that it will offer an e-mail service</a> doing just what I said above. It will combine the immediacy of Facebook chat with the threading capability of Facebook messages or e-mail but wrapped in a very simple, conversational format.</p>
<p>I think that Facebook is listening to their users. And by users, I don&#8217;t mean corporate people who love their Exchange shared folders. I mean people who just want to communicate with those they know and love.</p>
<p>And unlike Wave, I expect the adoption to be much higher, because people already spend a lot of time on Facebook. I think that it will leech some users away from their inbox.</p>
<p>My questions:</p>
<ol>
<li>What are the privacy implications of giving your @facebook e-mail address when you shop online or sign up for an account. Do they get more than just an e-mail address?</li>
<li>What kinds of e-mail like activity is this not going to work well with? Can I sign up to a mailing list and expect good results?</li>
<li>What about e-mails that have a very short useful life? For example, a coupon that is only good for a week or a notice that you were outbid on e-bay. How do you deal with these?</li>
</ol>
<p>I&#8217;ve got more questions but figure 3 will work for now. I can&#8217;t wait to see how it works. <img src='http://www.bearfruit.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/bearfruit/~4/wYXa7geoXjc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.bearfruit.org/2010/11/15/facebook-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.bearfruit.org/2010/11/15/facebook-email/</feedburner:origLink></item>
		<item>
		<title>Mobile browser redirection with mod_rewrite</title>
		<link>http://feedproxy.google.com/~r/bearfruit/~3/wExW32iKyRs/</link>
		<comments>http://www.bearfruit.org/2010/11/05/mobile-browser-redirection-with-mod_rewrite/#comments</comments>
		<pubDate>Fri, 05 Nov 2010 18:39:30 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Cool Stuff]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.bearfruit.org/?p=469</guid>
		<description><![CDATA[I found a great article on using mod_rewrite to send mobile browsers to a special page or site. I modified it to do the inverse as well. You can use the rules demonstrated in there to send mobile browsers to your mobile site and you can use the rules below as an inverse to send [...]]]></description>
			<content:encoded><![CDATA[<p>I found a great article on <a href="http://www.projectronin.com/blog/?p=10">using mod_rewrite to send mobile browsers to a special page</a> or site. I modified it to do the inverse as well. You can use the rules demonstrated in there to send mobile browsers to your mobile site and you can use the rules below as an inverse to send desktop browsers from your mobile site to your normal site.<span id="more-469"></span></p>
<pre>RewriteEngine On</pre>
<pre>RewriteCond %{REQUEST_URI} ^/$</pre>
<pre>RewriteCond %{HTTP_ACCEPT} !"text/vnd.wap.wml|application/vnd.wap.xhtml+xml" [NC]</pre>
<pre>RewriteCond %{HTTP_USER_AGENT} !"acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC]</pre>
<pre>RewriteCond %{HTTP_USER_AGENT} !"dang|doco|erics|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC]</pre>
<pre>RewriteCond %{HTTP_USER_AGENT} !"maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC]</pre>
<pre>RewriteCond %{HTTP_USER_AGENT} !"palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC]</pre>
<pre>RewriteCond %{HTTP_USER_AGENT} !"sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC]</pre>
<pre>RewriteCond %{HTTP_USER_AGENT} !"teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC]</pre>
<pre>RewriteCond %{HTTP_USER_AGENT} !"wapp|wapr|webc|winw|winw|xda|xda-" [NC]</pre>
<pre>RewriteCond %{HTTP_USER_AGENT} !"up.browser|up.link|windowssce|iemobile|mini|mmp" [NC]</pre>
<pre>RewriteCond %{HTTP_USER_AGENT} !"symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC]</pre>
<pre>RewriteCond %{HTTP_USER_AGENT} macintosh [NC]</pre>
<pre>RewriteRule ^(.*)$ http://www.yoursite.com/ [L,R=302]</pre>
<p>Three things to note about this compared to the original:</p>
<ol>
<li>My use case is two sites, www.yoursite.com for normal and m.yoursite.com for mobile sites</li>
<li>I only check URLs on the homepage, I figure here that if they&#8217;re on an interior page they&#8217;re there on purpose</li>
<li>You understand mod_rewrite and regular expressions enough to know what to change above to make it right for you (only the 2nd and last lines will likely need to change)</li>
</ol>
<img src="http://feeds.feedburner.com/~r/bearfruit/~4/wExW32iKyRs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.bearfruit.org/2010/11/05/mobile-browser-redirection-with-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.bearfruit.org/2010/11/05/mobile-browser-redirection-with-mod_rewrite/</feedburner:origLink></item>
	</channel>
</rss>

