• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 11:37
CET 17:37
KST 01: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
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
Sea Duckling Open (Global, Bronze-Diamond) $5,000+ WardiTV 2025 Championship Constellation Cup - Main Event - Stellar Fest RSL Revival: Season 3 Tenacious Turtle Tussle
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
Data analysis on 70 million replays BGH Auto Balance -> http://bghmmr.eu/ Which season is the best in ASL? [ASL20] Ask the mapmakers — Drop your questions BW General Discussion
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
Game Theory for Starcraft How to stay on top of macro? Current Meta PvZ map balance
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread The Perfect Game Path of Exile Should offensive tower rushing be viable in RTS games?
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 Things Aren’t Peaceful in Palestine US Politics Mega-thread 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: 1743 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
Hyrule19167 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
Next event in 23m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
LamboSC2 499
Fuzer 309
BRAT_OK 75
gerald23 66
MindelVK 23
StarCraft: Brood War
Calm 3785
Shuttle 1394
Mini 718
EffOrt 458
Rush 244
Larva 214
Light 173
Snow 99
Hyun 98
hero 88
[ Show more ]
JYJ33
Rock 28
ToSsGirL 27
Aegong 20
soO 20
Terrorterran 18
scan(afreeca) 17
Dota 2
Gorgc5326
qojqva4014
singsing2728
Dendi974
syndereN368
Counter-Strike
zeus384
oskar105
kRYSTAL_4
chrisJcsgo1
Other Games
DeMusliM923
hiko777
FrodaN566
Hui .385
Liquid`VortiX118
QueenE92
KnowMe65
nookyyy 44
Trikslyr38
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• poizon28 17
• Adnapsc2 9
• Reevou 7
• Kozan
• AfreecaTV YouTube
• sooper7s
• intothetv
• IndyKCrew
• LaughNgamezSOOP
• Migwel
StarCraft: Brood War
• HerbMon 8
• FirePhoenix3
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 3148
• WagamamaTV508
League of Legends
• TFBlade1195
Upcoming Events
StarCraft2.fi
23m
Replay Cast
7h 23m
The PondCast
17h 23m
OSC
23h 23m
Demi vs Mixu
Nicoract vs TBD
Babymarine vs MindelVK
ForJumy vs TBD
Shameless vs Percival
Replay Cast
1d 7h
Korean StarCraft League
2 days
CranKy Ducklings
2 days
WardiTV 2025
2 days
SC Evo League
2 days
BSL 21
3 days
Sziky vs OyAji
Gypsy vs eOnzErG
[ Show More ]
OSC
3 days
Solar vs Creator
ByuN vs Gerald
Percival vs Babymarine
Moja vs Krystianer
EnDerr vs ForJumy
sebesdes vs Nicoract
Sparkling Tuna Cup
3 days
WardiTV 2025
3 days
OSC
3 days
BSL 21
4 days
Bonyth vs StRyKeR
Tarson vs Dandy
Replay Cast
4 days
Wardi Open
4 days
StarCraft2.fi
4 days
Monday Night Weeklies
5 days
Replay Cast
5 days
WardiTV 2025
5 days
StarCraft2.fi
5 days
PiGosaur Monday
6 days
StarCraft2.fi
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.