<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Meseret Gebre &#187; Tips and Tricks</title>
	<atom:link href="http://meseretgebre.com/archives/category/tips-and-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://meseretgebre.com</link>
	<description></description>
	<lastBuildDate>Wed, 16 Nov 2011 04:42:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Quick Tip JavaScript strings to numbers</title>
		<link>http://meseretgebre.com/archives/quick-tip-javascript-strings-to-numbers/</link>
		<comments>http://meseretgebre.com/archives/quick-tip-javascript-strings-to-numbers/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 01:24:43 +0000</pubDate>
		<dc:creator>mez</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://meseretgebre.com/?p=222</guid>
		<description><![CDATA[This tip is really just different ways to convert strings to numbers. Did you know that the follow code works just fine: var string_to_number = &#34;10&#34; * &#34;10&#34;; // result 100 I thought that was cool, but funky right? Note, this does not work with the &#8220;+&#8221; operator. So a cool way to convert a [...]]]></description>
			<content:encoded><![CDATA[<p>This tip is really just different ways to convert strings to numbers. Did you know that the follow code works just fine:</p>
<pre class="brush: javascript">
var string_to_number = &quot;10&quot; * &quot;10&quot;; // result 100
</pre>
<p>I thought that was cool, but funky right? Note, this does not work with the &#8220;+&#8221; operator. So a cool way to convert a string into a number is to do the following cool trick:</p>
<pre class="brush: javascript">
var string_to_number = &quot;200&quot; - 0; // result 200 booyah!
</pre>
<p>That is it for this tip and trick. Let me know if you come across a neat tip.</p>
]]></content:encoded>
			<wfw:commentRss>http://meseretgebre.com/archives/quick-tip-javascript-strings-to-numbers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick Tip JavaScript concat operator</title>
		<link>http://meseretgebre.com/archives/quick-tip-javascript-concat-operator/</link>
		<comments>http://meseretgebre.com/archives/quick-tip-javascript-concat-operator/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 01:07:41 +0000</pubDate>
		<dc:creator>mez</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Concatting strings]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://meseretgebre.com/?p=214</guid>
		<description><![CDATA[JavaScript has string concatting built into the langauge for example. var hello = &#34;hel&#34; + &#34;lo&#34; This is not the interesting point I wanted to talk about. It actually gets more interesting on what happens when you concat string literals with numbers. For example: var x = &#34;33&#34; + 3 // result &#34;333&#34; Notice the [...]]]></description>
			<content:encoded><![CDATA[<p>JavaScript has string concatting built into the langauge for example.</p>
<pre class="brush: javascript">
var hello = &quot;hel&quot; + &quot;lo&quot;
</pre>
<p>This is not the interesting point I wanted to talk about. It actually gets more interesting on what happens when you concat<br />
string literals with numbers. For example:</p>
<pre class="brush: javascript">
var x = &quot;33&quot; + 3 // result &quot;333&quot;
</pre>
<p>Notice the above example the number 3 was concatted with the string &#8220;33&#8243; that result in the string &#8220;333&#8243;.<br />
However can you guess what would happen if the number came first? More importantly what happens in this next example:</p>
<pre class="brush: javascript">
var x = 3 + 3 + &quot;33&quot; // result &quot;633&quot;
</pre>
<p>This is entirely different if you had done the values in a different order, for example:</p>
<pre class="brush: javascript">
var x = &quot;33&quot; + 3 + 3; //result &quot;3333&quot;
</pre>
<p>So be careful with this gotcha.</p>
]]></content:encoded>
			<wfw:commentRss>http://meseretgebre.com/archives/quick-tip-javascript-concat-operator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysqld_safe not starting mysql5?</title>
		<link>http://meseretgebre.com/archives/mysqld_safe-not-starting-mysql5/</link>
		<comments>http://meseretgebre.com/archives/mysqld_safe-not-starting-mysql5/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 07:15:05 +0000</pubDate>
		<dc:creator>mez</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://meseretgebre.com/?p=195</guid>
		<description><![CDATA[MacPorts, mysql5, mysqld_safe]]></description>
			<content:encoded><![CDATA[<p>So I use macports to install mysql5 and when I was ready to start mysql using mysqld_safe, which is located:</p>
<pre class="brush: bash">
/opt/local/bin/
</pre>
<p>I ended getting a big error report which said something along the lines of:</p>
<pre class="brush: bash">
mkdir: /opt/local/var/run: No such file or directory
chown: /opt/local/var/run/mysql5: No such file or directory
chmod: /opt/local/var/run/mysql5: No such file or directory
</pre>
<p><strong>Solution</strong><br />
I solved this by doing the following:</p>
<ol>
<li>Make sure you have ran the following command after the install completes:
<pre class="brush: bash">
sudo /opt/local/lib/mysql5/bin/mysql_install_db  --user=mysql
</pre>
</li>
<li>Finally you have to do the following:
<pre class="brush: bash">
sudo mkdir /opt/local/var/run
sudo chmod g+w /opt/local/var/run/
sudo mkdir /opt/local/var/run/mysql5
sudo chown mysql /opt/local/var/run/mysql5/
</pre>
</li>
</ol>
<p>Now you should be able to start mysql with no problems! A little bonus is create alias for starting and stopping mysql. My MBP is running Snow Leopard so I edit:</p>
<pre class="brush: bash"> ~/.profile </pre>
<p>and add the following at the end of the file:</p>
<pre class="brush: bash">
alias mysqlstart=&#039;sudo /opt/local/bin/mysqld_safe5 &amp;&#039;
alias mysqlstop=&#039;/opt/local/bin/mysqladmin5 -u root -p shutdown&#039;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://meseretgebre.com/archives/mysqld_safe-not-starting-mysql5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

