Downloading large amount of data from a secure link

I’ve received a secure link to a directory on a client’s SharePoint for the purpose of sharing a non-trivial amount of data, probably about 30GB. I can download single directories and it works, but it’s a chore having to click everything and I will need to do that often. I tried downloading it all by selecting every top-level directory and clicking “Download”, but the file that gets downloaded is corrupted — ZIP reports missing central directory, so I assume it’s truncated during download. The “Open in File Explorer” link returns Access Denied. Are there any other options for automating download of this directory?

What’s the minimum amount of space I could leave for Windows 10 in a dual boot setup?

I’ve just bought a new laptop. It’s intended to be primarily for Linux and teaching myself JavaScript. I already use a Mac as my main laptop so won’t be installing many (Windows) apps, or storing large amounts of media.

I want to keep Windows around both to make it easy to restore the laptop for selling or gifting later, and as a ‘just in case’ for home Windows need.

What’s the smallest space you’d recommend leaving Windows in, and what would you put as a reasonable size NTFS shared drive – again just functional, not serious storage?

The specs – i3/ 4gb/ 1tb

Help designing a product model with vast amount of properties

I’ve been asked how to re-design a legacy system by a relative for a company that builds custom chairs. On their website you can customize your chair in about 30 permutations : chair type, material, if wood what kind, color, height, leg type, etc..

They have been working for years with a system that creates a ~40 character encoded string that represents the chair and use that string as the product code (like a long SKU). It will look like M01MA24C04L02… For Model #01, Material #24 Color #04, leg type #02, etc…

This string is used also in client’s application and a bit everywhere to represent a chair. You can enter the string on their web app and it will re-create you the chair configuration.

The problem now is that they want to refactor this because they are about to add more options and more will come in the future. We are talking about 40-50 permutations and obviously the encoded string will just get bigger and inconsistent in length with old data. Personnel and stores type this “product code” when they want to see what the what the client ordered with all the configurations and it’s getting too long for them to type.

I’ve been asked how I would go about a problem like that but I’m still recently graduated in computer engineering and don’t have much architecture experience yet. I was looking at EAV model but I’m uncertain.

For now I just suggested that they stop using that string as a SKU because it breaks every stores whenever they do a migration of what that code represents, and I suggested that instead of giving the encoded string to the client when they make the order to give them a confirmation number that maps to this code. But they would still like to have a “product code” that represents the product and that is likely to change in the future.

I googled around but I have no experience with stuff like that. I’m not looking for a full solution just an idea of where to look for problems like that mainly for my self interest.

Why binance sends small amount into another utxo while sending to cold wallet?

I believe address 1NDyJtNTjmwk5xPNhjgAMu4HDHigtobu1s belongs to Binance

If you look a this transaction for example https://blockchair.com/bitcoin/transaction/aa107ebc0a7f00e558048a01e327ff20e21c65356bc64a0b92eb975f067eb7aa They seem to send clients funds into this address but everytime they do that they also send a small amount into a fresh address. Here it is 3QZQ7S8v9mWWAUaSf8R4D4nzsGEMXnMjvw and after they send thoses utxo into their main cold wallet (like this tx https://blockchair.com/bitcoin/transaction/380acebfd4c1c84086b3c872cf916ef1219787b28720563b92c61a12df4ad7e3 ) and again with a little to another address etc.

Whats the point of doing that? why they just dont send into one single utxo belonging to their main address?

Thx

How to reduce amount of code (for loops) C

I made a simple matrix program that prints some data..I want to know how to reduce amount of lines with some functions or whatever, because there is so much if-s,and for loops.

Tried to make functions but almost every for loop is different, so that did not work.

#include <stdio.h> main() {     int i,j,m,n,sMain,sAnti,sCol,sMainUp,sMainDown,sAntiUp,sAntiDown;     int arr[30][30];      printf("What dimensions of matrix you want?(1 number) ");     scanf("%d",&m);     n = m;      for(i = 0; i < m; i++){         for(j = 0; j < n; j++){             printf("Type elements: ");             printf("Element[%d,%d]: ",i,j);             scanf("%d",&arr[i][j]);         }     }     for(i = 0; i < m; i++){         for(j = 0; j < n; j++){             printf("%d ",arr[i][j]);         }         printf("\n");     }     sMain = 0;     sAnti = 0;     sMainUp = 0;     sMainDown = 0;     sAntiUp = 0;     sAntiDown = 0;      for(i = 0; i < m; i++){         for(j = 0; j < n; j++){             if(i == j){                 sMain += arr[i][j];             }             if((i + j) == (n - 1)){                 sAnti += arr[i][j];             }             if(i < j){                 sMainUp += arr[i][j];             }             if(i > j){                 sMainDown += arr[i][j];             }             if((i + j) < (n - 1)){                 sAntiUp += arr[i][j];             }             if((i + j) > (n - 1)){                 sAntiDown += arr[i][j];             }         }     }     sCol = 0;     printf("Sum of what column you want? ");     scanf("%d",&j);     for(i = 0; i < m; i++){         sCol += arr[i][j];     }     printf("Sum of main diagonal: %d.\n",sMain);     printf("Sum of anti(counter) diagonal: %d.\n",sAnti);     printf("Sum above main diagonal: %d.\n",sMainUp);     printf("Sum under main diagonal: %d.\n",sMainDown);     printf("Sum above anti diagonal: %d.\n",sAntiUp);     printf("Sum under anti diagonal: %d.\n",sAntiDown);     printf("Sum of %d. column is: %d.",j,sCol);  } 

How to apply Memory Allocation? (eg. malloc, calloc, free) This C Program counts the amount of words in a list?

Considering the code provided by @David C. Rankin in this previous answer:

https://stackoverflow.com/questions/56141468/how-to-count-only-words-that-start-with-a-capital-in-a-list

How do you optimise this code to include Memory Allocation for much larger text files? With this code below it will complete for small .txt files.

However, what is the best way to set memory allocation to this code so that C (Programming Language) does not run out of memory. Is it best to use linked lists?

/**  * C program to count occurrences of all words in a file.  */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <limits.h>  #define MAX_WORD     50     /* max word size */ #define MAX_WORDS   512     /* max number of words */  #ifndef PATH_MAX #define PATH_MAX   2048     /* max path (defined for Linux in limits.h) */ #endif  typedef struct {            /* use a struct to hold */     char word[MAX_WORD];    /* lowercase word, and */     int cap, count;         /* if it appeast capitalized, and its count */ } words_t;  char *strlwr (char *str)    /* no need for unsigned char */ {     char *p = str;      while (*p) {         *p = tolower(*p);         p++;     }      return str; }  int main (void) {      FILE *fptr;     char path[PATH_MAX], word[MAX_WORD];     size_t i, len, index = 0;      /* Array of struct of distinct words, initialized all zero */     words_t words[MAX_WORDS] = {{ .word = "" }};      /* Input file path */     printf ("Enter file path: ");     if (scanf ("%s", path) != 1) {  /* validate every input */         fputs ("error: invalid file path or cancellation.\n", stderr);         return 1;     }      fptr = fopen (path, "r");   /* open file */     if (fptr == NULL) {         /* validate file open */         fputs ( "Unable to open file.\n"                 "Please check you have read privileges.\n", stderr);         exit (EXIT_FAILURE);     }      while (index < MAX_WORDS &&                 /* protect array bounds  */             fscanf (fptr, "%s", word) == 1) {   /* while valid word read */         int iscap = 0, isunique = 1;    /* is captial, is unique flags */          if (isupper (*word))            /* is the word uppercase */             iscap = 1;          /* remove all trailing punctuation characters */         len = strlen (word);                    /* get length */         while (len && ispunct(word[len - 1]))   /* only if len > 0 */             word[--len] = 0;          strlwr (word);                  /* convert word to lowercase */          /* check if word exits in list of all distinct words */         for (i = 0; i < index; i++) {             if (strcmp(words[i].word, word) == 0) {                 isunique = 0;               /* set unique flag zero */                 if (iscap)                  /* if capital flag set */                     words[i].cap = iscap;   /* set capital flag in struct */                 words[i].count++;           /* increment word count */                 break;                      /* bail - done */             }         }         if (isunique) { /* if unique, add to array, increment index */             memcpy (words[index].word, word, len + 1);  /* have len */             if (iscap)                      /* if cap flag set */                 words[index].cap = iscap;   /* set capital flag in struct */             words[index++].count++;         /* increment count & index */         }     }     fclose (fptr);  /* close file */      /*      * Print occurrences of all words in file.      */     puts ("\nOccurrences of all distinct words with Cap in file:");     for (i = 0; i < index; i++) {         if (words[i].cap) {             strcpy (word, words[i].word);             *word = toupper (*word);             /*              * %-15s prints string in 15 character width.              * - is used to print string left align inside              * 15 character width space.              */             printf("%-15s %d\n", word, words[i].count);         }     }      return 0; } 

Example Use/Output

Using your posted input

$   ./bin/unique_words_with_cap Enter file path: dat/girljumped.txt  Occurrences of all distinct words with Cap in file: Any             7 One             4 Some            10 The             6 A               13 

Massive amount of data being generated somewhere, filling up disk space

Preface: I am running Ubuntu 18.04. I can provide additional information if requested.

Somehow, some way my disk is filling up hundreds of gigabytes of empty space in just a few hours entirely on its own. Disk analyzer shows root directory has approximately 170 gigabytes of data in it. My hard drive is 1 TB. I see no other files that could occupy the other 800 gigabytes but i am being told that there is less than 1 GB remaining when I look at the disk in file manager. I did remove some massive log files totaling 500 GB earlier but I do not see anything that replaced them. These warnings and problems appeared today. I have no idea what changed.

Probability of X being a trick coin (heads every time) after heads is flipped k amount of times


A magician has 24 fair coins, and 1 trick coin that flips heads every time.

Someone robs the magician of one of his coins, and flips it $ k$ times to check if it’s the trick coin.

A) What is the probability that the coin the robber has is the trick coin, given that it flips heads all $ k$ times?

B) What is the smallest number of times they need to flip the coin to believe there is at least a 90% chance they have the trick coin, given that it flips heads on each of the flips?

Here is my approach:

Let $ T$ be the probability that the robber has the trick coin

Let $ H$ be the probability the robber flips a heads k times in a row

$ Pr(T) = 1/25$

$ Pr(H|T) = 1$

$ Pr(T’) = 24/25$

$ Pr(H|T’) = 1/2$ when $ k=1$ , $ 1/4$ when $ k=2$ , $ 1/8$ when $ k=3$ … etc

$ Pr(T|H) = (1 * 1/2) / (1 * 1/2 + Pr(H|T’) * 24/25) = 1/13, 1/7, 1/4,…$ etc

So the Pr(T|H) answer changes for every k, do I answer with the formula? How can I answer A? How do I make a probability distribution when k can be infinite?

Also is B 8 flips? Since when k = 8, Pr(T|H) = 1/256.

Thanks for any help.