• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 11:37
CEST 17:37
KST 00:37
  • 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
Serral wins HomeStory Cup 2914Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
ZeroSpace Early Access is Now Live!8Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters2Balance hotfix patch 5.0.16b (July 16)72Reynor: GSL Loss Wasn't About Preparation Format16[IPSL] Spring 2026 Grand Finals - This Weekend!18
StarCraft 2
General
Balance hotfix patch 5.0.16b (July 16) Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters How would you feel about frequent/monthly balance patches for SC2? Clem: "I don't have that much hope in Blizzard" [D] Wireframe Casting Removed
Tourneys
RSL Revival: Season 6 - Qualifiers and Main Event Master Swan Open (Global Bronze-Master 2) WardiTV Summer Cup 2026 GSL CK #5 Race War HomeStory Cup 29
Strategy
[G] Having the right mentality to improve
Custom Maps
New Map Maker - Looking for Advice - Love or Hate Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
Mutation # 535 Assembly of Vengeance The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together
Brood War
General
HORROR STARCRAFT MOVIE BGH Auto Balance -> http://bghmmr.eu/ How Famous was FlaSh before his Debut? BW General Discussion screpdb: new Starcraft reporting tool
Tourneys
[Megathread] Daily Proleagues [IPSL] Spring 2026 Grand Finals - This Weekend! Escore Tournament - Season 3 Small VOD Thread 2.0
Strategy
Simple Questions, Simple Answers PvT advise for noobs Fighting Spirit mining rates Creating a full chart of Zerg builds
Other Games
General Games
ZeroSpace Early Access is Now Live! ZeroSpace at Steam NextFest - Last free demo Path of Exile Nintendo Switch Thread Stormgate/Frost Giant Megathread
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread How to buy a book - shipping from Korea to Europe The Games Industry And ATVI UK Politics Mega-thread
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
Movie Discussion! Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books Series you have seen recently...
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion MLB/Baseball 2023 McBoner: A hockey love story
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Simple Questions Simple Answers FPS when play League Of Legend on laptop
TL Community
Northern Ireland Global Starcraft The Automated Ban List
Blogs
Hello guys!
LIN1s
Role of Gaming on Mental Hea…
TrAiDoS
ASL S22 English Commentary…
namkraft
Poker (part 2)
Nebuchad
An Exploration of th…
waywardstrategy
ramps on octagon
StaticNine
Customize Sidebar...

Website Feedback

Closed Threads



Active: 5900 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
Hyrule19228 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
WardiTV Summer Champion…
12:05
Summer Cup Group B
WardiTV956
TKL 167
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ByuN 436
ProTech87
SHIN 70
trigger 32
RushiSC 30
StarCraft: Brood War
Calm 6291
Shuttle 2454
Bisu 1952
Britney 1382
Jaedong 1077
Soma 888
Light 532
firebathero 349
Larva 334
Stork 316
[ Show more ]
Hyuk 252
Snow 234
Mini 230
hero 194
Soulkey 175
actioN 162
ggaemo 160
Rush 159
Dewaltoss 126
Mong 110
Sharp 79
Hyun 77
Pusan 60
Free 43
JYJ 41
soO 39
910 34
ToSsGirL 32
sorry 30
Movie 28
Barracks 20
Sacsri 19
Sexy 17
Bale 16
Rock 16
Hm[arnc] 14
IntoTheRainbow 12
Noble 10
Terrorterran 10
ajuk12(nOOB) 9
zelot 8
Dota 2
qojqva2565
Dendi1199
syndereN449
XaKoH 385
League of Legends
Trikslyr48
Counter-Strike
fl0m3196
byalli399
Other Games
FrodaN6128
B2W.Neo937
hiko756
Harstem601
crisheroes337
Hui .192
TKL 167
Liquid`VortiX157
ArmadaUGS130
Livibee77
ToD57
KnowMe52
CosmosSc2 43
SteadfastSC31
Organizations
Other Games
BasetradeTV201
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 16 non-featured ]
StarCraft 2
• poizon28 30
• mYiSmile115
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• blackmanpl 33
• HerbMon 9
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 1302
League of Legends
• Nemesis3598
Upcoming Events
PiGosaur Cup
8h 23m
The PondCast
18h 23m
Kung Fu Cup
19h 23m
OSC
1d 8h
CrankTV Team League
1d 19h
Replay Cast
2 days
CrankTV Team League
2 days
Korean StarCraft League
3 days
Afreeca Starleague
3 days
RSL Revival
3 days
Serral vs SHIN
herO vs Solar
[ Show More ]
Online Event
3 days
Replay Cast
4 days
RSL Revival
4 days
Clem vs ByuN
Rogue vs Lambo
WardiTV Weekly
5 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

Acropolis #4
HSC XXIX
Eternal Conflict S2 E3

Ongoing

CSL 2026 Summer (S21)
KCM Race Survival 2026 Season 3
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
SCTL 2026 Spring
BLAST Bounty Summer Qual
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

Upcoming

Escore Tournament S3: W4
ASL S22 SEASON OPEN Day 2
Escore Tournament S3: W5
CSLAN 4
Blizzard Classic Cup 2026
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
Light Tournament 2026
Eternal Conflict S2 Finale
ESL Pro League Season 24
Stake Ranked Episode 4
Logitech G Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 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.