literals

Using a Scala symbol literal results in NoSuchMethod

I have recently begun using Scala. I've written a DSL in it which can be used to describe a processing pipeline in medici. In my DSL, I've made use of symbols to signify an anchor, which can be used to put a fork (or a tee, if you prefer) in the pipeline. Here's a small sample program that runs correctly: object Test extends Pipeline...

Creating dynamic text for a literal control

On the ListView1_ItemDataBound of a list view event, i create the literal.text like so... <span style=&quot;position:relative;&quot;> style="position:relative"> <span id=&quot;term1&quot; class=&quot;popup&quot;>This id="term1" class="popup">This is the answer!</span> <a href=&quot;javascript:void(0);&quot;onMouseover=&quot;ShowPop('ter...

What is this called? And how to achieve it?

I would like to make a WRITE A NEW POST page similar to ASP.NET or how to make a page similar to http://stackoverflow.com/questions/ask Please note, I do not want reference to already made controls like free rich text editor, etc. I would like to do the required coding myself. I would also like to know what is the name given to thi...

Generating clean markup with Literal and string.Format

In order to generate clean markup, I often resort to using code similar to this: <asp:Literal ID="ltItem" runat="server"> <li class="{0}"><a href="{1}">{2}</a></li></asp:Literal> And in the codebehind: ... lt.Text = string.Format(lt.Text, cssClass, item.Url, Server.HtmlEncode(item.Caption) ); Some of the advantages are:...

Properly match a Java string literal

Hi, I am looking for a Regular expression to match string literals in Java source code. Is it possible? private String Foo = "A potato"; private String Bar = "A \"car\""; My intent is to replace all strings within another string with something else. Using: String A = "I went to the store to buy a \"coke\""; String B = A.replaceAll(...

What is the 'd' in the literal 12d called?

I feel like I should know the answer to this, but I don't. What is the type character on a numeric literal called? double myDouble = 12d; float myFloat = 10f; I wanted to find a complete list of them today, but couldn't come up with what to ask Google to search for. EDIT Found a decent list if anyone is interested http://www...

Can't get rid of this warning?

I'm getting this warning "Format not a string literal and no format arguments? Any ideas? -(BOOL)isFirstPointReached{ NSString *firstPoint = [NSString stringWithFormat:[pointsToFillArray objectAtIndex:0]]; NSString *lastPoint = [NSString stringWithFormat:[pointsToFillArray lastObject]]; if([firstPoint isEqualToString:lastP...

TSQL - make a literal float value

I understand the host of issues in comparing floats, and lament their use in this case - but I'm not the table author and have only a small hurdle to climb... Someone has decided to use floats as you'd expect GUIDs to be used. I need to retrieve all the records with a specific float value. sp_help MyTable -- Column_name Type Comp...

ASP.net Literal or Page altering HTML string, causing formatting issues

We have a service that generates a report (using word templates and a 3rd party library), and then returns a string in HTML. While this HTML isn't great - its formatted correctly in this string. We want this HTML to show up on a page - format intact. What we currently have done is set an ASP.net Literal's text element to this string. ...

What's wrong with JavaScript's regular expression notation?

I was reading Douglas Crockford's web page, JavaScript: The World's Most Misunderstood Programming Language, and I couldn't help but notice that, under Design Errors, he mentions "the notation for literal regular expressions." What exactly is he talking about? What's wrong with JavaScript's notation for regular expressions, and why? ...

How exactly does the JavaScript expression [1 [{}]] parse?

Can you explain how the JavaScript expression: [1 [{}]] parses/evaluates? In Firefox, Chrome, Konqueror, and rhino, it seems to create an array with a single element, undefined. However, I don't understand why. In Firefox: [1 [{}]].toSource() produces [(void 0)] Replacing 1 with other JavaScript values seems to yield the sam...

Teradata SQL: select a literal

I want to use a list of arbitrary numbers as a sort of input to a select. Option A, of course, is to create a temporary table that contains just the values (e.g., 1,2,3). I hope that you folks know what Option >A is. Suppose the statement is like: select Fx, XXXXXX as Foo from MyTable where MyTest depends on each XXXXXX So if I cou...

visual basic to c string literals "\\.\" and "\"

In visual basic I have the following 2 strings: "\\.\" & "\" How do I represent them in C? Also, & in VB is the concatenation operator? ...

Language literal support

Are there any languages that support easily extending the compiler to support new literals example such as for json/xml/yaml/different string encodings/extra number types. I understand that you can always fork the compiler, write a dsl but that's not quite what I'm asking about. I understand that some languages such as smalltalk and lisp...

Literal field value for Solr CSV

Is there a way to provide a literal field value when adding a CSV document? The documents do not contain a necessary field, so I need a way to specify the value some other way. I've tried things like f.field.map=:VALUE to no avail. Setting a default value for the missing field in schema.xml works, but it's obviously not a practical so...

initializing char arrays in a way similar to initializing string literals

Suppose I've following initialization of a char array: char charArray[]={'h','e','l','l','o',' ','w','o','r','l','d'}; and I also have following initialization of a string literal: char stringLiteral[]="hello world"; The only difference between contents of first array and second string is that second string's got a null charact...

C99 Macro to build a quoted string literal after evaluation

I'm developing an embedded application in C99, and the project contains some integer constants defined like: #define LEVEL1 0x0000 #define LEVEL2 (LEVEL1 + 1) It has since become useful to keep track of these values for logging purposes, so I would like to use a macro to create a string literal from the evaluated versions of t...

SharePoint Designer Keeps turning &#xa; within source code into literal new line.

I am using an if statement that tests the amount of lines in a cell. <xsl:if test="string-length(@Example) - string-length(translate(@Example, '&#xa;', '')) &lt; 10"> When I type in this code and hit save, that code turns into this: <xsl:if test="string-length(@Example) - string-length(translate(@Example, ' ', '')) &lt; 10"> Instea...

How do you declare a Char literal in Visual Basic .NET?

With Option Strict On: Dim theLetterA As Char = "A" returns an error about converting the string "A" to a Char. What is the syntax to enter a Char literal? ...

Do I need a pin_ptr to pass a literal string?

Hello, From a managed c++ function I want to invoke an unmanaged function that expects a 'const char *' as an argument. Are a) and b) below correct? For b), do I need to pin_ptr 'hello'? What about a)? Thanks. a) myFunction( "hello" ); b) char hello[10] ; strcpy( hello, "hello" ); myFunction( hello ); ...