Break Things, Please!
I posted this in my status on Facebook, but crossposting yields wider audiences. Amber conscripted me to build a simple submission and voting script for an upcoming Doctor Who fanvideo contest. I think I'm mostly done with it, which means that there's a ton of bugs to be fixed, naturally. I've already gotten the obvious SQL injection one (look at one of the submissions on the vote page, it has a drop table statement in it that should've cleared all the submissions) and Richard already helped me fix one that came up if the page was open in two different tabs or browsers (just a simple check fixed it; a stupid one, but simple), but I want people to keep trying to break it. Amber doesn't need it until the end of April or so, so I've got plenty of time to beef it up if anything is found.
So, go for it. Try all your stupid little user tricks, things I would never have thought of as the programmer (such as the multiple tab thing Richard showed me).
This project was really fun. I got to learn some more php, expand upon my sql, learn how to use sql within php, and probably most fun of all: learn how to use ajax. Since voters are to vote on multiple categories, I did not want to have to reload the page every time they voted in one category, that would be a waste of the voter's time. Especially when the page gets to be pretty long with a ton of submissions (I'm assuming it will get long (there's twenty-nine categories after all), and that there will be a ton of submissions). So, instead, when they vote on a category, it'll just collapse the form in that category into a "Thank you for voting!" message and the voter can go on unabated. I like it, it's really cool :razz:
The thing logs based on IP address, so of course if you go to another computer and try to vote again, you'll succeed. And of course if you use a proxy, etc. etc.
--A dude just walked past my window and freaked me the hell out. Looks like he was checking something on the outside of the buildings.--
Amber said that the people who will be participating are unlikely to go about vote stuffing in this manner since... well, they're generally fourteen year old fangirls who know shit about computers (though they can kick my ass at video editing, that's for sure).
But yeah, try anything, everything. And if you break it or find something that you think might be broken, just leave a comment on this post.
Also, yes. It is intentionally ugly (this is Corey's big issue for some reason, and yet his IPRO site looks like it was made in frontpage). I plan to just php include() them into Amber's site later on and CSS the hell out of them.
I watched A Dog's Breakfast before going to bed last night. It was surprisingly good. It stars David Hewlett (Rodney McKay, Stargate: Atlantis), his sister Kate Hewlett (Jeannie Miller, Mckay's sister, Stargate: Atlantis), and Paul McGillion (Dr. Carson Beckett, Stargate: Atlantis; Young Dr. Ernest Littlefield, Stargate: SG-1 "The Torment of Tantalus"). The Hewletts again play siblings, with McGillion as Kate's actor fiancé. It started out a little.. slowish for me, but then just took a turn for the awesome. Especially the cameo by Christopher Judge (Teal'c, Stargate: SG-1). Holy hell. He plays such a serious character on SG-1, and while I knew he was a funny guy, I didn't realize just how awesome he could be. He really needs more comedy jobs. It's a small cast, and it's basically all Stargate regulars, but it's so refreshing to see them all outside of the Sci-Fi genre doing some good ol' comedy.
I recommend the movie, even if you aren't a fan of Stargate. David Hewlett's performance is top-notch and his chemistry with Kate is perfect (which probably has something to do with the fact that, you know, they're siblings and all). McGillion is great too (one of my all time favorite actors on Atlantis).
The Prometheus ship set/stage also makes an appearance, as McGillion's character is an actor on a really bad Sci-Fi show (where Rachel Lutrell, also of Atlantis fame, makes a cameo) that seemingly takes place aboard an advanced space ship.
Success!
So. After who knows how long of not working on my plugin, I came to a revelation last night: Why bother replacing the spaces in the URLS with plusses?? Browsers nowadays should be able to handle that with no problem! Opera replaces the spaces with "%20"s automatically. Firefox doesn't replace them, but can handle them just fine. Same with Internet Explorer. So what was I even trying to do that? Hell, even Links behaves exactly like Firefox and IE! After realizing that and fixing the plugin as such, I now present to you... the Everything2 Pipe Linker Plugin! Download, share, use, abuse! Well, perhaps not abuse... but you get the idea! Hahaha! I'm so happy the thing is finally done! Huzzah! I even added a sink that allows one to use pipe links in comments! Go crazy! For those unacquainted with pipe links, see this node. They're really nifty things.
Check out the wp-plugins.net dowload link as well:
http://wp-plugins.net/plugin/e2pipe/
I’m Thinking Green
How about you?
Anyone have any idea how one might go about creating a graph (specifically a line graph) with PHP? I wanna record and plot my connection speeds over a period of time (I've been having issues for the past two months or so). Plus I would learn more about PHP in the process.
Um. Not much. I still haven't asked Ashley to Homecoming :cry: Everytime I see her, I just get... scared, almost... I know I should ask her though, no matter what she says, at least I would have asked. We actually talked yesterday, though, so that was cool. Why I didn't ask her then, I don't know.
School is almost to the point of whipping my ass. Physics, while at first glance seems pretty easy, is actually very time consuming and challenging. I don't like it. Trig isn't bad, but I keep falling asleep in class. If only I could stay awake, then I would never have trig homework. We have homework everyday in English. German prepositions are kicking my ass. Sociology and Swim are my only classes I can really relax in. And even then, I can't really relax in swim... Problem is, they're both in the morning. Nice classes to wake up to, yes, but I'd like a break later in the day between the evil classes.
Can't have everything.
Apparently Opera went free a few days ago. Go download it and try it out. It took me a bit (read: well over an hour) to get everything how I wanted it, but once I goet everything set, I was happy. I was amazed at how much I could change and customized. It's crazy. It feels a bit more responsive than Firefox, I think I may be converting (gasp!)..
If you've always wanted to try Opera, but the ad-supported, free version scared you, and/or you were just to cheap to pay for the browser, I suggest you check it out NOW. It's really nice.
This doesn't mean I won't uninstall Firefox though.
PortableFirefox is a fscking godsend. Opera can't beat it there.
Why consider switching?
1) Smaller download.
2) Many features that are only availabe as extensions in Firefox come built in.
3) Eats less RAM than Firefox.
4) Looks damn nice.
5) Why not? If you don't like it, simply uninstall it and go back to Firefox or Konqueror or Netscape or whatever (just as long as you don't go back to Internet Explorer, which hopefully isn't possible if Konqueror's on your system).
Monkey.
Sweet
Alright! I've got a basic example of what I want to happen!
My Poem (without the spaces) becomes My Poem!!
However! It doesn't replace the spaces in the URL with +'s yet, nor does it add the title attribute to the a tag...
But! I DO have a script that does JUST that with a fixed string (ie. NOT the random content produced whenever I post) over here. Thing is, it can only be done with one string right now. Somehow, I need to incorporate the second script into the currently functioning (albeit limited) plugin. I would need a way to search the $content for any string that starts with , and ends in . I don't want [$any_text] because that would include additions to quoted text, and even what little BBCode I use. Plus it just plain wouldn't work, as there would be no $result[2] to call for the link text.
All in all, I've still got a lot work ahead of me. I've managed to come this far, though, and I'm quite proud of myself. For several hours I was confused as all hell trying to figure out regular expressions, but I think I've got them pegged now.
Time to sleep.
Alright, plugin turned off for now, due to some major errors that it's causing with the wp-header. I'll try to figure that out in due time.
I lied! Plugin back up and running! No errors!
Awesomeness
Check it out:
It's my very own little "progress" bar script that shows how far along I am to getting my computer! I didn't realize PHP could output graphics, that's so cool! This brought me back to the days of Demonica (a playerworld Paul and I used to work on for Graal). I created an EXP, MP, and HP system MUCH different than that of the main Graal game (the main one was still there, one could never get rid of it entirely) and created little bars that could easily represent how much of whatever you had in a quick glance. The only real difference, however, was that the images weren't generated on the fly, I had to whip them up in Photoshop before hand. But this is so cool! Granted, I still have to edit the file to input a new value, but the fact that it will update everything else on it's own is awesome. There's also a vague little description of how I came up with the formula here. There's probably a better way, but this way works. Now I just need to stick this progress bar in my sidebar.
edit: Accomplishing this also brought me back out of my... um... "weird feeling"... Yea. Nothing like scripting to brighten one's day! Now I just need an [i]exact[/i] value instaed of 20.4. I chose that number because it sticks out in my head as my first paycheck ('twas just the training class) for some reason.
edit (12:20AM): Alright, exact value found. $20.89. Next paycheck should be a bit more, this last one was just the training class that I had.
edit (12:37AM): Added progress bar to the side bar under the "other" tab, resized and everything.