Author Archives: Arthur Payne

Back in the Saddle

It’s been over a year since my last update here. I’ve been putting coding updates in my personal blog, since I interweave them with personal comments, but it’s probably not good for my professional site to make it look empty like this.

I’m currently enrolled in the Advanced Game Development post-graduate program at Fanshawe College in London, Ontario. I’ll be uploading my assignments to my Github and linking them here to show what I’ve accomplished.

I’ll also be putting some of my older projects on hiatus. As it happens, one of my class assignments is to develop a full featured chatroom, so I might use that to restart my MU* project. I might even make it open source, wouldn’t that be neat?

Anyway thanks for checking out my Blog. Expect more posts in the next few months.

Tagged

SimpleBlog Work Post

4:30pm – This’ll be a short work session since I have to be somewhere in less than an hour, but I want to try and solve the AJAX error if I can before that. I’ve already taken a look at it and I’ve got no clue what’s going wrong. I don’t see any new code that would interfere with the jquery get function, yet it returns a fail result. So, I’ve gotta figure out under what conditions it could fail.

4:33pm – Oho! I found the problem. When I went to the php page itself it gave a syntax error. That explains it. That should be easy enoug to fix.

4:35pm – It doesn’t seem to have a syntax error in the file itself. I’ll try re-uploading it in case I don’t have the most recent version on the server.

4:46pm – Well I’ve gotten rid of the AJAX error but I still don’t have any posts showing. I wonder why that could be.

5:01pm – The AJAX error is gone, it was mostly a bunch of syntax errors in the PHP. But now it’s not putting up any posts and it’s not giving any errors. I added a data dump to console and found that it was getting a false result from the PHP script. That means the database connection isn’t working properly, in one of a few ways. It’ll take some effort to figure out what’s going wrong there, and I’m low on time, so I’m going to head out.

Tagged , , ,

SimpleBlog Work Post

3:15pm – Well, my problem mysteriously resolved itself when I cleared my cookies, which makes as little sense as the problem itself. For now I’m going to ignore it, since there’s nothing I can do, and continue programming. There’s a bug with the cookie anyways, so I need to implement a logout function. I’ll do that now.

3:35pm – I’m having trouble figuring out how to end the session when I’m doing the PHP side as a web service. I’m not sure but I think I’m going to have my sessions never end, server-side, while they end locally in browser, because it’s impossible to always have the browser close out sessions at the end. I’m not sure if this isn’t how the thing’s meant to be used either.

For now I’m going to do this the easy way and see if anything goes wrong.

4:07pm – Well the logout seems to be working fine. The cafe’s internet isn’t, though. It takes a while to load anything, if it loads at all… And it’s uncomfortably hot. I don’t think I’ll stick around for the second hour like I planned.

The next thing I need to do is figure out how I broke the basic post display, and fix it.

Tagged , ,

SimpleBlog Work Post

7:48pm – Some friends gave me some suggestions for my null != null is true problem, so I’ll give them a try.

8:19pm – No dice. Even when I have it as if(sessionID) and sessionID is null,

8:24pm – I’ve made progress! It’s a browser issue. In FireFox it works perfectly, but in Chrome it fails miserably.

8:33pm – Well that’s as far as I’ve been able to get. This really has me stumpped. I tried switching over to the !== operator but that doesn’t do any different. In Chrome, null !== null is true, and in Firefox null !== null is false.

Tagged ,

SimpleBlog Work Post

3:51pm – When I last left my Simpleblog, everything had broken. It thinks it’s logged in when it shouldn’t, and it throws an AJAX Error when it tries to download/display the posts. No more javascript errors though.

4:09pm – I put some console outputs into the code. For some reason the sessionID is coming out as null. Not sure how that’s happening…

4:16pm – Okay WHAT!? if(sessionID != null) is being passed even though sessionID is null. It being null is the only time that it should not pass! Debugging is one thing but I don’t know how to fix it when it’s clearly defying a logic gate. >.< 4:26pm - I've tested null comparison outside of my project and it works fine. Why doesn't it work here? It doesn't make sense! Argh. 4:28pm - if(null != null) console.log ("null != null"); doesn't print to console, so why does it evaluate as true immediately after? I have it printing sessionID to console immediately before the comparison; it's null, and yet null != null is proving true. Why? 4:33pm - It's google time. Here's something from StackOverflow... No that doesn't help. I don't see anything else that's like my problem. Shoot. I'm completely stumped, here. I'm going to give up for now and think about it, and maybe some friends will have an idea.

Tagged ,

SimpleBlog Work Post

10:29am- I finally have internet at the cafe I’m working at. I’ve been working for about a half hour aready, working on the login function JavaScript. I’m about to make some modifications to the php login function to stop code insertion.

11:44am- I’ve been working quite a while and haven’t tested anything. I’m sure something will go wrong with this code, and debugging it is going to be a pain. I’m still working on the login function. Right now I’m working on the part where it shows the hidden logged in options bar and hides the login form.

12:13pm- Now I’ve got it so that if there’s a session ID cookie it displays as if you’re logged in. It’s getting close to test time.

12:20pm- Test time! Also lunch time. I’ll be debugging until my food gets here. I’ve got my first bug too. The login form is nolonger displaying to the right of the page with the CSS Formatting.

1:14pm- Well I got the javascript errors cleared out, but now it’s throwing ajax errors displaying the entries. Unfortunately I’ve hit my limit, it’s hard to keep my eyes open. I need a nap, so this is where I’m calling it for now.

Tagged , , , , ,

SimpleBlog Work Post

Well I’ve finally found time to work on my SimpleBlog project again. Well, this isn’t the only time. Last time I worked on it, I didn’t save my notes, so I’ll summarize here.

I added a CheckLogin function to model_SimpleBlog to check the login data, and removed the checkLogin function from controller_SimpleBlog.php because its unneccesary now. The web app will know it’s logged in because it’ll have a session id, or it won’t. Checking the login data will happen on login.

9:51am- Getting started. The work I did last time has got the groundwork done for logging in and returning a Session ID. Now I need to make the login form work and make the system check for a cookie with a session id. I’ll start with the latter part.

10:47am- Okay it now checks for a session ID in the cookie when the page loads, and if it finds one it assumes the user is logged in. Next I need to make the login form work, but that’ll have to wait for next time. I just remembered something I had to do at home.

Tagged , , , ,

Hibernation Over

Well, I haven’t posted anything since October, and frankly I haven’t done much since October save for a bit of job searching that didn’t go anywhere. I think part of the problem is my lack of a portfolio. I haven’t finished my SimpleBlog or even worked on it in months, but I still have my Tile Matching Game to show off, so that’s what I’m going to do.

The first thing I’m doing today is getting a portfolio link page set up here on my ElectricSquirrel.net coding blog.

1:28pm – Work begins. Loading up FileZilla to find the last edition of my Tile Matching Game. Of course, there’s a new version of FileZilla to download, so while that’s going I’ll write up a description of the Tile Matching Game in the blank new page I’ve got open in annother window.

1:46pm – I’ve added the page, but something went wrong with WordPress and instead of loading the page when you click the button, it takes you to a list of dirctory contents. Not good.

1:51pm – Oh for goodness sake, I already had a ‘Portfolio’ folder and now it’s linked to by the page. I should be able to fix that…

Alright that worked fine.

I should also add the two websites I worked on to the Portfolio page.

2:03pm – Alright I added the websites to my portfolio. Hopefully now people will come to my coding blog and say ‘Oh, this person has done things before! We should totally hire them!’ and not ‘This person may be a college grad, but how do I know they know their stuff?’

We shall see!

I’ll admit I thought this would take more than a half hour to do. I suppose I should get to work on my other hibernating project, my SimpleBlog.

First, where did I leave off…

Ahh, it looks like I last did some work in December, I just didn’t write about it here on my Coding blog for whatever reason.

2:35pm – Ahh yes, I was struggling with pagination for moving through the entries in the blog, and had just solved the problem. The next stage of the blog is a difficult one; logging in.

2:56pm – I’m not really making any progress. I need to take a break and read up on the techs I was using before.

SimpleBlog Work Post

Last time, I put together the basic HTML of the simple blog. Today I’m going to work out the interchanges.

When a user first comes to the simpleblog index page, they’ll be presented with a list of the ten most recent entries, a login form, and buttons to display the next ten or previous ten entries chronologically.

So the first thing that has to happen is that the page must ask the controller for the ten most recent blog entries. This means the controller must ask the model for the ten most recent blog entries, to share them with the view, the page.

If the user enters data in the login form and presses the login button, the page must give that data to the controller to compare it with the login data in the MySQL database. I’ll enter that data directly, since it’s a one person blog. So there’ll need to be a model for the login database as well, and functions to access it.

When a user successfully logs into the blog, a persistant field will be created so that the user stays logged in. The sidebar will also be changed to include post and logout buttons via a script, and hide the login form.

When a user is logged in, each post will include edit and delete buttons. Edit will bring up a version of the post page with the data from that post. Delete will bring up a dialog box to confirm, then on confirmation will delete the post.

The post button will bring the user to the post page to allow them to post a new entry.

The Post Page itself will be a simple form with a post button. If the post page is shown in edit mode, it will say confirm edit instead. The post button will create a new post in post mode, or save the changes to a post in edit mode.

In edit mode, the Post page will load a previous post, so there will need to be a function for that in the controller and model, and a function to save over the post.

That should be everything. If I’m missing anything it’ll be discovered along the way.

Now I’m going to bed. It’s been a long day but I’m glad I found time to work on this.

Simple Blog

So I’ve given some thought to the WebMUCK Project and I’ve decided to put it on the back burner. It’s more complicated than I had anticipated, and it’s not going to be done for a while. I need to pump out some good, short projects for my portfolio, so I’m going to do what most of my class did back in school and write a simple blog. Well, I’ll do it a bit fancier than they did. I’m going to use all my HTML5, CSS3, JQuery, AJAX, PHP and MySQL skills. Well, as many of them as I can squeeze in there at least.

Now I’m going to do a rough inventory of what I’ll need to create to do this.

Viewing Page
Post/Edit Page

Just three pages. Lots of scripts though.

The Viewing Page will need to access a PHP Script that will show blog entries. It’ll need to be able to tell which entries it’s showing, so that it can show pages of ten entries at a time. There’ll also be a login box for the blog owner to log in and make and edit posts. That means it’ll also need to keep persistant login data.

The post/edit page will be simple by comparison. All it has to do is send form data to a PHP script that will push the data into the database. In the case of editing, it’ll first load a post, but that shouldn’t be much more complex.

I’ll try to keep to the MVC format, so there’ll be a controller_Blog.php script that the pages make RESTful calls to, and a model_Blog.php script that models the database and permits interaction with it.

I think I’ll start by making the basic HTML of the pages, then plan out the functions and methods for the scripts and how they interact, before implementing them. I find it helps to have something to look at to put everything in perspective.

—–

Alright, the HTML and CSS for the basic index page are done. I’ll have to edit them once I start actually programming, but this gives me something to start with. Next I’ll do up a form for posting/editing entries.

—–

And that’s a nice little post page. I think that’s enough for one update. I’ll share the github repo later.