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
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
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
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 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?
I want someone to type words in the console, and autocomplete from a list when they hit "tab" key. However, raw_input won't return a string until someone hits [Enter].
How do I read characters into a variable until the user hits [Enter]?
*Note: I don't want to use import readline for autocompletion because of OS issues.
Hi everyone,
I am in the middle of building a cache layer for the Redis DB to my application and I have come to the point where's it's about to take care of arrays.
I wonder if there's any good (high performance!) way of controlling an string to be serialized or not with PHP?
Thanks a lot!
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"??
How do I restrict a string to whitelisted characters?
// "HOW am I to understand; this is, BAD"
$str = restrictTo($str,"0-9a-z,. ");
// " am I to understand this is, "
Is there an inbuilt function in PHP that does something close? I can't formulate a regular expression for this though :(
Attempting to insert an escape character into a table results in a warning. For example:
create table EscapeTest (text varchar(50));
insert into EscapeTest (text) values ('This is the first part \n And this is the second');
Produces the warning:
WARNING: nonstandard use of escape in a string literal
(Using PSQL 8.2)
Anyone know how to get around this?
I'd like to test whether a string contains "Kansas" followed by anything other than " State".
Examples:
"I am from Kansas" true
"Kansas State is great" false
"Kansas is a state" true
"Kansas Kansas State" true
"KansasState" true
(For my immediate purposes this should work with mysql's REGEXP but if there's a more elegant way using PCRE, I'd like to see that too.)
I need to verify that the provided string has only allowed characters using Oracle regular expressions (REGEXP_LIKE).
Allowed chars are: abcdefghijklmnopqrstuvwxyz0123456789_-.
Trying to execute
SELECT CASE
WHEN REGEXP_LIKE('abcdefghijklmnopqrstuvwxyz0123456789_-.'
, '^[a-z0-9_\-\.]+$')
THEN 'true'
ELSE 'false'
END tmp
FROM dual;
results in 'false'.
Any ideas on this?
I've got a parser written using ruby's standard StringScanner. It would be nice if I could use it on streaming files. Is there an equivalent to StringScanner that doesn't require me to load the whole string into memory?
I have a string representing bits, such as:
"0000101000010000"
I want to convert it to get an array of bytes such as:
{0x0A, 0x10}
The number of bytes is variable but there will always be padding to form 8 bits per byte (so 1010 becomes 000010101).
I have a string of the form "a-b""c-d""e-f"...
Using preg_match, how could I extract them and get an array as:
Array
(
[0] =>a-b
[1] =>c-d
[2] =>e-f
...
[n-times] =>xx-zz
)
Thanks
I have:
tXML = "<type p_type=\"All\"/>";
if I do
Response.Write(tXML);
I get a blank space.
Is there anyway to output this string so I know it is being created?
Hi All,
i am trying to figure out how to write a linq query that will return a child collections "name" property as a string.
I have a BO that has a "options" property where the options are the "name" property of each option in an "order" object.
I would like the result to look something like
order.id = 12312
order.date = 12/03/10
order.options = "Option 1 Name, Option 2 Name, Option 3 Name"
I hope this makes sense. thanks for any and all help!
i have an variable
<?php
$a="$testit with $";
ehco $a;
its shows undefined variable $testit but it is not an variable its an string how to do it in php...
How to truncate sthe string to 75 characters only in python
This is how it was done in javascript
var data="saddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddsaddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddsadddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
var info = (data.length > 75) ? data.substring[0,75] + '..' : data;