Displaying 20 results from an estimated 800 matches similar to: ""humanizing" model attributes presentation"
2006 Mar 09
1
[TIP] Making an intelligent form fields
After searching arround I found a quite smart solution to me for binding
form fields to model in an active way. I use aggregations with single
value objects such as
class Percentage
attr_accessor :value
def initialize(value)
@value = (value.is_a? String) ? value.tr('' %'', '''').to_f : value
end
def to_s
return unless value
2006 Feb 09
1
migration with PostgreSQL - function nextval does not exist
This might be a problem with postgresql, but I''m not sure. In a
migration I have renamed a table so I wanted to rename a sequencer as
well. It looks like:
execute "ALTER TABLE global_vacations_id_seq RENAME TO vacations_id_seq;"
execute "ALTER TABLE vacations ALTER COLUMN id SET DEFAULT
nextval(''vacations_id_seq''::regclass);"
But the process of
2005 Nov 03
9
[Idea] session-wide persistent variables
I was thinking about having instance variable stored and fetched from
session container automatically before calling an action and after the
action is finished. Using methodology of accessors it would look like:
class MyController < ActionController::Base
persistent_attr :person
def alfa
person = ''John Smith''
# render as usual view alfa.rhtml with anchor
2002 Jan 15
3
problem with --delete if I sync part of a dir
Hi,
I'm using rsync for a couple of things but I am at a point where I could not find a solution for my problem.
this is what I want to do:
rsync only the files i_* from a directory from machine A to machine Bi and delete them from machine B if they on longer exist on machine A.
so I use the command:
rsync -azv --stats -e ssh --delete i_* user@host:/dir/
When using this command the files
2011 Sep 06
1
Workers getting broken after some time
I have strange error that happens after couple of hours. Some instances
start to respond on any request with status code 500. Log file
unicorn.stderr.log gets populated with this error:
app error: undefined method `each'' for nil:NilClass (NoMethodError)
/usr/local/lib/ruby/gems/1.9.1/gems/rack-1.1.2/lib/rack/utils.rb:267:in
`initialize''
2012 Jun 05
1
data analysis problem
Dear R users,
I have data on 4 types of interest rates. These rates evolve over
time and across regions of countries . So for each type of interest
rates I want to run a regression of rates on some other variables.
So my regression for one type of interest rate will be I_{ij}_t= a
+regressors +error term.
where I_{ij}_t is the absolute difference in rates between two
locations i and j at time
2004 Dec 12
2
Help : generating correlation matrix with a particular structure
Hi,
I would like to generate a correlation matrix with a
particular structure. For example, a 3n x 3n matrix :
A_(nxn) aI_(nxn) bI_(nxn)
aI_(nxn) A_(nxn) cI_(nxn)
aI_(nxn) cI_(nxn) A_(nxn)
where
- A_(nxn) is a *specified* symmetric, positive
definite nxn matrix.
- I_(nxn) is an identity matrix of order n
- a, b, c are (any) real numbers
Many attempts have been unsuccessful because a
2011 Jul 11
1
Spectral Coherence
Greetings,
I would like to estimate a spectral coherence between
two timeseries. The stats : spectrum() returns a coh matrix
which estimates coherence (squared).
A basic test which from which i expect near-zero coherence:
x = rnorm(500)
y = rnorm(500)
xts = ts(x, frequency = 10)
yts = ts(y, frequency = 10)
gxy = spectrum( cbind( xts, yts ) )
plot( gxy $ freq, gxy $
2006 Mar 14
3
ActiveRecord row-by-row processing
I want to use ActiveRecord outside of Rails to do processing on large
tables. I want to be able to process the rows as they are retrieved
rather than having to store the results in an intermediate array.
Any suggestions?
Looks like I could hack the adapter to provide an accessor to the
underlying DBI handle. Anything cleaner than that?
2005 Nov 02
1
getting pagination to work on joined tables
As soon as I use Model.find(:all, :include => [...], :limit => 3) I
loose associations and can''t do :conditions on joined tables. I''m not
able to do pagination in such association.
Only solution I came up with is this beast:
# I set up a paginator:
@reos_pages = Paginator.new self,
Reo.count(conds.join('' AND ''),
2014 Mar 04
3
[LLVMdev] [cfe-dev] C++11 reverse iterators (was C++11 is here)
On Mon, Mar 3, 2014 at 12:26 AM, Chris Lattner <sabre at nondot.org> wrote:
>
> On Mar 2, 2014, at 8:53 PM, Renato Golin <renato.golin at linaro.org> wrote:
>
> > On 3 March 2014 12:32, Pete Cooper <peter_cooper at apple.com> wrote:
> >> Would those work with a foreach construct? Perhaps I forgot to mention
> that was what I'm trying to work out
2011 Aug 02
0
[LLVMdev] clang: Manual unfolding doesn't match automatic unfolding
Here's the code and compilation steps:
#include <stdint.h>
typedef unsigned int uint128_t __attribute__((mode(TI)));
typedef struct{
uint64_t l[5];
} s;
void f(s * restrict r, const s * restrict x, const s * restrict y) {
uint128_t t[5] = {0, 0, 0, 0, 0};
#define BODY(i,j) { int i_ = i < j ? i : j; int j_ = i < j ? j :
i; uint128_t m = (uint128_t) x->l[i_] *
2016 Jan 04
2
[BUG] 2.2.21 Panic: file imap-client.c: line 841 (client_check_command_hangs): assertion failed: (!have_wait_unfinished || unfinished_count > 0)
Hi,
I'm seeing the following in my logs. Twice so far, no idea what caused
it. I do however have the core dump if that is of any use.
> Jan 4 11:14:11 karif dovecot[20876]: imap(username): Panic: file imap-client.c: line 841 (client_check_command_hangs): assertion failed: (!have_wait_unfinished || unfinished_count > 0)
> Jan 4 11:14:11 karif dovecot[20876]: imap(username): Error:
2011 Jul 28
0
[LLVMdev] Spills and values present in both registers & stack
On Tue, Jul 26, 2011 at 11:35 AM, Taral <taralx at gmail.com> wrote:
>
> One piece of code I'm writing has a lot of intermediates, and I'm
> trying to optimize down the number of memory accesses. Here's a
> snippet from the start of the function, where I think there is some
> low-hanging fruit:
>
> # BB#0:
> pushq %rbp
> pushq %r15
2001 Sep 27
1
Passing an R matrix to a C program
Hello,
I'm starting to write a C function that gets
a list and a matrix from R. I'm using .Call
because I've undertood that this is recommended
to handle lists (am I wrong?). My problem is that I
can pass the matrix as a vector, but not as a 2D array.
For example, in the following simple C program:
#include <R.h>
#include <Rdefines.h>
SEXP printListElement(SEXP list,
2011 Jul 26
3
[LLVMdev] Spills and values present in both registers & stack
One piece of code I'm writing has a lot of intermediates, and I'm
trying to optimize down the number of memory accesses. Here's a
snippet from the start of the function, where I think there is some
low-hanging fruit:
# BB#0:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rcx
movq %rdi, -16(%rsp) # 8-byte Spill
movq (%rsi), %rdi
movq
2008 Feb 20
1
text_field_tag - different parameter name
Hi, I have one problem with validation
I am creating e-shop and I have products. This view look like this:
<% for product in @category.products %>
<div class="produktyBox">
<%= product.title %><br />
Price: <br />
<div style="color:red; font-size:large; font-weight:bold; margin-
bottom:5px"><%=
2008 May 25
2
record will absolutely not save! so weird, please help.
I have a weird problem going on. All of sudden, records for a certain
model will not save with #save Please take a look at this:
>> p = Payment.new(:payment_reason_id => 1, :payment_method_id => 1, :date => Date.today, :amount => ''5.00'', :payable => Student.find(608))
=> #<Payment id: nil, school_id: nil, payment_reason_id: 1,
payment_method_id: 1,
2005 Jul 23
1
Plugin development
Hi,
I have a few questions regarding copy and save_finish methods.
How can I get a filename or processing mail from the parameters you get in
that methods? How could I use the logger you use for dovecot inside my
plugin?
Thanks, Sebastjan
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2011 Jul 06
2
Logging a special message into Dovecot source code
Hi,
I wanna modify Dovecot source code.For that,I need to know how can we log a
special message into Dovecot source code?
I tried to write a function to write a message in a file and added it to
Dovecot source code,but it didn't work.
I'm wondering if we can use Dovecote logging functions,but I don't know what
are those functions and how can we use them.
Thanks in advance.
--