search for: new_a

Displaying 6 results from an estimated 6 matches for "new_a".

Did you mean: new_p
2005 Dec 26
3
data insertion in multiple tables
I have two tables like: Table A: id (autoincrement) name Table B id id_of_A desc I want to add a record to table A and based on the id of A, I want to add a record to table B. I don''t think there is any SQL command that support this (at least in MySQL 4.1, so I use LAST_INSERT_ID()). (Is there any other way? or MySQL 5 support any special SQL command?) But I need
2009 Jul 02
1
Prevent attribute from being changed with "attr_readonly"
...t; also prevent the attribute from being changed even from inside the class? In other words, will the following method successfully change the values of attribute_a and attribute_b in model A? 1.Class A < ActiveRecord::Base 2. attr_readonly :attribute_a, :attribute_b 3. def change_attributes(new_a, new_b) 4. self.attribute_a = new_a 5. self.attribute_b = new_b 6. save! 7. end 8. end I know I can redefine the write accessor if I want to customize the way a single attribute is changed. However here I would like to change two attributes in one transaction and prevent each attribut...
2016 Apr 24
0
Dividing rows in groups
...3 1 4 > + 4 NA NA > + 4 0 1 > + 4 3 0 > + 5 2 5 > + 5 7 NA", header = TRUE) > > df2 <- df1 %>% > + group_by(ID) %>% > + mutate(new_A = A / sum(A, na.rm = TRUE) > + , new_B = B / sum(B, na.rm = TRUE) > + ) > > > > df2 > Source: local data frame [10 x 5] > Groups: ID [5] > > ID A B new_A new_B > (int) (int) (int) (dbl) (dbl) > 1 1 1 2...
2016 Apr 24
3
Dividing rows in groups
Hi I have two data frames as shown below (second one is obtained by aggregating rows of similar IDs in df1.). They both have similar number of columns but rows of df2 are lesser than rows of df1. df1: ID A B 1 1 2 1 0 3 2 5 NA 2 1 3 3 1 4 4 NA NA 4
2007 Jun 26
2
RFC: multiple address spaces for one process
...p = mmap((void *)NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, 0, 0); if (p == MAP_FAILED){ deal with it } memcpy(p, (char *)sd, len); p = mremap(p, len, len, MREMAP_MAYMOVE|MREMAP_FIXED, (char *)sd); if (p == MAP_FAILED) deal with it } while (new_as() >= 0 && nas < NCONTEXTS) nas++; switch_as(0); After this, you can call switch_as in a signal handler running on a stack in the shared data region. Anything else is liable to lead to stack corruption or SEGFAULTs. There are a couple of places where the semantics could be cha...
2007 Jun 26
2
RFC: multiple address spaces for one process
...p = mmap((void *)NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, 0, 0); if (p == MAP_FAILED){ deal with it } memcpy(p, (char *)sd, len); p = mremap(p, len, len, MREMAP_MAYMOVE|MREMAP_FIXED, (char *)sd); if (p == MAP_FAILED) deal with it } while (new_as() >= 0 && nas < NCONTEXTS) nas++; switch_as(0); After this, you can call switch_as in a signal handler running on a stack in the shared data region. Anything else is liable to lead to stack corruption or SEGFAULTs. There are a couple of places where the semantics could be cha...