Search Results

Search found 540 results on 22 pages for 'whitespace'.

Page 7/22 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • include a .tex file with spaces in the filename

    - by NomeN
    I am including chapters in my latex file one by one by using the \include{} statement, up till now I've had no problem with that. But I've recently written a chapter which I've saved under a name including spaces...because you can. Now the include{} statement apparently doesn't like spaces, and prints just the filename in my document in stead of the chapter. It is probably a pretty easy fix (apart from removing the spaces in the filename, ;-) ), but I can't find it.

    Read the article

  • (Django) Trim whitespaces from charField

    - by zardon
    How do I strip whitespaces (trim) from the end of a charField in Django? Here is my Model, as you can see I've tried putting in clean methods but these never get run. I've also tried doing name.strip(), models.charField().strip() but these do not work either. Is there a way to force the charField to trim automatically for me? Thanks. class Employee(models.Model): """(Workers, Staff, etc)""" name = models.CharField(blank=True, null=True, max_length=100) # This never gets run def clean_variable(self): data = self.cleaned_data['variable'].strip() return data def __unicode__(self): return self.name class Meta: verbose_name_plural = 'Employees' # This never gets run either class EmployeesForm(forms.ModelForm): class Meta: model = Employee def clean_description(self): #if not self.cleaned_data['description'].strip(): # raise forms.ValidationError('Your error message here') self.cleaned_data['name'].strip()

    Read the article

  • Span with white-space style in IE (7) applied _past_ end of span

    - by WaldenL
    We've got an application where users can enter "notes" into a rich edit control (Telerik's RedEditor, but that doesn't matter here). We had a user enter notes from w/in Safari that had a <span></span> in the middle of the note, and that span had a style on it specifying white-space:pre The HTML of the note was in the form of: <div> This is a note <span class="Apple-tab-span" style="white-space: pre; "> </span> and here's more of the note. </div> Simple enough, the style should apply to the span, and the span had 4 spaces in it. There should have been 4 spaces in the resulting output. Here's the problem. IE seems to apply that white-space: pre; style not only to the span, but to the enclosing div! Therefore, this long line that should have wrapped since it's not in the span, now pushed the document out until the line fits on the page. What am I missing. I know IE has problems, but this doesn't seem right, even for IE. So, the question(s): 1) Am I correct that the white-space attribute should only have applied to the span? 2) Can this be resolved somehow? Remember, I'm not in control of the content being entered. And it's entered from a mac w/Safari and being viewed in IE. Edit: The doctype on the page in question is: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    Read the article

  • Gedit adds line at end of page

    - by Sam
    The answer to this must be somewhere but I'm not finding it -- can anyone help me understand why in Gedit, if I have a page of code there is no extra trailing blank line, but then when I do a file comparison for my svn commit it shows an extra line being added at the end of the file? I have a feeling that Gedit is automatically adding an ending line break. But why, I have no idea...

    Read the article

  • How to get rid of bogus changes in git?

    - by zaza
    I'm a happy user of PortableGit 1.7.0.2. Today I wanted to pull a project changes from GitHub.com repository, so I did git pull. It failed with the following message: error: Your local changes to 'main.rb' would be overwritten by merge. Aborting.. I didn't care about the local changes so I typed git reset --hard HEAD (git clean from here didn't help neither), but it didn't work. When asked for git status I was still able to see the file as modified. git diff showed me that each line of the file has been modified, while git diff -b showed no differences at all, so I guess this is a line ending issue. Which is strange because the code is only pushed from Windows machines. Anyway, the question is: how can I ignore the local, bogus changes and merge with the latest changes from the remote repository?

    Read the article

  • Rails: find_by, conserving leading whitespaces

    - by peppermonkey
    Hi, when I do the following def somefunction @texts = A.find_all_by_someid(someid) respond_to do |format| format.xml { render :xml => @texts } end end it gets the string from the db correctly, except if the string has leading whitespaces, it seems they are trimmed. Note: the whitespaces are there in the db correctly What can I do to conserve those whitespaces? Thanks

    Read the article

  • ASP.NET MVC returning ContentResult using Ajax form - how to preserve whitespace?

    - by Ben
    In my application users can enter commands that are executed on the server. The results are added to a session object. I then stuff the session object into ViewData and add it to a textarea. When done with a standard HTML form whitespace is preserved. However, when I swap this out for an ajax form (Ajax.BeginForm) and return the result as ContentResult, the whitespace is removed. Controller Action: [HttpPost] public ActionResult Execute(string submitButton, string command) { if (submitButton == "Clear") { this.CurrentConsole = string.Empty; } if (submitButton == "Execute" && !string.IsNullOrEmpty(command)) { var script = new PSScript() { Name = "Ad hoc script", CommandText = command }; this.CurrentConsole += _scriptService.ExecuteScript(script); } if (Request.IsAjaxRequest()) { return Content(this.CurrentConsole, "text/plain"); } return RedirectToAction("Index"); } View: <fieldset> <legend>Shell</legend> <%=Html.TextArea("console", ViewData["console"].ToString(), new {@class = "console", @readonly = "readonly"})%> <% using (Ajax.BeginForm("Execute", new AjaxOptions { UpdateTargetId = "console", OnBegin = "console_begin", OnComplete = "console_complete"})) { %> <input type="text" id="command" name="command" class="commandtext" /> <input type="submit" value="Execute" class="runbutton" name="submitButton" /> <input type="submit" value="Clear" class="runbutton" name="submitButton" /> <%} %> </fieldset> How can I ensure that whitespace is preserved? When I inspect the response in FireBug it looks like the whitespace is transmitted, so can only assume it has something to do with the way in which the javascript handles the response data.

    Read the article

  • django - where to clean extra whitespace from form field inputs?

    - by Westerley
    I've just discovered that Django doesn't automatically strip out extra whitespace from form field inputs, and I think I understand the rationale ('frameworks shouldn't be altering user input'). I think I know how to remove the excess whitespace using python's re: #data = re.sub('\A\s+|\s+\Z', '', data) data = data.strip() data = re.sub('\s+', ' ', data) The question is where should I do this? Presumably this should happen in one of the form's clean stages, but which one? Ideally, I would like to clean all my fields of extra whitespace. If it should be done in the clean_field() method, that would mean I would have to have a lot of clean_field() methods that basically do the same thing, which seems like a lot of repetition. If not the form's cleaning stages, then perhaps in the model that the form is based on? Thanks for your help! W.

    Read the article

  • Is there a way to know when fscanf reads a whitespace or a new line?

    - by user1493813
    I want to know if there is a way to know when fscanf reads a whitespace or a new line. Example: formatting asking words italic links returns As fscanf read a string till it meets a newline or a whitespace(using %s), it'll read formatting and the space after it and before a. The thing is, is there a way to know that it read a space? And after it entered the second line is there is a way to know that it read a carriage return?

    Read the article

  • how to remove extra whitespace or a paragraph tag generated by ckeditor?

    - by user66862
    I am using CK editor to post the content. When I just type a simple text manually, It just appears as it was.But the problem is when I copy the test from other websites like wikipedia, an empty paragraph is rendered in the beginning of the string, which is making my page look odd. I have tried using trim,and preg_replace. But I did not find any solution. Please suggest some method to overcome this issue.. Thanks

    Read the article

  • Treetop basic parsing and regular expression usage

    - by ucint
    I'm developing a script using the ruby Treetop library and having issues working with its syntax for regex's. First off, many regular expressions that work in other settings dont work the same in treetop. This is my grammar: (myline.treetop) grammar MyLine rule line string whitespace condition end rule string [\S]* end rule whitespace [\s]* end rule condition "new" / "old" / "used" end end This is my usage: (usage.rb) require 'rubygems' require 'treetop' require 'polyglot' require 'myline' parser = MyLineParser.new p parser.parse("randomstring new") This should find the word new for sure and it does! Now I wont to extend it so that it can find new if the input string becomes "randomstring anotherstring new yetanother andanother" and possibly have any number of strings followed by whitespace (tab included) before and after the regex for rule condition. In other words, if I pass it any sentence with the word "new" etc in it, it should be able to match it. So let's say I change my grammar to: rule line string whitespace condition whitespace string end Then, it should be able to find a match for: p parser.parse("randomstring new anotherstring") So, what do I have to do to allow the string whitespace to be repeated before and after condition? If I try to write this: rule line (string whitespace)* condition (whitespace string)* end , it goes in an infinite loop. If i replace the above () with [], it returns nil In general, regex's return a match when i use the above, but treetop regex's dont. Does anyone have any tips/points on how to go about this? Plus, since there isn't much documentation for treetop and the examples are either too trivial or too complex, is there anyone who knows a more thorough documentation/guide for treetop?

    Read the article

  • How can I split a string by whitespace unless inside of a single quoted string?

    - by Kivin
    I'm seeking a solution to splitting a string which contains text in the following format: "abcd efgh 'ijklm no pqrs' tuv" which will produce the following results: ['abcd', 'efgh', 'ijklm no pqrs', 'tuv'] In other words, it splits by whitespace unless inside of a single quoted string. I think it could be done with .NET regexps using "Lookaround" operators, particularly balancing operators. I'm not so sure about Perl.

    Read the article

  • What language has the longest "Hello world" program?

    - by Kip
    In most scripting languages, a "Hello world!" application is very short: print "Hello world" In C++, it is a little more complicated, requiring at least 46 non-whitespace characters: #include <cstdio> int main() { puts("Hello world"); } Java, at 75 non-whitespace characters, is even more verbose: class A { public static void main(String[] args) { System.out.print("Hello world"); } } Are there any languages that require even more non-whitespace characters than Java? Which language requires the most? Notes: I'm asking about the length of the shortest possible "hello world" application in a given language. A newline after "Hello world" is not required. I'm not counting whitespace, but I know there is some language that uses only whitespace characters. If you use that one you can count the whitespace characters.

    Read the article

  • No whitespace between a cast and a namespace operator?

    - by Pod
    Hello. Could anyone please explain the following line of code, found on http://docs.openttd.org/ai__cargo_8cpp_source.html return (AICargo::TownEffect)::CargoSpec::Get(cargo_type)->town_effect; If this line was: return (AICargo::TownEffect) ::CargoSpec::Get(cargo_type)->town_effect; (note the space between TownEffect) and the ::) then I would understand it fine. However there is no whitespace in that document*, which would mean (AICargo::TownEffect) is the left operand of the :: operator. How does this code work/compile? Or are the two things equivilent due to some obscure C++ rule? *It's the same in the cpp file as well.

    Read the article

  • Unable to SSH into EC2 instance on Fedora 17

    - by abhishek
    I did following steps But I am not able to SSH to it(Same steps work fine on Fedora 14 image). I am getting Permission denied (publickey,gssapi-keyex,gssapi-with-mic) I created new instance using fedora 17 amazon community image(ami-2ea50247). I copied my ssh keys under /home/usertest/.ssh/ after creating a usertest I have SELINUX=disabled here is Debug info: $ ssh -vvv ec2-54-243-101-41.compute-1.amazonaws.com ssh -vvv ec2-54-243-101-41.compute-1.amazonaws.com OpenSSH_5.2p1, OpenSSL 1.0.0b-fips 16 Nov 2010 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to ec2-54-243-101-41.compute-1.amazonaws.com [54.243.101.41] port 22. debug1: Connection established. debug1: identity file /home/usertest/.ssh/identity type -1 debug1: identity file /home/usertest/.ssh/id_rsa type -1 debug3: Not a RSA1 key file /home/usertest/.ssh/id_dsa. debug2: key_type_from_name: unknown key type '-----BEGIN' debug3: key_read: missing keytype debug2: key_type_from_name: unknown key type 'Proc-Type:' debug3: key_read: missing keytype debug2: key_type_from_name: unknown key type 'DEK-Info:' debug3: key_read: missing keytype debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug2: key_type_from_name: unknown key type '-----END' debug3: key_read: missing keytype debug1: identity file /home/usertest/.ssh/id_dsa type 2 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9 debug1: match: OpenSSH_5.9 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.2 debug2: fd 3 setting O_NONBLOCK debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,[email protected],zlib debug2: kex_parse_kexinit: none,[email protected],zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,[email protected] debug2: kex_parse_kexinit: none,[email protected] debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: mac_setup: found hmac-md5 debug1: kex: server->client aes128-ctr hmac-md5 none debug2: mac_setup: found hmac-md5 debug1: kex: client->server aes128-ctr hmac-md5 none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug2: dh_gen_key: priv key bits set: 131/256 debug2: bits set: 506/1024 debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug3: check_host_in_hostfile: filename /home/usertest/.ssh/known_hosts debug3: check_host_in_hostfile: match line 17 debug3: check_host_in_hostfile: filename /home/usertest/.ssh/known_hosts debug3: check_host_in_hostfile: match line 17 debug1: Host 'ec2-54-243-101-41.compute-1.amazonaws.com' is known and matches the RSA host key. debug1: Found key in /home/usertest/.ssh/known_hosts:17 debug2: bits set: 500/1024 debug1: ssh_rsa_verify: signature correct debug2: kex_derive_keys debug2: set_newkeys: mode 1 debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug2: set_newkeys: mode 0 debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug2: key: /home/usertest/.ssh/identity ((nil)) debug2: key: /home/usertest/.ssh/id_rsa ((nil)) debug2: key: /home/usertest/.ssh/id_dsa (0x7f904b5ae260) debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password debug3: authmethod_lookup gssapi-with-mic debug3: remaining preferred: publickey,keyboard-interactive,password debug3: authmethod_is_enabled gssapi-with-mic debug1: Next authentication method: gssapi-with-mic debug3: Trying to reverse map address 54.243.101.41. debug1: Unspecified GSS failure. Minor code may provide more information Credentials cache file '/tmp/krb5cc_500' not found debug1: Unspecified GSS failure. Minor code may provide more information Credentials cache file '/tmp/krb5cc_500' not found debug1: Unspecified GSS failure. Minor code may provide more information debug2: we did not send a packet, disable method debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Trying private key: /home/usertest/.ssh/identity debug3: no such identity: /home/usertest/.ssh/identity debug1: Trying private key: /home/usertest/.ssh/id_rsa debug3: no such identity: /home/usertest/.ssh/id_rsa debug1: Offering public key: /home/usertest/.ssh/id_dsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic debug2: we did not send a packet, disable method debug1: No more authentication methods to try. Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

    Read the article

  • Why does VIM say there is trailing whitespace on this command?

    - by Jesse Atkinson
    I am trying to write a beautify CSS command in vim that sorts and alphabetizes all of the CSS properties as well as checks to see if there is not a space after the colon and inserts one. Here is my code: nnoremap <leader>S :g#\({\n\)\@<=#.,/}/sort | %s/:\(\S\)/: \1/g<CR> :command! SortCSSBraceContents :g#\({\n\)\@<=#.,/}/sort | %s/:\(\S\)/: \1/g These work independently. However, I am trying to pipe them into one command. On save VIM says: Error detected while processing /var/home/jesse-atkinson/.vimrc: line 196: E488: Trailing characters Any ideas?

    Read the article

  • C# - How do find a string within a string even if it spans across whitespace?

    - by James Heaney
    I want to be able to find and highlight a string within a string BUT I no not want to remove the space. So if my original string is : There are 12 monkeys I want to find '12 mon' and highlight those characters ending up with : There are < font color='red' 12 mon< /font keys BUT I also want the same result if I search for '12mon' (no space this time) This has really bent my mind! I'm sure it can be done with Regex.

    Read the article

  • How to raise an error, if the parsed number of a C++ stdlib stream is immediatly followed by a non whitespace character?

    - by Micha Wiedenmann
    In the following example, I didn't expect, that 1.2345foo would be parsed. Since I am reading data files, it is probably better to raise an error and notify the user. Is peek() the correct thing to do here? #include <iostream> #include <sstream> int main() { std::stringstream in("1.2345foo"); double x; in >> x; if (in) { std::cout << "good\n"; } else { std::cout << "bad\n"; } } Output good

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >