Difference between {$_GET['id']} and '".$_GET['id']."'?
Is the any difference between writing {$_GET['id']} and '".$_GET['id']."' in a sql statement? both works the same ...
Is the any difference between writing {$_GET['id']} and '".$_GET['id']."' in a sql statement? both works the same ...
I need to search through an html doc, find all of the spans and delete the spans and everything between them. What would a regular expression look like that would match everything between ? ...
Is there any way in VB.NET to remove all of the whitespaces between tags in HTML? Say, I've got this: <tr> <td> The string I've built is an entire HTML document, and it counts everything before those tags as legitimate space, so I need to trim it out. Is there a reg ex or function out there I could use to do this? Thanks ...
Does anybody know of a convenient means of determining if a string value "qualifies" as a floating-point number. BOOL IsFloat( string MyString ) { ... etc ... return ... // TRUE if float; FALSE otherwise } Thanks in anticipation. ...
In C# is there a way to detect if a string is all caps? Most of the strings will be short(ie under 100 characters) ...
Given that signed and unsigned ints use the same registers, etc., and just interpret bit patterns differently, and C chars are basically just 8-bit ints, what's the difference between signed and unsigned chars in C? I understand that the signedness of char is implementation defined, and I simply can't understand how it could ever make a...
From my database I am getting a very long string which is basically xml. I need to change it to a byte array. I can't get my head around the potential encoding issues. What do I need to be careful of when doing this conversion? public static byte[] StringToByteArray1(string str) { return Encoding.ASCII.GetBytes(str); ...
Suppose I have a large number of strings formatted something like: <tag>blah blahXXXXXblah blah</tag> I want to transform these strings into something like: blah blahZZZZZblah blah on a powershell command line. All instances of XXXXX get replaced by ZZZZZ in the transformation and the outer tags are stripped out. It isn't well-fo...
I'm looking for an algorithm, or at least theory of operation on how you would find similar text in two or more different strings... Much like the question posed here: http://stackoverflow.com/questions/246961/algorithm-to-find-similar-text, the difference being that my text strings will only ever be a handful of words. Like say I have...
Hello, I am deploying a Windows Application that uses SQL Server 2005. The program will use SQL Authentication. My question is, how do you handle the connection string when you don't know what the username/password will be? Do you load this from an encrypted file? Or are there provisions for handling this already? ...
Hi, In C++, I have a map<string, string>, containing an unknown number of entries. How can I pass this to a Lua function, so that the Lua function can use the data as a table? Hugo ...
Hi there, I'm trying to find a way to determine the difference between two strings in my script. I could easily do this with diff or comm, but I'm not dealing with files and I'd prefer not to output them to files, do the compare and read it back. I see that comm, diff, cmp all allow to pass either two files OR a file and standard input...
Hi all, I'm looking for a C++ container class, that's a lot like a multimap, but slightly different. The container would store pairs of strings. But when I retrieve items from the container using key K, I want to find all the items where K begins with the item's own key. E.G. If I use key "abcde" I want to find items with key "adc" ...
Is there a way to do the opposite of String.Split in .Net? That is, to combine all the elements of an array with a given separator. Taking ["a", "b", "c"] and giving "a b c" (with a separator of " "). UPDATE: I found the answer myself. It is the String.Join method. ...
Hi, I've this sample program of a step that I want to implement on my application. I want to push_back the int elements on the string separately, into a vector. How can I? #include <iostream> #include <sstream> #include <vector> using namespace std; int main(){ string line = "1 2 3 4 5"; //includes spaces stringstream lineS...
I'd like to take a string such as this: [One, Two[A, B[i, ii, iii, iv], C], Three] And convert it into a hierarchy of lists, so that if I execute code such as the following: Console.Write(myList[1][1][2]); The output will be: iii I'm hoping that this is a common enough requirement that there's some simple parsing code written in...
What would be the best way to search through HTML inside a C# string variable to find a specific word/phrase and mark (or wrap) that word/phrase with a highlight? Thanks, Jeff ...
I am working on a project using C. I store several records in a two-dimensional array of strings, where one string is the record name and the other string is the actual value. For example: myArray[0][0] = "filename1"; myArray[0][1] = "somefile.txt"; myArray[1][0] = "filename2"; myArray[1][1] = "anotherfile.txt"; // and so on ... I kno...
Input: 1) A huge sorted array of string SA; 2) A prefix string P; Output: The index of the first string matching the input prefix if any. If there is no such match, then output will be -1. Example: SA = {"ab", "abd", "abdf", "abz"} P = "abd" The output should be 1 (index starting from 0). What's the most algorithm way to do this ki...
Is there a function for SAP DB to get the length of a string in SQL? ...