Displaying 20 results from an estimated 400 matches similar to: "cumsum over varying column lengths"
2011 Jun 29
5
Enhance sftp protocol: get SHA hash of file
Hi,
it would be great, if the sftp protocol could be
enhanced: get sha (or other hash value) from a file or part of a file.
This would make it possible to run a rsync like file transfer
on sftp.
I would suggest a protocol like this
Client sends to Server:
get-supported hash-methods
returns whitespace seperated list like md5 sha1 sha256 ....
get-hash HASH-METHOD FILENAME STARTOFFSET
2001 Nov 22
14
Small vorbis files with vorbisfile
I think I have bumped into the small file error, or I''m doing something
stupid. The files are short audio effects for a game (embedded in our own
data format).
Sample info:
Vorbis packets: 1 (4 kb)
Samples: 28672
Samplerate: 22 kHz
Channels: 2
This is what I''m doing when I want to get a number of bytes from the stream:
The problem is that ov_pcm_tell always returns 0. And so
2013 Feb 06
0
[LLVMdev] [llvm] r174463 - Initial support for DWARF CFI parsing and dumping in LLVM
llvm[2]: Compiling DWARFDebugArangeSet.cpp for Debug+Asserts build
llvm[2]: Compiling DWARFDebugAranges.cpp for Debug+Asserts build
llvm[2]: Compiling DWARFDebugFrame.cpp for Debug+Asserts build
/home/rkotler/llvm_trunk/lib/DebugInfo/DWARFDebugFrame.cpp:118:8: error:
private field 'LinkedCIE' is not used
[-Werror,-Wunused-private-field]
CIE *LinkedCIE;
^
1 error
2012 Mar 19
24
[PATCHv2 00/11] arm: pass a device tree to dom0
This series of patches makes Xen pass a (somewhat) valid device tree
to dom0. The device tree for dom0 is the same as the one supplied to
Xen except the memory and chosen nodes are adjusted appropriately.
We don''t yet make use of the device tree to map MMIO regions or setup
interrupts for the guest and we still include the UART used for Xen''s
console.
Note that loading Linux
2012 Feb 29
15
[RFC] [PATCH] Add btrfs autosnap feature
From: anand jain <anand.jain@oracle.com>
Anand Jain (1):
[RFC] Add btrfs autosnap feature
Makefile | 6 +-
autosnap.c | 1553 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
autosnap.h | 81 +++
btrfs-list.c | 140 +++++-
btrfs.c | 46 ++-
btrfs_cmds.c | 186 +++++++-
btrfs_cmds.h | 3 +-
scrub.c | 1 +
8 files changed, 1982 insertions(+), 34
2012 Jan 15
1
problem with table.CAPM in PerformanceAnalytics
All,
I'm attempting to run this:
table.CAPM(series[,"Strat.Return",drop=FALSE],series[,"spy.Return",drop=FALSE])
and getting this error
Error in as.vector(data[, i]) : subscript out of bounds
I've searched around and cannot find a solution to the problem. I've used this in the past without problem and I'm not sure what I did different this time.
Other
2008 Jul 02
5
multiplication question
folks,
is there a clever way to compute the sum of the product of two vectors such that the common indices are not multiplied together?
i.e. if i have vectors X, Y, how can i compute
Sum (X[i] * Y[j])
i != j
where i != j
also, what if i wanted
Sum (X[i] * Y[j] * R[i, j])
i != j
where R is a matrix?
thanks,
murali
2011 Apr 02
0
cumsum while maintaining NA
Here's one way .....
Lines<-"x1 x2 x3 x4 x5 x6
NA NA 3 4 NA NA
5 3 4 NA NA NA
7 3 4 4 NA NA
11 3 4 5 NA NA
67 4 4 NA NA NA"
d <- read.table(textConnection(Lines), header = TRUE,
colClasses=c("integer"))
closeAllConnections()
res = t(apply(d, 1, function(x) ave(x,is.na(x),FUN=cumsum)))
print(res)
x1 x2 x3 x4 x5 x6
[1,] NA NA 3 7 NA NA
[2,] 5 8 12 NA NA NA
2012 Feb 14
0
cumsum formula to determine plankton phenology
Dear R-users
--
-- Heather Anne
-------------------------------------------
Heather A. Wright, PhD candidate
Ecology and Evolution of Plankton
Stazione Zoologica Anton Dohrn
Villa Comunale
80121 - Napoli, Italy
website<http://www.szn.it/SZNWeb/cmd/ShowArchiveItem?TYPE_ID=HUMANRESOURCE&ITEM_ID=21942&LANGUAGE_ID=2>
Lab: +39 081 583 3201
Cell: +39 366 484 2196
Fax: +39 081 764 1355
*
2010 Mar 23
2
Decreasing Cumsum Function?
Hi all,
I have a frequency data that looks like this.
3
2
1
5
What I want to get is the "decreasing" cumulative of this data
yielding
11
8
6
5
0
Is there any?
I am aware of cumsum(), which will yield
3
5
6
11.
But it is not what I want.
- G.V.
2016 Jun 09
1
cumsum method in Math group
When running
a = runif(10)
class(a) = "foo"
Math.foo = function(x, ...) {
NextMethod(.Generic)
}
signif(a, 3)
cumsum(a)
I don't understand why cumsum strips the class, but signif does not.
Both claim in the documentation that "These are generic functions:
methods can be defined for them individually or via the ?Math? group
generic."
--
Edzer Pebesma
Institute for
2017 Jan 20
1
NaN behavior of cumsum
Hi!
I noticed that cumsum behaves different than the other cumulative functions wrt. NaN values:
> values <- c(1,2,NaN,1)
> for ( f in c(cumsum, cumprod, cummin, cummax)) print(f(values))
[1] 1 3 NA NA
[1] 1 2 NaN NaN
[1] 1 1 NaN NaN
[1] 1 2 NaN NaN
The reason is that cumsum (in cum.c:33) contains an explicit check for ISNAN.
Is that intentional?
IMHO, ISNA would be better
2020 Aug 25
0
sum() vs cumsum() implicit type coercion
On 8/23/20 5:02 PM, Rory Winston wrote:
> Hi
>
> I noticed a small inconsistency when using sum() vs cumsum()
>
> I have a char-based series
>
> > tryjpy$long
>
> [1] "0.0022" "-0.0002" "-0.0149" "-0.0023" "-0.0342" "-0.0245" "-0.0022"
>
> [8] "0.0003" "-0.0001"
2001 Oct 18
0
Numerical precision of hist densities or cumsum?
Today I wanted to experiment with different distributions an to see the
hazard rates they imply. So I eventually ended up with this, which uses
the hist object's handy $density and the cumsum function in R:
x <- c(rweibull(21000,0.5,0.7))
#create "breaks" vector to go into histogram
#need last break bigger than max(x)
y <- seq(0,max(x)+2)
histx <-
2007 Nov 03
2
cumsum
Hi, my problem belongs to the basic ones. I want to get cumulated sum over
the matrix columns by one command (if such exists). Ordinary R's cumsum(x)
when x is:
[,1] [,2]
[1,] 1 5
[2,] 2 6
[3,] 3 7
[4,] 4 8
yields: 1 3 6 10 15 21 28 36
I want:
[,1] [,2]
[1,] 1 5
[2,] 3 11
[3,] 6 18
[4,] 10 26
Is there any command to do so??
best,
2008 Oct 03
1
Bug or inaccuracy in cumsum( )
I came across this: shouldn't the last value be a more exact zero?
It did not do that with 1 - sum( rep(0.1, 10) )
> 1 - cumsum( rep(0.1, 10) )
[1] 9.000000e-01 8.000000e-01 7.000000e-01 6.000000e-01 5.000000e-01
4.000000e-01 3.000000e-01 2.000000e-01
[9] 1.000000e-01 1.110223e-16
> version
_
platform
2009 Feb 17
2
cumsum vs. sum
I recently traced a bug of mine to the fact that cumsum(s)[length(s)]
is not always exactly equal to sum(s).
For example,
x<-1/(12:14)
sum(x) - cumsum(x)[3] => 2.8e-17
Floating-point addition is of course not exact, and in particular is
not associative, so there are various possible reasons for this.
Perhaps sum uses clever summing tricks to get more accurate results?
In some
2009 Sep 16
2
Generalized cumsum?
Is there anything like cumsum and cumprod but which allows you to
apply an arbitrary function instead of sum and product? In other words,
I want a function cumfunc(x, f) that returns a vector, so that for all n
up to the length of x
cumapply(x,f)[n] = f(x[1:n])
This would give cumsum and cumprod as special cases when f=sum or
f=prod.
I could write such a function, but I can't see
2012 Aug 01
0
Plotting cumsum data using lattice plots according to date conditioned by name.
I've been playing around with data like the following:
Name Date Hrs
Way, S 2-3-12 8
Nun, B 2-3-12 9
Way, S 2-4-12 7.5
Nun, B 2-4-12 9
Gus, T 2-5-12 8
I've been able to take this into a data.frame and even develop a cumsum
for each of the people
d.cum <- with(data,by(Hrs,
INDICES=list(date=as.POSIXct(Name)),FUN=cumsum))
This gives me a list personnel with an array
2024 Sep 28
1
lattice xyplot with cumsum() function inside
This code gives unexpected result.
library(data.table)
library(lattice)
set.seed(123)
mydt <- data.table(date = seq.Date(as.IDate("2024-01-01"), by = 1,
length.out = 50), xgroup = "A", x = runif(50, 0, 1))
mydt <- rbindlist(list(mydt, data.table(date = mydt$date, xgroup = "B", x = runif(50, 0, 3))))
mydt[, `:=`(xcumsum = cumsum(x)), by = .(xgroup)]
mydt[,