I am trying to write a simple plagiarism program by taking one file and and comparing it to other files by splitting up each file every six words and comparing then to the other files, which is also split up the same way. I was reading up on hashsets and I figured I might try and split them up with hashsets but I have no idea how. Any advice would be appreciated.
Related
I am new to programming NodeJS and want to load multi-line sections from a file into MongoDB. I have seen simple solution that reads the file into memory and parses into lines. This will fill my need but doesn't seem the "NodeJS" way of doing it. If I just wanted to quickly load the file, I would load IntelliJ and do it in Java. I want to learn asynchronous and pipelines.
I see the the basic steps are stream the file in chunks, parse the chunks into lines, group lines into sections, convert sections into JSON, and insert JSON into MongoDB.
I like the idea of pipelines since I can easily replace parts and reuse others. It also helps in this case since the slowest step is the last and the whole input file could be loaded into memory before the first MongoDB document is written.
I have searched for a good example but they seem to be missing parts and explanations of what I need to modify. I have seen you can easily pipe a file stream in chunks but I need lines. I have seen you can easily stream a file to a line parser but that is not a pipeline.
Any ideas on how to do this or good examples?
Thanks,
Wes.
I want to merge two files ending with .gz. I have tried two ways among others. For the first way, I directly concatenated the files using cat; for the other way, I first decompressed each file through gunzip, and then concatenated the decompressed files before compressing again using gzip. Interestingly, I found that the resulting files vary in size. Could anyone answer my puzzle here?
Thank you in advance!
If your question is which is better, then concatenating is faster, but recompressing will give you better compression. So it depends on how you define "better".
I'm working on a project for school.
The assignment is as follows:
Implement a sorting algorithm of your choosing in assembly (we are using the GNU Assembler). The input is a text-file with a series of numbers separated by newline.
I'm then trying to implement insertion sort.
I have already opened and read the file and i'm able to print the content to terminal.
My problem is now how to split each number from the file in order to compare and sort them.
I believe google is glowing at the moment due to my effort to find and answer (maybe I don't know what I need to type or where to look).
I have tried to get each character from the string, which i'm able to do BUT I don't know to put them together again as integers (we only have integers).
If anybody could help with some keywords to search for it would be much appreciated.
I'm working on a program that needs to find a tag in a .xxx file to just tell me if it exists or not in the file. I've been doing quite a bit of troubleshooting but I've realized there are three key things I don't know:
What a .xxx file is
Where to find help on how to work with .xxx files (Google didn't return anything useful)
How to read a string out of a .xxx file
I'm looking for help with these 3 things - specifically the 3rd, but help on the other two would mean I don't have to ask more questions later! I'm not in need of troubleshooting help yet - I'm not too worried about making my code run at this moment. This is more for reference and general knowledge so I don't have to ask 100 more questions about tedious specifics later on.
So, if anyone out there knows anything about these three problems, or has any knowledge on .xxx files, can you help me out?
(If you happen to know the code to do this, I'm writing in C#)
If you're using ReadLines, then it assumes it's a text file with line endings. If you're trying to use that on a binary file, then it won't necessarily work. And the best you may get is a count of 0 or 1, if there's no line endings found in the binary file at all.
You'll have to load the bytes in that instances and do a more thorough search through the binary file for instances of your string.
But if you're only wanting to know if a LINE contains at least one instance (as you have written your code above), then it won't work for binary files where you can't guarantee line endings exist.
I'm trying to compare two huge text files (from 100MB to 500MB each one) in order to extract the lines that differs between the files and write these differing lines on another text files.
I found on the Net the An O(ND) Difference Algorithm for C# but when implemented the result is an OutOfMemory Exception.
Could you know an exit way from this blind alley?
Thank you very much.
Antonio