由买买提看人间百态

topics

全部话题 - 话题: enumerate
首页 上页 1 2 3 4 5 6 7 8 9 下页 末页 (共9页)
k******r
发帖数: 2300
1
One use of attributes is you may enumerate all the attributes of the .net type
which you are mostly concerned about, then you may get some info of the type.
For example, the predefined DecriptionAttribute may give you an idea what the
type do.

part
X*O
发帖数: 35
2
来自主题: DotNet版 - C#的更高境界
foreach只能用于那些实现了IEnumerable的class, 每次循环都是去调用那些
Enumerator的函数以确定循环到哪个地方了.所以效率是比较低的. for loop是如果直
接使用数组,效率会好一点. 如果for loop只用于实现了IList的那些class,效果也好不
到那里去. 因为每一次this[int index]的调用,就是在调用get/set函数.
程序易读性比简洁的更重要. 个人感觉Linq发展前途不大.
s***o
发帖数: 2191
3
maybe you can use Enumerable.Except method. for more details, check:
http://msdn.microsoft.com/en-us/library/bb300779.aspx
c*********e
发帖数: 16335
4
来自主题: DotNet版 - 问个STRING比较的问题
把你要用户输入的正确单词放入一个enumerator,如果不是枚举里面的,就不管。和下
拉菜单的思路一样,只有那么几个选择,不能有其它选择。

ITEM
w*s
发帖数: 7227
5
my DB is in the local pc, some times my program gave such errors, while most
of the time is ok.
any suggestions ?
Unhandled Exception: System.Data.EntityException: The underlying provider
failed
on Open. ---> System.Data.SqlClient.SqlException: A network-related or
instance
-specific error occurred while establishing a connection to SQL Server. The
serv
er was not found or was not accessible. Verify that the instance name is
correct
and that SQL Server is configured to allow remote connections. ... 阅读全帖
t*******r
发帖数: 3271
6
来自主题: EmergingNetworking版 - 求面试问题
Describe the series of events going on when the 4 Routers connected the
Ethernet power up the same time.
What fields are contained in OSPF’s HELLO Packets ? (10 40 seconds)
Desribe Hello Packets when two routers are in the 2WAY state (neighbor field
) …
Can a router with a higher priority pre-empt a DR or BDR ?
What does Priority 0 mean ?
Describe the various LSA types (1,2,3,4,5) and what they are used for ?
1. Explain the 1st line – what is is (NET)
2. What’s in the second line ? (LSP-ID)
Expl... 阅读全帖
S******a
发帖数: 1644
7
Yes, probably..., but I am not sure... In the hardware list in the computer
, I can see "Bluetooth bus enumerator"
S******a
发帖数: 1644
8
But it looks like that Bluetooth bus enumerator is not a bluetooth device.
b**********i
发帖数: 1059
9
事态变严重了,没等到楼上回复,又用Norton在安全模式下扫描了一下,看到有个
windows下还有个文件类似A1567.exe受antivirus 2008感染,手一痒把它删了,这下可
好从硬盘启动不了了。用安装盘进去后好像c盘的文件系统也损坏了。显示enumeration
failed之类。现在咋办可好
s*****g
发帖数: 5159
10
来自主题: Hardware版 - 键盘鼠标 推荐?
Logitech Illuminated Keyboard
Logitech G9 (or G9x if you have the budget) gaming mouse
Havign run over a number of kb / mouse, these are so far the best for me.
I am in general a programmer and a light gamer. I like short key hit (to
save energy when typing enumerously). I also like short mouse delay and high
mouse precision. G9 is 3200dpi and G9x is 5700dpi. You could use the weight
blocks to adjust the feeling of your mouse.
p**i
发帖数: 688
11
如果你有Windows vista/7, 可以用built-in的winsat, 假设SSD的drive letter是c
winsat disk -drive c
Windows System Assessment Tool
> Running: Feature Enumeration ''
> Run Time 00:00:00.00
> Running: Storage Assessment '-drive c -seq -read'
> Run Time 00:00:04.45
> Running: Storage Assessment '-drive c -ran -read'
> Run Time 00:00:00.94
> Running: Storage Assessment '-drive c -scen 2009'
> Run Time 00:00:55.24
> Running: Storage Assessment '-drive c -seq -write'
> Run Time 00:00:06.82
> Running: Storage Assessmen... 阅读全帖
s*******d
发帖数: 4135
12
我的结果:
Windows System Assessment Tool
> Running: Feature Enumeration ''
> Run Time 00:00:00.00
> Running: Storage Assessment '-drive c -seq -read'
> Run Time 00:00:05.96
> Running: Storage Assessment '-drive c -ran -read'
> Run Time 00:00:00.53
> Running: Storage Assessment '-drive c -scen 2009'
> Run Time 00:00:53.67
> Running: Storage Assessment '-drive c -seq -write'
> Run Time 00:00:06.38
> Running: Storage Assessment '-drive c -flush -seq'
> Run Time 00:00:01.48
> Running: Storage Assessment... 阅读全帖
e****i
发帖数: 2152
13

谢谢.
不过我的win7,上面的方法找不到disk management.
I found the following from internet.
how to use Disk Management to set up a Hard Drive. [188931]
Subscribe
Back
To start Disk Management:
Log on as administrator or as a member of the Administrators group.
Click Start -> Run -> type compmgmt.msc -> click OK. Alternatively, right-
click on the My Computer icon and select 'Manage'.
In the console tree, click Disk Management. The Disk Management window
appears. Your disks and volumes appear in a graphical view... 阅读全帖
f********1
发帖数: 1601
14
需要用usb3的线,24针那种。
即使用了enumerated SDP usb3也只能充900ma
z****g
发帖数: 2497
15
来自主题: Java版 - 如何enumerate线程
Create a class YourThread extends Thread
add a static counter in it and increase by one in the constructor.
xt
发帖数: 17532
16
来自主题: Java版 - 如何enumerate线程

I don't see how that helps. Best idea is to keep your references.
z****g
发帖数: 2497
17
来自主题: Java版 - 如何enumerate线程
Maybe I misunderstand his question. :(
j***i
发帖数: 4
18
来自主题: Java版 - 如何enumerate线程
The ThreadGroup class might help. Just a thought. :-)
g*s
发帖数: 2277
19
来自主题: Java版 - a simple java programming question
Hashtable ht = ....;
user userObject = ....;
for (Enumeration e = ht.keys() ; e.hasMoreElements() ;) {
String key = (String)e.nextElement();
String value = (String)ht.get(key);
Object [] methodParamValues = new Object[1];
methodParamValues[0] = value;
Method method = userObject.getClass().getMethod("set"+key,
new Class [] { new String().getClass() });
method.invoke(userObject, methodParamValues);
}
e****o
发帖数: 76
20
来自主题: Java版 - 问一道关于Vector的题
yes, reverse loop might be the correct answer. So enumeration can not work.
A**o
发帖数: 1550
21
来自主题: Java版 - 问一道关于Vector的题
not much exp on enumeration. can't answer.
g*****g
发帖数: 34805
22
You should write an algorithm to get all the substring first,
then you can match one by one.

be:
".
G*********a
发帖数: 1080
23
yi? you have a daughter now?! she is so so so chobby and cute!
nod, since i can't get the regex do the work, i am post-process the returned
string myself.
thanks!
G*********a
发帖数: 1080
24
thanks!
but it returns the longest one still:
aaaaa 0 5

".
g**e
发帖数: 6127
25
works for me in vi
G*********a
发帖数: 1080
B*****g
发帖数: 34098
27
co-ask,搞不出来
b******e
发帖数: 1861
28
How about use group and loop.
import java.util.regex.*;
public class test
{
public static void main(String[] args)
{
Pattern p = Pattern.compile("a(a*)");
String a = "aaaa";
match(a, p);
}
private static void match(String s, Pattern p)
{
Matcher m = p.matcher(s);
while (m.find())
{
System.out.println("found char = " + m.group(0));
match(m.group(1), p);
}
}
}
a****i
发帖数: 13
29
in perl you can do @matched = "aaaaa" =~ m/(?=(a*))/g;
in java you probably can do similar thing by using zero-length look-ahead
and Matcher.find()
h*********o
发帖数: 62
30
@matched = "aaaaa" =~ m/(?=(a*))/g;
is a good one if it works.
F****n
发帖数: 3271
31
来自主题: Java版 - 问个Object.hashCode()的问题
You cannot enumerate all cases and should not try to do so, because how can
you be sure about other programs' implementation? What you do is to
understand the mechanism and use your brain to think about each case.
And I think I told you as long as equals() return this == obj, you can
return any constants as hashCode(). It will only drop the performance.
a***n
发帖数: 584
32
“Language Constructs”, is it about the new features that being added in
each newer version of java? e.g. annotation, enumerator, thread control, etc
?
N***m
发帖数: 4460
33
can we use vector.set(index,element)?
At the first glance, I thought LZ was asking how to make an efficient algo
to enumerate all possibilites, not just swapping.
z*******3
发帖数: 13709
34
来自主题: Java版 - j2ee web 方向的职业规划
现在系统并发数量据说上了million
就这么一个系统
每年可以生产出来的profits上亿刀
所以没有人敢轻易动手
我今天改了一个enumeration为iterator
胆战心惊地想了半天
算了,还是不改了
鬼知道这里面会出啥问题
还是先放着,先记下来,让别人来review一下再说
慢慢地改,慢慢的改
下一步是建议他们采用1.5的一些new features
尤其是java.util.concurrent里面的东西
这种代码级别的升级肯定又是一堆p事
不过好在明年要造一个新的子系统
我爽之后让别人痛苦的时候来了
z*******3
发帖数: 13709
35
来自主题: Java版 - j2ee web 方向的职业规划
现在系统并发数量据说上了million
就这么一个系统
每年可以生产出来的profits上亿刀
所以没有人敢轻易动手
我今天改了一个enumeration为iterator
胆战心惊地想了半天
算了,还是不改了
鬼知道这里面会出啥问题
还是先放着,先记下来,让别人来review一下再说
慢慢地改,慢慢的改
下一步是建议他们采用1.5的一些new features
尤其是java.util.concurrent里面的东西
这种代码级别的升级肯定又是一堆p事
不过好在明年要造一个新的子系统
我爽之后让别人痛苦的时候来了
b***i
发帖数: 3043
36
来自主题: Java版 - Concurrent Exception in Swing
我在main里面调用一个自己写的类OldSplashScreen的函数,起了一个线程,执行
splash()(其中145行splashWindow = new SplashWindow(this,fImage);)
178在一个private class SplashWindow extends JFrame的类中,是构造函数
private class SplashWindow extends JFrame {
BufferedImage base=null;
public Graphics2D gS=null;
private static final long serialVersionUID = 1L;
BufferedImage bf=null;
BufferedImage canvas=null;
178: SplashWindow(Frame aParent, Image aImage) {
构造函数怎么会出错?我估计是非Swing EDT里面调用Swing类Frame子类的构造函数了。
... 阅读全帖
z****e
发帖数: 54598
37
use iterator
dont use enumeration class
it is too old
Set s = new HashSet();
Iterator i = s.iterator();
while(i.hasNext()){
Object o = i.next();
}
b***i
发帖数: 3043
38
来自主题: Java版 - generics这样改对马?
1
protected AudioDevice instantiate(ClassLoader loader, String name)
throws ClassNotFoundException,
IllegalAccessException,
InstantiationException
{
AudioDevice dev = null;

Class cls = null;// 我改成Class对吗?
if (loader==null){
cls = Class.forName(name);
}else{
cls = loader.loadClass(name);
}
Object o = cls.newInstance();
dev = (AudioDevice)o;

return dev;
}
2
ZipFile zf = conn.getJarFi... 阅读全帖
m******t
发帖数: 2416
39

be:
".
I don't think you can come up with one regex to get them all.
You could construct "a{i}" dynamically where i steps from 1 to 5. Or take
substrings of "aaaaa" and try matching each of them against "a+"
But what exactly are you trying to achieve?
r*******n
发帖数: 3020
40
in vim, you just use the option of g[lobal]
like this.
it will put each matches in a single line,
and then you can move them to the end of file
by this:
be:
".
n****1
发帖数: 1136
41
也有个chrubuntu的项目,ubuntu 12.04变种,只能装在SD卡上,所以非常慢。而且这
种dual boot方案是没有办法无缝切换的。网上推荐croutonhttp://it-nthusiast.blogspot.com/2013/05/ubuntu-linux-on-chromebook-crouton-vs.html.
"My recommendation is crouton, for a number of reasons I will enumerate in
the section designed to it. ChrUbuntu is probably easier to install, and
easier to use, but it has some fundamental drawbacks which make it a bit
annoying. For crouton, you'll probably need to use the terminal a little bit
, but it's really not that much... 阅读全帖
R******d
发帖数: 1436
42
有台centos连续死机几次,/var/log/message里除了看到很多这样的错误,也没找到其
他致命的。

kernel: ioatdma 0000:60:04.6: channel enumeration error
kernel: ioatdma 0000:60:04.6: Intel(R) I/OAT DMA Engine init failed
kernel: ioatdma 0000:60:04.7: PCI->APIC IRQ transform: INT D -> IRQ 111
kernel: ioatdma 0000:60:04.7: channel error register unreachable

不知道什么原因会死机。

请问有什么好的办法能查出死机原因么?谢谢。
R******d
发帖数: 1436
43
有台centos连续死机几次,/var/log/message里除了看到很多这样的错误,也没找到其
他致命的。

kernel: ioatdma 0000:60:04.6: channel enumeration error
kernel: ioatdma 0000:60:04.6: Intel(R) I/OAT DMA Engine init failed
kernel: ioatdma 0000:60:04.7: PCI->APIC IRQ transform: INT D -> IRQ 111
kernel: ioatdma 0000:60:04.7: channel error register unreachable

不知道什么原因会死机。

请问有什么好的办法能查出死机原因么?谢谢。
t****t
发帖数: 6806
44
来自主题: Programming版 - C++ question
actually, you can. but only for integral type (or enumeration); initializer
must be const.
otherwise, must initialize it when you define it.
l*****c
发帖数: 1153
45
来自主题: Programming版 - some interview questions
1. bring to front, write log file, crash dump, gdb attach.
2. don't understand exactly what does this problem mean
3. less space, seek for range, enumerate in order, high locality in some
special cases. what else?
d*******8
发帖数: 3182
46
try the following:
lstLineNum = []
lstLine = []
lstTraffic = []
for linenum, line in enumerate(open('traffic.txt')):
..for num in line.strip().split('\t'):
....try:
......a = int(num)
....except:
......print "Not a munber"
....lstLine.append(a)
....lstLineNum.append(linenum)
..lstTraffic.append(lstLine)
dicTraffic = dict(zip(tulple(lstLineNum), lstTraffic))
b********r
发帖数: 1080
47
笨办法.
enum xxx{jack, diomand,...};
char* card[]={"jack", "diomand", ......};
int suit=spade;
cout<
l********s
发帖数: 358
48
Create a class called Suit which encapsulate "jack" or "diomand" or ...
Then overload operator <<
首页 上页 1 2 3 4 5 6 7 8 9 下页 末页 (共9页)