<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Nothing and Everything</title>
	<atom:link href="http://kevenker.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://kevenker.wordpress.com</link>
	<description>If I knew what this was about, I'd have a better title.</description>
	<lastBuildDate>Mon, 14 Nov 2011 21:10:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='kevenker.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Nothing and Everything</title>
		<link>http://kevenker.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://kevenker.wordpress.com/osd.xml" title="Nothing and Everything" />
	<atom:link rel='hub' href='http://kevenker.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Powershell script to delete a certificate</title>
		<link>http://kevenker.wordpress.com/2011/08/17/powershell-script-to-delete-a-certificate/</link>
		<comments>http://kevenker.wordpress.com/2011/08/17/powershell-script-to-delete-a-certificate/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 22:21:29 +0000</pubDate>
		<dc:creator>kevenker</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://kevenker.wordpress.com/?p=798</guid>
		<description><![CDATA[This is just a quick little script to delete a certificate using powershell. It&#8217;s not as flexible as one might want it to be but should get you started. Plus, it could be optimized a bit, but it gets the job done! You&#8217;ll notice the line: new-object System.Security.Cryptography.X509Certificates.X509Store "My","CurrentUser" The &#8220;My&#8221; is the StoreName (AddressBook, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=798&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is just a quick little script to delete a certificate using powershell. It&#8217;s not as flexible as one might want it to be but should get you started. Plus, it could be optimized a bit, but it gets the job done! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You&#8217;ll notice the line:</p>
<pre>new-object System.Security.Cryptography.X509Certificates.X509Store "My","CurrentUser"</pre>
<p>The &#8220;My&#8221; is the StoreName (AddressBook, AuthRoot, CertificateAuthority, Disallowed, My, Root, TrustedPeople, TrustedPublisher). See <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.storename.aspx">http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.storename.aspx</a> for more info.</p>
<p>&#8220;CurrentUser&#8221; is the StoreLocation with &#8220;CurrentUser&#8221; or &#8220;LocalMachine&#8221; the only two options at present. See <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.storelocation.aspx">http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.storelocation.aspx</a> for more info.</p>
<p>&nbsp;</p>
<pre>param
(
 [parameter(Mandatory=$true)][string]$certPattern
)
write-host "`nCertificate search pattern = '$certPattern'"
$store = new-object System.Security.Cryptography.X509Certificates.X509Store "My","CurrentUser"
$store.Open("ReadWrite")
$certs = $store.Certificates
foreach ($cert in $certs)
{
    if ($cert -like $certPattern)
    {
        write-host "Deleting: "$cert.Thumbprint $cert.Subject
        $store.Remove($cert)
    }
}
$store.Close()</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kevenker.wordpress.com/798/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kevenker.wordpress.com/798/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kevenker.wordpress.com/798/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kevenker.wordpress.com/798/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kevenker.wordpress.com/798/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kevenker.wordpress.com/798/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kevenker.wordpress.com/798/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kevenker.wordpress.com/798/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kevenker.wordpress.com/798/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kevenker.wordpress.com/798/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kevenker.wordpress.com/798/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kevenker.wordpress.com/798/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kevenker.wordpress.com/798/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kevenker.wordpress.com/798/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=798&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kevenker.wordpress.com/2011/08/17/powershell-script-to-delete-a-certificate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d589c10ea5131f5ec8fe3606bb5a7c7f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevenker</media:title>
		</media:content>
	</item>
		<item>
		<title>RAMROD 7/28/2011</title>
		<link>http://kevenker.wordpress.com/2011/08/01/ramrod-7282011/</link>
		<comments>http://kevenker.wordpress.com/2011/08/01/ramrod-7282011/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 01:12:04 +0000</pubDate>
		<dc:creator>kevenker</dc:creator>
				<category><![CDATA[Biking]]></category>

		<guid isPermaLink="false">http://kevenker.wordpress.com/?p=790</guid>
		<description><![CDATA[RAMROD: Ride Around Mount Rainier in One Day Short summary: this is a fun, but tough ride! RAMROD is Redmond Cycling Club’s premier riding event of the season. Far less “popular” (only in attendance) than the Flying Wheels ride in June, but holding far higher cache for riders who have completed it. Despite its fabled [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=790&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>RAMROD: Ride Around Mount Rainier in One Day</p>
<p>Short summary: this is a fun, but tough ride!</p>
<p>RAMROD is Redmond Cycling Club’s premier riding event of the season. Far less “popular” (only in attendance) than the Flying Wheels ride in June, but holding far higher cache for riders who have completed it. Despite its fabled toughness, these days, it sells out every year, with a waiting list of disappointed riders. The parks department limits it to just 800 riders.</p>
<p>My friend Steve Hastings and I headed down to Enumclaw Wednesday evening. RAMROD is done on Thursdays. After dinner at Quiznos, we stopped off at QFC to pick up some breakfast supplies. Steve was fine with Balance bars and the like but I like to eat more substantial things. So we got some milk and I got myself some turkey sandwich meat. It’s convenient that the place we stayed at, King’s Value Inn, has a mini-fridge to store food. Oh, and we got some chocolate milk too. Twin Brook Creamery has some really good chocolate milk!</p>
<p>After we arrived at our motel and unpacked, I did some prep work getting things packed for the next morning and then did a little internet surfing before going to bed. I slept a bit fitfully. The bed was harder than I am used to and I think I was a little amped up for the next morning.</p>
<p>We woke up to the phone ringing (our wake-up alarm) at 0330. I took a quick shower to really wake up and ate a quick breakfast (milk, cereal that I brought with and the turkey sandwich meat). Packing got a bit hurried as we moved a bit slower than we should have. Our goal was to arrive at the starting point at 0430, but we didn’t leave until just after 0434. Fortunately, it’s only about 10 minutes to the Enumclaw High School (the start and end point of the ride) so we weren’t that late. However, arriving even 15 minutes later than normal (for Steve) meant that parking was much, much harder. We had to do some searching to find a spot to park!</p>
<p>We got set up and headed for the starting line, making a quick pit-stop. Hint: the lines are for the toilets and not the urinals, so be sure to check. Plus, there’s a 2nd set of bathrooms further down the hallway which had much, much shorter lines.</p>
<p>0511 we were at start line ready to go. Unfortunately, Steve discovered he had 2 left-hand gloves so he went back to car to see if he could find a right-hand glove. He didn’t find a biking glove but did find a weightlifting glove so he was OK.</p>
<p>At 0516 we departed. There wasn’t much need for headlights after about 20 minutes as it started to get light pretty quickly. We paced behind a few different pacelines as we rode. We made good time, though I was trying to not to push too hard. I had a long ride ahead of me.</p>
<p>0632 @ mile 22.5, we did a quick stop at a port-o-potty at a Texaco in Kapowsin. While there we switched to dark lenses. The sun was clearly up and though there were some clouds it was getting bright quickly. We were back on the road at 0644.</p>
<p>We arrived at the Eatonville rest stop, the first official rest stop of the ride at 0721 @ 32.7 miles. There was a good crowd at the stop. Too early to have everybody spread out yet. They had some rather good scones for food, but, oddly, they only had the scones. No jam, butter, peanut butter or anything else besides simple water. I ate 2 scones. Steve didn’t eat a whole one. He wanted some extra stuff on his scone so it wasn’t that appetizing to him.</p>
<p>We were at the rest stop for about 20 minutes, which wasn’t bad, but was a bit longer than I really wanted.</p>
<p>From Eatonville, the road was gradually uphill, with occasional downhills thrown in. We were getting closer to Mt. Rainier park. The sun was up and the skies were clear and sunny but not too hot. It was a scenic ride. I was feeling good, even though we were mostly chugging up a gradual slope, but Steve was suffering. He still hadn’t recovered completely from his gall bladder surgery (and subsequent lack of training), so the mild grind uphill was getting to him and, in retrospect, I think his lack of eating hurt him too. Even if I’m not hungry, I force myself to eat and drink on a regular schedule. That helps me a great deal as it tends to prevent bonking (fairly easily solved by slamming a few gels) and dehydration (much more serious as it is hard to catch up once dehydrated).</p>
<p>We hit the Ashford Valley Grocery Store at 0902 @ mile 52.40, to avoid the official rest stop a few miles further up the road. Steve thinks it saves us time, but honestly, I think it’s a wash by the time you add in the lack of parallelism – we need to leave one person behind to watch the bikes when we buy supplies and go to the bathroom vs. both of us going for food and port-o-potties simultaneously at the official rest stops (better lines of sight to the bikes if nothing else).</p>
<p>We departed at 0930, so a 28 minute stop. Again, not ideal but this early in the ride, I didn’t stiffen up that quick. On STP, we had a couple of 40 minute breaks that just killed me from getting too cooled off. 29 minutes later (0959 @ mile 58.81), we rolled through the Mt. Rainier Park entrance! At that point, according to Steve (I didn’t check my watch) we had some 2400 feet of climbing already done! From there, the climbing began in earnest. For the next 65 minutes we climbed and climbed. At mile 65.15, we took a quick, 10 minute break at Longmire Inn. We’d covered 6.3 miles in 65 minutes, so you can see our average speed was around 6 miles an hour. Partly this was due to Steve not being 100%. I could have ridden a little faster but maybe a mile per hour faster max.</p>
<p>After Longmire Inn, we spent the next 75 minutes climbing up to Inspiration Point (just past the Paradise entrance). There’s a point where you’re riding and off to your right you see faster cyclists riding along the road several hundred feet above you. It’s slightly discouraging. I heard a few people groan when they realized how much more climbing there was. However, what the 1st timers don’t realize is that the next rest stop is right there too, so in the end, it wasn’t so bad.</p>
<p>We hit the Inspiration Point rest stop at 1203 @ mile 74.75). I felt good and was glad to have completed the climb of the first pass! We were there for about 20 minutes resting and admiring the sights before having the fun downhill section to the 2nd food stop: Box Canyon (1239 @ mile 82.43). It took 17 minutes to go 7.68 miles (avg. speed 27.1 miles per hour!). On the way down you have to be careful not to admire the scenery too much because it’s quite spectacular. I never notice on the way up – I’m too busy pedaling!</p>
<p>The food selection at Box Canyon was much better than the Eatonville stop. Fruit, potatoes, bagels with peanut butter, some rather dry cookies, and chocolate croissants (Steve’s particular favorite). While there, I noticed one young woman had a RAGNAR relay temporary tattoo on her arm. I asked if she’d done the relay (which was Friday – Saturday – just 5 days prior!) and she said yes, having run the equivalent of a marathon! Very impressive!</p>
<p>It seemed like we were there for a while, but looking at my log, we were at the rest stop for only 21 minutes! We left at 1300.</p>
<p>From Box Canyon, you climb for 3 miles to the top of Backbone Ridge. Even though it’s fairly steep, Backbone is sort of a bump in the road in comparison to what we’d just climbed. It took about 30 minutes to get to the top (I don’t have precise numbers for when we hit the peak). Then you have another fun downhill section. Again, you are greeted with some spectacular scenery though you can’t enjoy it too much as you have to watch the road!</p>
<p>1339 @ mile 93.07, we were at the bottom. We stopped at the Grove of the Patriarchs for a quick (11 minute) bathroom break. It’s less than a 1/2 mile to where you hit Hwy 123, which leads you to Cayuse pass.</p>
<p>Things start out nice enough. There’s lots of shady trees and the slope is very modest. And then, imperceptibly, the slope gets steeper and the trees start to get less shady. After a couple of miles you are on the real climb to Cayuse. This is the challenging pass! You’re 95, 96 miles into your ride, you have some 6000 feet of climbing on your legs, and you’re starting to hit the heat of the day and you have no shade. We were super-lucky this year. The heat was extremely modest. A few years ago, temps were pushing &gt;90 degrees, which must have been withering on this climb!</p>
<p>But the worst thing about the Cayuse Pass climb is its unrelenting nature. On most climbs, the slope increases, it decreases, it often even has (short) flat spots in it where you get a few moments to recover. Not on this climb! You set a grade and that’s it. For 9 miles! I chugged along at 6.1 miles an hour. Steve slowly fell behind so I tried not to go faster, though honestly, even had I been motivated, I could have only managed maybe 0.2 – 0.3 miles per hour faster. I found that going slower than 6 was actually harder for me than going 6 so I hoped Steve wouldn’t try to kill himself keeping up with me! Turns out he didn’t. In fact, he was starting to feel better – he was drinking more and his side-stitch from his gall bladder surgery 7 weeks prior was no longer bothering him.</p>
<p>I arrived at the Deer Creek water stop at 1440 @ mile 100.28. Boy was I glad for the rest break! Plus I was getting a bit low on water. There was no food. Just water. In my notes at this stop I wrote, “Cayuse is a bitch. Unrelenting hill. And long!”</p>
<p>I overheard the volunteers talking to one of the riders. The first rider arrived at Deer Creek around 1130! 3 hours ahead of Steve and I!</p>
<p>From Deer Creek, you still have 4 miles to the top. That doesn’t sound like much until you do the math and realize that 4 miles at 6 miles an hour is 40 minutes! Ugh! We departed the rest stop at 1453 (13 minute stop) and started our grind uphill. The rest break gives you a temporary burst of energy but then you quickly run out of steam. I really watched my odometer on this, counting down the distance and hoping that it really was 4 miles and not like 4.5 miles! I started to fade a bit and my 6.1 dropped down to 5.8 miles per hour.</p>
<p>I reached the top of Cayuse Pass at 1534 @ mile 104.34. So it was actually 4.06 miles, darn close to 4 miles! I was very happy to reach the top! They have a nice water stop at the top. My legs were a bit rubbery and I was feeling a little shaky. I ate some food and drank water waiting for Steve to arrive. Given how hard it was for me, I was a little worried about him. He showed up just a few minutes later and though tired said things went well and he felt OK.</p>
<p>Ride tip: Don’t spend too long at the Cayuse Pass stop. There’s food only 15 &#8211; 20 minutes away! Drink some water, eat a gel, enjoy the scenery and head out! You can rest on the way down! We burned up 20 minutes at the stop, only to stop again for another 27 minutes just 15 minutes later!</p>
<p>We departed at 1555 (21 minutes) and had a fast, fun coast down to the last official food stop. They warned of rough roads and to not go too fast, but actually there was only about ½ mile of bad road and they actually took the time to mark the big road hazards so you could see them! The rest was as good as any other downhill section I’d ridden.</p>
<p>I arrived at the Crystal Mountain lunch break [Deli Food Stop] at 1611 @ 112.61 (avg. 31.0 mph!) On the way down, my stomach started growling! I was hungry!! At the rest stop, I totally pigged out. I had a sandwich, a large bunch of grapes, a cookie, some other fruit, and multiple piles of potato chips. It was probably the potato chips that did me in. When we left, my stomach didn’t feel too good! Not like I was going to throw up or anything but just way too full! I wrote in my log, “I am going to be waddling the rest of the way!”</p>
<p>We left at 1648 (27 minutes – a bit too long for my taste) and enjoyed more downhill. As we got lower, the fabled headwinds began to make themselves felt. Steve says they were better this year than in past years. I’ll have to take his word for it! I pulled Steve for a while and then Steve took over and pulled for a while. My stomach didn’t feel very good so I couldn’t work as hard as I would have liked to. It was pretty amazing drafting though. Thanks to the headwinds and the moderate downhill slope, Steve was pedaling away and I was literally coasting, hitting my brakes to slow down! Never had that happen before!</p>
<p>Around mile 126 is the last stop: Greenwater. [Updated - The Deli Stop is the last official stop. Greenwater is a non-official, though popular, stop. Thanks Steve!] Though I “kinda sorta” needed to use the bathroom, I was feeling good overall (all that food was beginning to hit my bloodstream and I no longer felt bloated to boot!), we were making such good time, I had plenty of food and water left and Steve felt good too so we passed the Greenwater stop like our hair was on fire. Even with the headwinds, we’d been averaging 18 or 19 miles an hour and often were hitting 20+ on the steeper sections. It is almost literally all downhill from Cayuse to Enumclaw! Which is handy considering the headwinds! We had a guy drafting behind us for about 30 minutes but he dropped at the Deli Food Stop. Then we had something very fortuitous happen to us as we passed the stop. Just ahead was a small 4-person paceline. We caught up with them in short order, and settled in behind them. They were going a little slower than what we had been going, but it gave both of us a chance to rest. In the end, we were behind them for nearly an hour!</p>
<p>Turns out, we were thinking the same thing:  though we could have ridden faster than they were riding, with just 2 of us, it was unlikely we could have maintained the pace we’d been riding for the 80-90 minutes that it would have taken to finish the ride. So we just waited and rested. We both were prepared to pull, but some pacelines are suspicious of straphangers like us, so they cycled amongst the 3 male riders. The lone woman was apparently not feeling that strong because at one point, she was 2nd rider and actually dropped back to be the constant 4th rider. The slight increase in wind from being in 2nd place was wearing her out.</p>
<p>When we hit SE Mud Mountain Road (about 7 miles from the finish line) the paceline suddenly broke up. Since I was feeling pretty fresh (thanks to the long pull we’d gotten from the defunct paceline), and even moreso, motivated by really needing to go to the bathroom, I turned on the afterburners. We cranked along at a good clip. Mud Mountain road contains the last downhill section which I used as best I could (it’s a little rough with some sharp turns). After than you’re talking flat ground the rest of the way!</p>
<p>On the flats, I looked at my watch. We might be able to finish before 1840, which is the best arrival time Steve &amp; Denise ever did! So now I was doubly motivated! I pulled hard! About ½ mile out, Steve suggested that we slow down and take it easy to “cool down” for the finish line. I was having none of that! So he followed me in as fast as I could pedal.</p>
<p>We arrived at 1841. I had 148.69 miles on my odometer. Steve’s best time ever! This was my first one so if I’d finished it would have been my best time ever! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I was glad to be done, but even with that last ½ hour sprint in me, I didn’t feel too bad (especially after visiting the bathroom!) We enjoyed being lazy and I got an ice cream sandwich and bought a ride picture of myself (with Steve chugging along in the background!). Eventually, we packed up our bikes, and headed to Quiznos for dinner and then I got to relax while Steve drove us back to his place! Thanks Steve!</p>
<p>It’s funny. Right after finishing, I was thinking, “Wow, I don’t know if I’d want to do this every year, that was a tough ride!” But now that I’ve had 3 or 4 days to forget how tired I was, I would totally do it next year!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kevenker.wordpress.com/790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kevenker.wordpress.com/790/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kevenker.wordpress.com/790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kevenker.wordpress.com/790/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kevenker.wordpress.com/790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kevenker.wordpress.com/790/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kevenker.wordpress.com/790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kevenker.wordpress.com/790/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kevenker.wordpress.com/790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kevenker.wordpress.com/790/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kevenker.wordpress.com/790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kevenker.wordpress.com/790/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kevenker.wordpress.com/790/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kevenker.wordpress.com/790/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=790&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kevenker.wordpress.com/2011/08/01/ramrod-7282011/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d589c10ea5131f5ec8fe3606bb5a7c7f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevenker</media:title>
		</media:content>
	</item>
		<item>
		<title>Powershell error: A positional parameter cannot be found that accepts argument</title>
		<link>http://kevenker.wordpress.com/2011/06/14/powershell-error-a-positional-parameter-cannot-be-found-that-accepts-argument/</link>
		<comments>http://kevenker.wordpress.com/2011/06/14/powershell-error-a-positional-parameter-cannot-be-found-that-accepts-argument/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 22:05:24 +0000</pubDate>
		<dc:creator>kevenker</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://kevenker.wordpress.com/?p=771</guid>
		<description><![CDATA[One thing that is cool in C# is the params keyword. It allows you to have a arbitrary number of extra parameters, e.g.: private void MyFunction (string blah, params string[] lotsOfPossibleBlah) ... I had a powershell script that I wanted to extend with similar behavior. I wanted a couple of required parameters and then allow [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=771&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One thing that is cool in C# is the params keyword. It allows you to have a arbitrary number of extra parameters, e.g.:</p>
<pre style="padding-left:30px;"><span style="color:#3366ff;">private void MyFunction (string blah, params string[] lotsOfPossibleBlah) ...</span></pre>
<p>I had a powershell script that I wanted to extend with similar behavior. I wanted a couple of required parameters and then allow user to call with a unlimited list of optional parameters.</p>
<p>However, once you specify a parameter attribute, Powershell complains if you try to add extra parameters. So, for example, this works:</p>
<pre style="padding-left:30px;"><span style="color:#3366ff;">param </span><span style="color:#3366ff;">(</span><span style="color:#3366ff;">$a, </span><span style="color:#3366ff;">$b)</span></pre>
<pre style="padding-left:30px;"><span style="color:#3366ff;">write-host a= $a b= $b xtras= $args</span></pre>
<pre style="padding-left:30px;"><span style="color:#339966;">.\foo.ps1 1 2 3 4 </span>
<span style="color:#339966;">a= 1 b= 2 xtras= 3 4</span></pre>
<p>This does NOT work:</p>
<pre style="padding-left:30px;"><span style="color:#3366ff;">param</span>
<span style="color:#3366ff;">(</span>
<span style="color:#3366ff;">    [parameter(Mandatory=$true)][string]$a,</span>
<span style="color:#3366ff;">    [parameter(Mandatory=$true)][string]$b</span>
<span style="color:#3366ff;">)</span></pre>
<pre style="padding-left:30px;"><span style="color:#3366ff;">write-host a= $a b= $b xtras= $args</span></pre>
<pre style="padding-left:30px;"><span style="color:#339966;">.\foo.ps1 1 2 3 4</span>
<span style="color:#ff0000;">D:\foo.ps1 : A positional parameter cannot be found that accepts argument '3'.</span>
<span style="color:#ff0000;">At line:1 char:10</span>
<span style="color:#ff0000;">+ .\foo.ps1 &lt;&lt;&lt;&lt;  1 2 3 4 </span>
<span style="color:#ff0000;">    + CategoryInfo          : InvalidArgument: (:) [foo.ps1], ParameterBindingException</span>
<span style="color:#ff0000;">    + FullyQualifiedErrorId : PositionalParameterNotFound,foo.ps1</span></pre>
<p>Argh. Very annoying. Nothing in the docs, ebooks, etc. that I&#8217;ve read mention this gotcha. Their examples just work because they don&#8217;t add any attributes to their parameter list. After an hour of poking around and prodding, I finally found a list of Powershell attributes you could add to a parameter (<a href="http://msdn.microsoft.com/en-us/library/ms714348(VS.85).aspx">http://msdn.microsoft.com/en-us/library/ms714348(VS.85).aspx)</a> which saved the day. It is the attribute <strong>ValueFromRemainingArguments</strong>. This tells the parameter to grab all the remaining arguments into an array, so you get behavior just like the $args param. In fact, you can name this paramer $args, though in the example below, I named it $xtras just so there would be no confusion about the actual origin of the values.</p>
<p>So now this works, and is exactly the behavior I wanted. 2 required parameters and an optional number of extra parameters.</p>
<pre style="padding-left:30px;"><span style="color:#3366ff;">param </span>
<span style="color:#3366ff;">(</span>
<span style="color:#3366ff;">    [parameter(Mandatory=$true)][string]$a, </span>
<span style="color:#3366ff;">    [parameter(Mandatory=$true)][string]$b,</span>
<span style="color:#3366ff;">    [parameter(ValueFromRemainingArguments=$true)]$xtras</span>
<span style="color:#3366ff;">)</span></pre>
<pre style="padding-left:30px;"><span style="color:#3366ff;">write-host a= $a b= $b xtras= $xtras</span></pre>
<pre style="padding-left:30px;"><span style="color:#339966;">.\foo.ps1 1 2 3 4 </span>
<span style="color:#339966;">a= 1 b= 2 xtras= 3 4</span></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kevenker.wordpress.com/771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kevenker.wordpress.com/771/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kevenker.wordpress.com/771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kevenker.wordpress.com/771/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kevenker.wordpress.com/771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kevenker.wordpress.com/771/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kevenker.wordpress.com/771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kevenker.wordpress.com/771/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kevenker.wordpress.com/771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kevenker.wordpress.com/771/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kevenker.wordpress.com/771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kevenker.wordpress.com/771/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kevenker.wordpress.com/771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kevenker.wordpress.com/771/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=771&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kevenker.wordpress.com/2011/06/14/powershell-error-a-positional-parameter-cannot-be-found-that-accepts-argument/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d589c10ea5131f5ec8fe3606bb5a7c7f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevenker</media:title>
		</media:content>
	</item>
		<item>
		<title>Moon</title>
		<link>http://kevenker.wordpress.com/2011/01/13/moon/</link>
		<comments>http://kevenker.wordpress.com/2011/01/13/moon/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 20:57:27 +0000</pubDate>
		<dc:creator>kevenker</dc:creator>
				<category><![CDATA[TV/Movies]]></category>

		<guid isPermaLink="false">http://kevenker.wordpress.com/?p=763</guid>
		<description><![CDATA[I saw Moon the other night on my Blu-Ray DVD player (that Stacy bought me for Christmas!) through Netflix. Yes, very cool technology to be able to watch Netflix on the DVD player. I am glad that this was the first movie as I really liked this movie. Moon is about one guy, Sam Bell (Sam [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=763&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I saw <a href="http://www.imdb.com/title/tt1182345/">Moon</a> the other night on my Blu-Ray DVD player (that Stacy bought me for Christmas!) through Netflix. Yes, very cool technology to be able to watch Netflix on the DVD player. I am glad that this was the first movie as I really liked this movie. Moon is about one guy, Sam Bell (<a href="http://www.imdb.com/name/nm0005377/">Sam Rockwell</a>) who is on a Helium-3 mining outpost on the far side of the moon. The place is so automated that it needs only 1 person to manage.</p>
<p>For 3 years, Sam has been alone with just a robot, GERTY, for company. Sam is getting a bit restless to get back to his wife and child after the end of his 3 year contract. Unfortunately, while checking up on one of the robotic mining units, he has an accident. To say more would ruin the story, though I have to say I knew the basic plot outline before seeing it and I still greatly enjoyed it.</p>
<p>This movie is good in part because it so unusual. There are no aliens and for the most part, no super-futuristic technology (with 1 exception). This is a movie where technology serves the characters and not the other way around. And I thought it was well-written. The plot is quite intriguing and makes you think. You don&#8217;t get spoon-fed with this one. There are no &#8220;reveals&#8221; to explain what is happening. What Sam sees is what you see. Actually there are maybe 2 scenes where this isn&#8217;t true but it&#8217;s at the end of the movie where it doesn&#8217;t matter. You can already figure out what is going to happen.</p>
<p>I also really liked the musical score of this movie.</p>
<p>This is what science fiction was really meant to be. An exploration/reflection of the human condition.</p>
<p>8/10</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kevenker.wordpress.com/763/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kevenker.wordpress.com/763/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kevenker.wordpress.com/763/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kevenker.wordpress.com/763/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kevenker.wordpress.com/763/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kevenker.wordpress.com/763/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kevenker.wordpress.com/763/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kevenker.wordpress.com/763/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kevenker.wordpress.com/763/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kevenker.wordpress.com/763/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kevenker.wordpress.com/763/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kevenker.wordpress.com/763/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kevenker.wordpress.com/763/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kevenker.wordpress.com/763/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=763&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kevenker.wordpress.com/2011/01/13/moon/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d589c10ea5131f5ec8fe3606bb5a7c7f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevenker</media:title>
		</media:content>
	</item>
		<item>
		<title>Unstoppable</title>
		<link>http://kevenker.wordpress.com/2010/11/26/unstoppable/</link>
		<comments>http://kevenker.wordpress.com/2010/11/26/unstoppable/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 20:24:57 +0000</pubDate>
		<dc:creator>kevenker</dc:creator>
				<category><![CDATA[TV/Movies]]></category>

		<guid isPermaLink="false">http://kevenker.wordpress.com/?p=756</guid>
		<description><![CDATA[I saw Unstoppable last night. If ever there is a movie that will make trains exciting, this is it. Combine decent acting with decent music and lots of shots with the camera sitting on the tracks and the train going over them (really fast!!) and you have a very watchable movie. I imagine this movie was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=756&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I saw <a title="IMDB link to Unstoppable" href="http://www.imdb.com/title/tt0477080/">Unstoppable</a> last night. If ever there is a movie that will make trains exciting, this is it. Combine decent acting with decent music and lots of shots with the camera sitting on the tracks and the train going over them (really fast!!) and you have a very watchable movie.</p>
<p>I imagine this movie was hard to pitch. &#8220;It&#8217;s a movie about trains (yawn). Only this one doesn&#8217;t have anybody on it! (OK&#8230; so what?) Only *this* train has a load full of dangerous chemicals! (Hmm&#8230; getting warmer&#8230;) And all attempts to stop it fail! (I guess that&#8217;s the &#8216;Unstoppable&#8217; part&#8230;) except for <a title="IMDB link to Denzel Washington" href="http://www.imdb.com/name/nm0000243/">Denzel Washington</a> (Ah! Now we&#8217;re talking!) and his young sidekick played by <a title="IMDB link to Chris Pine" href="http://www.imdb.com/name/nm1517976/">Chris Pine</a> (who?) &#8211; you know, the guy who was Captain Kirk on the new Star Trek movie (hmm&#8230; not sure if trains and spaceships have the same demographic&#8230; Nice, but still sounds boring&#8230;) We&#8217;ll we&#8217;re gonna do lots of shots of trains rumbling over the camera, and we&#8217;ll have close calls with head-ons with&#8230; other trains! And of course, we&#8217;ll have the train smashing things- but nothing big enough or heavy enough for it to derail! (Ooh! Smashing things. That&#8217;s sounding much better! &#8230; What about car chases? Everybody likes a good car chase!) Oh&#8230; well um&#8230; we&#8217;ve got that too! We have a guy who is chasing the train in big pickup truck! With a police escort! (So he&#8217;s gonna jump on the train and stop it?) Err&#8230; not exactly. He&#8217;s a welder. (A welder?) Yeah, but he works in the train maintenance department, so he&#8230; well he wants to stop the train really bad! (Why? Is a relative on board?) No. (Are his kids trapped on a bus sitting on the train tracks?) No. He just likes a challenge. (Oh&#8230;) Did I mention it&#8217;s got Denzel Washington? (Oh yeah? Sold!)</p>
<p>I&#8217;m sure it went exactly like that. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It may sound like I didn&#8217;t like the movie, but I did enjoy it. It was fun, if inconsequential. They did a good job with making things feel tense and making 70 miles per hour seem like it was fast. Do you need to see it in the theater? Probably not. One thing I was slightly disappointed by was that they didn&#8217;t play up the massively deep and powerful sounding diesel engines these trains have. Probably because most sound systems can&#8217;t do the sound justice.</p>
<p>It&#8217;s one of those movies that is quite enjoyable, eminently watchable but parts of it don&#8217;t really hold up under deep scrutiny. It&#8217;s a bit formulaic and clichéd on hindsight, but hides its pedestrian nature well. I&#8217;d definitely say it is worth renting. Even if you dont&#8217; like trains I think you&#8217;ll be entertained.</p>
<p>6/10</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kevenker.wordpress.com/756/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kevenker.wordpress.com/756/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kevenker.wordpress.com/756/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kevenker.wordpress.com/756/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kevenker.wordpress.com/756/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kevenker.wordpress.com/756/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kevenker.wordpress.com/756/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kevenker.wordpress.com/756/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kevenker.wordpress.com/756/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kevenker.wordpress.com/756/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kevenker.wordpress.com/756/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kevenker.wordpress.com/756/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kevenker.wordpress.com/756/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kevenker.wordpress.com/756/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=756&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kevenker.wordpress.com/2010/11/26/unstoppable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d589c10ea5131f5ec8fe3606bb5a7c7f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevenker</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows CMD parsing, preventing environment variable expansion inside quoted string</title>
		<link>http://kevenker.wordpress.com/2010/11/18/windows-cmd-parsing-preventing-environment-variable-expansion-inside-quoted-string/</link>
		<comments>http://kevenker.wordpress.com/2010/11/18/windows-cmd-parsing-preventing-environment-variable-expansion-inside-quoted-string/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 23:45:18 +0000</pubDate>
		<dc:creator>kevenker</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://kevenker.wordpress.com/?p=749</guid>
		<description><![CDATA[I have a console-based app that talks to a database. I wanted to set a particular field value to be the environment variable, not the value of the envrionment variable. For example: myapp -setdbvalue "User %USERNAME% is on %COMPUTERNAME%." So the string I want stored in the database is &#8220;User %USERNAME% is on %COMPUTERNAME%.&#8221;. However, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=749&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have a console-based app that talks to a database. I wanted to set a particular field value to be the environment variable, not the value of the envrionment variable. For example:</p>
<pre>myapp -setdbvalue "User %USERNAME% is on %COMPUTERNAME%."</pre>
<p>So the string I want stored in the database is &#8220;User %USERNAME% is on %COMPUTERNAME%.&#8221;.</p>
<p>However, if you call the above, you would end up with a string like: &#8220;User KEVENKER is on KILOTWO.&#8221; Definitely NOT the intended value. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>After about an hour of searching, I never found the definitive answer! However, I learned enough from reading <a href="http://stackoverflow.com" target="_blank">http://stackoverflow.com</a> posts and <a href="http://ss64.com/nt/" target="_blank">http://ss64.com/nt/</a> that I managed to come up with this solution:</p>
<pre>myapp -setdbvalue "User "%"USERNAME% is on "%"COMPUTERNAME%."</pre>
<p>So what happens here is that the cmd processer sees the following strings:</p>
<pre>"User " + "%" + "USERNAME% is on " + "%" + "COMPUTERNAME%."</pre>
<p>and simply concatenates these all together into one string when passing this argument to my program.</p>
<p>So there you have it. I hope this helps some hapless person. Hopefully the title will be good enough for searching. I&#8217;m sure this has been solved before but finding the solution is the hard part. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kevenker.wordpress.com/749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kevenker.wordpress.com/749/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kevenker.wordpress.com/749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kevenker.wordpress.com/749/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kevenker.wordpress.com/749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kevenker.wordpress.com/749/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kevenker.wordpress.com/749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kevenker.wordpress.com/749/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kevenker.wordpress.com/749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kevenker.wordpress.com/749/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kevenker.wordpress.com/749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kevenker.wordpress.com/749/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kevenker.wordpress.com/749/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kevenker.wordpress.com/749/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=749&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kevenker.wordpress.com/2010/11/18/windows-cmd-parsing-preventing-environment-variable-expansion-inside-quoted-string/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d589c10ea5131f5ec8fe3606bb5a7c7f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevenker</media:title>
		</media:content>
	</item>
		<item>
		<title>Timestamps for Windows batch scripts</title>
		<link>http://kevenker.wordpress.com/2010/11/04/timestamps-for-windows-batch-scripts/</link>
		<comments>http://kevenker.wordpress.com/2010/11/04/timestamps-for-windows-batch-scripts/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 15:09:17 +0000</pubDate>
		<dc:creator>kevenker</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://kevenker.wordpress.com/?p=740</guid>
		<description><![CDATA[Just a quick snippet of code for Windows batch scripts. I had to fool around for a while to get this working so I figured I&#8217;d post it here so I wouldn&#8217;t forget it. And maybe somebody else would find it useful as well. I wanted to generate a timestamp for naming files of the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=740&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just a quick snippet of code for Windows batch scripts. I had to fool around for a while to get this working so I figured I&#8217;d post it here so I wouldn&#8217;t forget it. And maybe somebody else would find it useful as well.</p>
<p>I wanted to generate a timestamp for naming files of the form yyyymmddhhmmss. The problem is that batch scripts don&#8217;t really support string formatting. You can get %date%, e.g. Thu 11/04/2010, and you can get %time%, e.g.  7:55:31.23. So you have to tease out the pieces manually, by using batch script&#8217;s &#8220;substring&#8221; abilities.</p>
<p>The only real &#8220;gotcha&#8221; is that the time doesn&#8217;t print a zero at the front of single digit times. So if you do something like:</p>
<div><code>set timestamp==%date:~-4%%date:~4,2%%date:~7,2%=%time:~0,2%%time:~3,2%%time:~6,2%</code></div>
<p>you can end up with a string that looks like: &#8220;20101104 75531&#8243;, with that space in it, which is rather annoying. Not to mention that it breaks scripts unless you put quotes around everything.</p>
<p>Basically, you need to check to see if the first character in the time portion is a space and if it is, insert a 0 at the front and grab everything after the space. So the snippet I developed is:</p>
<div><code><br />
set datepart=%date:~-4%%date:~4,2%%date:~7,2%<br />
set timepart=%time:~0,2%%time:~3,2%%time:~6,2%</code></div>
<p><code></p>
<div>if "%timepart:~0,1%"==" " set timepart=0%timepart:~1%</div>
<div>set timestamp=%datepart%%timepart%</div>
<p></code></p>
<p>PS &#8211; Sorry about the jacked up formatting. It seems WordPress is going through one of its periodic episodes where the editor decides to to whatever it feels like. The HTML mode no longer appears to actually let you edit HTML either, making things extra fun!!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kevenker.wordpress.com/740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kevenker.wordpress.com/740/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kevenker.wordpress.com/740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kevenker.wordpress.com/740/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kevenker.wordpress.com/740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kevenker.wordpress.com/740/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kevenker.wordpress.com/740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kevenker.wordpress.com/740/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kevenker.wordpress.com/740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kevenker.wordpress.com/740/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kevenker.wordpress.com/740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kevenker.wordpress.com/740/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kevenker.wordpress.com/740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kevenker.wordpress.com/740/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=740&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kevenker.wordpress.com/2010/11/04/timestamps-for-windows-batch-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d589c10ea5131f5ec8fe3606bb5a7c7f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevenker</media:title>
		</media:content>
	</item>
		<item>
		<title>Multiple threads for C# Process streams</title>
		<link>http://kevenker.wordpress.com/2010/10/05/multiple-threads-for-c-process-streams/</link>
		<comments>http://kevenker.wordpress.com/2010/10/05/multiple-threads-for-c-process-streams/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 03:35:39 +0000</pubDate>
		<dc:creator>kevenker</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://kevenker.wordpress.com/?p=727</guid>
		<description><![CDATA[Here&#8217;s my stab at writing a function that uses multiple threads for reading from a C# Process object&#8217;s streams, StandardError and StandardOutput. I&#8217;ve provided a wrapper function RunShellCommand on top of RunProcess which is the most generic. If you don&#8217;t want to run as a different user, pass in a null or zero-length string for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=727&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s my stab at writing a function that uses multiple threads for reading from a C# Process object&#8217;s streams, StandardError and StandardOutput. I&#8217;ve provided a wrapper function RunShellCommand on top of RunProcess which is the most generic. If you don&#8217;t want to run as a different user, pass in a null or zero-length string for username.</p>
<p>Note that workingDirectory MUST be set to something valid if you run as a different user. Set to null if you want to run in current directory.</p>
<p>The reason for the lock() in GetOutput is that I want to create a function that outputs to one StringBuilder, not two. If you will always have two StringBuilders, then you can get rid of the lock.</p>
<p>I&#8217;m super-new to threads, so be kind for any obvious mistakes! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">        <span style="color:blue;">public</span> <span style="color:blue;">void</span> RunShellCommand(</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:blue;">string</span> username</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:blue;">string</span> domain</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:#2b91af;">SecureString</span> password</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:blue;">string</span> workingDirectory</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:blue;">string</span> command</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:blue;">out</span> <span style="color:blue;">string</span> stdOut</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:blue;">out</span> <span style="color:blue;">string</span> stdErr</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:blue;">out</span> <span style="color:blue;">int</span> exitCode</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:blue;">int</span> timeoutSeconds)</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">        {</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:blue;">string</span> cmd = <span style="color:#a31515;">&#8220;/c&#8221;</span> + command;</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:blue;">string</span> fileName = System.<span style="color:#2b91af;">Environment</span>.ExpandEnvironmentVariables(<span style="color:#a31515;">&#8220;%comspec%&#8221;</span>);</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            RunProcess(</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                username</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                , domain</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                , password</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                , workingDirectory</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                , fileName</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                , cmd</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                , <span style="color:blue;">out</span> stdOut</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                , <span style="color:blue;">out</span> stdErr</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                , <span style="color:blue;">out</span> exitCode</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                , timeoutSeconds);</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">        }</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">        <span style="color:blue;">public</span> <span style="color:blue;">void</span> RunProcess(</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:blue;">string</span> username</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:blue;">string</span> domain</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:#2b91af;">SecureString</span> password</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:blue;">string</span> workingDirectory</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:blue;">string</span> fileName</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:blue;">string</span> arguments</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:blue;">out</span> <span style="color:blue;">string</span> stdOut</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:blue;">out</span> <span style="color:blue;">string</span> stdErr</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:blue;">out</span> <span style="color:blue;">int</span> exitCode</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            , <span style="color:blue;">int</span> timeoutSeconds)</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">        {</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:#2b91af;">Process</span> p = <span style="color:blue;">new</span> <span style="color:#2b91af;">Process</span>();</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            p.StartInfo.FileName = fileName;</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            p.StartInfo.Arguments = arguments;</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            p.StartInfo.UseShellExecute = <span style="color:blue;">false</span>;</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            p.StartInfo.RedirectStandardOutput = <span style="color:blue;">true</span>;</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            p.StartInfo.RedirectStandardError = <span style="color:blue;">true</span>;</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            p.StartInfo.CreateNoWindow = <span style="color:blue;">true</span>;</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            p.StartInfo.WorkingDirectory = workingDirectory;</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:blue;">if</span> (!<span style="color:blue;">string</span>.IsNullOrEmpty(username))</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            {</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                p.StartInfo.UserName = username;</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                p.StartInfo.Domain = domain;</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                p.StartInfo.Password = password;</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            }</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:#2b91af;">StringBuilder</span> sbOut = <span style="color:blue;">new</span> <span style="color:#2b91af;">StringBuilder</span>();</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:#2b91af;">StringBuilder</span> sbErr = <span style="color:blue;">new</span> <span style="color:#2b91af;">StringBuilder</span>();</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:#2b91af;">List</span>&lt;<span style="color:blue;">object</span>&gt; lOut = <span style="color:blue;">new</span> <span style="color:#2b91af;">List</span>&lt;<span style="color:blue;">object</span>&gt;();</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:#2b91af;">List</span>&lt;<span style="color:blue;">object</span>&gt; lErr = <span style="color:blue;">new</span> <span style="color:#2b91af;">List</span>&lt;<span style="color:blue;">object</span>&gt;();</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            p.Start();</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            lOut.Add(p.StandardOutput);</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            lOut.Add(sbOut);</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            lErr.Add(p.StandardError);</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            lErr.Add(sbErr);</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            System.Threading.<span style="color:#2b91af;">Thread</span> outThread = <span style="color:blue;">new</span> System.Threading.<span style="color:#2b91af;">Thread</span>(GetOutput);</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            System.Threading.<span style="color:#2b91af;">Thread</span> errThread = <span style="color:blue;">new</span> System.Threading.<span style="color:#2b91af;">Thread</span>(GetOutput);</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            outThread.IsBackground = <span style="color:blue;">true</span>;</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            errThread.IsBackground = <span style="color:blue;">true</span>;</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            outThread.Start(lOut);</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            errThread.Start(lErr);</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:blue;">if</span> (!p.WaitForExit(timeoutSeconds * 1000))</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            {</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                <span style="color:blue;">throw</span> <span style="color:blue;">new</span> <span style="color:#2b91af;">ApplicationException</span>(</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                    <span style="color:blue;">string</span>.Format(</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                    <span style="color:#a31515;">&#8220;Executing {0} {1} timed out!&#8221;</span></p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                    , p.StartInfo.FileName</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                    , p.StartInfo.Arguments));</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            }</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:green;">// </span></p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:green;">// Wait for readers grab all data before closing streams.</span></p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:green;">// Closing the stream before it has finished may cause data-loss and may </span></p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:green;">// cause an ObjectDisposedException on the thread but this is trapped. </span></p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:green;">//</span></p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            errThread.Join(timeoutSeconds * 1000);</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            outThread.Join(timeoutSeconds * 1000);</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            p.StandardError.Close();</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            p.StandardOutput.Close();</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            stdOut = sbOut.ToString();</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            stdErr = sbErr.ToString();</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            exitCode = p.ExitCode;</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">        }</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">        <span style="color:blue;">private</span> <span style="color:blue;">void</span> GetOutput(<span style="color:blue;">object</span> parameters)</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">        {</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:#2b91af;">List</span>&lt;<span style="color:blue;">object</span>&gt; paramList = (<span style="color:#2b91af;">List</span>&lt;<span style="color:blue;">object</span>&gt;)parameters;</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:#2b91af;">StreamReader</span> sr = (<span style="color:#2b91af;">StreamReader</span>)paramList[0];</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:#2b91af;">StringBuilder</span> sb = (<span style="color:#2b91af;">StringBuilder</span>)paramList[1];</p>
<p style="font-family:Calibri;font-size:11pt;margin:0;"> </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:blue;">try</span></p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            {</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                <span style="color:blue;">while</span> (!sr.EndOfStream)</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                {</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                    <span style="color:blue;">string</span> l = sr.ReadLine();</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                    <span style="color:blue;">lock</span> (sb)</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                    {</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                        sb.AppendLine(l);</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                    }</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                    <span style="color:#2b91af;">Console</span>.WriteLine(l);</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">                }</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            }</p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:green;">// ObjectDisposedException happens if we timeout and close the</span></p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:green;">// stream before sr.EndOfStream is reached</span></p>
<p style="font-family:consolas;font-size:11pt;margin:0;">            <span style="color:blue;">catch</span> (<span style="color:#2b91af;">ObjectDisposedException</span>) { }        </p>
<p style="font-family:consolas;font-size:11pt;margin:0;">        }</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kevenker.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kevenker.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kevenker.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kevenker.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kevenker.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kevenker.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kevenker.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kevenker.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kevenker.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kevenker.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kevenker.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kevenker.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kevenker.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kevenker.wordpress.com/727/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=727&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kevenker.wordpress.com/2010/10/05/multiple-threads-for-c-process-streams/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d589c10ea5131f5ec8fe3606bb5a7c7f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevenker</media:title>
		</media:content>
	</item>
		<item>
		<title>Much of what we know about studying is wrong</title>
		<link>http://kevenker.wordpress.com/2010/09/11/much-of-what-we-know-about-studying-is-wrong/</link>
		<comments>http://kevenker.wordpress.com/2010/09/11/much-of-what-we-know-about-studying-is-wrong/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 18:34:07 +0000</pubDate>
		<dc:creator>kevenker</dc:creator>
				<category><![CDATA[Daily Stuff]]></category>

		<guid isPermaLink="false">http://kevenker.wordpress.com/?p=721</guid>
		<description><![CDATA[http://www.nytimes.com/2010/09/07/health/views/07mind.html?_r=2&#38;src=me&#38;ref=homepage This article talks about they common myths surrounding learning new material. Vary the setting. Learn the same material in two different places. Vary your learning activities. When learning a language, for example, move between vocabulary, reading and speaking. A little bit of each seems to work better than all of one thing. Space out [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=721&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nytimes.com/2010/09/07/health/views/07mind.html?_r=2&amp;src=me&amp;ref=homepage">http://www.nytimes.com/2010/09/07/health/views/07mind.html?_r=2&amp;src=me&amp;ref=homepage</a></p>
<p>This article talks about they common myths surrounding learning new material.</p>
<ul>
<li>Vary the setting. Learn the same material in two different places.</li>
<li>Vary your learning activities. When learning a language, for example, move between vocabulary, reading and speaking. A little bit of each seems to work better than all of one thing.</li>
<li>Space out your study of a particular item. Study something one day, then a few days later, then maybe a week later. (there&#8217;s actually a guy who sells a computer program (<a title="SuperMemo" href="http://supermemo.com/">SuperMemo</a>) for this (<a href="http://www.wired.com/medtech/health/magazine/16-05/ff_wozniak">http://www.wired.com/medtech/health/magazine/16-05/ff_wozniak</a>)).</li>
<li>Testing, even self-testing helps to remember material.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kevenker.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kevenker.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kevenker.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kevenker.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kevenker.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kevenker.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kevenker.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kevenker.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kevenker.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kevenker.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kevenker.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kevenker.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kevenker.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kevenker.wordpress.com/721/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=721&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kevenker.wordpress.com/2010/09/11/much-of-what-we-know-about-studying-is-wrong/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d589c10ea5131f5ec8fe3606bb5a7c7f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevenker</media:title>
		</media:content>
	</item>
		<item>
		<title>The Great Depression &#8211; Was it avoidable? Probably so.</title>
		<link>http://kevenker.wordpress.com/2010/09/07/the-great-depression-was-it-avoidable-probably-so/</link>
		<comments>http://kevenker.wordpress.com/2010/09/07/the-great-depression-was-it-avoidable-probably-so/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 19:19:54 +0000</pubDate>
		<dc:creator>kevenker</dc:creator>
				<category><![CDATA[Society/Politics]]></category>

		<guid isPermaLink="false">http://kevenker.wordpress.com/?p=711</guid>
		<description><![CDATA[This is a very interesting article about the Great Depression and how the government and it&#8217;s tragicomical mismanagement of the situation actually started the Great Depression and then seemed to do everything in its power to prolong it. http://www.zerohedge.com/sites/default/files/Mackinac%20Great%20Depression.pdf It&#8217;s a long read, but definitely worth your time.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=711&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a very interesting article about the Great Depression and how the government and it&#8217;s tragicomical mismanagement of the situation actually started the Great Depression and then seemed to do everything in its power to prolong it.</p>
<p><a href="http://www.zerohedge.com/sites/default/files/Mackinac%20Great%20Depression.pdf">http://www.zerohedge.com/sites/default/files/Mackinac%20Great%20Depression.pdf</a></p>
<p>It&#8217;s a long read, but definitely worth your time.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kevenker.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kevenker.wordpress.com/711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kevenker.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kevenker.wordpress.com/711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kevenker.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kevenker.wordpress.com/711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kevenker.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kevenker.wordpress.com/711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kevenker.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kevenker.wordpress.com/711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kevenker.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kevenker.wordpress.com/711/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kevenker.wordpress.com/711/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kevenker.wordpress.com/711/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kevenker.wordpress.com&amp;blog=101636&amp;post=711&amp;subd=kevenker&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kevenker.wordpress.com/2010/09/07/the-great-depression-was-it-avoidable-probably-so/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d589c10ea5131f5ec8fe3606bb5a7c7f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kevenker</media:title>
		</media:content>
	</item>
	</channel>
</rss>
