I'm having problems placing an equals character in my locale file
I have to do something like this:
#greater value
greater_value = the value must be ( >= ) than the corresponding value
but when the thing is displayed in the ui the text after the second equals is missed
how do you place an equals character in a flex locale file?
edit: I have already used, escape characters, ascci code, html codes and unicode unicodes.
You can use unicode character representation:
greater_value = the value must be ( >\u003D ) than the corresponding value
I dont know why but the unicode representation didnt work for me, what I finally did was to use the solution proposed by harry ninh, using the StringUtil.substitute.
There is a little bit tricky way to overcome this problem:
greater_value = the value must be ( {0} ) than the corresponding value
Then in your AS code, use StringUtil.substitute(localeString, ">=");
Related
I have a variable named full.path.
And I am checking if the string contained in it is having certain special character or not.
From my code below, I am trying to grep some special character. As the characters are not there, still the output that I get is true.
Could someone explain and help. Thanks in advance.
full.path <- "/home/xyz"
#This returns TRUE :(
grepl("[?.,;:'-_+=()!##$%^&*|~`{}]", full.path)
By plugging this regex into https://regexr.com/ I was able to spot the issue: if you have - in a character class, you will create a range. The range from ' to _ happens to include uppercase letters, so you get spurious matches.
To avoid this behaviour, you can put - first in the character class, which is how you signal you want to actually match - and not a range:
> grepl("[-?.,;:'_+=()!##$%^&*|~`{}]", full.path)
[1] FALSE
Hello, I've been trying to get this to work for ages now and I've ran out of options. No matter what I try, the value for a double/decimal is always invalid according to the Jquery validator. This is a list of what I tried:
Set culture in web.config
Set culture in CurrentThread
Change type from Decimal to Double
Change input type from Number to Text
Use globalize.js
Use a custom regex fix found on here
Use a DecimalBinder found on here
Nothing, absolutely nothing fixes this error. I'd greatly appreciate if somebody could point out what I was doing wrong here.
DisplayFormat.DataFormatString uses .NET's predefined formatting rules. In particular, the . (dot/period) is always interpreted to mean "the decimal point of the current culture", which in your case is ,, or comma.
If you want a literal dot separating the whole and fractional parts of the number, you need to escape it:
[DisplayFormat(DataFormatString = #"{0:0\.00}", ApplyFormatInEditMode = true)]
I have a function with an argument that is a link to a file. My problem is, that even though I specify that I want to have a string here, a part of it seems to be recognized as a date. This results in a part of my string being replaced by "t-". How do I prevent this from happening?
smfunc <- function(link=as.character("T:\11-10-2017 - Folder\filename.csv"))
{
link
}
smfunc()
[1] "T:\t-10-2017 - Folder\filename.csv"
How do I prevent this from happening?
Easy: this does not happen (that would be terrible). The problem is different: you forgot to escape the backslashes:
smfunc = function (link = "T:\\11-10-2017 - Folder\\filename.csv") {
link
}
Without the escaped backslashes, '\11' is interpreted as a numeric character code (with value 11oct = 9dec, which is equivalent to the tab character '\t').
'\f', by pure chance, is a valid escape sequence equivalent to the “form feed” character. This is not the same as '\\f', i.e. a literal backslash followed by an “f”, and which is what you need.
Using as.character, incidentally, is redundant here: your value is already a character vector.
I would like to query an SQLite table that contains directory paths to find all the paths under some hierarchy. Here's an example of the contents of the column:
/alpha/papa/
/alpha/papa/tango/
/alpha/quebec/
/bravo/papa/
/bravo/papa/uniform/
/charlie/quebec/tango/
If I search for everything under /bravo/papa/, I would like to get:
/bravo/papa/
/bravo/papa/uniform/
I am currently trying to do this like so (see below for the long story of why I can't use more simple methods):
SELECT * FROM Files WHERE Path >= '/bravo/papa/' AND Path < '/bravo/papa0';
This works. It looks a bit weird, but it works for this example. '0' is the unicode code point 1 greater than '/'. When ordered lexicographically, all the paths starting with '/bravo/papa/' compare greater than it and less than 'bravo/papa0'. However, in my tests, I find that this breaks down when we try this:
SELECT * FROM Files WHERE Path >= '/' AND Path < '0';
This returns no results, but it should return every row. As far as I can tell, the problem is that SQLite is treating '0' as a number, not a string. If I use '0Z' instead of '0', for example, I do get results, but I introduce a risk of getting false positives. (For example, if there actually was an entry '0'.)
The simple version of my question is: is there some way to get SQLite to treat '0' in such a query as the length-1 string containing the unicode character '0' (which should sort strings such as '!', '*' and '/', but before '1', '=' and 'A') instead of the integer 0 (which SQLite sorts before all strings)?
I think in this case I can actually get away with special-casing a search for everything under '/', since all my entries will always start with '/', but I'd really like to know how to avoid this sort of thing in general, as it's unpleasantly surprising in all the same ways as Javascript's "==" operator.
First approach
A more natural approach would be to use the LIKE or GLOB operator. For example:
SELECT * FROM Files WHERE Path LIKE #prefix || '%';
But I want to support all valid path characters, so I would need to use ESCAPE for the '_' and '%' symbols. Apparently this prevents SQLite from using an index on Path. (See http://www.sqlite.org/optoverview.html#like_opt ) I really want to be able to benefit from an index here, and it sounds like that's impossible using either LIKE or GLOB unless I can guarantee that none of their special characters will occur in the directory name, and POSIX allows anything other than NUL and '/', even GLOB's '*' and '?' characters.
I'm providing this for context. I'm interested in other approaches to solve the underlying problem, but I'd prefer to accept an answer that directly addresses the ambiguity of strings-that-look-like-numbers in SQLite.
Similar questions
How do I prevent sqlite from evaluating a string as a math expression?
In that question, the values weren't quoted. I get these results even when the values are quoted or passed in as parameters.
EDIT - See my answer below. The column was created with the invalid type "STRING", which SQLite treated as NUMERIC.
* Groan *. The column had NUMERIC affinity because it had accidentally been specified as "STRING" instead of "TEXT". Since SQLite didn't recognize the type name, it made it NUMERIC, and because SQLite doesn't enforce column types, everything else worked as expected, except that any time a number-like string is inserted into that column it is converted into a numeric type.
More than a long talk to explain that bug, here's a screenshot that explains everything :
As soon as we enter an "e" inside the url which correspond to rss_category, it no longer match the route. See :
!
We resolved this by forcing a requirements for {slugCat} to accept anything .^ (they were no requirements before)
If that can help someone somday, and if anyone has a valid explanation, i'll be glad to hear (runing under Symfony 2.1.1).
Wow, difficult one. This happens because when compiling the route, symfony tries to use the character preceeding the variable name as a separator. This code is from RouteCompiler.php:
// Use the character preceding the variable as a separator
$separators = array($match[0][0][0]);
if ($pos !== $len) {
// Use the character following the variable as the separator when available
$separators[] = $pattern[$pos];
}
$regexp = sprintf('[^%s]+', preg_quote(implode('', array_unique($separators)), self::REGEX_DELIMITER));
Symfony does this because usually you will have some kind of separator before the variable name, a route like /upload/rssArticle/{slugCat}, where '/' would be the separator and it is trying to be helpful by letting you use this separator to separate variables in routes which contain several variables. In your case, the character before the variable is an 'e' and that character becomes a separator and that is why your route does not match. If your route had beed /upload/rssArticles{slugCat}, then the 's' would be the separator and that would be the character you would not be able to use.
Maybe you could create an issue on the symfony router component. I think that the preceeding character should not be used as a separator if it is a letter or a number.