<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Repeated Overflows</title>
	<atom:link href="http://code.christophervigliotti.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://code.christophervigliotti.com</link>
	<description>Christopher Vigliotti often speaks in CSS, ColdFusion, Flash, Grails, Java, JavaScript, Selenium and SQL</description>
	<lastBuildDate>Thu, 25 Apr 2013 20:32:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Widgets Ahoy, The Two-Hour MVC Framework</title>
		<link>http://code.christophervigliotti.com/2013/04/widgets-ahoy-the-two-hour-mvc-framework/</link>
		<comments>http://code.christophervigliotti.com/2013/04/widgets-ahoy-the-two-hour-mvc-framework/#comments</comments>
		<pubDate>Thu, 25 Apr 2013 20:32:56 +0000</pubDate>
		<dc:creator>Christopher Vigliotti</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://code.christophervigliotti.com/?p=614</guid>
		<description><![CDATA[What does this ColdFusion developer do in his spare time? If you answered &#8216;write a custom MVC framework in two hours&#8217; then you answered correctly. Initially I hesitated to share this, as it is nowhere close to finished (and probably never will be). But I decided to throw caution to the wind and offer it [...]]]></description>
			<content:encoded><![CDATA[<p>What does this ColdFusion developer do in his spare time?  If you answered &#8216;write a custom MVC framework in two hours&#8217; then you answered correctly.  Initially I hesitated to share this, as it is nowhere close to finished (and probably never will be).  But I decided to throw caution to the wind and offer it up for ridicule and scrutiny.  Here&#8217;s a list of what I was able to accomplish in two hours&#8230;</p>
<ul>
<li>Create a spiffy directory structure</li>
<li>Add model, view and controller logic</li>
<li>integrate jquery, datatables.net and bootstrap (although I do get a warning when datatables loads)</li>
<li>Create a controller layer that allows for persistant variables when forwarding to one action to the next (like the flash scope in Grails)</li>
</ul>
<p>If I were to spend any more time on this project I would explore </p>
<ul>
<li>Moving the controller layer to cfcs</li>
<li>Switching from a [url]?action=section.action convention to a [url]/section/ation/ convention</li>
<li>Integrate ColdFusion&#8217;s built-in ORM goodness to the model</li>
<li>Actually make the sample application to work (adding CRUD features for the &#8216;widget&#8217; entity)</li>
<li>Switching out the awesome Bootstrap front-end framework for the even more awesome <a href="http://foundation.zurb.com/">Foundation front-end framework</a></li>
</ul>
<p>If you are looking for a good ColdFusion framework I insist that you look elsewhere.  ColdBox, CFWheels, FW/1 and Model Glue are all really good.</p>
<p>Without further rambling I present the 0.2 release of <a href="http://code.christophervigliotti.com/wp-content/uploads/2013/04/widgetsAhoy-0.2.zip">Widgets Ahoy</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://code.christophervigliotti.com/2013/04/widgets-ahoy-the-two-hour-mvc-framework/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>An Ode To A Node</title>
		<link>http://code.christophervigliotti.com/2013/02/an-ode-to-a-node/</link>
		<comments>http://code.christophervigliotti.com/2013/02/an-ode-to-a-node/#comments</comments>
		<pubDate>Thu, 28 Feb 2013 21:40:35 +0000</pubDate>
		<dc:creator>Christopher Vigliotti</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://code.christophervigliotti.com/?p=612</guid>
		<description><![CDATA[I had a requirement pop up recently that had me fiddling with jqTree. I wanted to be able to add a new parent or sibling node to a tree. Thankfully the author of jqTree provided the addParentNode() and addNodeAfter() functions. First I created a page that allowed me to add a new parent or sibling [...]]]></description>
			<content:encoded><![CDATA[<p>I had a requirement pop up recently that had me fiddling with <a href="http://mbraak.github.com/jqTree/">jqTree</a>.  I wanted to be able to add a new parent or sibling node to a tree.  Thankfully the author of jqTree provided the addParentNode() and addNodeAfter() functions.</p>
<p>First I created a page that allowed me to add a new parent or sibling node to node id 1&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>jqTree Example <span style="color: #CC0000;">1</span><span style="color: #339933;">:</span> adding a <span style="color: #000066; font-weight: bold;">new</span> parent node and<span style="color: #339933;">/</span>or a sibling node to node id <span style="color: #CC0000;">1</span><span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>	
<span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://code.jquery.com/jquery-1.8.3.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;scripts/tree.jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>link rel<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;stylesheet&quot;</span> href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;jqtree.css&quot;</span><span style="color: #339933;">&gt;</span>		
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>	
&nbsp;
	<span style="color: #006600; font-style: italic;">// get the data</span>
	<span style="color: #000066; font-weight: bold;">var</span> data <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>
	    <span style="color: #009900;">&#123;</span>
	        label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'node1'</span><span style="color: #339933;">,</span>
	        id<span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> 
	        children<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
	            <span style="color: #009900;">&#123;</span> 
	            	label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'child1'</span><span style="color: #339933;">,</span>
	            	id<span style="color: #339933;">:</span> <span style="color: #CC0000;">2</span> 
	            <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	            <span style="color: #009900;">&#123;</span> 
	            	label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'child2'</span><span style="color: #339933;">,</span>
	            	id<span style="color: #339933;">:</span> <span style="color: #CC0000;">3</span> 
	            <span style="color: #009900;">&#125;</span>
	        <span style="color: #009900;">&#93;</span>
	    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	    <span style="color: #009900;">&#123;</span>
	        label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'node2'</span><span style="color: #339933;">,</span>
	        id<span style="color: #339933;">:</span> <span style="color: #CC0000;">4</span><span style="color: #339933;">,</span>
	        children<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
	            <span style="color: #009900;">&#123;</span> 
	            	label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'child3'</span><span style="color: #339933;">,</span>
	            	id<span style="color: #339933;">:</span> <span style="color: #CC0000;">5</span> 
	            <span style="color: #009900;">&#125;</span>
	        <span style="color: #009900;">&#93;</span>
	    <span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">// Create tree widget</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tree1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tree</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	        data<span style="color: #339933;">:</span> data<span style="color: #339933;">,</span>
	        autoOpen<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	        saveState<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span>
	    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">// add a listener for the addParent button</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#addParent&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #006600; font-style: italic;">// get the tree					</span>
		<span style="color: #000066; font-weight: bold;">var</span> $tree <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tree1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #006600; font-style: italic;">// get the node with id 1</span>
		<span style="color: #000066; font-weight: bold;">var</span> node <span style="color: #339933;">=</span> $tree.<span style="color: #660066;">tree</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'getNodeById'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #006600; font-style: italic;">// add a parent node to node id 1</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tree1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tree</span><span style="color: #009900;">&#40;</span>
		    <span style="color: #3366CC;">'addParentNode'</span><span style="color: #339933;">,</span>
		    <span style="color: #009900;">&#123;</span>
		        label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'new parent added to node1'</span><span style="color: #339933;">,</span>
		        id<span style="color: #339933;">:</span> <span style="color: #CC0000;">6</span>
		    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
		    node
		<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>				
&nbsp;
	<span style="color: #006600; font-style: italic;">// add a listener for the addNodeAfter button</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#addNodeAfter&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #006600; font-style: italic;">// get the tree</span>
		<span style="color: #000066; font-weight: bold;">var</span> $tree <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tree1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #006600; font-style: italic;">// get the node with id 1</span>
		<span style="color: #000066; font-weight: bold;">var</span> node <span style="color: #339933;">=</span> $tree.<span style="color: #660066;">tree</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'getNodeById'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #006600; font-style: italic;">// add a parent node to the node id 1</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tree1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tree</span><span style="color: #009900;">&#40;</span>
		    <span style="color: #3366CC;">'addNodeAfter'</span><span style="color: #339933;">,</span>
		    <span style="color: #009900;">&#123;</span>
		        label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'new node added after node1'</span><span style="color: #339933;">,</span>
		        id<span style="color: #339933;">:</span> <span style="color: #CC0000;">6</span>
		    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
		    node
		<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;button&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;addParent&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;addParent&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;button&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;addNodeAfter&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;addNodeAfter&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;tree1&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Next I tweaked the code so that it created a new parent or sibling node for the last clicked node.  The secret sauce here is to bind to tree.click so that I could store the last clicked node in a variable (for use in other functions).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>jqTree Example <span style="color: #CC0000;">2</span><span style="color: #339933;">:</span> adding a <span style="color: #000066; font-weight: bold;">new</span> parent node and<span style="color: #339933;">/</span>or a sibling node to the last node clicked<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>	
<span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://code.jquery.com/jquery-1.8.3.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;scripts/tree.jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>link rel<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;stylesheet&quot;</span> href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;jqtree.css&quot;</span><span style="color: #339933;">&gt;</span>		
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// any time a node is clicked we will store it in this variable (see below)</span>
<span style="color: #000066; font-weight: bold;">var</span> clickedNode <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>	
&nbsp;
	<span style="color: #006600; font-style: italic;">// get the data</span>
	<span style="color: #000066; font-weight: bold;">var</span> data <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>
	    <span style="color: #009900;">&#123;</span>
	        label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'node1'</span><span style="color: #339933;">,</span>
	        id<span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> 
	        children<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
	            <span style="color: #009900;">&#123;</span> 
	            	label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'child1'</span><span style="color: #339933;">,</span>
	            	id<span style="color: #339933;">:</span> <span style="color: #CC0000;">2</span> 
	            <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	            <span style="color: #009900;">&#123;</span> 
	            	label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'child2'</span><span style="color: #339933;">,</span>
	            	id<span style="color: #339933;">:</span> <span style="color: #CC0000;">3</span> 
	            <span style="color: #009900;">&#125;</span>
	        <span style="color: #009900;">&#93;</span>
	    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	    <span style="color: #009900;">&#123;</span>
	        label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'node2'</span><span style="color: #339933;">,</span>
	        id<span style="color: #339933;">:</span> <span style="color: #CC0000;">4</span><span style="color: #339933;">,</span>
	        children<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
	            <span style="color: #009900;">&#123;</span> 
	            	label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'child3'</span><span style="color: #339933;">,</span>
	            	id<span style="color: #339933;">:</span> <span style="color: #CC0000;">5</span> 
	            <span style="color: #009900;">&#125;</span>
	        <span style="color: #009900;">&#93;</span>
	    <span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">// Create tree widget</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tree1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tree</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	        data<span style="color: #339933;">:</span> data<span style="color: #339933;">,</span>
	        autoOpen<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	        saveState<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span>
	    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">// add a listener for the addParent button</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#addParent&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #006600; font-style: italic;">// if at least one node has been clicked</span>
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>clickedNode <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #006600; font-style: italic;">// add a new parent to the clicked node</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tree1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tree</span><span style="color: #009900;">&#40;</span>
			    <span style="color: #3366CC;">'addParentNode'</span><span style="color: #339933;">,</span>
			    <span style="color: #009900;">&#123;</span>
			        label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'new parent added to node1'</span><span style="color: #339933;">,</span>
			        id<span style="color: #339933;">:</span> <span style="color: #CC0000;">6</span>
			    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
			    clickedNode
			<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>				
&nbsp;
&nbsp;
	<span style="color: #006600; font-style: italic;">// add a listener for the addNodeAfter button</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#addNodeAfter&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #006600; font-style: italic;">// if at least one node has been clicked</span>
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>clickedNode <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #006600; font-style: italic;">// add a new node after the clicked node</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tree1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tree</span><span style="color: #009900;">&#40;</span>
			    <span style="color: #3366CC;">'addNodeAfter'</span><span style="color: #339933;">,</span>
			    <span style="color: #009900;">&#123;</span>
			        label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'new node added after node1'</span><span style="color: #339933;">,</span>
			        id<span style="color: #339933;">:</span> <span style="color: #CC0000;">6</span>
			    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
			    clickedNode
			<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #006600; font-style: italic;">// bind the 'tree.click' event (fires each time the tree is clicked)</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tree1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span>
    <span style="color: #3366CC;">'tree.click'</span><span style="color: #339933;">,</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">// write the clicked node to the variable, for use </span>
        <span style="color: #006600; font-style: italic;">// in the addParent and addNodeAfter listeners above</span>
        clickedNode <span style="color: #339933;">=</span> event.<span style="color: #660066;">node</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;button&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;addParent&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;add parent to selected item&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;button&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;addNodeAfter&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;add node after selected item&quot;</span> <span style="color: #339933;">/&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;tree1&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Until next time, fellow code monkeys!</p>
]]></content:encoded>
			<wfw:commentRss>http://code.christophervigliotti.com/2013/02/an-ode-to-a-node/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Quick Fix For Undelivered Mail</title>
		<link>http://code.christophervigliotti.com/2012/12/a-quick-fix-for-undelivered-mail/</link>
		<comments>http://code.christophervigliotti.com/2012/12/a-quick-fix-for-undelivered-mail/#comments</comments>
		<pubDate>Thu, 20 Dec 2012 20:59:36 +0000</pubDate>
		<dc:creator>Christopher Vigliotti</dc:creator>
				<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://code.christophervigliotti.com/?p=611</guid>
		<description><![CDATA[Hello once again ColdFusion fans. I wish I had more time to blog about my adventures over the last six months (there have been many), but alas I do not. I was able to take a few minutes to share this with you, hope you find it helpful&#8230; One of the reasons why I love [...]]]></description>
			<content:encoded><![CDATA[<p>Hello once again ColdFusion fans.   I wish I had more time to blog about my adventures over the last six months (there have been many), but alas I do not.  I was able to take a few minutes to share this with you, hope you find it helpful&#8230;</p>
<p>One of the reasons why I love ColdFusion is that it allows me to solve problems quickly.  Today I ran into an issue where we had to move to a new mail server.  I had HUNDREDS of email messages in the undelivered folder that needed to be re-sent after the move was completed.</p>
<p>After moving to the new mail server and attempting to move the messages to the Spool folder the messages kept re-appearing in the undelivered folder.  Even though I specified a new mail server in ColdFusion Administrator the old messages were still tied to the old server and were bouncing back.  </p>
<p>So I wrote this code to solve the problem.  Feel free to co-opt it, take full credit for it, add this feature to <a href="http://www.raymondcamden.com/index.cfm">Ray Camden</a>&#8216;s  <a href="http://spoolmail.riaforge.org/">SpoolMail</a> project (I did swipe a few lines of his code from SpoolMail for this) or get a face tattoo of the source code.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span>
	// declare variables 
	request.emailMessage = &quot;&quot;;
	request.maildir = server.coldfusion.rootdir &amp; &quot;/Mail/Undelivr/&quot;;
	request.messagesListQuery = &quot;&quot;;
	request.newMailServerAndPort = &quot;new.servername.goes.here:25&quot;;
	request.oldMailServerAndPort = &quot;old.servername.goes.here:25&quot;;
	request.spooldir = server.coldfusion.rootdir &amp; &quot;/Mail/Spool/&quot;;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!--- get the undelivered messages ---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfdirectory</span> <span style="color: #0000FF;">action</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;list&quot;</span> </span>
<span style="color: #333333;">	<span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;request.messagesListQuery&quot;</span> </span>
<span style="color: #333333;">	directory<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#request.maildir#&quot;</span> </span>
<span style="color: #333333;">	filter<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;*.cfmail&quot;</span> </span>
<span style="color: #333333;">	sort<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;datelastmodified desc&quot;</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!--- loop through the list of messages ---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span> <span style="color: #0000FF;">query</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;request.messagesListQuery&quot;</span><span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #808080; font-style: italic;">&lt;!--- read a message ---&gt;</span>
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cffile</span> <span style="color: #0000FF;">action</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;read&quot;</span> file<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#request.maildir#/#name#&quot;</span> variable<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;request.emailMessage&quot;</span><span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #808080; font-style: italic;">&lt;!--- if the old mail server is present in the email... ---&gt;</span>
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span> <span style="color: #0000FF;">FindNoCase</span><span style="color: #0000FF;">&#40;</span>request.oldMailServerAndPort,request.emailMessage<span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #808080; font-style: italic;">&lt;!--- ...then swap it out with the new mail server ---&gt;</span>
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> request.emailMessage <span style="color: #0000FF;">=</span> </span>
<span style="color: #333333;">		<span style="color: #0000FF;">ReplaceNoCase</span><span style="color: #0000FF;">&#40;</span>request.emailMessage, request.oldMailServerAndPort, request.newMailServerAndPort<span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">/&gt;</span></span>
	<span style="color: #808080; font-style: italic;">&lt;!--- write the file to the spool directory + delete the old message ---&gt;</span>
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cffile</span> <span style="color: #0000FF;">action</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;write&quot;</span> file<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#request.spooldir#/#name#&quot;</span> output<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#request.emailMessage#&quot;</span><span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cffile</span> <span style="color: #0000FF;">action</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;delete&quot;</span> file<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#request.maildir#/#name#&quot;</span><span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #808080; font-style: italic;">&lt;!--- display the results ---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #0000FF;">#request.messagesListQuery.recordcount#</span> messages that were set to be delivered to server 
	<span style="color: #0000FF;">#request.oldMailServerAndPort#</span> have will now be re-sent using server 
	<span style="color: #0000FF;">#request.newMailServerAndPort#</span>.  Have a nice day.
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span></pre></td></tr></table></div>

<p>Once again ColdFusion helped me to quickly solve a problem.  Face tattoo sold separately. </p>
]]></content:encoded>
			<wfw:commentRss>http://code.christophervigliotti.com/2012/12/a-quick-fix-for-undelivered-mail/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Now Hiring</title>
		<link>http://code.christophervigliotti.com/2012/10/now-hiring/</link>
		<comments>http://code.christophervigliotti.com/2012/10/now-hiring/#comments</comments>
		<pubDate>Tue, 09 Oct 2012 20:12:59 +0000</pubDate>
		<dc:creator>Christopher Vigliotti</dc:creator>
				<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://code.christophervigliotti.com/?p=608</guid>
		<description><![CDATA[UPDATE: We&#8217;re no longer accepting applications or other correspondence for this position. The small, fast-paced educational startup where I work is hiring!  We&#8217;re busy, we&#8217;re growing and are we&#8217;re looking for an exceptional developer who wants to build something great.  I&#8217;m looking for a world-class senior-level ColdFusion and SQL Server Developer.  Do you&#8230; have 7+ [...]]]></description>
			<content:encoded><![CDATA[<p>UPDATE: We&#8217;re no longer accepting applications or other correspondence for this position.  </p>
<p><del datetime="2012-10-15T13:54:53+00:00">The small, fast-paced educational startup where I work is hiring!  We&#8217;re busy, we&#8217;re growing and are we&#8217;re looking for an exceptional developer who wants to build something great.  I&#8217;m looking for a world-class senior-level ColdFusion and SQL Server Developer.  Do you&#8230;</del></p>
<ul>
<li><del>have 7+ years of solid experience with ColdFusion and SQL Server?</del></li>
<li><del>have experience with ColdFusion frameworks?</del></li>
<li><del>have the drive to work remotely?</del></li>
<li><del>have the skill to work with a small team on both on legacy and new ColdFusion-based systems?</del></li>
</ul>
<p><del>If you answered yes to the above four questions and are interested in a change then please send your resume in Word format via email to <a href="mailto:cvigliotti@presassociates.com">cvigliotti@presassociates.com</a> with the characters &#8216;CFJOB&#8217; in the subject.  At this point this is a contract-level position and I am not accepting resumes from third parties of any kind.  Thanks!</del></p>
]]></content:encoded>
			<wfw:commentRss>http://code.christophervigliotti.com/2012/10/now-hiring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ColdFusion 10</title>
		<link>http://code.christophervigliotti.com/2012/07/coldfusion-10-2/</link>
		<comments>http://code.christophervigliotti.com/2012/07/coldfusion-10-2/#comments</comments>
		<pubDate>Mon, 23 Jul 2012 07:01:55 +0000</pubDate>
		<dc:creator>Christopher Vigliotti</dc:creator>
				<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://code.christophervigliotti.com/?p=602</guid>
		<description><![CDATA[My quest to be the last developer to blog about ColdFusion 10 is over! This will come as news to nobody in the community, but ColdFusion 10 is here. I&#8217;m looking forward to checking it out, and am particularly interested in tinkering with the enhanced ORM goodness (which I have exposure to in Groovy/Grails). I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>My quest to be the last developer to blog about ColdFusion 10 is over!  This will come as news to nobody in the community, but ColdFusion 10 is here.  I&#8217;m looking forward to checking it out, and am particularly interested in tinkering with the enhanced ORM goodness (which I have exposure to in Groovy/Grails).  I&#8217;m also glad to see Adobe pair ColdFusion 10 up with Solr and Tomcat.  Go ColdFusion!</p>
]]></content:encoded>
			<wfw:commentRss>http://code.christophervigliotti.com/2012/07/coldfusion-10-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Reviews</title>
		<link>http://code.christophervigliotti.com/2012/07/code-review/</link>
		<comments>http://code.christophervigliotti.com/2012/07/code-review/#comments</comments>
		<pubDate>Mon, 23 Jul 2012 06:59:14 +0000</pubDate>
		<dc:creator>Christopher Vigliotti</dc:creator>
				<category><![CDATA[Process Improvement]]></category>
		<category><![CDATA[Software Quality]]></category>

		<guid isPermaLink="false">http://code.christophervigliotti.com/?p=604</guid>
		<description><![CDATA[My friend and fellow ColdFusion developer Dave Leeds&#8217; blog Hit The Bits! is fast becoming one of my favorite developer blogs. His recent post on Code Reviews is right on the money.]]></description>
			<content:encoded><![CDATA[<p>My friend and fellow ColdFusion developer Dave Leeds&#8217; blog <a href="http://www.hitthebits.com/">Hit The Bits!</a> is fast becoming one of my favorite developer blogs.  His recent post on <a href="http://www.hitthebits.com/2012/07/code-review-best-practices-everyone.html">Code Reviews</a> is right on the money.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.christophervigliotti.com/2012/07/code-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Major Selenium IDE Upgrade</title>
		<link>http://code.christophervigliotti.com/2012/07/major-selenium-ide-upgrade/</link>
		<comments>http://code.christophervigliotti.com/2012/07/major-selenium-ide-upgrade/#comments</comments>
		<pubDate>Fri, 20 Jul 2012 18:16:09 +0000</pubDate>
		<dc:creator>Christopher Vigliotti</dc:creator>
				<category><![CDATA[Selenium]]></category>

		<guid isPermaLink="false">http://code.christophervigliotti.com/?p=600</guid>
		<description><![CDATA[I&#8217;ve been following the comments on this blog post and am anxiously awaiting an upcoming release to Selenium IDE that will feature Selenium WebDriver playback. Stay tuned for a review and update.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been following the comments <a href="http://blog.reallysimplethoughts.com/2012/04/15/webdriver-playback-is-coming-to-selenium-ide/">on this blog post</a> and am anxiously awaiting an upcoming release to Selenium IDE that will feature Selenium WebDriver playback.  Stay tuned for a review and update.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.christophervigliotti.com/2012/07/major-selenium-ide-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where There&#8217;s A Will, There&#8217;s A Test Plan</title>
		<link>http://code.christophervigliotti.com/2012/07/thanks-will/</link>
		<comments>http://code.christophervigliotti.com/2012/07/thanks-will/#comments</comments>
		<pubDate>Tue, 03 Jul 2012 13:26:15 +0000</pubDate>
		<dc:creator>Christopher Vigliotti</dc:creator>
				<category><![CDATA[Selenium]]></category>

		<guid isPermaLink="false">http://code.christophervigliotti.com/?p=597</guid>
		<description><![CDATA[I recieved this note from Will the other day&#8230; Hello, I am an intern for a retail company. I am currently working with selenium and I need to tell you that your guides are amazing. Thanks for your note Will. I&#8217;m glad that you found my Learn Selenium series helpful. Good luck on the path [...]]]></description>
			<content:encoded><![CDATA[<p>I recieved this note from Will the other day&#8230;</p>
<blockquote><p>
Hello, I am an intern for a retail company. I am currently working with selenium and I need to tell you that your guides are amazing.
</p></blockquote>
<p>Thanks for your note Will.  I&#8217;m glad that you found my <a href="http://code.christophervigliotti.com/learn-selenium/">Learn Selenium</a> series helpful.  Good luck on the path to improving software quality.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.christophervigliotti.com/2012/07/thanks-will/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server Quick Tip: Restoring A Database Backup</title>
		<link>http://code.christophervigliotti.com/2012/05/sql-server-quick-tip/</link>
		<comments>http://code.christophervigliotti.com/2012/05/sql-server-quick-tip/#comments</comments>
		<pubDate>Tue, 01 May 2012 13:10:59 +0000</pubDate>
		<dc:creator>Christopher Vigliotti</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://code.christophervigliotti.com/?p=595</guid>
		<description><![CDATA[Restoring your SQL Server database using the GUI can leave your database stuck in the &#8220;restoring&#8221; state. One quick solution is to restore your database by using this simple SQL script. RESTORE DATABASE your-database-name FROM DISK='c:\your\backup\file\and\path\backup.bak' WITH REPLACE 7/20/2012 Update Here&#8217;s an updated version of the script that I use. I&#8217;ve also included my backup [...]]]></description>
			<content:encoded><![CDATA[<p>Restoring your SQL Server database using the GUI can leave your database stuck in the &#8220;restoring&#8221; state.  One quick solution is to restore your database by using this simple SQL script.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;">RESTORE DATABASE your<span style="color: #339933;">-</span>database<span style="color: #339933;">-</span>name FROM DISK<span style="color: #339933;">=</span><span style="color: #0000ff;">'c:<span style="color: #000099; font-weight: bold;">\y</span>our<span style="color: #000099; font-weight: bold;">\b</span>ackup<span style="color: #000099; font-weight: bold;">\f</span>ile<span style="color: #000099; font-weight: bold;">\a</span>nd<span style="color: #000099; font-weight: bold;">\p</span>ath<span style="color: #000099; font-weight: bold;">\b</span>ackup.bak'</span> WITH REPLACE</pre></td></tr></table></div>

<h2>7/20/2012 Update</h2>
<p>Here&#8217;s an updated version of the script that I use.  I&#8217;ve also included my backup script.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #339933;">--</span> restore it
use master
ALTER DATABASE <span style="color: #009900;">&#91;</span>your<span style="color: #339933;">-</span>database<span style="color: #339933;">-</span>name<span style="color: #009900;">&#93;</span> SET SINGLE_USER WITH ROLLBACK IMMEDIATE 
RESTORE DATABASE <span style="color: #009900;">&#91;</span>your<span style="color: #339933;">-</span>database<span style="color: #339933;">-</span>name<span style="color: #009900;">&#93;</span>
FROM DISK <span style="color: #339933;">=</span> <span style="color: #0000ff;">'c:<span style="color: #000099; font-weight: bold;">\y</span>our<span style="color: #000099; font-weight: bold;">\b</span>ackup<span style="color: #000099; font-weight: bold;">\f</span>ile<span style="color: #000099; font-weight: bold;">\a</span>nd<span style="color: #000099; font-weight: bold;">\p</span>ath<span style="color: #000099; font-weight: bold;">\b</span>ackup-to-restore.bak'</span>
WITH REPLACE
ALTER DATABASE <span style="color: #009900;">&#91;</span>your<span style="color: #339933;">-</span>database<span style="color: #339933;">-</span>name<span style="color: #009900;">&#93;</span> SET MULTI_USER
&nbsp;
<span style="color: #339933;">--</span> back it up
BACKUP DATABASE <span style="color: #009900;">&#91;</span>your<span style="color: #339933;">-</span>database<span style="color: #339933;">-</span>name<span style="color: #009900;">&#93;</span> TO  
	DISK <span style="color: #339933;">=</span> N<span style="color: #0000ff;">'c:<span style="color: #000099; font-weight: bold;">\y</span>our<span style="color: #000099; font-weight: bold;">\b</span>ackup<span style="color: #000099; font-weight: bold;">\f</span>ile<span style="color: #000099; font-weight: bold;">\a</span>nd<span style="color: #000099; font-weight: bold;">\p</span>ath<span style="color: #000099; font-weight: bold;">\b</span>ackup.bak'</span> 
	WITH NOFORMAT, INIT,  NAME <span style="color: #339933;">=</span> N<span style="color: #0000ff;">'your-database-name'</span>, 
	SKIP, NOREWIND, NOUNLOAD,  STATS <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://code.christophervigliotti.com/2012/05/sql-server-quick-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Feed The Google Black Bar&#8217;s Google Play Link A Plate Of Death, Greasemonkey Style</title>
		<link>http://code.christophervigliotti.com/2012/03/feed-the-google-black-bars-google-play-link-a-plate-of-death-greasemonkey-style/</link>
		<comments>http://code.christophervigliotti.com/2012/03/feed-the-google-black-bars-google-play-link-a-plate-of-death-greasemonkey-style/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 14:59:25 +0000</pubDate>
		<dc:creator>Christopher Vigliotti</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://code.christophervigliotti.com/?p=594</guid>
		<description><![CDATA[Here&#8217;s a Greasemonkey script that I whipped up in 30 seconds that banishes the Google Black Bar&#8217;s new Google Play link back to the hell from whence it came. You may want to remove line 13. 1 2 3 4 5 6 7 8 9 10 11 12 13 // ==UserScript== // @name Oi Vei, [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a Greasemonkey script that I whipped up in 30 seconds that banishes the Google Black Bar&#8217;s new Google Play link back to the hell from whence it came.  You may want to remove line 13.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// ==UserScript==</span>
<span style="color: #666666; font-style: italic;">// @name 	Oi Vei, Google Play</span>
<span style="color: #666666; font-style: italic;">// @namespace  	http://code.christophervigliotti.com</span>
<span style="color: #666666; font-style: italic;">// @include    	http://*.google.*</span>
<span style="color: #666666; font-style: italic;">// @include     http://google.*</span>
<span style="color: #666666; font-style: italic;">// @include     https://*.google.*</span>
<span style="color: #666666; font-style: italic;">// @include     https://google.*</span>
<span style="color: #666666; font-style: italic;">// @include     https://accounts.google.*</span>
<span style="color: #666666; font-style: italic;">// @description Fixes Google's Black Bar</span>
<span style="color: #666666; font-style: italic;">// ==/UserScript==</span>
&nbsp;
document.<span style="color: #006633;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'gb_78'</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">parentNode</span>.<span style="color: #006633;">style</span>.<span style="color: #006633;">display</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'none'</span><span style="color: #339933;">;</span>
alert<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'YOU SHALL NOT PASS'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://code.christophervigliotti.com/2012/03/feed-the-google-black-bars-google-play-link-a-plate-of-death-greasemonkey-style/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
