Search Results

Search found 711 results on 29 pages for 'trailing slash'.

Page 4/29 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to escape trailing backslash in NVelocity

    - by Ben
    I am using NVelocity to process various PowerShell scripts before they are executed against a server. My question is how to escape a backslash trailing a variable: e.g. ls \\$computername\c$ $computername should be replaced with a valid computer name at runtime, but the trailing backslash (\c$) means that it does not. Thanks Ben

    Read the article

  • How to auto-remove trailing whitespace in Eclipse?

    - by Jan Zankowski
    Hello, The question has two parts, one of which I already have the answer for. How to auto-remove trailing whitespace from the entire file being edited? - Answer: use the AnyEdit plugin, which can be set to do that on any save to the file. How to auto-remove trailing whitespace only from the lines I changed? - This I don't know and would appreciate any help. Thanks, Jan

    Read the article

  • Trailing comments after variable assignment subvert comparison

    - by nobar
    In GNU make, trailing comments appended to variable assignments prevent subsequent comparison (via ifeq) from working correctly. Here's the Makefile... A = a B = b ## trailing comment C = c RESULT := ifeq "$(A)" "a" RESULT += a endif ifeq "$(B)" "b" RESULT += b endif ifeq "$(C)" "c" RESULT += c endif rule: @echo RESULT=\"$(RESULT)\" @echo A=\"$(A)\" @echo B=\"$(B)\" @echo C=\"$(C)\" Here's the output... $ make RESULT=" a c" A="a" B="b " C="c" As you can see from the displayed value of RESULT, the ifeq was affected by the presence of the comment in the assignment of B. Echoing the variable B, shows that the problem is not the comment, but the intervening space. The obvious solution is to explicitly strip the whitespace prior to comparison like so... ifeq "$(strip $(B))" "b" RESULT += b endif However this seems error prone. Since the strip operation is not needed unless/until a comment is used, you can leave out the strip and everything will initially work just fine -- so chances are you won't always remember to add the strip. Later, if someone adds a comment when setting the variable, the Makefile no longer works as expected. Note: There is a closely related issue, as demonstrated in this question, that trailing whitespace can break string compares even if there is no comment. Question: Is there a more fool-proof way to deal with this issue?

    Read the article

  • SSL wildcard certificates and trailing 'www'

    - by user173326
    I've got a wildcard SSL certificate for *.mydomain.com. I'm using nginx, and redirecting all traffic for http to https, and also rewriting the URLs without a trailing www (if there is one). So it has, 1) http://subdomain.mydomain.com ---> https://subdomain.mydomain.com 2) http://www.subdomain.mydomain.com ---> https://subdomain.mydomain.com 3) https://www.subdomain.mydomain.com ---> https://subdomain.mydomain.com 4) https://subdomain.mydomain.com ---> https://subdomain.mydomain.com However, since my cert is for *.mydomain.com, case 3 gets an SSL error in chrome ('This is probably not the site that you are looking for!'), but if you click through it gets redirected and all is well. I understand why, since the initial connection is for https with a www (2 levels of subdomains), which doesn't match what is on the wildcard certificate. I thought a solution would be to get an additional cert for *.*.mydomain.com to cover www.*.mydomain.com. But it seems like that won't work. I spoke to agents from namecheap and comodo, and both said *.*.mydomain.com was not possible. I also came across this: https://support.quovadisglobal.com/KB/a60/will-ssl-work-with-multilevel-wildcards.aspx Is there a solution to this? To be able to cover www.*.mydomain.com?

    Read the article

  • haproxy + nginx: https trailing slashes redirected to http

    - by user1719907
    I have a setup where HTTP(S) traffic goes from HAProxy to nginx. HAProxy nginx HTTP -----> :80 ----> :9080 HTTPS ----> :443 ----> :9443 I'm having troubles with implicit redirects caused by trailing slashes going from https to http, like this: $ curl -k -I https://www.example.com/subdir HTTP/1.1 301 Moved Permanently Server: nginx/1.2.4 Date: Thu, 04 Oct 2012 12:52:39 GMT Content-Type: text/html Content-Length: 184 Location: http://www.example.com/subdir/ The reason obviously is HAProxy working as SSL unwrapper, and nginx sees only http requests. I've tried setting up the X-Forwarded-Proto to https on HAProxy config, but it does nothing. My nginx setup is as follows: server { listen 127.0.0.1:9443; server_name www.example.com; port_in_redirect off; root /var/www/example; index index.html index.htm; } And the relevant parts from HAProxy config: frontend https-in bind *:443 ssl crt /etc/example.pem prefer-server-ciphers default_backend nginxssl backend nginxssl balance roundrobin option forwardfor reqadd X-Forwarded-Proto:\ https server nginxssl1 127.0.0.1:9443

    Read the article

  • Properly escaping forward slash in bash script for usage with sed

    - by user331839
    I'm trying to determine the size of the files that would be newly copied when syncing two folders by running rsync in dry mode and then summing up the sizes of the files listed in the output of rsync. Currently I'm stuck at prefixing the files by their parent folder. I found out how to prefix lines using sed and how to escape using sed, but I'm having troubles combining those two. This is how far I got: source="/my/source/folder/" target="/my/target/folder/" escaped=`echo "$source" | sed -e 's/[\/&]/\\//g'` du `rsync -ahnv $source $target | tail -n +2 | head -n -3 | sed "s/^/$escaped/"` | awk '{i+=$1} END {print i}' This is the output I get from bash -x myscript.sh + source=/my/source/folder/ + target=/my/target/folder ++ echo /my/source/folder/ ++ sed -e 's/[\/&]/\//g' + escaped=/my/source/folder/ + awk '{i+=$1} END {print i}' ++ rsync -ahnv /my/source/folder/ /my/target/folder/ ++ sed 's/^//my/source/folder//' ++ head -n -3 ++ tail -n +2 sed: -e expression #1, char 8: unknown option to `s' + du 80268 Any ideas on how to properly escape would be highly appreciated.

    Read the article

  • Spring Annotation trailing slash

    - by Eqbal
    I have a controller with @RequestMapping for root path "/". There are other controllers with say a @RequestMapping of "/test" etc. My application seems to be mapping correctly for paths like /appname/test, but if I add a trailing slash to the path, like so "/appname/test/ then it maps to the controller that has the @RequestMapping for root path "/". Any idea why?

    Read the article

  • Rewriterule end slash

    - by Maxime
    Hi, I'm working on a Rewriterule in order to have URLs like these: http://www.myhost.com/var1/var2/ RewriteRule ^(.*)\/(.*)\/$ index.php?var1=$1&var2=$2 [L] What I would like to add is that when someone types myhost.com/var1/var2 (without the end slash), it still goes to the same page. Is there a better way to do it than this? RewriteRule ^(.*)\/(.*)\/$ index.php?band=$1&song=$2 [L] RewriteRule ^(.*)\/(.*)$ index.php?band=$1&song=$2 [L]

    Read the article

  • Perl replace slash in variable

    - by cc96ai
    How can I replace the slash inside the variable? $string = 'a\cc\ee'; $re = 'a\\cc'; $rep = "Work"; #doesnt work in variable $string =~ s/$re/$rep/og; print $string."\n"; #work with String $string =~ s/a\\cc/$rep/og; print $string."\n"; output: a\cc\ee Work\ee

    Read the article

  • Redirects in Glassfish (adding trailing slash)

    - by echox
    Is it possible to add a trailing slash to the default context of an application? Example: http://www.uri.com/foo -> http://www.uri.com/foo/ I added the following redirect to the server properties: redirect_1: from=/foo url-prefix=/foo/ and this ends up in a loop... Several other configurations also didn't work :-/ I'm using glassfish v2.1-b60e.

    Read the article

  • One pass multiple whitespace replace to single whitespace and eliminate leading and trailing whitesp

    - by Phoenix
    void RemoveSpace(char *String) { int i=0,y=0; int leading=0; for(i=0,y=0;String[i]!='\0';i++,y++) { String[y]=String[i]; // let us copy the current character. if(isspace(String[i])) // Is the current character a space? { if(isspace(String[i+1])||String[i+1]=='\0'||leading!=1) // leading space y--; } else leading=1; } String[y]='\0'; } Does this do the trick of removing leading and trailing whitespaces and replacing multiple whitespaces with single ones ?? i tested it for null string, all whitespaces, leading whitespaces and trailing whitespaces. Do you think this is an efficient one pass solution ??

    Read the article

  • Javascript to remove trailing &nbsp;

    - by ria
    I am getting a string which is nothing but innerHTML, and so it has instances of &nbsp;. I need to trim the string such that the trailing &nbsp; alone are removed. Tried this: var text; text = txtInnerHTML.replace(/(&nbsp;)*/g,""); This removes all instances of &nbsp; which is not desired.. Only the trailing &nbsp; need to be removed.

    Read the article

  • How to escape forward slash?

    - by AndrewB
    I have the following sql command through code and because the parameter contains a forward slash when I evaluate the sql row after the update the column is just empty. sqlCommand.CommandText = String.Format("update {0} set {1}='{2}'where id = @Id", tableName, ColumnName, forwardSlashText); sqlCommand.Parameters.Add("@Id", SqlDbType.UniqueIdentifier).Value = rowId; numRowsAffected = sqlCommand.ExecuteNonQuery(); adding a log.debug to this command i get the following output... update my_table_name set mime_type='application/pdf' where id = @Id So i would assume that the command is correct, but then looking at the row the mime_type column is empty.

    Read the article

  • Apache rewrite with many slash not working?

    - by Daok
    I have modified a website with a redirection to a single page: RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] It works as it suppose to be. Everything is redirected to index.php. Here is a working example that display index.php with all images and css: http://.....com/section1 The problem occur when I try : http://....com/section1/subsection The page is redirected to index.php, BUT no images, no css, no javascript. Inside the PHP script everything is like this directly linked to the images or css or javascript like: <img src="images/images1.png> ... <img src="images2.png"> Why does url with many slash like .com../123/123/whatever does not work with images, css or javascript when .com/no_slash_url works?

    Read the article

  • Using .htaccess to replace backslash in URL with forward-slash

    - by DamienL
    I realise that a backslash should never appear in a URL in a form other than a URL escape code, however in this case the URL's are being generated by a .NET application for generating flashbooks. I have contacted the developer of this application with a bug report. In the interim i would like to use .htaccess to rewrite the offending backslashes. This is how the URLs appear in fiddler debugging proxy. www.example.com/folder/folder/thumbs%5C1.jpg I am using Firefox and it looks as though Firefox is translating them into the URL encoded equivalent ( \ == %5C1 ). Interestingly IE translates the backslash into a forward-slash automatically (not adhering to standards but convenient in this case). Is there a way to use .htaccess to rewrite all \ to /?

    Read the article

  • Prevent Django from redirecting to add trailing slash

    - by konrad
    UPDATED: Sorry, it looks like it's Apache that's rewriting it for some reason, not Django. I'll investigate further and post my findings. I need to add a /xmlrpc.php to my Byteflow installation to handle an application that is written for PHP blog engines and uses this hardcoded path. For some reason Byteflow appends a slash to this URL using a 301 Moved Permanently redirect, which breaks the application. It does not do so for the /robots.txt that is configured in a similar way. Relevant lines from the project urls.py: url(r'^xmlrpc.php$', 'django_xmlrpc.views.xmlrpc_handler'), url(r'^robots.txt$', include('robots.urls')), I read that the behavior was changed in the Django codebase in commit 6852 (in 2007) to prevent redirects being done for urls that have been explicitly configured not to contain any trailing slashes. I'm using Django 1.1. I assume that once I have fixed this problem, I should be able to use this application with Byteflow, because the application uses the MetaWeblog XML-RPC API. Any clue?

    Read the article

  • double slash apache configuration

    - by VP
    Hi, i'm deploying a ror application and now i have to rewrite the url (in apache) to add a prefix www to the url add / to the end of the url So i took the following approach: RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$ RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L] RewriteCond %{HTTP_HOST} ^foo\.com RewriteRule ^(.*)$ http://www.foo.com/$1 [R=301,L] The problem is that it is appending two trailing slash to my url So for example a resource /question/ask are becoming: http://foo.com//question/ask I tried to add the following Rule before all my Rewrite rules to try to remove the double //: RewriteCond %{REQUEST_URI} ^// RewriteRule ([^/]*)/+(.*) http://www.foo.com/$1/$2 [R=301,L] but it didnt work.. any idea to rip off all extras "//" added to the url?

    Read the article

  • Why does _GET in PHP wrongly decodes slash?

    - by Boaz
    Hi, Today I run into some oddity with PHP, which I fail find a proper explanation for in the documentation. Consider the following code: <?php echo $_GET['t']. PHP_EOL; ?> The code is simple - it takes a single t parameter on the url and outputs it back. So if you call it with test.php?t=%5Ca (%5c is a '\'), I expected to see: \a However, this is what I got: $ curl http://localhost/~boaz/test.php?t=%5Ca \\a Notice the double slash. Can anyone explains what's going on and give recipe for retrieving the strings as it was supplied on the URL? Thanks, Boaz

    Read the article

  • Codechef practice question help needed - find trailing zeros in a factorial

    - by manugupt1
    I have been working on this for 24 hours now, trying to optimize it. The question is how to find the number of trailing zeroes in factorial of a number in range of 10000000 and 10 million test cases in about 8 secs. The code is as follows: #include<iostream> using namespace std; int count5(int a){ int b=0; for(int i=a;i>0;i=i/5){ if(i%15625==0){ b=b+6; i=i/15625; } if(i%3125==0){ b=b+5; i=i/3125; } if(i%625==0){ b=b+4; i=i/625; } if(i%125==0){ b=b+3; i=i/125; } if(i%25==0){ b=b+2; i=i/25; } if(i%5==0){ b++; } else break; } return b; } int main(){ int l; int n=0; cin>>l; //no of test cases taken as input int *T = new int[l]; for(int i=0;i<l;i++) cin>>T[i]; //nos taken as input for the same no of test cases for(int i=0;i<l;i++){ n=0; for(int j=5;j<=T[i];j=j+5){ n+=count5(j); //no of trailing zeroes calculted } cout<<n<<endl; //no for each trialing zero printed } delete []T; } Please help me by suggesting a new approach, or suggesting some modifications to this one.

    Read the article

  • Python raw strings and trailing back slashes.

    - by dash-tom-bang
    I ran across something once upon a time and wondered if it was a Python "bug" or at least a misfeature. I'm curious if anyone knows of any justifications for this behavior. I thought of it just now reading "Code Like a Pythonista," which has been enjoyable so far. I'm only familiar with the 2.x line of Python. Raw strings are strings that are prefixed with an r. This is great because I can use backslashes in regular expressions and I don't need to double everything everywhere. It's also handy for writing throwaway scripts on Windows, so I can use backslashes there also. (I know I can also use forward slashes, but throwaway scripts often contain content cut&pasted from elsewhere in Windows.) So great! Unless, of course, you really want your string to end with a backslash. There's no way to do that in a 'raw' string. In [9]: r'\n' Out[9]: '\\n' In [10]: r'abc\n' Out[10]: 'abc\\n' In [11]: r'abc\' ------------------------------------------------ File "<ipython console>", line 1 r'abc\' ^ SyntaxError: EOL while scanning string literal In [12]: r'abc\\' Out[12]: 'abc\\\\' So one slash before the closing quote is an error, but two slashes gives you two slashes! Certainly I'm not the only one that is bothered by this? Thoughts on why 'raw' strings are 'raw, except for slash-quote'? I mean, if I wanted to embed a single quote in there I'd just use double quotes around the string, and vice versa. If I wanted both, I'd just triple quote. If I really wanted three quotes in a row in a raw string, well, I guess I'd have to deal, but is this considered "proper behavior"?

    Read the article

  • why limxml2 quotes starting double slash in CDATA with javascript

    - by Vincenzo
    This is my code: <?php $data = <<<EOL <?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <script type="text/javascript"> //<![CDATA[ var a = 123; // JS code //]]> </script> </html> EOL; $dom = new DOMDocument(); $dom->preserveWhiteSpace = false; $dom->formatOutput = false; $dom->loadXml($data); echo '<pre>' . htmlspecialchars($dom->saveXML()) . '</pre>'; This is result: <?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <script type="text/javascript"><![CDATA[ //]]><![CDATA[ var a = 123; // JS code //]]><![CDATA[ ]]></script></html> If and when I remove the DOCTYPE notation from XML document, CDATA works properly and leading/trailing double slash is not turned into CDATA. What is the problem here? Bug in libxml2? PHP version is 5.2.13 on Linux. Thanks.

    Read the article

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