Questions tagged [spaces]

The space character, `U+0020`, used to separate words/tokens in most natural and programming languages.

The space character, U+0020, used to separate words/tokens in most natural and programming languages. Space is a whitespace character.

Spaces are frequently of concern to programmers in the context of languages with significant whitespace (e.g. Python), source code indentation, and separating tokens. Separating tokens correctly is important for shell scripts, URIs, file names/paths, text processing, and string formatting. Questions regarding all of these areas are common on Stack Overflow, as spaces appearing unexpectedly can cause unexpected behavior whose source is not immediately obvious.

"Spaces" may also refer to the virtual desktop functionality of Mac OS X, first referred to as "Spaces" in OS X 10.5.

1024 questions
4
votes
1 answer

How do I get the number of Spaces in OSX?

I want the number of Spaces in OSX snow leopard. If I use 4 spaces, I want that number 4! I can't find a function or a class related with that.
Hwansoo Kim
  • 286
  • 2
  • 11
4
votes
2 answers

sed replace group of files string

I am trying to replace a string in multiple lines. It is late and I'm getting restless, maybe someone would prefer to give it a shot for some SO points. The string I'm replacing is 'STORED AS TEXTFILE' from the SQL below... PARTITIONED BY(load…
uh_big_mike_boi
  • 3,350
  • 4
  • 33
  • 64
4
votes
2 answers

Stop ConfigParser adding spaces to delims after upgrade from python 2.7.3 to 2.7.9

After being forced to use a later version of python, ConfigParser now insists on adding spaces to each side of any delims when modifying a configuration file. e.g. setting=90 becomes: setting = 90 This was not the behavior in the earlier version,…
4
votes
3 answers

LaTeX - vertical space equivalent of \makebox?

I'm making a LaTeX document and I'm getting success with \makebox, which puts text in an invisible box and will add extra horizontal whitespace to the end to make the whole thing fit within the size you specify. Is there something like that for…
Amandasaurus
  • 58,203
  • 71
  • 188
  • 248
4
votes
3 answers

How to edit .vimrc file to replace tab with spaces?

I am writing a Python script which writes some formatted data into a YAML file. I am using tabs for formatting the text, but I want the tabs to be converted into spaces when written into the YAML file. This is because my YAML file does not take tabs…
user189942
  • 351
  • 1
  • 3
  • 12
4
votes
2 answers

How to correctly calculate address spaces?

Below is an example of a question given on my last test in a Computer Engineering course. Anyone mind explaining to me how to get the start/end addresses of each? I have listed the correct answers at the bottom... The MSP430F2410 device has an…
Nedlinin
  • 881
  • 2
  • 12
  • 21
4
votes
1 answer

How to stop UILabel from trimming the space at the end?

I have a UILabel acting like a ticker so every 0.09 seconds the text is being changed, but when a space comes at the end of the label it is being trimmed, so it is looking like the ticker is lagging. Here’s the code: [self setTickerLabel: [ [UILabel…
Eddy
  • 274
  • 3
  • 17
4
votes
4 answers

Enforce "spaces" or "tabs" only in python files?

In Python, is there a mean to enforce the use of spaces or tabs indentation with a per file basis ? Well, perhaps "enforce" is too strong, more like a "recommendation". I keep receiving patch files with mixed indentation and this is annoying... (to…
edomaur
  • 1,397
  • 4
  • 23
  • 38
4
votes
1 answer

Sublime Text is not converting tabs to spaces when indenting... why and how to fix it?

I have been using quite effectively Sublime text. I have one problem that stil bugs me. While I type JavaScript code the tabs not converted to spaces if tab is pressed additionally to the provided indentation level. The following screenshot may help…
fstab
  • 4,801
  • 8
  • 34
  • 66
4
votes
1 answer

PHP Trying To Count Spaces Between Paragraphs

I have been trying to make a PHP code that counts the lines of text stored in a .txt file in a way so as it counts the total lines and the total spaces between paragraph's then echoes out each value along with a (Total Lines-Total Spaces) value at…
h3kz
  • 65
  • 5
4
votes
2 answers

Cocoa Accessibility API and Spaces?

I'm facing a problem for an application I'm writing (http://code.google.com/p/blazingstars/issues/detail?id=25), where my program is a menulet (menu bar) application that uses the Accessibility API to interact with and control another program. I do…
Winawer
  • 671
  • 8
  • 26
4
votes
2 answers

Bash escaping spaces in filename, in variable

I'm quite new to Bash so this might be something trivial, but I'm just not getting it. I'm trying to escape the spaces inside filenames. Have a look. Note that this is a 'working example' - I get that interleaving files with blank pages might be…
Joost
  • 4,094
  • 3
  • 27
  • 58
4
votes
3 answers

LINQ puts unwanted trailing spaces on strings

I have a very annoying problem with LINQ and MS SQL Server. Im currently making some software in WPF C# and use LINQ to generate classes from the data in the database. However, when i update a nvarchar or varchar field in the DB from my program,…
Kaare Mai
  • 193
  • 2
  • 10
4
votes
3 answers

spaces/nulls inserted into redirected output of the cmd command

When I run the command wmic memorychip get capacity from the command line in the cmd window, the output on the screen looks like: Capacity 2147483648 However, if I add this command to a batch file and try to redirect the output to a file,…
user2296601
  • 41
  • 1
  • 2
4
votes
1 answer

How to make awk gsub return a tab-separated line?

I use awk gsub to replace a string in a specific column of my tab-separated file: cat test.txt 1 1 2032 1 2 1 2032 2 3 1 999 3 4 1 2032 4 5 1 9999 5 However, the modified line is separated by spaces, even if -F "\t"…
Sébastien Clément
  • 570
  • 1
  • 9
  • 19