Hi, I'm kind of confused on this. If I have data on tables, and I'd like to know something which is deducted from that data, but requires several tables and calculations.. should I make that "something" an explicit data (table, attribute, who knows)? For example: I have a table of "goals", "matches" and "teams" of some football tournament. and I want to know the number of win matches of some team, then I would have to calculate them by comparing the number of goals, etc etc. But if Id put a column of "WonGames" in the table of teams, then this wouldnt be needed What is the correct approach? Thanks
Alivemau5
Posts
-
Deducting data vs saving it explicitly -
Database design questionIsn't bad that the table with states would be finite (5 registries) and readonly?
-
Database design questionWell my second suggestion was more like a table with 5 registries than a table with n registries, that is: (1, Not started) (2, First Half) (3, Break) (4, Second half) (5, Ended) And no more columns.. not this: (1, Not started) ... (23, Not started) I think you understood that This second suggestion was thinking on that I could fill any later combo (for example) without hardcoding it.. but the enum solution works and I wouldnt need to hardcode.
-
Database design questionYou have convinced me. And for users privileges do you think its a good idea to have the following?: Users (UserId, UserTypeId, ..) UserTypes (UserTypeId, Name, MayAddMatch, MayDelMatch, May..., May.., May... ) with registries like (1, "Admin", true, true, true...) (i'm not doing an offtopic.. its a similar question)
-
Database design questionWith (1) you would have to hardcode any combobox (for example) containing the different possible entries. With (2) you wouldn't know which one is each.. Diff between 2 and 3 would be that in the program itself you would have to use: someMatch.Status.Finished == true vs someMatch.Status.Description == 'finished' But im not convinced, though, of solution (3)
-
Database design questionI have a table of football matches, and each match can have 5 different statuses: Not started, 1st halftime, Break, 2nd halftime, Ended My question is, what is the correct way of modeling this?: Matches (MatchId, Status, ...) where Status is an integer or a string corresponding to each status vs Matches (MatchId, StatusId, ...) where StatusId is a foreign key to MatchStatuses, MatchStatuses (MatchStatusId, Description) vs Matches (MatchId, StatusId, ...) where StatusId is a foreign key to MatchStatuses, MatchStatuses (MatchStatusId, Description, IsNotStarted, IsFirstHT, IsBreak, IsSecondHT, IsEnded) for example, a registry in this case would be: (1, "First Half time", false, true, false, false, false) THANKS!
-
CSS: table min-widthHi, its very simple: <table style="min-width:1180px"...> works on Firefox and IE8, but not on IE7 What can I do to make it work on Ie7?
-
How to create Dialogs and notifications?Those are CLIENT SIDED events... Did you at least read the post?
-
How to create Dialogs and notifications?Hi, I have a combobox (aka select) with some options retrieved from the database.. The user might choose one item from there or click next to the combo on "Other". Here is the thing: I wan't to show a dialog that lets the user to add a new registry to the database and after that, the dialog should be closed and the combo should have the new option without a simple refresh (an HTTP GET, because this would erase all the form input).. So.. Any tutorials for this? Im sure this is some typical procedure.. In winforms this is really easy because of events.. but in web? More notes: -The dialog should block the parent window (javascript?) -Its like the "add new label" dialog when you are seeing a message in Gmail -The form that haves the combo shouldnt lose the current input (ajax?) -I'm using ASP.NET MVC and LINQ TO SQL. Please help!
-
Bug-1 Algorithm question [modified]Hi, Is it possible to use Bug-1 algorithm without knowing the distance to the target ? In every place (a matrix) I just know the way to this (N, NE, E, SE..), but not the distance.
modified on Tuesday, November 3, 2009 5:00 PM
-
Shortest path relatedI replied you, look my reply :P
-
Shortest path relatedDamn it, It fails when its facing an edge.. like
####._
|\
\ -
Shortest path relatedIt wasnt that hard =P pseudocode: First I orientate myself so that to my left is the obstacle. Then i call M:
M:
if there is wall to the left:
if there is no wall to my diagonal left:
move there
rotate 90º left
M()
else:
if there is wall infront:
rotate 90º to the right
M()
else:
move there.
else:
throw exceptionmodified on Friday, October 30, 2009 1:23 PM
-
Shortest path relatedSo how would it be the algorithm for surrounding an obstacle? Lets say that every node of the matrix have an obstacleId, and that if two obstacles are adjacent.. then they have the same obstacleId (and by induction, a block of obstacles whould have the same obstacleId too) So, I can treat an obstacle block as being the same obstacle. How do I follow it with the right (or left) hand on it all the time? (dont worry about stopping, thats easy) I think its the hardest part on the algorithm. I think I would need to introduce a "robot orientation" helper variable maybe
-
Shortest path relatedMy apolagizes.. Its true, I didnt mention I knew the direction... im so lame. Though Im still right that the bug algorithms dont need the exact location of the goal but just the direction of it. Imagine the problem as implementing a method Direction Move ( adjacents[], Direction direction ) Which is called from the outside, so you dont have to worry about refreshing and stuff. Direction could be an enum So... recalling... Do you know more algorithms like BUG? That apply for the exact same situation?
-
Shortest path related"The Bug algorithm assumes that you also know the exact location of the goal" You are wrong. Its way I've always said: What you know is: the eight adjacent points and the DIRECTION of the goal, that is: N, NE, NW, S, etc. That information is refreshed after each move.
-
Shortest path relatedSorry, I havent had the time to read your replies.. but I swear I'll read it tomorrow. Meanwhile, the ones interested in this problem, I found an algorithm called "bug-1" and "bug-2", search for it.. its just what I needed. I've been trying to found other algorithms but in the papers they just talk about the bug algorithm and after that they jump to other problems such as the one knowing the entire map or knowing more than the eight adjacent points.
-
Shortest path relatedYes but by moving all around you are not doing the shortest or almost-shortest path to the goal Sorry if I explained bad.. the objetive is to found the goal in a short path.. maybe no the shortest, but of course not the largest (by movin all around)
-
Shortest path related"why do you only know adjacent squares...?" Why do you wan't to change my problem? Thats the problem.. don't try to help me solving another problem :P
-
Shortest path relatedAny ideas for a "contour follow" algorithm? Like "contour follow with left hand on wall" and "countour follow with right hand on wall"