Search Results

Search found 4640 results on 186 pages for 'unique'.

Page 122/186 | < Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >

  • How do I filter or retain duplicates in Perl?

    - by manu
    I have one text string which is having some duplicate characters (FFGGHHJKL). These can be made unique by using the positive lookahead: $ perl -pe 's/(.)(?=.*?\1)//g'] For example, with "FFEEDDCCGG", the output is "FEDCG". My question is how to make it work on the numbers (Ex. 212 212 43 43 5689 6689 5689 71 81 === output should be 212 43 5689 6689 71 81) ? Also if we want to have only duplicate records to be given as the output from a file having n rows 212 212 43 43 5689 6689 5689 71 81 66 66 67 68 69 69 69 71 71 52 .. Output: 212 212 43 43 5689 5689 66 66 69 69 69 71 71 How can I do this?

    Read the article

  • Stacking multiple slideshows using Jquery

    - by plasticletter
    Hi, JQuery newbie here! I'm having difficulty stacking more than one slideshow with each it's own individual controls. The one slideshow works just fine. However, when I add another slideshow I lose the controls and title for that one. link: http://dl.dropbox.com/u/1466448/numbered/stack.html I read on other related posts about using a unique ID for each slideshow but I have very limited experience in jquery to understand that approach. Any help would be greatly appreciated. Thanks! -Thai

    Read the article

  • update dialog title for each click

    - by Scarface
    Hey guys I have a quick question, I have a dialog box that has multiple links with different attributes. Each time a link is clicked, the attribute src is printed inside of the dialog box so that each link has a unique output in the dialog. My problem is simply that only the first src title is in every box and I would like to change that as well with each click. I separated the line containing title to show the problem. If anyone has any ideas I would appreciate it. <a class="open" src="something" title="Click to play">link</a> <a class="open" src="something else" title="Click to play">link2</a> $('.open').click(function() { src=$(this).attr('src'); $('#show').html(''+src+''); $(\"#show\").dialog({hide: 'clip', width: 400,height: 150,position: 'center', show: 'clip',stack: true,title: ''+src+'', minHeight: 25, minWidth: 100, autoOpen: false,resizable:false}); $('#show').dialog('open'); })

    Read the article

  • RESTful web service, PUTting an unnamed resource?

    - by James L
    I have a back-end service that creates unique identifiers for resources. The general idea is that resources are saved and versioned, so you can perform: GET http://service/sales/targets/7818181919/latest or GET http://service/sales/targets/7818181919/4 for version 4, and so on. My question is about the most correct way to upload these resources in the first place. How about: PUT http://service/sales/targets/ returning 303 See other /service/sales/targets/ It seems a little wrong as you should PUT and GET from exactly the same place using a resource-oriented interface, but I can't think of a better option. Any ideas?

    Read the article

  • how to check if entity already exists in database before inserting in doctrine?

    - by fayer
    whenever i insert a entity that already exists in database (i have a unique constraint on email) i get an error message on the screen. so i want to check if it already exists, if not i insert it. at the moment it looks like this: $q = Doctrine_Query::create() ->from('User u') ->where('u.email = ?', $email); $object = $q->fetchOne(); if( ! is_object($object)) { $user = new User(); $user-email = $email; $user->save(); } i wonder, if there an easier way to do this? thanks

    Read the article

  • comparing rows on a mysql table

    - by user311324
    Ok here's the deal I got one table with a bunch of client information. Each client makes up to one purchase a year which is represented by an individual row. there's a column for the year and there's a column the contains a unique identifier for each client. What I need to do is to construct a query that takes last year and this year and shows me which clients were here made a purchase last year but not make a purchase this year. I also need to build a query that shows me which clients did not make a purchase last year and the year before last but did make a purchase this year.

    Read the article

  • It is the arranging game in which

    - by bachchan
    1 2 3 13 5 4 7 10 6 14 11 9 8 15 12 1.Every time when we refresh the page the numbers in the cells will change but the These numbers will remain unique n from 1 to 15 2.Whenever we double click the number in the cell which is surrounded the empty cell then it will replace the empty cell with that number n that number cell become empty. 3.If we double click the cell which is not surrounded the empty cell then it will not replace the empty cell. 4.e.g. if we click 8 then it will not move to empty cell But if we click either 13, 7 , or 11 then it will move to empty cell 5.And every time when we click the cell it’s num color will change for a moment

    Read the article

  • Create set of random JPGs

    - by Kylar
    Here's the scenario, I want to create a set of random, small jpg's - anywhere between 50 bytes and 8k in size - the actual visual content of the jpeg is irrelevant as long as they're valid. I need to generate a thousand or so, and they all have to be unique - even if they're only different by a single pixel. Can I just write a jpeg header/footer and some random bytes in there? I'm not able to use existing photos or sets of photos from the web. The second issue is that the set of images has to be different for each run of the program. I'd prefer to do this in python, as the wrapping scripts are in Python. I've looked for python code to generate jpg's from scratch, and didn't find anything, so pointers to libraries are just as good.

    Read the article

  • Grails searchable plugin with hasMany

    - by user2624442
    I am using grails searchable plugin to search my domain classes. However, I cannot yet search by my hasMany (skills and interests) fields even though they are of the simple type String. This is my domain class: class EmpactUser { static searchable = [except: ['dateCreated','password','enabled','accountExpired','accountLocked','passwordExpired']] String username String password boolean enabled = true boolean accountExpired boolean accountLocked boolean passwordExpired String email String firstName String lastName String address String phoneNumber String description byte[] avatar byte[] resume Date dateCreated static hasMany = [ skills : String, interests : String, // each user has the ability to list many skills and interests so that they can be matched with a project. ] static constraints = { username blank: false, unique: true password blank: false email email: true, blank: false firstName blank: false lastName blank: false description nullable: true address nullable: true avatar nullable: true, maxSize: 1024 * 1024 * 10 resume nullable: true, maxSize: 1024 * 1024 * 10 phoneNumber nullable: true, matches: "/[(][+]d{3}[)]d+/", maxSize: 30 } } This is the code I am using to search: def empactUserList = EmpactUser.search( searchQuery, [reload: false, result: "every", defaultOperator: "or"]) Am I missing something? Thanks, Alan.

    Read the article

  • Scalable stl set like container for C++

    - by Pqr
    Hi, I need to store large number of integers. There can be duplicates in the input stream of integers, I just need to store distinct amongst them. I was using stl set initially but It went OutOfMem when input number of integers went too high. I am looking for some C++ container library which would allow me to store numbers with the said requirement possibly backed by file i.e container should not try to keep all numbers in-mem. I don't need to store this data persistently, I just need to find unique values amongst it.

    Read the article

  • How to join the results of two tables in django python

    - by user1787524
    I have two models class Weather(model.model): region = models.ForeignKey(Region) district = models.ForeignKey(District) temp_max = models.IntegerField(blank=True, null=True, verbose_name='Max temperature (C)') temp_min = models.IntegerField(blank=True, null=True, verbose_name='Min temperature (C)') and class Plan(model.model): name = tinymce_models.HTMLField(blank=True, null=True) region = models.ForeignKey(Region) district = models.ForeignKey(District) Provided for every region and district have unique row. I want to combine the result so that i can get all the columns of both tables These two Models are not related to each other. ' I need to make the join like join weather w on w.region = A.region and w.distric = A.district so that result contains all the columns in everyobject like obj.temp_max etc

    Read the article

  • MySQL UPDATE WHERE IN for each listed value separately?

    - by Tom
    Hi, I've got the following type of SQL: UPDATE photo AS f LEFT JOIN car AS c ON f.car_id=c.car_id SET f.photo_status=1 , c.photo_count=c.photo_count+1 WHERE f.photo_id IN ($ids) Basically, two tables (car & photo) are related. The list in $ids contains unique photo ids, such as (34, 87, 98, 12). With the query, I'm setting the status of each photo in that list to "1" in the photo table and simultaneously incrementing the photo count in the car table for the car at hand. It works but there's one snag: Because the list can contain multiple photo ids that relate to the same car, the photo count only ever gets incremented once. If the list had 10 photos associated with the same car, photo_count would become 1 .... whereas I'd like to increment it to 10. Is there a way to make the incrementation occur for each photo individually through the join, as opposed to MySQL overthinking it for me? I hope the above makes sense. Thanks.

    Read the article

  • Both sql LAST_INSERT_ID() and PHP insert_id return 0

    - by jakubplus
    I've been searching google a lot for this issue and really found nothing. People just keep copying MySQL documentation on last_insert_id and nothing else. I've got an issue regarding last_insert_id, because for both situations (php & sql) it returns 0. YES: I've set a PRIMARY & UNIQUE field with AUTO_INCREMENT value YES: i've done some inserting before NO: Making double query with INSERT AND SELECT LAST... doesn't work. I've created a class Db for maintaining connection & query: class Db { public function connect() { $db = new mysqli('','','','',''); ... return $db; } public function insert() { $this->connect()->query("INSERT INTO bla bla..."); return $this->connect()->insert_id; } } And it doesn't work.

    Read the article

  • Using regex to strip out certain data from HTML code via PHP

    - by Chris
    I have the following HTML snippet <tr> <td class="1">...</td> <td class="2">...</td> <td class="3">...</td> <td class="4">...</td> </tr> etc... I basically have N rows, and each row contains 4 TD's each with a unique class. I would like a simple way to split out all the rows and TD's by class so I can choose what data I want to use. I expect the easiest way to achieve this would be regex (maybe two). One to split up the TR's then another to split up the TDs (by class preferably) Thanks

    Read the article

  • Get params value from component Joomla 3.0

    - by yogeshK
    I have saved value like this in my component table fields params. unique=1 default_value=Default validate=Validate validate_error_msg=Validate error messag searchable=1 Now i want to get value in my component.So I am passing values in my component's view.html.php in this way $params = new JForm($row->params); but its not working. Now I want to get value so I am taking like this $this->params->getValue('default_value'); But its not work where as in Joomla 2.5 ,we can get value like this $this->params->get('default_value');

    Read the article

  • What is the difference between "a is b" and "id(a) == id(b)" in Python?

    - by bp
    The id() inbuilt function gives... an integer (or long integer) which is guaranteed to be unique and constant for this object during its lifetime. The is operator, instead, gives... object identity So why is it possible to have two objects that have the same id but return False to an is check? Here is an example: >>> class Test(): ... def test(): ... pass >>> a = Test() >>> b = Test() >>> id(a.test) == id(b.test) True >>> a.test is b.test False A more troubling example: (continuing the above) >>> b = a >>> b is a True >>> b.test is a.test False >>> a.test is a.test False

    Read the article

  • OneToMany association updates instead of insert

    - by Shvalb
    I have an entity with one-to-many association to child entity. The child entity has 2 columns as PK and one of the column is FK to the parent table. mapping looks like this: @OneToMany(cascade = {CascadeType.ALL}, fetch = FetchType.EAGER ) @JoinColumn(name="USER_RESULT_SEQUENCES.USER_RESULT_ID", referencedColumnName="USER_RESULT_ID", unique=true, insertable=true, updatable=false) private List<UserResultSequence> sequences; I create an instance of parent and add children instances to list and then try to save it to DB. If child table is empty it inserts all children and it works perfectly. if the child table is not empty it updates existing rows! I don't know why it updates instead of inserts, any ideas why this might happen?? Thank you!

    Read the article

  • HTML anchor #bottom, only going half-way down page

    - by RewbieNewbie
    http://www.planet-tolkien.com/board/44/621/0/poll-suggestions It's due to the multiple "bottom of the page" anchor links on each post to the anchor name at the bottom of the page. I tried to solve this by using a unique id and name for the attributes: <a href="#bottom" id="4656" name="4656"> But this hasn't worked. Suggestions? P.S. Don't use the URL bar, yes that works. Visit the page and click on a link in a post that says "Bottom of the page". This is where it isn't working.

    Read the article

  • Calculating similarites between sentences

    - by codecreator
    I have datbase with thousands of rows of error logs and their description.This error log is for an application that running 24/7. I want to create a dashboard/UI to view the current common errors happening for prodcution support. The problem I am having is that even though there are lot of common errors, the error description differs by the transcation ID or user ID or things that are unique for that sigle prcoess. e.g Error trasaction XYz failed for user 233 e.g 2. Error trasaction XYz failed for user 567 I consider these two erros to be same. So I want to a program that will go through the new error logs and classify them into groups. I am trying to use "edit distance" but its very slow.Since I alraedy have old error logs, i am trying to think of solutions using that information too. Any thoughts?

    Read the article

  • C# How to Identify Caller for Template Events

    - by mikeknoop
    I have a ListBox container data bound and templatized as so: <ListBox x:Name="ListBox" ItemsSource="{Binding Source={StaticResource List}}" ItemTemplate="{StaticResource ListTemplate}"> </ListBox> Within my ListTemplate resource, I define a Grid which contains a few child elements. I have setup a click event handler on one of child elements. The event hander is not row-specific, and I need a (best practice) way of identifying which row in the ListBox the event fired upon. From my data source, I have an unique ID which corresponds to the row. I do not currently expose this ID in the data binding, though could. Ideally I would like the event handler to be able to identify the ID of the row the event was fired upon. Thank you!

    Read the article

  • Sphinx without using an auto_increment id

    - by squeeks
    I am current in planning on creating a big database (2+ million rows) with a variety of data from separate sources. I would like to avoid structuring the database around auto_increment ids to help prevent against sync issues with replication, and also because each item inserted will have a alphanumeric product code that is guaranteed to be unique - it seems to me more sense to use that instead. I am looking at a search engine to index this database with Sphinx looking rather appealing due to its design around indexing relational databases. However, looking at various tutorials and documentation seems to show database designs being dependent on an auto_increment field in one form or another and a rather bold statement in the documentation saying that document ids must be 32/64bit integers only or things break. Is there a way to have a database indexed by Sphinx without auto_increment fields as the id?

    Read the article

  • Duplicate / Copy records in the same MySQL table

    - by Digits
    I have been looking for a while now but I can not find an easy solution for my problem. I would like to duplicate a record in a table, but of course, the unique primary key needs to be updated. I have this query: INSERT INTO invoices SELECT * FROM invoices AS iv WHERE iv.ID=XXXXX ON DUPLICATE KEY UPDATE ID = (SELECT MAX(ID)+1 FROM invoices) the problem is that this just changes the ID of the row instead of copying the row. Does anybody know how to fix this ? Thank you verrry much, Digits //edit: I would like to do this without typing all the field names because the field names can change over time.

    Read the article

  • How to do a for loop in windows command line?

    - by TheFoxx
    I was wondering if this was possible? I'm not familiar with using windows command line, but I have to use it for a project I'm working on. I have a a number of files, for which I need to perform a function for each. I'm used to working with python, but obviously this is a bit different, so I was hoping for some help. Basically I need the for loop to iterate through 17 files in a folder, perform a function on each (that's using the specific software I have here for the project) and then that will output a file with a unique name (the function normally requires me to state the output file name) I would suck it up and just do it by hand for each of the 17, but basically it's creating a database of a file, and then comparing it to each of the 17. It needs to be iterated through several hundred times though. Using a for loop could save me days of work. Suggestions?

    Read the article

  • jquery add remove objects

    - by Scarface
    Hey guys quick question, I have an add remove script that will add a unique element and should remove it on a click function but does not. I think it is because the added object is not in the DOM when page is loaded but I am not sure how to fix this. IF anyone has any advice I would greatly appreciate it. $(document).ready(function(){ if (action=='content-change'){ $('#droppable2-inner').empty().append('<div id="content-image"><img id="visual-background2" src=' + src + '></div><div id="drop-content" action="drop-image">x</div>'); } $("#drop-content").click(function() { $('#content-image').remove(); }); })

    Read the article

  • GIT sharing configuration data

    - by user569980
    Hi, I just started using GIT for my versioning and I want to program some tools that work on top of it. Here is my question: Which information in the .git/config is shared to a remote repo? Is any? Is there a special way to push information to that repo? The reason I am asking is that I would like to add a "unique stamp" to the config of a repo. Also the remote repo and everybody pulling that project should have the stamp. Is that possible? If not, is there any other way to identify a repository? Having a .git folder, I want to decide whether this git repo is the same as a previously specified remote repo (the same means created by pulling the remote repo, changes are okay, of course).

    Read the article

< Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >