Monday, December 26, 2011

Tuesday, October 11, 2011

Simple way to debug Windows Service startup


If you come to situation that you need to debug the startup of your Windows Service here's a simple and dirty (and stupid) method that helps in most situations.
This could be used in situation where your service immediately starts and stops.
Windows Services reports a message like this:

The "serviceName" service on Local Computer started abd then stopped. Some services stop automatically if they are not in use by other services or programs.
Usually, to debug a service you'll need to setup the breakpoint in your code, attach to the process from Visual Studio, and debug upon hitting the breakpoint.
Problem is if your service immediately exits and your don't have time to attach the debugger.
Simple, stupid way to debug it is to... guess what?... add a Thread.Sleep() as the first line in your code.
Sample, service acting as a WCF Host and it's OnStartup() method:


protected override void OnStart(string[] args)
{
   System.Threading.Thread.Sleep(30000);
   myHost= new ServiceHost(typeof(MyService)); //set breakpoint here
   myHost.Open();
}



Now you have enough time to attach the debugger from Visual Studio and you don't have to use Windows Debugger Tools or similar advanced methods.

Tuesday, March 15, 2011

Setting up MMS on Google Nexus One

Here's a short post if you ever come to a problem setting up MMS on Google's Nexus One phone.
As far as I've figured it out, the problem emerges if your operator requires different APN's for Internet connection and MMS service.
To skip all the trouble I had figuring out what's the problem, the bottom line is that you must set APN type for the one that you use for Internet access to "default" and APN type for MMS must be set to "mms". Caps matter.
All the time I've left APN type for the Internet APN empty. Nexus One lets you write anything you want for acces, other Android devices usually let you choose from one of the predefined values. If you left it empty, Internet access will work, but if you define another APN for MMS (there you must enter "mms" as APN type), MMS won't work. When you set APN type of the Internet APN to "default", and left everything else as before, MMS will start working.

Here are the sample settings for my operator (BH Mobile) that work on my Nexus One.

  1. Internet APN
    • Name: BHMobile
    • APN: active.bhmobile.ba
    • Proxy:
    • Port:  
    • Username:  
    • Password:  
    • Server:  
    • MMSC:  
    • MMS Proxy:
    • MMS port:  
    • MCC: 218 (this can be different for your operator, Nexus One usually automatically recognizes it)
    • MNC: 90(this can be different for your operator, Nexus One usually automatically recognizes it)
    • Authentication type: None
    • APN type: default (this was the problem all the time while MMS didn't work, it was not set)
  1. MMS APN
    • Name: BHMobileMMS
    • APN: mms.bhmobile.ba
    • Proxy:
    • Port:  
    • Username:  
    • Password:  
    • Server:  
    • MMSC:  http://mms.bhmobile.ba/cmmsc/post
    • MMS Proxy: 195.222.056.041
    • MMS port:  8080
    • MCC: 218 (this can be different for your operator, Nexus One usually automatically recognizes it)
    • MNC: 90(this can be different for your operator, Nexus One usually automatically recognizes it)
    • Authentication type: None
    • APN type: mms 
What is really weird is that Internet APN setting was causing problems with MMS APN. I assume that it was using the Internet APN when trying to send MMS until I've set the APN type to default. Afterwards, it searched the MMS APN and used the correct one. Just assumption...


Thursday, November 18, 2010

Top 5 things that will get you bored

There are several things that get you bored and unsatisfied with your job if you constantly repeat them and if these things make more than 85% of your everyday work for a longer period of time.

  1. Business escalations - if you constantly fight with unsatisfied customers, failing projects, interpersonal problems, etc. If all of these problems end up at your desk too often, you'll get bored.
  2. Repetition - you're constantly repeating previously acquired knowledge and really not learning anything new in the professional sense.  
  3. "Disconnected" boss - this may seem awkward, but if your boss lets you do too much on your own, you'll get bored eventually. Monitoring also means that someone cares for what you do.
  4. Constant pay - you're getting payed same amount of money for your work every month and no change in any direction will also get you bored.
  5. Compensating incompetence - if you often compensate incompetence of some of your colleagues and they're not getting sanctioned will eventually get you bored; regardless of whether you're getting rewarded for it.
Most of these points seem like a regular tasks for some jobs, but if there's too much of these you'll definitely get bored at work.

Monday, November 01, 2010

Human mail dispatchers

I've recently read the book Rework by 37signals.com founders.
First of all, I highly recommend that you read it. It'll definitely make you rethink the way you do your business, at least it did to me, and hopefully you'll really rework to some extent.
Basically, book presents an agile approach to starting, running and growing your business. The ideas presented look revolutionary from the point of view described in widely adopted business related books.
One the chapters deals with delegators It's named "Delegators are dead-weight". Delegators are managers that dispatch work to other people, all work. What I've seen in my career is that the delegators are glorified as great managers and delegating is sometimes pointed out as the single-best management virtue. Don't do it yourself, delegate, I was often said. Delegation is surely important in management, as you're required to organize and lead people. But the problem with delegators is that  delegation is the only thing that they do, and this is not good. Managers are supposed to delegate, of course, but their work must add value. I've seen many managers that delegate all work in such a manner that they can be easily changed with a little bit more complex mail routing script. This will definitely not bring added value. If you see a delegator in your company, fire him and shorten the reporting line.
Related to my previous post, intentional managers are mostly delegators, and accidental managers do too little delegation.

Sunday, October 24, 2010

Intentional and Accidental Managers

There are two kind of managers, intentional and accidental managers. 

Intentional managers are educated to be managers. They start their carriers as managers. Usually, besides huge knowledge of by-the-book management rules, they also have a strong theoretical background on psychology. Also, these people are very self-organized and they are able to organize people to do some work in a way that’s easy to monitor and control. Most of all, they have generalization approach to managing work, especially at the beginning of their carriers. Generalization approach means that they use general rule for management regardless of the business domain. They follow the very same rules whether they run a shoe factory line or a software development team. 

Accidental managers are, first of all, craftsmen. Being extremely good in their everyday work got them to management in the first place. This kind of managers know their business domain very well, they have working knowledge on the matter and they earned the manager’s position by saving several problematic projects. They manage work through specialization. While working on the project, they go down to all the little details and seek to know every single thing that’s related to the project’s result.

So, which kind of managers is better?

As with everything in life, there’s no silver bullet.

Speaking of bullets, here are few on the diversity of these two types to conclude:
  • Intentional managers tend to delegate all of the work, accidental managers do (too) much of the work themselves.
  • Intentional managers lead larger teams in a very organized way. Accidental managers have problems managing large teams.
  • Intentional managers write great reports and present them to the satisfaction of stakeholders. Accidental managers have problems writing reports at all, and when writing,  they produce reports focused on problems and rarely mentioning good things they and team has done.
  • Accidental managers work great in time of crisis. They are great cost-cutters. Mainly, they are appointed at the time of crisis. Intentional managers much easier surrender to the crisis and flee from the battlefield.  
  • Accidental managers got bored easily when business is stable. In the day of crisis they are troubleshooter, in stable business they, as managers, are troublemakers. Intentional managers work best while in stable business. Reports are clear, regular and everyone can celebrate good results.

Monday, October 18, 2010

the dead parrot

It seems that Microsoft has dropped Oslo and it's focusing on OData and EDM as a more loosely coupled approach to modeling. I was really interested in "M" and creating DSL's in the language, was impressed with Don Box and Doug Perdy at PDC2008 but it seems that we'll have to wait for another fad to occupy our dsl-thirsty minds. Weirdest of all, it seems that Doug also vanished with the Oslo.

Nevertheless, after a few posts on SQL Server Modeling, Oslo, and "M" and a long pause posting, I'm here to write about the next technology I'm trying to learn and apply.
This time it's Python with Google App Engine.This should be a big change after years of using C# and Java in my everyday work. This is somehow weird, because actually I'll still continue to use MS technologies at work, but examining the Google side of development world is like a new hobby.

Right now I'm going through the tutorials and docs on Google code and I really like the language and the approach. Provided services give a lot of power instantly to your applications. You don't have to worry about authentication - authenticate users with Google account, don't worry about the database details and query optimization - just use the easy-to-use Datastore service. Emails, cron jobs, XMPP, Google Apps, all together gives a great platform for development and enable you to focus on your.... Idea!

If you don't have an idea for the next I believe you should try developing an application that you need and you would like to see available. Taken this approach what I miss really is an application to easily organize and track my tasks. I get and assign tasks through several tools, Outlook, issue tracking tools at work, Google tasks, and of course RTM. At the end of day, each application is missing some feature that I think I really need. Thus, I'll try - as an exercise - to start with a task tracking application. Not a great idea, but at least - it could be a real enough project to learn Python and development for Google App Engine.