Tasty Technology! By Tim Scarfe. Wednesday, November 29, 2006 - 16:11 [#]
Presentation TechnologiesPhil Winstanley posts about presentation technologies. "I think HTML is the easiest for developers to use (think back to the 90's every man and his dog was writing HTML) and that the web is the most comfortable for 99% of users out there, they know and understand the web and how to use it, Windows Applications are much less comfortable to most."
I very much disagree with this. I think it's roughly the other way around i.e. WinForms is by far the easiest and quickest/least extraneous presentation technology. I think DHTML/AJAX is by far the hardest (for LOB apps, we are not counting DX, MDX or XNA) and most extraneous with WPF sitting exactly half way in the middle. We even have a rule of thumb at Dot Net Solutions i.e. "relative to WinForms; DHTML takes 4 times as long and WPF takes 2 times as long to develop". Phil linked to a post by Mike Taulty about Rich vs. Reach I also think this is incorrect. The key point with WPF is that it is both rich and reach i.e. the pitch is this: "In the old days you had to select a presentation technology based on rich vs. reach; now you have WPF - which works in any scenario only drawbacks being it takes two times longer than WinForms to develop and client prerequisites" Mike also omits DirectX, MDX and XNA which are by far the richest (and the hardest to develop in). From Mike Taulty: "It comes up in debates about the various client technologies that we've got kicking around at the moment. I think you can argue as to whether Windows Forms and "WPF/E" should trade places and, also, whether there should really be 3 separate HTML-based entries and, also, Office would be another possible inclusion here as it's a client platform that sits on the screens of millions of users every day so it's very much a real platform."
There does seem to be some confusion on the reach aspect of WPF i.e. we have WPF/e and Xbap. The only differences being feature set and object/embed tag deployment. WPF should not be on any rich vs. reach diagram because it's both. Here is a slide from my DDD3 WPF presentation at Microsoft: Tags: wpf xna aspnet ajax winforms mtaulty directx Sunday, November 26, 2006 - 19:22 [#]
Scoping in JavaScriptOmar posted a few weeks back about when this is not this. i.e. In the anonymous function; "this" will refer to global scope. His solution was this: I sent him a mail about this and may as well spread the love! In the DHTML world of past, this was always the solution. JS is a very advanced language and supports higher order functions/closures. Important to note that in JS the "." (dot/period) symbol sets the scope therefore any function run from a setTimeout etc will run in global scope (by definition). In Omar's example, one function still ran in global scope (highlighted): I liked his solution though; typically I may have done something like this: The problem with closures and DHTML is you inevitably get circular references on DOM objects and your memory usage goes sky high i.e. they are best avoided by using some reference cache and not bothering about scope. Erik Arvidsson is the world authority on this stuff (@webfx.eae.net) (plug). From JavaScript: The Definitive Guide, 5th Edition (David Flanagan): 8.8.4.2. Closures and memory leaks in Internet Explorer Microsoft's Internet Explorer web browser uses a weak form of garbage collection for ActiveX objects and client-side DOM elements. These client-side objects are reference-counted and freed when their reference count reaches zero. This scheme fails when there are circular references, such as when a core JavaScript object refers to a document element and that document element has a property (such as an event handler) that refers back to the core JavaScript object.
This kind of circular reference frequently occurs when closures are used with client-side programming in IE. When you use a closure, remember that the call object of the enclosing function, including all function arguments and local variables, will last as long as the closure does. If any of those function arguments or local variables refer to a client-side object, you may be creating a memory leak. A full discussion of this problem is beyond the scope of this book.
See http://msdn.microsoft.com/library/en-us/IETechCol/dnwebgen/ie_leak_patterns.asp for details. Wednesday, November 22, 2006 - 19:47 [#]
Stopping Skype from opening up your firewallI had a little rant about Skype last week. For those of you unlucky enough to be in a situation where you have to run Skype please run it without administrator privileges using the SysInternals PsExec tool. "C:\Program Files\Sysinternals\PsTools\psexec.exe" -l -d "C:\Program Files\Skype\Phone\Skype.exe" This will give you the following benefits:
Skype opens your firewall up in the worst possible way i.e. for Skype.exe rather than a port (see below). Thanks to Kazi (one of our resident code gurus) for this insight! He also adds these comments (MSN): Kazi says: and i'm sure it opens the ports on router's too via UPnP, but I didn't check it it's clear skype is the biggest security risk today, because you can't filter viruses centrally, because it is a p2p network
Wednesday, November 22, 2006 - 19:00 [#]
Once it was called Sparkle.Then, Microsoft Interactive Designer. Now it looks like they are calling EID "Blend". And making it look pretty hip too. "We all know Microsoft Expression is a set of graphics-creation applications for uses of image composition, interface design and website design, with the names of Graphics Designer, Interactive Designer and Web Designer respectively. So what is Blend? It was clear from the functionality and tools (e.g. timeline editor), this was is Interactive Designer. Therefore, I speculate Blend is the official name crafted by the branding team to make the product hip. Although I think Interactive Designer makes a lot more sense, but when has common sense ever been marketable, right?" No wonder they haven't been spreading the love on the CTPs recently (which is a shame because running Sept CTP of EID made my .NET 3.0 RTM machine go bananas when I tried it). While we are talking about Long Zheng (I love his blog) check out his piece on the Vista multi-dimensional scrolling and Royale Noir, the secret (black) XP theme that we werent supposed to see. Wednesday, November 22, 2006 - 17:17 [#]
Chris Pirillo, Robert Scoble and Open Source.Chris Pirillo Talks CMS found from Robert's blog. Saw this video of Chris Pirillo talking about a new WCMS/Publishing system he has decided to create (yes, yet another web content management system). Needless to say I disagreed with just about everything he said but I was shocked that it would be possible for a passionate technologist such as me to be worlds apart from another guy in a similar space. He kept ranting on and on about open source. He doesn't like WordPress because it's not "open source". Naturally he tries to imply that had it been open source he would have ripped it apart himself and made it better. He is now going to create his own publishing platform because nobody else gets it and he is going to do it better. I don't buy it. Don't get me wrong. He did make the point that most publishing platforms don't support the concept of publishing to many sources of information (and he would like to incorporate that). That's cool. I even decided to make a CMS at Dot Net Solutions and that was based on the concept that publishing content should be as simple as a "publish now" button in your Microsoft Word toolbar. But why can't Chris do it in Word Press (or whatever). I strongly believe in Plug-ins, Extensibility and APIs/Web Services (so does Microsoft funnily enough). This gives you the best of both worlds i.e. good quality, supported software that can still do whatever you want it to do. Software projects are immensely complex. If I was using a product I would far rather it was proprietary anyway because it would install some confidence in me about the quality of the internals, competence of the developers, procedures/methodologies in place during its development, the level of support I am going to get etc. i.e. "Joe Bloggs" hasn't been hacking around with the source code in his bedroom. I strongly believe that good quality software is incredibly expensive to produce and for this reason alone the open source model is disastrously flawed. The average community technology preview that Microsoft releases is of higher quality than the production software of most ISVs or (in my opinion only) a lot of open source software. I wouldn't be in such a rush to put this up had Chris not shown such a disregard for proprietary software (and making throw away comments like "PHP is the path of least resistance"). Flame me all you like but this is a reality check from my point of view (for what it's worth). Tuesday, November 21, 2006 - 00:27 [#]
PowerGadgets Rocks!If you love Powershell as much as I do; stop what you are doing (after reading this entire blog entry of course) and check out the trial of PowerGadgets. "PowerGadgets is a revolutionary new data visualization product that utilizes Windows PowerShell, Microsofts new scripting shell, to allow the creation of Gadgets in Windows XP, Windows Vista, Windows Server 2003 and Windows Server "Longhorn". PowerGadgets requires no complex development environments, servers or browsers to run real-time Gadget components such as charts, gauges and maps on your desktop or in the Windows Sidebar." I discovered it after watching Jeremy Snover (Powershell Architect) demonstrate it during an IIS7 admin Channel9 video. Summing up grossly; PowerGadgets gives you dash-boarding capability from the power you have in PS using several visualization "gadgets":
get-wmiobject Win32_PerfRawData_PerfOS_Memory | out-gauge -value AvailableMBytes -floating Gives me this floating gadget on my desktop: I can even get it to refresh every second, with this extension: get-wmiobject Win32_PerfRawData_PerfOS_Memory | out-gauge -value AvailableMBytes -floating -Refresh 0:0:1
As a side note; there are millions of different styles for these gadgets, even a designer tool to let you create templates which you can reference on the cmd-lets with -template x.pgt How about this one (display of top 20 processes, ordered descending by private bytes): gps | sort PM -des | select Name, PM -fir 30 | out-chart The seriously clever thing is that it can visualize anything you could possibly chuck at it i.e. imported CSV file, objects from Active Directory, the file system, anything! Anyway I thought I would create a simple digital gauge displaying the ping time to www.dotnetsolutions.ltd.uk updating every second. Unfortunately because I was calling into a console application (.exe) I would get an annoying black box flick up every second. #getping1.ps1 $pattern = New-Object System.Text.RegularExpressions.Regex "\d{1,4}ms" $pattern.Match( ( ping ( args[0] +" -n 1" ) ) ).Value #called with ./getping1.ps1 www.dotnetsolutions.ltd.uk | out-gauge So the solution? Well I'm glad you asked! #getping2.ps1 $pattern = New-Object System.Text.RegularExpressions.Regex "\d{1,4}ms" $psi = New-Object System.Diagnostics.ProcessStartInfo "ping.exe", ( $args[0] + " -n 1" ) $psi.CreateNoWindow=1 $psi.RedirectStandardOutput = 1 $psi.UseShellExecute=0 $process = New-Object System.Diagnostics.Process $process.StartInfo=$psi $process.Start() | Out-Null $process.WaitForExit() $match = $pattern.Match( $process.StandardOutput.ReadToEnd() )
if( $match.Success ) { $match.Value } else { $args[0] +" is not responding to ICMP echo requests (pings)..." }
No annoying black box on that one. .\getping.ps1 www.dotnetsolutions.ltd.uk | out-gauge -Template GaugeTemplate.pgt -refresh 0:0:1 You can annotate the gadgets with titles so you know which is which. In Vista the gadgets can even live in the side bar! Thursday, November 16, 2006 - 02:35 [#]
Check Out Photosynth. Now!From: http://labs.live.com/ Today were releasing our first Technology Preview of Photosynth. Photosynth combines hundreds or thousands of regular digital photos of a scene to present a detailed 3D model, giving viewers the sensation of smoothly gliding around from every angle. The scene can be constructed regardless of whether the photos are from a single or multiple sources. Its like a hybrid of a slide show and a gaming experience that lets the viewer zoom in to see greater detail or zoom out for a more expansive view. By viewing the photos in a 3D context you are able to get a better sense for the place where they were captured. Photosynth is a collaboration between Microsoft and the University of Washington based on the groundbreaking research of Noah Snavely (UW), Steve Seitz (UW), and Richard Szeliski (Microsoft Research). To find out more about how this collaboration came about visit our recently updated Video section. Image feature detection and classification has always been a fascination of mine. These guys wrote feature detection algorithms that could take in hundreds of images and extract vertices in 3d space. Combined with a 3d viewer and some cool JPEG2000 powered image deferred loading technology they acquired from a company called SeaDragon about 10 months ago they have created a killer application. Let's take a look at image classification as it is on Flickr now. It's basically tagging and simple meta data like file name, camera model etc. If I take 100 pictures around a town in Rome, I would have to tag all of them as "Rome". However, with this technology, if some one else has already tagged a Rome picture, my images might get tagged automatically. Discovery gets about a million times richer when you have clever classification. I hope the next 5 years will see photo communities get more classification capability i.e.
Microsoft continues to innovate. Only last week they beat Google Earth by adding far more sophisticated 3d buildings to Virtual Earth (and the technology to get all the major cities in the world by the end of 2007 due to a recent company acquisition). The obvious next step is a killer 3d application combining an online community, Virtual Earth and Photosynth. It's an exciting time to be in the industry. Killer, immersive applications like this also remind us that the writing's on the wall for HTML/Web applications as we know them now. Thursday, November 16, 2006 - 01:25 [#]
Live Messenger Problems, Fixed.Several weeks ago I was over at iNNN in Reykjavik, Iceland. While there I made friends with all the developers (seriously cool bunch of guys they are) but was gutted that my MSN/Live Messenger would not receive or send invitations to them. Other than that I have also noticed other strange behaviour with my current contacts. I tried saving my contacts to an XML file using Contacts->Save.. and creating a brand new account. I didn't get too far down this road because Live Messenger wouldn't let me even sign into the new account. It would just say "Signing in" forever. One of the guys at iNNN too said he recently had the same issue and was forced to set up a new account. At this point I got really depressed and assumed the MSN network itself was in a bad state and even started using Skype (I didn't use Skype for long though!). Hope came when I signed into another machine that I hadn't used before the invitations came through and all seemed OK. However on my home and office machine, I still couldn't see the new contacts. I tried using Meebo and that worked too. Next I tried re-installing the Live Messenger client, and that had no effect. It was clearly some corrupt database in my profile area or something like that. I fired up trusty Sysinternals FileMon/RegMon and signed in to see where it was referencing. On the file system side - I found two profile areas used by Live Messenger. C:\Documents and Settings\Tim Scarfe\Local Settings\Application Data\Microsoft\Windows Live Contacts\[email address] C:\Documents and Settings\Tim Scarfe\Contacts\[email address] My first hunch was to delete the contents of these folders and try signing in again. When I did so it just said "Signing in" forever (as with the new account I created). After some trial and error I discovered that renaming the registry entry: HKLM\CU\Software\Microsoft\MSNMessenger\Policies\contacts.msn.com Would allow me to sign in! The strange thing is that I can't find any reference to this key in my Regmon trace but I am quite certain it was responsible for fixing the sign-in problem. I assume this registry key was also responsible for me not being able to sign in on the new account I created too but I haven't verified that yet. With that problem fixed, feel free to come and have an IM chat J Wednesday, November 15, 2006 - 02:23 [#]
QuakeCon 06: John Carmack Keynote AddressThis evening I had the great pleasure of watching John Carmack go into detail about various technical issues pertaining to:
This video really resonated with me and it touches on many relevant issues that are going to become increasingly prevalent in the near future. At Dot Net Solutions we tend to write business middleware and use high level languages and object frameworks. Much of our stuff runs single threaded and when we do multi-threaded apps they're "coarsely" threaded. The kind of parallelism John is talking about (computationally intensive applications) is seriously non-trivial and would soon hit diminishing returns when you ramp up the cores anyway. While some applications spread out nicely over multiple processors; games are usually an example of processing where split items of execution require constant synchronisation. John points out that we can't expect much more brute force performance from processors; and we may only expect to get another single order of magnitude before hitting limits. The near future will see 4 and 8 core processors and contrary to what some non-techie people may believe; it will not mean 4 or 8 times the performance. Not even close. This came at a good time for me because only last week Anandtech posted a great parallelism article about how Valve software are trying to solve this problem in their next game. We had quite the little e-mail thread in the office about it at the time. An interesting paper about programming Threads in C# (Andrew D. Birrell) that Mike Taulty linked to some time back. Multi-threaded programming may seem easy, but it's not. Wednesday, November 15, 2006 - 00:29 [#]
Skype causing considerable network slowdownI got back from work this evening and discovered that my home Internet connection was running very slowly. Considering it's a 10Mb connection I decided it was not due to millions of UK teenagers visiting their myspace.com accounts at the same time. I noticed that there was a hell of a lot of activity through my NIC by glancing at the status panel. Digging a little deeper; I fired up Microsoft
Network Monitor 3.0. I was horrified to see an incredible amount of traffic
to So what process what hosting all this activity, and why? I fired up good old Sysinternals Process Explorer to identify the culprit. I hardly run any non-Microsoft signed images so it didn't take long to track down the offending process. Skype. I have no idea why Skype would hold all these connections open to people out there on the Internet but I was horrified. It's a massive security concern. There is every chance it's just me being stupid but until someone gives me a decent explanation I won't be using Skype again. It's shame because Live Messenger isn't working well for me either right now; for some reason I can't add new people (and some people can't see me, or vice versa). It appears to be an installation problem because on new machines (that I haven't used for MSN) - it works. Damn! Update 15th Nov 18:00I have just done a little due diligence/research on this one. Turns out that Skype is written by the people out of Kazza and works on a peer to peer model. I was only using Skype for IM, not phone conversations or file transfers though. A little bit of Googling pulled up this article about why you may want to block Skype. "The bandwidth used during file transfers or during internet telephony can be tremendous, depending on the amount of usage--and Skype can turn your network into a "Supernode" without your consent, using it as a relay station for calls that do not originate or terminate on your site. The impact on productivity is severe. The reason Skype calls work so well is that it uses "intelligent routing," which sounds like a good idea until you realize what that means: Skype routes calls over the most effective path possible, leveraging available bandwidth from users on the Skype network." Emphasis mine. All I can say is that I hate malware and Skype.exe is the dictionary definition. Update #2 15th Nov 23:00"Security questions have some companies steering clear of the Internet phone service [...] On Nov. 10, Info-Tech Research Group in London, Ont., issued a report under the headline "Ban corporate Skype usage immediately" that cited a litany of potential security risks. " Sean in the office pointed me to another article about this. "[...] be a supernode. This requires that you have a fast internet connection (256kbit upstream or more), your firewall allows incoming TCP&UDP to the port you see (and could change) in Skype options, AND that you run Skype like that for days or weeks continuously without restarting. So if your firewall blocks incoming TCP or UDP part of the day, then your computer does not qualify. In any case, supernodes are elected on demand, and only those with fastest internet connections are elected -- so even if your computer does qualify, becoming a supernode is not guaranteed. A friend of mine tried a while ago, and didn't succeed This actually shows there is no shortage of supernodes in Skype. There is no option to voluntarily become a supernode, as it is best to leave the decision up to automatic network management algorithms.
"[...] be a relay node. Calls and Instant Messages are sometimes relayed over random Skype nodes (in encrypted form, of course, so relay nodes can not eavesdrop). Again you need a fast internet connection, and your firewall must not block incoming TCP&UDP. As opposed to supernodes, there is no special "relay node" status, it's just that your services will be used by those in need when necessary" " When you installed Skype you agreed to let Skype use some spare processing power and network bandwidth (see EULA), although that does not mean that you cannot take actions on your own to discourage your own system from being promoted to Supernode status. It's just that you are not likely to get support from Skype on how to do this because doing so would be against the fundamental philosophy of how Skype was designed to work (from Skype's perspective this is kinda like shooting oneself in the foot)."
"Probably the easiest way to prevent a PC from ever becoming a Supernode is to place it behind a NAT router." From http://www.skype.com/company/legal/eula/ :
Article 4 Utilization of Your computer 4.1 Utilization of Your computer. You hereby acknowledge that the Skype Software may utilize the processor and bandwidth of the computer (or other applicable device) You are utilizing, for the limited purpose of facilitating the communication between Skype Software users. Dan in the office made these comments in an email: "Thinking further this really does bring the whole of Skype's business model crashing down around it. You ask any user are they happy to be a relay, they're bound to say no. The only way Skype gets away with it is because so many people just dont realise (like Tim). It may well have been discussed in techie circles, but Im doubt most users would realise[...]." I don't need to do any more research here. In my opinion Skype is at best malware (on a par with win32 iTunes!) and worst a security/bandwidth nightmare waiting to happen. I'm livid as I feel mislead by their marketing. I have already uninstalled it (along with the hole it poked in my Windows firewall) but actually feel like going out of my way to lobby for corporate policy on Skype usage where we conduct business. Tuesday, November 14, 2006 - 11:24 [#]
AutomationI love rich user experiences as much as the next guy but the problem is their inherent manual, sequential process. If any single item in the process takes a long period of time then it blocks you (the user) from being able to do other things. Like sleeping! Enter Powershell and a raft of good quality command like tools for everything ranging from parity checking/repairing, RAR compression, downloading files, copying files etc. Here was my last nightly powershell script J #move gymnastics vids over to f to save space on g #this should result in 18gig to play with on g
robocopy 'G:\Gymnastics Videos' 'F:\Gymnastics Videos' /MOV /LOG:G:\gymtransferlog.txt /S
#verify all the downloads
sl "F:\transfers\newsgroups\p\" gci | where { $_.Name.EndsWith(".par2") } | foreach-object{ &'C:\bin\par2cmdline-0.4-x86-win32\par2.exe' r $_.FullName }
#extract some things we have space for
& 'C:\Program Files\WinRAR\UnRAR.exe' x "Armin_van_Buuren_-_A_State_of_Trance_273_(DI.FM)_2006-11-02.part01.rar" "G:\MP3\!MP3_ForApproval" & 'C:\Program Files\WinRAR\UnRAR.exe' x "Armin_van_Buuren_-_A_State_of_Trance_274_(DI.FM)_2006-11-09-.part01.rar" "G:\MP3\!MP3_ForApproval"
#we got a bunch of oct trance singles in seperate rar files
gci | where{ $_.LastWriteTime -gt [DateTime]::Parse("13/11/2006 23:06:00") -and $_.LastWriteTime -lt [DateTime]::Parse("13/11/2006 23:33:00") -and $_.Name.EndsWith(".rar") } | foreach-object{ & 'C:\Program Files\WinRAR\UnRAR.exe' x $_.FullName "G:\MP3\!MP3_ForApproval\Trance Singles Oktober 2006 (Vinyl,CDM,CDS,CDR,WEB)" } & 'C:\Program Files\WinRAR\UnRAR.exe' x "house okt deel 1.part001.rar" "G:\MP3\!MP3_ForApproval\house okt deel 1" & 'C:\Program Files\WinRAR\UnRAR.exe' x "House okt deel 2.part001.rar" "G:\MP3\!MP3_ForApproval\house okt deel 2"
#not sure if this little lot got par checked (all 8GB of it...)
&'C:\bin\par2cmdline-0.4-x86-win32\par2.exe' r "F:\transfers\newsgroups\p\Future Of Trance\MorXMXPX3X0001.par2" Copyright Tim Scarfe © 1999-2006. All rights reserved. |