Tuesday, March 16, 2010

Database DEnormalization and Violating Simplicity Principles

Timothy Claason, at SQL Server Central, writes:

"Denormalization is not a design strategy. It is a design work-around. Well
normalized databases represent a good design strategy, but can often lead to a
great deal of complexity when it comes to support, maintenance, and new
development. A well designed database can mean that, in order to get specific
data you need, you need to go through 5, 10, or even more tables which represent
the data you're looking for. Though there are many solutions to this dilemma,
such as virtual tables (views), programmatic solutions, temporary tables, and
more, I think it's important to not discount the value of well-placed
denormalization in the database. The intent of this article is to consider some
use cases for denormalization, and from those use cases, assert some
generalizations about when and why to use denormalization
."



Continued

Labels:

Wednesday, March 10, 2010

File Hash Checker

Download here

This is a simple utility I wrote that displays the hash code of one or two files, and then compares them to see if they are the same. I used this to find duplicate image files (where the names of the files could be different).


Labels: , , ,

Friday, March 5, 2010

Conditional Compilation

#define test = true
class TestClass {
void test() {
#if test
// do something
#else
// do something else
#endif
}}

Here's the equivalent code in VB.NET:

#Const test = True
Class TestClass
Sub test()
#If test
'do something
#Else
'do something else
#End If
End Sub
End Class

Here's the same but using the DEBUG constant which is automatically set by Visual Studio based on whether you are in debug mode:


Class TestClass
Sub test()
#If DEBUG
'do something
#Else
'do something else
#End If
End Sub
End Class

Labels:

Software Testing

Unit Tests
The major benefits to be had from unit testing are

1. It allows the developer test parts of an application without waiting for the other parts to be available.

2. Exceptional conditions can be tested for the unit

3. The debugging process is simplified by limiting the search for bugs to a small unit rather than the complete application.

4. It helps avoid lengthy compile-build-debug cycles when debugging difficult problems.

5. Detection and removal of defects can be done at a much lower cost.

Integration Testing
The purpose of this kind of testing is to verify whether the major subsystems of the application are integrated. It helps in uncovering the errors that may arise due to conflicts between different units of an application. Integration testing is performed in different ways.

Bottom Up Approach: The testing is commenced from the smallest subsystem and progresses up the hierarchy to cover the whole system. This methodology requires the developer to write a number of test driver programs that test the integration between the subsystems.

Top down Approach: This begins at the top. The top level interfaces are first tested and then the smaller sub systems are examined. Stubs are written for modules that are not ready for testing.

Umbrella Approach: The focus in this methodology is on testing the modules that have a high degree of user interaction. Stubs are used in place of process intensive modules. This enables the developer test the graphical user interface and improves the functionality of the interface.

Regression Testing
Regression testing is performed whenever the program is modified. The process involves the rerun of all the tests mentioned in the preceding sections. It has two main goals:

  1. Verification of known bugs that were corrected
  2. Verification of new bugs.


Testing International Applications
Applications created for international usage are to be tested by checking for the language, the country and dependencies. The following factors are to be considered when testing such applications:

  • Whether the application’s data and user interface conform to the locale’s standards for date, time, numeric values, currency, list separators and measurements.
  • Whether the application runs on different languages and culture variants.
  • If Unicode has not been used in the application the culture/locale code of the operating system will have to be set to the localized version of the application.
  • The Input data in the language should be supported by the localized version.
  • In this section of the lesson we have focused upon the testing of Windows applications. In the sections that follow we shall briefly look at tracing windows applications.

Labels:

Thursday, February 5, 2009

Javascript Error trapping


onerror=handleErr;
var noErrors = true;

function handleErr(msg,url,l)
{
if(noErrors){
txt="There was an error detected.\n\n";
txt+="Error: " + msg + "\n";
txt+="URL: " + url + "\n";
txt+="Line: " + l + "\n\n";
txt+="Click OK to continue.\n\n";
alert(txt);
noErrors = false;
return true;
}
else{
return true;
}
}

Labels:

Monday, October 13, 2008

Attaching SQL Server .mdb without .ldf file

If you're using SQL Server 2005:
create a database of equal size to the one you're trying to attach
shutdown the server
swap in the old mdf file
bring up the server and let the database attempt to be recovered and then go into suspect mode
put the database into emergency mode with ALTER DATABASE
run DBCC CHECKDB (dbname, REPAIR_ALLOW_DATA_LOSS) which will rebuild the log and run full repair
Your database will be available again but you'll have lost data and the data won't be transactionally consistent - see the following blog posts:
https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/15/632398.aspx
https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/16/633645.aspx
https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/18/636105.aspx
If you're on SQL Server 2000, you can still do this but you'll need to use the undocumented DBCC REBUILD_LOG at your own risk.

original post on MSDN

Labels:

Wednesday, August 13, 2008

Flash Frame by Frame Animation

Found out two great shortcuts for creating flash frame by frame animation:

1. When you begin, in the timeline, select a whole range of frames and right click, and select "Convert to Blank Keyframes"
2. Turn on Onion Skinning, of course.
3. As you draw each frame, just use the period key to move forward (and the comma key to go back to previous frame).


So much faster and easier!

Labels: