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)

3
votes
0answers
28 views

A c++ PEG parser generator

Last Weekend I wrote a c++ PEG packrat parser generator and would love to get some feedback on the code and/or syntax. I currently use the << operator for defining grammar expressions and ...
0
votes
0answers
6 views

Parsing multiple same formatted xml items [migrated]

I have multiple items within my xml code I want to parse. I'm not quite sure of how to do it, any help would be greatly appreciated. Below is a snippet of my xml and python code and what I'm looking ...
2
votes
1answer
35 views

XML to Windows.Forms.Keys List

It took me a lot of poking around and unit testing to get the code to look like it is right now. So I have a XML file which in part looks like this <FunctionKeys> ...
3
votes
1answer
51 views

Have I missed some obvious XSS vulnerabilities?

As the question states: have I missed some obvious security vulnerabilities in this code? Particularly interested in XSS... I'm trying to create something more robust that strip_tags, but simpler ...
0
votes
2answers
46 views

ruby notes scrubber search for specific characters [closed]

I am looking to making a not scrubber for my testing notes. I want to run a script that will read the entire file looking for special "tags" that I made in my notes, like @ ? (c) etc... I then want to ...
5
votes
2answers
122 views

Critiques on a trivially easy to use Python CSV class

I have been working on a project where I needed to analyze multiple, large datasets contained inside many CSV files at the same time. I am not a programmer but an engineer so I did a lot of searching ...
3
votes
1answer
85 views

How to make this BigRational parsing method more efficient?

I'm using the BigRational beta off the BCL CodePlex (bcl.codeplex.com), and I realized it had no parsing method. So I tried to write one. However, it's quite inefficient (5.5ms for a 254 character ...
3
votes
4answers
131 views

download an image from a webpage

I originally posted this on stackoverflow and was recommended that I post here, so I apologize if you see this twice:) I am trying to write a python script that download an image from a webpage.on ...
3
votes
2answers
107 views

How would one more elegantly parse data from XML using Ruby and Nokogiri?

I have a method that parses XML into an array of hashes. Here is the original XML: <rowset name="skillqueue" key="queuePosition" ...
2
votes
1answer
197 views

Get metadata from an Icecast radio stream

I am new to Python and not very familiar with advanced Python data structures. I have written a function to receive data from a socket in Python and perform string manipulations on it. The basic ...
1
vote
3answers
121 views

How should I read coordinates from a text file?

I have a text file with lines that look like this: Robot(479.30432416307934|98.90610653676828) Robot(186.42081184420528|213.11277688981409) Robot(86.80794277768825|412.1359734884495) or, more ...
3
votes
2answers
211 views

Custom parser for named parameters in prepared statement

I'm creating a small extension to the JDBC API, with the hope of automating some common tasks and avoid boilerplate code. One of its features will be a basic support for named parameters in prepared ...
2
votes
2answers
116 views

Pair Programming matrix: room for improvement?

At work, we have a "pair programming ladder" where you can keep track of who is pairing with whom (based on check-ins). The idea is to promote "promiscuous pairing" where each developer eventually ...
4
votes
1answer
80 views

Char* hex string to BYTE Array

The idea is that i want any size string to put the corresponding hex value into a byte array. I've seen a million ways to do it. Some of them didn't look to clean. My needs are speed over memory, so ...
2
votes
2answers
87 views

String parser review

So the task is that a string being passed to one of my methods looks like this <DIV><GKY><UID><END> it is generated this way from another program, so it will always have that ...
1
vote
2answers
102 views

RGB Color Name Matching using Euclidean Distance (Improved)

The code below stems from work on a Euclidean Distance algorithm. The color table was simply a vehicle to test the algorithm. It is perhaps reinventing the wheel, however it is useful in itself. ...
-1
votes
1answer
65 views

Parsing large text area - difficulty extracting info - Javascript [closed]

I am writing a program that will deal with formatting the text in a text area. The user will use Ctrl + A, Ctrl + C to copy the entirety of a web page, then paste that text into a text area. The ...
0
votes
0answers
50 views

custom cmdline implementation

The below program takes the inputted string from commandline and parses it and calls the corresponding function. commands are either single word or multiple words. say for e.g. -#version ...
1
vote
0answers
25 views

DOMDocument field class Python

What do you think of this class? Is this simple to understand how it works and what it does? Do you think it is good piece of code? class Field(object): """Class which contains logic of ...
2
votes
1answer
204 views

PEG parser in Python

Any suggestions to make this code clearer, more Pythonic, or otherwise better? I'm open to changes to the design as well as the code (but probably won't drop features or error checking since ...
2
votes
0answers
55 views

Can this token finding function be improved

I want to make sure find_value_from_key is safe and efficient. My constraints are language C++, use of standard library ok but cannot use boost or any new C++11 features. Can anyone offer any ...
3
votes
1answer
210 views

Parsing Wikipedia data in Python

I'm new to python and would like some advice or guidance moving forward. I'm trying to parse wikipedia data into something uniform that I can put into a database. I've looked at wiki parsers but from ...
0
votes
0answers
128 views

Calculator parsing S-expressions

The following program is supposed to be a (command line) calculator that parses expression following syntax similar to Lisp's S-expressions. Some examples: $ echo "(+ 5 5)" | ./a.out ...
4
votes
1answer
84 views

Is my PHP script/embed remover robust?

The goal of this question: Your goal here is to find a security hole in my code which allows a user to create input that contains a script doing anything they want, without that script being stopped ...
5
votes
1answer
411 views

Handling parsing failure in Scala without exceptions

I have a Scala (Play!) application that must get and parse some data in JSON from an external service. I want to be able to gently handle failure in the response format, but it is becoming messy. What ...
0
votes
0answers
556 views

Splitting an address into fields in SQL

I have the following code to split an address string in T-SQL. Excepting the unit number, which is already in its own field, it would affect too much of the application to split the address into ...
3
votes
2answers
145 views

A simple compiler for a language called Jack

Below is the code for a compiler I created for a language called Jack. This compiler is one of the projects for the book "The Elements of Computing Systems" (http://www1.idc.ac.il/tecs/plan.html) ...
3
votes
1answer
189 views

JQuery Promise Interface for a (very) simple JSON Parser

I have written a parser function that returns a JQuery Promise. You can see from the code that this is the top level parser and it delegates out to two other more specific parsers. At the minute it ...
2
votes
3answers
147 views

Is this the right way to read every line?

I am never to sure when it comes to ifstream and reading lines. I am often confused with the good(), bad(), eof() and so on. Could anyone tell me if I am doing it right? int parseLine(std::ifstream ...
2
votes
2answers
122 views

Can you guys look at my java project and give me some tips?

So I feel like I'm a good coder, but that's from my point of view. Can you take a look at my code and give me some tips or criticize me on my code. Or give me some tips or things to add or make things ...
1
vote
0answers
275 views

NLTK language detection code in Python

I need to write some code that checks thousands of websites, either if they are in English or not. Bellow is the source code. Any improvements would be appreciated. import nltk import urllib2 import ...
1
vote
1answer
173 views

Rails feed parser to be improved

This is my feed parser method using feedzirra. It works but I feel dirty because I can't figure out how to better this code. Any suggestion? class Feed < ActiveRecord::Base attr_accessible ...
3
votes
2answers
316 views

Joining url path components intelligently

I'm a little frustrated with the state of url parsing in python, although I sympathize with the challenges. Today I just needed a tool to join path parts and normalize slashes without accidentally ...
1
vote
0answers
86 views

Javascript XML Parser rapper

I created an XML rapper to easily access XML data. Please tell me what do you think about it. Performance Scalability Anything else... This is how you use it: var xml = new Xml(dataString); ...
1
vote
1answer
248 views

Language parser in haskell

This is a recursive descent parser for simple language with following grammar: PROGRAM <- {STATEMENT ';'}* RETURN_STMT ';' STATEMENT <- NAME_BINDING | TYPE_DECLARATION TYPE_DECLARATION <- ...
4
votes
2answers
414 views

Parsing URL segments

The .htaccess file redirects all requests to this file and the $_REQUEST['path'] variable contains the url after the base url. $url = ''; $urlSegments = []; $resource = ''; $action = ''; $parameters ...
1
vote
2answers
112 views

Feedback on text parsing and control structures

I threw together this C program today to handle a bioinformatics data processing task. The program seems to work correctly, but I wanted to know if anyone has suggestions regarding how the input data ...
2
votes
1answer
739 views

Parse a text file in python

I would like to refactor a large python method I wrote to have better practices. I wrote a method that parses a design file from the FSL neuroimaging library. Design files are text files with settings ...
3
votes
2answers
186 views

QJson: Yet another Json parser and serializer for Qt, but with additional features

I wrote QJson, a utility class in/for Qt, I need you to take a look at. It is both a JSON parser and serializer, but with extended funcionality (going beyond the JSON specification) (see first ...
3
votes
1answer
204 views

DnD dice roll parser

Some time ago I've written a small parser (about 250 LoC) which is capable of executing the four arithmetic operators +-*/ as well as a dice-roll operator, NdM, which "rolls a dice", DnD style. The ...
3
votes
1answer
198 views

Unicode parsing in PHP

Firstly, apologies if this is not the correct type of question for here, I had it on the stackoverflow but it was closed with a suggestion I post here. I’m in the process of converting from Latin 15 ...
2
votes
3answers
924 views

Parse an XML file using objects / methods

So I spent a while this morning creating an xml parser in java which is part of a job interview. I would love to have some people tear it apart so I can learn from any mistakes that I made so I can ...
1
vote
2answers
398 views

Help fix up my Python XML Schema parsing code

I've been working on a lightweight xml schema parser, and have what I think is a moderately clean solution (some parts helped out by previous questions I posted here) so far for obtaining all schema ...
1
vote
1answer
220 views

Review my prolog code for bibtex reader

I am trying to learn Prolog, and wrote a bibtex reader using gnu prolog. I would like some feed back on my code in terms of: the way I write Prolog, and how it can be improved. I am new here, and ...
1
vote
2answers
308 views

Messy c# code - can be improved? String Parsing

For various reasons, I'm parsing a string, this code will explain what I'm after: string baseString = "This is a \"Very Long Test\""; string[] strings = baseString.Split(' '); ...
-1
votes
1answer
509 views

CSV parsing in Perl

I am looking for a Perl (5.8.8) script for CSV parsing that would follow CVS standards. (See Wikipedia or RFC-4180 for details) Sure, code should be fast enough, but more important is that it should ...
2
votes
1answer
2k views

Query String Serializer

I have a ASP.NET Web Forms project, and I want to build calls to .aspx pages in a strongly-typed fashion. I ended up rolling my own serializer that takes simple structs and saves them to/loads them ...
3
votes
1answer
72 views

C# expression evaluator review request

I successfully created an expression evaluator in C#, and I would like to know if it works well, and what I can do to improve it. class ExpressionEvaluator2 { public enum Token { ...
1
vote
1answer
4k views

Android: Optimize JSON insertion to SQLite (insert … on duplicate key ignore)

In current task, I'm refactoring the code of converting JSON file into SQLite database on Android device. Code compliant with Java 6. As od benchmark, grabbing the code from remote server takes ~1 ...
0
votes
1answer
203 views

C-Style unsigned char parsing and manipulation in C/C++ - Proper algorithm correction and segmentation fault

Note that I'm using a C++ compiler ( hence, the cast on the calloc function calls) to do this, but the code is essentially C. Basically, I have a typedef to an unsigned char known as viByte, which ...

1 2