A site devoted to discussing techniques that promote quality and ethical practices in software development.

Sunday, March 18, 2012

What is more difficult - to think and to do something - follow on

In my previous post, I pondered on this topic and wonder if the experiment in MIT laboratory in studying habit can explain them.

Since then I rediscovered a study [Hadar] published in May 2008 that seems to attempt to answer similar question but more specifically directed to OO design.

Apparently
the formal OO paradigm has come to sometimes clash with the very intuitions that produced it. Thus while objects, classes, and inheritance certainly have an intuitive flavour, their formal version in OOD is different in important ways from their intuitive origins.

Dual-process theory, imported from contemporary cognitive psychology, highlights the underlying mechanism of those situations where our intuitions clash with our more disciplined knowledge and reasoning..... Highly accessible features will influence decisions, while features of low accessibility will largely ignored.

The intuition, as discussed in this paper, is explained based on the Dual-Process theory, credited to D. Kahneman, which states that
our cognition and behavior operate in parallel in two quite different modes, called System 1 (S1) and System 2 (S2), roughly corresponding to our common sense notion of intuitive and analytical thinking.

... S1 processes are characterized as being fast, automatic, effortless, unconscious, and inflexible (difficult to change or overcome). In contrast, S2 processes are slow, conscious, effortful, and relatively flexible. In addition, S2 serves as monitor and critic of the fast automatic responses of S1, with the "authority" to override them when necessary. In many situations, S1 and S2 work in concert, but there are situations ... in which S1 produces quick automatic non-normative responses, while S2 may or may not intervene in is role as monitor and critic.
The paper is worth reading as it describes experiments with experienced developers rather than using students.

I wonder if this explains why it is much easier to get "experienced" people to do work (the S1 process at play or the assisted and influenced by habits) while harder to get someone to think (the S2 process and the need to counter to what habits may lead to)?

I am also wondering if S1 relates to the Accidental Tasks while S2 is to Essential Tasks in software development as elaborated long ago in the "No Silver Bullet" paper by Brooks?



[Hadar] "How intuitive is Object-Oriented Design?" by Irit Hadar and Uri Leron, CACM May 2008/Vol 51 No. 5, pp 41-46

[Brooks] "No Silver Bullet - Essence and Accidents of Software Engineering", Frederick P. Brooks, Jr. IEEE Computer April, 1987. Vol 20 No. 4, pp 10-19

Wednesday, February 29, 2012

What is more difficult - to think or to do something?

I always ponder what is more difficult? To think of solving a problem or dealing with a situation or simply doing something to attack the problem or situation.

I have observed over several years when I worked with developers of different levels and come away with a view that is more difficult to get someone to think (as in an analysis or design). It seems most developers are only too happy to do something whatever comes naturally, which may or may not produce the best solution.

Why is it harder to think? I wonder.

Recently, I come across an article which reports some experiments to study what is habit and how it influences one's action. Perhaps this is the answer, to think requires more mental activities and needs to overcome habits, which may not directly applicable to the task in hand (close but not exactly). Allowing the brain to select the right chunk reduces the brain activities and put oneself into an almost automatic mode.

But like many things in life: it is much easier to form bad habits than good and this increases the chance to apply bad habits than good resulting in inferior performance.

Friday, February 17, 2012

LibreOffice Base 3.5.0 fixes MS Access Connectivity problem

It is nice to see LibreOffice Base version 3.5.0 (Windows Edition) has fixed the MS Access Connectivity Problem reported previously.

Monday, February 13, 2012

Faulty LibreOffice Base MS Access Connectivity

Further to my last message reporting the bug in connecting LibreOffice Base (ver 3.4.5) in Windows to MS Access database, below are screen shot showing the bug.

For demonstrating this bug, I have created an very simple MS Access 2003 database as with a table called ListOfNumbers containing 20 records (numbers from 100 to 119) as shown here:


Having got the MS Access database, I then create a LibreOffice Base using MS Access connectivity as shown here:

 
Opening the ListOfNumbers in LibreOffice shows the missing first record showing only from 101 to 119, reporting only 19 records - one short! Notice the record that is missing.

The record is actually retrieved in the recordset, only not displayed. If you sort the record set in descending order, you will now see the missing last record (value 119) and the first record (value 100) is now displayed, as shown here:

That's the missing record is always the first record. This causes me to suspect that LibreOffice code fails to reconcile the differences in the bases of two different array convention; the Ole Automation Collection starts with 1 while the other more conventional one starts with zero.

Just to prove the MS Access is not faulty, I have created a different LibreOffice Base database but this time using ODBC connectivity with the MS Access ODBC driver and the result shown below reports no missing record.

 
Hence the only conclusion one can draw is a fault MS Access connectivity support from LibreOffice Base.

Thursday, January 19, 2012

Caveat in using LibreOffice Base to access MS Access Database

Microsoft's MS Office (Office XP) hostility to being deployed in a virtual machine has once again driven me to desert MS Office to use LibreOffice. It is not that it cannot be deployed in a VM but when one relocates the VM from one machine to another, MS Office's activation scheme rears its ugly head. Rather than re-activating, which only solves the problem temporarily, I have decided to ditch MS Office.

In so doing I have discovered a rather disturbing bug when trying to access MS Access (ver 2002) database from LibreOffice Base (ver 3.4.5).

In LibreOffice Base (Windows version 3.4.5), you can connect to MS Access directly using LibreOffice's driver or you can connect to MS Access via the MS Access ODBC driver.

The former connection technique seems to have some bug in handling the MS Access database and the latter technique using ODBC driver should be recommended, at least for this version. While the direct connection technique can open the database and access the tables and queries (they are all I have so far tested) producing seemly the right results. But on closer examination, it reveals some disturbing results.

The direct connection technique always reports one record less than what is the actual total number of records in MS Access. LibreOffice Access connector always does not show the first record of the result set. The missing record is always in the record set from the execution of the query. For example if the first column is your sequence number from 1 to whatever in increasing number.

If you sort that column in ascending order, record corresponding to sequence id 1 is not shown and the total number of records reported on the bottom of the view shows one less than what it should be. The record with the highest sequence number is the last record.

If you sort that column in descending order, the record with the highest number of sequence number is missing as it should now be the first record in the grid but now you will see the record corresponding to sequence number 1 as the last record. The total number of records is the same - one less than the actual number.

It does not matter whether you are querying a table directly or executing an Access Query, it always drops the first record of the result set in the grid. It seems the connector has an out-by-one bug or perhaps there are two index bases internally - one base zero and the other base 1 - and the program or driver fails to provide the correct mapping.

Now if you reconnect from Base to the very same database using ODBC connectivity by defining a ODBC Database source using MS Access ODBC driver. The above mentioned idiosyncrasy does not appear.

In conclusion: Do not use LibreOffice Base's MS Access connection driver; use ODBC connection technique to avoid missing record.

Thursday, November 10, 2011

Apple's way to fix iOS security vulnerability

Keep quiet and Shoot the messenger and this is a classic Security by Obscurity.

Charlie Miller recently found a security vulnerability in iOS and shows it on YouTube. This has embarrassed Apple.

I am wondering how many 'silent messengers' out there going about merrily exploiting holes without telling Apple. After this episode why would researcher bother to tell Apple, the ungrateful lot.

Sunday, October 16, 2011

Win 7 slow file copying to network drive - is it Win7 problem?

I was backing up files using RoboCopy from my Win7 (64-bit) home machine to a network drive mounted on an XP Prof machine and noticed it was awfully slow. A check of the Network Utilization in the Task Manager's Network tab revealed that it was clocking only 2-4% and no one was using the network except me.

When I was reading this thread seeking any solution to my problem, I never believed it was the fault of Win7. Why? When I was doing a similar operation using a Cat5e cable with my laptop, the network utilization was in excess of 98% constantly. Hence I knew it was not Win7, as blamed by the above thread nor my network.

I knew it must be hardware associated with this machine that exhibited the slowness. Thankfully experience told me not to follow the instructions posted on the Internet blindly or else I could end up in a worse shape than I began with.

It turned out the solution was simpler than many would have guessed and it was highly unusual but the signs were always there.

It was a faulty Cat5e that was used to connected this machine to the router. The cable did not exactly not broken. Only the transmit line must be hanging by the thread resulting in slow copy to the server but acceptable performance in copying from the server. What pointed me to this simple solution was the fact that I was using a totally different cable when connecting the laptop to the network.

Blog Archive