Skip to main content

All Questions

Tagged with
0 votes
1 answer
2k views

Parsing messages with fixed-width fields into Employee objects

I'm writing a application that reads from a queue of messages from a legacy mainframe system. Some characteristics of message in the queue: Message from the Q is always fixed length plain text : 64 ...
edwin's user avatar
  • 121
2 votes
4 answers
900 views

Split a string into a list of tokens

I have the following assignment that I succeeded in solving, but the code is very inefficient. I would appreciate if someone could show me a more efficient way, perhaps with substring. Note that I am ...
Yuki1112's user avatar
  • 135
2 votes
2 answers
393 views

Finding an arbitrary word in a string of words given an offset

Background Given a string (s) and an offset into that string (offset), find the whole word that can be found at the given ...
Dave Jarvis's user avatar
  • 1,907
2 votes
1 answer
198 views

Efficiently calculating differences between file using diff file

I'm using SVNKit to get diff information between two revisions. I'm using the diff utility to generate a diff file, however I still need to parse it into numbers. I implemented a solution, but it is ...
Himself12794's user avatar
2 votes
1 answer
150 views

Optimizing Java HTML parser

I wrote a program that goes through a webpage and returns matches of regex. I used it on my letterboxd.com account to go through all of my movies (over 900 entries) and then find genres field for each ...
mlukas's user avatar
  • 21
5 votes
4 answers
8k views

Data type detection for a CSV file parser

I am building a CSV file parser, and in order to get the appropriate Object to represent different data types found on the parsed files, I wrote the following function: ...
carlossierra's user avatar
3 votes
1 answer
92 views

Parsing speech out of text

I'm working on an experiment to parse speech out of an emote in a text roleplaying game (MUD) so that if you can't hear it correctly, or if it's in a different language, you won't understand it. This ...
BrainFRZ's user avatar
  • 841
5 votes
3 answers
4k views

Base converting with strings from bases 1 to 36 to bases 1 to 36

I'm writing a fastest-code challenge over at PPCG relating to base conversion of bases 1 to 36, and as a part of the process for writing the competition, I decided to write my own program for it. This ...
Addison Crump's user avatar
-1 votes
1 answer
73 views

Parsing an uploaded file, returning record of 10 fields for each line [closed]

I have a program that reads a .txt file from a given directory. Each record line contains a data and I am parsing it. I think this is costly with it comes to performance but I might be wrong. Here is ...
Ti J's user avatar
  • 9
4 votes
3 answers
169 views

Extracting a database name from a file

I am developing a project that converts SQL server file to MySQL file based on some assumptions. I have written a function that takes the string source as input and it extracts the database name. Is ...
lostForAWHile's user avatar
1 vote
2 answers
70 views

Function that check's file type based on certain keywords

I have a function that breaks up a source file and checks each token against a keyword list to determine whether its a particular file type. How can I improve this function? ...
lostForAWHile's user avatar
4 votes
3 answers
446 views

Parsing huge data coming from a URL

I need to parse the data coming from the URL which looks like this: ...
david's user avatar
  • 1,997
3 votes
1 answer
766 views

Parsing /proc/net/sockstat

I have this very simple code which is used to parse values: ...
Peter Penzov's user avatar
1 vote
1 answer
95 views

Refactoring conditions in text parsing method

I am writing a generic text parser and have come up with the following text parsing algorithm, which works fine. I'm wondering how to refactor the following method to make it easily understandable and ...
EvilInside's user avatar
4 votes
1 answer
179 views

Simple attribute parser for HTML

I am studying Java and trying to write an HTML parser, which should parse tag names and attributes. I wrote a class (code below) using the State pattern. This is necessary for my training project, ...
Weres's user avatar
  • 43

15 30 50 per page