Development processes have fundamental problems they address, a philosophy by which they try to solve that problem and methods by which they implement that philosophy.
Problem that Agile solves is ever changing requirements of enterprise applications.
There are those who laugh at Agile for how awfully it would fail in building an air plane (technically speaking, proper agile will not fail, but it’s not at all the correct process to use there) and then go try to make an information system to a galactic government using a formal process and fail even more miserably. (I wanted to say kite, but wanted to emphasize size is not the problem). And this goes vice versa.
Smart project teams chose the right process for the right project. They don’t brand themselves as agile or formal. They are simply good engineers who are good at applying proper solution for the problem at hand right from the process itself.
Showing posts with label Technical. Show all posts
Showing posts with label Technical. Show all posts
Thursday, June 16, 2011
Tuesday, June 14, 2011
How’s your agile process working for you?
Are you practicing an agile process in your team? Do you still find your team working through the night? Do you still find your software to be rigid, fragile and immobile? Do you still find changes of requirements to be nightmares to the developers? How do you suppose those situations are possible with an Agile process?
Unfortunately, this is the situation in almost all Agile practicing and Agile preaching companies we have around in Sri Lanka. I’ve crossed my paths with quite a few developers from these companies and they all have the same story to tell; agile for them, is the same old cycle, without the documentation and without a designing phase - which makes their development life worse. Non-technical project managers are still around, being called by other names, and to add to the misery, now the customers bring the pressure directly to the developer - because it’s “Agile”.
Is Agile a bad idea? What’s going wrong? Why can’t we make it work? Have you seen the list of names in the Agile manifesto at http://agilemanifesto.org/? Do you think those are the kind of people who would invest on a failing process? Besides, they’ve been practicing and teaching it for over a decade now. So if there’s anything wrong with Agile, it’s more likely in the way we practice it.
Management elements such as deadlines, budgets and sucking up to customers’ aside, we developers too need to change some fundamental ideologies towards development in order to make Agile, well Agile. It is not to say that the operational model doesn’t matter, indeed, that’s what makes Agile possible. Someone should be available to the team to represent the customer, acceptance tests should be automated and made available to the developers when feature requests / changes are made; team should be responding to changes than follow a plan; team should be able focus on getting a working product out instead of documenting etc. etc. which all agile gurus will tell you; but the part they don’t speak about; the part the folks came up with agile manifesto took for granted; the part that is responsible for more than half the agile failures in Sri Lanka is with the developers.
One misconception most developers in Sri Lanka have about Agile development is, it is coding without design or documentation. The other misconception is to think getting software to “work” means getting the functionality out one way or another. The Agile philosophy has very different interpretations for these and is defined with the implied expectation of strong object oriented concepts and design principles of the developers.
By the term “a working product” what’s meant is a functional, testable and maintainable product. Not just functional. If a piece of code provides the functionality required, but only the developer himself could read and understand how it does that, it is not a working product by Agile definitions. Developers are to get the code to work and then refactor till it’s readable, not duplicating code and as simple as it could be but not simpler.
Refactoring to make code readable, non-duplicative, simple and free of unused design complexities and code is a constant practice that developers are expected to follow whenever they code something.
The design focus of Agile is much more implied than explicit. In each iteration, Agile focus on getting a working product to the customer. The team narrows their focus only on the features that are planned for that iteration making it as simple and expressive as possible; yet not losing the overall picture - or at least what exist of it at the time. This practice makes sure that the design never gets complicated than necessary and serves to the problem at hand than expected (but volatile) problems of the future. One of the problems in designing the whole application at once is that the architect is force to foresee requirements of the future; with requirements ever changing and little understanding of them to begin with; this is not a task someone could get 100% right. That’s why Agile promotes this simplistic approach which could accommodate changes more easily.
Unit Tests for agile developers are a design practice than a verification step. Writing the non-compiling unit test is defining the contract for a component. Developer should do due diligence and consider who are the consumers and think how the consumers would want to use a class. Note that the tests are written for the public interface of the class, the tests care only about the functionality exposed through that. Once the developer get the unit tests to pass, he can then go on refactoring his code to be simple, readable and non-duplicative - one step at a time - without worrying about breaking the functionality unknowingly; because the tests are there to guard against that.
The next aspect of design developers ignore in Agile is how exactly the changes are accommodated. Remember that agile designs are as simple as possible meaning that when code is first written, it is not accommodating flexibility for “potential” change. But when the first change comes, the developers should follow the object oriented design principles and separate the changing elements of code from the non-changing elements of code, evolving the design in that part, so that a second change in the same area would be easier and simpler than the first. This practice prevents the code becoming stale over repeated changes, still keeping the code as simple as possible.
As always, developers should keep themselves up to date not only with the new technologies but of the time proven concepts; and the organizations who wish to harness the benefits of any methodology should invest on getting their developers in par with that methodology.
References
Agile Principles, Patterns, and Practices in C# By Robert C. Martin, Micah Martin
Agile Software Development: The Cooperative Game, Second Edition By Alistair Cockburn
Test-Driven Development By Example By Kent Beck
Unfortunately, this is the situation in almost all Agile practicing and Agile preaching companies we have around in Sri Lanka. I’ve crossed my paths with quite a few developers from these companies and they all have the same story to tell; agile for them, is the same old cycle, without the documentation and without a designing phase - which makes their development life worse. Non-technical project managers are still around, being called by other names, and to add to the misery, now the customers bring the pressure directly to the developer - because it’s “Agile”.
Is Agile a bad idea? What’s going wrong? Why can’t we make it work? Have you seen the list of names in the Agile manifesto at http://agilemanifesto.org/? Do you think those are the kind of people who would invest on a failing process? Besides, they’ve been practicing and teaching it for over a decade now. So if there’s anything wrong with Agile, it’s more likely in the way we practice it.
Management elements such as deadlines, budgets and sucking up to customers’ aside, we developers too need to change some fundamental ideologies towards development in order to make Agile, well Agile. It is not to say that the operational model doesn’t matter, indeed, that’s what makes Agile possible. Someone should be available to the team to represent the customer, acceptance tests should be automated and made available to the developers when feature requests / changes are made; team should be responding to changes than follow a plan; team should be able focus on getting a working product out instead of documenting etc. etc. which all agile gurus will tell you; but the part they don’t speak about; the part the folks came up with agile manifesto took for granted; the part that is responsible for more than half the agile failures in Sri Lanka is with the developers.
One misconception most developers in Sri Lanka have about Agile development is, it is coding without design or documentation. The other misconception is to think getting software to “work” means getting the functionality out one way or another. The Agile philosophy has very different interpretations for these and is defined with the implied expectation of strong object oriented concepts and design principles of the developers.
By the term “a working product” what’s meant is a functional, testable and maintainable product. Not just functional. If a piece of code provides the functionality required, but only the developer himself could read and understand how it does that, it is not a working product by Agile definitions. Developers are to get the code to work and then refactor till it’s readable, not duplicating code and as simple as it could be but not simpler.
Refactoring to make code readable, non-duplicative, simple and free of unused design complexities and code is a constant practice that developers are expected to follow whenever they code something.
The design focus of Agile is much more implied than explicit. In each iteration, Agile focus on getting a working product to the customer. The team narrows their focus only on the features that are planned for that iteration making it as simple and expressive as possible; yet not losing the overall picture - or at least what exist of it at the time. This practice makes sure that the design never gets complicated than necessary and serves to the problem at hand than expected (but volatile) problems of the future. One of the problems in designing the whole application at once is that the architect is force to foresee requirements of the future; with requirements ever changing and little understanding of them to begin with; this is not a task someone could get 100% right. That’s why Agile promotes this simplistic approach which could accommodate changes more easily.
Unit Tests for agile developers are a design practice than a verification step. Writing the non-compiling unit test is defining the contract for a component. Developer should do due diligence and consider who are the consumers and think how the consumers would want to use a class. Note that the tests are written for the public interface of the class, the tests care only about the functionality exposed through that. Once the developer get the unit tests to pass, he can then go on refactoring his code to be simple, readable and non-duplicative - one step at a time - without worrying about breaking the functionality unknowingly; because the tests are there to guard against that.
The next aspect of design developers ignore in Agile is how exactly the changes are accommodated. Remember that agile designs are as simple as possible meaning that when code is first written, it is not accommodating flexibility for “potential” change. But when the first change comes, the developers should follow the object oriented design principles and separate the changing elements of code from the non-changing elements of code, evolving the design in that part, so that a second change in the same area would be easier and simpler than the first. This practice prevents the code becoming stale over repeated changes, still keeping the code as simple as possible.
As always, developers should keep themselves up to date not only with the new technologies but of the time proven concepts; and the organizations who wish to harness the benefits of any methodology should invest on getting their developers in par with that methodology.
References
Agile Principles, Patterns, and Practices in C# By Robert C. Martin, Micah Martin
Agile Software Development: The Cooperative Game, Second Edition By Alistair Cockburn
Test-Driven Development By Example By Kent Beck
Saturday, May 28, 2011
The specification of a method
Sometime back I read Alan Shalloway’s wonderful book “Design Patterns Explained: A New Perspective on Object-Oriented Design
” which I think makes a wonderful pre-read for anyone who’s going to read the GoF design patterns book. But even if you’ve already read the GoF, like I had, Alan’s book still is a good read.
In that book, Alan brings the point that any object oriented software component should be looked at in three different perspectives,
At any given level of abstraction - application | component | package | class | method - this stands true and is very important to separate these concerns in designing at each level.
I'd like to give a thought on how this is applicable at the level of a method. Let’s take an example to make things easier to understand. A method that converts a string to a number.
What is the responsibility?
Convert a string to a number of cause, but does that statement describe everything?
What’s the contract?
Defining the contract is the step which is going to make the responsibility of the method more explicit, and define the explicit usage of the method.
What are the parameters the method would take? Just the string to be converted? Should it get control parameters?
What’s the format of the string should be?
What would the method return if the format is incorrect? Would it return a default value? Would it throw an exception (what type of exception) or would it return null?
What type is the number? Integer or float? Could it be both? If so, how would the method return it?
What’s the implementation?
We should only get at this once we have the answers to the above two questions. And our implementation should depend on them, the responsibility or the contract should not change by our implementation - remember the dependency inversion principle!
So why is this post called “The specification of a method”? Because that’s where I’d like to focus for the rest of this post. That’s where I see room for a lot of improvements.
How exactly do we define the contract for a method after we do have the answers to the questions like what we saw above? It should all end up in the method signature. But, most languages only allow us to specify parameters and return types; so how do we communicate exceptions and whether a method would return null or not?
Java is a language that goes one step further and offer checked exceptions that allow us to express in the method signature what type of exceptions are thrown by the method; which I learned to appreciate only very recently. That’s a feature which make sure an application will not ever crash due to an unhandled exception, by making method contracts explicit.
That’s one good example that making the contract explicit contributes directly towards application stability and better coding practice. (But there are debates on whether this is a good thing or a bad thing - I think it is good.)
How do we do this in .NET? We could add the exception details in the XML comment documentation. But that’s not as good as the compiler mandate of java.
The other part of the signature which we miss a lot is conveying the fact whether a method would return null or not. We see quite a few null reference exceptions and quite a few null checks on methods that do not return nulls than we would like to in our day-today life. Some argue that it’s a “good” practice to check null even if a return value cannot be null. But that’s a pretty lame claim isn't it?
There are two ways that I could think of to overcome this. Obviously we can comment if a null value is returned by the method. But there’s no guarantee that someone someday would forget the comment and would not check null. The much thoughtful approach is to implement the Special Case pattern (PoEAA
). In which, separate implementations are given to such anomalies as null for the same interface, so that the consumer need not worry about exceptions. But, it’s a design decision that has to be taken much earlier than you start to design method signatures.
Regardless of how we are going to handle these information in the method signatures, if we do define them upfront and communicate to the consumers of the method (and of cause stick to that contract within the implementation) we are bound to improve stability and the quality of code in our applications.
In that book, Alan brings the point that any object oriented software component should be looked at in three different perspectives,
- Concept - which is the responsibility of that particular component (i.e. what it’s supposed to do)
- Specification - which is the contract with the external entities (i.e. how it would be used)
- Implementation - which is how that component is actually going to get the job done.
At any given level of abstraction - application | component | package | class | method - this stands true and is very important to separate these concerns in designing at each level.
I'd like to give a thought on how this is applicable at the level of a method. Let’s take an example to make things easier to understand. A method that converts a string to a number.
What is the responsibility?
Convert a string to a number of cause, but does that statement describe everything?
What’s the contract?
Defining the contract is the step which is going to make the responsibility of the method more explicit, and define the explicit usage of the method.
What are the parameters the method would take? Just the string to be converted? Should it get control parameters?
What’s the format of the string should be?
What would the method return if the format is incorrect? Would it return a default value? Would it throw an exception (what type of exception) or would it return null?
What type is the number? Integer or float? Could it be both? If so, how would the method return it?
What’s the implementation?
We should only get at this once we have the answers to the above two questions. And our implementation should depend on them, the responsibility or the contract should not change by our implementation - remember the dependency inversion principle!
So why is this post called “The specification of a method”? Because that’s where I’d like to focus for the rest of this post. That’s where I see room for a lot of improvements.
How exactly do we define the contract for a method after we do have the answers to the questions like what we saw above? It should all end up in the method signature. But, most languages only allow us to specify parameters and return types; so how do we communicate exceptions and whether a method would return null or not?
Java is a language that goes one step further and offer checked exceptions that allow us to express in the method signature what type of exceptions are thrown by the method; which I learned to appreciate only very recently. That’s a feature which make sure an application will not ever crash due to an unhandled exception, by making method contracts explicit.
That’s one good example that making the contract explicit contributes directly towards application stability and better coding practice. (But there are debates on whether this is a good thing or a bad thing - I think it is good.)
How do we do this in .NET? We could add the exception details in the XML comment documentation. But that’s not as good as the compiler mandate of java.
The other part of the signature which we miss a lot is conveying the fact whether a method would return null or not. We see quite a few null reference exceptions and quite a few null checks on methods that do not return nulls than we would like to in our day-today life. Some argue that it’s a “good” practice to check null even if a return value cannot be null. But that’s a pretty lame claim isn't it?
There are two ways that I could think of to overcome this. Obviously we can comment if a null value is returned by the method. But there’s no guarantee that someone someday would forget the comment and would not check null. The much thoughtful approach is to implement the Special Case pattern (PoEAA
Regardless of how we are going to handle these information in the method signatures, if we do define them upfront and communicate to the consumers of the method (and of cause stick to that contract within the implementation) we are bound to improve stability and the quality of code in our applications.
Thursday, December 23, 2010
Strong name validation failed. on 64bit windows - 32bit Visual Studio
If you are running a 32bit version of Visual Studio on a 64bit Windows version, and want to add a strong name exception for a delay signed assembly, the usual methods of running
"sn -Vr *, [public key token]"
Example:
sn -Vr *,89845dcd8080cc91
or adding the registry key manually to
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\"
Example:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\*,89845dcd8080cc91]
would not work.
The reason being that the 64bit windows registry has a separate area for 32bit applications. And, the sn.exe is not updating that.
To work around it, you have to add your strong name exceptions to the following location of the windows registry.
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\
Example:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\*,89845dcd8080cc91]
"sn -Vr *, [public key token]
or adding the registry key manually to
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\"
Example:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\*,89845dcd8080cc91]
would not work.
The reason being that the 64bit windows registry has a separate area for 32bit applications. And, the sn.exe is not updating that.
To work around it, you have to add your strong name exceptions to the following location of the windows registry.
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\
Example:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\*,89845dcd8080cc91]
Monday, June 28, 2010
Kubuntu/Ubuntu: "hda-intel: spurious response" on Intel Atom and D945GCLF
If you are going to install Ubuntu / Kubuntu on an Intel Atom based computer with the D945 based chipset; be aware that there is a bug in the linux kernal which leads to printing of following line continuously on screen, preventing you from logging-in. Sometimes when you reset the machine, it goes away but not at most of the times.
hda-intel: spurious response 0x0:0x0, last cmd=0x000000
The error looks as if it's from the sound driver; but the workaround for it is in the graphics department :)
In the BIOS setup, Video Settings, Set the IGD Aperture size to 256MB (The default is 128MB; in which the above error occur).
P. S. You can get to BIOS setup by pressing F1 key at computer startup.
hda-intel: spurious response 0x0:0x0, last cmd=0x000000
The error looks as if it's from the sound driver; but the workaround for it is in the graphics department :)
In the BIOS setup, Video Settings, Set the IGD Aperture size to 256MB (The default is 128MB; in which the above error occur).
P. S. You can get to BIOS setup by pressing F1 key at computer startup.
Sunday, June 27, 2010
Getting ZTE MF100 from Mobitel Lanka to work on Kubuntu 10.04
It's much easier than you would imagine. You need not use "wvdial"; the KNetworkManager works like a charm. This should work the same for other plug and play 3G modems by Sri Lanka Mobitel and Dialog too.
First; plug in your MF100. Kubuntu would auto detect the modem and show a mobile icon in the system tray. If you are already connected to a network, the icon would appear in the context menu of the KNetworkManager like below.
Click on "Mobile Broadband - Create network connection" to get the following dialog
Fill the information as follows:
Connection name: any name
Connect automatically: check "Connect automatically" if you wish to establish the connection automatically when you plug the modem
In the Mobile Broadband tab:
Number: *99#
User name: anything but blank
Password: anything but blank
APN: "mobitel3g" (without quotes) for Mobitel. I think for Dialog it's www.dialogsl.com please verify.
Type: Any (try "Prefer 3G" or "3G UMTS/HSPA" if you have better 3G reception
Leave other fields as they are.
In the PPP tab:
Check "PAP" under Authentication and de-select every other option.
Click OK to save settings and connect to the internet, and if you did not use auto connect; you'll have to click the icon in the system tray to activate the connection.
It's that simple! :)
First; plug in your MF100. Kubuntu would auto detect the modem and show a mobile icon in the system tray. If you are already connected to a network, the icon would appear in the context menu of the KNetworkManager like below.
Click on "Mobile Broadband - Create network connection" to get the following dialog
Fill the information as follows:
Connection name: any name
Connect automatically: check "Connect automatically" if you wish to establish the connection automatically when you plug the modem
In the Mobile Broadband tab:
Number: *99#
User name: anything but blank
Password: anything but blank
APN: "mobitel3g" (without quotes) for Mobitel. I think for Dialog it's www.dialogsl.com please verify.
Type: Any (try "Prefer 3G" or "3G UMTS/HSPA" if you have better 3G reception
Leave other fields as they are.
In the PPP tab:
Check "PAP" under Authentication and de-select every other option.
Click OK to save settings and connect to the internet, and if you did not use auto connect; you'll have to click the icon in the system tray to activate the connection.
It's that simple! :)
Saturday, June 19, 2010
Kubuntu 10.04 LTS
I've used Linux some years ago. In the days of Red Hat 6.4 and then 7.1. My career in .NET development and probably some frustrations with compatibility issues with my hardware at that time, made me switch back to Windows and never look back. I've since used and promoted Windows and had perceived all Linux compilations to be at the same level as Red Hat 6.4.
I did downloaded Fedora 11 in 2008 or so due to frustrations over Windows Vista but somehow never installed it. When Windows 7 came along, I thought Windows days are here to stay. But Janaka at office kept talking about Ubuntu once in a while and that made me want to give it a shot.
I received my CD of Kubuntu 10.04 LTS from good people at Canonical couple of days ago. I installed it on a VM on the same day and was impressed with the user experience. Today, I installed it on my father's laptop and boy! I'm loving it.
So, those of you who are using pirated copies of windows making the excuse that Linux is not in par... Take another look at Kubuntu 10.04. It's way better looking and faster than Windows 7 and is guilt free!
The DigiKam application is a feature rich image editing tool at par with Nikon's Capture NX. Open Office has come a long way to be a good office suite and Google Chrome lives by the name of Chromium in the Linux world. I haven't looked at any of the IDEs yet, but I'm sure there are some that could compete with Microsoft's Visual Studio.
So, this is me, a pro-microsoftee asking you to try out Kubuntu. Believe me, it's really nice.
I did downloaded Fedora 11 in 2008 or so due to frustrations over Windows Vista but somehow never installed it. When Windows 7 came along, I thought Windows days are here to stay. But Janaka at office kept talking about Ubuntu once in a while and that made me want to give it a shot.
I received my CD of Kubuntu 10.04 LTS from good people at Canonical couple of days ago. I installed it on a VM on the same day and was impressed with the user experience. Today, I installed it on my father's laptop and boy! I'm loving it.
So, those of you who are using pirated copies of windows making the excuse that Linux is not in par... Take another look at Kubuntu 10.04. It's way better looking and faster than Windows 7 and is guilt free!
The DigiKam application is a feature rich image editing tool at par with Nikon's Capture NX. Open Office has come a long way to be a good office suite and Google Chrome lives by the name of Chromium in the Linux world. I haven't looked at any of the IDEs yet, but I'm sure there are some that could compete with Microsoft's Visual Studio.
So, this is me, a pro-microsoftee asking you to try out Kubuntu. Believe me, it's really nice.
Tuesday, June 08, 2010
Ironic
This is funny; but unfortunately, I think I signed somewhere agreeing not to discuss these things in detail in public. So this is what I guess would be okay to write here.
I'm writing code for the next version of an application server that most of the .NET developers would soon start to use. And, that server is going to have a new feature integrated in to it by default - out of the box. I'm right now trying to get that done - get that feature integrated and made default through its post setup configuration program.
Since these two products were in the existence for sometime I thought someone must have done it before - not out of the box, but through some post setup customization. So I Googled... And the first hits I get are news items that say "The X server would have Y service by default - out of the box in its next release"... :)
I'm writing code for the next version of an application server that most of the .NET developers would soon start to use. And, that server is going to have a new feature integrated in to it by default - out of the box. I'm right now trying to get that done - get that feature integrated and made default through its post setup configuration program.
Since these two products were in the existence for sometime I thought someone must have done it before - not out of the box, but through some post setup customization. So I Googled... And the first hits I get are news items that say "The X server would have Y service by default - out of the box in its next release"... :)
Friday, May 28, 2010
Update: Is there something wrong in google app hosting?
Found out the cause; If you are using SLT ADSL; you cannot reach any of the google hosted contents using a custom domain name. SLT as usual; has screwed it up.
May be they are taking advise from China and are in the process of blocking out Google.. or whatever. In all accounts.. fuck SLT; they seem to even block the Google's DNS server IPs.. I was using 8.8.8.8 and 8.8.4.4 as my DNS settings and I was experiencing a lot of failures in DNS resolving. Didn't suspect SLT. I just switched to SLT DNS servers and lot of things got corrected. But who knows.. may be they are monitoring my internet usage too.
You could use a custom proxy for now to access all those unreachable blogs with custom domains.
But long term... complain to SLT. Make demands. Or let's just switch ISPs.. Dialog?
May be they are taking advise from China and are in the process of blocking out Google.. or whatever. In all accounts.. fuck SLT; they seem to even block the Google's DNS server IPs.. I was using 8.8.8.8 and 8.8.4.4 as my DNS settings and I was experiencing a lot of failures in DNS resolving. Didn't suspect SLT. I just switched to SLT DNS servers and lot of things got corrected. But who knows.. may be they are monitoring my internet usage too.
You could use a custom proxy for now to access all those unreachable blogs with custom domains.
But long term... complain to SLT. Make demands. Or let's just switch ISPs.. Dialog?
Wednesday, May 26, 2010
Did you format your memory card?
I did; Last night.
I had given the camera to Buddhi for him to use as an extra at a wedding shoot. He didn't had an assistant so he ended up using only his camera. Halfway through he ran out of storage in his card and swap the SD cards with mine.
Yesterday; I collected my camera, and was putting it and the lenses in the desiccator when I got the urge to shoot few shots; I turned the camera on, and it said the memory card needs formatting; So I did format it, shot some random photos and placed it in the desiccator.
Then I go switch on the laptop; in a while, in gtalk, Buddhi goes
So we start the search for recovery tools... Most tools were commercial products; price ranging from $10 to $400 or so.. We downloaded a few trials and did test runs on spare memory cards. And then Budhhi found this: http://dmitrybrant.com/diskdigger
It's a freelife-saver data-recovery tool developed by Dmitry Brant.
So; we finished our adventure later...
I had given the camera to Buddhi for him to use as an extra at a wedding shoot. He didn't had an assistant so he ended up using only his camera. Halfway through he ran out of storage in his card and swap the SD cards with mine.
Yesterday; I collected my camera, and was putting it and the lenses in the desiccator when I got the urge to shoot few shots; I turned the camera on, and it said the memory card needs formatting; So I did format it, shot some random photos and placed it in the desiccator.
Then I go switch on the laptop; in a while, in gtalk, Buddhi goes
buddhi:
oh fuck
the photos
are in the disk
11:00 PM hope you didn't format any :)
me: the one you gave me?
buddhi: yup
me: in my cam??
buddhi: yup
me: fuck me sideways
buddhi: damn
So we start the search for recovery tools... Most tools were commercial products; price ranging from $10 to $400 or so.. We downloaded a few trials and did test runs on spare memory cards. And then Budhhi found this: http://dmitrybrant.com/diskdigger
It's a free
So; we finished our adventure later...
me: guess i'll hit the bed now
:)
usual time
:)
buddhi: :
:)
so there seems to be a curse
not letting us sleep early
2:05 AM me: yeah
buddhi: :)
Wednesday, May 19, 2010
XML Validation error: Data at the root level is invalid. - could be a UTF BOM issue
UTF has an optional Byte Order Marker at the beginning of the file. The UTF encoding classes included in the .NET Frameworks previous to 4.0 by default did not write this BOM. Hence, most applications we wrote to read UTF files does not handle the BOM. :)
I recently wrote a tool using Visual Studio 2010
to generate a UTF8 encoded XML file to be consumed by another application which read the XML file using PowerShell. That app failed with an error "XML Validation error: Data at the root level is invalid. Line 1, position 1." Of cause, opening the file in Notepad2 didn't show any suspicious characters. Some educated colleagues pointed us at the possibility of BOM; which proved to be the case.
The fix is relatively easy. The UTF encoding class constructors takes in a boolean parameter encoderShouldEmitUTF8Identifier. Just pass false in to that.
//
// Summary:
// Initializes a new instance of the System.Text.UTF8Encoding class. A parameter
// specifies whether to provide a Unicode byte order mark.
//
// Parameters:
// encoderShouldEmitUTF8Identifier:
// true to specify that a Unicode byte order mark is provided; otherwise, false.
public UTF8Encoding(bool encoderShouldEmitUTF8Identifier);
Example using a XML writer:
XmlTextWriter writer = new XmlTextWriter(exportPath, new UTF8Encoding(false));
I recently wrote a tool using Visual Studio 2010
The fix is relatively easy. The UTF encoding class constructors takes in a boolean parameter encoderShouldEmitUTF8Identifier. Just pass false in to that.
//
// Summary:
// Initializes a new instance of the System.Text.UTF8Encoding class. A parameter
// specifies whether to provide a Unicode byte order mark.
//
// Parameters:
// encoderShouldEmitUTF8Identifier:
// true to specify that a Unicode byte order mark is provided; otherwise, false.
public UTF8Encoding(bool encoderShouldEmitUTF8Identifier);
Example using a XML writer:
XmlTextWriter writer = new XmlTextWriter(exportPath, new UTF8Encoding(false));
Wednesday, May 12, 2010
Why Google search is still the best
I use GhostDoc for code documentation.
Today, I was working on a different machine and found that it doesn't have ghost doc installed. I opened up a browser and typed ghostdoc in the search box and hit enter. For my surprise, I couldn't find the SubMain site on the first page of search results. Puzzled; I looked what's wrong to find out that the search engine was Bing...
Open up google and search GhostDoc and the first hit is the correct download site.
Search Google for "Mahasen" and the first hit is this blog.. it even suggest "Mahasen Bandara"; Bing doesn't fetch this seven year old blog till the 9th page; But it fetches my two weeks old site photoweaver.net in the first page.
I don't see myself using Bing anytime sooner...
Today, I was working on a different machine and found that it doesn't have ghost doc installed. I opened up a browser and typed ghostdoc in the search box and hit enter. For my surprise, I couldn't find the SubMain site on the first page of search results. Puzzled; I looked what's wrong to find out that the search engine was Bing...
Open up google and search GhostDoc and the first hit is the correct download site.
Search Google for "Mahasen" and the first hit is this blog.. it even suggest "Mahasen Bandara"; Bing doesn't fetch this seven year old blog till the 9th page; But it fetches my two weeks old site photoweaver.net in the first page.
I don't see myself using Bing anytime sooner...
Monday, May 10, 2010
Wordpress acts Linux (or worse?)
Our team decided to start a group blog to write about tech stuff. After spending at least couple of hours deciding on the domain name (I'll refrain from posting the name now as it's not in proper shape yet) we spent only a few minutes in deciding on the host (blogger/wordpress) to finally deciding to use wordpress.
If you own a blogger blog, you know that Google offer a domain name and Google Apps (docs, email, sites, chat and so much more) for your blog for just $10 per month. If you already have a domain name, everything above is free. Yes, FREE.
Wordpress on the other hand is charging 9.97$ for using a custom domain name (No. That's not for the domain name. That's just for using a custom domain name on the blog) But of cause they offer the domain name for a subsidized price of $5. What do they offer for 9.97$? Just the blog of cause. No email, no nothing. Just the blog. You have control over DNS so, if you do have an email hosting account somewhere, you could add a MX record.
How do you customize your Google profile in blogger? You just go there and change things right? It's all intuitive. Wordpress, on the other hand haven't heard of the concept of intuitiveness. It's all a mess there.
So what's with Linux you ask? it's like this. Linux is secure, powerful and so on; but the effort and the learning curve it takes a beginner to accomplish a very common task like installing a printer is quite high. So it is in Wordpress; but worse; this is a paid service.
If you own a blogger blog, you know that Google offer a domain name and Google Apps (docs, email, sites, chat and so much more) for your blog for just $10 per month. If you already have a domain name, everything above is free. Yes, FREE.
Wordpress on the other hand is charging 9.97$ for using a custom domain name (No. That's not for the domain name. That's just for using a custom domain name on the blog) But of cause they offer the domain name for a subsidized price of $5. What do they offer for 9.97$? Just the blog of cause. No email, no nothing. Just the blog. You have control over DNS so, if you do have an email hosting account somewhere, you could add a MX record.
How do you customize your Google profile in blogger? You just go there and change things right? It's all intuitive. Wordpress, on the other hand haven't heard of the concept of intuitiveness. It's all a mess there.
So what's with Linux you ask? it's like this. Linux is secure, powerful and so on; but the effort and the learning curve it takes a beginner to accomplish a very common task like installing a printer is quite high. So it is in Wordpress; but worse; this is a paid service.
Saturday, June 20, 2009
2009 International Young ICT Professional Conference

The 6th annual International Young ICT Professionals Conference will be held on the 3rd and 4th of September, 2009 at the Dockside Convention Centre, Darling Harbour in Sydney Australia.
This year's theme is "Future of ICT - Lead, Transform, and Succeed". The conference will combine a trade show and draw top ICT Professionals and Graduates in addition to international guests. The program will provide young professionals, recent graduates and university students around the world with the techniques, skills and confidence to advance their career in Information Communications Technology (ICT). A Panel Discussion is included as part of the 2 day program.
You can register for the event at http://www.acs.org.au/youngit/2009conference/
Tuesday, January 06, 2009
The way we screw requirements up.
My previous job was at a small software firm. They had no software development process at all. There was couple of people who mainly interacted with the customer to get the requirements. They spend few days with the customer discussing; and then sit with the developer for half an hour and ask him to write it! No documentation; no diagrams; no nothing. Write this. Once in a while they’d check what’s going on; show the customer what’s going on and change few things here and there and that’s it!...
Needless to say; we never made correct estimates; we never delivered what we initially thought the system was and very little number of customers came back. The applications were not designed at all. They were ad-hoc code with only the blessings of the skills of the developer.
That sucked… So I joined this company which has a pretty matured software development process. It defines how to capture requirements in different scenarios and conducts periodic audits to make sure that everyone is on track. Pretty neat eh? This all works well when everyone involved in it is committed and competent (almost all committed people are competent and almost all un-committed people are incompetent. Once in a while there’s a committed but incompetent person and a competent but un-committed one.)
But requirement capturing was a nightmare in the last two projects I worked in. Why? Some smart-ass thought anyone with CIMA or a MBA, who’s fluent in English, could be a BA. They simply didn’t know reasoning or probability. They just wrote what they heard. (I’m pretty sure they didn’t understand a thing what the customer wanted. But they didn’t know how to ask a question so that there won’t be ambiguity)
So what’s the end product? A big pile of documents that has no value at all and several wasted months (this is no small deal; one project had two BAs who wasted three months and the other had 5(!) BAs who wasted 10 months!!).
So; to think of it; the first company did less damage to the customer and the developers than the second.
So what really works?
A requirement capturing process practiced by professional BAs or Software Architects. That works really well - I’ve seen that. So; if you have any stake in a software project, make sure that you are talking with someone who’s capable of translating your requirements in to something that developers understand. Otherwise you’d just be wasting time and money - a lot of it (those 5 BAs wasted at least about US$1 million).
Needless to say; we never made correct estimates; we never delivered what we initially thought the system was and very little number of customers came back. The applications were not designed at all. They were ad-hoc code with only the blessings of the skills of the developer.
That sucked… So I joined this company which has a pretty matured software development process. It defines how to capture requirements in different scenarios and conducts periodic audits to make sure that everyone is on track. Pretty neat eh? This all works well when everyone involved in it is committed and competent (almost all committed people are competent and almost all un-committed people are incompetent. Once in a while there’s a committed but incompetent person and a competent but un-committed one.)
But requirement capturing was a nightmare in the last two projects I worked in. Why? Some smart-ass thought anyone with CIMA or a MBA, who’s fluent in English, could be a BA. They simply didn’t know reasoning or probability. They just wrote what they heard. (I’m pretty sure they didn’t understand a thing what the customer wanted. But they didn’t know how to ask a question so that there won’t be ambiguity)
So what’s the end product? A big pile of documents that has no value at all and several wasted months (this is no small deal; one project had two BAs who wasted three months and the other had 5(!) BAs who wasted 10 months!!).
So; to think of it; the first company did less damage to the customer and the developers than the second.
So what really works?
A requirement capturing process practiced by professional BAs or Software Architects. That works really well - I’ve seen that. So; if you have any stake in a software project, make sure that you are talking with someone who’s capable of translating your requirements in to something that developers understand. Otherwise you’d just be wasting time and money - a lot of it (those 5 BAs wasted at least about US$1 million).
Sunday, April 27, 2008
Prabath's podcast
Prabath recently did a podcast on OpenId integration of WSO2 Identity Solution.
According to podcast page "Prabath Siriwardene is a member of the WSO2 Identity Solution team and is currently working on integrating OpenID support. He has over 3 years industry experience in Microsoft .NET technologies."
But take my word, he's one heck of a techie than that.
According to podcast page "Prabath Siriwardene is a member of the WSO2 Identity Solution team and is currently working on integrating OpenID support. He has over 3 years industry experience in Microsoft .NET technologies."
But take my word, he's one heck of a techie than that.
Tuesday, November 06, 2007
Brought ADSL
I brought SLT ADSL to my home in Kandy.
The connectivity right now is pretty impressive but SLT is one of the worst service providers in the region when it comes to their customer care.
I didn't buy any hardware from them as I wanted to go for a Linksys router so they just wouldn't give me their configurations! Luckily I got them from Prabath and there were quite a few blogs around giving out the settings as well.
On Saturday, I managed to connect but the connection was not stable and it was damn slow as well. So I called to complain and they said the connection is not given yet! I called back on Sunday and received the same response. But I managed to get connected twice. So I went to SLT Teleshop in Kandy on Monday and asked them what the heck is going on... Then they said the connection was given on Sunday and lodge a complain for disturbance in the line.
I went back home and started to pack to come back to Colombo. Then I received a call from SLT maintenance and the person on the line straightaway asked me how many lines I have in parallel. I said none. Then he asked me how could that be possible!!! I told him that I've connected the router straight to the wall outlet and it's not sharing the line with a phone. Then he went on to say that it must be a configuration error and can NOT be a problem in the line. I got pissed off by his arrogance and the rude manner so I gave him a piece of advise on customer care as well as the technical details of ADSL and hang up.
Then at around 7PM suddenly the link got up and every thing started to work out of the blue!! So I stayed back, taught amma (mom) and appachchi (dad) how to play with IM and email. Updated all the virus guards, spam filters, security updates etc. etc. in my home machine and came back around 11PM.
Hmm... checked during the day today and it seems to be working fine for now.
The connectivity right now is pretty impressive but SLT is one of the worst service providers in the region when it comes to their customer care.
I didn't buy any hardware from them as I wanted to go for a Linksys router so they just wouldn't give me their configurations! Luckily I got them from Prabath and there were quite a few blogs around giving out the settings as well.
On Saturday, I managed to connect but the connection was not stable and it was damn slow as well. So I called to complain and they said the connection is not given yet! I called back on Sunday and received the same response. But I managed to get connected twice. So I went to SLT Teleshop in Kandy on Monday and asked them what the heck is going on... Then they said the connection was given on Sunday and lodge a complain for disturbance in the line.
I went back home and started to pack to come back to Colombo. Then I received a call from SLT maintenance and the person on the line straightaway asked me how many lines I have in parallel. I said none. Then he asked me how could that be possible!!! I told him that I've connected the router straight to the wall outlet and it's not sharing the line with a phone. Then he went on to say that it must be a configuration error and can NOT be a problem in the line. I got pissed off by his arrogance and the rude manner so I gave him a piece of advise on customer care as well as the technical details of ADSL and hang up.
Then at around 7PM suddenly the link got up and every thing started to work out of the blue!! So I stayed back, taught amma (mom) and appachchi (dad) how to play with IM and email. Updated all the virus guards, spam filters, security updates etc. etc. in my home machine and came back around 11PM.
Hmm... checked during the day today and it seems to be working fine for now.
Wednesday, September 26, 2007
Lhotka’s theory is against the theory I understand
I’m so bored with the work that I have at the office so I’ve taken on to reading quite a lot. I started with WF and at the same time started to read “Expert C# 2005 Business Objects” by Rockford Lhotka.
In the first chapter itself, while describing business objects, Lhotka states that “So, a business object that represents an invoice will include not only the data pertaining to the invoice, but also the logic to calculate taxes and amounts due. The object should understand how to post itself to a ledger, and how to perform other accounting tasks that are required. …” (Second Edition – Indian reprint : page 23)
I disagree.
An object should be an abstract representation of an entity or a concept. An object should represent one and only one entity or a concept. The contracts the object may have with other objects should be strictly in need to have basis.
Lhotka states the invoice should contain the logic to calculate taxes. Tax is a concept independent of an invoice entity. The responsibility of invoice with regards to tax is only to support the following two functionalities. 1.) Provide the taxable values 2.) Accept the tax values and use them against the taxable values. The invoice should not even know who does the tax calculation. It should expose the above mentioned functionality in terms of events and methods in the public interface.
Lets take a brief look at the problems that would arise when we implement the tax concept inside the invoice. To start with, it’s difficult to manage. Every time the tax calculation methods are changed, or a new tax is introduced you have to change the code in your invoice and test every functionality that’s associated with the invoice. Secondly, think of security, tax calculation is likely to require more security than the invoice as it could be accessing financial resources, and invoice is an object you are likely to pass around in your application. Not a good combination to go together. And thirdly, this implementation require the invoice object to have contracts with other objects which are required in tax calculation, which further complicates the manageability and possibly impact the structure of the application.
The second thing is, Lhotka states that the invoice object should understand how to post itself to a ledger. It is acceptable for an invoice to know which ledger it is posted in, but to be able to post itself to a ledger, it needs the knowledge of the ledger before it’s actually posted to it. Which is conceptually wrong. The invoice in Lhotka’s example is having a contract to a ledger before it actually gets posted to it. Secondly, posting an invoice to the ledger is neither a responsibility of an invoice nor of a ledger. An invoice should support being posted in a ledger and perhaps hold a reference to the ledger after it’s posted. And the ledger also should support posting invoices to it. But the responsibility of actually doing the act of posting is a responsibility of a third object.
Having such unnecessary contracts and responsibilities in objects causes manageability issues as well as design issues further on. For example if the action of posting an invoice to a ledger becomes more complicated in the future that requires modifications to the invoice class. And if these changes require access to other objects which the invoice by design does not have access to, it’s going to require some risky structural changes to the application as well.
Any thoughts?
In the first chapter itself, while describing business objects, Lhotka states that “So, a business object that represents an invoice will include not only the data pertaining to the invoice, but also the logic to calculate taxes and amounts due. The object should understand how to post itself to a ledger, and how to perform other accounting tasks that are required. …” (Second Edition – Indian reprint : page 23)
I disagree.
An object should be an abstract representation of an entity or a concept. An object should represent one and only one entity or a concept. The contracts the object may have with other objects should be strictly in need to have basis.
Lhotka states the invoice should contain the logic to calculate taxes. Tax is a concept independent of an invoice entity. The responsibility of invoice with regards to tax is only to support the following two functionalities. 1.) Provide the taxable values 2.) Accept the tax values and use them against the taxable values. The invoice should not even know who does the tax calculation. It should expose the above mentioned functionality in terms of events and methods in the public interface.
Lets take a brief look at the problems that would arise when we implement the tax concept inside the invoice. To start with, it’s difficult to manage. Every time the tax calculation methods are changed, or a new tax is introduced you have to change the code in your invoice and test every functionality that’s associated with the invoice. Secondly, think of security, tax calculation is likely to require more security than the invoice as it could be accessing financial resources, and invoice is an object you are likely to pass around in your application. Not a good combination to go together. And thirdly, this implementation require the invoice object to have contracts with other objects which are required in tax calculation, which further complicates the manageability and possibly impact the structure of the application.
The second thing is, Lhotka states that the invoice object should understand how to post itself to a ledger. It is acceptable for an invoice to know which ledger it is posted in, but to be able to post itself to a ledger, it needs the knowledge of the ledger before it’s actually posted to it. Which is conceptually wrong. The invoice in Lhotka’s example is having a contract to a ledger before it actually gets posted to it. Secondly, posting an invoice to the ledger is neither a responsibility of an invoice nor of a ledger. An invoice should support being posted in a ledger and perhaps hold a reference to the ledger after it’s posted. And the ledger also should support posting invoices to it. But the responsibility of actually doing the act of posting is a responsibility of a third object.
Having such unnecessary contracts and responsibilities in objects causes manageability issues as well as design issues further on. For example if the action of posting an invoice to a ledger becomes more complicated in the future that requires modifications to the invoice class. And if these changes require access to other objects which the invoice by design does not have access to, it’s going to require some risky structural changes to the application as well.
Any thoughts?
Tuesday, May 22, 2007
Localized web
I'm working on a application that should be supported in several languages including Japanese and French. So often, I have my regional settings set to these languages. And when I browse the web, I get pages in those languages...
Wednesday, May 16, 2007
You might want this
I’m intentionally avoiding commenting on certain posts these days. Because I’m pretty sure, if those discussions last any longer, every one would need one of these
Subscribe to:
Posts (Atom)


