科学网

 找回密码
  注册

tag 标签: write

相关帖子

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

没有相关内容

相关日志

写一个与NVSS做位置匹配的源列表文件(IDL程序)
deliangwang 2013-1-30 12:36
Pro nvss_upfile,ra,dec,radius=radius,filename=filename,format=format ;+ ;NAME: ; nvss_upfile ;PURPOSE: ; write a upfile for NVSS matched source ;CALLING SEQUENCE: ; nvss_upfile,ra,dec,filename=filename ; ;INPUT: ; ra ----- RA for source in Unit:degree ; dec ----- DEC for source in Unit:degree ;OPTIONAL KEYWORD INPUT: ; radius ---- matched radius in Unit:arcsec ; default it,it will set it 15 arcsec ; format ---- if set it,it will output according to format ;OPTIONAL KEYWORD OUT: ; filename ---- upfile name ;EXAMPLE: ; IDL nvss_upfile,ra,dec,filename='NVSS_update.dat' ; ;REVISION HISTORY: ; Original by DL.Wang,Aug-30-2007 ;- if ( N_PARAMS() lt 2 ) then begin message,'Syntax:nvss_upfile,ra,dec, ' return endif if not keyword_set(radius) then radius=15 openw,lun,filename,/get_lun n=n_elements(ra) for i=0L,n-1 do begin if not keyword_set(format) then begin printf,lun,adstring(ra ,dec ,1),' ',radius,' ','0' endif else begin printf,lun,adstring(ra ,dec ,1),radius,'0',format=format endelse endfor free_lun,lun End
个人分类: 编程笔记|2395 次阅读|0 个评论
写一个与2MASS数据库做位置匹配的上传文件的IDL程序
deliangwang 2013-1-29 23:02
Pro write_2mass_upfile,ra,dec,radius=radius,name=name, $ filename=filename,format=format ;+ ;NAME: ; write_2mass_upfile ;PURPOSE: ; write a upfile for matched source list,matched with 2MASS ;CALLING SEQUENCE: ; write_2mass_upfile,ra,dec,radius=radius,filename=filename,format=format, ; /name ;INPUT: ; RA ----- RA for matched source list in Unit:degree ; DEC ----- DEC for matched source list in Unit:degree ;OPTIONAL KEYWORD INPUT: ; radius ----- match radius in Unit:arcsec ; default it,radius is 7.0 arcsec ; name ----- if set it,it will print source name. ; default it,it will print source sequence ;OPTIONAL KEYWORD OUTPUT: ; filename ----- name for output file ; default it,filename is '2mass_update.dat' ; format ----- format for output data ; ;EXAMPLE: ; IDL write_2mass_upfile,ra,dec,filename='rgb_2mass_update.dat' ; ;REVISION HISTORY: ; Original by DL,Wang,Aug-17-2007 ;- Npar = N_params() if ( Npar lt 2 ) then message, $ 'ERROR - RA and Declination do not have equal number of elements' if not keyword_set(radius) then radius=7.0 if not keyword_set(format) then format='(1x,A14,1x,F10.6,1x,F10.6,1x,F3.1)' if not keyword_set(filename) then filename='2mass_update.dat' openw,lun,filename,/get_lun printf,lun,'\ Example of cone search' printf,lun,"\EQUINOX = 'J2000.0'" printf,lun,'| objname | ra | dec | radius |' printf,lun,'| string | double | double | double |' printf,lun,'| unit | unit | unit | arcsec |' if not keyword_set(name) then begin for i=0L,n_elements(ra)-1 do begin printf,lun,i+1,ra ,dec ,radius,F=format endfor endif else begin for i=0L,n_elements(ra)-1 do begin printf,lun,name ,ra ,dec ,radius,F=format endfor endelse free_lun,lun End
个人分类: 编程笔记|2352 次阅读|0 个评论
[转载]Fortran中write(*,*)和write(6,*)的区别
Irasater 2013-1-20 17:23
http://blog.sina.com.cn/s/blog_5504bf520100odbn.html write(*,*) xyz 表示将xyz的值(数字或者字符等)用默认的格式(第二个*)输出到默认的设备上(第一个*),即显示器上. write(6,*) xyz 表示将xyz的值(数字或者字符等)用默认的格式(第二个*)输出到设备号为6的设备(可以是文件)上. 如果没有指定设备号=6的设备(或文件), 则输出到默认的设备, 即显示器上. 那么用write(6,*) xyz 的好处是, 可以把结果输出到屏幕上, 或者输出到指定的设备(文件)上, 只要 指定或者不指定设备号6. 就是说可以方便切换输出方式. **************** 那么, 如何指定输出设备呢? 实际上, 除了屏幕(默认), 所谓输出设备, 就是文件。比如, open(unit=6, file='results.txt') write(6,*) xyz 将定义设备号6为文件results.txt。 输出内容(xyz的值) 将被按照默认格式(第二个*)存到此文件里。又如: open(unit=6, file='results.txt') WRITE (6,2011) Energy 2011 FORMAT ('Energy (keV) ', F6.2) 表示:按照格式2011, 将Engery的值写入文件results.txt.
个人分类: Software|2396 次阅读|0 个评论
OUTPUT MATRIX
kkmm02 2013-1-5 01:06
! DO I=1,M**2 ! write(31,'(100e10.2)') (A(I,J),J=1,M**2) ! END DO
3637 次阅读|0 个评论
[转载]Tips for Writing Better Science Papers: Titles (2)
dwd0826 2012-12-29 16:35
http://www.chemistryviews.org/details/education/2709461/Tips_for_Writing_Better_Science_Papers_Titles_2.html Have you ever struggled to write up your results into a publishable paper only to get it rejected? Richard Threlfall, Managing Editor, Asian Journal of Organic Chemistry , gives some insider tips on how to improve each section of your article and increase your chances of getting published. Titles We're going to start right at the top with the title of your manuscript! The title of a paper is important because it is one of the first things that an editor/reviewer/reader sees when they look at your manuscript. Therefore, it is important to grab their attention right away and give them an idea of why your paper is a scientific breakthrough! Be specific, not too technical, and concise. The other thing to consider is that internet and scientific search tools often search by manuscript title, so if you want to get your paper read and cited, it is important to get some of the key aspects of the research into the title. A good tip is to think which search terms you would use to find your own paper through a web search. For a basic example, consider a (fictional) manuscript entitled "Effect of Metal Catalyst on the Outcome of Reactions with Aryl Alcohols". What is the effect? Which metal? What reaction? What type of aryl alcohols? The editor/reviewer/reader get nothing but questions out of this title! Much better might be: "Ruthenium Trichloride is the Most Efficient Catalyst for C–H Activation with 2,4-Disubstituted Aryl Alcohols". The editor/reviewer/reader immediately knows what the paper is about and will want to read more. Plus, someone who types in terms like "ruthenium", "C–H activation", or "2,4-disubstituted" into a search engine has a much higher chance of finding the second manuscript, but does not get any matches with the title of the first one. Finally, avoid adding every detail from the paper into the title—the title shouldn't be confused with or replace an abstract. The most read and most cited articles often have short and simple titles.
2193 次阅读|0 个评论
[转载]How to write a research proposal?
grapeson 2012-11-28 20:04
Guideline Research proposal How to write your research proposal A research proposal is an outline of the research project that will be the focus of your doctoral thesis. Your research proposal will be the core of your application and allows you to present your academic perspective and creativity. Successful proposals will address research questions that lie within our areas of research . The following guidelines may be of assistance in writing your proposal. However, keep in mind that a research proposal should always reflect your personal academic perspective and research interests. We appreciate being challenged by an innovative research question and approach! First, present a concrete issue . What is the issue? Why you have chosen this issue and why is it relevant? In relation to this issue, pose a central research question. This question is the focus of your project and should be specified clearly. What is the central question you aim to answer in your thesis? Why is your research question relevant for academic debate? Where is the gap in literature that you intend to address? What are some sub-questions or hypotheses relevant to answering your question? Address the specific theoretical perspective that you will use in analysing your issue. Why did you choose this specific theoretical perspective? How does current theory help to answer your question, both in general and specifically? Based on your theoretical foundation, detail your planned methodological approach . What kind of methodology will you use and why (e.g. qualitative or quantitative analyses, single case studies, process tracing, small or large N, discourse analysis, critical theory)? What are some relevant sources of information (e.g. document analysis, field research, data base, interviews with relevant stakeholders)? Finally, reflect on the content . What will be the main arguments of the thesis? What might be the outcome of, or answers to, these arguments? How will you structure your thesis and why? Please also enclose a timetable indicating the timing of the main steps of your project including periods for research, analysis and writing. Your proposal should be no longer than 5,000 words ; the quality of your text is more significant than the quantity.
1840 次阅读|0 个评论
write matlab binary file example
newmerce 2012-10-25 22:04
% write binary features and targets % usage: writebin('training_pac.bin', Features, Targets) function = writebin(FileName, Features, Targets) = size(Features); %get features size nFeatures = col; %file flag flags = hex2dec('00010000'); fid = fopen(FileName, 'w'); fwrite(fid,flags,'int'); fwrite(fid,nFeatures,'int'); for i = 1: row fwrite(fid,Targets(i),'int'); fwrite(fid,Features(i,:),'double'); end fclose(fid); msg = 'ok';
个人分类: matlab|2203 次阅读|0 个评论
write profiled satellite soil moisture into netcdf format
gwangcc 2012-10-13 20:36
%% in Matlab clear load ECV_LY1 ECV_LY1=flipdim(ECV_LY1,2); =size(ECV_LY1); ncid = netcdf.create('ECV_LY1.nc', 'CLOBBER'); lon_dimid = netcdf.defDim(ncid,'longitude',nlon); lat_dimid = netcdf.defDim(ncid,'latitude',nlat); time_dimid = netcdf.defDim(ncid,'time',nt); varid = netcdf.defVar(ncid,'swvl1','double', ); netcdf.endDef(ncid) netcdf.putVar(ncid,varid,ECV_LY1); % clear load ECV_LY2 ECV_LY2=flipdim(ECV_LY2,2); =size(ECV_LY2); ncid = netcdf.create('ECV_LY2.nc', 'CLOBBER'); lon_dimid = netcdf.defDim(ncid,'longitude',nlon); lat_dimid = netcdf.defDim(ncid,'latitude',nlat); time_dimid = netcdf.defDim(ncid,'time',nt); varid = netcdf.defVar(ncid,'swvl1','double', ); netcdf.endDef(ncid) netcdf.putVar(ncid,varid,ECV_LY2); % clear load ECV_LY3 ECV_LY3=flipdim(ECV_LY3,2); =size(ECV_LY3); ncid = netcdf.create('ECV_LY3.nc', 'CLOBBER'); lon_dimid = netcdf.defDim(ncid,'longitude',nlon); lat_dimid = netcdf.defDim(ncid,'latitude',nlat); time_dimid = netcdf.defDim(ncid,'time',nt); varid = netcdf.defVar(ncid,'swvl1','double', ); netcdf.endDef(ncid) netcdf.putVar(ncid,varid,ECV_LY3); % clear load ECV_LY4 ECV_LY4=flipdim(ECV_LY4,2); =size(ECV_LY4); ncid = netcdf.create('ECV_LY4.nc', 'CLOBBER'); lon_dimid = netcdf.defDim(ncid,'longitude',nlon); lat_dimid = netcdf.defDim(ncid,'latitude',nlat); time_dimid = netcdf.defDim(ncid,'time',nt); varid = netcdf.defVar(ncid,'swvl1','double', ); netcdf.endDef(ncid) netcdf.putVar(ncid,varid,ECV_LY4); %% in Linux % layer 1 cdo replace Interim_SWVL1_1981-2010.nc ECV_LY1.nc temp.nc rm -f ECV_LY1.nc cdo chname,swvl1,ECV_LY1 temp.nc ECV_LY1.nc rm -f temp.nc % layer 2 cdo replace Interim_SWVL1_1981-2010.nc ECV_LY2.nc temp.nc rm -f ECV_LY2.nc cdo chname,swvl1,ECV_LY2 temp.nc ECV_LY2.nc rm -f temp.nc % layer 3 cdo replace Interim_SWVL1_1981-2010.nc ECV_LY3.nc temp.nc rm -f ECV_LY3.nc cdo chname,swvl1,ECV_LY3 temp.nc ECV_LY3.nc rm -f temp.nc % layer 4 cdo replace Interim_SWVL1_1981-2010.nc ECV_LY4.nc temp.nc rm -f ECV_LY4.nc cdo chname,swvl1,ECV_LY4 temp.nc ECV_LY4.nc rm -f temp.nc
3172 次阅读|0 个评论
[转载]【Fotran】Fortran文件操作技巧汇总
zhenghui2915 2012-9-18 16:13
转载地址: http://bbs.sciencenet.cn/blog-287062-269811.html 格式化输出的控制字符非常的丰富,但常用的并不多,一般说来:" I 、F、E、A、X "是最常使用的几个格式,最好把它们都记下来。 Iw 以w个字符的宽度来输出整数,至少输出m个数字。如:write(*,"(I5)")100 输出:_ _100 ; 前面两空格 Fw.d 以w个字符文本框来输出浮点数,小数部分占d个字符宽,输出文本框的设置不中会出现*号。如:write(*,"(F9.3)") 123.45 输出:_ _123.450 ; 前面两空格,后补0 Ew.d 用科学计数法,以w个字符宽来输出浮点数,小数部分占d个字符宽,指数部分最少输出e个数字。如:write(*,"(E15.7)" 123.45 输出:_ _0.1234500E+03 ; 输出不中15个字符的部分补上空白,小数部分不足7位的会补0 Dw.d 使用方法同Ew.d,差别在于输出时用来代表指数的字母由E换成D。 Aw 以w个字符宽来输出字符串。 write(*,"(A10)") "Hello" 固定用是为10我个字符段来输出字符串,不足的前面补空格 nX 输出位置向右移动n位。write(*,"(5X,I3)") 100 ; 将先填5个空格,再输出整数。 Lw 以w个字符宽来输出T或F的真假值。write(*,"(L4)") .true. ;程序会输出3个空格和一个T / 换行输出。write(*,"(I3//3)") 10,10 程序会得出4行,中间两行空格是从除号"/"得到的。 Tc 把输出的位置移动到本行的第c个字节。 TLn 输出位置向左相对移动n个字节。 TRn 输出位置向左相对移动n个字节。 SP、SS 加了SP后,输出数字时如数值为正则加上"+",SS则是用来取消SP的功能。 如 write(*,"(SP , I5 , I5 , SS , I5)") 5 , 5 , 5 输出:+5 +55 BN、BZ BN定义在输入时没有数据的字节代表没有东西。BZ定义在没有数据的字节代表0 另有 kP 、Bw 、Ow 、Zw 用的较少,在需要时可以查询。 2009-11-09于承德 1、在fortran中,文件和逻辑设备总是成对出现,文件总是同特定的逻辑设备相关联,不管这个文件是内部文件还是外部文件, 所谓的外部文件除内存以外的其他外部设,与此对应,保持在一块内存中的数据称为内部文件。 预定义的设备描述符中‘*’只允许与键盘和屏幕连接,而不能与其他的外部文件连接,而其他的默认的预定义的设备描述符0,5,6子fortran中虽然也是与默认的外部设备相关联,但fortran并不禁止在程序中将这些设备描述符同其他外部文件相关联。 2、 内部文件只能使用read和write语句进行操作,其他常见的文件操作语句(open,close,rewind,backspace,inquire)等语句不能作用于内部文件。 在进行内部文件输入输出操作时,如果输入的数据字段宽度小于内部文件中一个记录的长度时,则记录中剩余的空间会用空格进行填充,如果输入数据的字段宽度大于记录长度时,多余的部分将被删除。 3、外部文件中分类 3.1有格式文件:数据内容的记录是以ASCII码字符的方式进行,每一条就都已ASCII码中的回车符家换行符来结束,使用一般的文本编辑器可以直接看到其中的内容。open语句创建文件时默认的是有格式文件 3.2无格式文件:数据存放时不指定数据的格式,按照数据在内存中的二进制存放方式来存取数据,但是,一些必要的格式控制仍然会写入文件中,如记录之间的回车符和换行符。 3.3二进制文件:记录中只有数据,没有格式控制字符 3.4 二进制文件和无格式文件由于在进行数据保存时直接复制了相应内存中的内容,因而在数据的保存精度上是最高的,而有格式文件在进行格式转换操作时,往往受格式的现在而会对实际的数据做一些阶段处理,从而造成数据精度的丢失。 3.5顺序存取文件:此中的数据必须一个记录接着一个记录的按顺序被访问。采用open语句的默认设置来打开或创建的文件都是顺序文件。 3.6直接存取文件:存在在此中的数据可以按照任意顺序进行读写操作,这种文件中的记录从1开始进行连续编号,所有的记录的长度都是一致的,它通过open语句中的recl参数来描述。 3.7 只有格式化I/O语句才能读写格式化记录,费用非格式化I/O语句才能读写非格式化记录。在顺序文件中可以用Endfile语句在文件中添加一个文件结束记录。 3.8在标准的fortran支持的文件中,为了区分不同的记录,会在要保存的记录上添加一些控制字符(不管是有格式的还是无格式的) 4. OPEN 语句是fortran语言中最复杂的语句,用于 把设备号与文件名连接起来 ,并且 对文件的各项性质进行指定 。 它的一般形式为: OPEN( unit ) 自选的文件编号从10开始,关于其中各项的解释,请参考: http://blog.sina.com.cn/s/blog_5d2c32550100dhya.html OPEN语句 OPEN 语句用于 把设备号与文件名连接起来 ,并且 对文件的各项性质进行指定 。它的一般形式为: OPEN( unit ) 其中的各项参数的意义及取值如下: 1) UNIT :设备号说明。 unit 是大于或等于 0 的正整数,设备号说明是 OPEN 语句的第—项时可以省略“ UNIT= ”。 2) ACCESS :存取方式说明。 access 是字符串表达式: APPEND 追加方式 SEQUENTIAL 顺序访问方式 DIRECT 直接访问方式 当省略此说明项时为顺序访问方式。 3) ACTION :描述文件的读写属性。 action 是字符串表达式: READ 文件为只读方式打开 WRITE 文件为只写方式打开 READWRITE 文件为可读写方式打开 当省略此说明项时,文件打开顺序: READWRITE-READ-WRITE 。 4) BLANK :说明数据格式输入字段中空格的含义。 blank 是字符串表达式: NULL 空格忽略不计,相当于在格式描述符中的 BN 编辑符 ZERO 空格处理成数字 0 ,相当于 BZ 编辑符 当省略此说明项时为 ZERO 。此说明只能用于格式输入。 5) BLOCKSIZE :指定以字节为单位的设备缓存的大小,默认值为一 4 字节整数。 6) CARRIAGECONTROL :指明处理文件中的第一个字符的方式,其值为字符串表达式: Fortran 对第一个字符作一般的 Fortran 解释 LIST 指出在文件的每两个记录之间有—个空格 默认状态下,对于连接到打印机和显示器这样的设备,设置值为 Fortran ,对于连接到文件的设备,设置值为 LIST 。当 FORM 被设成 UNFORMATTED 和 BINARY 时,其值被忽略。 7) DELIM :指明分隔直接列表或格式化名称列表记录的方式,其值为字符串表达式: APOSTROPHE 用单撇号 ( ’ ) 分隔 QUOTE 用双撇号 ( ” ) 分隔 NONE 不用分隔符 如果在 OPEN 语句中设置了分隔符,则在文件中的单撇号和双撇号都是成对出现的。 8) ERR :出错处理说明。其值是同一程序中的一条语句的标号,当 OPEN 语句执行出错时执行此语句。如果省略该项,则出错时给出出错信息并终止运行。 9) FILE :文件名。 file 是一字符串表达式,可以是空、合法的数据文件名字、设备名字或是作为内部文件的变量。在 WinNT/9x 中允许使用长度大于 8 的文件名和长度大于 3 的文件扩展名。省略此项时,编译器将自动产生一个文件名唯一的临时文件,这个临时文件将在结束运行或与文件连接的设备关闭后被删除掉。 10) FORM :记录格式说明。 form 是字符串表达式: FORMATTED 记录按有格式存放。 UNFORMATTED 记录按无格式存放。 当省略此说明项时为:对顺序文件是有格式的;对直接文件是无格式的。 11) IOFUS :指出一个新 Quickwin 子窗口是否为活动窗口,其值为逻辑值。缺省值为真。 12) IOSTAT :出错状态说明。 iostat 是—个缺省长度为 4 的整形变量。当执行此 OPEN 语句时系统给变量赋值: 零 没有发生错误 负数 文件结尾 正数 发生错误,其值视具体计算机系统而定 若省略该项则没有此功能。 13) PAD :从格式化文件中记录的数据少于要读取的数据时,是否用空格来填充没有从记录中读到数据的变量。 pad 是字符串表达式: YES 填充 ( 默认值 ) NO 不填充 14) POSITION :指定打开顺序文件的访问位置, position 是字符串表达式: ASIA 已被连接的文件的访问位置是固定的,未被连接的文件的访问位置是文件的开始处。 REWIND 把文件的访问位置定在文件的开始处 ( 文件己存在 ) 。 APPEND 把文件的访问位置定在文件的末尾处 ( 文件己存在 ) 。 对于一个新文件,文件的访问位置总是被定在文件的开始处。 15) RECL :记录长度 ( 单位为字节 ) 说明。 recl 是指定的正整型量或算术表达式,用来指定直接文件中的每条记录的字节数,或顺序文件中的记录的最大长度。 16) SHARE :指明当文件打开时是否实现文件的锁定。 share 是字符串表达式: DENYRW 动态读写模式。不允许其他的进程打开这个文件。 DENYWR 动态写模式。不允许其他的进程以写的方式打开这个文件。 DENYRD 动态读模式。不允许其他的进程以读的方式打开这个文件。 DENYNONE 默认的非动态模式。允许其他的进程打开这个文件。 17) STATUS :文件状态说明。 status 是字符串表达式: OLD 表示指定的文件是已经存在的老文件。这一状态一般用于读操作,如果用于写操作则重写文件,原文件内容将被覆盖。如果指定的文件并不存在,则系统将给出出错信息。 NEW 表示指定的文件尚不存在。执行 OPEN 语句时将在磁盘上建立该文件并使其状态改变为 OLD 。 NEW 状态一般用于写操作。如果指定的文件名已经存在将给出出错信息 ( 有的系统不给出信息而是把这个已经存在的文件冲掉使原来的内容不复存在 ) 。 SCRATCH 表示与设备号相连接的文件在关闭时将被自动删除。注意:此状态不能与 FILE 说明共存,只能用于由计算机系统指定的文件名,使该文件作为程序运行过程中的一个临时性文件。 REPLACE 表示替换一个有相同名字的文件,如果没有同名的文件存在,将产生一个新文件。 UNKNOWN 表示文件可以是已存在的或不存在的。系统打开文件状态的次序为: OLO-NEW- 创建新文件。 STATUS 的设置值只影响磁盘文件,像键盘和显示器这样的设备将忽略这一设置。 若省略该项时默认的状态为 UNKNOWN 。 5.记录的组合:在fortran支持的文件中,对于顺序文件,每条记录依次排列,记录可长可短,读取时,计算机需要知道每条记录的长度(无格式文件的做法)或者正在读取的记录在哪儿结束(有格式文件的做法),对于直接文件,只需要知道该读取第几条记录就可以了,不需要知道每条记录的长度。 Fortran读文件时判断文件结束的两种方法 方法1: open(11,file='example') do while(.true.) read(11,*,iostat=status)record if(status.le.0) goto 100 print*,record enddo 100close(11) 方法2: open(11,file='example') do while(.true.) read(11,*,end=100)record print*,record enddo 100 close(11)
个人分类: 程序设计|1 次阅读|0 个评论
My first time to write review:one raw-rejected manuscript
LuWen0911 2012-4-11 21:40
Abstract Inflammation is a protective attempt by the organism to remove the injurious stimuli and to initiate the healing process. Initiation and progression of inflammation involves a complex cellular network, the predominant innate immune cell in inflammation is the monocyte-macrophage.The behavior of this cell type within the inflammation is heterogeneous and depends on the recruitment of diverse monocyte subsets.Recent efforts to elucidate the local tissue microenvironment offers polarization and activation signals which impact on macrophage phenotype . In this paper, we review the literature addressing the tissue factor in modulating macrophage heterogeneity and activation with adipose tissue, central nervous system ,aging. Key words : inflammation,tissue factor,macrophage heterogeneity and activation, adipose tissue,central nervous system Introduction Tissue macrophages have a broad role in the maintenance host defence,immunity, homeostasis, and act through several mechanisms by destroying bacteria,parasites, viruses and turmor cells,clearing necrotic debris ,apoptotic and senescent cells,processing antigens and presenting digested peptides to adoptive immunity, remodeling and repairing tissue damage(1,2, Jorge Lloberas et al.,2002,to cites or not to cited,not to cited at best) . M acrophage s undertaken so diverse burdens are tightly connected with their multiple characters.It has been known for decades that cytokines can alter macrophage functional responses( 1,3,4 i n Ro bert D.Stout et al.,2 005).Distinct functional phenotypes subsequently were reported to be generated by stimulating macrophages with a variety of agents,including IFN-r,IL-4,IL-10,TGFbeta( 4,5- 9).In addition,macrophages can reversibly and progressively shift their functional phenotype through a multitude of patterns in response to changes in microenvironmental influences( Ro bert D.Stout et al.,2 005). Macrophages are highly heterogeneous cells(10-12) that are able to respond to the specialization function of anatomical sites in tissues, primarily reflecting their local metabolic and immune microenvironment(Siamon Gordon et al.,2005). Such as in central nerve system , macrophages differ in cytoskeletal functions and migration towards specific CNS cell types under a variety of environmental cues (Elly JF Vereyken et al.,2011).High fat feeding- induced obesity leads to a phenotypic shift of adipose tissue macrophage(ATM) from an M2-polarized state that may protect aidpocytes from inflammation to an M1 proinflammatory state(Carey N.Lumeng et al.,2007, Justin I. Odegaard and Roberto R. Ricardo-Gonzalez et al.,2007) Aging associated malfunction of macrophages has contributed to a decline in the functional activity of the immune system(Jorge Lloberas et al.,2002, Julie Plowden et al.,2004 ). Th ese examples indicate that the tissue microenvironment can markedly influence the phenotype of tissue-resident macrophages (13) . Macrophages are a key cell component of the inflammatory reactions expressed at various pathological sites. Understanding the pathogenetic role played by polarized functions may pave the way for the identification of novel therapeutic approaches Macrophage activation and heterogeneity in inflammation (The spectrum of macrophage:macrophage population,Roles of macrophage in inflammation,2007) In response to cellular differentiation ,wide-spread tissue distribution and many endogenous and exogenous stimuli, Macrophages show significant heterogeneity in function(??14,15??)(14, 16). Different stimuli activate macrophages to express distinct patterns of chemokines, surface markers, and metabolic enzymes that ultimately generate the diversity of macrophage function seen in inflammatory and noninflammatory settings. Macrophage activation has been operationally defined across 2 separate activation status: interferon-r(IFN-r) mediated classically activated (CA/M1),pro-inflammatory, macrophages.Alternatively activated (AA/M2), growth promoting,macrophages, induced by the T helper 2(Th2) cytokines interleukin-4 and IL-13 (17,18) . These states have largely been defined in vitro, and tissue macrophages are likely activated along a continuum between these states in vivo(19,20,in Carey N.Lumeng et al.,2007).Mosser et al depict the spectrum showing the linear scale of the two macrophage designations.They propose three populations of macrophages based on their fundamental functions.(1) Classically activated macrophages,are vital components of host defence,predispose to cause host-tissue damage,autoimmune diseases.(2) Wound-healing macrophages,promote the production of extracellular matrix contributing to tissue repair and homeostasis,lead to fibrosis,exacerbate allergic responses.(3)Regulatory macrophages,dampen the immune response and limit inflammation,dysregulated action can contribute to the progression of neoplasia(Mosser and Edwards et al.,2008).Subsequently,Gordon et al argue that the definition on “alternative”form of activation is too loose in macrophage study. For searching potential therapeutic targets,it is required to( ##restrict the previous nomenclature,and ##)take into account the complex effects of the IL-4 and IL-13 dependence combined with cell differentiation, interactions,and local tissue microenvironment in modulating the macrophage pattern(Gordon et al et al.,2010). Key role of adipose tissue in the inflammation response An important initiator of the inflammatory response to obesity is adipose tissue. Adipose tissue is not merely an organ designed to passively store excess calories. Mature adipocytes synthesize and secrete numerous enzymes, growth factors, cytokines,chemokines and hormones that are involved in diverse processes in the body including lipid homeostasis and modulation of inflammatory responses.Adipocytes secreted termed adipocytokines or adipokines (21–23),that are recurrently reported over 50 different adipokines( http://themedicalbiochemistrypage.org/home.html ) . ###Give a general summary of these adipokines in Table 1#### Researchers found adipose tissues are infiltrated with increased numbers of macrophages in obese mice and human vensus lean counterparts,In addition,the content of these macrophages is in line with the level of obesity (25,26,27,28). Recently,Jerrold Olefsky and Christopher Glass contributed a wonderful review to summarize how adipose tissue modulates macrophage to propagate inflammation.They told a very interesting possibility that tissue cytokines in blood may “leak ”into the circulaton and impair insulin sensitivity in distal tissues in an endocrine fashion(29–31;Jerrold and Christopher et al.,2010). They also present activated T cells can modify macrophages behavior and contributed to insulin resistance(32).Th1 lymphocytes may participate macrophage migration and activation to raise the classical activated state ((33,34).While T-reg lymphocytes(Tregs) exert a protective effect to inhihit proinflammatory macrophages for a decrease in adipose tissue T-reg content in obesity(35,36). Another paper with leptin-de fi cient ob/ob mice,they induced TGF- β -dependent CD4+ latency-associated peptide positive Tregs found compromised status in inflammation,and decreased CD11b+F4/80+ macrophages and TNF- α in adipose tissue (Yaron Ilan and Ruth Maron et al.,2010).Although this furtherly confirms the role of Treg cells contributed to modulate macrophage activaity directly,as well as through cytokines,the molecular mechanisms underlying their contact-dependent interactions are poorly defined still. Organize below in a new detailed table.(cited from websites:) Table of Adipose Tissue Hormones and Cytokines Adipose tissue produces and releases a vast array of protein signal s including ( growth factor s, cy tokine s, chem oki nes, acut e phase prote ins, comp lement-like fac tors, and adhes ion mole cules,shape this table to new one ). The Table below describes several of the adipocyte proteins in more detail with leptin, adiponectin, and resistin discussed in greater detail in the following sections. The proteins of the various signaling processes are listed below. Factor Principal Source Major Action adiponectin also called adipocyte complement factor 1q-related protein (ACRP30), and adipoQ adipocytes see below adipsin (also called complement factor D) adipocytes, liver, monocytes, macrophages rate limiting enzyme in complement activation apelin adipocytes, vascular stromal cells, heart levels increase with increased insulin, exerts positive hemodynamic effects, may regulate insulin resistance by facilitating expression of BAT uncoupling proteins (e.g. UCP1, thermogenein) chemerin adipocytes, liver modulates expression of adipocyte genes involved in glucose and lipid homeostasis such as GLUT4 and fatty acid synthase (FAS); potent anti-inflammatory effects on macrophages expressing the chemerin receptor (chemokine-like receptor-1, CMKLR1) C-reactive protein (CRP) hepatocytes, adipocytes is a member of the pentraxin family of calcium-dependent ligand binding proteins; assists complement interaction with foreign and damaged cells; enhances phagocytosis by macrophages; levels of expression regulated by circulating IL-6; modulates endothelial cell functions by inducing expression of various cell adhesion molecules, e.g. ICAM-1, VCAM-1, and selectins; induces MCP-1 expression in endothelium; attenuates NO production by downregulating NOS expression; increase expression and activity of PAI-1 IL-6 adipocytes, hepatocytes, activated Th2 cells, and antigen-presenting cells (APCs) acute phase response, B cell proliferation, thrombopoiesis, synergistic with IL-1 and TNF on T cells leptin predominantly adipocytes, mammary gland, intestine, muscle, placenta see below monocyte chemotactic protein-1 (MCP-1) leukocytes, adipocytes is a chemokine defined as CCL2 (C-C motif, ligand 2); recruits monocytes, T cells, and dendritic cells to sites of infection and tissue injury omentin visceral stromal vascular cells of omental adipose tissue the omentum is one of the peritoneal folds that connects the stomach to other abdominal tissues, enhances insulin-stimulated glucose transport, levels in the blood inversely correlated with obesity and insulin resistance plasminogen-activator inhibitor-1 (PAI-1) adipocytes, monocytes, placenta, platelets, endometrium see the Blood Coagulation page for more details resistin adipocytes, spleen, monocytes, macrophages, lung, kidney, bone marrow, placenta see below TNFα primarily activated macrophages, adipocytes induces expression of other autocrine growth factors, increases cellular responsiveness to growth factors and induces signaling pathways that lead to proliferation vaspin visceral and subcutaneous adipose tissue is a serine protease inhibitor, levels decrease with worsening diabetes, increase with obesity and impaired insulin sensitivity visfatin; also called pre-B cell-enhancing factor (PBEF); reported to be the extracellular version of the enzyme nicotinamide phosphoribosyltransferase (Nampt or eNampt), however, the original paper claiming this has been retracted visceral white adipose tissue conflicting results relative to insulin receptor binding but blocking insulin receptor signaling interferes with effects of eNampt; changes in eNampt activity occur during fasting and positively regulate the activity of the NAD + -dependent deacetylase SIRT1 leading to alterations in gene expression Central nervous system It is well-accepted that monocytes can replenish tissue-macrophage numbers,especially during inflammation. However, the origin of the cells involved in this process is unclear,because it’s very complicated to distinguish the relative importance between local expansion and recruitment of microglia progenitors from the bloodstream. Although Monocytes can enter the CNS to populate macrophages ( 37 , 38,Siamon Gordon et al.,2005 ).There are evidences suggest that maintenance and local expansion of microglia are solely dependent on the self-renewal of CNS resident cells( 19 : Ajmi B and Bennett JL et al.,2007). Macrophages are important mediators in bridging innate and acquired immunity during neuroinflammation.Which can shape their phenotype and physiology to adapt to the local tissue microenvironment (13,14,Lument et al.,2007). In tissues, the microenvironment of the macrophages is thought to determine the phenotype . In vitro , cytokines and other stimuli induce these activation phenotypes. Recently,Christine D Dijkstra and colleagues published a research article to describe the characteristics of these phenotypically different macrophages in the context of the CNS. Their experiments present classically activated(CA) and alternatively activated(AA) macrophages behave differently incubated with the conditional media of CNS cells. (show in table 2)###in addition,give a description shortly### Table 2:based on Elly JF Vereyken et al,.2011 summarize in detail,continue….. CA AA Control the low weight ( 10 kD) fraction of neuronal conditioned medium, attracted higher numbers by astrocyte- and oligodendrocyte conditioned medium. attracted Intrinsic motility Low(a) High(2a) adhesion to extracellular matrix molecules (ECM) enhanced activity of the GTPases RhoA and Rac (actin cytoskeleton ) greater expression of CR3/ MAC-1(Phagocytosis of myelin and neuronal fragments) increased Effect of aging on macrophages ( human macrophages AND on animal models) Macrophages originate in the bone marrow and migrate to body tissues through blood,and therefore,which generally provide a limited view of tissue macrophages.CD68 positive cells,the markers of macrophage population ,have a dramatic decrease observed in the bone marrow of elderly people(Ogawa et al.,2000). Cell lifespan can be regulated mainly by telomeres and telomerases (Iwama et al., 1998).Telomere length and activity serve as biological regulators of the limited division potential of human cells.While terminal differentiated cells do not express telomerase(Weng, 2001).In order to uncover the functional activities of macrophages,several experiments have been performed to check the capacity of these cells to produce cytokines or chemokines(Beharka et al.,2001; Gon et al., 1996; Roubenoff et al., 1998;O’Mahony et al., 1998; Sadeghi et al., 1999; Ahluwalia et al., 2001; Mariani et al., 2002).Unfortunately,these reports are very contradictory mutually.However,some other reports suggest a decrease expression of scavenger receptor and apolipoprotein E, low respiratory burst of monocytes and susceptibility to stress-induced apoptosis during aging (Alvarez and Santa Maria, 1996;Monti et al., 2000). Experiments on animal models show impaired TNF-a production, Norepinephrine-induced chemotaxis and transcription of IAb gene (Corsini et al., 1999; Ortega et al., 2000).Aged macrophages treated with IFN-g produce lower MHC class II gene IA Complex,and intracellular IA b protein and mRNA(Herrero et al., 2001).Whereas treated with LPS produce more TNF-a and prostaglandin I than those from young animals(Tang et al., 2000)These results suggest that aged macrophages don’t work normally as young,further studies to clearify the phenotypic alteration and disclose the key molecular mechanisms of macrophage in aging state are very appreciated. Concluding remarks Macrophages,Inflammation ,CAD.pdf
2687 次阅读|0 个评论
[转载]fopen /open,read/write和fread/fwrite区别
linpandr 2012-3-8 20:35
fopen /open,read/write和fread/fwrite区别 转载URL: http://hi.baidu.com/%B9%C8%C9%F1%B2%BB%CB%C0jdp/blog/item/c9cf550bf6c5d1c33ac7639c.html fopen /open 区别 UNIX 环境下的 C 对二进制流文件的读写有两套班子: 1) fopen,fread,fwrite ; 2) open, read, write 这里简单的介绍一下他们的区别。 1. fopen 系列是标准的 C 库函数; open 系列是 POSIX 定义的,是 UNIX 系统里的 system call 。 也就是说, fopen 系列更具有可移植性;而 open 系列只能用在 POSIX 的操作系统上。 2. 使用 fopen 系列函数时要定义一个指代文件的对象,被称为 “ 文件句柄 ” ( file handler ),是一个结构体;而 open 系列使用的是一个被称为 “ 文件描述符 ” ( file descriptor )的 int 型整数。 3. fopen 系列是级别较高的 I/O ,读写时使用缓冲;而 open 系列相对低层,更接近操作系统,读写时没有缓冲。由于能更多地与操作系统打交道, open 系列可以访问更改一些 fopen 系列无法访问的信息,如查看文件的读写权限。这些额外的功能通常因系统而异。 4. 使用 fopen 系列函数需要 "#include sdtio.h" ;使用 open 系列函数需要 "#include fcntl.h" ,链接时要之用 libc ( -lc ) 小结: 总的来说,为了使程序获得更好的可移植性,未到非得使用一些 fopen 系列无法实现的功能的情况下, fopen 系列是首选。 read/write 和 fread/fwrite 区别 1,fread 是带缓冲的 ,read 不带缓冲 . 2,fopen 是标准 c 里定义的 ,open 是 POSIX 中定义的 . 3,fread 可以读一个结构 .read 在 linux/unix 中读二进制与普通文件没有区别 . 4,fopen 不能指定要创建文件的权限 .open 可以指定权限 . 5,fopen 返回指针 ,open 返回文件描述符 ( 整数 ). 6,linux/unix 中任何设备都是文件 , 都可以用 open,read. 如果文件的大小是 8k 。 你如果用 read/write ,且只分配了 2k 的缓存,则要将此文件读出需要做 4 次系统调用来实际从磁盘上读出。 如果你用 fread/fwrite ,则系统自动分配缓存,则读出此文件只要一次系统调用从磁盘上读出。 也就是用 read/write 要读 4 次磁盘,而用 fread/fwrite 则只要读 1 次磁盘。效率比 read/write 要高 4 倍。 如果程序对内存有限制,则用 read/write 比较好。 都用 fread 和 fwrite, 它自动分配缓存 , 速度会很快 , 比自己来做要简单。如果要处理一些特殊的描述符 , 用 read 和 write, 如套接口 , 管道之类的 系统调用 write 的效率取决于你 buf 的大小和你要写入的总数量,如果 buf 太小,你进入内核空间的次数大增,效率就低下。而 fwrite 会替你做缓存,减少了实际出现的系统调用,所以效率比较高。 如果只调用一次 ( 可能吗 ?) ,这俩差不多,严格来说 write 要快一点点 ( 因为实际上 fwrite 最后还是用了 write 做真正的写入文件系统工作 ) ,但是这其中的差别无所谓。 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 本文出自: http://kshaojun.cool.blog.163.com/blog/static/12993731220099201193045/ 当某个程序打开文件时,操作系统返回相应的文件描述符,程序为了处理该文件必须引用此描述符。所谓的文件描述符是一个低级的正整数。最前面的三个文件描述符(0,1,2)分别与标准输入(stdin),标准输出(stdout)和标准错误(stderr)对应。因此,函数 scanf() 使用 stdin,而函数 printf() 使用 stdout。你可以用不同的文件描述符改写默认的设置并重定向进程的 I/O 到不同的文件。 因此若我们要访问文件,而且我们用的调用的函数又是write,read,open和close时,我们就必须用到文件描述符(一般文件从3开始)。当然若调用的函数是fwrite,fread,fopen和fclose时就可以绕开文件描述符,与他们对应的则是文件流。 注意:若用open打开或者是创建一个文件时,open函数此时会返回一个文件描述符,此时该文件描述符只能用于write或者是read,不能在某个函数里面同时用同一个文件描述符来供write和read调用,除非调用了close关闭了该文件描述符。 1、首先说什么是文件描述符,它有什么作用? 文件描述符是一个简单的整数,用以标明每一个被进程所打开的文件和socket。第一个打开的文件是0,第二个是1,依此类推。Unix 操作系统通常给每个进程能打开的文件数量强加一个限制。更甚的是,unix 通常有一个系统级的限制。 因为squid 的工作方式,文件描述符的限制可能会极大的影响性能。当squid 用完所有的文件描述符后,它不能接收用户新的连接。也就是说,用完文件描述符导致拒绝服务。直到一部分当前请求完成,相应的文件和socket 被关闭,squid 不能接收新请求。当squid发现文件描述符短缺时,它会发布警告。 在运行./configure 之前,检查你的系统的文件描述符限制是否合适,能给你避免一些麻烦。大多数情况下,1024 个文件描述符足够了。非常忙的cache可能需要4096或更多。在配置文件描述符限制时,我推荐设置系统级限制的数量为每个进程限制的2 倍。 2、怎么突破,具体方法? 先查看LINUX默认的文件描述符: # ulimit -n 1024 我们用命令 ulimit -HSn 65536 来增大文件描述符,然后编译安装squid, 把ulimit -HSn 65536放到/etc/rc.d/rc.local让启动时加载。 以下为转载: Linux 在Linux 上配置文件描述符有点复杂。在编译squid 之前,你必须编辑系统include 文件中的一个,然后执行一些shell 命令。请首先编辑/usr/include/bits/types.h 文件,改变__FD_SETSIZE 的值: #define _ _FD_SETSIZE 8192 下一步,使用这个命令增加内核文件描述符的限制: # echo 8192 ; /proc/sys/fs/file-max 最后,增加进程文件描述符的限制,在你即将编译squid 的同一个shell 里执行: sh# ulimit -Hn 8192 该命令必须以root 运行,仅仅运行在bash shell。不必重启机器。 使用这个技术,你必须在每一次系统启动后执行上述echo 和ulimit 命令,或者至少在squid 启动之前。假如你使用某个rc.d 脚本来启动squid,那是一个放置这些命令的好地方。 补充: 文件描述符 是个很小的正整数,它是一个索引值,指向内核为每一个进程所维护的该进程打开文件的记录表。 文件描述符的优点:兼容POSIX标准,许多 Linux 和 UNIX 系统调用都依赖于它。 文件描述符的缺点:不能移植到UNIX以外的系统上去,也不直观。 基于文件描述符的输入输出函数: open:打开一个文件,并指定访问该文件的方式,调用成功后返回一个文件描述符。 creat:打开一个文件,如果该文件不存在,则创建它,调用成功后返回一个文件描述符。 close:关闭文件,进程对文件所加的锁全都被释放。 read:从文件描述符对应的文件中读取数据,调用成功后返回读出的字节数。 write:向文件描述符对应的文件中写入数据,调用成功后返回写入的字节数。 ftruncate:把文件描述符对应的文件缩短到指定的长度,调用成功后返回0。 lseek:在文件描述符对应的文件里把文件指针设定到指定的位置,调用成功后返回新指针的位置。 fsync:将所有已写入文件中的数据真正写到磁盘或其他下层设备上,调用成功后返回0。 fstat:返回文件描述符对应的文件的相关信息,把结果保存在struct stat中,调用成功后返回0。 fchown:改变与打开文件相关联的所有者和所有组,调用成功后返回0。 fchmod:把文件描述符对应的文件的权限位改为指定的八进制模式,调用成功后返回0。 flock:用于向文件描述符对应的文件施加建议性锁,调用成功后返回0。 fcntl:既能施加建议性锁也能施加强制性锁,能建立记录锁、读取锁和写入锁,调用成功后返回0。 dup:复制文件描述符,返回没使用的文件描述符中最小的编号。 dup2:由用户指定返回的文件描述符的值,用来重新打开或重定向一个文件描述符。 select:同时从多个文件描述符读取数据或向多个文件描述符写入数据。 3.底层函数简单说明 1)write #include unistd.h size_t write(int fildes,const void *buf,size_t nbytes); 参数说明: fildes:与文件相对应的文件描述符,可通过调用open函数获取 buf:存放将写入文件的数据,可以是字符串,也可是其他数据。其中buf是指向字符串的指针 nbytes:需写进文件的字节数 返回值: -1:写入失败 0:写入0个字节 x:已写入x个字节 1)read #include unistd.h size_t read(int fildes,char *buf,size_t nbytes); 参数说明: fildes:文件描述符 buf:存放从文件中读取的数据 nbytes:希望读取的直接数 返回值: -1:读取失败 0:读取0个字节 x:已读取x个字节 3)open #include fcntl.h #include sys/types.h #include sys/stat.h int open(const char *path,int oflags); int open(const char *path,int oflags,mode_t mode); 参数说明: path:文件存放路径,比如文件ksj.c位于/home/ksj,则path="/home/ksj/ksj.c"; oflags:打开方式。取值如下: O_RDONLY:以只读方式打开,O_WRONLY:以只写方式打开,O_RDWR:以读写方式打开 oflages参数中还包括下列可选模式的组合(用按位或操作) O_APPEND:把写入数据追加在文件的末尾 O_TRUNC:把文件长度设为0,丢弃已有的内容 O_CREAT:如果需要,就按参数mode中给出的访问模式创建文件 O_EXCL:已O_CREAT一起使用,确保调用者创建出文件 mode:当用open创建文件时,可包含该参数,像系统说明该文件的归属及权限。该部分内容太多了,不想写了,详细资料大家自己上网查把,或者查看《Linux程序设计》第84页。呵呵 4)close #include unistd.h int close(int fildes); 参数: fildes:文件描述符 返回: success:0 fail:-1 4.几个函数之间的简单区别 1)write和fwrite A:write用的是文件描述符,fwrite用的是文件流 B:write是将数据写入文件,而fwrite是将数据写进文件流 2)read和fread A:read用的是文件描述符,fread用的是文件流 B:read是从文件中读取数据,而fread是从文件流中读取数据 3)fgetc和getchar #include stdio.h int fgetc(FILE *stream); int getc(FILE *stream); int getchar(); int fputc(int c FILE *stream); int putc(int c,FILE *stream); int putchar(int c); 区别:fgetc是从文件流中读取下一个字符 getchar则是从标准输入中读取下一个字符,标准输入可以是我们的终端 fputc与putchar的区别与上面类似;
3835 次阅读|0 个评论
[转载]open vs fopen
linpandr 2012-3-8 19:28
fopen使用堆分配了一定数量的内存,当你用fprintf、putc等函数时,它 们先将要写的内容填入该内存区,填满了就FLUSH,真正地写入文件(当然, 这不是刷新磁盘缓冲),即调用INT 21,相当于执行write等函数。 而open呢,是直接调用INT 21,相应的读写函数write、read等也都是直 接调用INT 21。 在实际应用中,有这样两种情况: 一、数据是大批大批地读写的,例如每次0.5K、1K、2K等。调用open会 直接一点,可以省去类似fprintf等函数的一些开销。 二、数据是很零散的。例如整型数、长整型数、字符串、浮点数等说不 定要写些什么数据进去。如果一定要使用open + write。那么就得先 sprintf( buf, format, ... ),然后将buf write到文件中,这样频繁 地调用INT 21,将会浪费很多时间。这时使用fprintf( FILE, format,...) 反而更好了。 以上说的是在DOS下的情况,至于WINDOWS下及UNIX下是不是也有类似的区 别,我不太清楚(再说象WINDOWS这样,常常是希望用户“不拘小节”的)。 (一) 1.缓冲文件系统 缓冲文件系统的特点是:在内存开辟一个“缓冲区”,为程序中的每一个文件使用,当执行读文件的操作时,从磁盘文件将数据先读入内存“缓冲区”, 装满后再从内存“缓冲区”依此读入接收的变量。执行写文件的操作时,先将数据写入内存“缓冲区”,待内存“缓冲区”装满后再写入文件。由此可以看出,内存 “缓冲区”的大小,影响着实际操作外存的次数,内存“缓冲区”越大,则操作外存的次数就少,执行速度就快、效率高。一般来说,文件“缓冲区”的大小随机器 而定。 fopen, fclose, fread, fwrite, fgetc, fgets, fputc, fputs, freopen, fseek, ftell, rewind等 2.非缓冲文件系统 缓冲文件系统是借助文件结构体指针来对文件进行管理,通过文件指针来对文件进行访问,既可以读写字符、字符串、格式化数据,也可以读写二进制数 据。非缓冲文件系统依赖于操作系统,通过操作系统的功能对文件进行读写,是系统级的输入输出,它不设文件结构体指针,只能读写二进制文件,但效率高、速度 快,由于ANSI标准不再包括非缓冲文件系统,因此建议大家最好不要选择它。本书只作简单介绍。 open, close, read, write, getc, getchar, putc, putchar 等 (二) open和fopen的区别: 前者属于低级IO,后者是高级IO。 前者返回一个文件描述符(用户程序区的),后者返回一个文件指针。 前者无缓冲,后者有缓冲。 前者与 read, write 等配合使用, 后者与 fread, fwrite等配合使用。 后者是在前者的基础上扩充而来的,在大多数情况下,用后者。 1、 open 是系统调用 返回的是文件句柄,文件的句柄是文件在文件描述副表里的索引, fopen 是C的库函数,返回的是一个指向文件结构的指针。 2、 fopen 的实现要调用open, 关键看你想返回什么了, FILE指针还是描述符? 3、 32位环境下,编译加“-D_FILE_OFFSET_BITS=64” 要在open里加O_LARGEFILE标记 static int ext2_open_file (struct inode * inode, struct file * filp) { if (!(filp-f_flags O_LARGEFILE) inode-i_size 0x7FFFFFFFLL) return -EFBIG; return 0; } 0x7FFFFFFF就是2G-1。 看一下这个逻辑, 就知道open时必须制定O_LARGEFILE. 4、 fopen 一个文件,fclose两次,会是什么样的情况? 本人测试了一下: 在aix,hp,sco,unixware上fclose第一次成功,fclose第二次返回错误 在linux上.fclose第一次成功,第二次报segmentation fault,程序吐核 5、 计算机语言遵循的规范称为标准。C语言有C标准,C++语言有C++标准。标准中详细规定了你能够做什么和不能做什么。标准中规定不能做的就是我说的标准的禁止事项。 其实不只是标准,在介绍学习或使用语言的书中也会出现大量的应该做和不应该做的说明,只是一般不可能象标准那样全面。所以,在“The C Programming Language”中没有提到这个未定义行为也没有什么奇怪的。 "程序员基本职责"?…… 可以认为是为了实现程序预定的目的,对程序员的基本要求。在使用语言上的一个基本要求就是要符合标准规定。 还有一个问题 在非linux系统下,我使用 fopen 打开的文件 使用close关闭(注意,不是fclose),缓冲也相应关闭; 而在linux系统下,如果使用close关闭,结果缓冲还残留在内存中. 这个是不是说明linux 不支持标准? 如果用 close 来关闭一个缓冲文件,其行为是未定义的。因为 close 并不能保证刷新缓存,所以 fclose != close,不过可以这样认为:fclose = fflush + close。 既然 close 用 fopen 打开的文件是一种未定义行为,就是说标准没有规定这样会导致什么行为,所以结果导致缓冲刷新也罢不刷新也罢,这样的行为都是合法的,编译器可以自由实现。 由于未定义行为是标准规定的禁止在程序中出现的行为,所以一般没有必要再去讨论未定义行为到底有什么、或者有哪些具体的表现。 那我觉得linux下编译的过程中就应该发出警告,fclose两次是未定义的,有潜在危险 想 法是不错的。只不过未定义行为不是语法错误,在编译阶段一般是发现不了的,或者实现起来相当困难,只好推移到运行阶段、借助于程序的行为异常来发现这些错 误。比如,fclose两次、除数为0、悬挂指针等带来的行为。当然,也可能因在运行时程序表现正常而发现不了这些错误。这就要求我们在写程序的时候就要 尽量处理好,不要出现未定义的行为。对于编译器而言呢,我们希望它会以一种尽量“醒目”的方式提示我们,因此编译器在对未定义行为的实现上其实是有自己的 考虑的。 具体fclose两次是未定义的,这个是posix标准还是ansc c标准呢? 从 man fclose 中可以看出,这是一个ansc c标准规定的函数。这就意味着它又是一个 posix 标准的函数。posix就是在 ANSI C (C89)基础上实现的,包括了 ANSI C 的全部规定。 但是我觉得一个标准是符合人们的习惯的,那就是如果我去调用一个库函数, 那么这个库函数只有一个出口就是返回值,而现在又出现另外的出口:SEGV信号 1. void函数没有返回值。2. 除了函数的返回值之外函数的参数也可以作为出口。 运行时出现了SEGV说明程序中存在错误。其根本原因在于程序员在程序中使用了未定义行为从而违反了标准所致。 6、 值得一提大家经常可能会遇到的就是strcpy这个函数,如果参数中有NULL值, 例如:strcpy(NULL,"aa") 很快就引起一个段错误. 现在软件要求的不仅仅是效率,那么对于这种情况我们该如何避免这种错误呢? 更多情况下我们使用变量copy,如strcpy(char *str1,char *str2); 为了避免错误,我们可能会在每次copy前判断 if(str1!=NULL) strcpy(str1,str2); 我并不觉得这样很麻烦,但是我们万一有个疏忽,某次忘记了 不就造成大错了吗? 解决办法是我们要在原来c库的基础上进行我们的包装 写一个自己的类库,例如改装成 my_safe_strcpy(char *,char *); 但是这样的做法好象不太多见,大家都是直接使用c的库就OK; 7、 int setvbuf(FILE *stream, char *buf, int mode , size_t size); 把缓冲区与流相联,通过改变buf的大小,的确能改变 fopen 打开的流按系统默认buffer输出。 8、 前者属于低级IO,后者是高级IO。 前者返回一个文件描述符,后者返回一个文件指针。 前者无缓冲,后者有缓冲。 前者与 read, write 等配合使用, 后者与 fread, fwrite等配合使用。 后者是在前者的基础上扩充而来的,在大多数情况下,用后者。 9、 好象是 fopen 返回给fp的值有问题 因为这个所以导致fclose的时候coredump
2032 次阅读|0 个评论
[转载] how to write a paper (one possible answer)
zuojun 2011-11-14 08:10
Use the link below, if you can: http://blogs.nature.com/nyc/2011/08/10/how-to-write-a-paper-one-possible-answer ? Posted by chris wiggins on Aug 10, 2011 how to write a paper a student recently asked me how to write a paper. here's an algorithm i'd suggest, with plenty of room for an individual to deviate. punchline(s) nickname *figures *references outline abstract (w) intro and outtro (w) middle show definite coauthors show possible coauthors acknowledgements title code submit and post punchline(s) readers, reviewers, and you in 5 years are going to want to have some pithy way of remembering that paper. what is the "main result"? what did you learn? if answering this takes a long time, maybe you don't understand the subject well yet, or maybe it's really 2 papers. nickname most of the projects i work on have a nickname for the project. sometimes it's just the name of the cvs/svn/github repository. it helps you and your collaborators define a bite-size quantum of research. figures decide what figures are necessary to illustrate the punchline. decide which are going in the mansucript and which in supplementary material. the * indicates that this is how people read the paper -- they'll skim the figures and references first references decide who you should cite to support the argument and set the background/context. see above for *. someone i know once said to me that the first thing she or he reads in a paper is the references to see if she or he is cited. i'm still not sure if she or he was serious. outline next write an outline. seriously you need to do this. don't just sit down and start writing stuff. abstract now you are allowed to write the abstract (w) intro now write the beginning of the paper. the (w) indicates that htis is the part of the alogirhtm most people think of when they think of "writing a paper" (w) outtro now write the conclusions, what you showed, what you'd like to do in subsequent papers, where to find the source code. (w) middle now write the rest show definite coauthors if you haven't already, make sure you show to people who are going to be coauthors show possible coauthors if you haven't already, show it to people who may or may not want to be coauthors. be generous acknowledgements think about everyone who helped you and funded you. be generous. also people from the above section who elected not to be coauthors should be acknowledged title code if your work is computational (including modeling and statistical work), upload all code + data to a neutral, 3rd party site (e.g., code.google.com, github.com, sourceforge.net ). For more on this see this blog post or this talk or this roundtable . submit post to arxiv.org I'm not sure which is supposed to come first, but it seems reasonable to me that one submit to the journal and, as soon as possible thereafter, post to arxiv.org, with a note saying "submitted for publication" in the comment field.
个人分类: Scientific Writing|1952 次阅读|0 个评论
[转载]how to write a paper
热度 1 liangrui 2011-10-11 16:53
很不错的建议,跟大家分享一下。 writing-a-paper.rar
个人分类: how to write a paper|2653 次阅读|1 个评论
科学网的好博文也要“两性”兼备!
热度 12 wsyokemos 2011-6-3 20:46
近日我写了一篇标题为 好论文的标准:“两性”兼备 的博文,赚了不少点击,也有不少网友参与评论,其中有一位半开玩笑的说我的这篇博文也是“两性”兼备,这便引出了本文的话题:好博文,尤其是科学网的好博文也要“两性”兼备! 在上述博文中,我提到:好论文的标准中的 “两性”兼备是指 新颖性、有趣性 / 可读性。当然,不可否认,正如有的网友指出,这所谓的“两性”,应该是指“三性”,这个涉嫌玩标题党的标题当初也是为了吸引眼球。说 “两性”兼备,可能有许多人感兴趣,但是如果换成“三性” 兼备,我估计许多人就兴(性)趣寡淡了。我个人认为:上述博文似乎可以作为一个很好的例子可佐证本文我的主要观点:科学网的好博文也要“两性”兼备。下面会进一步分析,但是首先需要强调的是:我所认为的好博文的“两性”兼备和好论文的“两性”兼备不尽相同。 好博文的“两性”,我认为最重要的是要 : 科学性 + 有趣性 ,和好论文对 新颖性(创新性)的要求不同,写博文毕竟不是发表论文,对于新颖性要求不高。下面就具体谈谈为何科学性和有趣性是科学网好博文的 缺一不可的必要条件,并且这两点几乎又是好博文的充分条件。 “科学性” :毫无疑问,只要是真正的好论文,“科学性”那是必须的,对于“科学”网上的好博文而言,我觉得也需要有“科学性”,因为对于科学网上的网友,我相信大多数都有看具有科学性的文章的心理预期,热衷于八卦、情色、掐架、明星新闻的网友估计不会想着要来科学网搜搜、看看。为了迎合这种心理预期(这种“迎合”,似乎比一般的曲意迎合还是上了点档次),科学网的博文也有必要多少有点“科学性”。当然这个科学性的涵义,我个人认为需要适当外延,因为有些看起来和“科学”不大沾边的博文,比如有些摄影类的博文,似乎和科学有点距离,但是有些摄影高手,比如以科学网博主李学宽和孟津等老师为代表的一批高手,尽管他们不是职业摄影家,但是照片拍的却很有专业水准,所配图片的介绍和解释也往往妙趣横生,可以说和图片相得益彰,真正是图文并茂,在我看来,这类的博文的科学性同样很强,可以说是“很猛、很强大”。反之,有些看起来很有科学性的博文,但是文章本身笔误很多,或者文章有学术性的硬伤,再加上写的又无趣,自然算不上好博文。但是,如果一篇博文,只是为了有趣而有趣,插科打诨,而没有任何科学性可言,则同样算不上好博文,至少应该算不上科学网的好博文,毕竟科学网不是小品、相声的集中营。 有趣性 :在博文有科学性的前提下,好博文要写的有趣,有趣并不意味着简单地搞笑,但是幽默风趣无疑会为博文增色,当然,我所理解的有趣性,还在于博主能够以引人入胜的方式表达自己的观点或者讲述自己的故事,所以博文要能吸引读者读下去,除了和文章本身内容有关,也更与作者如何写自己的博文有关。科学性再高的博文,如果读者压根就没有兴趣读下去,也是枉然。我觉得一个好的博文,首先要有一个好的吸引人眼球的标题,不谦虚的说,我自认为我的大多数博文的标题还算比较吸引人,我在写每一篇博文时,我的博文题目都会仔细考虑一下,以尽可能在反映文章内容的前提下,尽量更有趣。在现在这个几乎人人是博客写手的今天,要想有更多的读者点击阅读自己的博文,扩大影响,首先要有一个好的标题。 在科学网,科学性与有趣性兼备的博文有很多,这方面难捏的很好的博主也有不少,我个人认为这其中的出色代表之一为李福洋老师,他的一系列有关科普的博文大都堪称科学性与有趣性的完美结合,可以说是科学网博文中的精品中的精品。另外,我不知道科学网编辑的精选、置顶博文的标准具体是什么,但从过去近两个月的经验来看,科学网编辑们认为的好博文似乎也基本符合上述的“两性”标准。 另外,顺便谈点题外话,有些网友在我的博客留言或评论说我的博文篇篇被精选,这实在是抬举我了,我在科学网开博近两个月来,已写(包括以前在别的博客写的)博文 40 余篇,尽管大多数蒙科学网编辑抬爱被精选(其中一些甚至被置顶推荐),但是还有一些未被精选,在此澄清一下。还需要说明的是,尽管我的大多数博文被精选,但是我一没有给科学网编辑 MM 送过花,二没有给科学网编辑 GG 喝过酒。另外,我更想强调的是:我写博文并非是为了被精选(尽管被精选是令人高兴的事),如果只是为了被精选,写博文估计就没有多少乐趣了,我写博文最大原因或者因素是兴趣,写自己感兴趣的话题,写作过程本身就是一件愉快的事情,看到自己写的博文,尤其是关于英文论文写作方面的博文,对于年轻研究生们有点帮助,自然觉得很欣慰,从而也觉得自己是有福气之人,因为正如圣经所言:“给比受更有福”。 写博文最令我感到高兴,或者说最有收获的地方是:当自己写的博文贴出后, 有网友有精彩评论(这样的评论往往比我写的博文本身好的多)或者指出我的博文中学术上/科学上的硬伤/错误,从而自己得以学习和提高。这样的例子,对于我而言可以说是不胜枚举,其中一个例子:比如我在一篇涉及诺贝尔奖的博文中(点击参见: 全球史上被引用次数最多的论文—兼议诺贝儿奖 ) ,曾提到 田中耕一 ,在我的博文原文中曾有一句话“ 田中耕一 只有本科学历,这是诺贝儿奖百年历史上首次也是迄今唯一一次颁发给一个是只有本科文凭的科学家”,有位网友就质疑这句话,提出“ Please check Guglielmo Marconi, 1909 laureate for physics ”, Marconi 即为发明电报的马可尼, 1909 年获诺贝尔物理奖,我在网上一查(包括诺贝尔基金会官方网站),果然马可尼基本就没有接受过多少正规的学校教育,主要靠家庭(尤其是其母亲)教育。当然,我原文中那句对 田中耕一 的表述并非是自己的猜测,也是有根据的,在英文维基百科上关于 田中耕一 的介绍中有这么一句:“ As of 2008, he is the only person without a post-bachelor's degree to have won a Nobel Prize in a scientific field ”。而我的那篇博文对 诺贝尔奖的讨论只限科学类奖项,并且 2009, 2010 年 诺贝尔科学类三大奖的得主,都读过研究生,所以我才得出上述对 田中耕一 的错误论述,这件事,也看出维基百科的不靠谱之处,不过,瑕不掩瑜,维基百科的好处和优点还是要远远大于其不足之处。 当然,在这位网友质疑后,我根据自己的进一步网上查询结果,确定自己是错误之后,就立刻更正自己的博文,并致歉,我和那位网友也互相加为好友。但是在科学网上,我也看到有些博主,在别人对自己的博文提出质疑之后,或者死不认帐,或者对指出错误的网友冷嘲热讽,我觉得这样,一是表现出对自己、对自己博文没有足够的自信,也使自己丧失了非常好的学习、进步的机会。这一段,我这样说,并非想表明自己是多么的 NB 或者境界高 , 而是认为科学网的博客也可以(也应该)成为大家相互切磋、学习提高的平台。事实上,我最近就斗胆对一位博主的英文博文指出一些明显的错误,该博主不但不没有表现出反感,还对我的评论意见表示感谢,并对博文做了相应修改,还主动加我为好友,这种经历我是第一次,因为我即使看到别人的博文有错误,也不愿指出,怕别人不高兴,但我相信:像上述这位虚心的博主应该是科学网的主流和大多数。 当然,我写博文,并非都是上述愉快的经历,不爽的事情也发生过,科学网有位大侠级的博主曾提到,赞扬型的博文可称为“献花”,批评性博文可称为“放炮”,我就曾经写过一篇多少有点“放炮”性质的有关大学排名的博文,这篇博文,我尽管只是用数据说话,这通“放炮”还是炸着了自己,如同捅了马蜂窝,引来了不少谩骂和人身攻击,我当然没有对这些人以牙还牙,我觉得骂人不但伤害了别人还伤害了自己,甚至还会累及自己的母校或者工作单位(即使是匿名评论,留下的 IP 地址也大致暴露了自己的身份) 。最后,由于这些人坚持不懈地谩骂和攻击,该博文不得不被迫关闭了评论功能,这也是迄今为止,我的博文中唯一关闭了评论功能的。然而,这个不爽的经历也让我至少有两点收获:1)更加容易知足:现在写博文,只要不挨骂,我就很知足了;2)人人都喜欢别人“献花”,不喜欢被别人“放炮”,所以,我决定:以后多“献花”,少、乃至不“放炮”,“放炮”多了,是否炸了别人倒不一定,受伤的首先是自己。毕竟,正如一位博主所言,写博文,博的就是“心情”!有人将谩骂和人身攻击型的评论比喻为自己后花园的一坨 shi ,如果天天出门看到这玩意,还有心情写博文?! 对上述 “两性”兼备话题之外的跑题,深表歉意! ( 王守业写于 2011 年 6 月 3 日,图片来自网络,感谢作者。未经允许,请勿转载)
个人分类: 乱弹杂谈|10224 次阅读|25 个评论
明明白白才是真: how to write a scientific paper clearly?
热度 11 wsyokemos 2011-5-26 20:08
在写此文前,偶然看到徐罡博士的博文: “ 英文论文撰写的 3C 原则,并感谢导师的教诲 ” (现在有的博文还提出 5C 原则),这 3C 分别是 Clear, Concise, and Critical ,有兴趣的网友可 点击查看看其博文 。我觉得这 3C 中 Clear 尤为重要,下面就详述原因(主要表现在两个方面)。 许多(如果不是绝大多数)科学家喜欢在实验室做实验,但是却讨厌写论文,其实事实上,写论文至少和做实验同样重要。撰写一篇清楚明了 (clear) 的论文对你的读者和你自己都是重要的。 “Write clearly” 是为了确保你的读者明白你的信息。作为作者,在写论文之前,最好先换位思考,作为一个读者,你想读到什么样的论文呢?很可能是短小、精悍、清楚明了的论文!事实上这样的文章才最有可能为读者所理解。你可以设想一下你的文章的可能的读者,当然最可能的是你的研究领域内的同行,但也不限于此,潜在的读者可能从刚从事科研的研究生到诺贝尔奖获得者,并且还要注意,读者还很有可能像你我一样来自非英语国家。所以你的文章要保证不但使英语国家的你研究领域内的同行可以很容易理解,还要使领域外的外行能够理解。另外,读者们也不会都在精神百倍的时候读你的文章,他/她可能是飞机上、公交车上、或在昏昏欲睡的深夜。因此,可以想象,使上述的读者都能在他们半清醒的状态下读你的文章时,还不至于不理解或误解你的文章,对作为作者的你显然是个挑战,但是你如果想让你的读者清楚无误的明白你的文章信息,你不得不使你的文章足够的让人明白。 但是, clarity 的标准是什么呢?套用公元一世纪的罗马修辞学家昆体良( Quintilian )的一句话: “ Clear writing is writing that is incapable of being misunderstood ” 。 也就是说 ”clear writing” 就是要不能被误解,这显然比能被理解是更高的标准。另一方面, “write clearly” 不仅仅是为了确保你的读者明白你的信息,同时也可以使你自己更加理清你的思路和想法。很多人认为,只要自己知道自己想说什么,将其写下来即可,但事实往往并非如此。写作可以帮助你发现你到底想表达什么。当你写论文时,你会经常发现你的思路方向变了,你可能最终回答了一个和你当初提出的有些不同的一个问题。这种思路的变化是写论文的一个很大的益处(事实上这也是写科学性很高的博文的一个好处)。另外一个好处就是,在你写论文时,可以发现错误的推理,因为当你读了你所写的,你将会发现一些问题,比如逻辑上前后不一致等等。这些问题迫使你重新考虑到底想表达什么。 因此,至少有两个很好的理由使你想 write clearly ,第一:确保你自己知道想表达什么;第二:使你的文章信息能使多种背景的读者都明白。所以 write clearly 确实很重要,如果说许多写论文的技巧都是像云雾一样令人捉摸不定,那么写的 “ 明白的 ” (请注意:此处采用东北话发音)才是真谛,正如那句名言所云: “ 明明白白才是真 ” 。 [注:以上部分编译自一本专著 (1) ] 那么到底如何才能 write clearly ,有个网站 ( 点击参考: How to Write Clearly - The 10 Most Important Principles ) 提出了十项原则(够多的!我党也才只是提出了四项基本原则) , 个人觉得非常好,实录如下,并补充一下自己的一点体会: 1. Use Short Sentences . 我们中国作者在英语的一个很大优势就是语法很强,所以往往句子写的很长,还没有语法错误,我最长就曾写过长达四、五行的一个句子。这种句子,读者和审稿人读起来会非常费劲,一定要避免,尽量使一句话只有 10-20 个单词。我们写论文的目的只是为了让审稿人和读者明白自己文章本身的内容,不是为了显摆自己的英语如何的 NB, 就算牛,作为来自非英语国家的老中,还能玩得过人家老美、老英?! 2. Prefer the Simple to the Complex . 就是尽量用一些简单的词,别玩一些偏僻词,整得自己很有学问似的,其实老美,尤其是平常说话,用的基本都是非常简单的常用的词,但是很有沟通效果,也很生动。 3.Prefer the Familiar Word . 这个就无需多说了,当然用自己熟悉的词,不熟悉,我们也搞不定啊。 4. Avoid Unnecessary Words. 避免不必要的词,这一点很有必要,因为有的期刊是按字数收出版费的,另外文章的总字数,许多 SCI 国际期刊都有具体的不同规定和限制。 5. Use Action Verbs . 即尽量用动词,比较: "He drove very fast down the road." 和 “He sped down the road". 为何后者更好?! 6. Write as you Talk . 就是说写论文要像平常说话一样让人通俗易懂,别故弄玄虚(参见文后11楼的评论) 。 7. Use Terms your Reader Can Picture . 别用太抽象的词 . 8. Connect with your Reader's Experience . 换位思考,上面已经详述。 9. Use Variety . 同一个意思,变换说法,别太单调。 10 .Write to Express not Impress . It is still all too often the case that people resort to unfamiliar, long words and meandering prose, especially when making formal announcements. Policemen say, "the thief was apprehended", not, "We caught the thief". Notices say, "Please refrain from smoking", rather than, "Please do not smoke". Nobody actually uses the word 'refrain' in normal conversation so why use it in a notice? It is done to sound important, make the notice sound official, done to impress, not express. 根据我的理解,简单的说,就是作者写论文要直接表达(Express)自己的意思,而不是拐弯抹角的给读者某种印象(Impress)或含蓄简洁地表达自己的观点或结果/意思,读者没有时间也没有耐心来猜哑谜,套用一句歌词:你的“意思”,我永远不懂!对于写论文,这绝对是要避免的(参见文后8楼的评论)。 参考文献 1. Zeiger M. Essentials of writing biomedical research papers , 2 nd version, Mcgraw-Hill, 2000. 后记:感谢科学网编辑将本文置顶推荐,尤其是感谢将标题中的那点洋文改为 “ 如何让学术论文清楚明了? ” 我当初采用又土又洋的标题,只是由于当时看到的英文专著是那麽说的,没有编辑的文采整成合适的中文标题,即:并非是为何显摆(再说也根本没有资本)。 (王守业草于 2010 年 11 月,修改于 2011 年 5 月 26 日,初稿曾贴于丁香园。必须得承认:本文的原创性不高,很多内容参考了上述的参考文献和网站内容。文中图片来自网络,感谢作者。引文地址: http://blog.sciencenet.cn/home.php?mod=spaceuid=563591do=blogquickforward=1id=448316 )
个人分类: 论文写作|20315 次阅读|17 个评论
how to write an abstract and introduction
limiao12345 2010-6-25 14:39
How to write abstract and introduction for a paper/conference paper: The abstract of a paper or a conference paper is normally one paragraph with 100-400 words. It is normally structured into several sentences. Each sentence should be able to answer the following questions: 1. what is this paper about- a general problem statement 2. Why is this important- what is the significance. This, on the other hand, explains why you conducted the research 3. What has been done before: state-of-the-art. 4. what is the shortcoming in what has been done before, why that is not good 5. What you have done in this research? 6. how that (what you have achieved) improved related to the state-of-the-art Following the above six points, and in this logical order, you should be able to present a very excellent abstract As for the title of the paper: The title of a paper should not be too long, and should not be too specific. it normally has 7 words, (not counting 'of', 'the','a',etc) How to write an introduction: An introduction is an extended version of an abstract, so it should be formulated the same way as the abstract. Instead of stating each of the above-mentioned questions in one or two sentences, an introduction should be able to give more detailed information and provide a profound discussion. For an 8 pages conference paper, the introduction part is normally one page long with 4 paragraphs. to put the answers to the above 6 questions into 4 paragraphs, you need to: v in the first paragraph: what is this paper about general problem background introduction why is this important-this states the significance of you research v in the second paragraph: What has been done before- state-of-the-art. why that is not good enough, the shortcoming The second paragraph in the introduction is actually the literature review. As for how to write a good literature review, I need to learn further more and then come up with some good 'how to', and this part can be in one paragraph or if too much information, then 2 Normally, a paragraph in a formal paper is around 10 lines in a single column A4 paper. A sentence, starting from one full stop until the following next full stop is no longer than 4 lines. you can always use comma ',' to break the sentence (as to where to put the comma, you follow your own feeling when read through it, normally, a adverb clause, phrase, etc), so that readers or reviewers could have a (puff) rest when they find difficulty in absorbing the too-much information in the long sentence. two-line is the normal length, but on the other hand, do not keep all the sentences in two-line length, try to use long and short sentences alternatively (this is not the right word, I am afraid) and use various sentence structures. v in the third paragraph: based on the literature review in the second paragraph, identify the research question, and state what you have done in this study what you have found (your result, contributions what is good about your work) and how that improves/ relates to the current start-of-the-art v In the fourth paragraph: state the organisation/ strucuture of the paper/ framework/outline/or whatever you name it, such as: the reminder of this paper is organised as follows: How to write a conclusion: Most of the time, you will see people put conclusions all in one single paragraph. It is suggested that emphasize each aspect in separated paragraphs or using bulleted list. In conclusion, you do not need to state the general problem again, you can start with a introduction of what you have done in this research, and then use bulleted dots to present the significance of your research, its contributions to the practical problem, the advantages of the proposed method, the superior performance of the model, etc. Start a new paragraph stating the future work or further study. Research never stops at wherever you achieved. Further work shows the continuing work and also the significance of your study, otherwise, there is no point if you will stop doing this topic after this paper. What else can be done to further improve or can this method be applied somewhere else. This should be the final paragraph of the entire paper and it is suggested that you conclude with very strong point, so that the readers or the reviewers finish reading with very good impression. Another point worth mentioning is that always use up the full page limit for a conference, put as much information as you can as long as you can keep the consistence and the cohesion. Keep your paper as a logic story.
个人分类: 博士学习|6075 次阅读|0 个评论
[转载] Nature WEB FOCUS How to write science books
xupeiyang 2010-3-6 10:25
请连接 http://www.nature.com/nature/focus/howtowrite/ How to write science books In this focus Five top science book writers offer advice for budding authors in a series of interviews in Nature 's Books Arts section. Peter Atkins reveals the hard work behind a successful textbook; Carl Zimmer highlights how passion is essential for popular science; David Brin reveals how criticism improves his fiction writing; Georgina Ferry shares research tips for biographies; and Joanna Cole explains how to convey science to children. Image: Alex Staroseltsev/iStockphoto.com Books Arts QA: Joanna Cole on writing science books for kids Free access Joanna Cole has authored more than 100 science books for children, including the best-selling Magic School Bus series, the latest edition of which tackles the topic of climate change. In the last of our series of interviews with authors who write science books for different audiences, Cole reveals how clarity and colour can introduce even very young children to science. Nature 464 , 36 (4 March 2010) :10.1038/464036a :10.1038/464036a Full Text | Books Arts QA: Georgina Ferry on writing biography Free access Acclaimed biographer Georgina Ferry has chronicled the lives of two Nobel prizewinning chemists, Dorothy Hodgkin and Max Perutz. In the fourth in our series of five interviews with authors who each write science books for a different audience, Ferry reveals how detachment is needed to turn an attic's worth of personal letters into a compelling story. Nature 463 , 1025 (25 February 2010) :10.1038/4631025a :10.1038/4631025a Full Text | Books Arts QA: David Brin on writing fiction Free access After obtaining a PhD in planetary physics, David Brin found that he could make a better living as a science-fiction novelist than a researcher. In the third in our series of five interviews with authors who each write science books for a different audience, Brin reveals that criticism and a thick skin are the keys to good creative writing. Nature 463 , 883 (18 February 2010) :10.1038/463883a :10.1038/463883a Full Text | Books Arts QA: Carl Zimmer on writing popular-science books Free access Acclaimed essayist Carl Zimmer has eight popular-science books to his name, on topics from parasites and Escherichia coli to evolution. In the second in a series of five interviews with authors who each write science books for a different audience, Zimmer describes how passion breeds popular success. Nature 463 , 737 (11 February 2010) :10.1038/463737a :10.1038/463737a Full Text | Books Arts QA: Peter Atkins on writing textbooks Free access The success of Peter Atkins's classic textbook Physical Chemistry led him to trade research for full-time writing and teaching in the 1980s. In the first of a series of five interviews with authors who each write science books for a different audience, Atkins explains how the rewards for textbooks can be great, but the effort needed can affect your research. Nature 463 , 612 (5 February 2010) :10.1038/463612a :10.1038/463612a Full Text |
个人分类: 学习方法|2287 次阅读|0 个评论
First time to write sth here
waterlilyqd 2009-9-24 16:16
When I searched one article by google, I found the sciencenet and read many good articles. Then I decided to open a blog on the sciencenet too. Today after I searched one friend's information on the net, I then decided to make a detailed plan and work harder. More time on work and work-related things, less time on trivial things. In the past, I wrote many articles (or just pieces) in English. Will I write my blog in English too? Will people have patience to read them? Can I express my idea clearly in English? I am not sure but I'll try. I'll use here as a place to learn from others and improve myself . 第一次在这儿写博,战战兢兢,这里的高人这么多,只有多向他们多学习,多讨教! 连在这里写什么都还没有规划,只是先开博,再根据情况而定吧!采用真名写博确实是需要勇气的。平时在其它地方用一个网名无论怎么胡言乱语都像没事,因为没有人知道我是谁。终于鼓起勇气走出第一步,也算不错吧!
个人分类: Life and Fun|3077 次阅读|0 个评论
How to Write and Illustrate a Scientific Paper
yaoronggui 2009-5-1 13:08
This Second Edition of How to Write and Illustrate a Scientific Paper will help both first-time writers and more experienced authors, in all biological and medical disciplines, to present their results effectively. Whilst retaining the easy-to-read and well-structured approach of the previous edition, it has been broadened to include comprehensive advice on writing compilation theses for doctoral degrees, and a detailed description of preparing case reports. Illustrations, particularly graphs, are discussed in detail, with poor examples redrawn for comparison. The reader is offered advice on how to present the paper, where and how to submit the manuscript, and finally, how to correct the proofs. Examples of both good and bad writing, selected from actual journal articles, illustrate the authors advice which has been developed through his extensive teaching experience in this accessible and informative guide. BJORN GUSTAVII has been teaching courses in scientific writing for doctoral (Ph.D.) students in medicine for 25 years.He brings his personal experience to this book, both from writing more than 100 of his own research papers and from his work as a journal editor. Published date: 2008 Pages: 180 Free Download: Write and Illustrate a Scientific Paper.part1 Write and Illustrate a Scientific Paper.part2
个人分类: 论文写作|6611 次阅读|0 个评论

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

GMT+8, 2024-5-29 20:04

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部