Click here to Skip to main content
16,005,121 members
Home / Discussions / C#
   

C#

 
QuestionCount bitpattern occurences in textstrings Pin
invictus314-Jan-08 21:40
invictus314-Jan-08 21:40 
GeneralRe: Count bitpattern occurences in textstrings Pin
J4amieC14-Jan-08 22:33
J4amieC14-Jan-08 22:33 
GeneralRe: Count bitpattern occurences in textstrings Pin
invictus314-Jan-08 23:00
invictus314-Jan-08 23:00 
AnswerRe: Count bitpattern occurences in textstrings Pin
Ajay.k_Singh14-Jan-08 23:11
Ajay.k_Singh14-Jan-08 23:11 
GeneralRe: Count bitpattern occurences in textstrings Pin
invictus314-Jan-08 23:29
invictus314-Jan-08 23:29 
GeneralRe: Count bitpattern occurences in textstrings Pin
Russell Jones15-Jan-08 0:02
Russell Jones15-Jan-08 0:02 
GeneralRe: Count bitpattern occurences in textstrings Pin
invictus315-Jan-08 0:05
invictus315-Jan-08 0:05 
GeneralRe: Count bitpattern occurences in textstrings Pin
Russell Jones15-Jan-08 0:45
Russell Jones15-Jan-08 0:45 
If you are passing long pieces of binary data about the place as strings you have to be prepared for different people to mean different things by the same number. AFAIK ASCII leaves the choice of numbers above 127 to the person using them. While there are conventions for numbers 127-255 there are more than 1 so it may be that your data gets mangled on the way. .Net languages often try to make sense of this chaos by translating the string from one codepage to another; while this might be good for someone trying to read the string at the end it's the last thing you would want to happen to your data.

If you are going to search the same string repeatedly then maybe you could do something clever with trees, thus putting the effort in at the start when you build the tree and getting payback through faster searching later.

I would use the brute force method to start and make sure it's wrapped up in a tidy method so that you can come back and improve it later or try to find a better way of doing the same thing that doesn't require an exhaustive search of a list of bytes.

Russell
GeneralRe: Count bitpattern occurences in textstrings [modified] Pin
Luc Pattyn15-Jan-08 0:56
sitebuilderLuc Pattyn15-Jan-08 0:56 
GeneralRe: Count bitpattern occurences in textstrings Pin
invictus315-Jan-08 23:20
invictus315-Jan-08 23:20 
GeneralRe: Count bitpattern occurences in textstrings Pin
Luc Pattyn16-Jan-08 8:56
sitebuilderLuc Pattyn16-Jan-08 8:56 
GeneralRe: Count bitpattern occurences in textstrings Pin
invictus319-Jan-08 8:41
invictus319-Jan-08 8:41 
GeneralRe: Count bitpattern occurences in textstrings Pin
Luc Pattyn19-Jan-08 9:13
sitebuilderLuc Pattyn19-Jan-08 9:13 
GeneralRe: Count bitpattern occurences in textstrings Pin
invictus319-Jan-08 11:16
invictus319-Jan-08 11:16 
GeneralRe: Count bitpattern occurences in textstrings Pin
Luc Pattyn19-Jan-08 11:36
sitebuilderLuc Pattyn19-Jan-08 11:36 
GeneralRe: Count bitpattern occurences in textstrings Pin
invictus319-Jan-08 12:57
invictus319-Jan-08 12:57 
GeneralRe: Count bitpattern occurences in textstrings Pin
Luc Pattyn19-Jan-08 14:01
sitebuilderLuc Pattyn19-Jan-08 14:01 
GeneralRe: Count bitpattern occurences in textstrings Pin
invictus321-Jan-08 0:09
invictus321-Jan-08 0:09 
GeneralRe: Count bitpattern occurences in textstrings Pin
Luc Pattyn21-Jan-08 0:45
sitebuilderLuc Pattyn21-Jan-08 0:45 
GeneralRe: Count bitpattern occurences in textstrings Pin
invictus321-Jan-08 0:57
invictus321-Jan-08 0:57 
GeneralRe: Count bitpattern occurences in textstrings Pin
Luc Pattyn21-Jan-08 1:09
sitebuilderLuc Pattyn21-Jan-08 1:09 
GeneralRe: Count bitpattern occurences in textstrings Pin
invictus321-Jan-08 22:41
invictus321-Jan-08 22:41 
GeneralRe: Count bitpattern occurences in textstrings Pin
Luc Pattyn22-Jan-08 1:07
sitebuilderLuc Pattyn22-Jan-08 1:07 
GeneralRe: Count bitpattern occurences in textstrings Pin
Ennis Ray Lynch, Jr.15-Jan-08 11:00
Ennis Ray Lynch, Jr.15-Jan-08 11:00 
GeneralRe: Count bitpattern occurences in textstrings Pin
invictus315-Jan-08 23:10
invictus315-Jan-08 23:10 

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.