由买买提看人间百态

topics

全部话题 - 话题: array
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
yy
发帖数: 45
1
来自主题: Programming版 - perl array|hash question
suppose i have a array @a or hash @hash, which are already assigned some
values
I am wondering whether there is a way to reset this array or hash to be empty?
Thanks!
s*****c
发帖数: 753
2
来自主题: Programming版 - C++ OO approach to use multi-dim array for HPC
Why not put ndim in template also?
template class array;
Too many constructor. Either use stl:vector for dimlen, or the constructor
parameter is size_t *. Same can be done for ele. You could use a stl:vector, or an array (correct size is ensured by your main program). You could also define another template class called pixel, or point, or vector:
template class pixel
{
T data[N]
...
...
}
z***e
发帖数: 14
3
I saw a similar post in this board, and recalled my recent interview
experience. Got this question in Amazon interview. Although I failed, it is
still a good one.
My answer:
1. Create a hash table to store all integers in this array. O(n)
2. For each int, look for sum - int in the created hash tree. Since hash
tree is the fastest look-up table, we can take advantage from it. n*O(1)
3. So this is O(n) algorithm.
Then the guy gave me the array 1, 2, 10, 20, sum is 2. My answer will return
true obv
m****i
发帖数: 712
4
来自主题: Programming版 - array allocation in c
#include
int main()
{
int n;
scanf("%d",&n);
int a[n];
int i;
for(i=0;i {
a[i] = i;
printf ("%d ",a[i]);
}
return 1;
}
This code work,
But the compiler only know how big the array on run-time....
how the compiler allocate the array on stack during compile time?
M*m
发帖数: 141
5
it seems that if I do
int main(){
int a[] = {12, 23, 121};
//sizeof(a) returns 12 = 3*sizeof(int)
}
as stated in the sizeof definition, we can do sizeof of an object or a type.
so the question is
1. how does sizeof work for an array object,
2. how do we pass the array to a function as an object. so that we can get
the size in the same way as we do here.

or
mw
发帖数: 525
6
来自主题: Programming版 - 怎么判断int a[]的array的实际长度?
精华区里面的一道面试题。我没想明白。
我想到了有两种可能
1. while loop整个array一直到有个什么返回值错误
2. char* aa = (char*)a,把a转成string array后用strlen,不过刚才程序跑起来
居然len= 0,我想是没有放\0的关系?
有人有标答吗?谢谢了
s*******e
发帖数: 664
7
☆─────────────────────────────────────☆
jindj (见过没) 于 (Thu Jan 7 23:06:33 2010, 美东) 提到:
which one is faster in the example?
float f[10000];
going through its elements over and over using:
1. f[i] 下标变量
2. *(f+i) 指针位移
Long long ago, I had been told in class that the 2nd is faster; I did some
tests but the results are not consistent - it seems true for a "float" array
, but it's opposite for a "double" array. weird.
☆─────────────────────────────────────☆
bullmj (牛马甲) 于 (Thu Jan 7 23:25:
d****p
发帖数: 685
8
来自主题: Programming版 - C++里get array size的问题 (转载)
Took another look.
The error message from Solaris CC is against
template char (&array(T(&)[N]))[N];
The last [N] was treated a subscript operator and N was expected to be
constant.
If typedef template is supported in C++, we can get this around by
template
typedef T(&T_N_array)[N];
template T_N_array array(T(&)[N]);

a
or
d****j
发帖数: 293
9
来自主题: Programming版 - C++ Function Pointer Array 的问题
Essential C++ 第二章介绍了如何使用function pointer,我试了了一下,想获取一个
定义好的function pointer array的长度,却怎么也搞不定,请指教。
具体的问题是,有5中sequence,如fibonacci序列,squared序列,等等,假设有下列5
个对应的function,输入参数为 int size,返回一个size长度的const vector;
const vector* fibon_seq(int);
const vector* lucus_seq(int);
const vector* pell_seq(int);
const vector* triang_seq(int);
const vector* square_seq(int);
再有一个从一个vector中取出第n个元素的函数,参数为pos,要取的数字的位置,elem,
引用,存储返回值,fp,第三个是function pointer,具体如下:
bool seq_elem(int pos, int& elem, co... 阅读全帖
t****t
发帖数: 6806
10
i didn't say fun2 is wrong, i said it's poorly written. dunno what you are
arguing.
in my previous post, i said as long as it's a pointer it should be ok
(albeit bad style). if it points to something in stack, it won't be
a pointer, it will be an array. an array is never a pointer.

wrong,
,
something
is
t****t
发帖数: 6806
11
basically, if str is a pointer, then only thing allocated for str is space
for a pointer. so naturally str won't point to anything on stack, because
there's nothing (except the pointer itself) there. it has to point to the
string literal, doesn't it?
so that's why i said as long as it is a pointer. the type of pointer doesn't
matter, for C all kinds of pointers can be converted back and forth.
but i repeat, an array is never a pointer. if str is an array, it will be
wrong.

why
G**Y
发帖数: 33224
12
来自主题: Programming版 - javascript里面object和length 1的array
能不能把length 1的object自动变成array呀。
比如文件里,有些时候是一个记录,有时候是一串。
想统一处理。能不能在遇到一个记录的时候,自动转成array。
k**********g
发帖数: 989
13
来自主题: Programming版 - 请教改numpy array的dtype
Firstly, extract by column. The colon means to extract everything in that
dimension.
http://stackoverflow.com/questions/4455076/numpy-access-an-arra
Then, use "astype" to convert from a (column) array of strings to an array
of float
http://stackoverflow.com/questions/3877209/how-to-convert-an-ar
k**********g
发帖数: 989
14
来自主题: Programming版 - 请教改numpy array的dtype

Structured arrays (a.k.a. record arrays)
http://docs.scipy.org/doc/numpy/user/basics.rec.html
u***l
发帖数: 51
15
【 以下文字转载自 JobHunting 讨论区 】
发信人: until (there there), 信区: JobHunting
标 题: Leetcode上面的"Search in rotated sorted array II"
发信站: BBS 未名空间站 (Tue Nov 11 18:08:22 2014, 美东)
最优解时间复杂度是 O(n) 吗?
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).
可能有重复值
N********n
发帖数: 8363
16
来自主题: Programming版 - array如何get set?

You have to bind to either objects or public properties of an objects.
If these integers are public property of an array of objects then you
can bind it to the array w/ content being that integer property.
l******t
发帖数: 55733
17
题我都看不明白。number of times?那先对分找到然后前后找?这个2d array等宽?
你可以直接写一个1d坐标到2d坐标(按列算的)的map然后再对分。
大意啊,
total = r * c
x = n / r
y = n % r
然后1 to total对分,每次把对分点n换成x,y就行了。找到了前后再slide,也是1d到
2d转换了
s*****g
发帖数: 731
18
来自主题: Biology版 - Cytokine Array要怎么读啊
没用过任何array。不太懂。最近想测老鼠体内肺部cytokine的变化。
我找了下很多种cytokine array似乎都提到用laser scanner读取信号。这种scanner是
不是跟DNA microarray用的设备是一样的啊?我是不是只要找学校里DNA microarray
facility的人就成了。
这种读出来的数据是不是定量的啊。
谢谢。
h*******o
发帖数: 4884
19
最近作了一些Taqman的Low Density Array (LDA), 老板要cluster analysis
Array 小白,只会用data analysis assist那个软件, 里面有2个 选项,
一个是Pearson's Correlation 一个是 Euclidean Distance。
哪位大侠能深入浅出的给讲讲,有什么区别?
如果我相比较组间gene expression区别有多大,是不是用Euclidean Distance 比较好?
谢谢!
l****n
发帖数: 844
20
来自主题: Biology版 - NGS/Array Job opportunity -Illumina
希望能帮到自己人. New graduate/postdoc有做NGS或array的找工作看过来. 这个
position主要侧重technology/method development. Hiring manager希望找
biotechnology方面有经验的.
Advanced Research group in Illumina is currently looking for an assay
technology scientist, the person will play an integral role in
developing innovative assay technologies for second-generation
sequencing and DNA array platforms. Primary responsibilities will
include assay technology research and the integration of assays with
micro/nanofabrication technologies... 阅读全帖
n********k
发帖数: 2818
21
Hey, folks:
We are planning to perform some ChIP/RNA-Seq as well as miRNA array
analysis some time soon. I was wondering any of you could kind of share
some of your experience in general.
Thanks a lot.
Something like: which services do you use(in house, or company), software,
etc etc. Which protocols, Kits? Pros and Cons, critical steps and tricks...
how many reads do you have, is it enough to cover the genome or enough for
the purpose? replicates? what about mRNA v lncRNA v miRNA, do y... 阅读全帖
s******n
发帖数: 47
22
来自主题: Biology版 - 菜鸟请教:affymetrix array data
多谢回复!
听说用affy array data的文章,发表后都要求上传数据到公共服务器。
看到一些paper,想下载以下其中提到的详细的array data。。。
网上搜过一圈affy的网站,却不知何处下手, 麻烦大侠给个链接!
不甚感激!
s******s
发帖数: 13035
23
有抗体array啊,估计也有aptamer array。
有人做micro-western,就是上千个lane一起跑,有几千个抗体一类的
t**h
发帖数: 82
24
来自主题: Biology版 - Illumina Bead Array 效果怎么样
拟用Microarray筛选组织基因表达的差异。了解到Illumina Bead Array比The
Affymetrix GeneChip 便宜很多(一半的价钱)。请教Illumina Bead Array效果怎么
样?
p********o
发帖数: 312
25
good
You can see this paper from Yi Cui's group.
http://pubs.acs.org/doi/full/10.1021/nl802886y
Put a monolayer of silica nanoparticles on the surface of a Si wafer as mask
, wet
etch, you can get wire array or cone array.
The diameter is defined by the size of nanoparticles. 50nm is even too large
, hehe.
k*******d
发帖数: 1340
26
我对题目意思没理解清楚,求median是说k个array连起来的大array的median?
rank(A1,A2,...Ak,x)中的A1...Ak指的是什么?
A**u
发帖数: 2458
27
来自主题: Quant版 - Complexity of the max array problem
具体什么题目?
array里找 sub array 使得 sub sum最大的那个?
c*******7
发帖数: 2506
28
来自主题: Statistics版 - a question about sum() and array
SCORE was defined as a numeric array/
I want to sum some of the elements of the array, like
TOTAL=SUM(OF SCORE{1}-SCORE{14});
but it did not work.
How should I modify it?
Thanks.
o****o
发帖数: 8077
29
来自主题: Statistics版 - 觉得SAS array超难用
其实习惯了就好,SAS的数组挺好用,也很有用
试试这个代码,看看结果是啥:
data _null_;
array _x{5, 4} _temporary_ (20*0);
put "NOTE: " @8 _x[3, 2]= 7.2;
run;
试完了以后,再看看这个的结果,这样你对SAS数组的实现有更好的理解
data _null_;
array _x{5, 4} _temporary_ (10*0);
do i=1 to 5;
do j=1 to 4;
put "NOTE: " @8 i= j= _x[i, j]= 7.2;
end;
end;
run;
有包子么?谢了
s********8
发帖数: 50
30
Thanks for thinking for it , it is a good trial.
but after I tried the code below, I didn;t think it worked.
data Farray;
length Q29B4B A Q29B5B B Q29B6B C Q29B7B D Q29B8B E Q29B9B F Q29B10B G
Q29B11B H Q29B12B I Q29B13B G Q29B14B K Q29B15B $8;
%let lastletter = B;
Array Ftesta(*) Q29B4&lastletter--Q29B15&lastletter;
Array Ftestb(*) Q29B4&lastletter-Q29B15&lastletter;
K=DIM(Ftesta);
P=DIM(Ftestb);
put K= P=;
run;
in LOG K=22 instead of 12;
and P can not get any value since
ERROR: Missing nu... 阅读全帖
k*******a
发帖数: 772
31
来自主题: Statistics版 - 请教sas code (array 的问题)
array只能在data step里面用吧, 不过你可以用macro
有两种方法,第一个可以把所有值存到一个macro变量里面
proc sql ;
select distinct NGCODE into :array1 separated by " "
from sgroup;
第二个方法先得出所有值的个数,每个值存在一个macro里面array1-arrayn
proc sql ;
select count(distinct NGCODE) into :n from sgroup;
select distinct NGCODE into :array1-array%left(&n)
from sgroup;
quit;
这样所有的值都存到 array1 到 arrayn 这n个 macro variable了
w*******9
发帖数: 1433
32
来自主题: Statistics版 - SAS array 一问
现有一dataset, 里面的有很多variable 名字以fr_开头,有什么办法取出所有这些变
量名字并存在一个array里?或者不用array,有没有其它可以批量处理这些变量的办法?
谢谢!
x*******i
发帖数: 1237
33
来自主题: Statistics版 - 请教一个SAS ARRAY的问题
DATA time_variant1 time_variant2;
SET var_res;
ARRAY var {2} var1 var2;
ARRAY dataset {2} time_variant1 time_variant2;
DO i=1 to 2;
IF var_nm=var{i} THEN OUTPUT dataset{i};
END;
RUN;
为什么SYNTAX ERROR UNDER output dataset{i}?
THX!!
h***b
发帖数: 43
34
来自主题: Statistics版 - Question about the variable names in ARRAY
Sorry I can not input Chinese now.
I have some character variables, abc_1_ok,......,abc_50_ok. The numbers are
in the middle of the name, instead of at the end. When I run ARRAY, there
are two ERRORs shown as the following. I think the reason for the following
two errors is the variable name. If so, could any one of you tell me how to
deal with it? Thanks much!
ERROR: Alphabetic prefixes for enumerated variables {abc_1_ok - abc_50_ok}
are different.
ERROR: Too few variables defined for the dimen... 阅读全帖
k**g
发帖数: 1558
35
来自主题: Statistics版 - 求救简单的SAS array 出错
出错在这个array只对convcurr第一个act除以1936.27, 剩下的全部不变。大家知道问
题出在了哪里?谢谢!
%let convcurr=act che at gdwl ppent dpact;
data test;
set annualdata;
array convcurr[*] &convcurr;
do i=1 to dim(convcurr);

if curcd='ITL' then do;convcurr[i]=convcurr[i]/1936.27;curcd='EUR';end;
end;
run;
w*******y
发帖数: 60932
36
30 Day Price Guarantee
Free 30 Day TV returns
Free White Glove Delivery
This is Sony's Flagship Model w/ FULL Array LED Local Dimming!
Please Add Both Items To Cart & Proceed To Final Checkout55" Sony XBR-
55HX929 Bravia 3D 1080p 240Hz Built-In WiFi Full Array LED Local Dimming
HDTV:
http://www.us-appliance.com/xbr55hx929.html
Six Pairs of 3D Active Glasses:
http://www.us-appliance.com/6packtdgbr50.html
Other Available Models:
Sony KDL-55HX820 + 6 Pack of 3D Glasses = $2,100
us-appliance.com:
... 阅读全帖

发帖数: 1
37
From the suburbs of Richmond to the subdivisions of Chicago and even
Oklahoma City, an array of diverse candidates — many of them women, first-
time contenders or both — stormed to victory and ended the Republicans’
eight-year grip on the House majority.
s********n
发帖数: 5
38
二手交易风险自负!请自行验证是否合法和一手卡!:
我想卖的物品:
两个Lacie 2TB Quadra Hard Drive Array
单张面值:
可接受价格(必须明码标价!):
两个共$500
物品新旧要求:
邮寄方式要求:
本市
买卖双方谁承担邮寄损失(Required if not code only):
付款方式说明:
现金
其他补充说明:
购买三个月,速度非常快,可直接从中剪辑视频,因换8TB硬盘而割爱,具体参数请看B
&H网站信息:
http://www.bhphotovideo.com/c/product/598075-REG/LaCie_301352U_
广告的有效期:
物品来源(Required for All Cards!):
我的联系方式:
u*****[email protected]
Warranty期限:
能否证明是合法的一手卡?(Required for All Cards!):
state and zip:
纽约市
c****r
发帖数: 698
39
3730xl DNA Analyzer Capillary Array, 50 cm $5225
BigDye® Terminator v3.1 Cycle Sequencing Kit $1077
有货源的请站内联系。量大,长期!
b*******3
发帖数: 1531
40
【出售】100+ samsung array boost mobile@16 each
不单独邮寄。
email: [email protected]
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
请发email,不要pm,thanks.
b********e
发帖数: 470
41
来自主题: Faculty版 - nanohole array
请问有没有公司卖在玻璃上的gold nano-hole array?就是那种可以做plasmonics的。
多谢。
s********n
发帖数: 5
42
二手交易风险自负!请自行验证是否合法和一手卡!:
我想卖的物品:
两个Lacie 2TB Quadra Hard Drive Array
单张面值:
可接受价格(必须明码标价!):
两个共$500
物品新旧要求:
邮寄方式要求:
本市
买卖双方谁承担邮寄损失(Required if not code only):
付款方式说明:
现金
其他补充说明:
购买三个月,速度非常快,可直接从中剪辑视频,因换8TB硬盘而割爱,具体参数请看B
&H网站信息:
http://www.bhphotovideo.com/c/product/598075-REG/LaCie_301352U_
广告的有效期:
物品来源(Required for All Cards!):
我的联系方式:
u*****[email protected]
Warranty期限:
能否证明是合法的一手卡?(Required for All Cards!):
state and zip:
纽约市
c****r
发帖数: 698
43
3730xl DNA Analyzer Capillary Array, 50 cm $5225
BigDye® Terminator v3.1 Cycle Sequencing Kit $1077
有货源的请站内联系。量大,长期!
b*******3
发帖数: 1531
44
【出售】100+ samsung array boost mobile@16 each
不单独邮寄。
email: [email protected]
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
请发email,不要pm,thanks.
b*******3
发帖数: 1531
45
【出售】100+ samsung array boost mobile@20 each obo
不单独邮寄。
email: [email protected]
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
请发email,不要pm,thanks.
U****6
发帖数: 2175
46
买一对在家K歌应该很不错, 配上ZED 10fx, SM 58话筒, 2500元价格也能接受。
http://www.guitarcenter.com/Bose/F1-Model-812-Flexible-Array-Loudspeaker.gc
H*M
发帖数: 1268
47
is dsw complicated?
if we partition the array using the middle point, do it recursively, and con
nect the middle point with those two nodes returned from left child and righ
t child, the complexity will be:
T(n) = 2T(n/2) +O(1)
T(n) = O(n) too..
Am i missing something here?
y****i
发帖数: 23
48
来自主题: JobHunting版 - 两个sorted array找median
没给任何限制,那就多用m+n的空间,把A,B合成一个array O(m+n), 取median O(1)
m******9
发帖数: 968
49
有个关于inplace merge的题目没想明白:
two sorted arrays A and B,size 分别为m和n,需要in place merge它们,不能用
extra space
一个常见的题目是:A中有足够的空间可以另外容纳下整个B。这个题目可以用的方法是
: 用merge sort中merge的办法,都从A和B的最后一个元素开始往前scan,A[i] B[j]
哪个大,就将大的放置在A的尾端,下次比较将大的放置在次尾端,依次进行下去。O(m+n)
比如:
A: 1 3 5 _ _ _ _
B: 2 4 6 8
output: A: 1 2 3 4 5 6 8
但是另外一个变形的题目是: A就是A,没有另外的空间可以容纳B。
即:
A: 1 3 5
B: 2 4 6 8
结果应当是:
A: 1 2 3
B: 4 5 6 8
我知道的一个方法是利用selection sort的思想,每次都从A B中select一个min放在最
左端,然后下次选择sec min放在次左端,依次下去。O(n^2)
这种题目,大家有什么好办法吗? 谢了
G**********s
发帖数: 70
50
来自主题: JobHunting版 - 问个Array Puzzle题
Each line represents a different step and () signifies what is being moved this step and [] is what has been moved from last step. The array itself is used as storage and two pointers (one for L and one for N) are required to determine what to move next. L means "letter line" and N is "number line" (what is moved).
A B C D 1 2 3 4
L A B C (D) 1 2 3 4 first is L, no need to move last N
N A B C (3) 1 2 [D] 4
L A B (C) 2 1 [3] D 4
N A B 1 (2) [C] 3 D 4
L A (B) 1 [2] C
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)