How can I escape ContainsTable control keywords (such as NEAR or ISABOUT) so that Full Text Search will actually look for those words, and not treat them as control keywords?
Hi,
After doing a long search on stackoverflow i didn't find any one talked about this even if it's a big choice, the Question is what's the best in order to prevent both of XSS and SQL injection, Escaping the data then store it in the DB or Store it as it is and escape when output it?
Note: it is better if you give some examples of practics if possible.
Thanks
What is the opposite of String.charAt()??
If I Have a string:
var Str:String="Hello World";
How do I change the 5th character, for example, from a ' ' to an '_'?
I can GET the 5th character like this:
var C:String=Str.charAt(5);
But how do I SET the 5th character?
Thanks in advance.
I have a page, where I have approximately 90 items I need to output. Most of them are object properties (I am using ORM so these objects map to my database tables). But the question is, do I have to escape each of those 90 outputs by applying functions to each (in my case, the htmlspecialchars)? Wouldn't that add a bit of an overhead (calling a single function 90 times)?
Given a string named line whose raw version has this value:
\rRAWSTRING
how can I detect if it has the escapecharacter \r? What I've tried is:
if repr(line).startswith('\r'):
blah...
but it doesn't catch it. I also tried find, such as:
if repr(line).find('\r') != -1:
blah
doesn't work either. What am I missing?
thx!
I have a config file that takes text warnings like follows:
warnings.1 = Please check the date
These are presented to the user as HTML. I need to embed a hyperlink like the following:
warnings.1 = <a href="http://foo.com/!FOO!/">check with foo</a>
I can't for the life of me figure out how to escape this such that parse_ini_file() can read it and get that string the way I want.
I want a UILabel to render a partial character by setting the lineBreakMode to clip. But it is clipping the entire character. Is there a different way to clip a word so that only partial character is displayed?
Lets say I have a string like:
"Hello Word" and that string is in a myLabel with a width that only fits the 5 characters and part of the "W" I want it still to render part of the "W" and not drop it from the render.
The documentation on parse_ini_file (http://php.net/manual/en/function.parse-ini-file.php) states that you can't use these chars {}|&~![()^" in the value. Is there some way to escape these chars? I need to use them. Normal escaping with \ doesn't seem to work.
Simple question:
What is the pattern for the word character \w in c#, .net?
My first thought was that it matches [A-Za-z0-9_] and the documentation tells me:
Character class Description Pattern Matches
\w Matches any \w "I", "D", "A", "1", "3"
word character. in "ID A1.3"
which is not very helpful.
And \w seems to match äöü, too. What else? Is there a better (exact) definition available?
I want to know endpoint feature extraction algorithm. I want to use this algorithm in handwritten English character recognition. (for example character C have two endpoints and character M have five endpoints).
hi,
how can find position of a character in a string, and get the substring till that character.
say
char* test = "Hello world, I come back";
I want to find first occurrence 'l' character.
a<- data.frame(sex=c(1,1,2,2,1,1),bq=factor(c(1,2,1,2,2,2)))
library(Hmisc)
label(a$sex)<-"gender"
label(a$bq)<-"xxx"
str(a)
b<-data.frame(lapply(a, as.character), stringsAsFactors=FALSE)
str(b)
When I covert dataframe a columns to character,the columns labels disappeared.My dataframe have many columns.Here as an example only two columns. How to keep columns labels when numeric convert to character? Thank you!
I am using Firefox's native JSON.parse() to parse some JSON strings that include regular expressions as values, for example:
var test = JSON.parse('{"regex":"/\\d+/"}');
The '\d' in the above throws an exception with JSON.parse(), but works fine when I use eval (which is what I'm trying to avoid).
What I want is to preserve the '\' in the regex - is there some other JSON-friendly way to escape it?
i have many textboxes on a form and all textboxes require to have a character limit / character countdown (50 character left of 150), what is the best way to achieve this and can anyone please provide code to implement.
Much Grateful
Thanks
I am making a Doctrine query and I have to do a wildcard match in the where clause. How should I escape the variable that I want to insert?
The query I want to get:
SELECT u.* FROM User as u WHERE name LIKE %var%
The php code until now:
$query = Doctrine_Query::create()
->from('User u')
->where();
What should come in the where clause? The variable I want to match is $name
In c# i want to create logic that if i a string like abcabda is passed to a method then it should return first non repeative character from string like in above it should return c.
i am unable to convert a string to array of character then how to make comparison of each array character to the string and return the first non repeative character.
CanI make it like this?
class A
{
static void main()
{
A a=new A();
char ch=a.m1(abcabd);
}
}
class B
{
char m1(string s)
{
string s1=s;
char[] ch1=new char[s.length];
for(int x=0; x<s.length;x++)
{
ch1[x]=s[x];
}
for(int x=0; x<s.length; x++)
{
for(int y=0; y<s.lenth; y++)
{
if(s[x]=ch1[y])
{
/// here i am confused how to create logic for comparison please let me know
// and how to return the character
}
}
}
}
}
Hello All,
I want to make an sql statement -
sqlStatement = [NSString stringWithFormat:@"SELECT * FROM movies where title like '%%@%'",searchKeyword];
But sqlStatement is becoming -
"SELECT * FROM movies where title like '%@'"
I want to make it
"SELECT * FROM movies where title like '%searchKeyword%'"
How can I escape the "%" character?
Thanks