FAQ Database Discussion Community


ScalaXML and empty lines

xml,scala,whitespace,implicit-conversion,removing-whitespace
I'm just getting started in scala and have an issue with representing my domain object (case class) to a well-formatted XML. I have the following implicit converter: implicit def identifierToXml(ident : Identifier): Elem = <identifier> { if(ident.use != null) <use value={ident.use}/> } { if(ident.label != null) <label value={ident.label}/> } {...

Elasticsearch “pattern_replace”, replacing whitespaces while analyzing

elasticsearch,whitespace,tokenize,removing-whitespace
Basically I want to remove all whitespaces and tokenize the whole string as a single token. (I will use nGram on top of that later on.) This is my index settings: "settings": { "index": { "analysis": { "filter": { "whitespace_remove": { "type": "pattern_replace", "pattern": " ", "replacement": "" } },...

how to check starting/ending word in a long space delimited string

arrays,string,removing-whitespace
I have a string array i.e. string[] input_Text = new string[] { "i am wanting to take admission in the univeristy of the islamabad", "we are enjoying all the talent here at the city of atlanta", "what are you doing there" }; and a stopWords array i.e. string[] stopWords =...

Atom text editor remove trailing whitespace on save

save,whitespace,sublimetext3,removing-whitespace,atom-editor
I am switching from Sublime text to Atom text editor. I believe it is the right decision for me. However, something is bothering me. When I save any file in sublime text it does not include any trailing blank line. But saving any file in Atom text editor leaves a...

What is causing this white space at the bottom of my page in Chrome?

google-chrome,hosting,whitespace,removing-whitespace,shockwave
I've been working on my new website for many days (building it locally on my Macbook Air), and always testing it locally in the Chrome browser on my computer. When I view it locally, it looks perfect. However, when I upload it to my hosting account @ hostmonster.com, for some...

An image size and a div size doesn't match

removing-whitespace
(I am making a website by myself and it's the first time. I am adding this writing because my post is mostly code. ) I added an image on the right div 'about_Cell2', but I don't know where the about 1px space comes from.. Please help me.. * { padding:...

Python newspace persists

python,removing-whitespace
I'm trying to make a name generator: from random import randint relation = { 'A' : ['B', 'C', 'D', 'F', 'R', 'Y'], 'B' : ['E', 'O', 'I'], 'C' : ['A', 'E', 'H', 'R', 'O', 'I'], 'D' : ['A', 'E', 'H', 'R', 'O', 'I'], 'E' : ['R', 'T', 'P', 'S', 'F',...

sed (in bash) works with [ \t] but not with \s?

regex,osx,bash,sed,removing-whitespace
I want to search-replace something containing whitespace on a bash command line, and I assumed sed would be the easiest way to go. Using [ \t] denoting either tab or space, to match the whitespace, works as intended: echo "abc xyz" | sed "s/[ \t]xyz/123/" abc123 But using \s instead...

Simplified: White space on mobile when defining div min-width

html,css,mobile,width,removing-whitespace
Problem: White space appears at bottom of page on mobile Chrome. I gutted everything to isolate the problem. There's now a single div. Page takes up full viewport just fine, until I define a min-width for the div. I tried a css reset. Did not solve problem. Am I just...

Remove space from a filename

perl,whitespace,removing-whitespace
I am stuck at finding an answer to my question, so i made windows-cmd like program and one of my feature is to rename a file. Everything is fine if theres no whitespace in the old name / new name, but as long as theres a space it simply doesn't...