• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 15:45
CEST 21:45
KST 04:45
  • 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
Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16[ASL21] Ro16 Preview Pt2: All Star10Team Liquid Map Contest #22 - The Finalists22[ASL21] Ro16 Preview Pt1: Fresh Flow9
Community News
RSL Revival: Season 5 - Qualifiers and Main Event8Code S Season 1 (2026) - RO12 Results02026 GSL Season 1 Qualifiers25Maestros of the Game 2 announced92026 GSL Tour plans announced15
StarCraft 2
General
Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun Code S Season 1 (2026) - RO12 Results Team Liquid Map Contest #22 - The Finalists Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool MaNa leaves Team Liquid
Tourneys
RSL Revival: Season 5 - Qualifiers and Main Event GSL Code S Season 1 (2026) SC2 INu's Battles#15 <BO.9 2Matches> WardiTV Spring Cup SEL Masters #6 - Solar vs Classic (SC: Evo)
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base Mutation # 521 Memorable Boss
Brood War
General
ASL21 General Discussion BGH Auto Balance -> http://bghmmr.eu/ Why there arent any 256x256 pro maps? BW General Discussion Pros React To: Leta vs Tulbo (ASL S21, Ro.8)
Tourneys
[ASL21] Ro8 Day 2 [Megathread] Daily Proleagues Escore Tournament StarCraft Season 2 [BSL22] RO16 Group Stage - 02 - 10 May
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers What's the deal with APM & what's its true value Any training maps people recommend?
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Daigo vs Menard Best of 10 Dawn of War IV Diablo IV
Dota 2
The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
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
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread European Politico-economics QA Mega-thread Russo-Ukrainian War Thread 3D technology/software discussion Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books Movie Discussion!
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Formula 1 Discussion
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Sexual Health Of Gamers
TrAiDoS
lurker extra damage testi…
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Iranian anarchists: organize…
XenOsky
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2212 users

The Big Programming Thread - Page 448

Forum Index > General Forum
Post a Reply
Prev 1 446 447 448 449 450 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.
Blitzkrieg0
Profile Blog Joined August 2010
United States13132 Posts
February 21 2014 19:18 GMT
#8941
On February 22 2014 02:05 WarSame wrote:
The key being for independent events. When they're dependent events(the state of one affects another) then it gets a bit trickier, and I don't really remember the rules. Generally, in that case I find drawing a Venn diagram helps keep track of the probabilities. Obviously when you get to 5 and above events it'll become impossible to draw.

EDIT: Oh, hey, 1000 posts. Cool.


You just have to subtract the union. The probability of x or y happening is P(X) + P(Y) - P(XY). This works because you're counting the chance of XY happening in the probability of X and again in probability of Y so subtracting it out once leaves you the correct answer. If you have more events it gets more complicated but follows a similar pattern. Say you want to know the probability of X or Y or Z happening.

P(X) + P(Y) + P(Z) - P(XY) - P(YZ) - P(XZ) + P(XYZ)

The same pattern extends if you add more events (add odd combinations of events and subtract even combinations of events).
I'll always be your shadow and veil your eyes from states of ain soph aur.
]343[
Profile Blog Joined May 2008
United States10328 Posts
Last Edited: 2014-02-21 19:21:49
February 21 2014 19:21 GMT
#8942
On February 22 2014 04:18 Blitzkrieg0 wrote:
Show nested quote +
On February 22 2014 02:05 WarSame wrote:
The key being for independent events. When they're dependent events(the state of one affects another) then it gets a bit trickier, and I don't really remember the rules. Generally, in that case I find drawing a Venn diagram helps keep track of the probabilities. Obviously when you get to 5 and above events it'll become impossible to draw.

EDIT: Oh, hey, 1000 posts. Cool.


You just have to subtract the union. The probability of x or y happening is P(X) + P(Y) - P(XY). This works because you're counting the chance of XY happening in the probability of X and again in probability of Y so subtracting it out once leaves you the correct answer. If you have more events it gets more complicated but follows a similar pattern. Say you want to know the probability of X or Y or Z happening.

P(X) + P(Y) + P(Z) - P(XY) - P(YZ) - P(XZ) + P(XYZ)

The same pattern extends if you add more events (add odd combinations of events and subtract even combinations of events).


I think both thinking about it logically (like you said) and drawing a Venn diagram (like WarSame said) are really helpful for understanding inclusion-exclusion.
Writer
Arnstein
Profile Blog Joined May 2010
Norway3381 Posts
February 21 2014 19:59 GMT
#8943
On February 22 2014 04:04 darkness wrote:
Show nested quote +
On February 22 2014 04:00 Arnstein wrote:
I'm a second year student in cybernetics, and I got a summer internship with ARM this summer!!! Sooo happy! Never thought I would get the job as the other people were in the 3rd and 4th year.


What questions have you been asked?


I will ask if I am allowed to share that. Let's just say that I was shocked at how big the task was, since I only got one hour to finish it.
rsol in response to the dragoon voice being heard in SCII: dragoon ai reaches new lows: wanders into wrong game
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
February 21 2014 20:53 GMT
#8944
You guys are right. Thanks. I do somewhat remember that from my Stats/Discrete math.
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-02-22 17:50:45
February 21 2014 22:35 GMT
#8945
Java question.

I am a bit stuck on my Sudoku project. I want to offer a feature to have a puzzle (chosen from a list by difficulty) to be modified at run time by the user. I use the MVC architecture. The puzzle is on an ArrayList, but I also have file access to puzzles.
The problem is I don't know how to do that. Should I show a (modal?) dialog with a puzzle with the same functionality (except the timer) that you see on the screenshot? Even so, is it possible to customise a dialog like that? I just don't know where to start form. Not using any dialog, and cancelling the current game to allow modification doesn't seem too flexible and nice to me as an option.

Hopefully you get the idea. Just throw at me topics or something so I can start reading.
DeltaX
Profile Joined August 2011
United States287 Posts
February 21 2014 22:55 GMT
#8946
What do you mean by modify here? Do you want people to be able to change difficulty, fill in the squares, add notes or something else?

If you mean when they change difficulty, then it makes sense to give them/make a new puzzle of the given difficulty. If you want to keep the same one but make it easier, maybe just have the program show the actual value for one square.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-02-22 17:49:45
February 21 2014 23:03 GMT
#8947
On February 22 2014 07:55 DeltaX wrote:
What do you mean by modify here? Do you want people to be able to change difficulty, fill in the squares, add notes or something else?

If you mean when they change difficulty, then it makes sense to give them/make a new puzzle of the given difficulty. If you want to keep the same one but make it easier, maybe just have the program show the actual value for one square.


By modification I mean changing difficulty and/or filling in squares or removing values from them. Up to the user.

Edit: I've figured it out. Just JOptionPane with a JPanel as one of the arguments.
Beamer
Profile Joined March 2010
United States242 Posts
Last Edited: 2014-02-23 21:31:26
February 23 2014 21:05 GMT
#8948
I'm in kind of a tricky situation and could use any help that's possible. I'm working on a project for a class in a group of 5. One aspect of this project is to develop an Android app that can communicate with a Bluetooth module. However, there is one big problem: None of the members in my group has any experience with either Android programming or Bluetooth communication. Therefore, we have to pick this up on the go. These past few days, I've been working on familiarizing myself with Android programming, and I can now build some very simple apps. I have also gotten our Bluetooth module to send information to an Android device (verified using the ArduDroid app). What I'm now struggling with is designing my own app that can receive this information.

I've been trying to follow the Bluetooth tutorial on the Android website, and I've made some small progress there. I can now check if the Android device has Bluetooth capability, and enable it if it is disabled. However, now I am stuck. I don't know how to go about pairing up with/connecting to the Bluetooth module. I would appreciate any help here.

EDIT: I can pair Android and the module together in the Android's Bluetooth settings, so I don't have to do that in the code. However, connecting them is still going over my head.
Vorenius
Profile Blog Joined December 2010
Denmark1979 Posts
February 24 2014 00:33 GMT
#8949
On February 24 2014 06:05 Beamer wrote:
I'm in kind of a tricky situation and could use any help that's possible. I'm working on a project for a class in a group of 5. One aspect of this project is to develop an Android app that can communicate with a Bluetooth module. However, there is one big problem: None of the members in my group has any experience with either Android programming or Bluetooth communication. Therefore, we have to pick this up on the go. These past few days, I've been working on familiarizing myself with Android programming, and I can now build some very simple apps. I have also gotten our Bluetooth module to send information to an Android device (verified using the ArduDroid app). What I'm now struggling with is designing my own app that can receive this information.

I've been trying to follow the Bluetooth tutorial on the Android website, and I've made some small progress there. I can now check if the Android device has Bluetooth capability, and enable it if it is disabled. However, now I am stuck. I don't know how to go about pairing up with/connecting to the Bluetooth module. I would appreciate any help here.

EDIT: I can pair Android and the module together in the Android's Bluetooth settings, so I don't have to do that in the code. However, connecting them is still going over my head.

I don't have a lot of experience with bluetooth in particular but I believe you can use BluetoothSocket or BluetoothServerSocket just as you would if you were using a TCP connection.
OsaX Nymloth
Profile Joined March 2013
Poland3244 Posts
February 24 2014 00:52 GMT
#8950
Finished some project, where I was coding the wordpress theme. Fairy easy, but there's on bug that's left on my list and I'm unsure how to fix that. This screen should help - overall, they're two backgrounds implemented on that page. One is the actual background, the second is the "torn paper" thing that appears on the edge of the main container. The problem is, that the "torn paper" thing is going a bit too far. Of course making any div longer, makes the page longer as well, so that's not the solution. I'm pretty sure this is something rather easy, but I'm still in weekend mood so my thinking is off a bit :F
Twitter: @osaxnymloth
Requizen
Profile Blog Joined March 2011
United States33802 Posts
February 24 2014 06:25 GMT
#8951
Does anyone have experience hosting with GoDaddy? Because this thing is kinda fucking stupid.
It's your boy Guzma!
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
February 24 2014 06:59 GMT
#8952
What do you need GoDaddy for?
There is no one like you in the universe.
Requizen
Profile Blog Joined March 2011
United States33802 Posts
February 24 2014 07:17 GMT
#8953
My company has a client that specifically asked to host their site there for whatever reason. I was put in charge of the move.
It's your boy Guzma!
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-02-24 21:27:34
February 24 2014 21:23 GMT
#8954
Do you guys find yourselves write sloppy (== quick) code on purpose just to implement a feature and make it work? After you're sure it works, you just refactor code to make it look better. I'm getting lazy these days, and I tend to have this bad habit. It probably doesn't save me time, but I certainly get a goal accomplished, especially if I'm initially uncertain how I should do implementation. I think it gives me the benefit to experiment code faster rather than spend time to write comments and connect objects properly.
tofucake
Profile Blog Joined October 2009
Hyrule19210 Posts
February 24 2014 21:55 GMT
#8955
I write sloppy and quick code to get a feature done and then I never refactor it because I've got far too many things to do.
Liquipediaasante sana squash banana
bangsholt
Profile Joined June 2011
Denmark138 Posts
February 24 2014 22:14 GMT
#8956
Write the shittiest of shit code to do a prototype. If that's what you chose to go with, throw it all away and write it properly with comments and diagrams explaining the why and hows - it's the only proper way to do it, and you're fucking over yourself and all your future colleges by not doing it properly.
Zocat
Profile Joined April 2010
Germany2229 Posts
February 24 2014 22:38 GMT
#8957
I usually write a rough idea how to do it properly in a comment. So if future me (or a poor guy) ever visits that code again he at least has a chance.
Rarely, when it's a real mess and/or can be done way more elegant quickly, I refactor directly (see tofucake's answer)
That said - I never "blindly" start writing anything, so I can at least avoid some shit.

Worst person though is private past me, since he always thinks that he can do cool stuff & get performance by doing bit/byte shit. I hate private past me whenever I look at his code. He also only rarely comments.
icystorage
Profile Blog Joined November 2008
Jollibee19350 Posts
February 25 2014 01:18 GMT
#8958
i usually write it as fast as i can to 'make it work' then 'make it better'
LiquidDota StaffAre you ready for a Miracle-? We are! The International 2017 Champions!
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
February 25 2014 01:39 GMT
#8959
On February 25 2014 06:55 tofucake wrote:
I write sloppy and quick code to get a feature done and then I never refactor it because I've got far too many things to do.


Do you feel confident that your quick code is good or do you just rely on compiler's optimisation?

Also a follow-up question to everyone: which book do you recommend for learning how to write good code? I've come across these 2 "Code Complete" and "Clean Code: A Handbook of Agile Software Craftsmanship". My level is neither beginner nor veteran, so something in between should be preferable.
phar
Profile Joined August 2011
United States1080 Posts
February 25 2014 03:30 GMT
#8960
I don't write sloppy code quick first because I don't have time. There's too much danger it won't get replaced/refactored quickly enough, and then the amount of time required to support it is too large.
Who after all is today speaking about the destruction of the Armenians?
Prev 1 446 447 448 449 450 1032 Next
Please log in or register to reply.
Live Events Refresh
BSL
19:00
RO16 Group A
eOnzErG vs OyAjiLIVE!
Doodle vs cavapoo
ZZZero.O190
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SpeCial 257
Ketroc 79
JuggernautJason78
BRAT_OK 60
StarCraft: Brood War
Britney 20904
Calm 3474
Mini 259
ZZZero.O 190
Hyuk 187
Nal_rA 136
ggaemo 123
Dewaltoss 97
Hyun 38
NaDa 10
Dota 2
Gorgc5804
monkeys_forever390
syndereN191
Counter-Strike
fl0m5105
Heroes of the Storm
Khaldor275
MindelVK17
Other Games
Grubby4693
FrodaN943
KnowMe215
ArmadaUGS196
420jenkins191
Hui .98
elazer55
Trikslyr54
QueenE49
Organizations
Other Games
gamesdonequick979
BasetradeTV294
Dota 2
PGL Dota 2 - Main Stream59
StarCraft 2
angryscii 21
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 19 non-featured ]
StarCraft 2
• printf 63
• StrangeGG 5
• LaughNgamezSOOP
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• sooper7s
• Migwel
StarCraft: Brood War
• 80smullet 18
• Michael_bg 14
• RayReign 3
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• WagamamaTV584
League of Legends
• imaqtpie1510
• Shiphtur322
Other Games
• tFFMrPink 18
Upcoming Events
Replay Cast
4h 15m
RSL Revival
14h 15m
herO vs TriGGeR
NightMare vs Solar
uThermal 2v2 Circuit
18h 15m
BSL
23h 15m
IPSL
23h 15m
eOnzErG vs TBD
G5 vs Nesh
Patches Events
1d 4h
Replay Cast
1d 13h
Wardi Open
1d 14h
Afreeca Starleague
1d 14h
Jaedong vs Light
Monday Night Weeklies
1d 20h
[ Show More ]
Replay Cast
2 days
Sparkling Tuna Cup
2 days
Afreeca Starleague
2 days
Snow vs Flash
WardiTV Invitational
2 days
GSL
3 days
Classic vs Cure
Maru vs Rogue
GSL
4 days
SHIN vs Zoun
ByuN vs herO
OSC
4 days
Replay Cast
5 days
Escore
5 days
The PondCast
5 days
WardiTV Invitational
5 days
Replay Cast
6 days
CranKy Ducklings
6 days
RSL Revival
6 days
SHIN vs Bunny
ByuN vs Shameless
WardiTV Invitational
6 days
BSL
6 days
Liquipedia Results

Completed

Escore Tournament S2: W5
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
KK 2v2 League Season 1
Acropolis #4
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026

Upcoming

BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
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 © 2026 TLnet. All Rights Reserved.