<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>TPT</title>
	<atom:link href="http://tecparatodos.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tecparatodos.com</link>
	<description>Blog de tecnología para todos</description>
	<lastBuildDate>Thu, 06 Jun 2013 00:21:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='tecparatodos.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/990b29dbf777d31180c05281f6792fd4?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>TPT</title>
		<link>http://tecparatodos.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://tecparatodos.com/osd.xml" title="TPT" />
	<atom:link rel='hub' href='http://tecparatodos.com/?pushpress=hub'/>
		<item>
		<title>Probability math notes part 2 – Bayes Theorem &#8211; Example with Software Quality Control</title>
		<link>http://tecparatodos.com/2012/11/04/probability-math-notes-part-2-bayes-theorem-example-with-software-quality-control/</link>
		<comments>http://tecparatodos.com/2012/11/04/probability-math-notes-part-2-bayes-theorem-example-with-software-quality-control/#comments</comments>
		<pubDate>Sun, 04 Nov 2012 20:34:43 +0000</pubDate>
		<dc:creator>Greg Werner</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[Bayes theorem]]></category>
		<category><![CDATA[Probability theory]]></category>
		<category><![CDATA[Quality and assurance]]></category>
		<category><![CDATA[Quality control]]></category>

		<guid isPermaLink="false">http://tecparatodos.com/2012/11/04/probability-math-notes-part-2-bayes-theorem-example-with-software-quality-control/</guid>
		<description><![CDATA[Bayes Theorem can be derived from the condition probability principles stated in Part 1 below. ⁃ Pr(A&#124;B) = Pr(A and B)/Pr(B), if Pr(B) not = 0 ⁃ Pr(B&#124;A) = Pr(A and B)/Pr(A), if Pr(A) not = 0 ⁃ Pr(A and B) = Pr(A&#124;B)*Pr(B) = Pr(B&#124;A)*Pr(A) ⁃ Pr(A&#124;B) = Pr(B&#124;A)*Pr(A)/Pr(B) **Note: Pr(A and B) can be [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=304&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><strong>Bayes Theorem</strong> can be derived from the condition probability principles stated in Part 1 below.</p>
<p>⁃ Pr(A|B) = Pr(A and B)/Pr(B), if Pr(B) not = 0<br /> ⁃ Pr(B|A) = Pr(A and B)/Pr(A), if Pr(A) not = 0<br /> ⁃ Pr(A and B) = Pr(A|B)*Pr(B) = Pr(B|A)*Pr(A)<br /> ⁃ <strong>Pr(A|B) = Pr(B|A)*Pr(A)/Pr(B)</strong></p>
<p>**Note: Pr(A and B) can be visualised with a <strong>Venn Diagram</strong>. The set that is common to two or more sets overlap, the overlapping set is the and space. Example: of 10 people that like fruit, five people like apples and four people like oranges. Two people like apples and oranges. In this case, one person likes neither apples or oranges, three people like apples but not oranges and two people like oranges but not apples.</p>
<p><strong>Example: Quality and Control with Software</strong></p>
<p>Suppose you have 7 programmers at your company developing Java classes. The following table describes their track record with quality:</p>
<p>Programmer | Proportion of development | Probability of defective class (code)<br />￼1                                 .10                                        .03<br />2                                 .05                                        .03<br />3                                 .20                                        .02<br />4                                 .15                                        .02<br />5                                 .25                                        .01<br />6                                 .15                                        .02<br />7                                 .10                                        .03</p>
<p>Suppose that the Quality and Assurance department (Q&amp;A) reviewed classes at random and found them to be defective. What is the probability that Programmer 1 developed this defective code?</p>
<p>If Programming is an event, then these are seven mutually exclusive events and their union is the entire sample space. A class was only developed by one and only one of the Programmers. (We&#8217;re assuming in this case that one programmer develops one class, which usually isn&#8217;t the case since programmers work in teams, however, this example may be extrapolated to groups, i.e. group 1 develops 10% of the code with a quality rate of 97%).</p>
<p>Let Bi (i = 1,2, … 7) be the event that the class was developed by programmer i, and let A be the event that the class is defective. Then, for example:</p>
<p>Pr(B1) = .10 and Pr(A|B1) = .03</p>
<p>In this case we have to calculate the reversed conditional probability. That is, we need to calculate the probability that the event, B1 (probability of Programmer 1 developing the code) is from the sample space A (probability of defective code). By applying Bayes&#8217; Theorem the formula would be:</p>
<p>Pr (B1|A) = Pr(A|B1)*Pr(B1) / Pr(A|B1)*Pr(B1) + Pr(A|B2)*Pr(B2) + … + Pr(A|B7)*Pr(B7)<br />Pr(B1|A) = (.10)(.03) / (.10)(.03) + (.05)(.03) + (.20)(.02) + (.15)(.02) + (.25)(.01) + (.15)(.02) + (.10)(.03)<br />Pr(B1|A) = .15</p>
<p>So there is a <strong>15% probability</strong> that the defective code is from Programmer 1.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregwernerdotcom.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregwernerdotcom.wordpress.com/304/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=304&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tecparatodos.com/2012/11/04/probability-math-notes-part-2-bayes-theorem-example-with-software-quality-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a966e7ef571ffea6a0cf5d22cb162d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregwernerblog</media:title>
		</media:content>
	</item>
		<item>
		<title>Probability math notes part 1 &#8211; Combinations and Permutations</title>
		<link>http://tecparatodos.com/2012/11/04/probability-math-notes-part-1-combinations-and-permutations/</link>
		<comments>http://tecparatodos.com/2012/11/04/probability-math-notes-part-1-combinations-and-permutations/#comments</comments>
		<pubDate>Sun, 04 Nov 2012 19:16:00 +0000</pubDate>
		<dc:creator>Greg Werner</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Combinations]]></category>
		<category><![CDATA[finite math]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[math for computer science]]></category>
		<category><![CDATA[permutations]]></category>

		<guid isPermaLink="false">http://tecparatodos.com/2012/11/04/probability-math-notes-part-1-combinations-and-permutations/</guid>
		<description><![CDATA[I found these notes for finite math principles to be helpful. They have to do with combinations and permutations&#8230;there are plenty of resources on the web but you may find these useful. I personally learned this stuff a long time ago but it&#8217;s always helpful to brush up on the basics. Enjoy! Combinations and Permutations [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=303&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I found these notes for finite math principles to be helpful. They have to do with combinations and permutations&#8230;there are plenty of resources on the web but you may find these useful. I personally learned this stuff a long time ago but it&#8217;s always helpful to brush up on the basics. Enjoy!</p>
<p><strong>Combinations and Permutations</strong></p>
<ul>
<li>If the order <b>doesn&#8217;t</b> matter it&#8217;s a <b>combination</b>.</li>
<li>If the order <b>does</b> matter it&#8217;s a <b>permutations.</b></li>
</ul>
<p><b>Two types of </b><strong>Permutations (order does matter):</strong></p>
<ul>
<li><strong>Repetition is allowed: </strong></li>
<li>Formula: n^r</li>
<li>Example: a lock with ten numbers to choose from (0, 1…9) numbers with three to choose from. This would equate to 10^3 = 1,000. </li>
</ul>
<ul>
<li><strong>Repetition is not allowed </strong></li>
<li>Formula: n! / (n &#8211; r)!</li>
<li>Example: if you were to figure out how to order 16 pool balls, the result would be 16! = 20,922,789,888,000. If however you only wanted to calculate the number of permutations required to choose 3 out of the 16 pool balls then you would have 16! / (16-3)! = 16! / 13! = 3,360</li>
</ul>
<p><b>Two types of </b><strong>Combinations (order doesn&#8217;t matter):</strong></p>
<p><b>* Note there will always be more permutations than combinations</b></p>
<ul>
<li><strong>Repetition is allowed: </strong></li>
<li>Formula: (n + r -1)! / r!(n-1)!</li>
<li>Example: choose three scoops of ice-cream out of five possible flavours. In this case, the result would be (5+3-1)! / 3!(5-1)! = 7! / 3!*4! = 35.</li>
</ul>
<ul>
<li><strong>Repetition is not allowed:</strong></li>
<li>Formula: n! / r!(n-r)! . Also known as the binomial coefficient, also known as saying, for example 16 choose 3 (choose 3 pool balls out of the 16 available).</li>
<li>Example: choose 3 pool balls out of the available 16, but in this case the order does not matter. The result would be 16! / 3! X (16-3)! = 16! / 3! X (13)! = 16! / 3! X (13)! = 560. </li>
</ul>
<p><strong>Number of probabilities in an Event</strong></p>
<p>The number of probabilities in an event is: </p>
<p>Pr(E) = [Number of outcomes in E] / N</p>
<p>Where E is the event and N is the sample space.</p>
<p><strong>Example:</strong> there are 8 white balls and two green balls in an urn. If you were to choose 3 balls out of the urn, what are the chances that they are all white balls?</p>
<p><strong>Solution:</strong> number of white balls are 8. Since order doesn&#8217;t matter and repetition is not allowed, the formula would be for a combination without repetition: C(8,3) = 56. The probability that this event would occur would have to be divided by the sample space, which is C(10,3). So the result would be C(8,3) / C(10,3) = 7/15.</p>
<p><strong>Calculating &#8216;at least&#8217; questions (these are always on quizzes and tests and are brain teasers)</strong></p>
<p>Two possible ways may be used to calculate &#8216;at least&#8217; questions. For example, what is the probability of selecting one green ball out of three selected from an urn that has 2 green balls and 8 white balls. </p>
<p><strong>One: use the multiplication and addition principles</strong></p>
<ul>
<li>Event for first green ball is C(2,1) X C(8,2).</li>
<li>Event for second green ball is C(2,2) X C(8,1).</li>
<li>Probability for both events are added: C(2,1) X C(8,2) + C(2,2) X C(8,1).</li>
<li>Divide by sample space using probability of an event formula: C(2,1) X C(8,2) + C(2,2) X C(8,1) / C(10,3) = 8/15 </li>
</ul>
<p><strong>Two: use the complement rule</strong></p>
<ul>
<li>Complement rule: Pr(E) = 1 &#8211; Pr(E&#8217;)</li>
<li>Since the probability of selecting &#8216;all three balls are white&#8217; = C(8,3) / C(10,3) = 7/15.</li>
<li>The event &#8216;at least one ball is green&#8217;, is F.</li>
<li>The complement of F, F&#8217;, is equal to E. Therefore E = F&#8217;.</li>
<li>So by the complement rule, Pr(F) = 1 &#8211; Pr(F&#8217;) = 1 &#8211; Pr(E) = 1 &#8211; 7/15 = 8/15.</li>
</ul>
<p><strong>Conditional Probability</strong></p>
<p>Pr(E|F). Sample space, F, is restricted. Written as Pr(E|F) = P(E and F) / Pr (F)</p>
<p>If E and F are independent, then <b>Pr(E and F) = Pr(E) * Pr(F)</b>.  Example: rolling dice, one roll has no affect on the other. </p>
<p>May also be expressed as <b>Pr(E|F) = Pr(E) and Pr(F|E) = P(F)</b>. This is obtained from the above by: Pr(E|F) = Pr(E and F)/Pr(F) = Pr(E)*Pr(F)/Pr(F), so Pr(F) cancels out leaving <b>Pr(E|F) = Pr(E)</b></p>
<p>A set of events are independent from each other if Pr(E1 and E2 and E3 and … En) = Pr(E1 * E2 * E3 … En). For example, a stereo has the probability of 2% of having a defective CD, 3% of having defective amplifier and 7% of defective speakers. Let these be events E, F and S^2, respectively. Then the chance of the system not being defective is E&#8217;, F&#8217;, S&#8217;^2. So the result would be Pr(E&#8217;) * Pr(F&#8217;) * Pr(S&#8217;)^2 = .98*.97*.93^2 = .822.</p>
<p> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregwernerdotcom.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregwernerdotcom.wordpress.com/303/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=303&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tecparatodos.com/2012/11/04/probability-math-notes-part-1-combinations-and-permutations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a966e7ef571ffea6a0cf5d22cb162d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregwernerblog</media:title>
		</media:content>
	</item>
		<item>
		<title>Example Python Script &#8211; Calculating ABV percentage for beer or wine</title>
		<link>http://tecparatodos.com/2012/01/14/example-python-script-calculating-abv-percentage-for-beer-or-wine/</link>
		<comments>http://tecparatodos.com/2012/01/14/example-python-script-calculating-abv-percentage-for-beer-or-wine/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 17:21:16 +0000</pubDate>
		<dc:creator>Greg Werner</dc:creator>
				<category><![CDATA[Mac OS X Lion]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[alcohol percentage]]></category>
		<category><![CDATA[gravity readings]]></category>
		<category><![CDATA[python version]]></category>

		<guid isPermaLink="false">http://tecparatodos.com/?p=292</guid>
		<description><![CDATA[Hi everyone, I have been playing around with Python on my Mac OSX Lion, version 2.7. (If you need to confirm the version just type using your Terminal: $ Python -version I came up with this handy script to check the ABV (alcohol percentage) for Beer or Wine. It&#8217;s a handy script if you&#8217;re into home [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=292&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Hi everyone,</p>
<p>I have been playing around with Python on my Mac OSX Lion, version 2.7. (If you need to confirm the version just type using your Terminal:</p>
<p><code>$ Python -version</code></p>
<p>I came up with this handy script to check the ABV (alcohol percentage) for Beer or Wine. It&#8217;s a handy script if you&#8217;re into home brewing. It also helped get me going on how simple it is to use Python and it&#8217;s also handy for prototyping different algorithms before getting to some serious coding in another language!</p>
<p>By the way, you may use this script without restrictions, but if I ever meet you buy me a beer, preferably a DIPA :=)).</p>
<p><code>/*<br />
* ----------------------------------------------------------------------------<br />
* "THE BEER-WARE LICENSE" (Revision 42):<br />
* wrote this file. As long as you retain this notice you<br />
* can do whatever you want with this stuff. If we meet some day, and you think<br />
* this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp<br />
* ----------------------------------------------------------------------------<br />
*/</code></p>
<p><code># Program used to calculate the alcohol percentage by volume in beer.<br />
# @ Greg Werner</code></p>
<p><code># Variable definitions for command prompt inputs. Includes conversion from strings to floats</code></p>
<p><code><code>og = raw_input('Please enter your Original Gravity reading: ')</code><br />
<code>o = float(og)</code><br />
<code>tempog = raw_input('Please enter the temperature, in F, when obtaining your Original Gravity: ')</code><br />
<code>tempOG = float(tempog)</code><br />
<code>fg = raw_input('Please enter your Final Gravity reading: ')</code><br />
<code>f = float(fg)</code><br />
<code>tempfg = raw_input('Please enter the temperature, in F, when obtaining your Final Gravity: ')</code><br />
<code>tempFG = float(tempog)</code></code></p>
<p><code># Function definition for original gravity and final gravity parameters with three floating point positions.</code></p>
<p><code>def abv(o, f):<br />
x = '%.3f' % (o)<br />
y = '%.3f' % (f)<br />
og = float(x)<br />
fg = float(y)</code></p>
<p><code># Conditions for adjusting original y final gravity readings according to temperature in F.</code></p>
<p><code>if tempFG &lt;= 69:<br />
fg = fg + 0<br />
elif tempFG &gt;= 70 and tempFG &lt;= 76:<br />
fg = fg + 0.001<br />
elif tempFG &gt;= 77 and tempFG &lt;= 83:<br />
fg = fg + 0.002<br />
elif tempFG &gt;= 84 and tempFG &lt;= 94:<br />
fg = fg + 0.003<br />
elif tempFG &gt;= 95 and tempFG &lt;= 104:<br />
fg = fg + 0.004<br />
else:<br />
fg == 105<br />
fg = tempFG + 0.007</code></p>
<p><code>if tempOG &lt;= 69:<br />
og = og + 0<br />
elif tempOG &gt;= 70 and tempOG &lt;= 76:<br />
og = og + 0.001<br />
elif tempOG &gt;= 77 and tempOG &lt;= 83:<br />
og = og + 0.002<br />
elif tempOG &gt;= 84 and tempOG &lt;= 94:<br />
og = og + 0.003<br />
elif tempOG &gt;= 95 and tempOG &lt;= 104:<br />
og = og + 0.004<br />
else:<br />
og == 105<br />
og = og + 0.007</code></p>
<p><code>abv = ((1.05 * (og - fg))/ fg) / 0.79 * 100</code></p>
<p><code>return '%.3f' % abv</code></p>
<p><code>ABV = float(abv(o, f))</code></p>
<p><code># Print results for ABV calculation.</code></p>
<p><code>if ABV &lt;= 5.00:<br />
print ('Your beer has an alcohol content of ' + str(ABV) +'. You have a low alcohol beer.')<br />
elif ABV &gt;= 5.01 and ABV &lt;= 8.00:<br />
print ('Your beer has an alcohol content of ' + str(ABV) +'. Drink in moderation, you have a medium alcohol beer.')<br />
else:<br />
print ('Your beer has an alcohol content of ' + str(ABV) +'. Be careful, you have yourself a bomb!')</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregwernerdotcom.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregwernerdotcom.wordpress.com/292/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=292&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tecparatodos.com/2012/01/14/example-python-script-calculating-abv-percentage-for-beer-or-wine/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a966e7ef571ffea6a0cf5d22cb162d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregwernerblog</media:title>
		</media:content>
	</item>
		<item>
		<title>November: living without the Internet and watching TV&#8230;</title>
		<link>http://tecparatodos.com/2011/12/01/november-living-without-the-internet-and-watching-tv/</link>
		<comments>http://tecparatodos.com/2011/12/01/november-living-without-the-internet-and-watching-tv/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 02:32:05 +0000</pubDate>
		<dc:creator>Greg Werner</dc:creator>
				<category><![CDATA[Rambles]]></category>

		<guid isPermaLink="false">http://tecparatodos.com/?p=289</guid>
		<description><![CDATA[Ok! Internet is misson critical and TV sucks. I moved during November and lost my Internet for about a month. I did have Internet at work, but needless to say it didn&#8217;t feel right to work on my personal stuff at work&#8230;but wow was I impressed with how much we rely on the Internet! Some [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=289&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Ok! Internet is misson critical and TV sucks.</p>
<p>I moved during November and lost my Internet for about a month. I did have Internet at work, but needless to say it didn&#8217;t feel right to work on my personal stuff at work&#8230;but wow was I impressed with how much we rely on the Internet! Some of the things that really caught me off guard:</p>
<ul>
<li>Had to have my wife pay my bills remotely, she turned into my virtual private assistant (straight from the 4 hour work week &#8211; thanks Ferris). Except I could understand her and was fully audited on all my transactions&#8230;</li>
<li>Could only check my emails on my clunky 3G phone. Blah.</li>
<li>Getting home at night and watching junk on TV is WAY worse that surfing on the web, even if your not surfing for anything in particular. At least you can read, watch videos, virtually socialize, man TV is such a dud. SUCH A DUD.</li>
<li>Not being able to work at night stinks. When else can you catch up on all those ignored emails? During the day in the middle of meetings? Don&#8217;t think so.</li>
<li>Missed out on Cyber Monday, dang.</li>
<li>Couldn&#8217;t write in this blog, aggh!</li>
<li>Couldn&#8217;t conference with family and co-workers in other time zones</li>
</ul>
<p>And the list goes on.</p>
<p>Maybe Santa Clause can bring my a redundant fiber link and perma Internet connection LTE chip embedded in my nose.</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregwernerdotcom.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregwernerdotcom.wordpress.com/289/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=289&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tecparatodos.com/2011/12/01/november-living-without-the-internet-and-watching-tv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a966e7ef571ffea6a0cf5d22cb162d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregwernerblog</media:title>
		</media:content>
	</item>
		<item>
		<title>How much cash to the large tech companies have?</title>
		<link>http://tecparatodos.com/2011/10/10/how-much-cash-to-the-large-tech-companies-have/</link>
		<comments>http://tecparatodos.com/2011/10/10/how-much-cash-to-the-large-tech-companies-have/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 03:51:47 +0000</pubDate>
		<dc:creator>Greg Werner</dc:creator>
				<category><![CDATA[Negocios]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cash And Cash Equivalents]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Current asset]]></category>
		<category><![CDATA[Dell]]></category>
		<category><![CDATA[EMC]]></category>
		<category><![CDATA[Google+]]></category>
		<category><![CDATA[Gross Domestic Product]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[international reserves]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[United States]]></category>

		<guid isPermaLink="false">http://tecparatodos.com/?p=284</guid>
		<description><![CDATA[A few weeks ago I published an article in Spanish about how much revenue large tech companies have in comparison to some of the countries around the world. To make a long story short, just two to three of the big tech companies put together have more revenue than the Gross Domestic Product (GDP) of [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=284&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>A few weeks ago I published an <a href="http://tecparatodos.com/2011/07/21/microsoft-apple-y-google-mas-dinero-que-la-mayoria-de-los-paises-del-mundo/" target="_blank">article in Spanish</a> about how much revenue large tech companies have in comparison to some of the countries around the world. To make a long story short, just two to three of the big tech companies put together have more revenue than the Gross Domestic Product (GDP) of many countries around the world. And with money comes power.</p>
<p>But how liquid are these companies, i.e. how much do they have in cash and other short term investments, i.e. current assets? As the old saying goes, cash is king, and boy do these tech juggernauts hold the crown. After a few minutes on Google Finance, Wikipedia and some other sites, I found some information, when compared to several governments, helps put things into perspective.</p>
<h2>Cash and short term assets on some of the big tech companies balance sheets</h2>
<ul>
<li><strong>Microsoft</strong> has about 75 billion dollars in current assets. It&#8217;s not uncommon for them to add between 1-4 billion dollars in cash per quarter.</li>
<li><strong>Apple</strong> has about 47 billion dollars in current assets. They are also generating cash on a quarterly basis at an insane level.</li>
<li><strong>IBM</strong> also has about 47 billion in current assets. Do they generate cash every quarter? Just about, say a billion here, a billion there.</li>
<li><strong>Google</strong> is no slouch either and is in good company, they hold about 47 billion in current assets as well. They hold about 39 billion dollars in cash and short term investments.</li>
<li><strong>HP</strong> surprised me. Even with all their troubles of late they &#8220;only&#8221; have about 56 billion dollars in current assets.</li>
<li><strong>Cisco</strong> is also insane. They have about 57 billion in current assets.</li>
<li>Let&#8217;s add <strong>EMC2</strong> into the mix as well. They have about 10.2 billion dollars in current assets. Their operating cash flow is also solid.</li>
<li><strong>Dell&#8230;</strong>. about 30 billion in current assets. Not bad huh?</li>
</ul>
<div>Let&#8217;s add the current assets from these eight companies: <strong>that&#8217;s about 370 billion dollars in current assets</strong>. Remember we&#8217;re not talking about total assets here, only cash and stuff they can sell relatively quickly to get cash in a hurry.</div>
<h2>Cash balances for some governments</h2>
<div>Governments don&#8217;t follow the same accounting principles that us mortals do. The closest thing to current assets are international reserves, also known as official reserves or foreign exchange reserves. These are holdings in international currencies (such as the US dollar and Yen), gold, special drawing rights (SDRs) and Internation Monetary Fund reserve positions.</div>
<div>Ok, so we all know China has a lot of cash and cash equivalents handy, to the tune of about 3.2 trillion USD dollars. But they are by far and away the country with the most international reserves.</div>
<div>So, where would the eight companies above rank if they were a country? <strong>Number six in the world.</strong> That&#8217;s right. A few of the countries that would be ranked below:</div>
<div>Brazil (35o billion), United States (142 billion &#8211; isn&#8217;t that nuts?), India (311 billion), Germany (230 billion), Mexico (131 billion), the list goes on and on.</div>
<div>Considering how much cash these companies have generated in the last ten years, and considering how most developed countries have not improved their international reserve positions, how will they compare 2022?</div>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregwernerdotcom.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregwernerdotcom.wordpress.com/284/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=284&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tecparatodos.com/2011/10/10/how-much-cash-to-the-large-tech-companies-have/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a966e7ef571ffea6a0cf5d22cb162d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregwernerblog</media:title>
		</media:content>
	</item>
		<item>
		<title>Using regular expressions with your web site and Ruby on Rails application</title>
		<link>http://tecparatodos.com/2011/09/25/using-regular-expressions-with-your-web-site-and-ruby-on-rails-application/</link>
		<comments>http://tecparatodos.com/2011/09/25/using-regular-expressions-with-your-web-site-and-ruby-on-rails-application/#comments</comments>
		<pubDate>Sun, 25 Sep 2011 18:53:32 +0000</pubDate>
		<dc:creator>Greg Werner</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[IP address]]></category>
		<category><![CDATA[Metacharacter]]></category>
		<category><![CDATA[Regular expression]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[search engine optimization]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://tecparatodos.com/?p=266</guid>
		<description><![CDATA[Regular expressions, also known as regex or regexp, are a useful and powerful way to match strings of text. I first ran into regular expressions when reading chapter 6 of Michael Hartl&#8217;s Rails Tutorial. After testing some examples and doing some research, I realized that using regex is also helpful for filtering Google Analytics reports [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=266&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Regular expressions, also known as regex or regexp, are a useful and powerful way to match strings of text. I first ran into regular expressions when reading chapter 6 of Michael Hartl&#8217;s <a href="http://railstutorial.org" target="_blank">Rails Tutorial</a>. After testing some examples and doing some research, I realized that using regex is also helpful for filtering Google Analytics reports and improving your organic search results in Google. (I don&#8217;t know if regex works with Bing but would assume so). So it is definitely worth it to learn a little regex, especially if your site is similar to Twitter or Groupon, i.e. your web application is very tied into your www website.</p>
<h2>A brief overview</h2>
<p>Regular expressions are used to match strings of text. This is done by using characters and metacharacters.</p>
<ul>
<li><strong>Characters</strong> are literal and case sensitive. The letter A matches the letter A, the letter b matches the letter b, the number 1 matches the number 1, etc.</li>
<li><strong>Metacharacters</strong> are not treated literally. Here are the most common ones:</li>
<ul>
<li><span style="text-decoration:underline;">Dot</span> . is a wildcard for any character. .ind will match with <strong>Wind</strong>ows,<strong> wind</strong>ows, or <strong>lind</strong>ows.</li>
<li><span style="text-decoration:underline;">Backlashes</span> \ are used to match characters that need to be matched with metacharacters, such as 192.168.1.1. Since the dot (.) is a metacharacter, matching 192.168.1.1 needs to be done with 192\.168\.1\.1 adding the backlash before the standard matacharacter.</li>
<li><span style="text-decoration:underline;">Brackets</span> [], similar to lists in most programming languages, are used to group a set of characters that you need to match. If you need to match a character regardless of case, you could match [Dd]og for matching Dog and dog.</li>
<li><span style="text-decoration:underline;">Repetition</span> ? + * {} allows you to search for sequences of characters.</li>
<ul>
<li>The ? allows you to match for no characters or up to one character. For example, 123? would match 12 and 1233 but not 12333.</li>
<li>The + matches one or more characters. For example, 123+ would match 123, 1233 or 1233333.</li>
<li>The * combines ? and +, in other words, in matches none or any number of characters after. For example, 123* matches 12, 123, 123333.</li>
<li>The {} matches repetitions. [0-9]{2} will match any two digits, [a-z]{6,8} will match any number of lower case characters between six and eight digits.</li>
</ul>
<li><span style="text-decoration:underline;">Grouping</span> () |. Parantheses are used to group characters together. If you wanted to match results with your short name and your full name for example (in may case it would be Greg or Gregory) you could use Greg(ory). Pipes (|) are used for the OR operator. For example you could use (Greg|greg)ory for Gregory and gregory.</li>
<li><span style="text-decoration:underline;">Anchors</span> ^ $ are used mainly for matching the beginning set of characters, which is handy for URL matching. The caret matches ^services/ would match services/myservices and services/myservices/theseservices. The $ works the other way around, that is, /services$ would match myservices/services but not services/these services.</li>
</ul>
</ul>
<div>By the way, kudos to <a href="http://www.seomoz.org/" target="_blank">http://www.seomoz.org/</a> for helping clarify some of the above definitions.</div>
<h2>Using Regular Expressions to Improve Organic Search Results</h2>
<div>Gone are the days of focusing on plastering your logo on a big bill board over you local interstate, particularly if you are a new company with limited marketing resources. And if you sell your products and services online, having your site positioned well with organic search results is extremely important to improve web site traffic and sales. Well, regular expressions can also help you with this task.</div>
<h3>Filter Internal IP Addresses from Web Site Traffic</h3>
<div>If you are serious about SEO you are probably using Google Analytics to monitor the quantity and quality of your web site traffic. Therefore your first step is to make sure your data within Google Analytics reflects external traffic only, not traffic generated by your internal network. You can use a regular expression with Google Analytics to filter out your internal network IP addresses. Below is a screen shot on how to use User Defined filters with regex:</div>
<div><a href="http://gregwernerdotcom.files.wordpress.com/2011/09/an_profile1.jpg"><img class="alignnone size-medium wp-image-279" title="Regular Expression Filter with Google Analytics" src="http://gregwernerdotcom.files.wordpress.com/2011/09/an_profile1.jpg?w=300&#038;h=164" alt="" width="300" height="164" /><br />
</a></div>
<p>Here the regular expression ^201\.159\.133\.([1-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-4]))$ looks for any IP address that matches 2o1.158.133.1 through 2o1.158.133.254.</p>
<p>If you don&#8217;t want to code from scratch, Google Analytics has a handy feature to create the regex for you at <a href="http://www.google.com/support/analytics/bin/answer.py?answer=55572" target="_blank">http://www.google.com/support/analytics/bin/answer.py?answer=55572</a>. There new custom filter feature allows you to create all kinds of filters without necessarily having to know regular expressions, but understanding them will help you tweak how the filters work.</p>
<h3>Rewrite URLs</h3>
<p>As you have probably heard, if your keywords are within your URL then organic placement in search results will improve. Most content managers these days, particularly <strong>Word Press, </strong>allow you to edit how your URL displays within your visitors web browser without knowing regex. Lots of web sites still use Apache though, so knowing a little regex will help when editing your <strong>.htaccess</strong> files to Rewrite URLs (make sure that RewriteEngine On is set).</p>
<h2>Using regular expressions within your RoR application</h2>
<p>One of the cool topics in the Rails Tutorial by Michael Hartl is the explanation on how to simplify field validations. The following example shows how the code looks in your *.rb file, for example in &lt;your application&gt;/app/models/user.rb:</p>
<div>
<pre>class User &lt; ActiveRecord::Base
  attr_accessible :name, :email

  email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i  validates :name,  :presence =&gt; true,
                    :length   =&gt; { :maximum =&gt; 50 }
  validates :email, :presence =&gt; true,
                    :format   =&gt; { :with =&gt; email_regex }
end</pre>
<p>The above example looks for a specific pattern of characters in order to determine if it complies with an email format. At first, regular expressions look like gibberish but if you learn how to use regex it will make you life a lot easier.</p>
<p>For Ruby, there is a site named Rubular (<a href="http://www.rubular.com" target="_blank">www.rubular.com</a>), which allows you to use the site as a reference guide for Ruby based regex. It also allows you to test your regex before you add it to your code.</p>
<p>So next time you are adding validations or other types of string matching tasks to your Ruby on Rails site, consider using regex in order to simplify your life. Just practice a little and in no time you&#8217;ll be able to use regex within your RoR application for field validations and the likes, use it to filter Google Analytics reports and improve your organic search results by modifying your web server URLs.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregwernerdotcom.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregwernerdotcom.wordpress.com/266/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=266&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tecparatodos.com/2011/09/25/using-regular-expressions-with-your-web-site-and-ruby-on-rails-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a966e7ef571ffea6a0cf5d22cb162d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregwernerblog</media:title>
		</media:content>

		<media:content url="http://gregwernerdotcom.files.wordpress.com/2011/09/an_profile1.jpg?w=300" medium="image">
			<media:title type="html">Regular Expression Filter with Google Analytics</media:title>
		</media:content>
	</item>
		<item>
		<title>Yahoo! needs to change its Roots!</title>
		<link>http://tecparatodos.com/2011/09/07/yahoo-change-roots/</link>
		<comments>http://tecparatodos.com/2011/09/07/yahoo-change-roots/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 20:11:10 +0000</pubDate>
		<dc:creator>Greg Werner</dc:creator>
				<category><![CDATA[Negocios]]></category>
		<category><![CDATA[Carol Bartz]]></category>
		<category><![CDATA[Google+]]></category>
		<category><![CDATA[Jerry Yang]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Silicon Valley]]></category>
		<category><![CDATA[Yahoo]]></category>

		<guid isPermaLink="false">http://tecparatodos.com/?p=260</guid>
		<description><![CDATA[There&#8217;s an old saying out there: really good management is only necessary if you need to cover up for faulty product. Not like everything takes care of itself by just having a great product, but it certainly makes things a lot easier, doesn&#8217;t it? A Little History After several underpreforming quarters, the board brought co-founder [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=260&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<div class="tweetmeme-button" id="tweetmeme-button-post-260" style='float: right; margin-left: 10px; margin-bottom: 5px; padding: 4px 0 2px 4px; background: #fff;'>
<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftecparatodos.com%2F2011%2F09%2F07%2Fyahoo-change-roots%2Ftweetmeme_alias%3Dhttp%3A%2F%2Fwp.me%2Fp1DRZ3-4c%26tweetmeme_source%3D%E2%80%9Dgwerner%E2%80%9D"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftecparatodos.com%2F2011%2F09%2F07%2Fyahoo-change-roots%2F" height="61" width="51" /></a>
</div>
<p>There&#8217;s an old saying out there: really good management is only necessary if you need to cover up for faulty product. Not like everything takes care of itself by just having a great product, but it certainly makes things a lot easier, doesn&#8217;t it?</p>
<h2>A Little History</h2>
<p>After several underpreforming quarters, the board brought co-founder Yang back in to try to get the company back to its roots. For the most part it worked, Microsoft bid 33 bucks a share for Yahoo!, but Yang and the board got greedy and rejected the offer. Then Silicon Valley veteran Bartz was brought in to shape the ship&#8230;that didn&#8217;t work so well either and investors acted. How would you like to be fired over the phone?</p>
<p>Bartz&#8217;s recent ouster from Yahoo! is no surprise, considering the company has been underperforming the S&amp;P 500 for some time now. I mean, really, you could put any CEO into that position and anyone could flounder, unless their product and strategy were to change drastically. Issue is, they lost track of their core business.</p>
<h2>Yahoo!&#8217;s Roots Are No Longer Applicable</h2>
<p>I go to Yahoo!&#8217;s site once in a while, but it&#8217;s stale. News items are from Thompson Reuters or from the Associated Press. They also have a Travel site. Have you ever bought a plane ticket from Yahoo!? I bet you haven&#8217;t, you probably use Expedia, Priceline, Orbitz or go directly to your favorite airline&#8217;s website. By the way, Yahoo!&#8217;s site is very handy for testing your Internet connection: just type &#8220;ping <a href="http://www.yahoo.com&#8221" rel="nofollow">http://www.yahoo.com&#8221</a>; and the site responds, one of the few to do so.</p>
<p>What&#8217;s the first thing we think about when when we think of Yahoo!? We think Internet portal and content, a.k.a. Internet mag, but I bet you don&#8217;t think of it as a premier search engine, heck that&#8217;s an afterthought as it&#8217;s not even their technology anymore. &#8220;I&#8217;m going to Bing for my favorite Yoga studio through Yahoo!&#8221;&#8230;no way. I also bet you don&#8217;t think of it as an B2B auction site, such as Alibaba, even though Yahoo! has a significant stake in the company.</p>
<p>When Yang started Yahoo! back in the 90&#8242;s he set it up to categorize information that was on the Internet so that he could find it better. So at its core, Yahoo! was and still attempts to be a portal that categorizes information so that you can find it. Trouble is the site is so full of content now that it&#8217;s more like a news magazine that a site to manage content via categories. Just type <a href="http://www.yahoo.com" rel="nofollow">http://www.yahoo.com</a> into your favorite web browser and you&#8217;ll see what I mean. Then Google came along and we all know how that went. Searching for content by first placing it into categories is cumbersome and no longer applicable!</p>
<h2>Yahoo!&#8217;s Future</h2>
<p>If I were CEO of Yahoo! I would&#8230;hide under my desk. Anyone that has to take over the CEO has a huge challenge in front of them. Basically, there would be two choices: sell the company in pieces or shift their strategy. The former would be more appealing to the likes of Proxy-Battle-Guru Icahn, the latter would be more appealing to long term strategic investors. In any case, here are some ideas:</p>
<ul>
<li>Start selling applications in the Cloud: they could either penetrate this space via acquisition or could build their own technology by leveraging data centers. Google does it, Microsoft does it, heck all companies are doing it one way or another. They could sell applications specialized in SMB&#8217;s, such as something similar to Google Docs.</li>
<li>Sell infrastructure to provide content on an automated basis: similar to the way Amazon sells its fulfillment services to third parties, Yahoo! could sell content publishing infrastructure to those who need it. I bet they have some significant IP to offer, not a lot of companies offer so much content at an aggregate level.</li>
<li>Categorize Internet content by rank: SEO companies help position websites organically within Google results, but these are specific strategies to improve the relevancy of a website based on certain key words. However, it would be nice if Yahoo! could leverage all their categories and place &#8220;Top 10 Autoparts Websites&#8221; using their ranking algorithms.</li>
</ul>
<p>What else could they do? Next few years shall be very interesting for Yahoo! Time to die a slow death or re invent themselves!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregwernerdotcom.wordpress.com/260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregwernerdotcom.wordpress.com/260/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=260&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tecparatodos.com/2011/09/07/yahoo-change-roots/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a966e7ef571ffea6a0cf5d22cb162d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregwernerblog</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting up Test Driven Development (TDD) with Ruby on Rails and MAC OS X Lion</title>
		<link>http://tecparatodos.com/2011/09/01/setting-up-test-driven-development-tdd-with-ruby-on-rails-and-mac-os-x-lion/</link>
		<comments>http://tecparatodos.com/2011/09/01/setting-up-test-driven-development-tdd-with-ruby-on-rails-and-mac-os-x-lion/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 14:49:08 +0000</pubDate>
		<dc:creator>Greg Werner</dc:creator>
				<category><![CDATA[Mac OS X Lion]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Michael Hartl]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[RSpec]]></category>
		<category><![CDATA[Test-driven development]]></category>

		<guid isPermaLink="false">http://tecparatodos.com/?p=250</guid>
		<description><![CDATA[Have you ever gone through the Ruby on Rails Tutorial (www.railstutorial.org) by Michael Hartl? It&#8217;s a great way to get your feet wet and start developing an application with RoR using your Mac OS X or Linux machine. The tutorial goes through a variety of RoR features, such as scaffolding, development of different controls, views [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=250&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<div class="tweetmeme-button" id="tweetmeme-button-post-250" style='float: right; margin-left: 10px; margin-bottom: 5px; padding: 4px 0 2px 4px; background: #fff;'>
<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftecparatodos.com%2F2011%2F09%2F01%2Fsetting-up-test-driven-development-tdd-with-ruby-on-rails-and-mac-os-x-lion%2Ftweetmeme_alias%3Dhttp%3A%2F%2Fwp.me%2Fp1DRZ3-42%26tweetmeme_source%3D%E2%80%9Dgwerner%E2%80%9D"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftecparatodos.com%2F2011%2F09%2F01%2Fsetting-up-test-driven-development-tdd-with-ruby-on-rails-and-mac-os-x-lion%2F" height="61" width="51" /></a>
</div>
<p>Have you ever gone through the Ruby on Rails Tutorial (<a href="http://www.railstutorial.org">www.railstutorial.org</a>) by Michael Hartl?</p>
<p>It&#8217;s a great way to get your feet wet and start developing an application with RoR using your Mac OS X or Linux machine. The tutorial goes through a variety of RoR features, such as scaffolding, development of different controls, views and models, style sheets, security, resource creation, GitHub repositories, pushing your app to Heroku, among others.</p>
<p>The most interesting topic for me though was how easily test driven development (TDD) can be incorporated into your methodology, using free tools such as Rspec and Spork. It really is super powerful, especially for hacks such as myself, because your code is constantly being tested as you go. The coolest part of TDD is that it forces you to think about the results that you need before you actually write any code, because your first step is to write a failing test, which in turn forces you to think about use cases.</p>
<h2>How TDD works</h2>
<p>I found the following flow chart on Wikipedia and have seen the same chart in blog posts for different types of programming languages, which helped me understand what the thought process should look like.<br />
As you can see in the flowchart, the steps are pretty self explanatory:</p>
<p><a href="http://gregwernerdotcom.files.wordpress.com/2011/09/tdd_flowchart.png"><img class="alignnone size-medium wp-image-251" title="TDD Flowchart" src="http://gregwernerdotcom.files.wordpress.com/2011/09/tdd_flowchart.png?w=300&#038;h=215" alt="" width="300" height="215" /></a></p>
<p><strong>Add a test:</strong> the test should fail because you don&#8217;t have any code written. If it doesn&#8217;t fail either your test isn&#8217;t set up correctly or you have some code somewhere that allows it to pass. (Yeah, it happens).</p>
<p><strong>Write code so that your test passes:</strong> write your code so that the test passes. Since this is your first attempt at writing code so that the test passes, don&#8217;t worry about having your code perfect. By the way it&#8217;s always a good idea to add comments of what your methods do, its also helpful to reference what methods are being tested and where.</p>
<p><strong>Automate testing:</strong> the test should run every time you make a change and save your code. If you are using Spork, you may have to restart the server if you save your *.rb files, especially routes.rb.</p>
<p><strong>Refactor:</strong> this is the step when you make your code more efficient and eliminate duplicates. For example, method one may do some of what method two does, if you put them together your code will be easier to maintain. You can be relatively confident that as you refactor your code is ok as long as your tests pass.</p>
<p>Another good resource is the book &#8220;Test Driven Development: By Example&#8221; by Kent Beck, which also clarifies the steps you need to take to write code using TDD:</p>
<p>1. Never write a single line of code unless you have a failing automated test.<br />
2. Eliminate duplication.</p>
<h2>TDD with RoR</h2>
<p>Bringing this down to Ruby on Rails, first you have to set up Rspec, Autotest and Spork. The Rails Tutorial (www.railstutorial.org) offers detailed steps on how to get set up, here are the basics:</p>
<h3>Install Autotest:</h3>
<p>$ [sudo] gem install autotest -v 4.4.6<br />
$ [sudo] gem install autotest-rails-pure -v 4.1.2</p>
<h3>Install FS Event and Growl:</h3>
<p>$ [sudo] gem install autotest-fsevent -v 0.2.4<br />
$ [sudo] gem install autotest-growl -v 0.2.9</p>
<h3>Create .autotest file in you application root</h3>
<p>$ mate .autotest</p>
<p>require &#8216;autotest/growl&#8217;<br />
require &#8216;autotest/fsevent&#8217;</p>
<h3>Run Autotest:</h3>
<p>$ autotest</p>
<h3>Install Spork:</h3>
<p>Spork makes your testing more efficient. If you use the command Rspec every time you run your test, it loads the whole rails environment every time you run your test…that can get really heavy. The Spork server loads rails once, from that point forward you just run the tests automatically with auto test and don&#8217;t have to worry about the additional load that much. Plus your tests will run faster.</p>
<h3>Modify your Gemfile and run bundle install:</h3>
<p>$ mate .Gemfile</p>
<p>source &#8216;<a href="http://rubygems.org&#038;#8217" rel="nofollow">http://rubygems.org&#038;#8217</a>;</p>
<p>gem &#8216;rails&#8217;, &#8217;3.0.9&#8242;<br />
gem &#8216;sqlite3&#8242;, &#8217;1.3.3&#8242;</p>
<p>group :development do<br />
gem &#8216;rspec-rails&#8217;, &#8217;2.6.1&#8242;<br />
end</p>
<p>group :test do<br />
gem &#8216;rspec-rails&#8217;, &#8217;2.6.1&#8242;<br />
.<br />
.<br />
.<br />
gem &#8216;spork&#8217;, &#8217;0.9.0.rc8&#8242;<br />
end</p>
<p>$ bundle install</p>
<h3>Bootstrap Spork configuration:</h3>
<p>bundle exec spork &#8211;bootstrap</p>
<h3>Configure RSpec configuration file</h3>
<p>Edit spec/spec_helper.rb, so that Rails environment gets loaded only once in pre fork configuration block:</p>
<p>require &#8216;spork&#8217;</p>
<p>Spork.prefork do<br />
# Loading more in this block will cause your tests to run faster. However,<br />
# if you change any configuration or code from libraries loaded here, you&#8217;ll<br />
# need to restart spork for it take effect.<br />
ENV["RAILS_ENV"] ||= &#8216;test&#8217;<br />
require File.expand_path(&#8220;../../config/environment&#8221;, __FILE__)<br />
require &#8216;rspec/rails&#8217;</p>
<p># Requires supporting files with custom matchers and macros, etc,<br />
# in ./support/ and its subdirectories.<br />
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}</p>
<p>RSpec.configure do |config|<br />
# == Mock Framework<br />
#<br />
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:<br />
#<br />
# config.mock_with :mocha<br />
# config.mock_with :flexmock<br />
# config.mock_with :rr<br />
config.mock_with :rspec</p>
<p>config.fixture_path = &#8220;#{::Rails.root}/spec/fixtures&#8221;</p>
<p># If you&#8217;re not using ActiveRecord, or you&#8217;d prefer not to run each of your<br />
# examples within a transaction, comment the following line or assign false<br />
# instead of true.<br />
config.use_transactional_fixtures = true<br />
end<br />
end</p>
<p>Spork.each_run do<br />
end</p>
<h3>Run Spork, by default it&#8217;ll run on port 8989:</h3>
<p>$ bundle exec spork</p>
<p>That&#8217;s it. Start writing your failing tests, code and refactor, see how it goes!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregwernerdotcom.wordpress.com/250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregwernerdotcom.wordpress.com/250/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=250&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tecparatodos.com/2011/09/01/setting-up-test-driven-development-tdd-with-ruby-on-rails-and-mac-os-x-lion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a966e7ef571ffea6a0cf5d22cb162d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregwernerblog</media:title>
		</media:content>

		<media:content url="http://gregwernerdotcom.files.wordpress.com/2011/09/tdd_flowchart.png?w=300" medium="image">
			<media:title type="html">TDD Flowchart</media:title>
		</media:content>
	</item>
		<item>
		<title>Engaging your website users with content and website mascots</title>
		<link>http://tecparatodos.com/2011/08/26/engaging-your-website-users-with-content-and-website-mascots/</link>
		<comments>http://tecparatodos.com/2011/08/26/engaging-your-website-users-with-content-and-website-mascots/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 03:19:26 +0000</pubDate>
		<dc:creator>Greg Werner</dc:creator>
				<category><![CDATA[Negocios]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Google+]]></category>
		<category><![CDATA[search engine optimization]]></category>
		<category><![CDATA[Web Design and Development]]></category>
		<category><![CDATA[Web search engine]]></category>
		<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://tecparatodos.com/?p=242</guid>
		<description><![CDATA[Lateley we&#8217;ve been investing quite a bit of time into Search Engine Optimization (SEO) in order to create leads. Why? Well, it seems to be more effective and it&#8217;s definitely cheaper than buying real estate in a mag. Have you ever been to the airport news stand and to kill time you pick up a [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=242&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<div class="tweetmeme-button" id="tweetmeme-button-post-242" style='float: right; margin-left: 10px; margin-bottom: 5px; padding: 4px 0 2px 4px; background: #fff;'>
<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftecparatodos.com%2F2011%2F08%2F26%2Fengaging-your-website-users-with-content-and-website-mascots%2Ftweetmeme_alias%3Dhttp%3A%2F%2Fwp.me%2Fp1DRZ3-3U%26tweetmeme_source%3D%E2%80%9Dgwerner%E2%80%9D"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftecparatodos.com%2F2011%2F08%2F26%2Fengaging-your-website-users-with-content-and-website-mascots%2F" height="61" width="51" /></a>
</div>
<p>Lateley we&#8217;ve been investing quite a bit of time into Search Engine Optimization (SEO) in order to create leads. Why? Well, it seems to be more effective and it&#8217;s definitely cheaper than buying real estate in a mag.</p>
<p>Have you ever been to the airport news stand and to kill time you pick up a mag just because the picture looked cool? Perhaps it was the super duper car on the cover, or maybe it was that knock out from the opposite sex with little clothing. In any case what the magazine did was engage the emotional part of your brain (from what I gather its the hypothalamus that regulates this stuff) and it got you to read some of it, and if the content was good enough, you may have even bought the thing.</p>
<p>Here&#8217;s the mascot from Mail Chimp:</p>
<p><a href="http://gregwernerdotcom.files.wordpress.com/2011/08/mailchimp.jpg"><img class="alignnone size-medium wp-image-243" title="mailchimp" src="http://gregwernerdotcom.files.wordpress.com/2011/08/mailchimp.jpg?w=300&#038;h=180" alt="" width="300" height="180" /></a></p>
<p>Search engines however aren&#8217;t very emotional, don&#8217;t think we&#8217;re there yet. Search engines (a.k.a. Google, personally I&#8217;m not so interested in organic placement with Bing) love text and lots of it. Keywords, linked sites, references, fresh content. They even like keywords that are bold and underlined. They also like videos, images, and other types of content, as long as they are tagged correctly. Apparently they even measure how frequently you update your site, look at your URLs and who knows what else. So in order for you to position your website on the first page of Google&#8217;s results it&#8217;s important to update your website content frequently and consistently with relevant and fresh content. You also need to try to have other heavily trafficked sites link to yours.</p>
<p>Here&#8217;s a mascot from Silver Back:</p>
<p><a href="http://gregwernerdotcom.files.wordpress.com/2011/08/silverback.jpg"><img class="alignnone size-medium wp-image-244" title="silverback" src="http://gregwernerdotcom.files.wordpress.com/2011/08/silverback.jpg?w=300&#038;h=180" alt="" width="300" height="180" /></a></p>
<p>But, search engines don&#8217;t really care about how cute your website mascot is. But humans do! Once you find what you are looking for, its nice to see a site that engages your emotions, for better or for worse. But I bet if you did run into a site with a memorable website mascot and then ran into another site without one, you would remember the funny Buddha or soothing Silverback instead of site overloaded with content.</p>
<p>Once the user engages your site emotionally, it&#8217;s much easier to engage the user and set calls to action, such as registrations, free trials, downloads and perhaps even purchases.</p>
<p>It&#8217;s something that&#8217;s worked for us, hopefully it will work for you as well!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregwernerdotcom.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregwernerdotcom.wordpress.com/242/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=242&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tecparatodos.com/2011/08/26/engaging-your-website-users-with-content-and-website-mascots/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a966e7ef571ffea6a0cf5d22cb162d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregwernerblog</media:title>
		</media:content>

		<media:content url="http://gregwernerdotcom.files.wordpress.com/2011/08/mailchimp.jpg?w=300" medium="image">
			<media:title type="html">mailchimp</media:title>
		</media:content>

		<media:content url="http://gregwernerdotcom.files.wordpress.com/2011/08/silverback.jpg?w=300" medium="image">
			<media:title type="html">silverback</media:title>
		</media:content>
	</item>
		<item>
		<title>HP se re inventa &#8211; bye bye hardware</title>
		<link>http://tecparatodos.com/2011/08/19/hp-se-re-inventa-bye-bye-hardware/</link>
		<comments>http://tecparatodos.com/2011/08/19/hp-se-re-inventa-bye-bye-hardware/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 22:09:43 +0000</pubDate>
		<dc:creator>Greg Werner</dc:creator>
				<category><![CDATA[Negocios]]></category>
		<category><![CDATA[HewlettPackard]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[IPad]]></category>
		<category><![CDATA[Léo Apotheker]]></category>
		<category><![CDATA[Personal computer]]></category>
		<category><![CDATA[SAP AG]]></category>
		<category><![CDATA[WebOS]]></category>

		<guid isPermaLink="false">http://tecparatodos.com/?p=234</guid>
		<description><![CDATA[Como de costumbre esta mañana estuve viendo las noticias de tecnología y negocios, y boom! por todos lados habían notas sobre HP y su nueva estrategia. En general parece ser que los señores de Hewlett Packard están implementando la siguiente estrategia: Adiós hardware: como IBM, están con planes de vender su división de hardware, así [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=234&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<div class="tweetmeme-button" id="tweetmeme-button-post-234" style='float: right; margin-left: 10px; margin-bottom: 5px; padding: 4px 0 2px 4px; background: #fff;'>
<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftecparatodos.com%2F2011%2F08%2F19%2Fhp-se-re-inventa-bye-bye-hardware%2Ftweetmeme_alias%3Dhttp%3A%2F%2Fwp.me%2Fp1DRZ3-3M%26tweetmeme_source%3D%E2%80%9Dgwerner%E2%80%9D"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftecparatodos.com%2F2011%2F08%2F19%2Fhp-se-re-inventa-bye-bye-hardware%2F" height="61" width="51" /></a>
</div>
<p>Como de costumbre esta mañana estuve viendo las noticias de tecnología y negocios, y boom! por todos lados habían notas sobre HP y su nueva estrategia. En general parece ser que los señores de Hewlett Packard están implementando la siguiente estrategia:</p>
<ul>
<li>Adiós hardware: como IBM, están con planes de vender su división de hardware, así que &#8220;la PC es personal&#8221; se convertirá en &#8220;la PC será de otro&#8221;.</li>
<li>Hola software y servicios: anunciaron la compra de Autonomy (empresa dedicada a la minería y análisis de datos), esto encima de la compra de EDS hace un par de años.</li>
<li>Adiós WebOS: PAM =&gt; que en paz descanse. Sin tener a HP invirtiendo en este sistema operativo no hay duda que morirá.</li>
<li>La estrategia parece ser sólida pero mover un buque de petróleo no est tan facil, veremos si el nuevo CEO Apotheker puede ejecutar la nueva visión de la empresa. ¿De dónde viene Léo Apotheker? SAP.</li>
</ul>
<p>Algunos números que me llamaron la atención:</p>
<ul>
<li>Al día de hoy, SAP tiene una capitalización de mercado mayor a la de HP ($60 mil millones vs $49 mil millones de dólares, respectivamente)</li>
<li>HP es la empresa de tecnología con mas ventas del mundo, con $ 126 mil millones de dólares</li>
<li>El negocio de hardware de HP representa el 16% por ciento de sus ingresos. Ahora que han anunciado la venta de esta división de hardware, ¿qué empresa invertirá en sus equipos?</li>
<li>HP pagó $1.2 mil millones de dólares por Palm, y ahora están anunciando un end of life (oops!). No hay duda que el éxito de la iPad y el Android tuvieron que ver con su decisión de desistir con el WebOS.</li>
<li>HP es el líder en el mercado en la venta de PCs, con casi 15 millones de unidades, tienen, según Gartner, el 17.5% del mercado.</li>
</ul>
<p>Ya veremos que pasa con esta excelente empresa, a veces cuando todos critican y las noticias son tan negativas es cuando hay que comprar acciones.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gregwernerdotcom.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gregwernerdotcom.wordpress.com/234/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tecparatodos.com&#038;blog=24278645&#038;post=234&#038;subd=gregwernerdotcom&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tecparatodos.com/2011/08/19/hp-se-re-inventa-bye-bye-hardware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79a966e7ef571ffea6a0cf5d22cb162d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gregwernerblog</media:title>
		</media:content>
	</item>
	</channel>
</rss>
