Ratnesh
c++ primer plus 6th edition is it good book for beginners
Ratnesh
To learn c++
Anonymous
Cool, in 1980s wtf I thought I was older… how old are you?
Hi Tazz, thanks for asking. Actually I have been playing around with electronics and computers for around 50 years now, so I am technically known as "ancient". How old are you may I ask?
+
guys what is fastest way to genrate checksum of file? (crc32, md5, adler and...) I dont want to use openssl for just generate a checksum
Talula
guys what is fastest way to genrate checksum of file? (crc32, md5, adler and...) I dont want to use openssl for just generate a checksum
CRC32... I do it for my small devices with tiny little chip running at 10MHz and it is fast.
Talula
and how you generate it?
Simply take 4 bytes and XOR with next 4...
Talula
Simply take 4 bytes and XOR with next 4...
In the end you get 32 bit number, which your CRC
Ali
CRC32... I do it for my small devices with tiny little chip running at 10MHz and it is fast.
I prefer CRC module present in chip if available. It is much faster and saves lot of CPU cycles for embedded devices.
Ali
Anyway the question doesn't mention hardware related, so need to implement it in software.
Talula
and how you generate it?
What do you wanna use CRC for?
+
What do you wanna use CRC for?
for check a big binary file
Talula
for check a big binary file
On PC or embedded system? If it is PC, the whole process would be really fast and you can use libraries to do it, you don't need to make anything on your own.
Talula
I want to keep program as smaller as possible and because of that I want to avoid using libary like openssl
Well in that case do what I said, take 4 bytes do XOR with next 4 bytes and the result with the next 4 bytes, till you're all bytes are done, the number you'll get in the end will be your CRC32
JY
I am handling some time series data in one of my projects, i found jaguardb is so cool. It does automatic aggregation of different time windows and i just use them.
Hanz
But XOR is programming operator 😕
Hanz
Anyway, it might not be beginner friendly 😄
+
Anyway, it might not be beginner friendly 😄
Im want to know how can I loop through file and xor all byte of it, and yes, I dont know much about it
Hanz
Someone might explain better than me though
Cris
Someone might explain better than me though
why you want to implement your own? is not acceptable to use something already exisiting?
Anonymous
how the fuck does googletest manage to probogate its include to all parent cmake's
Amirhossein.J
We have developed an dll windows driver which generate a tunnel for creating a bridge between a real physical com port and a virtual com port so it can role as a hub. It should bypass physical com port data to another physical com port and a tcp call to a rest api and wait for first data response. The problem is we it just runs on windows test mode because of non exsistance signed driver. As a solution we need this driver to be signed. We will appreciate any helps. Thanks in advance.
Cris
Whatt??
wrong quote, sorry
Hanz
😅😅
Pavel
Any ideas on how can I optimize this? uint64_t transform_one_linear(uint64_t n) { uint64_t res = 0; for (int i = 0; i < 64; ++i) { res ^= ((n >> (64 - i - 1)) & 1) * l_matrix[i]; } return res; } l_matrix[i] can be considered random (but it's fixed)
Pavel
It's basically scalar multiplication
OnePunchMan
Dylan
Hello to everyone
Pavel
Pavel
Ah, yes, xor is, of course, commutative, thanks, I'm stupid
But it doesn't help with performance anyhow
Hariyana Grande
char *C ="hello" ; string gets stored as compile time constant. what does it mean?
Talula
/report
Singh
Write c++ program to create otp
Sandeep
void PrintArray (const std:: array<int, 5>& data) Is there a way where you don't have to pass the size along with standard array(when standard arrays are passed as parameters)
Anunay
Write c++ program to create otp
This isn't google.com
Anunay
Tell us if you have a query
Pankaj
Any one explain -While and do while loop
fluffy
hello anyone who knows how to write a c++ program that sends push notifications to your phone
S
Did any one complete two sum problem using hashmap in c
S
#define size 500000 struct pair{ int value; int loc; }; int hash_func(int v){ int index = (v) % size; return index< 0? index+size: index; } struct pair *table(int *nums,int numsSize){ struct pair *hash=(struct pair*)calloc(sizeof(struct pair),size); for(int k=0;k<numsSize;k++){ hash[hash_func(nums[k])].value=nums[k]; hash[hash_func(nums[k])].loc=k; } return hash; } int* twoSum(int* nums, int numsSize, int target, int* returnSize){ * returnSize=2; int i; int res[2]; struct pair* hash=table(nums,numsSize); for(i=0;i<numsSize;i++){ int q=target-nums[i]; if(hash[hash_func(q)].value==q){ res[0]=i; res[1]=hash[hash_func(q)].loc; } } return res; }
Butterfly Around Wàist
Tell us if you have a query
Yes i have biggest query
Butterfly Around Wàist
Please send more ....
S
this is my code .but i got runtime error: load of null pointer of type 'int' [__Serializer__.c]
S
any one help me to solve error
Sandeep
Did you get the answer for lambdas
Sandeep
^
No..later you posted some coded..where it didn't matter if lambda was capturing or not capturing..couldn't pass as function pointer
Anonymous
that is not relevant anymore
Anonymous
i didnt scroll all the way up to the first error XD
Anonymous
pls delete :)
Anonymous
if i have https://wandbox.org/permlink/XRd7xjJiwlh3gWU3 how can i create a specilization for void return type?
Nova
Hey guys... Just want to know how to split and save it in like pairs of vector Input is abcd:1234,efghf:27265,sjggsh:28266 Now first i have to split it by" , " Than again split it with ":" and after that have to store it in pairs of strings Like it should be pair <string,string> p={abcd,1234} It fucking really easy in python as google says But I want to know how can I do it in c++ Please help......stuck in this for hours ....already googled everything i can
Pavel
Hey guys... Just want to know how to split and save it in like pairs of vector Input is abcd:1234,efghf:27265,sjggsh:28266 Now first i have to split it by" , " Than again split it with ":" and after that have to store it in pairs of strings Like it should be pair <string,string> p={abcd,1234} It fucking really easy in python as google says But I want to know how can I do it in c++ Please help......stuck in this for hours ....already googled everything i can
First create a function that takes a string and returns a pair of strings, inside implement splitting the string into two by ':' character (using find and substr on the string). Then take any of the examples from here to split the initial string by ',' char but on each step call your function and append the resulting pair to the container https://stackoverflow.com/questions/14265581/parse-split-a-string-in-c-using-string-delimiter-standard-c
Mahdi
/report
klimi
What?
/get cbook
/get best
/get best-book
/get c++_isnt_c_with_classes
bruh, im getting trolled by a bot trying to learn c and cpp, nice
/get cppbookguide
/get cpp
ninja
how i can remove these warning's