Search Results

Search found 390 results on 16 pages for 'escaping'.

Page 11/16 | < Previous Page | 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • How do quotes/strings work in Powershell?

    - by Casey
    I'm have a command line that works in the regular old Windows Command Shell, but somehow gets misinterpreted in Powershell (I'm fairly new to Powershell). sqlcmd -S .\SQLEXPRESS -i "f:\SQLBackups\ExpressMaint.sql" -v DB="ksuite" -v OPTYPE="DB" -v BACKUPFOLDER="f:\SQLBackups" -v REPORTFOLDER="f:\SQLBackups\Reports" -v DBRETAINUNIT="days" -v DBRETAINVAL="7" Powershell seems to be stripping the drive letters out of the arguments that require paths. For example, I get the following when I attempt to run the above command in Powershell: Sqlcmd: ':\SQLBackups': Invalid argument. Enter '-?' for help. Well sure it's invalid without the drive letter. I have tried variations on double quoting it, escaping it, etc. but can't get it to work. What am I missing that Powershell does differently?

    Read the article

  • how do I concatenate a regex in a bash alias?

    - by Rodreegez
    Hello, I can't for the life of me how to create an alias that will switch to a given project directory. I keep all my projects in a folder called Projects i.e. ~/Project/blog ~/Project/whatever I'd like to have an alias along the lines of p whatever that would equate to cd ~/Project/$1 where $1 is whatever is given to p. I have tried various combinations of alias p="cd ~/Projects/\$1" with all the usual suspects for regex escaping but I can't quite get it. Any ideas?

    Read the article

  • Twitter Feeds in Umbraco using XSLT

    - by Vizioz Limited
    There are currently two packages tagged on the Umbraco forum that can be used to add a twitter feed to your website. I was playing around with "Twitter for Umbraco" by Warren Buckley and noticed a bug in the way it converted twitter @names to links, so I thought I would try and solve this using XSLT.It may also be useful for those of you using Darren Ferguson's "Feed Cache" package as the demo on Darren's site does not add links to the tweets.To use this XSLT you simple call the XSLT Template passing in your Twitter message:<xsl:call-template name="formaturl"> <xsl:with-param name="url" select="text"/></xsl:call-template>Then add the XSLT template to your XSLT macro (outside of the main template)<xsl:template name="formaturl"> <xsl:param name="twitterfeed"/> <xsl:variable name="transform-http" select="Exslt.ExsltRegularExpressions:replace($twitterfeed, '(http\:\/\/\S+)',ig,'<a href="$1">$1</a>')"/> <xsl:variable name="transform-https" select="Exslt.ExsltRegularExpressions:replace($transform-http, '(HTTps\:\/\/\S+)',ig,'<a href="$1">$1</a>')"/> <xsl:variable name="transform-AT" select="Exslt.ExsltRegularExpressions:replace($transform-https, '(^|\s)@(\w+)',ig,' <a href="http://www.twitter.com/$2">@$2</a>')"/> <xsl:variable name="transform-HASH" select="Exslt.ExsltRegularExpressions:replace($transform-AT, '(^|\s)#(\w+)',ig,' <a href="http://www.twitter.com/search?q=$2">#$2</a>')"/> <xsl:value-of select="$transform-HASH" disable-output-escaping="yes"/> </xsl:template>You should find that this now replaces all the @names, #names and URL's with links!

    Read the article

  • MOSS Content Query Web part itemstyle.xsl

    - by nav
    Hi, I have a Content Query Webpart (CQWP) pulling the URL and title from a NewsLinks list. The CQWP uses the XSLT style LVIS.News.Links defined in ItemStyle.xsl. I need to sort the title @Title0 field as commented out below because it causes an error. Does anyone know whats causing this error? - Many Thanks. The XSLT code is below: <xsl:template name="LVIS.News.Links" match="Row[@Style='LVIS.News.Links']" mode="itemstyle"> <xsl:param name="CurPos" /> <xsl:param name="Last" /> <xsl:variable name="SafeLinkUrl"> <xsl:call-template name="OuterTemplate.GetSafeLink"> <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/> </xsl:call-template> </xsl:variable> <xsl:variable name="DisplayTitle"> <xsl:call-template name="OuterTemplate.GetTitle"> <xsl:with-param name="Title" select="@URL"/> <xsl:with-param name="UrlColumnName" select="'URL'"/> </xsl:call-template> </xsl:variable> <xsl:variable name="LinkTarget"> <xsl:if test="@OpenInNewWindow = 'True'" >_blank</xsl:if> </xsl:variable> <xsl:variable name="SafeImageUrl"> <xsl:call-template name="OuterTemplate.GetSafeStaticUrl"> <xsl:with-param name="UrlColumnName" select="'ImageUrl'"/> </xsl:call-template> </xsl:variable> <xsl:variable name="Header"> <xsl:if test="$CurPos = 1"> <![CDATA[<ul class="list_Links">]]> </xsl:if> </xsl:variable> <xsl:variable name="Footer"> <xsl:if test="$Last = $CurPos"> <![CDATA[</ul>]]> </xsl:if> </xsl:variable> <xsl:value-of select="$Header" disable-output-escaping="yes" /> <li> <a> <xsl:attribute name="href"> <xsl:value-of select="substring-before($DisplayTitle,', ')"></xsl:value-of> </xsl:attribute> <xsl:attribute name="title"> <xsl:value-of select="@Description"/> </xsl:attribute> <!-- <xsl:sort select="@Title0"/> --> <xsl:value-of select="@Title0"> </xsl:value-of> </a> </li> <xsl:value-of select="$Footer" disable-output-escaping="yes" /> </xsl:template>

    Read the article

  • Want to Run OS Commands From WLST?

    - by Bala Kothandaraman
    If you spend a lot of time with WLST in the interactive mode, I am sure you have opened another command prompt/shell to check something at the OS file system level. If you wonder whether can execute an OS command from within WLST prompt, the answer is "Yes". This is very convenient similar to how you can execute OS commands from within "Vi" editor. In fact this feature is not from WLST but from underlying Jython. There is "os" module in Jython that provides a unified interface to a number of operating system functions. There is "system" function in the "os" module that can take a OS command as a string input and returns either "0" or "1" depends on whether the command was successful or failed. So this feature can also be used with scripting mode where the return code can be verified for further processing in the script. For eg. os.system(r'dir c:\bea') can list the contents of the bea folder under c drive. Notice the use of the preceding 'r' for escaping the entire string.

    Read the article

  • Insufficient permissions within Eclipse when installed via synaptic in Ubuntu 12.04

    - by Clayton
    I installed Eclipse via the Synaptic Package Manager on Ubuntu 12.04 Desktop (more details on footer). However, from within Eclipse, I lack sufficient permissions to perform upgrades on my package and add-ons. I'm a recovering Windows user, and while I have a couple of years Ubuntu experience, I am unfamiliar with the command-line and mainly interact through the packaged GUI. Specifically, I am trying to install the upgrade for Eclipse CVS Clientorg.eclipse.cvs.feature.group1.3.100.v20110520-0800-7B78FHl9VF7BD7KBM4GP9C I am tracking the varying installation advice on a similar question eclipse install: Gaurav Butola Basically, the most current upgrades are available directly from eclipse?... But at some point I remember reading that the latest version of eclipse had been designed for the previous LTS of Ubuntu - I don't know if that is still true. I have read about the vulnerabilities of Java 6, and so I have gone with Open Java 7 openjdk-amd64 (if that has any relevance to which Eclipse package and installation method I choose). But I'm not crazy about the idea of creating a gksudo link in the sidebar launcher. I don't know enough about chown to use it - if that's even appropriate (I don't want stray java escaping from Eclipse and connecting to SkyNet). Another possible solution that I foresee is modifying my user's group memberships/privileges on the file system as a whole. The only other information that I think might be relevant is that I notice that Synaptic installed all of the files into /usr/ instead of /opt/ like I have seen recommended. So should I be changing ownership, reinstalling using a non-Synaptic method, or what? Any advice is greatly appreciated. Ubuntu information Ubuntu 12.04 LTS Memory 2.9 GiB Processor AMD Sempron(tm) Processor LE-1300 Graphics VESA: XXXXXXX OS type 64-bit Eclipse Version: 3.7.2 Build id: I20110613-1736 Ubuntu Developers :/usr/share$ ls -h -l drwxr-xr-x 5 root root 4.0K Sep 13 08:43 eclipse Install paths: /. /usr /usr/share ...

    Read the article

  • Is using something other than XML advisable for my configuration file?

    - by Earlz
    I have a small tool I'm designing which would require a configuration file of some sort. The configuration file in my case is really more of a database, but it needs to be lightweight, and if needed the end-user should find it easily editable. However, it also will contain a lot of things in it. (depending on certain factors, could be 1Mb or more) I've decided I'd rather use plain ol' text, rather than trying to use SQLite or some such. However, with using text, I also have to deal with the variety of formats. So far, my options are XML JSON Custom format The data in my file is quite simple consisting for the most part of key-value type things. So, a custom format wouldn't be that difficult... but I'd rather not have to worry about writing the support for it. I've never seen JSON used for configuration files. And XML would bloat the file size substantially I think. (I also just has a dislike of XML in general). What should I do in this case? Factors to consider: This configuration file can be uploaded to a web service(so size matters) Users must be able to edit it by hand if necessary(ease of editing and reading matters) Must be able to generate and process automatically (speed doesn't matter a lot, but not excessively slow) The "keys" and "values" are plain strings, but must be escaped because they can contain anything. (unicode and escaping has to work easily)

    Read the article

  • Validating allowed characters or validating disallowed characters

    - by Tom
    I've always validated my user input based on a list of valid/allowed characters, rather than a list of invalid/disallowed characters (or simply no validation). It's just a habit I picked up, probably on this site and I've never really questioned it until now. It makes sense if you wish to, say, validate a phone number, or validate an area code, however recently I've realised I'm also validating input such as Bio Text fields, User Comments, etc. for which the input has no solid syntax. The main advantage has always seemed to be: Validating allowed chars reduces the risk of you missing a potentially malicious character, but increases the risk the of you not allowing a character which the user may want to use. The former is more important. But, providing I am correctly preventing SQL Injection (with prepared statements) and also escaping output, is there any need for this extra barrier of protection? It seems to me as if I am just allowing practically every character on the keyboard, and am forgetting to allow some common characters. Is there an accepted practice for this situation? Or am I missing something obvious? Thanks.

    Read the article

  • Calling system commands from Perl

    - by Dan J
    In an older version of our code, we called out from Perl to do an LDAP search as follows: # Pass the base DN in via the ldapsearch-specific environment variable # (rather than as the "-b" paramater) to avoid problems of shell # interpretation of special characters in the DN. $ENV{LDAP_BASEDN} = $ldn; $lcmd = "ldapsearch -x -T -1 -h $gLdapServer" . <snip> " > $lworkfile 2>&1"; system($lcmd); if (($? != 0) || (! -e "$lworkfile")) { # Handle the error } The code above would result in a successful LDAP search, and the output of that search would be in the file $lworkfile. Unfortunately, we recently reconfigured openldap on this server so that a "BASE DC=" is specified in /etc/openldap/ldap.conf and /etc/ldap.conf. That change seems to mean ldapsearch ignores the LDAP_BASEDN environment variable, and so my ldapsearch fails. I've tried a couple of different fixes but without success so far: (1) I tried going back to using the "-b" argument to ldapsearch, but escaping the shell metacharacters. I started writing the escaping code: my $ldn_escaped = $ldn; $ldn_escaped =~ s/\/\\/g; $ldn_escaped =~ s/`/\`/g; $ldn_escaped =~ s/$/\$/g; $ldn_escaped =~ s/"/\"/g; That threw up some Perl errors because I haven't escaped those regexes properly in Perl (the line number matches the regex with the backticks in). Backticks found where operator expected at /tmp/mycommand line 404, at end of line At the same time I started to doubt this approach and looked for a better one. (2) I then saw some Stackoverflow questions (here and here) that suggested a better solution. Here's the code: print("Processing..."); # Pass the arguments to ldapsearch by invoking open() with an array. # This ensures the shell does NOT interpret shell metacharacters. my(@cmd_args) = ("-x", "-T", "-1", "-h", "$gLdapPool", "-b", "$ldn", <snip> ); $lcmd = "ldapsearch"; open my $lldap_output, "-|", $lcmd, @cmd_args; while (my $lline = <$lldap_output>) { # I can parse the contents of my file fine } $lldap_output->close; The two problems I am having with approach (2) are: a) Calling open or system with an array of arguments does not let me pass > $lworkfile 2>&1 to the command, so I can't stop the ldapsearch output being sent to screen, which makes my output look ugly: Processing...ldap_bind: Success (0) additional info: Success b) I can't figure out how to choose which location (i.e. path and file name) to the file handle passed to open, i.e. I don't know where $lldap_output is. Can I move/rename it, or inspect it to find out where it is (or is it not actually saved to disk)? Based on the problems with (2), this makes me think I should return back to approach (1), but I'm not quite sure how to

    Read the article

  • Perl Search and Replace Avoid Variable Interpolation

    - by Justin
    I'm really getting my butt kicked here. I can not figure out how to write a search and replace that will properly find this string. String: $QData{"OrigFrom"} $Text{"wrote"}: Note: That is the actual STRING. Those are NOT variables. I didn't write it. I need to replace that string with nothing. I've tried escaping the $, {, and }. I've tried all kinds of combinations but it just can't get it right. Someone out there feel like taking a stab at it? Thanks!

    Read the article

  • How to use htaccess to rewrite url to html anchor tag (#)

    - by Lee L
    Hi - I have a situation where I want to take the following URL: /1/john and have it redirect using Apache's htaccess file to go to /page.php?id=1&name=john#john so that it goes to an html anchor with the name of john. I've found a lot of reference to escaping special characters, and to adding the [NE] flag so that the redirect ignores the # sign, but these don't work. For example, adding [NE,R] means that the URL just appears in the browser address as the original: http://mysite.com/page.php?id=1&name=john#john. Any help would be appreciated.

    Read the article

  • Preventing LDAP injection

    - by Matias
    I am working on my first desktop app that queries LDAP. I'm working in C under unix and using opends, and I'm new to LDAP. After woking a while on that I noticed that the user could be able to alter the LDAP query by injecting malicious code. I'd like to know which sanitizing techniques are known, not only for C/unix development but in more general terms, i.e., web development etc. I thought that escaping equals and semicolons would be enough, but not sure. Here is a little piece of code so I can make clearer the question: String ldapSearchQuery = "(cn=" + $userName + ")"; System.out.println(ldapSearchQuery); Obviously I do need to sanitize $userName, as stated in this OWASP ARTICLE

    Read the article

  • can a valid xml body have escaped characters for the '<' and '>' around the element names

    - by prmatta
    My web service is receiving xml from a third party that looks like this: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> &lt;Foo&gt;bar&lt;/Foo&gt; </SOAP-ENV:Body> </SOAP-ENV:Envelope> My jaxws web service rejects this with a parsing error. Also if I try to validate this xml using soapui it says Body with element-only content type cannot have text element. My question is, is that xml valid? Or is the client supposed to send me something without escaping the < and . Any references to xml standards or rules are appreciated.

    Read the article

  • Silverlight 4 RichTextBox - can't restore Xaml with text containing curly braces

    - by fuzzyman
    We have a Silverlight application using the RichTextBox as a rich text editor for the user to create emails. We actually have our own serializer but essentially we are saving and restoring the Xaml. As far as I can tell it is impossible to restore any text containing curly braces. You can demonstrate this fairly easily by creating a RichTextBox and typing something similar to "{weird}" into it. Then take the .Xaml property of the textbox and set it on the .Xaml property of another textbox - kablooie. As we have our own serializer I have tried escaping the Text member of the Run elements with "". This makes no difference. I've tried replacing the braces with &#123; but that doesn't work either.

    Read the article

  • What is an "incompletely constructed object"?

    - by Joonas Pulakka
    Goetz's Java Concurrency in Practice, page 41, mentions how this reference can escape during construction. A "don't do this" example: public class ThisEscape { public ThisEscape(EventSource source) { source.registerListener( new EventListener() { public void onEvent(Event e) { doSomething(e); } }); } } Here this is "escaping" via the fact that doSomething(e) refers to the enclosing ThisEscape instance. The book states: Publishing an object from within its constructor can publish an incompletely constructed object. This is true even if the publication is the last statement in the constructor. If the this reference escapes during construction, the object is considered not properly constructed. I don't quite get this. If the publication is the last statement in the constructor, hasn't all the constructing work been done before that? How come is this not valid by then? Apparently there's some voodoo going on after that, but what?

    Read the article

  • JFormattedTextField : input time duration value

    - by bguiz
    I want to use a JFormattedTextField to allow the user to input time duration values into a form. Sample valid values are: 2h 30m 72h 15m 6h 0h However I am having limited success with this. Can some one please suggest how this can be accomplished? I am OK if this result can be achieved using a JTextField as well. Thanks! If it is worth anything, here's my current attempt: mFormattedText.setFormatterFactory( new DefaultFormatterFactory( new DateFormatter( new SimpleDateFormat("H mm")))); This sorta works except that: I cannot get h and m to appear as plain text (I tried escaping) * The number of hours has a max *: See @nanda's answer

    Read the article

  • I need to Split a string based on a complex delimiter

    - by Jason
    In C# I need to split a string (a log4j log file) into array elements based on a particular sequence of characters, namely "nnnn-nn-nn nn:nn:nn INFO". I'm currently splitting this log file up by newlines, which is fine except when the log statements themselves contain newlines. I don't control the input (the log file) so escaping them somehow is not an option. It seems like I should be able to use a comparator or a regex to identify the strings, but String.Split does not have an option like that. Am I stuck rolling my own, or is there a pattern or framework component that can be of help here?

    Read the article

  • !(ReferenceEquals()) vs != in Entity Framework 4

    - by Eric J.
    Unless a class specifically overrides the behavior defined for Object, ReferenceEquals and == do the same thing... compare references. In property setters, I have commonly used the pattern private MyType myProperty; public MyType MyProperty { set { if (myProperty != value) { myProperty = value; // Do stuff like NotifyPropertyChanged } } } However, in code generated by Entity Framework, the if statement is replaced by if (!ReferenceEquals(myProperty, value)) Using ReferenceEquals is more explicit (as I guess not all C# programmers know that == does the same thing if not overridden). Is there any difference that's escaping me between the two if-variants? Are they perhaps accounting for the possibility that POCO designers may have overridden ==? In short, if I have not overridden ==, am I save using != instead of ReferencEquals()?

    Read the article

  • FilePageSetupHeader in MS Project VBA project: Display image dynamically

    - by Anne Schuessler
    I want to display an image when printing a page from MS Page using the FilePageSetupHeader. It all works fine if I pass in the parameter for the Text property as a string as such FilePageSetupHeader Alignment:=pjRight, Text:="&P""C:\filepath\image.gif""" However, I'd prefer to be able to pass the filepath to the image to display as a variable. Somehow I can't get it right. So if I try something like the following: vImagePath = """&P""""" & prjFilePath & "\image.gif"""""" FilePageSetupHeader Alignment:=pjRight, Text:=vImagePath it just displays the path as a string. I'm pretty sure it boils down to something simple like escaping the quotes in the correct way, but I've been playing around with it for a while now and I can't seem to get it right. Any idea how this works?

    Read the article

  • Java replace slow?

    - by cpf
    Hi StackOverflow, I have a Java application that makes heavy use of a large file, to read, process and give through to SolrEmbeddedServer (http://lucene.apache.org/solr/). One of the functions does basic HTML escaping: private String htmlEscape(String input) { return input.replace("&", "&amp;").replace(">", "&gt;").replace("<", "&lt;") .replace("'", "&apos;").replaceAll("\"", "&quot;"); } While profiling the application, the program spends roughly 58% of the time in this function, a total of 47% in replace, and 11% in replaceAll. Now, is the Java replace that slow, or am I on the right path and should I consider the program efficient enough to have its bottleneck in Java and not in my code? (Or am I replacing wrong?) Thanks in advance!

    Read the article

  • [Ruby] Why do I have to URI.encode even safe characters for Net::HTTP requests?

    - by Matthias
    I was trying to send a GET request to Twitter (user ID replaced for privacy reasons) using Net::HTTP: url = URI.parse("http://api.twitter.com/1/friends/ids.json?user_id=12345") resp = Net::HTTP.get_response(url) this throws an exception in Net::HTTP: NoMethodError: undefined method empty?' for #<URI::HTTP:0x59f5c04> from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1470:ininitialize' just by coincidence, I stumbled upon a similar code snippet, which used URI.encode prior to URI.parse, so I copied that and tried again: url = URI.parse(URI.encode("http://api.twitter.com/1/friends/ids.json?user_id=12345")) resp = Net::HTTP.get_response(url) now it works fine, but why? There are no reserved characters that need escaping in the URL I mentioned, so why do I have to call URI.encode for get_response to succeed?

    Read the article

  • Regex Problem in PHP

    - by Chris
    I'm attempting to utilize the following Regex pattern: $regex = '/Name: [a-zA-Z ]*] [0-9]/'; When testing it in Rubular, it works fine, but when using PHP the expression never returns true, even when it should. Incidentally, if I remove the "[0-9]" part, it works fine. Is there some difference in PHP's regex syntax that I'm overlooking? Edit: I'm looking for the characters "Name:" then a name containing any number of letters or spaces, then a "]", then a space, then a single number. So "Name: Chris] 5" would return true and "Name: Chris] [lorem ipsum]" should return false. I also tried escaping the second bracket "\[" but this did not fix the problem.

    Read the article

  • C# - Process.Start - Pass html code to exe as argument

    - by dkirk
    Hello, I am using the code below to start a executable file from a windows service and I need to pass html code (stored in a variable) as an argument. I am escaping with double quotes but this is not working. What do I need to do in order to pass this correctly? Thanks in advance for any guidance that is offered. Inside the service: Process.Start(@"E:\Program Files\MyApp.exe", dr["rec"].ToString() + " \"" + subject + "\" \"" + htmlVar); and then within MyApp.exe: static void Main(string[] args) { Program MyProg = new Program(); MyProg.MyMeth(args[0].ToString(), args[1].ToString(), args[2].ToString()); }

    Read the article

  • Process.Start - Pass html code to exe as argument

    - by dkirk
    Hello, I am using the code below to start a executable file from a windows service and I need to pass html code (stored in a variable) as an argument. I am escaping with double quotes but this is not working. What do I need to do in order to pass this correctly? Thanks in advance for any guidance that is offered. Inside the service: Process.Start(@"E:\Program Files\MyApp.exe", dr["rec"].ToString() + " \"" + subject + "\" \"" + htmlVar); and then within MyApp.exe: static void Main(string[] args) { Program MyProg = new Program(); MyProg.MyMeth(args[0].ToString(), args[1].ToString(), args[2].ToString()); }

    Read the article

  • Disable escape in Zend Form Element Submit

    - by Joaquín L. Robles
    I can't disable escaping in a Zend_Form_Element_Submit, so when the label has special characters it won't display it's value.. This is my actual Zend Form piece of code: $this->submit = new Zend_Form_Element_Submit('submit'); $this->submit->setLabel('Iniciar Sesión'); $this->submit->setIgnore(true); $this->addElement($this->submit); I've tried $this->submit->getDecorator('Label')->setOption('escape', false); but I obtain an "non-object" error (maybe submit isn't using the "Label" Decorator).. I've also tried as suggested $this->submit->setAttrib('escape', false); but no text will be shown either.. Any idea? Thanks

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16  | Next Page >