Parsing refers to the action by software of breaking an artifact into its constituent elements and capturing the relationship between those elements.
0
votes
0answers
11 views
How to parse HTML table using jsoup?
I am trying to parse HTML using jsoup. This is my first time working with jsoup and I read some tutorial on it as well. Below is my HTML table which I am trying to parse -
If you see my below table, ...
4
votes
1answer
65 views
Put it in a bucket
You're running a jeans company. Your system is collecting detailed orders' data, but it's a bit archaic and it's storing the number of units ordered per size in a delimited string with 20 "fields", ...
0
votes
0answers
8 views
Regular Expressions for finding HTML code in Python [on hold]
So, I've been given another task from my professor, and this one is bugging me.
Write a program that can replicate this sort of exchange:
...
2
votes
1answer
27 views
More idiomatic way to write this Python coordinate parser?
This is a Python 2 script to take in a file in one of two formats (unknown), and standardize it.
The data are coordinates in the xy-plane. They represent airfoils in the first and fourth ...
2
votes
2answers
75 views
Parsing arithmetic expressions like (x + y * a + b *z)
I have this code which I wrote to parse arithmetic expressions.
However, many people say there are problems with it but don't tell me what the problem is. Please let me know if you see any.
Note ...
1
vote
2answers
46 views
Looking for matching names among two text files
I'm trying to enhance the execution speed of my below code. I am using only vanilla JavaScript. I would be willing to bring in additional libraries and plugins as long as they will enhance the overall ...
3
votes
3answers
164 views
Optimize parsing more and more
I have the below C# code for parsing. Do you think this is most optimize or I should use generic method or optimization required in these functions themselves?
...
4
votes
1answer
46 views
XSLT 2.0: Crawl HTML and add links
Background: I have 4 GB of text data dispersed in 250,000 html files. I want to interlink the files with <a> for the reader to click on. I have a 12 MB file ...
3
votes
1answer
49 views
Python script which fetches Amazon product details using its API
This is a script which takes an Amazon URL as input, takes out ASIN/ISBN from the URL, and uses Amazon Python API to fetch details.
For this task, I looked at many Amazon URLs and observed the ...
5
votes
2answers
110 views
Short XML parser
This is my first code in C# ever. It compiles and works as intended (not complete), but I want to see what I'm doing right and wrong as a first-timer.
...
4
votes
3answers
50 views
Parsing US address with Clojure
The parser below is not designed for every single US address. I am parsing through a file where each line may or may not be an address. I am more focused on speed rather than robustness.
...
3
votes
1answer
52 views
Parsing Solr log files - version 2
This post is in reference to: Parsing Solr log files
I re-wrote most of the code and split it up into a couple of classes. Currently, the class functionality is pretty limited, but I can see that I ...
3
votes
3answers
172 views
CSV reader (revised)
This is the successor of my previous CSV reader. I implemented quite some useful suggestions.
I will give explanation on a few parts:
Prefixing constant identifiers with ...
2
votes
1answer
55 views
Parsing Solr log files
I am kind of new to programming. Picked up some Perl about a year ago and now learning some Python. I am pretty confident in Perl, but Python seems un-natural to me.
I wrote a little script that ...
2
votes
5answers
326 views
CSV reader and parser
I have implemented a CSV reader. I think I did pretty well. Since CSV is a loosely defined format to begin with I decided to allow some malformations, like anything but a delimiter after an enclosed ...
5
votes
0answers
58 views
Reduce duplicate sequences
I am writing a copy paste detector using esprima.js and Hmm.
This particular function checks a number of sequences and reduces them.
Due to the parsing I might have 2 sequences with the same piece of ...
1
vote
1answer
50 views
Making an email text-parser generic using PredicateBuilder
I have some code that reads an email from a text file, parses the text, removes some lines (the 'cc' and 'to' lines) and then finds the line numbers of various phrases (e.g. "Regards", "Thanks") and ...
16
votes
3answers
2k views
Look 'ma, I can read code
I have put together a naive implementation of a VB6/VBA parser, and I'd like to see if the CR community sees the same things as I see can be improved with this code, before I start refactoring.
I've ...
15
votes
5answers
593 views
Parsing CSV to specific format
I've written this code to read CSV files written to a specific format. I would like to gather some feedback on where it could be improved. I'm trying to get into the test driven development ideology ...
2
votes
0answers
13 views
Parsing time ranges with PyParsing
The following code is intended to parse a string of the following format and return whether the current time falls in that window:
...
1
vote
1answer
77 views
7
votes
2answers
361 views
Optimizing this inefficient TicTacToe configuration parser
On a programming contest I came upon this question:
Given a partially played 3 × 3 tic-tac-toe configuration, write a program to determine which player will have a better chance of winning if the ...
2
votes
1answer
45 views
Is this `img` creator decently secure from XSS?
This is being used now, seems decent to me but I'm curious.
...
0
votes
1answer
44 views
Getting data from the server via JSON callback and parsing the data to HTML
I'm pretty new to web development with JS and was wondering if anyone can tell me how I can improve my code. I just feel like when it comes to maintainability my code would be very difficult to ...
3
votes
1answer
90 views
Parsing version number from a Java source file
I'm extracting the version number from a file like this one. It works, but I find it clumsy and longer than probably needed.
I'd also appreciate some sanity checks as long as they don't make the code ...
3
votes
2answers
171 views
Text parser code elegance
I have a text parser that reads certain information from a given file with a specified format. The text file contains some measured properties of a product. The date model number/lot number is written ...
7
votes
3answers
110 views
VB6/VBA Declaration (Dim) Syntax Parser
As part of a project I'm working on, I've implemented a class that encapsulates the syntax for a vb6/vba Dim statement.
Given a line of code, the ...
10
votes
1answer
127 views
Configuration file with Python functionality
I'm working on quite complicated scientific project.
I decided to use a configuration file for model description. However it was quite complicated to parse all strings after ...
4
votes
1answer
77 views
Code from “Write Yourself a Scheme in 48 Hours” tutorial
I recently went through this Haskell tutorial.
I'd be interested in any thoughts or comments at all, in terms of improving the structure, order, haskell conventions, or that long, kind of ugly eval ...
3
votes
1answer
43 views
Stripping out all /* */ comments from a paragraph
I've written this code keeping the following cases in mind and I think I've covered them all. I'd really appreciate if someone could help me determine if I've covered all of them.
Cases I considered:
...
3
votes
2answers
51 views
How can I speed up my RSS feed Android App?
I have a problem with parsing RSS from a PHP page because the app is too slow.
This is my parsing code:
...
3
votes
3answers
671 views
6
votes
2answers
88 views
Social Media Hashtag Splitting
I decided to try out Python (3.x) two or so weeks ago, and this is my first real script using it. The program I've written below is slow, clunky, inefficient, inaccurate, and probably poorly coded! ...
3
votes
1answer
71 views
Extracting the text of a specific XML node
I have to extract friendlyName from the XML document.
Here's my current solution:
...
2
votes
0answers
74 views
Parsing a website
Following is the code I wrote to download the information of different items in a page.
I have one main website which has links to different items. I parse this main page to get the list. This is ...
6
votes
2answers
54 views
Refactor an XML to JSON parser class
I used Nokogiri and a piece of ActiveSupport to parse an xml file from a given URL, format the data properly and return a JSON string. The script works as expected, so I'm only wondering if there are ...
4
votes
1answer
65 views
3
votes
1answer
183 views
Math Equation as String to Reverse Polish Notation Parser
What I have done is create a console program where users type in a math equation such as 5+4-6 or (5+16(8-4))/16 that follows ...
5
votes
2answers
99 views
Optimizing simple xHTML parser
I'm writing a simple xHTML parser which parses a data without nested tags.
Example input code will look like:
...
3
votes
0answers
65 views
Parsing an infix notation expression and converting to reverse polish notation
I'm pretty new to Go, and I do not know the best or idiomatic ways to do most of the stuff, so I'd appreciate feedback on how to make my code better, faster or more idiomatic.
My program is a set of ...
1
vote
1answer
143 views
Is this a safe way to parse out HTML tag attributes?
I needed a super simple parser to get HTML attributes and their values. I didn’t want to load a big library or anything so I made this.
I realize I am making assumptions here, mainly:
Attribute ...
3
votes
2answers
51 views
2
votes
1answer
28 views
Parsing playlists efficiently
I have this regexp working, simple, but I feel like it may not be the best way to code it. Basically, I have a playlist separated by line breaks returned as tcp data like so:
...
6
votes
1answer
78 views
Extraction of data from Flickr
I'm crawling Flickr for data for my university research project. However it's very slow and I'm not sure what it is exactly. It could be the FileWriter slowing it ...
5
votes
3answers
164 views
Converting KML/XML to Javascript
So, I have the boundaries of every states in the US, from the google map KML file.
This KML file is actually a XML file.
I'm converting this file to a JS file compatible with google map in order to ...
4
votes
2answers
63 views
Packaging a single-file Python copy-tool
I'm currently working on a very simple one-file project:
Lumix provides the possibility for the camera TZ41 (and others) to load GPS data and tourist information from a DVD to a SD-card so that you ...
7
votes
2answers
359 views
Parsing CSV file with BufferedReader vs Scanner
I have to parse file line by line and in single line I have split by ",".
First String would be Name and Second would be count. Finaly I have to display the Key and Count
For example
...
6
votes
2answers
77 views
Performance tuning on a text file to object conversion
I'm using an API which returns text in the following format:
...
5
votes
1answer
112 views
Infix-to-postfix parser using Dijkstra's shunting yard algorithm
I've been trying to expand my programming horizons, and have entered the world of grammars and parsing, which I'm brand new to. I have been improving a little implementation of Dijkstra's shunting ...
3
votes
1answer
86 views
Parse XML using Python XML eTree
I am a high school intern, and I am trying to parse my mentor's code so that he can read in an XML file and call simple methods to edit or get information from his XML file.
I was hoping someone ...