由买买提看人间百态

topics

全部话题 - 话题: method1
1 (共1页)
l****u
发帖数: 199
1
要输出,used下列CODES:
不WROK method1:
proc export data=febdaily06 outfile='H:\death\test.xls' replace;
run;
ERROR: The target file contains unmatched range name and sheet name. You may
use other name or remove the unmatched range/sheet in the file.
不WROK method1:
尝试了最笨的方法:EXPORT,不WORK。
ERROR: Error attempting to CREATE a DBMS table. ERROR: Execute: ????????.
WORK的 method1:
proc export
outfile = "H:\death\test.dbf"
data = febdaily06
dbms = dbf replace;
run;
WORK的 method2:
ods csvall file="H:\d
x*****p
发帖数: 1707
2
来自主题: JobHunting版 - multi-threading guru们
Yes.
Suppose you define two Runnable objects r1 and r2. They share the same
object of C. r1 calls method1 and r2 calls method2 in their run method.
Then you can use
ExecutoreService es = Executors.newSingleThreadExecutor();
es.execute(r2);
es.execute(r1);
Then it is guaranteed that r2 finishes running method2 first and r1 runs
method1 second.
g*****g
发帖数: 34805
3
来自主题: Java版 - synchronization for counters

synchron
Is this supposed to be
public void method1 { ?
you are not declaring method1 as a class, are you?
private variable needs to be synced as long as multiple threads may
be changing it. c1/c2 won't be changed at the same time.
h*i
发帖数: 3446
4
其他的FP语言我不知道。在Clojure这个生态环境里面,目前我还没有发现有啥缺了没
人作的东东。JVM上啥没有?Clojure只是JVM上薄薄的一层。想用一个FooClass类上的
method1和方法method2?
(doto (FooClass. "bar" 1)
(.method1 arg1)
(.method2 arg2))
就这么简单。
我不用IDE而已,我看那些用IDE的Clojure程序员也很高兴,没觉得缺了啥。我是从IDE
党转成vi党的,这又怎么说?
y*******o
发帖数: 6632
5
来自主题: JobHunting版 - multi-threading guru们
private AtomicBolean method2finished=new AtomicBoolean( false );
// private volatile method2finished=false; will also work and may be better
method1(){
while(!method2finished)
{ sleep(2000)}
do methods;
return;
}
method2(){
do methods;
method2finished=true;
return;
}
w*******s
发帖数: 96
6
再来一个拍拍:
////////////////////////////////////////////////////////////////////////////
////////
// Problem 1.1:
// Analysis and points:
// 1. strig operation(scan)
// 2. How to determine whether it's duplicate string?
// Method 1: using one hashtable, if it's already in
hashtable,
// it's duplicate, otherwise add into hashtable.
Complexity O(n)
// Method 2: for each characer, check whether it's duplicated
// ... 阅读全帖
S****h
发帖数: 115
7
最近做题做的有点晕的感觉... 这题我想的对么?
method1:
public boolean isPower2(int num){
if(num <= 0)
return false;
int mask = 1;
for(int i = 0; i <31; i++){
mask = mask << 1;
if(mask == num)
return true;
else if(mask > num)
return false;
}
return false;
}
method2:
public boolean isPower2(int num){
//skip
switch(num){
case 1:
... 阅读全帖
k**********i
发帖数: 36
8
►►►Regular Expression Matching
Implement regular expression matching with support for '.' and '*'.
'.' Matches any single character.
'*' Matches zero or more of the preceding element.
The matching should cover the entire input string (not partial).
The function prototype should be:
bool isMatch(const char *s, const char *p)
Some examples:
isMatch("aa","a") → false
isMatch("aa","aa") → true
isMatch("aaa","aa") → false
isMatch("aa", "a*") → true
isMatch("aa", ".*") → true
isMatch... 阅读全帖
d*********g
发帖数: 2906
9
Release cycle不是理由。我以前的工作任务之一就是协调我们自己的产品升级后帮助
其他用我们SDK的公司升级他们的产品。
作为platform产品,都有SDK。SDK API要保证一定的稳定性,不能ver 1这个method叫
method1,到了ver 2就变成了method2了。即便是要加新的功能也不能加在已有的
method上,要加在新的method上。这样才能最大的保证用SDK不用重写就能在新的版本
上运行。即便是有大的变化,例如从32位升级到64位,SDK API的变化也是有规律的。
在具体的操作上,在产品推出新版本之前就release SDK beta给第三方开发商,让他们
有机会升级自己的产品。其实Apple现在就遵循这个model。
假设Apple允许Adobe给iPhone做运行环境,Adobe也会采取这种pre-release update/
testing的方式。这就和它支持Firefox,Safari升级是一样。很少听说Firefox升级了
,已有的Flash就不能用了。
任何platform产品的升级在SDK上都不能disruptive,这会使已有建立
d*********g
发帖数: 2906
10
Release cycle不是理由。我以前的工作任务之一就是协调我们自己的产品升级后帮助
其他用我们SDK的公司升级他们的产品。
作为platform产品,都有SDK。SDK API要保证一定的稳定性,不能ver 1这个method叫
method1,到了ver 2就变成了method2了。即便是要加新的功能也不能加在已有的
method上,要加在新的method上。这样才能最大的保证用SDK不用重写就能在新的版本
上运行。即便是有大的变化,例如从32位升级到64位,SDK API的变化也是有规律的。
在具体的操作上,在产品推出新版本之前就release SDK beta给第三方开发商,让他们
有机会升级自己的产品。其实Apple现在就遵循这个model。
假设Apple允许Adobe给iPhone做运行环境,Adobe也会采取这种pre-release update/
testing的方式。这就和它支持Firefox,Safari升级是一样。很少听说Firefox升级了
,已有的Flash就不能用了。
任何platform产品的升级在SDK上都不能disruptive,这会使已有建立... 阅读全帖
f*z
发帖数: 421
11
【 以下文字转载自 Programming 讨论区 】
发信人: fyz (木~花样年华), 信区: Programming
标 题: C++ static member method with default arguments
发信站: BBS 未名空间站 (Thu May 29 05:40:49 2014, 美东)
大牛,同学们,请教,static member method 可不可用default argument?比如,
enum Index
{
INDEX_A = 0,
INDEX_B
};
class foo
{
public:
static void method1( int a, int b = Index::INDEX_A);
};
编译可以过,但有什么要注意的地方?
多谢!
P*P
发帖数: 36
12
来自主题: Java版 - synchronization for counters
我需要maintain两个thread safe incremental counter在不同的method里.
这个counter各自计各自的,所以可以同时分别update.但是每个counter自己是synchron
ized.
象下面这样子.
private int c1;
private int c2
public class method1 {
synchronized(this) {
c1++;
}
}
public class method2 {
synchronized(this) {
c2++;
}
}
我有两个问题
一是c1,c2都是private的,是不是本身就已经是thread-safe了,需要synchronized吗?
二是象上面的这段code,由于c1,c2都用的是this的lock,他们可以在同一时间update吗,
还是一个一个来
先谢谢了.
N***m
发帖数: 4460
13
来自主题: Java版 - multi-threading guru们 (转载)
How about
Class C {
method3()
{
method2();
method1();
}
g*****g
发帖数: 34805
14
来自主题: Java版 - multi-threading guru们 (转载)
make method 1 private, set up method 3
public void method3() {
method2;
method1;
}
l**********n
发帖数: 8443
15
来自主题: Java版 - multi-threading guru们 (转载)
thread1.join(); // in thread1 call method1
// in main thread call method2
m****r
发帖数: 6639
16
来自主题: Java版 - multi-threading guru们 (转载)
我这样写
class job1 {
C obj;
job1 (C c) { obj = c; }
run() {
synchronize (obj) {
if (method2 not done) obj.wait();
obj.method1
}
}
class job2 {
run() {
synchronize (obj) {
obj.method2;
obj.set method2 done;
obj.notifyAll();
}
}
in main thread
C c = new C();
new Thread(new job1(c)).start();
new Thread(new job2(c)).start();
这个应该是本来的意思.
c******n
发帖数: 4965
17
来自主题: Java版 - aspectJ question
I have many existing methods
method1() ...
method2() ...
method3() ....
they all throw SomeException. now I want to wrap these methods so that each
inside simply does try {} catch (){} where the inside of the try loop does
the
original work, and in catch() I recast the exception into SOMEOtherException.
is this possible with AspectJ ?
I guess not??? since it changes the signature.....
c******n
发帖数: 4965
18
来自主题: Java版 - aspectJ question
I have many existing methods
method1() ...
method2() ...
method3() ....
they all throw SomeException. now I want to wrap these methods so that each
inside simply does try {} catch (){} where the inside of the try loop does
the
original work, and in catch() I recast the exception into SOMEOtherException.
is this possible with AspectJ ?
I guess not??? since it changes the signature.....
c******n
发帖数: 4965
19
来自主题: Java版 - another aspectJ question
if I have method1 method2() method3() ...
and I create a pointcut so that I log the func call in each of them
is there a way to obtain the method name inside my advice ?
for example
pointcut blah() : execution ( * * () );
before(): blah() {
System.out.println( "running " + $_SOME_SPECIAL_VAR_FOR_FUNC_NAME );
}
f*z
发帖数: 421
20
大牛,同学们,请教,static member method 可不可用default argument?比如,
enum Index
{
INDEX_A = 0,
INDEX_B
};
class foo
{
public:
static void method1( int a, int b = Index::INDEX_A);
};
编译可以过,但有什么要注意的地方?
多谢!
d****i
发帖数: 4809
21
来自主题: Programming版 - C++可以不用类外的函数吗?
当然,C++可以完全和Java一样定义成员函数就像下面这样, Java就是全部纯粹OO化的C
++版本。
class Foo {
private:
int x, y, z;
public:
void method1(int a);
int method2(char *b);
float method3(float c);
// ...
};
t**t
发帖数: 9
22
Method1:
distiller
Method 2:
pdf => ps, then some ps utilities, such as pstops
...
f****3
发帖数: 502
23
来自主题: EE版 - 请教一个agilent ADS的问题
看英文解释是,method1和2采用open load,而method3和4采用匹配负载50ohm
b******e
发帖数: 539
24
method1:可能你本来就有test.xls这个文件存在,而且第一个tab里的表格比你现在的
数据小,比如说原来的表格是2x3的,你现在要输出的是4x5的,就会出现你所说的
error
E*********e
发帖数: 10297
25
来自主题: _K12版 - our addition
my girl just got homework about two-digit addition
the instruction said there are three methods to teach the kid how to do 2-
digit addition
Method1: counting on
ie., 47+33=?
47, 57, 67, 77
77+3=80
Method 2: combining groups
ie, 29+37=?
20+30=50
9+7=16
then 50+16=66
Method 3: adjusting and compensating
52+29=?
30
52+30=82
-1
1 (共1页)