Click here to Skip to main content
15,887,585 members
Home / Discussions / C#
   

C#

 
Questionhelp meeeeeeeeeeee?programming cms Pin
torabi2329-Sep-09 3:23
torabi2329-Sep-09 3:23 
AnswerRe: help meeeeeeeeeeee?programming cms Pin
Luc Pattyn29-Sep-09 3:26
sitebuilderLuc Pattyn29-Sep-09 3:26 
AnswerRe: help meeeeeeeeeeee?programming cms Pin
stancrm29-Sep-09 3:33
stancrm29-Sep-09 3:33 
GeneralRe: help meeeeeeeeeeee?programming cms Pin
vivasaayi29-Sep-09 4:00
vivasaayi29-Sep-09 4:00 
AnswerRe: help meeeeeeeeeeee?programming cms Pin
Wes Aday29-Sep-09 8:52
professionalWes Aday29-Sep-09 8:52 
AnswerRe: help meeeeeeeeeeee?programming cms Pin
Christian Graus29-Sep-09 10:35
protectorChristian Graus29-Sep-09 10:35 
QuestionShifting bytes Pin
hadad29-Sep-09 3:17
hadad29-Sep-09 3:17 
AnswerRe: Shifting bytes Pin
Ian Shlasko29-Sep-09 4:16
Ian Shlasko29-Sep-09 4:16 
Shouldn't be too difficult to figure out an algorithm for it... Some hints:

1) To check the rightmost bit of a number: (x % 2) // Remainder when dividing by 2) The generic form would be (x % (1 << numBits)) to get any number of bits.

2) To remove the rightmost bit: (x >> 1) // Shift right one bit

3) To add a bit to the left of a number: (x + (newBit << currentBitCount))

As for the algorithm, you know exactly how many bits are moving into and out of each byte... Each group of eight septets turns into 7 octets... So the formulae are:

oct0 = s0 + ((s1 % (1 << 1)) << 7)
(Start with septet 0, get 1 bit from septet 1, shift it 7 places left, and add it to septet 0)

oct1 = (s1 >> 1) + ((s2 % (1 << 2)) << 6)
(Shift out one bit, since we moved it to octet 0, grab 2 bits from the next byte, shift 6 places, since we're one place shorter, and add)

oct3 = (s2 >> 2) + ((s3 % (1 << 3)) << 5)

See the pattern?

(A = this byte, B = next byte)
octN = (A >> N) + ((B % (1 << (N + 1))) << (7 - N))

Do that for 7 bytes, skip the 8th byte (All 7 bits from the 8th byte would be shifted to the 7th byte), and start over.

Proud to have finally moved to the A-Ark. Which one are you in?
Developer, Author (Guardians of Xen)

QuestionThe Excel sheet 4 is not recognized. Pin
vinothkumar_Dhakshinamoorthy29-Sep-09 3:05
vinothkumar_Dhakshinamoorthy29-Sep-09 3:05 
AnswerRe: The Excel sheet 4 is not recognized. Pin
EliottA29-Sep-09 4:29
EliottA29-Sep-09 4:29 
GeneralRe: The Excel sheet 4 is not recognized. Pin
Richard MacCutchan29-Sep-09 5:52
mveRichard MacCutchan29-Sep-09 5:52 
QuestionDatagrid [modified] Pin
Yonathan111129-Sep-09 2:35
professionalYonathan111129-Sep-09 2:35 
AnswerRe: Datagrid Pin
nagendrathecoder29-Sep-09 3:07
nagendrathecoder29-Sep-09 3:07 
GeneralRe: Datagrid Pin
Yonathan111129-Sep-09 3:23
professionalYonathan111129-Sep-09 3:23 
QuestionHello My Follow Programmer Pin
Raphael Emma29-Sep-09 2:30
Raphael Emma29-Sep-09 2:30 
AnswerRe: Hello My Follow Programmer Pin
nagendrathecoder29-Sep-09 2:35
nagendrathecoder29-Sep-09 2:35 
AnswerRe: Hello My Follow Programmer Pin
Paramhans Dubey29-Sep-09 2:41
professionalParamhans Dubey29-Sep-09 2:41 
AnswerRe: Hello My Follow Programmer Pin
Xmen Real 29-Sep-09 2:50
professional Xmen Real 29-Sep-09 2:50 
AnswerRe: Hello My Follow Programmer Pin
Christian Graus29-Sep-09 10:37
protectorChristian Graus29-Sep-09 10:37 
AnswerRe: Hello My Follow Programmer Pin
Harvey Saayman29-Sep-09 12:38
Harvey Saayman29-Sep-09 12:38 
Questiondelete Pin
nhqlbaislwfiikqraqnm29-Sep-09 1:53
nhqlbaislwfiikqraqnm29-Sep-09 1:53 
AnswerRe: Native dll´s into the exe? Pin
freakyit29-Sep-09 1:58
freakyit29-Sep-09 1:58 
GeneralMessage Closed Pin
29-Sep-09 2:11
nhqlbaislwfiikqraqnm29-Sep-09 2:11 
GeneralRe: Native dll´s into the exe? Pin
stancrm29-Sep-09 2:25
stancrm29-Sep-09 2:25 
GeneralRe: Native dll´s into the exe? Pin
nhqlbaislwfiikqraqnm29-Sep-09 2:57
nhqlbaislwfiikqraqnm29-Sep-09 2:57 

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.