Monday, January 7, 2008
New blog location
Monday, December 31, 2007
WPF Training video library
Meet lynda.com - very nice learning resource with free WPF Training videos.
Sunday, December 30, 2007
Time tracking solutions are the must
A couple of unfortunate misunderstandings with clients will teach you to track the hours spent on solving their problems. Save yourself some trouble and take my word - you'll need tracking, but if you sure you don't, sometimes it's nice to have a track of hours spent on different activities.
Take a look at Toggle, it's free and it does a lot of great things like:
- Live tracking
- Workspaces
- Teams and permissions
- Clients and projects
- Reports
- and the most important - it's Internet-based so you can share the tracking between the different workstations where you work on the projects.
Saturday, December 29, 2007
Announcing the PopSci.com/Bug Labs Build-a-BUG Challenge
You have a chance to win BUGbase and the first batch of four BUGmodules - the open, modular consumer-electronics hardware and Web-services platform that you can use like Legos to build practically any gadget you can dream up.
Join the PopSci.com/Bug Labs Build-a-BUG Challenge. More information can be found on the PopSci.com.
Thursday, December 27, 2007
PocketPC phone usability horror story (Verizon XV6800 review)
I'm a Verizon member not by choice but by "no choice at all". Like in: I don't have any other choice of a provider in my house. T-Mobile, ATT nor others have any acceptable service level in my house. I think, mainly, because my close proximity to Newton and Brookline. This article will not be about Verizon's service and support (I have a lot to say here) and not about the worst choice of the devices between all the providers out there, but about my user experience with the mobile communicators that I've had recently.
I have a corporate phone/communicator and using it a lot to reply to my office e-mails. As you know it's not easy to type on keyboard that has tiny buttons, like Treo or similar. The best keyboards out there are on Blackberries (it's a shame Symantec doesn't use them) and on a slide-out keyboards of the HTC devices (or alike). So, being an forced Verizon customer, I had no choice by to chose HTC XV6700 as my communicator.
This is when my nightmare began. The exterior design of the phone looks nice until you start carrying it with you all the time. Since the joystick is sticking out, the carrying case starts to control the phone. Yes, literally.
The phone was calling other people on it's own, answering phone calls without asking me, adding appointments and deleting calendars, etc, etc... It was like the phone was leaving it's own life. And the worst of all - when the phone call came it was hanging (to the point of soft reset). A total nightmare ...
So, after talking to Verizon, I got an OK to replace it. With what? That was my main question. I had no alternative, but to wait. I've suffered for more than a year (from Jun/2006 to Nov/2007) and, finally, had a chance to replace the phone to it's successor XV6800.
Overall impression: the phone is better than it's predecessor but not drastically. It has more memory, I should give it that, but the usability was not improved. Actually it has improved in the joystick area and became worse in others.
Joystick is not sticking out as it was before, but the buttons on the sides of the phone are soft. Every time you'll want to pick the phone out of the pouch - you'll 100% press one of them.
The biggest design flaw of this device, as I see it, is a headset adapter cable. There is no headset outlet on the phone, so if you'd like to plug-in one, you'll need an adapter. It's a thick cable 4-5 inch long with huge plugs that will be sticking out of your phone while you're walking - horrible view and very inconvenient. Be very careful with this adapter, it's easy falls off the phone and it's small enough to be easily lost, BUT... you can't find a replacement in any of the stores nor online.
All said above is not even begins to convey how bad is the Windows Mobile usability aspect of BOTH of the devices. Let's start from the worst part:
- It's impossible to make the phone to auto-lock. So, if you want to lock the phone, you have to go to "Today" screen and press the lock button ON THE SCREEN. Yes, it's not a hardware button. There is no way to assign a hardware button to this action.
- It's impossible to turn the screen off while the device continues to work. I need it every time when I start a media player and put the device in a pocket or in a pouch. At this moment the phone is prone to accidental button and screen actions.
- The phone turns on once in a while. It's fine with me, but, at the same moment, the screen and the buttons are activated. So... you get my drift (all from above applied here).
- The phone synchronization is a nightmare. ActiveSync is very unreliable, self enclosed, rigid and impossible to make it do what you need. This is not a stone into the XV6800 backyard, but it adds cons to the whole experience.
I can go on an on, but, I think, I've said enough.
To conclude the story, I'd like to say that, to my taste, the whole user story is not completely backed and we're still in a very deep deep Beta of the product. Under the product I mean the device(hardware) + software(OS). At this moment it looks like there is no common team that owns such product. There are hardware companies that create the hardware and Microsoft, that have fun creating an software for an abstract device.
So bottom line I have a very bad user experience with this device. I'm looking forward to the next Windows Mobile release and hope the things will change to the better.
Tuesday, December 25, 2007
Let's give a Windows Live Writer a test run
I've decided to try WLW for a change. This is a test post.
Amazingly - it works !!!
Let's see how the code coloring will work:
1: private void Window_Loaded(object sender, RoutedEventArgs e)
2: {
3: WebBrowser wb = new WebBrowser();
4: wb.Navigate(System.Configuration.ConfigurationManager.AppSettings["Feed"]);
5: windowsFormsHost.Child = wb;
7: }
And it looks like the code should be pasted as HTML. Hmm... not a lot of help there.
And pictures? It looks like they are working via Picasa Web Albums. You're getting a free 1Gb storage account there with your Google account.
So have fun with this new blog editor !
Monday, December 24, 2007
Integrating Web Browser with WPF Forms
There are so many situations where you need to render an HTML in your forms. It may happen when you'd want, for example, to show an external web page, feed or a locally generated content like XML or an HTML. The Web Browser is extremely handy for the Web Automation (I’ll talk about it in future posts) since you have full HTML DOM available for control at your fingertips. So, having WPF now out there is not changing a thing – it’s still possible to host Web Browser inside a form.
Look how easy it is. Let’s say you want to show your blog on an application form. To do so:
- Create a WPF application with a Form.
- From the toolbox drop a WindowsFormsHost on the form. Give it a name, let’s say, “windowsFormsHost”. Make sure that the references to the WindowsFormsInteroperability and System.Windows.Forms were added to your project. To make a better presentation make the Margin = 0 – the control will fill in all the available form’s space.
- In the XAML source add “Loaded” attribute with “Window_Loaded” value to the
tag. - Add the following code to the Window_Loaded handler in the .cs file:
1: WebBrowser wb = new WebBrowser();
2: wb.Navigate(ConfigurationManager.AppSettings["Feed"]);
3: windowsFormsHost.Child = wb;
Build, run and enjoy!
Source code can be found as usual on my site.
Sunday, December 23, 2007
RSS is not only for the news
The new Syndication libraries, provided in the .NET 3.5, making creation of the RSS feeds a walk in a park. By combining them with the power of the WCF you can get an amazing results.
RSS technology allows you to reverse the client/server tandem from push to pull paradigm. Instead of client sending data to server you can publish the available data and make server to decide what to pull(download) and what to ignore, This can save a lot of valuable resources like time, network bandwidth, data transfer and processing.
To make my case more interesting and appealing let’s imagine a situation where you want to make a back-up agent that will be archiving all the text files. In order to do so, all the desktops will publish all the newly changed files that need to be archived. The server will subscribe to all the relevant feeds. In this article I’ll cover, for starters, only the client’s side and in the following articles we’ll talk about different discovery and subscription mechanisms that we have in our disposal in .NET for the server.
The following snippet shows you how to create s simple syndication feed:
1: SyndicationFeed feed = new SyndicationFeed();
2: List<SyndicationItem> items = new List<SyndicationItem>();
3: ...
4: SyndicationItem item = new SyndicationItem(title, path, GetFileUri(path));
5: items.Add(item);
6: feed.Items = items;
As you can see it’s extremely easy, but this was just a half of the job. The other half is to publish the feed. There are a lot of ways to do it, but I’m going to cover one of them. Since WCF is one of the best things to use in windows services (as well as in Web services), I’m going to use it to publish the feed. Here how you will initialize the WCF host with the Feed Service as a singleton (single-instance):
1: FileChangeFeedService service = new FileChangeFeedService();
2: ServiceHost serviceHost = new ServiceHost(service);
3: serviceHost.Open();
Note: don’t forget to mark the service class as a single-instance service by adding ServiceBehavior attribute –
1: [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,
2: IncludeExceptionDetailInFaults = true)]
Announce: I’ll be talking about REST in the following posts as well as a new “Give it a REST” presentation is ready for broader public to attend.
One of the beautiful things that became available with .NET 3.5 is Url templates. This allows to put HTTP verbs on the methods of a web service as well as to map the Url parts (not only parameters) to a method parameters. This in many cases will eliminate any need for parsing of the data. All the mentioned above, make the WCF Web Services REST compatible.
For example:
1: [OperationContract]
2: [WebGet(UriTemplate = "?format={format}")]
3: SyndicationFeedFormatter Feed(string format);
This contract method will be called if a web request will come to the following URL:
http://localhost/feed?format=rss
The format parameter (“rss” in our case) will be extracted from the URL and passed as a parameter to the Feed method. This allows us to seamlessly provide different feed formatting (thanks to the new WCF libraries):
1: public SyndicationFeedFormatter Feed(string format)
2: {
3: if ((format != null) && (format.ToLower() == "rss"))
4: return new Rss20FeedFormatter(feed);
5:
6: return new Atom10FeedFormatter(feed);
7: }
Note: if no parameters will be provided (i.e.: http://localhost/feed) the Feed method will be called with a NULL value.
And here is what will glue everything together – the config file:
<configuration>
<system.serviceModel>
<services>
<service name="FileChangeFeed.FileChangeFeedService">
<endpoint address="http://localhost:8080/feed" binding="webHttpBinding"
bindingConfiguration="" contract="FileChangeFeed.IFileChangeFeed" behaviorConfiguration="webBehavior" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="webBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
Note the endpoint behavior. As you can guess the feed can be published over any protocol, but if you’ll want to view the feed using standard RSS feed readers, it’s better to publish it over HTTP.
As soon as you’ll start the application and the service will be published – put the base Uri (http://localhost:8080/feed) in IE’s address box and you’ll see a rendered RSS feed view.
Have fun with RSS feeds and don’t be afraid to explore your possibilities.
The source code can be found on my site.
Monday, December 17, 2007
Spell checker for HTML, ASP.NET, JScript, VB, C#, CSS and C++ for Visual Studio 2005 and 2008
Wednesday, November 21, 2007
Part 2 - Securing Server with SSL
It's not a walk in the park to work with certificates. There are a lot of bells and whistles to it than it meets the eye, but I'll try to walk you through this nightmare step-by-step in the set of the following posts. But first, I'll show you how you can jump-start your development and encrypt your traffic with some hand-made and self-issued certificates.
There are a lot of ways to self-issue a test certificate, but I'm going to share with you the EASIEST one I use myself. Follow these simple steps, one by one, to create a test certificate:
- Create a root certificate:
makecert -pe -n "CN=Igor Cert Authority" -ss my -sr LocalMachine -a sha1 -sky signature -r "Igor Cert Authority.cer"
If you'll run the MMC console with Certificates Add-in (Computer Account/Local Computer) and navigate to Certificates/Personal/Certificates node, you will see that the "Igor Cert Authority" certificate already installed: - Create a certificate for the encryption purposes:
makecert -pe -n "CN=myhost" -ss my -sr LocalMachine -a sha1 -sky exchange -eku 1.3.6.1.5.5.7.3.1 -in "Igor Cert Authority" -is my -ir LocalMachine myhost.cer
Note: the best way to use your machine's DNS name in all the places I've used "myhost"
If you'll refresh the MMC console with Certificates Add-In - you'll see that the new "myhost" certificate will be configured for you as well.
The result of the exercise above is the "myhost.cer" file that you can use now to encrypt your communication.
For the sake of this demonstration, let's use the NULL SMTP server I've put together. This server will receive all the incoming SMTP requests and will process them as if it's a real SMTP server. The server will encrypt the incoming communication with the certificate that was created in the steps above.
- Create a certificate object from the CERT file:
1: X509Certificate serverCertificate = X509Certificate.CreateFromCertFile("myhost.cer");
- As soon as the new client connection is established - encrypt the stream with this certificate:
1: TcpListener listener = new TcpListener(IPAddress.Loopback, port);
2: ...
3: TcpClient client = listener.AcceptTcpClient();
4: ...
5:
6: // Create the SslStream using the client's network stream.
7: SslStream sslStream = new SslStream(client.GetStream(), false);
8:
9: // Authenticate the server but don't require the client to authenticate.
10: sslStream.AuthenticateAsServer(serverCertificate, false, SslProtocols.Tls, false);
In order to test the server, I've used the Outlook Express (it is in most cases installed by default on every machine). Don't forget to tell the Outlook Express that the communication should be secure (note the check box in the Outgoing SMTP mail section):
After the configuration is complete - have fun by sending e-mails. The sever will process all the outgoing traffic over the encrypted channel:
You can download the source of the NULL SMTP Server from my site - here.Tune-in for the upcoming set of articles that will show you a lot of new and cool staff.