<?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>Shane&#039;s blog &#187; Visual Web Development</title>
	<atom:link href="http://blog.shamess.info/category/programming/visual-web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.shamess.info</link>
	<description>Personal blog of Shane Preece. Occaisional politics and tech minddump.</description>
	<lastBuildDate>Wed, 18 Jan 2012 10:28:47 +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>Phase test two run down</title>
		<link>http://blog.shamess.info/2009/03/24/phase-test-two-run-down/</link>
		<comments>http://blog.shamess.info/2009/03/24/phase-test-two-run-down/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 17:49:44 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Visual Web Development]]></category>
		<category><![CDATA[Revision]]></category>

		<guid isPermaLink="false">http://blog.shamess.info/?p=564</guid>
		<description><![CDATA[Since I&#8217;ve done absolutely no prep for this exam, I figured I&#8217;d do so in here. Here&#8217;s the mock. Usually I&#8217;d say break down what you&#8217;re being asked to do, but it seems like they&#8217;ve already done that for us. &#8230; <a href="http://blog.shamess.info/2009/03/24/phase-test-two-run-down/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;ve done absolutely no prep for this exam, I figured I&#8217;d do so in here. <a href="http://blog.shamess.info/wp-content/uploads/2009/03/phase-test-2-prep.doc">Here&#8217;s the mock.</a> Usually I&#8217;d say break down what you&#8217;re being asked to do, but it seems like they&#8217;ve already done that for us.</p>
<div id="attachment_568" class="wp-caption alignright" style="width: 269px"><a href="http://blog.shamess.info/wp-content/uploads/2009/03/solution-explorer-project.png"><img class="size-full wp-image-568" title="solution-explorer-project" src="http://blog.shamess.info/wp-content/uploads/2009/03/solution-explorer-project.png" alt="Right clicking your project in the Solution Explorer to add a new item." width="259" height="170" /></a><p class="wp-caption-text">Right clicking your project in the Solution Explorer to add a new item.</p></div>
<p>Create a website. First thing I&#8217;d do is insert <a href="http://blog.shamess.info/wp-content/uploads/2009/03/databasetable-class-feb-2009.doc">the database class</a> we need to be using. (Looks like an informal <a href="http://creativecommons.org/licenses/GPL/2.0/">CC GNU GPL</a>, so long as he keeps credit.) Do that by copying the text &#8211; all of it. Going back to Visual Studio, right clicking on your project, <em>Add new item&#8230;</em>, <em>Class, Yes</em> to the &#8220;Put it in the &#8216;App code&#8217; folder&#8221;. Select everything, and paste the contents of that Word document for the table class (overwriting everything that was there). Rename that class to something more logical.</p>
<p>We also need to add the yabba database we&#8217;ve been given. Right click <em>App_Data</em>, <em>Add existing item&#8230;, </em>find and insert the database we&#8217;ve been given.</p>
<p>Add two fields, like it says, for the name and message. Validate inputs. I&#8217;ve no idea <span style="text-decoration:line-through;">how</span>why you&#8217;d use a function to validate two strings though, so I&#8217;m not going to.</p>
<p>Now, uhh&#8230; lets find how to use this database thing. I&#8217;m sure there was a class on it. Yep, here&#8217;s the presentation on it: <a href="http://www.cse.dmu.ac.uk/~mjdean/notes/modules/programming/csci1604/0809/content/databases/Creating%20Web%20Databases%20pt1.ppt">Database and webservers</a>. Written by Mathew Dean. Slide 13 gives you the code to connect to a database. And he talks about <a href="http://www.cse.dmu.ac.uk/~mjdean/notes/modules/programming/csci1604/0809/content/databases/Creating%20Web%20Databases%20pt2.ppt">adding records here</a>, on slide 2 and onwards.</p>
<p>Just to explain what this class actually does. When you create it, it nabs all the records and puts them into a hashed array (which has a <a title="Don't worry too much about this, it's Perl." href="http://www.tizag.com/perlT/perlhashes.php">key, and a value</a>, rather than just an index number and a value). You add to that array like normal, using NewRecord, and then when you save it just updates the database according to that array of information.</p>
<p>Okay, I&#8217;m actually bored of this now.</p>
<p>Here&#8217;s the badly commented code for the first page.</p>
<pre>    Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
        ' As if we're in C, variables at the top, for no reason. Regaurdless of if we need them. Which we don't.
        Dim Name As String
        Dim Message As String
        ' Make sure neither textbox is empty
        If (txtName.Text &lt;&gt; "" And txtMessage.Text &lt;&gt; "") Then
            Name = txtName.Text
            Message = txtName.Text

            'Connect to the database
            Dim MessagesDatabase As New DatabaseTable("yabba.mdb", "tblMessages")
            MessagesDatabase.NewRecord.Item("PostedBy") = Name
            MessagesDatabase.NewRecord.Item("MessageText") = Message
            MessagesDatabase.AddNewRecord()
            MessagesDatabase.SaveChanges()

            Response.Redirect("second.aspx")
        Else
            lblStatus.Text = "Something was empty. Try again."
        End If
    End Sub</pre>
<p>Second.aspx is supposed to output all the messages. Have fun with that.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shamess.info/2009/03/24/phase-test-two-run-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You should hurry up and do this.</title>
		<link>http://blog.shamess.info/2009/03/02/you-should-hurry-up-and-do-this/</link>
		<comments>http://blog.shamess.info/2009/03/02/you-should-hurry-up-and-do-this/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 00:19:38 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Visual Web Development]]></category>
		<category><![CDATA[driving test]]></category>

		<guid isPermaLink="false">http://blog.shamess.info/?p=458</guid>
		<description><![CDATA[Driving test 3 is only worth a small handful of points now, so I figured it&#8217;s about time I did it. Pick out the features we need to have: User needs to be able to enter their current balance, how &#8230; <a href="http://blog.shamess.info/2009/03/02/you-should-hurry-up-and-do-this/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Driving test 3 is only worth a small handful of points now, so I figured it&#8217;s about time I did it.</p>
<p><span id="more-458"></span>Pick out the features we need to have:</p>
<ul>
<li>User needs to be able to enter their current balance, how much they want to pay off, and their interest rate</li>
<li>Then a list box needs to be updated showing a month by month snapshot of their account</li>
<li>Calculate how long it&#8217;ll take to pay off their debt</li>
</ul>
<p>So it&#8217;s pretty obvious what we need to set up:</p>
<p style="text-align:left;">
<div id="attachment_459" class="wp-caption aligncenter" style="width: 396px"><a rel="lightbox" href="http://blog.shamess.info/wp-content/uploads/2009/03/driving-test-three-setup.png"><img class="size-full wp-image-459" title="Driving test three example set up" src="http://blog.shamess.info/wp-content/uploads/2009/03/driving-test-three-setup.png" alt="This is just how I've done it; be more inventive!" width="386" height="167" /></a><p class="wp-caption-text">This is just how I&#39;ve done it; be more inventive!</p></div>
</p>
<p>Remember to do validation on all three inputs, and give errors when there&#8217;s problems:</p>
<ul>
<li>They need to be greater than zero</li>
<li>The need to be a numbers</li>
<li>It can’t be blank!</li>
</ul>
<p>Before you start outputting to the list box, you need to make sure that the user will actually eventually pay off their loan. The biggest problem I think they are having with this test is that they&#8217;re not testing to see if their loop actually ever finishes. To start with, you have to make sure that the user is paying more every month than is added to their loan due to interest.</p>
<p>If the user is paying £10 a month, but the interest is £11 a month, they&#8217;ll <em>never</em> pay off the loan.</p>
<pre>InterestAmountEachMonth = TotalBalance + (TotalBalance * InterestRate)
If InterestAmountEachMonth &gt; MonthlyPayment Then Error</pre>
<p>Check for that first. Then give an error. If they are paying off enough though you can start taking it off their balance! Do something like this:</p>
<pre>While TotalBalance &gt; 0 Then
  TotalBalance = TotalBalance - Payment + Interest
  Update Listbox With New Balance
End While</pre>
<p>You have to output what month number it is as well!</p>
<p>That&#8217;s pretty much it. Remember to do a <a href="http://www.cse.dmu.ac.uk/~mjdean/notes/modules/programming/csci1604/0809/content/testing%20and%20debugging/test%20plan%20test%20log.doc">test plan</a> like last time too.</p>
<p>Things you should think about:</p>
<ul>
<li>Make it so the total amount owed never goes below zero (you wouldn&#8217;t pay more than you had to, would you?)</li>
<li>Clear the list box when you do another calculation</li>
<li>Put the validation into a function</li>
<li>Make all the currencies output with the right decimal places, and with a £ sign. (Use .ToString (&#8220;c&#8221;))</li>
<li>Why&#8217;re you using a while loop, and not a for loop?</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.shamess.info/2009/03/02/you-should-hurry-up-and-do-this/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Class summary for today</title>
		<link>http://blog.shamess.info/2009/01/19/class-summary-for-today/</link>
		<comments>http://blog.shamess.info/2009/01/19/class-summary-for-today/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 16:57:56 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Computer Technology]]></category>
		<category><![CDATA[Database Design Concepts]]></category>
		<category><![CDATA[Visual Web Development]]></category>

		<guid isPermaLink="false">http://blog.shamess.info/?p=365</guid>
		<description><![CDATA[In visual web dev. we just learnt about parameters for functions, and making subroutines and functions. Yeah, it was thrilling. I finished up the set work in the first hour (class is two hours along) and just spent the rest &#8230; <a href="http://blog.shamess.info/2009/01/19/class-summary-for-today/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In visual web dev. we just learnt about parameters for functions, and making subroutines and functions. Yeah, it was thrilling. I finished up the set work in the first hour (class is two hours along) and just spent the rest playing with Flash.</p>
<p>Database design concepts was okay. &#8220;Okay&#8221; is measured by &#8220;did I learn something?&#8221; and I sort of did. It was about how DBMSs should handle their integrity, using rollbacks and transactions. Also on user privileges.</p>
<p>When I can be more motivated (or if someone asks), I&#8217;ll come back and actually explain what they mean, because a few people missed that lecture. For now though, I&#8217;m going to work on my Leicester Guide Website for my computer technology assignment.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shamess.info/2009/01/19/class-summary-for-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Driving test two: If statements</title>
		<link>http://blog.shamess.info/2008/12/02/driving-test-two-if-statements/</link>
		<comments>http://blog.shamess.info/2008/12/02/driving-test-two-if-statements/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 16:24:46 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Visual Web Development]]></category>
		<category><![CDATA[driving test]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[if statements]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://blog.shamess.info/?p=258</guid>
		<description><![CDATA[I&#8217;m fairly sure most people haven&#8217;t done this one yet, so I&#8217;m not going to give you my finished code for a little while. I&#8217;ll walk you through what you should have though, and explain the things you&#8217;ll need to &#8230; <a href="http://blog.shamess.info/2008/12/02/driving-test-two-if-statements/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m fairly sure most people haven&#8217;t done this one yet, so I&#8217;m not going to give you my finished code for a little while. I&#8217;ll walk you through what you should have though, and explain the things you&#8217;ll need to know to complete it.</p>
<p><span id="more-258"></span>Unlike the <a href="http://blog.shamess.info/2008/11/30/youve-all-done-driving-test-1-right/">first driving test</a>, this one is a bit more complicated and so your solution could be completely different to everyone elses. So long as you fit in with the brief yours is correct.</p>
<p>First, lets take a look at the brief. As always, pick out the features that we&#8217;re told we need.</p>
<ul>
<li>User needs to be ale to enter a number to say how many choco bars they want</li>
<li>The total cost of the sale (with the discount) should be displayed</li>
<li>Minimum of five discount bands</li>
</ul>
<p>Maybe you could set a page up that looks like this:</p>
<div id="attachment_261" class="wp-caption aligncenter" style="width: 418px"><img class="size-full wp-image-261" title="Driving test 2 example" src="http://blog.shamess.info/wp-content/uploads/2008/12/driving-test-2.png" alt="Just some text, a text box and a button!" width="408" height="87" /><p class="wp-caption-text">Just some text, a text box and a button!</p></div>
<p>You&#8217;ve been given that calculation that&#8217;ll work out the price they user needs to pay in the book. Lemme change that a little bit to make it just that much more easier:</p>
<pre>Quantity = txtQuantity.Text
UnitCost = 2.10
Discount = UnitCost * 0.20
TotalPrice = Quantity * (UnitCost - Discount)</pre>
<p>That code is still pretty useless though. If we&#8217;re sticking with the discount bands in the book, then that discount of 20% would only be needed when the user want ten or more items. You&#8217;ll need to set the <em>Discount</em> in an <em>IF</em> block in order to work out what it should be.</p>
<p>In structured English, the IF statement might look something like this:</p>
<pre>If the quantity is between 1 and 3 then
   the discount should be 0%
Else, if the quantity is between 4 and 5 then
   the discount should be 5%</pre>
<p>That should give you a pretty good idea on exactly what you have to do for this driving test. Just output the total price with the discount applied in a label and you&#8217;re all set!</p>
<p>Remember to do validation on this one! You need to make a <a href="http://www.cse.dmu.ac.uk/~mjdean/notes/modules/programming/csci1604/0809/content/testing%20and%20debugging/test%20plan%20test%20log.doc">test plan</a> (that&#8217;s Matthew Dean&#8217;s website) as well, like we learnt in class. <strong>You can&#8217;t pass without it.</strong> Some validation you should definitely make sure the inputs have:</p>
<ul>
<li>The quantity can&#8217;t be negative</li>
<li>The quantity needs to be a number</li>
<li>It can&#8217;t be blank!</li>
<li>It shouldn&#8217;t be a really huge number</li>
</ul>
<p>If the user does any of those you should give an error message.</p>
<p>Some things that you could be asked about, or asked to change:</p>
<ul>
<li>Output the individual unit cost as well as the total price</li>
<li>Output how much of a discount the user is getting: <em>(UnitPrice * Quantity) &#8211; TotalCost</em></li>
<li>Add another discount band</li>
<li>Instead of just outputting a number, output the total cost as currency</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.shamess.info/2008/12/02/driving-test-two-if-statements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fair use is totally an excuse to break the law</title>
		<link>http://blog.shamess.info/2008/12/01/fair-use-is-totally-an-excuse-to-break-the-law/</link>
		<comments>http://blog.shamess.info/2008/12/01/fair-use-is-totally-an-excuse-to-break-the-law/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 13:39:03 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Law]]></category>
		<category><![CDATA[Meta-blog]]></category>
		<category><![CDATA[Visual Web Development]]></category>
		<category><![CDATA[copyright]]></category>
		<category><![CDATA[fair use]]></category>
		<category><![CDATA[plagorism]]></category>

		<guid isPermaLink="false">http://blog.shamess.info/?p=248</guid>
		<description><![CDATA[You may notice that I&#8217;m putting a load of course stuff online. This may take a while. I should have done this back within the first week and just kept up with it, but I guess I didn&#8217;t and now &#8230; <a href="http://blog.shamess.info/2008/12/01/fair-use-is-totally-an-excuse-to-break-the-law/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>You may notice that I&#8217;m putting a load of course stuff online. This may take a while. I should have done this back within the first week and just kept up with it, but I guess I didn&#8217;t and now I&#8217;m paying for it.</p>
<p>On the other hand though, it kinda means that every scrap of information that has been taught to us within DMU will be put online&#8230; I feel like I&#8217;m divuldging trade secrets which may well be illegal&#8230; I mean, why go to DMU &#8211; or university at all &#8211; if you can just come here and look at the material, right? So I&#8217;m going to avoid posting actual links to presentations and stuff, and just summerise it in my own words, which I&#8217;m fairly sure doesn&#8217;t evoke any copyright stuff.</p>
<p>And if it does, I&#8217;ll plee educational use, which is covered under fair use. S&#8217;all good.</p>
<p>I didn&#8217;t know that my systems analysis stuff had to be submitted on- as well as offline. I&#8217;m hoping she&#8217;ll still accept and mark it without me getting in trouble with due dates and stuff. To be fair, I submitted it by hand weeks before it had to be, that must count for something. She&#8217;s knows I did the work on time.</p>
<p>I got 1% chance of plagorism though, which is awesome. Most people get around 30%, apparently. I&#8217;ve always prided myself on having my own writing style &#8211; even if it is too informal sometimes. When people assume that I&#8217;ll steal someone elses work I&#8217;m kinda offended because&#8230; well, I&#8217;m the only person that can ever write like me.</p>
<p>Anyway, computer technology lecture two.</p>
<p>Oh, almost forgot. These computers have CS Flash on them! I&#8217;m totally going to learn it some time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shamess.info/2008/12/01/fair-use-is-totally-an-excuse-to-break-the-law/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You&#8217;ve all done driving test 1, right?</title>
		<link>http://blog.shamess.info/2008/11/30/youve-all-done-driving-test-1-right/</link>
		<comments>http://blog.shamess.info/2008/11/30/youve-all-done-driving-test-1-right/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 22:32:24 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Visual Web Development]]></category>

		<guid isPermaLink="false">http://blog.shamess.info/?p=218</guid>
		<description><![CDATA[Since you&#8217;re right down to five marks for the first driving test now I&#8217;m expecting you&#8217;d all have done your first driving test by now. If not, then you probably need help. So, we need to make a system with &#8230; <a href="http://blog.shamess.info/2008/11/30/youve-all-done-driving-test-1-right/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Since you&#8217;re right down to five marks for the first driving test now I&#8217;m expecting you&#8217;d all have done your first driving test by now. If not, then you probably need help.</p>
<p><span id="more-218"></span>So, we need to make a system with that can be used by customers to give their name and email address, and a comment, and then have it emailed to you with all that information. It&#8217;s really fairly simple, especially since in the book you&#8217;ve been given the following code.</p>
<pre>Dim A
Dim B
Dim C
A = txtEMail.Text
B = txtName.Text
C = txtComment.Text
Dim myMessage As New System.Net.Mail.MailMessage(A, "Your E-mail", B, C)
Dim Server As New System.Net.Mail.SmtpClient("mail.cse.dmu.ac.uk")
Server.Send(myMessage)
txtName.Text = ""
txtEMail.Text = ""
txtComment.Text = ""</pre>
<p>One snag here is that that&#8217;s awful code. If you ever sold that to a client they probably wouldn&#8217;t be too happy with it. It&#8217;s pretty damn disgraceful. The variable declarations have been given awful names, and they haven&#8217;t even been given data types!</p>
<p>First, quickly mock up a web page. Making it look like an actual company&#8217;s website isn&#8217;t really that important; your tutors more bothered about if you can actually do the code at the moment. In your brief (in the book) underline what information you need to be input by the user, so you know exactly what needs to be put on the page. As it is, all you need is a box for their name, email address, and a final one for their comment.</p>
<div id="attachment_219" class="wp-caption aligncenter" style="width: 320px"><img class="size-full wp-image-219" title="Driving test 1 example website" src="http://blog.shamess.info/wp-content/uploads/2008/11/driving-test-1.png" alt="Design doesn't matter so much" width="310" height="284" /><p class="wp-caption-text">Design doesn&#39;t matter so much</p></div>
<p>Remember to give the controls good IDs! In fact, you&#8217;re given the IDs to use in the code sample.</p>
<p>You want the code to be run when the user clicks on the button, so double click on that submit button to open the code for that event.</p>
<p>The next thing you should definitely deal with is fixing the variables that have been declared there. Give them better names! A, B, and C really aren&#8217;t cool. You&#8217;ve no idea what they do, and you&#8217;ll just confuse yourself by the end of the code. Not every project you make is going to be less than a page of code long, so you won&#8217;t be able to just look at the top of the screen to find where you set a variable. Always use good variable names. When you change the variable names, make sure you change them in all the places they&#8217;re mentioned later on.</p>
<p>Also, you&#8217;ll need to add the <em>As Datatype</em> bit to the <em>Dim</em>s too. Think about what data your user will be putting into them.</p>
<p>Now ladies and gentlemen, listen to what I say next very damn carefully. <strong>Go through the code and add comments.</strong> Honest to what ever god you follow, if you don&#8217;t you will fail. You need to comment to a huge degree, even more than you would in actual industary. Add something like this.</p>
<p>&#8216;This variable will be used later to store the customer&#8217;s name</p>
<p>That&#8217;s all. I&#8217;m guessing most of you will be confused by how to comment your <em>MyMessage</em> and <em>Server</em>, so let me just explain them now. MyMessage is an object which you&#8217;ve created to hold an email. You&#8217;ve given it some data, like the to address, from address, subject, and body. The server object is just an object which holds data about your server. Simple really.</p>
<p>It&#8217;s easy to forget which order the parameters of the email object go in, and don&#8217;t worry, even professionals will. Programming isn&#8217;t about memorising thousands of commands. Every programmer will quickly become best friends with the documentation of their language. To get to the documentation, just press F1 when your cursor is on the thing that&#8217;s confusing you. For the record the parameters are:</p>
<p><em>From, To, Subject, Body</em></p>
<p>When every you get confused by what you&#8217;re doing, you should say outloud your aim again. You want to send an email <em>to yourself</em>, <em>from a customer, with their comment</em>.</p>
<p>And after that, you&#8217;re pretty much finished! Here&#8217;s an example of the code you should have ended up with. Ffs, don&#8217;t copy and paste this to use. If you don&#8217;t understand it, your lecturer will know straight away it&#8217;s not yours, and my tutor has already seen these comments in my code.</p>
<pre>'Declare a space in memory to hold the customer's name
Dim UsersName As String
'Used to hold the users Email address
Dim UsersEmail As String
'Used to hold the users comment
Dim UsersComment As String
'Grab all the inputs and put them into the right variables
UsersEmail = txtEMail.Text
UsersName = txtName.Text
UsersComment = txtComment.Text
'Create the object to store the email we want to send, with all the right parameters for the to,
'from, subject and body
Dim myMessage As New System.Net.Mail.MailMessage(UsersEmail, "shamess@gmail.com", UsersName, UsersComment)
'Create an object to store server details
Dim Server As New System.Net.Mail.SmtpClient("mail.cse.dmu.ac.uk")
'Connect to the server and send the email
Server.Send(myMessage)
'Now we can clear all the text boxes
txtName.Text = ""
txtEMail.Text = ""
txtComment.Text = ""</pre>
<p>Now you&#8217;re ready to take your driving test, even though it&#8217;s kinda late. Start thinking about your second driving test now.</p>
<p>You still can&#8217;t relax though. Your tutor is going to ask you three questions about your code, and/or maybe even ask you to add an extra feature. Here are some possible things they could ask:</p>
<ul>
<li>Add a cancel button, to clear the form but <em>not</em> submit it</li>
<li>Make it so the body of the email also has the customer&#8217;s name in it. (Until I write a tutorial, here&#8217;s a Wikipedia page on <a href="http://en.wikipedia.org/wiki/Concatenation">concatenation</a>.</li>
<li>Make it so the email is sent to a different address</li>
<li>Add a thank you message after the email has been sent</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.shamess.info/2008/11/30/youve-all-done-driving-test-1-right/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weeks one and two summary: Visual Web Development</title>
		<link>http://blog.shamess.info/2008/10/12/weeks-one-and-two-summary-visual-web-development/</link>
		<comments>http://blog.shamess.info/2008/10/12/weeks-one-and-two-summary-visual-web-development/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 18:14:03 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Visual Web Development]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[dmu]]></category>
		<category><![CDATA[University]]></category>

		<guid isPermaLink="false">http://blog.shamess.info/?p=143</guid>
		<description><![CDATA[Just finished the first two weeks of academic work here. I&#8217;m planning to do a post like this every week. I didn&#8217;t last week because it was all mostly just admin work. Classes are really starting to shape up now &#8230; <a href="http://blog.shamess.info/2008/10/12/weeks-one-and-two-summary-visual-web-development/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just finished the first two weeks of academic work here. I&#8217;m planning to do a post like this every week. I didn&#8217;t last week because it was all mostly just admin work. Classes are really starting to shape up now though.</p>
<p>In Visual Web Design, during the first week we were just being taught the basic principles of programming and stuff. Since I&#8217;ve been programming for years I already know all this stuff but I&#8217;d totally forgotten that some things may not be obvious to people that have never coded in their life before. Some things we had to take note of:</p>
<ul>
<li>Commands have to be typed exactly should be</li>
<li>The order of the commands are important too. A lot of people seemed to slip up on this one. When we were practising with a program called GPE (I think the uni designed it as a learning device), which only has a few commands like &#8220;north&#8221;, &#8220;south&#8221;, &#8220;change colour&#8221;, and so on, a lot of the people expected the computer to know which order to do everything in.</li>
<li>Variable names to first, and then the information that you want to put into them. A lot of people thought that &#8220;stringstring&#8221; = foo; was valid, when they meant foo = &#8220;stringstring&#8221;;</li>
<li>Creating functions to do repeatable code for us</li>
</ul>
<p>Then, we suddenly just jumped into using Visual Web Developer, where I found out we&#8217;d be using ASP .NET, which I&#8217;m a bit annoyed with for two reasons:</p>
<p>ASP is shit. No one uses it. Well, some people do, but a lot of people talk about &#8220;upgrading&#8221; to PHP, which I think is an apt way of saying it. I mean, you can&#8217;t really code in ASP without buying the £300 IDE. And even then it produces horrible code. I suppose some people do still use it, so learning it won&#8217;t be a total of a waste of time.</p>
<p>Second, I think we jumped into it a little bit too fast&#8230; People were clearly confused as soon as she started talking about objects. I mean, it took me a good while to understand objects, surely students can&#8217;t be expected to understand what an object is with just &#8220;an object is a thing&#8221;. To her credit, we did a light bulb example, going through what functions(/methods) a light bulb object would have, but that confused even me&#8230; I just wish there could have been a tutorial on this, not really for me but for the clearly confused people sitting around me. A big problem there though is that we don&#8217;t have any tutorials for that class, just computer labs. Maybe we&#8217;re just expected to pick up things quickly now we&#8217;re older.</p>
<p>Anyway, in our last lesson, we use Visual Web Developer to make a simple form, then we learned&#8230; naming conventions I guess. The form didn&#8217;t have to do anything, I guess we were just getting used to how to be comfortable with the application.</p>
<p>Our tutor is a good one, and seems to be able to clear up confusion when people look confused, which is good. But one thing that does bug me is that she just reads out the handouts she gave us word for word. Not only does that completely negate the point of giving us handouts <em>to read</em>, but it makes her sound dumb. I know she&#8217;s not! But when all you&#8217;re talking about is something that we know is written by another person, it looks like you&#8217;re just passing on the information rather than sharing knowledge. It also makes the class slightly boring, for me at least. I don&#8217;t want to be sitting there just listening to someone; that&#8217;s boring. Listening and reading the handouts would at least give me something more challenging to do, but since she&#8217;s just reading aloud there&#8217;s no point.</p>
<p>We&#8217;ve been put into groups to do our project work in. My group is actually fairly good. Some of them haven&#8217;t done programming before, but that&#8217;s fine. When we were working on an exercise together everyone was giving input, so I think they were understanding it. When they weren&#8217;t either someone else explained it, or if no one else could I&#8217;d step in. I think I&#8217;m a pretty good teacher.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shamess.info/2008/10/12/weeks-one-and-two-summary-visual-web-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

