<?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>Thuan V. Nguyen &#187; Code</title>
	<atom:link href="http://www.a8le.com/category/code/feed" rel="self" type="application/rss+xml" />
	<link>http://www.a8le.com</link>
	<description>Full steam ahead.</description>
	<lastBuildDate>Thu, 08 Jul 2010 02:45:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Subtract Join</title>
		<link>http://www.a8le.com/the-subtract-join</link>
		<comments>http://www.a8le.com/the-subtract-join#comments</comments>
		<pubDate>Tue, 08 Apr 2008 02:13:00 +0000</pubDate>
		<dc:creator>a8le</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[opposite of a join]]></category>
		<category><![CDATA[sql join]]></category>
		<category><![CDATA[subtract join]]></category>

		<guid isPermaLink="false">http://www.a8le.com/archives/46</guid>
		<description><![CDATA[
I needed a way of selecting all primary key(s) from a certain table (Table_1) that was not used as a foreign key in a sub-table (Table_2).  So I went at it with my SQL know-how to no end.  It was obvious that I needed to do a little catching up.  
I googled [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.a8le.com/wp-content/uploads/2008/04/subtractjoin.gif" alt="Subtract Join" class="reflect" /></p>
<p>I needed a way of selecting all primary key(s) from a certain table (Table_1) that was not used as a foreign key in a sub-table (Table_2).  So I went at it with my SQL know-how to no end.  It was obvious that I needed to do a little catching up. <img src='http://www.a8le.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I googled the following:</p>
<blockquote><p> •	all instances of unique id not found in sub-table<br />
•	primary key not found as foreign key in sub-table<br />
•	select all rows if not exist in sub-table<br />
•	sql tutorial<br />
•	sql join<br />
•	sql reference<br />
•	sql relational databases</p></blockquote>
<p>…and found nothing useful.  However, my research did lead me to one conclusion… what I needed was the opposite of a join. I googled for it, it as in “opposite of a join”. What I found was a very useful MS KB, <a href="http://support.microsoft.com/kb/136699" title="Subtract Join" target="_blank">http://support.microsoft.com/kb/136699</a>.</p>
<p>The described &#8220;Subtract Join&#8221; was exactly what I was looking for and it works! What’s odd is of all the SQL tutorials I ran into, none of them mentioned the SUBTRACT JOIN. That makes me think there might be a better way of doing this query. Is there a better way? Am I simply not using the right keywords when I search? Anyways, if there is I couldn&#8217;t find it&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.a8le.com/the-subtract-join/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Batch BOL/EOL Editing</title>
		<link>http://www.a8le.com/batch-boleol-editing</link>
		<comments>http://www.a8le.com/batch-boleol-editing#comments</comments>
		<pubDate>Fri, 04 Apr 2008 14:22:09 +0000</pubDate>
		<dc:creator>a8le</dc:creator>
				<category><![CDATA[ASP.net 1.1]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[add]]></category>
		<category><![CDATA[every]]></category>
		<category><![CDATA[line]]></category>

		<guid isPermaLink="false">http://www.a8le.com/archives/44</guid>
		<description><![CDATA[I needed a way of adding periods to the end of every line in text documents.  The text documents in question had 100+ lines, so going through each document and pressing ( END &#62; . &#62; ENTER ) repetitively was not ideal.  I needed a program, but after some brief googling I gave [...]]]></description>
			<content:encoded><![CDATA[<p>I needed a way of adding periods to the end of every line in text documents.  The text documents in question had 100+ lines, so going through each document and pressing ( END &gt; . &gt; ENTER ) repetitively was not ideal.  I needed a program, but after some brief googling I gave up and decided that I needed to write this program.  I started my project by getting some advice and direction, <a href="http://www.vbdotnetforums.com/showthread.php?p=78217#post78217" target="_blank">here</a>, and I am glad I did or else I would have went with my original plan of working with &#8220;regex&#8221; <img src='http://www.a8le.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  &#8230;</p>
<blockquote><p><strike>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim oFile As System.IO.File<br />
Dim oWrite As System.IO.StreamWriter<br />
Dim Needy As String = tbx_main.Text<br />
Dim Added As String = Regex.Replace(Needy, &#8220;(\p{P})(?=\Z|\r\n)&#8221;, &#8220;.&#8221;)<br />
oWrite.Write(Added)<br />
oWrite.Close()<br />
oWrite = oFile.CreateText(&#8220;C:\Text_to_Speech.txt&#8221;)<br />
End Sub</strike></p></blockquote>
<p>The end result is a little program that adds any desired character(s) to the beginning or end of all lines pasted into its textbox.  The code is as follows&#8230;</p>
<blockquote><p>Try<br />
&#8216;Make sure big tbx is not empty<br />
If tbx_main.Text = &#8220;&#8221; Then<br />
tbx_main.Text = &#8220;Please enter text!&#8221;<br />
ElseIf tbx_main.Text = &#8220;Please enter text!&#8221; Then<br />
tbx_main.Text = &#8220;Please enter text!&#8221;<br />
Else<br />
&#8216;Make sure small tbx is not empty<br />
If tbx_desired.Text = &#8220;&#8221; Then<br />
tbx_desired.Text = &#8220;Char?&#8221;<br />
ElseIf tbx_desired.Text = &#8220;Char?&#8221; Then<br />
tbx_desired.Text = &#8220;Char?&#8221;<br />
Else<br />
&#8216;Declare: file, stream and savefiledialog<br />
Dim oFile As File<br />
Dim oMyStream As Stream<br />
Dim saveFileDialog1 As New SaveFileDialog<br />
&#8216;Set savefiledialog defaults<br />
saveFileDialog1.Filter = &#8220;txt files (*.txt)|*.txt&#8221;<br />
saveFileDialog1.FilterIndex = 2<br />
saveFileDialog1.RestoreDirectory = True<br />
&#8216;Run nested code if user presses OK button in dialog<br />
If saveFileDialog1.ShowDialog() = DialogResult.OK Then<br />
oMyStream = saveFileDialog1.OpenFile()<br />
Dim oWrite As New StreamWriter(oMyStream)<br />
For Each LineInput As String In tbx_main.Lines<br />
&#8216;Core Code, add periods to beginning or end<br />
If rbtn_begin.Checked = True Then<br />
&#8216;Beginning<br />
oWrite.WriteLine(tbx_desired.Text + LineInput)<br />
ElseIf rbtn_end.Checked = True Then<br />
&#8216;End<br />
oWrite.WriteLine(LineInput + tbx_desired.Text)<br />
End If<br />
Next<br />
oWrite.Close()<br />
End If<br />
&#8216;Periods added, display success msgbx, close form<br />
MessageBox.Show(&#8220;Success: file was created!&#8221;)<br />
Me.Dispose()<br />
Me.Close()<br />
End If<br />
End If<br />
Catch exc As Exception<br />
&#8216;Catch Errors, display messagebox<br />
MessageBox.Show(&#8220;Error: file was not created!&#8221;)<br />
End Try</p></blockquote>
<p>Sounds useful? If you want to download the program and use it at your own risk, <a href="http://www.a8le.com/wp-content/uploads/2008/04/periods.zip" title="Period.exe, Batch BOL/EOL Editing">click here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.a8le.com/batch-boleol-editing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YouTube Enabled</title>
		<link>http://www.a8le.com/youtube-enabled</link>
		<comments>http://www.a8le.com/youtube-enabled#comments</comments>
		<pubDate>Sat, 16 Feb 2008 17:48:12 +0000</pubDate>
		<dc:creator>a8le</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.a8le.com/archives/33</guid>
		<description><![CDATA[With the YouTube craze spreading like a wildfire, last summer (&#8216;07) I took some time to enable Noteful.COM with YouTube.  Users can now visually depict their thoughts using YouTube videos.  The code wasn&#8217;t hard and thanks to C.K. Sample&#8217;s blog (here), it was even easier&#8230;
&#60;object type="application/x-shockwave-flash" data="[INSERT VIDEO URL FROM EMBED CODE PROVIDED [...]]]></description>
			<content:encoded><![CDATA[<p>With the YouTube craze spreading like a wildfire, last summer (&#8216;07) I took some time to enable Noteful.COM with YouTube.  Users can now visually depict their thoughts using YouTube videos.  The code wasn&#8217;t hard and thanks to C.K. Sample&#8217;s blog (<a href="http://www.sampletheweb.com/2006/09/10/how-to-embed-youtube-and-google-video-without-breaking-validation/" target="_blank">here</a>), it was even easier&#8230;</p>
<blockquote><p><code>&lt;object type="application/x-shockwave-flash" data="[INSERT VIDEO URL FROM EMBED CODE PROVIDED HERE]" width="400" height="326"&gt;&lt;param name="movie" value="[INSERT VIDEO URL FROM EMBED CODE PROVIDED HERE]" /&gt;&lt;param name="FlashVars" value="playerMode=embedded" /&gt;&lt;/object&gt;</code></p></blockquote>
<p>With this code I can also allow users to embed Google Videos as well, this would have to be done soon before I fall behind.  More and more video streaming sites are hitting the web that are a must for me.  Stage6, for example is on the top of my list. If anyone has any advice on this, please comment. <img src='http://www.a8le.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.a8le.com/youtube-enabled/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.net 1.1 Repeater Columns</title>
		<link>http://www.a8le.com/35</link>
		<comments>http://www.a8le.com/35#comments</comments>
		<pubDate>Tue, 13 Nov 2007 16:52:43 +0000</pubDate>
		<dc:creator>a8le</dc:creator>
				<category><![CDATA[ASP.net 1.1]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Dotnetnuke]]></category>

		<guid isPermaLink="false">http://www.a8le.com/archives/35</guid>
		<description><![CDATA[While writing a script to mass approve posts on a site, similar to deleting all unwanted email using: a repeater (not a datagrid), a checkbox in each indexItem, and a button; I ran into a common problem for many&#8230; ASP.net repeaters don&#8217;t have columns. I searched the net and visited two of my favorite forums [...]]]></description>
			<content:encoded><![CDATA[<p>While writing a script to mass approve posts on a site, similar to deleting all unwanted email using: a repeater (not a datagrid), a checkbox in each indexItem, and a button; I ran into a common problem for many&#8230; ASP.net repeaters don&#8217;t have columns. I searched the net and visited two of my favorite forums looking for help and came up with nothing&#8230;</p>
<p>Here&#8217;s my Psuedo/Logic:<br />
1) Load Repeater with list of &#8220;UNmoderated&#8221; items<br />
2) Put a checkbox inside the repeaters ItemTemplate<br />
3) Add code to button (dosomething if checkbox is checked)</p>
<p><strong>Problem:</strong><br />
I couldn&#8217;t locate the column with the PrimaryUniqueID because there are no columns in repeaters, but my Stored Procedure &#8220;requires&#8221; the PrimaryUniqueID.</p>
<blockquote><p> <u>Button code:</u><br />
Private Sub MassApprove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MassApprove.Click<br />
Try<br />
Dim MyRptItem As RepeaterItem<br />
For Each MyRptItem In MyRepeater.Items<br />
Dim chbxMassApprove As CheckBox = CType(MyRptItem.FindControl(&#8220;chbxMassApprove&#8221;), CheckBox)<br />
<strike>Dim PrimaryUniqueID As String = MyRptItem.DataItem(PrimaryUniqueID)</strike> <strong>PROBLEMATIC LINE</strong><br />
If chbxMassApprove.Checked = True Then<br />
&#8216;DO THE MASS APPROVE<br />
&#8216;LOOP THRU STORED PROCEDURE<br />
End If<br />
Next<br />
Catch exc As Exception<br />
Response.Write(exc.ToString)<br />
End Try<br />
End Sub</p></blockquote>
<p><strong>Solution: </strong><br />
I used this as a workaround if this helps anyone&#8230;</p>
<blockquote><p><u>Front End:</u><br />
Text=&#8217;&lt;%# DataBinder.Eval(Container, &#8220;DataItem.PrimaryUniqueID&#8221;) %&gt;&#8217;</p>
<p><u>Back End:</u><br />
Dim PrimaryUniqueID As String = ckbxMassApprove.Text.ToString</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.a8le.com/35/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Code Commenting</title>
		<link>http://www.a8le.com/code-commenting</link>
		<comments>http://www.a8le.com/code-commenting#comments</comments>
		<pubDate>Mon, 29 Oct 2007 06:46:16 +0000</pubDate>
		<dc:creator>a8le</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.a8le.com/archives/29</guid>
		<description><![CDATA[I recently took full control of a clients website.  And as I was doing a few requested changes, I kept running into coding difficulties.  My main problem was that I had to spend a substantial amount of time figuring out what was changed for what reason.  If not do it for the next webmaster  [...]]]></description>
			<content:encoded><![CDATA[<p>I recently took full control of a clients website.  And as I was doing a few requested changes, I kept running into coding difficulties.  My main problem was that I had to spend a substantial amount of time figuring out what was changed for what reason.  If not do it for the next webmaster <img src='http://www.a8le.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> , do it for yourself&#8230; comment on your coding. A nicely documented page of code will always be read twice as fast!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.a8le.com/code-commenting/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.net Paging</title>
		<link>http://www.a8le.com/aspnet-paging</link>
		<comments>http://www.a8le.com/aspnet-paging#comments</comments>
		<pubDate>Thu, 18 Oct 2007 14:12:10 +0000</pubDate>
		<dc:creator>a8le</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Dotnetnuke]]></category>

		<guid isPermaLink="false">http://www.a8le.com/archives/24</guid>
		<description><![CDATA[So, the users of a certain website of mine have been requesting that I add paging to one of my controls.  I initially didn&#8217;t want to do it, not because I couldn&#8217;t do it. But because the control didn&#8217;t really call for it. But they are my users, without them the site wouldn&#8217;t be [...]]]></description>
			<content:encoded><![CDATA[<p>So, the users of a certain website of mine have been requesting that I add paging to one of my controls.  I initially didn&#8217;t want to do it, not because I couldn&#8217;t do it. But because the control didn&#8217;t really call for it. But they are my users, without them the site wouldn&#8217;t be there right?  So I went ahead with it.  Its been a while since I used any paging code, so I was refreshed after reviewing ASP.net paging webcontrols:</p>
<blockquote><p><code>System.Web.UI.WebControls.PagedDataSource</code></p></blockquote>
<p>What we have to do for us to paging through our data vs. displaying all of it at once?  We simply inject the paging into our data before displaying it.  In my case, I am using a repeater:</p>
<blockquote><p><code>'get the data<br />
Dim myData As System.Collections.ArrayList<br />
myData = ** myStoredProcedure **<br />
'ensure there is data to work with<br />
If myData .Count &gt; 0 Then<br />
'create a new instance of PagedDataSource<br />
myPagedDataSource = New System.Web.UI.WebControls.PagedDataSource<br />
'set my pagin preferences<br />
myPagedDataSource.DataSource = myData<br />
myPagedDataSource.AllowPaging = True<br />
myPagedDataSource.PageSize = 5<br />
myPagedDataSource.CurrentPageIndex = myCurrentPageIndex<br />
'then finally bind the data to my repeater<br />
myRepeater.DataSource = myPagedDataSource<br />
myRepeater.DataBind()<br />
End If</code></p></blockquote>
<p>Quite simple to use.  Knowing that the webcontrol is there really is the hard part of it all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.a8le.com/aspnet-paging/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>osCommerce Must Have&#8230;</title>
		<link>http://www.a8le.com/oscommerce-must-have</link>
		<comments>http://www.a8le.com/oscommerce-must-have#comments</comments>
		<pubDate>Tue, 25 Sep 2007 14:17:23 +0000</pubDate>
		<dc:creator>a8le</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.a8le.com/archives/12</guid>
		<description><![CDATA[I have been doing alot of osCommerce work for a client over the pass year and a half.  And although there are many &#8220;contributions&#8221; that are a must for any production osCommerce shop, without a doubt when it comes to designing a site, the &#8220;Simple Template System&#8221; aka STS contribution created by Brian Gallagher [...]]]></description>
			<content:encoded><![CDATA[<p>I have been doing alot of osCommerce work for a client over the pass year and a half.  And although there are many &#8220;contributions&#8221; that are a must for any production osCommerce shop, without a doubt when it comes to designing a site, the &#8220;Simple Template System&#8221; aka STS contribution created by Brian Gallagher is a must have.</p>
<p>If you are new to osCommerce, you will soon find out that designing your osCommerce website can be quite painful.  But once you add the STS contribution to your site, you essentially add a skinning method to it&#8230; making your job half as easy.  Link? <a href="http://www.oscommerce/community/contributions,1524">Click Here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.a8le.com/oscommerce-must-have/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
