By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,102 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,102 IT Pros & Developers. It's quick & easy.

file stream 1's 0's ?

P: n/a
I need to program this.
I'm not asking any code, but an idea from you would be helpful.
Thanks.

I open a binary file stream,
which has millions or trillions of 1's & 0's
some thing like this 1100100011101110111..........
for easy understanding lets take this

1 1 0 0 0 0 1 =X

assume there is an idle case like this

1 1 1 1 1 1 1 = Y

now Y has 7 cases, each case has 2 chances
either 1 or 0

'Z' is particular case

first position is changed to 0
1 1 1 1 1 1 0
and matched with X
not as a number[whether x is y, or not], but from left to right
checking 'individual' digits

If one digit is not matching, then the case is failed

if true, then checking Y's 2nd digit with X's ,so on

if all the cases are failed
Now Y's second case is

1 1 1 1 1 0 1
1 1 1 1 1 0 0

and again repeating the same procedure
if x & y has trillions of 1's and 0's

what is the complexity of the program

can I take Z count,

so that

If I change the 1 1 1 1 1 1 1=Y

for Z count times,

I can get X.

Thanks.
Nov 20 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On 20 Nov, 09:49, cnoe <azeez...@gmail.comwrote:

I'm guessing your first language isn't english.
I'm left struggling to understand what you mean.
Could you provide a sample input and its corresponding
output.

input string: "1100001"
output string: "1111110"

or whatever
I need to program this.
The first step is to clearly define what you are trying to do
I'm not asking any code, but an idea from you would be helpful.
Thanks.

I open a binary file stream,
which has millions or trillions of 1's & 0's
some thing like this 1100100011101110111..........
those are actual bits? Or characters?
for easy understanding lets take this

1 1 0 0 0 0 1 =X
why are there seven of them? Why not 8?

assume there is an idle case like this

1 1 1 1 1 1 1 = Y
why is this an "idle case"? Assume we have no idea what
your problem domain is.

now Y has 7 cases, each case has 2 chances
either 1 or 0

'Z' is particular case
a particular 1 or 0?
first position is changed to 0
1 1 1 1 1 1 0
and matched with X
how can you compare a position (a single bit?) with
7 bits?

not as a number[whether x is y, or not],
what are x and y?
but from left to right checking 'individual' digits
nope you completly lost me here. Could you give an example?
If one digit is not matching, then the case is failed
why can't you just load the bits into a byte and compare the bytes?

if true,
does "true" mean "matching"?

then checking Y's 2nd digit with X's ,so on
what?
if all the cases are failed
what?
Now Y's second case * is
I thought a "case" was a bit (or a bit position)
1 1 1 1 1 0 1
1 1 1 1 1 0 0

and again repeating the same procedure

if x & y has trillions of 1's and 0's

what is the complexity of the program
do you mean as in big-O?

can I take Z count,
Z?

*so that

If I change the 1 1 1 1 *1 1 1=Y
you change the value of Y?
for Z count times,
what does "Z count" mean?
I can get * * X.

Thanks.
no problem...

--
Nick Keighley

Nov 20 '08 #2

P: n/a
On Nov 20, 3:18*pm, Nick Keighley <nick_keighley_nos...@hotmail.com>
wrote:
On 20 Nov, 09:49, cnoe <azeez...@gmail.comwrote:

I'm guessing your first language isn't english.
I'm left struggling to understand what you mean.
Could you provide a sample input and its corresponding
output.

input string: *"1100001"
output string: "1111110"

or whatever
I need to program this.

The first step is to clearly define what you are trying to do
I'm not asking any code, but an idea from you would be helpful.
Thanks.
I open a binary file stream,
which has millions or trillions of 1's & 0's
some thing like this 1100100011101110111..........

those are actual bits? Or characters?
for easy understanding lets take this
1 1 0 0 0 0 1 =X

why are there seven of them? Why not 8?
assume there is an idle case like this
1 1 1 1 1 1 1 = Y

why is this an "idle case"? Assume we have no idea what
your problem domain is.
now Y has 7 cases, each case has 2 chances
either 1 or 0
'Z' is particular case

a particular 1 or 0?
first position is changed to 0
1 1 1 1 1 1 0
and matched with X

how can you compare a position (a single bit?) with
7 bits?
not as a number[whether x is y, or not],

what are x and y?
but from left to right checking 'individual' digits

nope you completly lost me here. Could you give an example?
If one digit is not matching, then the case is failed

why can't you just load the bits into a byte and compare the bytes?
if true,

does "true" mean "matching"?
then checking Y's 2nd digit with X's ,so on

what?
if all the cases are failed

what?
Now Y's second case * is

I thought a "case" was a bit (or a bit position)
1 1 1 1 1 0 1
1 1 1 1 1 0 0
and again repeating the same procedure
if x & y has trillions of 1's and 0's
what is the complexity of the program

do you mean as in big-O?
can I take Z count,

Z?
*so that
If I change the 1 1 1 1 *1 1 1=Y

you change the value of Y?
for Z count times,

what does "Z count" mean?
I can get * * X.
Thanks.

no problem...

--
Nick Keighley

here it is

take a sequence some thing like this

1 0 1 0 1 1 1 1 0 1 1 1 [total 12 here]
1 1 1 1 1 1 1 1 1 1 1 1 1 [create an idle case with 12 1's]

if I keep changing the idle sequence with 1's and 0's
in which case I can get the original given

sequence.

thanks.
Nov 20 '08 #3

P: n/a
cnoe wrote:
<snip>
1 1 1 1 1 1 1 1 1 1 1 1 1 [create an idle case with 12 1's]
s/idle/ideal/ ??

Bye, Jojo
Nov 20 '08 #4

P: n/a
On 20 Nov, 10:24, cnoe <azeez...@gmail.comwrote:
On Nov 20, 3:18*pm, Nick Keighley <nick_keighley_nos...@hotmail.com>
wrote:
On 20 Nov, 09:49, cnoe <azeez...@gmail.comwrote:
I'm guessing your first language isn't english.
I'm left struggling to understand what you mean.
Could you provide a sample input and its corresponding
output.
input string: *"1100001"
output string: "1111110"
or whatever
I need to program this.
The first step is to clearly define what you are trying to do
I'm not asking any code, but an idea from you would be helpful.
Thanks.
I open a binary file stream,
which has millions or trillions of 1's & 0's
some thing like this 1100100011101110111..........
those are actual bits? Or characters?
for easy understanding lets take this
1 1 0 0 0 0 1 =X
why are there seven of them? Why not 8?
assume there is an idle case like this
1 1 1 1 1 1 1 = Y
why is this an "idle case"? Assume we have no idea what
your problem domain is.
now Y has 7 cases, each case has 2 chances
either 1 or 0
'Z' is particular case
a particular 1 or 0?
first position is changed to 0
1 1 1 1 1 1 0
and matched with X
how can you compare a position (a single bit?) with
7 bits?
not as a number[whether x is y, or not],
what are x and y?
but from left to right checking 'individual' digits
nope you completly lost me here. Could you give an example?
If one digit is not matching, then the case is failed
why can't you just load the bits into a byte and compare the bytes?
if true,
does "true" mean "matching"?
then checking Y's 2nd digit with X's ,so on
what?
if all the cases are failed
what?
Now Y's second case * is
I thought a "case" was a bit (or a bit position)
1 1 1 1 1 0 1
1 1 1 1 1 0 0
and again repeating the same procedure
if x & y has trillions of 1's and 0's
what is the complexity of the program
do you mean as in big-O?
can I take Z count,
Z?
*so that
If I change the 1 1 1 1 *1 1 1=Y
you change the value of Y?
for Z count times,
what does "Z count" mean?
I can get * * X.
Thanks.
no problem...
--
Nick Keighley
don't quote sigs
here it is
here *what* is?
take a sequence some thing like this

1 0 1 0 1 1 1 1 0 1 1 1 *[total 12 here]

1 1 1 1 1 1 1 1 1 1 1 1 1 [create an idle case with 12 1's]
that's 13 1's. I asked you to give an example of both
input and output. You have not provided the output.

f("101011110111","111111111111) -??

you have a mapping that's takes two sequences of bits as
an input and produces... what exactly?
if I keep changing the idle sequence with 1's and 0's
what does this mean?
in which case I can get the original given
sequence.
I've no idea what this means.

If you can't state your problem then I don't see how
you can expect to write a program to solve it.
I probably won't reply to you again.
You seem like a time waster.

--
Nick Keighley
Nov 20 '08 #5

P: n/a
cnoe wrote:
I need to program this.
I'm not asking any code, but an idea from you would be helpful.
Thanks.

I open a binary file stream,
which has millions or trillions of 1's & 0's
some thing like this 1100100011101110111..........
Are you talking about bits or bytes?

What do you think
"binary file stream"
means in C?

--
pete
Nov 20 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.