Monday, April 21, 2014
Thursday, January 16, 2014
Yet another reason to use PowerShell
From this article:
Notice that all XML nodes in the document are converted to standard PowerShell properties, whether a node has children (e.g. catalog) or is a leaf node (e.g. price), or whether a leaf node is an element (e.g. author) or an attribute (e.g. id). In particular (as the last two examples above illustrate), element values and attribute values are treated exactly the same with standard “dot” notation.
This sill also help us suck work with DataSets, converting them to XML and then accessing the data as properties.
Notice that all XML nodes in the document are converted to standard PowerShell properties, whether a node has children (e.g. catalog) or is a leaf node (e.g. price), or whether a leaf node is an element (e.g. author) or an attribute (e.g. id). In particular (as the last two examples above illustrate), element values and attribute values are treated exactly the same with standard “dot” notation.
This sill also help us suck work with DataSets, converting them to XML and then accessing the data as properties.
Tuesday, January 14, 2014
Microsoft encourages bad developer practices
Look at this: http://sdt.bz/content/article.aspx?ArticleID=65362&page=1
“To give you a concrete scenario or example, let’s assume that you’re working on building an Azure website during the day, and you go home in the evening and suddenly the one thing that was bugging you about your website you want to go fix, and you suddenly know in your head, ‘Hey, these are three lines of code that I need to go add to make it work the way I want it to make it work.’ You can fire up a browser, use Visual Studio Online, get access to the source code, which is stored in Visual Studio Online, and then be able to edit your project with those three lines of change that you want to make, and boom, you are there. And you can deploy using Visual Studio Online right from there.”
What could go wrong? The developer fixes the issue and introduces three more, without integrating with other developers, testing, etc. deploys the stuff from his Visual Studio Online to production, breaking the site.
Why is Microsoft investing into the tools for deployment from the Visual Studio? They only encourage bad coding practices... This ability should be removed from the Visual Studio, instead we should be only deploy from the drop folder, after the code is integrated and built, all tests passed and the code is certified to be ready for prod. Instead of building tools to deploy from the Visual Studio Microsoft should make it easy to build deployment pipeline.
“To give you a concrete scenario or example, let’s assume that you’re working on building an Azure website during the day, and you go home in the evening and suddenly the one thing that was bugging you about your website you want to go fix, and you suddenly know in your head, ‘Hey, these are three lines of code that I need to go add to make it work the way I want it to make it work.’ You can fire up a browser, use Visual Studio Online, get access to the source code, which is stored in Visual Studio Online, and then be able to edit your project with those three lines of change that you want to make, and boom, you are there. And you can deploy using Visual Studio Online right from there.”
What could go wrong? The developer fixes the issue and introduces three more, without integrating with other developers, testing, etc. deploys the stuff from his Visual Studio Online to production, breaking the site.
Why is Microsoft investing into the tools for deployment from the Visual Studio? They only encourage bad coding practices... This ability should be removed from the Visual Studio, instead we should be only deploy from the drop folder, after the code is integrated and built, all tests passed and the code is certified to be ready for prod. Instead of building tools to deploy from the Visual Studio Microsoft should make it easy to build deployment pipeline.
Wednesday, August 21, 2013
Fix the gvim encoding problem on Windows
Files, created in Notepad with unicode won't display correctly in gvim unless explicitly set the encoding explicitly. To do that I mapped F6 key in .vimrc as follows:
:map <F6> :set encoding=utf-8<CR>:e!<CR>
:map <F6> :set encoding=utf-8<CR>:e!<CR>
Wednesday, April 17, 2013
Macro to remove attachments
People in my organization often don't pay attention to the size of the email attachments. My habit is to save the emails to the PST files. Hence the problem: my PCT files are huge. The solution: remove attachments. Simple Marco does the trick:
Sub RemoveAttachments()
Dim oMailItem As MailItem
Dim objAttachments As Outlook.Attachments
Dim i As Integer
Set oMailItem = Application.ActiveExplorer.Selection.Item(1)
Set objAttachments = oMailItem.Attachments
If objAttachments.Count > 0 Then
For i = objAttachments.Count To 1 Step -1
objAttachments.Item(i).Delete
Next i
oMailItem.Close (olSave)
End If
Set oMailItem = Nothing
End Sub
Sub RemoveAttachments()
Dim oMailItem As MailItem
Dim objAttachments As Outlook.Attachments
Dim i As Integer
Set oMailItem = Application.ActiveExplorer.Selection.Item(1)
Set objAttachments = oMailItem.Attachments
If objAttachments.Count > 0 Then
For i = objAttachments.Count To 1 Step -1
objAttachments.Item(i).Delete
Next i
oMailItem.Close (olSave)
End If
Set oMailItem = Nothing
End Sub
Thursday, August 23, 2012
So true!!!
The effect of a broken build generally, and specifically a build left broken at the end of a day’s work, is magnified if you are working in a distributed development team with groups in different time zones. In these circumstances, going home on a broken build is perhaps one of the most effective ways of alienating your remote colleagues.
Farley, David; Humble, Jez (2010-07-27). Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Addison-Wesley Signature Series (Fowler)) (Kindle Locations 2024-2026). Pearson Education (USA). Kindle Edition.
Farley, David; Humble, Jez (2010-07-27). Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Addison-Wesley Signature Series (Fowler)) (Kindle Locations 2024-2026). Pearson Education (USA). Kindle Edition.
Tuesday, August 21, 2012
Really good advise on configuration management
Keep the available configuration options for your application in the same repository as its source code, but keep the values somewhere else. Configuration settings have a lifecycle completely different from that of code, while passwords and other sensitive information should not be checked in to version control at all.
Farley, David; Humble, Jez (2010-07-27). Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Addison-Wesley Signature Series (Fowler)) (Kindle Locations 1581-1583). Pearson Education (USA). Kindle Edition.
Farley, David; Humble, Jez (2010-07-27). Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Addison-Wesley Signature Series (Fowler)) (Kindle Locations 1581-1583). Pearson Education (USA). Kindle Edition.
Thursday, June 07, 2012
Tuesday, May 01, 2012
More performant way to add items to SharePoint List
SPList.Items.Add(); -this code actually attempts to retrieve all items of the list.
Actually, you may retrieve an empty SPListItemCollection without querying the database by calling SPList.GetItems() and passing an SPQuery object designed to return no rows. So to add an item to a SharePoint list, use the following code instead: SPListItem newItem = SPList.GetItems(new SPQuery(){Query = "0"}).Add();
Mann, Steven; Murphy, Colin; Gazmuri, Pablo; Wheeler, Christina; Caravajal, Chris (2012-01-31). SharePoint 2010 Field Guide (Kindle Locations 8516-8520). John Wiley and Sons. Kindle Edition.
Actually, you may retrieve an empty SPListItemCollection without querying the database by calling SPList.GetItems() and passing an SPQuery object designed to return no rows. So to add an item to a SharePoint list, use the following code instead: SPListItem newItem = SPList.GetItems(new SPQuery(){Query = "0"}).Add();
Mann, Steven; Murphy, Colin; Gazmuri, Pablo; Wheeler, Christina; Caravajal, Chris (2012-01-31). SharePoint 2010 Field Guide (Kindle Locations 8516-8520). John Wiley and Sons. Kindle Edition.
Monday, April 16, 2012
List of JavaScript MVC frameworks
http://www.hanselman.com/blog/TheBigGlossaryOfOpenSourceJavaScriptAndWebFrameworksWithCoolNames.aspx
Monday, February 27, 2012
Wednesday, January 11, 2012
My Powershell Profile
I updated my profile in .\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 to include SharePoint:
function prompt {
$Host.UI.RawUI.WindowTitle=$(get-location)
"$ ";
}
#Set environment variables for Visual Studio Command Prompt
pushd 'c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC'
cmd /c "vcvarsall.bat&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
write-host "`nVisual Studio 2010 Command Prompt variables set." -ForegroundColor Yellow
& ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1'
write-host "`nSharePoint environment set." -ForegroundColor Yellow
function prompt {
$Host.UI.RawUI.WindowTitle=$(get-location)
"$ ";
}
#Set environment variables for Visual Studio Command Prompt
pushd 'c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC'
cmd /c "vcvarsall.bat&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
write-host "`nVisual Studio 2010 Command Prompt variables set." -ForegroundColor Yellow
& ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1'
write-host "`nSharePoint environment set." -ForegroundColor Yellow
Thursday, June 30, 2011
Kill Projects and Develop Agile Programs
http://ctotodevelopers.blogspot.com/2011/06/kill-projects-and-develop-agile.html
Wednesday, June 29, 2011
Best practices of the past
Looks like SharePoint faithfully following the best practices of 10 years ago. Lots of XML files, XSLT - some of younger developers don't remember the hype surrounding these at the turn of the millennium. When I experienced pain of setting up BCS in SharePoint 2010, it reminded me of EJB as they were around 2000: lots of duplication in various XML and code files, typo-unforgiving environment, etc.
Come on! It's 2011! Everyone is talking about "convention over configuration", "view engine", Razr, code-first Entity Framework, etc. Are we going to see these in SharePoint 2020?
Come on! It's 2011! Everyone is talking about "convention over configuration", "view engine", Razr, code-first Entity Framework, etc. Are we going to see these in SharePoint 2020?
Tuesday, June 28, 2011
Evil security in Win2008R2
On Windows Server 2008 R2 there is no way to install assembly into GAC. Drag and drop - get "Access denied". Gacutil is not installed!
Had to copy gacutil.exe and gacutil.exe.config from my Windows 7 workstation to the server, then can install assemblies without any problems. Evil security again???
Had to copy gacutil.exe and gacutil.exe.config from my Windows 7 workstation to the server, then can install assemblies without any problems. Evil security again???
Development experience in SharePoint still sucks!
Struggling through BDC Model creation in Visual Studio: what a tedious and unforgiving process. Almost no feedback or error messages...
To create a List I have to edit an XML file...
To create a List I have to edit an XML file...
Wednesday, March 23, 2011
Aspect-oriented programming
AOP and policy injection has low adoption because the use cases suggested are not that important. After all, security and logging has already pretty robust frameworks in both .Net and Java, and other use cases seem just lame...
Instead, where AOP can actually help is to enforce the Open-Closed principle, because it gives you a better alternative to subclass the classes trying to avoid modification. Rather than create derived classes a developer can create aspects or policies that extend the behavior of the class without having to modify it or create a string dependency through rigid inheritance structure.
Instead, where AOP can actually help is to enforce the Open-Closed principle, because it gives you a better alternative to subclass the classes trying to avoid modification. Rather than create derived classes a developer can create aspects or policies that extend the behavior of the class without having to modify it or create a string dependency through rigid inheritance structure.
Wednesday, January 05, 2011
SQL Sentry Plan Explorer
Really good tool for exploring SQL Server execution plans.
http://sqlsentry.net/plan-explorer/sql-server-query-view.asp
Tuesday, January 04, 2011
Free FAST Search for SharePoint training
http://msdn.microsoft.com/en-us/sharepoint/ff960976.aspx
Monday, October 11, 2010
Two lessons
I learned two lessons last week:
1. Friends don't let friends use ASP.Net Login Control
2. JQuery is the best way to fix bugs in ASP.Net.
Wednesday, September 22, 2010
Wednesday, August 11, 2010
Visual Studio command prompt with Powershell
I updated my profile in .\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 to include VS2010 prompt:
function prompt {
$Host.UI.RawUI.WindowTitle=$(get-location)
"$ ";
}
#Set environment variables for Visual Studio Command Prompt
pushd 'c:\Program Files\Microsoft Visual Studio 10.0\VC'
cmd /c "vcvarsall.bat&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
write-host "`nVisual Studio 2010 Command Prompt variables set." -ForegroundColor Yellow
function prompt {
$Host.UI.RawUI.WindowTitle=$(get-location)
"$ ";
}
#Set environment variables for Visual Studio Command Prompt
pushd 'c:\Program Files\Microsoft Visual Studio 10.0\VC'
cmd /c "vcvarsall.bat&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
write-host "`nVisual Studio 2010 Command Prompt variables set." -ForegroundColor Yellow
Thursday, August 05, 2010
Good TFS! Bad WebDeploy!
Evil MsDeploy wiped out my SharePoint site that was used to support TFS projects. Luckily I am on TFS 2010, so eventually I managed to get the site back without doing some low-level XML editing. I have to admit Microsoft did a very good job in making TFS more manageable.
I wish the next version of WebDeploy will be safer...
I wish the next version of WebDeploy will be safer...
Wednesday, August 04, 2010
Comma in Powershell
Mmm Learned today the hard way that comma should not be used to separate parameters. That is, instead of:
Great explanation here.
Encrypt-String "Alex", "089234kljhwsdf=", "98qasdlfkjhasdflkjh==you should use
Encrypt-String "Alex" "089234kljhwsdf=" "98qasdlfkjhasdflkjh==
Great explanation here.
Monday, August 02, 2010
Wednesday, July 28, 2010
Reality programming
It is a reality that we have a huge army of programmers that do not care about the quality of the code they write. It’s the reality, and we should not really blame them: they are trying to put bread on the table, feed their kids, parents and possibly other relatives as well.
So the reality should dictate different approach to programming. Rather than assuming that no code will be duplicated, we should assume that copy-paste will be the primary tool of development, and build our process around this. And when a programmer attempts to change some code that is also duplicated in 99 other places, the IDE should ask the programmer if he or she want also to modify the code in other 99 places, or maybe even give the programmer option to modify the code in 50 other places and leave the other 49 not modified. I know this is possible, because I am now checking out the tool called Atomiq that can find duplication in the code base.
What about source code? Say, if we want to revert a changeset in one file, the IDE will prompt us to revert the changes to all the code that is duplicated?
I know that most of developers will never write unit tests, but for the cases when their customers force them to do so what if the IDE will also duplicate unit tests to cover all duplicated code?
I know that most of the customers never test, but for those whose process requires them to do so what if the IDE will tell them that if they write a test case for a screen it will also work for 10 other screens that are duplicate of this one?
The purpose of these enhancements is not to encourage poor code quality, but to reduce the effect of the inevitably poor quality.
So the reality should dictate different approach to programming. Rather than assuming that no code will be duplicated, we should assume that copy-paste will be the primary tool of development, and build our process around this. And when a programmer attempts to change some code that is also duplicated in 99 other places, the IDE should ask the programmer if he or she want also to modify the code in other 99 places, or maybe even give the programmer option to modify the code in 50 other places and leave the other 49 not modified. I know this is possible, because I am now checking out the tool called Atomiq that can find duplication in the code base.
What about source code? Say, if we want to revert a changeset in one file, the IDE will prompt us to revert the changes to all the code that is duplicated?
I know that most of developers will never write unit tests, but for the cases when their customers force them to do so what if the IDE will also duplicate unit tests to cover all duplicated code?
I know that most of the customers never test, but for those whose process requires them to do so what if the IDE will tell them that if they write a test case for a screen it will also work for 10 other screens that are duplicate of this one?
The purpose of these enhancements is not to encourage poor code quality, but to reduce the effect of the inevitably poor quality.
Generate encryption key (128-bit) for RijndaelManaged
$algorithm = [System.Security.Cryptography.SymmetricAlgorithm]::Create("Rijndael")
$algorithm.set_keysize(128)
$keybytes = $algorithm.get_Key()
$ivbytes = $algorithm.get_IV()
[System.Convert]::ToBase64String($keybytes)
[System.Convert]::ToBase64String($ivbytes)
$algorithm.set_keysize(128)
$keybytes = $algorithm.get_Key()
$ivbytes = $algorithm.get_IV()
[System.Convert]::ToBase64String($keybytes)
[System.Convert]::ToBase64String($ivbytes)
Wednesday, July 21, 2010
My profile
Create folder WindowsPowerShell in My Documents
Create file Microsoft.PowerShell_profile.ps1
Copy this into the file:
function prompt {
$Host.UI.RawUI.WindowTitle=$(get-location)
"$ ";
}
Create file Microsoft.PowerShell_profile.ps1
Copy this into the file:
function prompt {
$Host.UI.RawUI.WindowTitle=$(get-location)
"$ ";
}
Powershell command to get all the groups I belong to.
$ [Security.Principal.WindowsIdentity]::GetCurrent().Groups | % {$_.Translate([Security.Principal.NTAccount]) }
Wednesday, May 05, 2010
Посредственные программисты.
Засилию посредственных программистов способствует политика компаний, не желающий тратить деньги на тренинг своих сотрудников. Мол, хороший программист сам должен учиться, если хочет преуспеть как профессионал. Ха! Скажите это женщине с двумя маленькими детьми, или её мужу, работающему по 60 часов в неделю! Так многие программисты не поднимаются выше уровня, который они получили в институте.
Monday, May 03, 2010
Serialize objects into C#
Am I the only crazy person who would like to serialize objects into C# code? Not binary or XML serialization. I want to take an object and generate C# code that will recreate all the public properties of this object and save the code to CS files.
Thursday, April 29, 2010
MSDN and Offshore developer
Including TFS (and some other features) in MSDN Pro has another benefit: it makes it possible to use these features when working with offshore outsourcing partner. It is no secret, that offshore development is all about cost, so to keep the cost down the offshore partners limit the money they are willing to pay for development tools. Having extra $2000 per developer means extra 96c per hour, which can reach 5% of the hourly rate. Which means that either the company risk losing business or the developer will be underpaid.
So this is really a smart move from Microsoft side.
So this is really a smart move from Microsoft side.
Wednesday, April 28, 2010
Overheard today...
A manager about the consulting company he uses for software development:
"I don't like them to be creative. We are not paying them to be creative."
"I don't like them to be creative. We are not paying them to be creative."
Tuesday, April 27, 2010
Why Non-broadcast Networks are not a Security Feature
http://technet.microsoft.com/en-us/library/bb726942.aspx
Wireless security consists of two main elements: authentication and encryption. Authentication controls access to the network and encryption ensures that malicious users cannot determine the contents of wireless data frames. Although having users manually configure the SSID of a wireless network in order to connect to it creates the illusion of providing an additional layer of security, it does not substitute for either authentication or encryption.
A non-broadcast network is not undetectable. Non-broadcast networks are advertised in the probe requests sent out by wireless clients and in the responses to the probe requests sent by wireless APs. Unlike broadcast networks, wireless clients running Windows XP with Service Pack 2 or Windows Server® 2003 with Service Pack 1 that are configured to connect to non-broadcast networks are constantly disclosing the SSID of those networks, even when those networks are not in range.
Therefore, using non-broadcast networks compromises the privacy of the wireless network configuration of a Windows XP or Windows Server 2003-based wireless client because it is periodically disclosing its set of preferred non-broadcast wireless networks. When non-broadcast networks are used to hide a vulnerable wireless network—such as one that uses open authentication and Wired Equivalent Privacy—a Windows XP or Windows Server 2003-based wireless client can inadvertently aid malicious users, who can detect the wireless network SSID from the wireless client that is attempting to connect. Software that can be downloaded for free from the Internet leverages these information disclosures and targets non-broadcast networks.
This behavior is worse for enterprise wireless networks because of the number of wireless clients that are periodically advertising the non-broadcast network name. For example, an enterprise wireless network consists of 20 wireless APs and 500 wireless laptops. If the wireless APs are configured to broadcast, each wireless AP would periodically advertise the enterprise’s wireless network name, but only within the range of the wireless APs. If the wireless APs are configured as non-broadcast, each of the 500 Windows XP or Windows Server 2003-based laptops would periodically advertise the enterprise’s wireless network name, regardless of their location (in the office, at a wireless hotspot, or at home).
For these reasons, it is highly recommended that you do not use non-broadcast wireless networks. Instead, configure your wireless networks as broadcast and use the authentication and encryption security features of your wireless network hardware and Windows to protect your wireless network, rather than relying on non-broadcast behavior.
Wireless security consists of two main elements: authentication and encryption. Authentication controls access to the network and encryption ensures that malicious users cannot determine the contents of wireless data frames. Although having users manually configure the SSID of a wireless network in order to connect to it creates the illusion of providing an additional layer of security, it does not substitute for either authentication or encryption.
A non-broadcast network is not undetectable. Non-broadcast networks are advertised in the probe requests sent out by wireless clients and in the responses to the probe requests sent by wireless APs. Unlike broadcast networks, wireless clients running Windows XP with Service Pack 2 or Windows Server® 2003 with Service Pack 1 that are configured to connect to non-broadcast networks are constantly disclosing the SSID of those networks, even when those networks are not in range.
Therefore, using non-broadcast networks compromises the privacy of the wireless network configuration of a Windows XP or Windows Server 2003-based wireless client because it is periodically disclosing its set of preferred non-broadcast wireless networks. When non-broadcast networks are used to hide a vulnerable wireless network—such as one that uses open authentication and Wired Equivalent Privacy—a Windows XP or Windows Server 2003-based wireless client can inadvertently aid malicious users, who can detect the wireless network SSID from the wireless client that is attempting to connect. Software that can be downloaded for free from the Internet leverages these information disclosures and targets non-broadcast networks.
This behavior is worse for enterprise wireless networks because of the number of wireless clients that are periodically advertising the non-broadcast network name. For example, an enterprise wireless network consists of 20 wireless APs and 500 wireless laptops. If the wireless APs are configured to broadcast, each wireless AP would periodically advertise the enterprise’s wireless network name, but only within the range of the wireless APs. If the wireless APs are configured as non-broadcast, each of the 500 Windows XP or Windows Server 2003-based laptops would periodically advertise the enterprise’s wireless network name, regardless of their location (in the office, at a wireless hotspot, or at home).
For these reasons, it is highly recommended that you do not use non-broadcast wireless networks. Instead, configure your wireless networks as broadcast and use the authentication and encryption security features of your wireless network hardware and Windows to protect your wireless network, rather than relying on non-broadcast behavior.
Wednesday, April 21, 2010
MSDN
Am I the only one who is confused by MSDN download screen? I have two MSDN subscription on my email, and I have no idea which software belongs to which client. I hope I don't get punished by Microsoft.
Tuesday, April 20, 2010
UPS
Just connected my server to APC UPS I just received. I realized that WHS does not have USB support, and the server itself does not have COM ports, and APC does not have a server version of the software that take care of shutdown. Oops...
This means I'll have to shutdown the server manually if I loose power for extended periods. Luckily that almost never happens. Most of the time I lose power for a few seconds, and the UPS should cover that.
This means I'll have to shutdown the server manually if I loose power for extended periods. Luckily that almost never happens. Most of the time I lose power for a few seconds, and the UPS should cover that.
Tuesday, March 09, 2010
Variable naming...
How do you pronounce variable "contactus"? "Con-cactus"?
One more argument for correct variable casing...
Wednesday, May 06, 2009
Too many items

Wednesday, April 15, 2009
Boolean is difficult
Sometimes you see the C# code like this:
if(isValid()) {
return true;
}
else {
return false;
}
or even "better":
return (isValid()? true : false);
I always wondered why not just write the code like this:
return isValid()
Is the reason is that some of the younger developers don't have any background in C, C++ or any languages where the conditional statements return int, not bool? It is psychologically difficult for them to accept Boolean as the first class citizen - data type. For them Boolean cannot be separated from the if statements or "?" operator. Am I correct? What is your opinion?
if(isValid()) {
return true;
}
else {
return false;
}
or even "better":
return (isValid()? true : false);
I always wondered why not just write the code like this:
return isValid()
Is the reason is that some of the younger developers don't have any background in C, C++ or any languages where the conditional statements return int, not bool? It is psychologically difficult for them to accept Boolean as the first class citizen - data type. For them Boolean cannot be separated from the if statements or "?" operator. Am I correct? What is your opinion?
Tuesday, April 14, 2009
JavaFx installation
Oddly enough it did not prompt me to download and install JavaFx, it just showed me the small icon. When I clicked on the icon it prompted me to download the latest Java, and after 6 minutes (on high-speed connection) and two browser restarts I've got it up and running.
Monday, April 06, 2009
Fixing Outlook annoyancies
If a message comes as plain text, Outlook will use plain text format to reply to this message. As a result the signature gets messed up, etc. This article shows how to overcome this limitations. A simple macro can convert a received email from plain text to html:
Sub ConvertMessage()
Dim oMailItem As MailItem
Set oMailItem = Application.ActiveExplorer.Selection.Item(1)
oMailItem.BodyFormat = olFormatHTML
'oMailItem.HTMLBody = oMailItem.Body
oMailItem.Close (olSave)
Set oMailItem = Nothing
End Sub
I commented out one of the lines because it works better for me this way.
Sub ConvertMessage()
Dim oMailItem As MailItem
Set oMailItem = Application.ActiveExplorer.Selection.Item(1)
oMailItem.BodyFormat = olFormatHTML
'oMailItem.HTMLBody = oMailItem.Body
oMailItem.Close (olSave)
Set oMailItem = Nothing
End Sub
I commented out one of the lines because it works better for me this way.
Tuesday, March 31, 2009
Anger-driven development
Being angry at the badly written code stimulated me to a few hours of very productive refactoring and bug fixing. Do I need to get angry to be productive?
Monday, March 16, 2009
IOC container
I found a great idea in Dave Laribee's article in MSDN Vol 24 # 2: Don't use IOC containers for entities, only for services. I am saying this becase our team is practicing this for the last year or so.
Monday, December 08, 2008
Silverlight instead of JavaScript?
I would not recommend anyone to use Silverlight instead of JavaScript, because of low tolerance of the former to browser differences. Besides, why would you trade your almost strongly typed JavaScript to weakly typed Silverlight syntax like:
HtmlElement label1 = HtmlPage.Document.GetElementById("Label1");However there is one scenario that could provide a good case for using Silverlight in place of JavaScript, as described here: http://msdn.microsoft.com/en-us/magazine/dd148642.aspx . Look at this piece of code:
label1.SetProperty("innerHTML", "Dino");
HtmlElement button1;You can attach a managed event handler to an HTML button!
button1 = HtmlPage.Document.GetElementById("Button1");
button1.AttachEvent("click", new System.EventHandler(Button1_Click));
Tuesday, August 12, 2008
How to fail the build if unit tests fail.
I just realized that the way TFS is architected is that it will mark the tests "Partially Succeeded" if the unit tests fail. This does not agree with out development process. Our development process prescribes that the build should fail if any of the unit tests fail. One way to deal with this problem is to edit C:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets and set ContinueOnError to false.
Another way of dealing with this was suggested in the blog entry http://blogs.msdn.com/aaronhallberg/archive/2007/11/05/how-to-fail-a-build-when-tests-fail.aspx
I modified the code suggested there to make sure also that the files are not copied to the drop location if the unit tests fail.
BuildUri="$(BuildUri)"
Condition=" '$(IsDesktopBuild)' != 'true' ">
BuildUri="$(BuildUri)"
CompilationStatus="Failed"
Condition=" '$(IsDesktopBuild)' != 'true' and '$(TestSuccess)' != 'true' "/>
BuildUri="$(BuildUri)"
SkipDropBuild="true"
Condition=" '$(IsDesktopBuild)' != 'true' and '$(TestSuccess)' != 'true' "/>
Another way of dealing with this was suggested in the blog entry http://blogs.msdn.com/aaronhallberg/archive/2007/11/05/how-to-fail-a-build-when-tests-fail.aspx
I modified the code suggested there to make sure also that the files are not copied to the drop location if the unit tests fail.
<
Target Name="AfterTest"><!--
Refresh the build properties. --><
GetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)"BuildUri="$(BuildUri)"
Condition=" '$(IsDesktopBuild)' != 'true' ">
<
Output TaskParameter="TestSuccess" PropertyName="TestSuccess" /></
GetBuildProperties><!--
Set CompilationStatus to Failed if TestSuccess is false. --><
SetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)"BuildUri="$(BuildUri)"
CompilationStatus="Failed"
Condition=" '$(IsDesktopBuild)' != 'true' and '$(TestSuccess)' != 'true' "/>
<
SetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)"BuildUri="$(BuildUri)"
SkipDropBuild="true"
Condition=" '$(IsDesktopBuild)' != 'true' and '$(TestSuccess)' != 'true' "/>
</
Target>Thursday, July 17, 2008
Mock object framework makes refactoring difficult
Probably unintended consequence of using a mock object framework is that it makes refactoring somewhat difficult if the method signature changes, or if methods are split/combined or rearranged to different interfaces. Sometimes I am having really hard time in getting the test back to the working condition, and often don't know why I need to do what I have to do to get it fixed.
Tuesday, July 15, 2008
FxCop rigidness
What drives me really crazy in FxCop is that I cannot easily change the MessageLevel of the built-in rules. The XML file describing rules is compiled into the rule assemblies as an embedded resource, so the only option for me is to create a new rule assembly, copy the XML file, exclude the old rule and include the new rule. I'd rather change the MessageLevel using FxCop project files.
Monday, July 14, 2008
Misfeature of FxCop 1.36
When upgraded to version 1.36 I started getting the messages "Strong name doesn't match the reference", or "Could not resolve member reference".
The solution can be found here. What worked for me is setting AssemblyReferenceResolveMode to None.
The solution can be found here. What worked for me is setting AssemblyReferenceResolveMode to None.
Friday, July 11, 2008
Problem with CollabNet SVN 1.5
When I upgraded I started getting messages like this:
Failed to load module for FS type 'bdb'
Apparently bdb module is not working (or maybe they forgot to include it?) in the CollabNet distribution. I had to use the old binaries to migrate the repositories from bdb to fsfs like this:
svnadmin create NEW_REPOSITORY
svnadmin dump OLD_REPOSITORY | svnadmin load NEW_REPOSITORY
where NEW_REPOSITORY is the file path to the new fsfs repository and OLD_REPOSITORY is the file path to the old bdb repository.
Failed to load module for FS type 'bdb'
Apparently bdb module is not working (or maybe they forgot to include it?) in the CollabNet distribution. I had to use the old binaries to migrate the repositories from bdb to fsfs like this:
svnadmin create NEW_REPOSITORY
svnadmin dump OLD_REPOSITORY | svnadmin load NEW_REPOSITORY
where
Sunday, July 06, 2008
BizTalk services let you expose stuff on internal network?
See http://msdn.microsoft.com/en-us/magazine/cc546613.aspx. Using RelayedHttp you can expose the web service on your internal network to the internet. But I wonder how this thing work? Is the service polling the BizTalk services all the time to check if there is any request?
Monday, May 19, 2008
Process owner
Some people own the process they are using, the others are owned by the process. It is especially sad when the people who invented the process in the first place start being owned by it.
Monday, May 12, 2008
QTP license blues
After a few times when QTP refused to find a license server I finally found a solution: in Windows firewall you need to open UDP port 5093.
Tuesday, May 06, 2008
Evangelists
There are so many Microsoft evangelists now, so I started wondering if there is also a Microsoft seminary.
Monday, April 28, 2008
AquaLogic® BPM
AquaLogic® BPM seems to be way more advanced workflow engine than Microsoft WF. In particular it is designed to work for human workflow, which Microsoft WF is not.
Typemock
If you have $450 per developer to spare consider buying TypeMock Isolator. It is especially useful when writing unit tests for a legacy system that is not well-designed. It is interesting to see how you can make sense of the spaghetti code by mocking everything: public methods, private methods, etc. Of course before that you should get ReSharper for much cheaper...
Wednesday, April 16, 2008
How to avoid session expiration
http://www.codinghorror.com/blog/archives/001100.html
Create a background JavaScript process in the browser that sends regular heartbeats to the server. Regenerate a new cookie with timed expiration, say, every 5 or 10 minutes.
Create a background JavaScript process in the browser that sends regular heartbeats to the server. Regenerate a new cookie with timed expiration, say, every 5 or 10 minutes.
Monday, April 14, 2008
VS2008
How is Visual Studio 2008 improving developer's productivity if it is twice slower than Visual Studio 2005?
Monday, April 07, 2008
VS2008 web projects
I was so happy when in VS2005 the web projects did not require any virtual directory to be set up. This allowed me to be working on multiple branches of the same web applications. In VS2008 we are back to the old stuff of requiring that the physical directory should match the virtual directory specified in the project file. WHY? This thing does not make any sense to me!
Wednesday, April 02, 2008
Web Client Software Factory
http://www.codeplex.com/websf
I have an impression that this was called something like "Composite application block" or something, because I tried it a year ago. At that time it impressed me with complexity. Did not quite fit into what Microsoft is trying to sell as "Software Factories". We'll see if some of the shortcomings are addressed in this incarnation.
I have an impression that this was called something like "Composite application block" or something, because I tried it a year ago. At that time it impressed me with complexity. Did not quite fit into what Microsoft is trying to sell as "Software Factories". We'll see if some of the shortcomings are addressed in this incarnation.
Thursday, March 27, 2008
CI Factory
Wow! Continuous integration out of the box. Everything integrated! Just install and configure it! CI Factory
Thursday, March 13, 2008
What is happening at Microsoft?
Microsoft promoting FireBug: extension to Firefox. Weird.
http://msdn2.microsoft.com/en-us/magazine/cc337891.aspx
http://msdn2.microsoft.com/en-us/magazine/cc337891.aspx
Wednesday, March 05, 2008
Why can't I throws an exception in .Net?
I used to belong to the camp that says that throwsing exception in Java is useless and you would rather not catch any exception until in the outer program catching all exceptions. Now working on the code I see a lot of random "catch all" statements that were originally meant to catch only OracleException or ParseException, but eventually that knowledge was forgotten and we started also swallowing other exceptions that we did not intend to do in the beginning. Thus if there is a problem in the code I cannot diagnose it until I start debugging it.
Instead if, like in Java, the methods were throwsing the exceptions forcing the client methods to catch them or to throws them further the developer's task would be much easier figuring out what exceptions need to be caught or rethrown.
Instead if, like in Java, the methods were throwsing the exceptions forcing the client methods to catch them or to throws them further the developer's task would be much easier figuring out what exceptions need to be caught or rethrown.
Thursday, February 21, 2008
Get Your Database Under Version Control
Great post:
http://www.codinghorror.com/blog/archives/001050.html
http://www.codinghorror.com/blog/archives/001050.html
Friday, January 18, 2008
TFS 2005 installation problems
While installing TFS 2005 you may get many error messages during the system health check. Some of the messages may be quite misleading. To find out more details you can open a file called hcpackage.xml (in the folders at, dt or atdt) and find the error message. The file also has WMI queries that are being executed to determine if an error condition exists. Sometimes there are multiple WMI queries that result in a single error message, so you have a much better chance to troubleshoot the problem and resolve the installation issue. You can also try to edit the file and remove the WMI if your environment cannot conform to the TFS 2005 requirements.
Thursday, January 10, 2008
Unit test generator
Just an idea: what if we had the software that would automatically generate unit tests for all success scenarios? It would work like this:
1. Attach to the running process as a debugger
2. The user would use the application to test all success scenarios
3. The generator program would record all the method invocations with all the parameters.
4. After the application that is being debugged exits the generator program would use the information about methods invocation and generate NUnit tests.
1. Attach to the running process as a debugger
2. The user would use the application to test all success scenarios
3. The generator program would record all the method invocations with all the parameters.
4. After the application that is being debugged exits the generator program would use the information about methods invocation and generate NUnit tests.
Monday, December 10, 2007
Object-oriented design
The goal of object-oriented design is not only to reduce dependency, but also to remove ambiguity.For example, using DataSet as a universal data transfer object definitely reduces dependency, but increases ambiguity a lot, requiring you to understand the non-documented contract of what data should be in the data set and what do they represent. By using strongly-typed objects you document the contract and reduce ambiguity.
Here is the strong point of the strongly typed languages vs. dynamic languages. The contracts in the strongly typed languages are usually more pronounced. Unit tests can compensate for the missing contract details but cannot themselves become a part of the object contract.
Here is the strong point of the strongly typed languages vs. dynamic languages. The contracts in the strongly typed languages are usually more pronounced. Unit tests can compensate for the missing contract details but cannot themselves become a part of the object contract.
Monday, December 03, 2007
Tuesday, November 20, 2007
Exam 70-529 training kit
The training kit is written quite poorly with a lot of typos and mistakes. Some of the examples are only given in VB.Net. What is most exciting (and funny) are the "words of wisdom" of the book:
"It is nearly impossible to write more than a few lines of code without there being some type of error in the execution of the code" (page 239)
"You should always expect the unexpected" (page 242).
"It is nearly impossible to write more than a few lines of code without there being some type of error in the execution of the code" (page 239)
"You should always expect the unexpected" (page 242).
Monday, November 19, 2007
Delayed Load
Cool technique for delay loading is provided at http://www.codeproject.com/Ajax/DelayedContentLoading.asp. Just use UpdatePanel, Timer and MultiView controls.
Saturday, October 27, 2007
Thursday, September 27, 2007
Friday, September 21, 2007
Tuesday, September 04, 2007
Manage ACL in ADAM
If you want to manage the access in ADAM the documented tool is dsacls. However this command-line tool is not very intuitive and easy-to-learn. There is an undocumented tool ldp in C:\Windows\ADAM directory that provides a GUI for security descriptors, i.e. DACL and SACL.
Thursday, August 30, 2007
Totally backwards!
I just discovered that Upgrading VS 2005 Web Site Projects to be VS 2005 Web Application Projects is a totally backwards procedure, as described in this blog. I just don't understand why this is so hard procedure, and why the "Convert to Web Application" context menu is available when you have already converted the project to web application, and it not an available menu for web sites.
Tuesday, August 07, 2007
Monday, August 06, 2007
Failed installations
To cleanup after failed installations (especially C:\Windows\Installer) you can use
MsiZap G!
Or alternatively download "Windows Installer Cleanup Utility" to do that using GUI.
MsiZap G!
Or alternatively download "Windows Installer Cleanup Utility" to do that using GUI.
Friday, August 03, 2007
MSBuild and Web Site projects
One of the developers found an interesting misfeature of the MSBuild. When you supply Project Name parameter it does not package the web site and does not create PrecompiledWeb folder. However as soon as you remove this parameter the folder gets created. Weird.
Monday, July 30, 2007
AzMan group (2)
Unfortunately the approach I described in the previous post does not really works. The problem is that the AzMan.msc breaks if I do that. Probably it expects the groupType to be exactly 16 or 32 rather than what would be correct behaviour: apply a bitmap.
Friday, July 27, 2007
AzMan groups
AzMan groups ain't security groups. If you check the groupType attribute of the Basic AzMan group it will be 16 (0x00000010). Now the security groupType normally is -2147483646 (0x80000002). This article deciphers the groupType values. Thus 0x80000002 really means global group that is also a security group. So if you want your Basic AzMan group to behave like a security group you should use group type 0x80000012 which will be -2147483630 in decimal.
Monday, June 11, 2007
ASP.NET AJAX performance problems
Look at this Fiddler capture: ScriptManager loads more than 400 MBytes of JavaScript code!
WebResource.axd: 20 KB
ScriptResource.axd: 260 KBytes
ScriptResource.axd: 65 KBytes
ScriptResource.axd: 22 KBytes
ScriptResource.axd: 9 KBytes
This will make people want to come back to plain old HTML.
WebResource.axd: 20 KB
ScriptResource.axd: 260 KBytes
ScriptResource.axd: 65 KBytes
ScriptResource.axd: 22 KBytes
ScriptResource.axd: 9 KBytes
This will make people want to come back to plain old HTML.
Tuesday, May 08, 2007
Monday, April 30, 2007
Microsoft SQL Server management Studio
The management studio is a big disappointment for me, because I expected the tool that has the best features of Enterprise Manager and SQL Query Analyzer. Instead I found the combined tool where EM and SQA exist as independent units, so I don't have any of SQA features when I open the table from the object explorer, and when I use "New Query" I cannot edit results, nor use Query Designer. I can't believe Microsoft is selling the tool as a SQL 2005 "improvement". :(
Tuesday, March 13, 2007
New syntax for NUnit 2.4
Check out the new syntax for NUnit 2.4 in this blog entry. Nunit will have more object-oriented syntax for assertions, allowing to encapsulate the complexity of unit tests in nice object model. I guess this is another reason to stick with NUnit rather than going to VSTS unit testing framework.
Tuesday, February 20, 2007
Unofficial Windows 2000 DST patch
http://www.intelliadmin.com/blog/2007/01/unofficial-windows-2000-daylight.html
I'll try to apply it today.
I'll try to apply it today.
Wednesday, January 31, 2007
QuickCounters
QuickCounters is a library that will make it easier to instrument your .Net code with performance counters. It still requires you to instrument the code through, which could make it quite messy.
Tuesday, January 02, 2007
Agile Google
Well, this blog says that Google represents good Agile, while other agile processes are bad agile. I agree with some points of the post, like if you have super developers the process does not help as much as if you have a mix of junior and medium level developers. But my personal experience does not confirm that no process is better than an agile process.
An eye-opening experience report by Mark Striebeck on Agile 2006 conference confirmed my suspicions. His area of work is Ad Words system, which is different from other stuff Google develops in that it is quite complex and requires a release cycle and commitments (as a B2B system). When he joined he found a few problems that can be attributed to a lack of a process. First of all the development was always late. Worse off, the developers did not know how late they are until the last moment. The scope creep was more than 30%. Mark was invited to add a process into the Ad Words development, to help solve these problems. Now, according to Steve Yegge this is like adding bad agile to good agile. Probably smart people at Google think differently.
An eye-opening experience report by Mark Striebeck on Agile 2006 conference confirmed my suspicions. His area of work is Ad Words system, which is different from other stuff Google develops in that it is quite complex and requires a release cycle and commitments (as a B2B system). When he joined he found a few problems that can be attributed to a lack of a process. First of all the development was always late. Worse off, the developers did not know how late they are until the last moment. The scope creep was more than 30%. Mark was invited to add a process into the Ad Words development, to help solve these problems. Now, according to Steve Yegge this is like adding bad agile to good agile. Probably smart people at Google think differently.
Friday, December 15, 2006
The Cost of Code Quality
One of the most controversial event on the Agile 2006 conference was a paper by Yuri Khramov from Apple on the cost of code quality. It is to bad I did not have a chance to see the presentation :( . Let's see what he is writing about:
"It is shown that a 'quick and dirty' approach is actually preferable in some situations"
There are quite a few statements like this in the article, it is clear the guy is very emotional about the issue. Let's see what he says further on:
"Code quality is not the ultimate goal of the development team, but rather one of the options considered for achievement of the real goal of the project, be it commercial success, timely solution of an important problem, or something else"
Agreed
"... there is no positive correlation between the quality of the code and the success of the product..." and also "If there is any correlation between code quality and the success, it is a negative one"
He bases his research on the 80 projects he participated. My impressions that they were mostly not very big projects or the system he built are not very big. But I can also say that this is my experience too. The worst system I ever built (in Perl) was very successful. It had no design whatsoever, not even a procedural one. And in fact it did not have too many bugs, was in production for at least two years. One of the best systems we built never made it to production. Usually the most successful systems I built had moderate code quality, although some of them have excellent code quality.
So anyway, the author says: "... most of the time the 'quick and dirty' approach delivers better return on investments"
Probably the reason for this statement is that the code quality is too expensive but does not bring much benefit. But how about all the projects failures due to the poor code quality? The author argues that volatility of requirements "is the reason for most project failures". This is probably true, although he of course does not count the projects that did not even start because the code was too expensive and risky to modify. Anyway what does the author suggest to fight the volatility of requirements. I suspect that he recommends building a poor code quality system and rewrite it with any significant change of requirements.
"High quality code performs correctly even on edge cases; quick and dirty solutions may work well only on the most frequent case". That's true. But the author argues that if the system will only be used in the most frequent case the quick and dirty solution is acceptable. I think this is more a design defect: why don't we design a system that will only have one or two use cases and remove all unnecessary alternative flows by not designing them into the system? For example, we don't need a breadcrumbs on the data entry applications. And what about all these "Home" buttons on the "wizard" pages? Do you really want the user to go back to the home page in the middle of transaction?
"...high post-release defect density is often related to the high degree of product success". That's true, if the system was never used it has no bugs.
"Despite the fact that several projects had failed, none of the failures was doe to high bug count" It depends how you define failure of the project. Some people define a project failure if it runs over budget or delivered with significant delays. Usually high bug count affects both cost and schedule.
Now the author argues with the theory that it costs more to fix bugs in the later stages of the project. I always thought that the theory was incorrect, but I am using agile principles for 7 years already. He says that "relative costs of fixing a single defect after release decreased substantially since 1994". "In our data, the cost of addressing an issue is not higher in the projects with low code quality". This may be true, but the issues are usually different for the systems with high and low code quality.
Now he says that there are many systems that are only in production for a few months, so why bothering with the code quality. I can agree with one exception: sometimes the business decides to keep the system longer than originally expected. We have one of the examples when a quick and dirty solution is in production already four time longer than originally anticipated.
Very beautiful:
"... a good project manager analyzes the project and designs the development process almost the same way as an architect designs the software."
Very evil:
"It is very natural to perceive the code written by another person as inferior..." But the point is clear: the developers don't enjoy working on the system with low code quality. For me low developer motivation is a project risk.
Good observation about xUnit:
"...xUnit approach means writing more code, and every line of code is a liability" Instead he suggests to use Design By Contract methodology where xUnit is too expensive. I think this is a good suggestion.
Conclusion:
"... experience demonstrates that the quest for the best code is not always justified."
"It is shown that a 'quick and dirty' approach is actually preferable in some situations"
There are quite a few statements like this in the article, it is clear the guy is very emotional about the issue. Let's see what he says further on:
"Code quality is not the ultimate goal of the development team, but rather one of the options considered for achievement of the real goal of the project, be it commercial success, timely solution of an important problem, or something else"
Agreed
"... there is no positive correlation between the quality of the code and the success of the product..." and also "If there is any correlation between code quality and the success, it is a negative one"
He bases his research on the 80 projects he participated. My impressions that they were mostly not very big projects or the system he built are not very big. But I can also say that this is my experience too. The worst system I ever built (in Perl) was very successful. It had no design whatsoever, not even a procedural one. And in fact it did not have too many bugs, was in production for at least two years. One of the best systems we built never made it to production. Usually the most successful systems I built had moderate code quality, although some of them have excellent code quality.
So anyway, the author says: "... most of the time the 'quick and dirty' approach delivers better return on investments"
Probably the reason for this statement is that the code quality is too expensive but does not bring much benefit. But how about all the projects failures due to the poor code quality? The author argues that volatility of requirements "is the reason for most project failures". This is probably true, although he of course does not count the projects that did not even start because the code was too expensive and risky to modify. Anyway what does the author suggest to fight the volatility of requirements. I suspect that he recommends building a poor code quality system and rewrite it with any significant change of requirements.
"High quality code performs correctly even on edge cases; quick and dirty solutions may work well only on the most frequent case". That's true. But the author argues that if the system will only be used in the most frequent case the quick and dirty solution is acceptable. I think this is more a design defect: why don't we design a system that will only have one or two use cases and remove all unnecessary alternative flows by not designing them into the system? For example, we don't need a breadcrumbs on the data entry applications. And what about all these "Home" buttons on the "wizard" pages? Do you really want the user to go back to the home page in the middle of transaction?
"...high post-release defect density is often related to the high degree of product success". That's true, if the system was never used it has no bugs.
"Despite the fact that several projects had failed, none of the failures was doe to high bug count" It depends how you define failure of the project. Some people define a project failure if it runs over budget or delivered with significant delays. Usually high bug count affects both cost and schedule.
Now the author argues with the theory that it costs more to fix bugs in the later stages of the project. I always thought that the theory was incorrect, but I am using agile principles for 7 years already. He says that "relative costs of fixing a single defect after release decreased substantially since 1994". "In our data, the cost of addressing an issue is not higher in the projects with low code quality". This may be true, but the issues are usually different for the systems with high and low code quality.
Now he says that there are many systems that are only in production for a few months, so why bothering with the code quality. I can agree with one exception: sometimes the business decides to keep the system longer than originally expected. We have one of the examples when a quick and dirty solution is in production already four time longer than originally anticipated.
Very beautiful:
"... a good project manager analyzes the project and designs the development process almost the same way as an architect designs the software."
Very evil:
"It is very natural to perceive the code written by another person as inferior..." But the point is clear: the developers don't enjoy working on the system with low code quality. For me low developer motivation is a project risk.
Good observation about xUnit:
"...xUnit approach means writing more code, and every line of code is a liability" Instead he suggests to use Design By Contract methodology where xUnit is too expensive. I think this is a good suggestion.
Conclusion:
"... experience demonstrates that the quest for the best code is not always justified."
Monday, December 11, 2006
KANO and Agile requirements
One thing the Agile methodlolgy is wrong is in insisting that all requirements must be explicit. Whereas from KANO methodology we know that the customer are explicit about only satisfiers and are implicit about dissatisfiers. Of course they don't even suspect about delighters. Agile methodology is wrong in requiring to explicitly state the dissatisfiers. This is quite irritating for the customers, and if they missed a dissatisfier and it does not get implemented the customer satisfaction swings into negative territory. Good Agile methodology should always make sure the dissatisfiers are implemented as a part of the solution. Correspondingly the customer should be aware that some of his money are going to maintain good standards of software, but he should be confident that all things he is taking for granted will be implemented in the system.
Tuesday, November 14, 2006
Test-driven writing of standards
We all know about test-driven development, and even test-driven management (which proves to be just setting goals and checking them at the end of the year).
Now I introduce Test-Driven Writing of Standards. Indeed you can start writing coding standards, but it is likely you will miss something, so when you see another ugliness in your code you need first to go and check if your standards cover the problem. If not you need to add it to the standards, and then raise a defect based on the newly added coding standard.
Now I introduce Test-Driven Writing of Standards. Indeed you can start writing coding standards, but it is likely you will miss something, so when you see another ugliness in your code you need first to go and check if your standards cover the problem. If not you need to add it to the standards, and then raise a defect based on the newly added coding standard.
Monday, October 02, 2006
Wiki and Blog in WSS 3.0!
This video shows how to use WSS to create a Wiki web or a blog. WSS also supports RSS. Very cool.
Wednesday, September 20, 2006
Tuesday, September 19, 2006
DBCC MEMORYSTATUS
Whenever you suspect memory problems in SQL Server 2000 use DBCC MEMORYSTATUS. Here is the KB article about how to interpret results.
Thursday, September 07, 2006
TDD vs RAD
I think the incompatibility between TDD and RAD is artificial. RAD is very useful for interfacng the external systems, like databases, web services and the user (UI is also the part of the external interface). TDD is very useful for developing business logic.
Friday, September 01, 2006
First thing to do when the execution plan changes
I need to run for every database:
EXEC sp_MSforeachtable "DBCC DBREINDEX ('?')"
EXEC sp_MSforeachtable 'UPDATE STATISTICS ? WITH FULLSCAN'
EXEC sp_MSforeachtable "DBCC DBREINDEX ('?')"
EXEC sp_MSforeachtable 'UPDATE STATISTICS ? WITH FULLSCAN'
Wednesday, August 30, 2006
So why does SQL server change execution plan?
Well, some hypotheses:
- SQL Server has artificial intelligence built in and wants to annoy the developers and DBAs by randomly changing execution plans for the query to make it slow and have developers and DBAs spend extra hours trying to optimize it.
- SQL Server has artificial intelligence built in and has a bias toward SQL Server performance ocnsulting. Since the rates dropped somewhat it decided it will torture full-time employees until they will hire a consultant with a decent rate.
- This behaviour was a part of SP4 and was designed to annoy developers and DBAs so they will upgrade to SQL Server 2005 as soon as possible, thus generating much-needed revenue for Microsoft.
Friday, August 25, 2006
Why does SQL server always change execution plan?
I just don't get it why does SQL server always changes execution plan.
I run
EXEC sp_MSforeachtable 'UPDATE STATISTICS ? WITH FULLSCAN'
and still cannot get the same execution plan as the last time. I don't think any data were changed since a few weeks ago. And why does the SQL server all the sudden start usign hash or merge joins and try to use parallelism? I worked a couple of days ago to optimize the query and I've got it down to 71 milliseconds. Today it is back to 600 ms. Is the solution to use the real database, for example Oracle?
I run
EXEC sp_MSforeachtable 'UPDATE STATISTICS ? WITH FULLSCAN'
and still cannot get the same execution plan as the last time. I don't think any data were changed since a few weeks ago. And why does the SQL server all the sudden start usign hash or merge joins and try to use parallelism? I worked a couple of days ago to optimize the query and I've got it down to 71 milliseconds. Today it is back to 600 ms. Is the solution to use the real database, for example Oracle?
Monday, July 31, 2006
Tuesday, June 06, 2006
Evil empire...
Just found in my code:
using System.Globalization;
I did not know we are using evil system of globalization. Gess what, the globalists are sitting in the ambush in all unlikely places...
using System.Globalization;
I did not know we are using evil system of globalization. Gess what, the globalists are sitting in the ambush in all unlikely places...
Subscribe to:
Posts (Atom)