I have a hex string (length 48 chars) that I want to convert to raw bytes with the pack function in order to put it in a Win32 vector of bytes.
How I can do this with Perl?
Say i have this PHP code:
$FooBar = "a string";
i then need a function like this:
print_var_name($FooBar);
which prints:
FooBar
Any Ideas how to achieve this? Is this even possible in PHP?
Hi,
I am getting the following error while running a select statement (using OleDbCommand).
My query is
SELECT CME
FROM Personnel
WHERE CME = '11349D'
If objOleDbCom.ExecuteScalar() 0 Then
When i execute the above statement i got this error
Conversion from string "11349D" to type 'Double' is not valid.
My field CME data type is Text
My database is Access 2007
I tried by running my query directly inside database and it is running fine.
Please suggest.
Thanks.
i have a dictionary when i pass it over simplejson.dumps(dict) the json output has put some sort of encoding on a string url?
"link": "http:\/\/www.mydomain.com"
How can i stop this?
Im using app engine simplejson.
^(.)+\S{10}(.)+$
I have that regex which will match any string that contains a word of 10 characters.
However I need the INVERSE of that.
A regex that will only match strings which do NOT have words of =10 characters.
NSString *myString = [NSString stringWithFormat:@"%@",BernabÈu];
NSLog(@"%@", myString);
Above statement prints:
Bernab\u00c8u
Here 'BernabÈu' is spanish character string
Why "\u00c8u" appended .How to get rid of this
In Python 2.x, using backticks to get decimal string from int object is Horrible?
Because backticks are repr(), not str()? I have noticed that when I answering this question.
In Python source, they have same function in Python source, intobject.c
(reprfunc)int_to_decimal_string, /* tp_repr */
....
(reprfunc)int_to_decimal_string, /* tp_str */
What do you think?
(?P<id>\d*)(/(?P<title>.*))?
Most of the time,we use regex to match something,but how to generate the matching string if we have id and title already?
Example,if id=4 and title='hello world',the result should be:
4/hello world
But if we only have id=4,it should be:
4
Because as the regex indicates,title is optional.
Two answers both misunderstood...
There is no preg_match yet
I cannot use strtolower as it affects all char. Should I use some sort of regular expression ?
I'm getting a string which is a product code, I want to use this product code as a search key in a different palce with the first letter made lowercase.
I've noticed that if you sent a query string routevalue through asp.net mvc you end up with all whitespaces urlencoded into "%20". What is the best way of overriding this formatting as I would like whitespace to be converted into the "+" sign?
I was thinking of perhaps using a custom Route object or a class that derives from IRouteHandler but would appreciate any advice you might have.
Hopefully there's a simple solution to this. I'm setting up a redirect for old search listings, but I don't want any of the query stringto carry over.
The current rule is:
redirect 301 /blog http://newdomain.com
But this would redirect the following:
http://www.olddomain.com/blog/2009/11/article-name-etc
To this:
http://newdomain.com/2009/11/article-name-etc
When I just want:
http://newdomain.com
Can this be done in the simple 301 redirect, or will I have to write a mod_rewrite rule?
Hi everyone,
I'm using the new Telerik Rad Control and I would to use the GridView included.
But my problem is I recover with a webservice a List<List<String>> object and I would like to show it into my Datagridview.
I try to make a Grid.ItemSource = e.result but nothing appears ;-(
What's the problem ?
Thanks a lot.
Narglix
Should I create private static final String = "Some exception message" or leave it inside the code? Is there any performance issues? I have a lot of exception cases. Texts are mostly different in any particular case. Wary about performance and memory issues
Specifically, I'm trying to use a stringto arbitrairly filter the ORM. I've tried exec and eval solutions, but I'm running into walls. The code below doesn't work, but it's the best way I know how to explain where I'm trying to go
from gblocks.models import Image
f = 'image__endswith="jpg"' # Would be scripted in another area, but passed as text <user input>
d = Image.objects.filter(f)
#for the non-django pythonistas:
d = Image.objects.filter(image__endswith="jpg")
# would be the non-dynamic equivalent.
how to pass stringto a url in java. i want to download an image from a web server. before downloading a image i want to pass some values to that image then after that i want to download the image. can someone help me. in Java SE application
Here's a phrase I have to make translateable:
Poll ends in 2 hours 23 minutes
This string must have the main phrase and 'hour' and 'minute' in singular and plural forms.
{% blocktrans %}Poll ends in {{ poll.expire_hours }} ??? {{ poll.expire_minutes }} ???{% endblocktrans %}
What do I put then instead of ??? ?
How can I search a dynamic array of char in Delphi 6 for a sub-string and get back an index to a match, not a pointer? I've seen functions in Delphi 6 that do this for strings but not for dynamic char arrays. There is a function called SearchBuf but that function returns a PChar pointer to the match location when what I need is the array index of the match.
Thanks.
. I get this error: "Cannot convert lambda expression to type 'string' because it is not a delegate type" - keyword select become underlined in blue Can you please advice.
Employee emp = new Employee();
comHandledBySQt.DataSource = from x in emp.GetDataFromTable("1")
select new { x.Id, Name = x.FirstName + " " + x.LastName };
comHandledBySQt.DisplayMember = "Name";
comHandledBySQt.ValueMember = "Id";
Above code should displays drop list of employees first name and last name in a combo box
Is it safe to do connection.createStatement().executeQuery(String query);, or should each java.sql.Statement object be created and closed by "hand" on every use, even if the connection is closed in a finally block?
If multiple queries are executed in one method by one connection it would use much less code if instantiating and closing each statement wasn't strictly necessary.
I have a method that needs to get my Connection String from the connection.connection_string property on hibernate.cfg.xml file.
I've tried use NHibernate.Cfg.Environment.ConnectionString, but it didn't work.
How can I get this?
Thank you.
At the moment I have a regular expression that looks like this:
^(cat|dog|bird){1}(cat|dog|bird)?(cat|dog|bird)?$
It matches at least 1, and at most 3 instances of a long list of words and makes the matching words for each group available via the corresponding variable.
Is there a way to revise this so that I can return the result for each word in the string without specifying the number of groups beforehand?
^(cat|dog|bird)+$
works but only returns the last match separately , because there is only one group.
Hi,
I am trying to develop a PHP class which would enable me to get the query string appended into a url and process it according to the variables passed. How can this be done?
Eg
www.example.com?var1=a&var2=b&var3=c
now I want to get '?var1=a&var2=b&var3=c' section and process it based on the variables.
Thanks