57,580 questions
4 votes
1 answer
84 views
How to evaluate arithmetic expression in pseudo‑SQL style (Lua 5.1)
In love2D I have a string that represents a mathematical expression, for example: local expr1 = "[p35] div [p36]" local expr2 = "((([p35]*100) div [p36]) mod 100)" local params = {...
Advice
0 votes
7 replies
113 views
High volume URL parsing in Python
I use the polars, urllib and tldextract packages in python to parse 2 columns of URL strings in zstd-compressed parquet files (averaging 8GB, 40 million rows). The parsed output include the scheme, ...
1 vote
1 answer
66 views
java-cup sends "Syntax error @ Symbol: PARSER" and NullPointerException when compiling a .cup
I’m working on a DSL parser using Java CUP, and I’m getting this error when trying to compile my .cup grammar: Error: Syntax error @ Symbol: PARSER (unknown:19/-5(-1) - unknown:19/1(-1)) Error : ...
0 votes
0 answers
38 views
Apply default or constant values to json
I want to modify input json before it will be processed by telegraf json plugin via json_query. Is it possible to add some default value or constant value to json via json_query? For example, I have ...
0 votes
2 answers
108 views
More parsing-friendly Python debugger locals() output [closed]
I need the locals() text output to be easier to parse then what the default output is. I am using a IDE that I wrote in C that starts a tty() to run pdb and it captures the output from locals() and ...
0 votes
1 answer
79 views
How do I rewrite paths in an AST's import tree?
I'm writing a program that will update a Rust project's imports to be from their new locations after a breaking change in a library. In this instance, I'd like to flatten all imports from vexide::...
-3 votes
1 answer
125 views
Best way to parse an http request (from scratch) [closed]
I'm currently working on a mini NGINX project just for learning purposes. I already implemented some logic related to socket networking. I'm now facing the problem of parsing the HTTP requests, and I ...
3 votes
1 answer
215 views
How to extract table from PDF with boxes into pandas dataframe
I have code that detects a table in a PDF that appears after a specific section, and parses the information in the table and copies it into a pandas dataframe. Now, I want to indicate whether a box is ...
Advice
1 vote
0 replies
96 views
Parsing with Python html.parser: accessing and using raw tags
I'm not a Python specialist, so bear with me. I'm trying to replace a Perl HTML::TokeParser based parser that I use for template foreign language translation to use Python html.parser. Here's the ...
2 votes
0 answers
114 views
How do I properly use Libwebsockets' JSON parser (LEJP)?
Trying to figure out how the built-in JSON parser in libwebsockets works. From my understanding of the documentation, you're supposed to call lejp_parse(), giving it a JSON-formatted string and a ...
0 votes
0 answers
50 views
How to force drain3 to keep log event defining parameter as a static?
I am trying to parse log lines for log anomaly detection, but two log lines are too similar for the parser to keep them apart: [Something] VM Started [Something] VM Paused it parses it to VM <*>...
1 vote
1 answer
114 views
can the parser fetch duplicate key
I know that the Yaml spec requires key uniqueness in mappings, but is it possible the make the parser parse and return duplicate keys in order to do some special processing on the duplicate keys in ...
0 votes
0 answers
15 views
NEST Network Emulation: httperf parser fails with AttributeError: 'NoneType' object has no attribute 'group
markdown I'm trying to run HTTP emulation experiments using NEST (Network Emulation and Simulation Testbed) but encountering parser errors with httperf output due to regex pattern mismatches. Problem ...
2 votes
2 answers
76 views
Get spaces count between nearest non-space character and given index
I have a string: ONT ONT ONT Auto-neg Speed Duplex Port Flow Native Priority And i need to get Auto-neg from it (for example). I have start index of this word, for example 24. I ...
0 votes
0 answers
36 views
New validation of xml by .iterparse
Good Morning, Does anyone use validation via .iterparse? I need to rebuild the plugin to validate files over 2GB. To do this, I need to change the parser – I'm using etree.iterparse instead of lxml....