|
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. |
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?
|
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.
|
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?
|
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.
|
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)
|
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.
|
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.
|
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?
|
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.
|
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.
|
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.
|
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.
|
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).
|
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.
|
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
|
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?)!
|
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!
|
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 .
|
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.
|
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.
|
|
|
|
|
|