<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for ramblings</title>
	<atom:link href="http://techore.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://techore.com</link>
	<description>come to your own conclusions</description>
	<lastBuildDate>Fri, 14 May 2010 12:26:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Adding javascript to symfony form field by Patrick</title>
		<link>http://techore.com/2009/11/adding-javascript-to-symfony-form-field/comment-page-1/#comment-63</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Fri, 14 May 2010 12:26:43 +0000</pubDate>
		<guid isPermaLink="false">http://techore.com/wp/?p=194#comment-63</guid>
		<description>@Suborno

here&#039;s the js that I use, it&#039;s not beautiful, but it works:

// handles overall function control
function filterBy(filter_type, result_type, filter_value, field, preshot, select_option)
{
	try
	{
		httpRequest = createFinalHttpRequest();
		if(httpRequest != null)
		{
	/*
	 * 	the two items commented out below are what need to be uncommented if you want
	 * 	asynchronous transfer.  
	 * 	A bug exists in the select box filtering when you trigger this event more than 
	 * 	once on a single event
	 * 
	 * 	(i.e.- New Location page, when user selects the Company, Division and Region
	 * 		are both automatically populated with appropriate options)
	 * 
	 */		
			var location = &#039;/activity/filter?filter_type=&#039; + filter_type + &#039;&amp;result_type=&#039; + result_type + &#039;&amp;filter_value=&#039; + filter_value;
			httpRequest.open(&quot;GET&quot;, location, false);
			httpRequest.send(null);
			
			if(httpRequest.readyState == 4)
			{
				if(httpRequest.status == 200)
				{
					var response_header = httpRequest.getResponseHeader(&quot;Content-Type&quot;);
					if(response_header.indexOf(&quot;text/xml&quot;) != -1 &#124;&#124; response_header.indexOf(&quot;application/xml&quot;) != -1)
					{
						var xml = httpRequest.responseXML;
						if(xml)
							var results = parseFilterResults(xml, result_type);
						if(!results)
							alert(&#039;There has been an error filtering the results&#039;);
						else
						{
							if(select_option)
								filterBox(field, results, select_option);
							else
								filterBox(field, results);
						}
					}
					else
						alert(&#039;Content is NOT xml;\nContent is: &#039; + httpRequest.getResponseHeader(&quot;Content-Type&quot;));
				}
			}
		}
		else
			alert(&quot;The http request is null!&quot;);
	}
	catch(err)
	{
		alert(&quot;There was an error filtering the &quot; + result_type + &quot;: &quot; + err);
		return false;
	}
	return true;

}

// creates the actual xml request to server
function createFinalHttpRequest()
{
	var xmlhttp;
	if (window.XMLHttpRequest)
	{
		// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp = new XMLHttpRequest();
	}
	else
	{
		// code for IE6, IE5
		try
		{
			xmlhttp = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);
		}
		catch(err)
		{
			try
			{
				xmlhttp = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
			}
			catch(er)
			{
				xmlhttp = null;
			}
		}
	}
	return xmlhttp;
}

// parses the returned xml and creates an array of the values
function parseFilterResults(xml, type)
{
	try
	{
		var results = new Array();
		switch(type)
		{
			case &#039;division&#039;:
				var divs 	= xml.getElementsByTagName(type);
				var ids 	= xml.getElementsByTagName(&#039;id&#039;);
				var names 	= xml.getElementsByTagName(&#039;name&#039;);
				for(var i=0;i&lt;divs.length;i++)
				{
					var id = ids[i].childNodes[0].nodeValue;
					var name = names[i].childNodes[0].nodeValue;
					results.push(new Array(id, name));
				}
				break;
			case &#039;region&#039;:
				var regs 	= xml.getElementsByTagName(type);
				var ids 	= xml.getElementsByTagName(&#039;id&#039;);
				var names 	= xml.getElementsByTagName(&#039;name&#039;);
				for(var i=0;i&lt;regs.length;i++)
				{
					var id = ids[i].childNodes[0].nodeValue;
					var name = names[i].childNodes[0].nodeValue;
					results.push(new Array(id, name));
				}
				break;
			case &#039;location&#039;:
				var locs 	= xml.getElementsByTagName(type);
				var ids 	= xml.getElementsByTagName(&#039;id&#039;);
				var names 	= xml.getElementsByTagName(&#039;name&#039;);
				for(var i=0;i&lt;locs.length;i++)
				{
					var id = ids[i].childNodes[0].nodeValue;
					try
					{
						var name = names[i].childNodes[0].nodeValue;
					}
					catch(ee)
					{
						var name = &quot;&quot;;						
					}
					results.push(new Array(id, name));
				}
				break;				
			case &#039;seismo&#039;:
				var seismos 	= xml.getElementsByTagName(type);
				var ids 		= xml.getElementsByTagName(&#039;id&#039;);
				var names 		= xml.getElementsByTagName(&#039;name&#039;);
				var lats 		= xml.getElementsByTagName(&#039;lat&#039;);
				var longs 		= xml.getElementsByTagName(&#039;long&#039;);
				for(var i=0;i&lt;seismos.length;i++)
				{
					var id 		= ids[i].childNodes[0].nodeValue;
					var name 	= names[i].childNodes[0].nodeValue;
					try
					{
						var lat 	= lats[i].childNodes[0].nodeValue;
						var long 	= longs[i].childNodes[0].nodeValue;
					}
					catch(e)
					{
						var lat 	= &quot;&quot;;
						var long 	= &quot;&quot;;
					}
					results.push(new Array(id, name, lat, long));
				}
				break;
			case &#039;activity&#039;:
				var activities 		= xml.getElementsByTagName(type);
				var ids				= xml.getElementsByTagName(&#039;id&#039;);
				var shot_numbers	= xml.getElementsByTagName(&#039;shot_number&#039;);
				for(var i=0;i&lt;activities.length;i++)
				{
					var id = ids[i].childNodes[0].nodeValue;
					try
					{
						var shot_number	= shot_numbers[i].childNodes[0].nodeValue;
					}
					catch(ee)
					{
						var shot_number = &quot;&quot;;
					}
					results.push(new Array(id, shot_number));
				}
			default:	// company
				break;
		}
	}
	catch(err)
	{
		alert(&quot;There was an error parsing the results: &quot; + err);
		return false;
	}
	return results;

}

// this removes all the options in the given box and adds all the new
// options in the options array
function filterBox(field, options, select_option)
{
	try
	{
		var updated_field = document.getElementById(field);
		removeAllOptions(updated_field, false);
		if(select_option)
			addSelectOption(updated_field, &quot;&quot;, &quot;Select an Option&quot;);
		for(var i=0;i&lt;options.length;i++)
			addSelectOption(updated_field, options[i][0], options[i][1]);
	}
	catch(err)
	{
		alert(&quot;There has been an erroring filtering the dropdown box: &quot; + err);
		return false;
	}
	return true;
}

// removes all options from a select box with the option 
// to add a single &#039;blank&#039; value option back
function removeAllOptions(sel_box, keep_blank)
{
	try
	{
		for(var i=sel_box.length-1;i&gt;=0;i--)
			sel_box.remove(i);
		if(keep_blank)
			addSelectOption(sel_box, &quot;&quot;, &quot;Select an Option&quot;);
	}
	catch(err)
	{
		alert(&quot;There has been an error removing options: &quot; + err);
		return false;
	}
	return true;
}

// adds an option to a select box
function addSelectOption(field, value, text)
{
	try
	{
		var opt = document.createElement(&quot;option&quot;);
		opt.text = text;
		opt.value = value;
		field.options.add(opt);
	}
	catch(err)
	{
		alert(&quot;There was an error adding an option: &quot; + err);
		return false;
	}
	return true;
}</description>
		<content:encoded><![CDATA[<p>@Suborno</p>
<p>here&#8217;s the js that I use, it&#8217;s not beautiful, but it works:</p>
<p>// handles overall function control<br />
function filterBy(filter_type, result_type, filter_value, field, preshot, select_option)<br />
{<br />
	try<br />
	{<br />
		httpRequest = createFinalHttpRequest();<br />
		if(httpRequest != null)<br />
		{<br />
	/*<br />
	 * 	the two items commented out below are what need to be uncommented if you want<br />
	 * 	asynchronous transfer.<br />
	 * 	A bug exists in the select box filtering when you trigger this event more than<br />
	 * 	once on a single event<br />
	 *<br />
	 * 	(i.e.- New Location page, when user selects the Company, Division and Region<br />
	 * 		are both automatically populated with appropriate options)<br />
	 *<br />
	 */<br />
			var location = &#8216;/activity/filter?filter_type=&#8217; + filter_type + &#8216;&#038;result_type=&#8217; + result_type + &#8216;&#038;filter_value=&#8217; + filter_value;<br />
			httpRequest.open(&#8220;GET&#8221;, location, false);<br />
			httpRequest.send(null);</p>
<p>			if(httpRequest.readyState == 4)<br />
			{<br />
				if(httpRequest.status == 200)<br />
				{<br />
					var response_header = httpRequest.getResponseHeader(&#8220;Content-Type&#8221;);<br />
					if(response_header.indexOf(&#8220;text/xml&#8221;) != -1 || response_header.indexOf(&#8220;application/xml&#8221;) != -1)<br />
					{<br />
						var xml = httpRequest.responseXML;<br />
						if(xml)<br />
							var results = parseFilterResults(xml, result_type);<br />
						if(!results)<br />
							alert(&#8216;There has been an error filtering the results&#8217;);<br />
						else<br />
						{<br />
							if(select_option)<br />
								filterBox(field, results, select_option);<br />
							else<br />
								filterBox(field, results);<br />
						}<br />
					}<br />
					else<br />
						alert(&#8216;Content is NOT xml;\nContent is: &#8216; + httpRequest.getResponseHeader(&#8220;Content-Type&#8221;));<br />
				}<br />
			}<br />
		}<br />
		else<br />
			alert(&#8220;The http request is null!&#8221;);<br />
	}<br />
	catch(err)<br />
	{<br />
		alert(&#8220;There was an error filtering the &#8221; + result_type + &#8220;: &#8221; + err);<br />
		return false;<br />
	}<br />
	return true;</p>
<p>}</p>
<p>// creates the actual xml request to server<br />
function createFinalHttpRequest()<br />
{<br />
	var xmlhttp;<br />
	if (window.XMLHttpRequest)<br />
	{<br />
		// code for IE7+, Firefox, Chrome, Opera, Safari<br />
		xmlhttp = new XMLHttpRequest();<br />
	}<br />
	else<br />
	{<br />
		// code for IE6, IE5<br />
		try<br />
		{<br />
			xmlhttp = new ActiveXObject(&#8220;Msxml2.XMLHTTP&#8221;);<br />
		}<br />
		catch(err)<br />
		{<br />
			try<br />
			{<br />
				xmlhttp = new ActiveXObject(&#8220;Microsoft.XMLHTTP&#8221;);<br />
			}<br />
			catch(er)<br />
			{<br />
				xmlhttp = null;<br />
			}<br />
		}<br />
	}<br />
	return xmlhttp;<br />
}</p>
<p>// parses the returned xml and creates an array of the values<br />
function parseFilterResults(xml, type)<br />
{<br />
	try<br />
	{<br />
		var results = new Array();<br />
		switch(type)<br />
		{<br />
			case &#8216;division&#8217;:<br />
				var divs 	= xml.getElementsByTagName(type);<br />
				var ids 	= xml.getElementsByTagName(&#8216;id&#8217;);<br />
				var names 	= xml.getElementsByTagName(&#8216;name&#8217;);<br />
				for(var i=0;i
<divs .length;i++)<br />
				{<br />
					var id = ids[i].childNodes[0].nodeValue;<br />
					var name = names[i].childNodes[0].nodeValue;<br />
					results.push(new Array(id, name));<br />
				}<br />
				break;<br />
			case 'region':<br />
				var regs 	= xml.getElementsByTagName(type);<br />
				var ids 	= xml.getElementsByTagName('id');<br />
				var names 	= xml.getElementsByTagName('name');<br />
				for(var i=0;i<regs.length;i++)<br />
				{<br />
					var id = ids[i].childNodes[0].nodeValue;<br />
					var name = names[i].childNodes[0].nodeValue;<br />
					results.push(new Array(id, name));<br />
				}<br />
				break;<br />
			case 'location':<br />
				var locs 	= xml.getElementsByTagName(type);<br />
				var ids 	= xml.getElementsByTagName('id');<br />
				var names 	= xml.getElementsByTagName('name');<br />
				for(var i=0;i<locs.length;i++)<br />
				{<br />
					var id = ids[i].childNodes[0].nodeValue;<br />
					try<br />
					{<br />
						var name = names[i].childNodes[0].nodeValue;<br />
					}<br />
					catch(ee)<br />
					{<br />
						var name = "";<br />
					}<br />
					results.push(new Array(id, name));<br />
				}<br />
				break;<br />
			case 'seismo':<br />
				var seismos 	= xml.getElementsByTagName(type);<br />
				var ids 		= xml.getElementsByTagName('id');<br />
				var names 		= xml.getElementsByTagName('name');<br />
				var lats 		= xml.getElementsByTagName('lat');<br />
				var longs 		= xml.getElementsByTagName('long');<br />
				for(var i=0;i<seismos.length;i++)<br />
				{<br />
					var id 		= ids[i].childNodes[0].nodeValue;<br />
					var name 	= names[i].childNodes[0].nodeValue;<br />
					try<br />
					{<br />
						var lat 	= lats[i].childNodes[0].nodeValue;<br />
						var long 	= longs[i].childNodes[0].nodeValue;<br />
					}<br />
					catch(e)<br />
					{<br />
						var lat 	= "";<br />
						var long 	= "";<br />
					}<br />
					results.push(new Array(id, name, lat, long));<br />
				}<br />
				break;<br />
			case 'activity':<br />
				var activities 		= xml.getElementsByTagName(type);<br />
				var ids				= xml.getElementsByTagName('id');<br />
				var shot_numbers	= xml.getElementsByTagName('shot_number');<br />
				for(var i=0;i<activities.length;i++)<br />
				{<br />
					var id = ids[i].childNodes[0].nodeValue;<br />
					try<br />
					{<br />
						var shot_number	= shot_numbers[i].childNodes[0].nodeValue;<br />
					}<br />
					catch(ee)<br />
					{<br />
						var shot_number = "";<br />
					}<br />
					results.push(new Array(id, shot_number));<br />
				}<br />
			default:	// company<br />
				break;<br />
		}<br />
	}<br />
	catch(err)<br />
	{<br />
		alert("There was an error parsing the results: " + err);<br />
		return false;<br />
	}<br />
	return results;</p>
<p>}</p>
<p>// this removes all the options in the given box and adds all the new<br />
// options in the options array<br />
function filterBox(field, options, select_option)<br />
{<br />
	try<br />
	{<br />
		var updated_field = document.getElementById(field);<br />
		removeAllOptions(updated_field, false);<br />
		if(select_option)<br />
			addSelectOption(updated_field, "", "Select an Option");<br />
		for(var i=0;i<options.length;i++)<br />
			addSelectOption(updated_field, options[i][0], options[i][1]);<br />
	}<br />
	catch(err)<br />
	{<br />
		alert("There has been an erroring filtering the dropdown box: " + err);<br />
		return false;<br />
	}<br />
	return true;<br />
}</p>
<p>// removes all options from a select box with the option<br />
// to add a single 'blank' value option back<br />
function removeAllOptions(sel_box, keep_blank)<br />
{<br />
	try<br />
	{<br />
		for(var i=sel_box.length-1;i>=0;i&#8211;)<br />
			sel_box.remove(i);<br />
		if(keep_blank)<br />
			addSelectOption(sel_box, &#8220;&#8221;, &#8220;Select an Option&#8221;);<br />
	}<br />
	catch(err)<br />
	{<br />
		alert(&#8220;There has been an error removing options: &#8221; + err);<br />
		return false;<br />
	}<br />
	return true;<br />
}</p>
<p>// adds an option to a select box<br />
function addSelectOption(field, value, text)<br />
{<br />
	try<br />
	{<br />
		var opt = document.createElement(&#8220;option&#8221;);<br />
		opt.text = text;<br />
		opt.value = value;<br />
		field.options.add(opt);<br />
	}<br />
	catch(err)<br />
	{<br />
		alert(&#8220;There was an error adding an option: &#8221; + err);<br />
		return false;<br />
	}<br />
	return true;<br />
}</divs>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Adding javascript to symfony form field by Suborno</title>
		<link>http://techore.com/2009/11/adding-javascript-to-symfony-form-field/comment-page-1/#comment-49</link>
		<dc:creator>Suborno</dc:creator>
		<pubDate>Tue, 11 May 2010 08:59:56 +0000</pubDate>
		<guid isPermaLink="false">http://techore.com/wp/?p=194#comment-49</guid>
		<description>Hi, 
I need this solution. Where is your filterBy() function? Can i get it?
I&#039;m stuck on that problem.

Thanks</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I need this solution. Where is your filterBy() function? Can i get it?<br />
I&#8217;m stuck on that problem.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on quickie: setting symfony datetime default by 456</title>
		<link>http://techore.com/2010/01/quickie-setting-symfony-datetime-default/comment-page-1/#comment-30</link>
		<dc:creator>456</dc:creator>
		<pubDate>Sun, 02 May 2010 05:41:10 +0000</pubDate>
		<guid isPermaLink="false">http://techore.com/wp/?p=243#comment-30</guid>
		<description>&lt;strong&gt;Olga&lt;a href=&#039;http://tuberkulez23.ru&#039; rel=&quot;nofollow&quot;&gt; &lt;/a&gt; &lt;a href=&#039;http://dorojka23.ru&#039; rel=&quot;nofollow&quot;&gt; &lt;/a&gt; &lt;a href=&#039;http://prometey23.ru&#039; rel=&quot;nofollow&quot;&gt; &lt;/a&gt;...&lt;/strong&gt;

Otkuda material ?&lt;a href=&#039;http://zevs77.ru&#039; rel=&quot;nofollow&quot;&gt; &lt;/a&gt; &lt;a href=&#039;http://afina23.ru&#039; rel=&quot;nofollow&quot;&gt; &lt;/a&gt; &lt;a href=&#039;http://alisa23.ru&#039; rel=&quot;nofollow&quot;&gt; &lt;/a&gt; &lt;a href=&#039;http://andromeda22.ru&#039; rel=&quot;nofollow&quot;&gt; &lt;/a&gt;...</description>
		<content:encoded><![CDATA[<p><strong>Olga<a href='http://tuberkulez23.ru' rel="nofollow"> </a> <a href='http://dorojka23.ru' rel="nofollow"> </a> <a href='http://prometey23.ru' rel="nofollow"> </a>&#8230;</strong></p>
<p>Otkuda material ?<a href='http://zevs77.ru' rel="nofollow"> </a> <a href='http://afina23.ru' rel="nofollow"> </a> <a href='http://alisa23.ru' rel="nofollow"> </a> <a href='http://andromeda22.ru' rel="nofollow"> </a>&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on future-proofing computers by SEO</title>
		<link>http://techore.com/2009/03/future-proofing-computers/comment-page-1/#comment-26</link>
		<dc:creator>SEO</dc:creator>
		<pubDate>Wed, 28 Apr 2010 01:12:18 +0000</pubDate>
		<guid isPermaLink="false">http://techore.com/wp/?p=98#comment-26</guid>
		<description>Thanks for another awesome post. I am rather sure this post has helped me save many hours of scrolling through other similar posts just to find what I was looking for. Keep up the good work: Thank you!</description>
		<content:encoded><![CDATA[<p>Thanks for another awesome post. I am rather sure this post has helped me save many hours of scrolling through other similar posts just to find what I was looking for. Keep up the good work: Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on hello clearwire! by Canal de Panama</title>
		<link>http://techore.com/2009/04/hello-clearwire/comment-page-1/#comment-24</link>
		<dc:creator>Canal de Panama</dc:creator>
		<pubDate>Mon, 26 Apr 2010 22:56:58 +0000</pubDate>
		<guid isPermaLink="false">http://techore.com/wp/?p=141#comment-24</guid>
		<description>I usually don&#039;t normally post on many Blogs, however I just has to say thank you... keep up the amazing work.  Ok regrettably its time to get to school.</description>
		<content:encoded><![CDATA[<p>I usually don&#8217;t normally post on many Blogs, however I just has to say thank you&#8230; keep up the amazing work.  Ok regrettably its time to get to school.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on IE 7 javascript bug by Brian</title>
		<link>http://techore.com/2009/11/ie-7-javascript-bug/comment-page-1/#comment-2</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Thu, 21 Jan 2010 03:06:05 +0000</pubDate>
		<guid isPermaLink="false">http://techore.com/wp/?p=191#comment-2</guid>
		<description>Hey Patrick - this is actually an easy one.

In IE you can NOT use .setAttribute() to set ANY event handlers.  Not onchange, onclick, onblur, onfocus, onkeyup, onmousedown, etc.

See here for details:
http://webbugtrack.blogspot.com/2007/08/bug-242-setattribute-doesnt-always-work.html

Then again it doesn&#039;t work on a whole pile of attributes...
like &quot;class&quot;, &quot;style&quot;, &quot;name&quot;, &quot;type&quot;, etc. but that&#039;s okay it isn&#039;t like you would ever want to set the name... or the style, or a class.

It just makes you want to cry.

I can&#039;t wait till I don&#039;t have to support IE anymore!

Brian</description>
		<content:encoded><![CDATA[<p>Hey Patrick &#8211; this is actually an easy one.</p>
<p>In IE you can NOT use .setAttribute() to set ANY event handlers.  Not onchange, onclick, onblur, onfocus, onkeyup, onmousedown, etc.</p>
<p>See here for details:<br />
<a href="http://webbugtrack.blogspot.com/2007/08/bug-242-setattribute-doesnt-always-work.html" rel="nofollow">http://webbugtrack.blogspot.com/2007/08/bug-242-setattribute-doesnt-always-work.html</a></p>
<p>Then again it doesn&#8217;t work on a whole pile of attributes&#8230;<br />
like &#8220;class&#8221;, &#8220;style&#8221;, &#8220;name&#8221;, &#8220;type&#8221;, etc. but that&#8217;s okay it isn&#8217;t like you would ever want to set the name&#8230; or the style, or a class.</p>
<p>It just makes you want to cry.</p>
<p>I can&#8217;t wait till I don&#8217;t have to support IE anymore!</p>
<p>Brian</p>
]]></content:encoded>
	</item>
</channel>
</rss>
