Fading an image with PHP, GD, and Jaguar

Posted by & filed under Coding.

For a project that I’m working on I needed a way to fade out an image before overlaying text on to it. Text I’ve done. That’s not an issue. But I haven’t ever done anything with PHP with fading out an image. Turns out there’s a library called Jaguar that makes it, and other image… Read more »

A couple of updates to Moodle unittest question

Posted by & filed under Moodle.

I’ve been using my unittest Moodle question type pretty much since the beginning of this school year. But a couple of things have been bothering me as I watch students work on code problems. The first is that their only feedback for a failed JUnit test was the stacktrace that JUnit kicks out. For students new… Read more »

Overloaded server, but it stayed up

Posted by & filed under Moodle.

Over the summer I took a Moodle unit testing plugin and updated it so that it’ll use JUnit 4 and improved on the interface a bit. Since the school year started I’ve been using it with my students, and up until a couple of days ago it worked without a hitch. What caught us is… Read more »

Commit early, commit often

Posted by & filed under Coding.

Learned an important lesson today. I spent a good chunk of yesterday working on a new project. It’s a Moodle plugin that, when finished, will let you put code online for your students to work on along with tests so they know when they’re done and you can automatically get back a grade. But while… Read more »

Easy Filter for Moodle

Posted by & filed under Moodle.

I’ve been playing around with Moodle plugins for the past few days and have kicked out a couple that are working, at least well enough for me to use. One of them solved a pretty trivial task for me, but one that should save some time down the road. And that’s formatting. Teaching Computer Science… Read more »

One line PHP regex search

Posted by & filed under Coding.

Not sure this is the best way to do this, but it works. Working on a project and I’m writing a lot of code to do RegEx searches. Each match is 3 or 4 lines to do the match, check if there was a match, and then do something with the match. Since I was… Read more »

Contrasting color function for PHP

Posted by & filed under Coding.

For another site of mine I needed a way to determine whether black or white was a better choice for text on a randomly colored background. The function takes a color as an array with elements r, g, and b and returns an array with the same 3 elements. Although in the returned array all… Read more »

Testing email with PHP

Posted by & filed under Coding.

Wish I had found this years ago… Up until about a week ago my normal process for testing PHP code that sends email was to run sendmail through WAMP and send to my email address. I’m thinking about the amount of time I could have saved had I found this plugin when I first started…. Read more »

Web safe color list with PHP

Posted by & filed under Programming.

Needed to create a list of the web safe colors for another site of mine. Yeah, I know that web safe colors are outdated. But it was still something I wanted on the site. Typing in 216 hex color codes was not something I wanted to do though. Looking over a list of the safe… Read more »