August 26Aug 26 31 minutes ago, Stuttered said:The code is getting increasing complex...just imagine for a sec how complex is Human DNA! ! !new bug report -
August 26Aug 26 2 hours ago, jackyjask said:just imagine for a sec how complex is Human DNA! ! !new bug report -Should be fixed. Added the auto-type-calc option for LCF-AT requested. Calc button has been removed. Once I'm done or get exhausted from this, I'll add the SRC. ;) FileSizeCALC_v0.0.5.rar
August 26Aug 26 4 minutes ago, jackyjask said:thanksbut :)Update: Found why it's crashing. Again, same issue. I would somehow need to mix between using Decimal and BigInteger to make the input value longer, which I'm not sure I can do at this point. Appreciate the testing feedback... Edited August 27Aug 27 by Stuttered
August 27Aug 27 Author OK thanks for new versions guy's. @Stuttered, looks good that you removed the calc button and to calc the results on fly but its not working if I change the format 1000 / 1024. That's bad. Maybe you can fix that too.I have another request / question about 1000 decimal and 1024 binary. Is there a quick way to get results to see of values I enter of 1000 dec & 1024 binary?Example: I enter 1 GB / 1024 and I get this...File Size Breakdown (Binary (1024-based)):Unit Size Description------------ ------------------------ --------------------------------Bits 8,589,934,592 1 Bit = 1/8 Byte Bytes 1,073,741,824 1 Byte = 8 Bits Kilobytes 1,048,576 1 KB = 1024 Bytes Megabytes 1,024 1 MB = 1024 KB Gigabytes 1 1 GB = 1024 MB Terabytes 9.766e-4 1 TB = 1024 GB Petabytes 9.537e-7 1 PB = 1024 TB ...its showing all results of 1024 what sizes they have. If I change now the format to 1000 decimal I get this...File Size Breakdown (Decimal (1000-based)):Unit Size Description------------ ------------------------ --------------------------------Bits 8,000,000,000 1 Bit = 1/8 Byte Bytes 1,000,000,000 1 Byte = 8 Bits Kilobytes 1,000,000 1 KB = 1000 Bytes Megabytes 1,000 1 MB = 1000 MB Gigabytes 1 1 GB = 1000 MB Terabytes 1.000e-3 1 TB = 1000 GB Petabytes 1.000e-6 1 PB = 1000 PB ...what shows me same in decimal. But now I want to know how large is 1 GB / 1000 decimal in 1024 binary is but I don't get to see the results of it and I need to do this manually.1,000,000,000 Byte of decimal results / copyPaste value into edit controlChange format to 1024Change unit to Bytes and I get this results outFile Size Breakdown (Binary (1024-based)):Unit Size Description------------ ------------------------ --------------------------------Bits 8,000,000,000 1 Bit = 1/8 Byte Bytes 1,000,000,000 1 Byte = 8 Bits Kilobytes 976,562.5 1 KB = 1024 Bytes Megabytes 953.674316 1 MB = 1024 KB Gigabytes ---> 0.93132257 1 GB = 1024 MB <--- Terabytes 9.095e-4 1 TB = 1024 GB Petabytes 8.882e-7 1 PB = 1024 TB ...and now I know the results I want to know. 1 GB / 1000 decimal = 0.93132257 GB / 1024. You know what I mean? I want to get those results too without doing that manually copy / past etc steps. Maybe you guy's could add something for this too to get the results right away. Or you show all results at once. One more time about the DOT & Comma thing. You see the results of 0.93132257 GB but the DOT is a problem. If I enter this value via copy / paste into a calculator its showing "93.132.257" instead what means the calculator did not handle the DOT as Comma. Maybe you can correct that too anyhow to set the Comma where it belongs too. So I hope my requests are not too demanding. 🙂 Thanks.greetz
August 27Aug 27 2 hours ago, LCF-AT said:OK thanks for new versions guy's. @Stuttered, looks good that you removed the calc button and to calc the results on fly but its not working if I change the format 1000 / 1024. That's bad. Maybe you can fix that too.I have another request / question about 1000 decimal and 1024 binary. Is there a quick way to get results to see of values I enter of 1000 dec & 1024 binary?Example: I enter 1 GB / 1024 and I get this...File Size Breakdown (Binary (1024-based)):Unit Size Description------------ ------------------------ --------------------------------Bits 8,589,934,592 1 Bit = 1/8 ByteBytes 1,073,741,824 1 Byte = 8 BitsKilobytes 1,048,576 1 KB = 1024 BytesMegabytes 1,024 1 MB = 1024 KBGigabytes 1 1 GB = 1024 MBTerabytes 9.766e-4 1 TB = 1024 GBPetabytes 9.537e-7 1 PB = 1024 TB...its showing all results of 1024 what sizes they have. If I change now the format to 1000 decimal I get this...File Size Breakdown (Decimal (1000-based)):Unit Size Description------------ ------------------------ --------------------------------Bits 8,000,000,000 1 Bit = 1/8 ByteBytes 1,000,000,000 1 Byte = 8 BitsKilobytes 1,000,000 1 KB = 1000 BytesMegabytes 1,000 1 MB = 1000 MBGigabytes 1 1 GB = 1000 MBTerabytes 1.000e-3 1 TB = 1000 GBPetabytes 1.000e-6 1 PB = 1000 PB...what shows me same in decimal. But now I want to know how large is 1 GB / 1000 decimal in 1024 binary is but I don't get to see the results of it and I need to do this manually.1,000,000,000 Byte of decimal results / copyPaste value into edit controlChange format to 1024Change unit to Bytes and I get this results outFile Size Breakdown (Binary (1024-based)):Unit Size Description------------ ------------------------ --------------------------------Bits 8,000,000,000 1 Bit = 1/8 ByteBytes 1,000,000,000 1 Byte = 8 BitsKilobytes 976,562.5 1 KB = 1024 BytesMegabytes 953.674316 1 MB = 1024 KBGigabytes ---> 0.93132257 1 GB = 1024 MB <---Terabytes 9.095e-4 1 TB = 1024 GBPetabytes 8.882e-7 1 PB = 1024 TB...and now I know the results I want to know. 1 GB / 1000 decimal = 0.93132257 GB / 1024. You know what I mean? I want to get those results too without doing that manually copy / past etc steps. Maybe you guy's could add something for this too to get the results right away. Or you show all results at once. One more time about the DOT & Comma thing. You see the results of 0.93132257 GB but the DOT is a problem. If I enter this value via copy / paste into a calculator its showing "93.132.257" instead what means the calculator did not handle the DOT as Comma. Maybe you can correct that too anyhow to set the Comma where it belongs too. So I hope my requests are not too demanding. 🙂 Thanks.greetzHmmm... Not sure I can do that, but I'll take a look. Here is v0.0.7. FileSizeCALC_x86_v0.0.7.rar
August 27Aug 27 not a bug just curiuos - why TB, PB lines are always showing e+-xxx scientific format? also would be nice to allow resizing the window as for big values one need to use scroller.....wow!why is that? :)nice to have - actual build -
August 28Aug 28 16 hours ago, jackyjask said:not a bug just curiuos -why TB, PB lines are always showing e+-xxx scientific format?also would be nice to allow resizing the window as for big values one need to use scroller.....wow!why is that? :)nice to have - actual build -Only because this is how the online app does it, I guess?this — PostimagesApp still needs some clean up, and the stretchable is fine. The internal VER I don't care about atm.3 hours ago, jackyjask said:mitigated big numbers/overflowsFileSizeCALC-0.0.8custom.zipNice! I'll take a look at the changes. Edited August 28Aug 28 by Stuttered
August 28Aug 28 @jackyjask , Can you increase the MaxLength to like 35 and see if you run into issues?
August 28Aug 28 I've seen you are trying to load icon from the file on disk, but the icon is already embedded into the exe itself.... lets solve this micro puzzle:how to reuse existing embedded icon (as native PE resorce) and assign it into the Form icon property?I triedd this but for some reason I hit 0 (null?) response [DllImport("user32.dll", SetLastError = true)] static extern IntPtr LoadImage(IntPtr hInstance, IntPtr lpName, uint uType, int cxDesired, int cyDesired, uint fuLoad); [DllImport("kernel32.dll", SetLastError = true)] static extern IntPtr GetModuleHandle(string lpModuleName); [DllImport("kernel32.dll")] static extern uint GetLastError(); public Form1(string filePath = null) { const uint IMAGE_ICON = 1; const uint LR_DEFAULTSIZE = 0x0040; const uint LR_SHARED = 0x8000; IntPtr hm = GetModuleHandle(null); IntPtr hIcon = LoadImage(hm, (IntPtr)3, IMAGE_ICON, 32, 32, LR_DEFAULTSIZE | LR_SHARED); // 0 ... why? uint why = GetLastError(); // 0 here - means no issue?? WTF?!
August 28Aug 28 2 minutes ago, jackyjask said:I've seen you are trying to load icon from the file on disk, but the icon is already embedded into the exe itself.... lets solve this micro puzzle:how to reuse existing embedded icon (as native PE resorce) and assign it into the Form icon property?I triedd this but for some reason I hit 0 (null?) response [DllImport("user32.dll", SetLastError = true)] static extern IntPtr LoadImage(IntPtr hInstance, IntPtr lpName, uint uType, int cxDesired, int cyDesired, uint fuLoad); [DllImport("kernel32.dll", SetLastError = true)] static extern IntPtr GetModuleHandle(string lpModuleName); [DllImport("kernel32.dll")] static extern uint GetLastError(); public Form1(string filePath = null) { const uint IMAGE_ICON = 1; const uint LR_DEFAULTSIZE = 0x0040; const uint LR_SHARED = 0x8000; IntPtr hm = GetModuleHandle(null); IntPtr hIcon = LoadImage(hm, (IntPtr)3, IMAGE_ICON, 32, 32, LR_DEFAULTSIZE | LR_SHARED); // 0 ... why? uint why = GetLastError(); // 0 here - means no issue?? WTF?!Yeah, I saw that. There is a way to do it, but I need to go back and look at an older code project to remember how...
August 28Aug 28 oooooooooopsC# .net BigInter type DOES NOT support numbers with decimal points......... what a pity!so seems we do not have in-built .net type for very big numbers together with decimal points...decided to use this public/free lib:GitHubGitHub - peteroupc/Numbers: A C# implementation of arbitr...A C# implementation of arbitrary-precision numbers and arithmetic - peteroupc/Numbersusing it seems all is looking nice! eg:Uploading Attachment...
August 28Aug 28 21 minutes ago, jackyjask said:oooooooooopsC# .net BigInter type DOES NOT support numbers with decimal points......... what a pity!so seems we do not have in-built .net type for very big numbers together with decimal points...decided to use this public/free lib:GitHubGitHub - peteroupc/Numbers: A C# implementation of arbitr...A C# implementation of arbitrary-precision numbers and arithmetic - peteroupc/Numbersusing it seems all is looking nice!eg:Uploading Attachment...Well, I guess that's why it would not work. The icon issue is fixed, You have to add the .ico as a resource and then add code.Right-click on project->properties. Add icon (icon and manifest).Add .ico to .resx file (double-click and then add)Add code below:Code:// Explicitly set the form's icon from the executabletry{this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);}catch (Exception ex){MessageBox.Show($"Error loading icon: {ex.Message}", "Icon Load Error");}Update:I have incorporated the library, and may have this working... app update in a bit...FileSizeCalc.ico Edited August 28Aug 28 by Stuttered
August 28Aug 28 2 hours ago, jackyjask said:oooooooooopsC# .net BigInter type DOES NOT support numbers with decimal points......... what a pity!so seems we do not have in-built .net type for very big numbers together with decimal points...decided to use this public/free lib:GitHubGitHub - peteroupc/Numbers: A C# implementation of arbitr...A C# implementation of arbitrary-precision numbers and arithmetic - peteroupc/Numbersusing it seems all is looking nice!eg:Uploading Attachment...Bro, what is this & how touse this in c#... Edited August 28Aug 28 by .hloire
August 28Aug 28 2 hours ago, Stuttered said:Well, I guess that's why it would not work. The icon issue is fixed, You have to add the .ico as a resource and then add code.Right-click on project->properties. Add icon (icon and manifest).Add .ico to .resx file (double-click and then add)Add code below:Code:// Explicitly set the form's icon from the executabletry{this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);}catch (Exception ex){MessageBox.Show($"Error loading icon: {ex.Message}", "Icon Load Error");}Update:I have incorporated the library, and may have this working... app update in a bit...FileSizeCalc.icoUpdate v0.0.10. Thx @jackyjask for pointing to the BigNumber library and assist. See attached. FileSizeCALC_v0.0.10.rar
August 28Aug 28 3 hours ago, Stuttered said:this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);damn it! this is GENIOUS! (instead of WinAPI old dirty crap!!!)1 hour ago, .hloire said:Bro, what is this & how touse this in c#...easy! just read the docs :)built a binary using that multi-precision lib: (left vs last build fom @Stuttered ) FileSizeCALC_0.0.11.zip
August 28Aug 28 41 minutes ago, jackyjask said:damn it! this is GENIOUS! (instead of WinAPI old dirty crap!!!)easy! just read the docs :)built a binary using that multi-precision lib: (left vs last build fom @Stuttered )FileSizeCALC_0.0.11.zipSeems like we have a winner! 👍
Create an account or sign in to comment