search for: amount

Displaying 20 results from an estimated 15636 matches for "amount".

2006 Apr 14
3
Updateform with a has_many relationship ?
Hello all, I would like to be able to update the "amount" of a certain item in me order list. The problem I run into is how to define the text_field element. @order is the current order, which has_many :order_item which in turn belongs_to :order. order_item has a field "amount" which should be modified... What I tried is this below,...
2009 Oct 29
2
The 'subset matching' challenge
Dear all, The following problem just has been submitted to me by an accountant. In his new job, he has to close some old accounts. He has yearly amounts, and a list of products that have been bought over the years, at certain prices for which he has an exhaustive record. The problem is: He does not know what product was bought this or that year (don't ask). He does not want to find back the real story, but just write realistic accounts, fo...
2008 Jun 10
5
Rails params parsing bug?
I have a form that sends the following query string to my Rails controller: transaxion[category_association_attributes][][category_id]=2& transaxion[category_association_attributes][][amount]=12& transaxion[category_association_attributes][][category_id]=1& transaxion[category_association_attributes][][amount]=8 But ActionController parses it as: category_association_attributes" => [ {"category_id"=>"2"}, {"category_id"=>&qu...
2009 Sep 19
3
Replacing values in dataframes
...> NAD[1:3,1:3] Sample.Id Main.abs..1 Main.abs..2 148 10a 0.04836 0.04994 167 11a_1109 0.32245 0.36541 173 11b_1109 0.29293 0.32815 What I want to do is to replace the Sample.Id with a corresponding number.The number i have in another file,called Prot.amount > Prot.amount[1:3,1] 10a 11a_1109 11b_1109 15.516 38.248 42.297 > row.names(NAD)<-(NAD[,1]) > NAD$Sample.Id <- replace(NAD$Sample.Id, NAD$Sample.Id=="10a",Prot.amount["10a",1]) > NAD[1:3,1:3] Sample.Id Main.abs..1 Main.abs..2 1...
2020 Jun 23
2
[RFC] Small Bitfield utilities
...Making bit field manipulation easier seems like a good overall goal given its prevalence in LLVM. As for the syntax, I tend to prefer that we don't pollute the namespace. Have you considered pushing the methods into the Bitfield class? Maybe something like: ``` uint8_t Storage = 0; using Amount = Bitfield::Element<unsigned, 0, 4>; Bitfield::set<Amount>(Storage, true); unsigned Value = Bitfield::get<Amount>(Storage); bool Cond = Bitfield::test<Amount>(Storage); ``` ^ Seems good to me because it's clear what the API is doing, even without knowing what `Am...
2006 Aug 12
1
Strategy pattern: comparing Context/Specify to Given/When/Then
Comments and suggestions for improving the specifications are welcome. Thanks, Alvin One example comparing context/specify (CS) with given/when/then (GWT) with a strategy pattern follows: Consider a pipeline transporting oil supplied by multiple partners. The amounts transported on behalf of each partner are recorded as transactions in a general ledger. There are multiple approaches to allocating the pipeline operational costs to each partner: - fixed amount - equal split - fixed percentage - gross override with subsidiary cost allocation - proporti...
2007 Jan 04
6
after_update attributes problem
...TEST: def test_register_item_adjusts_account_balance account = accounts(:cams_credit_card) transaction = RegisterItem.new(:date => ''2006-10-31'', :description => ''Chinese food'', :amount => ''-13.44'') transaction.account = account transaction.save assert_equal -113.44, account.balance #this assertion passes transaction.amount = -15.50 transaction.save assert_equal -115.50, account.balance # FAILS transaction.destroy assert_equa...
2018 Dec 06
2
New to LLVM. Need help generating assembly
Hi, I'm new to LLVM and need some help. I defined an instruction to increment the stack pointer by 'amount' (i.e. sp = sp + amount). During assembly generation, the string that gets emitted is "ADS $SP" rather than "ADS 10", for example, if I want to increment it by 10. Can somebody show me what I'm doing wrong? Thanks. def ADS: F_J<0b100001,(outs),(ins i32imm:$amount),...
2020 Jun 11
2
[RFC] Small Bitfield utilities
TL;DR: Have support in ADT for typed values packing into opaque scalar types - Code & design choices: https://reviews.llvm.org/D81580 - Usage: https://reviews.llvm.org/differential/changeset/?ref=2005337&whitespace=ignore-most - Example of rewrite: https://reviews.llvm.org/D81662 *CONTEXT* There are places in LLVM where we need to pack typed fields into opaque values. For instance,
2011 Nov 19
3
reshape data.frame
A late friday afternoon coding question. I'm having a hard time thinking of the correct search terms for what I want to do. If I have a df like this: a <- data.frame(name=c(rep('a',10),rep('b',15)),year=c(1971:1980,1971:1985),amount=1:25) name year amount 1 a 1971 1 2 a 1972 2 3 a 1973 3 4 a 1974 4 5 a 1975 5 6 a 1976 6 7 a 1977 7 8 a 1978 8 9 a 1979 9 10 a 1980 10 11 b 1971 11 12 b 1972 12 13 b 1973 13 14 b 1974...
2007 Sep 13
1
Problem using xtable on an array
...minimal example that displays this behaviour, so please bear with me to begin with. Observe: I create an array called model.mat. Some details on this: > str(model.mat) num [1:18, 1:4] -0.170 -0.304 -2.617 2.025 -1.610 ... - attr(*, "dimnames")=List of 2 ..$ : chr [1:18] "Amount: CP for VF" "Amount: CP for F" "Amount: CP for M" "Amount: RD for VF" ... ..$ : chr [1:4] "beta_0" "P-value" "beta_1" "P-value" It contains the following: > model.mat[1:2,] beta_0 P-value...
2018 Dec 06
3
New to LLVM. Need help generating assembly
> On Dec 5, 2018, at 22:15, Tom Stellard via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > On 12/05/2018 07:22 PM, m m via llvm-dev wrote: >> Hi, >> I'm new to LLVM and need some help. I defined an instruction to increment the stack pointer by 'amount' (i.e. sp = sp + amount). During assembly generation, the string that gets emitted is "ADS $SP" rather than "ADS 10", for example, if I want to increment it by 10. >> >> Can somebody show me what I'm doing wrong? >> Thanks. >> >> def ADS:...
2007 Jan 20
2
find_by_sql with named parameterized sql
I tried to use named parameters in my SQL query , using find_by_sql Order.find_by_sql ([select * from orders where amount > ? and quantity > ?", [ @amount, @quantity ] works;.. but Order.find_by_sql ([select * from orders where amount > :amount and quantity > :quantity ", [ :amount => @amt, :quantity => @qty ] is not working a I wrong or should I use a plain select string ? tfyl kad -...
2019 Jan 21
2
Amount of writes during index creation
Hi, I have had a problem report from a Recoll user about the amount of writes during index creation. https://opensourceprojects.eu/p/recoll1/tickets/67/ The issue is that the index is on SSD and that the amount of writes is significant compared to the SSD life expectancy (index size > 250 GB). >From the numbers he supplied, it seems to me that the total am...
2019 Oct 01
2
Shift-by-signext - sext is bad for analysis - ignore it's use count?
...hilipreames.com> wrote: > On 9/27/19 1:40 PM, Roman Lebedev via llvm-dev wrote: > > In https://reviews.llvm.org/D68103 the InstCombine learned that shift-by-sext > > is simply a shift-by-zext. > > Just to make sure I'm following, the reasoning here is that the shift > amount must be positive or the shift would produce poison? And thus, > it's safe to assume that the sext == zext because we've (at worst) > removed UB in the original program? Yes. zext and sext are equivalent for non-negative inputs. For negative inputs, sext will produce negative output. A...
2008 Oct 05
1
barchart for aggregated (sum) data in lattice?
Hi list, I have data in a dataframe t1, with a column for different amounts spent, a column what it was spent on, and a column with dates, from which I create a new column with months. Example: amount <- rep(c(10,20,30),3) what <- rep(c("food","books","cycling"),3) when <- c(rep("2008-09-05",5),rep("2008-10-07"...
2006 Jul 12
1
Question re: Computing a field in a DB record
I''m just learning Rails and have encountered a problem trying to set a field in a DB record based on the value of another form input field. Using the scaffold code, the create works as expected and the update (edit) also works. However, one of the DB fields (amount) is supposed to be computer from another (units): if the category field is "Mileage", amount= units * Fed_mileage_rate, otherwise amount= units. To accomplish this, I removed the amount field from the input form, as it is never entered directly, and put in an if statement to acco...
2006 Feb 16
2
simple association question
I have two models, Donor and Contribution, and have has_many and belongs_to set respectively. My question is regarding creation of associated objects. I''ll let the code speak: me = Donor.find(1) contribution = me.contributions.create do |e| e.amount = 164.00 e.category = Category.find(1) end I thought this was valid, but it doesn''t work properly - it appears to create a new Contribution, but does not associate it with the Donor (me). So, I tried this (using the build method): contribution = me.contributions.build do |e| e.a...
2019 Oct 01
2
Shift-by-signext - sext is bad for analysis - ignore it's use count?
The thing is, we *don't* "not demand" those high bits. We *don't* not care what's in those bits - IR shifts don't mask their shift amounts. I.e we can't replace `x >> (32-y)` with `x >> (-y)`, which would be legal transform should we not demand those bits. We very much demand them. We just know those bits to be zero. And i'm not sure how to convey that to SimplifyDemandedBits(). I can't pass the Known down th...
2012 Jan 19
3
What does the : operator mean in glm formulas
Hi, I see the following is the credit scoreing in R guide : m2<-glm(formula = good_bad ~ checking + duration + history+ purpose +amount + savings + employed + installp + marital + coapp +age + other + depends + telephon + foreign +checking:amount What does checking:amount mean? Regards, Xiaobo Gu