August 3rd, 2007
I'm working on a financial web app that's SSL-secured, and recently on page load, IE6 has been throwing up the mixed content prompt: "This page contains both secure and unsecure items".
This confused me because I searched through the app and couldn't find any URLs with the "http" scheme.
Using Fiddler2 I was able to decrypt the HTTPS traffic (which is quite cool) and I expected to find the request that was causing the problem.
If you have this problem, you may well find that Fiddler gives you the answer. Me – not so lucky. I just got red herrings. It would stop on certain requests and I would think that was the culprit, then next time round it would stop on a different request.
Finally, after much head-scratching and googling I came across the answer: I had IFRAME elements with no SRC attribute! See the Microsoft Knowledgebase article PRB: Security Warning Message Occurs When You Browse to a Page That Contains an IFRAME Through SSL
If you set the SRC attribute dynamically, or modify the contents of the iframe on-the-fly, just make sure you assign an initial dummy or javascript SRC in the markup and you troubles will disappear. See the example blow:
HTML:
-
<iframe id="myIframe" src="javascript:false;"></iframe>
I hope this helps.
Posted in Development, Web Dev | 1 Comment »
June 21st, 2007
I upgraded from NUnit 2.2.9 to NUnit 2.4.1 and while there is all sorts of new goodness added (much of which I don't yet use) I am quite disappointed in performance. The actual speed of each test hasn't changed, but it takes longer than before to start running the tests and, more annoyingly, it takes an age to close the form. This is quite a hindrance because, I really want to be able to switch quickly between running/debugging a test and then modifying the code. Obviously, this isn't possible when it takes 10-15 seconds to close! Hopefully, this will be fixed soon or I will probably revert back to a previous version.
Apart from that, a minor enhancement, which I applaud, is the adding of symbols to the test result icons. They're not sexy, but they help those of us who are colour-deficient (those yellow Assert.Ignores could easily hide amongst the greens).
Posted in Development | 2 Comments »
May 3rd, 2007
This is just a test. If this works it'll mean I can just type my blog posts in word and publish to WordPress. That would be pretty cool – I mean at the rate I post it'll save me about 2 minutes every three months.
It claims it'll also upload pictures. Now this I've got to see…
Pretty impressive! (and these image formatting tools are certainly an improvement over Office 2003).
You can also tag your posts…the categories are all pulled down from the blog.
Okay, enough of the image effects already.
Well I'm impressed. It actually works. Now there's no excuse not to post…
Â
Posted in Personal, Software | No Comments »
February 21st, 2007
As a photography enthusiast (albeit a shamefully inactive one) I am incensed by the notion of restricting photography in public places. According to Simon Taylor, there are moves afoot in the UK to do just this and so he has started a petition against it.
As it turns out, there is no actual Bill being put forward by the government. Mr Taylor is referring to
the ID cards proposed by various bodies which will serve to create an 'uber class' of photographer, and restrict the use of cameras by normal citizens.
The fact that there is no legislation in the pipeline has not prevented me from signing the petition. I have personally been harassed by security guards for taking photographs in the City of London with a tripod. It angered me that I was allowed to use my camera hand-held, or indeed to support it on a wall with a beanbag - but that the use of a tripod was prohibited. I believe that anyone should be allowed to take photographs of any public place - regardless of whether they use a tripod to steady the camera!
If you feel the same and you live in the UK then perhaps you should sign the petition too:
http://petitions.pm.gov.uk/Photography/
Posted in Development, Personal, Photography, Politics | No Comments »
February 13th, 2007
I was writing some ASP.NET authentication code last night and was trying to encrypt an authentication ticket using FormsAuthentication.Encrypt(). However, it kept returning null. I banged my head against the wall for about an hour and then went home. As so often happens, I came in in the morning and spotted the problem immediately: the authentication ticket's user data was null. Doh! I had only put null in there for test purposes!
C#:
-
FormsAuthenticationTicket authTicket =
-
new FormsAuthenticationTicket
(
-
1, // version
-
"stu@me.com", // email
-
DateTime.Now, // creation
-
DateTime.Now.AddMinutes(60),// Expiration
-
false, // Persistent
-
null); // User data (TICKET WON'T BE ENCRYPTED IF THIS IS NULL)
-
-
string encryptedTicket = FormsAuthentication.Encrypt(authTicket);
Posted in ASP.NET, C#, Development | 1 Comment »
February 5th, 2007
I went to WebDD on Saturday. It was quite an interesting event, indeed.
I attended several interesting sessions; from HTML microformats, to Ruby on Rails, to WPF and Microsoft Expression Blend.
Scott Guthrie was the man of the day: large throngs of developers vied for seats in his sessions. His talk on WPF/E was extremely interesting. He was bombarded with questions from all of us and, while he obviously had to "chest his cards" about Microsoft's strategy, he did drop a few hints.
Things I took away from the session include:
- WPF/E is currently cross-platform (Windows and Mac OSX) and cross-browser (IE, Firefox, Safari). Linux isn't currently supported because a) there are so many different distributions, and b) although Linux has a lot of penetration on the server market, it doesn't have a big client presence; WPF/E is obviously a client technology. However, MS will support a Linux version in future if there is significant demand for it.
- Right now you can only use JavaScript with WPF/E and it doesn't support layout management and other advanced controls - however this is going to change as WPF/E will be getting a version of the CLR and some of the .NET Framework. So we be able to use C# in Safari!
- Following on from that, and reading between the lines a little: expect the .NET Framework in general to pitch up on Mac OS X. In my opinion, this is the single most exciting development of the century. Yes, forget the breakthroughs in stem-cell research and cognitive neuroscience: Microsoft is committed to going cross-platform. I've been waiting for this news since I first saw the promising Environment.NewLine property (which claims to return 'a string containing "\r\n" for non-Unix platforms, or a string containing "\n" for Unix platforms.')
- WPF/E isn't hardware accelerated - it's software-only. So there is no 3D support in WPF/E. However, Scott's cheeky grins and evasive diplomacy seemed to indicate that in a future rev we could expect hardware acceleration and all the wholesome goodness that comes with it.
The session was recorded, and will be available online - but no link as yet.
The day ended with drinks at a bar and a "geek" dinner which was enjoyable and great for networking. We've gotta find a better name for these "geek" dinners. I'm sure I'm not the only developer who doesn't like to think of himself as a geek. How about Dev Dinners? 
Posted in C#, Development, Events, WPF, WPF/E, WebDD | No Comments »
October 6th, 2006
I always forget the binding flags needed to reflect over properties in .NET. So this is mainly an aide-mémoire for myself.
C#:
-
PropertyInfo
[] props =
typeof(MyType
).
GetProperties(BindingFlags.
Instance | BindingFlags.
Public | BindingFlags.
NonPublic);
I ALWAYS forget that you need to include the BindingFlags.NonPublic flag!
Posted in C#, Development | No Comments »
October 3rd, 2006
I read an interesting article today about Java EE dying in an SOA world. I know a lot of people complain about its complexity but I was surprised to read the claim from a senior analyst with the Burton Group that
In five years, Java EE will be the CORBA of the 21st Century.
In my opinion, the community-driven development of the Java stack has always seemed pretty cool, if only from the perspective of democratisation. Granted, Microsoft have become a lot better in involving the community in the last few years, but as a developer who has spent much of his time in the Microsoft stack, I have sometimes felt a little disenfranshised by the top-down, "eat-what's-on-your-plate" approach to the development of the platform. However, this centralised control has provided a major advantage: a more coherent and less complex platform than one "designed by committee".
I think .NET is great platform with good prospects in the SOA world. JEE maybe dying. But Java will still thrive. And I'm very positive about that. I really like the way the whole industry is going: several stacks to choose from and, with a bit of work and a bit of luck, they'll all play nicely together.
No need to port code; just port messages instead.
Posted in Development | No Comments »
September 2nd, 2006
I stumbled across this video of Microsoft PhotoSynth from Microsoft's Live Labs. It's probably old news for some people, but I was just blown away by this concept.
According to Blaise Aguera Y Arcas, an architect at Microsoft Live Labs:
You can think about what PhotoSynth does as linking images together. Whenever photographs are taken in a common environment it's as if you form a hyperlink between them. And so now, if you think of the emergent network of hyperlinks between images that can be built by, a crawler, say, going out and searching the whole web: that's a very powerful idea.
Powerful indeed! PhotoSynth uses image recognition software not only to identify related images, but to place them in a 3D space relative to one another! Throw in some awesome 3D graphics capabilities and you have a very immersive way of browsing that space.
In the videos they talk about how your personal photo collection can become a "worm hole" through which you can access other similar photos. So for example, one thing you can do is take one of your own shots, and then, if you wanted to get a closer look at something in the shot you could zoom into someone else's close-up photo of the same scene. Or you could find out what is next to your photo - or what is behind it.
What a compelling offering: Photographs + 3D world +The Network Effect.
You have got to check out the videos! Watch the overview first (the link at the beginning of this post), then the demo video (which can be downloaded from here).
Posted in Photography, Software | No Comments »
August 31st, 2006
I tried to uninstall SQL Server 2005 Developer Edition today and was mortified when, halfway through the uninstallation (is that a word?), "SQL Server setup encountered an error and needs to close"! I got a sickly, sinking feeling in my stomach - my immediate future was devoid of fun. After all, I needed to re-install it again so I could do some work.
A second (and third) attempt failed too, and each time I desperately opted to "tell Microsoft about this problem", in the irrational hope that it would wake someone up at Redmond and that they would slide down an emergency fireman's pole into the crisis and emergency centre and contact me immediately with a special fix.
Of course, no contact was made. So I rummaged through log files and scoured the web, but couldn't find any relevant information. The error in the log file was:
Error: Action "ReportChainingResults" threw an exception during execution.
One or more packages failed to install. Refer to logs for error details. : 1612
Error Code: 0x8007064c (1612)
Windows Error Text: The installation source for this product is not available. Verify that the source exists and that you can access it.
Eventually, I managed to get around the problem. This is what I did.
In Add/Remove Programs:
- Uninstalled SQL Server 2005 Samples
- Uninstalled SQL 2005 Mobile Dev tools
-
Then, instead of uninstalling SQL Server 2005, I opted to "change" it.
- When the component selection list came up I selected Workstation components (there were no instances anyway!)
- After the system config check, I selected "Change Installed Components" and made sure everything was set to "Entire feature will be unavailable". Next, next, etc and BINGO! It worked!
Then all I needed to do was uninstall some of the other thing in Add/Remove Programs, like backwards compatibility and native client.
I hope this helps some other poor sod.
Posted in Development, SQL Server | No Comments »