Questions tagged [multilinestring]

236 questions
6
votes
4 answers

Inline webgl shader code in javascript

I'm writing a simple Javascript library that makes use of some WebGL code. I'd like to include the shader sources inline in the .js file, because my alternatives are to include them as script tags in each page, or to have them as separate files…
Edward
  • 1,786
  • 1
  • 15
  • 33
5
votes
1 answer

Better way to hard-code JSON data as String in Java

I need to keep JSON data in my code for unit-tests as string. For instance, { "one": 1, "two": 2 } I know that I can read this data from file or from property, but I need to keep them as string. Currently, I have something like this: String…
Maxim Suslov
  • 4,335
  • 1
  • 35
  • 29
5
votes
3 answers

Return multiline string as part of REST api

I'm looking to return a multi-line string as part of a REST Get request. I have the following list: items = [1,2,3,4,5] I want to convert it into a string with the line breaks in between. So i did this: items = "\n".join(items) Here is the code…
kryogenic1
  • 166
  • 1
  • 2
  • 15
5
votes
3 answers

How to translate multiline string in Django models

I use ugettext_lazy as _ , and in a models file my string is represented in this way: s = _("firstline" "secondline" "thirdline") But after running makemessages I found that in the .po file only "firstline" is marked…
Julie B
  • 51
  • 1
  • 5
5
votes
1 answer

Python 3.5 splitlines for multiline string containing backslashes

How can I effectively split multiline string containing backslashes resulting in unwanted escape characters into separate lines? Here is an example input I'm dealing with: strInput = '''signalArr(0)="ASCB…
Tehuan
  • 71
  • 1
  • 6
5
votes
4 answers

Are multiline queries sql-injection safe?

This might be a stupid question. Or maybe my hacking skills are limited (I don't practice them at all). I have a query that looks like this:
acm
  • 6,541
  • 3
  • 39
  • 44
4
votes
3 answers

regexp and sed find block of string in multiline block untill it end with space

I try to capture those blocks of strings and comment on them using regexp and sed. each block separated with space some text here some text here AppServer1: name: ${AppServer1.name} ip: ${AppServer1.ip} some text here some text here…
user63898
  • 29,839
  • 85
  • 272
  • 514
4
votes
0 answers

Combining multiple linestrings to a valid polygon (Turf.js)

My main goal is to combine linestrings into a polygon. The problem is that concatenating the linestrings does not produce valid polygons. The used library Turf.js does not provide clear answer. Building the concave hull of the points also does not…
fhristov
  • 41
  • 3
4
votes
1 answer

How to marshal a multiline string to yaml value

I have a struct type Products struct { Name string Version string Description string } holding a multiline string constant as the value for Description field, the constant is as follows const DEFAULT_DESCRIPTION = `Please add…
Kasun Siyambalapitiya
  • 3,956
  • 8
  • 38
  • 58
4
votes
3 answers

Shortest path between many 2D points (travelling salesman within Shapely LineString?)

I was trying to create river cross-section profiles based on the point terrestical measurements. When trying to create a Shapely LineString from a Series of points with the common id, I realized that the order of given points really matters as the…
Marjan Moderc
  • 2,747
  • 23
  • 44
3
votes
1 answer

Why does a multiline string replacement with Python work with a hard coded string, but not when the string is read from a file?

I am trying to replace the contents of a string with a placeholder for later substitutions. When I execute my replacement against a string literal, the code works as expected, but if I read the same string from a file (literally the same string…
Nigel Ainscoe
  • 185
  • 1
  • 3
  • 14
3
votes
2 answers

Connect Linestrings

How can i connect two linestrings? It is possible to lay a very slim buffer around the lines and then connect them like so: one_line <- lines %>% st_buffer(0.05) %>% st_intersection() %>% st_union() %>% st_cast('LINESTRING') There are 2…
D.J
  • 1,180
  • 1
  • 8
  • 17
3
votes
6 answers

C# insert string in multiline string

I have a multiline string (from a txt-file using ReadAllText). the string looks like this: R;0035709310000026542510X0715;;; R;0035709310000045094410P1245;;; R;0035709310000026502910Z1153;;; I want to put in a ";" in each line on place 22, so it…
3
votes
2 answers

C# Multiline multi-double quote string

I need to make this text: { "method": "api.notifications.add", "params": { "name": "sequence.state.changed", "options": { "include_print_record": true, "include_layout": true } }, "id":…
3
votes
1 answer

Scala how to escape 3 double quotes

val s = """ """Shom """ gives :1: error: ';' expected but string literal found. val s = """ """Shom""" Tried to escape val s = """ ""\"Shom """ result is not as expected. s: String = " ""\"Shom"
Shom
  • 31
  • 1
1
2
3
15 16