• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 10:44
CEST 16:44
KST 23:44
  • 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
[ASL22] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9Serral wins HomeStory Cup 2915Serral wins Maestros of the Game 244ByuL, and the Limitations of Standard Play3
Community News
Official StarCraft website teases new content ahead of BlizzCon?76Stellar Fest TWO the Moon (Dec 16-20)9Weekly Cups (August 24-30): Patches' balance mod takes over3New 3v3 BGH Ladder (and more) on ShieldBattery!40Weekly Cups (August 17-23): Zerg dominate the week6
StarCraft 2
General
Nexon wins bid to develop StarCraft IP content, distribute Overwatch mobile game SC4ALL: II Winner Will Earn a Spot at HSC 30! Weekly Cups (August 24-30): Patches' balance mod takes over Balance hotfix patch 5.0.16b (July 16) September World Ranking: herO leads, Serral climbs
Tourneys
Stellar Fest TWO the Moon (Dec 16-20) IntoTheTV X SOOP SC2 League : Weekly & Monthly SC2 INu's Battles#20 [BO.9] 2026 GSTL Announcement PIG STY FESTIVAL 8.0! (13 - 23 August)
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
Mutation # 541 Binary Choice The PondCast: SC2 News & Results Mutation # 540 Dodge This Mutation # 539 Thunder Dome
Brood War
General
ASL22 General Discussion Gypsy to Korea Official StarCraft website teases new content ahead of BlizzCon? [Personal Project Share] Terran Defense v0.60 BW General Discussion
Tourneys
KCM Race Survival 2026 Season 3 Brood War in Budapest ! WORTEX 2026 BW Finals [Megathread] Daily Proleagues BSL LAN Party - Kraków 29-30 August - OPEN SIGNUPS
Strategy
Odyssey Mineral Stack Saturation Replay Review Process - What do you do? Game Theory for Starcraft Fighting Spirit mining rates
Other Games
General Games
Nintendo Switch Thread Diablo IV EVE Corporation [Maplestory Hardcore] Let's Play~!! General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank TL Mafia Community Thread NeO.D_StephenKing vs This Guy From 1 Million Dance
Community
General
US Politics Mega-thread Artificial Intelligence Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread UK Politics Mega-thread
Fan Clubs
MarineLorD Fan Club The Creator Fan Club The ShoWTimE Fan Club
Media & Entertainment
Movie Discussion! Anime Discussion Thread
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023 NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Dreaming of BW patches (mod…
c3rberUs
Regacy Esports: The Bh…
regacyesports
Violent Games and Crime Rate…
TrAiDoS
LOCKPICKING NOOB
LUCKY_NOOB
Cathedral Of CS And NY pizza a…
FuDDx
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7666 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
Hyrule19252 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 19h 17m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SHIN 228
StarCraft: Brood War
Britney 57123
Calm 6390
Shuttle 4430
actioN 893
Horang2 631
Hyuk 606
Mini 321
firebathero 225
hero 160
Mong 136
[ Show more ]
Sexy 101
Hyun 101
Last 77
910 77
Barracks 55
Bonyth 53
Aegong 33
Yoon 29
sSak 28
Sharp 21
Free 18
HiyA 15
SilentControl 13
scan(afreeca) 11
LancerX 11
ajuk12(nOOB) 9
Rock 9
Terrorterran 1
Dota 2
Gorgc4334
qojqva2554
420jenkins249
LuMiX2
Counter-Strike
fl0m3444
byalli983
SPUNJ326
dupreeh174
Super Smash Bros
Mew2King120
Heroes of the Storm
Khaldor305
Liquid`Hasu204
Other Games
B2W.Neo960
singsing795
Beastyqt413
RotterdaM291
Mlord209
Liquid`VortiX117
KnowMe111
QueenE27
Organizations
Other Games
EGCTV614
StarCraft: Brood War
lovetv 10
[ Show 13 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
• mYiSmile10
StarCraft: Brood War
• Michael_bg 9
• FT.aCt)Sony3
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV583
League of Legends
• Jankos1699
Upcoming Events
Sparkling Tuna Cup
19h 17m
OSC
21h 17m
Shopify Rebellion Sundays
1d
Mixu vs TBD
Spirit vs TBD
Clem vs TBD
Patches Events
1d 1h
OSC
1d 9h
Afreeca Starleague
1d 19h
Soma vs Shuttle
BeSt vs Rush
WardiTV Weekly
1d 20h
Monday Night Weeklies
2 days
Afreeca Starleague
2 days
Leta vs ggaemo
Jaedong vs Queen
GSL
2 days
[ Show More ]
PiGosaur Cup
3 days
Kung Fu Cup
3 days
Replay Cast
4 days
The PondCast
4 days
KCM Race Survival
4 days
Escore
5 days
IntoTheTV X SOOP
5 days
CranKy Ducklings
6 days
Liquipedia Results

Completed

Proleague 2026-09-02
PiG Sty Festival 8.0
Light Tournament 2026

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
ASL Season 22
Super Anchor Qualifying S3
CSL 2026 AUTUMN (S22)
Acropolis #5
Acropolis #5 - TRS
RSL Revival: Season 6
Calamity Invitational
Big Dog Cup 2026 Div 1
BLAST Open Fall 2026
Esports World Cup 2026
Esports World Cup 2026: LCQ
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026

Upcoming

Escore Tournament S3: King of Kings
Blizzard Classic Cup 2026
Acropolis #5 - GSA
Acropolis #5 - GSB
Acropolis #5 - GSC
SC4ALL II: Brood War
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
1win Private Club #2
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #3
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.