September 3, 2010, 11:54 am
This sample code is for testing some data type border value using C union. Worked on Linux OS. #include <stdio.h>#include <stdlib.h> int main(void){ union { unsigned long int lms; unsigned short shms[2]; unsigned char bms [4]; } myms; myms.lms = 0; while (1) { printf(“long: %ld short: %d byte: %d\n”, myms.lms, [...]
Read More » »
September 3, 2010, 11:45 am
You might have known the following example: Math.Round(3.44, 1); //Returns 3.4.Math.Round(3.45, 1); //Returns 3.4.Math.Round(3.46, 1); //Returns 3.5. (code sample from Microsft msdn site) So here you might find something is different. why 3.45 is 3.4 ? Yes, in C#, the Math.Round method normally (but not always, see more examples below) make all 0.5 and less down [...]
Read More » »
September 3, 2010, 10:55 am
Maybe you need to check .NET Data Type Suffixes, or call it Numeric Literals. For example: 100L means long type, then what meaning of 100M ? The following is all data type suffixes which I have found: Type Suffix .NET Framework Type ——————————————long L or l System.Int64decimal M or m System.Decimaldouble D or d System.Doublefloat [...]
Read More » »
September 2, 2010, 2:56 pm
To make the VisualSVN server accept log message changes, a pre-revprop-change hook, that allows to change author or message, has to be installed for the repository. The default installation rejects changes to author and log message. It is hard to find a sample hook script. but the following one is a solution but it need [...]
Read More » »
September 2, 2010, 2:37 pm
VisualSVN official site provides a help for “Where VisualSVN Server logs are stored“
Read More » »
September 2, 2010, 2:35 pm
After 2 articles Remote connect to SQL Server 2005 Express or SQL Server 2005 and Change SQL Server or SQL Server Express Authentication Mode, the SQL Server remote connection still have more stuff to talk about. Yes, we need to set Port and Firewall stuff to let remote computer can access. Doug Kennard have given [...]
Read More » »
September 2, 2010, 11:26 am
When I installed SQL Server Express on my local PC, I used to select Windows Authentication mode only, but later I might have to change the Authentication mode for some reasons such as connect this SQL Server database from another computer and I don’t want to set a new windows user account for another computer [...]
Read More » »
September 1, 2010, 1:04 pm
When we build Web Applications, we need to give a 404 page when the url link dead or not work. So “Page Not Found” content should be put in the 404 page. It is so easy because you just put the text on that page. However, how about multiple cultural web applications ? You have [...]
Read More » »
September 1, 2010, 12:51 pm
A common error always pop up when you run your .NET Application just like the following : Error Details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. The reasons and resolutions: These are different solutions due to different case, Here I collect some of them [...]
Read More » »
September 1, 2010, 12:19 pm
The lock keyword ensures that one thread does not enter a critical section of code while another thread is in the critical section. If another thread tries to enter a locked code, it will wait, block, until the object is released. The lock keyword marks a statement block as a critical section by obtaining the [...]
Read More » »