<?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>Luke Berndt</title>
	<atom:link href="http://lukeberndt.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://lukeberndt.com</link>
	<description>I am kind of a big deal...</description>
	<lastBuildDate>Mon, 23 Apr 2012 17:27:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>WP_List_Table and an Extra Nonce</title>
		<link>http://lukeberndt.com/2012/wp_list_table-and-an-extra-nonce/</link>
		<comments>http://lukeberndt.com/2012/wp_list_table-and-an-extra-nonce/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 17:27:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lukeberndt.com/?p=121</guid>
		<description><![CDATA[I am working on a WordPress plugin. For part of it I am adding a Metabox onto the Post Edit screen in the admin section. However things stop working if I add a WP_List_Table. That is because by default the list table adds a _wpnonce field, even though there is already one there for the [...]]]></description>
			<content:encoded><![CDATA[<p>I am working on a WordPress plugin. For part of it I am adding a Metabox onto the Post Edit screen in the admin section. However things stop working if I add a WP_List_Table. That is because by default the list table adds a <b>_wpnonce</b> field, even though there is already one there for the Edit page.</p>
<p>This of course messes things up and prevents you from saving or updating. Not awesome. The field is output in the display_tablenav() function in the base list_table class. It looks like there has been <a href="http://core.trac.wordpress.org/ticket/18817">a fix submitted</a>, lets hope it gets into an upcoming version.</p>
<p>Until then, you can simply override the display_tablenav() function with a blank function or one that provides similar functionality.</p>
]]></content:encoded>
			<wfw:commentRss>http://lukeberndt.com/2012/wp_list_table-and-an-extra-nonce/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tilestream: Fixing interaction</title>
		<link>http://lukeberndt.com/2012/tilestream-fixing-interaction/</link>
		<comments>http://lukeberndt.com/2012/tilestream-fixing-interaction/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 18:54:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lukeberndt.com/?p=117</guid>
		<description><![CDATA[When I upgrade to a new version of Tilestream / Wax, apparently the method for adding interactivity change. Before I think it pulled some of the info from a JSON file. It can still do this, but my files seemed to include localhost versions of the server. Anyhow, long story short, you need to make [...]]]></description>
			<content:encoded><![CDATA[<p>When I upgrade to a new version of Tilestream / Wax, apparently the method for adding interactivity change. Before I think it pulled some of the info from a JSON file. It can still do this, but my files seemed to include localhost versions of the server. Anyhow, long story short, you need to make sure you specify a template in your TileJSON. To find this, request the TileJSON Tilestream serves up for your made:</p>
<p><b><i>http://server</i>/v2/<i>layer_name</i>.json</b></p>
<p>Now look for the template variable and add it into the TileJSON you define in your javascript file. Mine is:</p>
<p>template: &#8216;{{#__location__}}{{/__location__}}{{#__teaser__}}{{{name}}} &lt;/br&gt;\n{{{address}}}{{/__teaser__}}{{#__full__}}{{{permit_id}}}{{/__full__}}&#8217;,</p>
]]></content:encoded>
			<wfw:commentRss>http://lukeberndt.com/2012/tilestream-fixing-interaction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tilestream: Tiles not found</title>
		<link>http://lukeberndt.com/2012/tilestream-tiles-not-found/</link>
		<comments>http://lukeberndt.com/2012/tilestream-tiles-not-found/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 18:49:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Tilemill]]></category>
		<category><![CDATA[Tilestream]]></category>
		<category><![CDATA[Wax]]></category>

		<guid isPermaLink="false">http://lukeberndt.com/?p=115</guid>
		<description><![CDATA[I just upgraded to a newer version of Tilestream. Unfortunately after doing that, all my maps stopped working. When I went to my Tilestream UI, I was able to see that it was up and it was finding the MBTILE files. When I clicked on info, it became clear that the URL had changed. Instead [...]]]></description>
			<content:encoded><![CDATA[<p>I just upgraded to a newer version of Tilestream. Unfortunately after doing that, all my maps stopped working. When I went to my Tilestream UI, I was able to see that it was up and it was finding the MBTILE files. When I clicked on info, it became clear that the URL had changed. Instead of having it be <b>server/1.0.0/map</b> it was now <b>server/v2/map</b>.</p>
<p>However after fixing my URLs, it still wasn&#8217;t working. Turns out I also needed to switch the mapping scheme from TMS to XYZ in the tilejson. Definitely not a seamless upgrade and I didn&#8217;t really see this change documented anywhere. I am still trying to figure out what I need to change to make interactivity work.</p>
<p><a href="http://support.mapbox.com/discussions/tilestream/59-tiles-not-displaying-on-map">http://support.mapbox.com/discussions/tilestream/59-tiles-not-displaying-on-map</a></p>
<p style="text-transform: none; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font: 14px/20px DroidSans, Arial, sans-serif; color: #000000; font-family: DroidSans, Arial, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">In your <code style="text-transform: none !important; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #F1F1F1; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(221, 221, 221); border-right-color: rgb(221, 221, 221); border-bottom-color: rgb(221, 221, 221); border-left-color: rgb(221, 221, 221); border-image: initial; background-position: initial initial; background-repeat: initial initial;">tilejson</code> object, try changing the scheme to <code style="text-transform: none !important; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #F1F1F1; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(221, 221, 221); border-right-color: rgb(221, 221, 221); border-bottom-color: rgb(221, 221, 221); border-left-color: rgb(221, 221, 221); border-image: initial; background-position: initial initial; background-repeat: initial initial;">xyz</code> instead of <code style="text-transform: none !important; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #F1F1F1; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(221, 221, 221); border-right-color: rgb(221, 221, 221); border-bottom-color: rgb(221, 221, 221); border-left-color: rgb(221, 221, 221); border-image: initial; background-position: initial initial; background-repeat: initial initial;">tms</code> and let me know if that fixes the problem.</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://lukeberndt.com/2012/tilestream-tiles-not-found/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>node-xml2js causes &#8220;Can&#8217;t send headers&#8230;&#8221;</title>
		<link>http://lukeberndt.com/2012/node-xml2js-causes-cant-send-headers/</link>
		<comments>http://lukeberndt.com/2012/node-xml2js-causes-cant-send-headers/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 02:50:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lukeberndt.com/?p=113</guid>
		<description><![CDATA[Ugh! Turns out if you don&#8217;t use a new Parser for each request you end up exiting with &#8220;Error: Can&#8217;t set headers after they are sent.&#8221; Very annoying! https://github.com/visionmedia/express/issues/711]]></description>
			<content:encoded><![CDATA[<p>Ugh! Turns out if you don&#8217;t use a new Parser for each request you end up exiting with &#8220;Error: Can&#8217;t set headers after they are sent.&#8221;</p>
<p>Very annoying!</p>
<p><a href="https://github.com/visionmedia/express/issues/711">https://github.com/visionmedia/express/issues/711</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lukeberndt.com/2012/node-xml2js-causes-cant-send-headers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing NodePie on Ubuntu</title>
		<link>http://lukeberndt.com/2012/installing-nodepie-on-ubuntu/</link>
		<comments>http://lukeberndt.com/2012/installing-nodepie-on-ubuntu/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 21:06:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Node.JS]]></category>

		<guid isPermaLink="false">http://lukeberndt.com/?p=111</guid>
		<description><![CDATA[I was transferring my latest creation over to my hosted Ubuntu server and came across the most annoying error. I had to reinstall the NodePie module because it relies on compiled C code. I kept getting an error though about something called lib-expat. Anyhow, turns out you need to apt-get a new library: sudo apt-get [...]]]></description>
			<content:encoded><![CDATA[<p>I was transferring my latest creation over to my hosted Ubuntu server and came across the most annoying error. I had to reinstall the NodePie module because it relies on compiled C code. I kept getting an error though about something called lib-expat.<br />
Anyhow, turns out you need to apt-get a new library:<br />
sudo apt-get install libexpat1-dev</p>
<p>GitHub to the rescue:<a href="https://github.com/astro/node-xmpp/issues/33">https://github.com/astro/node-xmpp/issues/33</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lukeberndt.com/2012/installing-nodepie-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transferring from MongoDB to CouchDB</title>
		<link>http://lukeberndt.com/2011/transferring-from-mongodb-to-couchdb/</link>
		<comments>http://lukeberndt.com/2011/transferring-from-mongodb-to-couchdb/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 17:30:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lukeberndt.com/?p=98</guid>
		<description><![CDATA[So I wanted to move a larger number of records from MongoDB to CouchDB. Here are the basic steps I took: I  just wanted a selected number of fields (name, address, longitude, latitude) so I used mongoexport to put it into a JSON Array: ./mongoexport -d cookography -c places -f name,address,longitude,latitude -o test.json &#8211;jsonArray Both [...]]]></description>
			<content:encoded><![CDATA[<p>So I wanted to move a larger number of records from MongoDB to CouchDB. Here are the basic steps I took:</p>
<ol>
<li>I  just wanted a selected number of fields (name, address, longitude, latitude) so I used mongoexport to put it into a JSON Array:<br />
<strong>./mongoexport -d cookography -c places -f name,address,longitude,latitude -o test.json &#8211;jsonArray</strong></li>
<li>Both CouchDB &amp; MongoDB use _ID and MongoExport insists on adding it. However it does it in a way the CouchDB hates so I munge it:<br />
<strong>sed &#8216;s/_id/id/g&#8217; test.json &gt; tested.json</strong></li>
<li>Now you have to format your JSON Array so you can feed it the the REST interface of CouchDB. First add this to the beginning:<br />
<strong>(echo &#8216;{&#8220;docs&#8221;:&#8217;; cat tested.json) &gt; output.json</strong><br />
And then this to the end:<br />
<strong>echo &#8220;}&#8221; &gt;&gt; output.json</strong></li>
<li>Now send this to REST API for CouchDB:<strong>DB=&#8221;http://127.0.0.1:5984/places&#8221;</strong>
<p><strong>curl -d @output.json -X POST $DB/_bulk_docs  -H &#8220;Content-Type: application/json&#8221;</strong></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://lukeberndt.com/2011/transferring-from-mongodb-to-couchdb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a DIV inside a LI</title>
		<link>http://lukeberndt.com/2011/a-div-inside-a-li/</link>
		<comments>http://lukeberndt.com/2011/a-div-inside-a-li/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 03:11:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lukeberndt.com/2011/a-div-inside-a-li/</guid>
		<description><![CDATA[Suppose you want to have a bunches of DIVs contained inside of a List Item… AND you want them to not mess with the height of the List Item and appear as a line of text? Well then, take this sample HTML: And apply this CSS:]]></description>
			<content:encoded><![CDATA[<p>Suppose you want to have a bunches of DIVs contained inside of a List Item… AND you want them to not mess with the height of the List Item and appear as a line of text?</p>
<p>Well then, take this sample HTML:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;li&gt;
&lt;div class=&quot;inspection&quot;&gt;
&lt;div class=&quot;date&quot;&gt;&lt;a href=&quot;/report/1430/9115/&quot;&gt;9-16-2010&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;inspection-type&quot;&gt;License Renewal &lt;/div&gt;
&lt;div class=&quot;violations&quot;&gt;0 Violations&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
</pre>
<p>And apply this CSS:</p>
<pre class="brush: css; title: ; notranslate">
.inspection {

overflow: hidden;

vertical-align: middle;

display: inline-block;

}

li {

margin-left: 15px;

list-style-type: disc;

list-style-position: inside;

}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://lukeberndt.com/2011/a-div-inside-a-li/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostGres &#8211; PostGIS on OSX Lion</title>
		<link>http://lukeberndt.com/2011/postgres-postgis-on-osx-lion/</link>
		<comments>http://lukeberndt.com/2011/postgres-postgis-on-osx-lion/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 13:07:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lukeberndt.com/?p=82</guid>
		<description><![CDATA[I recently just wasted a lot of time trying to get PostGIS up and running on OSX Lion. I wanted to do this so I could pull in Open Street Map data for the DC region and then play with it in QGIS and import it into Tilemill. I will be the first to admit [...]]]></description>
			<content:encoded><![CDATA[<p>I recently just wasted a lot of time trying to get PostGIS up and running on OSX Lion. I wanted to do this so I could pull in Open Street Map data for the DC region and then play with it in QGIS and import it into<a href="http://mapbox.com/#/"> Tilemil</a>l. I will be the first to admit that this is a rather complex toolchain, but it shouldn&#8217;t have been as difficult as it was.</p>
<p>On the off chance I can save someone time, I will recap what I did&#8230; and some of the misstep.</p>
<p>My big misstep was trying to use the precompiled binaries from <a href="http://www.kyngchaos.com/software:postgres">KyngChaos</a>. While they work fine, the <a href="http://wiki.openstreetmap.org/wiki/Osm2pgsql">OSM importer</a> for PostGIS always SegFaulted when I tried running it against these versions. I even tried compiling the importer from source code and couldn&#8217;t get it work.</p>
<p>Here is what to do:</p>
<ol>
<li>Use Homebrew. It makes it easy to download and compile source code. You may need to get rid of old cruft you have previously downloaded. I had to remove MacPython and some old Frameworks. If you run &#8220;brew doctor&#8221; it will give you hints.</li>
<li>Install <a href="https://github.com/mxcl/homebrew/wiki/installation">Homebrew</a></li>
<li>Install PostGres, PostGIS and all dependancies: &#8216;brew install postgis&#8217;</li>
<li>Initialize the database. This will create a Database structure and a database user (&#8220;role&#8221;) that is the same as user Mac user name: &#8216;initdb /usr/local/var/postgres/&#8217;</li>
<li>Create a database for GIS stuff (Instead of Luke, use your OSX username): &#8216;createdb -U Luke -E utf8 gis&#8217;</li>
<li>Start the PostGres server &#8211; for some reason I needed to specify that it is running on localhost: &#8216;postgres -D /usr/local/var/postgres/ -h localhost&#8217;</li>
<li>Add the PostGIS stuff to the DB: &#8216;psql -d gis -U Luke -f /usr/local/share/postgis/postgis.sql&#8217; and also &#8216;psql -d gis -U Luke -f /usr/local/share/postgis/spatial_ref_sys.sql&#8217;</li>
<li>Awesome! Now you should have a PostGIS DB loaded up. Now time to install the importer: &#8216;brew install osm2pgsql&#8217;</li>
<li>It is going to fail. This is because you need to apply a <a href="https://github.com/mxcl/homebrew/issues/6399">patch to fix some inconsistency</a>. Big pain in the ass. To do that, download the patch from here: <a href="http://trac.openstreetmap.org/raw-attachment/ticket/3299/patch-build_geometry.cpp">http://trac.openstreetmap.org/raw-attachment/ticket/3299/patch-build_geometry.cpp</a></li>
<li>To apply the patch, use the patch command: &#8216;cd ~/Library/Caches/Homebrew/osm2pgsql&#8211;svn/&#8217; and then &#8216;patch -p0 &lt; ~/Downloads/patch-build_geometry.cpp&#8217;</li>
<li>Now try it again and it should work: &#8217;brew install osm2pgsql&#8217;</li>
<li>Awesome, almost there. Next step is to download some OSM data. Cloudmade makes it pretty easy. I grabbed the DC data from here: http://downloads.cloudmade.com/americas/northern_america/united_states/district_of_columbia#downloads_breadcrumbs</li>
<li>Goto where ever you downloaded your files to and run (replacing it with your OSM file): &#8216;osm2pgsql -U Luke -H localhost -d gis  district_of_columbia.osm&#8217;</li>
<li>TADA! All that wonderful data should be loaded into your PostGIS DB. Now open up QGIS and add in a PostGIS layer. Make sure you use your OSX Username as the username (Luke) and the PostGIS DB you just created (DB).</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://lukeberndt.com/2011/postgres-postgis-on-osx-lion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>JSDOM Memory leaks</title>
		<link>http://lukeberndt.com/2011/jsdom-memory-leaks/</link>
		<comments>http://lukeberndt.com/2011/jsdom-memory-leaks/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 06:07:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Node.JS]]></category>

		<guid isPermaLink="false">http://lukeberndt.com/2011/jsdom-memory-leaks/</guid>
		<description><![CDATA[JSDOM is a great little module for NodeJS which lets you parse a DOM on the server. The only problem is that it has a memory leak. Not a big deal if you are only going to instantiate a couple times. A little trickier if you are screen scraping and need to call it 1000s [...]]]></description>
			<content:encoded><![CDATA[<p>JSDOM is a great little module for NodeJS which lets you parse a DOM on the server. The only problem is that it has a memory leak. Not a big deal if you are only going to instantiate a couple times. A little trickier if you are screen scraping and need to call it 1000s of times. I luckily found a work around. Instead of creating a new window every time you want to parse some code, simply keep the same window around and switch what it is displaying:</p>
<p>From the <a href="https://groups.google.com/group/nodejs/browse_thread/thread/ea7f8e9c215962c9/8553c11f80c7ff36?lnk=raot&amp;fwc=1">google groups</a>:</p>
<p style="font-family: fixed-width, monospace; font-size: 12px; background-color: #FFFFFF;">I&#8217;m basically doing this:</p>
<p style="font-family: fixed-width, monospace; font-size: 12px; background-color: #FFFFFF;">var jsdom = require(&#8216;jsdom&#8217;);<br />
var document = jsdom.jsdom(&#8216;&lt;html&gt;&lt;body&gt;&#8217;);<br />
var window = document.createWindow();</p>
<p style="font-family: fixed-width, monospace; font-size: 12px; background-color: #FFFFFF;">var JQUERY_URL = &#8216;<a target="_blank" rel="nofollow" href="http://www.google.com/url?sa=D&amp;q=http://localhost/js/jquery-1.4.4.min.js%27%3B" style="color: #0000CC;">http://localhost/js/jquery-1.4.4.min.js&#8217;;</a></p>
<p style="font-family: fixed-width, monospace; font-size: 12px; background-color: #FFFFFF;">function foo(text) {<br />
document.innerHTML = &#8216;&lt;html&gt;&lt;body&gt;&#8217; + text;<br />
jsdom.jQueryify(window, JQUERY_URL, function() {<br />
var $ = window.$;<br />
console.log(document.innerHTML);<br />
});</p>
<p style="font-family: fixed-width, monospace; font-size: 12px; background-color: #FFFFFF;">
<div id="qhide_158966" class="qt" style="display: block; font-family: fixed-width, monospace; font-size: 12px; background-color: #FFFFFF;">
  }</p>
</div>
<p><span style="font-family: fixed-width, monospace; font-size: 12px; background-color: #FFFFFF;">setInterval(function() {</span><br />
<span style="font-family: fixed-width, monospace; font-size: 12px; background-color: #FFFFFF;">foo(&#8220;Text&#8221;);</span></p>
<p style="font-family: fixed-width, monospace; font-size: 12px; background-color: #FFFFFF;">
<div id="qhide_158967" class="qt" style="display: block; font-family: fixed-width, monospace; font-size: 12px; background-color: #FFFFFF;">
  }, 1000);</p>
</div>
<p><span style="font-family: fixed-width, monospace; font-size: 12px; background-color: #FFFFFF;">And the process&#8217; memory increases and eventually terminates. How do</span><br />
<span style="font-family: fixed-width, monospace; font-size: 12px; background-color: #FFFFFF;">you suggest I should reuse the DOM?</span></p>
<p style="font-family: fixed-width, monospace; font-size: 12px; background-color: #FFFFFF;">I am trying this for now:</p>
<p style="font-family: fixed-width, monospace; font-size: 12px; background-color: #FFFFFF;">function foo(text) {<br />
document.innerHTML = &#8216;&lt;html&gt;&lt;body&gt;&#8217; + text;<br />
if (!window.$) {<br />
jsdom.jQueryify(window, JQUERY_URL, function() {<br />
var $ = window.$;<br />
console.log(document.innerHTML);<br />
});<br />
} else {<br />
var $ = window.$;<br />
console.log(document.innerHTML);<br />
}</p>
<p style="font-family: fixed-width, monospace; font-size: 12px; background-color: #FFFFFF;">
<p><span style="font-family: fixed-width, monospace; font-size: 12px;">}</span></p>
]]></content:encoded>
			<wfw:commentRss>http://lukeberndt.com/2011/jsdom-memory-leaks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>For Looping jQuery Elements</title>
		<link>http://lukeberndt.com/2011/for-looping-jquery-elements/</link>
		<comments>http://lukeberndt.com/2011/for-looping-jquery-elements/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 17:23:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lukeberndt.com/2011/for-looping-jquery-elements/</guid>
		<description><![CDATA[When you get a jQuery object back from a selector, you general loop through all of the elements it contains using .each(). However I wanted to use a For Loop because I wanted to access a bunch of elements at once. I am scrapping a table and I might want to access multiple elements to [...]]]></description>
			<content:encoded><![CDATA[<p>When you get a jQuery object back from a selector, you general loop through all of the elements it contains using .each(). However I wanted to use a For Loop because I wanted to access a bunch of elements at once. I am scrapping a table and I might want to access multiple elements to pull data from.
</p>
<p>Figuring out how to do this was a little tricky. Luckily it is very easy to do:
</p>
<p><span style="font-family:Courier New; font-size:10pt">&lt;body&gt;<br/>  &lt;div&gt;&lt;/div&gt;<br/>  &lt;div&gt;&lt;/div&gt;<br/>  &lt;div&gt;&lt;/div&gt;<br/><br/>  &lt;div&gt;&lt;/div&gt;<br/>  &lt;div&gt;&lt;/div&gt;<br/>  &lt;div&gt;&lt;/div&gt;<br/>&lt;script&gt;<br/><br/>    $(&#8220;body&#8221;).find(&#8220;div&#8221;).eq(2).addClass(&#8220;blue&#8221;);<br/>&lt;/script&gt;<br />
</span></p>
<p>
 </p>
<p>Simply use .<a href="http://api.jquery.com/eq/">eq(index)</a> to access a particular element in the jQuery object.</p>
]]></content:encoded>
			<wfw:commentRss>http://lukeberndt.com/2011/for-looping-jquery-elements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

