由买买提看人间百态

topics

全部话题 - 话题: function
首页 上页 1 2 3 4 5 6 7 8 9 10 (共10页)
l*********s
发帖数: 5409
1
That is a real concern, but you could count on language/compiler to improve
upon the situation.
Although you can pass function pointer in C, you cannot create functions
dynamically.
w*s
发帖数: 7227
2
来自主题: 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) {
...
}
}
大家有何建议?
s*i
发帖数: 5025
3
来自主题: Programming版 - 如何定义 Javascript overload function ?
Javascript里function的参数不需要特别指出或者定义。传入的参数,一律用
arguments 这个假的Array。
比如你的情况,即便写成没有参数,完全可以在runtime传入任何多的参数:
var myFunc = function() {
req = arguments[0];
res = arguments[1];
// ... other args except callback
callback = arguments[arguments.length - 1];
...
}
g****t
发帖数: 31659
4
来自主题: Programming版 - [bssd] 教小孩functional programming
1.
functional programming语言和tool chain较容易保持
referential transparency的习惯。referential transparency在
应用中应该得到重视。这个我非常肯定。
2.
这几天和小孩聊了下以前让他看的python和他的数学课。我决定还是让他花时间看看
lisp。
lisp的函数,symbol的概念和初中数学比较一致。如果学python的话,等于要学习和维
护另一套
函数,变量,等概念系统,这样非常容易confusing,困难挺多。
讲清楚function,procedure的区别那就更难了。
g****t
发帖数: 31659
5
来自主题: Programming版 - [bssd] 教小孩functional programming
工程的东西小孩没必要学。未来的东西肯定和现在不一样啊。
所以我现在觉得要么小孩别学计算机,要么就学lisp。
Haskell是自己的system F什么的,已经离lambda calculus远了。不是一回事,这个发
展方向本身是可疑的。没用是可以理解的。
任何一个工程软件都有Do while。这个不假。
但是任何一个应用范围广的软件也都有pure function。这点肯定也是对的。
Pure function和中学数学课本match,学起来容易,
而且也不会过时。


: 学fp,学下去学下去学下去,最后是数学,范畴论。

: 学python,C ,是工程,学下去是操作系统,体系结构和硬件。

: 搞数学的,可能觉得抽象到fp就天下太平了。

: 对搞工程的来说,the devil is in the detail。

: 小孩我觉得既要学数学,又要学计算机,但是一上来就把

: 计算机当数学学,工程方面会有欠缺。就数学来说,我觉得

: 最有用的是几何和线性代数这一路。

: 算法的本质其实是一个一步一步做某件事情的recipe,... 阅读全帖
m******r
发帖数: 1033
6
这贴写的太牛逼了 说到了核心. 难怪我晕菜了好多年。 R这个语言发明的应该在很早
以前 (S language),难道那个时代的人就琢磨出所谓functional programming了 ?
不知道functional programming, closure中文名字叫什么。
vectoriztion叫矢量化
d***a
发帖数: 13752
7
Functional programming早就有了,和Turing machine一样古老,也可以说更古老,
都出现在有CS这个专业之前。:)
Functional programming有它的优点也有它的问题,主要的问题是程序运行的性能不好
(非常不好)。
closure的中文叫做闭包。
d******c
发帖数: 2407
8
没有什么c++ functional的说法。
他必须用C++,然后用functional programming的一些原则,很多东西只是个设计思路
的区别。像John Carmark这样的传奇式人物在自己公司里推行的方法是可以得到执行的
,好好推广就是了。
j***w
发帖数: 489
9
这还大牛呢,这软件工程里著名定律就是there is no silver bullet.这家伙吹的
functional programming好像就是万能,常识都没有。functional programming有很多
缺点就不提了,还是不知道。

programmers
.
resulting
about,
n*w
发帖数: 3393
10
很多什么缺点?十个字


: 这还大牛呢,这软件工程里著名定律就是there is no silver bullet.这家伙吹的

: functional programming好像就是万能,常识都没有。functional programming
有很多

: 缺点就不提了,还是不知道。

: programmers

: .

: resulting

: about,

T*******x
发帖数: 8565
11
来自主题: Programming版 - functional programming的两个方面
functional programming我一直有一个困惑就是:它是不是没有复杂结构类型?比如
OOP中经常定义的类或结构?functional programming好像只能由简单类型然后用list,
dictionary, set等通用结构聚合起来?我觉得这个和OOP中定义的类或结构还是有区
别的。这种聚合的方式好像是一种无类型声明的数据结构。理论上说这样就足够了吗?

programming
other
This
you
n******7
发帖数: 12463
12
来自主题: Programming版 - functional programming的两个方面
说的有那么点意思,但是还是有点混
比如LINQ既是他说的老的定义的higher order function, 也是他提到的pure
function
LINQ的select就是map, aggregate就是reduce
我觉得老定义的东西比较实用,性能损失少(if any), 也是现在主流语言加入fp
feature的主要内容,跟传统编程概念结合的也比较自然
新定义的强调immutability的fp需要洗脑,性能上也不乐观,我个人不看好
s********1
发帖数: 581
13
来自主题: Software版 - 什么是functionality test?
什么是functionality test?
software QA 中的functionality test 与其他的QA test 有什么区别?
谢了。
h*******c
发帖数: 5
14
来自主题: Unix版 - error in my function "write_log"
I write a function "write_log" to log some message:
void write_log (FILE *fp_log, char *format, ...)
{
time_t tm;
va_list vl;

va_start(vl, format);
time(&tm);

printf("%s, pid:%d, ", cut_newline(ctime(&tm)),
(int)getpid());
printf(format, vl);
fprintf(fp_log, "%s, pid:%d, ",
cut_newline(ctime(&tm)), (int)getpid());
fprintf(fp_log, format, vl);
va_end(vl);
fflush(fp_log);
}
I call the function with : w
h**o
发帖数: 548
15
I have a file which records the activities of all functions.
I want to count from this file how many times each of the function is called.
How to write a unix shell to count them?
or
is there any other way?
Thanks
h**o
发帖数: 548
16
I have a file which records the activities of all functions.
I want to count from this file how many times each of the function is called.
How to write a unix shell to count them?
or
is there any other way?
Thanks
a*****l
发帖数: 27
17
As far as I know, Excel does not have symblic integral functionality. You can
first create tiny intervals in Excel, then evaluate the function and
accumulate, I think it is called 蒙特卡罗 method.
a****d
发帖数: 1919
18
最新一期的Nature paper,reprogramming from fibroblasts to functional neurons
. 一样的套路,不过还是感觉很crazy!
Direct conversion of fibroblasts to functional neurons by defined factors
Thomas Vierbuchen1,2, Austin Ostermeier1,2, Zhiping P. Pang3, Yuko Kokubu1,
Thomas C. Südhof3,4 & Marius Wernig1,2
Abstract
Cellular differentiation and lineage commitment are considered to be robust
and irreversible processes during development. Recent work has shown that
mouse and human fibroblasts can be reprogrammed to a plurip
P**K
发帖数: 80
19
Got email for the postdoctoral positions. FYI
The Enzyme Function Initiative (EFI) has been established with a Glue Grant
from
NIGMS/NIH (U54GM093342). The EFI’s goal is to develop a general
sequence/structure-based
strategy for facilitating discovery of in vitro enzymatic and in vivo
metabolic/physiological
functions of unknown enzymes discovered in genome projects, a crucial
limitation in
genomic
biology. This goal will be accomplished by integrating bioinformatics,
structural
biology, and
com
z*****g
发帖数: 306
20
来自主题: Biology版 - Help please: to compare protein function
Renzhen qingjiao wenti. Duo xie!
I have two genes: A and B. They do not match each other based on DNA
sequence. I am pretty sure that A and B possess the same/similar function. I
know the peptide sequence in A gene correspending to the function. How to
find out the its counterpart in B gene? Is there a free online program for
this purpose?
Duo xie!!
z*****g
发帖数: 306
21
来自主题: Biology版 - Help please: to compare protein function
Yes. I want to figure out the same functional domain in gene B as that in A.
I tried Blast to align the two gene, but Blast only shows the sequence
similarity, without functional information.
I appreciate any help! Duo xie!!
m**e
发帖数: 857
22
can you believe of it? Just 3 amino acid.
Regulatory evolution through divergence of a phosphoswitch in the
transcription factor CEBPB
Lynch VJ, May G, Wagner GP.
Nature. 2011 Nov 13;480(7377):383-6. doi: 10.1038/nature10595.
Abstract
There is an emerging consensus that gene regulation evolves through changes
in cis-regulatory elements and transcription factors. Although it is clear
how nucleotide substitutions in cis-regulatory elements affect gene
expression, it is not clear how amino-acid sub... 阅读全帖
r******k
发帖数: 446
23
大神们, gain of function的mutant protein会不会比WT被降解的更快呢?以我所知
,一般不都是loss of function的mutant form of protein会被degrade更快么???
s******s
发帖数: 13035
24
你说体内么?
是不是degrade和function没啥直接关系吧。misfold了就容易degrade,
这完全和function是间接关系。你的啥gain或者loss完全是遗传学的概念,
要看分子层面到底怎么回事

h**********r
发帖数: 671
25
Title:
Bacterial XylRs and synthetic promoters function as genetically encoded
xylose biosensors in Saccharomyces cerevisiae
Biotechnology Journal
最好是把补充材料也帮忙down下来吧。我的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.r... 阅读全帖
h*******o
发帖数: 1114
26
来自主题: Chemistry版 - Reverse tan function
Can anyone tell me how to fit my own data on reverse tan function by using
EXCEL? The problem is my Y range is from 951 to 959, how to fit this range
to -Pi/2 to + Pi/2? The reason for me to fit this function is my plot shape
is very similar to reverse Tan. Thank you so so so much!
x*y
发帖数: 364
27
来自主题: Computation版 - Re: help! bilinear basis function conver
Now I'm also wondering about this.
I got my results that bilinear basis function (quadrilateral element in 2-D)
yields 1.89 convergence rate for conformation tensor (or elastic stress) and
linear basis function (tetrahedral element in 3-D) yields 1.65 convergence
rate for conformation tensor. I use DEVSS-SUPG method for viscoelastic flow
confpuation. A reference paper shows that DEVSS-SUPG method yields r+0.5 which
is 1.5 in my case. But I think 1.89 is far above 1.5, and my advisor thinks
bilin
m*e
发帖数: 1018
28
【 以下文字转载自 Science 讨论区,原文如下 】
发信人: mie (cookie), 信区: Science
标 题: Help!有什么软件可以计算Correlation function
发信站: Unknown Space - 未名空间 (Sun Oct 3 18:22:41 2004) WWW-POST
由于我不是搞计算的,拿着这个问题在很短的时间内实在没办法。
我手上有一组2D数据,不知道有什么软件可以直接计算这些点的pair correlation
function, 多谢了!
p*s
发帖数: 30
29
I am writing an M-file based s-function in Simulink, I need multi-outputs.
The documentation is poor, I think, mabye I just don't have the patience to
go through all the corners to find my answer.
anyway, I figured it out by try and error. I list my solution here, hope
it helps.
Simulink provides a standard template, which is too complicated and not very
well explained. For my application, I just use the 'timestwo' example as the
template.
Following those steps,
Inside the s-function
(1) go to t
c****w
发帖数: 565
30
if you want to go with s-function for your rest of research life, i strongly
suggest you learn C-type s-function. That will give you more flexiblity.
Long time ago, I made a common comment on it, you can check here:
http://www.simwe.com/forum/viewthread.php?tid=205002
s********1
发帖数: 581
31
来自主题: Computation版 - 什么是functionality test?
什么是functionality test?
software QA 中的functionality test 与其他的QA test 有什么区别?
谢了。
l******d
发帖数: 12
32
来自主题: Computation版 - Matlab where function?
Thanks for your help in advance ...
Is there a function in matlab that can accomplish what the fortran 90
intrinsic function 'where' does:
WHERE ( x >= 0.0 )
z = 4.0*sqrt(x)
ELSEWHERE
z = 0.0
END WHERE
Here x, z are both vectors.
I assume matlab must have something similar, otherwise, looping over every
element of x would be too expensive. Thank you very much~~~
a****f
发帖数: 944
33
来自主题: Computation版 - optimization using matlab function fmincon
When you do energy minimization problems, do you use built-in matlab
function or write your own gradient descent method ( or other methods)?
I use matlab function fmincon for a constrained optimization problem, but
the parameters don't change at all after optimization, except those that did
not satisfy the constraints are changed to meet the constraints.
Does anyone know the reason?
x*****u
发帖数: 3419
34
来自主题: Computation版 - Calling Cuda Functions from Fortran z
http://www.computationalmathematics.org/topics/files/calling_cuda_from_fortran.html
Calling Cuda Functions from Fortran
Author: Austen Duffy, Florida State University
Cuda functions can be called directly from fortran programs by using a
kernel wrapper as long as some
simple rules are followed.
1. Data Types: Make sure you use equivalent data types, these basically
follow from fortran --> C
conventions. Make sure to specify fortran integers and reals, note that
integer*2 is a short int in C, I h
c*******h
发帖数: 1096
35
来自主题: Computation版 - 问个matlab function handle的问题
我有一个函数 func(x, para),要将它作为参数传给另外一个函数 foo
例如 foo( @(x)func(x,para), y, z )
那么 foo 函数应该怎么定义?
如果写成
function ret = foo( @(x)func(x,para), y, z )
那样是语法出错的
如果写成
function ret = foo( func, y, z )
那样又不能将 para 传进去
应该怎么写呢?
l*****0
发帖数: 299
36
matlab中的robust fit可以画confidence bound for function吗?
Least square fit是可以画confidence bound for function的。robust fit也可以画
吗?
谢谢!
l**********t
发帖数: 5754
37
when using expected utility to select optimal portfolio choice, how do I
determine the function form & risk aversion / temporal discount to fit the
representative investor? reference articles are highly appreciated.
many thanks.
l**********t
发帖数: 5754
38
thanks for considering the question.
in portfolio choice within the maxmizing expected utility framework, what
are the empirical evidences to justify the use of CRRA (or HARA , or any
other form) utility func, and how are the parameters in these functions
calibrated?
c****e
发帖数: 1842
39
utility function 设定,应该看你的问题吧。。从那个最简单的CRRA 试起吧。parame
ters 比如r和beta,,应该是从data calibrate出来的。如果你说到的max和bellman有
关,,大概需要用numerical的办法解了。
乱说一点,最近了解就这么多。。
l**********t
发帖数: 5754
40
thanks for the information. my problem falls into case 1.
"具体parameter value一般都是随便选的,比如CRRA,有把gamma定成4的,5,6,10都
有。" -- that's the impression I got from the literature: utility functions
(CRRA, etc) are chosen for convenience of having a closed formula and risk
index is chosen somewhat arbitrary. Any papers on fitting the risk index on
empirical data or how to measure the actual risk aversion of an investor?
Many thanks.
1。如果fully numerical做DP,那复杂的都能做,比如recursive preference, risk-
sensitive prefe
a**n
发帖数: 3801
41
你想干啥用?
这些都是唬人的。
哪有啥人是CRRA的

functions
on
CRRA
B******e
发帖数: 16928
42
Utility is somewhat arbitrarily chosen. It totally depends on the issue you
want to address as well as your taste. You can either choose CRRA, E-Z or
Habit formation. Risk aversion is usually a free parameter. However, there
are experimental studies which try to measure the risk aversion parameter of
individuals and the free risk aversion parameters are usually set to not
violate those experimental measures too much.

functions
on
CRRA
c****e
发帖数: 1842
43
理论上,那个effective risk aversion 你可以通过模型设定(推算)出和某某因素相
关的。这样的话,就和你的utility function设定有关了。。那个recursive的utility
好像可以吧。。
但是,这样,解出optimal portfolio大概会比较难。。
我觉得那个r虽然经常是被设定不变的,,但是往往是通过引入shocks来影响optimal p
ortfolio。或许可以参见heterogeneity portfolio choice的paper。。

Any
across
X*****r
发帖数: 2521
44
【 以下文字转载自 Mathematics 讨论区 】
发信人: Xfilter (支持南开的兄弟们), 信区: Mathematics
标 题: 请问有那种optimization是解决变化的objective function的?
发信站: BBS 未名空间站 (Mon Jan 21 19:31:57 2008), 转信
就是objective function是time varying的
有没有那种optimization或者其他的数学model是deal这种time varying objective fu
nction的?
多谢多谢!
s*******y
发帖数: 4173
45
老板要把一个matlab软件放到网上,
但想把其中一个function封装起来,
这样别人就没法看到那个function的内容。
有没有大侠讲讲如何做。
h********y
发帖数: 2
46
来自主题: Engineering版 - 紧急求救:writing S-function in matlab
I have a multi input coupled 2nd order non-linear system and want to generate
a
S-funciton generic simulink block. The forward numerical method run well in m-
file formate if given a very small step size: deltaT=.00005, but it will blow
up when implemented by using s-function block.
I don't have much experience using m-file to write s-function. I am wondering
if the m-file s-funciton itself have some bugs when impelmenting this kind of
highly non-linear system.
Help help. and Thanks a lot.
h********y
发帖数: 2
47
来自主题: Engineering版 - 紧急求救:writing S-function in matlab
I have a multi input coupled 2nd order non-linear system and want to generate
a
S-funciton generic simulink block. The forward numerical method run well in m-
file formate if given a very small step size: deltaT=.00005, but it will blow
up when implemented by using s-function block.
I don't have much experience using m-file to write s-function. I am wondering
if the m-file s-funciton itself have some bugs when impelmenting this kind of
highly non-linear system.
Help help. and Thanks a lot.
h***s
发帖数: 111
48
来自主题: Macromolecules版 - 请教 functionality 如何定义?
对于直链高分子(不包括graft, dentric and comblike polymer;),除了用 mmol/g 表
示外,下面那个定义相对好点
number of functional groups per chain?
fraction of functionalized polymer??
Thanks!
h***s
发帖数: 111
49
来自主题: Macromolecules版 - 请教 functionality 如何定义?
for example, if you want to make a monofunctional polymer by quenching the
anions with a functional qunecher in anionic polymerization, it is hard to
garuantee 100% efficiency to attach your desired functional group at the chain
end

d**a
发帖数: 3715
50
请问 diacrylate 的 functionality 是4还是2.
我们实验室的postdoc认为是2,因为有两个官能团。
但是我认为是4. 因为每个acrylate可以和另外的两个acrylate反应。这也是为什么
diacrylate
能够自身crosslink 形成 network. 根据书上说的,只有 functionality >2 才可以交
联的。
请问哪位达人能够指点一下。谢谢。
首页 上页 1 2 3 4 5 6 7 8 9 10 (共10页)