Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
2 answers
234 views

Parsing words from string

I am learning Java, so I am beginner. I know I can do this with split function but I want to improve my algorithm knowledge. I will be glad if you help me. Thanks. inputStr variable is contains the ...
Mestedepsu's user avatar
2 votes
1 answer
301 views

Reading bytes between two quotes from a stream and decoding it to its appropriate character set [closed]

This is a component for a lexer which operates on a byte input stream that handles reading and decoding the contents of a string contained within double-quotes. The validity of the encoding is handled ...
Zhro's user avatar
  • 239
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
911 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
4 votes
2 answers
11k views

Parsing a string with named sections and a key-value pair on each line

I have a response String as shown below which I need to parse it and store it my class. Format is shown below: task name followed by this dotted line ------------- ...
user1950349's user avatar
1 vote
2 answers
74 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
468 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
5 votes
1 answer
385 views

Create Java object from from page content or plain text

My job is to make a specified java objects from web page that contains following text: Companies: ...
dagi12's user avatar
  • 277
4 votes
1 answer
4k views

Boolean expressions from infix to postfix notation using Dijkstra's Shunting Yard algorithm

I began working on a Java library that receives a boolean expression such as not A and (B or not C), compiles it to a circuit of logical gates \$\mathcal{C}\$, ...
coderodde's user avatar
  • 31k
8 votes
1 answer
918 views

A little integer parser vs clean code

I was said to post this as a new question. I improved my code from: Little part of the string to integer parser vs Clean Code However I think that it break SRP as it parses, iterates through string ...
hejcz's user avatar
  • 123
4 votes
3 answers
280 views

Little part of the string to integer parser vs Clean Code

I started reading a Clean Code book and some other articles on the Internet about OOD and design patterns and I'm a little confused. I've started to code a little string to integer parser which ...
hejcz's user avatar
  • 123
4 votes
3 answers
3k views

Parsing a single CSV line into a list of strings

I've written this method to replace an older method that was much simpler, but used the regex split method and couldn't tell if a comma was in quotes/brackets/etc. and didn't read double quotes as ...
Hanii Puppy's user avatar
7 votes
2 answers
1k views

Identifying which paragraph, if any, is a superset of all words in a document

Description need to find out the paragraph number which is containing all the words in the file. input file java.txt What is a JVM? What is the most ...
Venkat Kondeti's user avatar
4 votes
1 answer
153 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: ...
user1071840's user avatar
5 votes
3 answers
26k views

Printing every digit of a number

Which of these three methods is better? ...
ERJAN's user avatar
  • 897

15 30 50 per page