• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 05:56
CEST 11:56
KST 18:56
  • 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
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Flash Announces Hiatus From ASL62Weekly Cups (June 23-29): Reynor in world title form?13FEL Cracov 2025 (July 27) - $8000 live event21Esports World Cup 2025 - Final Player Roster16Weekly Cups (June 16-22): Clem strikes back1
StarCraft 2
General
The SCII GOAT: A statistical Evaluation Statistics for vetoed/disliked maps Program: SC2 / XSplit / OBS Scene Switcher Weekly Cups (June 23-29): Reynor in world title form? PiG Sty Festival #5: Playoffs Preview + Groups Recap
Tourneys
RSL: Revival, a new crowdfunded tournament series WardiTV Mondays FEL Cracov 2025 (July 27) - $8000 live event Korean Starcraft League Week 77 Master Swan Open (Global Bronze-Master 2)
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma Mutation # 477 Slow and Steady
Brood War
General
Flash Announces Hiatus From ASL Player “Jedi” cheat on CSL Practice Partners (Official) ASL20 Preliminary Maps SC uni coach streams logging into betting site
Tourneys
[BSL20] Grand Finals - Sunday 20:00 CET [Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread What do you want from future RTS games? Beyond All Reason
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Trading/Investing Thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 688 users

The Big Programming Thread - Page 60

Forum Index > General Forum
Post a Reply
Prev 1 58 59 60 61 62 1031 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.
One Student
Profile Joined April 2011
73 Posts
June 14 2011 13:30 GMT
#1181
Hey guys I wanted to brush up on the standard way of documenting code. I've been doing it my own way up till now and thought it would be best if I switched early.

So any sites you guys can recommend on documentation standards and what not would be much appreciated.
Depression is what you get for leading a repetitive life.
catamorphist
Profile Joined May 2010
United States297 Posts
June 14 2011 13:33 GMT
#1182
The standard way is use your best judgement.
http://us.battle.net/sc2/en/profile/281144/1/catamorphist/
One Student
Profile Joined April 2011
73 Posts
June 14 2011 13:43 GMT
#1183
On June 14 2011 22:33 catamorphist wrote:
The standard way is use your best judgement.


I don't understand your statement. What does documentation have to do with judgement? Care to elaborate?
Depression is what you get for leading a repetitive life.
wO-ZiGouNeT
Profile Joined January 2011
United Kingdom21 Posts
June 14 2011 13:47 GMT
#1184
That really would depend on what you are working on, sometimes extensive documentation is needed often times it isn't it really depends on the complexity of the project you are working on (and mostly the standards of whoever you are writing the code for some companies require a massive documentation effort and some have none ...).
ddengster
Profile Blog Joined January 2009
Singapore129 Posts
June 14 2011 13:53 GMT
#1185
On June 14 2011 22:33 catamorphist wrote:
The standard way is use your best judgement.

Oh really? It's fine if you're working solo, but when you work in larger team you'll want a good standard way of documentation or you'll face a variety of annoying styles

For starters, put a comment block, followed by a description, then list the parameters down and describe each of them. Finally, add in the return value and describe it. At the end of the day, another guy should be able to read these descriptions and understand how to use your function

Example:
/*******************************/
This function does something
ParamA - Parameter a description
ParamB - Parameter b description
Return - An integer containing the result
/*******************************/

If you're looking for good documentation software, try doxygen. It's the god of all documentation software, and is able to generate useful compiled html help files, though your documentation of course has to comply with doxygen's standards.
Check out NEO Impossible Bosses, RTS-MOBA boss rush at http://neoimpossiblebosses.coder-ddeng.com
catamorphist
Profile Joined May 2010
United States297 Posts
June 14 2011 14:04 GMT
#1186
On June 14 2011 22:53 ddengster wrote:
Show nested quote +
On June 14 2011 22:33 catamorphist wrote:
The standard way is use your best judgement.

Oh really? It's fine if you're working solo, but when you work in larger team you'll want a good standard way of documentation or you'll face a variety of annoying styles

For starters, put a comment block, followed by a description, then list the parameters down and describe each of them. Finally, add in the return value and describe it. At the end of the day, another guy should be able to read these descriptions and understand how to use your function

Example:
/*******************************/
This function does something
ParamA - Parameter a description
ParamB - Parameter b description
Return - An integer containing the result
/*******************************/

If you're looking for good documentation software, try doxygen. It's the god of all documentation software, and is able to generate useful compiled html help files, though your documentation of course has to comply with doxygen's standards.


Sure, but the original asker isn't working with a team and doesn't have a standard coming down from high.

What does documentation have to do with judgement? Care to elaborate?


Is something confusing, surprising, or especially important? If so, spend extra words documenting it. Your judgement is what determines what is worth documenting and how to explain it clearly.
http://us.battle.net/sc2/en/profile/281144/1/catamorphist/
One Student
Profile Joined April 2011
73 Posts
June 14 2011 23:53 GMT
#1187
Thanks for the replies guys. Things are more clear now. ;]
Depression is what you get for leading a repetitive life.
kingcoyote
Profile Blog Joined May 2010
United States546 Posts
June 14 2011 23:59 GMT
#1188
I agree with the Doxygen comment. It's a really good system that is used by a lot of different languages. At the very least, it's a good starting point to flesh out a robust API. You basically just put a specially formatted comment block before each function / class, and doxygen will handle the rest.
AkaHenchway
Profile Joined October 2010
United States41 Posts
June 16 2011 02:12 GMT
#1189
Thanks for the replies yea the error was in how I saved/named the file.
Fuck the Bullshit
AoN.DimSum
Profile Blog Joined September 2008
United States2983 Posts
Last Edited: 2011-06-16 02:40:43
June 16 2011 02:39 GMT
#1190
Hey guys I have a question. Currently I am interested in android app development. My app idea is to locate a person's location, and then it will give the results of the closest gyms around. Also I need to set up a database for the list of gyms. Would I need to set up a web server first to accomplish this? I am trying to learn php so I can figure this out, unless there is a better way.

I am trying to learn a lot, so any tips on java or android development would be appreciated.
by my idol krokkis : "U better hope Finland wont have WCG next year and that I wont gain shitloads of skill, cause then I will wash ur mouth with soap, little man."
Craton
Profile Blog Joined December 2009
United States17246 Posts
Last Edited: 2011-06-16 07:04:53
June 16 2011 07:01 GMT
#1191
You'd either include a database of gym locations with the app itself, or you'd have it call out to a web service that would do the querying and return a result set.

The database would have all of the gym information, including their gps coordinates. I'm not really sure what the most efficient way would be to query the data and then compute which is closest -- probably something along the lines of pulling all the gyms which match a certain range of long and lat coordinates (+/- a certain amount from your current long/lat), then compute distance of each from you, then sort it.

I don't work with Android specifically, so I'm not sure on what it can do with databases on the phone itself.

twitch.tv/cratonz
VIB
Profile Blog Joined November 2007
Brazil3567 Posts
June 16 2011 07:11 GMT
#1192
Yea android can do that with just it's own database. You don't need a web service at all, unless you wanna update your current database. So to do what you want you would just have your own database of gyms in a database and compare that to the gps location. Alternatively, instead of using your own database. You could use the Maps API to make your app search for gyms on google maps. So you don't even need to make your own database nor your own web service.

Learning android is very easy. The amount of stuff they put to help you learn is awesome. Start at this point:
http://developer.android.com/resources/tutorials/hello-world.html

Then go through the other harder tutorials. Then look at the app fundamentals
http://developer.android.com/guide/topics/fundamentals.html

Then toy around with the open source samples on the SDK (there's tons of them). And watch some of the videos on the dev site. There's some great videos about good practices for beginners there.
Great people talk about ideas. Average people talk about things. Small people talk about other people.
AoN.DimSum
Profile Blog Joined September 2008
United States2983 Posts
June 18 2011 05:32 GMT
#1193
thank you guys, I appreciate the advice!

I found really good tutorial videos! http://www.youtube.com/user/CornboyzAndroid
I am learning a lot, thank you.
by my idol krokkis : "U better hope Finland wont have WCG next year and that I wont gain shitloads of skill, cause then I will wash ur mouth with soap, little man."
Vinski
Profile Joined November 2010
505 Posts
June 18 2011 23:09 GMT
#1194
On June 18 2011 14:32 AoN.DimSum wrote:
thank you guys, I appreciate the advice!

I found really good tutorial videos! http://www.youtube.com/user/CornboyzAndroid
I am learning a lot, thank you.

Thanks for the reference to this channel I was having trouble finding good video guides :D
"Sound is in a bad marriage, instead of divorcing her and keeping half your shit, he just committed suicide"
Frigo
Profile Joined August 2009
Hungary1023 Posts
Last Edited: 2011-06-18 23:40:47
June 18 2011 23:33 GMT
#1195
On June 14 2011 22:30 One Student wrote:
Hey guys I wanted to brush up on the standard way of documenting code. I've been doing it my own way up till now and thought it would be best if I switched early.

So any sites you guys can recommend on documentation standards and what not would be much appreciated.


Use a standard syntax for documentation like javadoc or doxygen.
Document everything immediately except truly trivial things, with a general outline and usage of the class or function and whatever you deem important about it at the time of coding. Include references to any source material you used, for example, a link to Wikipedia or some paper describing an algorithm, it helps a lot. It might be useful if not overkill to document design decisions as why a class or function is the way it is, or describing alternatives and advantages or disadvantages of each.

Just make sure you (or someone else) can understand your code with minimal effort a few months later.

A friend's advice from a few months ago when I asked a similar question:

Nam3l3ss says (18:32):
rule of thumb is as follows
well hmm
subjective a bit, but everything that breaks class boundaries is to be documented IMMEDIATELY
everything thats not 100% oop must be documented immediately
Nam3l3ss says (18:33):
patterns must be documented immediately
Werepistike says (18:33):
friend functions and classes as well ?
Nam3l3ss says (18:33):
yes
reverse pathways must be documented and referred to
eg. control inversions or aggregate relationships
there are many cases
Nam3l3ss says (18:34):
in general, document everything thats not 100% natural
eg. trivial get set, or functions which do what their names suggest are not a priority
BUT if the function alters state of an object
and is called externally
it must be documented
http://www.fimfiction.net/user/Treasure_Chest
Natsumar
Profile Joined March 2011
United States91 Posts
June 18 2011 23:35 GMT
#1196
Hey guys, I'm going to start college this fall and I'm planning on majoring in Computer Sciences. I've already enrolled, but when I talked to my advisor she said my first actual class in the major, Fundamentals of Software Design, uses a lot of Java, is very fast paced, and can sometimes jump around, assuming you already know the basics of programming.

Since I've never taken an actual programming class and have only been casually messing around with Visual Basic (trust me, I know), I know all of nothing about actual programming, I was wondering where I could read up this summer about some general concepts of programming and maybe some introduction to Java specifically?
Woah guys, this is where it gets tricky. Because right now we're behind in every conceivable aspect [...] The only thing we're not behind in is micro. Right? We got tons of that shit.
inkblot
Profile Joined December 2004
United States1250 Posts
June 19 2011 00:38 GMT
#1197
On June 19 2011 08:35 Natsumar wrote:
Hey guys, I'm going to start college this fall and I'm planning on majoring in Computer Sciences. I've already enrolled, but when I talked to my advisor she said my first actual class in the major, Fundamentals of Software Design, uses a lot of Java, is very fast paced, and can sometimes jump around, assuming you already know the basics of programming.

Since I've never taken an actual programming class and have only been casually messing around with Visual Basic (trust me, I know), I know all of nothing about actual programming, I was wondering where I could read up this summer about some general concepts of programming and maybe some introduction to Java specifically?


Some universities have good CS lectures online. Here's a Stanford introductory CS lecture series using Java for example: CS106A. IIRC you can find the class website for this course with most/all of the resources you might need to go through the course as if you were a student.
mmp
Profile Blog Joined April 2009
United States2130 Posts
June 19 2011 12:06 GMT
#1198
On June 19 2011 08:35 Natsumar wrote:
Hey guys, I'm going to start college this fall and I'm planning on majoring in Computer Sciences. I've already enrolled, but when I talked to my advisor she said my first actual class in the major, Fundamentals of Software Design, uses a lot of Java, is very fast paced, and can sometimes jump around, assuming you already know the basics of programming.

Since I've never taken an actual programming class and have only been casually messing around with Visual Basic (trust me, I know), I know all of nothing about actual programming, I was wondering where I could read up this summer about some general concepts of programming and maybe some introduction to Java specifically?

A software engineering class is not a class about programming in any particular language. It's about designing software systems that operate in a sane and predictable manner, as well as avoiding and debugging common pitfalls. The skills learned will ideally be applicable to many other languages. The course will probably give you a week to pick up the language used (Java is popular in some top universities, but is no less significant than C++ (or even C# in some industries) as a core language for the curriculum).

Know everything on this page by the first lecture and you should be up to speed.
http://download.oracle.com/javase/tutorial/java/index.html
I (λ (foo) (and (<3 foo) ( T_T foo) (RAGE foo) )) Starcraft
AkaHenchway
Profile Joined October 2010
United States41 Posts
Last Edited: 2011-06-20 01:32:32
June 20 2011 01:29 GMT
#1199
Hey guys this is not so much a programming question as it is a math question. For the life of me right now I can think how to set up the correct equation I need.
+ Show Spoiler +
import java.util.Scanner;

public class minuteconversion{

public static void main(String[] args) {

Scanner input = new Scanner(System.in);

System.out.print(" Enter the number of minutes: ");

double minutes = input.nextDouble();

int years = (int)(minutes / 525600);

// And here is where I go full retard on math
int daysleft = (int)(minutes / 1440);

System.out.println(" "+ minutes + " minutes is approximately " + years + " years and " + daysleft + " days left ");


}
}

The program I am writing is for a Java class. Goal of the program is to convert minutes to years and display the approximate number of days left. I just for the life of me cannot think of what equation I need to get it to display the number of days left.....Currently the program displays the years correctly (as a whole number), but then when it displays the number of days, it displays over 1 year of days left....I.E when I enter 535600 I get 371 days left.......probably painfully obvious and easy equation....but as I said I'm currently been drawing a blank for about the past 45 minutes. + Show Spoiler +
Thanks guys! Also if you could leave a explanation for why you do the math a certain way that would be helpful as I am semi math retarded.
Fuck the Bullshit
Frigo
Profile Joined August 2009
Hungary1023 Posts
June 20 2011 03:06 GMT
#1200
You have to subtract the days already counted in the years.
int daysleft = (int)(minutes / 1440) - years * 365;
http://www.fimfiction.net/user/Treasure_Chest
Prev 1 58 59 60 61 62 1031 Next
Please log in or register to reply.
Live Events Refresh
Next event in 4m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Tasteless 309
Crank 103
MindelVK 32
StarCraft: Brood War
Sea 9322
Horang2 2962
Bisu 793
Hyuk 606
Leta 322
Soma 276
TY 173
PianO 164
Jaedong 160
Killer 144
[ Show more ]
ToSsGirL 130
EffOrt 110
ZerO 102
Rush 47
JulyZerg 41
HiyA 23
Free 21
zelot 18
Movie 7
Sacsri 7
ajuk12(nOOB) 6
ivOry 3
Dota 2
XaKoH 745
XcaliburYe693
Fuzer 214
League of Legends
JimRising 564
Counter-Strike
Stewie2K1875
Heroes of the Storm
Khaldor284
Other Games
Happy502
Pyrionflax244
crisheroes202
ZerO(Twitch)19
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Berry_CruncH319
• LUISG 23
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota2339
League of Legends
• Lourlo1223
Upcoming Events
RSL Revival
4m
Clem vs Classic
SHIN vs Cure
Tasteless330
Crank 145
3DClanTV 0
FEL
2h 4m
WardiTV European League
2h 4m
BSL: ProLeague
8h 4m
Dewalt vs Bonyth
Replay Cast
1d 14h
Sparkling Tuna Cup
2 days
WardiTV European League
2 days
The PondCast
3 days
Replay Cast
3 days
RSL Revival
4 days
[ Show More ]
Replay Cast
4 days
RSL Revival
5 days
FEL
5 days
RSL Revival
6 days
FEL
6 days
FEL
6 days
Liquipedia Results

Completed

BSL 2v2 Season 3
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
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.