Update
If you were forced to use a single char on a split method, which char would be the most reliable?
Definition of reliable: a split character that is not part of the individual sub strings being split.
I have read through this SO question about 32-bits, but what about 64-bit numbers? Should I just mask the upper and lower 4 bytes, perform the count on the 32-bits and then add them together?
I am working on an application which requires matching of numbers from a scanned image file to database entry and update the database with the match result.
Say I have image- employee1.jpg. This image will have two two handwritten entries - Employee number and the amount to be paid to the employee. I have to read the employee number from the image and query the database for the that number, update the employee with the amount to be paid as got from the image. Both the employee number and amount to be paid are written inside two boxes at a specified place on the image.
Is there any way to automate this. Basically I want a solution in .net using c#. I know this can be done using artificial neural networks.
Any ideas would be much appreciated.
Hi folks,
Real quick question - what's the cleanest way of editing the characters in a string in C#?
i.e. what is cleanest C# equivalent of c++:
std::string myString = "boom";
myString[0] = "d";
Hello,
I am trying to set up a list of file names for a parameter to SHFileOperation. I want to be able to concatenate a file name onto the char array, but i dont want to get rid of the terminating character. for example, I want this:
C:\...\0E:\...\0F:\...\0\0
when i use strcat(), it overwrites the null, so it looks like
C:\...E:\...F:\...0\
Is there any easy way to do this? or am i going to have to code a new strcat for myself?
I am trying to set the Text property of a drop down list option like this:
<asp:ListItem Value="AB" Text='<%= Resources.Get("USA") %>'></asp:ListItem>
But it isn't working, instead the Text value is literally <%= Resources.Get("USA") %> and not the string "USA".
i.e. it is not being interpreted as code.
What is the problem?
I have a data set that I import into a SQL table every night. One field is 'Address_3' and contains the City, State, Zip and Country fields. However, this data isn't standardized. How can I best parse the data that is currently going into 1 field into individual fields. Here are some examples of the data I might receive:
'INDIANAPOLIS, IN 46268 US'
'INDIANAPOLIS, IN 46268-1234 US'
'INDIANAPOLIS, IN 46268-1234'
'INDIANAPOLIS, IN 46268'
Thanks in advance!
David
If I have a string
"this is a string"
How can I shorten it so that I only have one space between the words rather than multiple? (The number of white spaces is random)
"this is a string"
I tried to take input in form of string, specifically:
int i=0;
char c[50][500];
for(;i<50;++i)
scanf("%s",A[i]);
The input is
x is a website that allows the easy[1] creation and editing of any number of interlinked
web pages via a web browser using a simplified markup language or a WYSIWYG text editor.
In my program, I want the text to be stored as:
A[0]="x is a website that allows the easy[1] creation and editing of any number of interlinked"
A[1]=" web pages via a web browser using a simplified markup language or a WYSIWYG text editor."
But my code causes the text to be stored as
A[0]="is"
A[1]="a"
A[2]="website"
....
What am I doing wrong?
What's the cleanest way of editing the characters in a string in C#?
What's the C# equivalent of this in C++:
std::string myString = "boom";
myString[0] = "d";
I've got a string that could be in one of two forms:
prefix=key=value (which could have any characters, including '=')
or
key=value
So I need to split it either on the first or second equals sign, based on a boolean that gets set elsewhere. I'm doing this:
if ($split_on_second) {
$parts = explode('=', $str, 3);
$key = $parts[0] . '=' . $parts[1];
$val = $parts[2];
} else {
$parts = explode('=', $str, 2);
$key = $parts[0];
$val = $parts[1];
}
Which should work, but feels inelegant. Got any better ideas in php? (I imagine there's a regex-ninja way to do it, but I'm not a regex-ninja.;-)
It is well known that the user can define stream manipulators like this:
ostream& tab(ostream & output)
{
return output<< '\t';
}
And this can be used in main() like this:
cout<<'a'<<tab<<'b'<<'c'<<endl;
Please explain me how does this all work? If operator<< assumes as a second parameter a pointer to the function that takes and returns ostream &, then please explain my why it is necessary? What would be wrong if the function does not take and return ostream & but it was void instead of ostream &?
Also it is interesting why “dec”, “hex” manipulators take effect until I don’t change between them, but user defined manipulators should be always used in order to take effect for each streaming?
Customer.text is a field in an T-SQL DB (that I do not control and thus may not alter) of type "text".
I'd like to do something like this:
List<string> compare = new List<string>();
compare.Add("one");
compare.Add("two");
var q = from t in customer
where t.text.Contains( compare.First())
select t;
this will work.
But now I'd like to do something like: (!NOT WORKING!)
var q = from t in customer
where compare.Contains( t.text )
select t;
How can I achieve this? Is it even possible?
I want to assign a xml code into a string variable.
I can do this without escaping single or double-quotes by using triple-quote in python.
Is there a similar way to do this in F# or C#?
I am passing in command line arguments to my Lisp program and they are formatted like this when they hit my main function:
("1 1 1" "dot" "2 2 2")
I have a dot function and would like to call it directly from the argument, but this isn't possible because something like (funcall (second args)...) receives "dot" and not dot as the function name.
I tried variations of this function:
(defun remove-quotes (s)
(setf (aref s 0) '""))
to no avail, before realizing that the quotes were not really a part of the string. Is there a simple way to do this, or should I just check each string and then call the appropriate function?
Thanks!
I was wondering how to save PHP variables to a txt file and then
retrieve them again.
Example:
There is an input box, after submitted the stuff that was written in
the input box will be saved to a text file. Later on the results need
to be brought back as a variable. So lets say the variable is $text I
need that to be saved to a text file and be able to retrieve it back
again.
Hope it makes sense,
Thanks in advance!!!
Hi, I have a string like this String str = "la$le\$li$lo".
I want to split it to get the following output "la","le\$li","lo". The \$ is a $ escaped so it should be left in the output.
But when I do str.split("[^\\\\]\\$") y get "l","le\$l","lo".
From what I get my regex is matching a$ and i$ and removing then. Any idea of how to get my characters back?
Thanks
How do I find:
string str="(120)(1500)x";
How to find out in the event that the string contains:
string str1="()()X";
I then have to print:
console.writeline("str1 doesnt contain a numerical");
Hi folks
Looking for suggestions as to the best way to do this (I know there are many options):
take a variable like this:
$args = ('post_type=post&order_by=DESC&limit=10');
the create a function to convert that variable into parts like this:
$post_type = post;
$order_by = DESC;
$limit= 10;
Reason is I want a client to be able to use a string like the first to pass variables to a sql query in much the same way (but doesn't have to be exact) as you can do it in WordPress.
Hi all.., I have number : 1, 2, 3, 4, 10
But I wanna print that number
0001
0002
0003
0004
0010
I have search in google, the keyword is number format. but I've got nothing, I just get, frmat decimal such ass 1,000,000.00. hope you can suggest me a reference or give me some problem solving.
Thanks,
Hi Everyone:
I am wondering if there is some way to align text on the right of a photo, and keep the text in that same "box" even after the image ends using HTML and CSS. A quick "diagram" of what I am attempting to accomplish is below:
------- --------
------- --------
-Image- - Text -
------- --------
------- --------
--------
--------
Thanks for any help!