473,769 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

file stream 1's 0's ?

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 110010001110111 0111..........
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
5 1987
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 110010001110111 0111..........
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
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 110010001110111 0111..........

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
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
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 110010001110111 0111..........
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
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 110010001110111 0111..........
Are you talking about bits or bytes?

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

--
pete
Nov 20 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1773
by: Siddharth Taneja | last post by:
Hi, I have a very simple prg over here, trying to read the lines of a file #include <iostream> #include <fstream> #include <iostream> #include <string> using namespace std;
2
13099
by: gnv | last post by:
Hi all, I am writing a cross-browser(i.e. 6 and netscape 7.1) javascript program to save an XML file to local file system. I have an xml string like below: var xmlStr = "<?xml version="1.0" encoding="UTF-8"?><a>some info</a>"; I want to save this xml file to local file system with JavaScript,
19
3220
by: Johnny Google | last post by:
Here is an example of the type of data from a file I will have: Apple,4322,3435,4653,6543,4652 Banana,6934,5423,6753,6531 Carrot,3454,4534,3434,1111,9120,5453 Cheese,4411,5522,6622,6641 The first position is the info (the product) I want to retreive for the corresponding code. Assuming that the codes are unique for each product and all code data is on one line.
13
4321
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming that this is suppossed to end up as a component for others to use, and therefore I do NOT have access to their global.cs::Session_End() how do I cleanup files that were uploaded -- but obviously left stranded when the users aborted/gave up writting...
5
3068
by: Daniel Corbett | last post by:
I am trying to save a file dynamically created in a webpage. I get the following headers, but cannot figure out how to save the attachment. I am basically trying to replicate what internet explorer would do in this case. The headers I am getting are: Headers {Content-Disposition: attachment; filename="dynamic_file.mdb" Connection: close Cache-Control: private Content-Type: application/octet-stream
5
3173
by: IcingDeath via DotNetMonster.com | last post by:
I am building this SQL Server database app in which i can store files. In order to display files I want to have the app show the associated icon for the extension of the file that is in the database. Therefore the file doesnt really exist on the user's hard drive. All the file extracting techniques require that I have the actual file on the drive in order to get an icon for it. There is a workaround for this: i could create dummy files with...
4
2507
by: rony_16 | last post by:
Hi, I have a program that connects to a site With WebRequest and WebResponse . The response of this site is a file (csv file). The problem is that the file do not comes as a stream , hi is a part of the header (Content-Disposition:attachment; filename=changehistory.csv) i tried to download this file as a stream , but it do not work . i triesd with WebClient , but i coudn't attache a cookieContainer to him . (Connectiong to LogIn)
5
64651
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C++ programming. FYI Although I have called this article “How to Parse a File in C++”, we are actually mostly lexing a file which is the breaking down of a stream in to its component parts, disregarding the syntax that stream contains. Parsing is actually including the syntax in order to make...
6
17147
by: J055 | last post by:
Hi I have the following code. I upload an XML file using the FileUpload object, store the stream in a session so the user gets the chance to confirm some options then pass the stream from the Session to an XmlReader. if (performImport == false) { Session = fileUpload1.FileContent; //... some other code
45
4465
by: Dennis | last post by:
Hi, I have a text file that contents a list of email addresses like this: "foo@yahoo.com" "tom@hotmail.com" "jerry@gmail.com" "tommy@apple.com" I like to
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.