![]() |
Adding memmem() to QB64PE - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Expanding Horizons (Libraries) (https://qb64phoenix.com/forum/forumdisplay.php?fid=21) +---- Forum: One Hit Wonders (https://qb64phoenix.com/forum/forumdisplay.php?fid=24) +---- Thread: Adding memmem() to QB64PE (/showthread.php?tid=3519) Pages:
1
2
|
Adding memmem() to QB64PE - Sanmayce - 03-06-2025 To me, adding memmem() to QB64PE is a must-have, wanna see our QuickBasic64PE standing tall when the word 'Quick' is mentioned. Here comes Railgun_Nyotengu... Five reasons to boost our beloved QB64PE: - License is 100% FREE, the GLIBC and musl are with LGPL 2.1+ w/exceptions and MIT respectively; - Written by an actual QB64PE aficionado; - Make the 'Q' great again; - Trashes to smithereens the hyped Two-Way and BMH implementations; - Being FASTEST in practice. Just uploaded to GitHub the Railgun memmem() which is an excellent choice to fill this gap (especially for Windows users who lack that function). https://github.com/Sanmayce/Railgun How nifty would it be to dare the coders using other languages about "how fast is your search function", hee-hee. RE: Adding memmem() to QB64PE - grymmjack - 03-06-2025 Over my head, but love the passion! @a740g @offbyone @rhosigma @smcneill are needed here. ![]() RE: Adding memmem() to QB64PE - madscijr - 03-07-2025 (03-06-2025, 08:13 PM)grymmjack Wrote: Over my head, but love the passion!Yeah, can we get a laymen's description of this, for us mere mortals? ![]() RE: Adding memmem() to QB64PE - Petr - 03-07-2025 (03-07-2025, 03:22 PM)madscijr Wrote:(03-06-2025, 08:13 PM)grymmjack Wrote: Over my head, but love the passion!Yeah, can we get a laymen's description of this, for us mere mortals? If that's what I'm thinking, it should search for a larger block of bytes inside the memory block. Something like Instr or _Intsrrev but not for a string, but in the _MEM array. I would solve it by loading the block as a string and then using Instr or _Instrrev, but I don't really know if these functions can return a value of type _Integer64. But it's also possible that it's something completely different. RE: Adding memmem() to QB64PE - SMcNeill - 03-07-2025 (03-07-2025, 03:22 PM)madscijr Wrote:(03-06-2025, 08:13 PM)grymmjack Wrote: Over my head, but love the passion!Yeah, can we get a laymen's description of this, for us mere mortals? memmem is a command similar to strstr -- its purpose is to look for a str (string) inside a str (string). (Thus the name strstr.) memmem is basically supposed to look for a mem block inside a mem block. The QB64PE version of these commands would basically be INSTR and _INSTRREV. All the above is basically just a spam-type plug saying, "WE HAS THE BETTER STUFFS!!", all without ever actually sharing any code, libraries, or compilable examples where a person can test for themselves to see if the "better stuffs" is actually better or not. https://github.com/Sanmayce/Railgun <-- Even if you follow this link to the github, all you'll find there is one whole file for the entire github... README.md. Yeppers!! Just a readme text file, with the *exact* same contents as what was posted above. Once again, there is no code, libraries, or anything compilable or studyable at the site. So TLDR; --> Basically just consider all the bluster above to be a spam bot at work and ignore it. There's really nothing of substance to see here. RE: Adding memmem() to QB64PE - madscijr - 03-07-2025 (03-07-2025, 05:03 PM)Petr Wrote: If that's what I'm thinking, it should search for a larger block of bytes inside the memory block. Something like Instr or _Intsrrev but not for a string, but in the _MEM array. I would solve it by loading the block as a string and then using Instr or _Instrrev, but I don't really know if these functions can return a value of type _Integer64. That makes sense. Sounds like we already have the functionality, just need to know if it works with _Integer64? And if not, would it be hard to just modify the Instr and _Instrrev to support it? RE: Adding memmem() to QB64PE - RhoSigma - 03-07-2025 (03-07-2025, 05:03 PM)SMcNeill Wrote:(03-07-2025, 03:22 PM)madscijr Wrote:(03-06-2025, 08:13 PM)grymmjack Wrote: Over my head, but love the passion!Yeah, can we get a laymen's description of this, for us mere mortals? Hey Steve, is there a way to turn off that damn tagging when someone just quoted the tag, tired of getting tagged everytime, just to see when following it, that just another one quoted an article I've already read a dozen times. RE: Adding memmem() to QB64PE - SMcNeill - 03-07-2025 Not that I know of. I wish there was an option for that. "Ignore Tags on Replies" would be *lovely*! RE: Adding memmem() to QB64PE - Petr - 03-07-2025 I don't know for what it will, but it's such trivial stupidity... If you want it faster, you have to choose an even better method - for example, filtering. But I won't deal with that. Here is a basic version, of course, if you are going to search gigabyte and larger arrays, you must waiting to output with this version. Because I don't have enough knowledge to apply the Boyer-Moore or Boyer-Moore-Horspool algorithm, or deal with parallelization to increase speed right now. Practically speaking, if you are going to search Gigabyte and larger arrays, divide them into smaller ones but don't forget about the overlap (if it happens that half of the sample you are looking for will lie at the end of the smaller block and the other half at the beginning of the next block during the next reading) - without the overlap you would never find the sample. But in general - if you really need lightning-fast output in your program, this is a stupid solution. Just save the offset when storing to memory or choose small memory blocks - they will be searched faster. Code: (Select All)
RE: Adding memmem() to QB64PE - Sanmayce - 03-08-2025 (03-07-2025, 05:03 PM)SMcNeill Wrote:The sourcecode is at releases section:(03-07-2025, 03:22 PM)madscijr Wrote:(03-06-2025, 08:13 PM)grymmjack Wrote: Over my head, but love the passion!Yeah, can we get a laymen's description of this, for us mere mortals? https://github.com/Sanmayce/Railgun/releases And the benchmark is fully reproducible! > Yeppers!! Just a readme text file, with the *exact* same contents as what was posted above. Once again, there is no code, libraries, or anything compilable or studyable at the site. Lies, lies, and since when a single function needs a library I cannot believe how hateful and stupid things you said, a super moderator - you are not. |