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)
What's the best way to convert (to hash) a string like 3800290030, which represents an id for a classification into a four character one like 3450 (I need to support at max 9999 classes).
The hash needs to be unique and always the same for the same an input.
If possible, the hash should also be reversible (but this is not required).
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.
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.
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!
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
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 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?
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!
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.
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
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?
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.
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.
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
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 300 boolean fields in one table, and im trying to do somithing like that:
One string field:
10000010000100100100100100010001
Ha a simple way to do a simple search os this field like:
select * from table where field xor "10000010000100100100000000010001"
Im tring this but is to long:
select * from teste where mid(info,2,1) and mid(info,3,1)
:) Help!!
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
I am using Convert.ToInt32(ddlBuyer1Country.SelectedValue); to typecast a string returned by selectedvalue.
But this is giving me 0 instead of 3. I have selected value as 3 in this case.
var responseFromServer = "{\"flag\":true,\"message\":\"\",\"result\":{\"ServicePermission\":true,\"UserGroupPermission\":true}}";
var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
var responseValue = serializer.DeserializeObject(responseFromServer);
responseFromServer value is get a webservice, and then how to get the json string value, such as "flag","Servicepermission"??