Monday, 9 September 2013

How do I get the system date and time and store in a variable

How do I get the system date and time and store in a variable

I want to store the current date and time in a variable using C#. How
would I do that if it has to be in the format YYYY, MM, DD, HH, MM, SS?
I.e. I know I can store midnight on January 1st, 2013 as;
var time= new DateTime(2013, 1, 1, 0, 0, 0);
How do I do this with the system date and time?

SQL Server: deadlocked on lock communication buffer resources

SQL Server: deadlocked on lock communication buffer resources

what could be possible reason for this deadlock type? (not deadlock in
general)
lock communication buffer resources is this indicated system is low in
memory and buffers count ran out of limit?
Detailed Error: Transaction (Process ID 59) was deadlocked on lock
communication buffer resources with another process and has been chosen as
the deadlock victim. Rerun the transaction

gfortran 4.8.1 on Windows 7 (undefined reference to 'WinMain@16')

gfortran 4.8.1 on Windows 7 (undefined reference to 'WinMain@16')

I have a Problem compiling some fortran code with gfortran 4.8.1 on
Windows 7. With some fortran programs I get the error message:
c:/gcc/bin/../lib/gcc/i686-pc-mingw32/4.8.1/../../../../i686-pc-mingw32/lib/libmingw32.a(lib32_libmingw32_a-crt0_c.o):crt0_c.c:(.text+0x3c):
undefined reference to 'WinMain@16'
These are not programs that conatain only function or subroutines!
Any help how to solve this problem?
Thanks in advance.
Kind regards
Klaus

#EANF#

#EANF#

I can't understand why I am losing values for the below:
double bal = d.getBalance();
double finalBal = bal + (bal* x/1200*p);
BigDecimal result = new BigDecimal(finalBal).setScale(2,
BigDecimal.ROUND_HALF_UP);
System.out.println(d.getName()+" "+(result));
bal, p and x are all double type. Hence I am using the big decimal to
change it to the standard currency format. I cant understand why I am
getting more values.
Expected Output Your Output
Tom 69.28 Tom 66.54
Mickey 108.42 Mickey 105.46
Juliet 2488.71 Juliet 2495.00
Ann 2201.94 Ann 2208.19

Sunday, 8 September 2013

Binary pyramid in C programming [on hold]

Binary pyramid in C programming [on hold]

How to write a program to get
1
01
101
0101
10101
.....
my loop is:
for(i=1;i<=num;i++)
{
for(j=1;j<=i;j++)
{
if(i%2==0)
{
printf("0");
}
else
{
printf("1");
}
}
}

setting current cell in datagridview in load event not working in vb.net

setting current cell in datagridview in load event not working in vb.net

This is my code for setting the current cell:
dvFromAlloc.CurrentCell = dvFromAlloc(1, 0)
How ever this is not working in load event, Why is it not working?
Thank you for your help

numpy array: replace nan values with average of columns

numpy array: replace nan values with average of columns

I've got a numpy array filled mostly with real numbers, but there is a few
nan values in it as well.
How can I replace the nans with averages of columns where they are?