• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 08:38
CEST 14:38
KST 21:38
  • 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!19Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters2Balance hotfix patch 5.0.16b (July 16)88Reynor: 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) How would you feel about frequent/monthly balance patches for SC2? Clem: "I don't have that much hope in Blizzard" Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters [D] Wireframe Casting Removed
Tourneys
IntoTheTV X SOOP SC2 League : Weekly & Monthly INu's Battles#18 - Cure, herO, Rogue & ByuN RSL Revival: Season 6 - Qualifiers and Main Event Master Swan Open (Global Bronze-Master 2) WardiTV Summer Cup 2026
Strategy
[G] Having the right mentality to improve
Custom Maps
[M] (2) Industrial Park New Map Maker - Looking for Advice - Love or Hate
External Content
Mutation # 535 Assembly of Vengeance The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together
Brood War
General
Animated Gateway BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion HORROR STARCRAFT MOVIE How Famous was FlaSh before his Debut?
Tourneys
Escore Tournament - Season 3 [Megathread] Daily Proleagues [IPSL] Spring 2026 Grand Finals - This Weekend! 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
Path of Exile ZeroSpace Early Access is Now Live! Nintendo Switch Thread General RTS Discussion Thread Diablo IV
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
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 NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Artificial Intelligence Thread US Politics Mega-thread Russo-Ukrainian War Thread How to buy a book - shipping from Korea to Europe The Games Industry And ATVI
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
Anime Discussion Thread Series you have seen recently... Movie Discussion! [Req][Books] Good Fantasy/SciFi books
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
How Games can Help with Majo…
TrAiDoS
Hello guys!
LIN1s
ASL S22 English Commentary…
namkraft
Poker (part 2)
Nebuchad
An Exploration of th…
waywardstrategy
Customize Sidebar...

Website Feedback

Closed Threads



Active: 3908 users

The Big Programming Thread - Page 543

Forum Index > General Forum
Post a Reply
Prev 1 541 542 543 544 545 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.
Gowerly
Profile Blog Joined July 2011
United Kingdom916 Posts
November 05 2014 14:40 GMT
#10841
I posted that link and then realised I didn't mean it.
If I'm in Ruby, I will put braces in differently. If I'm doing something like

myArr.each { |item|
item.DoThing()
}

then my braces are like that. I don't know if Ruby even works without it as I'm still rather new.
I will reduce you to a series of numbers.
Manit0u
Profile Blog Joined August 2004
Poland17799 Posts
Last Edited: 2014-11-05 15:01:42
November 05 2014 14:59 GMT
#10842
Ok guys, now I have a different problem... Had to switch branches with the code, all looks fine, except there's 2x more code like stuff I posted on the previous page. I ignore it for the moment but there are other funny things happening.

1. Compiling this code to .war produces file that's 5x smaller than previously, probably missing some dependencies...
2. Errors be thrown: java.lang.NoClassDefFoundError, definitely dependencies are missing...
3. 'mvn depdendency:resolve' downloads all the required stuff, 1 and 2 remain unchanged.

Help? I've recompiled the code like 15 times now, updated everything, all looks cool and dandy, maven is able to install, clean package and all that jazz, but it doesn't work

And yes, all deps are properly included in pom.xml and class that's throwing the error does import the right thing.
Time is precious. Waste it wisely.
bangsholt
Profile Joined June 2011
Denmark138 Posts
November 05 2014 16:14 GMT
#10843
As long as the code is formatted in a consistent way, I don't mind how it's written.

My personal preferences are to follow the style guide of the language you're working in - with the exception of C, where I strongly prefer the Linux Kernel Style.

If it's not consistent, abuse CTRL + K, CTRL + D in VS, CTRL + SHIFT + F in Eclipse or ALT + CTRL + L in IntelliJ.

Now it is.

spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
November 05 2014 17:05 GMT
#10844
On November 06 2014 01:14 bangsholt wrote:
As long as the code is formatted in a consistent way, I don't mind how it's written.

My personal preferences are to follow the style guide of the language you're working in - with the exception of C, where I strongly prefer the Linux Kernel Style.

If it's not consistent, abuse CTRL + K, CTRL + D in VS, CTRL + SHIFT + F in Eclipse or ALT + CTRL + L in IntelliJ.

Now it is.


And then you pray that you're not the guy who has to merge that with another branch that has code changes in the files you just touched.
If you have a good reason to disagree with the above, please tell me. Thank you.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-11-05 18:43:09
November 05 2014 18:25 GMT
#10845
On November 06 2014 01:14 bangsholt wrote:
As long as the code is formatted in a consistent way, I don't mind how it's written.

i am with you brother.
i associate a narrow mind with syntax tears.
conspired against by a confederacy of dunces.
Saumure
Profile Joined February 2012
France404 Posts
Last Edited: 2014-11-05 22:15:34
November 05 2014 20:56 GMT
#10846
Hi guys,
I am pretty desperate
I wrote some c++ code in Qt and when I try to run the executable from the terminal, the program stops right after launching saying:
Illegal instruction

In Qt, when I try to debug, i get:
Debugging starts
&"warning: GDB: Failed to set controlling terminal: Inappropriate ioctl for device\n"

Can someone help me please?

EDIT: solved it
Manit0u
Profile Blog Joined August 2004
Poland17799 Posts
Last Edited: 2014-11-06 11:46:45
November 06 2014 08:48 GMT
#10847
On November 06 2014 03:25 nunez wrote:
Show nested quote +
On November 06 2014 01:14 bangsholt wrote:
As long as the code is formatted in a consistent way, I don't mind how it's written.

i am with you brother.
i associate a narrow mind with syntax tears.


I only want to cry if people don't put return statements on their own line and don't separate control statements from the rest of the code. I couldn't care less about where you put your bracers since I'm simultaneously working on several projects that have totally different brace-placement policy.
Time is precious. Waste it wisely.
Manit0u
Profile Blog Joined August 2004
Poland17799 Posts
Last Edited: 2014-11-06 13:26:50
November 06 2014 13:19 GMT
#10848
On November 05 2014 23:12 spinesheath wrote:
I retract the question. You're defining a method inside a class inside a method inside a class. This just can't be a good idea. Ever.

Is that 3rd method catching the exceptions it throws?


There are plenty of methods that:

a) throw 3 different exceptions in 7 different places
b) catch some of the exceptions they throw themselves and exceptions thrown by other events
c) call other methods that do the same, inside a loop, inside a loop (and those other methods also do such things)
d) there are methods inside classes inside methods inside classes inside methods inside classes and some of those methods are anonymous overrides to methods in classes higher in the order of hierarchy
e) in some classes there are methods that override basic stuff, like count() - my favorite part of it: if (total == 0) { total = 1; }, equals(), etc.

With every passing hour spent trying to understand this code I feel like I'm just diving into madness and going way too far down the rabbit hole...
Time is precious. Waste it wisely.
djookz
Profile Joined November 2014
1 Post
November 06 2014 13:55 GMT
#10849
Hey guys,
I've been an avid reader since this page came out but never felt the urge to make an account, but upon seeing this thread for the first time now (Usually not looking at General), I wanted to ask if some people here use R?
Chocolate
Profile Blog Joined December 2010
United States2350 Posts
November 06 2014 18:04 GMT
#10850
Taking a database class centered around SQL (our professor is lazy and is making the course parallel to a course offered at Stanford, so if you have taken their course, it's like that). Should I expect this to be very hard? I hear it's very useful in the working world, but I'm currently at 13 hours (my next semester I'll be busy with non-school things) and I want to know if I should drop this class if I get into a more important CS class that I'm trying to get.
MichaelEU
Profile Joined February 2011
Netherlands816 Posts
November 06 2014 18:15 GMT
#10851
On November 07 2014 03:04 Chocolate wrote:
Taking a database class centered around SQL (our professor is lazy and is making the course parallel to a course offered at Stanford, so if you have taken their course, it's like that). Should I expect this to be very hard? I hear it's very useful in the working world, but I'm currently at 13 hours (my next semester I'll be busy with non-school things) and I want to know if I should drop this class if I get into a more important CS class that I'm trying to get.


SQL (or rather: database design, which likely involves SQL) is one of the most useful things to learn. It's not that difficult.
世界を革命する力を!― znf: "Michael-oniichan ( *^▽^*)ノ✩キラ✩"
Chocolate
Profile Blog Joined December 2010
United States2350 Posts
November 06 2014 18:22 GMT
#10852
Ok, thanks. Yeah I definitely plan on taking the class eventually but if this one class (intermediate software programming) my school claims to be very helpful to have already done before you start internships opens up, I was planning on swapping them. We'll see I guess.

Also, can any of you tell me why in the world Visual Studio won't let me compile the code on this line? I stared at this shit for half an hour last night and couldn't figure out why VS was being a bitch about it. It's a default constructor for a generic queue class that I have to write for a project

template <typename type>
Queue<type> ::Queue() : head(nullptr), tail(nullptr)
{
//hooray for base initialization
}


The error says "expected semicolon" and that the "<" and ">" don't make sense. I checked a billion times for missing curly brackets and semicolons above this code but couldn't find any.
Khalum
Profile Joined September 2010
Austria831 Posts
November 06 2014 19:07 GMT
#10853
Are you by any chance writing this code in a .cpp file? You can't do that.
Chocolate
Profile Blog Joined December 2010
United States2350 Posts
November 06 2014 19:42 GMT
#10854
Yes this is a .cpp file. I have it so that my .h file includes my .cpp so whenever I need to use a queue I include my .h. I did the same thing (I believe) when I made a generic stack class, and that class is working. I feel like I'm probably making some very obvious mistake but I can't identify it for the life of me.
Khalum
Profile Joined September 2010
Austria831 Posts
Last Edited: 2014-11-06 20:02:59
November 06 2014 19:53 GMT
#10855
You can't put template code in a .cpp file mate.

[edit] That was not well formulated. You can't declare/define template classes/functions in .cpp files.
Chocolate
Profile Blog Joined December 2010
United States2350 Posts
Last Edited: 2014-11-06 20:23:36
November 06 2014 20:23 GMT
#10856
I'm 99% sure you can though, I have a working Stack class where the default constructor is
template <typename type>
Stack<type>::Stack() : head(nullptr)
{
//no code
}
Khalum
Profile Joined September 2010
Austria831 Posts
November 06 2014 20:40 GMT
#10857
Please consider reading this: http://www.parashift.com/c -faq-lite/templates-defn-vs-decl.html
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2014-11-06 20:52:14
November 06 2014 20:44 GMT
#10858
--- Nuked ---
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-11-06 22:56:37
November 06 2014 22:50 GMT
#10859
I think this is a serious weakness. In general, you're supposed to separate implementation and interface (header files). Except that you can't with templates? Isn't there a better option than one file? I've read about 'export' but there is a warning that it'll be deprecated.

On November 07 2014 05:44 Nesserev wrote:
Show nested quote +
On November 07 2014 05:23 Chocolate wrote:
I'm 99% sure you can though, I have a working Stack class where the default constructor is
template <typename type>
Stack<type>::Stack() : head(nullptr)
{
//no code
}

You can put a rusty spoon in your ass... doesn't mean that you should do it.

The baseline is... you're not supposed to do stuff like including source files in your header files. Wtf, where do you even get this idea? Conventions, please. You're supposed to put all template definitions in the same file (.tpp or .hpp).

It makes sense that a compiler cannot compile a generic template directly like a normal class; templates are just a 'blueprint'. When you use the template, you basically create a new class, and for the compiler to generate that class, it needs all the information that is given by the class definition and class method definitions, so you put it in one file altogether.

The reason why it works if you include your source file from your header, is that #includes basically 'copy' the contents of that file to your translation unit... .h and .cpp are just extensions for the sake of conventions and clarity, so they're treated the same way. But just don't do this stuff... you probably forgot your guards and sh!t in your .cpp file. Dangerous slippery slope to hell and stuff..


Actually, some articles suggest including a source file from header so this is no surprise. Here is an example I'm reading at the moment:

http://stackoverflow.com/a/495056/1091781
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2014-11-06 23:09:09
November 06 2014 23:08 GMT
#10860
--- Nuked ---
Prev 1 541 542 543 544 545 1032 Next
Please log in or register to reply.
Live Events Refresh
WardiTV Summer Champion…
12:00
Summer Cup Group C
WardiTV453
Rex89
IndyStarCraft 79
LiquipediaDiscussion
CrankTV Team League
11:00
Crank Gathers S4: Playoffs
LiquipediaDiscussion
KCM Race Survival
10:00
2026 Season 3 Week 3
Kim Chul Min (afreeca) 1133
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko418
Rex 89
IndyStarCraft 79
StarCraft: Brood War
Rain 5303
Calm 4990
BeSt 1810
Bisu 1249
Zeus 879
Jaedong 872
firebathero 558
Horang2 541
EffOrt 363
Mini 363
[ Show more ]
Soma 289
Soulkey 247
Light 228
Stork 175
Snow 172
actioN 171
Last 145
Dewaltoss 120
Hyun 100
Mong 94
Rush 91
Pusan 88
Larva 80
Mind 75
ToSsGirL 53
ggaemo 52
Sea.KH 44
sorry 43
hero 35
Shine 34
Movie 30
[sc1f]eonzerg 28
Bale 26
Barracks 25
JYJ 22
Sacsri 22
yabsab 21
Terrorterran 20
HiyA 20
Sharp 18
Sexy 18
JulyZerg 17
zelot 16
NaDa 14
ajuk12(nOOB) 13
Noble 12
IntoTheRainbow 11
Icarus 8
Dota 2
Dendi793
XcaliburYe138
Counter-Strike
fl0m1882
shoxiejesuss752
markeloff342
edward44
Other Games
FrodaN2459
singsing2399
B2W.Neo624
hiko355
crisheroes315
RotterdaM251
OGKoka 243
uThermal219
Sick182
Liquid`LucifroN153
ArmadaUGS56
CosmosSc2 23
Trikslyr17
Organizations
StarCraft: Brood War
UltimateBattle 31
StarCraft 2
angryscii 19
StarCraft: Brood War
lovetv 11
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 14 non-featured ]
StarCraft 2
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2224
• WagamamaTV370
League of Legends
• Jankos1701
• TFBlade798
Upcoming Events
Replay Cast
11h 22m
Escore
21h 22m
CrankTV Team League
22h 22m
Big Brain Bouts
1d 3h
Soulspirit vs goblin
TriGGeR vs Bunny
Korean StarCraft League
1d 14h
Afreeca Starleague
1d 15h
RSL Revival
1d 20h
Serral vs SHIN
herO vs Solar
Online Event
2 days
Replay Cast
2 days
RSL Revival
2 days
Clem vs ByuN
Rogue vs Lambo
[ Show More ]
OSC
2 days
WardiTV Weekly
3 days
Sparkling Tuna Cup
4 days
INu's Battles
4 days
Cure vs herO
ByuN vs Rogue
PiGosaur Cup
5 days
The PondCast
5 days
Kung Fu Cup
5 days
Patches Events
6 days
Replay Cast
6 days
CrankTV Team League
6 days
Liquipedia Results

Completed

Proleague 2026-07-22
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
ASL Season 22: Qualifier #1
ASL Season 22: Qualifier #2
CSLAN 4
ASL Season 22
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.