What’s that? a new forum? and a weird development announcement? Go check it out!
I’ll be spending today on writing up documentation on that forum and doing quick bugfixes.
What’s that? a new forum? and a weird development announcement? Go check it out!
I’ll be spending today on writing up documentation on that forum and doing quick bugfixes.
Normally it’s pretty cool to find new APIs in Messenger. Imagine my excitement when I found a new interface named “IMSNMessengerConversationWnd2” that seemed to inherit from the already known IMSNMessengerConversationWnd interface. Two new functions appeared to have been added. Hurrah!
So I spent 3 hours of my time debugging and testing these new functions. Turns out they’re not nearly as exciting as I had hoped:
[ odl, uuid(929BB08C-B50C-4ECD-B68C-175F0B69A544), helpstring("MSN Messenger Conversation Window Interface Ex"), dual, oleautomation ] interface IMSNMessengerConversationWnd2 : IMSNMessengerConversationWnd { [id(0x0000080c), propget, helpstring("Get the window text.")] HRESULT WindowTitle([out, retval] BSTR* bstrWindowTitle); [id(0x0000080c), propput, helpstring("Set the window text.")] HRESULT WindowTitle([in] BSTR bstrWindowTitle); };
I’ve tested this in Vista, it gets and sets the window titlebar. As Vista doesn’t use the borderless-windows that WLM9 uses on XP, I’m not sure if it works on that, but I suspect that this interface has been specially generated for precisely that.
Well, either way, have fun with it. Sure hope my time has been useful for someone :p
With LiveScratcher I’m working a lot with JavaScript, and I’ve really grown to love the language. For example, today I stumbled upon this blog post. It’s a JavaScript implementation of a lot of Haskell tricks and functions, including a quick “curry” function (read the blog post to find out what it is).
Just felt that was worth sharing 🙂
LiveScratcher, and it’s early abandoned brother project Modumes, have been in the pipeline for months now. I think I had the initial idea of a modular extension platform for Messenger well over a year ago. Either way, I never really had a lot of time to put some real work into it. Until now, that is. Holidays have started two weeks ago, and I’ve been crashing at my parent’s place (free food 😉 ) and working on LiveScratcher non-stop since. I hadn’t quite expected it (what would you expect from a project that’s been in the making for months without any results), but I feel that the end of the road (or at least something worth showing) is near 🙂
I’ve put up the initial scaffolding for the Messenger API, and am currently filling in the functionality for the Messenger, Contact, and Conversation classes. The DirectUI (messenger’s user-interface library) module is in a somewhat usable state, and I’ve even written an old-style UIFile parser to it (written completely in Javascript). One package I haven’t started on is the Interop (= communication with external libraries) one, but the plan for that one is well established in my head, and shouldn’t be too hard to implement.
For now I’m aiming for something that is on-par with Messenger Plus!’s scripting, but once I reach that I hope to keep expanding and surpass it greatly. One of the advantages I have is the extensibility. Each package can export certain functionality, and as such anyone is free to extend the API as they wish. Someone could make a package solely dedicated to communicating with facebook or twitter, and other developers can then use those packages from their scripts, for example creating a script that keeps your facebook or twitter friends updated on how many contacts you have.
Here’s a list of a few things that are done and worth mentioning:
Now, it all sounds really great when I put it like this, but there’s also a bunch of things that are missing (but that I do plan to implement some day):
Well, now you know most of what it is and my plans about it. If for some reason you got excited (sure hope you did 😉 ) and want to take a look and give some feedback, please don’t hesitate to contact me. Just leave a comment and I’ll get in touch with you. I’ll gladly send it over and give you all the help you need to get using it. At this point however I’m not quite comfortable with just uploading it here (as it’s still very very crude and rough around the edges), so you will have to personally ask me if you want to take a peek 😉
A lot of Messenger plugins, addons, and scripts nowadays use some form of memory patching. Some are quick patches like disabling the nudge limit, others like the chat-only name of StuffPlug 3 are much more complicated. But no matter how simple or complicated, they all have the same downsides: the location of the patch changes with almost every new release (even minor ones) of Messenger. Most developers simply keep a small table of locations in different versions, but this forces you to update your software with each and every messenger update. With StuffPlug 3 I opted to write a quick search routine that would search the messenger executable for specific patterns, and would find patch locations using that. This pretty much garantueed StuffPlug to keep working with minor messenger
updates, and sometimes even major updates.
One of the downsides of my implementation in StuffPlug 3 was however that the search routine was pretty simple and as such slow. With each new pattern that needed to be looked for, the time it took to search increased, and at some point this reached a full 3 seconds on my machine (which is pretty high-end compared to my average user). I solved this partially with caching, but for some patterns I needed all hits and caching was not possible. In the end the searching generally took 1 second, or 3 if you just updated messenger. Now even though 1 second (or possibly 5 on slower PCs) doesn’t sound like a lot, it bothered me, and it hasn’t even stopped bothering me. I’ve always wanted to look into other algorithms to speed this up, but generally I had other priorities or didn’t have time at all.
Somehow that changed a week or so ago, when we revisited string matching algorithms in my current course. I just had to try, and I did. As I’m looking for multiple patterns at once, Aho-Corasick should be the ideal approach. One downside: I need wildcards (characters that match anything) in my patterns, and Aho-Corasick wasn’t really made for it. I did see a suggestion somewhere to simply split your search string on the wildcards and search for the constant sub-patterns, but this sounded a bit silly. Especially as there was no motivation about why this was the best approach, I felt I could do better. And today, I thought I had. I had an Aho-Corasick implementation working, with wildcards and everything.
Or so I thought. Yes, the algorithm works. Yes, it can take a wildcard or two. But once you add a few more wildcards, the number of states in the state tree just explodes. With just two memory patterns (38 characters in total, of which 12 wildcards) needed a whopping 7007 nodes, and generating the tree alone took a full 12 seconds. I also tried with all 20 patterns in StuffPlug 3, but that just didn’t seem to finish, ever.
In conclusion: For Aho-Corasick with wildcards, just use the suggested technique of splitting the patterns up. It is possible to adjust the algorithm itself for wildcards, but the number of states needed gets so big that it’s no longer feasible, and will most likely not run on any current computer when you use more than 5 wildcards in total.
I’m not giving up though 🙂 I’m currently working on the Aho-Corasick bit with splitting up, and I have another tree/state-machine based approach in my head that I want to try. At least if I finish this I can truthfully say that I can’t possibly make that part of StuffPlug any faster…
There’s quite a lot of people out there that absolutely hate JavaScript or ECMAScript, mostly because the different DOM/DHTML implementations in browsers are often incompatible. Yet it appears there are also people out there that love the dynamic nature of the language itself, and I think I’m becoming one of them. To me it’s a language that allows you to hack small things together relatively easy (when writing some exercises that were supposed to be written in pseudo code in JS a professor noted that it resembled pseudo-code really closely, and I should recommend it to the lecturer), whereas you’re also able to write bigger projects by leveraging the OO capabilities.
Anyway, enough about that, ever since I started using Google’s V8 engine in LiveScratcher for the scripting I’ve been experimenting with JS, and after having done some Data structures exercises with it, I started getting passionate about implementing some data structures in JavaScript. I’ve currently written a Heap (with a PriorityQueue using it), and have just finished an AVLTree implementation (which I will use for a map), and will probably move on to implement all structures from my book 🙂 I’m not sure if I’ll ever release this into the wild, or if it’s even worth releasing into the wild, but I’m pretty proud of it so far, and it forces me to learn more about the data structures involved, as well as keeps my JS skills up to par.
On a different note: I’ve set up a website for LiveScratcher with a wiki and an installer for an alpha version. Check it out at http://www.livescratcher.com/