Damnit

When deciding to use SVN to update my WordPress install, I forgot to backup my content folder. Now it’s gone. Damnit.

And because I told Google not to save index this blog, it didn’t cache anything either.

Oh, looks like I do keep good backups.

Weeks one and two summary: Database Design Concepts

We started with a lecture in this class, which was good since most people probably had no idea why a database was interesting, and why they shouldn’t be using a spreadsheet. To be perfectly honest though, I’m sure a lot of people still don’t know. Though, thinking about it, most people seemed to understand some of the SQL so maybe I’m just under estimating them.

Reasons why you shouldn’t use a spreadsheet to store data:

  • It’s too easy to repeat data. For instance in a database you could just say “this row belongs to user 85″, and then have one row describing user 85, like their name and such. However, in a spreadsheet, unless you wanted to look up user 85 every time they were mentioned, you’d have to write out their name potentially hundreds of times. And then what if they change their name? You’ll have to go through and at least write  a macro to rewrite all the names, where in a table you’d just need to change the user table once.
  • Spreadsheets take up a lot of space, due to the repeat data, and also due to most the cells being in the wrong, or bad, format so compression is harder. For instance, in a database we could just say that a telephone number is capped at eleven characters. The file system now only needs to give that field that many bytes of data. Whereas in a spreadsheet it’d have to be variable length, a much greater resource intensive method.
  • They’re not as accessible. Over a network the user would need to download the spreadsheet then make any amendments they want, and then uploading it. They’d also need to lock the file so no one else could even read the data whilst it was in use. With a database, it’d stay on a central server where anyone can access the data at the same time. The database server could better manage user collisions.
  • Sticking with that example, a spreadsheet would require tenfold more bandwidth.

That’s enough examples.

After that we just jumped into learning terminology. That’ll probably the hardest thing for me to learn. Since I’m mostly self-taught I’ve rarely had to refer to much to anyone other than myself. For instance, my tutor refers to fields as “attributes”, which is what I could have called it’s type (she calls that the “attribute type”).

As she explained the term “key field” I got a little annoyed. I think she made it sound as though primary keys and unique keys were interchangeable words for the same thing, which they’re just not. Primary keys tell the database that it’s a unique field which is safe to refer to the row as. Whilst that’s the same for a unique field, unique keys aren’t usually used as foreign keys.

During the tutorial we had an example database, which a few tables. As a class (which is good, since most people were new at it, they might be unsure about what exactly the should be doing) we answered a few questions where we had to decide which tables we needed to select to get the information we wanted. Like, “list the students first names”. That was simple enough, so the WHERE clause was introduced. “List the first names of the students who were studying computing”.

As we were working through the lab workbook, I was pretty happy that people sitting close to me felt comfortable enough to ask me if they were stuck. The main problem I think for most people was that they didn’t understand that you need to tell the computer exactly what you want. When the problem asked to return all the students’ addresses, two people that asked me for help got it wrong because they had tried to called the table name `address` when they needed `street` and `town`. I’m pretty sure that’s just a thing they’ll get used to though.

In this class we’re going to be assessed on our ability to write SQL statements, I think. At least at the moment. I’m not sure how advanced we’re going to go into it though. So far it’s just SELECT we’re using, with WHERE, OR/AND, and comparison statements on single tables. Look through the lab work book, I saw that later we’ll be joining tables too. I think I saw a COUNT in there too, so I hope we’ll be using more complex SQL functions. I’ve never had much need to use them before.

Weeks one and two summary: Visual Web Development

Just finished the first two weeks of academic work here. I’m planning to do a post like this every week. I didn’t last week because it was all mostly just admin work. Classes are really starting to shape up now though.

In Visual Web Design, during the first week we were just being taught the basic principles of programming and stuff. Since I’ve been programming for years I already know all this stuff but I’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:

  • Commands have to be typed exactly should be
  • 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 “north”, “south”, “change colour”, and so on, a lot of the people expected the computer to know which order to do everything in.
  • Variable names to first, and then the information that you want to put into them. A lot of people thought that “stringstring” = foo; was valid, when they meant foo = “stringstring”;
  • Creating functions to do repeatable code for us

Then, we suddenly just jumped into using Visual Web Developer, where I found out we’d be using ASP .NET, which I’m a bit annoyed with for two reasons:

ASP is shit. No one uses it. Well, some people do, but a lot of people talk about “upgrading” to PHP, which I think is an apt way of saying it. I mean, you can’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’t be a total of a waste of time.

Second, I think we jumped into it a little bit too fast… 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’t be expected to understand what an object is with just “an object is a thing”. 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… 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’t have any tutorials for that class, just computer labs. Maybe we’re just expected to pick up things quickly now we’re older.

Anyway, in our last lesson, we use Visual Web Developer to make a simple form, then we learned… naming conventions I guess. The form didn’t have to do anything, I guess we were just getting used to how to be comfortable with the application.

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 to read, but it makes her sound dumb. I know she’s not! But when all you’re talking about is something that we know is written by another person, it looks like you’re just passing on the information rather than sharing knowledge. It also makes the class slightly boring, for me at least. I don’t want to be sitting there just listening to someone; that’s boring. Listening and reading the handouts would at least give me something more challenging to do, but since she’s just reading aloud there’s no point.

We’ve been put into groups to do our project work in. My group is actually fairly good. Some of them haven’t done programming before, but that’s fine. When we were working on an exercise together everyone was giving input, so I think they were understanding it. When they weren’t either someone else explained it, or if no one else could I’d step in. I think I’m a pretty good teacher.

Still no WoW? :(

I’ve connected to the university library wireless and it’s incredibly fast. Down side is that they’ve either blocked WoW from being about to send information, or WoW’s down… I’m hoping it’s not the first option.

In other news, I’m thinking of getting an Eee PC. They’re tiny, and good enough for me to type during classes.

Isohunt and IRC don’t work either. Damn censorship.

This isn’t fair!

I want to play WoW but this stupid connection lags too much. Normal surfing is fine, but the router can’t seem to handle my WoW connections. This is what happens when you put hundreds of people on one router and expect it to work well.

I’ve also used over half of my bandwidth allowance in just under two weeks, so I won’t be able to download Heroes this week either. Even if I could, I couldn’t watch it. BBC’s stupid “we’ll only buffer the next twenty seconds of the program, so we don’t waste all of our bandwidth if you only watch half of it” means that I can’t leave it to load. I have to watch twenty seconds, and then wait for it to buffer again. I can’t download the application to download it because that’s a P2P service which’ll use all my bandwidth allowance.

Seriously considering a 3G connection, so long as it’s fast enough.

Error log

There are always errors that pop-up that I look at for hours thinking “… what the hell is causing that..?” Usually it’s pretty stupid. Here’s a list of those types of errors so that I can quickly fix it when my head has melted.

  • Is .htaccess reading your file format right? Sometimes I write a CSS file in PHP so I can make a bit of it dynamic. For some reason the browser was ignoring the first line of CSS. I looked at the file in my browser and saw that it was outputting the PHP source too, because I’d actually forgotten to put the right line into .htaccess.
  • Use Notepad++ (or something else that tells you what you’re closing). I do this a lot of the time when I’m getting an array:

$arr_item = mysql_fetch_array (mysql_query ("...");

At the moment, it’s blatently obvious what’s wrong there because it just looks unbalanced. But when your SQL takes you across the page, you probably won’t notice it. With Notepad++, it’ll tell you that there’s a missing closing bracket.

  • XMLHTTPRequest not doing anything? Did you forget to do the send method?
  • Exploding at lines not working? Remember to use double quotes around the n, and not single quotes.

So far, so good.

Just an FYI, my tomatoes that I was worried about are fine. They say on the packet that they expire on the 25th of September, but they’re still perfectly fine.

Classes aren’t exactly interesting, but that’s mostly because I learnt all this stuff in college. I’m sure they’re just taking a little time to get everyone up to speed being as a lot of them didn’t do computing at college (or even attend english education) so database design consepts are completely foreign to them. I don’t mind.

They’re definitely more organised though. There’s no “oh, we didn’t get time to finish today, so we can carry on next lesson”, like in college. Today we didn’t finish the class because some people were lagging behind and the teacher just gave us the rest of the booklet as homework, and I suppose next lesson she’ll just carry on where she expected to finish. I like it. It does mean I actually have homework now though… Never really had that at all during college.

I don’t want to seem over confident but to pass this year we need 40%. … Yeah. 40%. Coursework is 70% and there’s a multiple choice exam for the rest. I don’t feel too pressured yet. Though, if you don’t attend classes to dock the maximum number of credits you can earn. So you can get everything 100% right, but if you don’t turn up you might not be able to pass.

Both my tutors so far are female, and there’s a good portion of my class that’re female too. I’ve never once met/spoken to a female person online before, so I just assumed it was all men. Maybe I have spoken to women, and just not noticed. They haven’t really filled me with confidence in class to be fair, but maybe that’s because they’re not teaching me hard stuff yet. It was a little disappointing when my database consepts tutor told the class to “just rename the table with the hyphon in it, that’ll fix the problem”. I mentioned that I thought backticks might have been a better option but she looked at the SQL I had written in a confused way.

Access tries to make things so simple it doesn’t work. I’ve never had a problem using backticks in command line, and it’s perfectly valid – even encouraged – SQL, but Access seemed to think I was confused and so put square brackets around it and then smiled smuggly that it’d fixed it for me… Down with Access. Lets just do the class in a MySQL CLI.

Programming consepts was just the same, dull stuff really, which I put down to the same reasons as above. We learnt that commands (I was commended happily when I called them functions unprompted…) make the computer do stuff, and if you spell them wrong then it won’t work. Oh, and that the order matters. Some people didn’t quite grasp that straight away.

Evenings are definitely more fun. Is it time to go out yet? (Scratch that, I actually have no money.)