danparizher / Pax-Academia

General purpose utility bot for the Homework Help Discord server
MIT License
13 stars 5 forks source link

fix: Upgrade code detection #281

Closed denizkirbiyik closed 3 months ago

denizkirbiyik commented 4 months ago

I replaced the system used for code detection with a different system that uses code-specific regex patterns/expressions.

The previous system was prone to false positives.

denizkirbiyik commented 4 months ago

I added all of the suggestions and I did a few more tests from previous detections in the server.

GabeMillikan commented 4 months ago

Thank you, can you share some of your tests here? It would be nice to paste a couple of examples in your PR description that demonstrate:

denizkirbiyik commented 4 months ago

Things that was previously falsely detected as code, but were correctly detected now:

Amber ( Inventory Personnel )
Search function for PRODUCT  [(search product you need) and (search Expired product)]
Replace or ament BALANCE QUANTITY, QUANTITY  (for Old Product)
Delete expired product ( delete only quantity and balance quantity )
[Quantity must be 0 for expiry products, 0 to represent delete]
Exit ( exit inventory )

This is the notes I've made
PA seems prone to false positives, for example:
Lines ending with (semi)colons
Text in parenthesies (be careful with them)
(wow)
(no wonder there are so many false positives)

My process for this question:

-16+8+4+1 = -3 (Exponent)

Next I moved the decimal point 3 places to the right

Answer = 0101.010 = 5.25 in denary

The correct answer is: 0.08203125 (However, I do not understand how to get to this answer) 
How to optimize the following Boolean expression using a map:
X'Z' + YZ' + XYZ

i will do it!!

(i am lying)
Hi, so i obtained the values:
27 13 34 85 59 91 50 38 as my step 1, in which 34 is sorted. However, i only have 2 values 27 and 13. How do i perform another middle of 3?
Theorem 4.2: All recursive algorithms must have a base case.
  Proof: See Theorem 4.2.
1: searches for all occurrences of 1 (1)
2: searches for all occurrences of 2 (2)
2: searches for all occurrences of 2 (2)
4: searches for all occurrences of 4 (2)
4: searches for all occurrences of 4 (2)
2 + 2 + 2 + 2 + 1 = 9
would you break it like:

$2(3^k) + 3^k - 6 > 4k + 4$
so from what i'm getting is:

learn the math (discrete, stats & probability, algebra, calc (for fun))
what if you do this instead:
Inside of recv you read the new frame. If you're not processing a frame you start transforming it async without awaiting (and set the boolean to true). Then return the last processed frame. The job of transform_frame is to set last_frame inside of itself (so it doesn't return anything). Or, if there is some kind of similar thing to .then as in JS, do that instead
if you want to develop native windows apps then i guess the following might be a decent option
clang/llvm as compiler (works just like gcc)
clangd extension for c language support in vscode
ninja for building (replaces make)
cmake + cmake extension in vscode for c project management
GabeMillikan commented 3 months ago

Thanks again for your effort here! Unfortunately we've decided to simply delete the feature altogether, because it is generally just annoying and not helpful. This PR would have fixed a lot false-positives where non-code was detected as code, but it does not meaningfully improve the correct-positives where code is detected as code. Doing so is a difficult challenge, and is better solved by language-specific rules in the ./code_detection/ directory.