Mercurial

October 14th, 2009

Updated 10/31: You don’t need a pass for the repo anymore.

I was on mid-term break the past two days. (Yeah only two. ugh.) I had been looking at Mercurial the past few days so I took the opportunity to switch OrtzIRC over to use Mercurial!

I really like Mercurial. I like how simple it is, even compared to SVN. Whenever I did something with SVN I felt like I was walking through a minefield. And I did manage to get my legs blown off a few times. (I looked at Git but it made me bleed from the ears.)

The switch was ridiculously easy. The only hard part was the fact that the hook for my CIA bot didn’t work, which should’ve been an easy fix, except I don’t know Python that well and Mercurial doesn’t have any docs for writing hooks that I could find. So I spent most of the day yesterday and part of this morning crawling through Mercurial’s changelogs and source.

Anyway, here’s the repo http://hg.ortzirc.com/ortzirc/.

I’m keeping the SVN repo up for now, but I’ll probably delete it pretty soon.

I also switched my issue tracking to FogBugz, which I’m also liking so far. (Free for up to two users) I may post more on that when I’ve used it more.

And as a result of all this, Trac is no longer useful to me. Can’t say I’ll miss it.

Dynamic Command Plugins

April 12th, 2009

I finished a major feature of OrtzIRC recently, so I thought I would write a bit about how it works.

First of all, a big thanks to Max for being the grease when my gears wouldn’t turn, so to speak. :P And for talking me into doing commands this way instead of mine, which would not have worked out as well.

One of the goals with OrtzIRC is extensibility. OrtzIRC will have many categories of plugins which you write with your favorite .NET language, compile, and place in the plugins folder, much like Paint.NET. (Unlike Paint.NET, OrtzIRC will stay open source. wink wink) The first plugin category is commands.

Here’s what the “say” command looks like:

namespace OrtzIRC.Commands
{
    using OrtzIRC.Common;
    using OrtzIRC.PluginFramework;
 
    /// <summary>
    /// Parts a channel
    /// </summary>
    [Plugin]
    public class Say : ICommand
    {
        /// <summary>
        /// Sends a message to the current channel
        /// </summary>
        /// <param name="channel"></param>
        /// <param name="message"></param>
        public void Execute(Channel channel, string message)
        {
            channel.Say(message);
        }
    }
}

Like with most IRC clients, “say” is the only command called automatically (when you type into the command box without specifying a command).

Commands must follow these rules to work properly:

  1. The class must implement the ICommand interface. At the moment this interface just lets the plugin loader know that it’s a command.
  2. The class must also have the Plugin attribute. Plugin takes an optional string parameter to specify the name of the plugin (in this case the name of the command you type to execute the command, ie “/say”) otherwise the plugin’s name is the name of the class.
  3. The command class must have at least one public Execute method. This method is what OrtzIRC calls when you type in a command.
  4. The type of the first parameter in each of the Execute methods must be one of the following:
    • Channel
    • Server
    • PrivateMessageSession

    This parameter represents the context in which the command was executed, in other words, the window. (A channel window, PM window…)

  5. The type of each of the remaining parameters must be either string or ChannelInfo. The ChannelInfo object is simply to let the command know that the user specified a channel name, ie “#luahelp”.
  6. If you want autocomplete support the Execute methods must each have proper XML docs. (This has not yet been implemented, I will discuss it in more detail when it is)

If these rules are not followed, the command will either not be loaded or not called when the user attempts to execute it. When a user types in a command, the plugin system looks through the commands it has loaded and looks for one that meets all these requirements and whose parameters match the parameters given by the user.

This command system is much more dynamic and easier on the programmer than other systems I have seen, which usually require the programmer to manage arguments manually and add a lot of redundant code.

Questions, comments, suggestions welcome.

OrtzIRC Progress

April 8th, 2009

‘Bout time for a quick update!

OrtzIRC’s first (major) feature is in; Drop-In Commands.  I’ll post more detail in the future but basically you write some commands in C#, compile it, plop it in the plugins directory, and restart OrtzIRC. The command code is dynamically called when you enter an IRC command. I haven’t decided on scripting support but it’s not out of the question.

Just a few more core functionality features to put in like server settings and favorite channels and I’ll be ready to call it “alpha” and get ahold of some testers!

I’ll try to twitter about progress with OrtzIRC more. Also, I’d use hashtags if hashtags.org worked…

4 Free Installers

February 5th, 2009

Via a wiki answer on StackOverflow:

WiX

  • Very powerful and flexible.
  • Can produce MSI packages (Microsoft deployment format of choice)
  • Almost no documentation
  • Very steep learning curve.
  • XML-based.
  • Recommended for very complex installators.

InnoSetup

  • Cannot produce MSI packages.
  • Based on INI files (less powerful but very low learning curve)
  • Possible to inject Pascal procedures for extra flexibility.
  • Probably the best choice for 90% of programs.

NSIS

  • Cannot produce MSI packages.
  • Fully scripted, very powerful but at cost of high learning curve.
  • Recommened if WiX is too much and InnoSetup not enough.

AdvancedInstaller

  • Basic version is free.
  • Can produce MSI packages.
  • Very good user-interface, almost no learning curve to get things done.
  • XML-based (but schema is not very user-friendly, doesn’t really matter as you would use GUI editor anyway)
  • The best option if you have only basic installer requirements and don’t have time to learn something new.

There’s a post here about getting it to work, but it’s old. Since then, the include statements for HTML Purifier were moved to their own file. In a normal script you would include the HTMLPurifier.includes.php file, but this isn’t in line with how CodeIgniter loads libraries, so it requires some hacking to get working.

  1. Download HTML Purifier and put the contents of the library folder into your codeigniter /system/application/libraries folder.
  2. Open HTMLPurifier.includes.php and change
    require 'HTMLPurifier.php';

    to

    //require 'HTMLPurifier.php';
  3. Open HTMLPurifier.php and add this just under <?php
    require_once('HTMLPurifier.includes.php');

And that’s all! Load with

$this->load->library('HTMLPurifier');

HTML Purifier

HTML Purifier Docs

XNA Youtube Playlist

April 24th, 2008

I’ve been collecting XNA videos on Youtube into a playlist for a while now. Check it out. I’ve got about 40 videos as of this posting.

If you have a video you would like me to add, feel free to contact me or leave a comment.

I also idle in #xna on EFNet. If you have a video you would like added, feel free to PM me. I’ll add it when I’m around.

TFH Recode

April 14th, 2008

Been a while since my last post… Seems like I can never think of anything to blog about. TFH is The Flaming Head, in case you’re confused.

I’m currently in the process of rewriting my entire site using the CodeIgniter framework. Not counting my blog and the forums, that is. Actually, I’m not sure if I want to keep the forums up. Nobody uses them, and frankly there’s no reason anyone would want to. And now that I think about it, some sort out shoutbox would probably work just as well. I’ll have to think about it. I’d appreciate any suggestions too.

CodeIgniter has been really fun to work with. This is my first experience with a web framework (apart from Ruby on Rails, which didn’t go so well… something about “convention over configuration” seems a bit communist) and MVC is really awesome. For the first time, I have a feeling like I really know what I’m doing and I’m not just a noob anymore. I think it might be because MVC was sort of an epiphany for me as a programmer.

I’ve decided to be more proactive with learning PHP; trying to learn the sort of things that didn’t really interest/concern me when I was just doing it for fun. Design patterns, for instance. I want to eventually get ZCE (Zend Certified Engineer). Which means I may end up starting on my own framework in the near future. I want to start doing doing freelance online. My biggest obstacle right now is a lack of real experience and, unfortunately, confidence.

As far as non-web programming is concerned, I’ve recently become interested in GUIs, both designing them and implementing them. Usability issues have always interested me because psychology has always interested me as well, and the two seem to go hand-in-hand. I mentioned before that I wanted to mess around with WPF a bit, which I still haven’t gotten around to, unfortunately.

PunBB Simple API

December 29th, 2007

Integrating PunBB with other scripts is something that has always been a major pain for me. So, when I found this I thought I would share it.

PunSAPI allows you to do everything related to PunBB that you could do just by including common.php, like checking the cookie to determine if the user is logged in, except it’s Object Oriented and it doesn’t interfere with other scripts. For instance, lately I’ve been using CodeIgniter, which, as most full-featured PHP apps do, has a redirect function. If you simply included common.php into you app, you get a PHP error about the function already being declared. PunSAPI avoids problems like this.

http://punbb.org/forums/viewtopic.php?id=15854

XNA and OOP

October 29th, 2007

I have a simple question about XNA tutorials. Why is everyone sparing newbies OO? Nearly every article and tutorial I see uses very little, if any, Object Orientation. They’re going to have to learn it anyway. In fact, game programming in XNA is a perfect opportunity to learn it.

Yes, they’re new, but you don’t need to dumb things down. XNA has already been simplified. That is, in fact, what XNA is all about. Because XNA has already made it easier, I think we need to concentrate on making the newbies good programmers instead of making it even easier for them to program. I can understand making the most basic “putting a sprite on the screen” tutorials as simple as possible to just get them started, but in order for them to really take off and get to the point where they no longer rely on tutorials, they HAVE to learn OOP.

Articles need to have OOP. This is even more confusing to me. Even the more advanced articles contain little OOP. Is this just how people program? Maybe it’s just me. When I program, I am obsessed with making everything as OO as possible.

Maybe I’m totally wrong. Maybe I’m just looking at the wrong tutorials. If I am, tell me.

XNA

March 28th, 2007

So for the past few weeks, shortly after jumping into C#, I’ve been messing around with XNA. I haven’t had this much fun programming since I first discovered how to query a MySQL database with PHP.

Instead of going on some big thing about what XNA is, I’ll link you here.

After I made a simple Pong game and it was boring, I started on an Asteroids game. Then I was reminded that I didn’t like playing Asteroids clones so it wouldn’t make much sense to make one.

So now, I’m working on something else. I’m not sure if I want to tell anyone what it is yet, since certain people will fap over it and compare it to something and flame me when it doesn’t meet their expectations. I will tell you that it involves the Farseer Physics Engine. It’s pretty new and undocumented but it will end up being the core of my game. I haven’t been working on it much lately because of schoolwork. Maybe I’ll post something on it later so people can motivate me.