Parse invalid XML C#

Here is the invalid xml response I need to parse with C#, I'm trying to create a class for the responses and have had little success. <Response service=\"RouteService\"> <Head>OK</Head> <Body> <RouteResponse mailno=\"...
more »

2017-04-12 02:04 (1) Answers

Parsing a "simple" grammar

Sorry in advance; I am sure this question will seem almost idiotic to people who are used to playing with parsers and grammars, but these are foreign topics to me, and this is my attempt at stepping gently into a practical case requiring them. I wou...
more »

2017-04-11 17:04 (1) Answers

Json find in array

I have this json: { "response":{ "name":"Demo Shop", "items":[ { "id":3, "name":"first", "cost":10, "description":"First description" }, { "id":2, ...
more »

2017-04-05 12:04 (3) Answers

Integer.parseInt throws NullPointerException

I'm trying to make a Minecraft plugin, in which I'm trying to parse the following: count[1] What I'm doing is I'm splitting the this in half by the character \[. Then, I'm taking the second element, element 1, of the resultant array and removing t...
more »

2017-04-01 23:04 (0) Answers

Read and Split(Parse) data in java

I am trying to split some simple data from a .txt file. I have found some useful structures on the internet but it was not enough to split the data the way I wanted. I get a string like this: {X:0.8940594 Y:0.6853521 Z:1.470214} And I want to tr...
more »

2017-03-29 11:03 (5) Answers

Java/Kotlin JSON parsing improvement

I consume an API which gives me this type of JSON: { "data": { "name": "Start", "pid": "1", "position": { "data": { "x": "31", "y": "330" }, "metadata": "empty" } }, "metadata": "empty" } I h...
more »

2017-03-21 15:03 (0) Answers

How to parse a .txt file into .xml?

This is my txt file: In File Name: C:\Users\naqushab\desktop\files\File 1.m1 Out File Name: C:\Users\naqushab\desktop\files\Output\File 1.m2 In File Size: Low: 22636 High: 0 Total Process time: 1.859000 Out File Size: Low: 77619 Hi...
more »

2017-03-16 14:03 (2) Answers

Splitting Strings within an Array

I am writing a program in python that reads in a text file and executes any python commands within it. The commands may be out of order, but each command has a letter ID such as {% (c) print x %} I've been able to sort all the commands with in the d...
more »

2017-03-15 04:03 (5) Answers

Dart: Get enum from String?

Hi there I have the following class in the Google Maps dart library and want to parse a Google Style JSONs into Dart object oriented format. Within the lib (can NOT be changed!) I have the following Enum: part of google_maps.src; @jsEnum class Map...
more »

2017-03-10 18:03 (2) Answers

PowerShell XML Output

I'm having trouble getting the desired results in the correct format with this PowerShell query when run against an XML file exported from Task Scheduler. I will eventually have this run against all Task Scheduler exported jobs dumped to the same one...
more »

2017-03-10 05:03 (2) Answers

Counting the number of "0" in this factor

Consider the following factor x = factor(c("1|1","1|0","1|1","1|1","0|0","1|1","0|1")) I would like to count the number of occurrences of the character "0" in this factor. The only solution I've found so far is sum(grepl("0",strsplit(paste(sapply...
more »

2017-03-02 02:03 (2) Answers

std::setfill and std::setw for input streams?

Consider this code: int xx; std::cin >> std::setfill('0') >> std::setw(4) >> xx; When sending 12 to the standard input I am expecting the value of xx to be 1200 and when sending 12345 I am expecting it to be 1234. However, it se...
more »

2017-03-01 12:03 (2) Answers

Warning parser/current is loading parser/ruby22

I'm newbie in Ruby, while excecuting a command I got this error. warning: parser/current is loading parser/ruby22, which recognizes warning: 2.2-compliant syntax, but you are running 2.3.1. My Ruby version is 2.3.1 My parser version is 2.4.0.0. I...
more »

2017-02-27 10:02 (0) Answers

Issue With @JsonProperty on Method

I currently have my POJO class as such for deserializing a json source. public class OpenBuilding extends Building { @JsonProperty("BuildingPostCode") @Override public String getPostcode() { return super.getPostcode(); } } ...
more »

2017-02-24 11:02 (1) Answers

Why is there no inverse to object.ToString()?

It seems like a good design decision that the System.Object class, and hence all classes, in .NET provide a ToString() method which, unsurprisingly, returns a string representation of the object. Additionally in C# this method is implemented for nati...
more »

2017-02-22 16:02 (2) Answers

Python Morse Code: S.O.S

I am having trouble finishing this code. My original plan was to accept a long string as input , for example '... ---.. -. -.. .... . .-.. .--.' and then be able to use morse_code = [code_input.split(' ')] to separate them and run them individually b...
more »

2017-02-21 05:02 (2) Answers

PHP html simple dom parser returns null

I'm trying to parse some table data, but that table doesn't have class or fixed number so i'm trying to catch it by using the next_sibling() method. But if I find a standard table it returns null. Did I make a mistake in my code? <table class="p...
more »

2017-02-20 10:02 (1) Answers

Tokenizing a string in Ruby?

I need to tokenize a string based on a few rules in Ruby. Basically, I need to group the file into sections that fit either a variable name, keyword, integer, or operation. So, for example, the file: x:=5;if x > 5 then x:=3; else x:=6; end wo...
more »

2017-02-19 21:02 (1) Answers

read multiline strings with ruby, broken by "\"

in some RPM spec files (for instance), there are multiline strings which look like: %build export CFLAGS="%{optflags} -fomit-frame-pointer \ -W -Wall -Wno-unused-parameter -Wstrict-prototypes -Wpointer-arith -fPIE" export LDFLAGS="-pie" %configure -...
more »

2017-02-19 17:02 (2) Answers

Error in formula to neuralnet

This is actually a copy of a perfectly useful question whose answer was (partially) arrived at by the questioner. Original title: "Formulas with more than 512 characters for neuralnet model in R for text analysis". He eventually fixed the problem alt...
more »

2017-02-15 01:02 (2) Answers

PHP to Parse a HTML page and output a certain div

So I've been trying to embed a part of a website within my website due to security reasons I cannot disclose the website that I am trying to embed so for the purpose of this example I am going to use bbc.co.uk. The following is the php/html code: ...
more »

2017-02-12 18:02 (1) Answers

Find declared function from user input

I have a prompt in my "app", like irb that takes an input,I want it to parse the input and execute a function that I've defined. Similarly, my app takes an input through gets, and calls the function. For example, command = gets.gsub("\n","") take...
more »

2017-02-10 16:02 (1) Answers