spaces

setting tabwidth to 4 in git show / git diff

只愿长相守 提交于 2019-11-28 03:38:51
At work we are several developers and don't have a code style guide, and some developers indent with tabs, and some others with 4 spaces (luckily noone of the indent with spaces people uses different than 4 spaces). In general this is no (big) problem because in our editors we set tabwidth=4 and all the indentation seems correct. But in git diff or git show that's what appears: diff --git a/mesclatabs.php b/mesclatabs.php new file mode 100644 index 0000000..1986c91 --- /dev/null +++ b/mesclatabs.php @@ -0,0 +1,5 @@ +<?php +function foo() { + echo "line with 1 tab\n"; + echo "line with 4 spaces

How do you recursively unzip archives in a directory and its subdirectories from the Unix command-line?

坚强是说给别人听的谎言 提交于 2019-11-28 03:11:28
The unzip command doesn't have an option for recursively unzipping archives. If I have the following directory structure and archives: /Mother/Loving.zip /Scurvy/Sea Dogs.zip /Scurvy/Cures/Limes.zip And I want to unzip all of the archives into directories with the same name as each archive: /Mother/Loving/1.txt /Mother/Loving.zip /Scurvy/Sea Dogs/2.txt /Scurvy/Sea Dogs.zip /Scurvy/Cures/Limes/3.txt /Scurvy/Cures/Limes.zip What command or commands would I issue? It's important that this doesn't choke on filenames that have spaces in them. Vivek Thomas If you want to extract the files to the

OSX Lion AppleScript : How to get current space # from mission control?

我只是一个虾纸丫 提交于 2019-11-28 03:04:25
I'm trying to figure out how to get the current space # from mission control. Source would be helpful, but more helpful would be info on how to figure this out myself. I've written a few applescripts, but more often than not it seems like any time I need to do something new (that I can't find dictionary documentation for) it falls under the category of "tell this specific app (e.g. "System Events") this very specific thing" and I've no clue how I would actually figure that out. Specifically what I am trying to do: I hate the new mission control in OSX 10.7. I want my spaces "grid" back since I

Show SOME invisible/whitespace characters in Eclipse

寵の児 提交于 2019-11-28 03:02:47
A long while back I transitioned to doing all my web application development in Eclipse from BBEdit. But I miss one little feature from BBEdit. I used to be able to show invisible characters like tabs but not show other invisibles like spaces. I know that I can bulk turn all of these on in Eclipse, but I wonder if there is a way to show only some invisibles in Eclipse. Aaron Digulla Unfortunately, you can only turn on all invisible (whitespace) characters at the same time. I suggest you file an enhancement request but I doubt they will pick it up. The text component in Eclipse is very

Echo tab characters in bash script

半城伤御伤魂 提交于 2019-11-28 02:46:35
How do I echo one or more tab characters using a bash script? When I run this code res=' 'x # res = "\t\tx" echo '['$res']' # expect [\t\tx] I get this res=[ x] # that is [<space>x] Johannes Weiss echo -e ' \t ' will echo 'space tab space newline' ( -e means 'enable interpretation of backslash escapes'): $ echo -e ' \t ' | hexdump -C 00000000 20 09 20 0a | . .| Use printf , not echo . There are multiple different versions of the echo command. There's /bin/echo (which may or may not be the GNU Coreutils version, depending on the system), and the echo command is built into most shells. Different

Java String trim has no effect

隐身守侯 提交于 2019-11-28 02:35:11
问题 Java String trim is not removing a whitespace character for me. String rank = (some method); System.out.println("(" + rank + ")"); The output is (1 ) . Notice the space to the right of the 1. I have to remove the trailing space from the string rank but neither rank.trim() nor rank.replace(" ","") removes it. The string rank just remains the same either way. Edit: Full Code: : Document doc = Jsoup.connect("http://www.4icu.org/ca/").timeout(1000000).get(); Element table = doc.select("table")

Selecting a database in mysql with spaces in its name

南楼画角 提交于 2019-11-27 23:54:50
I want to select my particular database in mysql console, but the problem is that my database name has a space in between and mysql ignores the part after the space. For instance, when i give the command: use 'student registration' I get the message: cannot find database 'student' You should try using back ticks ("`") to quote your database name. Generally speaking, it's probably better to use a naming convention to eliminate white space, e.g. USE `StudentRegistration`; or USE `student_registration`; You have two options. 1 Enclose the database name in backticks or single quotes. USE `student

Why does the cmd.exe shell on Windows fail with paths using a forward-slash ('/'') path separator?

天涯浪子 提交于 2019-11-27 22:12:38
Just when I'd thought I'd seen it all with Windows path issues, I've now encountered a case that only fails when '/' (forward-slash) is used as the path separator is used: C:\temp\tcbugs>mkdir "dir1 with spaces" C:\temp\tcbugs>echo hi > "dir1 with spaces"\foo.txt C:\temp\tcbugs>type "dir1 with spaces\foo.txt" hi C:\temp\tcbugs>type "dir1 with spaces/foo.txt" The system cannot find the file specified. What is particularly interesting about this is that it appears to be specific to the cmd.exe shell and doesn't occur in PowerShell (nor presumably in the win32 API): PS C:\temp\tcbugs> type 'dir1

Javascript to remove spaces from a textbox value

梦想与她 提交于 2019-11-27 18:35:44
问题 I've searched around for this a lot and can't find a specific example of what I'm trying to do. Basically I want to get the value of a textbox, by the name of the text box (not id). Then I want to remove ALL spaces, not just leading or trailing, but spaces in the text too. For example for this html code: <INPUT style="TEXT-ALIGN: right;" onkeyup="fieldEdit();" onchange="fieldChange();" NAME="10010input" VALUE="4 376,73" readonly > I have this javascript: var val = document.CashSheet.elements[

Converting a sentence string to a string array of words in Java

让人想犯罪 __ 提交于 2019-11-27 17:59:28
I need my Java program to take a string like: "This is a sample sentence." and turn it into a string array like: {"this","is","a","sample","sentence"} No periods, or punctuation (preferably). By the way, the string input is always one sentence. Is there an easy way to do this that I'm not seeing? Or do we really have to search for spaces a lot and create new strings from the areas between the spaces (which are words)? Adam Batkin String.split() will do most of what you want. You may then need to loop over the words to pull out any punctuation. For example: String s = "This is a sample sentence