Displaying 20 results from an estimated 3000 matches similar to: "Cleaner code in rails view"
2006 Feb 28
2
Need help with a Power Find()
I was hoping someone would be able to help me with creating a method.
I have two tables. What I am trying to do is create a list of all the id''s
from table2 that aren''t currently referenced by Table1''s address_id column.
That way, when I create a new customer I can have a drop down list in the
view of all the addresses that are not currently being used.
##### Database
2012 Jan 03
1
sqldf and not converting integers to floating point in SQLite
Hi,
I have following 2 tables:
Table 1:
POSTAL | VALUE
1000|49
1010|100
1020|50
Table 2:
INSEE | POSTAL
A|1000
B|1000
C|1010
D|1020
I would like to convert this to the following:
INSEE | VALUE_SPREAD
A|24.5
B|24.5
C|100
D|50
I can achieve this with a nested SQL query (through counting the
number of POSTAL that belong to any given INSEE, and diving the value
of the postal in that INSEE by
2004 Sep 23
0
two internet connections don''t appear to be masqing
I have a script for dual internet connections that does this:
-------------------------
#!/bin/bash
IF1=eth1
IP1=203.219.190.106
P1=203.219.190.105
P1_NET=203.219.190.104
IF2=eth2
IP2=220.245.224.46
P2=220.245.224.45
P2_NET=220.245.224.44
IF0=eth0
P0_net=192.168.0.0
TABLE1=inet1
TABLE2=inet2
ip route add $P1_NET dev $IF1 src $IP1 table $TABLE1
ip route add default via $P1 table $TABLE1
ip
2013 May 01
1
Combine multiple tables into one
Hi,
May be this helps:
dat1<- as.data.frame(table1)
?dat2<- as.data.frame(table2)
names(dat2)<-c("V3","V4")
library(plyr)
res<-join(dat1,dat2,type="full")
?res[is.na(res)]<- 0
?res
#? V1 V2 V3 V4
#1? 1? 1? 0? 0
#2? 1? 2? 0? 0
#3? 0? 0? 0? 1
#4? 0? 0? 0? 4
?combinedtable<-as.matrix(res)
?colnames(combinedtable)<- NULL
?combinedtable
#???? [,1] [,2]
2006 Feb 19
1
One Model from two Tables with no foreign keys
I would like to create a model that is based on two database tables:
Table1
---------
id (PK)
data1
Table2
----------
id (PK)
data2
There is a one-to-one relationship between the records of Table1 and
Table2. (That is, for every record in Table1 there is a record with
matching id in Table2 and vice versa).
The problem is that I cannot alter the table schemas in any way, so I
cannot add
2006 Feb 21
1
[Bug 452] New: DNAT to internal network don't work with source routing and 2 uplinks
https://bugzilla.netfilter.org/bugzilla/show_bug.cgi?id=452
Summary: DNAT to internal network don't work with source routing
and 2 uplinks
Product: netfilter/iptables
Version: linux-2.6.x
Platform: i386
OS/Version: Debian GNU/Linux
Status: NEW
Severity: normal
Priority: P2
2006 Jan 22
0
Rank Product
Hello Guys,
I'm using the package RankProduct to determine the differential expression of genes in 2 classes.
The importance of the thing is to know:
- How can I determine which class is the class of up-regulated genes and which to the down regulated gene
- How can i interpret the results :
$pfp, $RPs, $RPrank,
Orirank,
2012 Jul 26
0
lda, collinear variables and CV
Dear R-help list,
apparently lda from the MASS package can be used in situations with
collinear variables. It only produces a warning then but at least it
defines a classification rule and produces results.
However, I can't find on the help page how exactly it does this. I have a
suspicion (it may look at the hyperplane containing the class means,
using some kind of default/trivial
2012 Aug 14
0
Problems with lda-CV, and collinear variables in lda
Dear R-help list,
two issues regarding lda.
1) I'm puzzled by the fact that lda's in-build cross-validation gives results different from the manual cross-validation routine that I run (of course mine may be wrong, but I don't think so).
See here:
library(MASS)
set.seed(12345)
n <- 50
p <- 10 # or p<- 200
testdata <- matrix(ncol=p,nrow=n)
for (i in 1:p)
testdata[,i]
2006 Mar 05
1
Sweave and long strings
Dear R-List,
I use Sweave (which is wonderful) and I have a problem with the
strings when they are too long according to the width of the page. For
example when I do in my .Rnw document :
<<UsingRODBC,echo=TRUE>>=
channel <- odbcConnect(dsn="database",uid="root",pwd="password")
df1 <- sqlFetch(channel,"table1",rownames=TRUE)
df2
2004 Jul 23
1
Please document this
Stephen,
This REALLY needs to be fixed in the code; tc should reject as a syntax
error any "add filter" command that does not include a "prio"
parameter. It also needs to be documented.
=== From LARTC mailing list ===
> Dear list,
> After much code crunching and beating my head against the wall
> (literally), I discovered the faulty code. Thanks mostly to
2011 Mar 10
1
snp-chip table
Dear R helpers
I have a table and i need to make new table
table1:
sire snp1 snp2 snp3 snp4 snp5 snp6 snp7 snp8 snp9 snp10
snp11 snp12 snp13 snp14 snp15 8877 -1 -1 -1 -1 0 0 -1 -1 -1 0 1 1 1 -1 -1
7765 1 1 1 0 0 0 -1 1 1 1 0 0 0 1 0 8766 1 1 -1 0 -1 -1 0 -1 0 -1 -1 -1 0 1
0 6756 0 1 0 -1 1 -1 -1 0 0 0 0 -1 0 1 1 5644 -1 0 1 -1 0 0 0 0 -1 -1 0 0 0
0 1
I have table2
sire
2007 Apr 02
1
RODBC, sqlQuery with NA:s
Hi R-users,
I'm trying to retrieve data from MS SQL database with RODBC's
sqlQuery-function:
temp <- sqlQuery(channel,"select *, (select text from table1 where
koodi='paa' and koodi2=paa) as tempor from table2")
str(temp)
…
$ var0 : num NA NA 1.6 NA NA 1.4 NA 1 NA NA ...
$ var1 : Factor w/ 45 levels "
2009 Dec 30
1
lm() and factors appending
How for the love of god can I prevent the lm() function from padding on to
my factor variables?
I start out with 2 tables:
Table1
123123
124351
...
626773
Table2
Count,IS_DEAD,IS_BURNING
1231,T,F
4521,F,T
...
3321,T,T
Everything looks fine when I import the data.
then we get a
oh_crap <- lm(table1 ~ Count + IS_DEAD + IS_BURNING, table2)
Magically when I look at my oh_crap coefficents
2011 Sep 28
3
Data transformation & cleaning
Hi,
I have a few methodological and implementation questions for ya'll. Thank
you in advance for your help. I have a dataset that reflects people's
preference choices. I want to see if there's any kind of clustering effect
among certain preference choices (e.g. do people who pick choice A also pick
choice D).
I have a data set that has one record per user ID, per preference choice.
2006 May 03
5
Multiple Scaffolds
I''d like to create scaffolds for each of the tables in my database, but
would like to access them below the path: localhost:3000/admin
For example localhost:3000/admin/table1
localhost:3000/admin/table2
Where table1 and table2 would be the controller names respectively,
calling their own list.rhtml, show.rhtml, edit.rhtml, etc..
Any recommendations on how/where to
2005 Dec 14
0
how do I list the two tables?
Hello,
I want a page that list the database contents of table1
and then list the database contents of table2
How do I reference both tables in my controller?
I tried @t1 = Table1.find(:all)
@t2 = Table2.find(:all)
Thanks
Frank
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
2010 Jun 18
3
inverse function of melt
Dear list,
I'm looking for an inverse function of melt(which is in package reshape).Namely, I had a data frame like this
(Table1)
YEAR VAR1 VAR2 VAR3
1995 7 3 45
1996 5 6 32
1997 6 10 15
I transformed my data by using the melt function and my data was reshaped in the following format:
(Table2)
YEAR variable
2003 Apr 08
0
Using iproute2 to bond two Internet lines for a webserver.
I am relatively new to iproute2. Any information on the topic below would
save me considerable time. I appreciate any help, thanks.
We want to plug two lines into a webserver to increase the bandwidth
available to the hosted sites. Rather than use round-robin DNS we would
prefer to use iproute2 to use equal cost routing across the two lines.
However, I am still not sure how well that will
2012 Jan 18
2
Table Intersection
I've got two tables....
first one(table1):
ID chrom start end
Ex1 2 152 180
Ex2 10 2000 2220
Ex3 15 3000 4000
second one ( table2):
chrom location name
2 160 Alv
2 190 GNN
2 100