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

Website Feedback

Closed Threads



Active: 3486 users

The Big Programming Thread - Page 395

Forum Index > General Forum
Post a Reply
Prev 1 393 394 395 396 397 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.
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
November 18 2013 02:16 GMT
#7881
On November 18 2013 10:44 FunkyLich 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.


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.

As they say, there are only 2 hard things in Computer Science, caching, naming things, and off-by-1 errors.
dae
Profile Joined June 2010
Canada1600 Posts
November 18 2013 03:04 GMT
#7882
On November 18 2013 11:16 CatNzHat wrote:
Show nested quote +
On November 18 2013 10:44 FunkyLich wrote:
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.

As they say, there are only 2 hard things in Computer Science, caching, naming things, and off-by-1 errors.


God, finding a nice naming convention is so hard >.<.

I tend to just vary alot depending how I feel on that day, which for schoolwork is fine but whenever I work on larger projects it tends to get all over the place.
scudst0rm
Profile Joined May 2010
Canada1149 Posts
November 18 2013 04:52 GMT
#7883
On November 18 2013 11:16 CatNzHat wrote:
Show nested quote +
On November 18 2013 10:44 FunkyLich wrote:
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.

As they say, there are only 2 hard things in Computer Science, caching, naming things, and off-by-1 errors.


lol. They also claim that there are 10 types of people.
You're like a one ranger army comin' at me...
WolfintheSheep
Profile Joined June 2011
Canada14127 Posts
November 18 2013 05:33 GMT
#7884
On November 18 2013 13:52 scudst0rm wrote:
Show nested quote +
On November 18 2013 11:16 CatNzHat wrote:
On November 18 2013 10:44 FunkyLich wrote:
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.

As they say, there are only 2 hard things in Computer Science, caching, naming things, and off-by-1 errors.


lol. They also claim that there are 10 types of people.


We're up to 10 now? Last I heard it was 0F.
Average means I'm better than half of you.
sluggaslamoo
Profile Blog Joined November 2009
Australia4494 Posts
Last Edited: 2013-11-18 07:02:06
November 18 2013 07:00 GMT
#7885
On November 17 2013 14:25 CatNzHat 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)


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!


Pull request are a little difficult without Github though. but I completely 100% agree with this, the main issue will be getting people motivated to do pull requests. Its easy to do in a team that loves to do them, but if the manager doesn't wanna do it none of his employees will bother either.

Also if you are using the right "branch layout" you should never run into this problem.

Basically you should have a branch for each version (0.1, 0.2, etc) that you treat like your master branch, NEVER PUSH TO MASTER!!! If you want to know more have a look at "Continous Delivery" by Humble and Farley.
Come play Android Netrunner - http://www.teamliquid.net/forum/viewmessage.php?topic_id=409008
sluggaslamoo
Profile Blog Joined November 2009
Australia4494 Posts
Last Edited: 2013-11-18 07:13:09
November 18 2013 07:10 GMT
#7886
On November 18 2013 12:04 dae wrote:
Show nested quote +
On November 18 2013 11:16 CatNzHat wrote:
On November 18 2013 10:44 FunkyLich wrote:
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.

As they say, there are only 2 hard things in Computer Science, caching, naming things, and off-by-1 errors.


God, finding a nice naming convention is so hard >.<.

I tend to just vary alot depending how I feel on that day, which for schoolwork is fine but whenever I work on larger projects it tends to get all over the place.


I used to have a very hard time naming things until I stopped using the internet for information and started reading books. I read through 10+ OOP books in about 6 months and afterwards I never had a problem designing classes let alone naming them. These days I think up multiple classes and names and figure out how to interact them within seconds before I even start. :D

The internet is great for examples, but not a lot of people want to learn the fundamentals which leaves those websites at the bottom ranking, or there just aren't a lot of them because most people are simply not interested.

Usually everything falls into a certain subtype which makes naming very easy. You will never find this information on the internet though, you have to dig through books.

Rather than tell you how to do any of this, because it seems that whenever I give advice someone finds a reason to flame me, so Ill just list some books that really helped me and I'm sure will help you.

The gang of four design patterns book will help you understand what subtype your classifications (classes) fall into.

http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612

Object Design by Wirfs Brock and Mckeen will help you understand roles and responsibilities which help you to name more obtuse class designs and interactions.

http://www.amazon.com/Object-Design-Roles-Responsibilities-Collaborations/dp/0201379430

Clean Code by Robert C Martin will help you to understand functional decomposition. Making your functions atomic so that your classes remain readable from the inside out.

http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882
Come play Android Netrunner - http://www.teamliquid.net/forum/viewmessage.php?topic_id=409008
Manit0u
Profile Blog Joined August 2004
Poland17838 Posts
November 18 2013 09:28 GMT
#7887
Question: Are there any good IDEs for C# outside of Visual Studio? (don't want to spend a ton of money before I'm certain I can and want to fully commit to it).
Time is precious. Waste it wisely.
Arnstein
Profile Blog Joined May 2010
Norway3381 Posts
November 18 2013 10:06 GMT
#7888
Any reason why you wouldn't use Vim or Emacs?
rsol in response to the dragoon voice being heard in SCII: dragoon ai reaches new lows: wanders into wrong game
ObviousOne
Profile Joined April 2012
United States3704 Posts
November 18 2013 10:21 GMT
#7889
On November 18 2013 18:28 Manit0u wrote:
Question: Are there any good IDEs for C# outside of Visual Studio? (don't want to spend a ton of money before I'm certain I can and want to fully commit to it).

You can use VS Express if you have a hotmail/live/msn account to "try" it. Fairly limited, though and I've learned nothing about building projects since it does all of that for you (after you google a tutorial to figure that out). Start the hard way, with a basic editor and compiler and go from there, IMO. Really the only part of VS that I like is the intellisense/autocomplete.

Notepad++ for instance since it does highlighting, and whatever compiler for your OS.
Fear is the only darkness. ~Destiny Fan Club operator~
Manit0u
Profile Blog Joined August 2004
Poland17838 Posts
November 18 2013 10:56 GMT
#7890
Oh, OK then. I thought that you'd be at some serious disadvantage when not using VS

This is even better.
Time is precious. Waste it wisely.
WindWolf
Profile Blog Joined July 2012
Sweden11767 Posts
November 18 2013 11:16 GMT
#7891
While we are talking about VS.

Has anyone here had a chance to touch VS 2013 yet? How much different is it compared to VS2012? I'm primary wondering about the C++ side of things. (I'm gonna stick with 2012 for a while, since that is what my teacher will use in the upcoming courses at university, but I'm still curious)
EZ4ENCE
bangsholt
Profile Joined June 2011
Denmark138 Posts
November 18 2013 13:13 GMT
#7892
On November 18 2013 18:28 Manit0u wrote:
Question: Are there any good IDEs for C# outside of Visual Studio? (don't want to spend a ton of money before I'm certain I can and want to fully commit to it).


http://monodevelop.com/
sluggaslamoo
Profile Blog Joined November 2009
Australia4494 Posts
November 18 2013 13:41 GMT
#7893
On November 18 2013 19:21 ObviousOne wrote:
Show nested quote +
On November 18 2013 18:28 Manit0u wrote:
Question: Are there any good IDEs for C# outside of Visual Studio? (don't want to spend a ton of money before I'm certain I can and want to fully commit to it).

You can use VS Express if you have a hotmail/live/msn account to "try" it. Fairly limited, though and I've learned nothing about building projects since it does all of that for you (after you google a tutorial to figure that out). Start the hard way, with a basic editor and compiler and go from there, IMO. Really the only part of VS that I like is the intellisense/autocomplete.

Notepad++ for instance since it does highlighting, and whatever compiler for your OS.


In my experience I could pretty much do everything I needed to do in VS Express, theres an Indie online RPG engine written in VS Express.

http://www.netgore.com/

Unless you're doing an enterprise app or something, I don't think it would be a problem.
Come play Android Netrunner - http://www.teamliquid.net/forum/viewmessage.php?topic_id=409008
patermatrix
Profile Joined March 2012
64 Posts
Last Edited: 2013-11-18 13:54:27
November 18 2013 13:53 GMT
#7894
On November 18 2013 19:56 Manit0u wrote:
Oh, OK then. I thought that you'd be at some serious disadvantage when not using VS

You are.

Vim, emacs, Notepad++, they're all decent to excellent code editors when you work within a single file. As soon as you start working on projects, you won't want to miss features like autocomplete and refactoring which only a real IDE can provide. And not to mention that VS probably has the best debugging features out of all IDEs.

VS Express should be enough for most things though, so don't bother paying unless you really need something only the full versions can offer.
Rollin
Profile Joined March 2011
Australia1552 Posts
Last Edited: 2013-11-18 14:08:33
November 18 2013 14:07 GMT
#7895
On November 18 2013 22:41 sluggaslamoo wrote:
Show nested quote +
On November 18 2013 19:21 ObviousOne wrote:
On November 18 2013 18:28 Manit0u wrote:
Question: Are there any good IDEs for C# outside of Visual Studio? (don't want to spend a ton of money before I'm certain I can and want to fully commit to it).

You can use VS Express if you have a hotmail/live/msn account to "try" it. Fairly limited, though and I've learned nothing about building projects since it does all of that for you (after you google a tutorial to figure that out). Start the hard way, with a basic editor and compiler and go from there, IMO. Really the only part of VS that I like is the intellisense/autocomplete.

Notepad++ for instance since it does highlighting, and whatever compiler for your OS.


In my experience I could pretty much do everything I needed to do in VS Express, theres an Indie online RPG engine written in VS Express.

http://www.netgore.com/

Unless you're doing an enterprise app or something, I don't think it would be a problem.

Imho the biggest disadvantage of express is the lack of support for user extensions, like visual assist x, but I don't even use them lol. There are probably other things too.

On November 18 2013 20:16 WindWolf wrote:
While we are talking about VS.

Has anyone here had a chance to touch VS 2013 yet? How much different is it compared to VS2012? I'm primary wondering about the C++ side of things. (I'm gonna stick with 2012 for a while, since that is what my teacher will use in the upcoming courses at university, but I'm still curious)

Well I only got it today , but so far:
- Better, but still not complete, c++11 support
- Better syntax highlighting, though still not great
- I like the layout more than 2012, which was shit imo

I am a noob though and I've barely played with it . But for free, I'd say it was worth the upgrade.
Throw off those chains of reason, and your prison disappears. | Check your posting frequency timeline: http://www.teamliquid.net/mytlnet/post_activity_img.php
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
November 18 2013 14:29 GMT
#7896
Amount £0.00

Microsoft Visual Studio Professional 2013 32-bit (English) - DreamSpark - Download
Extended Access Guarantee (24 months) Extended Access Guarantee (24 months) - Included
24 months of access to your download and/or key. This does not extend the duration of time-limited licenses (if applicable).
Expires 2015-11-18
Messages:

DreamSpark EULA


Gotta love to be a student from a Computer Science department. I'm downloading it even though I use Java for my project, so Eclipse is what matters for me now.
Manit0u
Profile Blog Joined August 2004
Poland17838 Posts
Last Edited: 2013-11-18 15:24:24
November 18 2013 14:32 GMT
#7897
For Java I would use NetBeans. Worked much better for me than Eclipse ever did.

Edit: Also,

On November 13 2013 06:57 EscPlan9 wrote:
Really should just initialize the loop variable inside the loops. Cleans up the code a bunch:


#include <stdio.h>

int main()
{
int array[10][10];
int count;

for ( int i = 0; i<10; ++i )
{
for (int j = 0; j<10; ++j )
{
array[i][j] = count;
count++;
}
}

for (int i = 0; i<10; ++i )
{
for (int j = 0; j<10; ++j )
{
printf( "%d", array[i][j] );
printf( " " );
}
printf("\n");

}
}




I don't think you should be using "++i" statements for incrementation in a for loop. I'm of the opinion that they did a great job in Python with eliminating the ++ and -- operators (both pre- and post-) and leaving just += and -=. So much more consistent.
Time is precious. Waste it wisely.
WindWolf
Profile Blog Joined July 2012
Sweden11767 Posts
November 18 2013 14:32 GMT
#7898
On November 18 2013 23:07 Rollin wrote:
Show nested quote +
On November 18 2013 20:16 WindWolf wrote:
While we are talking about VS.

Has anyone here had a chance to touch VS 2013 yet? How much different is it compared to VS2012? I'm primary wondering about the C++ side of things. (I'm gonna stick with 2012 for a while, since that is what my teacher will use in the upcoming courses at university, but I'm still curious)

Well I only got it today , but so far:
- Better, but still not complete, c++11 support
- Better syntax highlighting, though still not great
- I like the layout more than 2012, which was shit imo

I am a noob though and I've barely played with it . But for free, I'd say it was worth the upgrade.

I still waiting a bit with upgrading since I'm using Boost quite a bit and the latest release had some problems with VS 2013.
EZ4ENCE
mcc
Profile Joined October 2010
Czech Republic4646 Posts
November 18 2013 16:14 GMT
#7899
On November 17 2013 05:24 Morfildur wrote:
Show nested quote +
On November 16 2013 17:29 obesechicken13 wrote:
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.

Show nested quote +
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.

Though even in the message board example, I would probably add is_active (or similar) column on the user table, instead of actually removing the record physically, just to be able to keep all the data consistently referenced. I see very few reasons to ever remove rows from core tables.
mcc
Profile Joined October 2010
Czech Republic4646 Posts
November 18 2013 16:21 GMT
#7900
On November 18 2013 18:28 Manit0u wrote:
Question: Are there any good IDEs for C# outside of Visual Studio? (don't want to spend a ton of money before I'm certain I can and want to fully commit to it).

You want , there might be good IDEs, but none as good as VS. There are also free versions that are somewhat functional I think, but I am not sure about that.
Prev 1 393 394 395 396 397 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 44m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 468
SpeCial 111
Nathanias 40
CosmosSc2 8
StarCraft: Brood War
Shuttle 692
Dewaltoss 120
Sexy 39
Dota 2
monkeys_forever152
febbydoto10
League of Legends
Doublelift2085
Counter-Strike
minikerr41
Super Smash Bros
Mew2King79
Other Games
Liquid`RaSZi2440
Pyrionflax176
ArmadaUGS149
hungrybox130
C9.Mang0116
RotterdaM86
NeuroSwarm43
Trikslyr39
UpATreeSC31
ViBE20
JuggernautJason12
Organizations
Other Games
BasetradeTV40
[ Show 18 non-featured ]
StarCraft 2
• RyuSc2 13
• musti20045 12
• Kozan
• IndyKCrew
• AfreecaTV YouTube
• Migwel
• intothetv
StarCraft: Brood War
• Michael_bg 6
• Pr0nogo 2
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21413
• WagamamaTV583
League of Legends
• TFBlade777
Other Games
• imaqtpie1199
• Scarra645
• Shiphtur211
Upcoming Events
OSC
44m
IntoTheTV X SOOP
13h 14m
CranKy Ducklings
1d 12h
Big Brain Bouts
1d 12h
Garitos vs ArT
Lambo vs Percival
TriGGeR vs ByuN
Sparkling Tuna Cup
2 days
OSC
2 days
Shopify Rebellion Sundays
2 days
Mixu vs TBD
Spirit vs TBD
Clem vs TBD
Patches Events
2 days
Afreeca Starleague
3 days
Soma vs Shuttle
BeSt vs Rush
WardiTV Weekly
3 days
[ Show More ]
Afreeca Starleague
4 days
Leta vs ggaemo
Jaedong vs Queen
GSL
4 days
PiGosaur Cup
5 days
Kung Fu Cup
5 days
Replay Cast
6 days
The PondCast
6 days
Liquipedia Results

Completed

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

Ongoing

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

Upcoming

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

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Disclosure: This page contains affiliate marketing links that support TLnet.

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.