Search Results

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

Page 25/36 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • Mod_Rewrite: Insert "/" between variables and values in URL

    - by Abs
    Hello all, I am attempting clean useful URLs using mod_rewrite. I am sure this is a common question but I am not so hot with mod_rewrite: I have this URL: http://mysite.com/user.php?user=fatcatmat&sort=popularv I want to be able to rewrite it like this: http://mysite.com/user/user/fatcatmat/sort/popularv (Is there a way to remove duplicates in a URL?) I think I have managed to do the removal of the PHP extension. RewriteRule ^(.*)\$ $1.php [nc] Is the above correct? For the separate pages, I would have something like this. RewriteRule ^/?user(/)?$ user.php Main Question: Its a bit tedious to do all the above but is there a MEGA rewrite rule that will just place "/" in between variables and their values and remove the .php extension from all pages? Thank you for any help.

    Read the article

  • Css Multiple background-color

    - by Khanh TO
    I'm a novice in Css and it's difficult to search for this specific case on the internet, so I post a question here. I'm working on an existing code base and I see something like this. li { background-color: #000 \9; background-color: rgba(0, 0, 0, 0); } I don't understand the meaning of \9. But it looks to me they are duplicates and I should remove one of them. Could you please explain the \9 and should I remove one of them? Thanks.

    Read the article

  • How to search for duplicate values in a huge text file having around Half Million records

    - by Shibu
    I have an input txt file which has data in the form of records (each row is a record and represents more or less like a DB table) and I need to find for duplicate values. For example: Rec1: ACCOUNT_NBR_1*NAME_1*VALUE_1 Rec2: ACCOUNT_NBR_2*NAME_2*VALUE_2 Rec3: ACCOUNT_NBR_1*NAME_3*VALUE_3 In the above set, the Rec1 and Rec2 are considered to be duplicates as the ACCOUNT NUMBERS are same(ACCOUNT_NBR1). Note: The input file shown above is a delimiter type file (the delimiter being *) however the file type can also be a fixed length file where each column starts and ends with a specified positions. I am currently doing this with the following logic: Loop thru each ACCOUNT NUMBER Loop thru each line of the txt file and record and check if this is repeated. If repeated record the same in a hashtable. End End And I am using 'Pattern' & 'BufferedReader' java API's to perform the above task. But since it is taking a long time, I would like to know a better way of handling it. Thanks, Shibu

    Read the article

  • What's a unit test? [closed]

    - by Tyler
    Possible Duplicates: What is unit testing and how do you do it? What is unit testing? I recognize that to 95% of you, this is a very WTF question. So. What's a unit test? I understand that essentially you're attempting to isolate atomic functionality but how do you test for that? When is it necessary? When is it ridiculous? Can you give an example? (Preferably in C? I mostly hear about it from Java devs on this site so maybe this is specific to Object Oriented languages? I really don't know.) I know many programmers swear by unit testing religiously. What's it all about? EDIT: Also, what's the ratio of time you typically spend writing unit tests to time spent writing new code?

    Read the article

  • Correct way to add objects to an ArrayList

    - by ninjasense
    I am trying to add an object to an arraylist but when I view the results of the array list, it keeps adding the same object over and over to the arraylist. I was wondering what the correct way to implement this would be. public static ArrayList<Person> parsePeople(String responseData) { ArrayList<Person> People = new ArrayList<Person>(); try { JSONArray jsonPeople = new JSONArray(responseData); if (!jsonPeople.isNull(0)) { for (int i = 0; i < jsonPeople.length(); i++) { Person.add(new Person(jsonPeople.getJSONObject(i))); } } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { } return People; } I have double checked my JSONArray data and made sure they are not duplicates. It seems to keep adding the first object over and over.

    Read the article

  • Command Query Separation validating for retries

    - by Neil Barnwell
    So I'm comfortable with the basic concept of CQS, where you might have a command that writes to one database, and that updates the query database that you read from. However, consider the scenario where you are entering data, and want to prevent duplicates. Using new employee data entry an employee register as an example, working through a pile of application forms to key in the new employees' details: Take top sheet. Key in employee name and unique payroll number to UI. Submit. Put paper in "completed pile". Repeat. How would you now prevent the user from keying in the same payroll number again, say for instance if they get distracted and can't remember whether they've keyed one in already and the "message" hasn't got all the way back to the query db for the user to search?

    Read the article

  • Grails Unique Constraint for Groups

    - by WaZ
    Hi there, I have the following requirement I have 3 domains namely: class Product { String productName static constraints = { productName(unique:true,blank:false) } class SubType { String subTypeName static constraints = { subTypeName(unique:true,blank:false) } String toString() { "${subTypeName}" } } class CLType { String TypeName static belongsTo = Car static hasMany = [car:Cars] static constraints = { } String toString() { "${TypeName}" } class CLines implements Serializable { Dealer dealer CLType clType SubType subType Product product static constraints = { dealer(nullable:false,blank:false,unique:['subType','product','clType']) clType(blank:false,nullable:false) subType(nullable:true) product(nullable:true) } } I want to achieve this combination: A user can assign dealer a CLType. But cannot have duplicates. As an example consider this scenario Please let me know what to mention in my unqiue constraint to make this possible? Thanks, Much Appreciated.

    Read the article

  • How to quantify your "slow" development machine?

    - by lance
    ( Please provide the question this one duplicates. I'm disappointed I couldn't find it. ) My development machine is "slow". I wait on it "a lot". I've been asked by decision makers who want to help to fairly and accurately measure that time. How do you quantify the amount of time you spend waiting on the computer (during compiles, waiting for apps to open every day, etc). Is there software which effectively reports on this sort of thing? Is there an OS metric (I/O something something, pagefile swapping frequency, etc, etc) that captures and communicates this particularly well? Some sort of benchmark you'd recommend me testing against?

    Read the article

  • What are the common patterns in web programming?

    - by lankerisms
    I have been trying to write my first big web app (more than one cgi file) and as I kept moving forward with the rough prototype, paralelly trying to predict more tasks, this is the todo that got accumulated (In no particular order). * Validations and input sanitizations * Object versioning (to avoid edit conflicts. I dont want hard locks) * Exception handling * memcache * xss and injection protections * javascript * html * ACLs * phonetics in search, match and find duplicates (for form validation) * Ajaxify!!! (I have snipped off the project specific items.) I know that each todo will be quite tied up to its project and technologies used. What I am wondering though, is if there is a pattern in your todo items as well as the sequence in which you experienced guys have come across them.

    Read the article

  • Using Angularjs with server side templates

    - by codecollision
    For SEO purposes the server renders out the full html template for a given URL on initial load. The site uses angularjs which detects the URL route and renders a client template from the JSON API. For example, you navigate to: /blog/post-title Server responds with post-title content. Angular loads, detects route: /blog/:post_slug and begins to load JSON and render client side template from response. Obviously what Angular does is fine when links are followed after the initial load, but on first load it duplicates effort. My question is if there is a clean way to prevent this situation.

    Read the article

  • How to remove duplicate records in a table?

    - by Mason Wheeler
    I've got a table in a testing DB that someone apparently got a little too trigger-happy on when running INSERT scripts to set it up. The schema looks like this: ID UNIQUEIDENTIFIER TYPE_INT SMALLINT SYSTEM_VALUE SMALLINT NAME VARCHAR MAPPED_VALUE VARCHAR It's supposed to have a few dozen rows. It has about 200,000, most of which are duplicates in which TYPE_INT, SYSTEM_VALUE, NAME and MAPPED_VALUE are all identical and ID is not. Now, I could probably make a script to clean this up that creates a temporary table in memory, uses INSERT .. SELECT DISTINCT to grab all the unique values, TRUNCATE the original table and then copy everything back. But is there a simpler way to do it, like a DELETE query with something special in the WHERE clause?

    Read the article

  • Duplicate a database record with linq

    - by holz
    Is there a way to duplicate a db record with linq to sql in c#? Id [int] IDENTITY(1,1) NOT NULL PRIMARY KEY, [Foo] [nvarchar](255) NOT NULL, [Bar] [numeric](28,12) NOT NULL, ... Given the table above, I would like to duplicate a record (but give it a different id), in a way that new fields added to the DB and the Linq dbml file at a later date will still get duplicated with out having to change that code that duplicates the record. ie I don't want to write newRecord.Foo = currentRecord.Foo; for all of the fields on the table.

    Read the article

  • scripting subtlties [closed]

    - by jpmyob
    Possible Duplicates: When to use anonymous JavaScript functions? Is there any difference between var name = function() {} & function name() {} in Javascript? in javascript (and other scripting languages) what is the 'real' difference between these two syntax: a) function myFun(x) { yadda yadda } b) myFun(x) = function { yadda yadda } to a casual observer - no 'real' difference - you still call either as myFun()...and they still return the same thing, so if reference and return are identical - is it a preference or is there some difference in the code parsing engine that treats these two differently - and if so - when would you use one over the other???

    Read the article

  • What is the most effective and flexible way to generate combinations in TSQL?

    - by SDReyes
    What is the most effective and flexible way to generate combinations in TSQL? With 'Flexible', I mean you should be able to add easily combination rules. e.g.: to generate combinatories of 'n' elements, sorting, remove duplicates, get combinatories where each prize belongs to a different lottery, etc. For example, Having a set of numbers representing lottery prizes. Number | Position | Lottery --------------------------- 12 | 01 | 67 12 | 02 | 67 34 | 03 | 67 43 | 01 | 89 72 | 02 | 89 33 | 03 | 89 (I include the position column because, a number could be repeated among different lottery's prizes) I would like to generate combinatories like: Numbers | Lotteries ------------------- 12 12 | 67 67 12 34 | 67 67 12 34 | 67 67 12 43 | 67 89 12 72 | 67 89 12 33 | 67 89 . . .

    Read the article

  • Learning CSS - What is the BEST ONLINE RESOURCE?

    - by Chris Jacob
    The Goal: Use votes to rank nominated sites. The first answer to reach 100+ votes will be accepted. Please answer following these 5 simple rules: ONE SITE per answer. Link to each page if nominating a "series" of resources on a SITE. No "offline" books. Only online resources (tutorials, API references, blogs, screencasts, etc). Don't add "subjective" details/notes in your answer. Add them as a comment to the answer. Don't post duplicates. If your favourite is already listed Up Vote It! Example Answer: Site Name http://www.example.com Example Answer (site with a series of resources): Site Name http://www.example.com Series Name A http://www.example.com/video/a/1 http://www.example.com/video/a/2 Series Name B http://www.example.com/video/b/1

    Read the article

  • Sorting 1 million 8-digit numbers in 1MB of RAM

    - by Favourite Chigozie Onwuemene
    I have a computer with 1M of RAM and no other local storage. I must use it to accept 1 million 8-digit decimal numbers over a TCP connection, sort them, and then send the sorted list out over another TCP connection. The list of numbers may contain duplicates, which I must not discard. The code will be placed in ROM, so I need not subtract the size of my code from the 1M. I already have code to drive the ethernet port and handle TCP/IP connections, and it requires 2k for its state data, including a 1k buffer via which the code will read and write data. Is there a solution to this problem?

    Read the article

  • Which method of adding items to the ASP.NET Dictionary class is more efficient?

    - by ahmd0
    I'm converting a comma separated list of strings into a dictionary using C# in ASP.NET (by omitting any duplicates): string str = "1,2, 4, 2, 4, item 3,item2, item 3"; //Just a random string for the sake of this example and I was wondering which method is more efficient? 1 - Using try/catch block: Dictionary<string, string> dic = new Dictionary<string, string>(); string[] strs = str.Split(','); foreach (string s in strs) { if (!string.IsNullOrWhiteSpace(s)) { try { string s2 = s.Trim(); dic.Add(s2, s2); } catch { } } } 2 - Or using ContainsKey() method: string[] strs = str.Split(','); foreach (string s in strs) { if (!string.IsNullOrWhiteSpace(s)) { string s2 = s.Trim(); if (!dic.ContainsKey(s2)) dic.Add(s2, s2); } }

    Read the article

  • What is the result of "new int[ 0 ]"? [closed]

    - by ArunSaha
    Possible Duplicates: What does zero-sized array allocation do/mean? C++ new int[0] — will it allocate memory? int * p; p = new int[ 0 ]; What is the expected outcome when new is called for zero number of elements? Is the outcome defined or undefined? Further, is it okay to call delete [] p; on that pointer? What is the intuition/analogy to this situation of pointer to an array of zero elements? Thanks in advance. Regards, Arun

    Read the article

  • Does duplicate id's screw up jquery selectors?

    - by Matt
    If I had two divs, both with id="myDiv" Would $("#myDiv").fadeOut(); fade both divs out? Or would it fade only the first/second? Or none at all? How do I change which one it fades out? Note: I know duplicate id's is against standards but I'm using the fancybox modal popup and it duplicates specified content on your page for the content of the popup. If anyone knows a way around this (maybe I'm using fancybox wrong) please let me know.

    Read the article

  • Distinct select on Oracle

    - by funktku
    What i am trying to do is a simple recommender , must take the biggest weighted top 40 element's node2 element. Calculation for weight comes from (E.WEIGHT * K.GRADE). Now this code succesfully returns top 40 elements. However, i don't want E.NODE2 to return duplicates. POSTGRE SQL allowed me to do SELECT DISTINCT ON (NODE2) E.NODE2 , (E.WEIGHT * K.GRADE). How can i do the same in oracle? The complete sql query; SELECT * FROM (SELECT DISTINCT E.NODE2 , (E.WEIGHT * K.GRADE) FROM KUAISFAST K, EDGES E WHERE K.ID = 1 AND K.COURSE_ID = E.NODE1 AND E.NODE2 NOT IN( SELECT K2.COURSE_ID FROM KUAISFAST K2 WHERE K2.ID = 1 ) ORDER BY( E.WEIGHT * K.GRADE ) DESC) TEMP WHERE rownum <= 40

    Read the article

  • Javascript or jquery replace text

    - by ngreenwood6
    I need to replace some text that is on the page within the body tag. I am using javascript but have jquery available if needed. I basically need to replace test® (test with the registered trademark) with TEST® or tests® with TESTS® and it could even be test with TEST® or tests with TESTS®. I am able to uppercase them but its not liking to work for me with the ® sign, it wants to put duplicates on ones that already have it. Basically anything on the page that has the word test or tests should be TEST® or TESTS® if it is plural. Any help is appreciated.

    Read the article

  • Filtering out unique rows in MySQL

    - by jpatokal
    So I've got a large amount of SQL data that looks basically like this: user | src | dst 1 | 1 | 1 1 | 1 | 1 1 | 1 | 2 1 | 1 | 2 2 | 1 | 1 2 | 1 | 3 I want to filter out pairs of (src,dst) that are unique to one user (even if that user has duplicates), leaving behind only those pairs belonging to more than one user: user | src | dst 1 | 1 | 1 1 | 1 | 1 2 | 1 | 1 In other words, pair (1,2) is unique to user 1 and pair (1,3) to user 2, so they're dropped, leaving behind only all instances of pair (1,1). Any ideas? The answers to the question below can find the non-unique pairs, but my SQL-fu doesn't suffice to handle the complication of requiring that they belong to multiple users as well. [SQL question] How to select non "unique" rows

    Read the article

  • Post-back + Page Refresh. Post/Redirect/Get pattern alternatives?

    - by Andrew Florko
    When user posts back a web form and then tries to refresh the page - dialog "would you like to resend information" pops up (Opera works silently though). To avoid this we can redirect browser to the page we'd like to show after postback. Now, when user refreshes the page, he duplicates get-request and no pop-ups. Everything is ok but post/redirect/get approach requires additional roundtrip. Is there better alternatives. Send form data with ajax aynchronously, for example? Thank you in advance!

    Read the article

  • MS Excel 03 - Deleting rows that have live string identifiers in column A, while concatenating other

    - by Justin
    I have this xml document that is provided as a data feed (right off the bat I can not modify the source of the data feed) and i import it into excel with the xml import. there is no schema that comes with this xml so i get a table that ends up having a whole bunch of duplicates for an identifier, because of the unique values spread throughout the spreadsheet. XML in XLS Col1(IDnum) Col2(name) Col3(Type) Col4(Category) Col(etc) ================================================================= 0011 Item 01 6B 0011 Item xxj9 7B 0011 Item xxj9 0011 Item 02 0011 Item 01 xxj9 6B 0012 etc I need to delete all rows where columnA string/number matches while concatenating all potential values from Col3, Col4 & Col5 together so it looks like this Col1(IDnum) Col2(name) Col3(Type) Col4(Category) Col(etc) ================================================================= 0011 Item 01, 02 xxj9 6B, 7B what visual basic method would allow me to accomplish this? thanks

    Read the article

  • ASP.NET MVC 2 Model object validation

    - by Jimmy
    Hey guys, I'm trying to validate a model object outside of the context of ModelState within a controller, I currently have a parser that creates model objects from an excel file and I want to be able to report how many entries were added to the database and how many failed, is there a way to validate a model object on its data annotations outside of model binding? I'm looking for something similar to the rails model method of model.valid? or a way for me to implement that myself. My current solution is just manually checking if a few key fields are present but this duplicates requirements between my model class and its metadata, there has to be a better way to hook into the model validation checking that is done by mvc 2. Thanks

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >