• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 00:05
CET 06:05
KST 14:05
  • 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
BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband Information Request Regarding Chinese Ladder SC: Evo Complete - Ranked Ladder OPEN ALPHA
Tourneys
$5,000+ WardiTV 2025 Championship Constellation Cup - Main Event - Stellar Fest RSL Revival: Season 3 Tenacious Turtle Tussle [Alpha Pro Series] Nice vs Cure
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
Which season is the best in ASL? [ASL20] Ask the mapmakers — Drop your questions BW General Discussion FlaSh's Valkyrie Copium BGH Auto Balance -> http://bghmmr.eu/
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
Stormgate/Frost Giant Megathread The Perfect Game Path of Exile Nintendo Switch Thread 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
Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread 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: 1248 users

The Big Programming Thread - Page 394

Forum Index > General Forum
Post a Reply
Prev 1 392 393 394 395 396 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.
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
November 16 2013 04:17 GMT
#7861
My professor said we weren't supposed to use weak entities. This is bugging me.

Like my assignment is to draw out an ERD. It sounds simple but not having any weak entities just seems like unnecessary complexity to a system.

Eg my system has users
It also has items
and it has bids

the bids table might not have bid ids. I might want that to be a weak entity. What's wrong with that?
I guess if I delete the user or the item the bid will disappear too, but if my item disappears or the user does, don't I want the bid to disappear?
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
ObviousOne
Profile Joined April 2012
United States3704 Posts
November 16 2013 04:38 GMT
#7862
Bid is linked to a user and an item and has an amount. Doesn't that qualify as a strong entity?

Bid table:
PK- bid id
FK- user id
FK- item id
bid amount

No? Been ages since I had this class.
Fear is the only darkness. ~Destiny Fan Club operator~
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
November 16 2013 06:22 GMT
#7863
On November 16 2013 13:38 ObviousOne wrote:
Bid is linked to a user and an item and has an amount. Doesn't that qualify as a strong entity?

Bid table:
PK- bid id
FK- user id
FK- item id
bid amount

No? Been ages since I had this class.

That would qualify, and that's what I'm thinking of doing just so I'll have a strong entity, but then what's the point of calling them foreign keys? Isn't this overly complicated?
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
ObviousOne
Profile Joined April 2012
United States3704 Posts
Last Edited: 2013-11-16 07:26:55
November 16 2013 07:17 GMT
#7864
On November 16 2013 15:22 obesechicken13 wrote:
Show nested quote +
On November 16 2013 13:38 ObviousOne wrote:
Bid is linked to a user and an item and has an amount. Doesn't that qualify as a strong entity?

Bid table:
PK- bid id
FK- user id
FK- item id
bid amount

No? Been ages since I had this class.

That would qualify, and that's what I'm thinking of doing just so I'll have a strong entity, but then what's the point of calling them foreign keys? Isn't this overly complicated?

FK reienforces relationships, right? You want to make sure there are no bids without corresponding items or users, so you get referential integrity or w/e the word is.

bid_id user_id item_id bid_amount
1 101 1001 999.99
2 105 1001 1499.99
3 101 1001 1999.99

You can then look up all bids from X person on Y item. You never want a situation where the user_id or item_id is invalid. This gives you bid history and a query can give you the max bid based on item to find the winner or whatever other business goals you might have.

The DBMS enforces the relationships for you, I think is the purpose of calling it a FK.
Fear is the only darkness. ~Destiny Fan Club operator~
FakePseudo
Profile Joined January 2012
Belgium716 Posts
November 16 2013 08:02 GMT
#7865
Hi guys,

So I've been using git for more then a year now, and I'm starting to go a bit beyond the basics, as I have to maintain several repos for some groups assignment where most users are really inexperimented (with git I mean). However, one thing still bothers me: what is your easiest and fastest way to apply changes across all branches (like a .gitignore change or w/e makes sense to you) that does not involve git push force right after it (so no rewinding history to a common ancestor or other weird rebasing)? For the time being I use cherry-picking or merging but it really isn't efficient nor meaningful for anyone reading the git log or tree, but I figure there should be a better way...(googling and all didnt help much)
I am the 0.0007% /forum/viewpost.php?post_id=17208334|| Big Black Women Vocals Is Like Porn to my Ears ||San Antonio Spurs|Boston Celtics||#1EZToss Hater;
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
Last Edited: 2013-11-16 08:29:48
November 16 2013 08:29 GMT
#7866
On November 16 2013 16:17 ObviousOne wrote:
Show nested quote +
On November 16 2013 15:22 obesechicken13 wrote:
On November 16 2013 13:38 ObviousOne wrote:
Bid is linked to a user and an item and has an amount. Doesn't that qualify as a strong entity?

Bid table:
PK- bid id
FK- user id
FK- item id
bid amount

No? Been ages since I had this class.

That would qualify, and that's what I'm thinking of doing just so I'll have a strong entity, but then what's the point of calling them foreign keys? Isn't this overly complicated?

FK reienforces relationships, right? You want to make sure there are no bids without corresponding items or users, so you get referential integrity or w/e the word is.

bid_id user_id item_id bid_amount
1 101 1001 999.99
2 105 1001 1499.99
3 101 1001 1999.99

You can then look up all bids from X person on Y item. You never want a situation where the user_id or item_id is invalid. This gives you bid history and a query can give you the max bid based on item to find the winner or whatever other business goals you might have.

The DBMS enforces the relationships for you, I think is the purpose of calling it a FK.

Alright thank you. I wasn't even sure if an entity could have a foreign key and primary key in the same setting. I think I've tried it out in code but I was getting some errors whenever I did anything with foreign keys. That's why I couldn't just try to have a primary key and foreign key together.

I still don't know if this is a best practice but it's what the professor wants.
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
PVJ
Profile Blog Joined July 2012
Hungary5221 Posts
November 16 2013 12:23 GMT
#7867
Hey guys, is anyone here using Scala w the play! framework? I'd like to organise a get together at the ping conference but I'm not sure if anyone would be interested.
The heart's eternal vow
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
November 16 2013 20:19 GMT
#7868
On November 16 2013 17:02 FakePseudo wrote:
Hi guys,

So I've been using git for more then a year now, and I'm starting to go a bit beyond the basics, as I have to maintain several repos for some groups assignment where most users are really inexperimented (with git I mean). However, one thing still bothers me: what is your easiest and fastest way to apply changes across all branches (like a .gitignore change or w/e makes sense to you) that does not involve git push force right after it (so no rewinding history to a common ancestor or other weird rebasing)? For the time being I use cherry-picking or merging but it really isn't efficient nor meaningful for anyone reading the git log or tree, but I figure there should be a better way...(googling and all didnt help much)


This really, really sounds like you are trying to solve the wrong problem in a wrong way, so let me ask:
What are you actually trying to accomplish and why?
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
Last Edited: 2013-11-16 20:29:54
November 16 2013 20:24 GMT
#7869
On November 16 2013 17:29 obesechicken13 wrote:
Show nested quote +
On November 16 2013 16:17 ObviousOne wrote:
On November 16 2013 15:22 obesechicken13 wrote:
On November 16 2013 13:38 ObviousOne wrote:
Bid is linked to a user and an item and has an amount. Doesn't that qualify as a strong entity?

Bid table:
PK- bid id
FK- user id
FK- item id
bid amount

No? Been ages since I had this class.

That would qualify, and that's what I'm thinking of doing just so I'll have a strong entity, but then what's the point of calling them foreign keys? Isn't this overly complicated?

FK reienforces relationships, right? You want to make sure there are no bids without corresponding items or users, so you get referential integrity or w/e the word is.

bid_id user_id item_id bid_amount
1 101 1001 999.99
2 105 1001 1499.99
3 101 1001 1999.99

You can then look up all bids from X person on Y item. You never want a situation where the user_id or item_id is invalid. This gives you bid history and a query can give you the max bid based on item to find the winner or whatever other business goals you might have.

The DBMS enforces the relationships for you, I think is the purpose of calling it a FK.

Alright thank you. I wasn't even sure if an entity could have a foreign key and primary key in the same setting. I think I've tried it out in code but I was getting some errors whenever I did anything with foreign keys. That's why I couldn't just try to have a primary key and foreign key together.

I still don't know if this is a best practice but it's what the professor wants.


There is a common problem people run into when they start to use foreign keys and from the sound of it, you encountered it as well:
Foreign keys are in the database scope, meaning you can't use two equally named foreign keys, even if they are in different tables. They always have to have a unique name. MySQL has horrible error messages which really never explain the actual problem, so it's possible you tried to use two equally named foreign keys when you tried to use a primary and foreign key together.

On November 16 2013 13:17 obesechicken13 wrote:
My professor said we weren't supposed to use weak entities. This is bugging me.

Like my assignment is to draw out an ERD. It sounds simple but not having any weak entities just seems like unnecessary complexity to a system.

Eg my system has users
It also has items
and it has bids

the bids table might not have bid ids. I might want that to be a weak entity. What's wrong with that?
I guess if I delete the user or the item the bid will disappear too, but if my item disappears or the user does, don't I want the bid to disappear?


There are lots of situations where, even when the item it relates to is deleted, you want to keep the entry. As a simple example, think of a message board. If you delete a user, you still want the posts to remain so the discussion stays consistent and doesn't suddenly have holes. For bids, yes, you'd probably want them to disappear. It always depends on the program.
FakePseudo
Profile Joined January 2012
Belgium716 Posts
November 16 2013 21:57 GMT
#7870
On November 17 2013 05:19 Morfildur wrote:
Show nested quote +
On November 16 2013 17:02 FakePseudo wrote:
Hi guys,

So I've been using git for more then a year now, and I'm starting to go a bit beyond the basics, as I have to maintain several repos for some groups assignment where most users are really inexperimented (with git I mean). However, one thing still bothers me: what is your easiest and fastest way to apply changes across all branches (like a .gitignore change or w/e makes sense to you) that does not involve git push force right after it (so no rewinding history to a common ancestor or other weird rebasing)? For the time being I use cherry-picking or merging but it really isn't efficient nor meaningful for anyone reading the git log or tree, but I figure there should be a better way...(googling and all didnt help much)


This really, really sounds like you are trying to solve the wrong problem in a wrong way, so let me ask:
What are you actually trying to accomplish and why?


Well last time it occured to me, I basically wanted to add so random merge backup file (.orig) to the .gitignore.
I am the 0.0007% /forum/viewpost.php?post_id=17208334|| Big Black Women Vocals Is Like Porn to my Ears ||San Antonio Spurs|Boston Celtics||#1EZToss Hater;
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
Last Edited: 2013-11-17 03:34:25
November 17 2013 00:14 GMT
#7871
Is every relationship also a table in an ERD?

edit: no they aren't. You just need to join the tables later on primary keys to work with them.
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
Housemd
Profile Joined March 2010
United States1407 Posts
November 17 2013 03:06 GMT
#7872
Ok guys, I'm a complete newbie so please bear with me. I'm also not sure if this is allowed but here goes nothing.

The task is to write Java code using a for statement to sum the numbers from 1 through 50.

This is what I have so far:

int sum = 0;
for (int y = 0; y<=50; y++);
{
sum = sum + y;
}
System.out.println(sum);


Now, the problem is that Eclipse keeps on saying "y" is an unresolved variable. I just can't understand it. I have declared y in my for loop and while searching online, I saw the same thing. I need to get through this problem to make sure my sum is correct so if someone could please point out my mistake, it would be a big help.
Fantasy is a beast
ZenithM
Profile Joined February 2011
France15952 Posts
Last Edited: 2013-11-17 03:15:41
November 17 2013 03:12 GMT
#7873
On November 17 2013 12:06 Housemd wrote:
Ok guys, I'm a complete newbie so please bear with me. I'm also not sure if this is allowed but here goes nothing.

The task is to write Java code using a for statement to sum the numbers from 1 through 50.

This is what I have so far:

int sum = 0;
for (int y = 0; y<=50; y++);
{
sum = sum + y;
}
System.out.println(sum);


Now, the problem is that Eclipse keeps on saying "y" is an unresolved variable. I just can't understand it. I have declared y in my for loop and while searching online, I saw the same thing. I need to get through this problem to make sure my sum is correct so if someone could please point out my mistake, it would be a big help.

Should probably be:
int sum = 0;
for (int y = 0; y<=50; y++)
{
sum = sum + y;
}
System.out.println(sum);

without the semicolon after the closing parenthesis.

for (int y = 0; y <= 50; y++); essentially means "do nothing 51 times"
and Java doesn't know what "y" means outside of the for loop it has been declared in, so "y" is unresolved in the following block (the "{ }" delimitate what is called a block, which is essentially a sequence of lines of code where variables declared inside mean something. Look up http://en.wikipedia.org/wiki/Scope_(computer_science)#Block_scope).
Housemd
Profile Joined March 2010
United States1407 Posts
November 17 2013 03:14 GMT
#7874
On November 17 2013 12:12 ZenithM wrote:
Show nested quote +
On November 17 2013 12:06 Housemd wrote:
Ok guys, I'm a complete newbie so please bear with me. I'm also not sure if this is allowed but here goes nothing.

The task is to write Java code using a for statement to sum the numbers from 1 through 50.

This is what I have so far:

int sum = 0;
for (int y = 0; y<=50; y++);
{
sum = sum + y;
}
System.out.println(sum);


Now, the problem is that Eclipse keeps on saying "y" is an unresolved variable. I just can't understand it. I have declared y in my for loop and while searching online, I saw the same thing. I need to get through this problem to make sure my sum is correct so if someone could please point out my mistake, it would be a big help.

Should probably be:
Show nested quote +
int sum = 0;
for (int y = 0; y<=50; y++)
{
sum = sum + y;
}
System.out.println(sum);

without the semicolon after the closing parenthesis.

for (int y = 0; y <= 50; y++); essentially means "do nothing 51 times"
and Java doesn't know what "y" means outside of the for loop it has been declared in, so "y" is unresolved.



You my friend, are a lifesaver.

Argh, such a stupid mistake. I always whiff on semicolons so the one time I make sure I put them, it comes back to haunt me

Thanks again though.
Fantasy is a beast
ZenithM
Profile Joined February 2011
France15952 Posts
Last Edited: 2013-11-17 03:21:12
November 17 2013 03:18 GMT
#7875
Yeah, it's not easy at the beginning
For now I would advise you to remember not to put any semicolon after something like if (...), for (...), while (...), switch (...) and such. Always make sure to write something like:

while ( [your condition] ) {
[fill in your code here]
}

Maybe putting the opening "{" just after the ")", on the same line, will help you forget about putting a semicolon there
typeid
Profile Joined November 2013
United States1 Post
November 17 2013 05:10 GMT
#7876
Hello All!

This is my first post on TL! How exciting!!!!!
With that being said, if this is in the wrong forum or perhaps it is inappropriate to post something like this in another thread I apologize in advance and ask any mods to move or remove it as necessary.

(a little about me for honesty's sake...)
I don't have any professional experience programming but I have been researching and practicing since 1999. I have current gone through about 3 years of college on the subject though.

On several occasions I've considered different ways of creating some kind of more extensive programming tutorial for others to use and reference. I feel that a large amount of the information you can find on the internet is too specific and therefore difficult to extrapolate to your own projects.

For example, you might look at an article or tutorial about say spatial partitioning. More often than not it will give you one specific system, tell you how it works, throw some code at you (the good ones will explain it!) and let you be on your way. Now don't get me wrong these are invaluable resources and I am by no means trying to tell anyone not to use them.

On the other hand, I would like to share some of the knowledge I've accumulated through the years and I was think about doing it through a live stream. That way I could have some immediate feedback and viewers could ask questions through the chat.

I was thinking of doing it a few hours a day (6 pm - 10 pm EST) for three days a week (Wed, Thurs, Fri).

I planned on doing three different broad topics, one for the each of the three days.

Day one would probably be something like a "programming for newbies" approach, if you have no prior knowledge what so ever this would be where we start.

Day two would something more game programming specific. I have composed a few games over the years some text, 2D, and 3D. I love programming games it is very rewarding and I would be happy to give some other interested people that same enjoyment.

Day three I though would be good for a Q&A. (Questions of course could be asked other days, but if the answer is long winded I will just write it down and save it for day three).

An important note the language I prefer is C++ and as such will be the only language I'll talk about. C++ is fast, generic, and cross platform for the most part (not necessarily APIs though). Also, like most programmers, I'm incredibly biased towards my language of choice. Most of the ideas will be applicable to any language but the responsibility of figuring out the syntax semantic differences will be on you.

DISCLAIMER: I do not know anything officially.

I can't guarantee that I will have an answer immediately, but if it's a good question and I can't answer immediately I will definitely look into it.

I would like to know if anyone is actually interested in something like this before I start though as I would hate to waste valuable game time (lol).

I'll probably make a new thread on the matter in a couple days!

My e-mail: bghomashi@gmail.com
Twitch ID: typeid

Shoot me an e-mail or reply if you have any thoughts on the matter or even if you think its a silly idea.

Thanks guys (and maybe the one or two females? Maybe?)!
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
Last Edited: 2013-11-17 05:34:00
November 17 2013 05:25 GMT
#7877
On November 16 2013 17:02 FakePseudo wrote:
Hi guys,

So I've been using git for more then a year now, and I'm starting to go a bit beyond the basics, as I have to maintain several repos for some groups assignment where most users are really inexperimented (with git I mean). However, one thing still bothers me: what is your easiest and fastest way to apply changes across all branches (like a .gitignore change or w/e makes sense to you) that does not involve git push force right after it (so no rewinding history to a common ancestor or other weird rebasing)? For the time being I use cherry-picking or merging but it really isn't efficient nor meaningful for anyone reading the git log or tree, but I figure there should be a better way...(googling and all didnt help much)


I work at a company with an engineering team of about 16 and we keep all branches up to date with production by automatically merging master in after every successful deploy. If you could explain a bit more about why you want to apply a change across all branches that would be helpful. Usually you'd just branch off master and then make a pull request into master, and then everyone would have that change if they're keeping their branch up to date with master. They could resolve any conflicts themselves, or if they didn't want to deal with that they could just let their branch fall behind master and then you could handle the merge while processing their pull request.

It seems to me like this problem is occuring because you're all committing to branches and merging them yourselves instead of making pull requests to merge your feature branch into master or an appropriate integration branch.

One of the biggest benefits of working with a group of people on a project is having your code reviewed by someone else. They don't' have to be more experienced than you, or even understand all of your code, just having a second set of eyes makes a huge difference. Get into the habit of making pull requests, assigning them to someone, getting feedback, and iterating. This helps everyone enforce good programming habits, and it makes it easier for you to stray outside your comfort zone, knowing that you can get someone who knows more about what you're trying to accomplish to look over your code and help you make it the best it can be.

Good luck with Git!
Rollin
Profile Joined March 2011
Australia1552 Posts
November 17 2013 05:42 GMT
#7878
On November 17 2013 14:10 typeid wrote:
An important note the language I prefer is C++ and as such will be the only language I'll talk about. C++ is fast, generic, and cross platform for the most part (not necessarily APIs though).



I'll see if I can stop in sometime next week if you're running it to sus it out .
Throw off those chains of reason, and your prison disappears. | Check your posting frequency timeline: http://www.teamliquid.net/mytlnet/post_activity_img.php
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
November 17 2013 12:37 GMT
#7879
On November 17 2013 06:57 FakePseudo wrote:
Show nested quote +
On November 17 2013 05:19 Morfildur wrote:
On November 16 2013 17:02 FakePseudo wrote:
Hi guys,

So I've been using git for more then a year now, and I'm starting to go a bit beyond the basics, as I have to maintain several repos for some groups assignment where most users are really inexperimented (with git I mean). However, one thing still bothers me: what is your easiest and fastest way to apply changes across all branches (like a .gitignore change or w/e makes sense to you) that does not involve git push force right after it (so no rewinding history to a common ancestor or other weird rebasing)? For the time being I use cherry-picking or merging but it really isn't efficient nor meaningful for anyone reading the git log or tree, but I figure there should be a better way...(googling and all didnt help much)


This really, really sounds like you are trying to solve the wrong problem in a wrong way, so let me ask:
What are you actually trying to accomplish and why?


Well last time it occured to me, I basically wanted to add so random merge backup file (.orig) to the .gitignore.


What you want to do in this case, as CatNzHat already mentioned, is to put your change into the root branch, usually master, and let the users of the other branches update themselves at an appropriate time with "git merge master". Changes should generally be deployed with pull or merge, not with push, because otherwise you'll run into trouble when there are already conflicting changes.

Just put the .gitignore into your master branch and let the others merge the change into their branches.
FunkyLich
Profile Blog Joined August 2010
United States107 Posts
November 18 2013 01:44 GMT
#7880
On November 17 2013 12:06 Housemd wrote:
Ok guys, I'm a complete newbie so please bear with me. I'm also not sure if this is allowed but here goes nothing.

The task is to write Java code using a for statement to sum the numbers from 1 through 50.

This is what I have so far:

int sum = 0;
for (int y = 0; y<=50; y++);
{
sum = sum + y;
}
System.out.println(sum);


Now, the problem is that Eclipse keeps on saying "y" is an unresolved variable. I just can't understand it. I have declared y in my for loop and while searching online, I saw the same thing. I need to get through this problem to make sure my sum is correct so if someone could please point out my mistake, it would be a big help.


So it sounds like you found the problem with the semicolon. I just wanted to point out something I would consider a mistake. Your for loop took y from 0 to 50 instead of 1 to 50. I'm not trying to be nit picky. I understand it produces the same result; I just wanted to make sure you were not being careless. When programming loops, it can get very tricky to think about all the plus ones and minus ones. I've been doing this for a while and the nuances of inclusive/exclusive addition still get me.
Prev 1 392 393 394 395 396 1032 Next
Please log in or register to reply.
Live Events Refresh
PiGosaur Monday
01:00
#60
PiGStarcraft674
SteadfastSC146
CranKy Ducklings99
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft674
RuFF_SC2 169
SteadfastSC 146
StarCraft: Brood War
actioN 314
PianO 268
Noble 52
Icarus 8
Dota 2
monkeys_forever585
League of Legends
JimRising 722
Counter-Strike
Coldzera 1410
Other Games
summit1g13780
WinterStarcraft492
C9.Mang0369
ViBE157
Organizations
Other Games
gamesdonequick1082
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Hupsaiya 78
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Azhi_Dahaki20
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo1140
• Stunt364
Other Games
• Scarra1303
Upcoming Events
Wardi Open
6h 56m
StarCraft2.fi
11h 56m
Replay Cast
18h 56m
The PondCast
1d 4h
OSC
1d 10h
Demi vs Mixu
Nicoract vs TBD
Babymarine vs MindelVK
ForJumy vs TBD
Shameless vs Percival
Replay Cast
1d 18h
Korean StarCraft League
2 days
CranKy Ducklings
3 days
SC Evo League
3 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
4 days
OSC
4 days
BSL 21
4 days
Bonyth vs StRyKeR
Tarson vs Dandy
Replay Cast
5 days
Wardi Open
5 days
StarCraft2.fi
5 days
Replay Cast
5 days
StarCraft2.fi
6 days
PiGosaur Monday
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.