THINK

that’s how i naturally know

Microsoft Sync Framework Unhandled Exception “Retrieving the COM class factory for component with CLSID…”

leave a comment

From the Microsoft Sync Framework 2.1 SDK download page http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=23217

in the last part where it says instructions:

It is not possible have full 32-bit Sync Framework 2.1 SDK installed side-by-side with the 64-bit SDK; therefore you will have to install one version of SDK (64-bit) completely and only selected components of other version (32-bit) of SDK. See Sync Framework Tips and Troubleshooting topic for details.

But that statement isn’t totally clear: The way to install for 64bit development machine is to download the x64 for the SDK and the fill the x86 parts with the redistributables from http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=19502

It works for me at least. Hope it helps.

Unrelated tidbit: I broke the Microsoft Forums layout when I posted this as a reply to http://social.microsoft.com/Forums/en/syncdevdiscussions/thread/34a04f62-014a-48a0-9397-256b6ad1387b

Check this out:

Written by Jake

December 6th, 2011 at 10:33 am

Posted in Programming

Tagged with

PTR, rDNS, SPF, DKIM, DomainKeys and SMTP set up for sending emails

leave a comment

The DNS records related to sending emails has to be set correctly according to prevailing standards otherwise you will get into various non-delivery issues.

PTR and rDNS

When the sender server (S) email arrives at the recipient server (R), R will do a rDNS check and this sequence of events will happen:

  1. R will check the IP that S is connected on
  2. R will check the IP for a valid hostname by doing a DNS lookup for the PTR record for the IP. This PTR record is recorded in the ISP zone for S.
  3. S’s ISP will return a hostname to R.
  4. R will check the hostname for an IP by doing a DNS lookup for the A record for the hostname. This A record is recorded in the zone of the hostname’s domain.
  5. R will compare the IP in step 1 and 4 to make sure it is the same.

Additionally, R may require that the hostname in step 2 be the same as the sender email domain’s MX and be the same as the hostname in the HELO/EHLO command sent by S. Although this will be over doing it.

SPF

R may also check whether S implements the Sender Policy Framework (SPF) in the DNS by looking up the TXT record in the email domain zone. Typically, an SPF TXT looks like:

  • “v=spf1 mx a ~all”

This will tell R that emails originating from the MX server and the Web Server (specified at the A record for the domain) are allowed to send emails for the email domain.

DomainKeys, DKIM

S can also implement a “signature” protocol where every email sent out will be signed by the it. Then when R recieves the email, it will look up TXT record in the DNS zone of the email domain for the DomainKey and DKIM rules to parse and determine if the signature on the email is valid.

 

 

Written by Jake

December 1st, 2011 at 3:13 pm

Posted in Networking,Web

What should we do with the disabled?

leave a comment

In a much bigger picture, various bad things happen to people all over the world and all the time. There is no need to specially pick out one bad thing and apply special consideration and treatment while demeaning the rest of the problems that happen to people on a regular basis.

As a race, we humans are dying day by day since the time we are born into this world. If we do not wish to die faster than we can avoid, then we inevitably have to face up to all sorts of risks, internal and external.

When talking about care for the disabled, most people equate “disabled person” to a person who has musculoskeletal disabilities. Marketing materials also often portray handicapped persons on wheel chairs to stir emotions. People tend to empathise and believe we need to cater special arrangements for them because the ill-informed are made to believe that these people are the minorities (we don’t see handicapped persons everywhere) and that they are being ostracized by the society.

However, disability is more than just all the handicapped persons. A disabled person can be in one of the 14 categories recognised and documented in US Social Security Blue Book:

  1. Musculoskeletal System
  2. Special Senses and Speech
  3. Respiratory System
  4. Cardiovascular System
  5. Digestive System
  6. Genitourinary Impairments
  7. Haematological Disorders
  8. Skin Disorders
  9. Endocrine System
  10. Multiple Body System Impairments
  11. Neurological Problems
  12. Mental Disorders
  13. Malignant Neoplastic Disease
  14. Immune System Disorders

People with such disabilities can range from unnoticeable to mild to severe; and it is also possibility that many with such disabilities never realise they had it until much later.

Disabled people can exhibit various characteristics which may affect performance of work and its environment such as:

  • Inability to learn, integrate, express
  • Inability to calculate
  • Have to visit toilet very frequently
  • Fatigue, tiredness, sleepiness
  • Unable to work under certain environments, e.g. sunlight, smoke, low ventilation, high altitudes
  • Excessive medical leave, due to weak immune system
  • Infectious disease carrier e.g. bronchitis, flu

So then how can we cater to all the disabled in our society? Clearly, there is no other better way than to spare them from the requirements of work. They are pathetic enough.

You see, the human race does not stubbornly, unreasonably and intentionally inflict pain and suffering on itself. Life, aka the process of dying, does it itself.

When we remove all our emotional attachments, we work logically. Logic says that we should mostly leave the disabled people alone and make the others work hard for the economy, for the country and for the world.

We can spare all the disabled persons the hardship of work, but the sad consequence is that more and more people, due to life undoing itself, is claiming social security benefits for their disability (social security claims is made possible due to our emotional calling), but governments and organisations are finding it harder and harder to support these people on top of the aging populations. Alas, we have to rope in the help of the disabled and squeeze every ounce of them still functional.

Look back at the list again and see what we can do. Well, it is a no brainer that the easiest group to target is the handicapped people. We just need to build ramps and lifts to ferry these people to their desk and they will be able to support themselves, and then convince the public and corporations that they are still cognitively functional and adequate to carry out a wide range of tasks.

Quite ironically, somehow most of us have twisted mentalities and doubts about the very society and world that we thrive in: So here we have this system of human treatment whereby through natural, logical selection, we pick the most enabled persons to work. In fact most societies strictly require all abled persons to work otherwise they will be discriminated based on social stigma, but we do not frown upon unemployed persons who are handicapped because we naturally excuse them from work. Then, at the same time, we think that this preferential treatment for the handicapped is a form of ill-treatment just because if they wanted work, they cannot get.

There are many more disabled people than just the handicapped alone, and without doubt, the more “social dependents” we can remove from this group the better. But remember not to be emotional and always be clear of the logical reasons to do this. Do not blame the society, for this is life. Ultimately, rather than we finding ways to help the disabled, the disabled themselves should find their own means to continue this living. They took the risk of living therefore they have to face up to the consequences now (Begs for a whole new topic of “Why and how am I here on earth). I am sorry to say, but most of these people really just cannot stand up to a fair and competitive environment being handicapped. In case a person is really talented, he will have his chance naturally and will not require any social help, for example, Beethoven who is deaf.

Finally, the decision to give special treatment to “disabled persons” in itself is discriminatory. How can we decide if a person is disabled or not; what is the difference between unnoticed, mild and severe conditions? Do we only empathise with the critically ill but overlook the welfare of the potentially ill persons? Do we not judge work performance the same “human” standards but instead have different set of standards based on how many limbs you have; how good your bladder is; or how glucose intolerant you are? The lesser known truth is that there is no clear line between an abled person and a disabled person if look beyond just the set of handicapped persons.

Have you wondered why your some people cannot follow simple instructions; or keeps on making typo mistakes in documents and reports; or cannot deliver a good presentation to clients; or have bad driving skills; or is always sleeping on the job? Unlikely as you may argue, chances are, they may be suffering from symptoms of disabilities that are lesser empathised and publicised by the public. Unfortunately, there is little we can do to help these people and worse of all, we are not even helping at all! Most of these poor folks will be dismissed as incapable, lazy or simply falling below expected performance.

All in all, “helping” the disabled is just a marketing cliché and a tone set to stir emotions and garner support for the real question of “what to do with the disabled” since we cannot and do not want to support them. Any mandatory special treatment given to these people only imposes more burdens for the rest of the human race.

Written by Jake

November 27th, 2011 at 1:42 am

Connect to remote SQLEXPRESS server (2005 / 2008)

leave a comment

A few things to set up on the SQLEXPRESS before client can connect to it remotely.

Go to SQL Server Configuration Manager > Network Configuration > Protocols for SQLEXPRESS and enable TCP/IP. The default installation of SQLEXPRESS does not enable TCP/IP. If you are connecting via other protocols, enable those (obviously).

Go to the host machine’s services.msc and enable the SQL Server Browser service. You may want to change the startup to Automatic as well.

Additionally, you may need to configure SQL Express to use Mixed Mode Authentication. This is normally a one-time configuration during the installation of the server, however, it can be changed manually through the registry at HKLM\Software\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer and set LoginMode to 2 (decimal)

Then restart SQL Server (SQLEXPRESS) in services.msc to make it use the new settings.

If users are required, use Microsoft SQL Server Management Studio to add users that can log in with SQL authentication.

Written by Jake

November 25th, 2011 at 1:19 pm

Posted in Networking,Programming

Tagged with

Bottom margin or spacing in an inline img

one comment

Inline img tags by default is positioned such that it has an additional bottom spacing relative to its parent block element. If the parent block element e.g. div have zero padding and the img have zero margin, the img height will not equal to the div height as the additional spacing will push the parent border further downwards.

This is because the inline img tries to compensates for character decendants when positioned inline with adjacent text. charater decendants are the “tails” in “g”, “j”, “p”, “q” and “y” that extend downwards.

To remove the spacing, set the img vertical-align to bottom. In the absence of adjacent text, this would make img ignore the compensation, resulting in equal-height div and img.

Written by Jake

October 22nd, 2011 at 3:09 pm

Posted in Web

Tagged with ,

One-to-many mappings

leave a comment

A lot of times I had to look for a data structure to store one to many relationships such as a list of products keyed by their categories. I remember the last time I coded in C++ I used a whole lot of std::multimap to do just this.

With C#, there isn’t such a container. The only way is to construct your own container by creating some sort of Dictionary<Key, List>.

Better still, if you only need to add elements once you can just use a simple List<data>, add your data by List.Add() then make a LINQ call to List.ToLookup(). And you immediately have a one to many mapping. This is much more elegant since you do no need to check the dictionary for existing key each time you want to add data.

Written by Jake

October 3rd, 2011 at 11:52 pm

Posted in Programming

Tagged with , ,