• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 23:21
CEST 05:21
KST 12:21
  • 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
Clem: "I don't have that much hope in Blizzard"2ZeroSpace Early Access is Now Live!20Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters2Balance hotfix patch 5.0.16b (July 16)89Reynor: GSL Loss Wasn't About Preparation Format17
StarCraft 2
General
How would you feel about frequent/monthly balance patches for SC2? Balance hotfix patch 5.0.16b (July 16) Reynor: GSL Loss Wasn't About Preparation Format Clem: "I don't have that much hope in Blizzard" Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters
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
BW General Discussion How Famous was FlaSh before his Debut? Animated Gateway BGH Auto Balance -> http://bghmmr.eu/ HORROR STARCRAFT MOVIE
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
General RTS Discussion Thread Path of Exile ZeroSpace Early Access is Now Live! Nintendo Switch 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 Community Thread TL Mafia Power Rank NeO.D_StephenKing vs This Guy From 1 Million Dance Vanilla Mini Mafia
Community
General
US Politics Mega-thread Artificial Intelligence 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: 4045 users

The Big Programming Thread - Page 519

Forum Index > General Forum
Post a Reply
Prev 1 517 518 519 520 521 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.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
September 15 2014 23:30 GMT
#10361
hahaha.
conspired against by a confederacy of dunces.
Ben...
Profile Joined January 2011
Canada3485 Posts
Last Edited: 2014-09-16 00:35:14
September 16 2014 00:33 GMT
#10362
Yesterday I forgot that in some cases you need to put -l flags along with your -L$(DIRECTORY) business before -o flags when using a custom library and linking or gcc will not be able to find the required library.

That hour and a half of frustration before remembering that tidbit was my equivalent of a blood sacrifice to the linker gods (it only broke when using object files and trying to link them).

Luckily, today I solved a different linking issue in that same makefile in about 5 minutes.

The linker gods shine brightly upon me today. I shall mark this day in the history books.
"Cliiiiiiiiiiiiiiiiide" -Tastosis
ZenithM
Profile Joined February 2011
France15952 Posts
September 16 2014 00:50 GMT
#10363
On September 16 2014 08:08 RoyGBiv_13 wrote:
Show nested quote +
On September 15 2014 07:09 nunez wrote:
all my programs are silent prayers to gcc:
take onto you my ungodly syntax, and bring forth the indended semantic.


Compilers are one-file-in-one-file-out programs, how hard could they be? Linkers are the true deity.

+ Show Spoiler +

Our Linker in binary,
+x be thy permissions.
Your ELF, COFF, and PE come,
your allocation be done,
on our binary as it is in yours.
Give us libraries for our executable,
and forgive us our bugs,
as we have forgiven our compiler.
And lead us not into warnings,
but deliver us from errors.
Amen

Take unto Thee, this list of blessed libraries, modules, and symbol tables. Let it be to Your eternal satisfaction that all instances of symbols are singularly defined, and that no COMMONS exist. Amen.

Haha that's good. And so true.
Epishade
Profile Blog Joined November 2011
United States2267 Posts
September 16 2014 06:51 GMT
#10364
I hope my question makes sense - I just started Java and I have almost no idea what I'm doing.

I am creating an instance of a class in my Driver using a while loop that asks the user if they want to continue running the program and entering in different values again. I need to have a running total of some variables (cost subtotals etc) that are calculated when the class is created. Each time I rerun the loop though, the subtotals reset to zero.

Here's my while-loop in my driver right now.
+ Show Spoiler +


while (goAgain == 'Y' || goAgain == 'y')
{
System.out.print ("Enter item price: ");
price = input.nextDouble();
System.out.print ("Enter percent discount: ");
percentDiscount = input.nextDouble();
System.out.print ("Enter tax rate: ");
TAX_RATE = input.nextDouble();

new ItemSale(price, percentDiscount, TAX_RATE);

System.out.print ("Would you like to add more items? Y or N: ");
goAgain = input.next().charAt(0);
}



Does the recreation of ItemSale in each loop reset all of the values back to zero (or whatever I set the values to in the constructor) that were in there from the previous iteration? For example, I used TAX_RATE to find the tax value of an item in a method in ItemSale. I wanted to keep a running total of the tax value of all of the items that the user wants to add, but each repeat, the running total goes back to zero.

If it does, I'm not entirely sure how to proceed from here then. If it doesn't, then I guess I'm stuck somewhere else and can't find where to fix it.
Pinhead Larry in the streets, Dirty Dan in the sheets.
icystorage
Profile Blog Joined November 2008
Jollibee19350 Posts
September 16 2014 07:01 GMT
#10365
maybe because you are instantiating ItemSale over and over again? where do you store the running total? what does ItemSale() look like?
LiquidDota StaffAre you ready for a Miracle-? We are! The International 2017 Champions!
Furikawari
Profile Joined February 2014
France2522 Posts
September 16 2014 07:04 GMT
#10366
This line :

new ItemSale(price, percentDiscount, TAX_RATE);

creates a new object. It creates a new reference to a new object, meaning, it uses free spots in the memory. So yes, basically all members of this object are reinitialized in each iteration.

Here you have to problems: design and how to use objects.
I'm not sure of the way you want to handle your sum of taxes, but the object that will contain this value must be declared prior to the entrance in the while in order to be known in each iteration of the while.
Probably that you want to save your ItemSale. So you should have something like :

ItemSale currentItemSale = new ItemSale(price, percentDiscount, TAX_RATE);
itemSales.add(currenItemSale);

With itemSales being a list declared before you enter the while loop.

Another word: by convention, variables in upper letters are constants. So TAXE_RATE should be taxRate in your case, as it is specified for each item. It's not an error, just a convention used by most java programmers.

HTH!
Epishade
Profile Blog Joined November 2011
United States2267 Posts
Last Edited: 2014-09-16 07:17:49
September 16 2014 07:15 GMT
#10367
Darn, I was afraid of that, but I kind of had a feeling that that was the problem, as nothing else seemed like it would have been resetting my values. Thanks.

On September 16 2014 16:01 icystorage wrote:
maybe because you are instantiating ItemSale over and over again? where do you store the running total? what does ItemSale() look like?


I was storing running total in the methods inside ItemSale(), which is why I suppose they were getting wiped each time I reran through the loop.
Pinhead Larry in the streets, Dirty Dan in the sheets.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2014-09-16 13:45:37
September 16 2014 13:34 GMT
#10368
ughhh stupid makefiles

had a rule

EXECS : ${EXEC1} ${EXEC2} ${EXEC3} ${EXEC0}

EXEC2 always fails cause there are no files with the name

was wondering for 3 hours why EXEC0 never built.... i felt so dumb when i realized -____-"
There is no one like you in the universe.
Ben...
Profile Joined January 2011
Canada3485 Posts
Last Edited: 2014-09-16 16:44:19
September 16 2014 16:41 GMT
#10369
On September 16 2014 22:34 Blisse wrote:
ughhh stupid makefiles

had a rule

EXECS : ${EXEC1} ${EXEC2} ${EXEC3} ${EXEC0}

EXEC2 always fails cause there are no files with the name

was wondering for 3 hours why EXEC0 never built.... i felt so dumb when i realized -____-"

That's not so bad. I spent multiple hours trying to get a custom library to work in a makefile.

What it ended up being:

LIB=-L/.../doc/...


when it was supposed to be:

LIB=-L/.../docs/...


I didn't notice for a fairly long time. Added the s and everything compiled perfectly. Felt like a complete idiot for the rest of the day.

That led to my other situation in my previous post. The library would be found correctly when making the object file but not when linking. Ended up burning like 3 hours on a tiny thing. Was not impressed with myself.
"Cliiiiiiiiiiiiiiiiide" -Tastosis
RoyGBiv_13
Profile Blog Joined August 2010
United States1275 Posts
Last Edited: 2014-09-16 22:01:37
September 16 2014 22:00 GMT
#10370
Makefiles are the greatest time saver ever until they aren't.

My company has its own custom project file format. It makes entirely too much sense. Especially when compared to make.

Also, you only need to get bitten by -L, -l, and #include <> versus "" once before you know what to look for, which is nice. It's guaranteed you're going to bump into it at least once though.

Linker directive files are for wizards. Each one I look at I find a new piece of syntax I never knew existed. There is no specification for them, and every linker has it's own syntactical sugar.

+ Show Spoiler +
from a piece of documentation I read today: Calling this function on the same Task twice will result in undesirable behavior.

No joke, it crashed the entire system...
Any sufficiently advanced technology is indistinguishable from magic
nunez
Profile Blog Joined February 2011
Norway4003 Posts
September 16 2014 23:06 GMT
#10371
i consequently use #include<>.
oh, how it pleases the eye.

today i got a part time job offer from the company i programmed for this summer.
they had told me they would probably offer one, but it took longer time than i expected.
i made the logical conclusion over a week ago: they took an actual look at the code i wrote and burned every computer that had compiled it.

this confidence boost brings me back into balance. of course it might be a trap, they want me to come in so they can finish the cleansing for good.
conspired against by a confederacy of dunces.
Cyx.
Profile Joined November 2010
Canada806 Posts
September 16 2014 23:42 GMT
#10372
On September 17 2014 08:06 nunez wrote:
i consequently use #include<>.
oh, how it pleases the eye.

today i got a part time job offer from the company i programmed for this summer.
they had told me they would probably offer one, but it took longer time than i expected.
i made the logical conclusion over a week ago: they took an actual look at the code i wrote and burned every computer that had compiled it.

this confidence boost brings me back into balance. of course it might be a trap, they want me to come in so they can finish the cleansing for good.

Haha this is exactly how I felt last week when my summer company did the same... now I'm fixing a bunch of bugs in all the stuff I wrote this summer rofl
nunez
Profile Blog Joined February 2011
Norway4003 Posts
September 17 2014 00:37 GMT
#10373
that does not bode well!
conspired against by a confederacy of dunces.
Cyx.
Profile Joined November 2010
Canada806 Posts
September 17 2014 01:49 GMT
#10374
On September 17 2014 09:37 nunez wrote:
that does not bode well!

awh it's okay, that's just for the first week or so =P but prepare to get a few bug reports if you wrote anything big near the end of the summer rofl
Millitron
Profile Blog Joined August 2010
United States2611 Posts
Last Edited: 2014-09-17 02:02:37
September 17 2014 02:01 GMT
#10375
On September 17 2014 01:41 Ben... wrote:
Show nested quote +
On September 16 2014 22:34 Blisse wrote:
ughhh stupid makefiles

had a rule

EXECS : ${EXEC1} ${EXEC2} ${EXEC3} ${EXEC0}

EXEC2 always fails cause there are no files with the name

was wondering for 3 hours why EXEC0 never built.... i felt so dumb when i realized -____-"

That's not so bad. I spent multiple hours trying to get a custom library to work in a makefile.

What it ended up being:

LIB=-L/.../doc/...


when it was supposed to be:

LIB=-L/.../docs/...


I didn't notice for a fairly long time. Added the s and everything compiled perfectly. Felt like a complete idiot for the rest of the day.

That led to my other situation in my previous post. The library would be found correctly when making the object file but not when linking. Ended up burning like 3 hours on a tiny thing. Was not impressed with myself.

If we're talking about annoying problems, I got a dilly.

I had to make a sudoku game for a User Interfaces course. It was a semester-long project in which each chapter would end with us implementing the chapter topic in the game. For instance, an early one was to split the game up into an MVC-style program. Anyways, it is the night before the assignment is due, and I am putting what I think is the finishing touches on. 11PM rolls around, and suddenly this program which was nearly complete and running great starts crashing constantly. 7 hours later, and it's 6AM and I find the problem. Somewhere along the way, I had lost a close-parenthesis, and eclipse neglected to tell me. But now I find a few more minor problems and end up working on it until 30 minutes before I present.

tl;dr:
One missed parenthesis almost cost me a semester long project.
Who called in the fleet?
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2014-09-17 02:35:49
September 17 2014 02:20 GMT
#10376
haha, maybe not on one parenthesis level, but this was a makefile error. worked on my machine, did not compile on submission servers. deadline was 11:59 :p can you feel the pain hahaha

+ Show Spoiler +
[image loading]
There is no one like you in the universe.
Millitron
Profile Blog Joined August 2010
United States2611 Posts
September 17 2014 03:35 GMT
#10377
That's the stuff nightmares are made of.
Who called in the fleet?
icystorage
Profile Blog Joined November 2008
Jollibee19350 Posts
September 17 2014 03:47 GMT
#10378
rofl. felt it.
LiquidDota StaffAre you ready for a Miracle-? We are! The International 2017 Champions!
amazingxkcd
Profile Blog Joined September 2010
GRAND OLD AMERICA16375 Posts
September 17 2014 17:02 GMT
#10379
Anyone ever used angularJS or meteorJS to create a front end for exposing an API (documentation)? I'm rebuilding the API docs in house at my work and i want it to look sleek and smooth. back end would run off node

If i could get some tips or tricks for designing this stuff would be appreciated since I never done any web dev before (I'm a soft dev, test guy)
The world is burning and you rather be on this terrible website discussing video games and your shallow feelings
ZenithM
Profile Joined February 2011
France15952 Posts
September 17 2014 18:54 GMT
#10380
On September 17 2014 11:20 Blisse wrote:
haha, maybe not on one parenthesis level, but this was a makefile error. worked on my machine, did not compile on submission servers. deadline was 11:59 :p can you feel the pain hahaha

+ Show Spoiler +
[image loading]

Been there, done that haha. Good (and terrifying) stuff.
Prev 1 517 518 519 520 521 1032 Next
Please log in or register to reply.
Live Events Refresh
Replay Cast
00:00
Crank Gathers S4: Playoffs
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ViBE194
RuFF_SC2 142
Nina 85
FoxeR 65
StarCraft: Brood War
GuemChi 4375
NaDa 58
Dota 2
NeuroSwarm158
LuMiX1
Counter-Strike
summit1g8202
Coldzera 941
Fnx 546
taco 290
minikerr34
Heroes of the Storm
Trikslyr60
Other Games
tarik_tv5188
Doublelift1930
PiGStarcraft446
C9.Mang0381
WinterStarcraft308
JuggernautJason218
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 14 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 6
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush1202
• Lourlo531
Other Games
• Scarra1288
Upcoming Events
Escore
6h 40m
CrankTV Team League
7h 40m
WardiTV Summer Champion…
8h 40m
Big Brain Bouts
12h 40m
Soulspirit vs goblin
TriGGeR vs Bunny
OSC
18h 40m
Korean StarCraft League
23h 40m
Afreeca Starleague
1d
RSL Revival
1d 5h
Serral vs SHIN
herO vs Solar
Online Event
1d 11h
Replay Cast
1d 20h
[ Show More ]
RSL Revival
2 days
Clem vs ByuN
Rogue vs Lambo
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
4 days
The PondCast
5 days
Kung Fu Cup
5 days
Patches Events
5 days
Replay Cast
6 days
CrankTV Team League
6 days
Replay Cast
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
Escore Tournament S3: W4
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

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
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.