Tuesday, November 13, 2007

Behavior in Vista Newsgroup

Sometimes I discuss (have a blazing row with) my father about all sorts of things. We each explain (at great volume) our points of view to the other hoping to persuade them (by beating any given point to death) that our view is the more accurate.

Observers of this behavior will wonder if they shouldn't move the sharp objects out of the room. Just to be on the safe side.

But the truth is that my father and I have the greatest respect for one another.
We can just be very bad at listening to one another. :)

Whilst looking for a suitable newsgroup in order to post about my Vista problem I came across microsoft.public.windows.vista.general.

I posted about my problem and went about my business. I had naturally added this newsgroup to my newsreader Omea Pro, so when I was informed by said reader that an absolute torrent of posts had appeared in said newsgroup, my interest was of course piqued.

I clicked the folder and started to read the titles of the posts hoping for some response to mine.

I'm afraid that I have to report, to those of you lucky enough not to already know, that the 5 year olds have taken over this newsgroup.

There are some valid informative posts in this newsgroup, but they are largely hidden, for the moment at least, by the relative avalanche of "alternative" posts wherein the correspondents have long forgotten any actual facts that their arguments might have been based on, and settled instead upon the time honored strategy of name-calling.

The signal:noise ratio is approx 10-15:1

Wow that's a lot of Crap. Do these people really have nothing better to do that to "virtually" shout names at one another across the ether can they really maintain this constant level of bickering about nothing.

My 2 eldest children are rather adept at fighting in that way that siblings will do about almost anything. But even they eventually get bored and give up.

I hope that I never reach the stage where reasoned argument is forsaken and personal flaming rapidly becomes the default strategy.

I think I'm going to start listening to my father a little more.


Vista Ultimate, 64-bit, VS2005, "Run as Administrator"

As the title suggests I run Vista 64-bit (at least at work). I have a core2duo something or other and a whopping 4Gig of RAM.

I run VS2005 (although I think I may be switching very soon :P). and it runs very well apart from one thing.

I can't switch to it.

Well that may be over-exaggerating things a little.

I can switch to it...using Alt tab
I can switch to it...using the task-bar
I can switch to it...sometimes....by clicking on it when it's in the background.

but I can't switch to it when I click on it in the background and I'm not already running a UAC elevated process.

Yes that's right, it's as if the Elevated  processes all run in a different desktop all the time.   There's no grayed out background. there's no prompt asking me if I want to allow this action.

But none the less I cannot switch from notepad to VS2005 by clicking on VS2005 in the background of Notepad.

Now I do run VS2005 elevated as Administrator, because encourages me to every time it loads by showing me this screenimage

Why I continue to have it show the message, I don't know. I thought it might go away once I told the .exe to "Run as Administrator" every time it loads. But no, this does not appear to be the case.

I have installed VS2005 SP1 and I have applied the Vista update for same.

However... I'm not yet been 100% totally forthcoming with the full facts.... You see... It's not just VS2005 that is doing this to me.

There's another culprit and It's none other than IIS7.

So with this baffling combination of circumstances, can someone somewhere tell me what's going on here and how I can fix it.

I would love to imagine that this will be fixed in a matter of weeks when I install VS2008, but I doubt it.

 

So how's about it... anyone... anyone at all?


The time has come.... VS2003... you're fired.

Ok sure that was cheesy, but come on..... Just read the title again. it said "VS2003". This is a product whose name at least is soon to be out of date by 5 years. (ok nobody say XP)

I'm just sick of maintaining code that's just that old. (ok nobody say VB6)

The time has come. I am mere days now from the rollout of the last of our products to be upgraded from using version 1.1 of the .Net framework to version 2.0.

And not a minute too soon because version 3.0 is already out and version 3.5 is due out before the end of this month.

It is my sad (ecstatically happy really) duty to inform you that VS2003 is finally on it's way out. And to that end I must further inform the populace at large (or small in the case of the readership of this blog) that I will no longer be allowing said framework to hold back any of my plugins either.

I have a reasonably new core2duo 64-bit machine with 4 Gigs of ram running vista ultimate 64-bit. and I don't mean to sully (no Mulder or X-Files jokes allowed) it with any of that .Net 1.1 crap (ok no Vista cracks either).

I will be moving all plugins that are deemed worthy, to version 2.0 or better of the framework just as soon as I can find the time. (yeah I know... that could lengthen their lives by years)

I will attempt to mark their source in Subversion in such a way as to allow the 1.1 versions to live on in some sense but that's about it.

VS2005... My mate multi-targeting says your days are seriously numbered.

But VS2003 and  .Net 1.1...... You're fired.


A nice stress-free holiday.

Yup that was the plan..

And to be fair it was quite a stress-free holiday. The journey home and the subsequent few days were a little more tense.

You see the idea was that given our tight financial situation we would not be going abroad or holidaying in any official location. We would instead holiday by taking a break from the norm. We would put ourselves beyond the reach of the Internet.

This is a big step as, for my wife (Anne) and I, the computers have largely replaced the television as our primary indoor (non adult-themmed) entertainment.

We live on the south coast of England and so we don't get to see my Anne's family very much. (Like all families it should be understood that for some members this is a good thing and for others it is not so good.) So we planned to spend the first few days of our break, visiting with her family "Up North" in Halifax.

This is a journey of some 286 miles which Google maps informs me should have taken roughly 5 hours. The route I took was about 20 miles more than this but took about the same time. All told, including numerous toilet and food breaks, we took about 6.5 hours to do this trip in the northward direction.

Once arrived we spent a pleasant couple of days in the company of Anne's Parents, Sister, Niece and their respective families. A good time was had and we managed to get off pretty lightly when it came to holiday junk acquired. I even managed to get the car's M.O.T (Mandatory, once yearly, minimum roadworthiness check here in the UK) renewed whilst everyone else generally wandered around the shops looking for holiday junk to fill the car with.

And so came the time of the return journey.

The car was packed, the kids were packed and some holiday junk was packed. We drove around the area passing at each family home to say goodbye and then we were off.

I think it was around 7pm on Tuesday evening. [This time was chosen, in theory to be good for getting the kids to sleep at given that it is their usual bed time. And even those of you with no kids whatsoever should appreciate that it is far less stressful to travel with kids who are unconscious than with kids who are constantly talking: I'm hungry", "I'm Thirsty", " I need the toilet", "Are we nearly there yet?". And this can all be in the first 10 minutes.] We set of at a fair pace (Breaking no speed limits or other sensible driving guidelines at all. Honest) and covered what I thought to be a fair distance. Google says it was about 112 miles in 2 hours. [I dispute this and suggest it was more like 100 but who am I to argue with the great Google :)]

It was at this point that things started to take a turn for the worse. We suddenly noticed a suspicious-looking light on the dashboard. It looked like an engine with little lightning strike through it. Then it disappeared. A minute later it was back again. A minute late it was gone again.

We got a little worried and stopped the car at the nearest service station to have a look. We stopped the car opened the bonnet (That's what we call the hood for any Americans out there:) ) and I used my considerable "mechanical engineering skillz" to confirm for my wife that yes indeed, we still had an engine and no it did not appear to have been struck by lightning.

Happy with my conclusion I suggested that not would be a good time to get everyone out of the car and feed and water the family. This seemed good because it would be a break on my terms rather than on those of my children. So we trooped into the service station (Kids in PJs and everything) for some food.

Food was (for a change) not bad and everybody felt better. Everybody got back in the car and we noted with optimism that the warning light was now out and all seemed normal.

Back on the road and a few miles further on we saw a different warning light come on. You should have figured out by now that I know diddly about cars and so this time we looked in the manual to find out what was happening.

The light said the manual indicates the failure of the automatic transmission. (Auto-Gearbox for those, like me, who would have had to ask their wives what this meant).

It then went on to say that since the automatic gears we're knackered, that we should shift manually instead. Well that seemed fair enough. I assumed (and you know what they say about assumptions) that we could get away with this until we could call a mechanic at home.

So instead of leaving the car in D(Drive) we now have to switch from 1 through 3 appropriately. Fine we can do that. I learned and am licensed in a manual so these concepts are now new to me even if doing so in an automatic is a little strange for me.

So we continue a little further.... and then Anne points out that although this light is still on, the rest of the dashboard has gone dark.... a moment later a seatbelt warning light had come on. Suddenly Anne, who is driving, says she thinks the car is loosing power. Literally she is having to push the accelerator further to get any kind of momentum from the engine.

The car is indeed losing power so we decided (rather quickly that the car was about to die on us and perhaps the middle lane (out of a possible 3) on the M1 (major motorway/Highway running North-South) was not the best place for this to happen. Especially at about 21:30 at night in reasonably high traffic.

So as quick as we can we get into the left-most lane (the slow lane) where we noticed signs indicating that we were just about to hit the off ramp to another service station. This would be a very good place to stop so we indicated and drifted left in to what we thought was the off ramp but turned out to be just the hard-shoulder (no idea if those outside the UK have another term for this but it's a lane to the left of the slow lane used in case of emergency) we quickly realized our mistake as it seemed that if we continued in this lane we were going to hit a bridge. Not good. We indicated and drove back out onto the slow lane, drove another 10 yards or so and my wife declared that all power seemed to have disappeared. Having already passed the bridge, we steered left again onto the hard shoulder and to our relief saw that this was indeed the off-ramp. However, having no power save for the momentum already ours, we saw that we would not reach the service station and so steered (For by not it's not really driving, there being no drive) onto the true hard shoulder where the car was brought (more from lack of power than from applied brakes) to a halt.

So 21:30ish at night, it's dark and it's cold but there's a service station within sight. My 3 kids Molly(5), Daniel(4) and Rosie(1) year old are asleep on the back seat of the car but we're still technically on a motorway. This is not a safe position to be in. It is not a happy position to be in. I could carry the elder 2 kids if need be and Anne could carry Rosie easily enough but I wasn't happy about the idea of walking any length of road in the dark under those conditions.

We quickly decided that we couldn't stay here as it was possible we could get hit by some fool driver at any moment. Then we noticed that the Hazard lights (emergency lights on the car) which we had remembered to turn on, were not working any more. The headlights had also failed. At this point I was not thinking much of that M.O.T I had had done.

So that did it. It's bad enough being in a broken down car at the side of the motorway at night in the rain (Did I mention the rain).

But now the car has lost all electrical power including anything that might power the Hazard lights. We had to get out.

Just then we noticed some blue flashing lights ahead. It seems that some police had just driven past on patrol and had seen the car. The offered to give us a lift to the service station. It took some doing to rouse my 2 eldest but once their subconscious minds were vaguely aware of getting to ride in a police car, the woke up with amazing speed. The Police dropped us off at the service Station and said they would call Highway maintenance or some such group who would help me get my car towed off the motorway. I booked the family into a room for the night after all who knew how long it might take to get this all sorted. Then I resolved to go back to the car to get some blankets and nappies (diapers) and anything else which might have been considered essential.

I took a safe(ish) route going outside of the barriers that a car might potentially have hit, thus affording me some protection. I reached the car and opened it up. I realized that since nothing was functioning anyway, I might as well turn everything off. Off went the headlights, the hazards and the heater. I shut the car and went to the boot (trunk for my American friends) to retrieve the bits for Rosie. Having got these I decided it would be good since I was here already to pick something up to occupy my kids, as sleep was not going to be foremost in their little heads after something like a ride in a police car. So I went to open the car up (meaning to retrieve some picture books or toys or something) and discovered that now the central locking mechanism of the car had decided to give out.In and of itself I could understand this as I can see where electrical power would help this subsystem in it's duties. but what I don't understand is why I couldn't even turn the key to unlock the passenger door itself. Strange. I resolved to figure this out later. I had already got my hands on the vitals necessary for looking after my Rosie.

On the way back I my mobile phone began to ring. It was the Highway guys. they informed me that I could not leave the car where it was and that I would have to move it or they have the police do it for me at a probable cost of over £100. This, I thought, was a little steep and resolved to find a way to do it myself.

Since I had to yet phoned and kind of rescue service, being of mind to sort my family out first I realized that no rescue service would arrive in time to move the car before the highway guys got the police to do it. So I asked the guy on the phone (James  I think his name was) Where exactly was the car felt to be safe?

James indicated that basically it was unsafe as long as it was on the motorway so as long as I got it off there, it would be ok. I looked at where the car was and wondered if I could push it off. however as I looked closer, I realized that in order to get the car into the car park I would have to cross back on to the exit ramp from the hard shoulder. this would be like pushing the car into traffic, and without any lights of any kind this was really not going to be a valid option.

Then I spotted the "End of motorway regulations" sign. It stood a full car length from one end of the Hard shoulder providing the perfect place where the car could reside without being either in the car park or technically on the motorway. I solicited help from a guy playing the slots in the service station, and together we approached the car, the battery of which, had now managed to store enough energy to allow reentry into the ca. I disengaged the gears putting the car in neutral, removed the handbrake and we managed to push the car the length of the hard shoulder to it's new "safe" location. I never did ask the name of the guy who helped me push the car but I slipped him the close to £5 loose change I had in hopes that it might help him to his fortune on the slots.

A short while after this, I got a call from the highway guys saying that the police had seen the car and were prepared to tow it around the corner into the car park for me (at no charge). I was very glad to hear this as I was still very unsure if where I had left the car would be acceptable.

The towing complete, I was off back to the room I'd booked for the family where I found mum looking ragged. This is not a reflection on here, but more on the behavior of my elder kids who seemed to have picked up the same levels of energy as they might have gained from several energy drinks mixed with some sort of neat sugar IV and they were using this burst of energy to pound on one another. This coupled with cries of Rosie who apparently needed changing meant that my arrival was greeted with much anticipation.

A little while later we had managed to get all 3 children to sleep the 2 eldest had fought so much that they now had each a bed of their own, and Rosie had a makeshift bed made out of a much folded blanket. I was preparing to sleep on the floor but Anne convinced me that we could now move Molly back into the same bed as Daniel. After this we both collapsed into bed where we slept very soundly until morning.

In the morning we called the AA who showed up very quickly and told us that our alternator was shot and a replacement would cost us about £90. Well we paid up and the car was fixed up right there in the car park.

A day later the fan belt fell apart. It was literally shredded.

We got that replaced and now the Power steering pump is leaking. We have a replacement for that and it's being fitted tomorrow morning by a friend of ours.

I think the car is fast earning a nickname of "The money pit"

I'm glad I cycle to work :)


Monday, November 12, 2007

Duplicate Line - Simple Examples

'Duplicate Line' is a simple enough concept....

  • Type a qualifying line of code.
  • Hit <Shift>+<Enter> instead of <Enter>

CodeRush will intelligently duplicate the line of code.

What do I mean by 'intelligently duplicate'.

Well I assume you know what I mean by 'duplicate'. What I mean by 'intelligently' is probably best demonstrated rather than explained.

Suppose I have the VB.Net line...
ImportsSystemData 
Position your caret at the end of this line and hit <Shift>+<Enter>.
CodeRush duplicates the line in question.....
ImportsSystemDataSelected ...and then positions the selection block cleverly around the namespace itself so that you can over-type with an alternative.

Similarly you can use this to create a whole slew of variables of the same type.....

PrinvateAAsInteger

...becomes...Private2Vars

 

 

...becomes...

PrivateManyVars

 

 

 

 

I think you'll agree, this is quite the handy function.


Selection-Inversion

Selection-Inversion (CTRL-SHIFT-I) is a mechanism for transforming one simple code structure into another or back again.
For example:

From .... "X = True" ....into.... "X = False"

..OR..

From .... "A = B" ....into.... "B = A"

So how does this work?

We it's all down to pattern matching and the wonderful alias engine provided by DevExpress.

Each Selection-Inversion requires a pattern to match and another pattern to replace.

The expressions that allow the above Inversions are simple in nature and, unlike most regular expressions, quite readable.

For example, the first Selection-Inversion above matches using...
-------------------------------------------------------------
%Identifier1% = %BooleanValue1% %EndOfLineComment1%?
-------------------------------------------------------------
...and replaces with...
-------------------------------------------------------------
%Identifier1% = «?InvertBoolean(%BooleanValue1%)» %EndOfLineComment1%
-------------------------------------------------------------
This shows an additional strength of Selection-Inversion. That of the StringProviders. I'll cover StringProviders in another post but as you can see from this small example. a StringProvider is essentially like a function which takes 0 or more parameters and returns a string. A very simple idea but one which allows for a lot of customization.

The example here uses an "InvertBoolean" StringProvider which, as it's name suggests, inverts the passed boolean and passes out the text which represents it's opposing value.

The second example matches using...
-------------------------------------------------------------
%Identifier1% = %Identifier2% %EndOfLineComment1%?
-------------------------------------------------------------
...and replaces with...
-------------------------------------------------------------
%Identifier2% = %Identifier1% %EndOfLineComment1%
-------------------------------------------------------------

Note the subtle change here. Only the numerals 1 and 2 have switched positions. The numerals can be tacked on to any alias and allow each alias type to be used multiple times in the match string and then placed in arbitrary positions in the replacement string.

As you can see the Selection-Inversion is quite powerful.

There are also a few more Inversions in the shipping version of CodeRush which deal with inverting loops so that they progress in the opposite direction from which they started but I'll leave these for you to investigate.


Sunday, October 28, 2007

BST - Bites me again

I don't know what it is that make this happen every year.

But every single time that the clocks have to be adjusted due to either the start or the end of BST, I inevitably find out about it at around midday on the Sunday on which the change occurs.

I therefore, am either late for some appointment, or alternatively miss that all important extra hour in bed.

Of course I could simply go to bed an hour earlier this evening, but frankly it's been a week since I touched a computer so if you think I'm gonna leave this one early his evening you've got another thing coming.

:)


Friday, October 19, 2007

Holiday???... What's that then?

The trouble with working for yourself (or family in my case) is that you very rarely get to take any official time off.

Not withstanding the birth of my last child Rosie, I haven't taken "official holiday" in about 3 years.

But I'm taking next week off to chill with a few good books.

Money is a bit tight so my wife, my 3 kids and myself are going to visit my in-laws (Just for a few days) who don't really know what the Internet is, much less have a computer.

I'm leaving my laptop behind and I'll probably switch off my mobile phone.

I might take a pen and paper but that's the technological limit.

The pace of life is going to slow to a snail pace and I might finally be able to relax for a bit :)

Of course we'll be staying with the in-laws so there's no guarantees :)

So this is me dutifully giving notice that my DX-Squad presence is going to lapse like never before.

So to anyone who emails me during the next week.... replies will be a little delayed. :P

Tuesday, October 09, 2007

Aliases - The art of readable regular expressions

Here's a simple question.. Which of these is more readable?

  • (\.?((\[(([A-Z]|[a-z]|([À-Ö]|[Ø-ö]|[ø-ə]))|_)
    ((([A-Z]|[a-z]|([À-Ö]|[Ø-ö]|[ø-ə]))|_)|[0-9])*
    (\u0025|&|@|!|#|\$)?\])|(([A-Z]|[a-z]|([À-Ö]|[Ø-ö]
    |[ø-ə]))|_)((([A-Z]|[a-z]|([À-Ö]|[Ø-ö]|[ø-ə]))|_)
    |[0-9])*(\u0025|&|@|!|#|\$)?)((\s*)\.(\s*)((\[(([A-Z]|[a-z]|([À-Ö]
    |[Ø-ö]|[ø-ə]))|_)((([A-Z]|[a-z]|([À-Ö]|[Ø-ö]
    |[ø-ə]))|_)|[0-9])*(\u0025|&|@|!|#|\$)?\])|(([A-Z]|[a-z]|([À-Ö]
    |[Ø-ö]|[ø-ə]))|_)((([A-Z]|[a-z]|([À-Ö]|[Ø-ö]
    |[ø-ə]))|_)|[0-9])*(\u0025|&|@|!|#|\$)?))*)


  • %Identifier%


I'll give you a minute to let that sink in......


The 2 expressions above are both valid and equivalent in DXCore's 'Alias' subsystem. The 'alias' subsystem backs the 'Duplicate Line', 'Selection Inversion" and "Intelligent Paste" functions of CodeRush.


Which would you rather type?


The 'Alias' subsystem is a very simple but very powerful recursive substitution system which starts with a simple phrase. (In this case %Identifier%) and then expands it according to 1 or more rules. The resultant phrase is then analyzed and, if capable, expanded again... and again ... and again.


%Identifier%

...becomes...

(\.?%SimpleIdentifier% (%ws%\.%ws%%SimpleIdentifier%)*)

...becomes...

(\.?(%EscapedIdentifier%|%NonEscapedIdentifier%) (%ws%\.%ws%(%EscapedIdentifier%|%NonEscapedIdentifier%))*)

...becomes...

(\.?((\[%AlphaOrUnderline%%PartialIdentifier%%TypeCharacter%?\]) |%AlphaOrUnderline%%PartialIdentifier%%TypeCharacter%?) (%ws%\.%ws%((\[%AlphaOrUnderline%%PartialIdentifier%%TypeCharacter%?\]) |%AlphaOrUnderline%%PartialIdentifier%%TypeCharacter%?))*)

A few rounds later and we have our full expansion....


(\.?((\[(([A-Z]|[a-z]|([À-Ö]|[Ø-ö]|[ø-ə]))|_)
((([A-Z]|[a-z]|([À-Ö]|[Ø-ö]|[ø-ə]))|_)|[0-9])*
(\u0025|&|@|!|#|\$)?\])|(([A-Z]|[a-z]|([À-Ö]|[Ø-ö]
|[ø-ə]))|_)((([A-Z]|[a-z]|([À-Ö]|[Ø-ö]|[ø-ə]))|_)
|[0-9])*(\u0025|&|@|!|#|\$)?)((\s*)\.(\s*)((\[(([A-Z]|[a-z]|([À-Ö]
|[Ø-ö]|[ø-ə]))|_)((([A-Z]|[a-z]|([À-Ö]|[Ø-ö]
|[ø-ə]))|_)|[0-9])*(\u0025|&|@|!|#|\$)?\])|(([A-Z]|[a-z]|([À-Ö]
|[Ø-ö]|[ø-ə]))|_)((([A-Z]|[a-z]|([À-Ö]|[Ø-ö]
|[ø-ə]))|_)|[0-9])*(\u0025|&|@|!|#|\$)?))*)


At each round of the substitution you can see the power of  Aliasing (not to mention the pre-built list of aliases) at work.


And what a list it is..... 93 separate pre-built aliases found in the "Core\Aliases\Regular Expressions\System" section of the DXCore options.


If  you find, somehow, that these aren't enough you can create you own. DevExpress have even allocated a place for you to do just this in "Core\Aliases\Regular Expressions\User"


But it doesn't stop there. Each defined alias can be referenced either on it's own, or with a numeral suffix from 1 to 9. Thus you can have %Identifier%, %Identifier1%, %Identifier2% .. all the way through to .. %Identifier9% all used in the same expression.


This paves the way for some pretty powerful features


In my next couple of posts I'll show you how we take advantage of aliases in our use of "Duplicate Line", "Smart Paste" and "Selection Inversion".


Thursday, September 27, 2007

Trevor is unlocked

Trevor W is blogging. Take a look over at http://trevorunlocked.blogspot.com
Trevor W has unlocked his brain and will shortly be pouring forth the cream of the content from within. Available at http://trevorw.blogspot.com, Trevor is well versed in many technologies available from DeveloperExpress and is particularly keen on their XPO and XAF technologies and we should begin to see the gems of information pour forth soon.

Well done Trevor....

I have a feeling I'll be reading your blog for some time to come.

Friday, September 14, 2007

DX_Contrib, MoveIt, PaintIt and UnusedVariables all added to DXCorePlugins

The sourcecode to DX_Contrib, MoveIt, PaintIt and UnusedVariables has now been uploaded to http://DXCoreplugins.GoogleCode.com
These projects (DX_Contrib, MoveIt, PaintIt and UnusedVariables) are all still somewhat in flux.

I'm trying to get around to making sure that the cache employed by each of them for paint purposes is kept up to date.

This seemed originally to have some performance issues and I am trying to move towards a background threaded mechanism for keeping said cache up to date.

The problem seems to be that each time I approach this system looking to see if I Can improve it, it takes almost all my spare time to analyse what I have done to date. so that I seem to have very little time left to actually improve it.

This of course smacks of poor documentation/commenting. Therefore I have checked the entire set of projects into GoogleCode.com.

At least this way everyone can see where things have reached.

I am by no means giving up on these projects though. I intend to start going through the code making damn sure that I comment things as I go this time ;)

New project: DX_Sample

I have added DX_Samples to http://dxcoreplugins.googlecode.com.

DX_Samples was created in response to a question on the DX_Plugin newsgroup asking for
"a quick example of how I might go making an action that auto-creates regions around any properties that are not already in a region."

DX_Samples contains a plugin called RegionWrapProperties which wraps *all* properties in a class in a region. This is clearly not *exactly* what the original poster asked but we'll get there.

In the mean time we now have a suitable project for creating reference examples about how things can be done, without necessarily needing to create *full* examples.

Wednesday, September 12, 2007

Coderush EmbedParenthesis Tip

Idea by Neal Culiner... Configuration workaround by Mark Miller....
Coderush contains a feature called "Embed Parenthesis". this feature allows a user to select a portion of their code and to then type either '(' or ')'.

At 19:20 this evening (According to my newsreader) Neal Culiner suggested on the Coderush forum that it would be good if the existing EmbedParenthesis feature could be made somewhat more intelligent. He suggested that the caret should be placed either left or right of the final expression dependant on which of the 2 keys had been pressed in order to activate said function.
-------------------------------------------------------------
Note:
This is particularly useful as, Neal pointed out, for vb programmers who regularly highlight small expressions and wrap parenthesis around them so that we might CInt, CStr or CType.

I would also be sensible to use this to wrap an expression in any function call which passes such an expression.
-------------------------------------------------------------

"Great" said I "Add that to the support center and I'll track it too".

By 20:20 Mark Miller had spotted the conversation and posted a solution which required no new distribution of Coderush as all could be done with the existing version.

For those not willing to click through and read Mark's version, the solution is simple and elegant.
Simply create 2 'Selection\Embedding' entries. One for ParensCaretOnLeft and another for ParensCaretOnRight. Each should be the 5th type of SelectionEmbedding

For ParensCaretOnLeft, the Top line should be...
-------------------------------------------------------------
«Caret»(
-------------------------------------------------------------
...and the bottom line should be...
-------------------------------------------------------------
)
-------------------------------------------------------------

This should be suitably changed for ParensCaretOnRight

Then just change the existing bindings for Shift+9 and Shift+0 in "IDE\Shortcuts" to trigger the "Embed" rather than "EmbedParenthesis" and give each a parameter of either
'ParensCaretOnLeft' or 'ParensCaretOnRight'

You should now be good to go.



Tuesday, September 11, 2007

Write your own Dynamic Template

How do you write your own custom Dynamic-Template for CodeRush?
CodeRush 2.0 introduced the concept of Dynamic-Templates which I blogged about some time ago here. However I don't think I ever went into any detail about how you make your own.

Well the process is fairly simple.

To show you how this is done I will give an example.

Lets create a new template that will spit out code like...
-------------------------------------------------------------
Throw New ApplicationException
-------------------------------------------------------------
OR
-------------------------------------------------------------
Throw New System.InvalidCastException
-------------------------------------------------------------
OR
-------------------------------------------------------------
Throw New System.IO.FileNotFoundException
-------------------------------------------------------------

...based the specifics of your mneumonic.

The first step is to create a Dynamic List.

Follow these steps to get to the Dynamic Lists options page:

-------------------------------------------------------------
1. From the DevExpress menu, select "Options...".
2. In the tree view on the left, navigate to this folder:

Core

3. Select the "Dynamic Lists" options page.
-------------------------------------------------------------

Now we would like to create a "neutral" list, because this list should be available to all language types.

(Note: This is not technically true. I would prefer to make this list available to only VB.net and C#, but for now there is no way to do this other than to duplicate the list for these types. This will not matter too much as we will only be creating templates that use this list in VB.Net and C# anyway)

To do this we must ensure that the language dropdown reads "neutral".

Next we will right click the "Lists" list in the center column of the options screen and select "New".

You will next have to fill out 3 boxes with values for Name, Variable and a Comment.

Name should mean something to you, and it is what will appear in the previously mentioned "Lists" list once you save. I typed "Exception Types" in this box.
Variable is the suitable variable name in which DXCore will store the user/developer's selected item. I typed "Exception" here.

...and Comment is just a comment. I guess you should write a comment here :)

Once saved, your list is ready to be filled. This is accomplished by adding items on the right-hand side of the options dialog.

Each item added requires a mnemonic and a value.
We will add the following items

a - ApplicationException
ic - InvalidCastException
fnf - FileNotFoundException

Then we can push "apply" and our list is saved.

So how do we use this list in a sensible way?

This is the easy part.

Navigate to the "Editor\Templates" options page and create a new template. I'm going to do the VB one for now so I'll select VB.Net from the language dropdown first.

This template will need a special name. You need to use a special syntax within the name to indicate where DXCore should allow the user to substitute one of the mneumonics we created earlier.

We will call our Template "tn?Exception?".

What this means is that our Template will be triggered by the letters 't' , 'n' and any mneumonic from the Dynamic-List.

The expansion of our template will be:-
-------------------------------------------------------------
Throw New «?Get(Exception)»
-------------------------------------------------------------
The '«?Get»' is a StringProvider. StringProviders are available to insert from the right-click context menu in the expansion box. The '(Exception)' is the parameter for the StringProvider. In this case the phrase '«?Get(Exception)»' retrieves the string held in the "Exception" variable placed there by the trigger mneumonic.

Once this little gem is saved, you should be able to trigger your 3 expansions with any of the 3 phrases 'tna', 'tnfnf' or 'tnic'

The great thing is that you can add additional exception types to the "Exception Types" Dynamic-List at any time and they will also work with the template we have defined.

So now you have some simple mneumonics to help throw exceptions.

Sunday, September 09, 2007

Minor CR_WorkBench update.

CR_Workbench now Autoloads and Autosaves.
Yes CR_WorkBench now has an option "AutoLoad and AutoSave" vailable from "DevExpress\Options\ToolWindows\WorkBench".
This will cause your WorkBench to save each time you close your solution.
It will (kinda obviously) attempt to load a WorkBench each time you open a solution.

This new functionality added in revision 18 of DXCorePlugins

Wednesday, September 05, 2007

URL Mistake

It seems I have been quoting the wrong Urls in my previous DXCorePlugin posts.
I have now corrected the posts themselves but if you use an rss reader to view this then you might have already downloaded an earlier version.

Essentially I published Urls which required a login in order to gain access the the resources.

The correct Urls are
http://dxcoreplugins.googlecode.com/svn/trunk/CR_Contexts
http://dxcoreplugins.googlecode.com/svn/trunk/QuickTemplates
http://dxcoreplugins.googlecode.com/svn/trunk/CR_WorkBench
http://dxcoreplugins.googlecode.com/svn/trunk/Common

CR_Contexts added to DXCorePlugins

I have added a new plugin (CR_Contexts) to DXCorePlugins to add a few new contexts to DevExpress's IDE Tools

The new plugin provides 3 new Clipboard contexts called 'Clipboard Contains (Literal)', 'isMultiLine' and 'Clipboard Contains (RegEx)'

All found underneath 'Editor\Clipboard'

Enjoy.

This source available via GoogleCode and Subversion.
CR_Contexts available from http://dxcoreplugins.googlecode.com/svn/trunk/CR_Contexts
Common code available from http://dxcoreplugins.googlecode.com/svn/trunk/Common

QuickTemplates added to DXCorePlugins

Just a quick note to tell those who are interested that I have added my QuickTemplates plugin to DXCorePlugins
Yup, QuickTemplates is now available as a part of DXCorePlugins.

This source available via GoogleCode and Subversion.
QuickTemplates available from http://dxcoreplugins.googlecode.com/svn/trunk/QuickTemplates
Common code available from http://dxcoreplugins.googlecode.com/svn/trunk/Common

CR_WorkBench

CR_Workbench is a DXCore plugin which provides you with a toolwindow to store references to commonly used files.

CR_workBench gives you a toolwindow into which you can drag/drop files from either Solution Explorer or Windows Explorer.

All files placed on the WorkBench can be Double-Clicked to load them into the editor

The WorkBench has a context menu which allows loading and saving it's list to and from a file called [Docs and Settings]\[You user name]\Local Settings\Application Data\WorkBenches\[Solution Name].sln.wrk"

The only real point is to allow you a window which does not contain the whole breadth of files in your solution. If you save your workspace (I'm thinking of adding Autoload/Autosave) then you can close all documents prior to saving your solution and thus receive a much faster start-up next time studio loads this solution.

This source available via GoogleCode and Subversion.
WorkBench available from http://dxcoreplugins.googlecode.com/svn/trunk/CR_WorkBench
Common code available from http://dxcoreplugins.googlecode.com/svn/trunk/Common

Tuesday, September 04, 2007

GoogleCode - DXCorePlugins

And so I have created a GoogleCode repository for an open source project called 'DXCorePlugins'.

I created 'DXCorePlugins' because I wanted a better way to manage my open source plugins for DXCore, CR and R!.

I irks me that I don't do as much work on said plugins as I would like to. I came to the conclusion that it was all the management that was becoming awkward.

i.e.
Creating versioned code...
... to make versioned assemblies...
... and building versioned zip files with both source code and binaries.
... updating web pages to reference said zip files and explain the purpose of each.

... trying to keep track of 'issues', 'bugs' and 'feature requests'

It's all management which distracts from the fun part.... making a cool plugin which does something to help people in their daily coding lives.

So I decided that I had to move the source code off my machine and into a repository of some kind. We use CVS at work but are thinking of moving to SubVersion. so ideally this would be a good chance to get to know said source control software on something less mission critical.

So I needed hosting of an open source project which ideally allowed SubVersion access to the repository of code.

2 obvious candidates: SourceForge and GoogleCode. This does not make a definitive set but this is a hobby project after all. I didn't want the research to take over my life.

It should be noted that I did consider Codeplex but decided against it because of what appeared to be a bias toward MS SCC API. To me MS SCC API shouts SourceSafe and I've been stung there before. Now I know that this is an unfair judgement, but ours is a small company and we cannot afford to spend too much time on micro-management so the fewer pieces involved, the better. I simply saw Subversion as a natural evolution of CVS and therefore when I saw that I would need to introduce additional pieces( some kind of SSC - Subversion bridge) I basically ruled out Codeplex then and there.

Now... to say that I was then left with SourceForge and GoogleCode is also something of an unfair statement. A more accurate statement would have been..."I was left with GoogleCode and, if I really had to, SourceForge".

You see, SourceForge has, for me, been the slowest of experiences. Accessing a SourceForge has always been like returning to the days of dial-up connections. It makes me wonder if this isn't the method they use to connect their servers to the internet. Now in fairness, I have been led to believe that this is not the case for everyone. many people apparently find SourceForge a very reasonable resource. however I am apparently not in that position. So from day one, If I could run without SourceForge, I was going to...

And therein lies my one regret. If not for this one issue I would simply have added my code to the CRPlugin project on SourceForge. I would recommend that these projects definitely be checked out.

And so unless GoogleCode was to provide and major stumbling blocks, I was going to use it.

So how does one create a project on GoogleCode?

Well it turns out it's really easy. Just show up at http://code.google.com/hosting/ and declare the Name and Licence of your project. That's essentially all there is to it. True you'll need an account with google, but who doesn't have a GMail account these days anyway.

The hard part was choosing a Licence for the project.

Now originally I wanted to specify do anything you like with the code except sell it (I wanted to encourage giving back to the community) but I realised I was spending way too much time considering the licence when... In truth, I didn't really care what people did with the code as long as they don't blame me for something it might do by mistake.

I stared at the list and their definitions for ages before I finally gave in and asked for help.

Trevor Westerdahl rescued me and pointed me in the direction of the MIT licence. Indicating "An MIT license is about as "open" as a license gets. It essentially protects the writer form any harm...as in there are no warranties of any kind, but allows for selling, copying, redistributing, etc."

It sounded good to me, and so there you have it. http://dxcoreplugins.googlecode.com/ is up and running with it's first project 'CR_WorkBench'.

Friday, August 10, 2007

Quick templates Example: Contact XML

A simple example of using "Quick Templates" with a simple piece of XML.
This is a very quick post to show an example of using "Quick Templates" to aid you
in the creation of a repetitive piece of XML
Imagine you have the following XML.
-------------------------------------------------------------
<Contact fname="Rory" lname="Becker"/>
-------------------------------------------------------------
You would like to have many more of these.
What to do?

- Highlight the XML to duplicate.
- Trigger my plugin. (I suggest attaching the "Create Quick Template" action to the "Alt-Q")
- Enter a few keys to trigger your template (In this case perhaps "con")
- Add some choice (crlf separated) keywords to the "Field list". (I think Rory and Becker would work well here. )
- Optionally: Setup a suitable context for you new template.
- Click Ok

Now whenever you activate the template by typing con and hitting space, you will find that the XML is repeated back
to you but that Coderush has wrapped my name (in this case) using it's nice glowing field markers. and you can
effectively type the following
-------------------------------------------------------------
con Mark Miller<enter>
con Carl Franklin<enter>
con Dustin Campbell<enter>
con Richard Campbell<enter>
-------------------------------------------------------------
...and create the following XML...
-------------------------------------------------------------
<Contact fname="Mark" lname="Miller" />
<Contact fname="Carl" lname="Franklin" />
<Contact fname="Dustin" lname="Campbell" />
<Contact fname="Richard" lname="Campbell" />
-------------------------------------------------------------

I'm sure there are many other uses for this.
Feel free to suggest some.

Thursday, August 09, 2007

QuickTemplates v0.5

Here's a sneak peek at my new QuickTemplates plugin.
QuickTemplates is a DXCore plugin which provides a new action to complement CodeRush Templates.

Available here(Updated to 0.51), it provides a quick method to create a template from text selected in the editor.

Setup:
1. Place QuickTemplates.Dll (Extract from obj folder or compile your own from the source) to your plugins folder and start VS.
2. Assign a key to the "Create Quick Template" action. I use "Alt-Q"

Usage:
1. Select some text
2. Activate the action (Alt-Q)
3. Assign a Name to the template.
4. Enter some words/phrases (CRLF separated) in the box labelled "Fields".
5. Configure any context you require.
6. Click 'Ok'

You will now have created a template complete with fields in place of appropriate phrases.

Here are some screenshots:



Friday, July 27, 2007

VS2008 Beta2. Installed and working :)

Well the download took it's sweet time, but as I say... It;s working.
Yup VS2008 Beta2 Pro is installed and ready to cook.

Note: I have also installed the very latest builds of Coderush and RefactorPro and both are working fine. I will say that I am in fact working with a "Daily Build" of each (version 2.2.4 - dated 27th July 2007) so your mileage may vary.

Sub note: If you're a subscriber to either then you to can request a "Daily Build" from the support team. Although these may not be "stable" builds. :)

Anyway back to VS2008. As I said it installed very nicely and appears to function very nicely. Worth saying that, whilst it is a little slow in places, the general experience is not bad at all.

So far I have only had time to check out 'XML-Literals' and hunt around for the Multi-Targeting (hard to find it but it's on the "Compile" tab of the project properties and is triggered by the "Advance Compile Options" button.

If there's anyone out there who is on or knows someone on the VB.net team, can you ask them to either beat the C# team into submission or alternatively cave themselves so that we can have a little more consistency in the placement of such "Cross language" features.

Having said that much Kudos to said VB.net team. I love XML Literals. Now I just have to find out how to extract data from them as simply as declaring them.

I still haven't made up my mind (Yeah as if I could have done that about anything in so short a space of time.) about whether or not I like the hyper enthusiastic intellisense.
On the one hand it does help with things like XML-Literal syntax but then it is very hard to take when it blocks Coderush's 'ms' template. (and many more I suspect.)

Ok that's it for now. I'll let y'all know how I get on as and when I discover new and cool stuff.

Thursday, July 26, 2007

VS2008 Beta2

VS2008 Beta 2 is available. that's right it's here and this time I'm gonna install it.
Yup the Beta 1 only made it into a VM on my home box. This time I'm gonna just install it. Yeah I know I'm risking it all, but I heard good things about Beta 1 and I assume(yeah I know) that things have only got better. So here I go....

Thursday, May 10, 2007

Add Namespace

I just knocked up a new RefactorPro plugin which uses the refactoring menu to Add a Namespace around a Class, Module or other Namespace
Find it in this thread of the new Developer Express Forums.

Monday, April 23, 2007

I just snapped up Winsnap

In an effort to encourage myself to create some more useful Blog posts and Wiki entries, I have purchased a copy of WinSnap by Alexander Avdonin.I feel this has to be one of the best capture tools I have ever used. It's simple, effective, "does exactly what it says on the tin".

It captures... Screens, Applications, Windows, Regions, Objects and Menus.

It Rotates, Scales, Adds Watermarks and Inverts.

It even adds curved edges to your window shots and it even has a portable edition.

The only thing it doesn't seem able to do is take shots of itself.

It has so many super powers that it must surely be in league with the devil.

Actually some would say it is.... it may not slice or dice but that's because it can hand your little screenshot off to Microsoft's Paint.

I think you'll agree that this is one capable little program.

Oh yeah and it's < 500Kb to download. and the registered edition is only $19.95

Monday, March 12, 2007

Coderush Tip #1: Show References

In CodeRush 2.1.3, a feature called "Show References" was added.In CodeRush 2.1.3, a feature called "Show References" was added.

This feature allows one to 'Tab' through all references to a given variable/method. Simply locate your caret within the token of your choice and hit 'Tab'.
Your caret jumps to the next reference to that token in question.

Hit Shift-F12 (The default 'Show References' keycombo) and up pops the References Tool panel, to show you every reference to the given token in your entire solution.

Go on... Try it with int32 and see how quickly it works.

Now I couldn't leave well enough alone, and deciding that even this was too slow. (Sorry Mark :) ), I resolved to find a quicker way to access this functionality.

It was a very simple idea but one that seemed to gel better in my head.

Basically I changed the keystroke that fires this marvellous facility from [Shift-F12] to [Enter].

To paraphrase something that Mark Miller has said a few times.
Why make somebody push 2 keys when they can press 1?

So if you'd care to follow these few instructions, we'll see if we can't make life a little easier and reduce (by a very small measure) the chances of you suffering RSI.
(Note to reader: Actual chance of suffering RSI may increase as a result of taking this advice due to further addiction to CodeRush and hence coding)

1. First locate the 'DevExpress' menu in Visual Studio and select 'Options'
2. Next locate and select from the tree of options on the left, a branch entitled IDE\Shortcuts.
(Rather than remove the [Shift-F12] keystroke, we'll copy it.)

3. Locate the existing Shortcut in Navigation\References and right-click it.
4. Select 'Duplicate shortcut'
5. Select either the original or the duplicate and alter 'Key 1' so that it reads [Enter] (without brackets).
6. Change the context (the tree of checkboxes in the bottom right) to additionally check the 'System\In Nav Field' context.

7. Click 'Ok'

You're all done

Enjoy

Help your (VB6) Code Shine


One of the reasons that I haven't been posting of late, is down to one Warren Sirota. He is the developer behind CodeShine, a refactoring addin for VB6.

Yes that's right. I said VB6....
Codeshine does not attempt to compete on the same level as RefactorPro. Indeed it does not really compete at all, given that DevExpress have no interest in the VB6 space. (A fact I checked over with both Mark Miller and Ray Navasarkian) but it does manage to provide some of the fundamentals that are so hard to do without once you have been exposed to.

I'm talking about... 'Extract Method', 'Extract Function' and 'Introduce Explaining Variable'.

When I first approached Warren about his software I wanted to know if he had any plans to implement any form of 'Rename' (Local, Parameter, Field) or whether I would get any of the source to CodeShine with my purchase.

Although Warren does not generally share the source to his product, he indicated that we might be willing to collaborate somewhat in light of the fact that I was more that happy to contribute any changes back to the primary source for him to include.

And thus we find ourselves at a point at which I have managed (I think) to have produced a fairly workable 'Rename Var' refactoring which can be used to rename a private field, local variable or method parameter from either their declarations or indeed a reference to said variable.

We are undergoing a period of testing now and this refactoring may well make it into the commercial product. (US$74.95 at the time of this Blog post)

I am very excited to be able to help bring this sort of functionality to VB6.

So if you think this facility might be of use to you or you know someone else who might benefit, send them along to http://www.codeshine.com/CodeShine/default.htm and let's see if we can't help your code to shine that little bit more :)

Sunday, March 11, 2007

I've been gone, but I'm back now.

Ok I've not actually been away anywhere, but I haven't blogged properly this year and, without checking, I think it was at least November before that.

I can't believe I haven't blogged in so long. Well my apologies my dear reader (yes you know who you are :) ). I promise to be more forthcoming with the posts in future.

Look out for posts in the near future on....

CI Refactory: Damn this idea looks good. Jay, I'm downloading as I type this.

CodeShine: Best Refactoring program on the market for VB6 (Yes I said VB6)

CodeRush: The main reason I can't believe I haven't blogged in the last 3 months (That Joost post really doesn't count right?) it that I must have been all of the 5th person (outside of Devexpress ), to have used and loved the new additions to Coderush. (Refactor Pro still has a few rough edges but as always these are on the newer features which havn't had time to bed down yet.) Even though I'm the apparently the slowest person to have pointed out the latest CR goodness, I'm sure there are a few tips I can impart here and there that you might not have heard elsewhere.

So.... On with the Blog.......

Wednesday, February 21, 2007

Anyone out there Joost?

Has anyone gotta spare Joost invite that I could have ?

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.