Search Results

Search found 639 results on 26 pages for 'literal'.

Page 12/26 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Regular - Take all numeric characters following a text character

    - by Simon
    Given a string in the format: XXX999999v99 (where X is any alpha character and v is any numeric character and v is a literal v character) how can I get a regex to match the numeric chatacters following the v? So far I've got 'v\d\d' which includes the v but ideally I'd like just the numeric part. As an aside does anyone know of a tool in which you can specify a string to match and have the regex generated? Modifying an existing regex is one thing but I find starting from scratch painful!

    Read the article

  • [bash] Escape a string for sed search pattern

    - by Alexander Gladysh
    In my bash script I have an external (received from user) string, which I should use in sed pattern. REPLACE="<funny characters here>" sed "s/KEYWORD/$REPLACE/g" How can I escape the $REPLACE string so it would be safely accepted by sed as a literal replacement? NOTE: The KEYWORD is a dumb substring with no matches etc. It is not supplied by user.

    Read the article

  • Vim syntax highlighting for ruby 1.9

    - by Peter
    Ruby 1.9 has a few new syntax elements, such as the {key: value} hash literal syntax. Has anyone written or seen an updated syntax/ruby.vim highlighting file that will highlight key: just like it highlights :key in {:key => value}?

    Read the article

  • How many significant digits should I use for double literals in Java?

    - by M. Dudley
    How many significant digits should I use when defining a double literal in Java? This is assuming that I am trying to represent a number with more significant figures than a double can hold. In Math.java I see 20 and 21: public static final double E = 2.7182818284590452354; public static final double PI = 3.14159265358979323846; This is more than the 15-17 significant digits provided by IEEE 754. So what's the general rule-of-thumb?

    Read the article

  • How to access static members in a Velocity template?

    - by matt b
    I'm not sure if there is a way to do this in Velocity or not: I have a User POJO which a property named Status, which looks like an enum (but it is not, since I am stuck on Java 1.4), the definition looks something like this: public class User { // default status to User private Status status = Status.USER; public void setStatus(Status status) { this.status = status; } public Status getStatus() { return status; } And Status is a static inner class: public static final class Status { private String statusString; private Status(String statusString) { this.statusString = statusString; } public final static Status USER = new Status("user"); public final static Status ADMIN = new Status("admin"); public final static Status STATUS_X = new Status("blah"); //.equals() and .hashCode() implemented as well } With this pattern, a user status can easily be tested in a conditional such as if(User.Status.ADMIN.equals(user.getStatus())) ... ... without having to reference any constants for the status ID, any magic numbers, etc. However, I can't figure out how to test these conditionals in my Velocity template with VTL. I'd like to just print a simple string based upon the user's status, such as: Welcome <b>${user.name}</b>! <br/> <br/> #if($user.status == com.company.blah.User.Status.USER) You are a regular user #elseif($user.status == com.company.blah.User.Status.ADMIN) You are an administrator #etc... #end But this throws an Exception that looks like org.apache.velocity.exception.ParseErrorException: Encountered "User" at webpages/include/dashboard.inc[line 10, column 21] Was expecting one of: "[" ... From the VTL User Guide, there is no mention of accessing a Java class/static member directly in VTL, it appears that the right hand side (RHS) of a conditional can only be a number literal, string literal, property reference, or method reference. So is there any way that I can access static Java properties/references in a Velocity template? I'm aware that as a workaround, I could embed the status ID or some other identifier as a reference in my controller (this is a web MVC application using Velocity as the View technology), but I strongly do not want to embed any magic numbers or constants in the view layer.

    Read the article

  • AVAudioPlayer error for Iphone Development

    - by KamalBhr
    Hello , I am developing an iphone application using "AVAudioPlayer" for playing a ".wav" file . For this i am adding header file "#import <AVFoundation/AVAudioPlayer.h>" . But while compiling i am getting error like : ".objc_class_name_AVAudioPlayer", referenced from: literal-pointer@__OBJC@__cls_refs@AVAudioPlayer in WebviewController.o ld: symbol(s) not found collect2: ld returned 1 exit status" . So can you please tell me the solution for this type of error.... Thanks & Regards, KamalBhr "

    Read the article

  • Matching non-[a-zA-Z] characters in PHP regex

    - by Bill X
    I have some strings that need a-strippin': ÃœT: 9.996636,76.294363 Tons of long strings of location codes. A literal regex in PHP won't match them, IE $pattern = /ÃœT:/; echo preg_replace($pattern, "", $row['location']); Won't match/strip anything. (To know it's working, /T:/ does strip the last bit of that string). What's the encoding error going on here? Alternately, I would accept a concise way to take out just the numbers.

    Read the article

  • Matching 'weird' characters in PHP regex

    - by Bill X
    I have some strings that need a-strippin': ÃœT: 9.996636,76.294363 Tons of long strings of location codes. A literal regex in PHP won't match them, IE $pattern = /ÃœT:/; echo preg_replace($pattern, "", $row['location']); Won't match/strip anything. (To know it's working, /T:/ does strip the last bit of that string). What's the encoding error doing on here? Alternately, I would accept a concise way to take out just the numbers.

    Read the article

  • How to get a Clean String in Javascript?

    - by streetparade
    i have a long String. With some German characters and lots of new lines tabs ect.. In a Selectbox user can select a text, on change i do document.getElementById('text').value=this.value; But this fails. I just get a "unterminated string literal" as error in JavaScript. I think i should clean the string. How can i do it in JavaScript?

    Read the article

  • Access <script> tag from codebehind

    - by Hoque
    I was trying to access existing within Head tag. What I was doing to achieve that, foreach (Control ctrl in Header.Controls) { Response.Write(lc.GetType() + "<br/>"); } It gives me the reference of "title", "meta" and "literal" control. How can I get the control and get the "src" attribute of that tag.

    Read the article

  • Sharepoint, ajax and page title

    - by drax
    Hi, I have strange problem with sharepoint and ajax functionality. We have an UpdatePanel placed inside webpart. When partial postback occurs, page title gets missing. We have found that temporary partial solution is to write title element into one line and not use any spaces or controls inside it..not even a literal control. But we need some way to provide sommon title for all pages, so title would look like this: My default title - Current page title Any ideas how to solve this?

    Read the article

  • What is the difference between the Boolean object and the Boolean data type in JavaScript?

    - by DarkLightA
    The Boolean type has two literal values: true and false. Do not confuse the primitive Boolean values true and false with the true and false values of the Boolean object. The Boolean object is a wrapper around the primitive Boolean data type. See Boolean Object for more information. What does this mean? What's the difference between the Boolean object and the Boolean data type??

    Read the article

  • How can I implement a site with ASP.NET MVC without using Visual Studio?

    - by Cheeso
    I have seen ASP.NET MVC Without Visual Studio, which asks, Is it possible to produce a website based on ASP.NET MVC, without using Visual Studio? And the accepted answer is, yes. Ok, next question: how? Here's an analogy. If I want to create an ASP.NET Webforms page, I load up my favorite text editor, create a file named Something.aspx. Then I insert into that file, some boilerplate: <%@ Page Language="C#" Debug="true" Trace="false" Src="Sourcefile.cs" Inherits="My.Namespace.ContentsPage" %> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Title goes here </title> <link rel="stylesheet" type="text/css" href="css/style.css"></link> <style type="text/css"> #elementid { font-size: 9pt; color: Navy; ... more css ... } </style> <script type="text/javascript" language='javascript'> // insert javascript here. </script> </head> <body> <asp:Literal Id='Holder' runat='server'/> <br/> <div id='msgs'></div> </body> </html> Then I also create the Sourcefile.cs file: namespace My.Namespace { using System; using System.Web; using System.Xml; // etc... public class ContentsPage : System.Web.UI.Page { protected System.Web.UI.WebControls.Literal Holder; void Page_Load(Object sender, EventArgs e) { // page load logic here } } } And that is a working ASPNET page, created in a text editor. Drop it into an IIS virtual directory, and it's working. What do I have to do, to make a basic, hello, World ASPNET MVC app, in a text editor? (without Visual Studio) Suppose I want a basic MVC app with a controller, one view, and a simple model. What files would I need to create, and what would go into them?

    Read the article

  • How can I implement ASP.NET MVC without using Visual Studio?

    - by Cheeso
    I have seen ASP.NET MVC Without Visual Studio, which asks, Is it possible to produce a website based on ASP.NET MVC, without using Visual Studio? And the accepted answer is, yes. Ok, next question: how? Here's an analogy. If I want to create an ASP.NET Webforms page, I load up my favorite text editor, create a file named Something.aspx. Then I insert into that file, some boilerplate: <%@ Page Language="C#" Debug="true" Trace="false" Src="Sourcefile.cs" Inherits="My.Namespace.ContentsPage" %> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Title goes here </title> <link rel="stylesheet" type="text/css" href="css/style.css"></link> <style type="text/css"> #elementid { font-size: 9pt; color: Navy; ... more css ... } </style> <script type="text/javascript" language='javascript'> // insert javascript here. </script> </head> <body> <asp:Literal Id='Holder' runat='server'/> <br/> <div id='msgs'></div> </body> </html> Then I also create the Sourcefile.cs file: namespace My.Namespace { using System; using System.Web; using System.Xml; // etc... public class ContentsPage : System.Web.UI.Page { protected System.Web.UI.WebControls.Literal Holder; void Page_Load(Object sender, EventArgs e) { // page load logic here } } } And that is a working ASPNET page, created in a text editor. Drop it into an IIS virtual directory, and it's working. What do I have to do, to make a basic, hello, World ASPNET MVC app, in a text editor? (without Visual Studio)

    Read the article

  • Bizarre Escape Character Question

    - by William Calleja
    I have the following c# code embedded in a literal <% %> of a c# asp.net page string commandString = "SELECT tblData.Content " + "FROM tblData " + "WHERE (tblData.ref = N\'%"+myCurrentREF+"%\')"; This is breaking my code since it apparently cannot use the \' escape character. Why is it so? other escape characters like \" are working so why isn't \' working?

    Read the article

  • What's the best way to keep java app data stored redundantly in a file?

    - by Bijan
    If I have systems that are based on realtime data, how can I ensure that all the information that is current is redundantly stored in a file? So that when the program starts again, it uses this information to initialize itself back to where it was when it closed. I know of xstream and HSQLDB. but wasn't sure if this was the best option for data that needs to be a literal carbon copy.

    Read the article

  • C++ snippet support in visual studio?

    - by Jeremy Bell
    I'm writing code in native C++ (not C++/CLR). I know that there is no built-in support for C++ with regards to the snippet manager and snipper picker interfaces, however I found a utility called "snippy" which supposedly can generate C++ snippets. Here is a c++ snippet that the program generated: <?xml version="1.0" encoding="utf-8"?> <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>MySnippet</Title> <Shortcut>MySnippet</Shortcut> <Description>Just a test snippet</Description> <Author>Me</Author> <SnippetTypes> <SnippetType>Expansion</SnippetType> </SnippetTypes> </Header> <Snippet> <Declarations> <Literal Editable="true"> <ID>literal1</ID> <ToolTip>just a placeholder</ToolTip> <Default> </Default> <Function> </Function> </Literal> </Declarations> <Code Language="cpp"><![CDATA[cout << "$literal1$" << std::endl;]]></Code> </Snippet> </CodeSnippet> </CodeSnippets> If there is support in visual C++, even in a limited capacity, for C++ snippets, how do I add them to my environment, and what are the limitations? All I need is support for basic expansion snippets that I can invoke by typing a shortcut and hitting tab, and which supports basic literals that I can tab through (basically, if it supports the above snippet, I'm good). If this can't be done, are there any free add-ons or extensions to visual studio that support snippets for C++? I'm using both visual studio 2010 and 2008, but I mostly write code in 2010 right now.

    Read the article

  • Get the union of 2 series having different root items in WTX

    - by Jean
    Here is a sample of my problem. I have the following typetree : Root |-Text(item) |-Texts(group, delimited, literal separator=<NEXT>) I have 3 cards : serie1 (type=Texts), rule =clone("test", 3) serie2 (type=Texts), rule =clone("test", 3) union (type=Texts), rule =? How can I get the union to contain both the values from serie1 and serie2 ?

    Read the article

  • How to access 'private functions' in a singleton from another object inside it.

    - by Cedric Dugas
    I am currently trying to create a test suite for my javascript apps. My problem is that, it seems I cannot get access to init() from my utils object, as you can see below: I have my app that follow a singleton pattern: var appModal = function () { var utils = Object.create(moduleUtils); function init(caller, options ) { } }(); My test suite is in moduleUtils, this is a object literal converted to a prototype moduleUtils.debug = { addSlideTest : function(){ /* this function cannot fire init() from appModal */ }}

    Read the article

  • Cut a file based on a text marker

    - by Mustafa
    I have a text file that has the following layout: text text .. CUT HERE text text .. The literal CUT HERE appears only once. What I want to do using shell scripting, is to produce another file containing all the text below CUT HERE, i.e. ignore whatever above CUT HERE. Thanks.

    Read the article

  • When I add meta:resourcekey to LinkButton it hides label contained in link button.

    - by Vinay Pandey
    For the code below:- <asp:LinkButton ID="lbtnTest" runat="server" CssClass="toolbar" CommandArgument="Test" meta:resourcekey="lbtnTest1" OnCommand="ChangeText"> <asp:Literal ID="litTest" Text="My Text" runat="server" meta:resourcekey="litTest" /> </asp:LinkButton> When I remove meta:resourcekey="lbtnTest1" from the link button then litTest is rendered properly whereas if I have meta:resourcekey="lbtnTest1" in link button it doesn't display text for litTest. Any idea what I am doing wrong here?

    Read the article

  • Get the union of 2 series having different root items in Websphere TX

    - by Jean
    Here is a sample of my problem. I have the following typetree : Root |-Text(item) |-Texts(group, delimited, literal separator=<NEXT>, components=Text[1:s]) I have 3 cards : serie1 (type=Texts), rule =clone("test", 3) serie2 (type=Texts), rule =clone("test", 3) union (type=Texts), rule =? How can I get the union to contain both the values from serie1 and serie2 ?

    Read the article

  • How to make selection color be "on top" when background color for any text element is set in Visual

    - by Confused Developer
    Faced problem while setting background color for any element in Visual Studio 2010 editor. Selection color doesn't override this background color. So then it's very inconvenient to work with selections in editor. Case when only string literal is selected it's almost impossible to distinguish colors and see what part of string is selected. Is there any possibility to fix the problem by changing some options? Or it's a Visual Studio bug?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >