Tagged Questions

Parsing refers to the action by software of breaking an artifact into its constituent elements and capturing the relationship between those elements.

learn more… | top users | synonyms (1)

5
votes
1answer
33 views

Parser for simple programming language

I'm writing a basic LL(1) parser in java, but my parser class is quickly getting out of hand and becoming huge. PMD even calls it a "God class" and says that it has "Too many methods." Is there a way ...
0
votes
0answers
15 views

Python - call all methods of a class [on hold]

I'm wondering if my design is flawed or if I'm thinking this incorrectly: I have a class Lexer that has a number of methods. All methods are ...
1
vote
2answers
67 views

Finding logic operators [on hold]

We get the search string from the UI. Based on the search parameters we need to create a back-end query. This is similar to "Feed Item Query Language(FIQL)". I have wrote the code to find the logical ...
2
votes
1answer
30 views

Bash Script - File Comment out & Notate

I have been writing my own Bash Scripts for a little while now. I am getting a better comprehension of it and I would like to start refining my code to be more elegant. I have recently developed this ...
2
votes
1answer
21 views

Filtering JSONArray by Branding & Modelling

I have a small function that takes in a list of JSON objects that has the format below. The function below that wants to see if the brand and model of car passed to it can be matched against the List ...
0
votes
0answers
31 views

Parsing Markdown with Parsec

Are there better ways to refactor the code? I would like to avoid try. What do you think of the type-annotation-block? ...
2
votes
2answers
56 views

Splitting a Multi-FASTA file into individual files

I have written a program to split a Multi-FASTA file into individual fasta files. ...
3
votes
0answers
70 views

Parsing small sets of data from a large XML using XMLReader [closed]

Suppose I have a lot of large XMLs I want to parse data from and each of these can range in size from 10MB to well over 300MB. Now, I only need a small sub-set of data from a few specific keys. For ...
2
votes
4answers
276 views

Parsing a string to get the values of certain attributes

I have written a small method that extracts certain information from a string. An example of such a string is ...
2
votes
1answer
58 views

Creating objects from parsed file

I'm newbie in Python but I want to know some tricks to make my code look cute. I know that syntax of Python allows to do this, but I don't know how. Suppose I have file with lines of format "x y z" ...
4
votes
1answer
51 views

Parse prospero-Parameters

Prospero is a URI Scheme. There you have fields and values. Would you guys check this code and give common suggestions or even testcases for junit-Tests? Sorry Docu is in German. ...
1
vote
1answer
50 views

Mapping/parsing database table data to output data

I have currently implemented this simple example of a database to output for a REST API to show the way information is being parsed, mapped and serialized starting from database data converting it to ...
5
votes
3answers
71 views

Windows forms set saved groupbox location settings

I have a Windows form that when a user moves some groupboxes around, before the application exits, it saves those X and Y coordinates into a MySQL database (with a bit of added text to identify which ...
4
votes
1answer
25 views

Finding the next XML element

I am looking for a better way to do a while cycle with the variable update. The background is that I'm writing a StAX-line XML reader in JavaScript and want to ...
11
votes
5answers
879 views

Finding longest word in a string

I was working on a problem from Coderbyte. The challenge was to write a function that takes in a string and returns the longest word in the string. If two words are the same size then it asks to ...
12
votes
3answers
2k views
6
votes
2answers
79 views

Parse floats from a string

While fixing some old code I came up with a class that parses floats from a string. This is used for parsing svg files in xml format. Floats can be separated by comma, space or anything at all in ...
7
votes
3answers
62 views

Parsing dates from an OCR application

I wrote this code to parse dates from the output of the OCR, which means that the obtained date can be literally anything, so I put some restrictions in place: Date is the the format of: ...
11
votes
4answers
162 views

Improving the readability and efficiency of parser code

Recently, I had a test and I wrote this code, but they didn't like my code because it was "deplete and nested". In order to improve my skills, what would be good ways to make this more readable and ...
2
votes
0answers
41 views

Text parsing and calculator (calculate Java heap memory)

I'm writing small tool, which must execute jmap -heap, write output to log, then takes some data from log and calculate used memory. I added some ...
3
votes
2answers
69 views

Parsing arguments for cd command

This file manager has a code snippet that handles an argument of the "cd" console command. It converts the argument to a valid path, expands ~ and environment variables into the corresponding values: ...
5
votes
1answer
50 views

Parsing .obj 3D meshes

I have a legacy code parsing .obj 3D mesh files. However, it seems to me a bit ugly: ...
3
votes
0answers
47 views

Python API for TreeStructInfo - new simple config format

I've created a simple (300 SLOC) API for a new configuration format (I'm not the author of it). Unfortunately, the specification is only in Polish at the moment, but you can see how it looks here. ...
9
votes
3answers
128 views

Ugly workaround to get the vbext_ProcKind of a procedure is breaking encapsulation

This is a follow up to Extending the VBAExtensibility Library. It turns out that code had a really nasty bug. Anytime vbeProcedure.StartLine got called, I was ...
4
votes
1answer
80 views

Reading and Parsing JSON from a Game Server

This is my naive (but currently working) attempt at reading JSON commands from a Java game server in Objective-C. I am afraid I might be doing something wrong, so hopefully this question will be a ...
3
votes
1answer
57 views

Dirty XML-to-JSON parser

I have that XML-to-JSON function based on ElementTree. It looks very simple but until now it does what it's supposed to do: give a JSON description of the ...
3
votes
1answer
69 views

Deserialize an email header into key-value pairs

I've created a function that will deserialize an email header into a list of key-value pairs. I've run numerous tests using MS Office Outlook 2010 and MS Office 14.0 Object Library, all of which were ...
3
votes
3answers
314 views

Parsing and formatting a time two ways (perfectionistic approach)

I'm still not satisfied by the readability of the code. The wanted behavior which would be self descriptive would sound like: "I've two fields; one is for the date and one for the hour. This two ...
5
votes
1answer
62 views

JavaScript path parsing

I was attempting to do some contribution to the underscore-contrib library, and I ended up writing a function that will parse a JavaScript path to later on expose through an API if the path exists or ...
15
votes
2answers
494 views

Lexer+Parser code for my “Reedoo” programming language

I've been working on my own programming language, as a hobby for the past couple of months now, called Reedoo. It is implemented in pure C++ 11 and uses only the libraries that come with C++; no ...
1
vote
0answers
22 views

XML data-parsing design that doesn't sacrifice efficiency [closed]

I have the following method signature ...
9
votes
1answer
68 views

Yet Another Fraction

A recent question inspired me to implement a Fraction class. I decided to write this one in vba, because I like writing tools for the poor souls that still have to ...
8
votes
2answers
86 views

Fixing double arithmetic errors

I am trying to account for the errors in double arithmetic in a C# program I am writing, and came up with this first solution that seems to work well for most cases: ...
2
votes
2answers
86 views

Histogram of length of words in text

This my first real program in python. I welcome harsh criticism. I tried to make it as efficient as possible. Trying to balance speed and readability as well. My program takes a file of text and ...
10
votes
5answers
936 views

Using TryXXX pattern to avoid exceptions

I have been using the TryXXX and GetXXX pattern lately to give clients a choice whether to trap an exception or to read a boolean. An example of this concept would be ...
1
vote
0answers
51 views

A function for parsing words from a string without using whitespace

I'm trying to parse words from a badly garbled text file that contains many repeats. It's about 100k characters in length and was formed from joining many substrings in alphabetical order. I'm ...
3
votes
1answer
30 views

Implementation of *nix ipcalc

I posted a JS subnetting calc before, but I wanted to try a CLI version, so I made this. The parts I'm most worried about are: structure (could I refactor the layout better?) Did I goof any math? ...
4
votes
3answers
245 views

Parsing dates from a webpage

I have two inputs (TextBox) on my front end. The following code parses them from their string representation to aDateTime object. If it fails, it then sets ...
1
vote
0answers
28 views

Extracting country data from HTML tables

I am trying to optimize/improve my coding skills in python The rationale behind this code is to extract some data from files and store them in a dictionary. I tried to comments lines to improve ...
11
votes
2answers
268 views

Markdown to HTML

...
4
votes
2answers
115 views

Serializing data from two URLs in the same object efficiently

This is a follow-up to: Serializing JSON data coming from two URLs in the same object I have two URLs (urlA and urlB) and they ...
2
votes
1answer
178 views

Java Query String Parser

I have written a Query String Parser to Parse a given query string. Is there any enhancement I can do? ...
5
votes
1answer
95 views

Parsing Valve Key-Value files

Introduction Valve recently launched the Dota 2 Workshop Tools, which allows players to create their own maps with custom gamemodes, similar to Warcraft 3 in capabilities. Ability and unit ...
4
votes
2answers
67 views

Evaluating algebra expression using an auxiliary VB class compiled on the fly and consumed in a C# project

I want to create algebra evaluator but I don't want to write my own parser because it takes much time to learn. I don't like algebra expression in C# because it does not look natural compared to VB ...
10
votes
2answers
136 views

Parsing of a (Linux) netlink hotplug uevent packet

The netlink service is used, among other things, to notify userspace about hotplug events (e.g. "a device has been connected"). These events come in the form of packets, which follow the following ...
1
vote
0answers
26 views

Infix epression evaluation

I'm looking for some feedback on my OCaml implementation of some methods to translate infix expressions to postfix and then evaluate them. I'm very new to OCaml, coming from C#/Java and JavaScript ...
5
votes
1answer
104 views

MP4 Parser: Reducing code duplication

I'm developing an MP4 parser. Each class represents each box in MP4 file, and every box class derives from base box class. The problem is that below code is duplicated on every box class: ...
8
votes
2answers
245 views

Serializing JSON data coming from two URLs in the same object

I have two URLs (urlA and urlB) and both the URL gives me a JSON response back in the same JSON format. Below is my JSON string ...
6
votes
1answer
57 views

Splitting plain text dictionary data to multiple files, round 2

This is a continuation of my earlier question. I have a plain text file with the content of a dictionary (Webster's Unabridged Dictionary) in this format: ...
7
votes
2answers
110 views

Splitting plain text dictionary data to multiple files

I have a plain text file with the content of a dictionary (Webster's Unabridged Dictionary) in this format: ...