-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cyclop #1
base: master
Are you sure you want to change the base?
Cyclop #1
Conversation
Add multi-icon ico-file and compile instructions.
compile_and_add_icon.txt
Outdated
|
||
Also, I see this program have name a clop. "Клоп" in russian sounds disgustingly like a "bug", "crum". | ||
But programming language of this is C. | ||
So I think "cyclop" will be good name for this program... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, the program/project name clop was chosen hastily and erroniously, because
"List Of Consecutive Primes" is more correct description than "Consecutive List Of Primes" for what the app is intended.
So, it should be locp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cann't not find an appropriate word for LOCP and the semantic association to add an icon.
So cyclop will be the name for this program for me.
Cyclop (C-lang - Consecutive List Of Primes).
compile_and_add_icon.txt
Outdated
But programming language of this is C. | ||
So I think "cyclop" will be good name for this program... | ||
|
||
- Cyclop multi-icon ico-file - added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as the app is console, I can't even imagine for what needs this icon can come in handy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make able this icon was displayed in various formats for program in windows.
Here is screens of different icons (PNG):
https://github.com/username1565/clop/blob/master/cyclop_compiled/compile_icon/icons_in_windows.7z
As you can see on the screens, this program can be runned,
using double-click on exe in Windows.
win64: >windres -F pe-x86-64 cyclop.rc cyclop_x64.o | ||
|
||
5. Compile .c with .o - using gcc: | ||
win32: >gcc -m32 cyclop.c cyclop_win32.o -o cyclop_win32.exe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer Distributed Computings notation for naming of executable files:
bin\Release\clop_$(version)windows_x86_64.exe
bin\Release\clop$(version)windows_x86.exe
./bin/Release/clop$(version)linux_x86_64
./bin/Release/clop$(version)_linux_x86
for the relevant OS and architectures
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I working with windows executables win32-win64. I cann't compile this for linux.
You can do this yourself of just rename files and then you can upload id for your releases...
cyclop_compiled/cyclop.c
Outdated
#define VERSION "1.03" | ||
|
||
#ifdef _WIN64 | ||
#define WINPAUSE system("pause") //to don't close window when double click on exe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not understand where the define is used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
system("pause"); used in the bottom of the code after this definition.
This need to prevent close window on error, or when double clicking on exe.
But... WINPAUSE stopped writting last block in the file,
and need to press key or exit from program - to update file.
fflush(fout), and fclose(fout) before system("pause") - not working and file not writting before closing window...
PNG screens of program, which compiled with multi-icon ico-file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See source code, there is many changes and additions, which backward compatible with previous program.
compile_and_add_icon.txt
Outdated
|
||
Also, I see this program have name a clop. "Клоп" in russian sounds disgustingly like a "bug", "crum". | ||
But programming language of this is C. | ||
So I think "cyclop" will be good name for this program... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cann't not find an appropriate word for LOCP and the semantic association to add an icon.
So cyclop will be the name for this program for me.
Cyclop (C-lang - Consecutive List Of Primes).
compile_and_add_icon.txt
Outdated
But programming language of this is C. | ||
So I think "cyclop" will be good name for this program... | ||
|
||
- Cyclop multi-icon ico-file - added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make able this icon was displayed in various formats for program in windows.
Here is screens of different icons (PNG):
https://github.com/username1565/clop/blob/master/cyclop_compiled/compile_icon/icons_in_windows.7z
As you can see on the screens, this program can be runned,
using double-click on exe in Windows.
Fix try to write, before opening file. Commented test strings added. See source code.
Add supporting for 7z compressing txt-parts - on fly, when generating. test.bat: ::cyclop_win32.exe 1 982451653 -p -o 50M.txt -s 1 -n 1000000 -b 10 -d 09 -bd 10 -wfl -f 100000 ::cyclop_win32.exe 1 982451653 -p -o 50M.txt -s 1 -n 1000000 -b 10 -d 09 -bd 10 -wfl -f 100000 -path_to_7z cyclop_win32.exe 1 982451653 -p -o 50M.txt -s 1 -n 1000000 -b 10 -d 09 -bd 10 -wfl -f 100000 -path_to_7z "C:\\7-Zip\\7z.exe" pause
If path not specified, and 7z folder there is in environment variables PATH, just -7z key can be used. No any sence to using argument -path_to_7z. Default path "7z.exe" already specified in the source code...
Add optimizaton option -O3 when compiling. Detail about this - here: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
And rename
Клоп ico and pictures - added. Add silently/quietly 7z packing, without messages in console. (addition option "-y > nul" for each 7z command.) Add dialog for set parameters if this was not specified in command line. Add command line generator and display this, after dialog. Add variables to check is argument specified or changed. Add function to escape characters. Add function to return escaped symbol. Add function to unescape character. Add second version of function for unescape (commened in code). Add function to check is string a number or not. Re-write function print-usage. Now default call for this is print_usage(0); Add function to change fullpath to filename of exe in argv[0] when double click on exe in windows. Add disabled argument for 7z to don't show dialog to enable this. Add supporting to write and read primes, as binary data. (*, **) Write primes as 64-bit integers, without any delimieters. "-x64" option available - in command line. Write primes as prime gaps. "-gaps" option in command line. There is two formats for gaps: 1. Two bytes for each full prime gap writted in file from unsigned short int. "-gaps2byte" option in command line. More compressing. In this case all primes can be writted as two bytes. [0000 - FFFF] = [0 - 65535] if very big range for gaps for all 64-bit prime numbers. prime gap writted fully. 2. One bytes for each half prime gap writted in file from unsigned char (1 byte). "-gaps1byte" option in command line. The best compressing. In this case all primes can be writted as ONE BYTE. - All gaps are even number and can be divided by 2. - Many half gaps have the value lesser than 255, so can be writted as 1 byte. - 00 byte never used, because 0 gap cann't be exists. So 00 byte reserved for switch from 1 byte to 2 byte. - If 00 byte, then next two bytes are half prime gap as (unsigned short int - 2 bytes). All other prime gaps writted as 1 byte. Add gaps and 64-bit numbers - to check_file function. Now available checking this parts and append data if this not full. If primes not correct there will be delimiter block as text. ________________________________________________________________ * I recommend to see the binary code of this files in hex-editor, in this case, this more readable. If many parts are generated and one from this sequence is deleted or incomplete, program can write fully or append data only to this part. ** I thinking about writting the converter between lists, x64-binary data, and gaps (half-gaps) parts. This converter may convert parts from each <-> to each. ________________________________________________________________
If 7z enabled, last generated part not packed earlier, before exit. Now this packing, and txt file deleted, then exit. See test.bat to test this.
1. Replace 4 white spaces to "\t" 2. Replace all "\t" to 8 white spaces. 3. Change alignment for all comments. Now source code more readable anywhere.
Cyclop compiled + source. Changes and additions. Icon added.
Multifile + checkfile + restoring files.
Delimiters supporting.