alex in a nutshell

February 10, 2008

Setting up home media centre with PlayStation 3

Filed under: — Alex Salamakha @ 9:13 AM

I’ve been using my old 21″ Philips CRT TV for the past eight years and have been reluctant to replace it because I didn’t think the technologies offered were mature enough and I couldn’t justify the price of the replacement.

However, the time has come. LCD TVs are now descent quality, sharp picture, and reasonably priced.

Sony Australia offered free Playstation 3 (40GB) with any Bravia TV 40″ and above. It was a very sweet offer to resist and I became a happy owner of two fine Sony products.

Since I’m not a gamer, I didn’t care for PS 3 gaming features, but I did care about its media centre capabilities.

It does everything I need. First of all, it plays DVD, BlueRay and DivX. Also, it has a very easy-to-use interface. But wait, there is more. There is a fantastic (and free) program called TVersity, which I run on my desktop and use to stream video, music and images from my desktop to the TV via Playstation 3.

Think about presenting snaps from your latest trip to your friends on a 46″ LCD in your living room instead of printing the pictures in a photo lab and then passing the album around. Kicks arse!

How about playing music in living room from a massive music collection stored on a huge hard drive somewhere in the basement?

How about flicking through your entire collection of movies with your remote?

So, there are three things you need to do when you get yourself a Playstation3:

1) Get a proper remote for your Playstation 3.

2) Get a HDMI cable to connect PS 3 to your LCD panel. Just make sure you get something cheap, don’t fall into the trap of buying $400 Monster cables because they are “better quality”. HDMI is a digital standard, it either works or it doesn’t. I’ve got mine for $13 and very happy about it. If you don’t believe me, read this article in PC World.

3) Install TVersity. That’s about all you need in order to set your media centre up.

Gaming. I’ve played games on PS3 during past 6 weeks of owning it. Once. Don’t get me wrong, it’s good, graphics is superb and real on large LCD panel, however, I much prefer playing Wii console on that old and semi-retired 21″ Philips CRT TV with my daughter. It’s so much more fun!!!

Getting old extensions work with Firefox 3

Filed under: — Alex Salamakha @ 8:35 AM

I’ve been complaining about Firefox being a memory hog earlier, so I decided to try new Firefox 3 beta 2. It’s been a lot less aggressive in its memory consumption and is quite stable, which is a fantastic result for a beta. On the down side, most of my add-ons stopped working. I can live without many things, but I can’t live without Yahoo del.icio.us and Web Developer add-ons.

Luckily I’ve found this neat trick to enable your old Firefox 2 extensions in new Firefox 3:

1. Navigate to about:config address
2. Right-click and select New >> Boolean
3. Name it extensions.checkCompatibility
4. Set it to false
5. Restart Firefox

All your old add-ons will try to work and most of them will. At least both Yahoo del.icio.us and Web Developer add-ons work just fine for me.

UPDATE: this no longer works for Firefox 3.6. Click here for the solution for 3.6.

December 17, 2007

Firefox the memory hog

Filed under: — Alex Salamakha @ 8:06 PM

I use Firefox every day, I was sold on its speed, leanness and extensibility, but it looks like the Firefox team is loosing the plot. My friend James Crisp recently posted the following:

Finally, last week, after Firefox hung yet again using 100% of processor and over 300mb of memory, I decided to give Opera a go.

300MB? How about 1.5GB? I’ve left my Firefox v2.0.0.11 running overnight on my office machine with 3 tabs open and discovered the following in the morning:

Firefox the memory hog

WTF, Firefox team? Is it time to give another browser a go?

December 1, 2007

Russian fonts in Firefox under OS X Leopard

Filed under: — Alex Salamakha @ 8:28 AM

One of the annoying problems of OS X Leopard upgrade was Firefox’s problem of presenting Russian characters – all buttons, text boxes and other controls contained question marks instead of characters while web pages were presented well.

Problem with question marks instead of letters

This is how you fix this:

Quit Firefox. Go to Applications folder and Right click on Firefox. Select “Show Package Contents” from the menu. Navigate to Contents -> Resources and rename en.lproj directory to ru.lproj directory.

the problem is fixed

November 14, 2007

Creating business objects validation with Enterprise Library Validation Block

Filed under: — Alex Salamakha @ 11:01 PM

I’ve been using MS Enterprise Library on a number of projects. There are several blocks that used more often than others. I find validation block particularly useful. However, I usually like to tweak it a bit. The thing I don’t like is when you want to validate an object you require to write a substantial amount of code:

Validator<Customer> validator = ValidationFactory.CreateValidator<Customer>();

ValidationResults results = validator.Validate(customer);

Also it’s possible to create a validator for another type and validate an object with it without any problems, errors or exceptions:

Validator<WRONGCLASS> validator = ValidationFactory.CreateValidator<WRONGCLASS>();

ValidationResults results = validator.Validate(customer);

This feature is for flexibility, however, I haven’t found a need to use it the way it was intended. On the other hand I have encountered a number of situations where developers copy-pasted code responsible for creation of a validator without changing the type of a target object. This results unexpected behaviour during testing.
In order to fix this every business object is derived from a common parent BaseBusinessObject class, which has the following method defined:

public ValidationResults Validate()

{

Validator validator = ValidationFactory.CreateValidator(this.GetType());

return validator.Validate(this);

}

As a result, validating an object is now a lot simpler:

customer.Validate();

Usually it makes sense to have a base business object class anyway, so it’s not much of an overhead.

October 28, 2007

New job

Filed under: — Alex Salamakha @ 6:09 AM

As of November 6, 2007 I will no longer be an independent consultant at Commonwealth Bank of Australia, my workplace for the past 18 months. I’m not going to another organisation, however. I’m switching to a permanent position of Application Architect instead.

I’m excited!

October 23, 2007

Running multiple instances of CruiseControl monitor

Filed under: — Alex Salamakha @ 8:49 PM

We’re using a customised version of Cruise Control, hence we all stuck with old one-per-project Cruise Control Monitor (v. 0.9.1.940).

Major hassle for me is to monitor a number of projects in tray. This version doesn’t support multiple project configurations with only one entry in the config allowed for a project:

<?xml version=”1.0″ encoding=”utf-8″?>
<CruiseControlMonitor xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns=”http://www.sf.net/projects/ccnet”>
<PollingIntervalSeconds>15</PollingIntervalSeconds>
<ProjectName>Name-Of-Your-Project-Here</ProjectName>

As a result, every time I restart a machine I need to start 4 instances of CCTray and manually select corresponding projects from a list. Annoying!

Simple fix is:

  • Create multiple config files, with just ProjectName entry being different
  • Create however many shortcuts to CCTray you need in your Startup group and specify a corresponding config file as a parameter
  • Enjoy the view of multiple CruiseControl Monitors sitting in your tray:

Multiple CruiseControl monitors

October 5, 2007

Do we need frameworks?

Filed under: — Alex Salamakha @ 1:30 PM

Mitch Denny’s and Paul Stovell’s posts on frameworks are thought-provoking, especially because I’m in a beginning phase of a rather big project. We have layered architecture with UI, complex middle-tier that talks to a number of external systems and DBs.

We have a number of developers on the project with the same number to start in next few weeks. After initial launch I expect 50-60-70% of staff to be moved to some other projects with new (and, most likely, junior) developers taking over their positions.

Do we need a custom framework on top of what .Net provides? Yes.

Do we need a framework even if it’s going to be outdated tomorrow? Hell, yes!

Why do we need any framework at all?

1) Consistency of development process. I don’t want new starters to invent a wheel and create their own solutions. Framework can be verified, tested, performance-tested, approved by architects. Do I have a luxury of trusting every developer’s judgment on everything? Not on a large project.

2) Efficiency. I want developers to productively write code (mostly UI and business logic) and don’t worry about plumbing, validation nuances, etc.

Are we going to write everything ourselves? No. We’re going to re-use as much as we can. This brings a second question:

Adopting external frameworks. Is it good?

.Net provides a lot of stuff out of the box, however, not everything. Validation, Data Access and control library are obvious weak points that require addressing on pretty much any project. Tracing and logging can be extended way further than standard implementation in order to be really useful in n-tier systems.

So, re-use third-party or write your own? I have seen projects where everything was written in house as a principle, including reporting engine. It took a lot of time and was inferior comparing to what’s available on the market. Yes, the framework did almost 100% of what’s needed and was written with specific project in mind, but it had its own limitations, just like any other framework in the world. It would have been more efficient development-wise and beneficial to customers to utilise existing libraries.

YAGNI principle teaches us that we should not over-engineer for future as we won’t need it most probably. I think this principle is being violated more often during in-house framework development rather than during third-party framework re-use. Given a choice between utilising 20% of Enterprise Library or writing these 20% ourselves, I’m going to opt for the first option because it’s faster and does the job. I’d rather use it as a base and write a little bit of custom tweaking code on top of it when required; it’s more efficient this way. For example Enterprise Library Validation block doesn’t support cross-field validation. Fine! I can write it within the scope of my project, but at least I don’t need to write the entire validation framework.

Seriously, what’s the problem with utilising 20% of a large-ish third-party framework? After all, code re-use isn’t such a new concept.

October 4, 2007

VS.Net 2005 AddIns

Filed under: — Alex Salamakha @ 1:27 AM

VS.Net add-ins are being installed by default to My Documents\Visual Studio 2005\AddIns folder.I’ve got a roaming profile at my work computer and My Documents folder is located on a remote drive, which, in its turn, causes all the add-ins to fail during load due to trust issues.

Simplest solution is to move add-ins to a new location and then change your VS.Net 2005 settings via Tools >> Options >> Environment >> Add-in/Macros Security:

VS.Net 2005 AddIns settings

Hit OK, restart your Visual Studio and voila!

September 21, 2007

Decimal in c# attributes

Filed under: — Alex Salamakha @ 2:08 AM

We’re writing a new framework for our new project and decided to use Enterprise Library Validation Block as the foundation for user input validation. It worked out really well; we’re building a library of our business-specific re-usable validators. With unit testing in place, it’s heaps better than using any validation inside the forms.

There is one question that puzzles me however – why the hell decimal isn’t allowed as a parameter in attributes at CLR level?

24.1.3 Attribute parameter types

The types of positional and named parameters for an attribute class are limited to the attribute parameter types, which are:
- One of the following types: bool, byte, char, double, float, int, long, short, string.
- The type object.
- The type System.Type.
- An enum type, provided it has public accessibility and the types in which it is nested (if any) also have public accessibility.
- Single-dimensional arrays of the above types.

I’m sure CLR guys had their reasons, but since I haven’t found any documentation about that topic I’d like to know the answer.

Using double and internally use Convert.ToDecimal isn’t n option I’d like to pursue.

« Previous PageNext Page »
Copyright © 1997-2010 Alexei Salamakha. All rights reserved
email: alex@salamakha.com    Alex Salamakha on Facebook    Alex Salamakha on LinkedIn    ICQ 11923872