literals Questions
4
How do you write a Binary Literal in Dart?
I can write a Hex Literal like so:
Int Number = 0xc
If I try the conventional way to write a Binary Literal:
Int Number = 0b1100
I get an error. I've tr...
2
Solved
I have a string in UTF-8 format but not so sure how to convert this string to it's corresponding character literal. For example I have the string:
My string is: 'Entre\xc3\xa9'
Example one:
This...
4
Solved
In C one can have string literals in the form of
char *string = "string here";
integer literals:
uint8_t num = 5;
long literals:
long long bigNum = 90322L;
floating point literals:
float...
5
Solved
Problem
Is there a way in Typescript to define a type that is only a string literal, excluding string itself?
Note that I am not talking about a certain list of string literal; for which, a simpl...
Glaswegian asked 12/2, 2020 at 9:30
6
Solved
In order to work with decimal data types, I have to do this with variable initialization:
decimal aValue = 50.0M;
What does the M part stand for?
5
I want to narrow a string to a string literal union. In other words, I want to check if the string is one of the possible values of my literal union, so that this will work (if the operator couldbe...
Buckbuckaroo asked 16/5, 2017 at 14:43
5
Solved
I have a struct type with a *int64 field.
type SomeType struct {
SomeField *int64
}
At some point in my code, I want to declare a literal of this (say, when I know said value should be 0, or po...
3
Solved
I'm confused about the type of a string literal. Is it a const char * or a const char?
Tympanist asked 20/9, 2012 at 17:45
3
I'm trying to use a "literal" multi-column table for a join query with Oracle 11g.
Here's the best I've come up with, based on this answer (
this answer suggests a much nicer syntax, but it only w...
7
Solved
In a verbatim string literal (@"foo") in C#, backslashes aren't treated as escapes, so doing \" to get a double quote doesn't work. Is there any way to get a double quote in a verbatim string liter...
Bruch asked 18/12, 2009 at 15:36
6
Solved
I have the function below which accepts a bool pointer. I'm wondering if there is any notation which allows me to set the value of the is field to true in the struct literal; basically without to d...
11
Solved
"foo" instanceof String //=> false
"foo" instanceof Object //=> false
true instanceof Boolean //=> false
true instanceof Object //=> false
false instanceof Boolean ...
Vaccaro asked 15/10, 2008 at 4:44
2
Solved
Does C++23 now provide support for Unicode characters in its basic char type, and to what degree?
So on cppreference for character literals, a character literal:
'c-char'
is defined as either:
...
Crescendo asked 6/9, 2023 at 20:46
9
Solved
When you create an integer with leading zeros, how does C handle it? Is it different for different versions of C?
In my case, they just seem to be dropped (but maybe that is what printf does?):
#in...
24
I am working through the book "Introduction to Computation and Programming Using Python" by Dr. Guttag. I am working on the finger exercises for Chapter 3. I am stuck. It is section 3.2, page 25. T...
3
Solved
I want to use the format! macro with a String as first argument, but because the macro expects a string literal, I am not able pass anything different to it.
I want to do this to dynamically add st...
9
Solved
Typically, I've seen people use the class literal like this:
Class<Foo> cls = Foo.class;
But what if the type is generic, e.g. List? This works fine, but has a warning since List should be...
4
Solved
When I try to assign an 128-bit integer in gcc 4.9.1, I get a warning: integer constant is too large for its type.
Example Code
int main(void) {
__uint128_t p = 47942806932686753431;
return 0;
}...
3
Solved
I'm in trouble trying to remove rows from a dataframe based on two-column list of items to filter. For example, for this dataframe:
df = spark.createDataFrame([(100, 'A', 304), (200, 'B', 305), (30...
Homely asked 6/1, 2017 at 18:22
5
C++03 5.1 Primary expressions §2 says:
A literal is a primary expression. Its type depends on its form (2.13). A string literal is an lvalue; all other literals are rvalues.
Similarly, C99 6.5...
Doti asked 4/4, 2012 at 3:23
14
Solved
Technically, any odd number of backslashes, as described in the documentation.
>>> r'\'
File "<stdin>", line 1
r'\'
^
SyntaxError: EOL while scanning string literal
>>> ...
1
Solved
Is this really the best way to declare a byte (or array of bytes)?
static constexpr byte kGuard1_[] = {
byte{0x45}, byte{0x23}, byte{0x12}, byte{0x56}, byte{0x99}, byte{0x76}, byte{0x12}, byte{0x5...
Hardness asked 10/2, 2023 at 13:26
2
Solved
In golang what are struct literals?
Why is the following a literal even though there is a variable? And aren't structs literally variable, even when not const? So how does it make sense.
MyType{F...
8
Solved
Sometimes for algebraic types it is convenient to have a constructor that takes a literal value 0 to denote the neutral element, or 1 to denote the multiplicative identity element, even if the unde...
4
Solved
What is the meaning and difference between these queries?
SELECT U'String' FROM dual;
and
SELECT N'String' FROM dual;
Gavrah asked 3/1, 2018 at 11:25
1 Next >
© 2022 - 2024 — McMap. All rights reserved.