Roadmap to Beta: The new Virb gets a launch date! →
JulyJul 18 Sunday 10
So as you’d already know, Ciera came back to Australia three weeks ago, which is why I haven’t really been on messenger much recently
. Things have been excellent so far, it’s been really enjoyable. Last week, we made some delicious rainbow cookies. They were pretty much just plain lemon cookies based on a recipe from a $4 book we bought at Go-Lo, WITH A DIFFERENCE! We made them awesome by colouring them all different colours (and even made some multi-colour, which was my idea
). They were delicious and colourful and made with 100% awesomesauce. Next time we make some, we’ll make them all rainbow I think xD.
Yesterday (Saturday), we went to Scienceworks, which is a science museum here in Melbourne. Well, we got there eventually. We had a few minor issues along the way. Firstly, we got off at Parliament Train Station (as the Metlink journey planner said to), and the platform that the train we needed usually comes to was closed, and there was a notice to go to Southern Cross Station. So, we went back to the platform we came from, and caught another train to Southern Cross. When we got to Southern Cross, the train took aaaages to come (then again, it’s the Weribee line so it’s kinda expected I guess
). And then there was another complication — The train terminated at Footscray and we had to take a replacement bus the rest of the way. However, once we caught that bus, we finally got there. Entry is free if you’re a student, so that’s definitely a bonus.
While I’ve been to Scienceworks before, it was a long long time ago and I couldn’t remember much of it. This time around it was pretty good and I found it quite interesting. They had a toy exhibit, which was awesome! They had a roller coaster made out of K’Nex which was very nice. I want one!! Get me one please? I’m such a child at times, I don’t think that’ll ever change
. Anyways, there was also other exhibits like a flight simulator, a kitchen thingy and a nice fire show (with demonstrations, Aaron would have loved it xD). There’s also a planetarium there, but we didn’t go this time (maybe we’ll go next time). And we also went to the store there, and bought some glow-in-the-dark stars (which we stuck all over the roof in our room
). All in all, it was a very fun day, I really enjoyed it! Was definitely worth the $0 entry to Scienceworks, hahaha
.
As for work, things are going very good. Since I just passed the six month mark for my IBL placement, I moved from the technical support team at work into one of the development teams. We’ve been working on improving our products by making commonly-requested upgrades. When clients would like functionality that is currently not available in our system, their request goes onto a wishlist. My team went through the wishlist, rated all the items based on priority, and started working on them. In just two weeks, we’ve completed heaps, and a few people are very happy
! I’ve also been doing a few other things, it’s been quite good. I really enjoy my job! Also since it’s about the half way mark now, my mid-placement report is nearly due. I’ve nearly finished it, just have to confirm that it’s alright, and show it to my supervisor and see if he thinks it’s alright.
So it’s the start of another week tomorrow. I really miss Ciera during the day while I’m at work, but it’s awesome coming home to her! Really makes me happy and makes everything I do worth it. <3
Until next time,
— Daniel
JulyJul 3 Saturday 10
So, my girlfriend Ciera came back to Melbourne last Saturday (26th June 2010)! We’ve been having a great time so far, I’m so very glad to see her again! I honestly don’t think I would have been able to wait much longer, so I’m extremely happy that she came her when she did. It’s been a week since she got here, and things have already been so amazing! I think she’s been enjoying it here heaps (I know she loves it in Australia), and I’ve certainly enjoyed it. Today we just did a bit of shopping, nothing too big. Bought a bookshelf to put all our books and stuff on
I can’t wait for what the future is going to bring us!
Until next time,
— Daniel
JuneJun 25 Friday 10
I’ve added a “Microblog” section to this blog, which I’ll basically (try to) use to post things when I’m out and about. Kinda like Twitter, but maybe with longer posts. Like a… microblog, or tumbleblog (Tumblr, etc.)
Ciera gets here tomorrow morning! EPIC excitedness! I can’t wait!!!
Until next time,
— Daniel
MayMay 19 Wednesday 10
AprilApr 24 Saturday 10
I thought I’d give some link love to some of the lesser-known web development blogs I enjoy reading. This post was prompted by a post about my site at GiveUpInternet.com. I didn’t expect the link (as I don’t think my blog is very good for web development stuff), but I do appreciate it heaps! This blog hasn’t really focused too much on web development, perhaps I should post more web development articles
That’s all for now… I might eventually write another blog post like this. Or a proper blog post
Until next time,
— Daniel
MarchMar 28 Sunday 10
In this post, I’ll discuss some of the techniques that I personally write JavaScript. There’s no right or wrong, this is all my opinion (still, feel free to flame me if you feel it’s necessary
). This post is aimed at people that understand basic JavaScript and HTML techniques, and want to see how I code my JavaScript. I will talk about the JavaScript of the past, how it’s changed, and some techniques used in modern JavaScript development. This will probably be a multi-part series if I ever get around to writing more posts
So where do we begin? In the old days, JavaScript wasn’t used very much at all. Browsers didn’t really support much JavaScript, so it was only used to add little bits of functionality to sites. The one site might have had a few little procedural functions for the whole site. Global variables were used everywhere, but as the scripts were very small, this wasn’t too much of an issue. Usability also wasn’t considered much of an issue, and there was no proper event model, leading to things like:
<a href="javascript:DoSomething();">Do something</a>
However, the JavaScript of today is something very different — It is everywhere, and is used for more than just trivial uses. On a normal website, a large amount of JavaScript might be used. Nowadays we even have web applications like Gmail and Google Docs which contain heaps of JavaScript for all their core functionality. There are a lot of web applications that are mainly client-side, with a very small server-side component. Because of this use of large scripts, we can no longer rely on unorganised scripts and use of global variables as in the past. Scripts written using these techniques of the past become very unmaintainable very quickly. Additionally, usability is a bigger issue today than it used to be, mainly due to the number of users on the Web (many of which have disabilities and require sites to be accessible).
So what can we do to improve our JavaScript? Well, let’s first see how we can neatly organise our JavaScript using…
You might be thinking, “what the heck is object literal syntax”? Simply put, it’s a simple syntax for creating a JavaScript object, added with the release of JavaScript 1.2 in June 1997. Here’s an example of an object created with this syntax:
var MyObject =
{
myVariable: 123,
hello: 'world'
}
alert(MyObject.myVariable) // alerts "123"
alert(MyObject.hello) // alerts "world"
See? Pretty simple. It’s a lot like a hashtable in other programming languages (such as C#, Perl, and arrays in PHP). One of the great things about JavaScript (and a feature that differentiates it from some other languages) is that you can store functions inside variables. We can use this to our advantage:
var MyObject =
{
myVariable: 123,
hello: function()
{
alert('Hello world ' + this.myVariable);
}
}
MyObject.hello(); // alerts "Hello world 123"
See what we can do? Instead of having variables functions laying around all over the place, we can group them together into objects. This is a similar idea to namespaces in other languages, and is probably about the closest equivalent in JavaScript. When coding a site that uses JavaScript, my personal approach is generally to make one object per unique page that uses JavaScript. This keeps things nicely organised, and makes each page’s functions and variables self-contained.
Of course, we can also use proper classes to hold reusable components, but this is outside the scope of this post and will probably be covered in a future post
.
Another modern technique is unobtrusive JavaScript…
In a nutshell, unobtrusive JavaScript is a coding technique that separates JavaScript from HTML in the same way that CSS is separate from HTML. Basically, with unobtrusive JavaScript, you have no JavaScript in the HTML at all, except for the tag that loads the script file, and maybe a tag to run an initialisation function. This means no onclick=”whatever()” attributes on any of your HTML elements. How do we add JavaScript click actions, then? Easy — Event handlers!
When using unobtrusive JavaScript, the JavaScript initialisation function “connects” the event handlers to all elements that need them. JavaScript event handlers are similar to that in other languages — Stuff throws events (such as click, mouseover, etc.), and functions can be set to run when these events are thrown. Previously, this was a little annoying, as Internet Explorer uses a different syntax to other browsers. However, today, there is no excuse, as JavaScript frameworks (such as MooTools and Prototype) and libraries (such as jQuery) make it really easy.
Another feature of unobtrusive JavaScript is that it involves progressive enhancement and graceful degradation. If the JavaScript doesn’t run (ie. if the user has JavaScript disabled), the user’s experience will still be acceptable. Maybe not as good as if they had JavaScript enabled, but still usable. We don’t rely on JavaScript, but we do take advantage of it if it’s available. This usually involves adding event handlers (as mentioned above) that override the default action for links (that is, go to the URL they link to).
You might be confused by now (seems I ramble a lot in these posts), so let’s quickly jump to an example HTML file that shows some of the things we’ve mentioned so far:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>JavaScript Test</title>
<script type="text/javascript" src="mootools-1.2.4-core-yc.js"></script>
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript">window.addEvent('domready', UserList.init);</script>
</head>
<body>
<table>
<thead>
<tr>
<th>Username</th>
<th>Tools</th>
</tr>
</thead>
<tbody>
</tbody>
<tr id="user-1">
<td>Daniel15</td>
<td><a href="/user/1/delete" class="delete">Delete</a></td>
</tr>
<tr id="user-2">
<td>Bob</td>
<td><a href="/user/2/delete" class="delete">Delete</a></td>
</tr>
<tr id="user-3">
<td>Mark</td>
<td><a href="/user/3/delete" class="delete">Delete</a></td>
</tr>
</tbody>
</table>
</body>
As you can see, absolutely no inline JavaScript, just some script loading, and setting the UserList.init method to run when the page loads. If JavaScript is disabled, clicking any of those “Delete” links will take the user to the corresponding delete page linked with the tag. What happens if JavaScript is enabled? Let’s see! Here’s the corresponding JavaScript file:
var UserList =
{
init: function()
{
// Connect up all the delete links
$$('a.delete').addEvent('click', UserList.del);
},
del: function()
{
var user_id = this.getParent().getParent().id.substring(5);
alert('Delete user ' + user_id);
// Make sure the link doesn't go anywhere.
return false;
}
};
This is written using MooTools, but you could achieve a similar thing with another framework/library such as Prototype or jQuery. MooTools is just what I use
Notice the init function “connects” the delete links to the delete JavaScript function (which I named “del”, “delete” is a reserved word in JavaScript). So, when you have JavaScript enabled, instead of going to the URL specified in the link, the UserList.del method will be run. This example just pops up an alert box, but this could easily be changed to use an AJAX call to delete the user. See? Magic! It’s fully functional with JavaScript disabled, but JavaScript being enabled adds a lot of niceness.
And yes, I know, that script is messy and could be made better, it’s just an example.
In this post, I’ve shown how to use object literal syntax to group JavaScript functions and variables together, and unobtrusive JavaScript techniques to progressively enhance pages. The advantages of doing so include neater and more maintanable code, and graceful degradation if JavaScript is disabled (not possible with links. There might eventually be a follow-up post.
Hope this helped you
Until next time,
— Daniel
MarchMar 14 Sunday 10
A while ago, I used to use a VPS from a company called FSCKVPS, mainly for storing backups offsite (in case something bad happens to my server one day), and secondary DNS (so in case my server is ever down, I can still get emails, as my emails are hosted using Google Apps). In June 2009, their parent company VAServ had a massive hack attack, with news websites reporting that as many as 100,000 websites were wiped out by the hack, and the WebHostingTalk thread about the outage ended up being one of the longest ones I’ve seen, at 177 pages long. Some people’s VPSes survived, but mine was one of the ones that was totally lost (luckily, as it was only for backups, it didn’t have anything too important in it). They offered two months free as compensation, so I waited patiently for them to provision me a new VPS, and lived without offsite backups for a while.
After the two free months, they were still having issues — My VPS kept breaking, and they still hadn’t given me a secondary IP address as I had requested. I kept giving them the benefit of the doubt, but eventually I decided that enough was enough (two months should have been enough to sort out things), so I moved to another provider. When a company can’t even work out how to spell its own company name (sometimes they write “VAServ”, other times they write “VAServe“), it’s probably time to give up on them. I asked them to politely remove me from their mailing list so I’d no longer get any emails from them. I thought this’d be the end of it, but last week, I received the following email from them:
What goes up won’t go down.
At Poundhost/VAServ we know that if your site is not up, your profits go down. Which is why we recently migrated your website onto a more secure Linux server platform.
However, threats are always evolving. To ensure that you are provided with the very best platform that’s reliable, secure, easier to manage, with greater interoperability and a substantially lower total cost of ownership, we recommend that you consider switching to Microsoft’s Hyper-V hosting platform.
Running on next generation virtualisation technologies Microsoft’s Hyper-V stores your data on a cluster of servers rather than one. So if a server is attacked, or goes down, the system automatically switches to the others. Thereby guaranteeing 100% uptime.
Migration is so simple you can do it yourself. However some of you may need to tweak or re-code your data beforehand to enable it to run on a Microsoft platform. Should you have any queries, call our contact centre on 01628 67 31 31.
Don’t delay though because we are prepared to offer a 10% discount to all those who migrate before 31st March 2009 using the coupon vdsmigrate.
See http://vds.poundhost.com for more information!
Ugh. Where do I begin?
I’m sure I’m not the only former customer that got this email. Did they just send it to everyone, regardless of whether they’re a current customer or not? I asked them to remove my personal information when I left, so I’d consider this spam. I replied to the email asking them to remove my details from their system, and they replied saying they had done so, so we’ll see. At least they could spell “guaranteed” correctly this time around, the FSCKVPS site had misspellings of it from their launch, and a lot of people told them about it, they still didn’t fix them.
For what it’s worth, I’m currently using a Core 2 Duo server at HiVelocity for hosting all my sites, and the backup VPS is now at PhotonVPS. I’d definitely recommend both companies
Yes yes, this isn’t really a proper blog post. One will come eventually
Until next time,
— Daniel
JanuaryJan 22 Saturday 10
JanuaryJan 2 Saturday 10
So, I’m not sure how many people agree with me (I haven’t really searched around to see if anyone has the same opinion), but I’m starting to form the opinion that there are two different types of developers: Those that can develop an application but don’t really understand the concepts behind it, and those that have a relatively deep knowledge of how their code works and all fits together. Or, in other words, those think it’s alright (and perhaps have it as a job), but are not very passionate, versus those that are very passionate about programming. Generally, I guess something like the following could be said:
People in the first group:
And people in the second group:
Anyone else agree with me? Personally I’m proud to be in the second group, the awesome group
Anyways, I’ll write another proper blog post, eventually. I started working recently, and will definitely have to blog about that
Until next time,
— Daniel
DecemberDec 31 Thursday 09
DecemberDec 30 Thursday 09
DecemberDec 26 Sunday 09
Recently, I was looking through a few short domains, and decided to buy dan.cx. I think it’s a pretty good domain, even if .cx is an odd TLD (it’s the TLD for Christmas Island which is close to Australia, so I guess it’s kinda related
). It’s better than my old one (d15.biz) in my opinion. “d15″ doesn’t have too much meaning (apart from people that know it means “Daniel15″), whereas “dan” is a lot better. I’ll still be using the old domain for some things (it’ll still be my main email domain, since there doesn’t seem to be a way to change the domain of a Google Apps setup, which is what I’m using for my email). I also got daniel.gd last night, but I’m not sure where I’ll use that (“daniel good?” I dunno). It currently just redirects to dan.cx. I should probably stop buying domains. But, I bought these instead of renewing a few domains. I don’t really work on MySpaceTools any more, so I’m just letting the domain expire.
I guess you’ve probably noticed, but I’ve been doing some updates to my site (finally!). I rewrote it to use my own very simple CMS (instead of a static HTML file), and added a “Projects” page showing some of the bigger projects I’ve worked on in the past. I’m considering switching the site to be fully WordPress (instead of just the blog), but I haven’t done that just yet. Not sure if I will, I’m happy with the simple CMS for now. I thought WordPress might be easier for site management though. And the main part of the site is the blog, which might be better in the root. I dunno.
A proper blog post will come eventually. One day.
Until next time,
— Daniel
DecemberDec 14 Tuesday 09
DecemberDec 7 Monday 09
DecemberDec 6 Tuesday 09
DecemberDec 2 Thursday 09
Well, I haven’t blogged for a while (seems to happen to me quite often). I was pretty busy with university work, exams, arranging a work placement for next year for IBL, and other stuff. I get my exam results in about one and a half weeks, hopefully I did alright on them. We’ll see I guess…
Many of you know about my girlfriend. If not, her name is Ciera, and she’s absolutely amazing
. We met online on MySpace (haha) towards the end of September 2008. I had broken up with my ex-girlfriend after a short and hopeless relationship in August 2008. I was rather upset after my ex broke up with me (to be honest, I really have no idea why, looking back at it now), and was just looking for people to talk to, to make me feel better. I was browsing MySpace one of those days, and was looking through Tom’s (you know, the guy with the pretend friends) blog, where Ciera had posted a comment on one of the posts. There was something about her in particular (the way she wrote? Her picture? I really don’t know) that made me click on her and take a look at her profile. Now, I don’t know why this happened (even today, neither me nor her know why things happened the way they did), but I’m glad it did. Reading her profile made me realise that we had so much in common! I sent a friend request right away, wondering if she’d accept and become my friend. I really wanted to get to know her more.
Luckily, she accepted my friend request. We started talking on MySpace, and eventually on Windows Live Messenger. We chat for hours and hours every day… It made me really happy (still does today), and made me forget about my ex-girlfriend and what happened with her. We kept learning more and more about each other, and got closer and closer. It was amazing how much we have in common! After about a month, we started to realise how we felt about each other. What started as a good friendship was definitely growing into something bigger (bigger is better, right?). There was only one problem with this — Distance. You see, while I’m here in Australia, she’s all the way in the USA. We were so close, and yet physically we were so so far away from each other. Quite annoying really
. She told me that when she finds a job, she’d start saving up to come see me!
Fast-forward eight months later, to June 2009, and Ciera was on her way here! She had saved up some money for the flight here, and I contributed some money towards it as well. It was so unbelievable, finally getting to be with her. I honestly didn’t know what to expect, but I knew things were going to be alright (since me and Ciera were extra-close by this time
). And things were way better than just “alright” — The whole experience was AMAZING! We had a great time staying together! She was here for three months, and we did so much in that time! I showed her around some places in Melbourne, and we just generally had a great time. Just holding hands and even just being in the same room as each other felt so amazing after dreaming about it for so long. It was really like a dream come true to us. It was really upsetting when she had to leave though, and I still miss her all the time
. At least now I know who I’m going to spend my life with. It’s a great feeling knowing someone as amazing and attractive as Ciera.
Being in a long-distance relationship has been quite an experience. While it’s quite hard and I miss her every day, knowing that she’s there for me and we’ll be together one day is an amazing thing. I miss her heaps. I miss her smile, her laugh, everything about her. Being able to chat to her every day helps HEAPS though. It makes me feel like she’s with me, even though we’re physically so far away. A lot of people say that online relationships don’t work, but me and Ciera are proving them wrong
. I love her more than anyone else I’ve ever met, and I have a feeling things will be like this forever. We’re both working towards seeing each other again, and it’ll be amazing. Like I mentioned at the start, I have a work placement next year. If that goes well, I’ll save all the money from that, and use it to fly over to see her at the end of the year. That’s pretty far away, but it’ll be incredible when it happens. It’ll be the first time I’ve travelled outside Australia (outside Victoria, even).
Ciera’s also written a similar post on her blog, if you want to read her one.
Until next time,
— Daniel