Displaying 20 results from an estimated 6000 matches similar to: "Make matrix from SQL query result"
2006 Mar 28
5
Anyone use .uniq! ???
could anyone by chance give me a working example of the .uniq! method?
i''ve been trying all day. any help would be much appreciated!
jon
--
Posted via http://www.ruby-forum.com/.
2005 Jun 19
2
outgoing call routing
I have a Asterisk @home ver 1.0 running with a TDMB11 card. Several sip
extensions and a regular phone connected to the box. All routing works fine
from the regular phone connected to the box, whether its going to FWD,
broadvoice or the PSTN. The problem I am experiencing comes from making
calls from the sip phones. They get routed correctly to the sip and iax
trunks but when making calls
2006 Dec 05
4
has_many with :uniq not working for me
Hi all,
I have a relationship (no really!)
class RiskMatrix < ActiveRecord::Base
has_many :severities, :order => :position, :uniq => true
end
class RiskFactor < ActiveRecord::Base
belongs_to :risk_matrix
validates_presence_of :descriptor, :example
validates_uniqueness_of :descriptor, :example, :scope=> :risk_matrix_id
end
class Severity < RiskFactor
2007 Nov 21
2
uniq -c
Is there an R analog of the Unix command uniq -c:
http://en.wikipedia.org/wiki/Uniq
Given an array x, uniq -c replaces each contiguous subsequence of
identical numbers with a tuple (count, number). E.g.
$ cat > usample
10
10
9
8
8
7
7
7
6
3
1
1
1
0
$ uniq -c usample
2 10
1 9
2 8
3 7
1 6
1 3
3 1
1 0
Cheers,
Alexy
2007 Dec 09
4
Help on drying code
Hi all,
Currently I''m having to do this:
def self.authorized_roles(controller, action)
specific = self.find_by_controller_and_action(controller, action)
all_actions = self.find_by_controller_and_action(controller, ''*'')
all_controllers = self.find_by_controller(''*'')
role_ids = []
specific.each do |role_item|
role_ids <<
2006 Feb 07
1
habtm :uniq causing duplicate inserts? How to update Rails?
Hello *Gem* experts,
Sorry for asking multiple questions in one post but they are both related to one problem.
So far I have the following code:
class Member < ActiveRecord::Base
has_and_belongs_to_many :blogs, :uniq=>true
.....
end
class Blog < ActiveRecord::Base
has_and_belongs_to_many :members, :uniq=>true
...
end
The issue is that
2006 Mar 24
2
Return all rows, split then show uniques
I''m returning some rows from a tags database that look like this:
ID WORDS
1. apple banana pear
2. banana melon
3. apple peach lime
What I want to do with that data is use the .split method to divide them
into separate values in an array, then use the .uniq method to return a
unique list of the words like so:
apple, banana, pear, melon, peach, lime
So in my controller I
2007 Jul 24
11
Mock or Stub strategy for validates_uniqueness_of
Hi,
I''m a bit stuck with mocking a unit test of a join model with regards to a
validates_uniqueness_of clause.
I have
class Book < AR:B
has_many :clippings
various validates_presence_of etc
end
class Clip < AR:B
has_many :clippings
various validates_presence_of etc
end
class Clipping < AR:B
belongs_to :book
belongs_to :clip
validates_uniqueness_of :clip_id,
2006 Feb 19
4
Multiple HABTM to one table
I have a class Player, and a class Game.
Game has two HABTM relationships to the Player table through seperate
relationship tables.
class Game < ActiveRecord::Base
has_and_belongs_to_many :players, :uniq => true
has_and_belongs_to_many :victors, :class_name => ''Player'', :uniq => true
end
When I add Player A to players, and Player B to victors, and save the
2005 Mar 15
18
[Bug 1001] Error on MAKE while compiling SRPMS and tar.gz but not while installing RPMS
http://bugzilla.mindrot.org/show_bug.cgi?id=1001
Summary: Error on MAKE while compiling SRPMS and tar.gz but not
while installing RPMS
Product: Portable OpenSSH
Version: 3.7.1p2
Platform: All
OS/Version: Linux
Status: NEW
Severity: critical
Priority: P2
Component: ssh
2010 Oct 14
2
Drop matching lines from readLines
Dear R-group,
I have some noise in my text file (coding issues!) ... I imported a 200 MB
text file using readlines
Used grep to find the lines with the error?
What is the easiest way to drop those lines? I plan to write back the
"cleaned" data set to my base file.
Thanks.
2009 Oct 06
1
how to output profile plots for groups using lattice package
Dear R users,
I am trying to have an xyplot of a data set which has the following
variables:
case (n=10,20,30)
parameter (parm=a,b)
group (grp=g1,g2)
y (y values)
x (x=2,4,8)
My plot should be parameter by case such that I have 2 rows (each row= each
parameter) and 3 columns (each column=each case). My R-code is as follows
but I am not able to get what I want to:
tp1.sim <- xyplot(y~ x | case
2009 Oct 28
7
Scripting help please....
Need a scripting help to sort out a list and list all the duplicate lines.
My data looks somethings like this
host6:dev406mum.dd.mum.test.com:22:11:11:no
host7:dev258mum.dd.mum.test.com:36:17:19:no
host7:dev258mum.dd.mum.test.com:36:17:19:no
host17:dev258mum.dd.mum.test.com:31:17:19:no
host12:dev258mum.dd.mum.test.com:41:17:19:no
host2:dev258mum.dd.mum.test.com:36:17:19:no
2018 Apr 27
1
wiki suggestions, part 2
Am 26.04.2018 um 20:07 schrieb Harry Jede via samba:
> No, i have created 2 users with same sid.
>
> root at capella:~# pdbedit -Lv | grep "User SID" | sort|uniq -d
> root at capella:~#
>
> root at capella:~# pdbedit -L|grep Failing
> ldapsam_getsampwsid: More than one user with SID [S-1-5-21-3958726613-3318811842-4132420312-21010]. Failing. count=2
>
2012 Sep 06
4
Why the error is coming, can anyone help?
Hi everyone
Can anyone help?
x = c("Treatment", "Planned", "Actual", "Demographics", "Outcomes")
for (i in x) {
df <- paste(i)[, c("Reference_ID", "Arm_ID")]
unique(df) -> uniq
as.data.frame(table(uniq$Reference_ID)) -> y
i.Arms<- paste(y$Var1, y$Freq, sep="_")
Print_Message("Check for the Total No of
2014 Jul 19
1
patch about mingwbuild 4.9.1
recently I used gcc 4.9.1 (http://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win64/Personal Builds/mingw-builds/)on windows to build R,but failed when link R.dll ,it report linker status 5.
after some digging, I found when use gcc 4.9.1 64 bit on windows there are lots of .refptr.*(* is r function name) in R.def, which lead build fail.so I add a simple path to
2010 Feb 02
1
ggplot/time series with indicators question
Hello, I am trying to plot time-series data with certain weeks highlighted using symbols.
require(ggplot2)
#plotting time series data
timescale <- seq(as.Date("01/01/09","%m/%d/%y"), length.out=12, by=7)
data.all <- data.frame(
id = c(rep('111',12),rep('222',12),rep('333',12)),
week=c(timescale,timescale,timescale),
2011 May 19
3
A better way to do this
Hello gurus,
I have a dataframe containing two groups viz., 'control' and 'case', each of
these groups contains longitudinal data for 100 subjects. I have to plot all
these subjects on a single chart and then put a regression line for each of
the group for all the subjects. I have written a function to do the chart
grpcharts<-function (dat, group,group2,molecule,cutoff){
2006 Apr 17
3
model.models.models or model.models.find(:first).models
I the following three models which all have has_and_belongs_to_many
# User <-> UserGroup <-> Permissions
class UserGroup < ActiveRecord::Base
has_and_belongs_to_many :users, :join_table => "user_usergroup_join"
has_and_belongs_to_many :permissions, :join_table =>
"usergroup_permission_join", :uniq => true
end
I can do this:
permissions =
2005 Apr 26
1
ldap uid with static gid problem
hi,
i'd like to use dovecot to authenticate from ldap. in ldap each user has
it's uniq uid and gid. unfortunately with postfix we can't use uniq
uid/gid since in this case we have ot create all user's home in advance.
so we decided to use uniq uid and a common gid in postfix since in
this case postfix can create new users maildir and deliver new mails. so
i'd like to