LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-07-2005, 02:34 AM   #76
enemorales
Member
 
Registered: Jul 2004
Location: Santiago, Chile
Distribution: Ubuntu
Posts: 410

Rep: Reputation: 31

I have anothe theory about the problem. I think he has a stream of binary data and wants to count the number of ones. So if the input of the program is

00110101011

then the output is 6 I believe ).

The problem is that the size of the data is very big. Now, I see 2 possibilities:

1) Either the data is in binary, so if you look into the file you will see any kind of symbols, each of them representing a byte and therefore 8 bits. In this case the problem consists of adding about 300.000 bytes (the size of the file about 300.000, if I recall correctly), which I think fits in a long. I mean: the worst case is that all the bits are 1 and in this case the addition will be 300.000x8. Of course if the file becomes bigger and bigger there will be a moment when built in integers datatypes won't be enough, but we need a VERY big file for that, isn't it? we need that 300.000x8>capacity of a long = 2.147.483.647. Therefore a file of about 250Mb, a lot more than 300Kb anyway.

2) Either the data is in ASCII, so if you look inside there are only 0's and 1's, and in this case the maximum number of 1's is 300.000.

In any case you don't need to store the full string into memory, so that's why I'm not sure about my interpretation of the problem, so I would like to ask: Is the order of the data important?? Will the output be different if you put the information "up-side-down"?
 
Old 07-07-2005, 07:10 AM   #77
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Quote:
Originally posted by Matir
He is apparently claiming to have hit upon some big compression algorithm that is based on either division and multiplication or base conversion. I'm not sure which, to be honest, and I've been here all along. In either case, I can say with certainty that his algorithm would not do anything useful at all. (I say this as both a programmer of 12 years and as a student of Computer Science)
I agree... last time I checked the number 10d, Ah, 12o, and 1010b all take the same amount of physical space to represent
 
Old 07-07-2005, 10:20 AM   #78
mohama
Member
 
Registered: May 2005
Location: solar-system->earth->northern hemisphere
Distribution: ubunutu+knoppix+suse
Posts: 197

Rep: Reputation: 31
interesting ..

hi ,

Quote:
i dont care about programming
according to this sentence i think he has no idea what is he talking about , and from what i succeeded to understand from his unreadble and ununderstandble phrases , i think he beleives that he discovered a new way to represent data so that we could save memory and as effetiant as the way we use ..

Quote:
does that mean everyone is now trying to do what i said and ignoring me now
further more , he thinks that after we understanded his new discovery we just ignored him and get busy with it ..!!!!!!!!!

and he said something about fingers and 3 years old child and 7 years old child which i have no idea what was he tring to explain by it ..!!!

well , i know that some genious people have strange behaves , but i know also that he is not one of them .

so i would say , save your time , and go to do somthing useful .. unless he writes clearly readbly and things that make sence , especialy after asking him thousand times to do that ...

thats all ,
bye,
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
writing raw data to a tiff file James_dean Programming 4 10-25-2005 05:03 AM
Reading raw hard disk sectors villie Programming 4 05-13-2004 12:18 AM
Capturing raw mouse data pld Linux - Software 4 04-11-2004 08:13 PM
Raw Syn Packet with Data GodSendDeath Programming 4 04-06-2004 04:53 PM
Raw Packet Data vanibhat Linux - Security 1 08-01-2003 07:42 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration