string

SQL Server VARCHAR(2) join performance vs. INT

Hi I have a table of q-grams (2 letter strings). I need to join another table to this on the CHAR(2) field. Would it be faster to convert these 2-grams into a number (e.g. aa=1, ab=2, ac=3) and convert the fields in both this table and the referencing table to an INT and join using an INT rather? Kind regards Peter ...

Find a string within the source code (DDL) of a stored procedure in oracle.

Hello, I need to find a string in the source code (DDL) for all stored procedures in Oracle schema. I use this query to perform the task, but I think can be improved SELECT T0.OBJECT_NAME FROM USER_PROCEDURES T0 WHERE T0.OBJECT_TYPE='PROCEDURE' AND INSTR( (SELECT DBMS_METADATA.GET_DDL('PROCEDURE',T0.OBJECT_NAME,'MySCHEMA') ...

In C#, can I escape a double quote in a literal string?

In a literal string (@"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 literal string? (This understandably doesn't work: string foo = @"this \"word\" is escaped";) ...

Subsonic SimpleRepository Nullable string problem

Hi I am having a problem with subsonic simplerepository. I have a users class and it has some optional fields.these optional fields are of type string. As soon as I try to persist my object , if the optional fields are null , an exception is being thrown I know string is already of type nullable so i cannot do something like nullab...

convert number to string

I have: int i=8; i.ToString(); if i do this i get "8" i want "08" is possible setting an option in tostring parameter ? ...

string split function in delphi

Hello, All actually i was opened question previously, but can't get answer what i exactly want, so i would like to ask again thanks All for example, i have some text file name is 'test.txt' , and inside text contents looks like hello all good day happy is and i want to modify following source to iterate from first index of 'hello ...

Why doesn't scanf need an ampersand for strings and also works fine in printf (in C)?

I am learning about strings in C now. How come to use scanf to get a string you can do scanf("%s",str1); and for printf you can do printf("The string is %s\n", str1); I understand that for scanf it is because the string is just a character array which is a pointer, but for printf, how is it that you can just put the variable name...

PHP explode function

I want to let the user type in tags: windows linux "mac os x" and then split them up by white space but also recognizing "mac os x" as a whole word. Is this possible to combine the explode function with other functions for this? There has to be a way. ...

split a string into certain sections

I need to create an easy way to split up some strings into formatted strings, for example, i have this string ":[email protected] PRIVMSG #channel :test message" and i need to split that into: string nickname = "JStoker" string ident = "stoker" string host = "jcs.me.uk" string channel = "#channel" string message = "test messa...

What's a portable way of converting Byte-Order of strings in C

I am trying to write server that will communicate with any standard client that can make socket connections (e.g. telnet client) It started out as an echo server, which of course did not need to worry about network byte ordering. I am familiar with ntohs, ntohl, htons, htonl functions. These would be great by themselves if I were trans...

Unicode to string conversion in Java

I am building a language, a toy language. The syntax \#0061 is supposed to convert the given Unicode to an character: String temp = yytext().subtring(2); Then after that try to append '\u' to the string, I noticed that generated an error. I also tried to "\\" + "u" + temp; this way does not do any conversion. I am basically trying...

Is there a compressed representation of Xpath?

I am working on a project which requires working with XPath (on HTML). The (multiple) XPath is transferred to client-side inside JavaScript. Since XPath strings are long, I was wondering if there is a shorter representation which is equivalent to XPath? Perhaps one which works sort of like huffman encoding but specific to XPath. ...

J2ME String Splitter Counter

J2ME String Tokenizer: public String[] split(String toSplit, char delim, boolean ignoreEmpty) { StringBuffer buffer = new StringBuffer(); Stack stringStack = new Stack(); for (int i = 0; i < toSplit.length(); i++) { if (toSplit.charAt(i) != delim) { buffer.append((char) toSplit.charAt(i)); } else...

Tips for embedding a longer text in source code, as in languages like Perl?

Possible Duplicate: Something like print END << END; in C++? In a shell script or in a perl program the so called "HERE" documents are commonly used for longer text, e.g. Perl: my $t=<<'...'; usage: program [options] arg1 arg2 options: -opt1 description for opt1 -opt2 description for opt2 ...

Regular Expression to split on specific character ONLY if that character is not in a pair

After finding the fastest string replace algorithm in this thread, I've been trying to modify one of them to suit my needs, particularly this one by gnibbler. I will explain the problem again here, and what issue I am having. Say I have a string that looks like this: str = "The &yquick &cbrown &bfox &Yjumps over the &ulazy dog" You'...

Word occurrence in a String(word count)

Hello. Im stuck on writing Word occurrence in a string. I got some tip(in task notes) to use is compareToIgnoreCase. so I tried something like this: splitwords = StringCont.split("\\s"); for(int i=0; i<splitwords.length; i++) { if(splitwords[1].compareToIgnoreCase(splitwords[i]) == 0) splitcount++; } It is of course just w...

How to iterate over a string using a buffer (python)

Hi all, I'm trying to find some code that, given a string, will allow me to iterate over each line using the for loop construct, but with the added requirement that separate for loop constructs will not reset the iteration back to the beginning. At the moment I have sList = [line for line in theString.split(os.linesep)] for line in SL...

reading int from console

How can I convert a String array into an int array in java? I am reading a stream of integer characters into a String array from the console, with BufferedReader br = new BufferedReader (new InputStreamReader(System.in)); for(c=0;c<str.length;c++) str[c] = br.readLine(); where str[] is String typed. I want to compare the str[] ...

How to convert string (containing double max) to double

I have no problem converting "normal" double values, but I can't convert numeric_limits<double>::max() or DBL_MAX string representations? std::string max = "1.79769313486232e+308"; std::istringstream stream(max); double value; // enters here, failbit is set if (!(stream >> value)) ...

How to make a Ruby string safe for a filesystem?

I have user entries as filenames. Of course this is not a good idea, so I want to drop everything except [a-z], [A-Z], [0-9], _ and -. For instance: my§document$is°° very&interesting___thisIs%nice445.doc.pdf should become my_document_is_____very_interesting___thisIs_nice445_doc.pdf and then ideally my_document_is_very_interest...