If I've got a symbol `MSFT and I want to get a string "MSFT", I thought I'd be able to do:
`string$`MSFT
but this doesn't work.
I had also expected the opposite to be true, that I would be able to:
`$"MSFT"
and be returned `MSFT, but this doesn't seem to work either.
What am I doing wrong?
This is how to string a symbol.
q)string`MSFT
"MSFT"
Your syntax for casting to symbol looks correct to me - not sure what the issue is on your end.
q)`$"MSFT"
`MSFT
Related
So as in the title, I'm trying to format a date in dd_mm_yy format using time.Now().Format("02_01_2006") as shown in this playground session:
http://play.golang.org/p/alAj-OcRZt
First problem, dd_mm_yyyy isn't an acceptable format, only dd_mm_yy is, which is fine I can manipulate the returned string myself.
The problem I have for you is to help me figure out what Go is even trying to do with this input.
You should notice the result you get is:
10_1110009
A good few thousand years off and it's lost the underscore which it only does it for _2. Does this character sequence represent something special here?
Replacing the last underscore with a hyphen or space returns a valid result. dd_mm_yy works fine. Just this particular case seems to completely fly off the handle.
On my local machine (Go playground is on a specific date) the result for today (the 5th) is:
05_01 5016
Which is equally strange, if not moreso as it's substituted in a space which seems to be an ANSIC thing.
This is very likely due to the following bug: https://github.com/golang/go/issues/11334
This has been fixed in Go 1.6beta1
Found an issue from their github:
https://github.com/golang/go/issues/11334
Basically _2 is taking the 2 as the day value from the reference time and then trying to parse the rest (006) which it doesn't recognise so it all goes wrong from there.
I'm typing up a table with org mode, where the equal sign(=) if the first character in the cell and it want to start a formula. how do I get it to display the symbol without it being a formula, of a way to use formulas to display it. I get errors when I use single quotes, and I see the Unicode decimal value when using double quotes.
I have tried the following
='=+'
="=+"
they give
#ERROR
[61, 43]
Use an escaped entity, \equal{} and it should display as you wish. See the variable org-entities for others you can use.
I'm a bit late :D
There may be a better way, but you can try with :='(format "=+")
Source: https://emacs.stackexchange.com/questions/19183/can-i-use-formula-to-manipulate-text-in-org-mode-table
When I ran into this problem just now, I found that I was able to get around it by replacing the equals sign with some other similar-looking character. Two which come to mind are ꞊ ‘U+A78A MODIFIER LETTER SHORT EQUALS SIGN’ and ⹀ ‘U+2E40 DOUBLE HYPHEN’.
I recently have seen an expression in Crystal. It's a formula, when I edit it, its content is something like this:
("sNumber") + ":"
However, when I print this report, the code above will become: Number:
I think ("sNumber") is something like a variable. But I cannot find where it is be declared. I searched a lot on web but I find nothing.
So my question is:
Where can I find it?
How can I edit its value?
Any help would be welcome!
UPDATE:
I tried some expression, and find out all string after "s" will be displayed on the report, and those before "s" will be removed.
Maybe it's just some string expression not in document. If someone knows the specification, please add below.
After some further test, I have to say it is not a variable. It's just that everything after the letter "s" will be printed.
But I can see the whole string "sNumber" in the preview view.
My conclusion is if I want to change it, just modify the string after "s".
try this in your Formula "(""sNumber"") :" if you just need to create it as string
Hi i'm trying to let lex/yacc split this string
table subwayLines:int[3]
into tokens of table, subwayLines, int[3] with the [3] optional(i.e. int or int[3])
everything is fine until i try to recognize the "int",
so this is what i did in lex
[A-Za-z0-9\[\]]+ { /* column property*/
yylval.sval = (char *)strdup(yytext);
char* temp=yylval.sval;
return STRING;
}
i know the problem is in
[A-Za-z0-9\[\]]+
because when i changed it to
[A-Za-z]+("[")?+[0-9]+("]")?+(",")?
it works except I still can't go without the "[" or "]", for example, if i wrote this in my string:
table subwayLines:int
then it gives me a syntax error
so does anyone knows how to do change it? thanks
To make the [3] optional, this will not work:
[A-Za-z]+("[")?+[0-9]+("]")?+(",")?
You've made only the square brackets optional, but not the number in between. You need something like
[A-Za-z]+("["[0-9]+"]")?
I.e. the entire square-bracketed part is optional.
Also the combination (REGEX)?+ doesn't make much sense (the ?+ part of it). It's equivalent to (REGEX)*, since you're effectively saying that (REGEX) is optional, one or more times, which is like zero or more.
(Not sure why you have the optional comma in the second example; the first one doesn't recognize a comma and it's not shown in your example input.)
Referencing the page number variable in JasperReport as $V{PAGE_NUMBER}. Of course that works fine. However, I would like this report to have a page number preceded by a letter, as in:
A-1
A-2
...
A-N
Unfortunately, this does not appear to be permitted. Even when I get the expression editor to accept an expression, it still fails to compile. Always with "cannot cast from String to Integer", or "cannot cast from Integer to String" errors, or sometimes both.
"A-".concat($V{PAGE_NUMBER}.toString()) does not work. No possible variation works, mystifyingly.
Just a note, you can write it as "A-" + $V{PAGE_NUMBER}
Yeah, you can't teach smart. I neglected to change the field type from Integer to String. And I was about to disparage an awesome free product. D'Oh.