<?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>Penguin Geek &#187; Coding</title>
	<atom:link href="http://penguin-geek.org/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://penguin-geek.org</link>
	<description>Life, the Universe, and Everything... plus Penguins.</description>
	<lastBuildDate>Fri, 22 May 2009 17:53:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Florida Vacation 2008, Part I</title>
		<link>http://penguin-geek.org/2008/07/08/florida-vacation-2008-part-i/</link>
		<comments>http://penguin-geek.org/2008/07/08/florida-vacation-2008-part-i/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 04:52:01 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Memories]]></category>
		<category><![CDATA[Tweets]]></category>
		<category><![CDATA[Writings]]></category>
		<category><![CDATA[beach]]></category>
		<category><![CDATA[florida]]></category>
		<category><![CDATA[Key West]]></category>
		<category><![CDATA[traffic]]></category>
		<category><![CDATA[vacation]]></category>

		<guid isPermaLink="false">http://penguin-geek.org/?p=328</guid>
		<description><![CDATA[We arrived in the Keys on Saturday without too much incident. The trip was long as always but spread over 2 days, it seemed like more than forever. I think we&#8217;d just rather have drove through the night and gotten it over with. And why couldn&#8217;t Georgia have something worthwhile to look at along the [...]]]></description>
			<content:encoded><![CDATA[<p>We arrived in the Keys on Saturday without too much incident. The trip was long as always but spread over 2 days, it seemed like more than forever. I think we&#8217;d just rather have drove through the night and gotten it over with. And why couldn&#8217;t Georgia have something worthwhile to look at along the highway? We didn&#8217;t get into Florida on schedule due to road construction and the kids needing to pee at inopportune times. We had also planned to eat picnic-style for lunch but the weather would threaten with rain and thunder.</p>
<p>We got into Gainesville late in the evening and stopped for the night at a Days Inn. After a [good] night&#8217;s sleep (it was as good as it was going to get, frankly), we headed back on the road onto the turnpike. There was some traffic congestion when we first got onto US-1 but we did get to Steve&#8217;s before sunset. We even had time to relax in the pool before bed.</p>
<p><a href="http://penguin-geek.org/wp-content/uploads/hpim2326.jpg"><img class="alignright alignnone size-thumbnail wp-image-330" style="float: right; border: black 1px solid;" title="Veteran's Memorial Park, Little Duck Key" src="http://penguin-geek.org/wp-content/uploads/hpim2326-150x150.jpg" alt="" width="150" height="150" /></a><span id="more-328"></span>On Sunday, we went out to Veteran&#8217;s Memorial Park on Little Duck Key for a swim. The beach there is a really nice one. The shallow ridge goes on to what seems like forever. Steve took the boys out pretty far, I could hardly see them from the shore. They also enjoyed searching for shells and coral pieces near the shore. It wasn&#8217;t too hard as the &#8220;sand&#8221; there is pretty much made of broken coral and shells. The water was also very warm and was much to my liking. Weird as it sounds, I really do prefer warmer water to wade in than the more frigid water that public pools like to use. It&#8217;s a good beach and we&#8217;ll probably head back tomorrow.</p>
<p>Yesterday, the rain kind of ruined any plans to go out anywhere as most things down here require the great outdoors and sunny weather. After lunch, we came back to the house and relaxed a bit; the kids played some games and tried their best to practice different ways to get themselves upside down and so forth with handstands and cartwheels.</p>
<p>Today we did make it out of the house for most of the day. We went down to Key West and parked the van in at private garage so we could walk on Duval Street for a few hours. We stopped at the Hard Rock Cafe for some ice cream and water. Both were very nice to have on this hot day as it got to 94 degrees while we were out. I took a few pictures of the memorabilia and it was pretty awesome to be in the same room as the instruments and garments of these familiar rock legends. After the Hard Rock, we continued up Duval and checked out some souvenir shops. After a couple of hours, we walked back to the garage to find the passenger side door was open! Luckily nothing was missing. I&#8217;m guessing that one of the kids forgot to close it. Yeah, lucky there. We went along Whitehead Street to see the Southern-most Point and back onto US-1 heading north back to Big Pine Key.</p>
<p>We did get held up in a traffic jam on US-1 though at about mile marker 20. When there&#8217;s an accident on this road, it&#8217;s just a catastrophe as US-1 is the only road in and out of the Keys to the mainland. It is, for the most part, two lanes and bridges. The accident apparently started at 1:30pm and involved a dump truck spilling its entire load on a bridge. We had left Key West at 4:20pm and didn&#8217;t get back to Big Pine until about 6:45pm. Yeaaaah, that was fun. All part of the great adventure, I suppose. ^_^</p>
<p>Well, time for bed. More details on our exploits later this week.</p>
]]></content:encoded>
			<wfw:commentRss>http://penguin-geek.org/2008/07/08/florida-vacation-2008-part-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bring Your Child to Work Day</title>
		<link>http://penguin-geek.org/2007/04/27/bring-your-child-to-work-day/</link>
		<comments>http://penguin-geek.org/2007/04/27/bring-your-child-to-work-day/#comments</comments>
		<pubDate>Sat, 28 Apr 2007 03:20:31 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Memories]]></category>
		<category><![CDATA[Penguins]]></category>
		<category><![CDATA[Tweets]]></category>
		<category><![CDATA[Writings]]></category>

		<guid isPermaLink="false">http://penguin-geek.org/2007/04/27/bring-your-child-to-work-day/</guid>
		<description><![CDATA[Thursday was &#8220;Bring Your Child to Work Day&#8221;. This is the first year that I&#8217;ve been able to participate father-wise. The past years, I&#8217;ve participated on behalf of the company with our laptop teardowns. This year, they didn&#8217;t plan anything truly special which, I think, is kind of sad. Overall, the kids though that was [...]]]></description>
			<content:encoded><![CDATA[<p>Thursday was &#8220;Bring Your Child to Work Day&#8221;. This is the first year that I&#8217;ve been able to participate father-wise. The past years, I&#8217;ve participated on behalf of the company with our laptop teardowns. This year, they didn&#8217;t plan anything truly special which, I think, is kind of sad. Overall, the kids though that was the best thing, taking apart laptops. Something mom and dad would be fearful of them doing to their own equipment. Alas, there was nothing special planned. I brought Jacob with me in the morning and he spent the entire day, helping me out and asking questions about what I do all day.</p>
<p>The day was good. Jake thought it was cool that he got his own visitor badge at the security desk when <a rel="lightbox[byctwd07]" href="http://lh6.ggpht.com/_Z8bpGTOSEM0/SAFcgicSyBI/AAAAAAAAC0M/X2enKeGDRlk/s800/jake_4-26-07_2.jpg">we came in</a>. We went up to my cubicle and he was introduced to my coworkers. After taking part of my morning ritual of hot cocoa and daily origami, we set out via the <a rel="lightbox[byctwd07]" href="http://lh4.ggpht.com/_Z8bpGTOSEM0/SAFchCcSyCI/AAAAAAAAC0U/s6AsqyhSCv4/s800/jake_4-26-07_3.jpg">gerbil tubes</a> into the campus to work on a ticket. Jake did seem interested in what I was doing when I talked with our customers and I explained to him how we could fix the problem at hand. Afterwards, we went up to the hardware team&#8217;s area and my ex-team lead gave him a personal laptop teardown session. I had forgotten the camera at my desk or else I would have a picture of that. Well, tarter sauce.</p>
<p><span id="more-112"></span>We went back to my desk for a bit before lunch. For lunch we went down to our cafeteria where Jake was amazed at all of the different kinds of food we could choose from. He settled on some <a rel="lightbox[byctwd07]" href="http://lh6.ggpht.com/_Z8bpGTOSEM0/SAFciicSyEI/AAAAAAAAC0k/_IPLmYRwK-0/s800/jake_4-26-07_5.jpg">pepperoni pizza &amp; breadsticks</a>. Yum! It was a pretty big piece but he ate it all. After eating, I took him on a quick tour of the main campus buildings and the main courtyard, dodging <a rel="lightbox[byctwd07]" href="http://farm1.static.flickr.com/222/475141817_a4bc00ef84_d.jpg">goose pooh</a> as we walked.</p>
<p><a rel="lightbox[byctwd07]" href="http://lh6.ggpht.com/_Z8bpGTOSEM0/SAFcjicSyFI/AAAAAAAAC0s/8FOWONxOpjM/s800/jake_4-26-07_6.jpg"><img style="border: 1px solid #000" src="http://lh6.ggpht.com/_Z8bpGTOSEM0/SAFcjicSyFI/AAAAAAAAC0s/8FOWONxOpjM/s800/jake_4-26-07_6.jpg" alt="" width="400" height="300" /></a></p>
<p>In the afternoon, we went back out to the other end of campus to clean up some virus from someone&#8217;s PC. By that time, the cafeteria was giving out some free soft-serve ice cream sundaes to the kids so we headed there <a rel="lightbox[byctwd07]" href="http://lh4.ggpht.com/_Z8bpGTOSEM0/SAFckCcSyGI/AAAAAAAAC00/YRZc7JOz3FA/s800/jake_4-26-07_7.jpg">for a treat</a>. Most excellent. Back at my desk, Jacob told me that he didn&#8217;t have anything to hang off of his new lanyard that one of my coworkers gave him. Mine has my ID badge on it so I figured I would make him one of his own from a Post-It, markers, and a quick picture. I think it <a rel="lightbox[byctwd07]" href="http://lh6.ggpht.com/_Z8bpGTOSEM0/SAFclicSyII/AAAAAAAAC1E/Gt1NvolnoAg/s800/jake_4-26-07_9.jpg">came out pretty good</a>. Jacob loved it and it was a great addition to his report he was writing about his special day. He was sure to bring it to school today when he told his class about his day. His report was pretty complete with the badges and pictures. Overall, it was a good day and I hope he learned something. I can&#8217;t wait to do it again next year.</p>
]]></content:encoded>
			<wfw:commentRss>http://penguin-geek.org/2007/04/27/bring-your-child-to-work-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random C# &#8211; Active Directory</title>
		<link>http://penguin-geek.org/2006/10/10/random-c-active-directory/</link>
		<comments>http://penguin-geek.org/2006/10/10/random-c-active-directory/#comments</comments>
		<pubDate>Tue, 10 Oct 2006 20:20:15 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Geeky]]></category>

		<guid isPermaLink="false">http://penguin-geek.org/2006/10/10/random-c-active-directory/</guid>
		<description><![CDATA[Recently I&#8217;ve had to create a web form that would submit a request through our internal trouble ticket system. That part&#8217;s fine. It was the part where I needed to filter the requesting users according to a few criteria. In order to submit the form, the the user would need to be (1) on our [...]]]></description>
			<content:encoded><![CDATA[<p><span class="dropcap">R</span>ecently I&#8217;ve had to create a web form that would submit a request through our internal trouble ticket system.  That part&#8217;s fine.  It was the part where I needed to filter the requesting users according to a few criteria.  In order to submit the form, the the user would need to be (1) on our new domain, (2) based in a certain city, and (3) on certain email exchanges.  At first, I was thinking how I would accomplish this task.  <em>Active Directory!  Right!  That&#8217;s what ASP.Net is good for!  But how?&#8230;</em></p>
<p>I searched and searched.  I did find articles but the wording, bad grammar, and confusing posts made it a tad difficult to understand at first.  I asked a co-worker who actually had wrote a site that interacted with Active Directory.  Thank you, Matt, for getting me started on this.  The example code he gave me was very helpful and I found it was easier than I thought.  I tried it out and was overjoyed.  <em>There.  I can search AD and grab the account name with no problem!  But&#8230; What about the other properties I need for this project?  What are their names?</em> I scoured the Interweb in search for an answer to my plea: Where&#8217;s a list of all of the properties that I can access?  No luck at all.  All of my searches ended with the same old articles.  The fact turned out to be that all Directories are going to be different according to the infrastructure&#8217;s needs.  <em>Slap myself.  Duh.</em> Well then, back to the old coding board with me.<br />
<span id="more-71"></span></p>
<pre style="font-size: smaller"><code lang="c#">
Using System.DirectoryServices;  // Don't forget this at the top

private static String GetADInfo(String user)
{
   String output = "";
   // Fill in with your own LDAP domain path
   DirectorySearcher searcher = new DirectorySearcher(new DirectoryEntry(”LDAP://DC=“);
   searcher.Filter = “(&amp;(anr=” + user + “) (objectCategory=Person))”;
   SearchResult result = searcher.FindOne();

   try
   {
      if (result != null)
      {
         foreach (string key in result.Properties.PropertyNames)
         {
            foreach (object propValue in result.Properties[key])
            {
               output += key + ” = ” + propValue + ““;
            }
         }
      }
      else
      {
         output = “User ”" + user + “” does not exist in AD.”;
      }
   }
   catch (Exception e)
   {
      Response.Write(e.Message);
   }

   return output;
}

</code></pre>
<p>Assign that function to a text field on the page and it will output every single property AD will allow you to retrieve for a user account.  With all seven pages of results printed out, I was able to find the properties I needed to stick into:</p>
<p><code lang="c#">searcher.PropertiesToLoad.AddRange(new String[] { "property1", "property2" });</code></p>
<p>Sometimes you can&#8217;t find everything on the Internet and you have to figure it out yourself.  This project is looking good so far and I hope it works out.  At least I learned something.  Useful links for future reference:</p>
<ul style="margin-left: 15px; margin-bottom: 15px;">
<li><a href="http://www.codeproject.com/dotnet/QueryADwithDotNet.asp">Querying AD with .Net [codeproject.com]</a></li>
<li><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/dotnetadsearch.asp">Using System.DirectoryServices to search AD [msdn.microsoft.com]</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://penguin-geek.org/2006/10/10/random-c-active-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Losing my groove, one line of code at a time</title>
		<link>http://penguin-geek.org/2006/09/26/losing-my-groove-one-line-of-code-at-a-time/</link>
		<comments>http://penguin-geek.org/2006/09/26/losing-my-groove-one-line-of-code-at-a-time/#comments</comments>
		<pubDate>Tue, 26 Sep 2006 18:51:00 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://penguin-geek.org/2006/09/26/losing-my-groove-one-line-of-code-at-a-time/</guid>
		<description><![CDATA[Finding myself having to reference functions and routines more often nowadays. It may be that I am a little bit out of practice. I do a bit of programming at work for our internal department sites but my days are usually spent playing OS detective or battling spyware. Don&#8217;t get me wrong &#8211; I still [...]]]></description>
			<content:encoded><![CDATA[<p><span class="dropcap">F</span>inding myself having to reference functions and routines more often nowadays.  It may be that I am a little bit out of practice.  I do a bit of programming at work for our internal department sites but my days are usually spent playing OS detective or battling spyware.  Don&#8217;t get me wrong &#8211; I still have the programming theory down but having to google how to best implement something that seems simple enough is next to pathetic, right?  I honestly do not expect myself to memorize every single function and its parameters nor do I expect to remember the best ways to implement things that I have coded a month ago.  This morning I was trying to figure out how to reference the DOM using vbscript since I usually use javascript to do so.  I thought it was done the same way but it just was not working as the server was spitting out an error about the document object didn&#8217;t exist or some garbage.  Needless to say, I ended up tacking in some javascript to do the task instead.</p>
<p>Maybe I&#8217;m losing my touch.  Maybe I need more practice.  Maybe I&#8217;m just getting older and forgetting things is natural.  Maybe I do have <acronym title="variant Creutzfeldt-Jakob disease">vCJD</acronym> like the <acronym title="Community Blood Center">CBC</acronym> said I may have, and that I am slowly losing my mind (I know, not funny &#8211; too disturbing to think about actually).  Either way, I may just have to put up a flag outside my cubicle that says, &#8220;Sorry but I may suck today.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://penguin-geek.org/2006/09/26/losing-my-groove-one-line-of-code-at-a-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cookie-licious</title>
		<link>http://penguin-geek.org/2006/09/25/cookie-licious/</link>
		<comments>http://penguin-geek.org/2006/09/25/cookie-licious/#comments</comments>
		<pubDate>Mon, 25 Sep 2006 17:26:36 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://penguin-geek.org/2006/09/25/cookie-licious/</guid>
		<description><![CDATA[Drama continues for the web application that I commonly refer to as the stupid form. I did fix it way back when by forcing an Abandon() when the user submits the form, but nowadays we have been seeing the same problems but with people that go to the form and don&#8217;t submit anything. I just [...]]]></description>
			<content:encoded><![CDATA[<p><span class="dropcap">D</span>rama continues for the web application that I commonly refer to as the <em>stupid form</em>.  I did fix it <a href="http://penguin-geek.org/2006/06/30/spaghetti-code-and-meatballs/">way back when</a> by forcing an Abandon() when the user submits the form, but nowadays we have been seeing the same problems but with people that go to the form and don&#8217;t submit anything. I just knew once that I got around to it, I&#8217;d figure something out. Well, I&#8217;m hoping this will work.<br />
<img src="http://penguin-geek.org/wp-content/uploads/2006/09/cookie.jpg" alt="Yum... Cookie-licious" style="float: right" /></p>
<p>Since the content of the request was intact per user and only the user itself got mixed up when it created the ticket, I just resigned to not storing the user&#8217;s ID in the session with the rest of the information.  Instead, the form now creates a cookie.  That way, there really is no way for it to be mixed up with someone else&#8217;s ID since it&#8217;s only on the client.  I am hoping this will cure, at least, that particular ill.  If not, well&#8230; let&#8217;s not think about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://penguin-geek.org/2006/09/25/cookie-licious/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

