Discussion:
[annevolve] Text Chromosomes & the big/little endian problem
Mitchell Timin
2006-08-07 20:35:23 UTC
Permalink
I wrote a C program that converts a text file of numbers to a binary
file of floats, or vice-versa. It's attached. It's all in one file, so
you just have to compile that file and make an executable called
"convert" or "convert.exe"

Then, say you have a chromosome file named "savedchromes". You just
type the commmand:
convert savedchromes
and you get a file called savedchromes.txt which consists of the same
values in text form. You can then email that file to someone whos
floats are not binary compatible. He will then give the command:
convert savedchromes.txt
He will get a binary file named savedchromes.txt.bin which is compatible
with his machine. He can rename the file to something more convenient
if he wishes.

m
--
I'm proud of http://ANNEvolve.sourceforge.net. If you want to write software, or articles, or do testing or research for ANNEvolve, let me know.
larryl
2006-08-08 13:27:44 UTC
Permalink
Post by Mitchell Timin
I wrote a C program that converts a text file of numbers to a binary
file of floats, or vice-versa. It's attached. It's all in one file,
so you just have to compile that file and make an executable called
"convert" or "convert.exe"
Then, say you have a chromosome file named "savedchromes". You just
convert savedchromes
and you get a file called savedchromes.txt which consists of the same
values in text form. You can then email that file to someone whos
convert savedchromes.txt
He will get a binary file named savedchromes.txt.bin which is
compatible with his machine. He can rename the file to something more
convenient if he wishes.
m
Isn't it better to avoid the confusion and let the programs save and
load in ascii ?



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Mitchell Timin
2006-08-08 15:29:54 UTC
Permalink
Post by larryl
Post by Mitchell Timin
I wrote a C program that converts a text file of numbers to a binary
file of floats, or vice-versa. It's attached. It's all in one file,
so you just have to compile that file and make an executable called
"convert" or "convert.exe"
Then, say you have a chromosome file named "savedchromes". You just
convert savedchromes
and you get a file called savedchromes.txt which consists of the same
values in text form. You can then email that file to someone whos
convert savedchromes.txt
He will get a binary file named savedchromes.txt.bin which is
compatible with his machine. He can rename the file to something more
convenient if he wishes.
m
Isn't it better to avoid the confusion and let the programs save and
load in ascii ?
There certainly are advantages to that, as has been pointed out before
by several people.

There are two reasons in favor of the present binary approach:

1. It's already coded and tested.

2. The text files need to be at least 2.5 times the size, in bytes.
Since some of our savedchromes files are quite large already, it's not
desirable to multiply their size by 2.5. (I remember some savedchromes
files being over 200,000 bytes.)

Larry, would you like to take over the waybak project, and eventually
release it with both of our names as authors?
Then you could change the savedchromes format to text, if you want.

m
--
I'm proud of http://ANNEvolve.sourceforge.net. If you want to write software, or articles, or do testing or research for ANNEvolve, let me know.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
larryl
2006-08-08 16:10:32 UTC
Permalink
Post by Mitchell Timin
Post by larryl
Post by Mitchell Timin
I wrote a C program that converts a text file of numbers to a binary
file of floats, or vice-versa. It's attached. It's all in one file,
so you just have to compile that file and make an executable called
"convert" or "convert.exe"
Then, say you have a chromosome file named "savedchromes". You just
convert savedchromes
and you get a file called savedchromes.txt which consists of the same
values in text form. You can then email that file to someone whos
convert savedchromes.txt
He will get a binary file named savedchromes.txt.bin which is
compatible with his machine. He can rename the file to something more
convenient if he wishes.
m
Isn't it better to avoid the confusion and let the programs save and
load in ascii ?
There certainly are advantages to that, as has been pointed out before
by several people.
1. It's already coded and tested.
2. The text files need to be at least 2.5 times the size, in bytes.
Since some of our savedchromes files are quite large already, it's not
desirable to multiply their size by 2.5. (I remember some savedchromes
files being over 200,000 bytes.)
Larry, would you like to take over the waybak project, and eventually
release it with both of our names as authors?
Then you could change the savedchromes format to text, if you want.
m
Maybe an ascii option in the INI file could be an start ?
I could try to add it if you like.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Mitchell Timin
2006-08-08 16:53:54 UTC
Permalink
Post by larryl
Post by Mitchell Timin
Post by larryl
Post by Mitchell Timin
I wrote a C program that converts a text file of numbers to a binary
file of floats, or vice-versa. It's attached. It's all in one file,
so you just have to compile that file and make an executable called
"convert" or "convert.exe"
Then, say you have a chromosome file named "savedchromes". You just
convert savedchromes
and you get a file called savedchromes.txt which consists of the same
values in text form. You can then email that file to someone whos
convert savedchromes.txt
He will get a binary file named savedchromes.txt.bin which is
compatible with his machine. He can rename the file to something more
convenient if he wishes.
m
Isn't it better to avoid the confusion and let the programs save and
load in ascii ?
There certainly are advantages to that, as has been pointed out before
by several people.
1. It's already coded and tested.
2. The text files need to be at least 2.5 times the size, in bytes.
Since some of our savedchromes files are quite large already, it's not
desirable to multiply their size by 2.5. (I remember some savedchromes
files being over 200,000 bytes.)
Larry, would you like to take over the waybak project, and eventually
release it with both of our names as authors?
Then you could change the savedchromes format to text, if you want.
m
Maybe an ascii option in the INI file could be an start ?
I could try to add it if you like.
That's a good idea; I had not considered that. The option is the
perfect solution, especially since you are willing to code it. :)

Yes, please do.

m
--
I'm proud of http://ANNEvolve.sourceforge.net. If you want to write software, or articles, or do testing or research for ANNEvolve, let me know.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
larryl
2006-08-08 19:41:46 UTC
Permalink
Post by Mitchell Timin
Post by larryl
Post by Mitchell Timin
Post by larryl
Post by Mitchell Timin
I wrote a C program that converts a text file of numbers to a binary
file of floats, or vice-versa. It's attached. It's all in one file,
so you just have to compile that file and make an executable called
"convert" or "convert.exe"
Then, say you have a chromosome file named "savedchromes". You just
convert savedchromes
and you get a file called savedchromes.txt which consists of the same
values in text form. You can then email that file to someone whos
convert savedchromes.txt
He will get a binary file named savedchromes.txt.bin which is
compatible with his machine. He can rename the file to something more
convenient if he wishes.
m
Isn't it better to avoid the confusion and let the programs save and
load in ascii ?
There certainly are advantages to that, as has been pointed out before
by several people.
1. It's already coded and tested.
2. The text files need to be at least 2.5 times the size, in bytes.
Since some of our savedchromes files are quite large already, it's not
desirable to multiply their size by 2.5. (I remember some savedchromes
files being over 200,000 bytes.)
Larry, would you like to take over the waybak project, and eventually
release it with both of our names as authors?
Then you could change the savedchromes format to text, if you want.
m
Maybe an ascii option in the INI file could be an start ?
I could try to add it if you like.
That's a good idea; I had not considered that. The option is the
perfect solution, especially since you are willing to code it. :)
Yes, please do.
m
I've commited the changes for two new waybak.ini options: saveFileName
and saveFileType

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Mitchell Timin
2006-08-08 22:33:14 UTC
Permalink
Post by larryl
Post by Mitchell Timin
Post by larryl
Post by Mitchell Timin
Post by larryl
Post by Mitchell Timin
I wrote a C program that converts a text file of numbers to a binary
file of floats, or vice-versa. It's attached. It's all in one file,
so you just have to compile that file and make an executable called
"convert" or "convert.exe"
Then, say you have a chromosome file named "savedchromes". You just
convert savedchromes
and you get a file called savedchromes.txt which consists of the same
values in text form. You can then email that file to someone whos
convert savedchromes.txt
He will get a binary file named savedchromes.txt.bin which is
compatible with his machine. He can rename the file to something more
convenient if he wishes.
m
Isn't it better to avoid the confusion and let the programs save and
load in ascii ?
There certainly are advantages to that, as has been pointed out before
by several people.
1. It's already coded and tested.
2. The text files need to be at least 2.5 times the size, in bytes.
Since some of our savedchromes files are quite large already, it's not
desirable to multiply their size by 2.5. (I remember some savedchromes
files being over 200,000 bytes.)
Larry, would you like to take over the waybak project, and eventually
release it with both of our names as authors?
Then you could change the savedchromes format to text, if you want.
m
Maybe an ascii option in the INI file could be an start ?
I could try to add it if you like.
That's a good idea; I had not considered that. The option is the
perfect solution, especially since you are willing to code it. :)
Yes, please do.
m
I've commited the changes for two new waybak.ini options: saveFileName
and saveFileType
Cool! That was fast. :)

I assume you have tested it. Was it on windows or linux?

Do you want to take over Waybak, finish it and release it? I think it
only need changes to the comments; It seems to run correctly. If you
want, I will add some additional genetic operators, like I talked about
a few weeks ago.

m
--
I'm proud of http://ANNEvolve.sourceforge.net. If you want to write software, or articles, or do testing or research for ANNEvolve, let me know.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Mitchell Timin
2006-08-09 02:44:42 UTC
Permalink
This is a multi-part message in MIME format.
--------------080601050001060405090704
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
I wrote a C program that converts a text file of numbers to a binary
file of floats, or vice-versa. It's attached. It's all in one file, so
you just have to compile that file and make an executable called
"convert" or "convert.exe"
Then, say you have a chromosome file named "savedchromes". You just
convert savedchromes
and you get a file called savedchromes.txt which consists of the same
values in text form. You can then email that file to someone whos
convert savedchromes.txt
He will get a binary file named savedchromes.txt.bin which is compatible
with his machine. He can rename the file to something more convenient
if he wishes.
I put the program (convert.c) in the SVN repository, under
trunk/users/timin.

m
--
I'm proud of http://ANNEvolve.sourceforge.net. If you want to write software, or articles, or do testing or research for ANNEvolve, let me know.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Loading...