Thursday, December 14, 2006

Blogger in Beta

Just a quick note to let anyone who's interested know that I have moved my blog to the new "Blogger in Beta". This may have resulted in some strange side effects which I will try to correct as I find them.

Tuesday, November 14, 2006

NantShell

So following my last post I decided to get of my butt and see if I could make something to fill the need.


So....I've created this little program 'NantShell' which is basically a console app designed to evaluate commands entered and respond.

If the command entered is not recognised, then NantShell assumes that I am trying to specify a Nant 'Target' for it to run.

So it looks through it's list of directories and scripts to see if it has any target whose name matches the command entered (Note: command/target name match process is case sensitive.)

Well that was the start anyway. :)

Since then I have added a bunch of features to help make things easier.

1.> NantShell has it's own built-in help available by typing 'help' or '?'

2.> NantShell has commands for adding namespaces* (xml), scripts(*.build) and directories(with scripts in) to it's environment.

3.> NantShell has it's own config file (NantShell.config) (Crappy custom rubbish for now as I'm lazy. Yeah go figure :)) to list out namespaces*, directories and script-files which will be preloaded in to the environment at startup.

So basically the system understands that you want to run Nant targets but that you are way too lazy to want to create batch files or other launch mechanisms to trigger them.

Further, you might have these Targets spread over many files and have many Targets within each file.

So NantShell builds, what amounts to, a Path (or list) of (script) files which it is willing to search through each and every time you ask it, looking for the precious target you said it would find somewhere in there, and then it executes it for you.

Wow I'm sure there should have been more punctuation in there

*Note: Namespaces, in this context, are things which need to be removed from the DocumentElement of a XMLdocument before my XPath stuff would work :)

Yeah it's a hack because I am, for the moment at least, too lazy to work out why this doesn't work.

(Since I know next to nothing about xml namespaces, (and I was feeling impatient) I just thought
Screw It!... I'll just remove them.
and what do you know.... it worked :) )


So give me some feedback.

What do you think?

Oh yeah and does anyone know how I might embed this in a toolwindow for DevExpress's CodeRush?

Thursday, November 09, 2006

Nant Runner/Console

I seem to be accumulating a lot of NAnt files which require arbitrary periodic running...
I was thinking the other night about how many NAnt files I seem to have with targets which do highly useful things when run without requiring any params.

RestoreDemoDatabase
RegenerateNantXSD
GoMakeMeACoffee <-- yeah I wish

It occurred to me that it would be really good if I had a sort of dos-box *interactive* nant console application.

This app would be launched with an optional list of build files.

I could interactively ask it to load further build files and then I could execute targets by name.


So I could just Type the name of a target and it would run.

Sounds like something PowerShell could do.

or perhaps just a simple .net console app.

I've never made an interactive console app before (I guess you might call this a shell of sorts)

Can someone point me in the direction of a small example?

What do ya'll think of this as an idea anyway?

NantShell.... yeah I like the sound of that



The Nant .XSD ( schema)

Jay Flowers sent me an email this morning, to remind me that you can recreate the NAnt XSD(Schema) at any time by running the 'nantschema' task.....Jay Flowers reminded me of nant's very clever built in 'nantschema' task which will create an xsd (named however you like) containing the schema for the entire suite of NAnt tasks present your copy.

This means that if you have downloaded NantContrib or have created your own tasks, then the 'nantschema' task will reflect over these and include them in the xsd it creates.

As Jay says you can have visual studio give you this information back as intellisense by setting the default namespace of your build file to the generated xsd.

Jay also gave a link to a good 'HowTo' which covers pretty much all you need to know

Thanks for the mail Jay

:)

Nant Task - Call2

Is anyone else sick of being unable to pass parameters to a Nant 'Call' task?


I am thinking about writing a new "Call2" Nant task. It would work like 'Call' but treat all extra attributes as properties to create or overwrite prior to execution of the referenced task.

It would effectively allow me the following shortcut:

Instead of....
-------------------------------------------------------------



-------------------------------------------------------------

...I would be able to type ...

-------------------------------------------------------------

-------------------------------------------------------------

For me at least this will be quite the time saver.

Is this a waste of time?

Has someone else already done this?

Is it already in NAnt somewhere under a different name?

I'd be glad to hear anyone's opinion on the subject.

If you're interested in this task, drop me a line at my GMail address or post in the comments.


Templates in the Template editor (revisited)

So after a bit of thought (and some help from the relevant forum) I've come up with a way to use templates in the Coderush Template Editor.
You'll recall my post some several minutes ago where I declared that it would be really useful to be able to execute a template whilst editing another template.

You'll also recall (because it really wasn't so very long ago) that CodeRush, at the time of writing, does not support this.

Well I've found a solution. It's not perfect by any means but it does help quite significantly. It turns out that AutoHotKey mentioned in a previous post is nearly perfect for the job.

It cannot do 'Selection Embedding', but it can do simple text replacement based on HotStrings.

A HotString is like the key sequence that might trigger a CodeRush Template.

In this case, the simple scripts of...
-------------------------------------------------------------
:*?:<<::«
:*?:>>::»
::field::«Field»
::fieldstart::«FieldStart»
::fieldend::«FieldEnd»
-------------------------------------------------------------
... create 5 HotStrings which expand suitably from one form to another.

Thus << becomes «
and >> becomes »

The difference is that these templates are system-wide and will work in any textbox or word processor.

However there is much that these Templates cannot do.

There is no Linked Identifiers, No simple «Field» switching and I don't appear to be able to set a location for the caret to finish up at.

So while these HotStrings are very useful for setting up «cursor»_«BlockQuote» and «FieldStart»-«FieldEnd» combos, they are entirely incapable of replacing them.

Still they are useful.

Some CodeRush Template Editor Ideas

As my last post indicated, I've been playing around a lot more with CodeRush's 'Template' facility.
In my recent attempts to create all kinds of CodeRush templates, I have come across a few... items which could stand a little improvement in the template editor.

1.> «Cursor» and «BlockQuote» have little icons to represent them but «FieldStart» and «FieldEnd» do not.
I'm finding that I am using these 2 little gems more and more all the time and it's getting quite annoying to have to reach for the mouse in order to select these.

2.> My next thought was simple (like so many of them). I could create a template to create the phrases and so ease my task.
except that the template editor does not consider itself part of the IDE and as such cannot run templates within itself.

3.> One common situation is one where you have a prospective template in which you hope to embed several 'fields'. These should have temporary wording in place of each with a «FieldStart»-«FieldEnd» pair around each. Further, the first of these should have a «Cursor»-«BlockQuote» pair around the outside of it so that it becomes the initially selected field.

This leads us to a situation where one would like to do either of the following:

a.> Highlight some text and use a 'Selection Embedding' to wrap the text in a «FieldStart»-«FieldEnd» or a «Cursor»-«BlockQuote» combination or perhaps even both.

Or

b.> Click «Cursor», Select «FieldStart»,Type Some Text, Select «FieldEnd» and Click «BlockQuote»

The first case is simply not supported. I have raised it as a suggestion and am waiting to hear an answer from the support center

The second case works (Sort of). What I mean is that currently there is a bug (in my opinion) wherein after one selects an item from the dropdown list of commands, the cursor in placed to the left of the inserted command (rather than to the right).

Thus the insertion of further commands without first manually reseating the cursor, result in the commands being chosen in the order 1, 2, 3 and yet appearing in text as 3, 2, 1.

Initially it is hard to observe this behaviour because although the caret's virtual position appears to be to the left, the caret itself is not visible because the focus is on the command dropdown.

I believe that this bug is responsible for people creating templates like:

-------------------------------------------------------------
SomeText«Cursor»«FieldStart»Field«BlockQuote»«FieldEnd»EndText
-------------------------------------------------------------

...when they meant to create...

-------------------------------------------------------------
SomeText«Cursor»«FieldStart»Field«FieldEnd»«BlockQuote»EndText
-------------------------------------------------------------

Then (without noticing that something is amiss) they wonder why (and in some cases ask tech-support/newsgroup residents why) their template doesn't work.

This is a minor bug but I felt that since they seem so few and far between, I should mention it to prove that I am unbiased in things DXCore based :)


Wednesday, November 08, 2006

Nant Templates

Some Nant CodeRush Templates I've created. Available to all.
I've been doing a lot of work with Nant recently and quite frankly there is nothing quite so annoying as having to type all those angle brackets. I just don't know how a c# guy puts up with having to do that sort of thing all the time :P

Thankfully CodeRush makes this a lot easier. Within seconds I had created several useful templates which, as usual, I have chosen to share with the rest of you.

Aren't you all so very lucky :P

The file is available here


Update(09 Nov 2006) Jay Flowers points out that I have made no mention of just what templates I created (DOH!)

So.....
FYI: Templates include:- Property, Target, Copy, Delete, Exec, mkdir as well as a few aliases to help with some default uses. These should import into a Template folder of Custom\NAnt.

Also included is my most used template $ which expands to ${} with the caret in the brackets.

On closer inspection I don't seem to have included a 'Project' Template which would be good. I'll have a look at adding that.


Friday, November 03, 2006

Bugzilla?!?! You gotta be Sh*tting me

It's been suggested that I look into BugZilla..
Ok.. So I've just been to look at...

http://www.bugzilla.org/docs/win32install.html

Holy crap but that's complicated.

That's just the sort of time I don't have.

The reason I mentioned FogBugz is that although it costs money (and yeah I already approached Joel for a freebie Single-User Support-the-Open-Source-Movement edition. But that wasn't going to happen.), It is very simple to setup and it is very intuitive to use.

How do I know this? Well my company (erm well ... the one I work for) bought a copy of FogBugz a few months back for our own use and I have to say it's wonderful. Not perfect (what is?) but really very good.

But hey, asking people for donations is still a bit lame I know. So I tripped out to the Bugzilla site and well how should I put this....?

I tend to judge the maintainability/security(and in fairness flexibility) of something by how many parts it is made up of and how long those parts take to setup initially.

Shall we say that Bugzilla was clearly developed with the *nix style user/developer in mind.


I couldn't in clear conscience install that software on any machine which wasn't mine unless I was spending all day every day learning about just how it worked so that I could be sure it didn't have any gapping security holes in it.

It might very well have none. I freely admit that it probably doesn't.

But I'd much rather stick to something based on MS SQL server and IIS.
(Probably because I know a little about how they work)

Oh and if I didn't mention it already, My company had already volunteered to host this little project for me (back when I asked Joel for a copy) as long as I could give them reasonable assurances as to the security, Lack of conflicts and generally not mashing up their machine for them.

With Bugzilla I'd have to spend far too long trying understand enough to appease my conscience.

Any other ideas?


Bug Reports (and Donations :P)

With work on my plugins being so sporadic, it's sometimes difficult to keep track of what I should be working on next....
Yup its my own fault really. I asked people to contact me anyway and anyhow but in truth the best way to submit bugs and feature requests is simple.

Just send them to my Gmail address RoryBecker[At]Gmail[Dot]Com
I will then file them and deal with them as well as I can in order.

Of course if anyone wants to fund me a copy of FogBugz ( which would solve all of these issues) then feel free to donate some money:













(I believe FB costs around $120 total :P )

But for now, my GMail address is probably best for reports.


Visual Studio hotfixes available without contacting support!!

From the DailyGrid 1005 - Mike Gunderloy (my delayed congratulations by the way Mike), News that the VS.Net team are making VS.net hotfixes available for download without having to go through product support.

Thursday, November 02, 2006

DX_ContextContrib now available

My first Context-Providing plugin created to fill a need first suggested by Dan Avni in the DevExpress's Coderush newsgroup

In response to a post by Dan Avni in DevExpress's CodeRush newsgroup, I've created a new but very simple plugin which provides the developer with 3 new contexts.

Editor\Clipboard\IsMultiLine
Editor\Clipboard\Contains Literal
Editor\Clipboard\Contains RegEx

Dan's post required the first of these and I just decided to add the others for the fun of it :)

The addition of IsMultiLine allows us to create a duplicate of the 're' Template and change it so that it detects that the Clipboard string is Multi-line and therefore place this string, not in the region name, but as the region body.

The template...
--------------------------
#Region "«Caret»"
«Paste»
#End Region
--------------------------
.... seems to work great :)

Assuming of course that you tick the right contexts

Duplicate the original template (and name it 're' also) then change the body of the duplicate to the above code and add the (Clipboard)isMultiline context. Further you can either assign a negative isMultiline requirement to the original or alternatively move the priority of the new template above the old one.

Questions... comments

Again I hope this helps someone :)


Friday, September 29, 2006

Contacting Me

What ways are there to contact me, and when should you use each ....
I've been getting some very helpful comments from several people regarding bugs that they have found in some of my plugins.

Thanks very much BTW.

However the problem with this is that when I fix and of these bugs I have no idea who to contact, since most people comment anonymously ( at least as far as an amail address is concerned)

So I thought spell out the alternative ways of contacting me :)

1.> EMail: RoryBecker AT gmail DOT com
Useful for general "whazup", "Hey there" or "You and your plugins Suck big-time!" type messages. It's also where notifications of your blog comments get forwarded. I'm plugged into this address whether at home or work. So I'll definitely get your message. Please don't spam me though.

2.> Email: RoryB AT DXSquad DOT com
My DXSquad.com email address, donated by the kind folks at DevExpress.

3.> Developer Express Newsgroups (Plugins, Coderush, RefactorPro). If it's related to these forums then feel free to contact me here.

On the flip side I don't want to hijack said forums with a deluge of mails about my plugins (unless they are wonderful endorsements of how my wonderful plugins have singlehandedly saved your life etc)

Also I encourage anyone out there to email me direct at my gmail address just to let me know you're using a plugin of mine :)


Friday, September 08, 2006

DX_Contrib Bugs fixed in version 0.2.1

The latest version of DX_Contrib fixes PaintIt and UnusedVariables.
Yup that's the beauty of library dlls. They can be used to fix or introduce bugs to several apps/plugins at once. In this case lets hope that the net result is more positive than negative. :)

Specifically fixed in version 0.2.1 of DX_Contrib are
  • An InvalidcastException which was being caused when PaintElementName was instructed to use the OverlayText PaintStyle (and posibly others)
  • An attempt to decorate elements even when they were hidden inside colapsed regions. Oops :)


These bugs would have affected any plugin attempting to call PaintElementName. Which includes PaintIt and UnusedVariables.

Anyway hopefully we can now resume our <cough/> usual high service. :)

Wednesday, September 06, 2006

I want Multi-language projects in Visual Studio

I want multi-language projects in Visual Studio and Here's why...

(NB: this post made from a VS 2003/Framewoirk v1.1 point of view)

VB.Net doesn't cut it ..... but then again neither does C#.

The truth is that both languages compete with each other.
I know Microsoft would have us believe that all languages are equal in the eyes of the framework and to some extent, this is true.

But how eay is it to create an application using both C# and VB.Net?

For example one of the nicer features of C# is operator overloading which vb simply does not have. (not in v1.1 anyway)

Likewise there are things which C# does not have. Like a background compiler.

A reasonable ( but by no means comprehensive list of differences exist here :http://www.advisor.com/Articles.nsf/aid/SHERP42

Anyway the point is this...

The languages are different but each have advantages over the other. Now we find that we have J# F# CAML Python Ruby (I have not looked at any of these directly but at least some of them compile to IL)

So why am I forced to pick a language for a project. I have often found myself wishing that I had operator overloading in VB.net but I shudder when I think of moving permanently to c# as I think of all the things that I might loose.

Now i appreciate that VB.Net 2.0 has operator overloading and further introduces the MY namespace (a seperate debate of it's own) but the truth is that these languages will always have things that the other doesn't.

and yet I still need to create a new project in studio, reference the project or the created dll from wherever it needs to be found from, and ensure that these references are maintained for the life of the project. further there are known to be issues in studio where Project A(VB.net) references Project B(c#) references Project C(VB.Net) again.

And so I ask.....

Why can't I have a Multi Language project where language is specified on a per file basis (probably by looking at the extension). The project properties could have a c# page, a vb.net page. in fact one page for any language that whose files might be included.

We used to be able to compile object files from different languages and then link them together to form cohesive dlls and exes.

Give me back my linking :) Automated of course :)

Ok over to everyone else. Just why is this a bad idea? :P


New versions of Plugins

I have released new versions of PaintIt, MoveIt, DeclareIt, UnusedVariables and DX_Contrib
That's right I have released new versions of my plugins.

PaintIt has had it's guts ripped out yanked around and replaced including a new caaching system to help deal with some performance issues.

UnusedVariables has now been altered to depend on DX_Contrib and so allow you the user to pick the decoration style that is used with this plugin.

MoveIt and DeclareIt have both been changed to depend also on DX_Contrib. They have not changed much although some methods previously held in their "Utils/Utility" regions have moved into DX_contrib instead. There may also have been some minor adjustments in other areas. In truth I intend to have a closer look at the functionality in these 2 plugins over the next week or so.

Finally DX_Contrib itself has been updated to veriosn 0.2 (It should be noted that all the previously mentioned plugins now depend on version 0.2.)

I have included more decoration types for the Stylepicker and I have introduced some Element helper methods many of which have migrated from other plugins.

One of the more interesting things in the latest version of DX_Contrib, is a new LanguageElementIterator.

This object takes a Delegate in it's constructor which is then used as an evaluator for each element it passes over. This makes it very simple for you, the plugin developer, to write a CapitalizedVariables or PrivateMethodsWithUnderScoresInName delegate and pass over this list at any point in your code.

This is how the new versions of PaintIt and UnusedVariables generate their caches.

Anyway...download and have fun. (http://www.rorybecker.me.uk/)

Questions? Comments???

Feel free to comment here on the blog and I will try to respond as quick as I can.

If theis blog has a facility for you to monitor comments of a given post (Ala RSS), then I am unaware of it. As such you will have to check back regularly in order to determine if I have responded to you.

Of course you could just leave your email address or just mail me direct ( RoryBecker AT GMail.com)






Thursday, August 31, 2006

I'm back but the plugins have moved

Yup after more than 2 weeks without home broadband, I'm back.... what have I been doing and why are my plugins moving? (and more importantly where to ?)
Well it's all very simple...

I recently moved house to a much nicer location with a bigger garden and more space within for my wife and kids to occupy with more stuff.

In so moving, I needed to cancel every known service directed at my old place and inform said people of where my new address would be located.

This included of course... my home landline and thus my broadband.

Noooooo........

In the process of doing this, I discovered that I was not under contract with Pipex ( my previous provider) any longer and I could elect to move with no surcharge.

Interesting.

I enquired of pipex support what would happen if I decided to remain with them in my new abode.

They informed me (in a slightly cryptic manner) that things would be just as difficult as if I move to a different provider (new Landline, new account with pipex, difficulty in maintaining email aliases).

Additionally they would not be able to offer me the same rates as before because I would be having to start a new contract with them rather than transfer the existing one.

This would have the surprising effect of forcing me to choose from their new range of offerings, of which only one could possible suit me due to my bandwidth requirements. and oh shame this new package was somehow more expensive than the previous model.

Oh well that was it.

I have now changed providers to demon.net

They don't give me any web space but I don't need that as I have some spare elsewhere. However the rorybecker.co.uk domain name was more of an issue.

I bought rorybecker.co.uk from quidnames.com which to this point has been a very good purchase.

I needed now however to change the redirection on said domain so that it would point at my new web space.

This proved a little difficult.

Normally one logs in to their system through the use of the registered email and password.

Since I could remember neither of these, the system felt required to deny me the access which was rightfully mine.
I hurled massive abuse (verbal) at the site but this seemed to do no good. I decided that there would in all good sense be a method to retrieve said information since I am in fact the rightful owner of said domain.

It turns out that quidnames do, in fact, have such a method.

They simply require that you visit the appropriate page on their site and enter the domainname whose information you require and the registered email associated with said domain name.

And there-in lay the problem. I of course had no idea which email of mine was the correct one. I have "many".

I proceeded to mail "support" explaining (repeatedly) that if they would just email the details to whichever email address happened to be associated with the account, then I would be able to collect them as I forward most things to my gmail account these days.

My emails met with no response whatsoever for the next 8 days, where upon support got back to me to tell me which email address was in fact assigned to the account.

And that is where things get complicated :)

You see (if I understand this correctly)....
  • The address in question was in a domain owned by the company I work for.

  • This domain was bought through Company 1.

  • Company 1 was instructed (not by me) to set the name servers of the domain to the IP address of a dedicated server we controlled.

  • The dedicated server ran a nameserver of it's own. (NameServer1)

    • NameServer2 (for some ungodly reason) pointed at dyndns.org which then pointed back at nameserver1, thus giving us a very neat single point of failure. (NameServer1)

  • Nameserver1 pointed at a nameserver held by Company2 (NameServer3)

  • The NameServer3(at company2) held instructions for distributing email.

  • Company2 also held some pop3 boxes into which it was instructed to sort the email from the domain in question.



Can you see where all this is going?


  • We ceased renting the dedicated server.

  • The dedicated server was formatted/mangled/otherwise destroyed.

  • NameServer1 vanishes like a fart in a tornado.

  • The chain is broken and now the email from quidnames now forwards into the ether never to return.



ya gotta love the net :)

So now I have instructed Company1 to point set the domains nameservers to the 2 nameservers supplied by Company2.

This so it is said will take 24 to 48 hours

48 hours was sunday.

I am led to believe that the process was however only started yesterday evening so this time tommorow I should be able to retrieve email send from that point onward tro the domain in question.

After this I hope to request my password from quidnames and then retrieve said password and redirect rorybecker.co.uk to rorybecker.me.uk

and all, I think, will be well again :)

So the upshot is that my plugins have moved temporarily, to http://www.rorybecker.me.uk

Saturday, August 05, 2006

My plugin site has been Refactored

Yeah my plugin site has been Refactored. Hopefully it now provides all that it once did whilst managing to do so with a 'little' more style and a little less noise :)

(For those that still think it looks crap (I'm still in that camp), my books on css should be arriving in a week or so (there seems to have been a little delay), so hopefully I'll start to be able to do something a 'little' better.)

So check it out at http://www.rorybecker.co.uk

Refactoring PaintIt -> DX_Contrib v0.1

I've realised that perhaps some of my PaintIt Code could be useful elsewhere.
I have spent the past couple of days refactoring PaintIt so as to extract the actual painting code (Including the ColorPicker and PaintPicker(yes they are crap names) from the Original PaintIt plugin and into a new Common Dll called DX_Contrib.

I am releasing this project like all my others, complete with source.

It is my intention to initially maintain control over this project but to accept code snippets in vb.net (feel free to submit in c# if examples are short enough for me to translate without too much difficulty) and to include them for everyone's benefit.

I would like to say up front that at this early stage, I have no plans to honour backward compatibility in any way. However like all my plugins, I will not be deleting past version from my site.

In addition, I will be including the version number in the dll itself (thus the first version is DX_Contrib0.1.dll) and in this way allow past versions to work side by side with newer ones.

For Example, PaintIt v1.3 (the current latest version) uses v0.1 of DX_Contrib. (naturally enough). I have release both. Some developer 'A' might choose also to develop against v0.1 of DX_Contrib. Later I might decide, or indeed have it subtley pointed out with a sledgehammer, that a give method is either in the wrong class or a class is in the wrong namespace. At this time corrections and enhancements will be made and a new version will be released with version 0.2. This new dll will be called DX_Contrib

As I said, it is my init plan to maintain control of this myself, but if it proves in some way successful then I think we will have to consider sourceforge or some similar facility instead. :)

Feel free to submit code to me either by email or newsgroup for potential inclusion in a future version of this dll.

Oh yeah, if you don't already know, DX_Contrib and my other real(ish) plugins can be found at http://www.rorybecker.co.uk

Tuesday, August 01, 2006

PaintIt v1.2

Ok version 1.2 of PaintIt is out. Well what are you waiting for? Download now from http://www.rorybecker.co.uk where full details of the changes can be found.

Sunday, July 30, 2006

PaintIt v1.1

PaintIt has had a little makeover
ok version 1.1. This version sees some bug fixes, some optimisation, some new functionality and some experimental new flexibility with regard to painting styles. So go check out version 1.1 at http://www.rorybecker.co.uk

Sunday, July 23, 2006

AutoHotkey

If you like Slickrun you'll probably love AutoHotkey
AutoHotkey is, as Carl Franklin might say, "The coolest thing I've downloaded recently".

It's essentially exactly what it's name implies. It's a program that sits in background and waits for you to hit any of the 'hotkeys' that it recognises. The 'Hooks' that it uses to detect these hotkeys are global, which means that they will be detected no matter which program has the foreground at any given moment.

So Notepad, Word, Gmail, Blogger.... anything is fair game.

The key to this particular implementation is that the hotkeys are defined by you the user, via a small script ini file. (The default such file is AutoHotkey.ini which is a complete misnomer as the content is not laid out like a standard ini file at all.)

In this file you nominate the basic keystroke combination that you require and then follow this by the command or commands that you require of the hotkey.

A simple command might be

#n:: Run Notepad

(The # is a symbol which in this case means the Windows key. Hence in this case Windows-N will launch notepad)

But this is but a trifle to AutoHotkey.

More useful is to detect if you already have a copy of Notepad open

#n::
IfWinExist Untitled - Notepad
WinActivate
else
Run Notepad
return

Further the system is capable of triggering template expansions in response to 'hotstrings'.

For example...

::sig::
{
Find my blog @ http://www.rorybecker.blogspot.com
Find my plugins @ http://www.rorybecker.co.uk
}

....allows me to enter my signature into either gmail or any other email program or document simply by typing 'sig' and then hitting space.

Great stuff.

There is of course a lot more that it can do besides launch notepad.

I will now quote the introduction on it's homepage

AutoHotkey is a free, open-source utility for Windows. With it, you can:

* Automate almost anything by sending keystrokes and mouse clicks. You can write a mouse or keyboard macro by hand or use the macro recorder.
* Create hotkeys for keyboard, joystick, and mouse. Virtually any key, button, or combination can become a hotkey.
* Expand abbreviations as you type them. For example, typing "btw" can automatically produce "by the way".
* Create custom data entry forms, user interfaces, and menu bars. See GUI for details.
* Remap keys and buttons on your keyboard, joystick, and mouse.
* Respond to signals from hand-held remote controls via the WinLIRC client script.
* Run existing AutoIt v2 scripts and enhance them with new capabilities.
* Convert any script into an EXE file that can be run on computers that don't have AutoHotkey installed.


A complete list of commands is available here and the main documentation here

**It should be noted that I do not feel that I would prefer to use this program over coderush itself. there are many things that coderush can do for which it requires prior understanding of the code within your editor and I do not feel that this is the case with AutoHotkey. (Coderush is simply the closest thing I know to this facility)**

Autohotkeys could be likened to Slickrun with the saving grace that it does not have a permanent on screen interface.

Oh yeah... did I mention that this software is both freeware and open source

Again ... Great stuff

PaintIt has arrived

Yup the first iteration of PaintIt is here. The basic functionaliy is in place and there's more to come.
The first iteration of PaintIt is here. With it comes a minor change to the plugins page.

I will now be publishing an official version number and release date so that will know just when a pluginis different from a previous iteration that you might already have downloaded. So in this case version 1.0 of PaintIt is published exactly 1 month after my last plugin update. Unforgivable isn't it.

Anyway... back to PaintIt.
This plugin is an amalgamation of the previously released ColorCodeVars and HighlightCurrentVars enhanced to work with methods aswell as variables.

Essentially this means that you can pick the color that you would like Public, Protected, Protected Internal, Internal and Private Methods and Variables to be displayed in.
In addition seperate colors can be specified for Local, ParamIn, OParamOut, ParamRef and ParamArray variables.

Finally these colors can be overridden to allow the notion of a Current variable or method and all references to it be drawn in yet another differing color. This time allowing also the specification of a back color.

Some suggest that these measures might create a level of chaos within your code, Others sugest that this might help create a level of clarity. It all depends which way you think.

Either way I hope that this serves some as a useful tool and others as a possible example of how to create such tools.

Source Code is available as always :)


Friday, June 23, 2006

MoveIt updated again

I have updated MoveIt. This update includes a fix for MoveCodeUp/MoveCodeDown and also includes the previously seperate "Sort References" Refactoring. To download, see http://www.rorybecker.co.uk
Yup, thats right I finally found some time to fix(I hope) a bug in MoveCodeUp/Down which prevented the xml comments from moving with a method.

Also this version of MoveIt includes the previously seperate "Sort References" refactoring. This is an enhanced version of the previous version of "Sort References". It now allow you to define a series of Namespaces which are not sorted alphabetically but according to the order you define. By default System.* and DevExpress.* namespaces are sorted to the top.

"Sort References" also includes a facillity to optionally include a blank line between groups of similarly named namespaces.
To download, see http://www.rorybecker.co.uk

Monday, June 12, 2006

CodeRush 2.0

The next versions of CodeRush and Refactor are so amazing they have been assigned version 2.0 status
Thats right the next versions of Coderush and Refactor are just that special that they require promotion from their 1.x status to full on version 2.0. Now this deserves a little explanation. Well as yet, I'm not privy to any classified information and I'm afraid I wouldn't tell you any of it even if I was. Nothing personal it's just that I don't want to be sued :)

However, I can paraphrase and quote some of what I have heard. None of which is secret.

Coderush 2.0 will include a new 'dynamically typed' template engine. This new facility augments the existing template system alowing for dynamically typed templates.

What is a Dynamically Typed Template(DTT)? Well to answer that I really should explain the existing Statically Typed Template(STT)

One example of an STT would be 'mb'. This is a sequence of keys which creates the declaration of a method which returns a boolean when the trigger key (usually the spacebar) is pressed.

Why is this Static Typed? Well it always produces the exact same code and the type involved is always a boolean.

We can make copies of this template which instead create Methods returning strings, shorts or any other types you might have created.

However at 1 template, per type, per purpose we would have to write a lot of templates to cover ourselves.

Coderush verion 1.x ships with over 900 such templates, but as you can imagine several of these are essentially duplicates of each other due to the nessecity of covering serveral types for each purpose.

In Coderush 2.0, DTTs are kinda like mixing STTs and Generics.

So one would create an 'm' template which understood that a second 'chord' would be needed to indicate the type.
This allows us to write 1 template per purpose and drastically reduce the number of templates needed to achieve any given purpose.

so now I can type
mb for methods returning booleans
ms for methods returning Strings
mw for methods returning Widgets

Hang on ... did I get that right?...

Yes I did. you can now teach coderush new types that you like to use frequently and indicate which key or keys you would like to use to represent the type in question.

And as soon as you define the relationship between w and widget, you can use it with any of the existing DTT instead of having to define the relationship for each template.

This seems to blow the door wide open on template creation. It seems that I can create scores of mnemonic expansion possibilities simply by creating a single DTT

This is true. In fact, in the next version, the number templates is said to have shrunk overall by about 100 while the number of shipping mnemonic combinations should be higher by 1.5 orders of magnitude. I say this in this manner so as not to scare people off.

But don't worry, you won't have to memorise all of these. By their very nature most mnemonics produce very similar code to each other with the subtle differences in types making up their differences.

And these differences are almost instinctive to guess anyway so there shouldn't be pages and pages of documentation to pour over.

(The key here is being able to write one template and use it with many types without the author of the template explicitly having to create a copy per type.)

Speaking of which, a new interactive training window will be available in the next version. No details on that just yet but I'm guessing something a little like studio's dynamic help feature only, (as the name implies) more interactive and of course centered on Coderush's templates.

Refactor is also set to have some improvements in the way of new Refactorings. It's now said to ship with more that twice, yes that's 2X, the number of refactorings in ReSharper 2.0.

And more... yes access to all of this wonderful technology is also still wholy available through an open managed api 'DXCore'. Which is still freely available and which I will be jumping headlong into just as soon as I can.

Finally we come to the issue of money. Yup the ugly beast has reared it's head again.

Developer Express has changed the licensing model of CodeRush/Refactor to match the rest of it's products.

In version 2.0 we move to a subscription licencing model.

But don't panic this is not as bad as it first seems. Compared with the feature set of these products, the fees involved are truely neglegible.

So at the time of authoring the original price of $249 for Coderush (which still includes RefactorPro for free) is unaltered as is the RefactorPro price of 99$.

However now this price will only get you 1 year's free upgrades before a maintenence fee is required. This fee is currently set to be $100 for CodeRush and $40 for RefactorPro.

The following has not been layed out in stone and is my interpretation.

1.> The renewal price for Coderush includes the renewal price for RefactorPro which come free with the initial purchase.
2.> If you descide not to renew, you are still entitled to continue using the products that you have bought up to that point.

Item 2 here is great news because it provides incentive for DevExpress to continue to update and improve these products forevermore in order to get you to keep paying.

This is is my opinion the best money you will ever spend as long as you are using the Microsoft line of IDEs.

I cannot express just how flexible this system is.

It is more valuable than any set of components you might use to improve your end user's experience. It further allows your programming team to begin to code almost as fast as they can think.

I cannot sing the praises of the existing system highly enough.

Now that I'm thinking about version 2.0, I'm afraid someone is going to have to throw me a life-jacket because I appear to be drowning in my own drool.


Saturday, June 10, 2006

New feature in MoveIt

Shock News - MoveIt can now move your code around.
MoveIt has a new feature (inspired by Dan Avni) which allows you to Move code around. Specifically the current statement, declaration or method. Simply bind some keys (I personally use Ctrl-PgUp and Ctrl-PgDown) to the MoveCodeUp and MoveCodeDown actions and you should be able to use those keystrokes to move individual statements, declarations or methods up or down one place at a time.

Note that a blocks of code like If's and foreach's count as single statements so they can be moved in their entirity.

Please note that the plugin tries to guess what you want moved not by what is selected but by where your caret is located at the time of activation.

Comments, as always, are welcome.

Download from http://www.rorybecker.co.uk

Update(13/June/2006):Uploaded new version to correct bug spotted by Karel Kral. Thanks Karel

Friday, June 09, 2006

Baby 'Rose Becker' born at last


It's been a long 9 months and 12 days but baby Rose (Rosie) Becker is with us at last.
Rose (Rosie) Becker arrived at 16:20 on thursday the 8th of June 2006. Official length of labour was 3.5 hours although if you ask Anne she'll say it felt a lot longer :)

Our little Rosie arrived weighing 8 pounds 11 ounces. Just under the weight of her older sister Molly.

There were no complications and the only side effect so far is that Anne's right leg feels very numb. (But don't worry she can move her toes etc.)

Update(10th June 00:31): Anne was feeling much better today and was up and about so no need to worry about her being paralysed or anything.


Sunday, June 04, 2006

DX-Squad

I've was invited to join DX-Squad and was very happy to accept.
The guys at DevExpress have invited me to join DX-Squad, a volunteer group of users of their software/components who are willing to spend a little of their time helping out other users in their newsgroups etc. I guess we're that group of people who obsess enough about a cool technology to try to learn everything we can about it and really push it. I guess my previous contributions in the DXCore newsgroups along with the plugins I've developed, got me noticed in some way. This is cool.

Note: I should make it clear that I do not work for Developer Express. Nor do any of the rest of DX-squad. (Although I believe Oliver Sturm used to be a member and is now employed by them). We are all still just very enthusiastic customers.
This means that you can rest assured they have not bought my opinion. I do get to play with beta bits from time to time and as such I have signed an NDA. However I can still say what I want when I want. On my blog, for example, I am totally allowed to say "Coderush Sucks" if I think it sucks.

So don't you worry. Just as soon as I can find something that actually does suck, I'll let you know. Just, please, don't hold your breath. I've been looking at their other products and I think you'll be waiting some time and I wouldn't want you to hurt yourself.

:)

Saturday, May 20, 2006

Minor change to Blog layout

I've finally managed to get hold of some code which allows the new abbreviated front page of my Blog. This new format sees each 'long' post have a brief summary on the front page with a link to the full article.

The code I've used, is a slightly modified version of some I found I found at Anything Else which is very clever and also allows for shorter posts which do not link to a larger page. (This current post is such an example.)

I have adjusted it slightly from the version indicated to allow for a summary which is not a part of the actual post.

Wednesday, May 17, 2006

Code Generation

A post on code generation in this case via MyGeneration and some of the clever things can be done with it :)
HanselMinutes
I listen to several podcasts. For a complete list see my sidebar. One of these is HanselMinutes
A weekly audio talk show with noted web developer and technologist Scott Hanselman and hosted by Carl Franklin

In reality what this means is that Scott has spend a great deal of time dealing with technology of varying kinds and brings us this weekly show with Carl Franklin (of DotNetRocks fame.) and shares with us his knowledge regarding tools utilities tips and tricks relating to .. well .. almost anything.

Scott recently did a podcast (ok so it was a month or more ago) on Code Generation in which he mentioned several code generation options and rated their capabilities and effectiveness.

My Generation
As Scott himself points out during the course of his show, there are far more Code-Generation products available then he could possibly have covered during his show.

One that was missed by Scott, but found by my good friend Marc Croom, was MyGeneration a freeware application/framework build around the dotnet framework.

MyGeneration claims to be capable of everything that CodeSmith is and has the added bonus that it's free (although not open-source).

Naturally (given a free framework some spare time to play with) we have begun to delve into the realms of Code-Generation and have been trying to decide just how we can take advantage of it.

The idea seems to be that you code up a script/template (in VB.Net/C#/VBA or JavaScript(I think)) and then this script is made to run, generating the code you requested.

MyGeneration comes complete with a framework for reflecting over an existing database structure. So you can create a class per Table/View/StoredProc which can contain constants derived from the Table names, Field names, parameter names and code derived from a combination of these and code pre-build into the template. (Of course these are ideas not limits)

Inside a couple of hours we (Marc and myself) have managed to create a few simple templates which we were then able to use to completely regenerate the existing DAL (Data Access Layer) of one of our company's main applications.

The application in question has, at last count, 122 tables, and 45 views.

Classes for all 167 of these database objects including Select/Insert/Update/Delete methods (obviously where appropriate), relevant fieldname constants and several lazily loaded properties were generated following this in less than 30 seconds

And that was just from the meta data gathered from the database itself.

I can insert this generation of code into my build procedure to ensure that I get compile errors if I change the database to the point where old code cannot work against it.

For example
If I delete a field the code generation will regenerate without that field constant and any code that references it will fail to compile.

In the old days, (lol I'm not that old :)) we would have "hand coded" constants to represent the fields of a database. These constants would have been compiled into the code and would not have manifested problems until runtime.
So here we fail as early as possible moving as many errors as we can from runtime to compile-time.

Hey here's an interesting idea. Hows about we generate assertions for the existence of each and every field and table in our entire data structure which we can run upon application startup in order to determine for certain that we are running against the correct version of the database.

The Next Step
In the current situation, "The Database" is the domain language. In other words the database contains all the information used to perform the generation of code. This is great for simple needs, like mine are currently, but what if later I need to express exceptional circumstances to my templates?

I plan on taking a leaf out of Scott's book and trying the following.

I'm going to try to use MyGeneration to generate, not code, but an XML representation of the schema of my database.

I'm then going to see if I can't knock up an assembly or 2 to help MyGeneration reflect in a strongly typed fashion over the generated XML and see if it's can't be made to generate the SQL Schema from the XML

Initially this might seem like a strange idea, but there is method to my madness.

You see in doing this, I will have shifted my Domain Language from the Database to the XML.

The reason for this, is that XML is capable of having meta-bits added to express things that the database cannot. So I can markup my database XML definition with business information which should enable my code generation to make sensible decisions.

For example
I would like to generate a DAL for my database. But there are several tables for which I would like to generate further logic.

I have a Customer table and a Product table and I would like to indicate to the generation system that it should generate Domain Objects for these tables.

So I would actually like the system to generate Customer and Product objects which would naturally have intellisense access to properties which represent the fields in the table. Further I would like to generate collection classes for these new Domain Objects and finally I would like the DAL for these objects to return collections of these objects rather than Rows, Datasets or Datareaders. So now my results are strongly typed, iterable (not sure that's a word) and I can inherit/amend these to add business-logic.

There is no easy way to markup the database itself so that the templates can understand that these tables are special but I should be able to markup the XML in any way I see fit making this an almost trivial task.

And finally...
There would seem to be many potential uses for Code-Generation. A few more I have either thought of myself or have had suggested by others include

Unit Tests for generated code
XML Documentation
AJAX Style Javascript Functions that map to existing server-side functions

If you can think of any more, then please feel free to let me know in the comments. I'm very interested to know what people are doing in this space.

Tuesday, May 16, 2006

The bane of my life for many weeks (Solved)

A retro post which refers to an incident that was actually solved a couple of weeks back, but I didn't have a Blog then did I? :)

Once upon a time (It could be up to about 6 months back). I had a perfectly working ASP.Net WebApp when suddenly and through no fault of mine..... (never is, is it?)

.... my copy of Visual Studio broke.

Well I say it broke. What I mean is that the QuickWatch broke. But if there was ever a feature I use all the time it's QuickWatch.

What I mean to say is that while simple types (int32, String etc) would work fine, complex classes would fail to display the little plus sign which allows one to expand the item being watched and to then see all of it's properties.

More recently I discovered that this only happens in VB.Net (and before the zealots jump out and kill VB, I must point out that this is not a flaw in the language. It's a flaw in the VB part of the IDE).

Further more I already knew that this is a project based problem. That is, only a select few projects suffer from this.

This plagued me at work for some time.

I later found the answer while programming my 2 latest DXCore offerings (DeclareIt and MoveIt). Both are now available by the way (in a sort of beta testing open source kinda way) at http://www.rorybecker.co.uk

I had been besieged by the same problem. My solution, in this case contained a few different plugins (again written in VB.net) but nothing that special.

I was livid. That B*stard bug had leapt from my work PC to my home PC and now my "fun relaxation" programming was becoming as stressful as my work programming.

That was it.... I had to do something...

I spent all night (on and off) visiting forums and google groups and found lots of people who seemed to be experiencing the same problem. None of whom had any answer..

Finally I found someone who had the answer... the holy grail... the goose that laid the golden egg.

But damn it I can't find it any more. That's right I have no idea who you can actually thank for finding this little nugget of information.


Sorry

..
.
.


Oh yeah sorry that's right I didn't tell you why this happens yet. :) Sorry

Well it turns out that this happens if your solution contains a project with no compilable code in it :)

Yup its that simple

In my case I have a project for creating my plugin repository homepage which , due to it's very simple HTML/CSS approach (due to my being too cheap to plump for real hosting with asp.net facility), had no compilable code in it whatsoever.

So long story short (oops too late) all you have to do is to find that one ( ok I guess there might be more than one) project in your solution which has no code(VB/C#/C++ etc) in it, and then add a single class ( class1.vb/class1.cs/class1.whateverthoseawkwardc++guysareusingthesedays)
Compile once and your done.

Go on try it... Yeah now put a QuickWatch on that class instance over there (yes that one)... See that plus sign (you do remember those don't you?) yeah expand that.


Now doesn't that feel better :)...

Now go get a beer..

You deserve one...

And so do I :)

RefactorPro -> CodeRush -> DXCore

The most useful visual studio toolset that money can buy. And the free bit too.
About 6 months ago now I discovered the most useful Visual Studio tool in existence.

Refactor Pro (by Developer Express) is basically a language-agnostic refactoring tool for visual studio (2002,2003,2005).

This means that it allows you to do lots of very clever things to your code which transform it into a very much more readable state without damaging the code itself. Oh yeah and itworks for both C# and VB.Net

Note: A Refactoring in it's truest sense should not alter the functionality of the code it's modifying. In other words, after the refactoring, the code should manage to pass all unit tests which it passed before the refactoring.

From there is was a very short walk to find CodeRush. CodeRush is a programmer productivity tool like RefactorPro. It's productivity is gained, not from changing old code, but by allowing you to create new code in far less time with far less keystrokes.

Word has it that Mark Miller was giving a talk on the merits of coderush and he challanged one of the audience members to a duel wherein he (Mark) and the audience member would attempt to code the same simple application from scratch. The audience member was given a standard PC with no hidden extras, and Mark was using another machine identical save for the copy of coderush which was installed. Then, to make things a little more challanging, Mark informed the audience that he was so confident in Coderushs ability to aid him in his quest, that he would consent to type the code for this application using, not his hands but instead by using a single pair of chopsticks.

Apparently Mark managed to beat the poor guy with time to spare.
(I think it likely that Mark probably had a litte cafine advantage aswell)

The final thing to be aware of is that both CodeRush and RefactorPro are built on a "Free" framework architected by Developer Express on to which anyone can build additional functionality.

And to prove the point, that's exactly what I've done.

My home page is over at http://www.rorybecker.co.uk/ and exists at the moment as a place to dump some of the DXCore plugins that I work on in my spare time.

So I emplore you if you haven't heard of these great tools, please head on over to www.DevExpress.com and checkout both Coderush and RefactorPro

Please be warned... some of them require Refactor Pro aswell as DXCore.
But at only $99 (last time I checked) It's probably the best money you will ever spend as a VS.Net developer

I will be posting a couple more Plugins (DeclareIt and MoveIt) soon so check back here or in the devexpress DXCore/CodeRush/RefactorPro newsgroups for information as it's available.

Monday, May 15, 2006

Who am I

A little introduction to me
My name (as you really should know already from this blog's title) is Rory.
More precisely it's Rory Becker.

I am a programmer for a relatively small company which I'm not going to name here so that I can say whatever I want without it reflecting badly on them.

I mostly program in VB.Net although I am fairly competent in C# as well. I have been following the Microsoft thread of IDE's since VB 5.0 when the company I was working for dictated that this was the "New Language" that would be used for our next project. I immediately complained (although not very loudly) that Delphi (not sure which version was about at the time but it would have mattered very little) was a far more capable language for almost any possible project.

I was informed that this did not matter as we had a large supply of VB 3.0 code from a previous project which would be the basis of this new project. (Oh dear)

I would like to have quit but that wouldn't have looked good on my report when I'd finished my gap year.

Anyway that's all water under the bridge now and since VB has now caught up and become a real grown up language.

So now I program in VB.Net 2003 but I am, for the moment, very happy doing so.