How to input multiline words in cocos2d-x? - cocos2d-x

I've met a problem in using editbox.I want a mutiline inputDialoge in cocoss2d-x. is there a good solution?Any response is appreciated.

Related

Obtain a text from a html code with BeautifulSoup

I've been trying to extract the text from the following code with BeautifulSoup in Python:
<a class="w-menu__link" href="https://www.universidadviu.es/grado-economia/">Grado en Economía</a>
I need to extract the text "Grado en Economía" from this and all other similar lines in the html code. For example:
<a class="w-menu__link" href="https://www.universidadviu.es/grado-derecho/">Grado en Derecho</a>
In this line I need to extract "Grado en Derecho".
I can extract the class and the href, but I don't know how to extract the rest of the text. I'm using the following code:
list_of_links_graus = []
html_graus = urlopen("https://www.universidadviu.es/grados-online-viu/") # Insert your URL to extract
bsObj_graus = BeautifulSoup(html_graus.read());
for link in bsObj_graus.find_all('a'):
list_of_links_graus.append(link.get('href'))
I would also ask if someone can please edit the title of this question in order to fit the real problem, since I'm not a html expert and I suppose I'm not extracting a simple text (as the title says).
Thanks to all in advance.
Use the text attribute
for link in bsObj_graus.find_all('a'):
list_of_links_graus.append((link.get('href'), link.text))

How do you replace part of a string of an apache NIFI attribute?

Can you update attribute using replace text of an attribute's value?
I have an attribute - ${a} which has a place holder called "PLACEHOLDER". How do I replace each occurrence of the word "PLACEHOLDER" in attribute ${a} with the value of attribute ${b}?
I have tried using replace text processor - using both Regex Replace and Literal Replace replacement strategies without any luck.
See below my example.
1. Generate flow file.
Replace text attempt 1 - literal replace strategy
Replace text attempt 2 - regex replace strategy
None works as attribute value is unchanged.
How can I achieve this? If not this processor, which one please? How? Thanks in advance!
Haha...Such a bummer. Found the answer. Should have kept digging through the documentation i guess.
Use update attribute processor then set attribute to ${a:replace('PLACEHOLDER', ${b})}
Hope this helps someone who's not searched documentation properly like me in future :-)

hpple XpathQuery ideas?

I am using hpple to parse some HTML. I am using Xcode 4.6 and iOS 6.1. It looks like this.
I can extract the text and images by using the following XPathQueryStrings.
Text ==> //div[#class = 'entry-content']/p
Images ==> //div[#class = 'entry-content']//img/#src
However, I also need to get the text near the bottom "Retiring Stamp Set PDF". This text changes, but the format is usually the same. I tried the following path,
div[#class = 'entry-content']//a[#title]//text()
But that did not work. I am placing all these in an array and I can see that I get a null back for that entry, but I want to get the text. I looked at the XPath Syntax, but can't make it any further. Does anyone have any suggestions?
So I figured it out! So for anyone that has viewed this here is the answer according to my HTML file.
To get the text you use....
//div[#class = 'entry-content']//a[#title]//*
This returns all the text under the a div with a title.

placeholder sentence into new row

I am looking for an solution. If there's no any, well I cannot help it :]
I like placeholder attribute quite a lot. Today/tonight I was making an contact form.
However I am wondering is there any solution to put an word/sentence into new row into placeholder...
Example:
You are suppoused,
to write an message to me...
Instead of:
You are suppoused, to write an message to me...
I hope there is an way. Thanks in advance
From the WHATWG (emphasis mine):
4.10.7.3.10 The placeholder attribute
The placeholder attribute represents a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format. The attribute, if specified, must have a value that contains no U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR) characters.
Seems like a pretty clear no.

Surrounding text with tag and populating tag

I have several lines of text, in them there is a word or words that are capitalized like this:
Hello HOW ARE YOU good to see you
I am FINE
Is there a tool that can go through the text and surround all those capitalized with the HTML anchor text?
and
I guess more difficultly, also populate the href with uncapitalized, space(s) removed version of that capitalized text?
Any help on one or both questions is appreciated.
It took me a while, but here it is in javascript: http://jsfiddle.net/RdJ4E/4/
I'm sure you will find the way hot to tune the code. Good luck!
Is this a beginning? Matching all uppercased words is trivial with regex, and with providing the String.replace method with a callback function instead of a string you can do whatever you want with the matched string.
myString.replace(/(\b[A-Z\s]+\b)/g, function(result, match){
var stripped = encodeURI(result.trim().toLowerCase());
return ' '+result.trim()+' ';
});
http://jsfiddle.net/mwxnC/2/