Search Results

Search found 886 results on 36 pages for 'duplicates'.

Page 8/36 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Access MP3 audio data independently of ID3 tags?

    - by kyl191
    Hi, this is a 2 part question. First off, is it possible to access the audio data in an MP3 independently of the ID3 tags, and secondly, is there any way to do so using available libraries? I recently consolidated my music collection from 3 computers and ended up with songs which had changed ID3 tags, but the audio data itself was unmodified. Running a search for duplicate files failed because the file changed with the ID3 tag change, but I think it should be possible to identify duplicate files if I just run a deduplication using the audio data for comparison. I know that it's possible to seek to a particular position past the ID3 header in the file, and directly read the data, but was wondering if there's a library that would expose the audio data so I could just extract the data, run a checksum on it, and store the computed result somewhere, then look for identical checksums. (Also, I'd probably have to use some kind of library when you take into account variable length headers.)

    Read the article

  • SQL Query Returning Duplicate Results

    - by Jesse Bunch
    Hi, I've been working out this query now for a while and I thought I had it where I wanted it, but apparently not. There are two records in the database (orders). The query should return two different rows, but instead returns two rows that have exactly the same values. I think it may be something to do with the GROUP BY or derived tables I'm using but my eyes are tired and not seeing the problem. Can any of you help? Thanks in advance. SELECT orders.billerID, orders.invoiceDate, orders.txnID, orders.bName, orders.bStreet1, orders.bStreet2, orders.bCity, orders.bState, orders.bZip, orders.bCountry, orders.sName, orders.sStreet1, orders.sStreet2, orders.sCity, orders.sState, orders.sZip, orders.sCountry, orders.paymentType, orders.invoiceNotes, orders.pFee, orders.shipping, orders.tax, orders.reasonCode, orders.txnType, orders.customerID, customers.firstName AS firstName, customers.lastName AS lastName, customers.businessName AS businessName, orderStatus.statusName AS orderStatus, IFNULL(orderItems.itemTotal, 0.00) + orders.shipping + orders.tax AS orderTotal, IFNULL(orderItems.itemTotal, 0.00) + orders.shipping + orders.tax - IFNULL(payments.totalPayments, 0.00) AS orderBalance FROM orders LEFT JOIN customers ON orders.customerID = customers.id LEFT JOIN orderStatus ON orders.orderStatus = orderStatus.id LEFT JOIN ( SELECT orderItems.orderID, SUM(orderItems.itemPrice * orderItems.itemQuantity) as itemTotal FROM orderItems GROUP BY orderItems.orderID ) orderItems ON orderItems.orderID = orders.id LEFT JOIN ( SELECT payments.orderID, SUM(payments.amount) as totalPayments FROM payments GROUP BY payments.orderID ) payments ON payments.orderID = orders.id

    Read the article

  • R counting the occurance of similar rows of data frame

    - by Matt
    I have data in the following format called DF (this is just a made up simplified sample): eval.num, eval.count, fitness, fitness.mean, green.h.0, green.v.0, offset.0 random 1 1 1500 1500 100 120 40 232342 2 2 1000 1250 100 120 40 11843 3 3 1250 1250 100 120 40 981340234 4 4 1000 1187.5 100 120 40 4363453 5 1 2000 2000 200 100 40 345902 6 1 3000 3000 150 90 10 943 7 1 2000 2000 90 90 100 9304358 8 2 1800 1900 90 90 100 284333 However, the eval.count column is incorrect and I need to fix it. It should report the number of rows with the same values for (green.h.0, green.v.0, and offset.0) by only looking at the previous rows. The example above uses the expected values, but assume they are incorrect. How can I add a new column (say "count") which will count all previous rows which have the same values of the specified variables? I have gotten help on a similar problem of just selecting all rows with the same values for specified columns, so I supposed I could just write a loop around that, but it seems inefficient to me.

    Read the article

  • Duplicate a UITableViewCell - iPhone

    - by ncohen
    Hi everyone, I would like to create an effect to a cell of a UITableView. The effect is: duplicate the cell and move the duplicated cell (the original stays at its place). My problem is to duplicate the cell... I've tried: Code: UITableViewCell *animatedCell = [[UITableViewCell alloc] init]; animatedCell = [[self cellForRowAtIndexPath:indexPath] copy]; but UIView doesn't seem to implement the copy... How can I do it? Thanks

    Read the article

  • R counting the occurrences of similar rows of data frame

    - by Matt
    I have data in the following format called DF (this is just a made up simplified sample): eval.num, eval.count, fitness, fitness.mean, green.h.0, green.v.0, offset.0 random 1 1 1500 1500 100 120 40 232342 2 2 1000 1250 100 120 40 11843 3 3 1250 1250 100 120 40 981340234 4 4 1000 1187.5 100 120 40 4363453 5 1 2000 2000 200 100 40 345902 6 1 3000 3000 150 90 10 943 7 1 2000 2000 90 90 100 9304358 8 2 1800 1900 90 90 100 284333 However, the eval.count column is incorrect and I need to fix it. It should report the number of rows with the same values for (green.h.0, green.v.0, and offset.0) by only looking at the previous rows. The example above uses the expected values, but assume they are incorrect. How can I add a new column (say "count") which will count all previous rows which have the same values of the specified variables? I have gotten help on a similar problem of just selecting all rows with the same values for specified columns, so I supposed I could just write a loop around that, but it seems inefficient to me.

    Read the article

  • R selecting duplicate rows

    - by Matt
    Okay, I'm fairly new to R and I've tried to search the documentation for what I need to do but here is the problem. I have a data.frame called heeds.data in the following form (some columns omitted for simplicity) eval.num, eval.count, ... fitness, fitness.mean, green.h.0, green.v.0, offset.0, green.h.1, green.v.1,...green.h.7, green.v.7, offset.7... And I have selected a row meeting the following criteria: best.fitness <- min(heeds.data$fitness.mean[heeds.data$eval.count = 10]) best.row <- heeds.data[heeds.data$fitness.mean == best.fitness] Now, what I want are all of the other rows with that have columns green.h.0 to offset.7 (a contiguous section of columns) equal to the best.row Basically I'm looking for rows that have some of the conditions the same as the "best" row. I thought I could just do this, heeds.best <- heeds.data$fitness[ heeds.data$green.h.0 == best.row$green.h.0 & ... ] But with 24 columns it seems like a stupid method. Looking for something a bit simpler with less manual typing. Thanks!

    Read the article

  • Datamapper Clone Record w/ New ID

    - by BouncePast
    class Item include DataMapper::Resource property :id, Serial property :title, String end item = Item.new(:title = 'Title 1') # :id = 1 item_clone = Item.first(:id = 1).clone item_clone.save This does "clone" the object as described but how can this be done so it applies a different ID once the record is saved, e.g. #

    Read the article

  • How to compare 2 lists and merge them in Python/MySQL?

    - by NJTechGuy
    I want to merge data. Following are my MySQL tables. I want to use Python to traverse though a list of both Lists (one with dupe = 'x' and other with null dupes). For instance : a b c d e f key dupe -------------------- 1 d c f k l 1 x 2 g h j 1 3 i h u u 2 4 u r t 2 x From the above sample table, the desired output is : a b c d e f key dupe -------------------- 2 g c h k j 1 3 i r h u u 2 What I have so far : import string, os, sys import MySQLdb from EncryptedFile import EncryptedFile enc = EncryptedFile( os.getenv("HOME") + '/.py-encrypted-file') user = enc.getValue("user") pw = enc.getValue("pw") db = MySQLdb.connect(host="127.0.0.1", user=user, passwd=pw,db=user) cursor = db.cursor() cursor2 = db.cursor() cursor.execute("select * from delThisTable where dupe is null") cursor2.execute("select * from delThisTable where dupe is not null") result = cursor.fetchall() result2 = cursor2.fetchall() for cursorFieldname in cursor.description: for cursorFieldname2 in cursor2.description: if cursorFieldname[0] == cursorFieldname2[0]: ### How do I compare the record with same key value and update the original row null field value with the non-null value from the duplicate? Please fill this void... cursor.close() cursor2.close() db.close() Thanks guys!

    Read the article

  • How to triage this MySQL duplicate entry error after running Rails migration?

    - by keruilin
    I get the following error when I try to run this migration: == AddUniquenessConstraintOnAwards: migrating ================================ -- add_index(:awards, [:badge_id, :game_week_id], {:unique=>true, :name=>:game_badge_index}) rake aborted! An error has occurred, all later migrations canceled: Mysql::Error: Duplicate entry '35-8192' for key 'game_badge_index': CREATE UNIQUE INDEX `game_badge_index` ON `awards` (`badge_id`, `game_week_id`) Has anyone encountered? What's the error telling me? How did you troubleshoot it and ultimately fix it?

    Read the article

  • How can I ignore an http request without clearing the browser?

    - by Timid Developer
    To prevent duplicate requests (i.e. pressing F5 right after clicking a command button), I've setup my page base class to ignore the request if it's detected as a duplicate. When I say 'ignore' I mean Response.End() Now I thought I've seen this work before, where there's an issue, I just Response.End() and the users page just does nothing. I don't know the exact circumstance in which this worked, but I'm unable to repeat it now. Now when I call Response.End(), I just get an empty browser. More specifically, I get this html. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=utf-8"></HEAD> <BODY></BODY></HTML> I setup the following test app to confirm the problem is not elsewhere in my app. Here it is: Add the following to an aspx form <asp:Label ID="lbl" Text="0" runat="server" /><br /> <asp:Button ID="btnAdd1" Text="Add 1" runat="server" /><br /> <asp:Button ID="btnAdd2" Text="Add 2" runat="server" /><br /> <asp:Button ID="btnAdd3" Text="Add 3" runat="server" /><br /> And here's the code behind file using System; namespace TestDupRequestCancellation { public partial class _Default : System.Web.UI.Page { protected void Page_Init(object sender, EventArgs e) { btnAdd1.Click += btnAdd1_Click; btnAdd2.Click += btnAdd2_Click; btnAdd3.Click += btnAdd3_Click; } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) CurrentValue = 0; else if (Int32.Parse(lbl.Text) != CurrentValue) Response.End(); } protected void Page_PreRender(object sender, EventArgs e) { lbl.Text = CurrentValue.ToString(); } protected int CurrentValue { get { return Int32.Parse(Session["CurrentValue"].ToString()); } set { Session["CurrentValue"] = value.ToString(); } } void btnAdd3_Click(object sender, EventArgs e) { CurrentValue += 3; } void btnAdd2_Click(object sender, EventArgs e) { CurrentValue += 2; } void btnAdd1_Click(object sender, EventArgs e) { CurrentValue += 1; } } } When you load the page, clicking any button does what is expected, but if you press F5 at any time after pressing one of the buttons, it will detect it as a duplicate request and call Response.End() which promptly ends the task. Which leaves the user with an empty browser. Is there anyway to leave the user with the page as it was, so they can just click a button? Also; please note that this code is the simplest code I could come up with to demonstrate my problem. It's not meant to demonstrate how to check for dup requests.

    Read the article

  • BB Code Parser (in formatting phase) with jQuery jammed due to messed up loops most likely

    - by Oskar
    Greetings everyone, I'm making a BB Code Parser but I'm stuck on the JavaScript front. I'm using jQuery and the caret library for noting selections in a text field. When someone selects a piece of text a div with formatting options will appear. I have two issues. Issue 1. How can I make this work for multiple textfields? I'm drawing a blank as it currently will detect the textfield correctly until it enters the $("#BBtoolBox a").mousedown(function() { } loop. After entering it will start listing one field after another in a random pattern in my eyes. !!! MAIN Issue 2. I'm guessing this is the main reason for issue 1 as well. When I press a formatting option it will work on the first action but not the ones afterwards. It keeps duplicating the variable parsed. (if I only keep to one field it will never print in the second) Issue 3 If you find anything especially ugly in the code, please tell me how to improve myself. I appriciate all help I can get. Thanks in advance $(document).ready(function() { BBCP(); }); function BBCP(el) { if(!el) { el = "textarea"; } // Stores the cursor position of selection start $(el).mousedown(function(e) { coordX = e.pageX; coordY = e.pageY; // Event of selection finish by using keyboard }).keyup(function() { BBtoolBox(this, coordX, coordY); // Event of selection finish by using mouse }).mouseup(function() { BBtoolBox(this, coordX, coordY); // Event of field unfocus }).blur(function() { $("#BBtoolBox").hide(); }); } function BBtoolBox(el, coordX, coordY) { // Variable containing the selected text by Caret selection = $(el).caret().text; // Ignore the request if no text is selected if(selection.length == 0) { $("#BBtoolBox").hide(); return; } // Print the toolbox if(!document.getElementById("BBtoolBox")) { $(el).before("<div id=\"BBtoolBox\" style=\"left: "+ ( coordX + 5 ) +"px; top: "+ ( coordY - 30 ) +"px;\"></div>"); // List of actions $("#BBtoolBox").append("<a href=\"#\" onclick=\"return false\"><img src=\"./icons/text_bold.png\" alt=\"B\" title=\"Bold\" /></a>"); $("#BBtoolBox").append("<a href=\"#\" onclick=\"return false\"><img src=\"./icons/text_italic.png\" alt=\"I\" title=\"Italic\" /></a>"); } else { $("#BBtoolBox").css({'left': (coordX + 3) +'px', 'top': (coordY - 30) +'px'}).show(); } // Parse the text according to the action requsted $("#BBtoolBox a").mousedown(function() { switch($(this).children(":first").attr("alt")) { case "B": // bold parsed = "[b]"+ selection +"[/b]"; break; case "I": // italic parsed = "[i]"+ selection +"[/i]"; break; } // Changes the field value by replacing the selection with the variable parsed $(el).val($(el).caret().replace(parsed)); $("#BBtoolBox").hide(); return false; }); }

    Read the article

  • Bash loop command until file contains n duplicate entries (lines)

    - by Andrew
    Hello, I'm writing a script and I need to create a loop that will execute same commands until file does contain a specified number of duplicate entries. For example, with each loop I will echo random string to file results. And I want loop to stop when there are 10 lines of of the same string. I thought of something like while [ `some command here (maybe using uniq)` -lt 10 ] do command1 command2 command3 done Do you have any idea how can this problem be solved? Using grep can't be done since I don't know what string I need to look for. Thank you for your suggestions.

    Read the article

  • How to list all duplicated rows which may include NULL columns?

    - by Yousui
    Hi guys, I have a problem of listing duplicated rows that include NULL columns. Lemme show my problem first. USE [tempdb]; GO IF OBJECT_ID(N'dbo.t') IS NOT NULL BEGIN DROP TABLE dbo.t END GO CREATE TABLE dbo.t ( a NVARCHAR(8), b NVARCHAR(8) ); GO INSERT t VALUES ('a', 'b'); INSERT t VALUES ('a', 'b'); INSERT t VALUES ('a', 'b'); INSERT t VALUES ('c', 'd'); INSERT t VALUES ('c', 'd'); INSERT t VALUES ('c', 'd'); INSERT t VALUES ('c', 'd'); INSERT t VALUES ('e', NULL); INSERT t VALUES (NULL, NULL); INSERT t VALUES (NULL, NULL); INSERT t VALUES (NULL, NULL); INSERT t VALUES (NULL, NULL); GO Now I want to show all rows that have other rows duplicated with them, I use the following query. SELECT a, b FROM dbo.t GROUP BY a, b HAVING count(*) > 1 which will give us the result: a b -------- -------- NULL NULL a b c d Now if I want to list all rows that make contribution to duplication, I use this query: WITH duplicate (a, b) AS ( SELECT a, b FROM dbo.t GROUP BY a, b HAVING count(*) > 1 ) SELECT dbo.t.a, dbo.t.b FROM dbo.t INNER JOIN duplicate ON (dbo.t.a = duplicate.a AND dbo.t.b = duplicate.b) Which will give me the result: a b -------- -------- a b a b a b c d c d c d c d As you can see, all rows include NULLs are filtered. The reason I thought is that I use equal sign to test the condition(dbo.t.a = duplicate.a AND dbo.t.b = duplicate.b), and NULLs cannot be compared use equal sign. So, in order to include rows that include NULLs in it in the last result, I have change the aforementioned query to WITH duplicate (a, b) AS ( SELECT a, b FROM dbo.t GROUP BY a, b HAVING count(*) > 1 ) SELECT dbo.t.a, dbo.t.b FROM dbo.t INNER JOIN duplicate ON (dbo.t.a = duplicate.a AND dbo.t.b = duplicate.b) OR (dbo.t.a IS NULL AND duplicate.a IS NULL AND dbo.t.b = duplicate.b) OR (dbo.t.b IS NULL AND duplicate.b IS NULL AND dbo.t.a = duplicate.a) OR (dbo.t.a IS NULL AND duplicate.a IS NULL AND dbo.t.b IS NULL AND duplicate.b IS NULL) And this query will give me the answer as I wanted: a b -------- -------- NULL NULL NULL NULL NULL NULL NULL NULL a b a b a b c d c d c d c d Now my question is, as you can see, this query just include two columns, in order to include NULLs in the last result, you have to use many condition testing statements in the query. As the column number increasing, the condition testing statements you need in your query is increasing astonishingly. How can I solve this problem? Great thanks.

    Read the article

  • remove double http:// from input via jquery

    - by loo
    I have a textarea with a default value of http://. Now when an user pastes in an url (if they don't know what they are doing, like most people) it comes out like this http://http://www.google.com. I've seen a site that as soon as you have http://http:// it removes one via Ajax. I am not familiar with Ajax, so can anyone help me? I don't want to clear the field on focus only.

    Read the article

  • How to find duplicate values in SQL Server

    - by hgulyan
    Hi, I'm using SQL Server 2008. I have a table Customers customer_number int field1 varchar field2 varchar field3 varchar field4 varchar ... and a lot more columns, that doesn't matter for my queries. Column *customer_number* is pk. I'm trying to find duplicate values and some differences between them. Please, help me to find all rows that have same 1) field1, field2, field3, field4 2) only 3 columns are equal and one of them isn't (except rows from list 1) 3) only 2 columns equal and two of them aren't (except rows from list 1 and list 2) In the end, I'll have 3 tables with this results and additional groupId, which will be same for a group of similars (For example, for 3 column equals, rows that have 3 same columns equal will be a seperate group) Thank you.

    Read the article

  • query structure - ignoring entries for the same event from multiple users?

    - by Andrew Heath
    One table in my MySQL database tracks game plays. It has the following structure: SCENARIO_VICTORIES [ID] [scenario_id] [game] [timestamp] [user_id] [winning_side] [play_date] ID is the autoincremented primary key. timestamp records the moment of submission for the record. winning_side has one of three possible values: 1, 2, or 0 (meaning a draw) One of the queries done on this table calculates the victory percentage for each scenario, when that scenario's page is viewed. The output is expressed as: Side 1 win % Side 2 win % Draw % and queried with: SELECT winning_side, COUNT(scenario_id) FROM scenario_victories WHERE scenario_id='$scenID' GROUP BY winning_side ORDER BY winning_side ASC and then processed into the percentages and such. Sorry for the long setup. My problem is this: several of my users play each other, and record their mutual results. So these battles are being doubly represented in the victory percentages and result counts. Though this happens infrequently, the userbase isn't large and the double entries do have a noticeable effect on the data. Given the table and query above - does anyone have any suggestions for how I can "collapse" records that have the same play_date & game & scenario_id & winning_side so that they're only counted once?

    Read the article

  • Duplicated Label in add_menu_page

    - by Blackdream
    I have created a function for a theme customization. function create_theme_option() { add_menu_page( 'Manage Options', //Page Title 'Theme Option', //WP Administrator Menu Title 'manage_options', // 'theme-options', //Link to a page to your Administration Area 'deploy_theme_options', //Function Name get_template_directory_uri() . '/Plugins/Background Changer/images/icons/icon.png',//Menu Icon 99); add_submenu_page("theme-options", "Theme Settings", "Theme Settings", 1, "theme-settings", "theme_settings"); add_submenu_page("theme-options", "Manage Header", "Manage Header", 1, "manage-header", "manage_header"); add_submenu_page("theme-options", "Social Media", "Social Media Links", 1, "social-media", "social_media"); add_submenu_page("theme-options", "Catalog Manager", "Catalog Manager", 1, "catalog-manager", "catalog_manager"); } but I noticed that after the label "Theme Option" there is another text appear next to it as "Theme Option". Check the Image below: How can I fix this? Please help!

    Read the article

  • detecting object-reference duplication across JavaScript files

    - by AnC
    I have a number of files with contents like this: function hello() { ... element1.text = foo.locale.lorem; element2.text = foo.locale.ipsum; ... elementn.text = foo.locale.whatever; ... } function world() { ... var label = bar.options.baz.blah; var toggle = bar.options.baz.use_toggle; ... } This could be written more efficiently, and also be more readable, by creating a shortcut to the locale object: function hello() { var loc = foo.locale; ... element1.text = loc.lorem; element2.text = loc.ipsum; ... elementn.text = loc.whatever; ... } function world() { var options = bar.options.baz; ... var label = options.blah; var toggle = options.use_toggle; ... } Is there a simple way to detect occurrences of such duplication for any arbitrary object (it's not always as simple as "locale", or foo.something)? Basically, I wanna know where lengthy object references appear two or more times within a function. Thanks!

    Read the article

  • Removing duplicate elements with XSLT

    - by user1439459
    I need to eliminate duplicate elements from my XML using a specific node (ItemID) My XML Looks as follows; <XML> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>723073</ItemID> <ColorID>02</ColorID> <Description>Pentel LR7 Energel Metal Tip Refill 0.7mm</Description> <MainCategory>WRITING INSTRUMENTS</MainCategory> <SubCategory>Refill</SubCategory> <LineNum> 1.0000000</LineNum> <Qty> 6.0000000</Qty> <UnitPriceExclTax> 10.0200000</UnitPriceExclTax> <LineTax> 8.4200000</LineTax> <LinePriceExclTax> 60.1200000</LinePriceExclTax> <ColorName>Black</ColorName> <UOM>EA</UOM> <Backorder> 0.0000000</Backorder> <INVENTTRANSID> CAP5637542_060</INVENTTRANSID> </Line> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>903420</ItemID> <ColorID /> <Description>STEPHENS JUNIOR Stapler Half Strip KW586</Description> <MainCategory>OFFICE SUNDRIES</MainCategory> <SubCategory>Staplers</SubCategory> <LineNum> 2.0000000</LineNum> <Qty> 3.0000000</Qty> <UnitPriceExclTax> 32.2500000</UnitPriceExclTax> <LineTax> 13.5400000</LineTax> <LinePriceExclTax> 96.7500000</LinePriceExclTax> <ColorName /> <UOM>Ea</UOM> <Backorder> 0.0000000</Backorder> <INVENTTRANSID> CAP5637547_060</INVENTTRANSID> </Line> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>867241</ItemID> <ColorID /> <Description>TRODAT PRINTY S/Inking Stamp Copy 4911</Description> <MainCategory>STAMPS DATERS NUMBERERS</MainCategory> <SubCategory>Self Inking Stamps</SubCategory> <LineNum> 3.0000000</LineNum> <Qty> 1.0000000</Qty> <UnitPriceExclTax> 42.1500000</UnitPriceExclTax> <LineTax> 5.9000000</LineTax> <LinePriceExclTax> 42.1500000</LinePriceExclTax> <ColorName /> <UOM>Ea</UOM> <Backorder> 1.0000000</Backorder> <INVENTTRANSID> CAP5637548_060</INVENTTRANSID> </Line> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>941151</ItemID> <ColorID /> <Description>PENTEL Correction Tape 5mx5mm ZT35</Description> <MainCategory>OFFICE SUNDRIES</MainCategory> <SubCategory>Correction Fluid/Pens/Tape</SubCategory> <LineNum> 4.0000000</LineNum> <Qty> 2.0000000</Qty> <UnitPriceExclTax> 25.1500000</UnitPriceExclTax> <LineTax> 7.0400000</LineTax> <LinePriceExclTax> 50.3000000</LinePriceExclTax> <ColorName /> <UOM>Ea</UOM> <Backorder> 0.0000000</Backorder> <INVENTTRANSID> CAP5637549_060</INVENTTRANSID> </Line> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>801215</ItemID> <ColorID /> <Description>MONDI ROTATRIM Copy Paper A4 80Gsm White</Description> <MainCategory>A4 Paper</MainCategory> <SubCategory>White Bond Paper</SubCategory> <LineNum> 5.0000000</LineNum> <Qty> 100.0000000</Qty> <UnitPriceExclTax> 29.0100000</UnitPriceExclTax> <LineTax> 406.1400000</LineTax> <LinePriceExclTax> 2901.0000000</LinePriceExclTax> <ColorName /> <UOM>Pkt 500</UOM> <Backorder> 0.0000000</Backorder> <INVENTTRANSID> CAP5637552_060</INVENTTRANSID> </Line> <Line> <SALESID> CAP716197SO</SALESID> <INVOICEID> CAP600795SI</INVOICEID> <INVOICEDATE>2010/05/06</INVOICEDATE> <NUMBERSEQUENCEGROUP /> <LINENUM> 2.0000000</LINENUM> <ITEMID>805236</ITEMID> <INVENTDIMID> CAP0000594_061</INVENTDIMID> <NAME>Ruled Paper A4 Fnt/Marg JD76</NAME> <CONFIRMEDDLV>2010/05/06</CONFIRMEDDLV> <INVENTTRANSID> CAP5637543_060</INVENTTRANSID> <QTYSALES> 4.0000000</QTYSALES> <QTYORDERED> 4.0000000</QTYORDERED> <QTYBACKORDERSALES> 4.0000000</QTYBACKORDERSALES> <QTYBACKORDERINVENT> 4.0000000</QTYBACKORDERINVENT> <SALESUNIT>EA</SALESUNIT> <ORIGSALESID> CAP716197SO</ORIGSALESID> <DATAAREAID>wal</DATAAREAID> <RECID>622392608</RECID> <RecVersion>1</RecVersion> </Line> <Line> <SALESID> CAP716197SO</SALESID> <INVOICEID> CAP600795SI</INVOICEID> <INVOICEDATE>2010/05/06</INVOICEDATE> <NUMBERSEQUENCEGROUP /> <LINENUM> 3.0000000</LINENUM> <ITEMID>941150</ITEMID> <INVENTDIMID> CAP0000594_061</INVENTDIMID> <NAME>PENGUIN Correction Fluid 20ml White</NAME> <CONFIRMEDDLV>2010/05/06</CONFIRMEDDLV> <INVENTTRANSID> CAP5637546_060</INVENTTRANSID> <QTYSALES> 6.0000000</QTYSALES> <QTYORDERED> 6.0000000</QTYORDERED> <QTYBACKORDERSALES> 6.0000000</QTYBACKORDERSALES> <QTYBACKORDERINVENT> 6.0000000</QTYBACKORDERINVENT> <SALESUNIT>EA</SALESUNIT> <ORIGSALESID> CAP716197SO</ORIGSALESID> <DATAAREAID>wal</DATAAREAID> <RECID>622392609</RECID> <RecVersion>1</RecVersion> </Line> <Line> <SALESID> CAP716197SO</SALESID> <INVOICEID> CAP600795SI</INVOICEID> <INVOICEDATE>2010/05/06</INVOICEDATE> <NUMBERSEQUENCEGROUP /> <LINENUM> 5.0000000</LINENUM> <ITEMID>867241</ITEMID> <INVENTDIMID> CAP0000594_061</INVENTDIMID> <NAME>TRODAT PRINTY S/Inking Stamp Copy 4911</NAME> <CONFIRMEDDLV>2010/05/06</CONFIRMEDDLV> <INVENTTRANSID> CAP5637548_060</INVENTTRANSID> <QTYSALES> 2.0000000</QTYSALES> <QTYORDERED> 2.0000000</QTYORDERED> <QTYBACKORDERSALES> 1.0000000</QTYBACKORDERSALES> <QTYBACKORDERINVENT> 1.0000000</QTYBACKORDERINVENT> <SALESUNIT>EA</SALESUNIT> <ORIGSALESID> CAP716197SO</ORIGSALESID> <DATAAREAID>wal</DATAAREAID> <RECID>622392610</RECID> <RecVersion>1</RecVersion> </Line> </XML> You will see the XML is not identical but the tag is always in the same place, and there is currently 1 duplicate 867241 I do not want the order to change, just the element removed. Desired output would be; <XML> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>723073</ItemID> <ColorID>02</ColorID> <Description>Pentel LR7 Energel Metal Tip Refill 0.7mm</Description> <MainCategory>WRITING INSTRUMENTS</MainCategory> <SubCategory>Refill</SubCategory> <LineNum> 1.0000000</LineNum> <Qty> 6.0000000</Qty> <UnitPriceExclTax> 10.0200000</UnitPriceExclTax> <LineTax> 8.4200000</LineTax> <LinePriceExclTax> 60.1200000</LinePriceExclTax> <ColorName>Black</ColorName> <UOM>EA</UOM> <Backorder> 0.0000000</Backorder> <INVENTTRANSID> CAP5637542_060</INVENTTRANSID> </Line> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>903420</ItemID> <ColorID /> <Description>STEPHENS JUNIOR Stapler Half Strip KW586</Description> <MainCategory>OFFICE SUNDRIES</MainCategory> <SubCategory>Staplers</SubCategory> <LineNum> 2.0000000</LineNum> <Qty> 3.0000000</Qty> <UnitPriceExclTax> 32.2500000</UnitPriceExclTax> <LineTax> 13.5400000</LineTax> <LinePriceExclTax> 96.7500000</LinePriceExclTax> <ColorName /> <UOM>Ea</UOM> <Backorder> 0.0000000</Backorder> <INVENTTRANSID> CAP5637547_060</INVENTTRANSID> </Line> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>867241</ItemID> <ColorID /> <Description>TRODAT PRINTY S/Inking Stamp Copy 4911</Description> <MainCategory>STAMPS DATERS NUMBERERS</MainCategory> <SubCategory>Self Inking Stamps</SubCategory> <LineNum> 3.0000000</LineNum> <Qty> 1.0000000</Qty> <UnitPriceExclTax> 42.1500000</UnitPriceExclTax> <LineTax> 5.9000000</LineTax> <LinePriceExclTax> 42.1500000</LinePriceExclTax> <ColorName /> <UOM>Ea</UOM> <Backorder> 1.0000000</Backorder> <INVENTTRANSID> CAP5637548_060</INVENTTRANSID> </Line> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>941151</ItemID> <ColorID /> <Description>PENTEL Correction Tape 5mx5mm ZT35</Description> <MainCategory>OFFICE SUNDRIES</MainCategory> <SubCategory>Correction Fluid/Pens/Tape</SubCategory> <LineNum> 4.0000000</LineNum> <Qty> 2.0000000</Qty> <UnitPriceExclTax> 25.1500000</UnitPriceExclTax> <LineTax> 7.0400000</LineTax> <LinePriceExclTax> 50.3000000</LinePriceExclTax> <ColorName /> <UOM>Ea</UOM> <Backorder> 0.0000000</Backorder> <INVENTTRANSID> CAP5637549_060</INVENTTRANSID> </Line> <Line> <SupplierID>Waltons</SupplierID> <InvoiceID>CAP600795SI</InvoiceID> <InvoiceDate>20100506</InvoiceDate> <ItemID>801215</ItemID> <ColorID /> <Description>MONDI ROTATRIM Copy Paper A4 80Gsm White</Description> <MainCategory>A4 Paper</MainCategory> <SubCategory>White Bond Paper</SubCategory> <LineNum> 5.0000000</LineNum> <Qty> 100.0000000</Qty> <UnitPriceExclTax> 29.0100000</UnitPriceExclTax> <LineTax> 406.1400000</LineTax> <LinePriceExclTax> 2901.0000000</LinePriceExclTax> <ColorName /> <UOM>Pkt 500</UOM> <Backorder> 0.0000000</Backorder> <INVENTTRANSID> CAP5637552_060</INVENTTRANSID> </Line> <Line> <SALESID> CAP716197SO</SALESID> <INVOICEID> CAP600795SI</INVOICEID> <INVOICEDATE>2010/05/06</INVOICEDATE> <NUMBERSEQUENCEGROUP /> <LINENUM> 2.0000000</LINENUM> <ITEMID>805236</ITEMID> <INVENTDIMID> CAP0000594_061</INVENTDIMID> <NAME>Ruled Paper A4 Fnt/Marg JD76</NAME> <CONFIRMEDDLV>2010/05/06</CONFIRMEDDLV> <INVENTTRANSID> CAP5637543_060</INVENTTRANSID> <QTYSALES> 4.0000000</QTYSALES> <QTYORDERED> 4.0000000</QTYORDERED> <QTYBACKORDERSALES> 4.0000000</QTYBACKORDERSALES> <QTYBACKORDERINVENT> 4.0000000</QTYBACKORDERINVENT> <SALESUNIT>EA</SALESUNIT> <ORIGSALESID> CAP716197SO</ORIGSALESID> <DATAAREAID>wal</DATAAREAID> <RECID>622392608</RECID> <RecVersion>1</RecVersion> </Line> <Line> <SALESID> CAP716197SO</SALESID> <INVOICEID> CAP600795SI</INVOICEID> <INVOICEDATE>2010/05/06</INVOICEDATE> <NUMBERSEQUENCEGROUP /> <LINENUM> 3.0000000</LINENUM> <ITEMID>941150</ITEMID> <INVENTDIMID> CAP0000594_061</INVENTDIMID> <NAME>PENGUIN Correction Fluid 20ml White</NAME> <CONFIRMEDDLV>2010/05/06</CONFIRMEDDLV> <INVENTTRANSID> CAP5637546_060</INVENTTRANSID> <QTYSALES> 6.0000000</QTYSALES> <QTYORDERED> 6.0000000</QTYORDERED> <QTYBACKORDERSALES> 6.0000000</QTYBACKORDERSALES> <QTYBACKORDERINVENT> 6.0000000</QTYBACKORDERINVENT> <SALESUNIT>EA</SALESUNIT> <ORIGSALESID> CAP716197SO</ORIGSALESID> <DATAAREAID>wal</DATAAREAID> <RECID>622392609</RECID> <RecVersion>1</RecVersion> </Line> </XML> I can use XSLT 1 or 2 Regards,

    Read the article

  • SortList duplicated key, but it shouldn't

    - by Luca
    I have a class which implements IList interface. I requires a "sorted view" of this list, but without modifying it (I cannot sort directly the IList class). These view shall be updated when the original list is modified, keeping items sorted. So, I've introduced a SortList creation method which create a SortList which has a comparer for the specific object contained in the original list. Here is the snippet of code: public class MyList<T> : ICollection, IList<T> { ... public SortedList CreateSortView(string property) { try { Lock(); SortListView sortView; if (mSortListViews.ContainsKey(property) == false) { // Create sorted view sortView = new SortListView(property, Count); mSortListViews.Add(property, sortView); foreach (T item in Items) sortView.Add(item); } else sortView = mSortListViews[property]; sortView.ReferenceCount++; return (sortView); } finally { Unlock(); } } public void DeleteSortView(string property) { try { Lock(); // Unreference sorted view mSortListViews[property].ReferenceCount--; // Remove sorted view if (mSortListViews[property].ReferenceCount == 0) mSortListViews.Remove(property); } finally { Unlock(); } } protected class SortListView : SortedList { /// <summary> /// /// </summary> /// <param name="property"></param> /// <param name="capacity"></param> public SortListView(string property, int capacity) : base(new GenericPropertyComparer(typeof(T).GetProperty(property, BindingFlags.Instance | BindingFlags.Public)), capacity) { } /// <summary> /// Reference count. /// </summary> public int ReferenceCount = 0; /// <summary> /// /// </summary> /// <param name="item"></param> public void Add(T item) { Add(item, item); } /// <summary> /// /// </summary> /// <param name="item"></param> public void Remove(T item) { // Base implementation base.Remove(item); } /// <summary> /// Compare object on a generic property. /// </summary> class GenericPropertyComparer : IComparer { #region Constructors /// <summary> /// Construct a GenericPropertyComparer specifying the property to compare. /// </summary> /// <param name="property"> /// A <see cref="PropertyInfo"/> which specify the property to be compared. /// </param> /// <remarks> /// The <paramref name="property"/> parameter imply that the compared objects have the specified property. The property /// must be readable, and its type must implement the IComparable interface. /// </remarks> public GenericPropertyComparer(PropertyInfo property) { if (property == null) throw new ArgumentException("property doesn't specify a valid property"); if (property.CanRead == false) throw new ArgumentException("property specify a write-only property"); if (property.PropertyType.GetInterface("IComparable") == null) throw new ArgumentException("property type doesn't IComparable"); mSortingProperty = property; } #endregion #region IComparer Implementation public int Compare(object x, object y) { IComparable propX = (IComparable)mSortingProperty.GetValue(x, null); IComparable propY = (IComparable)mSortingProperty.GetValue(y, null); return (propX.CompareTo(propY)); } /// <summary> /// Sorting property. /// </summary> private PropertyInfo mSortingProperty = null; #endregion } } /// <summary> /// Sorted views of this ReactList. /// </summary> private Dictionary<string, SortListView> mSortListViews = new Dictionary<string, SortListView>(); } Practically, class users request to create a SortListView specifying the name of property which determine the sorting, and using the reflection each SortListView defined a IComparer which keep sorted the items. Whenever an item is added or removed from the original list, every created SortListView will be updated with the same operation. This seems good at first chance, but it creates me problems since it give me the following exception when adding items to the SortList: System.ArgumentException: Item has already been added. Key in dictionary: 'PowerShell_ISE [C:\Windows\sysWOW64\WindowsPowerShell\v1.0\PowerShell_ISE.exe]' Key being added: 'PowerShell_ISE [C:\Windows\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe]' As you can see from the exception message, thrown by SortedListView.Add(object), the string representation of the key (the list item object) is different (note the path of the executable). Why SortList give me that exception? To solve this I tried to implement a GetHashCode implementation for the underlying object, but without success: public override int GetHashCode() { return ( base.GetHashCode() ^ mApplicationName.GetHashCode() ^ mApplicationPath.GetHashCode() ^ mCommandLine.GetHashCode() ^ mWorkingDirectory.GetHashCode() ); }

    Read the article

  • avoid duplication with auto increment key in Hibernate

    - by Lily
    I am trying to use Hibernate to auto increment the id, however, I try to avoid duplication. class Service { Long id; // auto increment String name; String owner; // setter and getter } What I want to achieve is, whenever name and owner are the same, it will be a duplicated entry. In this case, I don't want to add another entry into the Database anymore. How to revise the hbm.xml files to avoid this issue?

    Read the article

  • R get rid of rows with duplicate attribute

    - by CatholicEvangelist
    hi there I have a big dataframe with columns such as: ID, time, OS, IP Each row of that dataframe corresponds to one entry. Within that dataframe for some IDs serveral entries (rows) exist. I would like to get rid of those multiple rows (obviously the other attributes will differ for the same ID). Or put different: I only want one single entry (row) for each ID. Could anyone be so kind and help me out on this one? When I use unique, on the ID column, I only recieve the levels (or each unique ID), but I want to keep the other attributes as well... I have tried to use apply(x,2,unique(data$ID)), but this does not work either... Any help is highly appreciated!

    Read the article

  • Create "duplicate copy" of github repository

    - by user1483934
    I see answers to similar questions and I'm sure I may just not be familiar enough with Git and Github terminology to know if they apply to my question. What I need to do is to clone an existing Github remote repository (a private repo under another person's username that I have contributor access to) and create a new private remote repo under my account. The existing repo user is going to make significant alterations to the repo, delete, and re-push, before they do that they want me to clone and create a duplicate so we can continue working from the repo under my user. I want to preserve the commit history with the repo if possible. I've cloned locally but don't can't seem to figure out how to push it to a new remote that isn't origined to the original user.

    Read the article

  • Prevent duplicate entries in arraylist

    - by timyh
    Say I create some object class like so public class thing { private String name; private Integer num; public oDetails (String a, Integer b) { name = a; num = b; } ...gets/ sets/ etc Now I want to create an arraylist to hold a number of this object class like so. ArrayList<thing> myList = new ArrayList<thing>; thing first = new thing("Star Wars", 3); thing second = new thing("Star Wars", 1); myList.add(first); myList.add(second); I would like to include some sort of logic so that in this case...when we try and add object "second" rather than add a new object to the arrayList, we add second.getNum() to first.getNum(). So if you were to iterate through the ArrayList it would be "Star Wars", 4 I am having trouble coming up with an elegant way of handling this. And as the arraylist grows, searching through it to determine if there are duplicate name items becomes cumbersome. Can anyone provide some guidance on this?

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >