search for: arr2

Displaying 15 results from an estimated 15 matches for "arr2".

Did you mean: arr
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? Thanks! -Jeremy _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCw...
2014 Aug 01
2
[LLVMdev] Create "appending" section that can be partially dead stripped
...:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" define i32 @main() { %1 = getelementptr [2 x i8]* @arr1, i64 0, i32 0 %2 = load i8* %1 %3 = zext i8 %2 to i32 ret i32 %3 } @arr1 = appending global [2 x i8] [ i8 1, i8 2 ], section "mytest" @arr2 = appending global [2 x i8] [ i8 3, i8 4 ], section "mytest" *** Since @arr2 is not referenced, I would like it to not appear in the final binary, but "clang -fdata-sections" generates: *** .type arr1, at object # @arr1 .section...
2006 Aug 04
4
cannot convert String into Integer
...ieve I have the algorithm down to do what I want, below. arr = @params[:query].split() condition = @params[:attribute].to_s + " LIKE ?" while num < arr.length condition += "and " + @params[:attribute].to_s + " LIKE ?" num += 1 end arr2 = [condition, "%#{arr[0]}%"] num = 1 while num < arr.length arr2 += ["%#{arr[" + num + "]}%"] # <--- cannot convert String into Integer num += 1 end At the noted line, I receive the error "cannot convert String into Integer"....
2013 Apr 16
1
converting blank cells to NAs
...quot;h"? "v"? "k" #[2,] "l"? "b"? "j"? "y" #[3,] "c"? "p"? "g"? "j" #[4,] "e"? "n"? "c"? "e" #[5,] "h"? "g"? NA?? "d"? ?arr2<- array(1:40,dim=c(5,4,2)) ?arr2[5,3,2]<- "" arr2[arr2==""]<- NA arr2<- apply(arr2,c(2,3),as.numeric) arr2[,,2] #???? [,1] [,2] [,3] [,4] #[1,]?? 21?? 26?? 31?? 36 #[2,]?? 22?? 27?? 32?? 37 #[3,]?? 23?? 28?? 33?? 38 #[4,]?? 24?? 29?? 34?? 39 #[5,]?? 25?? 30?? NA?? 40...
2012 Mar 13
1
Amount of memory occupied by data type
...he TRUE vs FALSE could be used to update data in the first array. (but even this idea may be weak if I just end up with a third temporary array...) I'm running win xp sp3, "R version 2.14.1 (2011-12-22)". Thanks very much. Michael ______________________ arr<-array(1:60,c(3,4,5)) arr2<-array(TRUE,c(3,4,5)) mode(arr) class(arr) storage.mode(arr) mode(arr2) class(arr2) storage.mode(arr2) object.size(arr) object.size(arr2) ______________________________________ Michael Folkes Salmon Stock Assessment Canadian Dept. of Fisheries & Oceans Pacific Biological Station 319...
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]]
2012 Sep 27
1
List of Variables in Original Order
I am trying to Sweave the output of calculating correlations between one variable and several others. I wanted to print a table where the odd-numbered rows contain the variable names and the even-numbered rows contain the correlations. So if VarA is correlated with all the variables in mydata.df, then it would look like var1 var2 var3 corr1 corr2 corr3 var4 var5
2012 Jan 28
2
Need very fast application of 'diff' - ideas?
...other languages, so I'm hoping the community has some ideas about how to approach this particular problem... Many thanks, Kevin In iPython: In [3]: import numpy as np In [4]: arr = np.random.randint(0, 1000, (10000000,1)).astype("int16") In [5]: arr1 = arr[1:].view() In [6]: timeit arr2 = arr1 - arr[:-1] 10 loops, best of 3: 20.1 ms per loop In Clojure: (defn subtract-lag [n] (let [v (take n (repeatedly rand))] (time (dorun (map - v (cons 0 v)))))) [[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...
2009 May 27
1
[LLVMdev] Ada bound checks
...ams that Ada already does some optimization to remove bound checks. Do you know how are they done, and where? I tested two codes (below) and the first code did not produce any bound check and the second produced two bound checks. -- -- Simple array example. -- with Gnat.Io; use Gnat.Io; procedure Arr2 is A: array(1..5) of Integer; -- Array subscripts 1 to 5. I: Integer; begin -- Read 'em in. for I in 1..5 loop Put("> "); Get(A(I)); end loop; -- Put 'em out in reverse order. Put("["); for I in reverse A'Range loop Put...
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
2014 Aug 05
2
[LLVMdev] Create "appending" section that can be partially dead stripped
...2:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64- f80:128:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" define i32 @main() { Entry: %sumvar = alloca i32 ; make the second and third element live by directly referring them %eleptr1 = getelementptr [2 x i32]* @arr2, i64 0, i32 0 %eleptr2 = getelementptr [2 x i32]* @arr3, i64 0, i32 0 %ele1 = load i32* %eleptr1 %ele2 = load i32* %eleptr2 %sum1 = add i32 %ele1, %ele2 store i32 %sum1, i32* %sumvar ; now loop over the entire array by using @arrstart and @arrstop %loopstop = ptrtoint [0 x i32]* @arrst...
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?
2010 Jan 16
3
Comparing dates in dataframes
I have two data frames. One (arr) has all arrivals to an airport for a year, and the other (gw) has the dates and quarter hour of the day when the weather is good. arr has a Date and quarter hour column. >names(arr) [1] "Date" "weekday" "hour" "month" "minute" [6] "quarter" "ICAO"
2018 Mar 23
5
RFC: Speculative Load Hardening (a Spectre variant #1 mitigation)
...alicious inputs ineffective and allowing attackers to use malicious data inputs to leak secret data. Here is an example, extracted and simplified from the Project Zero paper: ``` struct array { unsigned long length; unsigned char data[]; }; struct array *arr1 = ...; // small array struct array *arr2 = ...; // array of size 0x400 unsigned long untrusted_offset_from_caller = ...; if (untrusted_offset_from_caller < arr1->length) { unsigned char value = arr1->data[untrusted_offset_from_caller]; unsigned long index2 = ((value&1)*0x100)+0x200; unsigned char value2 = arr2->data[...