alex in a nutshell

December 19, 2011

Refreshing unread counts for IMAP folders in Outlook 2007 or 2010

Filed under: — Alex Salamakha @ 11:30 PM

I’ve got three Google Apps accounts with IMAP interface and I use Outlook to manage my emails.

It’s a great tool, but it has an annoying “feature” – when it starts it doesn’t display unread counts for IMAP accounts. So you have to physically click on every IMAP account to see whether you have any new messages or not. Pretty horrible, if you ask me.

Thankfully, it’s not that hard to solve this problem.

First of all, enable Developer tools:

Right-click Outlook toolbar, then choose Customize the Ribbon… menu

then tick Developer toolbar:

You will now see Developer toolbar

Click on Macros button.

In the new window type GoThroughAllAccounts or whatever name you fancy and click Create button

In the editor window type

Sub GoThroughAllAccounts()
For Each Account In Session.Accounts
‘iterate through accounts and go into each folder
Set Application.ActiveExplorer.CurrentFolder = Account.DeliveryStore.GetDefaultFolder(olFolderInbox)
Next
End Sub

In the tree on the left click on Microsoft Outlook Object, choose ThisOutlookSession and double-click it. A new editor window will appear.

In the window choose Startup event from the drop-down on top-right and type

Call GoThroughAllAccounts

in the body of the sub-routine

Save your script and close the script editor.

Now we need to set permissions for your script to run on startup.

In Outlook click on File >> Options >> Trust Center and then press Trust Center settings… button

Click on Macro Settings link on the left and choose one of the two options:

1) Notifications for all macros – you will have to press Enable macros every time you start Outlook

2) Enable all macros – it will work without bothering you, but you have to be more cautious with this settings as you may end up getting viruses.

I use option 2).

 

September 23, 2009

.Net 4, Azure SDK and WCF HTTP Activation

Filed under: — Alex Salamakha @ 10:33 AM

Azure SDK requires WCF HTTP Activation to be installed. However, WCF HTTP Activation won’t install if you have installed .Net 4 prior to that. Here is why:

when you install the .Net 4.0 beta, for some reason it also overwrites at least one of your .Net 3.0 (WCF) files, at least on 64bit systems, namely

c:\windows\microsoft.net\framework64\v3.0\Windows Communication Foundation\SMConfigInstaller.EXE“.

So the bad part is, with this new version in place you cannot longer enable the “WCF HTTP Activation” Feature of Vista and Win7 and even worse, uninstalling .Net 4 beta does not restore the original version.

So if you’re building a new system, make sure you install WCF HTTP Activation prior to .Net 4.

If you have screwed up like I did, install Windows 7/Vista on a VM, copy SMConfigInstaller.EXE file back, restart your machine and enjoy.

September 19, 2009

Microsoft TechEd Australia 2009

Filed under: — Alex Salamakha @ 4:55 AM

It’s been fantastic to get away from the office and spend few days at sunny Gold Coast.

Every paid TechEd delegate received an awesome package from Microsoft and HP:

img_1796

Now I have a little carry-around-meetings netbook, HP Mini 2140. Despite being a bit too sluggish for development in Visual Studio 2010 and not having Bluetooth it is a really nice machine which has proven itself for the job.

Back to the conference. There were quite a few interesting sessions. Here is my top 5:

  • Chris Auld from Intergen, NZ presenting on Azure platform. Great overview and comparison of all cloud platforms (Session ARC201).
  • Jim Webber, Thoughtworks’ Global Head of Architecture, presenting on architecturing REST-based systems and hypermedia. Jim is a fantastic and passionate presenter, I enjoyed both of his sessions (SOA321 and ARC305) immensely.
  • Joel Pobar presenting on F# and its application in applications. It was a very interesting session (DEV450) indeed, one of those sessions that any developer should love –  playing with new cool stuff  with new technology. I’ll be catching up with Joel during his upcoming Sydney visit to talk more about F#.
  • Nick Randolph on interconnectivity between clients (including mobile) and Azure services, queues, etc viagra vs cialis. Full of practical stuff on Azure (Session SOA341).
  • Rob Farley from LobsterPot Solutions presenting a hands-on session on SQL Azure (Session SQL305).

And, as usual, TechEd is a place where you meet interesting people and get inspiring ideas. It was great to catch up with ex-colleagues from ediCargoWise who now run their own company, EnvoyAT.

Looking forward to TechEd 2010, it’s going to be great to spend few full on technical days at Gold Coast this time next year.

June 19, 2008

CommSec Cash Management goes live

Filed under: — Alex Salamakha @ 11:19 AM

It’s such a good feeling to finish a long project. CommSec Cash Management was an interesting project to work on. Put simply, it’s a self-contained bank within a bank, offering high interest savings and transactional accounts, Debit Master Card, Internet banking, full back office capabilities and integration with existing CommSec’s trading products and Commonwealth Bank’s existing payments systems.

Building such a thing from the ground up was quite an experience from professional point of view; it was a long project too (started prototype in August 2007, started development in September 2007, pilot in April 2008, went live for public in June 2008).

Two weeks after launch – no major issues, which is even a better feeling.

…now I just need a holiday before starting to work on a new assignment…

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 http://rxtadalafil.com/.

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

Next Page »
Copyright © 1997-2015 Alexei Salamakha. All rights reserved
email: alex@salamakha.com    Alex Salamakha on Facebook    Alex Salamakha on LinkedIn