<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Squarespace Site Server v5.11.81 (http://www.squarespace.com/) on Tue, 29 May 2012 18:38:11 GMT--><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>Journal</title><link>http://www.adamcarr.net/journal/</link><description></description><lastBuildDate>Sun, 25 Dec 2011 12:59:03 +0000</lastBuildDate><copyright></copyright><language>en-US</language><generator>Squarespace Site Server v5.11.81 (http://www.squarespace.com/)</generator><item><title>Nuget package posted for DotNetDesign.EntityFramework</title><category>development</category><category>development .net nuget EntityFramework EntityGenerator</category><dc:creator>Adam Carr</dc:creator><pubDate>Wed, 21 Dec 2011 00:31:06 +0000</pubDate><link>http://www.adamcarr.net/journal/2011/12/20/nuget-package-posted-for-dotnetdesignentityframework.html</link><guid isPermaLink="false">619503:7201319:14202728</guid><description><![CDATA[<p>I have been working on a library that I called EntityFramework (poor choice in namimg, I know) that creates smart objects that handle versioning, observation, persistance and support for deploying services that handle the repository operations over a <span class="caps">WCF </span>service interface. </p>

<p>This framework doesn't care what you use for your object store, it just establishes structure of your objects and their relationship with each other. It uses contract based development and depends highly on dependency injection and assumes the user will use some form of Inversion of Control container to facilitate the dependencies.</p>

<p>I have been working on this in a closed environment for a while but decided to open it up for others to use and provide feedback on if interest exists. There is a pretty steep learning curve though.</p>

<p>I have also created a set of entity generation tools using an <span class="caps">XML </span>document and a T4 template to generate a large portion of the partial interfaces and classes needed by the framework.</p>

<p>The git repository is located here:</p>

<ul>
<li><a href="https://github.com/adamcarr/DotNetDesign.EntityFramework">https://github.com/adamcarr/DotNetDesign.EntityFramework</a></li>
</ul>

<p>The nuget packages are called and located here:</p>

<ul>
<li><a href="https://nuget.org/packages/DotNetDesign.EntityFramework">DotNetDesign.EntityFramework</a></li>
<li><a href="https://nuget.org/packages/DotNetDesign.EntityFramework.EntityGenerator">DotNetDesign.EntityFramework.EntityGenerator</a></li>
</ul>

<p>Let me know your thoughts. It is my first public code offering so be gentle!!!</p>
]]></description><wfw:commentRss>http://www.adamcarr.net/journal/rss-comments-entry-14202728.xml</wfw:commentRss></item><item><title>Operating System Deficit Disorder</title><category>windows osx linux macbook thinkpad lenovo apple</category><dc:creator>Adam Carr</dc:creator><pubDate>Fri, 25 Nov 2011 05:01:41 +0000</pubDate><link>http://www.adamcarr.net/journal/2011/11/25/operating-system-deficit-disorder.html</link><guid isPermaLink="false">619503:7201319:13858418</guid><description><![CDATA[<p>Ok, so I seriously have a problem. My closest friends know that I have this problem and make fun of me quite often about it. I don't stick with an OS for very long before reformatting my system and starting over. I have installed every linux distro I can imagine (gentoo, [xu/u/ku]bunto, arch, openSuSE, fedora, mint, pinguy, etc), Windows [version number] and several hackintosh installs. I don't ever have to activate windows when I do a new install because I know I will end up re-installing within the next 30 days so why make the effort.</p>

<p>Is anyone else like this or is this pretty unique to me? I always have a reason for it. I switch from windows to something else because "The trackpad drivers are horrible" or "Ruby runs to slow". I switch from linux because "Everything is more complicated than it should be" from wireless drivers, waking up from sleep mode, supporting my graphics card the way I want or wanting to run visual studio. I have never attempted (that's not true, attempted once but failed quickly) turning my laptop into a hackintosh but have done it on my desktop at home many times. I have owned several macbooks over the years (a 13", 2 15"s and the most recent 17" thunderbolt). I truly love macbooks and regret selling them. I am a windows programmer by day and the justification for selling my latest was because I like running windows natively and wasn't happy with the bootcamp drivers for windows, specifically the trackpad support. I was sad to later find out that my new ThinkPad <span class="caps">W520 </span>has worse trackpad support than the macbook did. I just assumed that Lenovo would have better hardware driver support for windows considering that is their main market. Apple has an interest in supporting windows running on it's machines but not in it running perfectly.</p>

<p>So, I'm back to where I started. I have a very fast and functional ThinkPad <span class="caps">W520 </span>but the hardware support sucks. Who knows what tomorrow brings (as I am reinstalling Windows 7 after using PinguyOS for the last 2 days).</p>
]]></description><wfw:commentRss>http://www.adamcarr.net/journal/rss-comments-entry-13858418.xml</wfw:commentRss></item><item><title>Intersection of collection of arrays</title><category>rails ruby development</category><dc:creator>Adam Carr</dc:creator><pubDate>Tue, 22 Nov 2011 03:02:51 +0000</pubDate><link>http://www.adamcarr.net/journal/2011/11/21/intersection-of-collection-of-arrays.html</link><guid isPermaLink="false">619503:7201319:13819706</guid><description><![CDATA[<p>Ok, so tonight I was working on the Tags portion of this (my old site) site. I wanted to include a list of tags on the right side of the page. This is pretty typical of blogging engines. That part was easy for the most part. I then wanted to filter the posts on the main page based on the tag clicked. This too was pretty easy by just passing back the name of the tag and filtering. </p>

<p>Here is where the <strong>problems</strong> began. I thought to myself "Wouldn't it be cool if they were <em>filters</em>?". Think about it. If a user clicks on <strong>ruby</strong>, then I only show <strong>ruby</strong> posts. But what if a user only wants to see <strong>ruby</strong> and <strong>rails</strong> posts? Shouldn't be too difficult, right? Well, I was wrong. It took me quite some time to get the logic down on how I wanted the query to look. I wrestled with the Rails Query Engine for a while. I kind of expected more <em><strong>magic</strong></em> from it to be honest. I couldn't figure out how to have multiple <code>'tag.name = ?', tagname1</code> filters. I ended up opting to query for the associated post ids from a <code>Tag.where(...)</code> query and then finding the intersection of those post_ids.</p>

<p>Ok, now to the <em><strong><span class="caps">REAL PROBLEM</span></strong></em>. I had an array of arrays that I needed to find the intersection of. I assumed there would be a method available already to do this and as far as I know, there is, but I couldn't find one so here is what I came up with.</p>



<pre class="brush: ruby">
def intersect_arrays(arrays)
  result = []
  arrays.compact.each do |a|
    if result.empty?
      result = a
    else
      result = result &amp; a
    end
  end
  result
end
</pre>



<p>I wouldn't consider myself a seasoned Rubyist at this point so I wouldn't be surprised if there was either a method already available to do this or a better approach to doing this; but, it gets the job done for now. I did get the idea for handling this problem from the <a href="http://pullmonkey.com/2008/03/31/intersection-of-array-of-arrays-in-ruby/">PullMonkey.com</a> post. I didn't like the idea of using an inline eval method call so I created this method to get around it.</p>

<p>Another day, another problem, another hack.</p>
]]></description><wfw:commentRss>http://www.adamcarr.net/journal/rss-comments-entry-13819706.xml</wfw:commentRss></item><item><title>Ubuntu RVM Rails pre install</title><category>development</category><category>rails</category><category>ruby</category><category>rvm</category><category>ubuntu</category><dc:creator>Adam Carr</dc:creator><pubDate>Tue, 07 Jun 2011 02:03:17 +0000</pubDate><link>http://www.adamcarr.net/journal/2011/6/6/ubuntu-rvm-rails-pre-install.html</link><guid isPermaLink="false">619503:7201319:11717691</guid><description><![CDATA[<p>I have a weird issue where I wipe and re-install operating systems all the time. Because of this, I decided to create a shell script that will install all the prerequisites for rvm, install and configure rvm and then install rails. Currently, it is set to install rails --pre (currently Rails 3.1.rc1).</p>



<pre class="brush: shell">
#!/bin/bash

echo &quot;Installing dependencies&quot;

sudo apt-get install ruby curl bison build-essential autoconf zlib1g-dev libssl-dev libxml2-dev libreadline6-dev git-core subversion sqlite3

echo &quot;Installing RVM&quot;
bash &lt; &lt;(curl -s https://rvm.beginrescueend.com/install/rvm)

echo &quot;Configuring RVM&quot;
echo '[[ -s &quot;$HOME/.rvm/scripts/rvm&quot; ]] &amp;&amp; . &quot;$HOME/.rvm/scripts/rvm&quot; # Load RVM function' &gt;&gt; ~/.bashrc
source ~/.bashrc

echo &quot;Installing ruby 1.9.2-head&quot;
rvm install 1.9.2-head

echo &quot;Setting ruby 1.9.2-head as default&quot;
rvm use 1.9.2-head --default

echo &quot;Installing rails pre&quot;
gem install rails --pre --no-ri --no-rdoc
</pre>



<p>Just run </p>



<pre class="brush: shell">
source ubuntu_rvm_rails.sh
</pre>



<p>It will ask you for your sudo password and to confirm the installed dependencies.</p>
]]></description><wfw:commentRss>http://www.adamcarr.net/journal/rss-comments-entry-11717691.xml</wfw:commentRss></item><item><title>Subdomain routing with rails 3.1</title><category>development</category><category>heroku</category><category>rails</category><category>subdomain</category><dc:creator>Adam Carr</dc:creator><pubDate>Thu, 02 Jun 2011 03:32:53 +0000</pubDate><link>http://www.adamcarr.net/journal/2011/6/1/subdomain-routing-with-rails-31.html</link><guid isPermaLink="false">619503:7201319:11657808</guid><description><![CDATA[<p>I wanted to use subdomain based routing on my current rails 3.1rc project and was getting some very odd behavior. Everything locally worked great when I was using lvh.me to point to local host and using custom subdomains and routes. I used the tutorial found here <a href="http://asciicasts.com/episodes/221-subdomains-in-rails-3">http://asciicasts.com/episodes/221-subdomains-in-rails-3</a> to help me with everything and made my own unimportant changes as needed. When I pushed all this up to heroku's bamboo stack, I experienced quite a few errors, but mainly a TypeError (can't convert Symbol into String).</p>
<p>After trying to figure it out on my own, I contacted the heroku support team and they advised me to move it to the brand new cedar stack launched that morning. I did and still experienced the same issue. However, and this is where things really get weird, it stopped working locally. I was really shooting in the dark on this as I had no idea where the error was occurring. I wasn't sure if it was my code or something inside rails or what. After commenting out pretty much every piece of code I had written, I finally found the error.&nbsp;</p>
<p>At the bottom of the tutorial, he talks about setting the domain for the session cookie so that it is accessible on all domains. The problem is the symbol assigned to the domain key in the hash passed to the session_store method. I guess this worked in 3.0 but is broken in 3.1. By making the following change (setting the domain to your specific domain),&nbsp;everything started working as I expected.</p>
<p><script src="https://gist.github.com/1003892.js?file=subdomain_session_store.rb"></script></p>
<p>The problem here is that when I am testing locally, I have to remember to change this to lvh.me or set my hosts file to point my personal domain to 127.0.0.1. At least it is working agian.</p>]]></description><wfw:commentRss>http://www.adamcarr.net/journal/rss-comments-entry-11657808.xml</wfw:commentRss></item><item><title>Hosting with heroku</title><category>development</category><category>heroku</category><category>logs</category><category>rails</category><dc:creator>Adam Carr</dc:creator><pubDate>Mon, 30 May 2011 18:41:18 +0000</pubDate><link>http://www.adamcarr.net/journal/2011/5/30/hosting-with-heroku.html</link><guid isPermaLink="false">619503:7201319:11621981</guid><description><![CDATA[<p>I am working on a side project that uses Rails 3.1rc since I am just starting development. I know that it is pretty early on but heroku's platform is pretty well sandboxed for each application so I figured if I can get something up and running locally using thin and just gems installed via my gemfile, things would work fine on heroku. I did have to install 'pg' in order to get it to work with heroku's postgresql database, but that was it. Except now, everything seems to get processed successfully to the point where the log files say "Completed 200 OK in 7ms(...)" yet 2 lines later, it says TypeError (can't convert Symbol into String). It would be nice to get some line numbers or stack trace with the logs to identify where the error really occured. I know, I am trying to use their system with an RC product, but the point is still valid. Better logs, happier customers.</p>]]></description><wfw:commentRss>http://www.adamcarr.net/journal/rss-comments-entry-11621981.xml</wfw:commentRss></item><item><title>Incorrect facebook online friends count</title><dc:creator>Adam Carr</dc:creator><pubDate>Tue, 24 Feb 2009 20:45:05 +0000</pubDate><link>http://www.adamcarr.net/journal/2009/2/24/incorrect-facebook-online-friends-count.html</link><guid isPermaLink="false">619503:7201319:15836134</guid><description><![CDATA[<p></p>]]></description><wfw:commentRss>http://www.adamcarr.net/journal/rss-comments-entry-15836134.xml</wfw:commentRss></item><item><title>ASP.NET MVC 1.0 Release Candidate</title><dc:creator>Adam Carr</dc:creator><pubDate>Sat, 31 Jan 2009 19:40:03 +0000</pubDate><link>http://www.adamcarr.net/journal/2009/1/31/aspnet-mvc-10-release-candidate.html</link><guid isPermaLink="false">619503:7201319:15836135</guid><description><![CDATA[<p>Release of ASP.NET MVC RC1</p>]]></description><wfw:commentRss>http://www.adamcarr.net/journal/rss-comments-entry-15836135.xml</wfw:commentRss></item><item><title>Challenge of work-life balance</title><dc:creator>Adam Carr</dc:creator><pubDate>Sat, 03 Jan 2009 00:14:44 +0000</pubDate><link>http://www.adamcarr.net/journal/2009/1/3/challenge-of-work-life-balance.html</link><guid isPermaLink="false">619503:7201319:15836140</guid><description><![CDATA[<p>How do you maintain a good work-life balance while still be competitive as a programmer?</p>]]></description><wfw:commentRss>http://www.adamcarr.net/journal/rss-comments-entry-15836140.xml</wfw:commentRss></item><item><title>Blog Migration To WordPress</title><dc:creator>Adam Carr</dc:creator><pubDate>Sat, 27 Dec 2008 00:23:21 +0000</pubDate><link>http://www.adamcarr.net/journal/2008/12/27/blog-migration-to-wordpress.html</link><guid isPermaLink="false">619503:7201319:15836141</guid><description><![CDATA[<p>Talking about my recent migration from BlogEngine.NET to WordPress despite it being written in PHP and the security vulnerabilities it has.</p>]]></description><wfw:commentRss>http://www.adamcarr.net/journal/rss-comments-entry-15836141.xml</wfw:commentRss></item></channel></rss>
