similar to: Need very fast application of 'diff' - ideas?

Displaying 20 results from an estimated 500 matches similar to: "Need very fast application of 'diff' - ideas?"

2011 Jan 05
3
How to 'explode' a matrix
Hi everyone, I'm looking for a way to 'explode' a matrix like this: > matrix(1:4,2,2) [,1] [,2] [1,] 1 3 [2,] 2 4 into a matrix like this: > matrix(c(1,1,2,2,1,1,2,2,3,3,4,4,3,3,4,4),4,4) [,1] [,2] [,3] [,4] [1,] 1 1 3 3 [2,] 1 1 3 3 [3,] 2 2 4 4 [4,] 2 2 4 4 My current kludge is this:
2011 Jan 05
4
Match numeric vector against rows in a matrix?
Two posts in one day is not a good day...and this question seems like it should have an obvious answer: I have a matrix where rows are unique combinations of 1's and 0's: > combs=as.matrix(expand.grid(c(0,1),c(0,1))) > combs Var1 Var2 [1,] 0 0 [2,] 1 0 [3,] 0 1 [4,] 1 1 I want a single function that will give the row index containing an exact match
2006 Apr 24
5
merging one array into another
Is there no better way to merge one array into another than iterating over the array you wish to append with each() and push()ing the elements on to the other array? Here''s what I mean: var arr1 = [1, 2, 3, 4, 5]; var arr2 = [''a'', ''b'', ''c'']; $A(arr2).each(function(el) { arr1.push(el) }); Is there no better way to do it than this?
2014 Aug 01
2
[LLVMdev] Create "appending" section that can be partially dead stripped
Hi, Is there a way in llvm IR to emit multiple data elements within a single compilation unit that a) are guaranteed to appear sequentially in the final binary (in the order they appear in the llvm IR), and b) will be removed on an individual basis by the optimizers and/or linker in case they are not referenced from anywhere ? Defining them as "appending" puts them all into a
2011 Apr 14
3
Find number of elements less than some number: Elegant/fast solution needed
Take vector x and a subset y: x=1:10 y=c(4,5,7,9) For each value in 'x', I want to know how many elements in 'y' are less than 'x'. An example would be: sapply(x,FUN=function(i) {length(which(y<i))}) [1] 0 0 0 0 1 2 2 3 3 4 But this solution is far too slow when x and y have lengths in the millions. I'm certain an elegant (and computationally efficient)
2013 Mar 15
2
missing values in an array
Dear All, I've an array with some missing values (NA) in between. I want to remove that particular matrix if a missing value is detected. How can I do so? Thank you very much. Best regards, Ray [[alternative HTML version deleted]]
2019 Jan 15
2
Reducing the number of ptrtoint/inttoptrs that are generated by LLVM
Hello Chandler, > ``` > void f(int *arr1, int *arr2, int length) { > intptr_t rel_offset = arr2 - arr1; > int *arr1_end = arr1 + length; > for (int *p = arr1; p < arr1_end; p += sizeof(int)) { > do_something(p, p + rel_offset); > } > } > ``` > > For example, a common loop optimization technique is something like the following in *pseudocode* (note
2019 Jan 14
4
Reducing the number of ptrtoint/inttoptrs that are generated by LLVM
Hello Chandler, > First and foremost - how do you address correctness issues here? Because the subtraction `A - B` can escape/capture more things. Specifically, if one of `A` or `B` is escaped/captured, the > subtraction can be used to escape or capture the other pointer. So *some* of the conservative treatment is necessary. What is the plan to update all the analyses to remain correct?
2006 Aug 04
3
Building a random walk vector
I'm studying R in my free time. I want to build a vector where each element is equal to the element before it in the sequence plus some random tweak. In python, I would write: vec = [100] * 50 # make a 50-element list with each element set to 100 from random import randint for i, v in enumerate(vec): if i is not 0: # if we're not on the first element vec[i] = vec[i-1] +
2011 Jul 17
1
[LLVMdev] vmkit runtime errors
Hi LLVM developers, I have successfully installed LLVM 2.9 on an ubuntu linux box, with a LLVM-based frontend support of gcc and g++. After installing successfully vmkit I have tried running my java applications, but it failed. I have installed the latest stable release of vmkit (0.29) using the introduction text of the LLVM website. The application does consist of two programs. The first
2018 Jul 22
2
R History: Why is there no importFrom() function?
Excuse me if this is inappropriate content for this list, but I thought it might be the best place -- and the best audience -- to ask about a design decision for the R language. Programs or analyses written in R typically use library() to pull in functions from non-core packages. This differs markedly from most languages*, which usually offer some way to selectively import symbols. For example,
2013 Apr 16
1
converting blank cells to NAs
You can use na.strings="" in read.table() or read.csv() library(stringr) vec1<-unlist(str_split(readLines(textConnection("3,7,11,,12,14,15,,17,18,19")),",")) ?vec1[vec1==""]<- NA ?vec1 # [1] "3"? "7"? "11" NA?? "12" "14" "15" NA?? "17" "18" "19" #or
2014 Aug 02
2
[LLVMdev] Create "appending" section that can be partially dead stripped
On 01/08/14 19:37, Reid Kleckner wrote: > What happens if you drop appending linkage? I think it will just work, > since you are already using a custom section, which will ensure that all > the data appears contiguously in memory. Thanks for the suggestion, but it still puts everything in a single .section statement. > Although, I do worry about what LLVM's alias analysis will
2010 Apr 09
3
[LLVMdev] VMKit assertion failure
On 09.04.2010, at 11:28, nicolas geoffray wrote: > VMKit runs multiple threads (for example for GC, finalization, etc), > so I need the back trace of other threads as well :) Here it comes: Thread 4 (process 14442 thread 0x2003): #0 0x950be44e in __semwait_signal () #1 0x950e93e6 in _pthread_cond_wait () #2 0x950e8dcd in pthread_cond_wait$UNIX2003 () #3 0x000be2d2 in mvm::Cond::wait
2009 Dec 12
1
Create sequence given start and end vector
How can I create the following without the 'for' loop? start=c(1,10,20) end=c(4,15,27) out=c() for (i in 1:length(start)) { out=c(out,start[i]:end[i]) } out [1] 1 2 3 4 10 11 12 13 14 15 20 21 22 23 24 25 26 27 I know there must be an easier (and, hopefully, faster) way. Many thanks in advance, Kevin Ummel Central European University Department of Environmental Science and
2013 May 14
1
PuppetDB Cannot Find Postgresql Driver
Puppet 3.3.1 // CentOS release 6.4 (Final) rpm -qa | grep puppet puppetlabs-release-6-7.noarch puppet-3.1.1-1.el6.noarch puppetdb-1.3.0-1.el6.noarch puppet-server-3.1.1-1.el6.noarch puppetdb-terminus-1.3.0-1.el6.noarch Installed from yum packages: Running Transaction Installing : puppetdb-1.3.0-1.el6.noarch
2023 Nov 22
1
mediaplayer for icecast streams?
you can pull it with jQuery via javascript for example evry 10 seconds, and update the informations you want, at least its the way i do it. Am 23.11.2023 um 00:13 schrieb Thomas Jensen: > Thank you, Ben! > > I was afraid it would be very complicated to get the information > extracted, but it was very simple. My only problem now is to find a way > to update the text on the
2023 Nov 22
1
mediaplayer for icecast streams?
Thank you, Ben! I was afraid it would be very complicated to get the information extracted, but it was very simple. My only problem now is to find a way to update the text on the webpage. I was hoping sleep(5) could do the trick, but it does not work. <?php if (1) { $jsonobj=file("http://radio.protestbandet.dk:8000/status-json.xsl"); //var_dump($jsonobj);
2010 Apr 09
0
[LLVMdev] VMKit assertion failure
VMKit runs multiple threads (for example for GC, finalization, etc), so I need the back trace of other threads as well :) Thanks! Nicolas On Fri, Apr 9, 2010 at 9:28 AM, Konrad Hinsen <konrad.hinsen at fastmail.net>wrote: > On 7 Apr 2010, at 21:36, nicolas geoffray wrote: > > Hmm, I am not getting that error message on my MacOS 10.5 machine with >> that same gcc. Could you
2006 Nov 21
2
Handle Options Method
Hi, I have an Alteon in test (a sip/rtp load balancer). This Alteon sends to the asterisk box a "SIP OPTIONS" to know if asterisk is alive. However, asterisk sends me a 404 message and not a response like, for example, a Thomson (200 + SDP) I wrote a very little script (you can find it at the end of the email) to send an Options message to asterisk/phones to try. It works