How do I find if a string contains html data or not? (note: user provides input via rich:editor and its quite possible he could have used either a simple text or used html formatting)
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.
I have 4 numeric up down controls on a form. They are set to hexidecimal, maximum 255, so they'll each have values from 0 to FF. I'd like to concatenate these values into a string for a textbox.
I am a beginner Java programmer. I am attempting to make a simple text editor. I have got the text from the text field into a variable that's a String, called "text".
My question is, how can I save the contents of the "text" variable to a text file?
Thank you!
I have strings like "5d4h2s", where I want to get 5, 4, and 2 from that string, but I also want to know that 5 was paired with d, and that 4 was paired with h, etc etc. Is there an easy way of doing this without parsing char by char?
Hi folks:
I have a question about algorithm:
How to find all characters in a string whose appearance is greater than a specific number, say 2 for example efficiently?
Regards.
Say I have a bunch of functions, each with something likeMyFunction.1, etc. I want to pass these functions into another function, which prints out a small report. Ideally I'd like to be able to label sections of a report by which function is being used to generate the results.
So are there any nice ways of getting the name of a predefined function as a string?
i need the code to convert the string type data into integer type data if i have entered a numerical value in the text box.
i am using visual c++ windows forms and the visual studio
Trying to format a date string using a technique I've used countless times, suddenly returning false (PHP5). Anyone run into this?
//$new_date = June 14,2010
echo $new_date;
$new_date = date("F j, Y", strtotime($new_date));
//returns the infamous December 31, 1969 because strototime() is returning false?
Just wondering if there is an easy way around my issue. If I want to place a large chunk of HTML into a string, how's it possible without escaping the HTML first? There is so much HTML which is used for my MySpace bot (inserting into profiles) that it will take forever to escape.
It seems that if there is a sql memory leak somewhere and you dont have time to find it you can use the load balance timeout option in a sql connection string to destory the connection after x seconds.
Am i right in assuming I can set the load balance time out to 30-40 seconds and then hunt for the leak latter, while in the mean time the leak will not affect my application too much.
I have a string which is like this:
this is "a test"
I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:
['this','is','a test']
PS. I know you are going to ask "what happens if there are quotes within the quotes, well, in my application, that will never happen.
I have a string Paris, UK, Pakistan, China, Madagascar
I need to ensure that I hav only names and after the third name I insert ...
i.e
Paris, UK, Pakistan...
How can i do this?
In Eclipse, I have created a Run configuration with some VM arguments and starting class. How can I get the string that eclipse uses to launch the project so that I can run it without using eclipse?
I'm trying to declare an enum type based on data that I'm retrieving from a database. I have a method that returns a string array of all the rows in the table that I want to make into an enumerated type. Is there any way to construct an enum with an array?
This is what I tried, but from the way it looked in eclipse, it seemed like this just created a method by that name:
public enum ConditionCodes{
Condition.getDescriptions();
}
Thank you in advance!
Possible Duplicate:
Can I add custom methods/attributes to built-in Python types?
In Ruby you can override any built-in object class with custom method, like this:
class String
def sayHello
return self+" is saying hello!"
end
end
puts 'JOHN'.downcase.sayHello # >>> 'john is saying hello!'
How can i do that in python? Is there a normally way or just hacks?
I am creating a secure web based API that uses HTTPS however if I allow the users to configure it (include sending password) using a query string will this also be secure or should I force it to be done via a POST?
Hi, just going through the registry retrieving values and binary is making my file outputer fall.
I was wondering how could I convert Subkey.getValue(value[i]) into a String if the Value type is binary?
Thank you in advance
Hi, i've recently done a migration from a really old version of some application to the current version and i faced some problems while migrating databases.
I need a query that could help me to compare columns in two tables. I mean not the data in rows, i need to compare the columns itself to figure out, what changes in table structure i've missed.
hi
i writing stream in to file and stdout
but im getting somekind of encoding like this:
"\u05ea\u05e7\u05dc\u05d9\u05d8 \u05e9\u05e1\u05d9\u05de\u05dc \u05e9\u05d9\u05e0\u05d5\u05d9 \u05d1\u05e1\u05d2\u05e0\u05d5\u05df \u05dc\u05d3\u05e2\u05ea\u05d9 \u05d0\u05dd \u05d0\u05e0\u05d9 \u05d6\u05d5\u05db\u05e8 \u05e0\u05db\u05d5\u05df"
how can i convert it to printable string
I have a string with this value:
2010-05-13 23:17:29
I'd like to format it and am using the following code:
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateStyle = NSDateFormatterMediumStyle;
NSDate *formattedDate = [formatter dateFromString:dateString];
[formatter release];
When the debugger reaches the release line, formattedDate shows "invalid CFStringRef" and
Cannot access memory at address 0x0
Any ideas what I'm doing wrong?
If I have an array named $myArray how can I get a reference to it from a string of the same name myArray. I tried:
eval('myArray');
But that gave me an error.
Hi, im traversing through the registry, taking the values of the keys and storing them as strings. I have discovered there are many different types. Some of these types are causing my filestream writer to fail. Is it possible to convert all of the below into a string form. The actual data value is not important, just the ability to differentiate between different values.
DWORD
ExpandString
Binary (is this just the same as byte[] ?)
MultiString
My json object looks like:
User { ID: 234, name: 'john', ..);
I want to build a string of all the ID's.
How can I do this? is there a more elegant way than below?
var ids = '';
for(int x = 0; x < json.length; x++)
{
ids += json[x].Id + ",";
}
// strip trailing id