• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 19:06
CET 01:06
KST 09:06
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13
StarCraft 2
General
Chinese SC2 server to reopen; live all-star event in Hangzhou Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband
Tourneys
RSL Offline FInals Sea Duckling Open (Global, Bronze-Diamond) $5,000+ WardiTV 2025 Championship Constellation Cup - Main Event - Stellar Fest RSL Revival: Season 3
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night Mutation # 499 Chilling Adaptation
Brood War
General
Which season is the best in ASL? BW General Discussion Data analysis on 70 million replays BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Ask the mapmakers — Drop your questions
Tourneys
[Megathread] Daily Proleagues [BSL21] RO16 Group B - Sunday 21:00 CET [BSL21] RO16 Group C - Saturday 21:00 CET Small VOD Thread 2.0
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
ZeroSpace Megathread Stormgate/Frost Giant Megathread Nintendo Switch Thread The Perfect Game Path of Exile
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine The Big Programming Thread Artificial Intelligence Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
James Bond movies ranking - pa…
Topin
Esports Earnings: Bigger Pri…
TrAiDoS
Thanks for the RSL
Hildegard
Saturation point
Uldridge
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1380 users

The Big Programming Thread - Page 475

Forum Index > General Forum
Post a Reply
Prev 1 473 474 475 476 477 1032 Next
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
Profile Joined May 2010
Germany3208 Posts
May 07 2014 20:00 GMT
#9481
Reinstalling internet explorer 11 fixed it, although firefox was the system default browser and eclipse was set to use firefox.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
May 07 2014 20:46 GMT
#9482
--- Nuked ---
Prillan
Profile Joined August 2011
Sweden350 Posts
May 07 2014 21:06 GMT
#9483
On May 08 2014 05:46 Nesserev wrote:
Show nested quote +
On May 08 2014 05:00 Warri wrote:
Reinstalling internet explorer 11 fixed it, although firefox was the system default browser and eclipse was set to use firefox.

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.
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
May 08 2014 04:56 GMT
#9484
Anyone have experience managing user logins via different platforms? Did you end up treating each platform as a separate user?
There is no one like you in the universe.
phar
Profile Joined August 2011
United States1080 Posts
May 08 2014 07:25 GMT
#9485
Can you provide a bit more detail? Do you mean supporting multiple ways of logging into the same service?
Who after all is today speaking about the destruction of the Armenians?
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
May 09 2014 01:24 GMT
#9486
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?
There is no one like you in the universe.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2014-05-09 10:24:23
May 09 2014 10:24 GMT
#9487
--- Nuked ---
Garfailed
Profile Joined May 2011
Netherlands409 Posts
May 09 2014 19:28 GMT
#9488
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.
Manit0u
Profile Blog Joined August 2004
Poland17496 Posts
Last Edited: 2014-05-09 19:52:58
May 09 2014 19:52 GMT
#9489
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?
Time is precious. Waste it wisely.
Garfailed
Profile Joined May 2011
Netherlands409 Posts
May 09 2014 20:23 GMT
#9490
Android Somehow i forgot this crucial detail
Manit0u
Profile Blog Joined August 2004
Poland17496 Posts
May 09 2014 20:30 GMT
#9491
On May 10 2014 05:23 Garfailed wrote:
Android Somehow i forgot this crucial detail


http://stackoverflow.com/questions/17783084/how-to-make-xml-strings-bold-underlined-etc

Does this help?
Time is precious. Waste it wisely.
Garfailed
Profile Joined May 2011
Netherlands409 Posts
May 09 2014 21:38 GMT
#9492
On May 10 2014 05:30 Manit0u wrote:
Show nested quote +
On May 10 2014 05:23 Garfailed wrote:
Android Somehow i forgot this crucial detail


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
Profile Blog Joined August 2004
Poland17496 Posts
Last Edited: 2014-05-09 22:30:12
May 09 2014 22:26 GMT
#9493
On May 10 2014 06:38 Garfailed wrote:
Show nested quote +
On May 10 2014 05:30 Manit0u wrote:
On May 10 2014 05:23 Garfailed wrote:
Android Somehow i forgot this crucial detail


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


Maybe try making it a separate string instead of a substring?

Or try this: http://developer.android.com/reference/android/text/SpannableStringBuilder.html
Time is precious. Waste it wisely.
teamamerica
Profile Blog Joined July 2010
United States958 Posts
May 09 2014 22:35 GMT
#9494
On May 10 2014 06:38 Garfailed wrote:
Show nested quote +
On May 10 2014 05:30 Manit0u wrote:
On May 10 2014 05:23 Garfailed wrote:
Android Somehow i forgot this crucial detail


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


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.
RIP GOMTV. RIP PROLEAGUE.
Ottoxlol
Profile Blog Joined November 2010
735 Posts
May 09 2014 23:21 GMT
#9495
Have been googling and thinking for a couple of hours I can't crack whats wrong with my program. Would make my day if someone could help. Its a simple inventory system where I have to use heterogeneous collection, dynamic memory allocation and classes in C++. I am finished if not for the Save() function that I would use to write my objects out to a file the same way I read them. For the parent I use:
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
Profile Joined May 2011
Netherlands409 Posts
Last Edited: 2014-05-09 23:35:33
May 09 2014 23:33 GMT
#9496
On May 10 2014 07:35 teamamerica wrote:
Show nested quote +
On May 10 2014 06:38 Garfailed wrote:
On May 10 2014 05:30 Manit0u wrote:
On May 10 2014 05:23 Garfailed wrote:
Android Somehow i forgot this crucial detail


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


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.


 
ArrayList<String> hashtags = entity.getHashTags();
ArrayList<String> hashtagsPos = entity.getHashTagPos();
Scanner sc;

for(int i = 0; i < hashtags.size(); i++) {
sc = new Scanner(hashtagsPos.get(i));
int pos1 = Integer.parseInt(sc.next());
int pos2 = Integer.parseInt(sc.next());
String result = tweet.getText();

Log.d("position",pos1 + ", " + pos2 );

String sub1 = result.substring(0,pos1);
String sub2 = result.substring(pos1, pos2);
String sub3 = result.substring(pos2, result.length());
text.setText(sub1 + Html.fromHtml("<b>" + sub2 + "</b>") + sub3);
sc.close();
}
Garfailed
Profile Joined May 2011
Netherlands409 Posts
Last Edited: 2014-05-09 23:35:02
May 09 2014 23:34 GMT
#9497
Sorry, double post.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2014-05-10 00:00:57
May 09 2014 23:40 GMT
#9498
--- Nuked ---
teamamerica
Profile Blog Joined July 2010
United States958 Posts
May 09 2014 23:57 GMT
#9499
On May 10 2014 08:33 Garfailed wrote:
Show nested quote +
On May 10 2014 07:35 teamamerica wrote:
On May 10 2014 06:38 Garfailed wrote:
On May 10 2014 05:30 Manit0u wrote:
On May 10 2014 05:23 Garfailed wrote:
Android Somehow i forgot this crucial detail


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


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.


 
ArrayList<String> hashtags = entity.getHashTags();
ArrayList<String> hashtagsPos = entity.getHashTagPos();
Scanner sc;

for(int i = 0; i < hashtags.size(); i++) {
sc = new Scanner(hashtagsPos.get(i));
int pos1 = Integer.parseInt(sc.next());
int pos2 = Integer.parseInt(sc.next());
String result = tweet.getText();

Log.d("position",pos1 + ", " + pos2 );

String sub1 = result.substring(0,pos1);
String sub2 = result.substring(pos1, pos2);
String sub3 = result.substring(pos2, result.length());
text.setText(sub1 + Html.fromHtml("<b>" + sub2 + "</b>") + sub3);
sc.close();
}



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.
RIP GOMTV. RIP PROLEAGUE.
Garfailed
Profile Joined May 2011
Netherlands409 Posts
May 10 2014 00:01 GMT
#9500
On May 10 2014 08:57 teamamerica wrote:
Show nested quote +
On May 10 2014 08:33 Garfailed wrote:
On May 10 2014 07:35 teamamerica wrote:
On May 10 2014 06:38 Garfailed wrote:
On May 10 2014 05:30 Manit0u wrote:
On May 10 2014 05:23 Garfailed wrote:
Android Somehow i forgot this crucial detail


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


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.


 
ArrayList<String> hashtags = entity.getHashTags();
ArrayList<String> hashtagsPos = entity.getHashTagPos();
Scanner sc;

for(int i = 0; i < hashtags.size(); i++) {
sc = new Scanner(hashtagsPos.get(i));
int pos1 = Integer.parseInt(sc.next());
int pos2 = Integer.parseInt(sc.next());
String result = tweet.getText();

Log.d("position",pos1 + ", " + pos2 );

String sub1 = result.substring(0,pos1);
String sub2 = result.substring(pos1, pos2);
String sub3 = result.substring(pos2, result.length());
text.setText(sub1 + Html.fromHtml("<b>" + sub2 + "</b>") + sub3);
sc.close();
}



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!
Prev 1 473 474 475 476 477 1032 Next
Please log in or register to reply.
Live Events Refresh
Replay Cast
00:00
WardiTV Mondays #62
CranKy Ducklings15
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft359
elazer 162
SpeCial 50
CosmosSc2 37
StarCraft: Brood War
Artosis 553
Larva 159
Dota 2
syndereN1094
League of Legends
C9.Mang0192
Counter-Strike
Foxcn256
Other Games
Grubby5356
summit1g5292
tarik_tv4094
FrodaN893
RotterdaM163
Maynarde100
Day[9].tv98
Mew2King34
ViBE17
Organizations
Other Games
gamesdonequick304
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• musti20045 36
• davetesta13
• IndyKCrew
• Migwel
• AfreecaTV YouTube
• sooper7s
• intothetv
• Kozan
• LaughNgamezSOOP
StarCraft: Brood War
• RayReign 43
• blackmanpl 22
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• Ler91
League of Legends
• Doublelift4388
Other Games
• imaqtpie1398
• Day9tv98
Upcoming Events
The PondCast
9h 54m
OSC
15h 54m
Demi vs Mixu
Nicoract vs TBD
Babymarine vs MindelVK
ForJumy vs TBD
Shameless vs Percival
Replay Cast
23h 54m
Korean StarCraft League
2 days
CranKy Ducklings
2 days
WardiTV 2025
2 days
SC Evo League
2 days
BSL 21
2 days
Sziky vs OyAji
Gypsy vs eOnzErG
OSC
2 days
Solar vs Creator
ByuN vs Gerald
Percival vs Babymarine
Moja vs Krystianer
EnDerr vs ForJumy
sebesdes vs Nicoract
Sparkling Tuna Cup
3 days
[ Show More ]
WardiTV 2025
3 days
OSC
3 days
BSL 21
3 days
Bonyth vs StRyKeR
Tarson vs Dandy
Replay Cast
4 days
Wardi Open
4 days
StarCraft2.fi
4 days
Monday Night Weeklies
4 days
Replay Cast
4 days
WardiTV 2025
5 days
StarCraft2.fi
5 days
PiGosaur Monday
6 days
StarCraft2.fi
6 days
Tenacious Turtle Tussle
6 days
Liquipedia Results

Completed

Proleague 2025-11-30
RSL Revival: Season 3
Light HT

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
CSCL: Masked Kings S3
Slon Tour Season 2
Acropolis #4 - TS3
META Madness #9
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
Kuram Kup
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.