w********6 发帖数: 12977 | 1 Oakley Vault 有SI Ballistic M Frame® Strike Array 80刀,这个对于亚洲人
很合适,两片镜片,很推荐,和radar path很像 |
|
a*o 发帖数: 25262 | 2 早就说过,都不是文科。。
哈哈哈。。。
明天复明天,明天何其多。。
今天 = 明天
明天 = 后天
今天.next = 明天
明天. prv = 今天
array【今天,明天,后天】
明日何其多。。。
为什么不是明天何其多?要用 日?
唉。。 |
|
B****n 发帖数: 11290 | 3 看成array轉成linklisa
update |
|
m***r 发帖数: 294 | 4 In array, getting or setting the value at a particular index (constant time)
.
Why? |
|
O*******d 发帖数: 20343 | 5 for computer, adding 1 takes same time as adding 38475. So array[0] +
offset*size_t takes same time no matter what value offset is. |
|
s*********o 发帖数: 409 | 6 就是sorting一个1000000长度的,值在0-1之间的array,matlab是38ms就完成了,用c
有算法可以超越这个吗?
谢谢! |
|
c**g 发帖数: 274 | 7 use a loop and charindex function.
Usually I join an array of String by ":", pass this joined string
as a single varchar parameter to stored procedure, then in
the stored procedure, a loop and charindex function go through
all of them. Can't write down the code without my reference. I
always copy/paste.
My bad memory really gave me a hard time during my job hunting
back years ago. I just can't remeber the syntax. It is the most embarrasing
moment when asked to wring code on paper, what a nightma |
|
c*o 发帖数: 70 | 8 .net doesn't support control array feature.
If I have ten TextBox controls laying out in a web form,I have to name them
differently rather than named them with a same name then differeniate them by
index. it is not convinient if I want to use a loop to get all the text value
of them in code. Any one has any idea or hint? |
|
C****n 发帖数: 2324 | 9 Control Array feature sucks. It's a foundmental design flaw and should be
discarded.
In .Net, you have better way to do it:
foreach (Control c in tablecell.Controls)
if (c is TextBox)
{
.............
}
If you want to manipulate them in javascript, I am not very familiar with
javascript, but there has to be a way to do it, javascript is soooooo
flexible.
them |
|
e****y 发帖数: 26 | 10 I use JBuilder8
I wanna declare a array of vector, so i use:
Vector[] tables = new Vector[20];
It seems okay now. But when i try to use like
tables[1]
JBuilder will send error information.
What's wrong? I am not good at java.
Thanks. |
|
c*y 发帖数: 137 | 11 You need to specify how much memory to allocate to the array when defining it. |
|
P*****f 发帖数: 2272 | 12 on 32bit platform, say, a one-dimension int array
int [] a={1,2,3};
What about the memory layout of a according to spec? suppose the starting
address for a is $a, so 0($a) is the type info? 4($a)is the length? and
followed by
elements? thx |
|
m******t 发帖数: 2416 | 13
I doubt the JVM Spec would dictate this. 8-)
On a hunch, I would guess it's more complex than that. Arrays should be
implemented as objects. |
|
y********o 发帖数: 2565 | 14 In ArrayList, we can use contains(Object o) which returns a boolean value.
How about an array of primitive integers? In Python, we can do
if x in myList:
print "I got you!"
Any easy way to do the same in Java? I have always been wondering about
this.
Thanks. |
|
m******t 发帖数: 2416 | 15 java.util.Arrays.binarySearch(int[], int) |
|
|
r*****l 发帖数: 2859 | 17 You should definitely use Set instead of Array to do the job. Java 1.5 has
auto boxing and un-boxing so you don't have to do the conversion.
所以
Hash
的办
我不 |
|
m******t 发帖数: 2416 | 18 Right. For some reason I took for granted the OP was talking about a sorted
array. |
|
o***g 发帖数: 2784 | 19 you should
for (ArrayList al : newArray)
{
al = new ArrayList();
}
first.
after ArrayList newArray[] = new ArrayList[5];
you only have an array of 5 nulls. |
|
A**o 发帖数: 1550 | 20 这是Array初始化的问题,你不过正好用了ArrayList。 |
|
m**d 发帖数: 14 | 21 我有一个socket,给我一段一段stream。我要把它存到mysql的一个blob里面去。有一
个问题是,我不能按照原始stream的顺序存,而必须反过来存,比如进来的数据如果是:
line1111
line2222
line3333
那存在数据库里就必须是:
line3333
line2222
line1111
所以我不能直接吧stream迭代到mysql sql statement哪里去。我现在是手工把原始数
据搞成serizliable的object, 再把每次读进来一组array of object 转成bytes,再把bytes写到数据库。结果eclipse就崩溃了说Exception in thread "
main" java.lang.OutOfMemoryError: Java heap space
这个东西应该怎么样搞比较好?谢谢 |
|
|
F****n 发帖数: 3271 | 23 If you have to convert from a primitive array, there's no way other than
loop it. |
|
g****y 发帖数: 436 | 24 foo(int[][] lala);
foo2(Double[][] lala);
现在想只保留一个generic的fooG。
google半天,没有结果。。
请问有没有这种generic array?谢谢! |
|
Z****e 发帖数: 2999 | 25 there's auto-boxing, but it only works on one dim array.
interesting thing is that in a function with generics, you can use T to do
typecast, but you cannot do things like T.class |
|
F****n 发帖数: 3271 | 26 Generics is not for primitive data types. There's no Generics for primitive
array. |
|
B*****g 发帖数: 34098 | 27 咱没用过ArrayDescriptor ,但是DBMS_SQL.NUMBER_TABLE本身不是array,而是一个
collection。
one |
|
s****d 发帖数: 338 | 28 ARRAY is Oracle's own JDBC impl class, and it requires a OracleConneciton
instance. 估计你传进去的Connection不是真正的OracleConnection, 而是container
自己包装过的wrapper connection. 如果是JDK 6, 你可以试试用connection.unwrap()
把OracleConnection取出来用.
one |
|
i**p 发帖数: 902 | 29 Person[] zhang_warp = new Person[1];
Person wang_warp[] = new Person[1];
Both declare an array of Person. What are they different? |
|
i**p 发帖数: 902 | 30 Got the answer.
Declaring an array of object references:
Ferrari[] Ferraris; // Recommended
Ferrari Ferraris[]; // Legal but less readable |
|
f*******n 发帖数: 12623 | 31 yes. Arrays are objects. Objects are all dynamically allocated on the heap. |
|
g*****g 发帖数: 34805 | 32 The array (an object) is stored on the heap, the reference can be stored on
heap or stack, depending on whether it's an instance variable. |
|
O*z 发帖数: 109 | 33 最近在看Horstmann写的那本Core Java自学,好像看了书之后做练习的时候有很多自己
找出的问题。比如帖子题目写的
这两个对比。我在看了Java API之后,觉得ArrayList的methods可能更多,而且还能转
成Array(除了Integer等类似primitive type的不能转意外(???有待考证))
对于String和Stringbuffer我自己的体会是string是immutable,但是StringBuffer是
可以改变其中string的内容,而且看过API之后感觉StringBuffer这个class自带的
methods更多更实用一些。
请高手指点一下。
还有最后一个问题,Java中的每个class(比如string, arrayList)有这么多methods,
大家是一般都能记住,还是只记住几个很常用的,其他不太常用的methods在有需要的
时候去看API的?不好意思,问题好像挺多的,请各位不吝赐教 |
|
r******r 发帖数: 700 | 34 不是高手,Array 和 ArrayList 完全是两码事。
Methods 很多,但是常用的好像不太多。 |
|
|
F*******X 发帖数: 143 | 36 我是说 Array class 很少在书里看到。 很多初级 Java 书都先教 ArrayList 然后再
讲解 Generic |
|
p*****2 发帖数: 21240 | 37
java Array class到底是啥东西呢? |
|
F****n 发帖数: 3271 | 38 Use
java.lang.reflect.Array.newInstance(AnyType.class, 2) |
|
W***o 发帖数: 6519 | 39 终于work了,但是我的方法可能比较慢,array access 是不是太多了,有更高效的吗
?不能用太高级的API,因为作业规定:
int[] test = new int[] {1, 2, 3, 3, 3, 3, 5, 6, 8, 8, 8, 8, 8, 9, 9, 9, 9};
int i = 0;
int j = test.length - 1;
int[] copySegment;
while (i < test.length)
{
while (j > i)
{
if (test[j] == test[i])
{
for (int k = i; k <= j; k++)
System.out.print(test[k] + " ");
Syst... 阅读全帖 |
|
W***o 发帖数: 6519 | 40 终于work了,但是我的方法可能比较慢,array access 是不是太多了,有更高效的吗
?不能用太高级的API,因为作业规定:
int[] test = new int[] {1, 2, 3, 3, 3, 3, 5, 6, 8, 8, 8, 8, 8, 9, 9, 9, 9};
int i = 0;
int j = test.length - 1;
int[] copySegment;
while (i < test.length)
{
while (j > i)
{
if (test[j] == test[i])
{
for (int k = i; k <= j; k++)
System.out.print(test[k] + " ");
Syst... 阅读全帖 |
|
l*******g 发帖数: 82 | 41 你这个array是排序好的么?
如果是的话试一下这个
1:两个指针 p1,p2
2:初始化状态:p1指向第一个item,p2指向第二个
3:比较p1和p2
3.1:如果不一样,就两个指针同时移动到下一个(这时候p1指向刚刚p2指向的item,p2
指向自己的下一个item)
3.2如果一样,只移动p2到自己的下一个item
继续第3步 |
|
b****u 发帖数: 1130 | 42 For example
public class SpecialArray {
T[] createSpecialArray()
{
return (T[])Array.newInstance(???, 10);
}
}
如何获得 T 的type at runtime by Reflection?
I am not allowed to change API or method argument).
So I can not use T[] createSpecialArray(Class clazz). |
|
W***o 发帖数: 6519 | 43 我记得java不支持generic array啊 |
|
m********7 发帖数: 1368 | 44 JAVA刚入门,请教一个低级的问题,如何 create a generic array? 如果比较复杂,
能否提供一个好用的reference,多谢!
public static > void sort(T[] a){
T[] tmp = new T[a.length]; <---error
sort(a,tmp, 0, a.length-1);
} |
|
F****n 发帖数: 3271 | 45 @SuppressWarnings("unchecked")
T[] tmp = (T[])Array.newInstance(a.getClass().getComponentType(), a.length); |
|
r****y 发帖数: 26819 | 46 No autoboxing for array. Only primitives have autoboxing. |
|
p*********9 发帖数: 277 | 47 I solve the problem. I used the wrong shell version.
I originally used #!/bin/sh. It works on a lot of stuff.
After I changed it to #!/bin/bash. the problem with array disappeared. |
|
G**T 发帖数: 388 | 48 In my program, I need some loops. However, I do not know the # of loop which
is based on computation. I remeber we can use 2 or 3 arrays to simulate N
loops. How to do it? Any1 has an example?
thanks |
|
y******n 发帖数: 6 | 49 Hi,
Thanks a lot. What is arr.Length meaning? You mean Length is automatic for
each array.
The question is you are using g(f(5)) directly.
Will it be illegal to do:
int [] array1;
array1 = f(5);
g(array1);
...
xie xie la. |
|
t****z 发帖数: 229 | 50 lz想让p指向array a?
这样不行,&a在这里得到的是参数的地址 |
|