Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
6 votes
2 answers
376 views

Operator associativity while writing tokenizer using regex match

I am trying to write a simple tokenizer for a basic arithmetic calculator. Here's the code: ...
user2338150's user avatar
10 votes
6 answers
1k views

Extract unique email addresses from a text file

I'm working on a Python script that reads a text file and extracts all the unique email addresses. The code works as intended, it produces the correct output, throws no errors, and I've tested it on ...
rao abdullah's user avatar
0 votes
1 answer
93 views

Parsing shortcodes out of a string

I wrote this shortcode parsing and it runs in \$O(N^2)\$. Is there a way to better optimize this? ...
ericraio's user avatar
  • 151
1 vote
2 answers
196 views

Parse list of UserPrincipal objects into custom class

I'm wondering how I could optimize this method that takes in a list of UserPrincipal objects, filters them by Regex and inserts the new class instance into a list. It takes 4 to 5 seconds for an input ...
mvi2110's user avatar
  • 11
2 votes
1 answer
332 views

Text splitter using Regular Expressions in Python

I have been provided a text splitter class that will take a text input and use re.sub to make replacements when matches are found and also splits sentences up and stores them in a list. I had an idea ...
JackWeir's user avatar
2 votes
2 answers
140 views

Regex and pandas to read forecast sky condition string

DataFrame methods to parse the sky condition from a terminal aerodrome forecast. A line in a taf can report zero-eight cloud layers. Cloud layers are required in predominate lines, and optional in ...
Jason Leaver's user avatar
1 vote
1 answer
138 views

using pandas and numpy to parse dirty .csv

I'm relatively new to Python have been writing for a few months now. I've started a Pandas Numpy project that starts with parsing large and somewhat sloppy formatted textfile, its not exactly csv but ...
Jason Leaver's user avatar
0 votes
2 answers
153 views

Parse file and make output in custom List [closed]

I have a file output like this and want to do parsing and put the output into a List. The biggest problem here is the name of a wake-lock which appears after ID and runtime, in some cases, it contains ...
Danijel Markov's user avatar
3 votes
1 answer
279 views

Parsing values from string into struct using match in Julia

My goal I am parsing from a string which contains token:value pairs into a type. Example: ...
Jessica Nowak's user avatar
5 votes
2 answers
208 views

Separating data from string representation of objects, with added extras

Given a string representation of data, I want to extract the information into its corresponding object. However, If the string has "|" separators then these should be considered options and ...
Lewis Morris's user avatar
7 votes
3 answers
289 views

parse date and number from API results

I'm slurping up fields from an API that returns an array of fields. Each field in the array is a String that actually contains two separate fields (a number and a date). The number is enclosed in ...
user2402616's user avatar
8 votes
1 answer
365 views

Parse data from Input file and print results

I have written a script which does parsing to the input file and take out some values from them with respect to the node and print the data accordingly. Below is my script, and it works as expected: <...
vkk05's user avatar
  • 183
11 votes
3 answers
4k views

Convert a string like 4h53m12s to a total number of seconds in JavaScript

At the moment I have this: ...
Dirk Boer's user avatar
  • 640
18 votes
5 answers
4k views

Speeding up thousands of string parses

I have a mapping application which takes string arguments in the form of string arrays. I parse these and then perform an action on the map. One of these is ...
pfinferno's user avatar
  • 447
5 votes
1 answer
81 views

Analyzing a web access log to obtaining totals for requests

This program takes the filename as the input and outputs to a file the number of requests that were more than 1000 bytes and the total bytes. Log file example: ...
Olive.b's user avatar
  • 53

15 30 50 per page
1
2 3 4 5 6