The Big Programming Thread - Page 475
| Forum Index > General Forum |
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. | ||
|
Warri
Germany3208 Posts
| ||
|
Nesserev
Belgium2760 Posts
| ||
|
Prillan
Sweden350 Posts
On May 08 2014 05:46 Nesserev wrote: Uh, what? How could Internet Explorer 11 be related to Eclipse... sounds like magic to me (aka this shouldn't happen, right?) It was probably using IE to render the links inside the pop-up. It's not that uncommon. | ||
|
Blisse
Canada3710 Posts
| ||
|
phar
United States1080 Posts
| ||
|
Blisse
Canada3710 Posts
On May 08 2014 16:25 phar wrote: Can you provide a bit more detail? Do you mean supporting multiple ways of logging into the same service? Not supporting it, but what to do when you do have a user using multiple services and you want to combine them all into one person. Do you just treat all the different log-ins as different people? Then that means if that one person logs in to multiple accounts/services to do something, does the person appear as the same person or as different people? | ||
|
Nesserev
Belgium2760 Posts
| ||
|
Garfailed
Netherlands409 Posts
I have to build a twitter client for a school assignment. Hashtags and stuff dont need to be clickable, but do need to be hightlighted, by writing them in bold for instance. I've read the position of hashtags, and the hashtag itself from a JSON file, however, i cant seem to print the hashtag in bold, while the rest of the text remains normal. | ||
|
Manit0u
Poland17496 Posts
On May 10 2014 04:28 Garfailed wrote: i've got a quick question. I have to build a twitter client for a school assignment. Hashtags and stuff dont need to be clickable, but do need to be hightlighted, by writing them in bold for instance. I've read the position of hashtags, and the hashtag itself from a JSON file, however, i cant seem to print the hashtag in bold, while the rest of the text remains normal. What are you writing the client in? PHP? C#? JS? | ||
|
Garfailed
Netherlands409 Posts
Somehow i forgot this crucial detail | ||
|
Manit0u
Poland17496 Posts
On May 10 2014 05:23 Garfailed wrote: Android Somehow i forgot this crucial detailhttp://stackoverflow.com/questions/17783084/how-to-make-xml-strings-bold-underlined-etc Does this help? | ||
|
Garfailed
Netherlands409 Posts
On May 10 2014 05:30 Manit0u wrote: http://stackoverflow.com/questions/17783084/how-to-make-xml-strings-bold-underlined-etc Does this help? Not really, i get the string from a JSONObject. Not xml. I have the hashtag in a substring already, but i can't seem to make that 1 substring bold, when i add the entire thing together and set the TextView | ||
|
Manit0u
Poland17496 Posts
On May 10 2014 06:38 Garfailed wrote: Not really, i get the string from a JSONObject. Not xml. I have the hashtag in a substring already, but i can't seem to make that 1 substring bold, when i add the entire thing together and set the TextView Maybe try making it a separate string instead of a substring? Or try this: http://developer.android.com/reference/android/text/SpannableStringBuilder.html | ||
|
teamamerica
United States958 Posts
On May 10 2014 06:38 Garfailed wrote: Not really, i get the string from a JSONObject. Not xml. I have the hashtag in a substring already, but i can't seem to make that 1 substring bold, when i add the entire thing together and set the TextView Can you use Html.fromHtml() method? So it's like: mTextView.setText(Html.fromHtml(str + "<b>" + hashtag + "</b>)) From http://stackoverflow.com/questions/1529068/is-it-possible-to-have-multiple-styles-inside-a-textview Not a huge fan of using string concatenation to style it but seems like a pretty simple approach. Also not sure how this would play with any markup in the tweet body itself. | ||
|
Ottoxlol
735 Posts
virtual void Save(fstream &file) {file << thingsformattedinawayineedthem; } , for the children: void Save(fstream &file){file << 'x' ; Camera::Save(file); file << otherthingsformattedinawayineedthem; } the function that calls for every object to save itself is: void Saveall(vector<Parent*> inventory,fstream &file){for (unsigned i=0; i<inventory.size(); i++){inventory[i]->Save(file);} I did almost exactly the same for a Listall function that prints every objects variables and it worked so I think it has to do something with the way I handle the fstream(currently it does nothing to the file) Bonus question: is there a clear command for files? if not is there an elegant solution to clearing it(txt in this case). | ||
|
Garfailed
Netherlands409 Posts
On May 10 2014 07:35 teamamerica wrote: Can you use Html.fromHtml() method? So it's like: mTextView.setText(Html.fromHtml(str + "<b>" + hashtag + "</b>)) From http://stackoverflow.com/questions/1529068/is-it-possible-to-have-multiple-styles-inside-a-textview Not a huge fan of using string concatenation to style it but seems like a pretty simple approach. Also not sure how this would play with any markup in the tweet body itself. Thats what i have implemented now, however it does not seem to work. My code does succeed in setting the textView properly, but fails to make the hashtag bold, ill paste it here. EDIT: ill have a look at the SpannableStringBuilder tomorrow, looks like it could do the trick.
| ||
|
Garfailed
Netherlands409 Posts
| ||
|
Nesserev
Belgium2760 Posts
| ||
|
teamamerica
United States958 Posts
On May 10 2014 08:33 Garfailed wrote: Thats what i have implemented now, however it does not seem to work. My code does succeed in setting the textView properly, but fails to make the hashtag bold, ill paste it here. EDIT: ill have a look at the SpannableStringBuilder tomorrow, looks like it could do the trick.
You need to do it: text.setText(Html.fromHtlm(sub1 + "<b>" + sub2 + "</b>") i.e the whole setText needs to be the return value from Html.fromHtml. I guess it has something to do with what you doing being tv.setText(String) vs tv.setText(Spanned) (using pure Html.fromHtml) Because what you have becomes tv.setText(sub1 + Html.fromHtml(..).toString()) basically. I don't know for sure to be honest. | ||
|
Garfailed
Netherlands409 Posts
On May 10 2014 08:57 teamamerica wrote: You need to do it: text.setText(Html.fromHtlm(sub1 + "<b>" + sub2 + "</b>") i.e the whole setText needs to be the return value from Html.fromHtml. I guess it has something to do with what you doing being tv.setText(String) vs tv.setText(Spanned) (using pure Html.fromHtml) Because what you have becomes tv.setText(sub1 + Html.fromHtml(..).toString()) basically. I don't know for sure to be honest. well, that actually did the trick! i feel rather dumb now... Thanks alot though! | ||
| ||
Somehow i forgot this crucial detail