Search Results

Search found 337 results on 14 pages for 'gender'.

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

  • Linq guru - filtering related entities...

    - by vdh_ant
    My table structure is as follows: Person 1-M PesonAddress Person 1-M PesonPhone Person 1-M PesonEmail Person 1-M Contract Contract M-M Program Contract M-1 Organization At the end of this query I need a populated object graph where each person has their: PesonAddress's PesonPhone's PesonEmail's PesonPhone's Contract's - and this has its respective Program's Now I had the following query and I thought that it was working great, but it has a couple of problems: from people in ctx.People.Include("PersonAddress") .Include("PersonLandline") .Include("PersonMobile") .Include("PersonEmail") .Include("Contract") .Include("Contract.Program") where people.Contract.Any( contract => (param.OrganizationId == contract.OrganizationId) && contract.Program.Any( contractProgram => (param.ProgramId == contractProgram.ProgramId))) select people; The problem is that it filters the person to the criteria but not the Contracts or the Contract's Programs. It brings back all Contracts that each person has not just the ones that have an OrganizationId of x and the same goes for each of those Contract's Programs respectively. What I want is only the people that have at least one contract with an OrgId of x with and where that contract has a Program with the Id of y... and for the object graph that is returned to have only the contracts that match and programs within that contract that match. I kinda understand why its not working, but I don't know how to change it so it is working... This is my attempt thus far: from people in ctx.People.Include("PersonAddress") .Include("PersonLandline") .Include("PersonMobile") .Include("PersonEmail") .Include("Contract") .Include("Contract.Program") let currentContracts = from contract in people.Contract where (param.OrganizationId == contract.OrganizationId) select contract let currentContractPrograms = from contractProgram in currentContracts let temp = from x in contractProgram.Program where (param.ProgramId == contractProgram.ProgramId) select x where temp.Any() select temp where currentContracts.Any() && currentContractPrograms.Any() select new Person { PersonId = people.PersonId, FirstName = people.FirstName, ..., ...., MiddleName = people.MiddleName, Surname = people.Surname, ..., ...., Gender = people.Gender, DateOfBirth = people.DateOfBirth, ..., ...., Contract = currentContracts, ... }; //This doesn't work But this has several problems (where the Person type is an EF object): I am left to do the mapping by myself, which in this case there is quite a lot to map When ever I try to map a list to a property (i.e. Scholarship = currentScholarships) it says I can't because IEnumerable is trying to be cast to EntityCollection Include doesn't work Hence how do I get this to work. Keeping in mind that I am trying to do this as a compiled query so I think that means anonymous types are out.

    Read the article

  • Making only a part of model field available in Django

    - by Hellnar
    Hello I have a such model: GENDER_CHOICES = ( ('M', 'Male'), ('F', 'Female') ) class Profile(models.Model): user = models.ForeignKey(User) gender = models.CharField(max_length=1, choices=GENDER_CHOICES) class FrontPage(models.Model): female = models.ForeignKey(User,related_name="female") male = models.ForeignKey(User,related_name="male") Once I attempt to add a new FrontPage object via the Admin page, I can select "Female" profiles for the male field of FrontPage, how can I restrict that? Thanks

    Read the article

  • Can't connect IBOutlet in Interface Builder

    - by Dave C
    Hello, I have the following code: @interface AddResident : UIViewController { IBOutlet UITextField *FirstName; IBOutlet UISegmentedControl *Gender; } I can see both of these outlets in interface builder but can only connect the UISegmented control... the other one will not connect to my UITextField on the form. Any help is much appreciated.

    Read the article

  • Is currying just a way to avoid inheritance?

    - by Alex Mcp
    So my understanding of currying (based on SO questions) is that it lets you partially set parameters of a function and return a "truncated" function as a result. If you have a big hairy function takes 10 parameters and looks like function (location, type, gender, jumpShot%, SSN, vegetarian, salary) { //weird stuff } and you want a "subset" function that will let you deal with presets for all but the jumpShot%, shouldn't you just break out a class that inherits from the original function? I suppose what I'm looking for is a use case for this pattern. Thanks!

    Read the article

  • UIPickerView issues - iphone

    - by Rob J
    I have the following: - (NSInteger) numberOfComponentsInPickerView:(UIPickerView *)pickerView { return 2; } - (NSInteger) pickerView:(UIPickerView *) pickerView numberOfRowsInComponent:(NSInteger) component { return [genderPickerData count]; return [agePickerData count]; } When I do this, the UIPicker is split into 2 components, but the PickerData is only being represented for gender on both pickers. I am trying to figure out through Apple's confusing documentation on how I reference each individual component but can't seem to figure it out.

    Read the article

  • Fixing up an entity framework query

    - by vdh_ant
    My table structure is as follows: Person 1-M PesonAddress Person 1-M PesonPhone Person 1-M PesonEmail Person 1-M Contract Contract M-M Program Contract M-1 Organization At the end of this query I need a populated object graph where each person has their: PesonAddress's PesonPhone's PesonEmail's PesonPhone's Contract's - and this has its respective Program's Now I had the following query and I thought that it was working great, but it has a couple of problems: from people in ctx.People.Include("PersonAddress") .Include("PersonLandline") .Include("PersonMobile") .Include("PersonEmail") .Include("Contract") .Include("Contract.Program") where people.Contract.Any( contract => (param.OrganizationId == contract.OrganizationId) && contract.Program.Any( contractProgram => (param.ProgramId == contractProgram.ProgramId))) select people; The problem is that it filters the person to the criteria but not the Contracts or the Contract's Programs. It brings back all Contracts that each person has not just the ones that have an OrganizationId of x and the same goes for each of those Contract's Programs respectively. What I want is only the people that have at least one contract with an OrgId of x with and where that contract has a Program with the Id of y... and for the object graph that is returned to have only the contracts that match and programs within that contract that match. I kinda understand why its not working, but I don't know how to change it so it is working... This is my attempt thus far: from people in ctx.People.Include("PersonAddress") .Include("PersonLandline") .Include("PersonMobile") .Include("PersonEmail") .Include("Contract") .Include("Contract.Program") let currentContracts = from contract in people.Contract where (param.OrganizationId == contract.OrganizationId) select contract let currentContractPrograms = from contractProgram in currentContracts let temp = from x in contractProgram.Program where (param.ProgramId == contractProgram.ProgramId) select x where temp.Any() select temp where currentContracts.Any() && currentContractPrograms.Any() select new Person { PersonId = people.PersonId, FirstName = people.FirstName, ..., ...., MiddleName = people.MiddleName, Surname = people.Surname, ..., ...., Gender = people.Gender, DateOfBirth = people.DateOfBirth, ..., ...., Contract = currentContracts, ... }; //This doesn't work But this has several problems (where the Person type is an EF object): I am left to do the mapping by myself, which in this case there is quite a lot to map When ever I try to map a list to a property (i.e. Scholarship = currentScholarships) it says I can't because IEnumerable is trying to be cast to EntityCollection Include doesn't work Hence how do I get this to work. Keeping in mind that I am trying to do this as a compiled query so I think that means anonymous types are out.

    Read the article

  • recommendation systems and the cold start problem

    - by Hellnar
    Hello, I am curious what are the methods / approaches to overcome the "cold start" problem where when a new user or an item enters the system, due to lack of info about this new entity, making recommendation is a problem. I can think of doing some prediction based recommendation (like gender, nationality and so on). Thanks

    Read the article

  • Radio Button text

    - by niya
    Trying to create a profile using content provider.I want to add the gender to the table when the radio button corresponding to the male or female is clicked. Any solution?

    Read the article

  • Search and replace

    - by zx
    Hi, I have a really large SQL dump around 400MB. It's in the following format, "INSERT INTO user VALUES('USERID', 'USERNAME', 'PASSWORD', '0', '0', 'EMAIL', 'GENDER', 'BIRTHDAY', '182', '13', '640', 'Married', 'Straight', '', 'Yes', 'Yes', '1146411153', '1216452123', '1149440844', '0', picture', '1', '0', '0', 'zip', '0', '', '0', '', '', '0')" Is there anyway I can just get the email and password out from that, I want to import the users into another table. Anyone know how I can do this and just get email-password stripped out from that content? Thank you in advance

    Read the article

  • Restructuring Site - SEO

    - by a1anm
    I am planning to restructure my site slightly which means certain urls will be changing. I rank quite well for some of these pages in google. What can I do to retain this once I change the url's? Here is an example of some of the changes: twistedtime.com/mens-watches.html to twistedtime.com/shop-by/gender/mens-watches.html twistedtime.com/watch-brands/lip-watches.html to twistedtime.com/shop-by/watch-brands/lip-watches.html

    Read the article

  • JanRain OpenID in PHP SREG?

    - by AFK
    I setup the demo with a modified login I found called open-id selector. the login works fine and the identity url comes back, but the SREG data I ask for is never populated, required or optional. I am logging into my page with a gmail account. Here is the code from my try_auth.php that I edited $sreg_request = Auth_OpenID_SRegRequest::build( // Required array('email'), // Optional array('fullname', 'gender', 'timezone', 'dob', 'country')); what gives?

    Read the article

  • How to update a collection based on another collection in MongoDB?

    - by Sean Zhu
    Now I get two collections: coll01 and coll02. And the structure of coll01 is like this: { id: 01, name: "xxx", age: 30 } and the structure of coll02 is like: { id: 01, name: "XYZ" gender: "male" } The two id fields in the both collection are indices. And the numbers of documents in these two collections are same. And what I want to do in traditional SQL is : update coll01, coll02 set coll01.name = coll02.name where coll01.id = coll02.id

    Read the article

  • High performance querying - Sugestions please

    - by Alex Takitani
    Supposing that I have millions of user profiles, with hundreds of fields (name, gender, preferred pet and so on...). With database would You choose? Suppose that You have a Facebook like load. Speed is a must. Open Source preferred. I've read a lot about Cassandra, HBase, Mongo, Mysql... I just can't decide.....

    Read the article

  • Linq query challenge - can this be done?

    - by vdh_ant
    My table structure is as follows: Person 1-M PesonAddress Person 1-M PesonPhone Person 1-M PesonEmail Person 1-M Contract Contract M-M Program Contract M-1 Organization At the end of this query I need a populated object graph where each person has their: PesonAddress's PesonPhone's PesonEmail's PesonPhone's Contract's - and this has its respective Program's Now I had the following query and I thought that it was working great, but it has a couple of problems: from people in ctx.People.Include("PersonAddress") .Include("PersonLandline") .Include("PersonMobile") .Include("PersonEmail") .Include("Contract") .Include("Contract.Program") where people.Contract.Any( contract => (param.OrganizationId == contract.OrganizationId) && contract.Program.Any( contractProgram => (param.ProgramId == contractProgram.ProgramId))) select people; The problem is that it filters the person to the criteria but not the Contracts or the Contract's Programs. It brings back all Contracts that each person has not just the ones that have an OrganizationId of x and the same goes for each of those Contract's Programs respectively. What I want is only the people that have at least one contract with an OrgId of x with and where that contract has a Program with the Id of y... and for the object graph that is returned to have only the contracts that match and programs within that contract that match. I kinda understand why its not working, but I don't know how to change it so it is working... This is my attempt thus far: from people in ctx.People.Include("PersonAddress") .Include("PersonLandline") .Include("PersonMobile") .Include("PersonEmail") .Include("Contract") .Include("Contract.Program") let currentContracts = from contract in people.Contract where (param.OrganizationId == contract.OrganizationId) select contract let currentContractPrograms = from contractProgram in currentContracts let temp = from x in contractProgram.Program where (param.ProgramId == contractProgram.ProgramId) select x where temp.Any() select temp where currentContracts.Any() && currentContractPrograms.Any() select new Person { PersonId = people.PersonId, FirstName = people.FirstName, ..., ...., MiddleName = people.MiddleName, Surname = people.Surname, ..., ...., Gender = people.Gender, DateOfBirth = people.DateOfBirth, ..., ...., Contract = currentContracts, ... }; //This doesn't work But this has several problems (where the Person type is an EF object): I am left to do the mapping by myself, which in this case there is quite a lot to map When ever I try to map a list to a property (i.e. Scholarship = currentScholarships) it says I can't because IEnumerable is trying to be cast to EntityCollection Include doesn't work Hence how do I get this to work. Keeping in mind that I am trying to do this as a compiled query so I think that means anonymous types are out.

    Read the article

  • PHP MySQL Select multiple tables

    - by Jordan Pagaduan
    Is it posibble to select 3 tables at a time in 1 database? Table 1: employee -- employee_id -- first_name -- last_name -- middle_name -- birthdate -- address -- gender -- image -- salary Table 2: logs -- log_id -- full_name -- employee_id -- date -- time -- status Table 2: logout -- log_id -- full_name -- employee_id -- date -- time -- status I wanted to get the value of employee table where $id of selected. Then the $id also get the value of log.time, log.date, logout.time, and logout.date. I already try using UNION but nothing happens.

    Read the article

  • How do I exit a series of If / else conditions in a mysql trigger?

    - by ScArcher2
    I have a trigger that checks to see if certain fields changed during the update. If any of these fields changed I update another table. I'd like to "break" out of the if conditions as soon as I know that something changed. Is there a way to do this within a MySQL Trigger? What I have works, but It seems inefficient. CREATE TRIGGER profile_trigger BEFORE UPDATE ON profile FOR EACH ROW BEGIN DECLARE changed INTEGER; SET changed = 0; IF STRCMP(NEW.first_name, OLD.first_name) <> 0 THEN SET changed = 1; ELSEIF STRCMP(NEW.last_name, OLD.last_name) <> 0 THEN SET changed = 1; ELSEIF STRCMP(NEW.maiden_name, OLD.maiden_name) <> 0 THEN SET changed = 1; ELSEIF STRCMP(NEW.suffix, OLD.suffix) <> 0 THEN SET changed = 1; ELSEIF STRCMP(NEW.title, OLD.title) <> 0 THEN SET changed = 1; ELSEIF STRCMP(NEW.gender, OLD.gender) <> 0 THEN SET changed = 1; ELSEIF STRCMP(NEW.street, OLD.street) <> 0 THEN SET changed = 1; ELSEIF STRCMP(NEW.street2, OLD.street2) <> 0 THEN SET changed = 1; ELSEIF STRCMP(NEW.city, OLD.city) <> 0 THEN SET changed = 1; ELSEIF STRCMP(NEW.state, OLD.state) <> 0 THEN SET changed = 1; ELSEIF STRCMP(NEW.zip, OLD.zip) <> 0 THEN SET changed = 1; ELSEIF STRCMP(NEW.home_phone, OLD.home_phone) <> 0 THEN SET changed = 1; ELSEIF NEW.date_of_birth <> OLD.date_of_birth THEN SET changed = 1; END IF; IF changed > 0 THEN update other_table set updated = CURRENT_TIMESTAMP where id = NEW.id; END IF; END; |

    Read the article

  • join 03 table in the database codeIgniter

    - by python
    with my table. person_id serial NOT NULL, firstname character varying(30) NOT NULL, lastname character varying(30), email character varying(50), username character varying(20) NOT NULL, "password" character varying(100) NOT NULL, gender character varying(10), dob date, accesslevel smallint NOT NULL, company_id integer NOT NULL,//Reference to table company position_id integer NOT NULL,//Reference to table position company_id serial NOT NULL, company_name character varying(80) NOT NULL, description character varying(255), address character varying(100) NOT NULL, In my controller ........................ // load data $persons = $this->person_model->get_paged_list(10,0); // generate table data $this->load->library('table'); $this->table->set_empty("&nbsp;"); $this->table->set_heading('No', 'FirstName', 'LastName','E-mail','Company''Gender', 'Date of Birth', 'Actions'); foreach ($persons as $person){ $this->table->add_row(++$i, $person->firstname, $person->lastname, $person->email, $person->company_name, //HOW CAN I GOT THE POSITION TITLE ?, strtoupper($person->gender)=='M'? 'Male':'Female', date('d-m-Y',strtotime($person->dob)), } My model <?php class Person_Model extends Model { private $person= 'person'; function Person(){ parent::Model(); } function list_all(){ $this->db->order_by('person_id','asc'); return $this->db->get($person); } function count_all(){ return $this->db->count_all($this->person); } function get_paged_list($limit = 0, $offset = 0) { $this->db->limit($limit, $offset); $this->db->select("person.*, company.company_name as company"); $this->db->from('person'); $this->db->join('company','person.company_id = company.company_id','left'); //MY QUESTION:? CAN I JOIN MORE WITH TABLE POSITION? $query = $this->db->get(); return $query->result(); } function get_by_id($id){ $this->db->where('person_id', $id); return $this->db->get($this->person); } function save($person){ $this->db->insert($this->person, $person); return $this->db->insert_id(); } function update($id, $person){ $this->db->where('person_id', $id); $this->db->update($this->person, $person); } function delete($id){ $this->db->where('person_id', $id); $this->db->delete($this->person); } } ?>

    Read the article

  • How to keep columns labels when numeric convert to character

    - by stata
    a<- data.frame(sex=c(1,1,2,2,1,1),bq=factor(c(1,2,1,2,2,2))) library(Hmisc) label(a$sex)<-"gender" label(a$bq)<-"xxx" str(a) b<-data.frame(lapply(a, as.character), stringsAsFactors=FALSE) str(b) When I covert dataframe a columns to character,the columns labels disappeared.My dataframe have many columns.Here as an example only two columns. How to keep columns labels when numeric convert to character? Thank you!

    Read the article

  • Appstore - An application with only Youtube videos will be accepted?

    - by Pittor
    Hi, this is my question... I have a compilation(UITableView) of videos from youtube of a particular gender(funny videos, for example) and I want to know if this app will pass the approval process. These videos are freely accessible by anyone in youtube, but ins't uploaded/recorded by me. This is a concept: http://img263.imageshack.us/img263/3466/img0075.png (obviously with a cool skin design and more options like Favorites, Share with friends, etc) Thanks for reading.

    Read the article

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