whitespace

How automatically remove all white spaces start or end in a string

How automatically remove all white space start or end in a string like: "hello" return "hello" "hello " return "hello" " hello " return "hello" " hello world " return "hello world" regards ...

Can't find whitespace display setting in VS 2010

I am looking for a setting in Visual Studio 2010 (It was in 08 I'm sure it's in 10) Basically it makes it easy to see the indentation/spacing of code because in the white space it buts spaced fullstops (which are obviously a different color) and it makes it really easy to see the indentation of your code. But I can't find the setting n...

Groovy map - keys with space

I have a map in groovy that looks like the following... def book = [Title of Book: "Groovy Recipes", Author: "Scott Davis", Number of Pages: "241"] I add my each 'book' into a BookList and would like to be able to get each value later on but when I try something like... BookList.Title of Book[0] //prints something like Title[0] inste...

Cleaning 'messy' markup rendered by ASP.NET

Ive noticed when looking at the source of a page generated in ASP.NET, the actual markup is very messy - sort of a half-assed tabbed affair with bundles of whitespace thrown in (see pic). Can anyone suggest a technique to remove/strip this whitespace? ...

Regular Expression to match relative URLs - II

Continue with the previous question, http://stackoverflow.com/questions/3447131/regular-expression-to-match-relative-urls we are facing a slight problem with space in the relative Urls. Lets say, we have two scenarios: /abc/part%20Red/ /abc/part Red/ First relative URl is retrived but second relative URL returned /abc/part instea...

Check if textarea has any characters (and ignore whitespaces) before submitting

I have a simple check ( .val() == "" ) with jQuery if textarea is empty or not before submitting.. it works, but it counts whitespaces. How can I ignore white spaces in this check? // Post guestbook; Check on frontend before submitting function postGuestbook() { if ($('.post-form textarea').val() == "") { $('div.mess...

eregi include extra characters into the allowed list.

/* Check if username is not valid */ else if(!eregi("/[^a-z0-9\s\' ']/i", $subuser)){ $form->setError($field, "* Username not valid"); } How to I allow for spaces to be allowed in the eregi line?? On a sidenote... I was going to use: $input_name = preg_replace('/\s\s+/', ' ', $input_name) to strip excess white spa...

Benefits of stripping trailing white spaces?

I got into the habit of removing trailing white spaces from my source file. In fact, I have my editor to do this automatically. I got in this habit by using git; it created a habit that I adhere to. My question relates to the fact that I cannot justify this behaviour. I can understand that in some fields, such as web designers, it may ...

Python and C++ integration. Python prints string as multiple lines.

I'm trying to write a program in python to run a program in C++. It wasn't working right, so I made the most basic version of each I could. The C++ program merely takes in a string from stdin, and then prints it out. The Python code is written as follows: import popen2, string, StringIO fin, fout = popen2.popen2("PyTest") msg = ur"Hel...

Remove non breaking space ( ) from between elements using jquery

How can I use jquery to remove non-breaking spaces (nbsp) which appear between html elements? So, for example, the following code is generated by a cms: <div><span>content</span>&nbsp;<span>content</span></div> I am able to target the elements using slectors. The following page suggests an answer to remove normal whitespace, but no...

Git add only non-whitespace changes

I have my text editor to automatically trim trailing whitespace upon saving a file, and I am contributing to an OpenSource project that has severe problems with trailing whitespace. Every time I try to submit a patch I must first ignore all whitespace-only changes by hand, to choose only the relevant information. Not only that, but when...

"Submit Application to iTunes Connect..." Xcode feature with filename that contain whitespace

Xcode has a nice feature that let you submit your application to iTunes connect without launching Application Loader. The problem appears when you have a whitespace in the application name. I understand the problem, but since Xcode is naming the file automatically, how can I use this feature without changing the name of my app? Than...

Why Firefox wont transfer %20 to space (' ')?

I am sending to the browser a request to save a file with the file name. The file name might include spaces, so i replace all spaces with %20. Internet Explorer and Chrome transfers %20 back to spaces, but Firefox does not to that. why? Is there a way make all browsers show the space? This is my code: String codedName = new String(URLE...

HTML/CSS - Why does float:left render as 'invisible'?

If you have two divs contained within a div: <div style="border:1px;"> <div style="float:left;background-color:red;width:20px;height:20px;"> <div style="float:left;background-color:red;width:20px;height:20px;"> </div> The two inner divs are rendered as 'invisible', as in the container div doesn't stretch to allow them to fill,...

Reporting Services 2008 Chart DynamicHeight Property Creates Extra Space

I have a bar chart with horizontal bars. I used this article to setup the dynamic height property: http://blogs.msdn.com/b/robertbruckner/archive/2008/10/27/charts-with-dynamic-size-based-on-categories-or-data.aspx Everything looks fine in the viewer, but as soon as you go to print layout, pdf, et.al there is about 50% more blank space...

Regular Expressions: low-caps, dots, zero spaces

hi, how do I write an expression which checks for lowcaps, dots, and without any white space in the string? the code below so far was trying to check for lowcaps and dots (it does not work anyway!) but I don't know how to add in the expression for white spaces. # check for matches of lowcaps or lowcaps with a dot if (!preg_match('/([a...

Prevent emacs from mixing tabs and spaces?

Background: I'm primarily a Javascript developer. Espresso mode rocks. I work on a team where other people touch my code (and I theirs). Different folks have different preferences for tab width. I like mine at four, a coworker likes his at two. JSLint complains if you mix tabs and spaces (yes, I realize you can turn it off - but it he...

Whitespace aware C

Possible Duplicate: Tool for braceless, whitespace sensitive C syntax It recently occurred to me, after returning to C after several years of C++ and Python, that the use of curly braces is both ugly and contentious in a language for which I have great admiration. In particular, the use of K&R style leads to "hurried" statemen...

CakePHP - Image cannot be displayed because it contains errors

While serving images through CakePHP, I'm getting The image "http://DOMAIN/PLUGIN/images/image.png" cannot be displayed, because it contains errors. There is a bug report already existing, http://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/864 As mentioned in the above bug report, whitespace is the culprit here....

xml:space="preserve" in Word 2003 XML document

I'm using XSLT templates to generate word documents in XML format. The problem I'm having is with whitespaces (specifically - tabs). This is an example of a tab inside a paragraph in xml doc: <w:p> <w:r xml:space="preserve"> <w:tab /> <w:t>This is some text after tab</w:t> </w:r> </w:p> I added xml:space="preserve" to save the white...