Displaying 20 results from an estimated 700 matches similar to: "Changing global variables from functions"
2006 Jun 24
4
setting attribute in constructor, .NEW works but not .CREATE
I have table "decks" with three fields: "id", "created_at" and "cards"
which is a 264-character string field. I have modified the model with a
constructor, as follows:
class Deck < ActiveRecord::Base
attr_reader :cards
def initialize
@cards = "12345"
end
end
If I call Deck.new from my controller, I get no errors and an object
with the
2006 Mar 19
2
Multiple polymorphic belongs_to declarations
I have the following models:
class Card < ActiveRecord::Base
belongs_to :deck
belongs_to :front, :polymorphic => true
belongs_to :back, :polymorphic => true
end
class TextContent < ActiveRecord::Base
has_one :card, :as => :front
has_one :card, :as => :back
end
The conflicting has_one declarations don''t work. What I need is
2011 Nov 16
5
Multi-channel labels in Vorbis comments
Hi devs :-)
At the Mozilla Festival in London recently, I took part in a Hack the DJ
workshop, looking at ways to take digital DJ'ing to the next level:
http://www.bbc.co.uk/blogs/researchanddevelopment/2011/11/setting-a-dj-challenge-at-the.shtml
One of the ideas proposed was stem mixing, using multichannel files in
DJ applications. A proprietary implementation of this idea is Fireplayer
2006 Jun 22
1
Active Record question, orphaned children
I have a Deck object and a Card object with their corresponding tables. (You
know a deck of cards.) When I destory a Deck it leaves orphaned cards in
the database. Is there a way to set up the objects with ActiveRecord so that
when a parent object is destoryed the child objects are destroyed as well?
My code below.
class Deck < ActiveRecord::Base
has_many :cards
end
class Card <
2012 Jun 15
2
Looking for Speed in a Toy Simulation Example
Dear List Members
I used to play around with R to answer the following question by
simulation (I am aware there is an easy explicit solution, but this is
intended to serve as instructional example).
Suppose you have a poker game with 6 players and a deck of 52 cards.
Compute the empirical frequencies of having a single-suit hand. The
way I want the result structured is a boolean nosimulation
2011 Jan 10
5
FLAC is dead?
>> Oh I don't doubt the basics, red book is red book and bits are
>> identically replicable and re rippable bits.
>
> I don't see any problem with taking innovation as far as is practical
> and saying "it's finished, no more updates".
Sure, basics :) Again, I'm meaning in regard to about bugs, docs,
porting and nits.
> If I want to do freedb
2006 Apr 30
3
require "ajax_scaffold" in model error
Hi there,
I''ve got installed ajax_scaffold_generator (3.1.2, 2.2.1)
Anyway I''m following the example here <http://height1percent.com/
articles/2006/04/18/ajaxscaffold-3-1-0-released> which suggests the
following in a model file:
--------------------------------------------------------
require ''ajax_scaffold''
class Pet < ActiveRecord::Base
2002 Jan 24
3
getting rank order
I'm doing a study where people place a deck of cards in a certain
order. It's sufficient to assume that their colors & each has a
number (it's actually about attributes of hobbies). I'd like to look
for patterns in how they've arranged the deck. For each subject I
have a list like 3,5,2,4,1, indicating that (s)he chose 3 first, then
5, then 2. . . .
I think what I first
2006 Apr 10
4
Many To Many''s Join table attributes + migrations
Hi all,
just joined and have only just kicked off with Rails (coming, but not
departing, from WebObjects development). And so far there seems to be
a lot of promise except for one thing I can''t figure out as yet --
the above problem.
Say I have the following conceptual relationships:
ITEMS <<--->> CARTS
i.e., each item can belong to one or more categories. So really
2017 Feb 01
2
time zone
> Date: Tuesday, January 31, 2017 19:35:46 -0500
> From: TE Dukes <tdukes at palmettoshopper.com>
>
>> From: CentOS [mailto:centos-bounces at centos.org] On Behalf Of
>> Richard Sent: Tuesday, January 31, 2017 6:46 PM
>>
>> > Date: Tuesday, January 31, 2017 18:16:36 -0500
>> > From: TE Dukes <tdukes at palmettoshopper.com>
>> >
2007 Sep 11
2
Missing data
Hi all,
I'm looking for a contributed package that can provide a detailed
account of missing data patterns and perhaps also provide imputation
procedures, such as mean imputation or hot deck imputation and the like.
Is there anything out there?
Thanks in advance,
David
--
===========================================================================
David Kaplan, Ph.D.
Professor
2006 Sep 27
1
Any hot-deck imputation packages?
Hi
I found on google that there is an implementation of hot-deck imputation in
SAS:
http://ideas.repec.org/c/boc/bocode/s366901.html
Is there anything similar in R?
Many Thanks
Eleni Rapsomaniki
2009 Jul 27
2
Multiple graphs
Hi,
I wrote a simple master function, run(), that has inside six qplot
functions. The goal is to type run() and have all six graphs appear as
separate windows so that I can copy them into PowerPoint for a client.
When I type run(), only the last graph appears, the first five
apparently being overwritten. How do I get all six in separate windows,
ready for copying?
By the way, is the a way
2019 Nov 26
5
debug build busts memory
The linking state of a Debug build seems to require a humongous amount of
memory. My poor little linux machine with 16G of ram swaps its brains out.
Waiting for it to finish (if it ever does) is like the old days when you
submitted your deck of cards and waited until the next day to see the results.
To debug a new backend, is there a way to just get the debug info for the
Target/Foo
2013 Nov 25
0
INTERNAL ERROR: Signal 6
Hallo list,
I am running a samba server on Arch Linux. From time to time I get this error
message in the system log (journalctrl, log from systemd). I have read the
Trouble-Shooting section of the Samba HOWTO as pointed out in the error, but I
could not find anything related. Can s.o. please tell me how to approach this
error, or even tell me that the reason could be.
Any help is really
2007 Oct 27
2
mp3 recorder?
I have my tape deck connected to my PC's line-in port, but Audacity's
unstable release is unable to pick up the audio, though when I select the
proper device and play with the volume control in the app, the audio does
change.
What other mp3 capture programs do people use? My goal is to simply
capture each side of a tape to mp3, then use Audacity to break each song
to its own mp3
2009 Jan 16
1
PDF slided (beamer or prosper) to an editable PPT
Hello, I am getting requests to place our PDF slides (output from
beamer) into Microsoft Powerpoint formats (.ppt). What's the best
practice or any recommended software packages (any success with open or
commercial) that we can use to convert PDF slides into an EDITABLE
powerpoint deck?
Thanks in advance.
2013 May 11
2
Tier 1 Service Providers (AT&T, Level 3)
Anyone here using Level 3 or AT&T wholesale sip terminations services? I
would like to know on any minimums they would require? Also, an idea of how
competitive the rates are. I am not asking to disclose your custom rate
deck, just a "what to expect". Finally, if you guys can PM me contact info
to someone from the wholesale department, I would really appreciate it.
Kind Regards,
2011 May 06
1
Replacing missing values with values before it
I'm using the survey api. I am taking 1000 samples of size of 100 and replacing 20 of those values with missing values. Im trying to use sequential hot deck imputation, and thus I am trying to figure out how to replace missing values with the value before it. Other things I have to keep in mind is if there are two missing values side by side, how do I replace both those values with the value
2008 Apr 09
3
permutation/randomization
Hello,
I have what I suspect might be an easy problem but I am new to R and
stumped. I have a data set that looks something like this
b<-c(2,3,4,5,6,7,8,9)
x<-c(2,3,4,5,6,7,8,9)
y<-c(9,8,7,6,5,4,3,2)
z<-c(9,8,7,6,1,2,3,4)
data<-cbind(x,y,z)
row.names(data)<-c('a','b','c','d','e','f','g','h')
which gives:
x y z