Displaying 20 results from an estimated 510 matches for "uniq".
Did you mean:
unil
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/.
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...
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
acts_as_list :scope => :risk_matrix
end
I d...
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 :uniq=> true isn''t working and multiple records are being inserted in blogs_members table when I call the following in Member clas...
2009 Nov 12
0
Problem with has_many :through, :uniq => true with polymorph
Didn''t have quite enough space to describe it there...basically i''m
having a problem with the :uniq option in my tags.
I''m using acts_as_taggable_on_steroid which adds these associations to
my Resource class:
Resource
has_many :taggings, :as => :taggable, :dependent => :destroy, :include
=> :tag
has_many :tags, :through => :taggings, :uniq => true
This uses the join...
2011 Sep 09
2
Passing in Condtions into Object
Hello,
I am trying to pass a conditional expression into an expression to be
evaluated when ever an R statement is called. For example:
get_unique_count <- function(df, select, field){
uniqs <- unique(subset(df, select)[field])
return (nrow(uniqs))
}
In this case select is a conditional statement year == 1980, and the
function would be called in the following manner:
library(ggplot2)
get_unique_count(mpg, year==1980, 'man...
2007 Oct 18
0
Getting the through items from a has_many :through :uniq relationship
Getting the through items from a has_many :through :uniq relationship
In a nutshell, I have been using the has_many :through :uniq
relationship, and I want a DRY way to list the join model objects.
Currently, my objects include taxon objects, toxin objects,
data_object objects, and taxon_toxin_citation objects ("citation" is
another word for...
2007 Dec 09
4
Help on drying code
...)
role_ids = []
specific.each do |role_item|
role_ids << role_item.role_id
end
all_actions.each do |role_item|
role_ids << role_item.role_id
end
all_controllers.each do |role_item|
role_ids << role_item.role_id
end
role_ids.flatten.uniq
end
which of course is not DRY at all.
I could not find how to merge class instances (specific, all_actions
and all_controllers) or how to make only one find to use the selection
statements above (at least not in a easy to read way)
It would be better if I could do something like:
def self.au...
2006 Apr 11
0
habtm and :uniq
Hi
I wonder what the state of this ticket is:
http://dev.rubyonrails.org/ticket/2019
Does anyone have information regarding whether there are plans to fix
this behaviour? It seems strange to me to force uniqueness in Ruby
(i.e. application code) but not in the database.
For example, in activerecord/lib/active_record/associations/
has_and_belongs_to_many_association.rb there is a line which reads
@reflection.options[:uniq] ? uniq(records) : records
This would be superflous if the "<<...
2005 Jun 24
3
Make matrix from SQL query result
Hi,
I am trying to form a matrix from a SQL query result.
The SQL query result looks like this:
equity_id date returns
1 20050619 0.12
2 20050619 0.03
1 20050620 -0.01
2 20050620 0.01
The target matrix looks like this:
date 1 2
2014 Jul 19
1
patch about mingwbuild 4.9.1
...=========================================
--- Makefile(版本 66200)
+++ Makefile(工作副本)
@@ -148,7 +148,7 @@
ifeq "$(WIN)" "64"
R.dll: $(OBJS) $(OBJS-EXTRA) $(MAINLIBS) $(EXTRALIBS) dllversion.o
@$(ECHO) EXPORTS > R.def
-@$(NM) $^ | $(SED) -n $(SYMPAT) | LC_COLLATE=C $(SORT) | uniq > R0.def
+@$(NM) $^ | $(SED) -n $(SYMPAT) | LC_COLLATE=C $(SORT) | uniq |$(SED) '/.refptr./d' > R0.def
@$(SED) -e's/@.*//' Rdll.hide | LC_COLLATE=C $(SORT) > R1.def
@LC_COLLATE=C comm -23 R0.def R1.def >> R.def
$(DLL) -shared $(DLLFLAGS) $($*-DLLFLAGS) -o $@ R.def...
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 have:
def taglist
@tags = Tag.chop_em(params[:tag])
end
and in my model I know I need something:
def self.chopem(tag)
Tag.find(:all)
end
I think I lack the understanding of ho...
2010 Feb 02
1
ggplot/time series with indicators question
...colour=id)) + geom_line(size=1.05)
#adding indicators on each line
data.all$ind <- c(rep("",4),rep("2",2),rep("",4),rep("3",2),rep("",2),rep("2",4),rep("",3),rep("6",3),rep("",8),rep("1",4))
ind.uniq = setdiff(unique(data.all$ind),c(""))
names(ind.uniq) <- paste("ind", ind.uniq, sep="")
ind.df <- data.frame(lapply(ind.uniq, function(x) ifelse(data.all$ind==x, data.all$value, NA)))
ind.df <- cbind(data.all[,c("id","week")],ind.df)
How c...
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 game,
there is no INSERT for games_victors, but there is for games_players. I
cannot figure out why this is s...
2012 Jun 28
4
Optimizing grep, sort, uniq for speed
...pulls an array of hostnames from some log files.
It has to parse around 3GB of log files, so I'm keen on making it as
efficient as possible. Can you think of any way to optimize this to
run faster?
HOSTS=()
for host in $(grep -h -o "[-\.0-9a-z][-\.0-9a-z]*.com" ${TMPDIR}/* |
sort | uniq); do
HOSTS+=("$host")
done
2007 Dec 11
2
Patch 10463: has_many through using uniq does not honor order
Hi,
I''ve just submitted a patch for ActiveRecord;
http://dev.rubyonrails.org/ticket/10463
The patch includes new fixtures because I could not find a applicable
combination among the existing fixtures. I hope that''s okee.
Please +1 or comment it.
Thanks,
Remco
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
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...
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
> ldapsam_getsampwsid: More than one user with SID [S-1-5-21-3958726613-3318811842-4132420312...
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, :sco...
2005 Mar 15
18
[Bug 1001] Error on MAKE while compiling SRPMS and tar.gz but not while installing RPMS
...SSH version (any) RPM it gets installed after resolving
dependencies but it fails at MAKE when I try to install using tar.gz or source
RPMS. The error displayed is:
---------- ERROR MESSAGE -----
checking if your system defines WTMPX_FILE... no
configure: creating ./config.status
./configure: uniq: command not found
config.status: creating Makefile
config.status: creating openbsd-compat/Makefile
config.status: creating scard/Makefile
config.status: creating ssh_prng_cmds
config.status: creating config.h
OpenSSH has been configured with the following options:
User...