<?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>lejnieks &#187; Rants</title>
	<atom:link href="http://www.lejnieks.com/category/rants/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lejnieks.com</link>
	<description></description>
	<lastBuildDate>Fri, 29 Jan 2010 19:22:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Passing arguments to javascript&#8217;s setTimeout() method using closures</title>
		<link>http://www.lejnieks.com/2008/08/21/passing-arguments-to-javascripts-settimeout-method-using-closures/</link>
		<comments>http://www.lejnieks.com/2008/08/21/passing-arguments-to-javascripts-settimeout-method-using-closures/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 18:07:34 +0000</pubDate>
		<dc:creator>klejnieks</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[fckEditor]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://lejnieks.com/?p=30</guid>
		<description><![CDATA[Yesterday I ended up having to hack around FCKEditor a bit to &#8220;fine tune&#8221; it for a project im involved in. The problem was that the html text we needed from the editor was getting back to our app, I didnt touch the code at all except to add a console log (window.console.log()) and tada&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I ended up having to hack around FCKEditor a bit to &#8220;fine tune&#8221; it for a project im involved in. The problem was that the html text we needed from the editor was getting back to our app, I didnt touch the code at all except to add a console log (window.console.log()) and tada&#8230; it works now. Well it was aparent that the fckeditor was not getting to where i needed to get to fast enough.<br />
<span id="more-30"></span><br />
Javascript has a method setTimeout, which if you google this, youll find a bunch of related topics on setTimeout, setInterval, and clearTimeout etc&#8230; So I went with a setTimeout to simply call the next function i needed 1 millisecond later.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">...
<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span> doAlert<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
...
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> doAlert<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Great! that works&#8230; but wait, I need to pass it a few variables. No problem i figured i could just add them inline right?</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">...
<span style="color: #003366; font-weight: bold;">var</span> msg <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;Hello World&quot;</span><span style="color: #339933;">;</span>
setTimeout<span style="color: #009900;">&#40;</span> doAlert<span style="color: #009900;">&#40;</span>msg<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
...
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> doAlert<span style="color: #009900;">&#40;</span>msg<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>msg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Wrong. this wont work in IE which sadly enough we have to support, and my argument that everyone should use firefox or safari just doesnt ever seem to hold water in a big corporation.</p>
<p>So I googled around and came across a post on <a href="http://lists.evolt.org/archive/Week-of-Mon-20040705/161085.html" target="_blank">evolt</a> showing how to add in parameters using closures. Now im not advocating the usage of closures, but I figure in this case it would have to do. So in the end my routine looked a little something like this</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">...
<span style="color: #003366; font-weight: bold;">var</span> msg <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;Hello World&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> delay <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> doAlert<span style="color: #009900;">&#40;</span>msg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
setTimeout<span style="color: #009900;">&#40;</span>delay<span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
...
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> doAlert<span style="color: #009900;">&#40;</span>msg<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>msg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>this works like a champ on mac and windows in IE, FF, and safari.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejnieks.com/2008/08/21/passing-arguments-to-javascripts-settimeout-method-using-closures/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Dreamhost 4 days down and running&#8230;</title>
		<link>http://www.lejnieks.com/2008/03/27/dreamhost-server-down/</link>
		<comments>http://www.lejnieks.com/2008/03/27/dreamhost-server-down/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 02:11:50 +0000</pubDate>
		<dc:creator>klejnieks</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://lejnieks.com/?p=7</guid>
		<description><![CDATA[The short of of the long is this, I switched my server last week to dreamhost after hearing so many good things about their services. I have a few colleagues who are on their systems who raved about them, and well, i was drawn into it. So&#8230; made my payment, switched my dns, let it [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-8" href="http://lejnieks.com/2008/03/dreamhost-server-down/picture-15/"><img class="alignleft size-thumbnail wp-image-8" title="Dreamhost Server Down" src="http://lejnieks.com/wp-content/picture-15-150x150.png" alt="" width="150" height="150" /></a>The short of of the long is this, I switched my server last week to <a href="http://dreamhost.com" target="_blank">dreamhost</a> after hearing so many good things about their services. I have a few colleagues who are on their systems who raved about them, and well, i was drawn into it. So&#8230; made my payment, switched my dns, let it all propagate through, woke up next morning to find out that dreamhosts main file server has been down for over 1 week and because of this my website, email, and ftp were now all down too.</p>
<p><span id="more-7"></span></p>
<p>I understand downed systems are somewhat common place in this industry and inevitable, and I have been down this path many of times before. What surprises me, though, is that I ended up getting sold a service which was already down&#8230; They sold me a server that was crashed, down, broken, ruined. Ok, well again these things happen&#8230; so fix it, right?</p>
<p>Well thats where this all becomes a much more infuriating issue. It has been 1 week, the service is still down, and i have not heard back from anyone at Google nor <a href="http://dreamhost.com">Dreamhost</a>, no refund, no support, no response, no service.</p>
<p>you can watch the events unfold <a href="http://www.dreamhoststatus.com/2008/03/25/problem-with-central-services-panelwebmail-etc/" target="_blank">here</a></p>
<p><a rel="attachment wp-att-8" href="http://lejnieks.com/2008/03/dreamhost-server-down/picture-15/"><br />
</a></p>
<p>For those of you looking to move to dreamhost I strongly suggest against it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lejnieks.com/2008/03/27/dreamhost-server-down/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
