Displaying 20 results from an estimated 1000 matches similar to: "Prevent attribute from being changed with "attr_readonly""
2016 Apr 24
0
Dividing rows in groups
This will handle all the columns; it assumes the ones you want to start
with are in column 2 through the end:
> library(dplyr)
> df1 <- read.table(text = "ID A B
+ 1 1 2
+ 1 0 3
+ 2 5 NA
+ 2 1 3
+ 3 1 4
+ 4 NA NA
+ 4 0 1
+ 4
2009 Jul 02
0
validates_uniqueness_of and attr_readonly
I notice that I always want to prevent the unique key of a table from
being changed. Does that mean I always have to have attr_readonly right
after validates_uniqueness_of ? Is there a single function that
replaces both of these but has the same affect?
Thanks.
--------------------------------------------------------------------------------
Developing with Rails 2.3.2; Ruby 1.8.7 (2009-04-08
2007 Nov 16
1
small patch for attr_readonly
A small patch to fix attr_readonly when used in conjunction with
optimistic locking
Please Review:
http://dev.rubyonrails.org/ticket/10188
+1 if it works for you.
nick.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to
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 Mar 02
0
Implementing conditional read-only attributes of ActiveRecord objects
Hello,
my goal is to implement the option of specifying a condition in
attr_protected, attr_readonly and possibly other attribute methods in
ActiveRecord objects.
Rationale (example):
class User < AR:Base
# User should not be able to modify fields any more once they have
been verified
attr_readonly :firstname, :lastname, :gender_id, :birthdate, :if
=> :passport_verified?
# ...
end
2006 Dec 15
1
[PATCH] cube unfold distance
I have gone ahead and implemented the unfold distance option
as mentioned in the source.
the patch is here
http://home.comcast.net/~moppsy/compiz/cube-unfold-distance.patch
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
2013 Feb 14
3
list of matrices --> array
i'm somehow embarrassed to even ask this, but is there any built-in
method for doing this:
my_list <- list()
my_list[[1]] <- matrix(1:20, ncol = 5)
my_list[[2]] <- matrix(20:1, ncol = 5)
now, knowing that these matrices are identical in dimension, i'd like
to unfold the list to a 2x4x5 (or some other permutation of the dim
sizes) array.
i know i can initialize the array, then
2006 Oct 09
1
[PATCH] dbus terminate action
I was always annoyed that you couldn't terminate an action with dbus so
I have
written this patch which fixes that. Hopefully this can be included.
I wrote the patch trying to repeat as little code as possible so I just
added a boolean
parameter to the dbusHandleActivateMessage and changed the name to
dbusHandleActivateDeactivateMessage. You could probably change the
deactivate
parameter
2015 Jun 07
2
[LLVMdev] Loop Unfolding in LLVM
Hello,
I am looking for a loop unfolding procedure implemented in LLVM that helps
to transform a while-loop to n-layer If-statements. The transformation
should be on IR, although the example below is illustrated on the source
level.
original loop:
* WHILE (condition) DO
action
ENDWHILE*
Expected unfolded loop (2-layer):
* IF (condition) THEN*
* action*
* IF
2015 Mar 18
6
[LLVMdev] string input for the integrated assembler
Short version: If the integrated assembler accepted assembly strings
as input, more targets could take advantage of integrated assembly.
The longer version:
For a given assembly statement, my out-of-tree target has complex
instruction selection logic -- more so than the in-tree targets. This
target uses variable length instructions and a laborious hierarchy of
tblgen AsmOperands to do the job.
2007 Dec 16
4
Make AR setter methods private?
Hi,
I have a AR model that I want to limit changes to be only via instance
methods that I''ve added.
How do I prevent my other sw from setting the instance''s attributes?
I know about #attr_protected and #attr_readonly. But the first leaves
the individual setters as they were and the second stops all changes.
I want something like "attr_private"
Thoughts?
Thanks,
2011 Apr 07
0
python for game menus needing mouse but with mwo=force
#
#
# WHY DID WRITE SCRIPT ? : GAMES !
# WINETRICKS MWO=FORCE but want to use GAME MENUS with MOUSE
# example SWAT4 , need to use menu in game to start shooting baddies !! but need MWO=FORCE in game ??
#
# PLATFORM : linux
# REQUIRES : python python-xlib xdotool
# AUTHOR : terry.cadd at gmail.com
# DATE : Thu Apr 7 22:28:38 BST 2011
# VERSION : 1
#
# USAGE :
# start this script then play the
2016 Oct 23
2
Outliner plugin for editor
I am currently running not only Geany (on CentOS and on Windows) but also Gedit on CentOS, much of the use is as markdown-editors being a recent convert to this language. I would, however, also like to be able to essentially use it as an outliner - remember the old DOS outliners that were great for creating document outlines?
It would have been perfect had I been able to fold and unfold sections
2010 Jun 15
4
dovecot vs. Thunderbird
Hello (and Moin Moin) ;)
I have currently a straith Problem ...
I have our IMAP-Server migrated from an old cyrus the the current stable
Version of dovecot.
In the old configuration we organized many mails (e.g. root-Stuff) in
Public Folders. They structure had nearly 5 folderlevels.
After the complete migration an syncronize we switch complete to the
dovecot setup.
At this moment we have
2011 Dec 21
2
[LLVMdev] The name of LLVM
Hi LLVM,
I have a question that is irrelevant to LLVM developing, but do not
know where to post. I found the LLVM webpage uses the following new
introduction of LLVM
"The LLVM Project is a collection of modular and reusable compiler
and toolchain technologies. Despite its name, LLVM has little to do
with traditional virtual machines, ..."
I remember the old webpage said that LLVM =
2009 Nov 11
1
fitting a glm with matrix of responses
hi all - quick question:
i have a matrix 'y' of response values, with two explanatory variables
'x1' and 'x2'.
tested values of 'x1' and 'x2' are sitting in two vectors 'x1' and
'x2'.
i want to learn model parameters without "unrolling" the matrix of
response values.
example below:
# some fake data for the example
x1 <- 1:5
x2
2016 Oct 23
1
Outliner plugin for editor
Thank you. Ideally, however, I would like to continue using Geany or gedit. I have found a "gnome outliner" on the 'net but that seems not have been updated for a very long time...
On 10/22/2016 9:46 PM, Phil Wyett wrote:
> On Sat, 2016-10-22 at 21:28 -0400, H wrote:
>> I am currently running not only Geany (on CentOS and on Windows) but also Gedit on CentOS, much of the
2007 Apr 12
1
[PATCH] Transparent cube
Hi,
Recently i have worked on re-writing beryl's transparent cube, and
ported 3d plugin to compiz.
I'm attaching a patchset here that includes the transparent cube
patches (i'll post the 3d plugin when i fix some problems that didn't
happen in beryl).
Patching order: btf-ftb.patch, clip-planes.patch, plugin-events.patch,
cube-paint-order.patch, transparent-cube.patch.
Special
2015 Mar 18
2
[LLVMdev] string input for the integrated assembler
On Tue, Mar 17, 2015 at 6:14 PM, Tim Northover <t.p.northover at gmail.com> wrote:
>> As a simplification, the compiler deals almost exclusively in pseudo
>> instructions. By x86 analogy, using pseudos to unfold a TEST32rm into
>> MOV32rm + TEST32rr means I can skip the complex operand fitting effort
>> needed to pick specific machine instructions. There are many