Search Results

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

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

  • MVC for web development: Sign-up form?

    - by incrediman
    How would I go about implementing a signup form using the MVC pattern for a website (I'm using PHP)? I think the controller should receive the POST data initially. Then probably some interation with the model might need to take place (if the user successfully signs up). Then I think the signup form view would be called, and a value would be passed in saying whether or not the signup was successful. Stuff I need help with: Where do I do input validation (ie. proper email address formatting)? How do I check to make sure the username is unique? Is the rest of my description alright? How would you go about doing an MVC website signup form?

    Read the article

  • SQL: joining multiples tables into one.

    - by Graveen
    I have 4 tables. r1, r2, r3 and r4. The table columns are the following: rId | rName I want to have, in fine, an unique table - let's call it R. Obviously, R will have the following structure: rTableName | rId | rName I'm looking for a solution, and the more natural for me is to: add a single column to all rX insert this column the table name i'm processing generate SQLs and concatenate them all Although I see exactly how to perform 1 and 3 with batching, editing, etc... (I have only to perform it once and for all), I don't see how to do the point 2: self-getting the tablename to insert into SQL. Have you an idea / or a different way to do that could solve my problem? Note: In fact, there are 250+ rX tables. That's why i can't do this manually. Note2: Precisely, this is with MySQL.

    Read the article

  • Indexing affects only the WHERE clause?

    - by andre matos
    If I have something like: CREATE INDEX idx_myTable_field_x ON myTable USING btree (field_x); SELECT COUNT(field_x), field_x FROM myTable GROUP BY field_x ORDER BY field_x; Imagine myTable with around 500,000 rows and most of field_x values being unique. Since I don't use any WHERE clause, will the created index have any effect at all in my query? Edit: I'm asking this question because I don't get any relevant difference between query-times before and after creating the index; They always take about 8 seconds (which, of course is too much time!). Is this behaviour expected?

    Read the article

  • Using 'ref code' related to the spinner option chosen

    - by user1508541
    I am trying to add a spinner function in a trial app which compares the frequency charts of earphones. I am trying to extract the info from " http://www.headphone.com/learning-center/build-a-graph.php " website. what I want to do is make the spinner work like the drop down list in the mentioned website. On further inspection what I found was that every dropdown element is provided with a unique code that is called when the particular element is selected. I need help in replicating the same in an android spinner.

    Read the article

  • Generate matrix with value flags

    - by pagid
    I do have a solution for the following problem but it's quite ugly and it can most likely be done in a much shorter way. Would be great to get your help. My input looks like this: C1 C2 A B B D D C A D and my output should look like this: A B C D 1 1 0 0 0 1 0 1 0 0 1 1 1 0 0 1 My current solution is: index <- unique(unlist(input[,1:2])) output <- matrix(0,nrows=dim(input),ncols=length(index)) for(i in 1:dim(input)) { output[i, input[i,]$C1] <- 1 output[i, input[i,]$C2] <- 1 } Of course 4-5 lines is actually fine - but even as an R beginner this doesn't feel right to use a for loop. Besides that my actual data has much more than two columns, therefore this doesn't look nice in the end. How would I do that in a smarter way? Cheers

    Read the article

  • One Database Field to Hold Survey Answer

    - by yar
    Skipping the question of whether this is bad design (and the question of why I would want/need to do this), I'm just wondering if my 'math' is right... I have n things that need to be put in order (n is always less than 5): thing1 thing2 thing3 ... and I'd like to store these results in a single integer for thing. My initial thought is that (obviously the code will not look like this): thing = thing1 * 1 + thing2 * 2 + thing3 * 4 + thing5 * 8 will always give me a unique value, and that any value for thing will always translate back to its values for thing1...thingn. Is this correct?

    Read the article

  • All PHP files getting hacked

    - by nsearle
    Hey All, Like always, just want to say thank you for all of the help and input in advance. I have a particular site that I am the web developer for and am running into a unique problem. It seems that somehow something is getting into every single PHP file on my site and adding some malware code. I have deleted the code from every page multiple times and changed FTP and DB passwords, but to no avail. The code that is added looks like this - eval(base64_decode(string)) - which the string is 3024 characters. Not sure if anyone else has ran into this problem or if any one has ideas on how I can secure my php code up. Thanks again.

    Read the article

  • Multiple repositories or single repository with branches?

    - by Goro
    I have been working on a project for some time, and it has branched off into several different versions. All versions have some common code base, and each version has specific functionality that is unique, and each version will need to be supported individually. What SVN structure would you recommend? Right now I am using a separate repository for each project, but the downside of that is that it is impractical for large number of products. The downside of using a single repository with branches is that it would add revision numbers to every branch whether anything was committed, regardless from which branch. What setup do you/would you use in this situation?

    Read the article

  • T-SQL Specific Syntax problem (Simple no doubt)

    - by Yoda
    Hi guys, I have an issue with a query I'm trying to run on some data, I guess the place to start is to describe the data. Ok so I have a list of email addresses, each email address has a unique ID and an account ID Also in my tables I have a set number which auto incrememnts, this will allow me to target duplicate email addresses What I need to do is something like this. Insert into duplicates (EMAIL,ACCOUNTID,ID) SELECT Email,AccountID,ID FROM EmailAddresses Group by Email,AccountID Having Count(email)>1 Order by AccountID, Email So essentially I want to select all duplicate email addresses and insert them (and their relative fields) into a new table broken down by accountID so I can run some further querys on it. I have been battling with this for way too long and could just use a fresh perspective. Cheers in advance

    Read the article

  • Insert data into table effeciently, postgresql

    - by Rowan_Gaffney
    I am new to postgresql (and databases in general) and was hoping to get some pointers on improving the efficiency of the following statement. I am inserting data from one table to another, and do not want to insert duplicate values. I have a rid (unique identifier in each table) that are indexed and are Primary Keys. I am currently using the following statement: Insert INTO table1 SELECT * FROM table2 WHERE rid NOT IN (SELECT rid FROM table1). As of now the table one is 200,000 records, table2 is 20,000 records. Table1 is going to keep growing (probably to around 2,000,000) and table2 will stay around 20,000 records. As of now the statement takes about 15 minutes to run. I am concerned that as Table1 grows this is going to take way to long. Any suggestions?

    Read the article

  • Why repeat database constraints in models?

    - by BWelfel
    In a CakePHP application, for unique constraints that are accounted for in the database, what is the benefit of having the same validation checks in the model? I understand the benefit of having JS validation, but I believe this model validation makes an extra trip to the DB. I am 100% sure that certain validations are made in the DB so the model validation would simply be redundant. The only benefit I see is the app recognizing the mistake and adjusting the view for the user accordingly (repopulating the fields and showing error message on the appropriate field; bettering the ux) but this could be achieved if there was a constraint naming convention and so the app could understand what the problem was with the save (existing method to do this now?)

    Read the article

  • Is it possible to use inheritance in this situation? (Java)

    - by they changed my name
    I have ClassA and ClassB, with ClassA being the superclass. ClassA uses NodeA, ClassB uses NodeB. First problem: method parameters. ClassB needs NodeB types, but I can't cast from the subclass to the superclass. That means I can't set properties which are unique to NodeB's. Second problem: When I need to add nodes toClassB, I have to instantiate a new NodeB. But, I can't do this in the superclass, so I'd have to rewrite the insertion to use NodeB. Is there a way around it or am I gonna have to rewrite the whole thing?

    Read the article

  • How do I do a has_many through association on a has_many through association in rails?

    - by Angela
    Warning: I may have the wrong 'problem statement' but here it goes: A Campaign has many Contacts. A Campaign has many Emails. Therefore, a Contact has many Emails through a Campaign. And an Email can have many Contacts through a Campaign. Each Contact-Email pair has its own unique Status (status1, status2, etc). Each Status (for a Contact-Email pair) will have its own User. I do not know how to model Status, or User. Currently the immediate challenge is Status. (see diagram below)

    Read the article

  • How do I use SPMemember.ID property to get User or Group

    - by Jason
    I have to write a utility to enumerate and manage the owners of groups within a SharePoint site. I know I can use the Groups property of the SPWeb object to retrieve a collection of groups. And I know I can use the Owner property of the group to get back the owner. My problem is that I do not know what to do next. The SPGroup.Owner property returns a SPMember object. The member object has one property called ID that returns the unique ID (an integer) of the member. What I cannot seem to find information on is how to use that integer value to determine if the member is a User or a Group and how to get back additional details (say the name). Any ideas? Thanks.

    Read the article

  • How to import datarow from one dataset to another?

    - by Disciple
    Hi, I want to copy the row to the new dataset if the previous value in second column isn't the same as the current one (i.e this dataset should have rows with unique values): DataTable tbl = new DataTable(); DataTable tmpTable = ds.Tables[0]; for( var rowIndex = 0; rowIndex < ds.Tables[0].Rows.Count; rowIndex++ ) { object value = null; foreach (DataRow x in tbl.Rows) { if (ds.Tables[0].Rows[rowIndex][1] == x[1]) { value = ds.Tables[0].Rows[rowIndex][1]; break; } } // value already exists if (value == null) { tbl.ImportRow(ds.Tables[0].Rows[rowIndex]); } } How to do this correctly? Maybe one loop instead 2?

    Read the article

  • How to use LINQ To Entities for filtering when many methods are not supported?

    - by Kinderchocolate
    Hi, I have a table in SQL database: ID Data Value 1 1 0.1 1 2 0.4 2 10 0.3 2 11 0.2 3 10 0.5 3 11 0.6 For each unique value in Data, I want to filter out the row with the largest ID. For example: In the table above, I want to filter out the third and fourth row because the fifth and sixth rows have the same Data values but their IDs (3) are larger (2 in the third and fourth row). I tried this in Linq to Entities: IQueryable<DerivedRate> test = ObjectContext.DerivedRates.OrderBy(d => d.Data).ThenBy(d => d.ID).SkipWhile((d, index) => (index == size - 1) || (d.ID != ObjectContext.DerivedRates.ElementAt(index + 1).ID)); Basically, I am sorting the list and removing the duplicates by checking if the next element has an identical ID. However, this doesn't work because SkipWhile(index) and ElementAt(index) aren't supported in Linq to Entities. I don't want to pull the entire gigantic table into an array before sorting it. Is there a way?

    Read the article

  • Programmatically scroll to an Anchor Tag

    - by Anders
    Consider the following code: <a href="#label2">GoTo Label2</a> ... [content here] ... <a name="label0"></a>More content <a name="label1"></a>More content <a name="label2"></a>More content <a name="label3"></a>More content <a name="label4"></a>More content Is there a way to emulate clicking on the "GoTo Label2" link to scroll to the appropriate region on the page through code? EDIT: An acceptable alternative would be to scroll to an element with a unique-id, which already exists on my page. I would be adding the anchor tags if this is a viable solution.

    Read the article

  • Core Data not-reverse relationship subquery

    - by user561485
    Hi, I have the following entities in CoreData: Village - villageID Bookmark - (relation) village There are multiple villages with each an unique villageID. I have a entity Bookmark which only has a relation to a Village entity; it isn't possible to make a reverse relation. Now I would like to get the village entities where there exists a Bookmark relation. I've red something about subqueries, but I can't get it right for this situation. It must be something like: Village.villageID IN (Bookmark.village.villageID) It isn't possible to get first all the Bookmarks and then loop to get all the Villages, because of the design of the framework. Can this be done in CoreData (I presume the answer is "Yes, of course!") and how?

    Read the article

  • Which SharePoint Authentication Mode Should I be using for this scenario?

    - by Dynamic
    I currently have a sharepoint 2010 site for which NTLM windows authentication has been enabled (by default it is against Active Directory I believe). I'd need to change this so that I have 1 custom login page which accepts username/password/domain and validates those information against the active directory, then if that was valid, I'll write logic to logon to another webservice which is located on another server and returns me a unique sessionId that I can store (as a cookie) for further use. Please could you advise which authentication mode I can use to create this custom login page? should that be FBA against AD? not sure how that works. Thanks in advance.

    Read the article

  • user_objects oracle

    - by mysticfalls
    I would just like to ask what is the difference between user_constraints and user_objects. I have this two database. I run a script on both DB that resulted a unique constraint error. To solve the problem I delete the constraint on user_constraint table for both DB. After that DB1 run without error.. DB2 however failed, I checked the user_constraint for both db and the constraints was deleted. I was asked to check the user_objects.. and found that DB2 has that same constraint_name as the object_name in user_objects table.. Any info regarding their relationship, use, similarites, etc will be appreciated ... Thanks..

    Read the article

  • Select rows where column LIKE dictionary word

    - by Gerve
    I have 2 tables: Dictionary - Contains roughly 36,000 words CREATE TABLE IF NOT EXISTS `dictionary` ( `word` varchar(255) NOT NULL, PRIMARY KEY (`word`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; Datas - Contains roughly 100,000 rows CREATE TABLE IF NOT EXISTS `datas` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `hash` varchar(32) NOT NULL, `data` varchar(255) NOT NULL, `length` int(11) NOT NULL, `time` int(11) NOT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `hash` (`hash`), KEY `data` (`data`), KEY `length` (`length`), KEY `time` (`time`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=105316 ; I would like to somehow select all the rows from datas where the column data contains 1 or more words. I understand this is a big ask, it would need to match all of these rows together in every combination possible, so it needs the best optimization. I have tried the below query, but it just hangs for ages: SELECT `datas`.*, `dictionary`.`word` FROM `datas`, `dictionary` WHERE `datas`.`data` LIKE CONCAT('%', `dictionary`.`word`, '%') AND LENGTH(`dictionary`.`word`) > 3 ORDER BY `length` ASC LIMIT 15 I have also tried something similar to the above with a left join, and on clause that specified the like statement.

    Read the article

  • MYSQL - SQL query Getting single record for the similar records and populating other columns with which has more length

    - by Bujji
    Here is my case , I have a database table with below fields name place_code email phone address details estd others and example data if you look at the above example table First three records are talking about XYZ and place code 1020 . I want create a single record for these three records based on substring(name,1,4) place_code ( I am lucky here for all the similar records satisfies this condition and unique in the table .) For the other columns which record column length has max . For example again for the above 3 records email should be [email protected] , phone should be 657890 and details should be "testdetails" This should be done for all the table . (Some has single records and some has max 10 records ) Any help on query that helps me to get the desired result ? Thank You Regards Kiran

    Read the article

  • x86 linux - how to create custom malloc with address hint

    - by nandu
    Hi, I want to create a custom malloc which allocates memory blocks within a given address range. I am writing a pthreads application in which threads are bound to unique cores on a many-core machine. The memory controllers are statically mapped, so that certain range of addresses on main memory are electrically closer to a core. I want to minimize the latency of communication between cores and main memory by allocating thread memory on these "closer" regions. Any ideas would be most appreciated. Thank you! Nandu

    Read the article

  • iOS sdk question: how do I cast a UIView to a UIImage View (alternativly how do I get a UIImageView from a GestureRecognzer?)

    - by user439299
    Desired end result: user taps a UIImageView and the image changes to another image (a subsequent tap returns the image to the original state) Problem: I add a (unique) selector to a bunch of UIImageViews (in an array) and point the action at the same function - let's call this function imageTapped: for now. Here is my code so far: -(void)imageTapped:(UITapGestureRecognizer *)tapGesture { UIImageView *view = tapGesture.view; // rest of code... } This code actually works fine but gets a warning when I run it: "Incompatible objective c types initilizing 'struct UIView *', expected 'struct UIImageView *' Any way to get rid of this? Not sure how casting works in objective c... primitive types seem to work fine such as (int)someFloat works fine but (UIImageView)someUiView doesn't work. Like I said, code works alright when I run it but would like to get ride of the compiler warning. Any help would be awesome.... I am very new to objective c (or any non java language for that matter) so be gentle. Thanks in advance.

    Read the article

  • indexing question

    - by user522962
    I have a table w/ 3 columns: name, phone, date. I have 3 indexes: 1 on phone, 1 on date and 1 on phone and date. I have the following statement: SELECT * FROM ( SELECT * FROM people WHERE phone IS NOT NULL ORDER BY date DESC) as t GROUP BY phone Basically, I want to get all unique phone numbers ordered by date. This table has about 2.5 million rows but takes forever to execute....are my indexes right? UPDATE: My EXPLAIN statement comes back with 2 rows: 1 for primary table and 1 for derived table. It says I am using temporary and using filesort for my primary table. For my derived table, it says my possible keys are (phone), and (phone, date) but it is using filesort.

    Read the article

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