topics

全部话题 - 话题: arg1
1 (共1页)
t**r
发帖数: 3428
1
来自主题: JobHunting版 - topcoder- strange country problem.
贴个答案
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
const long long LINF = (5e18);
const int INF = (1<<30);
#define EPS 1e-6
const int MOD = 1000000007;
using namespace std;
class StrangeC... 阅读全帖
l*******s
发帖数: 7316
2
【 以下文字转载自 Prepaid 俱乐部 】
发信人: llaalways (camper), 信区: Prepaid
标 题: Moto E 1526 成功鼓捣成一开机就自动打开hotspot,每月自动拨号一次。
发信站: BBS 未名空间站 (Mon Mar 7 12:38:14 2016, 美东)
还是用Tasker, 就是在上次自动拨号的profile里加了3条。
wifi off
wifi tether on
svc data enable
但wifi tether on 在stock rom里出错,所以刷了flyme. 中间还试过CM13,CM13遇到
GAPP装不好的问题,所以放弃了。
flyme还有一个小问题,就是不能拦截拨号,这个以后再折腾。
将下面的内容保存为onBoot.prf.xml, 然后从Tasker里import profile 就可以了。


1457209583790阅读全帖
o**********a
发帖数: 330
3
今天学pass by value or ref.
有点疑问, 如果说string 在c#里面是reference type的话,为什么我下面的例子中m
is still cate , but not mouse.
static void Main(string[] args)
{
string m = "cat";
string n = "dog";
SwapString(m, n);
Console.WriteLine("m is " + m);//m is still cat
Console.WriteLine("n is " + n);//n is still dog
Point pnt1 = new Point(2,3);
Point pnt2 = new Point(20,30);
SwapObject(pnt1,pnt2);
Con... 阅读全帖
o**********a
发帖数: 330
4
今天学pass by value or ref.
有点疑问, 如果说string 在c#里面是reference type的话,为什么我下面的例子中m
is still cate , but not mouse.
static void Main(string[] args)
{
string m = "cat";
string n = "dog";
SwapString(m, n);
Console.WriteLine("m is " + m);//m is still cat
Console.WriteLine("n is " + n);//n is still dog
Point pnt1 = new Point(2,3);
Point pnt2 = new Point(20,30);
SwapObject(pnt1,pnt2);
Con... 阅读全帖
D***0
发帖数: 138
5
来自主题: JobHunting版 - 发个evernote的code challenge
网上申请的,回复的挺快,安排了code challenge,一道题,不限时,半个小时写完了
,发过去,第二天收到了thank you but 88.不知道哪里的问题。
* Write a function that takes two parameters:
* (1) a String representing a text document and
* (2) an integer providing the number of items to return.
* Implement the function such that it returns a list of Strings ordered by
word frequency,
* the most frequently occurring word first.
* Use your best judgement to decide how words are separated.
* Your solution should run in O(n) time where n is the number of cha... 阅读全帖
w*****n
发帖数: 25
6
There is no much infomation in the minidump file.
1: kd> !analyze -v
****************************************************************************
***
*
*
* Bugcheck Analysis
*
*
*
****************************************************************************
***
KERNEL_DATA_INPAGE_ERROR (7a)... 阅读全帖
y***n
发帖数: 8
7
来自主题: BuildingWeb版 - CGI
Now let us make a more useful one.
带有参数的脚本
为了传递一个参数给脚本,可以在URL中使用 (?) 插入脚本名词和参
数之间, 用加号(+) 表示每个单一的参数, 如:
run my script
当服务器接收到这个请求,它传递 arg1, arg2, 和 arg3 参数给脚
本. 你然后能在脚本中使用这些参数.
这个方法有时叫查询, 因为早期它用在搜索功能中.
练习: 检查是否有人登陆.
既然你知道怎样使用参数,让我们继续上面的例子pinglaura,通过
修改这个例子我们得到下面这个脚本pinggeneric.
我们取个不同题目:
#!/bin/sh
echo "Content-type: text/html"
echo
echo ""
echo "Are You There?"
echo ""
在上面的例子中, 下一步应该是测试我是否登陆,在这里我们用参数
${1}代替我
v******e
发帖数: 63
8
来自主题: Java版 - Stupid IBM JDK
I don't like IBM, but I can't agree with you on this one. Looks like your
check() method is not idempotent. Check this :
boolean check1 = check(arg1, arg2);
boolean check2 = check(arg1, arg2);
System.out.println("check1:" + check1 + " check2:" + check2);

they
not
w*s
发帖数: 7227
9
来自主题: Programming版 - 如何定义 Javascript overload function ?
在node.js里,我这么凑合的,
if(config.mode === case1) {
var myFunc = function(req, res, arg1, callback) {
...
}
} else {
var myFunc = function(req, res, arg1, arg2, callback) {
...
}
}
大家有何建议?
o**********l
发帖数: 743
10
来自主题: Unix版 - ksh 问题
写了一个 SHELL SCRIPT, 比如叫 ABC.SH
放在当前目录下运行, 马上就启动一个/usr/bin/ksh ARG1 ARG2... 这个参数表就是
当前目录下所有的文件。 大概一百个,同时启动ABC.SH。 这个时候ABC.SH 跟本动不
了。不知道什么原因。
奇怪的在于, ABC.SH放到任何其他目录下,就能完美的运行,而且跟本不会启动/USR/
BIN/KSH ARG1 ARG2。
这个这个就表明,不是代码错误的;启动了/usr/bin/ksh , 因为其他目录下的文件都
没有被列出来。
肯定 有什么我不知道环境设置问题。
有遇到过这个 问题的?
w*****e
发帖数: 197
11
struct functor {
T *m_f;
functor( T *f ) : m_f( f ) { ; }
void operator() ( int arg1 ) const {
( *m_f )( arg1 ); // this will pass compiler
}
};
That's it.
functor d( f );
d( 1 );
c*********l
发帖数: 3438
12
【 以下文字转载自 CS 讨论区 】
发信人: amrita (Amrita), 信区: CS
标 题: [分享]:一篇文章讲通一半Java《面向对象一家人》
发信站: BBS 未名空间站 (Thu Oct 24 04:15:04 2013, 美东)
原文链接:http://ladder.azurewebsites.net/forum.php?mod=viewthread&tid=121&extra=page%3D1
第一集:Mr.Method
Hi,大家好~~我是Mr.Method,和Mr. Okay是好哥们儿。
在所有面向对象的语言里你都能见到我的身影。不信?你们学编程的时候第一个程序
都是Hello World吧?那就是依靠对我的调用实现的——无论是哪个平台、哪种语言,
你一定调用了在命令行里输出字符串的某个Method。
铁三角
在正式介绍我自己之前,还是先说说我的哥哥和妹妹吧,我们的家庭背景有助于大家
对我有一个更好的了解。我的哥哥(Mr. Class)和小妹(Mr. Field)加上我,我们仨
可是面向对象家庭里绝对的主角、“铁三角”。我们三个之所以称为“铁三角”是因为
... 阅读全帖
l******9
发帖数: 579
13
【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: SQL run a stored procedure by fetching from a cursor row by row
发信站: BBS 未名空间站 (Fri May 23 17:57:23 2014, 美东)
I need to run a stored procedure on SQL server 2008.
But, I can only fetch one row from the cursor. After that, the @@FETCH_
STATUS is -1.
DECLARE @my_table TABLE
(
code int not null
);
INSERT INTO @my_table (id)
SELECT DISTINCT a.id
FROM table1 as a
WHERE a.value = 'abc'
ORDER BY a.id A... 阅读全帖
q**1
发帖数: 193
14
来自主题: BuildingWeb版 - PHP问题
如何调用其它 html 或 php file,并传递参数。我现在用

contain 其他网页,但是不知道如何将当前文件里定义的参数
传递到 component.html
我原先用 Perl 的 HTML::Mason 可以
<& /path/to/component.html, arg1 => value1, arg2 => value2 &>
然后在 component.html里面做相应设置。。
请问,在 PHP 里面如何实现?? //bow
b*********n
发帖数: 1258
15
【 以下文字转载自 Java 讨论区 】
发信人: babyfacenan (黑土), 信区: Java
标 题: java 里可以插入linux command吗?
发信站: BBS 未名空间站 (Mon Jul 7 20:56:16 2008)
project有一部分是别人写的code,
我要把我的和别人的integrate起来
他用的是perl 或者c++, I'm not sure
他的程序是take an input flat file,
then write out an output file,
then, 我只要再读入他的output file 就可以了
他只给了我compile 之后的binary file
可以在linux下run, like this:
compliedFile arg1 arg2
我的程序是java的,不知道java可不可以run linux command?
以前用过perl插入linux command
高手给指点指点吧
谢谢
a****a
发帖数: 67
16
原文链接:http://ladder.azurewebsites.net/forum.php?mod=viewthread&tid=121&extra=page%3D1
第一集:Mr.Method
Hi,大家好~~我是Mr.Method,和Mr. Okay是好哥们儿。
在所有面向对象的语言里你都能见到我的身影。不信?你们学编程的时候第一个程序
都是Hello World吧?那就是依靠对我的调用实现的——无论是哪个平台、哪种语言,
你一定调用了在命令行里输出字符串的某个Method。
铁三角
在正式介绍我自己之前,还是先说说我的哥哥和妹妹吧,我们的家庭背景有助于大家
对我有一个更好的了解。我的哥哥(Mr. Class)和小妹(Mr. Field)加上我,我们仨
可是面向对象家庭里绝对的主角、“铁三角”。我们三个之所以称为“铁三角”是因为
我们各司其职、配合的非常默契。Mr.Class,他是个很好的组织者,他能把从现实世界
抽象出来的结果良好地组织在一起(这个叫“封装”)——我(Mr.Method)和我小妹
(Ms. Field)被我哥管着(注:被封装在类里)。小妹负责表示我们这个小组织当... 阅读全帖
a****a
发帖数: 67
17
原文链接:http://ladder.azurewebsites.net/forum.php?mod=viewthread&tid=121&extra=page%3D1
第一集:Mr.Method
Hi,大家好~~我是Mr.Method,和Mr. Okay是好哥们儿。
在所有面向对象的语言里你都能见到我的身影。不信?你们学编程的时候第一个程序
都是Hello World吧?那就是依靠对我的调用实现的——无论是哪个平台、哪种语言,
你一定调用了在命令行里输出字符串的某个Method。
铁三角
在正式介绍我自己之前,还是先说说我的哥哥和妹妹吧,我们的家庭背景有助于大家
对我有一个更好的了解。我的哥哥(Mr. Class)和小妹(Mr. Field)加上我,我们仨
可是面向对象家庭里绝对的主角、“铁三角”。我们三个之所以称为“铁三角”是因为
我们各司其职、配合的非常默契。Mr.Class,他是个很好的组织者,他能把从现实世界
抽象出来的结果良好地组织在一起(这个叫“封装”)——我(Mr.Method)和我小妹
(Ms. Field)被我哥管着(注:被封装在类里)。小妹负责表示我们这个小组织当... 阅读全帖
l******9
发帖数: 579
18
I need to run a stored procedure on SQL server 2008.
But, I can only fetch one row from the cursor. After that, the @@FETCH_
STATUS is -1.
DECLARE @my_table TABLE
(
code int not null
);
INSERT INTO @my_table (id)
SELECT DISTINCT a.id
FROM table1 as a
WHERE a.value = 'abc'
ORDER BY a.id ASC
DECLARE t_input CURSOR FOR
SELECT id
FROM @my_table
DECLARE @return_value tinyint
DECLARE @my_id varchar(3)
OPEN t_input
FETCH NEXT FROM t_input... 阅读全帖
c*****t
发帖数: 1879
19
来自主题: Java版 - eclipse help
1. the Override/Implement method option have arguments that just don't
make sense (arg0, arg1, etc), how to make them the same as parent
class or interface arguments?
2. the javadoc imported from Overrride/Implement method is like
/* (non-Javadoc)
* @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
*/
which is merely a pointer. It would be nice to have the original
java doc for the function. how?
3. will Eclipse display hints of fu
c***c
发帖数: 6234
20
来自主题: Java版 - 怎么测试 Web Service Functions?
I have a Web Service on server. The business method has two paramters, say
arg1 and arg2.
What is the URL that I can test it?
谢谢
b*********n
发帖数: 1258
21
project有一部分是别人写的code,
我要把我的和别人的integrate起来
他用的是perl 或者c++, I'm not sure
他的程序是take an input flat file,
then write out an output file,
then, 我只要再读入他的output file 就可以了
他只给了我compile 之后的binary file
可以在linux下run, like this:
compliedFile arg1 arg2
我的程序是java的,不知道java可不可以run linux command?
以前用过perl插入linux command
高手给指点指点吧
谢谢
r********r
发帖数: 208
22
运行如下的代码后得到了警告,点击“continue”后程序可以正常输出正确结果。
Google后也找不到答案,请大牛提示一下。
public class PrintCommandLineArguments{
public static void main(String[] args){
System.out.println(args[0] + " "
+ args[1] + " " + args[2]);
}
}
//arguments in command line are: arg1 arg2 arg3
----------------------------------------------------
PrintCommandLineArguments at localhost:2109 contains obsolete methods.
Reason:
The virtual machine was unable to remove all stack frames running old
code from the ca... 阅读全帖
J*******n
发帖数: 2901
23
把你这个class贴到Eclipse里面跑了一下,没问题啊
你确定是在Eclipse里面run的?在Run Configuration --> Java Application里面,在
Arguments tab底下的Program arguments里面定义了arg1, arg2, arg3?
a****a
发帖数: 67
24
原文连接:http://ladder.azurewebsites.net/forum.php?mod=viewthread&tid=121&extra=page%3D1
第一集:Mr.Method
Hi,大家好~~我是Mr.Method,和Mr. Okay是好哥们儿。
在所有面向对象的语言里你都能见到我的身影。不信?你们学编程的时候第一个程序
都是Hello World吧?那就是依靠对我的调用实现的——无论是哪个平台、哪种语言,
你一定调用了在命令行里输出字符串的某个Method。
铁三角
在正式介绍我自己之前,还是先说说我的哥哥和妹妹吧,我们的家庭背景有助于大家
对我有一个更好的了解。我的哥哥(Mr. Class)和小妹(Mr. Field)加上我,我们仨
可是面向对象家庭里绝对的主角、“铁三角”。我们三个之所以称为“铁三角”是因为
我们各司其职、配合的非常默契。Mr.Class,他是个很好的组织者,他能把从现实世界
抽象出来的结果良好地组织在一起(这个叫“封装”)——我(Mr.Method)和我小妹
(Ms. Field)被我哥管着(注:被封装在类里)。小妹负责表示我们这个小组织当... 阅读全帖
m********r
发帖数: 811
25
abstract=""
usage="Usage: \${0##*/} [options] [arg1] [arg2] ..."
function Abstract()
{
abstract=$@
}
function Usage()
{
usage=$@
}
function Option()
{
eval "options=\"$options $1,$2,$3\""
eval "main_help=\"$main_help \t -$1,--$2\n\""
eval "main_help=\"$main_help \t $4\n\n\""
}
g****g
发帖数: 1828
26
来自主题: Linux版 - bash script真难看懂
这个我都快读晕了。
#!/bin/bash
# Light weight option parser for bash
#
abstract=""
usage="Usage: \${0##*/} [options] [arg1] [arg2] ..."
function Abstract()
{
abstract=$@
}
function Usage()
{
usage=$@
}
function Option()
{
eval "options=\"$options $1,$2,$3\""
eval "main_help=\"$main_help \t -$1,--$2\n\""
eval "main_help=\"$main_help \t $4\n\n\""
}
function OptionWithArgument()
{
ARGUMENT=`echo $3 | tr a-z A-Z`
eval "options_warg=\"$options_warg $1,$2,$3\""
eval "main_help=\"$main_help \t -$1 $ARGUMENT, --
w*s
发帖数: 7227
27
【 以下文字转载自 Programming 讨论区 】
发信人: wds (净洗前尘,从头再来), 信区: Programming
标 题: segmentation fault as soon as entering 1 function in the arm processor board
发信站: BBS 未名空间站 (Sat Dec 15 22:20:01 2012, 美东)
Hi everyone,
i'm lost on this one, can someone give me some hints ?
1. downloaded latest stunnel package from web
2. build in the host linux and runs fine
3. build for arm target (am using the same settings from before,
my task is to upgrade to latest stunnel)
4. builds ok, when run in arm board, seg fau... 阅读全帖
a***a
发帖数: 739
28
在机器A.com上的用户user的login shell被设置成了一个non-interactive的script:
shell=~/x.sh
问题是如何在使用ssh登录的时候 ssh [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){}})();
/* ]]> */
, 把一些参数传递给x.sh
我看到网上有的例子是 ssh [email... 阅读全帖
w****g
发帖数: 44
29
来自主题: Programming版 - wierd problem
I have a program (example.exe) built in VC.
Now I run it in the cmd terminal: example.exe arg1, arg2, arg3
it works fine.
Then I just run it in VC using debug (F5), it said windows has trigged a
break point in example.exe
then continue, it said debug assertation failed.
the output window has such info:
First-chance exception at 0x770bb09e in example.exe: Microsoft C++ exception
HEAP[example.exe]: Invalid Address specified to RtlValidateHeap( 03010000,
030C5D50 )
any idea ? why this happen and ho
b*********n
发帖数: 1258
30
【 以下文字转载自 Java 讨论区 】
发信人: babyfacenan (黑土), 信区: Java
标 题: java 里可以插入linux command吗?
发信站: BBS 未名空间站 (Mon Jul 7 20:56:16 2008)
project有一部分是别人写的code,
我要把我的和别人的integrate起来
他用的是perl 或者c++, I'm not sure
他的程序是take an input flat file,
then write out an output file,
then, 我只要再读入他的output file 就可以了
他只给了我compile 之后的binary file
可以在linux下run, like this:
compliedFile arg1 arg2
我的程序是java的,不知道java可不可以run linux command?
以前用过perl插入linux command
高手给指点指点吧
谢谢
s*****c
发帖数: 550
31
来自主题: Programming版 - About command line in C++
Hi,
I was trying to run some C programs (from UNIX environment) in VC++
environment, and I created a Win32 application Console as project. I need to
be able to input something like:
./executable.exe Arg0 Arg1 Arg2 > output.txt
But now, I can only have a console window flashed through, but not able to
get input arguments.
Shannon
s*******e
发帖数: 664
32
☆─────────────────────────────────────☆
flytomar (撒旦归来) 于 (Mon Nov 23 19:31:10 2009, 美东) 提到:
一直没搞定这个。
另外一个程序,假设名字abc,在同一个路径,有四个参数。
我应该怎么调用它呢?查了google,用execl但是不工作啊
execl(pathname, "abc", arg1, arg2, arg3, arg4, NULL);
是这样用吗?
谢谢
☆─────────────────────────────────────☆
pptwo (pp) 于 (Mon Nov 23 19:34:26 2009, 美东) 提到:
just use system, or popen if you want to write/read stdio

☆─────────────────────────────────────☆
flytomar (撒旦归来) 于 (Mon Nov 23 19:39:09 2009, 美东) 提到:
system 可以调用我自己的pro
g****g
发帖数: 1828
33
来自主题: Programming版 - bash script真难看懂
【 以下文字转载自 Linux 讨论区 】
发信人: gengwg ( 注意:修改邮件后,需重新激活帐号.), 信区: Linux
标 题: bash script真难看懂
发信站: BBS 未名空间站 (Wed Jun 9 11:49:38 2010, 美东)
这个我都快读晕了。
#!/bin/bash
# Light weight option parser for bash
#
abstract=""
usage="Usage: \${0##*/} [options] [arg1] [arg2] ..."
function Abstract()
{
abstract=$@
}
function Usage()
{
usage=$@
}
function Option()
{
eval "options=\"$options $1,$2,$3\""
eval "main_help=\"$main_help \t -$1,--$2\n\""
eval "main_help=\"$main_help \t $4\n\n\""
}
function OptionWithArgume
w*s
发帖数: 7227
34
Hi everyone,
i'm lost on this one, can someone give me some hints ?
1. downloaded latest stunnel package from web
2. build in the host linux and runs fine
3. build for arm target (am using the same settings from before,
my task is to upgrade to latest stunnel)
4. builds ok, when run in arm board, seg fault.
5. from gdb core,
[New LWP 867]
Cannot access memory at address 0x70797263
(gdb) bt
#0 parse_commandline (name=0xbefdce29 "/opt/ultra/config/stunnel.conf",
parameter=0xbefdce48 "-version") at... 阅读全帖
a****a
发帖数: 67
35
原文:http://ladder.azurewebsites.net/forum.php?mod=viewthread&tid=121&extra=page%3D1
第一集:Mr.Method
Hi,大家好~~我是Mr.Method,和Mr. Okay是好哥们儿。
在所有面向对象的语言里你都能见到我的身影。不信?你们学编程的时候第一个程序
都是Hello World吧?那就是依靠对我的调用实现的——无论是哪个平台、哪种语言,
你一定调用了在命令行里输出字符串的某个Method。
铁三角
在正式介绍我自己之前,还是先说说我的哥哥和妹妹吧,我们的家庭背景有助于大家
对我有一个更好的了解。我的哥哥(Mr. Class)和小妹(Mr. Field)加上我,我们仨
可是面向对象家庭里绝对的主角、“铁三角”。我们三个之所以称为“铁三角”是因为
我们各司其职、配合的非常默契。Mr.Class,他是个很好的组织者,他能把从现实世界
抽象出来的结果良好地组织在一起(这个叫“封装”)——我(Mr.Method)和我小妹
(Ms. Field)被我哥管着(注:被封装在类里)。小妹负责表示我们这个小组织当前
... 阅读全帖
S*A
发帖数: 7142
36
来自主题: Programming版 - C10M 练习2: 空TCP 连接,1M per 4G RAM
拍脑瓜的简单客户端。假设端口是 80, 启动指定服务器 IP 地址,
不用域名。当然会碰到一个 IP 地址只能发出去 65K 个连接的限制。
如何用 ip alias 使用多个 IP 地址解决这个问题留给大家自己改。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
void die(char *reason)
{
perror(reason);
exit(1);
}
int main(int argc, char **argv)
{
int sockfd;
struct sockaddr_in... 阅读全帖
S*A
发帖数: 7142
37
来自主题: Programming版 - C10M 练习2: 空TCP 连接,1M per 4G RAM
拍脑瓜的简单客户端。假设端口是 80, 启动指定服务器 IP 地址,
不用域名。当然会碰到一个 IP 地址只能发出去 65K 个连接的限制。
如何用 ip alias 使用多个 IP 地址解决这个问题留给大家自己改。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
void die(char *reason)
{
perror(reason);
exit(1);
}
int main(int argc, char **argv)
{
int sockfd;
struct sockaddr_in... 阅读全帖
x*x
发帖数: 156
38
来自主题: Programming版 - 请教,call c++ shared lib in java via jni
Thanks a lot! I do have quite a few functions in JNI for env->
GetStringUTFChars, now all are paired with ReleaseStringUTFChars.
There is another set of functions on env->NewStringUTF(), see the example
code here:
=========================
std::vector< std::string >::value_type *result = 0 ;
result = a_function_to_allocate_mem(jobject arg1, int arg2);
jresult= env->NewStringUTF(result->c_str());
return jresult;
=========================
should I also pair it with
env->DeleteLocalRef(arg1_... 阅读全帖
h*i
发帖数: 3446
39
其他的FP语言我不知道。在Clojure这个生态环境里面,目前我还没有发现有啥缺了没
人作的东东。JVM上啥没有?Clojure只是JVM上薄薄的一层。想用一个FooClass类上的
method1和方法method2?
(doto (FooClass. "bar" 1)
(.method1 arg1)
(.method2 arg2))
就这么简单。
我不用IDE而已,我看那些用IDE的Clojure程序员也很高兴,没觉得缺了啥。我是从IDE
党转成vi党的,这又怎么说?
c*********e
发帖数: 16335
40
来自主题: Programming版 - 如何定义 Javascript overload function ?
var myFunc = function(req, res, callback, arg1, arg2) {
if(config.mode === case1) {
...
} else {
...
}
}
p******s
发帖数: 938
41
来自主题: Unix版 - 求助:pthread_create的用法
使用pthread_create()出错,以下是测试用的代码:
void *ServerThread(void *arg1)
{
printf("I'm the server\n");
}

int main()
{
pthread_t serverID;
pthread_mutex_init(&lock, NULL);
printf("Now creating the thread to serve..\n");
if(pthread_create(&serverID, NULL, ServerThread, NULL)!=0)
perror("Could not create the thread\n");
pthread_join(serverID, NULL);
exit(0);
}
运行结果:
Now creating the thread to serve..
Could not create the thread
请问是为何出错?//bow
p**5
发帖数: 2544
42
4: kd> !analyze -v
****************************************************************************
***
*
*
* Bugcheck Analysis
*
*
*
****************************************************************************
***
CRITICAL_PROCESS_DIED (ef)
A critical system process died
Arguments:
Ar... 阅读全帖
S***w
发帖数: 1014
43
来自主题: Computation版 - 有用过cluster上Platform Lava的吗
请教一个问题
怎么并行计算呢
bsub -n 8 < script.
永远只有2个处理器在算
scirpt shi
#!/bin/sh
mpirun -np 8 comand < arg1 > arg2
多谢了
l******9
发帖数: 579
44
【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: SQL run a stored procedure by fetching from a cursor row by row
发信站: BBS 未名空间站 (Fri May 23 17:57:23 2014, 美东)
I need to run a stored procedure on SQL server 2008.
But, I can only fetch one row from the cursor. After that, the @@FETCH_
STATUS is -1.
DECLARE @my_table TABLE
(
code int not null
);
INSERT INTO @my_table (id)
SELECT DISTINCT a.id
FROM table1 as a
WHERE a.value = 'abc'
ORDER BY a.id A... 阅读全帖
l******9
发帖数: 579
45
【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: SQL run a stored procedure by fetching from a cursor row by row
发信站: BBS 未名空间站 (Fri May 23 17:57:23 2014, 美东)
I need to run a stored procedure on SQL server 2008.
But, I can only fetch one row from the cursor. After that, the @@FETCH_
STATUS is -1.
DECLARE @my_table TABLE
(
code int not null
);
INSERT INTO @my_table (id)
SELECT DISTINCT a.id
FROM table1 as a
WHERE a.value = 'abc'
ORDER BY a.id A... 阅读全帖
y*****l
发帖数: 5997
46
来自主题: _pennystock版 - 推荐炒股软件Amibroker (转载)
你出80伪币可以买全套。
软件自带的pick只有几十个大盘股,网上现有的股票列表很多代码都失效了。我自己做
的列表包括美国三大股市的6735个股票,可用附带的软件自动下载,然后自动加入系统。
AFL语言很简单,学过C吧,自己看手册自学成才吧。
AmiBroker Formula Language (AFL)
AFL is a special programming language used to define and create custom
indicators, scans, explorations, back-tests and guru commentaries.
Language structure
Each formula in AFL contains of one or more expression statements. Each
statement MUST be terminated by semicolon (;). In this way you are able to
break long expressions into several physi... 阅读全帖
i*****f
发帖数: 578
47
来自主题: _Python版 - Static variables in function
# method 1: a callable instance
# pros: good encapsulation
# cons: too verbal
class _func_with_static_var:
def __init__(self):
self.static_var = 0
def __call__(self, *args):
self.static_var += 1
print self.static_var
func_with_static_var = _func_with_static_var()
# method 2: pass as a list with default value
# pros: less verbal
# cons: affect the function interface
def func_with_static_var( arg1, arg2, static_var = [0] ):
static_var[0] += 1
print static_var[0]
# met
1 (共1页)