<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CEMHRHc9eyp7ImA9WhRVEk8.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175</id><updated>2012-01-10T14:07:15.963-05:00</updated><category term="MySQL" /><category term="SQL" /><category term="join" /><category term="count" /><category term="XPlanner NTLM" /><title>TechStumbler</title><subtitle type="html">Notes from my RandomWalk in computing.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://techstumbler.blogspot.com/" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Techstumbler" /><feedburner:info uri="techstumbler" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CEMHRHc8eCp7ImA9WhRVEk8.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-4698100110994007711</id><published>2012-01-10T13:59:00.001-05:00</published><updated>2012-01-10T14:07:15.970-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-10T14:07:15.970-05:00</app:edited><title>Loading Remote Assemblies in Powershell with .NET 4</title><content type="html">We recently updated our entire codebase to .NET 4.0 from 3.5. There are plenty of blog posts about that process in general, so I'm going to keep this one specific to our Powershell deployment scripts. &lt;br /&gt;
&lt;br /&gt;
We build our code to a central server and then use Powershell to install those build on our Development server. The upgrade to .NET 4 caused 2 problems with Powershell when we called &lt;code&gt;[Reflection.Assembly]::LoadFile()&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
First:&lt;br /&gt;
Powershell by default runs in .NET 2.0. When we tried to load our new 4.0 assemblies, we got this error:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
Exception calling "LoadFile" with "1" argument(s): "Could not load file or assembly 'file://\\buildServer\Application\assembly.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded."&lt;br /&gt;
At C:\Scripts\Deployment\Deploy.ps1:XX char:XX&lt;br /&gt;
+ $assembly = [Reflection.Assembly]::LoadFile &amp;lt;&amp;lt;&amp;lt;&amp;lt; ($file);     + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException     + FullyQualifiedErrorId : DotNetMethodException &lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
We need to tell Powershell to run in .NET 4.0 mode. To do that we need to create an app.config file for Powershell. In our case the file was created here: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe.config, but YMMV based on Powershell's location. The new powershell.exe.config file looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;configuration&amp;gt; &lt;br /&gt;
&amp;nbsp;&amp;lt;startup useLegacyV2RuntimeActivationPolicy=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;supportedruntime version=&amp;quot;v4.0.30319&amp;quot;/&amp;gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;supportedruntime version=&amp;quot;v2.0.50727&amp;quot;/&amp;gt; &lt;br /&gt;
&amp;nbsp&amp;lt;/startup&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
Now Powershell can run with both 2.0 and 4.0 assemblies.&lt;br /&gt;
&lt;br /&gt;
Second:&lt;br /&gt;
The security features are a bit different when running 2.0 vs 4.0. This difference caused a problem when running assemblies from our Build server on our Development server:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
Exception calling "LoadFile" with "1" argument(s): "An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for&lt;br /&gt;
more information."&lt;br /&gt;
At C:\Scripts\Deployment\Deploy.ps1:XX char:XX&lt;br /&gt;
+ $assembly = [Reflection.Assembly]::LoadFile &amp;lt;&amp;lt;&amp;lt;&amp;lt; ($file);     + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException     + FullyQualifiedErrorId : DotNetMethodException &lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Now we simply add the loadFromRemoteSources switch to the powershell.exe.config file we just created so that the entire file looks like this:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;configuration&amp;gt; &lt;br /&gt;
&amp;nbsp;&amp;lt;startup useLegacyV2RuntimeActivationPolicy=&amp;quot;true&amp;quot;&amp;gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;supportedruntime version=&amp;quot;v4.0.30319&amp;quot;/&amp;gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;supportedruntime version=&amp;quot;v2.0.50727&amp;quot;/&amp;gt; &lt;br /&gt;
&amp;nbsp;&amp;lt;/startup&amp;gt;&lt;br /&gt;
&amp;lt;runtime&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;loadfromremotesources enabled=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/runtime&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
Now we are successfully loading remote .NET 4.0 assemblies in Powershell. Hope this helps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-4698100110994007711?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/dRZcFE4OGMtLE9-EsrFMlXHaS-0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dRZcFE4OGMtLE9-EsrFMlXHaS-0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/dRZcFE4OGMtLE9-EsrFMlXHaS-0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dRZcFE4OGMtLE9-EsrFMlXHaS-0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/Ye0pn0-FmFE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/4698100110994007711/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=4698100110994007711" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/4698100110994007711?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/4698100110994007711?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/Ye0pn0-FmFE/loading-remote-assemblies-in-powershell.html" title="Loading Remote Assemblies in Powershell with .NET 4" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2012/01/loading-remote-assemblies-in-powershell.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4DQXs6eip7ImA9WhdXE0s.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-4450484880130548212</id><published>2011-08-26T09:58:00.003-04:00</published><updated>2011-08-26T10:12:50.512-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-26T10:12:50.512-04:00</app:edited><title>Safari User Agent Detection in JavaScript</title><content type="html">Here's a quick snippit for detecting if a browser is Safari version 4 or 5. It works for both desktop and mobile (iPhone, iPod, iPad) versions.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
function detectSafari45()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; var safariRegEx = /Mozilla\/5\.0 \([^\)]*\) AppleWebKit\/\d+\.\d+(\.\d+)? \(KHTML, like Gecko\) Version\/[45]\.\d+\.\d+( Mobile\/\w*)? Safari\/\d+\.\d+(\.\d+)?/i&lt;br /&gt;
&amp;nbsp; var match = safariRegEx.exec(navigator.userAgent);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; if (match !== null &amp;amp;&amp;amp; match.length &amp;gt; 0)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return true;&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; return false;&lt;br /&gt;
}&lt;br /&gt;
&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-4450484880130548212?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8PbJAk71ZbHepZa-afDMQoYVfy4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8PbJAk71ZbHepZa-afDMQoYVfy4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8PbJAk71ZbHepZa-afDMQoYVfy4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8PbJAk71ZbHepZa-afDMQoYVfy4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/cEOnH1RKKsI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/4450484880130548212/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=4450484880130548212" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/4450484880130548212?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/4450484880130548212?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/cEOnH1RKKsI/safari-user-agent-detection-in.html" title="Safari User Agent Detection in JavaScript" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2011/08/safari-user-agent-detection-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUNR3kycSp7ImA9WhZWEEk.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-7895177150676135467</id><published>2011-05-10T12:27:00.004-04:00</published><updated>2011-05-10T12:51:36.799-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-10T12:51:36.799-04:00</app:edited><title>Averaging Timespans in T-SQL</title><content type="html">I'm doing some work with an operations queue. All of the operations are added to a small table on our SQL Server instance. We have a start_datetime and a stop_datetime for each operation. It took me a little time but here's a select statement for profiling the wait times for operations in our queue.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
select  &lt;br /&gt;
&amp;nbsp;&amp;nbsp;CONVERT(VARCHAR(13),creation_date,120) as [hour], &lt;br /&gt;
&amp;nbsp;&amp;nbsp;CONVERT(VARCHAR(8), max(stop_datetime - start_datetime), 108) as MaxWaitTime,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;CONVERT(VARCHAR(8), min(stop_datetime - start_datetime), 108) as MinWaitTime,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;CONVERT(VARCHAR(8), cast(avg(cast(stop_datetime - start_datetime as float)) as datetime), 108) as AvgWaitTime&lt;br /&gt;
from &lt;br /&gt;
&amp;nbsp;&amp;nbsp;[OpQueue].[Op]&lt;br /&gt;
where &lt;br /&gt;
&amp;nbsp;&amp;nbsp;start_datetime &amp;gt; '2011-05-07'&lt;br /&gt;
group by &lt;br /&gt;
&amp;nbsp;&amp;nbsp;CONVERT(VARCHAR(13),start_datetime ,120)&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Here are a few things to note.&lt;br /&gt;
This statement will spit out the min, max, and average running time for operations in the queue that start in the same hour.&lt;br /&gt;
The third argument for convert is pretty handy for DATETIMEs. Here is the page where it is described: &lt;a href="http://msdn.microsoft.com/en-us/library/ms187928.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms187928.aspx&lt;/a&gt;. &lt;br /&gt;
The AVG() function doesn't work for DATETIMEs, so we need to convert it to a float and then back again to get what we are looking for.&lt;br /&gt;
&lt;br /&gt;
Here's the graph we ended up with.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-RKoyIZha7Ds/TclnT7Ws4cI/AAAAAAAAAPw/HXcNVRMXNkU/s1600/WaitTimes.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="290" src="http://1.bp.blogspot.com/-RKoyIZha7Ds/TclnT7Ws4cI/AAAAAAAAAPw/HXcNVRMXNkU/s400/WaitTimes.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Seems like it's time to invest in some more processing power.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-7895177150676135467?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/sOZdcMuycNCTmbr59cphhw7oohY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sOZdcMuycNCTmbr59cphhw7oohY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/sOZdcMuycNCTmbr59cphhw7oohY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sOZdcMuycNCTmbr59cphhw7oohY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/1-FrJrvA9zU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/7895177150676135467/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=7895177150676135467" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/7895177150676135467?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/7895177150676135467?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/1-FrJrvA9zU/averaging-timespans-in-t-sql.html" title="Averaging Timespans in T-SQL" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-RKoyIZha7Ds/TclnT7Ws4cI/AAAAAAAAAPw/HXcNVRMXNkU/s72-c/WaitTimes.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2011/05/averaging-timespans-in-t-sql.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkEGRH4zeyp7ImA9WhZQFEU.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-699921153927005009</id><published>2011-04-22T12:10:00.000-04:00</published><updated>2011-04-22T12:10:25.083-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-22T12:10:25.083-04:00</app:edited><title>Running Hudson from OS X: the .war.zip Fiasco</title><content type="html">It took me a while to figure this out and maybe it's just because I'm not a java guy, but I couldn't figure out how to start the Hudson continuous integration tool on my Mac. I downloaded the 2.0.0 version from the Hudson site (http://hudson-ci.org/). The file was hudson-2.0.0.war.zip. The instructions say to run &lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
java -jar hudson-2.0.0.war&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
to start up the service. I unzipped the file and ended up with a bunch of .class files and no .war. Ah, looks like I also unzipped the .war file. So then I found this nice post (http://superuser.com/questions/159260/in-mac-os-x-how-can-i-unzip-a-zip-file-without-unzipping-its-contents) on how to unzip a file without unzipping its contents. Now I have a &lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
hudson-2.0.0.war/&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
directory. I ran &lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
$ java -jar hudson-2.0.0.war&lt;br /&gt;
Invalid or corrupt jarfile hudson-2.0.0.war&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
Hmm, not sure what to do next. Somewhere in my search I read that a .war is basically just a zip file. So I tried&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
$ java -jar hudson-2.0.0.war.zip&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
on the original file, which worked. I renamed hudson-2.0.0.war.zip&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
$ mv hudson-2.0.0.war.zip hudson-2.0.0.war&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
and I was off and running.&lt;br /&gt;
&lt;br /&gt;
So I hope this helps some other java n00bs who may have run into this. The moral of the story is .war == .zip&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-699921153927005009?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KiACnZwJTZK61MxMgG6KGXJURXE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KiACnZwJTZK61MxMgG6KGXJURXE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KiACnZwJTZK61MxMgG6KGXJURXE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KiACnZwJTZK61MxMgG6KGXJURXE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/g14Pys8joKw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/699921153927005009/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=699921153927005009" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/699921153927005009?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/699921153927005009?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/g14Pys8joKw/running-hudson-from-os-x-warzip-fiasco.html" title="Running Hudson from OS X: the .war.zip Fiasco" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2011/04/running-hudson-from-os-x-warzip-fiasco.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEAHQn06fip7ImA9Wx9SGUQ.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-8438311006853831293</id><published>2010-12-10T10:58:00.000-05:00</published><updated>2010-12-10T10:58:53.316-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-10T10:58:53.316-05:00</app:edited><title>Moving Replicated FullText Index in SQL Server</title><content type="html">We needed to move the location of our full text index (FTI) on a subscriber. I thought this would be a pain because the replication, but it turns out to be pretty straightforward. Here's the system I am working with:&lt;br /&gt;
&lt;br /&gt;
SQL Server 2005&lt;br /&gt;
Transactional Replication with an Updateable Subscriber.&lt;br /&gt;
&lt;br /&gt;
Here are the steps I took:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0. Make sure you have appropriate backups.&lt;br /&gt;
1. Point all of the apps to the Publisher because we will need to take the Subscriber offline.&lt;br /&gt;
2. On the Subscriber, open the synchronization status by right-clicking on Replication-&gt;Local Subscriptions-&gt;&lt;NameOfSunscription&gt; ans selecting View Synchronization Status. &lt;br /&gt;
3. Stop the Synchronization Service. (This really just pauses updates).&lt;br /&gt;
4. On the Subscriber run &lt;code&gt; SELECT name FROM sys.database_files WHERE type_desc = 'FULLTEXT';&lt;/code&gt; to get the name of the FTI.&lt;br /&gt;
5. On the Subscriber run &lt;code&gt;ALTER DATABASE [DB_NAME] SET OFFLINE;&lt;/code&gt;&lt;br /&gt;
6. Move the FTI where to it's new home.&lt;br /&gt;
7. On the subscriber run &lt;code&gt;ALTER DATABASE [DB_NAME] MODIFY FILE (Name=[FTI_NAME], Filename = "'new/location/on/disk/'); &lt;/code&gt;&lt;br /&gt;
8. On the Subscriber run &lt;code&gt;ALTER DATABASE [DB_NAME] SET ONLINE;&lt;/code&gt;&lt;br /&gt;
9. Start the Sync Service in View Synchronization Status.&lt;br /&gt;
&lt;br /&gt;
That should be it. Hope this helps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-8438311006853831293?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KoPcbfAeJvQ-SBopQVzm18WQ_9I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KoPcbfAeJvQ-SBopQVzm18WQ_9I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KoPcbfAeJvQ-SBopQVzm18WQ_9I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KoPcbfAeJvQ-SBopQVzm18WQ_9I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/lxM3bVUxLJw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/8438311006853831293/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=8438311006853831293" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/8438311006853831293?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/8438311006853831293?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/lxM3bVUxLJw/moving-replicated-fulltext-index-in-sql.html" title="Moving Replicated FullText Index in SQL Server" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2010/12/moving-replicated-fulltext-index-in-sql.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0AFR3k9eyp7ImA9Wx9SEUg.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-268314718693135444</id><published>2010-11-24T17:29:00.003-05:00</published><updated>2010-11-30T17:21:56.763-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-30T17:21:56.763-05:00</app:edited><title>T-SQL Query: Tables Without a Primary Keys</title><content type="html">I used this when I was setting up a Transactional Replication system on SQL Server. I needed to figure out which tables did not have primary keys assigned.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
select s.name+'.'+ t.name&lt;br /&gt;
from&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sys.schemas s&lt;br /&gt;
&amp;nbsp;&amp;nbsp;join sys.tables t on s.schema_id = t.schema_id&lt;br /&gt;
&amp;nbsp;&amp;nbsp;left join sys.indexes i on i.object_id = t.object_id and&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i.is_primary_key = 1&lt;br /&gt;
where i.name is null&lt;br /&gt;
order by (s.name+'.'+ t.name) asc;&lt;br /&gt;
&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-268314718693135444?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XY4sGWAnEpugD2_chd3auY1OupA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XY4sGWAnEpugD2_chd3auY1OupA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XY4sGWAnEpugD2_chd3auY1OupA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XY4sGWAnEpugD2_chd3auY1OupA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/EtAhC31yMFc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/268314718693135444/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=268314718693135444" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/268314718693135444?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/268314718693135444?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/EtAhC31yMFc/t-sql-query-which-tables-do-not-have.html" title="T-SQL Query: Tables Without a Primary Keys" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2010/11/t-sql-query-which-tables-do-not-have.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4GRXYyfCp7ImA9WxFXGUo.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-1371731626719548582</id><published>2010-05-27T12:15:00.000-04:00</published><updated>2010-05-27T12:15:24.894-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-27T12:15:24.894-04:00</app:edited><title>Great Post on SQL Server Stored Procedure Variables</title><content type="html">It took me a while to find this about using variables in the &lt;code&gt;TOP&lt;/code&gt; clause of a MSSQL stored prodedure. This post answered all my questions:&lt;br /&gt;
&lt;br /&gt;
http://sqlserver2000.databases.aspfaq.com/how-do-i-use-a-variable-in-a-top-clause-in-sql-server.html&lt;br /&gt;
&lt;br /&gt;
Here's the best part&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
CREATE PROCEDURE dbo.getFoo &lt;br /&gt;
&amp;nbsp;&amp;nbsp;@top INT&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt; AS &lt;br /&gt;
&amp;nbsp;&amp;nbsp;BEGIN &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;SET ROWCOUNT @top &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;SELECT foo &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;FROM blat &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;ORDER BY foo DESC &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;-- never forget to set it back to 0! &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;SET ROWCOUNT 0 &lt;br /&gt;
&amp;nbsp;&amp;nbsp;END &lt;br /&gt;
GO&lt;br /&gt;
&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-1371731626719548582?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3fyYUoTjsoNO4UUxRnSSFiSQpLc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3fyYUoTjsoNO4UUxRnSSFiSQpLc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3fyYUoTjsoNO4UUxRnSSFiSQpLc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3fyYUoTjsoNO4UUxRnSSFiSQpLc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/ZzQ-RTfzxAQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/1371731626719548582/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=1371731626719548582" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/1371731626719548582?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/1371731626719548582?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/ZzQ-RTfzxAQ/great-post-on-sql-server-stored.html" title="Great Post on SQL Server Stored Procedure Variables" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2010/05/great-post-on-sql-server-stored.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEQBRX04eip7ImA9WxBaFU4.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-8099562900811331442</id><published>2010-03-25T12:57:00.001-04:00</published><updated>2010-03-25T12:59:14.332-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-25T12:59:14.332-04:00</app:edited><title>Programmaticly Changing the File Attribute of an App.config File.</title><content type="html">The requirement for this assignment was to use a command line argument to change the settings of a C# console application. I didn't want to compile the settings into the app itself, but to use an app.config file instead. Here's how it works:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
public static bool SetEnvironment(string env)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;string configFilePath = string.Empty;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;env = env.ToLowerInvariant();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;switch (env)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;case "dev":&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; configFilePath = @"Config\Dev.config";&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;case "prod":&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; configFilePath = @"Config\Prod.config";&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;default:&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;try&lt;br /&gt;
&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;System.Configuration.Configuration config =   &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;AppSettingsSection appSetSec = config.AppSettings;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;appSetSec.File = configFilePath;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;config.Save(ConfigurationSaveMode.Modified);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;ConfigurationManager.RefreshSection("appSettings");&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;catch (Exception ex)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;OfflineDemoTool.WriteError(ex.Message);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;return false;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that I forgot to do was to make sure that the Config\Dev.config and Config\Prod.config files were set to "Copy if newer" in their properties list, otherwise they won't be copied to the output directory.&lt;br /&gt;
&lt;br /&gt;
Most of this comes straight from the MSDN article found here: &lt;a href="http://msdn.microsoft.com/en-us/library/system.configuration.appsettingssection.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.configuration.appsettingssection.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-8099562900811331442?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ncjlnTLDtfH4yS5-KzMxbdE22Es/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ncjlnTLDtfH4yS5-KzMxbdE22Es/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ncjlnTLDtfH4yS5-KzMxbdE22Es/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ncjlnTLDtfH4yS5-KzMxbdE22Es/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/nTr_3Qi9Fco" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/8099562900811331442/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=8099562900811331442" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/8099562900811331442?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/8099562900811331442?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/nTr_3Qi9Fco/programmaticly-changing-file-attribute.html" title="Programmaticly Changing the File Attribute of an App.config File." /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2010/03/programmaticly-changing-file-attribute.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcBRXg6fSp7ImA9WxBTE0o.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-1192839999604175049</id><published>2009-12-09T11:49:00.002-05:00</published><updated>2009-12-09T12:00:54.615-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-09T12:00:54.615-05:00</app:edited><title>Windows Commands with Arguments in Powershell</title><content type="html">I have been trying to write a simple PowerShell script that runs (invokes?) MySqlDump.exe for two days. PowerShell syntax for running commands with arguments is not obvious and I wasn't able to find it documented anywhere. While this case is specific to mysqldump, it can be applied to any command line executable with multiple arguments. The trick is to create an array of the arguments and use that as the second "argument" for the ampersand (&amp;) call operator. Here's what my final example looked like:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;[string]$pathToExe = "C:\MySQL\MySQL Server 5.1\bin\mysqldump.exe";&lt;br /&gt;[string]$user = "myUser";&lt;br /&gt;[string]$password = "myPass";&lt;br /&gt;[string]$dbName = "myDB";&lt;br /&gt;[Array]$arguments = "-u", $user, "--password=$password", $dbName;&lt;br /&gt;&lt;br /&gt;&amp; $pathToExe $arguments | Out-File -FileName "out.sql";&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So there you have it. That's how to run an executable with spaces and arguments from PowerShell.&lt;br /&gt;&lt;br /&gt;While this article from PowerShell.com didn't answer my questions, I thought it was pretty useful and relevent:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://powershell.com/cs/blogs/ebook/archive/2009/03/30/chapter-12-command-discovery-and-scriptblocks.aspx"&gt;http://powershell.com/cs/blogs/ebook/archive/2009/03/30/chapter-12-command-discovery-and-scriptblocks.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-1192839999604175049?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/N2D9zQ6-PkktuZGr780Ex7h8oXs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/N2D9zQ6-PkktuZGr780Ex7h8oXs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/N2D9zQ6-PkktuZGr780Ex7h8oXs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/N2D9zQ6-PkktuZGr780Ex7h8oXs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/RiB0Ls9E4Tc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/1192839999604175049/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=1192839999604175049" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/1192839999604175049?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/1192839999604175049?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/RiB0Ls9E4Tc/windows-commands-with-arguments-in.html" title="Windows Commands with Arguments in Powershell" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2009/12/windows-commands-with-arguments-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IBR3Yzeip7ImA9WxNUGEs.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-7912481355919122002</id><published>2009-11-10T10:59:00.003-05:00</published><updated>2009-11-10T11:12:36.882-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-10T11:12:36.882-05:00</app:edited><title>Changing aspnet_wp user in IIS 5.1</title><content type="html">It's possible that no one will ever have to work with IIS 5.1 in XP again, but here you go just in case:&lt;br /&gt;&lt;br /&gt;We needed the asp.net worker process (aspnet_wp.exe) to access a share on a remote machine. By default the "Netowrk Service" runs aspnet_wp and that user doesn't have access to remote shares. The way to change this is by changing the "processModel" attribute in your machine.config file (c:\windows\microsoft.net\framework\v2*\config\machine.config).&lt;br /&gt;&lt;br /&gt;Mine ended up looking something like this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;  &amp;lt;processmodel username="DOMAIN\username" password="password" autoconfig="true"&amp;gt;&lt;br /&gt;  &amp;lt;/processmodel&amp;gt;&lt;br /&gt;  ...&lt;br /&gt;&amp;lt;/system.web&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Just make sure to restart IIS for the changes to take effect.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-7912481355919122002?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wPIQ8sCEZIJsKuuFzcU8OzoXTX4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wPIQ8sCEZIJsKuuFzcU8OzoXTX4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wPIQ8sCEZIJsKuuFzcU8OzoXTX4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wPIQ8sCEZIJsKuuFzcU8OzoXTX4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/A6baID_wqbs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/7912481355919122002/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=7912481355919122002" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/7912481355919122002?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/7912481355919122002?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/A6baID_wqbs/changing-aspnetwp-user-in-iis-51.html" title="Changing aspnet_wp user in IIS 5.1" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2009/11/changing-aspnetwp-user-in-iis-51.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYERXo9fSp7ImA9WxJRF0g.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-2939148759463028052</id><published>2009-05-19T12:48:00.003-04:00</published><updated>2009-05-19T12:55:04.465-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-19T12:55:04.465-04:00</app:edited><title>Powershell Diff Directory</title><content type="html">I wanted to create a file diff between two different directories. Unfortunately, the Copy-Item CmdLt will not (as far as I know) create the directory structure while copying. This is a bummer. I wanted to keep all of the files in the pipe as opposed to to getting all the files first because of the number of files in the directory structure. Here's what I cam up with&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$fromDir = "C:\FromDir";&lt;br /&gt;$toDir = "C:\ToDir";&lt;br /&gt;$diffDir = "C:\DiffDir";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Get-ChildItem -Recurse -Path $fromDir | % {&lt;br /&gt;  if ((Test-Path (Join-Path -Path $toDir -ChildPath ([string]$_.FullName).Replace($fromDir, ""))) -eq $false) &lt;br /&gt;  {&lt;br /&gt;    if ((Test-Path (Join-Path -Path $diffDir -ChildPath         ([string]$_.Directory).Replace($fromDir, ""))) -eq $false)&lt;br /&gt;    {&lt;br /&gt;      New-Item -Type "Directory" -Path (Join-Path -Path $diffDir -ChildPath ([string]$_.Directory).Replace($fromDir, ""));&lt;br /&gt;    }&lt;br /&gt;    Copy-Item -Recurse -Force $_.FullName -Destination (Join-Path -Path $diffDir -ChildPath ([string]$_.FullName).Replace($fromDir, ""));&lt;br /&gt;  }&lt;br /&gt;};&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As always, if anyone know a better way to do this, let me know.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-2939148759463028052?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ifpb3Jl8eARJfEI1D4VZO5sn_xo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ifpb3Jl8eARJfEI1D4VZO5sn_xo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Ifpb3Jl8eARJfEI1D4VZO5sn_xo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ifpb3Jl8eARJfEI1D4VZO5sn_xo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/VxBTi-A1C8M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/2939148759463028052/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=2939148759463028052" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/2939148759463028052?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/2939148759463028052?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/VxBTi-A1C8M/powershell-diff-directory.html" title="Powershell Diff Directory" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2009/05/powershell-diff-directory.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D08GQncyeyp7ImA9WxJXEk0.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-1286892210651169561</id><published>2009-04-29T10:39:00.005-04:00</published><updated>2009-06-05T08:43:43.993-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-05T08:43:43.993-04:00</app:edited><title>Powershell Rename-Item vs Copy-Item: Changing file names to upper case</title><content type="html">I needed recursively change all file and sub-directory names in a directory from mixed case to upper case. To me, this felt like a problem for PowerShell, but maybe I was wrong. Here was my first attempt:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Get-ChildItem -Recurse -Path "C:\media" | % {Rename-Item $_.FullName -NewName ([string]$_.Name).ToUpper()};&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;However, I received the following error:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Rename-Item : Source and destination path must be different.&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;So it looks like PowerShell refused to rename &lt;code&gt;file1&lt;/code&gt; to &lt;code&gt;FILE1&lt;/code&gt;, because it thinks that they are the same file. In order to get around this I ended up copying the entire tree, and even that command isn't particularly elegant:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Get-ChildItem -Recurse -Path "C:\media" | % {Copy-Item -Force $_.FullName ([string]$_.FullName).Replace("C:\media", "C:\MEDIA2").ToUpper()};&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;If there is a better way to do this, I'd love to know.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-1286892210651169561?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qOrL9y3QrZFS0WHuBmT9qWsKgwY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qOrL9y3QrZFS0WHuBmT9qWsKgwY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qOrL9y3QrZFS0WHuBmT9qWsKgwY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qOrL9y3QrZFS0WHuBmT9qWsKgwY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/f2Vz701uL20" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/1286892210651169561/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=1286892210651169561" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/1286892210651169561?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/1286892210651169561?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/f2Vz701uL20/powershell-rename-item-vs-copy-item.html" title="Powershell Rename-Item vs Copy-Item: Changing file names to upper case" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2009/04/powershell-rename-item-vs-copy-item.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQDQXgzeCp7ImA9WxRSF0s.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-9075099461769404521</id><published>2008-09-18T13:50:00.003-04:00</published><updated>2008-09-18T14:26:10.680-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-18T14:26:10.680-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="XPlanner NTLM" /><title>XPlanner Authentication with NTLM</title><content type="html">I spent most of the day setting up XPlanner and the documentation seemed to be lacking in a few spots. I'll go over the caveats I stumbled on.&lt;br /&gt;&lt;br /&gt;The XPlanner install was happening on the lone linux box (Fedora 8) on an NT domain. The box was almost completely empty so I had to install java first. I chose to install the jsdk 1.4.2 even though that version's is EOL'd. XPlanner hasn't been updated in a while (since 2006) and I didn't want to mess w/ a new version of the sdk.&lt;br /&gt;&lt;br /&gt;I upacked and installed the "standalone" version of XPlanner 0.7b7. So far so good. I was immediately able to use the default username/password to login.&lt;br /&gt;&lt;br /&gt;The hardest part was figuring out how to authenticate based on our NT credentials. Most of the configuration occurs in the xplanner-0.7b7-standalone/webapps/ROOT/WEB-INF/classes/xplanner.properties file.&lt;br /&gt;&lt;br /&gt;Here's how I was able to get the NT authentication to work. In the xplanner.properties file, find the authentication strings:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#&lt;br /&gt;# XPlanner security configuration&lt;br /&gt;#&lt;br /&gt;xplanner.security.login[0].module=com.technoetic.xplanner.security.module.XPlannerLoginModule&lt;br /&gt;xplanner.security.login[0].name=XPlanner&lt;br /&gt;xplanner.security.login[0].option.userIdCaseSensitive=true&lt;br /&gt;xplanner.security.login[0].option.debug=true&lt;br /&gt;&lt;br /&gt;#xplanner.security.login[1].module=com.technoetic.xplanner.security.module.jndi.JNDILoginModule&lt;br /&gt;#xplanner.security.login[1].name=JNDI&lt;br /&gt;#xplanner.security.login[1].option.userIdCaseSensitive=false&lt;br /&gt;#xplanner.security.login[1].option.debug=true&lt;br /&gt;#xplanner.security.login[1].option.connectionURL=&lt;br /&gt;#xplanner.security.login[1].option.connectionName=cn=&lt;br /&gt;#xplanner.security.login[1].option.connectionPassword=&lt;br /&gt;#xplanner.security.login[1].option.digest=SHA&lt;br /&gt;#xplanner.security.login[1].option.userPattern=&lt;br /&gt;#xplanner.security.login[1].option.userPassword=&lt;br /&gt;#xplanner.security.login[1].option.authentication=simple&lt;br /&gt;#xplanner.security.login[1].option.derefAliases=never&lt;br /&gt;#xplanner.security.login[1].option.userSearch=cn={0}&lt;br /&gt;#xplanner.security.login[1].option.userSubtree=true&lt;br /&gt;#xplanner.security.login[1].option.roleBase=&lt;br /&gt;#xplanner.security.login[1].option.roleName=&lt;br /&gt;#xplanner.security.login[1].option.roleSearch=(uniqueMember={0})&lt;br /&gt;&lt;br /&gt;# NTLM login module&lt;br /&gt;#xplanner.security.login[2].module=com.technoetic.xplanner.security.module.ntlm.NtlmLoginModule&lt;br /&gt;#xplanner.security.login[2].name=NTLM&lt;br /&gt;#xplanner.security.login[2].option.userIdCaseSensitive=false&lt;br /&gt;#xplanner.security.login[2].option.domain=DOMAIN&lt;br /&gt;#xplanner.security.login[2].option.controller=CONTROLLER&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;To use the NTLM module, comment out the first set to security strings, uncomment the NTLM strings, and change the NTLM array index to 0. Here's how my file looked after I finished.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#&lt;br /&gt;# XPlanner security configuration&lt;br /&gt;#&lt;br /&gt;#xplanner.security.login[0].module=com.technoetic.xplanner.security.module.XPlannerLoginModule&lt;br /&gt;#xplanner.security.login[0].name=XPlanner&lt;br /&gt;#xplanner.security.login[0].option.userIdCaseSensitive=true&lt;br /&gt;#xplanner.security.login[0].option.debug=true&lt;br /&gt;&lt;br /&gt;#xplanner.security.login[1].module=com.technoetic.xplanner.security.module.jndi.JNDILoginModule&lt;br /&gt;#xplanner.security.login[1].name=JNDI&lt;br /&gt;#xplanner.security.login[1].option.userIdCaseSensitive=false&lt;br /&gt;#xplanner.security.login[1].option.debug=true&lt;br /&gt;#xplanner.security.login[1].option.connectionURL=&lt;br /&gt;#xplanner.security.login[1].option.connectionName=cn=&lt;br /&gt;#xplanner.security.login[1].option.connectionPassword=&lt;br /&gt;#xplanner.security.login[1].option.digest=SHA&lt;br /&gt;#xplanner.security.login[1].option.userPattern=&lt;br /&gt;#xplanner.security.login[1].option.userPassword=&lt;br /&gt;#xplanner.security.login[1].option.authentication=simple&lt;br /&gt;#xplanner.security.login[1].option.derefAliases=never&lt;br /&gt;#xplanner.security.login[1].option.userSearch=cn={0}&lt;br /&gt;#xplanner.security.login[1].option.userSubtree=true&lt;br /&gt;#xplanner.security.login[1].option.roleBase=&lt;br /&gt;#xplanner.security.login[1].option.roleName=&lt;br /&gt;#xplanner.security.login[1].option.roleSearch=(uniqueMember={0})&lt;br /&gt;&lt;br /&gt;# NTLM login module&lt;br /&gt;xplanner.security.login[0].module=com.technoetic.xplanner.security.module.ntlm.NtlmLoginModule&lt;br /&gt;xplanner.security.login[0].name=NTLM&lt;br /&gt;xplanner.security.login[0].option.userIdCaseSensitive=false&lt;br /&gt;xplanner.security.login[0].option.domain=DOMAIN&lt;br /&gt;xplanner.security.login[0].option.controller=CONTROLLER&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The NTLM module uses the local DB as a fall back, so any logins that you creaed locally that aren't in the Active Directory should still work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-9075099461769404521?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hrpeVlOWhnGVx212kB92bK2G5XM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hrpeVlOWhnGVx212kB92bK2G5XM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hrpeVlOWhnGVx212kB92bK2G5XM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hrpeVlOWhnGVx212kB92bK2G5XM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/tsCwpZbHyu8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/9075099461769404521/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=9075099461769404521" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/9075099461769404521?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/9075099461769404521?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/tsCwpZbHyu8/xplanner-authentication-with-ntlm.html" title="XPlanner Authentication with NTLM" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2008/09/xplanner-authentication-with-ntlm.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08ERHk-eip7ImA9WxRTGUQ.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-620819030555640458</id><published>2008-09-09T16:21:00.002-04:00</published><updated>2008-09-09T16:23:25.752-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-09T16:23:25.752-04:00</app:edited><title>JPEG Marker codes</title><content type="html">I'm doing a bit of JPEG manipulation for a project and it took me longer than I would have liked to find a consise table of JPEG segment markers or frame markers or whatever you want to call them. Here's a C# enum with all the values. Hopefully that will save some typing for you.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;        public enum JpegMarkers&lt;/div&gt;&lt;div&gt;        {&lt;/div&gt;&lt;div&gt;            // Start of Frame markers, non-differential, Huffman coding&lt;/div&gt;&lt;div&gt;            HuffBaselineDCT = 0xFFC0,&lt;/div&gt;&lt;div&gt;            HuffExtSequentialDCT = 0xFFC1,&lt;/div&gt;&lt;div&gt;            HuffProgressiveDCT = 0xFFC2,&lt;/div&gt;&lt;div&gt;            HuffLosslessSeq = 0xFFC3,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            // Start of Frame markers, differential, Huffman coding&lt;/div&gt;&lt;div&gt;            HuffDiffSequentialDCT = 0xFFC5,&lt;/div&gt;&lt;div&gt;            HuffDiffProgressiveDCT = 0xFFC6,&lt;/div&gt;&lt;div&gt;            HuffDiffLosslessSeq = 0xFFC7,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            // Start of Frame markers, non-differential, arithmetic coding&lt;/div&gt;&lt;div&gt;            ArthBaselineDCT = 0xFFC8,&lt;/div&gt;&lt;div&gt;            ArthExtSequentialDCT = 0xFFC9,&lt;/div&gt;&lt;div&gt;            ArthProgressiveDCT = 0xFFCA,&lt;/div&gt;&lt;div&gt;            ArthLosslessSeq = 0xFFCB,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            // Start of Frame markers, differential, arithmetic coding&lt;/div&gt;&lt;div&gt;            ArthDiffSequentialDCT = 0xFFCD,&lt;/div&gt;&lt;div&gt;            ArthDiffProgressiveDCT = 0xFFCE,&lt;/div&gt;&lt;div&gt;            ArthDiffLosslessSeq = 0xFFCF,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            // Huffman table spec&lt;/div&gt;&lt;div&gt;            HuffmanTableDef = 0xFFC4,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            // Arithmetic table spec&lt;/div&gt;&lt;div&gt;            ArithmeticTableDef = 0xFFCC,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            // Restart Interval termination&lt;/div&gt;&lt;div&gt;            RestartIntervalStart = 0xFFD0,&lt;/div&gt;&lt;div&gt;            RestartIntervalEnd = 0xFFD7,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            // Other markers&lt;/div&gt;&lt;div&gt;            StartOfImage = 0xFFD8,&lt;/div&gt;&lt;div&gt;            EndOfImage = 0xFFD9,&lt;/div&gt;&lt;div&gt;            StartOfScan = 0xFFDA,&lt;/div&gt;&lt;div&gt;            QuantTableDef = 0xFFDB,&lt;/div&gt;&lt;div&gt;            NumberOfLinesDef = 0xFFDC,&lt;/div&gt;&lt;div&gt;            RestartIntervalDef = 0xFFDD,&lt;/div&gt;&lt;div&gt;            HierarchProgressionDef = 0xFFDE,&lt;/div&gt;&lt;div&gt;            ExpandRefComponents = 0xFFDF,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            // App segments&lt;/div&gt;&lt;div&gt;            App0 = 0xFFE0,&lt;/div&gt;&lt;div&gt;            App1 = 0xFFE1,&lt;/div&gt;&lt;div&gt;            App2 = 0xFFE2,&lt;/div&gt;&lt;div&gt;            App3 = 0xFFE3,&lt;/div&gt;&lt;div&gt;            App4 = 0xFFE4,&lt;/div&gt;&lt;div&gt;            App5 = 0xFFE5,&lt;/div&gt;&lt;div&gt;            App6 = 0xFFE6,&lt;/div&gt;&lt;div&gt;            App7 = 0xFFE7,&lt;/div&gt;&lt;div&gt;            App8 = 0xFFE8,&lt;/div&gt;&lt;div&gt;            App9 = 0xFFE9,&lt;/div&gt;&lt;div&gt;            App10 = 0xFFEA,&lt;/div&gt;&lt;div&gt;            App11 = 0xFFEB,&lt;/div&gt;&lt;div&gt;            App12 = 0xFFEC,&lt;/div&gt;&lt;div&gt;            App13 = 0xFFED,&lt;/div&gt;&lt;div&gt;            App14 = 0xFFEE,&lt;/div&gt;&lt;div&gt;            App15 = 0xFFEF,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            // Jpeg Extensions&lt;/div&gt;&lt;div&gt;            JpegExt0 = 0xFFF0,&lt;/div&gt;&lt;div&gt;            JpegExt1 = 0xFFF1,&lt;/div&gt;&lt;div&gt;            JpegExt2 = 0xFFF2,&lt;/div&gt;&lt;div&gt;            JpegExt3 = 0xFFF3,&lt;/div&gt;&lt;div&gt;            JpegExt4 = 0xFFF4,&lt;/div&gt;&lt;div&gt;            JpegExt5 = 0xFFF5,&lt;/div&gt;&lt;div&gt;            JpegExt6 = 0xFFF6,&lt;/div&gt;&lt;div&gt;            JpegExt7 = 0xFFF7,&lt;/div&gt;&lt;div&gt;            JpegExt8 = 0xFFF8,&lt;/div&gt;&lt;div&gt;            JpegExt9 = 0xFFF9,&lt;/div&gt;&lt;div&gt;            JpegExtA = 0xFFFA,&lt;/div&gt;&lt;div&gt;            JpegExtB = 0xFFFB,&lt;/div&gt;&lt;div&gt;            JpegExtC = 0xFFFC,&lt;/div&gt;&lt;div&gt;            JpegExtD = 0xFFFD,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            // Comments&lt;/div&gt;&lt;div&gt;            Comment = 0xFFFE,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            // Reserved&lt;/div&gt;&lt;div&gt;            ArithTemp = 0xFF01,&lt;/div&gt;&lt;div&gt;            ReservedStart = 0xFF02,&lt;/div&gt;&lt;div&gt;            ReservedEnd = 0xFFBF&lt;/div&gt;&lt;div&gt;        };&lt;/div&gt;&lt;div&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-620819030555640458?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/acRx9rSAr2y-B9E2GHs77Z5USbA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/acRx9rSAr2y-B9E2GHs77Z5USbA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/acRx9rSAr2y-B9E2GHs77Z5USbA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/acRx9rSAr2y-B9E2GHs77Z5USbA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/dKamCVkcY6E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/620819030555640458/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=620819030555640458" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/620819030555640458?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/620819030555640458?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/dKamCVkcY6E/jpeg-marker-codes.html" title="JPEG Marker codes" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2008/09/jpeg-marker-codes.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UGQHo8eyp7ImA9WxdRFU8.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-9047557553411080072</id><published>2008-06-03T16:19:00.003-04:00</published><updated>2008-06-03T16:33:41.473-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-03T16:33:41.473-04:00</app:edited><title>eApps and yum</title><content type="html">One of my new projects is hosted on eApps. While they've been great so far, I spent some time trying to get some real developer tools on my box using yum. The first problem was that php was failing with the following error:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;PHP Warning: Module 'modulename' already loaded in Unknown on line 0&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;As it turns out that means that the xls package was included in the binary, and also being declared as a dynamic package. So, to fix this I commented out the following line in the /etc/php.d/xsl.ini:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;;extension=xsl.so&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Now on to yum itself. Doing any kind of yum update resulted in the following error:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Error: Missing Dependency: glibc-common = 2.3.4-2.36 is needed by package glibc-dummy-centos-4&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;After doing a bit of research, I found that the dummy-centos-4 package isn't really necessary if you're going to be upgrading your gcc libraries anyways so away it goes.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;yum remove glibc-dummy-centos-4&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;After that I ran a full yum upgrade which worked just fine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-9047557553411080072?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6xEl6qgH81vex-1TNsSCLXCvYnY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6xEl6qgH81vex-1TNsSCLXCvYnY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6xEl6qgH81vex-1TNsSCLXCvYnY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6xEl6qgH81vex-1TNsSCLXCvYnY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/gLptlwxumzI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/9047557553411080072/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=9047557553411080072" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/9047557553411080072?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/9047557553411080072?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/gLptlwxumzI/eapps-and-yum.html" title="eApps and yum" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2008/06/eapps-and-yum.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0EHQHsyeSp7ImA9WxZaF0o.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-55583209030709727</id><published>2008-05-02T20:43:00.002-04:00</published><updated>2008-05-02T20:47:11.591-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-02T20:47:11.591-04:00</app:edited><title>Stripping Accennts From Text With PHP</title><content type="html">Most of the PHP string functions don't really work with UTF-8 encoded strings (&lt;span class="MsgBodyText"&gt;&lt;a href="http://bugs.php.net/bug.php?id=35520" target="_blank"&gt;http://bugs.php.net/bug.php?id=35520&lt;/a&gt;)&lt;/span&gt;. I found &lt;a href="http://www.symfony-project.org/forum/index.php/m/37800/"&gt;this post&lt;/a&gt; on the Symfony forums that had a solution.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;span class="MsgBodyText"&gt;&lt;pre&gt;$text = iconv('UTF-8', 'ASCII//TRANSLIT', $tex&lt;span style="font-family: Georgia,serif;"&gt;t);&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Done and done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-55583209030709727?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oEFTgn6StFPq_M9bIMofL5tHJts/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oEFTgn6StFPq_M9bIMofL5tHJts/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/oEFTgn6StFPq_M9bIMofL5tHJts/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oEFTgn6StFPq_M9bIMofL5tHJts/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/As3osHo7cNw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/55583209030709727/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=55583209030709727" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/55583209030709727?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/55583209030709727?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/As3osHo7cNw/stripping-accennts-from-text-with-php.html" title="Stripping Accennts From Text With PHP" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2008/05/stripping-accennts-from-text-with-php.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE8FQHk_cSp7ImA9WxBXFU4.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-5861822622690034737</id><published>2008-04-14T14:41:00.004-04:00</published><updated>2010-01-26T15:13:31.749-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-26T15:13:31.749-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MySQL" /><category scheme="http://www.blogger.com/atom/ns#" term="count" /><category scheme="http://www.blogger.com/atom/ns#" term="join" /><category scheme="http://www.blogger.com/atom/ns#" term="SQL" /><title>SQL Join with count</title><content type="html">For the real estate site I've been working on, I needed to get a list of real estate offices and how many active listings they had on the MySQL DB we are using. I had a table of offices and a table of listings. I needed each office represented even if that office had no active listings. It seemed like an easy application of the left join command. Not quite as easy as I thought. Here's my first attempt:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;SELECT&lt;br /&gt;COUNT(listings.id), offices.id&lt;br /&gt;FROM offices  LEFT  JOIN  listings ON (offices.id = listings.office_id)&lt;br /&gt;WHERE&lt;br /&gt;listings.status = 1&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;However, this only returned office/count pair where the count was greater than 0. It seemed like the WHERE condition wasn't being applied correctly, like it was being applied AFTER the tables were joined. I wanted the WHERE condition to be applied to the listings table and then have the results joined to the offices table. So, here's the solution I found: in situations like this, the WHERE clause needed to be added to the ON clause in the LEFT JOIN like this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;SELECT&lt;br /&gt;COUNT(listings.id), offices.id&lt;br /&gt;FROM offices  LEFT  JOIN  listings ON (offices.id = listings.office_id AND listings.status = 1)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Works like a charm.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-5861822622690034737?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-4_bk3xRiI7oFkOtt6fVrB4IQUQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-4_bk3xRiI7oFkOtt6fVrB4IQUQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-4_bk3xRiI7oFkOtt6fVrB4IQUQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-4_bk3xRiI7oFkOtt6fVrB4IQUQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/qE3rD_Qv3Nk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/5861822622690034737/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=5861822622690034737" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/5861822622690034737?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/5861822622690034737?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/qE3rD_Qv3Nk/mysql-join-with-count.html" title="SQL Join with count" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>4</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2008/04/mysql-join-with-count.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMNRHs8fyp7ImA9WxZUE08.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-5730971336955869269</id><published>2008-04-04T11:17:00.004-04:00</published><updated>2008-04-04T11:54:55.577-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-04T11:54:55.577-04:00</app:edited><title>Dynamic Credentials in Symfony</title><content type="html">For a long time now I've been using dynamic credentials in Symfony as laid out in this code snippit: &lt;a href="http://www.symfony-project.org/snippets/snippet/18"&gt;http://www.symfony-project.org/snippets/snippet/18&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;pre class="php"&gt;&lt;span class="co1"&gt;// to put in the actions.class.php file&lt;/span&gt;&lt;br /&gt;&lt;span class="kw2"&gt;function&lt;/span&gt; getCredential&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span class="br0"&gt;{&lt;/span&gt;&lt;br /&gt;  &lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;post&lt;/span&gt; = &lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;_retrievePost&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;; &lt;span class="co1"&gt;// retrieving the object based on the request parameters&lt;/span&gt;&lt;br /&gt;  &lt;span class="kw1"&gt;if&lt;/span&gt; &lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;getUser&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;-&gt;&lt;span class="me1"&gt;isOwnerOf&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;post&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;getUser&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;-&gt;&lt;span class="me1"&gt;addCredential&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="st0"&gt;'owner'&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;  &lt;span class="kw1"&gt;else&lt;/span&gt;&lt;br /&gt;    &lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;getUser&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;-&gt;&lt;span class="me1"&gt;removeCredential&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="st0"&gt;'owner'&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;  &lt;span class="co1"&gt;// the hijack is over, let the normal flow continue:&lt;/span&gt;&lt;br /&gt;  &lt;span class="kw1"&gt;return&lt;/span&gt; parent::&lt;span class="me2"&gt;getCredential&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span class="br0"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;However, it seems like this isn't really the proper way to add dynamic credentials. The getCredential() method is called by the Symfony FilterChain to discover what credentials that module &lt;span style="font-style: italic;"&gt;requires,&lt;/span&gt; not to add credentials to the user.&lt;br /&gt;&lt;br /&gt;For me, the problem cam to a head when I was trying to show a link if a user had a particular credential. The problem was that the page with the link was not a secure page. Since the page was not secute (is_secure: off in the config/security.yml file) the getCretential() method was never called.&lt;br /&gt;&lt;br /&gt;The solution is to use the preExecute() method instead of getCredential()&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;pre class="php"&gt;&lt;span class="co1"&gt;// to put in the actions.class.php file&lt;/span&gt;&lt;br /&gt;&lt;span class="kw2"&gt;function&lt;/span&gt; preExecute&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span class="br0"&gt;{&lt;/span&gt;&lt;br /&gt;  &lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;post&lt;/span&gt; = &lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;_retrievePost&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;; &lt;span class="co1"&gt;// retrieving the object based on the request parameters&lt;/span&gt;&lt;br /&gt;  &lt;span class="kw1"&gt;if&lt;/span&gt; &lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;getUser&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;-&gt;&lt;span class="me1"&gt;isOwnerOf&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;post&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;getUser&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;-&gt;&lt;span class="me1"&gt;addCredential&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="st0"&gt;'owner'&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;  else&lt;br /&gt;    $&lt;code&gt;this-&gt;getUser()-&gt;removeCredential('owner');&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span class="co1"&gt;// the hijack is over, let the normal flow continue:&lt;/span&gt;&lt;br /&gt;  &lt;span class="kw1"&gt;return&lt;/span&gt; parent::&lt;span class="me2"&gt;getCredential&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span class="br0"&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;code&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-5730971336955869269?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MAZrOAEf-V48VUnUFB4y_fuSv60/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MAZrOAEf-V48VUnUFB4y_fuSv60/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MAZrOAEf-V48VUnUFB4y_fuSv60/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MAZrOAEf-V48VUnUFB4y_fuSv60/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/yZA09mCQXJc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/5730971336955869269/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=5730971336955869269" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/5730971336955869269?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/5730971336955869269?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/yZA09mCQXJc/dynamic-credentials-in-symfony.html" title="Dynamic Credentials in Symfony" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>6</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2008/04/dynamic-credentials-in-symfony.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04GRHYyfyp7ImA9WxZXGE4.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-1706217905652033689</id><published>2008-03-06T16:34:00.000-05:00</published><updated>2008-03-06T16:45:25.897-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-03-06T16:45:25.897-05:00</app:edited><title>Accent mode in Emacs 22</title><content type="html">For a long time I used the emacs iso-accents-mode for my editing in Spanish. Looks like this has finally been removed from the standard emacs distros, so I had to figure out whatever they replaced it with. Here's what I (eventually) found: To get the same functionality as the old iso-accents-mode, you need to change the input mode. The official doc can be found &lt;a href="http://cricket.ipsyn.net/software/emacs/manual/html_mono/emacs.html.gz#Select-Input-Method"&gt;here&lt;/a&gt;, but here are the basic commands.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;M-x list-input-methods&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;C-x RETURN C-\ &lt;i&gt;method&lt;/i&gt; RETURN&lt;br /&gt;&lt;/code&gt;This is how to select the input method.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;C-\&lt;br /&gt;&lt;/code&gt;Toggles the input mode on/off. Pretty useful.&lt;br /&gt;&lt;br /&gt;The mode I use is &lt;code&gt;latin-1-prefix&lt;/code&gt;. It should be familiar to the iso-accents-mode followers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-1706217905652033689?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Vgo06pUU-7r8YMJcX06XPnGcfSk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Vgo06pUU-7r8YMJcX06XPnGcfSk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Vgo06pUU-7r8YMJcX06XPnGcfSk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Vgo06pUU-7r8YMJcX06XPnGcfSk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/y_Zv8Ge5JSc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/1706217905652033689/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=1706217905652033689" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/1706217905652033689?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/1706217905652033689?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/y_Zv8Ge5JSc/accent-mode-in-emacs-22.html" title="Accent mode in Emacs 22" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2008/03/accent-mode-in-emacs-22.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0cFQnYzeip7ImA9WxdQEUw.&quot;"><id>tag:blogger.com,1999:blog-3034834282750107175.post-8062745689491406695</id><published>2008-03-06T09:40:00.002-05:00</published><updated>2008-06-10T12:23:33.882-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-10T12:23:33.882-04:00</app:edited><title>Loading NetFlix Prize Data into MySQL</title><content type="html">I may be a year late, but I decided to enter into the &lt;a href="http://www.netflixprize.com/"&gt;NetFlix Prize&lt;/a&gt; contest the other day. I've already got MySQL (Lampp) running on my box (Fedora 8) so I decided to load the data into my DB to do some basic analytics. There's some good info out there, but nothing that encompassed all the steps I took, so I'm going to repeat my process here.&lt;br /&gt;&lt;br /&gt;1. Enter the Contest and download the dataset. Nothing too complicated here, you just need a unique team name and an email address.&lt;br /&gt;&lt;br /&gt;2. Get Ruby where it needs to be. For this I used yum to install both the ruby and ruby-devel packages.&lt;br /&gt;&lt;br /&gt;2a. Then you need to download and install Ruby/MySQL. Here are the basic steps from &lt;a href="http://lafcadio.rubyforge.org/manual/ch02s02.html"&gt;http://lafcadio.rubyforge.org/manual/ch02s02.html&lt;/a&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;wget http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.tar.gz&lt;br /&gt;tar zxvf mysql-ruby-2.7.tar.gz&lt;br /&gt;cd mysql-ruby-2.7&lt;br /&gt;ruby extconf.rb --with-mysql-config&lt;br /&gt;make&lt;br /&gt;ruby test.rb [hostname] [username] [dbpassword]&lt;br /&gt;sudo make install&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;2b. After that is all set and you can connect to the MySQL w/ the test.rb script, download the ruby DBI from here: &lt;a href="http://www.kitebird.com/articles/ruby-dbi.html#TOC_3"&gt;http://www.kitebird.com/articles/ruby-dbi.html#TOC_3&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;wget http://rubyforge.org/frs/download.php/12368/dbi-0.1.1.tar.gz&lt;br /&gt;tar zxvf dbi-0.1.1.tar.gz&lt;br /&gt;ruby setup.rb config --with=dbi,dbd_mysql&lt;br /&gt;ruby setup.rb setup&lt;br /&gt;sudo ruby setup.rb install&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;In the config command, I chose to only include the MySQL packages of the DBI. I think it's generally better to only include the packages you want as opposed to always including everything. If you don't specify which DB packages you want, the installer will assume you want everything. If you don't have all of the required development packages already on your machine (ie oracle and sybase) you'll get into errors when you run the setup command.&lt;br /&gt;&lt;br /&gt;3. Now find a ruby script to load the data. I used this one from &lt;a href="http://www.juretta.com/log/2007/04/24/loading_the_netflix_dataset_into_mysql/"&gt;juretta:&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#!/usr/bin/ruby&lt;br /&gt;#&lt;br /&gt;#  Created by Stefan Saasen on 2007-04-24.&lt;br /&gt;#  Copyright (c) 2007. All rights reserved.&lt;br /&gt;require 'dbi'         &lt;br /&gt;&lt;br /&gt;# Configuration&lt;br /&gt;DB_DATABASE   = 'netflix'&lt;br /&gt;DB_USER       = 'user'&lt;br /&gt;DB_PASSWORD   = '******'&lt;br /&gt;           &lt;br /&gt;# Directory with netflix dataset&lt;br /&gt;NETFLIX_DOWNLOAD_DIR = File.join("/sata_ext/net_flix")&lt;br /&gt;&lt;br /&gt;NETFLIX_MOVIE_TITLES = File.join(NETFLIX_DOWNLOAD_DIR, "movie_titles.txt")&lt;br /&gt;NETFLIX_TRAINING_SET = File.join(NETFLIX_DOWNLOAD_DIR, "training_set")&lt;br /&gt;&lt;br /&gt;# Profile...&lt;br /&gt;start = Time.now&lt;br /&gt;&lt;br /&gt;# Connect to the MySQL database&lt;br /&gt;DBI.connect("DBI:Mysql:#{DB_DATABASE}", DB_USER, DB_PASSWORD) do |dbh|&lt;br /&gt;# create the necessary tables&lt;br /&gt;stmts = DATA.read.split(";").delete_if{|stmt| stmt.strip.empty?}&lt;br /&gt;stmts.each do |stmt|&lt;br /&gt;  # Execute the current SQL statement&lt;br /&gt;  dbh.do(stmt)&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# 1. Insert movie titles into movie_titles table using simple INSERT STATEMENTS&lt;br /&gt;sql = "INSERT INTO movie_titles (id, year_of_release, title) VALUES(?,?,?)"&lt;br /&gt;# It would be even more efficient to use INSERT statements that&lt;br /&gt;# use VALUES syntax which can insert multiple rows.&lt;br /&gt;# e.g. INSERT INTO movie_titles (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);&lt;br /&gt;dbh.prepare(sql) do |sth|&lt;br /&gt;  File.open(NETFLIX_MOVIE_TITLES) do |f|&lt;br /&gt;     f.each do |line|&lt;br /&gt;       # Execute the prepared INSERT Statement&lt;br /&gt;       id, year_of_release, title = line.split(",")&lt;br /&gt;       sth.execute id.to_i, year_of_release.strip, title.strip&lt;br /&gt;     end&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# 2. Insert rating data from training_set using the fast LOAD DATA INFILE syntax&lt;br /&gt;# The filename contains the movie id!&lt;br /&gt;sql = "LOAD DATA INFILE ? INTO TABLE ratings FIELDS TERMINATED BY ',' "+&lt;br /&gt;      "IGNORE 1 LINES (customer_id, rating, date) SET movie_id = ?;"&lt;br /&gt;dbh.prepare(sql) do |sth|&lt;br /&gt;  Dir[NETFLIX_TRAINING_SET + "/*.txt"].each do |trs_file|&lt;br /&gt;    puts "Importing #{trs_file}..."&lt;br /&gt;    if trs_file =~ /([0-9]+)\.txt$/&lt;br /&gt;      movie_id = $1.dup.to_i&lt;br /&gt;    else&lt;br /&gt;      raise "Missing movie_id (file: #{trs_file})"&lt;br /&gt;    end&lt;br /&gt;    # Execute the prepared statement using the .txt file and the movie_id&lt;br /&gt;    sth.execute File.expand_path(trs_file), movie_id&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# Add index for certain columns&lt;br /&gt;#puts "Creating index on the ratings table - may take a while"&lt;br /&gt;#["CREATE INDEX mid_idx ON ratings (...)", "CREATE INDEX cid_idx ON ..."].each{|stmt| dbh.do(stmt)}           &lt;br /&gt;end&lt;br /&gt;puts "Import successfully finished!\n"&lt;br /&gt;puts "The netflix data import took #{sprintf("%0.2f", (Time.now - start)/60.0)} minutes"&lt;br /&gt;&lt;br /&gt;__END__&lt;br /&gt;DROP DATABASE IF EXISTS netflix;&lt;br /&gt;CREATE DATABASE netflix /*!40100 DEFAULT CHARACTER SET latin1 */;&lt;br /&gt;USE netflix;&lt;br /&gt;&lt;br /&gt;DROP TABLE IF EXISTS `movie_titles`;&lt;br /&gt;CREATE TABLE `movie_titles` (&lt;br /&gt;`id` int(11) NOT NULL,&lt;br /&gt;`year_of_release` YEAR(4) default NULL,&lt;br /&gt;`title` VARCHAR(250),&lt;br /&gt;PRIMARY KEY  (`id`)&lt;br /&gt;) ENGINE=MyISAM DEFAULT CHARSET=latin1;&lt;br /&gt;&lt;br /&gt;DROP TABLE IF EXISTS `ratings`;&lt;br /&gt;CREATE TABLE `ratings` (&lt;br /&gt;`id` int(11) NOT NULL auto_increment,&lt;br /&gt;`movie_id` int(11) NOT NULL,&lt;br /&gt;`customer_id` int(11) NOT NULL,&lt;br /&gt;`date` date default NULL,&lt;br /&gt;`rating` int(1),&lt;br /&gt;PRIMARY KEY  (`id`)&lt;br /&gt;) ENGINE=MyISAM DEFAULT CHARSET=latin1;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The last part there are the SQL commands to create the tables needed for this script.&lt;br /&gt;&lt;br /&gt;I loaded all of the data onto my machine (Dual Intel 2.13 GHz w/ 1GB RAM) in about 13 minutes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3034834282750107175-8062745689491406695?l=techstumbler.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1FZehz_fv3xUkkpS8btQ7oWHS8I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1FZehz_fv3xUkkpS8btQ7oWHS8I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1FZehz_fv3xUkkpS8btQ7oWHS8I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1FZehz_fv3xUkkpS8btQ7oWHS8I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Techstumbler/~4/fR8YnBDp1BE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techstumbler.blogspot.com/feeds/8062745689491406695/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3034834282750107175&amp;postID=8062745689491406695" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/8062745689491406695?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3034834282750107175/posts/default/8062745689491406695?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Techstumbler/~3/fR8YnBDp1BE/loading-netflix-prize-data-into-mysql.html" title="Loading NetFlix Prize Data into MySQL" /><author><name>TH</name><uri>http://www.blogger.com/profile/04929065984151212386</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://techstumbler.blogspot.com/2008/03/loading-netflix-prize-data-into-mysql.html</feedburner:origLink></entry></feed>

