Ideas for a plug-in for Visual Studio 2k8 - if anyone is interested in OSS'ing this then let me know!
1. Click on a variable and convert it to a with block (probably needs to work on the selection)
2. Organise imports - like the C# one - and can remove anything that is no longer needed
4. Rename that works through to an aspx/ascx page and therefore the .designer files as well
5. Go to declaration on a control takes you to the HTML source
6. Navigate from the code to the HTML designer view
Sunday, December 28, 2008
Lutz Roeder's Reflector suggestions
Ideas for Lutz Roeder's reflector which I'll get around to sending to him at some point:
* Use of the new "If" function rather than "Iif" if VB
* When variable names use reserved words they should be wrapped in []
* When dividing integers the integer divide operator should be used
* In places code generated takes the form of
New XYZ isn't valid - needs to be put into a variable
But that doesn't recreate the correct reversal of code
* use of new construct and set method doesn't seem to work properly - missing the " with " operator
* use of AscW and ChrW rather than char constructor and type conversion
* x = y = 1 construct not translated correctly
* friend property get's incorrectly become get_XXX functions
* catch xyz As Object isn't valid syntax
* Use of the new "If" function rather than "Iif" if VB
* When variable names use reserved words they should be wrapped in []
* When dividing integers the integer divide operator should be used
* In places code generated takes the form of
New XYZ isn't valid - needs to be put into a variable
But that doesn't recreate the correct reversal of code
* use of new construct and set method doesn't seem to work properly - missing the " with " operator
* use of AscW and ChrW rather than char constructor and type conversion
* x = y = 1 construct not translated correctly
* friend property get's incorrectly become get_XXX functions
* catch xyz As Object isn't valid syntax
Sunday, July 27, 2008
Implementing the Office Binary Formats
Microsoft released the Office binary format specification earlier in the year and I'm going through a fair few thousand pages of spec building .Net libraries to read and write the files at the byte level.
Below is an errata which I'll keep up-to-date during the process.
OfficeDrawing97-2007BinaryFormatSpecification.pdf
Various types aren't correct
STD is used as a default but never described
MSOCOLORNONE is used as a default but never described
P44 refers to MSOSRH, MSOPRH, MSOPV and MSOPRV which aren't documented anywhere
P49 says line left style twice but should probably say Line Row Style
P51 wzSigSetupProvId claims to be property 192 but is 1922
P52 refers to msopctSizeNone and msopctPosNone and MSOSRH which aren't defined anywhere
No documentation is provided for the additional line styles' extended color information
Below is an errata which I'll keep up-to-date during the process.
OfficeDrawing97-2007BinaryFormatSpecification.pdf
Various types aren't correct
STD is used as a default but never described
MSOCOLORNONE is used as a default but never described
P44 refers to MSOSRH, MSOPRH, MSOPV and MSOPRV which aren't documented anywhere
P49 says line left style twice but should probably say Line Row Style
P51 wzSigSetupProvId claims to be property 192 but is 1922
P52 refers to msopctSizeNone and msopctPosNone and MSOSRH which aren't defined anywhere
No documentation is provided for the additional line styles' extended color information
Tuesday, May 27, 2008
SQL Server CE 3.5 SELECT TOP
Another gotcha but this time in the dialect that SQL Compact Edition 3.5 uses.
Version 3.5 introduced a couple of new features to make it's SQL more compatible with that of SQL Server and one of those is TOP.
Simple you'd think but oh on - they've decided to use a different dialect for the same command.
In SQL server you write:
SELECT TOP 10 [name] FROM [people] ORDER BY [name]
In SQL CE 3.6 you write:
SELECT TOP (10) [name] FROM [people] ORDER BY [name]
How annoying as it means that the same piece of SQL can't be used without a little translation layer. Why anybody though that wrapping the number of lines in parenthesis was a good idea I'll never know!
Version 3.5 introduced a couple of new features to make it's SQL more compatible with that of SQL Server and one of those is TOP.
Simple you'd think but oh on - they've decided to use a different dialect for the same command.
In SQL server you write:
SELECT TOP 10 [name] FROM [people] ORDER BY [name]
In SQL CE 3.6 you write:
SELECT TOP (10) [name] FROM [people] ORDER BY [name]
How annoying as it means that the same piece of SQL can't be used without a little translation layer. Why anybody though that wrapping the number of lines in parenthesis was a good idea I'll never know!
Shared Folders in Virtual PC 2007
I use Virtual Machines extensively but got caught this weekend with something I've not really found documented anywhere.
I was in the middle of restoring an 18GB Oracle 9i database, and rather than muck up my dev. machine I decided a virtual machine was the obvious answer.
All went well until I tried the Oracle "imp" tool to import the database from a "Shared Folder". It got part way through and complained of a corrupted backup file.
I tried again with a different version of Oracle and the same error occurred.
It turns out that the "Shared Folders" have a limitation on file size like that of FAT which I'm guessing is a 32bit pointer as 2GB seems to be the limit.
The simple answer to the problem is to map a network drive or use UNC but I was quite surprised that the facility of the VM additions failed in such a strange way.
I was in the middle of restoring an 18GB Oracle 9i database, and rather than muck up my dev. machine I decided a virtual machine was the obvious answer.
All went well until I tried the Oracle "imp" tool to import the database from a "Shared Folder". It got part way through and complained of a corrupted backup file.
I tried again with a different version of Oracle and the same error occurred.
It turns out that the "Shared Folders" have a limitation on file size like that of FAT which I'm guessing is a 32bit pointer as 2GB seems to be the limit.
The simple answer to the problem is to map a network drive or use UNC but I was quite surprised that the facility of the VM additions failed in such a strange way.
Saturday, May 17, 2008
Immediacy <head> gotcha
I'm currently doing some Immediacy customisation work using templates developed by an Immediacy partner.
I was getting a very strange effect on one particular page when hitting a search button that did a form post... basically the CSS got lost.
I checked the templates thoroughly and couldn't see the problem but when comparing the page before and after a post I noticed that the lines in the head tag had mysteriously had their "href" attributes changed. It appears that something within the Immediacy page pipeline attempts to "play" with the contents of the head tag and on postback it makes a right mess.
I'm guessing it's to do with the themes support within Immediacy as even on a standard page there are a bunch of injected <link> elements picking up CSS from a handler and what it appeared to be doing on postback was moving the href attributes from elements in the template to the next sibling - I even ended up with <meta> tags with a href's pointing to CSS files!
The solution to the issue is to ensure that the head tag, which normally reads as:
<head runat="server">
Is attributed without viewstate and therefore reloaded from the original ASCX file each time.
<head runat="server" enableviewstate="false">
This has now solved the issue, and on further investigation I found that more than just this one page was being affected but due to the CSS in the template it wasn't quite so obvious. I've simply done a search and replace on all templates in the solution and replaced the head tag as above - problem solved.
I was getting a very strange effect on one particular page when hitting a search button that did a form post... basically the CSS got lost.
I checked the templates thoroughly and couldn't see the problem but when comparing the page before and after a post I noticed that the lines in the head tag had mysteriously had their "href" attributes changed. It appears that something within the Immediacy page pipeline attempts to "play" with the contents of the head tag and on postback it makes a right mess.
I'm guessing it's to do with the themes support within Immediacy as even on a standard page there are a bunch of injected <link> elements picking up CSS from a handler and what it appeared to be doing on postback was moving the href attributes from elements in the template to the next sibling - I even ended up with <meta> tags with a href's pointing to CSS files!
The solution to the issue is to ensure that the head tag, which normally reads as:
<head runat="server">
Is attributed without viewstate and therefore reloaded from the original ASCX file each time.
<head runat="server" enableviewstate="false">
This has now solved the issue, and on further investigation I found that more than just this one page was being affected but due to the CSS in the template it wasn't quite so obvious. I've simply done a search and replace on all templates in the solution and replaced the head tag as above - problem solved.
Tuesday, May 13, 2008
SQL Server Locks
A better alternative to sp_lock with information about the locks in the current database:
SELECT
li.req_spid As "Session ID",
o.[name] AS "Object Name",
i.[name] AS "Index Name",
v.[name] As "Lock Type",
u.[name] As "Lock Mode"
FROM
master..syslockinfo AS li
INNER JOIN master..spt_values AS v ON li.[rsc_type] = v.[number] AND v.[type] = 'LR'
INNER JOIN master..spt_values AS u ON li.[req_mode] + 1 = u.[number] AND u.[type] = 'L'
INNER JOIN sysobjects AS o ON o.[id] = li.[rsc_objid]
LEFT OUTER JOIN sysindexes AS i ON i.[id] = li.[rsc_objid] AND i.[indid] = li.[rsc_indid]
WHERE
li.rsc_dbid = db_id()
ORDER BY
o.[name],
i.[name],
v.[name] desc
Wednesday, May 07, 2008
Huawei E220 USB HSDPA Modem
Finally someone has managed to get the Huawei E220 Vista 64bit drivers working on Windows XP 64.
Hurrah!
Much kudos to you whoever you are.
Hurrah!
Much kudos to you whoever you are.
Saturday, April 19, 2008
Forza 3 suggestions
Well I'm not going to deny it - I'm a big fan of Forza 2 and it's probably been the most entertainment for £40 I can think of.
There's a few things though, that if they make it into Forza 3 will really make my day...
In no particular order:
Enough of me and back to the game - I'm sure there's plenty of other opinion out there and we'll just have to wait and see what Forza 3 brings. Let's hope its constructive towards game play though and doesn't follow GT5's route of only providing eye candy.
There's a few things though, that if they make it into Forza 3 will really make my day...
In no particular order:
- Weather effects
- Lighting effects
- Pit strategy
- Length of races
- Difficulty levels
- Circuits
- Cars
- Damage
The challenge here is not to get gimmicky - PGR 4 actually did a reasonable job of rain but the snow, although fun, isn't really worth the effort it must have taken.
There's two parts to implementing this - the first is the visual effects of water on the cars, the circuits, the spray from cars, the rain itself and of course the darkening of the skies that would add considerable atmosphere to what is a very clinical game.
The second part is implementing aqua-planing and friction against the water in puddles - PGR4's attempt here is a good example of what can be achieved, but with the additional dynamics that are being modelled in Forza surely it could be awesome.
In a similar way that rain would add atmosphere I think that other lighting effects would give the game further depth.
In addition to the obvious one of night races, the time of the day can trigger effects such as low sun glare or mist burning off during a race.
I think what would really make things interesting is something along the lines of a weather forecast for the race adding dynamics such as choosing tyres and pit strategy to the mix.
I believe I've read somewhere that Forza 2 models the effects of fuel use on the weight of the car, possibly even the weight distribution. That's a great piece of physics implementation but it's stillborn in that you have no choice as to how much fuel you're putting in the car.
We've seen that in formula 1, pit strategy has become a huge element in determining who wins - I wouldn't want a game to lose it's driving aspects too much but the choice of only filling to say 75% from the grid and knowing that an early pit stop is required would add to the strategy.
Likewise the pit stops all seem to take about the same length of time - I'd like to see the options as to whether certain damage is repaired and whether tyre changing should be performed and see an appropriate knock on effect on pit time. It would bring into the equation the possibility of "splash-and-dash" pit stops.
I guess looking at all of the above you can see that I'm a fan of the longer races. If it was me designing the career elements I' have added about an extra 5 series, all as long as the endurance races and have some proper endurances races of 4 hours or more.
The 50'ish minute races are well chosen in that an hour is a reasonable time to set aside for a race but the opportunity is missed to have some really long races allowing for far more to happen during the race.
I also can't see why adding addition levels has a great deal of effect on play testing - the addition of an extra 50 combinations of race would surely be an easy thing to do. Maybe each class of car could have 5 or 10 circuits for the endurance races rather than just the one.
The model of difficulty affecting credits earned works well in Forza 2 - I've never found myself with too many credits nor too few.
What I find annoying is that by dropping from hard to easy I only lose 15% of my credits won per race. This could have been changed considerably without affecting the early stages of the game where credits are at a premium. I also find that the "normal" level of difficulty is too closely matched to that of "hard". The "easy" levels can be completed with almost no concentration and in almost any car, yet "normal" and "hard" often require a car and driver of much higher skill. Either an additional level of difficulty or a rebalancing of these would smooth things out. In terms of credits - I'd like to see the levels at -50%, 0% and +100%. That would really make a difference as to which level is chosen.
Oh for more circuits... I guess you can never have enough and at least with Xbox Live there's the possibility of more being added.
I guess there's a high level of effort (and therefore cost) in presenting a new circuit but surely it's worth it. I'd almost go to say that I'd settle for 1st and 2nd grade circuits, differing in how well they've been modelled. Maybe that's where the community could come alive by modelling circuits they have an interest in - initially just from aerial photography but eventually with contours and additional touches such as scenery. There are so many circuits out there that very easily be modelled in outline from Google maps alone.
What's most missing from Forza are the street circuits that have been implemented so well in other driving games such as PGR and GT. I know that it is a game concentrating far more on dynamics than visuals and that's one of the main reasons I like it but there's still something about screaming though an Italian city or through London that appeals. It's obviously possible as the New York circuit demonstrates. I can only assume that the development costs are prohibitive compared to that of a normal circuit.
With over 300 cars we're not doing badly and there's only a few manufacturers that I feel have missed the opportunity to get included.
I'm not sure how the licensing works for cars - I'm guessing the manufacturer has to give permission for the trademarked brands to be included and may even contribute 3d models and technical data to start the process off. From there I guess it's all done from publicly available literature and photographs.
The thing I'd like to see here is far more variants of some of the existing models - the gamer points can still be done my model but surely it can't be that hard to have statistics against different engine options for the same model. Maybe I'm the only person out there, but there is something nice about driving the exact model of car that you own - in the same colour and specification. Something I can only really do with the 350z as it's a popular choice in gaming.
The damage modelling in Forza 2 is a valuable addition that models crashes quite well - I'm looking forward to Race Driver: GRID as Dirt had stunning damage modelling and if they've been able to bring that across Forza will be looking very dated.
More important than just crash modelling for me would be more subtle effects such as those of punctures caused by driving over debris and even flat-spots on the tyres caused by locking the wheels under braking. I don't think these will be hard to model but will add yet another depth of game play. They are also obvious candidates for the rumble in the controller and for the direction tug that's already been implemented.
Enough of me and back to the game - I'm sure there's plenty of other opinion out there and we'll just have to wait and see what Forza 3 brings. Let's hope its constructive towards game play though and doesn't follow GT5's route of only providing eye candy.
SSD performance
Continuing my investigation of SSD performance I've now installed Vista Business 32bit inc SP1 on my Latitude D600 with 32GB PATA Samsung SSD.
The results are a bit annoying... the machine feels much better running Vista than it did running XP and that's something I'm a bit embarrassed to admit to!
I haven't benchmarked it properly yet but so far there have been considerably less stutters that I experienced before and currently experience on the Precision M4300.
Given the 64bit driver problems I've been experiencing (mostly the 3 3G USB modem) I'm very tempted to install Win 2k8 Server on the M4300 and see how it gets on.
I'll be happily living without the Aero interface as I hate it - some of us have work to do - but given that 2k8 is working well on my Precision 690 workstation it's got to be worth a try.
Watch this space where I'll do some more formal performance analysis and benchmarking.
The results are a bit annoying... the machine feels much better running Vista than it did running XP and that's something I'm a bit embarrassed to admit to!
I haven't benchmarked it properly yet but so far there have been considerably less stutters that I experienced before and currently experience on the Precision M4300.
Given the 64bit driver problems I've been experiencing (mostly the 3 3G USB modem) I'm very tempted to install Win 2k8 Server on the M4300 and see how it gets on.
I'll be happily living without the Aero interface as I hate it - some of us have work to do - but given that 2k8 is working well on my Precision 690 workstation it's got to be worth a try.
Watch this space where I'll do some more formal performance analysis and benchmarking.
Subscribe to:
Posts (Atom)