Search Results

Search found 245 results on 10 pages for 'commission junction'.

Page 2/10 | < Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • get data using junction table with linq-sql confused :$

    - by raklos
    Im using linq-sql .I have 3 tables. e.g Project, People and a ProjectsPeople(fk's ProjectID and PeopleID) (junction) Table. given a set of peopleIDArray (an array of ints as people ID's) how can i get only Projects that have atleast one of the peopleId's associated with them? i.e there will be atleast one (may be more) record in the ProjectsPeople table that will have a ProjectId and an id from the peopleIDArray ) thanks

    Read the article

  • Many to many self join through junction table

    - by Peter
    I have an EF model that can self-reference through an intermediary class to define a parent/child relationship. I know how to do a pure many-to-many relationship using the Map command, but for some reason going through this intermediary class is causing problems with my mappings. The intermediary class provides additional properties for the relationship. See the classes, modelBinder logic and error below: public class Equipment { [Key] public int EquipmentId { get; set; } public virtual List<ChildRecord> Parents { get; set; } public virtual List<ChildRecord> Children { get; set; } } public class ChildRecord { [Key] public int ChildId { get; set; } [Required] public int Quantity { get; set; } [Required] public Equipment Parent { get; set; } [Required] public Equipment Child { get; set; } } I've tried building the mappings in both directions, though I only keep one set in at a time: modelBuilder.Entity<ChildRecord>() .HasRequired(x => x.Parent) .WithMany(x => x.Children ) .WillCascadeOnDelete(false); modelBuilder.Entity<ChildRecord>() .HasRequired(x => x.Child) .WithMany(x => x.Parents) .WillCascadeOnDelete(false); OR modelBuilder.Entity<Equipment>() .HasMany(x => x.Parents) .WithRequired(x => x.Child) .WillCascadeOnDelete(false); modelBuilder.Entity<Equipment>() .HasMany(x => x.Children) .WithRequired(x => x.Parent) .WillCascadeOnDelete(false); Regardless of which set I use, I get the error: The foreign key component 'Child' is not a declared property on type 'ChildRecord'. Verify that it has not been explicitly excluded from the model and that it is a valid primitive property. when I try do deploy my ef model to the database. If I build it without the modelBinder logic in place then I get two ID columns for Child and two ID columns for Parent in my ChildRecord table. This makes sense since it tries to auto create the navigation properties from Equipment and doesn't know that there are already properties in ChildRecord to fulfill this need. I tried using Data Annotations on the class, and no modelBuilder code, this failed with the same error as above: [Required] [ForeignKey("EquipmentId")] public Equipment Parent { get; set; } [Required] [ForeignKey("EquipmentId")] public Equipment Child { get; set; } AND [InverseProperty("Child")] public virtual List<ChildRecord> Parents { get; set; } [InverseProperty("Parent")] public virtual List<ChildRecord> Children { get; set; } I've looked at various other answers around the internet/SO, and the common difference seems to be that I am self joining where as all the answers I can find are for two different types. Entity Framework Code First Many to Many Setup For Existing Tables Many to many relationship with junction table in Entity Framework? Creating many to many junction table in Entity Framework

    Read the article

  • iPhone App link to iStore for commission

    - by Simon
    Is it possible to link from an iPhone application to the iStore so a user can (a) play a sample of music and then navigate to that track in order to buy it? In a bit more detail: the application lists a number of tracks for a particular artist (a recommendation by the app based on user criteria). The user scrolls down the list and finds a track that they are interested in. They play the 30 second sample (as you would in the iStore) and then, if they like it, they press on a link that takes them to the iStore where they can purchase the track. If they buy the track, then the application gets 5% of the money paid for the track. I have looked through the web and found a number of suggestions but nothing seems to fit the specification above. I would be very grateful if anyone is able to tell me whether this is possible and some clues as to how it would be done. Thanks, Simon...

    Read the article

  • La Commission européenne examine le rachat de McAfee par Intel et craint une position de monopole pour la sécurité des processeurs

    La Commission européenne examine le rachat de McAfee par Intel, et craint une position de monopole pour la sécurité des processeurs Mise à jour du 20.12.2010 par Katleen L'acquisition de McAfee par Intel pourrait être compromise. La Commission européenne examine actuellement le dossier et émet quelques réserves. Car si Intel occupe pour l'instant une place importante sur la scène des processeurs, et que ce rachat ne lui octroierait donc aucunement une position de monopole dans le domaine de la sécurité, Bruxelles veut voir plus loin. Les instances européennes pensent à l'avenir, et craignent que le visage du marché de la sécurité informatique ne soit modifié. Certains spécialistes pens...

    Read the article

  • La "taxe Google" reportée pour un délai d'au moins six mois, malgré son adoption lundi par la commission mixte paritaire

    La "taxe Google" reportée pour un délai d'au moins six mois, malgré son adoption lundi par la commission mixte paritaire Mise à jour du 15.12.2010 par Katleen Lundi soir, la "taxe Google" a été adoptée par la Commission Mixte Paritaire (composée de 7 sénateurs et 7 députés), qui l'a un peu remodelée en favorisant le texte du Sénat plutôt que celui de l'Assemblée. Ceci a crée un fort mouvement de contestation auprès des professionnels français de la publicité en ligne, qui seront les premiers touchés et directement ponctionnés par cet impôt spécifique. « Une telle taxe ferait mécaniquement baisser les recettes des acteurs français installés en France et retarderait ...

    Read the article

  • User account shows two Downloads folders

    - by Chris Lieb
    I have my user account on my D drive and junction'd to the C:\users folder. I accidentally moved my profile Downloads folder (C:\users\me\Downloads) and then moved it back to its path on the D drive (C:\me\Downloads). After doing this, the directory tree for my user profile lists two Downloads directories, one located at C:\users\me and one at D:\me. I tried deleting the directory from the D drive, then restoring it from the Recycle Bin to the proper location on the C drive (actually the D drive, accessed through the junction), but it gave me the two Downloads directories again. Is there some way to fix this so that the only listing is for the C:\users\me\Downloads directory, like it was to begin with?

    Read the article

  • Le rachat de McAfee par Intel validé par la Commission européenne, sous réserve d'une garantie "d'interopérabilité des produits"

    Le rachat de McAfee par Intel validé par la Commission européenne, sous réserve d'une garantie de l'interopérabilité "des produits issus de cette concentration" Mise à jour du 28.01.2011 par Katleen Ca y est, la Commission européenne a finalement statué sur l'acquisition de McAfee par Intel, et a décide de l'autoriser, tout en y mettant des conditions. En effet, cette validation est « accordée sous réserve d'un ensemble d'engagements garantissant une concurrence équitable entre les parties et leurs concurrents dans le domaine de la sécurité informatique ». Intel a donc du s'engager a garantir que ses processeurs équipés des technologies de protection de McAfee seront compatib...

    Read the article

  • Customer Experience Management : A conversation with world experts RTD

    - by David lefranc
    A conversation with world experts in Customer Experience Management in Rome, Italy - Wed, June 20, 2012 It is our pleasure to share the registration link below for your chance to meet active members of the Oracle Real-Time Decisions Customer Advisory Board. Join us to hear how leading brands across the world have achieved tremendous return on investment through their Oracle Real-Time Decisions deployments and do not miss this unique opportunity to ask them specific questions directly during our customer roundtable. Please share this information with anyone interested in real-time decision management and cross-channel predictive process optimization.http://www.oracle.com/goto/RealTimeDecisions

    Read the article

  • SQL aggregation query, grouping by entries in junction table

    - by cm007
    I have TableA in a many-to-many relationship with TableC via TableB. That is, TableA TableB TableC id | val fkeyA | fkeyC id | data I wish the do select sum(val) on TableA, grouping by the relationship(s) to TableC. Every entry in TableA has at least one relationship with TableC. For example, TableA 1 | 25 2 | 30 3 | 50 TableB 1 | 1 1 | 2 2 | 1 2 | 2 2 | 3 3 | 1 3 | 2 should output 75 30 since rows 1 and 3 in Table have the same relationships to TableC, but row 2 in TableA has a different relationship to TableC. How can I write a SQL query for this?

    Read the article

  • Consolidating values in a junction table

    - by senloe
    I have the following schema: Parcels Segments SegmentsParcels ========= ========== ================= ParcelID SegmentID ParcelID ... Name SegmentID ... id A user of the data wants to consolidate Segments.Names and gave me a list of current Segment.Names mapped to new Segment.Names (all of which currently exist). So now I have this list in a temporary table with the currentID and newID to map to. What I want to do is update the SegmentID in SegmentsParcels based on this map. I could use the statement: update SegmentParcels set segmentID = [newID] from newsegments where segmentID = currentid but this will create some duplicates I have a unique constraint on ParcelID and SegmentID in SegmentParcels. What is the best way to go about this? I considered removing the constraint and then dealing with removing the duplicates (which I did at one point and could probably do again) but I was hoping there was a simpler way.

    Read the article

  • Give Access to a Subdirectory Without Giving Access to Parent Directories

    - by allquixotic
    I have a scenario involving a Windows file server where the "owner" wants to dole out permissions to a group of users of the following sort: \\server\dir1\dir2\dir3: Read & Execute and Write \\server\dir1\dir2: No permissions. \\server\dir1: No permissions. \\server: Read & Execute To my understanding, it is not possible to do this because Read & Execute permission must be granted to all the parent directories in a directory chain in order for the operating system to be able to "see" the child directories and get to them. Without this permission, you can't even obtain the security context token when trying to access the nested directory, even if you have full access to the subdirectory. We are looking for ways to get around this, without moving the data from \\server\dir1\dir2\dir3 to \\server\dir4. One workaround I thought of, but which I am not sure if it will work, is creating some sort of link or junction \\server\dir4 which is a reference to \\server\dir1\dir2\dir3. I am not sure which of the available options (if any) would work for this purpose if the user does not have Read & Execute permission on \\server\dir1\dir2 or \\server\dir1, but as far as I know, the options are these: NTFS Symbolic Link, Junction, Hard Link. So the questions: Are any of these methods suitable to accomplish my goal? Are there any other methods of linking or indirectly referencing a directory, which I haven't listed above, which might be suitable? Are there any direct solutions that don't involve granting Read & Execute to \\server\dir1 or \\server\dir2 but still allowing access to \\server\dir1\dir2\dir3?

    Read the article

  • List all files and dirs without recursion with junctions

    - by naxa
    Is there a native|portable tool that can give me an unicode (or at least system local-compatible) list of all files and directories under a path recursively, without recursing into junction points or links, in Windows? For example, the built-in dir command, as well as takeown and icacls run into an infinite loop with the Application Data directory (1). EDIT I would like to be able to get a text file or at least easy clipboard transfer as output.

    Read the article

  • I can't delete a directory inside a junctioned directory

    - by Fredy Muñoz
    So this is the deal. A couple of days ago I moved my profile folder C:\Documents and Settings\fmunoz to a different drive D:\fmunoz. Today, I created a directory in my desktop using the point-and-click method: Right-click on an empty space in the desktop Select New Select Folder Leave the default name New Folder and press Enter I tried to delete the folder using the point-and-click method: Right-click the New Folder directory Select Delete After five seconds, I got the following message: --------------------------- Error Deleting File or Folder --------------------------- Cannot delete New Folder: Access is denied. Make sure the disk is not full or write-protected and that the file is not currently in use. --------------------------- Initially I thought that there must be some sort of indexing services locking the directory so I got a list of open files using the TuneUp Process Manager tool but the New Folder directory wasn't there. I double-clicked My Computer, navigated to the desktop directory C:\Documents and Settings\fmunoz\Destkop, tried to delete the New Folder directory using the same point-and-click method described above and got exactly the same message at the same amount of time. In the same window, I navigated to the actual location of the desktop directory D:\fmunoz\Desktop, tried to delete the New Folder directory and this time it worked. I thought that this behavior was due to some special treatment that Windows gives to the desktop or the profile directories so I tried doing the same thing with a different set of directories: Created a folder D:\dummy Created a junction C:\dummy pointing to D:\dummy Created a New Folder directory in C:\dummy Tried to delete New Folder from C:\dummy. Didn't work. Tried to delete New Folder from D:\dummy. It worked. I tried creating the folder in the actual directory rather than the junction directory: Created a New Folder directory in D:\dummy Tried to delete New Folder from C:\dummy. Didn't work. Tried to delete New Folder from D:\dummy. It worked. I also tried using the Delete button instead of using the Delete option of the context menu but it didn't work. When using the Shift+Delete sequence, it works. It also works by using the rd command in the console, but in both cases the deleted directory doesn't goes to the Recycle Bin, which is my intention when using the Delete context menu option or the Delete button.

    Read the article

  • Proper upgrade path for Windows 7 to Windows 8 when the directory setup is non-standard

    - by Joey
    I have both a HDD and a SSD in my computer and after installing Windows I moved things around a little to ensure that the OS is on the SSD but my user profile resides on the SSD (with a few exceptions). I used junction points heavily for that. Windows and most applications are fine with that and it works well. Now I wonder whether I can in-place upgrade this to Windows 8 while retaining that exact setup or whether there is anything I can do to ease the upgrade process.

    Read the article

  • What is the best way to reduce code and loop through a hierarchial commission script?

    - by JM4
    I have a script which currently "works" but is nearly 3600 lines of code and makes well over 50 database calls within a single script. From my experience, there is no way to really "loop" the script and minimize it because each call to the database is a subquery of the ones before based on referral ids. Perhaps I can give a very simple example of what I am trying to accomplish and see if anybody has experience with something similar. In my example, there are three tables: Table 1 - Sellers ID | Comm_level | Parent ----------------------------------- 1 | 4 | NULL 2 | 3 | 1 3 | 2 | 1 4 | 2 | 2 5 | 2 | 2 6 | 1 | 3 Where ID is the id of one of our sales agents, comm_level will determine what his commission percentage is for each product he sells, parent indicates the ID for whom recruited that particular agent. In the example above, 1 is the top agent, he recruited two agents, 2 and 3. 2 recruited two agents, 4 and 5. 3 recruited one agent, 6. NOTE: An agent can NEVER recruit anybody equal to or higher than their own level. Table 2 - Commissions Level | Item 1 | Item 2 | Item 3 ----------------------------------------------------- 4 | .5 | .4 | .3 3 | .45 | .35 | .25 2 | .4 | .3 | .2 1 | .35 | .25 | .15 This table lays out the commission percentages for each agent based on their actual comm_level (if an agent is at a level 4, he will receive 50% on every item 1 sold, 40% on every item 2, 30% on every item 3 and so on. Table 3 - Items Sold ID | Item --------------------- 4 | item_1 4 | item_2 1 | item_1 2 | item_3 6 | item_2 1 | item_3 This table pairs the actual item sold with the seller who sold the item. When generating the commission report, calculating individual values is very simple. Calculating their commission based on their sub_sellers however is very difficult. In this example, Seller ID 1 gets a piece of every single item sold. The commission percentages indicate individual sales or the height of their commission. For example: When seller ID 6 sold one of item_2 above, the tree for commissions will look like the following: -ID 6 - 25% of cost(item_1) -ID 3 - 5% of cost(item_1) - (30% is his comm - 25% comm of seller id 6) -ID 1 - 10% of cost(item_1) - (40% is his comm - 30% of seller id 3) This must be calculated for every agent in the system from the top down (hence the DB calls within while loops throughout my enormous script). Anybody have a good suggestion or samples they may have used in the past?

    Read the article

  • How can I set Windows Server 2008 juntion points to Every Read Allow?

    - by brendan
    We have apps running on Windows Server 2003 and now 2008 as well. Unfortunately some of our code relies on inspecting the Documents and Settings directory which no longer exists in Windows 2003. It looks like there are "Junction Points" set up for backwards compatibility - http://msdn.microsoft.com/en-us/library/bb756982.aspx. But it seems like nothing I can do can get me access. I basically need to be able to call from a command line on both 2003 and 2008: C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\Application\chrome.exe Which translates in Windows 2008 to : C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe I've tried setting up my own "Documents and Settings" folder in 2008 but it won't let me as that seems to be reserved for these Juntion Points.

    Read the article

  • IF I have multiple candidate keys which one is a primary key and justify your choice ??

    - by zahrani
    Given R = { Account , Analyst , Assets, Broker, Client, Commission, Company, Dividend, Exchange, Investment, Office, Profile, Return, Risk_profile, Stock, Volume} and a set of functional dependencies F{fd1, fd2,fd3, fd4, fd5,fd6, fd7, fd8, fd9, fd10, fd11} where: fd1: Client - Office fd2: Stock - Exchange, Dividend fd3: Broker - Profile fd4: Company - Stock fd5: Client - Risk_profile, Analyst fd6: Analyst - Broker fd7: Stock, Broker - Invenstment, Volume fd8: Stock - Company fd9: Investment,Commission - Return fd10: Stock, Broker - Client fd11: Account - Assests these are candidate key(s) : (Account, Commission,Analyst ,Company) (Account, Commission,Analyst ,Stock) (Account ,Commission,Broker ,Company) (Account ,Commission,Broker ,Stock) (Account ,Commission,Client, Company) (Account ,Commission,Client ,Stock) (Q) Select a primary key and justify your choice ? I was select (Account ,Commission,Broker ,Stock) as a primary key ??? I chose that because it has the most direct dependencies compared to other ones. e.g. more attributes are functionally dependent on this primary key. please check if my answer is it true ? or Not I'm waiting your answer asap thank you

    Read the article

  • VLOOKUP in Excel, part 2: Using VLOOKUP without a database

    - by Mark Virtue
    In a recent article, we introduced the Excel function called VLOOKUP and explained how it could be used to retrieve information from a database into a cell in a local worksheet.  In that article we mentioned that there were two uses for VLOOKUP, and only one of them dealt with querying databases.  In this article, the second and final in the VLOOKUP series, we examine this other, lesser known use for the VLOOKUP function. If you haven’t already done so, please read the first VLOOKUP article – this article will assume that many of the concepts explained in that article are already known to the reader. When working with databases, VLOOKUP is passed a “unique identifier” that serves to identify which data record we wish to find in the database (e.g. a product code or customer ID).  This unique identifier must exist in the database, otherwise VLOOKUP returns us an error.  In this article, we will examine a way of using VLOOKUP where the identifier doesn’t need to exist in the database at all.  It’s almost as if VLOOKUP can adopt a “near enough is good enough” approach to returning the data we’re looking for.  In certain circumstances, this is exactly what we need. We will illustrate this article with a real-world example – that of calculating the commissions that are generated on a set of sales figures.  We will start with a very simple scenario, and then progressively make it more complex, until the only rational solution to the problem is to use VLOOKUP.  The initial scenario in our fictitious company works like this:  If a salesperson creates more than $30,000 worth of sales in a given year, the commission they earn on those sales is 30%.  Otherwise their commission is only 20%.  So far this is a pretty simple worksheet: To use this worksheet, the salesperson enters their sales figures in cell B1, and the formula in cell B2 calculates the correct commission rate they are entitled to receive, which is used in cell B3 to calculate the total commission that the salesperson is owed (which is a simple multiplication of B1 and B2). The cell B2 contains the only interesting part of this worksheet – the formula for deciding which commission rate to use: the one below the threshold of $30,000, or the one above the threshold.  This formula makes use of the Excel function called IF.  For those readers that are not familiar with IF, it works like this: IF(condition,value if true,value if false) Where the condition is an expression that evaluates to either true or false.  In the example above, the condition is the expression B1<B5, which can be read as “Is B1 less than B5?”, or, put another way, “Are the total sales less than the threshold”.  If the answer to this question is “yes” (true), then we use the value if true parameter of the function, namely B6 in this case – the commission rate if the sales total was below the threshold.  If the answer to the question is “no” (false), then we use the value if false parameter of the function, namely B7 in this case – the commission rate if the sales total was above the threshold. As you can see, using a sales total of $20,000 gives us a commission rate of 20% in cell B2.  If we enter a value of $40,000, we get a different commission rate: So our spreadsheet is working. Let’s make it more complex.  Let’s introduce a second threshold:  If the salesperson earns more than $40,000, then their commission rate increases to 40%: Easy enough to understand in the real world, but in cell B2 our formula is getting more complex.  If you look closely at the formula, you’ll see that the third parameter of the original IF function (the value if false) is now an entire IF function in its own right.  This is called a nested function (a function within a function).  It’s perfectly valid in Excel (it even works!), but it’s harder to read and understand. We’re not going to go into the nuts and bolts of how and why this works, nor will we examine the nuances of nested functions.  This is a tutorial on VLOOKUP, not on Excel in general. Anyway, it gets worse!  What about when we decide that if they earn more than $50,000 then they’re entitled to 50% commission, and if they earn more than $60,000 then they’re entitled to 60% commission? Now the formula in cell B2, while correct, has become virtually unreadable.  No-one should have to write formulae where the functions are nested four levels deep!  Surely there must be a simpler way? There certainly is.  VLOOKUP to the rescue! Let’s redesign the worksheet a bit.  We’ll keep all the same figures, but organize it in a new way, a more tabular way: Take a moment and verify for yourself that the new Rate Table works exactly the same as the series of thresholds above. Conceptually, what we’re about to do is use VLOOKUP to look up the salesperson’s sales total (from B1) in the rate table and return to us the corresponding commission rate.  Note that the salesperson may have indeed created sales that are not one of the five values in the rate table ($0, $30,000, $40,000, $50,000 or $60,000).  They may have created sales of $34,988.  It’s important to note that $34,988 does not appear in the rate table.  Let’s see if VLOOKUP can solve our problem anyway… We select cell B2 (the location we want to put our formula), and then insert the VLOOKUP function from the Formulas tab: The Function Arguments box for VLOOKUP appears.  We fill in the arguments (parameters) one by one, starting with the Lookup_value, which is, in this case, the sales total from cell B1.  We place the cursor in the Lookup_value field and then click once on cell B1: Next we need to specify to VLOOKUP what table to lookup this data in.  In this example, it’s the rate table, of course.  We place the cursor in the Table_array field, and then highlight the entire rate table – excluding the headings: Next we must specify which column in the table contains the information we want our formula to return to us.  In this case we want the commission rate, which is found in the second column in the table, so we therefore enter a 2 into the Col_index_num field: Finally we enter a value in the Range_lookup field. Important:  It is the use of this field that differentiates the two ways of using VLOOKUP.  To use VLOOKUP with a database, this final parameter, Range_lookup, must always be set to FALSE, but with this other use of VLOOKUP, we must either leave it blank or enter a value of TRUE.  When using VLOOKUP, it is vital that you make the correct choice for this final parameter. To be explicit, we will enter a value of true in the Range_lookup field.  It would also be fine to leave it blank, as this is the default value: We have completed all the parameters.  We now click the OK button, and Excel builds our VLOOKUP formula for us: If we experiment with a few different sales total amounts, we can satisfy ourselves that the formula is working. Conclusion In the “database” version of VLOOKUP, where the Range_lookup parameter is FALSE, the value passed in the first parameter (Lookup_value) must be present in the database.  In other words, we’re looking for an exact match. But in this other use of VLOOKUP, we are not necessarily looking for an exact match.  In this case, “near enough is good enough”.  But what do we mean by “near enough”?  Let’s use an example:  When searching for a commission rate on a sales total of $34,988, our VLOOKUP formula will return us a value of 30%, which is the correct answer.  Why did it choose the row in the table containing 30% ?  What, in fact, does “near enough” mean in this case?  Let’s be precise: When Range_lookup is set to TRUE (or omitted), VLOOKUP will look in column 1 and match the highest value that is not greater than the Lookup_value parameter. It’s also important to note that for this system to work, the table must be sorted in ascending order on column 1! If you would like to practice with VLOOKUP, the sample file illustrated in this article can be downloaded from here. Similar Articles Productive Geek Tips Using VLOOKUP in ExcelImport Microsoft Access Data Into ExcelImport an Access Database into ExcelCopy a Group of Cells in Excel 2007 to the Clipboard as an ImageShare Access Data with Excel in Office 2010 TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Quickly Schedule Meetings With NeedtoMeet Share Flickr Photos On Facebook Automatically Are You Blocked On Gtalk? Find out Discover Latest Android Apps On AppBrain The Ultimate Guide For YouTube Lovers Will it Blend? iPad Edition

    Read the article

  • How do I create and use a junction table in Rails?

    - by Thierry Lam
    I have the following data: A post called Hello has categories greet Another post called Hola has categories greet, international My schema is: create_table "posts", :force => true do |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" end create_table "categories", :force => true do |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" end create_table "posts_categories", :force => true do |t| t.integer "post_id" t.integer "category_id" t.datetime "created_at" t.datetime "updated_at" end After reading the Rails guide, the most suitable relationship for the above seems to be: class Post < ActiveRecord::Base has_and_belongs_to_many :categories end class Category < ActiveRecord::Base has_and_belongs_to_many :posts end My junction table also seems to have a primary key. I think I need to get rid of it. What's the initial migration command to generate a junction table in Rails? What's the best course of action, should I drop posts_categories and re-create it or just drop the primary key column? Does the junction table have a corresponding model? I have used scaffold to generate the junction table code, should I get rid of the extra code? Assuming all the above has been fixed and is working properly, how do I query all posts and display them along with their named categories in the view. For example: Post #1 - hello, categories: greet Post #2 - hola, categories: greet, international

    Read the article

  • windows service "soft link"

    - by fred smith
    I would like to be able to have a nice management tool to allow the rollout of different versions of a windows service over time. for example I would like to deploy my software (windows service) in version numbered folders, e.g. c:\wss\v1.0 c:\wss\v1.1 etc however I dont want to have to reinstall the windows service each time but rather would like to be able to easily point the windows service manager to the new folder. Are there tools to get this done? NB: I have used Windows Junctions before (from sysinternals) however I am wondering if there is a nice GUI tool to do this.

    Read the article

  • When does it makes sense to use a map?

    - by kiwicptn
    I am trying to round up cases when it makes sense to use a map (set of key-value entries). So far I have five categories (see below). Assuming more exist, what are they? Please limit each answer to one unique category, put up an example, and vote up the fascinating ones. Property values (like a bean) age -> 30 sex -> male loc -> calgary Histograms peter -> 1 john -> 7 paul -> 5 Presence, with O(1) performance peter -> 1 john -> 1 paul -> 1 Functions peter -> treatPeter() john -> dealWithJohn() paul -> managePaul() Conversion peter -> pierre john -> jean paul -> paul

    Read the article

  • Comparing datafeeds from different networks (Affiliate Marketing)

    - by Logistetica
    Hi, I am working on integrating affiliate sales into few existing sites. We are using a few merchants who work via different networks (cj, shareasale, linkshare, avantlink). Now my observation is that all these networks provide data feeds in different formats. But that's not a big problem. My main concern is actually merchants using different titles on same products. I don't want to run into these situations: a) two listings of the SAME product from N merchants (if titles are just a bit different) b) one listing of N different products from merchants (if we don't use strict comparison algorithm) We want to automate everything as much as possible, want to avoid operators scanning listings under question all the time. How is this problem typically handled?

    Read the article

  • Junctions or Virtual Directories for Web Applications?

    - by Kevin
    I see that junctions are a common way of referencing shared code in many projects. However, I have not seen them used in web applications before. Our team is exploring the possibility of abandoning virtual directories in favor of junctions to simplify our build process. My goal is to compile a list of pros and cons in order to make an informed decision regarding this change. Is it more appropriate to use junctions or virtual directories on web application projects? Environment is ASP.NET, IIS6/IIS7, VS.NET.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >