Search found 136 matches

by Hadi_Lovelorn
2024-11-16 16:40
Forum: Programming
Topic: [C] [Solved ]Why " fwrite " writes werid number as binary ?
Replies: 7
Views: 291

Re: [C] Why " fwrite " writes werid number as binary ?

I fixed it by separating input file name and output file name .......

Thanks
by Hadi_Lovelorn
2024-11-15 18:35
Forum: Programming
Topic: [C] [Solved ]Why " fwrite " writes werid number as binary ?
Replies: 7
Views: 291

Re: [C] Why " fwrite " writes werid number as binary ?

blackbird Hello Sir In the GMP tutorial it's said : Return the size of op measured in number of digits in the given base. base can vary from 2 to 62. And num/256 will be for hex numbers while we are working with decimal numbers And for decompression I will use exponentiation and remained numbers .....
by Hadi_Lovelorn
2024-11-14 22:08
Forum: Programming
Topic: [C] [Solved ]Why " fwrite " writes werid number as binary ?
Replies: 7
Views: 291

Re: [C] Why " fwrite " writes werid number as binary ?

lindi Once I was free ...... I'm political activist in Iran and the government took me to mental hospital and I'm forced to take heavy psycho-atric medicines ...... Also they put aluminium in my food several months ago ....... Otherwise I wasn't bad in coding ....... I wrote partially C Programming...
by Hadi_Lovelorn
2024-11-14 21:43
Forum: Programming
Topic: [C] [Solved ]Why " fwrite " writes werid number as binary ?
Replies: 7
Views: 291

Re: [C] Why " fwrite " writes werid number as binary ?

lindi Minimal code : #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> #include <gmp.h> int main(void) { FILE * fr, * fw; char filename[201]; unsigned long int size = 0; unsigned long int rt = 999999; unsigned char ch[1] = {112}; printf("Enter filename : "); f...
by Hadi_Lovelorn
2024-11-14 20:29
Forum: Programming
Topic: [C] [Solved ]Why " fwrite " writes werid number as binary ?
Replies: 7
Views: 291

[C] [Solved ]Why " fwrite " writes werid number as binary ?

Hello Dears I reversed the order of my code as : #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> #include <gmp.h> int main(void) { FILE * fr, * fw; char filename[201]; unsigned long int size = 0; unsigned long int rt = 999999; unsigned char ch[1] = {112}; printf("...
by Hadi_Lovelorn
2024-10-13 20:24
Forum: Programming
Topic: C Language , What are these extra useless zeros ?
Replies: 6
Views: 727

Re: C Language , What are these extra useless zeros ?

blackbird

I thought the same about a 3 digit number taking 3 bytes after asking my question ..... But You made it totally clear ..... Thank You ........
by Hadi_Lovelorn
2024-10-13 01:13
Forum: Programming
Topic: C Language , What are these extra useless zeros ?
Replies: 6
Views: 727

Re: C Language , What are these extra useless zeros ?

blackbird

I got it , the fwrite , writes numbers as big-endian ....... But size is ordered as rootnum ( the number of digits as root ) ....... Why it makes larger files and fill them with zeros ?
by Hadi_Lovelorn
2024-10-12 05:50
Forum: Programming
Topic: C Language , What are these extra useless zeros ?
Replies: 6
Views: 727

Re: C Language , What are these extra useless zeros ?

blackbird You mean those zeros are part of the root number ? And when You calculate 2^5 as binary and get the result as binary , You can convert it to decimal ....... It's true that they are calculated as binary , but we can convert them to decimal and they must match to each other ........ But tha...
by Hadi_Lovelorn
2024-10-11 01:19
Forum: Programming
Topic: C Language , What are these extra useless zeros ?
Replies: 6
Views: 727

C Language , What are these extra useless zeros ?

This is the code : #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> #include <gmp.h> int main(void) { FILE * fr, * fw; char filename[201]; unsigned long int size = 0; unsigned long int rt = 999999; unsigned char ch[1] = {112}; printf("Enter filename : "); fget...
by Hadi_Lovelorn
2024-09-30 15:00
Forum: Programming
Topic: C Language , Finite loop never ends or gives segfault
Replies: 10
Views: 500

Re: C Language , Finite loop never ends or gives segfault

blackbird I wrote as swap .... 99,999 root as result is not bigger than 999,999 and of course a remainder will still exist and the process will repeat ...... Just thinking about how to make it faster ....... It's a compressing and decompressing application , It must work quickly and take user's tim...
by Hadi_Lovelorn
2024-09-29 14:27
Forum: Programming
Topic: C Language , Finite loop never ends or gives segfault
Replies: 10
Views: 500

Re: C Language , Finite loop never ends or gives segfault

blackbird Sir , I have a weak machine ... when the 999,999nth root be found when result is not bigger than 99,999 it wouldn't be 6 KB , It would be 11 digits and a power ( ^ ) sign ..... And it's a scratch , The app will cut files to 256MB chunks and root them or on users intention the whole file w...
by Hadi_Lovelorn
2024-09-28 17:17
Forum: Programming
Topic: C Language , Finite loop never ends or gives segfault
Replies: 10
Views: 500

Re: C Language , Finite loop never ends or gives segfault

seasoned_geek Good for You feel good about others' mistakes ! Just for Your information I'm political activist in Iran and taking flupentixol , haloperidol etc everyday alongside putting aluminium in my food several months ago .... I'm not in good shape .... I've wrote great codes ...... But thanks...
by Hadi_Lovelorn
2024-09-27 06:59
Forum: Programming
Topic: C Language , Finite loop never ends or gives segfault
Replies: 10
Views: 500

Re: C Language , Finite loop never ends or gives segfault

You need to specify where the error is. As it sits now your first loop has a useless else. Just close the if after the break then move on. It might be getting stuck there. But only a guess. I'm out on mobile now. Will try it when I get back to my hotel to look further. Also change fgets to getline ...
by Hadi_Lovelorn
2024-09-22 22:07
Forum: Programming
Topic: C Language , Finite loop never ends or gives segfault
Replies: 10
Views: 500

C Language , Finite loop never ends or gives segfault

Hi There I have three ideas for application , It's only a scratch .... But my loop gives segfault or as debugger says I remove the line and it never ends ; I tested both 1.1 GB file or 78 MB file : /* Atousa Project is Copyright © 2008-2024 by Mir Hadi Setayeshgar . All rights reserved _____________...
by Hadi_Lovelorn
2024-09-19 21:04
Forum: General Questions
Topic: [Software] [Solved] Time showed for Tehran is wrong
Replies: 8
Views: 226

Re: [Software] Time showed for Tehran is wrong

Aki
Hallvor

The time get corrected automatically !! Like a charm .... Thank You , Both ....... Now it shows 12:32 for Tehran ....... Hoping it don't broken again .......

Thank You
by Hadi_Lovelorn
2024-09-19 21:00
Forum: General Questions
Topic: [Software] [Solved] Time showed for Tehran is wrong
Replies: 8
Views: 226

Re: [Software] Time showed for Tehran is wrong

Aki

I corrected , I apologize

Hallvor

I don't know sir ... I didn't install something like that ... Should I install it ? Is the package name systemd-timesyncd ?
by Hadi_Lovelorn
2024-09-19 19:31
Forum: General Questions
Topic: [Software] [Solved] Time showed for Tehran is wrong
Replies: 8
Views: 226

Re: [Software] Timw showed for Tehran is wrong

I installed NTP as Sudo , then

It gives error :

Code: Select all

Failed to set ntp: NTP not supported
by Hadi_Lovelorn
2024-09-19 18:54
Forum: General Questions
Topic: [Software] [Solved] Time showed for Tehran is wrong
Replies: 8
Views: 226

Re: [Software] Timw showed for Tehran is wrong

Hallvor Hello Sir This is the output : Local time: Fri 2024-09-20 01:53:48 +0330 Universal time: Thu 2024-09-19 22:23:48 UTC RTC time: Thu 2024-09-19 22:23:49 Time zone: Asia/Tehran (+0330, +0330) System clock synchronized: no NTP service: n/a RTC in local TZ: no
by Hadi_Lovelorn
2024-09-19 16:58
Forum: General Questions
Topic: [Software] [Solved] Time showed for Tehran is wrong
Replies: 8
Views: 226

[Software] [Solved] Time showed for Tehran is wrong

My system clock was wrong about some hours and minutes , But Debian Time ( As I set it Automatically from Internet ) was 25 minutes later ... So today I set-up my System time and logged in to Debian and now Debian is 3 hours and 50 minutes later and wrong ! I have enabled Location Services ( As defa...