Sociometry, Social Network Analisys

A couple years ago I have created a simple tool to visualize a sociometry.
A sociometry is a simple quantitative method to visualize social relations.

Given a class the teacher asks some questions about likes and dislikes within the predefined group of persons (class).

Given a connection matrix between the individuals the main task is to visualize and cluster groups within the class and understand important factors like central and peripheral positions.

Here is a visualization of a sample dataset (without names).

The tool takes the individuals and the connections into account and attracts and distracts/repels the nodes (persons) thus minimizing the total aggregated force within the system (attraction is +, repel is -).

I am keen to rewrite the whole tool in C# in the near future.

My current formulas for the sliders are:
  • repel: sqrt(exp(1/dist)*trProximity.Position)*cos(angleA)
  • attrack: sgn(ddist)*sqrt(exp(abs(ddist)/trConnection2.Position)*trConnection.Position)*cos(angleA)
  • mutual connections can receive bonus attraction

Performance counters runnning wild -- Perfmon, Data Collection Sets

In our project we were lucky enough to reach the point for performance profiling and optimization.
My colleagues were constantly fighting with time: the profiled instance being requested from the cloud and they were monitoring and then saving the screenshot and the data from performance monitor. They were not able to leave the office until the measurement typically taking 1 hour were done. We needed data from the perfmon.

I just happened to meet the adequate solution on windows.
One can define Data Collection Sets and afterwards getting data out via reports with the perfmon tool.
A sample for ReadyBoost technology profiling can be found here.

Do you happen to know the demotivational poster about premature optimization & the devil? And Mr Knuth of course.)

Long long time ago, there was a .NET/CLR

Recently I had a quite interesting opportunity to talk about .Net fundamentals.
Though using C# for various reasons and framework I am aware that I lack the real bits and bolts of the language & the framework.

An interesting (and quite basic topic) - FYI.

What will b1 and b2 be (and why)?

            object s1 = "apple";
            object s2 = "apple";
            bool b1 = s1 == s2;

            object i1 = 1;
            object i2 = 1;
            bool b2 = i1 == i2;

I remembered that I need the fundamentals of boxing and unboxing, etc; therefore my answer was ok, however the reasoning was not ok. Some background here.
The solution is (true, false). My understanding about the reasons: b1: Reference, however string is immutable thus CLR maps to same address; b2: boxed value type becomes reference type, thus different pointers.

Taking screenshots on an Android phone

The team has just finished our brand new Android client application.
I was naive enough to make an attempt to capture some screenshots on the device.

This task was very straightforward on iPhone, Windows Mobile and even with some utility on BlackBerry. However on Android every forum tried to go for turning on the USB debugging option and then taking the screenshots on the PC.
I do not like this approach (and also it wouldn't work on my PC due to some missing Samsung drivers).

A smartphone should be self-contained: installing apps, taking screenshots, everything.

After some googling I managed to find this nice utility: screenshot.apk.

Try it, it seems to perform well.