JSON object parse issue on react

json = "{ elements: [ {type: 'radiogroup', choices: ['Yes','No','Maybe','Never'], isRequired: true, name: 'Test_01', title: 'Do you like ice cream?' }],showQuestionNumbers: 'off'}"; json = JSON.stringify(json); model = new Model(json); it d...
more »

2017-07-06 19:07 (2) Answers

reading string twice? What's the prob? C

In my code I have a menu with 4 options : 1-> am trying to read 2 strings, and then 2-> count the 'e'-s in them, 3-> quit the program, or 4-> print the two strings. int add(char *str1, char *str2){ int res=0; int index=0; for(index=...
more »

2017-06-30 21:06 (2) Answers

Remove Duplicates from String in Cell

So, I've been wrestling with this problem a while. Anytime CheckBox3 and CheckBox6 are both checked, it duplicates the "-", when I just need one. I've tried to use Len, as well as a array to go through the string to delete duplicates, but neither did...
more »

2017-06-30 17:06 (2) Answers

How to take off an URL from this string?

I got this string coming from an API: (I'm coding in javascript) "{\"profile\":{\"profile_image\":\"http://image.avatar.com/fichiers/2017/22/1496503336-avatar.png\",\"name\":\"ejeje\"}}" How can I get the image URL http://image.avatar.com/fichiers...
more »

2017-06-30 17:06 (0) Answers

php preg_replace escapes single and double quotes

I am doing some security research and I have a problem with the evalutation of preg_replace() in PHP. My goal is that I can execute commands with this function. I have control over the first and third parameter of the preg_replace function but not th...
more »

2017-06-23 13:06 (2) Answers

Python defining Function

I want to make a function that strips whitespace from a string, what I have so far is: def stripped(x): x = x.replace(' ', '') string = " yes Maybe So" I want to just strip the space by doing this string.stripped() but I keep getting ...
more »

2017-06-22 19:06 (4) Answers

convert an array of char into several String

I need to convert an array of char into several lines of a certain size. For example, considering this array : char[] bases = new char[]{'a', 'c', 'c', 't', 'a', 'c', 'a', 't', 'a', 'c', 'c', 't', 'a', 'c', 'a', 't'}; the expected output would be...
more »

2017-06-22 16:06 (5) Answers

Why malloc can't work with strcpy?

char * removeChar(char * str, char c){ int len = strlen(str); int i = 0; int j = 0; char * copy = malloc(sizeof(char) * (len + 1)); while(i < len){ if(str[i] != c){ copy[j] = str[i]; j++; ...
more »

2017-06-19 17:06 (4) Answers

Replace zeros to letter "o" inside words

After ocr recognition I have a lot of words where instead of o I have 0. So I want to replace any zeros inside words. Up till now I could do only the following String result ="I don't like th0se books"; result = result.replaceAll("\\w+0\\w*", "o");...
more »

2017-06-19 11:06 (6) Answers

how to make for/foreach loop between spans ?

I have website. I am getting data from website with WebRequest. After that, I need Tags in this website. but every page has a diffrent tag number. some pages have a 2 tags some pages have 3-4-5 etc. my question is how can I take these tags. these a...
more »

2017-06-19 11:06 (0) Answers

How to convert String into locale in java

I need to convert a given string into locale. String has value "fr_US" and I need to convert it into locale (in java.util.locale). I found one method in "org.apache.commons.lang.LocaleUtils" that does the conversion but I am looking for a method tha...
more »

2017-06-19 09:06 (2) Answers

Converting String to Date - Java

I have implemented the following method to convert a String to a Date because the Date(String) constructor is deprecated: private Date format(String inputString) { DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); ...
more »

2017-06-17 22:06 (3) Answers

Removing spaces from strings

I tried to write a function that gets a string and creates a new string but without multiple spaces (leaving only 1 space between words). So far I wrote this, but for some reason it crashs and the debugger shows nothing. I also don't know where do ...
more »

2017-06-17 15:06 (4) Answers