Click here to Skip to main content
15,906,106 members
Home / Discussions / C#
   

C#

 
Questionsystem time Pin
lankaudaranga16-Sep-08 20:56
lankaudaranga16-Sep-08 20:56 
AnswerRe: system time Pin
Giorgi Dalakishvili16-Sep-08 21:02
mentorGiorgi Dalakishvili16-Sep-08 21:02 
QuestionC++ Crc Method to C# Crc Method Pin
Programm3r16-Sep-08 20:56
Programm3r16-Sep-08 20:56 
AnswerRe: C++ Crc Method to C# Crc Method Pin
Guffa16-Sep-08 21:24
Guffa16-Sep-08 21:24 
QuestionRe: C++ Crc Method to C# Crc Method Pin
Programm3r16-Sep-08 21:40
Programm3r16-Sep-08 21:40 
AnswerRe: C++ Crc Method to C# Crc Method Pin
leppie16-Sep-08 21:48
leppie16-Sep-08 21:48 
QuestionRe: C++ Crc Method to C# Crc Method Pin
Programm3r16-Sep-08 21:52
Programm3r16-Sep-08 21:52 
AnswerRe: C++ Crc Method to C# Crc Method Pin
leppie16-Sep-08 22:09
leppie16-Sep-08 22:09 
Programm3r wrote:
Would you say that the Crc method look good after my C# interpretation?


I am not sure that it is correct, as the result (which should fit in a 16 bit number) overflowed. I have modified it slighty, best would be to test the output with the output of the native function.
static unsafe ushort crc16(char* pBuf, int Len, ushort InitialCrc)
{
  ushort crc = InitialCrc; //?

  for (int i = 0; i < Len; i++)
  {
    crc = (ushort)((crc >> 8) | (crc << 8));
    crc = (ushort)(crc ^ *pBuf);
    crc = (ushort)(crc ^ ((crc & 0xff) >> 4));
    crc = (ushort)(crc ^ (crc << 12));
    crc = (ushort)(crc ^ ((crc & 0xff) << 5));
    pBuf++;
  }

  return crc;
}


xacc.ide - now with TabsToSpaces support
IronScheme - 1.0 alpha 4a out now (29 May 2008)

GeneralRe: C++ Crc Method to C# Crc Method Pin
Programm3r16-Sep-08 22:16
Programm3r16-Sep-08 22:16 
AnswerRe: C++ Crc Method to C# Crc Method Pin
Guffa16-Sep-08 22:49
Guffa16-Sep-08 22:49 
QuestionConnection String Problem using textBox1.text Pin
M Riaz Bashir16-Sep-08 20:51
M Riaz Bashir16-Sep-08 20:51 
AnswerRe: Connection String Problem using textBox1.text Pin
Giorgi Dalakishvili16-Sep-08 21:11
mentorGiorgi Dalakishvili16-Sep-08 21:11 
GeneralRe: Connection String Problem using textBox1.text Pin
Guffa16-Sep-08 21:14
Guffa16-Sep-08 21:14 
GeneralRe: Connection String Problem using textBox1.text Pin
Giorgi Dalakishvili16-Sep-08 21:17
mentorGiorgi Dalakishvili16-Sep-08 21:17 
AnswerRe: Connection String Problem using textBox1.text Pin
Programm3r16-Sep-08 21:12
Programm3r16-Sep-08 21:12 
AnswerRe: Connection String Problem using textBox1.text Pin
Guffa16-Sep-08 21:12
Guffa16-Sep-08 21:12 
GeneralRe: Connection String Problem using textBox1.text Pin
M Riaz Bashir16-Sep-08 21:16
M Riaz Bashir16-Sep-08 21:16 
GeneralRe: Connection String Problem using textBox1.text Pin
Guffa16-Sep-08 21:27
Guffa16-Sep-08 21:27 
GeneralRe: Connection String Problem using textBox1.text Pin
M Riaz Bashir16-Sep-08 21:29
M Riaz Bashir16-Sep-08 21:29 
AnswerRe: Connection String Problem using textBox1.text Pin
Programm3r16-Sep-08 21:26
Programm3r16-Sep-08 21:26 
GeneralRe: Connection String Problem using textBox1.text Pin
M Riaz Bashir16-Sep-08 21:28
M Riaz Bashir16-Sep-08 21:28 
AnswerRe: Connection String Problem using textBox1.text Pin
Giorgi Dalakishvili16-Sep-08 21:37
mentorGiorgi Dalakishvili16-Sep-08 21:37 
AnswerRe: Connection String Problem using textBox1.text Pin
Vasanth.S.R17-Sep-08 0:58
Vasanth.S.R17-Sep-08 0:58 
AnswerRe: Connection String Problem using textBox1.text Pin
Mohammed Hameed17-Sep-08 1:05
professionalMohammed Hameed17-Sep-08 1:05 
Questioni want to make the fix sized text in text box(e.g 10 characters). Pin
maifs16-Sep-08 20:51
maifs16-Sep-08 20:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.