hi,
In my application i write the code like this
byte [] byt=new byte[ Convert.ToSbyte(textbox1.tex)];
it is giving the error that input string was not in a correct format.
I have a Persons object. It has a variable name accessible by saying
$p = new Person('John');
echo $p->name;
Now I have a string.
$name = 'name';
I need to get $p->name using $p and $name. Something like
echo $p->[$name];
I'm writing an Apache module and want to get a string with the Apache name version and other details. Much like what gets added to outgoing headers, e.g.:
Server: Apache/2.2.13 (Win32)
I've tried code like this:
apr_table_get(request_rec->headers_out,"Server")
But that doesn't seem to work. Is there an API call I haven't found or am I doomed to get version resource data from httpd.exe?
Must I do something like this?
NSString *errorDescription = [error localizedDescription];
NSString *errorInfoStr = NSLocalizedString(errorDescription, nil);
Or do I use NSLocalizedString already when populating the userInfo dictionary with the NSLocalizedDescriptionKey key and value? So the value for that is not actually a key for NSLocalizedString, but it is the actual localized string ready to show up on screen?
Hi peoples, I'm building a pdf document with reportlab, using the Paragraph class:
doc = SimpleDocTemplate(response, leftMargin=lateral_margin, rightMargin=lateral_margin,
topMargin=top_bottom_margin, bottomMargin=top_bottom_margin)
Document = []
Document.append(Paragraph("bla bla bla bla", my_style))
doc.build(Document)
Now I want to add at the end of every page a string, how can I do that??
I need to use preg_match to check that only a-z0-9. is used (including full stop(.)). I don't want to replace anything. My problem is that it doesn't notice white space at beginning of a string.
Also, if anyone knows how to check there is no two full stops in a row, I would be very grateful.
What I have so far:
("/[^a-z0-9.]+$/",$request)
Thanks !
How can I loop through a Comma separated string which I am passing as a parameter in XSLT 1.0?
Ex- 1,4,7,9
I need to loop the above UID parameter and collectd nodes from within each of the UID in my XML File
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
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).
Hello!
How can I draw a String in Java (using Graphics2d) in monospace mode? I have a font that looks like LCD screen font, and I want to draw something like LCD label.
I am using Digital 7 Mono font.
Do you know where I can find another font that will be monospace and lcd (I wan to type only digitals)?
Got
... '[]=': can't modify frozen string (TypeError)
when trying to modify what I thought was a copy of ARGV[0].
Same results for each of
arg = ARGV[ 0 ]
arg_cloned = ARGV[ 0 ].clone
arg_to_s = ARGV[ 0 ].to_s
arg[ 'x' ] = 'y'
arg_cloned[ 'x' ] = 'y'
arg_to_s[ 'x' ] = 'y'
Hey, here's a dumb question: how can I set an object property given its name in a string. I have a dictionary being passed to me and I wish to transfer its values into namesake properties using code like this:
for entry in src_dict:
if entry.startswith('can_'):
tgt_obj[entry] = src_dict_profile[entry]
I'm still a bit of a noob with Python so would appreciate some help.
- dave.
I am reading a file by line and need to extract latitude and longitude from it.
This how lines can looks:
DE 83543 Rott am Inn Bayern BY Oberbayern Landkreis Rosenheim 47.983 12.1278
DE 21147 Hamburg Hamburg HH Kreisfreie Stadt Hamburg 53.55 10
What's for sure is, there are no dots surrounded by digits except for the ones representing the doubles.
Unfortunately there are Values without a dot, so it's probably best to check for numbers from the end of the String.
thanks for your help!
I have a string of HTML stored in a database. Unfortunately it contains characters such as ®
I want to replace these characters by their HTML equivalent, either in the DB itself or using a Find Replace in my Python / Django code.
Any suggestions on how I can do this?
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.
hi,
how to get in python from string not one character, but two?
I have:
long_str = 'abcd'
for c in long_str:
print c
and it gives me like
a
b
c
d
but i need to get
ab
cd
I'm new in python.. is there any way?
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
i have string MyText that hold "L1"
i have label control that his name is "L1"
is there any way to read label L1 using MyText ?
somthing like: TMT = MyText.text
or: TMT = ((Control)MyText.ToString()).Text;
thank's in advance
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?
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 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?
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.
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.