Tech Blog


 Click here for RSS feed

iPhone  - 7/12/2008

It was released in Spain yesterday, and I managed to pick one up today. The best way to describe it, is "it just works!". The really know their stuff on user experience. I'm really impressed.

Comments ...

I've given up on Firefox  - 7/9/2008

I've been using Firefox for a long time now...longer than I remember, and before that I was using other NON-IE browsers. Why? Because of the security issues that IE. With the appearance of Firefox and it´s  cool features, and more importantly support for plugins, it grew on me. However, I've always had to launch IE because some sites just wouldn't work. It's not Firefox's fault, it's the site's fault. It's not designed to work with browsers other than Internet Explorer. Some of these sites I use frequently, such as online banking, and now recently Sharepoint and Microsoft Exchange Web Access. Things just don't work.

I've put up with it until today. I finally uninstalled Firefox. I made the terrible mistake of installing Firefox 3.0 a couple of weeks back when it was released and I must say, I'm very disappointed. Great looking skin, but in terms of stability, it's just not there. I get at least 10 crashes a day and I'm just tired of it. So for now I've gone back to IE 7 which is decent enough, and although I'll miss many of Firefox's features, at least I don't lose time or work.

Maybe someday...


Comments ...

MSTest "Not Executed" Error  - 7/8/2008

I'm testing out a new IoC container framework (more on that later), and so I decided to setup some tests to see how it works. As a "newbie" to MSTest (MbUnit / xUnit rules!), I wrote my tests, tried to run them and was presented with an error message:

Failed to queue test run 'Hadi Hariri 2008-07-08 10:06:31': Test Run deployment issue: The location of the file or directory 'd:\.....\someAssembly.dll' is not trusted.

Now D is my local drive, so go figure why suddenly an assembly I reference on my local disk is not trusted. Wel lit turns out that Vista, in all it's glory (I have a love-hate relationship with Vista, I love hating it all the time), decided to block this assembly and all other files I extracted from a zip file I downloaded.

So if it happens to you, go to the assembly and unblock it. And of course, this is not something you can do by selecting multiple files at once. No, that would be WAY too dangerous! You need to do it one by one. Alternatively, delete the whole folder, unblock the zip file and then extract it.

Comments ...

Outlook doesn't suck after all  - 6/3/2008

For the past couple of years I've had many problems with Outlook, but mainly one big problem: "The Data File did not close properly....." message that kept popping up every time I would close it down, reboot, restart, shutdown, go away, whatever...

In the past I've tried various mail clients, including but not limited to The Bat!, PocoMail and recently Thunderbird. In regard to The Bat! it is probably the most productive mail client that exists. It's extremely powerful (built in Delphi), yet it lacks two important things: a decent calendar/task list, and sync with PDA's. Keeping two contact lists is a PIA. So that's discarded. My experience with PocoMail/Barca (also built in Delphi) was limited and just didn't *do it for me*. I decided to try Thunderbird a couple of weeks ago, sick of Outlook. Found a Calendar plugin (Lightening) that was pretty decent (despite it's bugs) and away I went. Yesterday I switched back to Outlook.

Why? After several weeks of using Thunderbird, I gave up. Thunderbird is not a bad software but the developers have completely forgotten what usability is all about. There are some standard things that just don't work the way they should. Sure, I can run about:config, but why the hell should I have to? Don't make configuration options in a nicely designed dialog for stupid little things and then the basics leave hidden away. Lightening (which is Sunbird a la plugin) also has some really annoying bugs (like times not getting registered unless you EXPLICITLY LEAVE the edit boxes before saving).

So I kept going back and forth, and for a couple of years decided to stick with Outlook. It's integration with various applications is very time-saving and flexible. It's calendar is pretty decent and on the whole I'm happy with version 2007, except for this data corruption problem. I decided that after two weeks (and just before my trial ran out on BirdieSync) to give Outlook another try. So low and behold, yesterday I set out on a venture to try and find my problem with Outlook [for those with short term memory problems: Data File corruption].

Many people have reported that it's because Outlook doesn't close even after the window disappears, and resetting the machine causes corruption. That's true to a certain point, except in my case I can close Outlook, wait for it to close down entirely, open it up and get the data corruption each time.

My next bet was TrueCrypt, yet I couldn't find anything about this on the web, and I was NOT about to give up TrueCrypt. I had also heard rumors about AVG, but again, something I doubt. Then while going through the list of plugins installed in Outlook, it struck me. Could it be Google Desktop? I decided to uninstall the plugin, and since I mostly use GDT for Outlook search, I removed it entirely from my system. As of yesterday, all my data corruption problems seem to have vanished. Not only that, but my other problems with Outlook are gone too. No more taking up 100% CPU when checking mail, no more frozen Windows and no more slow operations. In fact, it's really fast now, considering my archive folder is 1.5 GB and my main one is crawly to just under 600 MB.

So now I have to find a replacement for GDT. Any suggestions? And no, I won't install Vista  (or Windows Desktop Search). The damn thing doesn't even work. I get better results with a dir /s when searching for a simple file.


Comments ...

Silverlight, Linq, Xml, Intraweb, Ajax and REST  - 6/1/2008

I've updated the support for Silverlight in Intraweb to support the changes for the Silverlight 2 beta that has recently come out. To test the new functionality, I decided to put together a demo that shows how to not only use Silverlight controls, but to also interact with them using Intraweb. I then decided to take it one step further and use Intraweb as a service to provide data to the silverlight control.

Here I had two options: use Intraweb as a SOAP server, something that can be done very easily using Arcana's Elite Suite (now open source and available here) or use REST. I decided to choose SOAP so that I could show how easy it is. Unfortunately it didn't work. Not because Intraweb failed, nor did Arcana's components, but Silverlight did. It turns out that Silverlight has issues with certain web services.

So I had to opt for using REST, which in fact is good because it shows the simplicity and beauty of this architecture, where we get rid of the SOAP overhead. With
Intraweb, implementing a REST service is extremely simple. All that is required is to process the information in the OnBeforeDispatch and set the Handled property to True.

Since this is quite long (not that it's complicated, but I want to explain things with as much detail as I can), I've divided it up into several posts:

[Note: Integrating Intraweb and Silverlight is not complicated. The purpose of this demo is to show pretty much all the different things you can do and make use of a variety of technologies and techniques]

1. Creating the REST Intraweb Server

2. Consuming Data from Silverlight

3. Talking to Intraweb Controls from Silverlight

4. Talking to Silverlight Controls from Intraweb using Ajax

The final result is show below. It's not meant to be pretty, but functional and instructive. I'm using the AdventureWorks database shipped with SQL Server 2005. Download code from here




Comments ...

Resharper 4 Beta available  - 5/21/2008

If you haven't been running the nightly builds and have been waiting for a beta, here it is. Not much you can say about R# except that once you try it you can't live without it.



Comments ...

Skype on the move  - 5/21/2008

Skype is a pretty complex program in the sense that it has quite a lot of options. However, one thing lacking is an option to configure where you want your data files stored. Whether it's history, pictures, received files, etc.. none of these are available for you to configure from the user interface. Now as a developer, I would think why haven't they built in this functionality? It doesn't take much to foresee that someone might want to change the location.

The funny thing is that they actually do have all of this built in. You can configure the locations of pictures and received files in the config.xml file that is in the data files folder. The entries are:

      <Avatar>C:\Documents and Settings\.....</Avatar>
      <AvatarPath>C:\Documents and Settings\.....</AvatarPath>
      <ContentPath>C:\Documents and Settings\....</ContentPath>

This is great, but where is the data folder located? Well by default Skype creates it in the Application folder (C:\Documents and Settings\User\Application Data\Skype) which kind of sucks for those of us that have our data on a different drive. There is no where in the options to change this. There's no configuration file in the application executable folder either. There's not even a registry entry. Nope. Skype have made it so easy that it's not even obvious. To change the location where your data is stored, pass it in on the command line:

skpe.exe /datapath:D:\MySkypeData

You can even make it portable by passing in /removable also. This prevents your password from being saved. Great for USB sticks.

What I find amazing is that if these developers have gone through the "hard" part of making this all configurable, why wouldn't they just add an option to the user interface?



   

Comments ...

Windows Communication Foundation  - 5/1/2008

Next week (finally) "Introducción a Windows Communication Foundation" will hit the book stores. It's the first book I've authored entirely on my own, and for now I can say that I won't be writing another for at least a few years. It drains a lot out of you. It's been a fun and at times frustrating ride, but at the end of the day, it's good to see your work completed.

So what is this book and why is it in Spanish? Well to be honest, it started out as a tutorial I started writing in Spanish, seeing the lack of documentation that existed on WCF. However, the project got converted into a book and took a bit longer than expected. Who is this book aimed at? For people who have little or no knowledge of WCF. It's not an in-depth book (around 200 pages), but at the same time it's not a "superficial" one either. I try and cover most of the important concepts that are used in WCF and are needed in daily work.

It's not a Hands-On-Lab (which I don't like personally) in that you don't follow a series of steps to create a project. I explain the concepts behind each thing I introduce and don't cover each and every individual step required, since most of them are obvious and not related to WCF. In other words, if you're expecting a book like:

1. Select File -> New -> WCF Service Library

2. Create a new App.Config file and type <bla bla bla>

3. Build and Deploy

then it's the wrong book for you. I introduce concepts gradually but explain them fully.

It also is not a reference book or an in-depth book about WCF or it's extensiblity (and that's why it's called Introduction to WCF).

Having said all that, if you buy it, I hope you enjoy it and provide me with feedback. For more information and purchasing options see Krasis Press

[P.S. there are no current planes to publish this on Lulu.com]

-------------------------------------------------------------------


La semana que viene (por fin), Introducción a Windows Communication Foundation estará disponible en las distintas librerías (FNAC, Casa del Libro) así como directamente desde Krasis Press. Es el primer libro que he escrito como único autor y puedo decir que no escribiré otro hasta pasado por lo menos un par de años. Aunque ha sido muy divertido, también requiere mucho esfuerzo. Pero al final del día, merece la pena ver el trabajo de uno mismo plasmado en algo físico.

¿Por qué el libro y por qué en castellano? El libro empezó como un proyecto que iba a ser un tutorial sobre WCF, a vista de la falta de información sobre esta tecnología en castellano. Sin embargo, por varios motivos, se convirtió en un libro.

¿A quién está destinado el libro? Es para desarrolladores que tienen poco o ningún conocimiento de WCF: No se trata ni de un libro de referencias ni un hands-on-lab (libro guiado paso a paso), sino más bien de un libro que introduce los conceptos de la tecnología de manera gradual, pero a la vez en detalle. Al ser un libro de unas 200 páginas, tampoco se toca en temas profundos como la extensibilidad de WCF, aunque si se ve casi todos los puntos importantes de WCF que son necesarios para su uso "diario".

Dicho esto, espero que os guste y me encantaría recibir cualquier tipo de comentario al respecto.


Comments ...

Var in C#  - 4/27/2008

I've recently upgraded to R# 4.0. I tried it in the past and the early EAP's were a bit flaky, but lately they are getting better and better. Since this version has support for C# 3.0, every time you declare a variable and create an instance of the same class, you get presented with a hint to change the declaration to use var. That is, when creating an instance of the class Parent as shown

R# suggests you convert it to

Initially I was reluctant to do something like that, but the more I think about it, the less I see anything wrong with it. I think it's perfectly fine to not have to declare of what type the variable is if you're creating an instance of the same type.

Comments ...

Design for Testability  - 4/22/2008

I've been meaning to blog about a new tool I've been using for some projects for the past month, called TypeMock, but I kept delaying it. Today, after a "debate" on alt.net mailing list, I've decided to say a couple of things and hopefully end the deabte it with this post. So to put you in context, a little background. TypeMock is a mocking framework that allows you to mock objects that don't necessarily implement an interface. This makes it extremely easy to mock objects in legacy code or code over which you have no control over (for example using TypeMock for testing ASP.NET MVC). It also has a very nice and elegant syntax (called Natural Mocks) that makes your tests easy and clean.

There are other frameworks for mocking, such as RhinoMocks or NMock, both of which require classes you want to mock to implement an interface (interface/abstract class). I've been using RhinoMock up to now until I switched recently to TypeMock.

Chad Myers was asking for reasons as to why he should use TypeMock since he already has reasons why not to use it. I responded with two points:

1. It allows you to test legacy code or code you do not have control over.
2. It doesn't force you to implement interfaces just for the sake of testability

And it seems that point 2, with some people didn't go through too well. So for the last time, let me clear it up.

I tend to design my systems with loosely coupled classes where I use interfaces and dependency injection when I need it. What does that mean? It means when I know that there is a possiblity that I might need a different implementation for a particular class. Now beforehand it's not always possible to know what your system might need in the future, in which case I tend to abstract my classes. However, there are certain situations where I do know for sure, 100% guaranteed, that I do not have a need for abstracting a particular class (how often does an RFC protocol implementation change?). These are the times where I do not see a need to introduce dependency injection just for the sake of testability.

Now one argument against that is that if a class is tightly coupled enough so as to not require abstraction, then the unit test should be more an integration test. That's great in theory but not always possible in practice. I might have to perform unit tests on my code where certain dependent classes aren't viable to be tested.

In summary, if I'm using a mocking framework that allows me to overcome these situations, whether caused by my own code or not, and at the same time allows me (nothing can prevent you) to continue with my good practices, I don't see a reason why I shouldn't use it. If on top of that I get a nice syntax and other features all the better. What it doesn't imply is that just because I can now mock concrete classes that I should forget about concepts such as dependency injection.

I still haven't received a response on in this debate about why would you abstract all your classes Maybe it's because of testing frameworks imposing it on your design?  But to be honest, I've given up asking.

Comments ...

More recent entries | Older entries