New answers tagged parsing
0 votes
Remove HTML block in Python
from bs4 import BeautifulSoup HTML = '''<html> <head> ... </head> <body> <div> ... </div> </...
2 votes
How can I take an integer string modulo 4 without overflowing u128?
Per J_H's answer, you can do this just by taking the last two digits mod 4. For any decimal number [A...B]CD: mod([A...B]CD, 4) = mod(100[A...B]+CD, 4) = mod(0+CD, 4) = mod(CD, 4) Thus, you can ...
0 votes
Handle multiple ORC OBR repetitions on OML_O33 message as OML_O33_ORDER instances
One solution might be to set the parser in the so-called "non-greedy" mode: https://hapifhir.github.io/hapi-hl7v2/base/apidocs/ca/uhn/hl7v2/parser/ParserConfiguration.html#setNonGreedyMode-...
2 votes
How can I take an integer string modulo 4 without overflowing u128?
@phuclv observes that to get the remainder when dividing by 4 you just need to take the remainder of the last 2 digits. It works regardless of the size, no need to parse the number at all. In fact ...
2 votes
How to check if a date is after today java
tl;dr Use java.time, never legacy Date/Calendar. LocalDate // Represent a date-only value (year-month-day). .parse( "2016/04/26".replace( "/" , &...
0 votes
How to exclude a tag from an html file with xidel?
user37421's answer helped me understand how to exclude certain tags. Here is a summary of my findings: $ echo '<ab>12<cd>9876</cd>34</ab>' | xidel -e '/' 12987634 $ echo '<...
0 votes
Excel VBA - parse JSON string and set cell values based on key:values
This code can process the sample data Sub processjson() inpstring = Range("H1") i = 1 colcount = 1 rowcnt = 1 Do While InStr(i, inpstring, ":") <> 0 If colcount = 5 Then ...
Best practices
1 vote
0 replies
0 views
Optimization of an OSM-file parser
Why do you ignore the existing XML parsers and implement your own? For processing large XML files you can use streaming XML parsers like SAX or StAX.
Best practices
0 votes
0 replies
0 views
Optimization of an OSM-file parser
Did you notice that this question is an "open-ended" question? That means that the question limitations are more relaxed. So considering that this is an open-ended question, do you still ...
Best practices
0 votes
0 replies
0 views
Optimization of an OSM-file parser
First off: Why do you "need to" write an OSM parser? There are plenty out there. Aside from that, this question is probably off-topic for Stack Overflow: You either, if you have a specific ...
Best practices
5 votes
0 replies
0 views
Optimization of an OSM-file parser
One homemade and the other using java own XML-parser. Unfortunately the former is invalid. You can't parse XML line-wise
Advice
0 votes
0 replies
0 views
0 votes
Why can't a compiler have a "shift/shift" conflict?
In LR(0) parsers we use Pushdown automaton and to drive the decision as to whether shift or reduce we create a characteristic automaton which will be non-deterministic from the viable or admissible ...
Advice
1 vote
0 replies
0 views
How do I fix the string limit of my code?
You didn't add URL so we can't test it. Maybe page gives only 501 strings (maybe it uses JavaScript to load more data but requests, BeautifulSoup can't run Javascript - and it may need to use Selenium ...
Advice
0 votes
0 replies
0 views
How do I fix the string limit of my code?
by the way: input() doesn't need print() brand = input("brand: ") limit = int(input("limit: "))
2 votes
Parsing /proc/meminfo using read() in C gives incorrect RAM values
There are enough comments concerning your approach and architecture. Therefore this answer just pinpoints the actual error. Condensed to the relevant structure, your program looks like this: int main(...
Advice
1 vote
0 replies
0 views
How do I fix the string limit of my code?
What is len(hidden_inputs)? It seems like the most obvious cause is there's only 501 inputs to read.
2 votes
Parsing /proc/meminfo using read() in C gives incorrect RAM values
Here's code from my personal library. It might give you some ideas for your implementation. One special feature is the switch that reacts to the length of the keywords. This optimization is intended ...
2 votes
Accepted
xml2lua gives me multiple root nodes
Before reusing handle.root, you have to claim that the old node tree will not be used: handler.root = nil The code can be as follows: local function count_root_nodes() local parser = xml2lua....
Top 50 recent answers are included
Related Tags
parsing × 57564python × 9685
json × 8647
java × 8426
xml × 5853
php × 4745
c# × 4233
javascript × 4119
html × 3687
regex × 3539
string × 3342
android × 3122
c++ × 2447
csv × 1775
arrays × 1705
c × 1655
beautifulsoup × 1142
ios × 1092
jquery × 1091
grammar × 1076
ruby × 1073
python-3.x × 987
datetime × 941
antlr × 934
date × 927