Perfil de PaulioIT BytesBlogListasScraps Ferramentas Ajuda

Blog


13 de agosto

Windows 7, where has my DVD Drive gone?

Just had a problem burning a file to disc, when I rebooted and checked "my computer" the drive had vanished. After checking the Device Manager el al I couldn't find any problems. Then I realised what was happening, it now only shows the drive if there is something in it to read! Gotcha!
 
12 de agosto

Digitally code signing Office VBA macro

Had some fun today with code signing some macro's in Excel. Applying a code signing certificate is very easy, simply go to the visual basic editor, tools->Signing and you're away. The problem is creating the correct type of certificate in the first place.

My sys admins provided with a p7b certificate. So I installed that, but it didn't show in VBs available certificates. So I thought I'd better try and understand what was going on. In turns out that I need a pfx certificate and a p7b is just part of formula for creating such a beast. You need the private key used to create the original certificate together with the p7b;

pvk2pfx -pvk privateKey.pvk -spc codeSignCert.p7b -pfx actualCodeSign.pfx -po myPassword -f

That will challenge you for the password used to create the original certificate but will produce required pfx file. Now just install that and it should be available for signing

09 de agosto

How to install BT Netprotect on Windows 7

After installing Windows 7 I realised I needed to install my antivirus software so off to BT to download Netprotect. However, the download page incorrectly assumes that if the OS isn't XP or Vista then it must be a really old version of Windows - Bzzzt. I first tried to persuade IE to launch in compatibility mode but to no avail. So I donwloaded Firefox, went to the properties, switched compatbiblity mode to run as Vista and downloaded NetProtect - fooled it.
 
 
06 de junho

How to make Vista shutdown when you press the big “off” button

I finally cracked today and had to find out how to change Vista’s default go-to-sleep when you press what looks like the off icon. I’d dismissed the Power Options because when it talks about the, “power button” it literally means the physical power button. However, if you customize the power options and select advanced you can change it…

image

The button then goes a very dark red.

22 de abril

WebDD 09 - a quick blog

Last Sat' I attended WebDD 09, here is my brief summary;

What's New In Silverlight 3? - Mike Taulty
Mike is a good speaker and knows his Silverlight onions so I thought this one would be worth attending even if I have read about the majority of the changes. Overall it was a good session and it's good to see live demos of the changes. One of the demo's failed but Mike was determined to provide an answer why and was forthcoming a couple of couple of hours later (and on his blog).

What's good in .NET 4 and Visual Studio 2010 - Alex Mackey
The idea behind this session was to preview the, "new stuff". However, I came away from this session a little disappointed. I was hoping for some insights but what I got was really a summary from publicly available blogs and CTPs. Still it was ok and it's quite a nice idea for someone to collate these remours into one place but to paraphrase Alex, 'I've not looked deeply at X because it's likely to change' so perhaps this session is too early to watch too?

I want it on that one, that one and that one! And it all needs to be synched! - Andrew Westgarth
Andrew presented the deployments options in II7. I was interested to see the Deploy utility, that seems to be an implementation of a Powershell host, and I especially like the idea of easily keeping production and test sites in sync. However, that was really the interesting part of the session and the rest felt like it was just repeating itself. I think this was probably due to the fact that almost all the demos failed and probably took all the momentum out of the session.

An Introduction to jQuery - Andy Gibson
I took a chance on this one since I have been dabbling with jQuery so I should be beyond an introduction now but I thought I might learn something I'd missed. Overall the session was a decent introduction to jQuery, although since I understand it you'd really have to ask someone who was new to jQuery, and it was reassuring to hear some things I'd guessed at rather than knew for certain.  For a WebDD I would have liked to have seen an intermediate/advance session rather than a introduction.

ASP.NET MVC best practices - Sebastien Lambla
Sebastien provided a witty and interesting session on what was wrong with the out-of-the-box MVC framework and how his teams worked around them. I really liked this session even if the demo gods caused a blue-screen and other demo failures. I just felt he could have quickly introduced the Windsor framework as I could see a number of people were confused by its sudden use but that's only a tiny point. Suffice to say that I've added his blog to my reader

ASP.NET 4.0 - Mike Ormond
Mike is a another MS session stalwart and presented a good session on ASP.NET 4. Although all the nice things about ASP.NET Ajax WPF style binding was good to see I felt like shouting hallelujah at the control provided over Client IDs, something I've been campaigning for on forums. For me ASP.NET is a terrible framework but I concede that v4 looks to finally have started to consider professional developers so maybe I'll be enticed back...maybe.



20 de março

How to read Car number plates in Google Street Maps

Just had a quick play with Google Street Maps and was interested to see how peoples faces and car number plates are automatically blurred. However, what I also noticed is that the blurring only detects such features in the "current" frame. E.g. you see a car and then move towards it, the car is now at a good resolution and the plate is blurred. However, if you move back a step and then use the zoom button you can easily read the plate. So if your car in visible I would recommend you try this trick and then use the report a problem button to ask for it to be blurred (or removed).

11 de março

Tip: Virtual PC slow?

I just discovered that when I remote desktop to a machine that is hosting a Virtual PC and try to use the VM from the "player" then the user performance is terrible. You try to move the mouse pointer and it stutters which results in you spending 10mins just to trying to get the mouse-pointer to click a button! Don't despair there is a workaround. Simply enable remote desktop access to the VM and remote desktop directly to the VM. The UI performance is fine, in fact you wouldn't know it was a VM.
 
24 de fevereiro

RIP IE6, goodbye old friend

To start off I'm not an IE6 hater. Much of what is written today vilifies IE6 but for me it's been a steady, if limited, platform. However, even I concede that it no longer fits the bill. I could second Calling time on IE6 reasons of it's limited CSS support or it's now poor JavaScript performance but the final straw for me is the lack of bug fixes. Sure Microsoft will fix the critical (aka security) issues but anything else it just isn't interested in. E.g. Want to use IIS compression and content-disposition? Yes please, but wait it doesn't reliably work in IE6 :( (Edit: note to Systems Admins, you should move away from IE6 too for the same reasons, the users should have the best experience including decent caching, compression, parsing, rendering and bug fixes - all things IE6 doesn't give you)

So I'm joining throngs of the ivory tower W3Cers and fed up web designers...



Although to balance out the post, Firefox, Safari and Opera can all be royal CSS pains in the....too!


09 de fevereiro

Things to consider when developing with JavaScript

I admit that I'm used to using JavaScript to provide the odd bit of client functionality and to plug gaps with CSS. However, the more complicated script I write the more problems I find with it. So I found this slide show by John Resig to be very interesting (if you get the chance to attend a seminar by him then do so).

The DOM is a Mess @ Yahoo  
View more presentations from jeresig. (tags: dom javascript)

09 de dezembro

Html empty cells and table cell spacing

I finally became frustrated with having to ensure that table cells have some content to make them wok properly and from being hit by the requirement to set the horrible cellspacing attribute so I had a look around the web...
 

empty-cells:show; - see Empty Cells in HTML tables

border-collapse: collapse;

and to stop lines breaking in a table;

overflow

:hidden;

white-space:nowrap;

07 de dezembro

What is the top position of an html element?

I was playing with AJAX Contol Toolkit today and wanted to position a control (ie DIV) at the same position as the control (ie element) however I was suprised to discover that there is no such property, you have to total all the offsets of the elements parents to get the actual position. Fortunatley I stumbled across this...
Find Position which worked a treat.
 
01 de dezembro

Visual Round Trip Analyzer/NetMon not working?

I spent 30 mins today trying to understand why the Visual Round Trip Analyzer (VRTA) or  NetMon wouldn't capture any data. After a lot of fiddling with network settings, Virus checkers and the like it turned out to be something very simple. NetMon has settings about how much disk space you should have free before it automatically stops capturing...yes I've got less than the default 2% free. After changing the setting it started working. Would have been nice if it has said, "automatically stopped, not enough free disk space" or something!

08 de novembro

Goodies from Remix UK

Finally managed to get the download subscription from Remix working, only about a month late! However, getting the correct subscription information was only the first hurdle. Once armed with the information to subscribe to the american site (where the downloads live) I hurried to the download only to discover that although the keys were now ready the download was greyed out. Turns out that it doesn't like Firefox on the Mac (MS sites can really be bad examples of how to write web sites, especially ironic given this is the Expression site). So fired up Vista and tried again. Hurray the download was ready so clicked it....
---------------------------
VBScript: Microsoft File Transfer Manager
---------------------------
There was an error launching File Transfer Manager.
 
If you are running Windows XP with Service Pack 2 or Windows Server 2003 with Service Pack 1,
this installation may have been blocked.  If the gold IE Information Bar is present above, please
click the bar and select the option to 'Install ActiveX'.
 
For additional assistance, please visit the web site https://transfers.ds.microsoft.com,
or contact your help provider.
---------------------------
OK  
---------------------------
Erm ok, played around with the IE settings and no joy. Went the link in the message, 'bad page'. Oh wonderful, I can see this is a really great example of a web site. To be fair there is some info about this in the FAQ page, although I found the easiest solution was to go and download the msi for File Transfer Manager. Once installed things started to work. So I've now finally managed to download a disk full of iso images and a Vista iso mounting driver from http://www.slysoft.com/en/download.html
 
Begin Rant
It appears that Microsoft are trying to learn from Apple, that really was a very painful dowload experience similar to the farce of downloading DRM material from iTunes. But don't worry because we're soon going to be putting all our life into the cloud...<gulp>
End Rant
 
 
 
05 de outubro

Remix UK replayed

Did you miss Remix 08 UK? Did you attend but couldn't decide which session to miss? Well fear not, Remix Replayed is now up and running.
02 de outubro

Francis Bacon, data visualisations and the Turner Prize (?!)

It's been long overdue but finally I managed to get back to the Tate Britain today, and as luck would have it there was both an exhibition of Sir Francis Bacon and the Turner Prize.

One thing that struck me during the tour was how painters reaction to photography was similar to a number of recent presentations about data visualization. E.g. you can take a photo of someone but it doesn't (normally) convey the inner person whereas a painter can show those inner attributes via their particular skill or style but in a way that is often quite foreign to our normal experiences. In a similar way many people are striving to show data in peculiar but compelling way. Oh well, not sure why I shared that but there you go ;)

Ah the Turner Prize. It's all too easy to knock the artists that are nominated for the Turner Prize so it's only fair that before making comment you visit it, so I thought. Hmm, I have to say that I didn't see anything that was particularly challenging or innovative. That's not to say it was, "all rubbish, a five year old could have done it" as I did like some individual items but prize winning? The bit I enjoyed the most was the comment wall at the end of the exhibition. Some were funny, some just venting their anger others asking for the prize themselves based upon the drawing on the comment card. I think the most telling comments were, 'I'll never get that back' and a drawing of the recycling symbol with the word prize in it. Of course I can only hope to earn a tiny percentage of the money those artists will make, so who am I to throw stones? Good luck to them, I'd go for the work about zooming into pictures or the glass sculpture.


 

 
21 de setembro

remix uk day 2

Day 2:
Understanding the ASP.NET Model-View-Controller - Scott Guthrie
The ASP.NET MVC project is a strange one for me. A few months back I read up on it and thought it looked really good but I've not actually had the time to try it out. Scott's presentation was excellent. What I especially liked was the way he showed the warty way of doing something and then showed the simpler method. This is excellent because the warty way makes it obvious what the code is actually doing, whereas too many people only show the nice clean method which makes it far harder to understand what is happening under the covers. Some of the features I haven't seen before were just excellent, the validation messages were really well handled. I'm very impressed by MVC, I don't have a lot of love for the ASP.NET psudeo event model/page life-cycle. Well worth attending the dev-based presentation. 10/10.

Computing power, screens, and networks: Impact on authored content - Tim Regan
Tim was, by his own admission, a little nervous presenting but he shouldn't be. I would group the mobile part of the presentation in the, 'ways to visualize data' presentations with a specific focus on analysing literature. I found it very interesting but since I don't have a need to analyse patterns in literature the specifics are of much to use to me directly. But again it re-enforced my interest in thinking about different ways to present data. Good presentation but some difficult for me to use in my every-day role - 7/10

Beauty & the Geek - The Perfect blend of left & right brain - Conchango
Following in the MS Expression wave of designers & developers working together Conchango shared their experiences. I've worked in this area a bit and it was interesting to hear how they were getting around some of the problems, e.g. no version control for the designer. I thought it was interesting to make someone the owner of the xaml. I was a little surprised to hear that the developer spent so much time in Blend. I think that the separation of Blend and Visual Studio is a great way to ring-fence the responsibility. I agree that Visual Studio does need better basic handling of xaml in the design, at least to be able to navigate around the visual tree and highlight the xaml, but apart from that leave Blend well alone unless you really are a designer! It was also interesting to hear the pair-programming style of working (even more reason for the dev to leave Blend alone) as in my experience there is usually a fair amount of delay between the developer and the designer re-synchronizing their efforts. Interesting presentation and it's nice to hear the experience of others. I think the developer vs. designer jokes are a little weak these days but I can forgive that...oooh get me ;) 8/10

Behind Every Great Site There is Great Data - Eric Nelson
I've had the good fortune to attend a number of Microsoft seminars hosted by Eric over the years, yes I do remember him joining (good grief). Although obviously Eric works for Microsoft but I've always thought his presentations are from the point of view of their customers, i.e. telling us as it is rather than as it should be. To be honest I nearly didn't attend this as I've had some exposure to these technologies and had written some of them as too imature, but I thought it would be good to hear Eric's impression. In this presentation Eric did a good job on untangling the differences between Linq to SQL and Linq to Entities (he has a great diagram for this on his blog) and although I still remain sceptical about the EDM I certainly feel more comfortable understand how keep the path to it open. I would have liked a few min's about where this fits into a n-tier design, e..g where to put the business rules but overall I'm glad I attended. 9/10

Mobile User Experience - Inspiring new ways of design & development - Antony Ribot
Antony talked about the issues of providing a quality and clear interface for the various mobile devices out there. I felt the content was fine but, for me, the presentation wasn't as slick. This resulting in a slightly muddled message, however Antony is clearly a smart person, perhaps a bit of nerves. 6/10

Sneak Peak and end - Paul Foster
A few little demos and adverts and a Balmer-like burst from Paul ;) He did re-enforce the importance of letting people have the time to be creative, something I yearn for in my current post.

For Day 1...




20 de setembro

remix uk Day 1

I've just got back from reMix UK (Mix UK) in sunny (and it was) Brighton. As is my way I thought I'd provide a little mini-review of the event...

Day 1
Keynote: Bill Buxton & Scott Guthrie (and others)
Great start from Bill who gave a passionate talk about the importance of design and user experience, including his personal mantra of, Ultimately, we are deluding ourselves if we think that the products that we design are the "things" that we sell, rather than the individual, social and cultural experience that they engender, and the value and impact that they have. Design that ignores this is not worthy of the name. He backed that up with a great advert from a mountain bike company showing a rider have an exciting ride through a stream but you cannot see the make (or model) of the bike he's on.

Bill talked about Jonathan Ive the designer behind Apple's IMac & Ipod. He explained that he was at Apple during the bad years and it was only when Steve Jobs took over was he given the chance. The important points I took from that are (well it was obvious)  a) the company needs to put design at equal importance as any other part of developing & releasing a product b) you need to free employees' from the n+1 release treadmill and allow them to fulfil their potential. I really enjoyed Bill presentation.

Scott's presentation didn't excite me quite as much, to be fair there wasn't a lot of stuff that was new to me. He introduced folks from ITV and (InnerAthlete???). Again the ITV presentation was all about streaming...again. Ok I can see that it's important to application developers because it helps to increase the Silverlight user-base but for me streaming video is not where the value of Silverlight is. So it was good to see the application side represented by the Athletic training software. Although the application design wasn't my cup of tea.

Overall I would have preferred to leave after the first part of the keynote, but I'm sure for members of the audience who haven't been exposed to Silverlight before then it would have been a great keynote. 7/10

It's not necessary to be understood - Brendan Dawes
As a developer these are exactly the sort of sessions that I attend Mix for. Brendan showed lots of interesting ways to visualize data, although I doubt I could actually use any of them directly it helps me approach showing data in a different way. It also encouraged me to play more with development rather than only create things with a specific business purpose. 9/10

Designing for the Wild: Sketching Experiences - Bill Buxton
More of the same from Bill, with some interesting views about how much detail you put into your early designs and how many proposed solutions you deliver early on. It certainly struck a cord with all too many prototypes making it into a product because they were the only choice rather than necessarily being the best solution. I did feel that Bill didn't offer advice for smaller companies working on much tighter budgets where even if you provide the roughest sketches to a client you'll have burnt too much money and time. For that reason it's not a perfect score. 9/10.

ADO.NET Data Services for the Web - Mike Flasko
Although I tend to avoid the development track I felt I needed to hear a good presentation on ADO.NET Data Services because I felt very suspicious about the use of this. Mike did a good job of explaining it even though it was very similar to previous presentations. I feel I have a much better appreciation of how and when to use it. I still would like more to be said about the relationship with WCF, i.e. I want to switch to a faster protocol than http, how would I do that?  8/10.

Becoming human; smiling like you mean it, & learning to say hello - Denise Wilton
A nice presentation from the Denise Wilton (Graphic Designer & Creative Director of moo) talking about fostering a friendly atmosphere for a site. By actively participating in a "community" the whole experience from the user to the staff fielding calls is improved. I lot of the talk was around community and public sites and was very interesting, perhaps a bit too long a session for the content but Denise is a very good presenter - I liked the humour and the accidental use of some...stronger language as it was heart felt rather than scripted. 8/10
[Edit] Forgot to mention the "canyon of despair" (smells too much like marketing speak for me ;) ) which was a nice way of depicting the difference between a hold-you-hand easy application and an advanced bells-and-whistles application or rather that bit in-between the two where a lot of application want to live.

Day 2...


13 de agosto

Remote Desktop Console feature after Vista SP1

Remote Desktop allows the user to connect to the remote machines Console session. This is very useful is side-stepping some issues with Visual Studio (perhaps they've fixed those now?). However, after installing Vista SP1 I noticed that even though I was specifying the /Console flag I was getting a standard session. Apparently this has changed and you must now supply /admin instead.
10 de agosto

Using Classic ASP to avoid performance problems with ASP.NET Dynamic controls

First off I must admit that I'm not the biggest fan of ASP.NET and you'll often find me accusing it of attempting to shoe-horn an old VB6 style event model to the web. However, I do concede that it is a very good attempt at doing just that and helping to take away much of the plumbing work that was required to write a decent classic ASP application, one of these issues was 'solved' by Viewstate. Love it or hate it viewstate is an easy way to maintain the values of the HTML form elements between post-backs. So everything is Ok then? Well I'm conveniently ignoring the size issues to talk about a common pattern of using a single page and changing the view of the page by using dynamically created controls. Typically the single page has no content of its own but some stimulus, such as the query string, allows the code-behind to create completely different views of data. I'll stop short of saying it's a way to implement MVC/MVP patterns but you could do it.

An Example

So as an example consider creating an application that allows the user to search for employee details, by selecting from a set of criteria. Once selected the user presses the "show me the results" button and the page takes the criteria and displays details. The user can then change the details and update them or move back to the criteria page. So introduces our first problem, what details to display for the employees?

Displaying details that are only known at run-time

Ok so it is a bit contrived, but let's say that the number of text boxes change due to the type of employee. The code runs a fairly expensive SQL query, that takes 30 seconds to complete, in order to discover the employee details to display. But we need to be careful where to run this query in order to correctly construct the controls for ASP.NET to use. The basic part of the page life-cycle to create dynamic controls is in the OnInit override. Here are some snippets, I know there is code in there I've not explained, hopefully later you'll see how I've populated those...

protected override void OnInit(EventArgs e)
        { 
            base.OnInit(e);
            // Add dynamic controls here
            CreateView(); 
        }

private void CreateView()
        {
            if (this.lastView == this.currentView)
            {
                // do nothing, rely on the view state populating the fields
                return;
            }
            // not the same view, so trash whatever went before
           
// (probably nothing yet but just to be safe)
            this.PlaceHolderDynamicContent.Controls.Clear();

            if (this.currentView == 1)
            {
                CreateView1Controls();
            }
            if (this.currentView == 2)
            {
                                      // Warning, expensive discovery query in here
                CreateView2Controls();
            } 
        }

Ok so we've created the dynamic controls, but how do you read the changes the end-user has entered?

Reading changes made to dynamic controls

Leaving the well trodden road of static controls can be tricky, to read data from dynamically created controls in a post-back you must do so after ASP.NET has; a) Create the control hierarchy used to create the previously rendered page b) inserted the values into the controls from the viewstate and post data. The basic place to read the data is the page_load event.


protected void Page_Load(object sender, EventArgs e)
        {
                // Read saved data from dynamic controls here
                SaveLastView();
        }

So we can create a view that was unknown at design time and read the data from those dynamic controls so what's the problem?

Running expensive discovery queries on post-back

As we've seen in order to read the data from dynamic controls we have to help ASP.NET out by creating the initial set of controls during post-back. However, to do that we'll have to re-run that expensive discovery query again. If the user has changed some details then it's an expense we'll have to put up with (or use some other caching mechanism). However, what if the user hasn't made any changes and want to return to the Criteria view? Currently we'd blindly run the discovery query and incur 30 sec hit only to throw away all the controls and create the control set for the criteria...seems a bit of waste. So how can we know that the user has navigated away from view when we can only read the data in the Page_Load, but that happens after the Page Initialize and therefore after we've run the discovery query! Well this is where classic ASP can come to the rescue.

Classic ASP rides to the rescue

The ASP.NET page life-cycle isn't magic, the browser posts data to the server, ASP.NET process the data and transforms it into the event based model. There is lot of smoke and mirrors going on but the underlying process hasn't changed from classic ASP, the Response object still contains the user's posted data. So if we have a navigation control called MyButtonView1 then you can fish directly into the Response object and get the value via Response.Form["MyButtonView1"]. This means that in the Initialize event we can know if the user is navigating away and therefore we don't have to run the discovery query for the details. Hurray all the problems solved? No, what happens if the user has made some changes and then navigated away? I knew you'd ask that. Well this is where it becomes irritating, because you have to write more an more code to support the dynamic controls reaching a point where you may as well write classic ASP from the off. Oh well, here is one way to do this. Add client side OnChange to the dynamic controls that update a single "HiddenFieldNeedsToSave" control, then in the Init you can check this too. So finally we've got a mechanism to support dynamic controls without having to needless re-run expensive discovery queries.

protected override void OnInit(EventArgs e)
        {
            this.lastView = Convert.ToInt32(Request["HiddenFieldView"]);
            if (Request["ButtonView1"] == "View1")
            {
                this.currentView = 1;
            }

            if (Request["ButtonView2"] == "View2")
            {
                this.currentView = 2;
            }

            if (Request["ButtonSave"] == "Save")
            {
                this.isSaving = true;
                this.currentView = this.lastView;
            }
            base.OnInit(e);

            // Add dynamic controls here
            if (this.isSaving)
            {
                CreateLastView();
            }
            else
            {
                CreateView();
            }
        }


 protected void Page_Load(object sender, EventArgs e)
        {
            if (this.isSaving)
            {
                // Read saved data from dynamic controls here
                SaveLastView();
                this.isSaving = false;
                CreateView();
            }
            this.HiddenFieldView.Value = Convert.ToString(this.currentView);
        }

Hopefully I've missed something and some nice person can show me the error of my ways, but until then my way of solving this ASP.NET problem is to turn to classic ASP...or just switch to using the MVC project ;)
   




09 de agosto

Where to add dynamic controls in the asp.net page life cycle?

There are some things in software development that I just keep having to re-read. One such subject that refuses to stay in mind is where in the asp.net page life-cycle should I; a) add dynamic controls b) set the properties of those controls c) read user saved values from those controls. So as an aid-mémoire:

OnInit - Create the dynamic controls. This is the basic place to create controls, without getting into the whole re-loading of the cycle when adding child controls.
Page_Load - read user saved values and set control values. This is used 'cause proving the dynamic controls have already been created (see above) then the viewstate and post-back mechanisms will have loaded the correct user set values.

There, why is that so hard to remember?