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)

2
votes
0answers
9 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: ...
7
votes
2answers
348 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
42 views

Is this `img` creator decently secure from XSS?

This is being used now, seems decent to me but I'm curious. ...
2
votes
0answers
53 views

Oracle alert log parser [closed]

Actually, I don't want to ask a question, I want to share my parser for Oracle alert log. I've had a lot of headache with alert log monitoring. Grep for errors doesn't give much info, so you should ...
0
votes
1answer
38 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
86 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
157 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
90 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
117 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
65 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
41 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: ...
0
votes
0answers
9 views

High-level strategy for distinguishing a regular string from invalid JSON (ie. JSON-like string detection) [migrated]

Disclaimer On Absence of Code: I have no code to post because I haven't started writing; was looking for more theoretical guidance as I doubt I'll have trouble coding it but am pretty befuddled on ...
3
votes
2answers
48 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: ...
5
votes
2answers
76 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
66 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
64 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
51 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
54 views

Output of 'ldd' to dictionary

I want to use the output of the terminal command ldd: ...
3
votes
1answer
149 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
96 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
56 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
118 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
45 views

Perl 6: Grammar issues (simple defines)

My goal is to parse defines in Objective-C code: ...
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
72 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
140 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
60 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
314 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
73 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
100 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
73 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 ...
3
votes
1answer
39 views

Extracting performance statistics from FTP session transcript

I've borrowed and written the following code to output the disconnect time. All works well but I'm curious as to how I could tighten/ shorten the code. If anyone feels like having some fun then I'd ...
9
votes
1answer
83 views

Processing C++ comments

Here's the first functional version of my Python 2 script for processing comments in C++ source files. It's a personal project, I expect to expand it later with more advanced options (mainly about ...
11
votes
2answers
130 views

Parsing Valve Map Files (VMF) into a tree like structure

I've written a small library of objects for parsing of Valve Map Files (VMF). These files are always generated and exported from either the Hammer World Editor, or a Source engine built in map making ...
9
votes
3answers
213 views

Parsing comma-separated floats and semicolon-delimited commands

I wrote a cstring parser. It has to work with a relatively wide amount of arguments (usually 3 or 4, but maybe in future with a different amount), which are ...
3
votes
1answer
42 views

getword that properly handles undersores, string constants, comments, or preprocessor control lines

Our version of getword does not properly handle underscores, string constants, comments, or preprocessor control lines. Write a better version. This is the exercise 6-1 and can be foud on K&R ...
1
vote
2answers
82 views

How to handle JSON's undefined value in a better way?

I'm working on Google Book API to post a book's basic information. I notice that some of the books will always miss a value or two under volumeInfo, like this book ...
3
votes
1answer
93 views

Which approach is preferable string parsing?

I want to find total word count in string. I have two methods as mentioned below. ...
4
votes
1answer
88 views

Library for parsing strings to java types, generic types and collections/arrays

I've done a library that can parse strings to different java types and to List<...>, Set<...>, ...
3
votes
1answer
84 views

Parse needs to be more efficient

I will preface by saying that this data set is much larger than what I have here. I'm having to loop through an XML file to get data and display it on a site with jQuery. I have to use jQuery because ...
8
votes
2answers
403 views

Object Creation during loops

I'm trying to parse a CSV file into objects. I've already got a very efficient CSV parser (SuperCSV). The problem arises when trying to create the object with the data that is being read out. I've ...
1
vote
1answer
104 views

Ruby html href parser working slow

I wrote this simple HTML parser in Ruby. Basically I have a folder that has files. Every file has crawled web pages. The only addition within these files is before the HTML content there is a page ...
5
votes
2answers
77 views

First program with scraping, lists, string manipulation

I wanted to find out which states and cities the USA hockey team was from, but I didn't want to manually count from the roster site here. I'm really interested to see if someone has a more elegant ...
9
votes
2answers
719 views

Math expression solver

Recently I've stumbled upon an interesting challenge for me. You should develop C application, that solves math expressions. Operations such as (+,-,*,/) should be supported, as well as (cos, sin, ...
5
votes
3answers
80 views
4
votes
2answers
70 views

Parsing record-jar format in PHP 5.3

Here is a simple function I wrote to parse record-jar data. I need it in a php5.3 application to validate bcp47 language tags. It converts the language subtag registry among other things, into a ...
3
votes
1answer
42 views

Parsing psql output into multiple files

I wrote the following simple Perl script to read lines from stdin that are the output from a psql call that returns lines of the ...
5
votes
0answers
70 views

Reading Intervals from command line

I want to parse a command line using boost.program_options. Most of my command line arguments will be intervals, which I could implement as something like ...