科学网

 找回密码
  注册

tag 标签: 编程

相关帖子

版块 作者 回复/查看 最后发表

没有相关内容

相关日志

贝塞尔函数及其编程和书籍
热度 3 zuozw 2010-5-1 22:49
贝塞尔 函数 ( Bessel function, 又称柱函数 ) 是一类在各工程领域中有着广泛应用的特殊函数。贝塞尔函数是贝塞尔方程 ( 一个二阶常微分方程 ) 的解。 一般有三类贝塞尔函数 1 、第一类贝塞尔函数 (Bessel function of the first kind) J v (x) 2 、第二类贝塞尔函数 (Bessel function of the second kind), 又称诺依曼函数( Neumann function ) :Y v (x)( 或 N v (x)) 3 、第三类贝塞尔函数( Bessel function of the third kind ),又称汉克尔函数( Hankel function ) : H 1 v (x) 和 H 2 v (x) 。 当贝塞尔方程为变形贝塞尔方程 ( 虚宗量贝塞尔方程 ) 时,方程的解一般有两类 1、 变形第一类贝塞尔函数( modified Bessel function of the first kind ) I v (x) 2、 变形第二类贝塞尔函数( modified Bessel function of the second kind ) K v (x) 另外应用比较多的函数还有球贝塞尔函数 (Spherical Bessel functions) 、艾里函数 (Airy functions )等等。由于贝塞尔函数的广泛应用,很多软件都提供了现成的函数供用户使用。 Mathematics :提供了比较多的 Bessel 函数。如: Bessel 函数 BesselJ BesselY BesselI BesselK 球体 Bessel 函数 SphericalBesselJ SphericalBesselY Hankel 函数 HankelH1 HankelH2 SphericalHankelH1 SphericalHankelH2 Airy 函数 AiryAi AiryAiPrime AiryBi AiryBiPrime Kelvin 函数 KelvinBer KelvinBei KelvinKer KelvinKei Struve 函数 StruveH StruveL AngerJ WeberE 零函数 BesselJZero BesselYZero AiryAiZero AiryBiZero Matlab :提供了五个函数 besselj 、 bessely 、 besselh 、 besseli 和 besselk 分别对应第一类 Bessel 函数、第二类 Bessel 函数、第三类 Bessel 函数、第一类变形 Bessel 函数和第二类变形 Bessel 函数。语法 besselj(nu,z) : nu 为函数的阶次,可以不为整数但必须为实数。 z 为函数的变量,可以为复数。还有 besselj(nu,z,1) 语法,可查询帮助。其他函数除了 besselh 有些不同外,基本类似。至于球函数、 Airy 函数等可通过这个函数来构造实现。 Excel :提供了四个函数,即: BESSELJ 、 BESSELY 、 BESSELI 、 BESSELK 。 语法: BESSELJ (x,n) ;其中, x 为参数值, n 为函数的阶数。如果 n 非整数,则截尾取整。即 Excel 中只能计算整数阶次的 Bessel 函数。其他函数类似。 关于贝塞尔函数的专业书籍有: 中文 刘颖,《圆柱函数》国防工业出版社, 1983 。 奚定平,《贝塞尔函数》高等教育出版社和施普林格出版社, 1998. 英文 George Neville Watson 《 A Treatise on the Theory of Bessel Functions 》 Cambridge University Press , 1995(1944 , 1922) 最经典的一本书。 BG Korenev 《 Bessel Functions and Their Applications 》 CRC 2002. Milton Abramowitz, and Irene A. Stegun 《 Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables 》 Dover Publications 1964. I.S. Gradshteyn, I.M. Ryzhik, A Jeffrey, D Zwillinger 《 Table of integrals, series and products 》 (Seventh Edition) Academic Press 2007.
个人分类: 科研心得|12512 次阅读|7 个评论
数值逼近求解线性常微分方程
qianlivan 2010-4-26 10:51
线性微分方程的求解方法很多,直接积分可以得到很高的精度。但是尝试一下用数值逼近的方法也是很有意思的。 下面以用Chebyshev多项式展开求解方程(x= 的一段) dy/dx=y y(0)=1 为例说明这个方法。 n阶Chebyshev定义为T(n,x)=cos(n arccos(x))。假设函数y(x)可以近似为 y(x)=\sum^{n}_{i=1} a_i T(i,x) 那么,取需要求解的区间内的n-1个点,加上初始条件,方程可以表示为n元线性方程组,用线性代数的方法可以求解展开系数a_i。 下面是实现这个方法的一段代码 function trychebyshev2(n,t0,t1)% use first n Chebyshev polinomial to approximate % t0:lower boundary; t1: upper boundary A=zeros(n,n); h=t0:(t1-t0)/n:t1; t=h(2:end); for j=1:n-1 for i=1:n A(j,i)=chebT(i,t(j))-chebQ(i,t(j)); % the differential equation is y'=y, y(0)=1 end end for i=1:n A(n,i)=chebT(i,0); end B=zeros(n,1); B(n)=1; x=linsolve(A,B); z=0:0.05:1; f1=0; for i=1:n f1=f1+x(i)*chebT(i,z); end f2=exp(z); plot(z,f1,'r',z,f2,'b'); function y=chebT(n,x) y=cos(n.*acos(x)); function y=chebQ(n,x) y=sin(n.*acos(x)).*n./sqrt(1-x.^2); 用5阶Chebyshev多项式时误差可以达到百分之几。 用10阶Chebyshev多项式近误差就小得多了。 不过,可以看到,在近似区间之外,近似函数和真实函数就完全不同了。
个人分类: 总结|6156 次阅读|2 个评论
简单的flex-java的程序
putin24 2010-4-13 14:48
使用 myeclipse 6.5.1 、 flex builder3.0做一个简单的flex-java的程序。 1 、创建 flex 项目: file - new - flex project 如下图1 Application type 中选 第一个 web application ; Server technology 中选择 j2ee, 勾选 user remote object access service ( 否则无法调用 java) 2 、点 next 按钮 ,下一界面如图2示。 在 J2EE Settings 中, 1) 选择一个 tomcat 服务器,点击 new- 到电脑安装过的 tomcat 安装目录; 2)Context root 设置为 MyFlex( 项目名称 ) ; 3) 指定 flex war file 文件 blazeds.war 的路径,(其作用是用来实现 java 和 flex 间的通信),可从网络上下载 blazeds.war ,然后选择 blazeds.war 存在的目录路径; 4)Compilation options 编译方式中选择 第一个可以节省服务器的开销; 5 ) output folder 与 Content folder 都一样,设置为 Webroot ; 3 、点 next 如图3,然后点 finish 。 4 、在项目上右键 myeclipse - add web project capabilities ,项目已经建好,现在做个 flex 访问 java 的例子。 在 MyFlex.mxml 中添加: mx:Script ! ] /mx:Script !-- mx:RemoteObject destination=Hello id=hlo endpoint=http://localhost:8080/FlexTest/messagebroker/amf result=show(event) /-- mx:RemoteObject destination= Hello id= hlo endpoint= http://localhost:8080/FlexText/messagebroker/amf mx:method name= sayHello result=show(event) / /mx:RemoteObject mx:Panel title= 调用 java width= 415 height= 278 mx:FormItem label= 输入: mx:TextInput id= input / /mx:FormItem mx:FormItem mx:Button label= 调用 click=say() / /mx:FormItem mx:FormItem label= 输出为: height= 79 mx:TextArea id= output width= 262 height= 78 /mx:TextArea /mx:FormItem /mx:Panel 5 、创建 java 文件 package com.test; public class Hello { /** * * @param name * @return */ public String sayHello(String name){ System. out .println(name+ say hello! ); return name+ say hello! ; } } 6 、配置 remote-config.xml 文件,添加: destination id = Hello properties source com.test.Hello / source / properties / destination 7 、通过 tomcat 发布项目 8 、在 myflex.mxml 文件上右键, run as - flex application : 输入 aaaa 点调用 如图4: 图1 图2 图3 图4
个人分类: 生活点滴|3578 次阅读|0 个评论
笔记(十一)IDL三维可视化
qianlivan 2010-4-2 09:56
笔记(十一)IDL三维可视化的一种方法 用TV命令画等值面 pro three fitsname='../gaussfit.fits' a=mrdfits(fitsname) head=headfits(fitsname);read the header of the fits file to a vector nx = fxpar(head,'NAXIS1'); number of elements in the first dimension ny = fxpar(head,'NAXIS2'); nv = fxpar(head,'NAXIS3'); ;a=read_binary('/home/qianl/Software/idl_6.2/examples/data/head.dat',$ ; data_dims= ,data_type=1) b=lindgen(nx,ny,nv) bnz0=b/nx/ny bny0=(b-bnz0*nx*ny)/nx bnx0=b-bnz0*nx*ny-bny0*nx bx=bnx0*1.0d0 by=bny0*1.0d0 bv=bnz0*1.0d0 ;a=exp(-((bx-30.0)/10.0)^2-((by-30.0)/10.0)^2-((bv-30.0)/10.0)^2) shade_volume,a,max(a)/2.0,v,p,/low scale3,xrange= ,yrange= ,zrange= set_plot,'PS' filename='3d_TV.ps' ; set the file name of the output ps file device,file=filename,/COLOR, BITS=8 tv,polyshade(v,p,/t3d) device,/CLOSE end
个人分类: 总结|5765 次阅读|0 个评论
笔记(十)
qianlivan 2010-4-1 23:00
笔记(十)二维高斯分布和高斯聚类的程序 生成两个二维高斯分布随机数样本的组合样本,用混合高斯模型聚类,算出每个点属于每个高斯成分的概率,代码如下,结果如图所示。 %testcluster.m: z1= ; z2= ; z= ; x=gmm(z,2); hold on scatter3(z(:,1),z(:,2),x(:,1),'.'); scatter3(z(:,1),z(:,2),x(:,2),'.'); %axis( ) %view( ); view(-162,-13); hold off print -dpng gmm.png %gmm.m function varargout = gmm(X, K_or_centroids) % ============================================================ % Expectation-Maximization iteration implementation of % Gaussian Mixture Model. % % PX = GMM(X, K_OR_CENTROIDS) % = GMM(X, K_OR_CENTROIDS) % % - X: N-by-D data matrix. % - K_OR_CENTROIDS: either K indicating the number of % components or a K-by-D matrix indicating the % choosing of the initial K centroids. % % - PX: N-by-K matrix indicating the probability of each % component generating each point. % - MODEL: a structure containing the parameters for a GMM: % MODEL.Miu: a N-by-K matrix. % MODEL.Sigma: a D-by-D-by-K matrix. % MODEL.Pi: a 1-by-K vector. % ============================================================ threshold = 1e-15; = size(X); if isscalar(K_or_centroids) % judge if K_or_centroids is a scalar K = K_or_centroids; % K is the number of Gaussian components % randomly pick centroids rndp = randperm(N); % randomly permute the index array 1:N centroids = X(rndp(1:K), :); % centers of the Gaussian components else K = size(K_or_centroids, 1); % size of the first dimension (number of rows) centroids = K_or_centroids; end % initial values = init_params(); Lprev = -inf; while true Px = calc_prob(); % new value for pGamma pGamma = Px .* repmat(pPi, N, 1); % (N by K) matrix pGamma = pGamma ./ repmat(sum(pGamma, 2), 1, K); % (N by K) matrix % new value for parameters of each Component Nk = sum(pGamma, 1); % add to a single row (1 by K) pMiu = diag(1./Nk) * pGamma' * X; % (K by D) pPi = Nk/N; for kk = 1:K Xshift = X-repmat(pMiu(kk, :), N, 1); % (N by D) pSigma(:, :, kk) = (Xshift'* ... (diag(pGamma(:, kk)) * Xshift))/ Nk(kk); % (D by D) end % check for convergence L = sum(log(Px*pPi')); if L-Lprev threshold break; end Lprev = L; end if nargout == 1 varargout = {Px}; else model = = init_params() pMiu = centroids; % set the centers of Gaussian components pPi = zeros(1, K); pSigma = zeros(D, D, K); % hard assign x to each centroids distmat = repmat(sum(X.*X, 2), 1, K) + ... repmat(sum(pMiu.*pMiu, 2)', N, 1) - ...% (N by K) matrix 2*X*pMiu'; % pMiu' (D by K) % add the columns to a single column % and creat a large % matrix (N by K) by % tiling % X*pMiu' (N by K) % distmat is an (N by K) % to specify the % distance of every data % point to the K centers = min(distmat, [], 2); % return minimum of every row % labels is the column % numbers for k=1:K Xk = X(labels == k, :); pPi(k) = size(Xk, 1)/N; pSigma(:, :, k) = cov(Xk); % if Xk is a vector, cov(Xk)is % the variance,just set the % K initial (D by D matrix) to the same value end end function Px = calc_prob() Px = zeros(N, K); for k = 1:K Xshift = X-repmat(pMiu(k, :), N, 1); % N by D matrix inv_pSigma = inv(pSigma(:, :, k)); % invert the matrix (D by D) tmp = sum((Xshift*inv_pSigma) .* Xshift, 2); % N element vector coef = (2*pi)^(-D/2) * sqrt(det(inv_pSigma)); Px(:, k) = coef * exp(-0.5*tmp); % the probability end end end
个人分类: 总结|167 次阅读|0 个评论
笔记(九)
qianlivan 2010-4-1 14:52
笔记(九) 一点Matlab知识 isscalar(a)用于判断变量a是不是标量,可以处理多种类型的函数的输入值。 randperm(N)产生一个将数组1:N元素随机排列的数组。 repmat(a,m,n)将a作为一个分块,排列成一个大的矩阵,这个矩阵是a和矩阵ones(m,n)的直积。 cov(A)计算矩阵A的列向量的协方差矩阵,如果A有m列,则cov(A)是m×m矩阵。 画二维高斯函数: mu1= ; Sigma2= ; % 输入均值向量和协方差矩阵 =meshgrid(-3:0.1:1,-2:0.1:4); xy= ; %产生网格数据 p=mvnpdf(xy,mu1,Sigma2); P=reshape(p,size(X)); %求取联合概率密度 surf(X,Y,P)
个人分类: 总结|2494 次阅读|0 个评论
笔记(八)
qianlivan 2010-3-27 20:42
笔记(八)高斯拟合分子云中的团块 function newtfunc,t common temp,a,x,y,v,nx,ny,nv,crpixx,crpixy,crpixv,maxa,$ cdeltax,cdeltay,cdeltav,crvalx,crvaly,crvalv,nx0,ny0,nv0,dbeam,$ vres,offset a0=t phi=t x10=t x20=t delx1=t delx2=t delv=t v0=t alf1=t alf2=t ;;;;;;;;;;;;;;;;;; ;b0=t b0=offset ;;;;;;;;;;;;;;;;;; b=lindgen(nx,ny,nv) bnz0=b/nx/ny bny0=(b-bnz0*nx*ny)/nx bnx0=b-bnz0*nx*ny-bny0*nx bx=bnx0*1.0d0 by=bny0*1.0d0 bv=bnz0*1.0d0 ;weight=exp(-((bx-nx0)/10.0)^2-((by-ny0)/10.0)^2-$ ; ((bv-nv0)/10.0)^2) weight=bx*0.0+1.0 normal=nx*ny*nv*1.0d0-11.0d0 value=a0*exp(-(bx*cos(phi)+by*sin(phi)-x10)^2/(dbeam^2+delx1^2)-$ (-bx*sin(phi)+by*cos(phi)-x20)^2/(dbeam^2+delx2^2)-4.0*alog(2.0)/delv^2$ *(bv-v0-alf1*(bx-x10)-alf2*(by-x20))^2)+b0 chi2=total(weight*(value-a)^2+exp(value-a))/normal+$ (((x10-nx0)/dbeam)^2+((x20-ny0)/dbeam)^2+$ ((v0-nv0)/vres)^2)+(a0+b0-maxa)^2 print,'chi2 a0 b0 maxa',chi2,a0,b0,maxa print,'x10 x20 v0',x10,x20,v0 return,chi2 end function grad,t common temp,a,x,y,v,nx,ny,nv,crpixx,crpixy,crpixv,maxa,$ cdeltax,cdeltay,cdeltav,crvalx,crvaly,crvalv,nx0,ny0,nv0,dbeam,$ vres,offset a0=t phi=t x10=t x20=t delx1=t delx2=t delv=t v0=t alf1=t alf2=t ;;;;;;;;;;;;;;;;;;;; ;b0=t b0=offset ;;;;;;;;;;;;;;;;;;;; b=lindgen(nx,ny,nv) bnz0=b/nx/ny bny0=(b-bnz0*nx*ny)/nx bnx0=b-bnz0*nx*ny-bny0*nx bx=bnx0*1.0d0 by=bny0*1.0d0 bv=bnz0*1.0d0 ;weight=exp(-((bx-nx0)/10.0)^2-((by-ny0)/10.0)^2-$ ; ((bv-nv0)/10.0)^2) weight=bx*0.0+1.0 normal=nx*ny*nv*1.0d0-11.0d0 H1=exp(-(bx*cos(phi)+by*sin(phi)-x10)^2/(dbeam^2+delx1^2)-$ (-bx*sin(phi)+by*cos(phi)-x20)^2/(dbeam^2+delx2^2)-4.0*alog(2.0)/delv^2$ *(bv-v0-alf1*(bx-x10)-alf2*(by-x20))^2) Yfit=a0*H1+b0 deviate=Yfit-a H2=2.0*deviate H3=(bx*cos(phi)+by*sin(phi)-x10) H4=(-bx*sin(phi)+by*cos(phi)-x20) H5=bv-v0-alf1*(bx-x10)-alf2*(by-x20) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;for test ;H6=(-(bx*cos(phi)+by*sin(phi)-x10)^2/(dbeam^2+delx1^2)-$ ; (-bx*sin(phi)+by*cos(phi)-x20)^2/(dbeam^2+delx2^2)-4.0*alog(2.0)/delv^2$ ; *(bv-v0-alf1*(bx-x10)-alf2*(by-x20))^2) ;H6=-4.0*alog(2.0)/delv^2*(bv-v0-alf1*(bx-x10)-alf2*(by-x20))^2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;for test da0=H1 dphi=a0*H1*(-(2.0*H3*((-bx*sin(phi)+by*cos(phi))/(dbeam^2+delx1^2))+$ 2.0*H4*((-bx*cos(phi)-by*sin(phi))/(dbeam^2+delx2^2)))) dx10=a0*H1*(-2.0*H3*(-1.0/(dbeam^2+delx1^2))-4.0*alog(2.0)/delv^2*H5*(-alf1)) dx20=a0*H1*(-2.0*H4*(-1.0/(dbeam^2+delx2^2))-4.0*alog(2.0)/delv^2*H5*(-alf2)) ddelx1=a0*H1*(-2.0*H3^2/(-(dbeam^2+delx1^2)^2)*delx1) ddelx2=a0*H1*(-2.0*H4^2/(-(dbeam^2+delx2^2)^2)*delx2) ddelv=a0*H1*(-4.0*alog(2.0)/delv^3*(-2.0)*H5^2) dv0=a0*H1*(-4.0*alog(2.0)/delv^2*2.0*H5*(-1)) dalf1=a0*H1*(-4.0*alog(2.0)/delv^2*2.0*H5*(-(bx-x10))) dalf2=a0*H1*(-4.0*alog(2.0)/delv^2*2.0*H5*(-(by-x20))) db0=1.0d0 fda0=total(weight*H2*da0+exp(Yfit-a)*da0)/normal $ +2.0*(a0+b0-maxa) fdphi=total(weight*H2*dphi+exp(Yfit-a)*dphi)/normal fdx10=total(weight*H2*dx10+exp(Yfit-a)*dx10)/normal $ +2.0*(x10-nx0)/dbeam^2 fdx20=total(weight*H2*dx20+exp(Yfit-a)*dx20)/normal $ +2.0*(x20-ny0)/dbeam^2 fddelx1=total(weight*H2*ddelx1+exp(Yfit-a)*ddelx1)/normal fddelx2=total(weight*H2*ddelx2+exp(Yfit-a)*ddelx2)/normal fddelv=total(weight*H2*ddelv+exp(Yfit-a)*ddelv)/normal fdv0=total(weight*H2*dv0+exp(Yfit-a)*dv0)/normal $ +2.0*(v0-nv0)/vres^2 fdalf1=total(weight*H2*dalf1+exp(Yfit-a)*dalf1)/normal fdalf2=total(weight*H2*dalf2+exp(Yfit-a)*dalf2)/normal fdb0=total(weight*H2*db0+exp(Yfit-a)*db0)/normal $ +2.0*(a0+b0-maxa) ;print,'grad ',fda0,fdphi,fdx10,fdx20,fddelx1,fddelx2,fddelv,$ ; fdv0,fdalf1,fdalf2,fdb0 return, ;,$ ; fdb0] end function eval,t common temp,a,x,y,v,nx,ny,nv,crpixx,crpixy,crpixv,maxa,$ cdeltax,cdeltay,cdeltav,crvalx,crvaly,crvalv,nx0,ny0,nv0,dbeam,$ vres,offset a0=t phi=t x10=t x20=t delx1=t delx2=t delv=t v0=t alf1=t alf2=t ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;b0=t b0=offset ;;;;;;;;;;;;;;;;;;;;;;;;;;;; b=lindgen(nx,ny,nv) bnz0=b/nx/ny bny0=(b-bnz0*nx*ny)/nx bnx0=b-bnz0*nx*ny-bny0*nx bx=bnx0*1.0d0 by=bny0*1.0d0 bv=bnz0*1.0d0 value=a0*exp(-(bx*cos(phi)+by*sin(phi)-x10)^2/(dbeam^2+delx1^2)-$ (-bx*sin(phi)+by*cos(phi)-x20)^2/(dbeam^2+delx2^2)-4.0*alog(2.0)/delv^2$ *(bv-v0-alf1*(bx-x10)-alf2*(by-x20))^2); gaussian component ; without the offset term! ;print,'max gaussian',max(value),a0,$ ; max(exp(-(bx*cos(phi)+by*sin(phi)-x10)^2/(dbeam^2+delx1^2))*$ ; exp(-(-bx*sin(phi)+by*cos(phi)-x20)^2/(dbeam^2+delx2^2))*$ ; exp(-4.0*alog(2.0)/delv^2*(bv-v0-alf1*(bx-x10)-alf2*(by-x20))^2)) return,value end pro gaussclumps4 common temp,a,x,y,v,nx,ny,nv,crpixx,crpixy,crpixv,maxa,$ cdeltax,cdeltay,cdeltav,crvalx,crvaly,crvalv,nx0,ny0,nv0,dbeam,$ vres,offset fitsname='../co12_2.fits' a=mrdfits(fitsname) head=headfits(fitsname);read the header of the fits file to a vector bw = fxpar(head,'BW'); band width freq = fxpar(head,'LINEFREQ'); central frequency nx = fxpar(head,'NAXIS1'); number of elements in the first dimension ny = fxpar(head,'NAXIS2'); nv = fxpar(head,'NAXIS3'); crvalx = fxpar(head,'CRVAL1'); reference value of the first dimension cdeltax = fxpar(head,'CDELT1'); increasement of the first dimension ; in units of degree, when calculate physical ; scale, must changed to arcdegree crpixx = fxpar(head,'CRPIX1'); reference position of the first dimension crvaly = fxpar(head,'CRVAL2'); cdeltay = fxpar(head,'CDELT2'); crpixy = fxpar(head,'CRPIX2'); crvalv = fxpar(head,'CRVAL3'); cdeltav = fxpar(head,'CDELT3'); crpixv = fxpar(head,'CRPIX3'); x=dindgen(nx); y=dindgen(ny); v=dindgen(nv); ;print,1.0/(nx*ny*nv*1.0d0) b=lindgen(nx,ny,nv) bnz0=b/nx/ny bny0=(b-bnz0*nx*ny)/nx bnx0=b-bnz0*nx*ny-bny0*nx bx=bnx0*1.0d0 by=bny0*1.0d0 bv=bnz0*1.0d0 print,max(b) ;a=exp(-((bx-30.0)/10.0)^2-((by-30.0)/10.0)^2-((bv-30.0)/10.0)^2) dbeam=1.0 vres=1.0 for iloop=1,10 do begin maxa=max(a) index=where(a eq maxa) nv0=index /nx/ny ny0=(index -nv0*nx*ny)/nx nx0=index -nv0*nx*ny-ny0*nx print,'maxa nx0 ny0 nv0 ',maxa,nx0,ny0,nv0 a0=maxa phi=0.0 x10=nx0*1.0d0 x20=ny0*1.0d0 delx1=10*1.0d0 delx2=10*1.0d0 delv=10.0d0 v0=nv0*1.0d0 alf1=0.1 alf2=0.1 b0=0.1 ;;;;;;;;;;;;;;;;;;;;;; offset=b0 ;set a constant offset ;;;;;;;;;;;;;;;;;;;;;; t=dindgen(10) t =a0 t =phi t =x10 t =x20 t =delx1 t =delx2 t =delv t =v0 t =alf1 t =alf2 ; t =b0 ;r=amoeba(1.0e-2,SCALE=t,P0=t,FUNCTION_NAME='newtfunc') ;xi=transpose( ,$ ; ,$ ; ,$ ; ,$ ; ,$ ; ,$ ; ,$ ; ,$ ; ,$ ; ,$ ; ]) ;powell,t,xi,1.0e-4,fmin,'newtfunc' ; print,'a0, phi, x10, x20 ',t ; print,'delx1, delx2, delv, v0 ',t ; print,'alf1, alf2, b0 ',t dfpmin,t,1.0e-2,fmin,'newtfunc','grad',/DOUBLE,ITMAX=1000 ;print,newtfunc(t) print,'loop ',iloop,' max ',maxa print,'a0, phi, x10, x20 ',t print,'delx1, delx2, delv, v0 ',t print,'alf1, alf2, b0 ',t ,offset print,'residue ',newtfunc(t) a=a-eval(t); substract the gaussian component print,'max component',max(eval(t)) ;print,a if iloop eq 1 then begin para= ] endif else begin para= ] endelse endfor print,para save,file='parameters',para end
个人分类: 读书|240 次阅读|0 个评论
笔记(七)关于命令行直接运行IDL脚本
qianlivan 2010-3-22 09:29
笔记(七)关于命令行直接运行IDL脚本 假设有一个IDL脚本test.pro,内容为 pro test print,1+1 end 现在想直接在shell里运行而不先启动IDL,怎么办?我的土办法是另写一个文件test,内容为 #!/usr/local/idl test 再变为可执行文件。然后,把test.pro里的pro test和end两行注释掉。这样就可以直接敲test了。IDL自动启动,运行test.pro。 如果想执行完直接退出IDL,那么在test.pro中再加一行 exit 就可以了。
个人分类: 总结|14418 次阅读|0 个评论
Matlab和Excel混合编程
zuozw 2010-3-18 17:16
Matlab具有强大的数据计算和处理、图形显示能力;Excel则具有强大的表格处理同时也有强大的数据统计和显示能力。在科研过程中常会同时使用这两款软件,如果实现Matlab和Excel的链接,可以满足实际要求。实现Matlab和Excel的混合编程主要有以下几种方法: 1、 利用 Excel Link (最常用方法 ) Excel Link 是一个在 Windows 环境下实现 Excel 与 Matlab 进行链接的插件。通过连接 Excel 和 Matlab ,实现 Excel 和 Matlab 的数据共享。使用 Excel Link 时,不脱离 Excel 环境直接在 Excel 中调用 Matlab 函数。 具体可参见Matlab帮助或 Excel Link手册 。 2、 利用Excel生成器(Matlab作COM服务器) COM(通用对象模型)是一组面向对象的技术和工具的集合。利用Matlab提供的COM生成器,把Matlab的算法程序生成组件,这些组件可作为独立的COM对象被Excel的Visual Basic使用。具体可参见Matlab COM Builder或者Matlab Builder for Excel工具。 3、 利用Active X控制(Matlab作COM客户端) ActiveX是 Microsoft对于一系列策略性面向对象程序技术和工具的称呼,其中主要的技术是组件对象模型。主要利用Matlab中的actxserver函数:actxserver('progid');progid为程序的ActiveX部件的标识符,针对不同的程序有不同的progid。如actxserver('Excel.Application'),然后可利用invoke函数进行一系列操作。 4、 文件导入方法 利用xlsread和xlswrite函数读写Excel文件(也可用fopen、fread和fwrite函数),然后进行数据处理操作。另外,还可以通过菜单File-Import data方法。
个人分类: 科研心得|14763 次阅读|2 个评论
笔记(五)
qianlivan 2010-3-10 16:23
笔记(五)模拟中性氢质量函数 在这里附上模拟某个极限流量时观测到的河外星系中性氢的质量函数的代码。 z=0.1; %redshift rmax=zD(z);% maximum distance corresponding to maximum redshift thetastar=8.6e-3;% normalization of the mass function V=200.0; % line width in km/s f=0.7; % factor accounting for the line shape Slim=3.0e-5; % flux limit, in Jy dx=3.906; % length of side of a volume element, in Mpc dy=3.906; dz=3.906; volume=dx*dy*dz; % volume element, in Mpc^3 local=26.0; % local latitude dec1=local+30.0; % range of relevant declination dec2=local-30.0; %a=load('densmap_250_G10.0.dat'); x=a(:,1); % coordinate y=a(:,2); z=a(:,3); b=a(:,4); % % %max(b); % % %maxb=23.5072;% the maximum of the density contrast % % b=b./maxb; % = meshgrid(-250:1:250, -250:1:250, -250:1:250); % % v = x .* exp(-x.^2 - y.^2 - z.^2); % slice(x,y,z,a, ,2, ) n=length(b); MHI= ; NHI=zeros(1,5); M=6:10; M=M+0.5; for i=1:n if mod(i,1000)==0 i end V=sgc2ec(x(i),y(i),z(i)); ra=V(1); dec=V(2); r=sqrt(x(i).^2+y(i).^2+z(i).^2); if decdec1decdec2rrmax % if in the right dec and redshift range ngal=volume*(b(i)+1.0)*thetastar; if ngal~=0 mgal=floor(ngal); xgal=mgal+((ngal-mgal)rand());% if the number is not integer % the decimal part is treated as % probability if xgal0 temp=GenRanNum2(xgal); % generate a sample with the distribution of the mass function for i=1:xgal S=temp(i)./(2.356e5.*r.^2.*V.*f); if SSlim % if can be detected MHI= ; % add to the whole sample Dist= ; j=ceil(log10(temp(i))-6); NHI(j)=NHI(j)+1; end end end end end end save simulation_NHI.txt NHI -ascii %plot(M,NHI,'*'); bar(M,NHI); % histogram title(strcat('redshift:',num2str(z),' Slim:',num2str(Slim))); xlabel('\fontname{times New Toman}\fontsize{16}log(M_{HI}/M_{sun})'); ylabel('\fontname{times New Toman}\fontsize{16}N'); print -depsc2 simulation.eps
个人分类: 总结|224 次阅读|0 个评论
笔记(四)
qianlivan 2010-3-10 15:09
红移距离转换也是常用的一个操作。现把代码放在下面 function y=zD(z) % z-distance relation, distance in units of Mpc h=0.72; DH=3000./h; % in Mpc OmegaM=0.274; OmegaLam=0.726; %fun=strcat('',num2str(OmegaM),'*(1+x)^3+',num2str(OmegaLam),'') DC=DH.*comdis(OmegaM,OmegaLam,z); DM=DC; % for zero curvature y=DM.*(1+z); %================================================= function y=comdis(OmegaM,OmegaLam,z0) function f=E(z) f=1.0./sqrt(OmegaM.*(1+z).^3+OmegaLam); end y=quadl(@E,0,z0); end
个人分类: 总结|2326 次阅读|0 个评论
笔记(三)
qianlivan 2010-3-10 14:38
笔记(三)产生某个分布的随机数的matlab脚本 function y=GenRanNum2(n) %本函数产生n个指定概率分布的随机数,本例中的 %概率密度函数为f(x)=(1-x*x)/(1+x*x)/(pi-2) |x|1 thetastar=8.6e-3; alpha=-1.30; MHIstar=10.0^9.79; min=1.0e6;% 概率密度区间的左边界 max=1.0e10; %概率密度区间的右边界 uper=thetastar.*(min./MHIstar).^alpha.*exp(-min./MHIstar);%概率密度函数的上确界 step=(max-min)./10.0; %rand('state',0);sum(100*clock) stat=zeros(10); mass=1:10; mass=min+mass*step for k=1:n x1= min + (max-min).*rand(1); x2=uper*rand(1); x3=thetastar.*(x1./MHIstar).^alpha.*exp(-x1./MHIstar); %此处为指定的概率密度函数f(x)的位置 while x2x3 x1= min + (max-min).*rand(1); x2=uper*rand(1); x3=thetastar.*(x1./MHIstar).^alpha.*exp(-x1./MHIstar); end y(k)=x1; j=ceil(y(k)./step); stat(j)=stat(j)+1; end plot(log10(mass),log10(stat));
个人分类: 总结|198 次阅读|0 个评论
笔记(二)几个matlab脚本
qianlivan 2010-3-10 13:53
笔记(二)几个matlab脚本 经常需要做一些不同坐标系中坐标的变换,已经折腾了不止一两次了。把脚本放这儿,以备不时之需。 1. 赤道坐标变换为银道坐标 %north pole R.A. 12h 51m 26.282s , Dec. +27° 07′ 42.01″ %zero point R.A. 17h 45m 37.224s , Dec. -28° 56′ 10.23″ %Galactic Coordinate - Equitorial Coordinate %Galactic pole (b=90 deg) RA=12.8573 h=192.859508 deg Dec=+27.128336 deg %zero point (b=0 deg, l=0 deg) RA=17.7603 h=266.405100 deg Dec=-28.936175 deg function V=ec2gc(Ra,Dec) % Theta=(90.0-27.128336)./180.0.*pi; % Phi=(192.859508-270.0)./180.0.*pi; % Theta1=(90.0-(-28.936175))./180.0.*pi; % Phi1=266.405100./180.0.*pi; % xs= ; % M1= ; % M2= ; % RotMz=M2*M1; % xp= ']'; % zt= ']'; % Phip=asin(cross(xp,xs)*zt'); % M3= ; % RotM=RotMz*M3; % Rotation Matrix for coordinate system: RotM= ; ra=Ra./24.0.*2.0.*pi; dec=Dec./180.0.*pi; H = ; Pos= '; xp=Pos(1); yp=Pos(2); zp=Pos(3); if abs(xp)1.e-8 if yp0 b=pi./2.0; end if yp0 || yp==0 b=3.0.*pi./2.0; end else if yp0 if xp0 b=atan(yp./xp); else b=atan(yp./xp)+pi; end else if xp0 b=atan(yp./xp)+2.0.*pi; else b=atan(yp./xp)+pi; end end end l=asin(zp); b=b./2.0./pi.*24.0; l=l./pi.*180.0; V= ; 2. 银道坐标变换为赤道坐标 %north pole R.A. 12h 51m 26.282s , Dec. +27° 07′ 42.01″ %zero point R.A. 17h 45m 37.224s , Dec. -28° 56′ 10.23″ %Galactic Coordinate - Equitorial Coordinate %Galactic pole (b=90 deg) RA=12.8573 h=192.859508 deg Dec=+27.128336 deg %zero point (b=0 deg, l=0 deg) RA=17.7603 h=266.405100 deg Dec=-28.936175 deg function V=gc2ec(b,l) % Theta=(90.0-27.128336)./180.0.*pi; % Phi=(192.859508-270.0)./180.0.*pi; % Theta1=(90.0-(-28.936175))./180.0.*pi; % Phi1=266.405100./180.0.*pi; % xs= ; % M1= ; % M2= ; % RotMz=M2*M1; % xp= ']'; % zt= ']'; % Phip=asin(cross(xp,xs)*zt'); % M3= ; % RotM=RotMz*M3; % Rotation Matrix for coordinate vector: RotM= ; b=b./24.0.*2.0.*pi; l=l./180.0.*pi; H = ; Pos= '; xp=Pos(1); yp=Pos(2); zp=Pos(3); if abs(xp)1.e-8 if yp0 ra=pi./2.0; end if yp0 || yp==0 ra=3.0.*pi./2.0; end else if yp0 if xp0 ra=atan(yp./xp); else ra=atan(yp./xp)+pi; end else if xp0 ra=atan(yp./xp)+2.0.*pi; else ra=atan(yp./xp)+pi; end end end dec=asin(zp); Ra=ra./2.0./pi.*24.0; Dec=dec./pi.*180.0; V= ; 3. 赤道坐标变换为超星系坐标 %north pole R.A. 18h 55m 01s, Dec. +15deg 42' 32" %zero point R.A. 2h 49m 14s, Dec. +59deg 31' 42" %Supergalactic Coordinate - Equitorial Coordinate %Supergalactic pole (SGB=90 deg) RA=18.9169 h=283.7535 deg Dec=+15.7089 deg %zero point (SGB=0 deg, SGL=0 deg) RA=2.8206 h=42.3090 deg Dec=+59.5283 deg function V=ec2sgc(Ra,Dec) % Theta=(90.0-15.7089)./180.0.*pi; % Phi=(283.7535-270.0)./180.0.*pi; % Theta1=(90.0-59.5283)./180.0.*pi; % Phi1=42.3090./180.0.*pi; % xs= ; % M1= ; % M2= ; % RotMz=M2*M1; % xp= ']'; % zt= ']'; % Phip=asin(cross(xp,xs)*zt'); % M3= ; % RotM=RotMz*M3; % Rotation Matrix for coordinate system: RotM= ; ra=Ra./24.0.*2.0.*pi; dec=Dec./180.0.*pi; Pos = ; V= '; 4. 超星系坐标变换为赤道坐标 %north pole R.A. 18h 55m 01s, Dec. +15deg 42' 32" %zero point R.A. 2h 49m 14s, Dec. +59deg 31' 42" %Supergalactic Coordinate - Equitorial Coordinate %Supergalactic pole (SGB=90 deg) RA=18.9169 h=283.7535 deg Dec=+15.7089 deg %zero point (SGB=0 deg, SGL=0 deg) RA=2.8206 h=42.3090 deg Dec=+59.5283 deg function V=sgc2ec(x,y,z) % Theta=(90.0-15.7089)./180.0.*pi; % Phi=(283.7535-270.0)./180.0.*pi; % Theta1=(90.0-59.5283)./180.0.*pi; % Phi1=42.3090./180.0.*pi; % xs= ; % M1= ; % M2= ; % RotMz=M2*M1; % xp= ']'; % zt= ']'; % Phip=asin(cross(xp,xs)*zt'); % M3= ; % RotM=RotMz*M3; % Rotation Matrix for coordinate vector: RotM= ; H= ./sqrt(x.^2+y.^2+z.^2); Pos= '; xp=Pos(1); yp=Pos(2); zp=Pos(3); if abs(xp)1.e-8 if yp0 ra=pi./2.0; end if yp0 ra=3.0.*pi./2.0; end else if yp0 ra=atan(yp./xp)+pi./2.0; else ra=atan(yp./xp)+3.0.*pi./2.0; end end dec=asin(zp); Ra=ra./2.0./pi.*24.0; Dec=dec./pi.*180.0; V= ;
个人分类: 总结|4212 次阅读|0 个评论
[转载]101条伟大的计算机编程名言
JRoy 2010-3-6 21:47
boxi 编译 人们总是害怕改变。电被发明出来的时候他们害怕电,是不是?他们害怕煤,害怕蒸汽机车。无知无所不在,并导致恐惧。但随着时间推移,人们终究会接受最新的科技。 正如比尔盖茨曾经警告过一样,计算机已经真正成为我们的最新科技,几乎遍布我们日常生活的每一方面。所以,我们这个时代的某些最伟大的头脑开始思索起计算机和软件对于人类的重要性来了。以下就是101条有关计算机的伟大名言,并且,既然我们这个网站是一个软件开发网站,我们尤其关注编程方面的。 计算机 1、计算机没什么用。他们只会告诉你答案。 (巴勃罗毕加索,画家) 2、 计算机就跟比基尼一样,省去了人们许多的胡思乱想。 (萨姆尤因,作家) 3、他们拥有计算机,他们也还可能拥有其他的大规模杀伤性武器。 (珍内特雷诺,美国前女司法部长) 4、跟计算机工作酷就酷在这里,它们不会生气,能记住所有东西,还有,它们不会喝光你的啤酒。 (保罗利里,吉他手) 5、如果汽车能赶上计算机的发展周期的话,一辆今天的劳斯莱斯仅值100美元,每加仑要跑100万英里,每年还得爆炸一次,把里面的人杀个精光。 (Robert X. Cringely,技术作家) 计算机智能 6、计算机总是越来越智能的。科学家告诉我们说不久它们就能跟我们对话了。(这里的它们,我指的是计算机。我怀疑科学家永远都不能跟我们对话。) (Dave Barry,幽默作家) 7、我最近注意到,在共同文化中,那种对计算机变得智能化并最终掌控世界的妄想恐惧症几乎彻底消失了。据我所知,这跟MS-DOS的发布基本是同步的。 (Larry DeLuca) 8、计算机会不会思考这个问题就像问潜水艇会不会游泳一样。 (Edsger W. Dijkstra,图灵奖获得者) 9、活了一百年却只能记住30M字节是荒谬的。你知道,这比一张压缩盘还要少。人类境况正在变得日趋退化。 (Marvin Minsky,人工智能研究的奠基人) 信任 10、这座城市的中央计算机告诉你的?R2D2,你不该相信一台陌生的计算机! (C3PO,星球大战中的翻译机器人) 11、不要信赖那些大到不能扔出窗外的计算机 (斯蒂夫沃兹尼亚克,苹果联合创始人) *译者:游戏《文明4》中的科技引言,实际上沃兹尼亚克自己也不记得自己是否确切讲过这样的话。 硬件 12、硬件:计算机系统中可被踢的部分。 (Jeff Pesis) 软件 13、今天大部分的软件都很像上百万块砖堆叠在一起组成的埃及金字塔,缺乏结构完整性,只能靠强力和成千上万的奴隶完成。 (阿伦凯,图灵奖获得者,面向对象创始人) 14、我终于明白向上兼容性是怎么回事了。这是指我们得保留所有原有错误。 (Dennie van Tassel) 操作系统 15、有两样重要产品出自伯克利:LSD和BSD*。我们不相信这是个巧合。 (Jeremy S. Anderson) *译者:LSD是一种药力至强的迷幻剂,BSD- BSD ( Berkeley Software Distribution ,伯克利软件套件)是Unix的衍生系统 16、2038年1月19日,凌晨3点14分07秒 (UNIX中的世界末日*1970年1月1号之后的2^32秒) *译者:word跟world发音类似,UNIX用有符号整形数(WORD)表示时间,所以最多只能计时2^31秒,原文的2^32应为错误。 17、每个操作系统都差不多 我们都一样的烂。 (微软的高级副总裁布莱恩瓦伦蒂尼这样描述操作系统的安全状况,2003) 18、微软出了个新版本,Windows XP,据大家说是有史以来最稳定的Windows,对我而言, 这就好像是在说芦笋是有史以来发音最清脆的蔬菜一样 (Dave Barry) 互联网 19、互联网?那个东西还在吗? (Homer Simpson) 20、网络就像是个母夜叉。我每转到一处都会看见小个的按钮命令我提交*。 (Nytwind) *译者注:Submit:提交,另一层意思是要求屈服 21、想想看吧,已经有一百万只猴子坐在一百万台打字机旁,可Usenet就是不像莎士比亚。 (Blair Houghton) 软件产业 22、计算机软件产业最为惊人的成就,是其持续不断地放弃硬件产业的惊人成果和稳定性。 (Henry Petroski) 23、真正的创新经常来自于那些贴近市场、但无力拥有市场的的小型初创公司。 (Timm Martin) 24、人们常说,伟大的科学学科就像是站在其它巨人肩膀上的巨人。人们也说过,软件产业正如站在其他侏儒脚上的侏儒。 (Alan Cooper,交互设计之父) 25、这无关比特、字节和协议,而关乎利润和损益。 (郭士纳,IBM前CEO) 26、我们是微软。反抗是徒劳的。你会被同化的。 (保险杠贴纸) 软件演示 27、不管演示在彩排的时候有多好,一旦在观众面前展示时,演示的不出错几率为投资总额的观众人数次方的倒数。 (Mark Gibbs) 软件专利 28、专利大多数都是垃圾。浪费时间去阅读这些专利是愚蠢的。只有专利持有人才会这么干,还得强迫自己才会看。 (Linus Torvalds,LINUX创始人) 复杂性 29、控制复杂性是计算机编程的本质。 (Brian Kernigan) 30、复杂性杀死一切。它把程序员的生活给搞砸了,它令产品难以规划、创建和测试,带来了安全挑战,并导致最终用户和管理员沮丧不已。 (Ray Ozzie) 31、进行软件设计有两种方式。一种是让它尽量简单,明显没有不足。另一种是弄得尽量复杂,没有明显缺陷。 (C.A.R. Hoare) 32、好的软件的作用是让复杂的东西看起来简单。 (Grady Booch,UML创始人之一) 易用性 33、不管那些计算机书怎么说,只需记住,你不是傻瓜。真正的傻瓜是那些所谓的技术专家,因为他们设计不出普通消费者赖以生活的易于使用的软硬件。 (Walter Mossberg,科技专栏记者) 34、软件供应商在努力尝试让他们的软件更易于操作 迄今为止,他们最好的办法就是翻出所有的老手册,然后在封面盖上易于操作这几个字。 (比尔盖茨) 35、有个老套的故事说有人希望他的计算机能像他的电话机一样好用。他的愿望实现了,因为我已经不知道该如何使用自己的电话了。 (Bjarne Stroustrup,C++之父) 用户 36、任何一个傻瓜都会用电脑。的确有很多傻瓜在用。 (Ted Nelson) 37、只有两个行业把客户称为用户*。 (Edward Tufte,信息设计大师) *译者注:一个是计算机设计,另一个是毒品交易 ,computer design and drug dealing 程序员 38、程序员在跟宇宙赛跑,他们在努力开发出更大更好的傻瓜程序,而宇宙则努力培养出更大更好的白痴。到目前为止,宇宙领先。 (Rich Cook) 39、你们当中很多人都知道程序员的美德。当然啦,有三种:那就是懒惰、急躁以及傲慢。 (Larry Wall,Perl发明者) 40、程序员的问题是你永远都不知道他在做什么,直到为时已晚。 (Seymour Cray,超级计算机之父) 41、那就是这些自认为痛恨计算机的人的真实面目。他们实际上真正痛恨的是糟糕的程序员。 (拉瑞尼文,科幻作家) 42、很长时间以来我一直困惑不已,为什么一些又贵又先进的东西会一点用都没有。直到我突然想起,计算机不就是一台愚蠢之至却拥有难以置信的做聪明事能力的机器嘛,而程序员不就是聪明绝顶却拥有难以置信的干蠢事的能力的人嘛。一句话,他们简直就是天生绝配。 (比尔布莱森,旅游文学作家) 43、正如研究画笔和颜料无法让人成为绘画大师,计算机科学的教育不会让任何人成为一名编程大师。 (埃里克雷蒙,开源运动领袖) 44、一个程序员是经历以下事情后仍能证明自己是严格的专家的人:他可以历经数不清的捶打,可取材于无关紧要的文档,用上面的争议数据作出模糊假设,并以此计算出测微精度的无数片面理解的答案,并由一个不可靠、脑袋充满质疑、公开宣称要让一个倒霉透顶、没有指望、毫无防备,要求第一时间获得信息的部门狼狈不堪、令人生厌的人使用一台准确度有问题的仪器去实施。 (IEEE网格新闻杂志) 45、运气好的黑客能用几个月的时间 - 生产出一个小规模的开发团体(比如说,7-8人)历尽艰辛一起工作了一年多才能做出来的东西。IBM经常报告说某些程序员的生产力要比其它工人高百倍,甚至更多。 (Peter Seebach,黑客) 46、最好的程序员跟好的程序员相比可不止好那么一点点。无论用那种标准去衡量:概念创造性、速度、设计的独创性或者解决问题的能力,这种好都不是一个数量级的。 (兰德尔 E 斯特劳斯,科技作家) 47、伟大的车工值得给他几倍于普通车工的薪水,但一个伟大的软件代码作家,其价值则要等同于一个普通的软件写手的价格的1万倍。 (比尔盖茨) 编程 48、就算它工作不正常也别担心。如果一切正常,你早该失业了。 (Mosher的软件工程定律) 49、靠代码行数来衡量开发进程就好比用重量来衡量飞机制造的进度。 (比尔盖茨) 50、写代码的社会地位比盗墓的高,比管理的低。 (杰拉尔德温伯格,软件与系统思想家) 51、首先学习计算机科学及理论。接着形成自己编程的风格。然后把这一切都忘掉,尽管改程序就是了。 (George Carrette,杰出软件工程师,开源推广者) 52、先解决问题再写代码。 (John Johnson) 53、乐观主义是编程行业的职业病;用户反馈则是治疗方法。 (Kent Beck) 54、迭代者为人,递归者为神。 (L. Peter Deutsch) 55、布尔值最好的一点是,就算你错了,也顶多错了一位而已。 (无名氏) 56、数组的下标是从0开始好还是从1开始好呢?我的0.5的折衷方案,以我之见,没有经过适当考虑就被否决掉了。 (Stan Kelly-Bootle) 编程语言 57、只有两种编程语言:一种是天天挨骂的,另一种是没人用的。 (Bjarne Stroustrup,C++之父) 58、PHP是不合格的业余爱好者创建的,他们犯了个小恶;Perl是娴熟而堕落的专家创建的,他们犯了阴险狡诈的大恶。 (Jon Ribbens) 59、COBOL的使用摧残大脑;其教育应被视为刑事犯罪。 (E.W. Dijkstra) 60、把良好的编程风格教给那些之前曾经接触过BASIC的学生几乎是不可能的。作为可能的程序员,他们已精神残废,无重塑的可能了。 (E. W. Dijkstra) 61、我想微软之所以把它叫做.Net,是因为这样它就不会在Unix的目录里显示出来了。 (Oktal) 62、没有一种编程语言能阻止程序员写出糟糕的程序来,不管这种语言结构有多良好。 (Larry Flon) 63、计算机语言设计犹如在公园里漫步。我是说侏罗纪公园。 (Larry Wall) C/C++ 64、搞了50年的编程语言的研究,最后就出了个C++? (Richard A. OKeefe) 65、写C或者C++就像是在用一把卸掉所有安全防护装置的链锯。 (Bob Gray) 66、在C++里你想搬起石头砸自己的脚更为困难了,不过一旦你真的做了,整条腿都要报销。 (Bjarne Stroustrup) 67、C++ : 友人可造访你的私有成员之地也。 (Gavin Russell Baker) 译者:Friends:C++的友元,是一种定义在类外部的普通函数,但它需要在类体内进行说明,为了与该类的成员函数加以区别,在说明时前面加以关键字friend。友元不是成员函数,但是它可以访问类中的私有成员。友元的作用在于提高程序的运行效率,但是,它破坏了类的封装性和隐藏性,使得非成员函数可以访问类的私有成员。 68、罗马帝国灭亡的其中一个主要原因是他们没有0 - 这样他们就没法给自己的C程序指明成功退出的路径了。 (Robert Firth) Java 69、Java从许多方面来说就是C++。 (Michael Feldman) 70、说Java好就好在运行于所有操作系统之上,就好比说肛交好就好在无论男女都行。 (Alanna) 71、好吧,Java也许是编程语言的好榜样。但Java应用则是应用程序的坏榜样。 (pixadel) 72、要是Java真的有垃圾回收的话,大部分程序在执行之前就会把自己干掉了。 (Robert Sewell) 开源 73、软件就像性事:免费/自由更好。 (Linus Torvalds) 74、唯一对免费软件感到害怕的人,是自己的产品还要不值钱的人。 (David Emery) 代码 75、好代码本身就是最好的文档。 (Steve McConnell,《代码大全》的作者) 76、你自己的代码如果超过6个月不看,再看的时候也一样像是别人写的。 (伊格尔森定律) 77、前面90%的代码要占用开发时间的前90%。剩下的10%的代码要占用开发时间的另一90%。 (Tom Cargill,C++领域中公认的专家) 软件开发 78、好的程序员绞尽脑汁,务求考虑各种场景,幸得好的指南拯救我们,不必面面俱到。 (Francis Glassborow,C和C++领军人物之一) 79、在软件里面,我们鲜有有意义的需求。就算有,衡量成功的唯一尺度,也取决于我们的解决方案是不是搞定了客户的想法 - 那飘忽不定的、对问题是什么的想法。 (Jeff Atwood,Coding Horror Developer Blog的创始人) 80、想想我们计算机程序的糟糕现状吧,很显然软件开发仍是黑箱艺术,还不能称之为工程学科。 (Bill Clinton,前美国总统) 81、没有伟大的团队就没有伟大的软件,可大部分的软件团队举止就像是支离破碎的家庭。 (吉姆麦卡锡,微软VC++总监) 调试 82、一旦我们开始编程,就会惊讶地发现让程序正常没想象中那么简单。调试不可避免。那一刻我认记忆犹新,当时我就意识到,从今往后我生活的大部分时间都要花在寻找自己程序的错误上面了。 (莫里斯威尔克斯调试探索, 1949) 83、调试难度本来就是写代码的两倍。因此,如果你写代码的时候聪明用尽,根据定义,你就没有能耐去调试它了。 (Brian Kernighan,《C 程序设计语言》的作者之一) 84、如果调试是除虫的过程,那么编程就一定是把臭虫放进来的过程。 (Edsger W. Dijkstra) 质量 85、 我才不管它 能 不 能 在你的机器上运行呢!我们又没装到你的机器上 ! (Vidiu Platon,罗马尼亚的微软最佳学生合作伙伴MSP) 86、编程就像性一样:一时犯错,终生维护。 (Michael Sinz) 87、有两种写出无错程序的办法;只有第三种有用。 (Alan J. Perlis) 88、软件质量与指针算法不可兼得。 (Bertrand Meyer) 89、如果麦当劳像软件公司那样运作的话,每一百个巨无霸就会有一个令你食物中毒,而他们的回应是,真对不起,这是一张额外附送两个的赠券。 (Mark Minasi) 90、永远要这样写代码,好像最终维护你代码的人是个狂暴的、知道你住在哪里的精神病患者。 (Martin Golding) 91、是人都会犯错,不过要想把事情彻底搞砸还得请电脑出马。 (Paul Ehrlich) 92、计算机比人类历史上的任何发明都更快速地导致你犯更多的错误可能除了手枪和龙舌兰酒是例外。 (Mitch Radcliffe) 预测 93、能发明的东西都发明出来了。 (查尔斯杜埃尔, 美国专利局局长,1899年) 94、我认为全球市场约需5台计算机。 (托马斯沃森,IBM董事长, 约1948年) 95、看上去我们已经到达了利用计算机技术可能获得的极限了,尽管下这样的结论得小心,因为不出五年这听起来就会相当愚蠢。 (约翰冯诺伊曼,约1949年) 96、但这又有什么好处呢? (IBM先进计算机系统部的工程师对微芯片的评论, 1968年) 97、没理由人人都放台电脑到家里面去。 (肯奥尔森,数据设备公司(DEC)总裁,1977年) 98、640K对每一个人来说都已足够。 (比尔 盖茨,1981年) 99、Windows NT的RAM寻址空间可达2G,这比任何应用程序所需都要多。 (微软, 谈及Windows NT的开发时所言, 1992年) 100、我们永远也无法真正成为无纸化社会,直到掌上电脑一族发布擦我1.0*(WipeMe 1.0)为止。 (安迪皮尔逊,商界领袖) *译者注:意思是说难道你大便不用纸吗? 101、长此以往,除了按键的手指外,人类的肢体将全部退化。 (弗兰克劳埃德赖特,建筑师)
个人分类: 知识杂谈|2154 次阅读|0 个评论
笔记(一)一些IDL语句
qianlivan 2010-3-3 15:56
笔记(一)一些IDL语句 时常会用IDL写点小程序,有些语句常用,但无奈自己记忆力太差,每次都上网查一次。鉴于有些语句我常用而别人常用的语句我不一定常用,为了节省每次上网查找的时间,特在这里做一些记录。 1. 替换数组中的NaN 数组中的NaN时常会造成计算中的麻烦,所以一般把它们替换为一些特别的数,比如-999.9。 IDLbad=where(finite(data) eq 0,count) IDLif(count gt 0) then data(bad)=-999.9 2.获得数组中最大元素的标号 IDLmaxr=max(r) IDLindex=where(r eq maxr) 3.处理.sav文件 IDLrestore,'data.sav'
个人分类: 总结|10209 次阅读|0 个评论
Java学习体会2
putin24 2010-1-15 14:06
一直还不知道个所以然的我,慢慢的开始不再厌恶这些代码,可能是因为自己反抗抵触的时间过了吧,原来学习走入了误区,总认为喜欢先进的,软件也更新到最新的,但是后来想想还是很奇怪,现在才从基础的一点一点小问题去解决,反而进步很快,渐渐地可能会忘记一些,但是比起以前的那种空对空要显得实在。 写 JSP 的时候很多都已经是 CSS 来控制页面的时候,我还是用 table 来处理。 1.Table 一些札记 table width=90% border=0 cellspacing=0 cellpadding=0 bordercolor=black bordercolorlight=black bordercolordark=white //table 的属性 tr align=center // 行 td height=25 colspan=2 bgcolor=005ece align=center STYLE=font-size:11pt; background=%=request.getContextPath()%/image/tablebanner.gif // 列 /td/tr a href=%=request.getContextPath()%/person/person_myself_look.do /a img src= 图片地址 width=300 height=400 / // 图片的引用 input type=image src= onclick=javascript:return(confirm(' 添加成功! ')) // 使用图片按钮 a href=%=request.getContextPath()%%=pagepath%?page=%=currentpage-1% 上一页 /a // 使用翻页 input type=text name=type value='%=node.getType()%' // 修改 %if( i%2==0) {%bgcolor=#f2F595% }% %if( i%2!=0) {%bgcolor=#f2b695% }% // 使用简单的 js 语言控制表格各行不一样颜色 . 2. 测试类札记 public static void main(String[] args){ //java 中测试实例 TreeJDBC tree=new TreeJDBC(); tree.deleteRecord(1); Collection col=tree.getAllnodesfromdatabase(); Iterator it=col.iterator(); while(it.hasNext()){ Treenode node=(Treenode)it.next(); System.out.println(node.getId()+, +node.getParentid()+, +node.getName()); } } node.setId(rs.getString(ID)); //set 方法 String manager =(String)request.getParameter(manager); //get 页面传输过来的参数 manager 3. 样式札记 head style type=text/css .button { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #3573CA; } input{ height:20px; border-color:blue; } select{ BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #FFFFFF 1px solid; FONT-SIZE: 15px; BORDER-LEFT: #FFFFFF 1px solid; COLOR:#003366; BORDER-BOTTOM: #000000 1px solid; BACKGROUND-COLOR: #f4f4f4; } /style/head // 页面直接调用样式,流行的是写在 CSS 文件中;在 head 中添加, link rel=stylesheet type=text/css href=%=contentPath%/css/input.css / input name=project_name class=inputstyle type=text // 调用样式类名称 inputstyle 希望新年里自己不断努力。 补充一点struts检验时间格式抛出异常笔记: String timeerrors = Change.checkdate(portfolio_time); if (!(timeerrors.equals(success))) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError( timeerrors)); saveErrors(request, errors); return mapping.findForward(false); } if (!mark) { saveErrors(request, errors); return mapping.findForward(false); }
个人分类: 生活点滴|3123 次阅读|0 个评论
Java学习总结
putin24 2009-12-31 01:42
实时总结,可能会有所收获吧,讲下 Servlet 与 struts1.x 的区别吧,最近在开发一个系统,系统由于前期规划不好,导致既有 Servlet 与 struts1.x 在作用,显得很不协调,但也很快的让我看出了其中一些区别。 1.Servlet 在 web.xml 里定义一个 servlet 的 name 和 mapping 的路径 /servlet/DisplayTemplate servlet description 显示模板的 servlet/description display-name 显示模板的 servlet/display-name servlet-nameDisplayTemplate/servlet-name servlet-classorg.example.servlet.DisplayTemplate/servlet-class /servlet servlet-mapping servlet-nameDisplayTemplate/servlet-name url-pattern/servlet/DisplayTemplate/url-pattern /servlet-mapping 而相比 struts 定义的方式却显得简化了,首先在 struts-config.xml 中定义一个 bean ,对应一个 form 。 form-beans form-bean name=xxxform type=com.office.actionform.xxxxxForm / /form-beans 在 mapping 中定义映射,指向的路径和 forward 的页面。 action-mappings action name=treeform parameter=xxx path=/project/xxx scope=request type=com.office.action.TreenodeAction forward name=add path=/project/addsuccessfully.jsp/ forward name=success path=/project/addsuccessfully.jsp / /action /action-mappings 其实从这点上看还是有很多的相似之处,但是 struts1.x 最大的好处是把这些零散的东西整理成一堆组织性更强的文件。 2. 稍微大一点的项目用 servlet 要写很多的 servlet.class 文件和很多的 doPost 和 doGet ,而用 struts 1.x 好在可以把相似的这些 servlet 写到一个 Action 里,通过 struts-config.xml 不同参数的选择,调用不同的方法来实现 jsp 与 java/DB 的通信,确实减少了很多文件的冗余; 3. struts 1.x 能在 jsp 页面大量使用比较简洁的 Struts 标签,减少了很多用 JavaScript 写的代码,但在页面中需要引入定义好的标签。 %@ taglib uri=struts-html prefix=html % %@ taglib uri=struts-bean prefix=bean% %@ taglib uri=struts-logic prefix=logic% 注释: Servlet 是一个标准服务器端程序,执行商务逻辑,处理 HTTP 请求 =Server+let e.g. MIDlet=MIDP+let ; Applet=Application+let Javax.servlet.Servlet Servlet 的生命周期对应的三个方法: init() 初始化方法, service (), destroy() JS 部分代码 script function ok(){ var nodeid='%=nodeid%'; document.forms .action=document.forms .action+?nodeid=+nodeid; document.forms .submit(); } /script action=%=path%/Addnode tdselect name=task_resource % List grouplist = (List) request.getAttribute(grouplist); for (int i = 0; i grouplist.size(); i++) { ResourceForm tt = (ResourceForm) grouplist.get(i); % option value=%=tt.getGroup_id()%%=tt.getGroup_id()+tt.getGroup_name()%/option % } % /select /td trtdinput type=button onclick=javascript:ok(); name= 确定 value= 确定 //td/tr Struts 标签 html:form action=/project/add_node.do?addtype=link html:options collection=grouplist property=value labelProperty=label //html:select /td html:submit value= 添加 styleClass=button/html:select property=task_resource
个人分类: 学术笔记|2381 次阅读|1 个评论
【转载】语录:101条伟大的计算机编程名言
freton 2009-9-27 17:42
语录:101条伟大的计算机编程名言 HACKER 2009-05-23 18:50 阅读 17 评论 1 字号: 大 大 中 中 小 小 人们总是害怕改变。电被发明出来的时候他们害怕电,是不是?他们害怕煤,害怕蒸汽机车。无知无所不在,并导致恐惧。但随着时间推移,人们终究会接受最新的科技。 正如比尔盖茨曾经警告过一样,计算机已经真正成为我们的最新科技,几乎遍布我们日常生活的每一方面。所以,我们这个时代的某些最伟大的头脑开始思索起计算机和软件对于人类的重要性来了。以下就是101条有关计算机的伟大名言,并且,既然我们这个网站是一个软件开发网站,我们尤其关注编程方面的。 计算机 1、计算机没什么用。他们只会告诉你答案。 (巴勃罗毕加索,画家) 2、计算机就跟比基尼一样,省去了人们许多的胡思乱想。 (萨姆尤因,作家) 3、他们拥有计算机,他们也还可能拥有其他的大规模杀伤性武器。 (珍内特雷诺,美国前女司法部长) 4、跟计算机工作酷就酷在这里,它们不会生气,能记住所有东西,还有,它们不会喝光你的啤酒。 (保罗利里,吉他手) 5、如果汽车能赶上计算机的发展周期的话,一辆今天的劳斯莱斯仅值100美元,每加仑要跑100万英里,每年还得爆炸一次,把里面的人杀个精光。 (RobertX.Cringely,技术作家) 计算机智能 6、计算机总是越来越智能的。科学家告诉我们说不久它们就能跟我们对话了。(这里的它们,我指的是计算机。我怀疑科学家永远都不能跟我们对话。) (DaveBarry,幽默作家) 7、我最近注意到,在共同文化中,那种对计算机变得智能化并最终掌控世界的妄想恐惧症几乎彻底消失了。据我所知,这跟MS-DOS的发布基本是同步的。 (LarryDeLuca) 8、计算机会不会思考这个问题就像问潜水艇会不会游泳一样。 (EdsgerW.Dijkstra,图灵奖获得者) 9、活了一百年却只能记住30M字节是荒谬的。你知道,这比一张压缩盘还要少。人类境况正在变得日趋退化。 (MarvinMinsky,人工智能研究的奠基人) 信任 10、这座城市的中央计算机告诉你的?R2D2,你不该相信一台陌生的计算机! (C3PO,星球大战中的翻译机器人) 11、永远不要相信一台不能扔掉一扇窗户*的计算机 (斯蒂夫沃兹尼亚克,苹果联合创始人) *译者:暗指微软的wINDOWS操作系统 硬件 12、硬件:计算机系统中可被踢的部分。 (JeffPesis) 软件 13、今天大部分的软件都很像上百万块砖堆叠在一起组成的埃及金字塔,缺乏结构完整性,只能靠强力和成千上万的奴隶完成。 (阿伦凯,图灵奖获得者,面向对象创始人) 14、我终于明白向上兼容性是怎么回事了。这是指我们得保留所有原有错误。 (DennievanTassel) 操作系统 15、有两样重要产品出自伯克利:LSD和BSD*。我们不相信这是个巧合。 (JeremyS.Anderson) *译者:LSD是一种药力至强的迷幻剂,BSD-BSD(BerkeleySoftwareDistribution,伯克利软件套件)是Unix的衍生系统 16、2038年1月19日,凌晨3点14分07秒 (UNIX中的世界末日*1970年1月1号之后的2^32秒) *译者:word跟world同音,UNIX用4个字节(WORD)表示时间,所以最多只能计时2^32秒 17、每个操作系统都差不多我们都一样的烂。 (微软的高级副总裁布莱恩瓦伦蒂尼这样描述操作系统的安全状况,2003) 18、微软有出了个新版本,WindowsXP,据大家说是有史以来最稳定的Windows,对我而言,这就好像是在说芦笋是有史以来发音最清脆的蔬菜一样 (DaveBarry) 互联网 19、互联网?那个东西还在吗? (HomerSimpson) 20、网络就像是个母夜叉。我每转到一处都会看见小个的按钮命令我提交*。 (Nytwind) *译者注:Submit:提交,另一层意思是要求屈服 21、想想看吧,已经有一百万只猴子坐在一百万台打字机旁,可Usenet就是比不上莎士比亚。 (BlairHoughton) 软件产业 22、计算机软件产业最为惊人的成就,是其持续不断地放弃硬件产业的惊人成果和稳定性。 (HenryPetroski) 23、真正的创新经常来自于那些贴近市场、但无力拥有市场的的小型初创公司。 (TimmMartin) 24、人们常说,伟大的科学学科就像是站在其它巨人肩膀上的巨人。人们也说过,软件产业正如站在其他侏儒脚上的侏儒。 (AlanCooper,交互设计之父) 25、这无关比特、字节和协议,而关乎利润和损益。 (郭士纳,IBM前CEO) 26、我们是微软。反抗是徒劳的。你会被同化的。 (保险杠贴纸) 软件演示 27、不管演示在彩排的时候有多好,一旦在观众面前展示时,演示不出错的几率与观众人数成反比,与投入的金钱总额成正比。 (MarkGibbs) 软件专利 28、专利大多数都是垃圾。浪费时间去阅读这些专利是愚蠢的。只有专利持有人才会这么干,还得强迫自己才会看。 (LinusTorvalds,LINUX创始人) 复杂性 29、控制复杂性是计算机编程的本质。 (BrianKernigan) 30、复杂性杀死一切。它把程序员的生活给搞砸了,它令产品难以规划、创建和测试,带来了安全挑战,并导致最终用户和管理员沮丧不已。 (RayOzzie) 31、进行软件设计有两种方式。一种是让它尽量简单,让人看不出明显的不足。另一种是弄得尽量复杂,让人看不出明显的缺陷。 (C.A.R.Hoare) 32、好的软件的作用是让复杂的东西看起来简单。 (GradyBooch,UML创始人之一) 易用性 33、不管那些计算机书籍如何宣称,只需记住,你并非傀儡。真正的傀儡是那些无法设计出易于使用的硬件和软件的那些人,尽管他们是技术专家,因为这是普通消费者赖以生活的东西。 (WalterMossberg,科技专栏记者) 34、软件供应商在努力尝试让他们的软件更易于操作迄今为止,他们最好的办法就是翻出所有的老手册,然后在封面盖上易于操作这几个字。 (比尔盖茨) 35、有个老套的故事说有人希望他的计算机能像他的电话机一样好用。他的愿望实现了,因为我已经不知道该如何使用自己的电话了。 (BjarneStroustrup,C++之父) 用户 36、任何一个傻瓜都会用电脑。很多都会。 (TedNelson) 37、只有两个行业把客户称为用户*。 (EdwardTufte,信息设计大师) *译者注:一个是计算机设计,另一个是毒品交易,computerdesignanddrugdealing 程序员 38、程序员在跟宇宙赛跑,他们在努力开发出更大更好的傻瓜程序,而宇宙则努力培养出更大更好的白痴。到目前为止,宇宙领先。 (RichCook) 39、你们当中很多人都知道程序员的美德。当然啦,有三种:那就是懒惰、急躁以及傲慢。 (LarryWall,Perl发明者) 40、程序员的问题是你无法预料他在做什么,直到为时已晚。 (SeymourCray,超级计算机之父) 41、那就是这些自认为痛恨计算机的人的真实面目。他们实际上真正痛恨的是糟糕的程序员。 (拉瑞尼文,科幻作家) 42、很长时间以来我一直困惑不已,为什么一些又贵又先进的东西会一点用都没有。直到我突然想起,计算机不就是一台愚蠢之至却拥有难以置信的做聪明事能力的机器嘛,而程序员不就是聪明绝顶却拥有难以置信的干蠢事的能力的人嘛。一句话,他们简直就是天生绝配。 (比尔布莱森,旅游文学作家) 43、不像学学涂涂画画也能让某人成为专家级画家,计算机科学教育不会让任何人成为一名编程大师。 (埃里克雷蒙,开源运动领袖) 44、一个程序员是经历以下事情后仍能证明自己是严格的专家的人:他可以历经数不清的捶打,可取材于无关紧要的文档,用上面的争议数据作出模糊假设,并以此计算出测微精度的无数片面理解的答案,并由一个不可靠、脑袋充满质疑、公开宣称要让一个倒霉透顶、没有指望、毫无防备,要求第一时间获得信息的部门狼狈不堪、令人生厌的人使用一台准确度有问题的仪器去实施。 (IEEE网格新闻杂志) 45、运气好的黑客能用几个月的时间-生产出一个小规模的开发团体(比如说,7-8人)历尽艰辛一起工作了一年多才能做出来的东西。IBM经常报告说某些程序员的生产力要比其它工人高百倍,甚至更多。 (PeterSeebach,黑客) 46、最好的程序员跟好的程序员相比可不止好那么一点点。这种好不是一个数量级的,取决于标准怎么定:概念创造性、速度、设计的独创性或者解决问题的能力。 (兰德尔E斯特劳斯,科技作家) 47、伟大的车工值得给他几倍于普通车工的薪水,但一个伟大的软件代码作家,其价值则要等同于一个普通的软件写手的价格的1万倍。 (比尔盖茨) 编程 48、就算它工作不正常也别担心。如果一切正常,你早该失业了。 (Mosher的软件工程定律) 49、靠代码行数来衡量开发进程就好比用重量来衡量飞机制造的进度。 (比尔盖茨) 50、写代码的社会地位比盗墓的高,比管理的低。 (杰拉尔德温伯格,软件与系统思想家) 51、首先学习计算机科学及理论。接着形成自己编程的风格。然后把这一切都忘掉,尽管改程序就是了。 (GeorgeCarrette,杰出软件工程师,开源推广者) 52、先解决问题再写代码。 (JohnJohnson) 53、乐观主义是编程行业的职业病;用户反馈则是治疗方法。 (KentBeck) 54、迭代者为人,递归者为神。 (L.PeterDeutsch) 55、布尔值最好的一点是,就算你错了,也顶多错了一位而已。 (无名氏) 56、数组的下标是从0开始好还是从1开始好呢?我的0.5的折衷方案,以我之见,没有经过适当考虑就被否决掉了。 (StanKelly-Bootle) 编程语言 57、只有两种编程语言:一种是天天挨骂的,另一种是没人用的。 (BjarneStroustrup,C++之父) 58、PHP是不合格的业余爱好者创建的,他们犯做了个小恶;Perl是娴熟而堕落的专家创建的,他们犯了阴险狡诈的大恶。 (JonRibbens) 59、COBOL的使用摧残大脑;其教育应被视为刑事犯罪。 (E.W.Dijkstra) 60、把良好的编程风格教给那些之前曾经接触过BASIC的学生几乎是不可能的。作为可能的程序员,他们已精神残废,无重塑的可能了。 (E.W.Dijkstra) 61、我想微软之所以把它叫做.Net,是因为这样它就不会在Unix的目录里显示出来了。 (Oktal) 62、Thereisnoprogramminglanguagenomatterhowstructuredthatwillpreventprogrammersfrommakingbadprograms. (LarryFlon) 63、计算机语言设计犹如在公园里漫步。我是说侏罗纪公园。 (LarryWall) C/C++ 64、搞了50年的编程语言的研究,我们难道就以C++告终啦? (RichardA.OKeefe) 65、写C或者C++就像是在用一把卸掉所有安全防护装置的链锯。 (BobGray) 66、在C++里你想搬起石头砸自己的脚更为困难了,不过一旦你真的做了,整条腿都要报销。 (BjarneStroustrup) 67、C++:友人可造访你的私有成员之地也。 (GavinRussellBaker) 译者:Friends:C++的友元,是一种定义在类外部的普通函数,但它需要在类体内进行说明,为了与该类的成员函数加以区别,在说明时前面加以关键字friend。友元不是成员函数,但是它可以访问类中的私有成员。友元的作用在于提高程序的运行效率,但是,它破坏了类的封装性和隐藏性,使得非成员函数可以访问类的私有成员。 68、罗马帝国灭亡的其中一个主要原因是他们没有0-这样他们就没法给自己的C程序指明成功退出的路径了。 (RobertFirth) Java 69、Java从许多方面来说就是C++。 (MichaelFeldman) 70、说Java好就好在运行于多个操作系统之上,就好像说肛交好就好在不管男女都行。 (Alanna) 71、好吧,Java也许是编程语言的好榜样。但Java应用则是应用程序的坏榜样。 (pixadel) 72、要是Java真的有垃圾回收的话,大部分程序在执行的时候就会把自己干掉了。 (RobertSewell) 开源 73、软件就像性事:免费/自由更好。 (LinusTorvalds) 74、唯一对免费软件感到害怕的人,是自己的产品还要不值钱的人。 (DavidEmery) 代码 75、好代码本身就是最好的文档。 (SteveMcConnell) 76、你自己的代码如果超过6个月不看,再看的时候也一样像是别人写的。 (伊格尔森定律) 77、前面90%的代码要占用开发时间的前90%。剩下的10%的代码要占用开发时间的另一90%。 (TomCargill) 软件开发 78、好的程序员会用脑,但是好的向导救我们于样样都要想到。 (FrancisGlassborow) 79、在软件里面,我们鲜有有意义的需求。就算有,衡量成功的唯一尺度也取决于我们的解决方案是否解决了客户对问题是什么的观念的转变。 (JeffAtwood) 80、想想我们计算机程序的糟糕现状吧,很显然软件开发仍是黑箱艺术,还不能称之为工程学科。 (BillClinton,前美国总统) 81、没有伟大的团队就没有伟大的软件,可大部分的软件团队举止就像是支离破碎的家庭。 (吉姆麦卡锡,微软VC++总监) 调试 82、一旦我们开始编程,就会惊讶地发现让程序正常没想象中那么简单。调试不可避免。那一刻我认记忆犹新,当时我就意识到,从今往后我生活的大部分时间都要花在寻找自己程序的错误上面了。 (莫里斯威尔克斯调试探索,1949) 83、调试难度本来就是写代码的两倍。因此,如果你写代码的时候聪明用尽,根据定义,你就没有能耐去调试它了。 (BrianKernighan) 84、如果调试是除虫的过程,那么编程就一定是把臭虫放进来的过程。 (EdsgerW.Dijkstra) 质量 85、我才不管它能不能在你的机器上运行呢!我们又没装到你的机器上! (VidiuPlaton,罗马尼亚的微软最佳学生合作伙伴MSP) 86、编程就像性一样:一时犯错,终生维护。 (MichaelSinz) 87、有两种写出无错程序的办法;只有第三种有用。 (AlanJ.Perlis) 88、软件质量与指针算法不可兼得。 (BertrandMeyer) 89、如果麦当劳像软件公司那样运作的话,每一百个巨无霸就会有一个令你食物中毒,而他们的回应是,真对不起,这是一张额外附送两个的赠券。 (MarkMinasi) 90、永远要这样写代码,好像最终维护你代码的人是个狂暴的、知道你住在哪里的精神病患者。 (MartinGolding) 91、是人都会犯错,不过要想把事情彻底搞砸还得请电脑出马。 (PaulEhrlich) 92、计算机比人类历史上的任何发明都更快速地导致你犯更多的错误可能除了手枪和龙舌兰酒是例外。 (MitchRadcliffe) 预测 93、能发明的东西都发明出来了。 (查尔斯杜埃尔,美国专利局局长,1899年) 94、我认为全球市场约需5台计算机。 (托马斯沃森,IBM董事长,约1948年) 95、看上去我们已经到达了利用计算机技术可能获得的极限了,尽管下这样的结论得小心,因为不出五年这听起来就会相当愚蠢。 (约翰冯诺伊曼,约1949年) 96、但这又有什么好处呢? (IBM先进计算机系统部的工程师对微芯片的评论,1968年) 97、我们没有理由让每一个人在家都拥有一台电脑。 (肯奥尔森,数据设备公司(DEC)总裁,1977年) 98、640K对每一个人来说都已足够。 (比尔盖茨,1981年) 99、WindowsNT的RAM寻址空间可达2G,这比任何应用程序所需都要多。 (微软,谈及WindowsNT的开发时所言,1992年) 100、我们永远也无法真正成为无纸化社会,直到掌上电脑一族发布擦我1.0*(WipeMe1.0)为止。 (安迪皮尔逊,商界领袖) *译者注:意思是说难道你大便不用纸吗? 101、长此以往,除了按键的手指外,人类的肢体将全部退化。 (弗兰克劳埃德赖特,建筑师) 附:英文版 2009 - 05 - 24 101 Great Computer Programming Quotes 关键字: 精彩转载 People always fear change. People feared electricity when it was invented, didnt they? People feared coal, they feared gas-powered engines. There will always be ignorance, and ignorance leads to fear. But with time, people will come to accept their silicon masters. As Bill Gates once warned, computers have indeed become our silicon masters, pervading nearly every aspect of our modern lives. As a result, some of the greatest minds of our time have pondered the significance of computers and software on the human condition. Following are 101 great quotes about computers, with an emphasis on programming, since after all this is a software development site. Computers Computers are useless. They can only give you answers. (Pablo Picasso) Computers are like bikinis. They save people a lot of guesswork. (Sam Ewing) They have computers, and they may have other weapons of mass destruction. (Janet Reno) Thats whats cool about working with computers. They dont argue, they remember everything, and they dont drink all your beer. (Paul Leary) If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year, killing everyone inside. (Robert X. Cringely) Computer Intelligence Computers are getting smarter all the time. Scientists tell us that soon they will be able to talk to us. (And by they, I mean computers. I doubt scientists will ever be able to talk to us.) (Dave Barry) Ive noticed lately that the paranoid fear of computers becoming intelligent and taking over the world has almost entirely disappeared from the common culture. Near as I can tell, this coincides with the release of MS-DOS. (Larry DeLuca) The question of whether computers can think is like the question of whether submarines can swim. (Edsger W. Dijkstra) Its ridiculous to live 100 years and only be able to remember 30 million bytes. You know, less than a compact disc. The human condition is really becoming more obsolete every minute. (Marvin Minsky) Trust The citys central computer told you? R2D2, you know better than to trust a strange computer! (C3PO) Never trust a computer you cant throw out a window. (Steve Wozniak) Hardware Hardware: The parts of a computer system that can be kicked. (Jeff Pesis) Software Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves. (Alan Kay) Ive finally learned what upward compatible means. It means we get to keep all our old mistakes. (Dennie van Tassel) Operating Systems There are two major products that come out of Berkeley: LSD and UNIX. We dont believe this to be a coincidence. (Jeremy S. Anderson) 19 Jan 2038 at 3:14:07 AM (End of the word according to Unix2^32 seconds after January 1, 1970) Every operating system out there is about equal We all suck. (Microsoft senior vice president Brian Valentine describing the state of the art in OS security, 2003) Microsoft has a new version out, Windows XP, which according to everybody is the most reliable Windows ever. To me, this is like saying that asparagus is the most articulate vegetable ever. (Dave Barry) Internet The Internet? Is that thing still around? (Homer Simpson) The Web is like a dominatrix. Everywhere I turn, I see little buttons ordering me to Submit. (Nytwind) Come to think of it, there are already a million monkeys on a million typewriters, and Usenet is nothing like Shakespeare. (Blair Houghton) Software Industry The most amazing achievement of the computer software industry is its continuing cancellation of the steady and staggering gains made by the computer hardware industry. (Henry Petroski) True innovation often comes from the small startup who is lean enough to launch a market but lacks the heft to own it. (Timm Martin) It has been said that the great scientific disciplines are examples of giants standing on the shoulders of other giants. It has also been said that the software industry is an example of midgets standing on the toes of other midgets. (Alan Cooper) It is not about bits, bytes and protocols, but profits, losses and margins. (Lou Gerstner) We are Microsoft. Resistance Is Futile. You Will Be Assimilated. (Bumper sticker) Software Demos No matter how slick the demo is in rehearsal, when you do it in front of a live audience, the probability of a flawless presentation is inversely proportional to the number of people watching, raised to the power of the amount of money involved. (Mark Gibbs) Software Patents The bulk of all patents are crap. Spending time reading them is stupid. Its up to the patent owner to do so, and to enforce them. (Linus Torvalds) Complexity Controlling complexity is the essence of computer programming. (Brian Kernigan) Complexity kills. It sucks the life out of developers, it makes products difficult to plan, build and test, it introduces security challenges, and it causes end-user and administrator frustration. (Ray Ozzie) There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies. (C.A.R. Hoare) The function of good software is to make the complex appear to be simple. (Grady Booch) Ease of Use Just remember: youre not a dummy, no matter what those computer books claim. The real dummies are the people whothough technically expertcouldnt design hardware and software thats usable by normal consumers if their lives depended upon it. (Walter Mossberg) Software suppliers are trying to make their software packages more user-friendly Their best approach so far has been to take all the old brochures and stamp the words user-friendly on the cover. (Bill Gates) Theres an old story about the person who wished his computer were as easy to use as his telephone. That wish has come true, since I no longer know how to use my telephone. (Bjarne Stroustrup) Users Any fool can use a computer. Many do. (Ted Nelson) There are only two industries that refer to their customers as users. (Edward Tufte) Programmers Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. (Rich Cook) Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris. (Larry Wall) The trouble with programmers is that you can never tell what a programmer is doing until its too late. (Seymour Cray) Thats the thing about people who think they hate computers. What they really hate is lousy programmers. (Larry Niven) For a long time it puzzled me how something so expensive, so leading edge, could be so useless. And then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match. (Bill Bryson) Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter. (Eric Raymond) A programmer is a person who passes as an exacting expert on the basis of being able to turn out, after innumerable punching, an infinite series of incomprehensive answers calculated with micrometric precisions from vague assumptions based on debatable figures taken from inconclusive documents and carried out on instruments of problematical accuracy by persons of dubious reliability and questionable mentality for the avowed purpose of annoying and confounding a hopelessly defenseless department that was unfortunate enough to ask for the information in the first place. (IEEE Grid newsmagazine) A hacker on a roll may be able to producein a period of a few monthssomething that a small development group (say, 7-8 people) would have a hard time getting together over a year. IBM used to report that certain programmers might be as much as 100 times as productive as other workers, or more. (Peter Seebach) The best programmers are not marginally better than merely good ones. They are an order-of-magnitude better, measured by whatever standard: conceptual creativity, speed, ingenuity of design, or problem-solving ability. (Randall E. Stross) A great lathe operator commands several times the wage of an average lathe operator, but a great writer of software code is worth 10,000 times the price of an average software writer. (Bill Gates) Programming Dont worry if it doesnt work right. If everything did, youd be out of a job. (Moshers Law of Software Engineering) Measuring programming progress by lines of code is like measuring aircraft building progress by weight. (Bill Gates) Writing code has a place in the human hierarchy worth somewhere above grave robbing and beneath managing. (Gerald Weinberg) First learn computer science and all the theory. Next develop a programming style. Then forget all that and just hack. (George Carrette) First, solve the problem. Then, write the code. (John Johnson) Optimism is an occupational hazard of programming; feedback is the treatment. (Kent Beck) To iterate is human, to recurse divine. (L. Peter Deutsch) The best thing about a boolean is even if you are wrong, you are only off by a bit. (Anonymous) Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration. (Stan Kelly-Bootle) Programming Languages There are only two kinds of programming languages: those people always bitch about and those nobody uses. (Bjarne Stroustrup) PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil perpetrated by skilled but perverted professionals. (Jon Ribbens) The use of COBOL cripples the mind; its teaching should therefore be regarded as a criminal offense. (E.W. Dijkstra) It is practically impossible to teach good programming style to students that have had prior exposure to BASIC. As potential programmers, they are mentally mutilated beyond hope of regeneration. (E. W. Dijkstra) I think Microsoft named .Net so it wouldnt show up in a Unix directory listing. (Oktal) There is no programming languageno matter how structuredthat will prevent programmers from making bad programs. (Larry Flon) Computer language design is just like a stroll in the park. Jurassic Park, that is. (Larry Wall) C/C++ Fifty years of programming language research, and we end up with C++? (Richard A. OKeefe) Writing in C or C++ is like running a chain saw with all the safety guards removed. (Bob Gray) In C++ its harder to shoot yourself in the foot, but when you do, you blow off your whole leg. (Bjarne Stroustrup) C++ : Where friends have access to your private members. (Gavin Russell Baker) One of the main causes of the fall of the Roman Empire was thatlacking zerothey had no way to indicate successful termination of their C programs. (Robert Firth) Java Saying that Java is nice because it works on all OSes is like saying that anal sex is nice because it works on all genders. (Alanna) Fine, Java MIGHT be a good example of what a programming language should be like. But Java applications are good examples of what applications SHOULDNT be like. (pixadel) If Java had true garbage collection, most programs would delete themselves upon execution. (Robert Sewell) Open Source Software is like sex: Its better when its free. (Linus Torvalds) The only people who have anything to fear from free software are those whose products are worth even less. (David Emery) Code Good code is its own best documentation. (Steve McConnell) Any code of your own that you havent looked at for six or more months might as well have been written by someone else. (Eaglesons Law) The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time. (Tom Cargill) Software Development Good programmers use their brains, but good guidelines save us having to think out every case. (Francis Glassborow) In software, we rarely have meaningful requirements. Even if we do, the only measure of success that matters is whether our solution solves the customers shifting idea of what their problem is. (Jeff Atwood) Considering the current sad state of our computer programs, software development is clearly still a black art, and cannot yet be called an engineering discipline. (Bill Clinton) You cant have great software without a great team, and most software teams behave like dysfunctional families. (Jim McCarthy) Debugging As soon as we started programming, we found to our surprise that it wasnt as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs. (Maurice Wilkes discovers debugging, 1949) Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you areby definitionnot smart enough to debug it. (Brian Kernighan) If debugging is the process of removing bugs, then programming must be the process of putting them in. (Edsger W. Dijkstra) Quality I dont care if it works on your machine! We are not shipping your machine! (Vidiu Platon) Programming is like sex: one mistake and youre providing support for a lifetime. (Michael Sinz) There are two ways to write error-free programs; only the third one works. (Alan J. Perlis) You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time. (Bertrand Meyer) If McDonalds were run like a software company, one out of every hundred Big Macs would give you food poisoning, and the response would be, Were sorry, heres a coupon for two more. (Mark Minasi) Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. (Martin Golding) To err is human, but to really foul things up you need a computer. (Paul Ehrlich) A computer lets you make more mistakes faster than any invention in human historywith the possible exceptions of handguns and tequila. (Mitch Radcliffe) Predictions Everything that can be invented has been invented. (Charles H. Duell, Commissioner, U.S. Office of Patents, 1899) I think theres a world market for about 5 computers. (Thomas J. Watson, Chairman of the Board, IBM, circa 1948) It would appear that we have reached the limits of what it is possible to achieve with computer technology, although one should be careful with such statements, as they tend to sound pretty silly in 5 years. (John Von Neumann, circa 1949) But what is it good for? (Engineer at the Advanced Computing Systems Division of IBM, commenting on the microchip, 1968) There is no reason for any individual to have a computer in his home. (Ken Olson, President, Digital Equipment Corporation, 1977) 640K ought to be enough for anybody. (Bill Gates, 1981) Windows NT addresses 2 Gigabytes of RAM, which is more than any application will ever need. (Microsoft, on the development of Windows NT, 1992) We will never become a truly paper-less society until the Palm Pilot folks come out with WipeMe 1.0 . (Andy Pierson) If it keeps up, man will atrophy all his limbs but the push-button finger. (Frank Lloyd Wright)
个人分类: 转载随记|5156 次阅读|1 个评论
【转载】22条经典的编程引言
freton 2009-9-27 17:38
22条经典的编程引言 HACKER 2009-05-24 15:08 阅读 51 评论 6 字号: 大 大 中 中 小 小 下面的这些经典的引言来自英文,也许有些我翻译的是不很好,所以,我提供了中英对照,如果有问题,请大家指正。 过早的优化是万恶之源。Premature optimization is the root of all evil! - Donald Knuth 在水里行走和以一个需求规格进行软件开发,有一点是相同的,那就是如果水或需求都被冻住不了,那么行走和软件开发都会变得容易。Walking on water and developing software from a specification are easy if both are frozen - Edward V Berard Hofstadter 定理:一件事情总是会花费比你预期更多的时间,就算是你已经考虑过本条Hofstadter 定理。It always takes longer than you expect, even when you take into account Hofstadters Law. - Hofstadters Law 有些遇到问题的人总是会说我知道,我会使用正则表达式,那么,你现在有两个问题了。(意思是:你本想用正则表达式来解决你已有问题,但实际上你又引入了正则表达式的一个新问题)Some people, when confronted with a problem, think I know, Ill use regular expressions. Now they have two problems - Jamie Zawinski 调试程序的难度是写代码的两倍。因此,只要你的代码写的尽可能的清楚,那么你在调试代码时就不需要那么地有技巧。Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. - Brian Kernighan 用代码行来衡量开发进度,无异于用重量来衡量制造飞机的进度。Measuring programming progress by lines of code is like measuring aircraft building progress by weight. - Bill Gates PHP被一些不合格的业余人员造就成了一个小恶魔;而Perl则是被一些熟练的但不正当的专业人员造就成了一个超级大恶魔。PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil, perpetrated by skilled but perverted professionals. - Jon Ribbens 在两个场合我被问到:请你告诉我,如果你给机器输入了错误的数字,那么,是否还能得到正确的答案?我并不能正确领会这类想法。(意思是:程序需要有纠错的能力吗?)On two occasions I have been asked, Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out? I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage 在编程的时候,我们一定要想像一下,以后维护我们自己的代码的那个人会成为一个强烈的精神病人,并且,他还知道我们住在哪里?Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Rick Osborne 现代的编程是程序员努力建一个更大更傻的程序和世界正在尝试创造更多更傻的人之间的一种竞赛,目前为止,后者是赢家。Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook 我才不关于我的代码是否能在你的机器上工作!我们不会给你提供机器。I dont care if it works on your machine! We are not shipping your machine! - Ovidiu Platon 我总是希望我的电脑能够像电话一样容易使用;我的这个希望正在变成现实,因为我现在已经不知道怎么去使用我的电话了。I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone. - Bjarne Stroustrup 计算机是一种在人类历史上所有发明中,可以让你比以前更快地犯更多的错误的发明,同样,其也包括了手枪和龙舌兰酒这两种发明的缺陷。A computer lets you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. - Mitch Ratcliffe 如果调试程序是一种标准的可以铲除BUG的流程,那么,编程就是把他们放进来的流程。If debugging is the process of removing software bugs, then programming must be the process of putting them in. - E. W. Dijkstra 教一群被BASIC先入为主的学生,什么是好的编程风格简直是一件不可能的事。对于一些有潜力的程序员,他们所受到的智力上的伤害远远超过了重建他们的信心。It is practically impossible to teach good programming style to students that have had prior exposure to BASIC. As potential programmers, they are mentally mutilated beyond hope of regeneration. - E. W. Dijkstra 理论上来说,理论和实际是一样的。但实际上来说,他们则不是。In theory, theory and practice are the same. In practice, theyre not. - Unknown 只有两个事情是无穷尽的:宇宙和人类的愚蠢。当然,我现在还不能确定宇宙是无穷尽的。Two things are infinite: the universe and human stupidity; and Im not sure about the universe. - Albert Einstein Perl这种语言就好像是被RSA加密算法加密过的一样。Perl - The only language that looks the same before and after RSA encryption. - Keith Bostic 我爱最终期限,我喜欢嗖嗖嗖的声音就像他们在飞一样。I love deadlines. I like the whooshing sound they make as they fly by. - Douglas Adams 说Java好的是因为它跨平台就像好像说肛交好是因为其可以适用于一切性别。Saying that Java is good because it works on all platforms is like saying **** sex is good because it works on all genders - Unknown XML就像是一种强暴如果它不能解决你的问题,那只能说明你没有用好它。XML is like violence - if it doesnt solve your problems, you are not using enough of it. - Unknown 爱因期坦说,自然界中的一切一定会有一个简单的解释,因为上帝并不是反复无常和独裁的。当然,不会有什么信仰能程序员像爱因期坦那样感到舒服。Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer. - Fred Brooks
个人分类: 转载随记|299 次阅读|0 个评论
70年代:为了学术而放弃金钱的徐迎晓【转载】
maywuyi 2009-3-5 11:24
最近看到一篇介绍IT人生的文章,感觉很有代表性,转载如下: 一.请先介绍你的出生日期、籍贯、现任工作单位和职务、参与工作时间,还有历年来的工作履历。 徐迎晓 出生于1973年,籍贯:江苏淮阴,1996年开始参加工作。1993年保送东南大学机械系硕士研究生,经过激烈竞争,成功地进入该系最偏向计算机的计算机集成制造研究方向,完成了由本科的机械专业向计算机方向转移的第一小步。1996年来到上海大学网络中心,算是正式跨入IT界,之间经历了多家IT公司的兼职,做培训、写技术文章、出书和做研究,日趋成熟,游刃有余。1999年考入复旦大学计算机软件与理论专业,2002年7月获博士学位,最终摆脱非科班出生的帽子。2002年破格评上上海大学副研究员,圆了部分学术梦想。 二、请回答填写下列问题。根据自己的真实情况和感受作答,长短不限,但必须全部属实。 1、进来IT业界这么久,对你个人的改变或发展影响最大的是什么?   进入网络中心做网管,并在当时其下的Leap公司做IT培训,使我从一个网络的门外汉成为不折不扣的网络专家。伴随着公司一起长大,成为公司的骨干,相继获取了CAN/CNE/CNI/SCJP/CCNA一大堆证书,摆脱了毕业时惶惶然不知能够做什么的心境,在讲台上获得了绝对的自信,在做工程项目中发现IT界没有我做不了的事情。 2、在这行干到现在,你对钱有什么看法?   受传统思想毒害太深,一直以为钱是身外之物,一心追求学术发展,因而找工作时也全部在高校中求职。工作以后曾经有多个月薪两万又很轻松的工作摆在我面前,但是我主动放弃了,只是为了心中的学术梦想。但当我的父母为居无定所而苦恼,母亲住院期间因为现金没跟上而被突然停药,岳母住院时因为手头没有足够的住院押金而在走廊中呻吟着等待筹集现金时,我知道对于生于70年代的我们,金钱已经不仅仅是个人的事情。我们的父母是被时代牺牲的一代,生于70年代的我们无法置之度外,对金钱的潇洒或许只能等待下一代。年近30,才发现为了学术而放弃金钱的想法也是很傻的。学术的背后仍是金钱:没有钱,就没有学术助手,只有孤军奋战;写出来的学术论文水平再高,交不出钱仍无法发表;没有钱也无法参加国际会议进行学术交流。而即使在学术机构,争取到多少科研经费仍比个人的学术水平更重要。事实上,至少在目前的社会,个人的成就感更多地来自金钱的多少而非学术的高下,而金钱的多少在很多时候更决定着学术声誉的高下。如果上天再给我一次机会,我会先去挣足足够的钱。 3、你觉得入行以后你做的最成功的一件事是什么?请详细说来听听。(请交待事情发生的时间、地点、人物、事情经过、结果) 在南京读硕士研究生后不久,导师课题很少,连使用计算机的机会都很少,我总觉得吃不饱,谁给我用一用计算机我愿意一分钱工钱不要,甚至倒贴。但那时大学生兼职主要还是家教,技术类的兼职机会还很少。经过漫长的等待,终于在学校门口的树干上看到了一个小广告,是南京师范大学下面的一个公司招C++程序员,那时C++刚开始热门,图书馆只有清华出版社出版的一套书,我忙借过来狂看。图书馆阅览室是当天借当天还的,因此每天早上都急急地去抢书,生怕被别人借去了。狂看三天后,以前只听过面向对象这一个词的我终于初步知道了类、对象、方法之类的概念了,赶在截止之前最后一天去面试,面对诸多高手,居然凭自己的东南大学的牌子而和另一个校友一起胜出。这是我的第一个计算机类的兼职,一个月的不舍昼夜和废寝忘食,终于赚来了近500元钱。现在如果还有机会像那时那么辛苦,足够我赚好几万了,但那时研究生的补贴只有几十元,各种加起来100元上下就是我一个月全部的收入了。500元虽不是天文数字,但也像现在的几万元足够让我心狂跳了。觉得赚钱真是容易,又给我电脑用又给我这么多钱。拿出100多元给家里买了个微型缝纫机,其余的存起来。买缝纫机时走在新街口百货商店和鼓楼百货商店,第一次发现店里的东西真便宜,大部分东西我的500元都可以买得起。 4、在未来的日子里,你最看重什么,最渴望得到什么?   最看重生活质量。荣誉、地位、学术、金钱一切都是假的,这些东西只有能够提高自己的生活质量才是活生生的让自己和家人受益。最渴望宽敞的住房,安静的书房和自由的工作。 5、你觉得生在70年代的IT人有什么特征是其他年代的人没有的?   不论是计算机还是国家,生于70年代的IT人都经历了从简单到复杂,从贫乏到丰富,从困苦到小康的过程。因此,我们能够适应最艰苦的物质生活和最原始的计算机操作,也能够享受最富足的小康生活和手写/语音输入、网络会议。我们是历史的见证人和参与者。但生在70年代初的IT人极可能是被牺牲的一代,在终于等到了Internet所带来的与国际接轨、各尽所能的时代时,最富有创造力的年华已经快要过去。我在最具有创造力的年龄没有计算机使用,只有在教室的桌子上闭着眼睛练键盘指法。生于80年代的IT人将跳过我们十几年的弯路,直接与国际接轨。生于70年代初的IT人赶上了末班车,而生于70年代末和80年代的IT人将出现一批真正的大师。 三、你对同龄人和后辈还有什么话要说的?   发展是硬道理。不要为了讨好任何人做牺牲。做任何事情都是有人喝彩有人说风凉话,只要一件事有助于自己的发展,那就去做,不管周围的舆论和冠冕堂皇的宣传。 转载地址: http://arch.pconline.com.cn/news/subjectnews/xl/10212/118702.html
个人分类: 读书笔记|6429 次阅读|2 个评论

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-17 19:11

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部