Search Results

Search found 2372 results on 95 pages for 'relational theory'.

Page 20/95 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • De-normalization for the sake of reports - Good or Bad?

    - by Travis
    What are the pros/cons of de-normalizing an enterprise application database because it will make writing reports easier? Pro - designing reports in SSRS will probably be "easier" since no joins will be necessary. Con - developing/maintaining the app to handle de-normalized data will become more difficult due to duplication of data and synchronization. Others?

    Read the article

  • Still Confused About Identifying vs. Non-Identifying Relationships

    - by Jason
    So, I've been reading up on identifying vs. non-identifying relationships in my database design, and a number of the answers on SO seem contradicting to me. Here are the two questions I am looking at: What's the Difference Between Identifying and Non-Identifying Relationships Trouble Deciding on Identifying or Non-Identifying Relationship Looking at the top answers from each question, I appear to get two different ideas of what an identifying relationship is. The first question's response says that an identifying relationship "describes a situation in which the existence of a row in the child table depends on a row in the parent table." An example of this that is given is, "An author can write many books (1-to-n relationship), but a book cannot exist without an author." That makes sense to me. However, when I read the response to question two, I get confused as it says, "if a child identifies its parent, it is an identifying relationship." The answer then goes on to give examples such as SSN (is identifying of a Person), but an address is not (because many people can live at an address). To me, this sounds more like a case of the decision between primary key and non-primary key. My own gut feeling (and additional research on other sites) points to the first question and its response being correct. However, I wanted to verify before I continued forward as I don't want to learn something wrong as I am working to understand database design. Thanks in advance.

    Read the article

  • Entity Framework 4 missing features?

    - by Roger Alsing
    I'm well aware that similair topics have been brought up before e.g. http://stackoverflow.com/questions/1639043/entity-framework-4-vs-nhibernate But instead of arguments like: NHibernate have been around longer and is more mature EF4 is drag n drop and not enterprisy EF4 and LinqToSql are ... I would like to see a more detailed list of features that you consider missing from EF4. Personally, I think the lack of enum support is the biggest drawback of EF4.

    Read the article

  • Mutual Information / Entropy Calculation Help

    - by Fillip
    Hi, Hoping someone can give me some pointers with this entropy problem. Say X is chosen randomly from the uniform integer distribution 0-32 (inclusive). I calculate the entropy, H(X) = 32 bits, as each Xi has equal probability of occurring. Now, say the following pseudocode executes. int r = rand(0,1); // a random integer 0 or 1 r = r * 33 + X; How would I work out the mutual information between the two variables r and X? Mutual Information is defined as I(X; Y) = H(X) - H(X|Y) but I don't really understand how to apply the conditional entropy H(X|Y) to this problem. Thanks

    Read the article

  • Algorithm for Determining Variations of Differing Lengths

    - by joseph.ferris
    I have four objects - for the sake of arguments, let say that they are the following letters: A B C D I need to calculate the number of variations that can be made for these under the following two conditions: No repetition Objects are position agnostic Taking the above, this means that with a four object sequence, I can have only one sequence that matches the criteria (since order is not considered for being unique): ABCD There are four variations for a three object combination from the four object pool: ABC, ABD, ACD, and BCD There are six variations for a two object combination from the four object pool: AB, AC, AD, BC, BD, and CD And the most simple one, if taken on at a time: A, B, C, and D I swear that this was something covered in school, many, many years ago - and probably forgotten since I didn't think I would use it. :-) I am anticipating that factorials will come into play, but just trying to force an equation is not working. Any advice would be appreciated.

    Read the article

  • Finding contained bordered regions from Excel imports.

    - by dmaruca
    I am importing massive amounts of data from Excel that have various table layouts. I have good enough table detection routines and merge cell handling, but I am running into a problem when it comes to dealing with borders. Namely performance. The bordered regions in some of these files have meaning. Data Setup: I am importing directly from Office Open XML using VB6 and MSXML. The data is parsed from the XML into a dictionary of cell data. This wonks wonderfully and is just as fast as using docmd.transferspreadsheet in Access, but returns much better results. Each cell contains a pointer to a style element which contains a pointer to a border element that defines the visibility and weight of each border (this is how the data is structured inside OpenXML, also). Challenge: What I'm trying to do is find every region that is enclosed inside borders, and create a list of cells that are inside that region. What I have done: I initially created a BFS(breadth first search) fill routine to find these areas. This works wonderfully and fast for "normal" sized spreadsheets, but gets way too slow for imports into the thousands of rows. One problem is that a border in Excel could be stored in the cell you are checking or the opposing border in the adjacent cell. That's ok, I can consolidate that data on import to reduce the number of checks needed. One thing I thought about doing is to create a separate graph that outlines the cells using the borders as my edges and using a graph algorithm to find regions that way, but I'm having trouble figuring out how to implement the algorithm. I've used Dijkstra in the past and thought I could do similar with this. So I can span out using no endpoint to search the entire graph, and if I encounter a closed node I know that I just found an enclosed region, but how can I know if the route I've found is the optimal one? I guess I could flag that to run a separate check for the found closed node to the previous node ignoring that one edge. This could work, but wouldn't be much better performance wise on dense graphs. Can anyone else suggest a better method? Thanks for taking the time to read this.

    Read the article

  • Mysql random rows

    - by n00b
    please read the whole question... 90% of you dont seem to do that and some of you only read the title obviously... and if you dont know the solution, dont answer - i wont have to downvote you -.-'' im entertaining the idea of getting random rows directly from mysql. what i found was SELECT * FROM tablename WHERE somefield='something' ORDER BY RAND() LIMIT 5 but even i see how slow that would be.. is the only way to do this doing something like SELECT * FROM tablename WHERE somefield='something' LIMIT RAND(aincrementvalue-5), 1 5 times? or is there a way that i with my little knowlege of databases cant come up with ? (no i dont want random indexes. i hate the idea of them...) @commenters - please first look, then think, then look again, think again and then post. i wont point fingers but i dislike stupid comments and why i think random indexes are a nasty hack ? it doesnt give you random results. it gives you x results from a random index in a predefined order its like a gapless id only in the wrong order if you fetch by 1 row and get true randomness you fall back to my method but with an additional junk field finally the reason the field exists is only to serve as a helper to something that can be done without it with almost same performance (but the quality (randomness) is better), so it is a nasty hack ;) i solved it, look @ my answer... if you think its incorrect please tell me :)

    Read the article

  • Help needed with Linq To Sql Query

    - by fearofawhackplanet
    I have the concept of valid/ordered transitions. So for example, it's not possible to move to status In progress from status Complete. Current and Next in table StatusTransition are FK (StatusType.Id). The Linq generator has created the following relations: Child Property Name: StatusTransitions1 Parent Property Name: StatusType1 Participating Properties: StatusType.Id -> StatusTransition.Next Child Property Name: StatusTransitions Parent Property Name: StatusType Participating Properties: StatusType.Id -> StatusTransition.Current I'm normally ok with Linq but I'm having difficulty getting the list of valid Next StatusTypes from the Current status. public List<StatusType> GetValidStatusTransitions(int statusId) { // trying to write something like the following // (obviously not correct) return _statusRepository .Where(s => s.Id == statusId) .Next.StatusTypes; }

    Read the article

  • What is the difference between causal models and directed graphical models?

    - by Neil G
    What is the difference between causal models and directed graphical models? or: What is the difference between causal relationships and directed probabilistic relationships? or, even better: What would you put in the interface of a DirectedProbabilisticModel class, and what in a CausalModel class? Would one inherit from the other? Collaborative solution: interface DirectedModel { map<Node, double> InferredProbabilities(map<Node, double> observed_probabilities, set<Node> nodes_of_interest) } interface CausalModel: DirectedModel { bool NodesDependent(set<Node> nodes, map<Node, double> context) map<Node, double> InferredProbabilities(map<Node, double> observed_probabilities, map<Node, double> externally_forced_probabilities, set<Node> nodes_of_interest) }

    Read the article

  • Selecting by ID in Castle ActiveRecord

    - by ripper234
    How can I write a criteria to return all Orders that belong to a specific User? public class User { [PrimaryKey] public virtual int Id { get; set; } } public class Order { [PrimaryKey] public virtual int Id { get; set; } [BelongsTo("UserId")] public virtual User User { get; set; } } return ActiveRecordMediator<Order>.FindAll( // What criteria should I write here ? );

    Read the article

  • Java JPA @OneToMany neededs to reciprocate @ManyToOne?

    - by bguiz
    Create Table A ( ID varchar(8), Primary Key(ID) ); Create Table B ( ID varchar(8), A_ID varchar(8), Primary Key(ID), Foreign Key(A_ID) References A(ID) ); Given that I have created two tables using the SQL statements above, and I want to create Entity classes for them, for the class B, I have these member attributes: @Id @Column(name = "ID", nullable = false, length = 8) private String id; @JoinColumn(name = "A_ID", referencedColumnName = "ID", nullable = false) @ManyToOne(optional = false) private A AId; In class A, do I need to reciprocate the many-to-one relationship? @Id @Column(name = "ID", nullable = false, length = 8) private String id; @OneToMany(cascade = CascadeType.ALL, mappedBy = "AId") private List<B> BList; //<-- Is this attribute necessary? Is it a necessary or a good idea to have a reciprocal @OneToMany for the @ManyToOne? If I make the design decision to leave out the @OneToMany annotated attribute now, will come back to bite me further down.

    Read the article

  • Circular database relationships. Good, Bad, Exceptions?

    - by jim
    I have been putting off developing this part of my app for sometime purely because I want to do this in a circular way but get the feeling its a bad idea from what I remember my lecturers telling me back in school. I have a design for an order system, ignoring the everything that doesn't pertain to this example I'm left with: CreditCard Customer Order I want it so that, Customers can have credit cards (0-n) Customers have orders (1-n) Orders have one customer(1-1) Orders have one credit card(1-1) Credit cards can have one customer(1-1) (unique ids so we can ignore uniqueness of cc number, husband/wife may share cc instances ect) Basically the last part is where the issue shows up, sometimes credit cards are declined and they wish to use a different one, this needs to update which their 'current' card is but this can only change the current card used for that order, not the other orders the customer may have on disk. Effectively this creates a circular design between the three tables. Possible solutions: Either Create the circular design, give references: cc ref to order, customer ref to cc customer ref to order or customer ref to cc customer ref to order create new table that references all three table ids and put unique on the order so that only one cc may be current to that order at any time Essentially both model the same design but translate differently, I am liking the latter option best at this point in time because it seems less circular and more central. (If that even makes sense) My questions are, What if any are the pros and cons of each? What is the pitfalls of circular relationships/dependancies? Is this a valid exception to the rule? Is there any reason I should pick the former over the latter? Thanks and let me know if there is anything you need clarified/explained. --Update/Edit-- I have noticed an error in the requirements I stated. Basically dropped the ball when trying to simplify things for SO. There is another table there for Payments which adds another layer. The catch, Orders can have multiple payments, with the possibility of using different credit cards. (if you really want to know even other forms of payment). Stating this here because I think the underlying issue is still the same and this only really adds another layer of complexity.

    Read the article

  • P=NP?-Problem: What are the most promising methods?

    - by phimuemue
    Hello everybody, I know that P=NP has not been solved up to now, but can anybody tell me something about the following: What are currently the most promising mathematical / computer scientific methods that could be helpful to tackle this problem? Or are there even none such methods known to be potentially helpful up to now? Is there any (free) compendium on this topic where I can find all / most of the research done in this area?

    Read the article

  • Error(2,7): PLS-00428: an INTO clause is expected in this SELECT statement

    - by omgzor
    I'm trying to create this trigger and getting the following compiler errors: create or replace TRIGGER RESTAR_PLAZAS AFTER INSERT ON PLAN_VUELO BEGIN SELECT F.NRO_VUELO, M.CAPACIDAD, M.CAPACIDAD - COALESCE(( SELECT count(*) FROM PLAN_VUELO P WHERE P.NRO_VUELO = F.NRO_VUELO ), 0) as PLAZAS_DISPONIBLES FROM VUELO F INNER JOIN MODELO M ON M.ID = F.CODIGO_AVION; END RESTAR_PLAZAS; Error(2,7): PL/SQL: SQL Statement ignored Error(8,5): PL/SQL: ORA-00933: SQL command not properly ended Error(8,27): PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe Error(2,1): PLS-00428: an INTO clause is expected in this SELECT statement What's wrong with this trigger?

    Read the article

  • the problem only happens when i try create a release...

    - by ace
    I'm sorry if im not presenting this right, but i trully cannot understand what the problem is. i have a project to hand in, a code of 600 lines defined within a main, .cpp, and header file. if i compile the project with just a debugger and no release, it's fine. when i create it with the release, the following error occurs, for every function!!! 1st error: |36|multiple definition of `countLines(int&, std::vector const&)'| 2nd error: |36|first defined here| if someone will allow me and i can send them the entire code, that would be awesome - i have to have this done within 3 hours.

    Read the article

  • Parent-Child relation while using object data source

    - by Saba
    Hello guys I am experiencing with a class generator I've written, which generates a class for each table in database with each table field as a property and such. Before that, I used to add a typed dataset to the project and add some tables to it. It automatically detected the relationship between tables and when I added a parent table as data source of a datagrid, I could add another datagrid and use the foreing key data member of it's bindingsource to fill it, and when someone moved the focus on parent datagrid, the data in child datagrid would change accordingly. Now that I have my classes, I add an object as data source for my 2 datagrids, but obviously it doesn't detect a parent child relation. But It'd really help if I could have that foreign key relation in my object datasources. Is there any way to have that relation in object datasource?

    Read the article

  • Database Design for One to One relationships

    - by Greelmo
    I'm trying to finalize my design of the data model for my project, and am having difficulty figuring out which way to go with it. I have a table of users, and an undetermined number of attributes that apply to that user. The attributes are in almost every case optional, so null values are allowed. Each of these attributes are one to one for the user. Should I put them on the same table, and keep adding columns when attributes are added (making the user table quite wide), or should I put each attribute on a separate table with a foreign key to the user table. I have decided against using the EAV model. Thanks!

    Read the article

  • Make Java parent class not part of the interface

    - by Bart van Heukelom
    (This is a hypothetical question for discussion, I have no actual problem). Say that I'm making an implementation of SortedSet by extending LinkedHashMap: class LinkedHashSortedMapThing extends LinkedHashMap implements SortedSet { ... } Now programmers who use this class may do LinkedHashMap x = new LinkedHashSortedMapThing(); But what if I consider the extending of LinkedHashMap an implementation detail, and do not want it to be a part of the class' contract? If people use the line above, I can no longer freely change this detail without worrying about breaking existing code. Is there any way to prevent this sort of thing, other than favouring composition over inheritance (which is not always possible due to private/protected members)?

    Read the article

  • To Interface or Not?: Creating a polymorphic model relationship in Ruby on Rails dynamically..

    - by Globalkeith
    Please bear with me for a moment as I try to explain exactly what I would like to achieve. In my Ruby on Rails application I have a model called Page. It represents a web page. I would like to enable the user to arbitrarily attach components to the page. Some examples of "components" would be Picture, PictureCollection, Video, VideoCollection, Background, Audio, Form, Comments. Currently I have a direct relationship between Page and Picture like this: class Page < ActiveRecord::Base has_many :pictures, :as => :imageable, :dependent => :destroy end class Picture < ActiveRecord::Base belongs_to :imageable, :polymorphic => true end This relationship enables the user to associate an arbitrary number of Pictures to the page. Now if I want to provide multiple collections i would need an additional model: class PictureCollection < ActiveRecord::Base belongs_to :collectionable, :polymorphic => true has_many :pictures, :as => :imageable, :dependent => :destroy end And alter Page to reference the new model: class Page < ActiveRecord::Base has_many :picture_collections, :as => :collectionable, :dependent => :destroy end Now it would be possible for the user to add any number of image collections to the page. However this is still very static in term of the :picture_collections reference in the Page model. If I add another "component", for example :video_collections, I would need to declare another reference in page for that component type. So my question is this: Do I need to add a new reference for each component type, or is there some other way? In Actionscript/Java I would declare an interface Component and make all components implement that interface, then I could just have a single attribute :components which contains all of the dynamically associated model objects. This is Rails, and I'm sure there is a great way to achieve this, but its a tricky one to Google. Perhaps you good people have some wise suggestions. Thanks in advance for taking the time to read and answer this.

    Read the article

  • Big-O for Eight Year Olds?

    - by Jason Baker
    I'm asking more about what this means to my code. I understand the concepts mathematically, I just have a hard time wrapping my head around what they mean conceptually. For example, if one were to perform an O(1) operation on a data structure, I understand that the amount of operations it has to perform won't grow because there are more items. And an O(n) operation would mean that you would perform a set of operations on each element. Could somebody fill in the blanks here? Like what exactly would an O(n^2) operation do? And what the heck does it mean if an operation is O(n log(n))? And does somebody have to smoke crack to write an O(x!)?

    Read the article

  • How to find whole graph coverage path in dynamic state-flow diagram?

    - by joseph
    Hello, As I've been researching algorithms for path finding in graph, I found interesting problem. Definition of situation: 1)State diagram can have p states, and s Boolean Fields, and z Int Fields 2)Every state can have q ingoing and r outgoing transitions, and h Int fields (h belongs to z - see above) 3)Every transition can have only 1 event, and only 1 action 4)every action can change n Boolean Fields, and x Int Fields 5)every event can have one trigger from combination of any count of Boolean Fields in diagram 6)Transition can be in OPEN/CLOSED form. If the transition is open/closed depends on trigger2 compounded from 0..c Boolean fields. 7) I KNOW algorithm for finding shortest paths from state A to state B. 8) I KNOW algorithm for finding path that covers all states and transitions of whole state diagram, if all transitions are OPEN. Now, what is the goal: I need to find shortest path that covers all states and transitions in dynamically changing state diagram described above. When an action changes some int field, the algorithm should go through all states that have changed int field. The algorithm should also be able to open and close transition (by going through transitions that open and close another transitions by action) in the way that the founded path will be shortest and covers all transitions and states. Any idea how to solve it? I will be really pleased for ANY idea. Thanks for answers.

    Read the article

  • Resource placement (optimal strategy)

    - by blackened
    I know that this is not exactly the right place to ask this question, but maybe a wise guy comes across and has the solution. I'm trying to write a computer game and I need an algorithm to solve this question: The game is played between 2 players. Each side has 1.000 dollars. There are three "boxes" and each player writes down the amount of money he is going to place into those boxes. Then these amounts are compared. Whoever placed more money in a box scores 1 point (if draw half point each). Whoever scores more points wins his opponents 1.000 dollars. Example game: Player A: [500, 500, 0] Player B: [333, 333, 334] Player A wins because he won Box A and Box B (but lost Box C). Question: What is the optimal strategy to place the money? I have more questions to ask (algorithm related, not math related) but I need to know the answer to this one first. Update (1): After some more research I've learned that these type of problems/games are called Colonel Blotto Games. I did my best and found few (highly technical) documents on the subject. Cutting it short, the problem I have (as described above) is called simple Blotto Game (only three battlefields with symmetric resources). The difficult ones are the ones with, say, 10+ battle fields with non-symmetric resources. All the documents I've read say that the simple Blotto game is easy to solve. The thing is, none of them actually say what that "easy" solution is.

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >