https://www.menie.org/georges/embedded/

需要移植如下两个基础读写函数

int _inbyte(unsigned short timeout);

void _outbyte(int c);

xmodem.c

  1. /*
  2. * Copyright 2001-2010 Georges Menie (www.menie.org)
  3. * All rights reserved.
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the University of California, Berkeley nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27.  
  28. /* this code needs standard functions memcpy() and memset()
  29. and input/output functions _inbyte() and _outbyte().
  30.  
  31. the prototypes of the input/output functions are:
  32. int _inbyte(unsigned short timeout); // msec timeout
  33. void _outbyte(int c);
  34.  
  35. */
  36.  
  37. #include "crc16.h"
  38.  
  39. #define SOH 0x01
  40. #define STX 0x02
  41. #define EOT 0x04
  42. #define ACK 0x06
  43. #define NAK 0x15
  44. #define CAN 0x18
  45. #define CTRLZ 0x1A
  46.  
  47. #define DLY_1S 1000
  48. #define MAXRETRANS 25
  49.  
  50. void _outbyte(int c)
  51. {
  52. while ((readb(UTX1) & 0x20) == )
  53. ;
  54.  
  55. writeb ((char)c,UTX1+);
  56. }
  57.  
  58. void outbyte(int c)
  59. {
  60. static char prev = ;
  61. if (c < ' ' && c != '\r' && c != '\n' && c != '\t' && c != '\b')
  62. return;
  63. if (c == '\n' && prev != '\r') _outbyte('\r');
  64. _outbyte(c);
  65. prev = c;
  66. }
  67.  
  68. int _inbyte(unsigned short timeout) // msec timeout
  69. {
  70. unsigned short c;
  71. int delay = timeout << ;
  72.  
  73. while (((c=readw(URX1)) & 0x2000) == ) {
  74. usleep(); /* 60 us * 16 = 960 us (~ 1 ms) */
  75. if (timeout) {
  76. if (--delay == ) return -;
  77. }
  78. }
  79.  
  80. return c & 0x0FF;
  81. }
  82.  
  83. unsigned short crc16_ccitt( const void *buf, int len )
  84. {
  85. unsigned short crc = ;
  86. while( len-- ) {
  87. int i;
  88. crc ^= *(char *)buf++ << ;
  89. for( i = ; i < ; ++i ) {
  90. if( crc & 0x8000 )
  91. crc = (crc << ) ^ 0x1021;
  92. else
  93. crc = crc << ;
  94. }
  95. }
  96. return crc;
  97. }
  98.  
  99. static int check(int crc, const unsigned char *buf, int sz)
  100. {
  101. if (crc) {
  102. unsigned short crc = crc16_ccitt(buf, sz);
  103. unsigned short tcrc = (buf[sz]<<)+buf[sz+];
  104. if (crc == tcrc)
  105. return ;
  106. }
  107. else {
  108. int i;
  109. unsigned char cks = ;
  110. for (i = ; i < sz; ++i) {
  111. cks += buf[i];
  112. }
  113. if (cks == buf[sz])
  114. return ;
  115. }
  116.  
  117. return ;
  118. }
  119.  
  120. static void flushinput(void)
  121. {
  122. while (_inbyte(((DLY_1S)*)>>) >= )
  123. ;
  124. }
  125.  
  126. int xmodemReceive(unsigned char *dest, int destsz)
  127. {
  128. unsigned char xbuff[]; /* 1024 for XModem 1k + 3 head chars + 2 crc + nul */
  129. unsigned char *p;
  130. int bufsz, crc = ;
  131. unsigned char trychar = 'C';
  132. unsigned char packetno = ;
  133. int i, c, len = ;
  134. int retry, retrans = MAXRETRANS;
  135.  
  136. for(;;) {
  137. for( retry = ; retry < ; ++retry) {
  138. if (trychar) _outbyte(trychar);
  139. if ((c = _inbyte((DLY_1S)<<)) >= ) {
  140. switch (c) {
  141. case SOH:
  142. bufsz = ;
  143. goto start_recv;
  144. case STX:
  145. bufsz = ;
  146. goto start_recv;
  147. case EOT:
  148. flushinput();
  149. _outbyte(ACK);
  150. return len; /* normal end */
  151. case CAN:
  152. if ((c = _inbyte(DLY_1S)) == CAN) {
  153. flushinput();
  154. _outbyte(ACK);
  155. return -; /* canceled by remote */
  156. }
  157. break;
  158. default:
  159. break;
  160. }
  161. }
  162. }
  163. if (trychar == 'C') { trychar = NAK; continue; }
  164. flushinput();
  165. _outbyte(CAN);
  166. _outbyte(CAN);
  167. _outbyte(CAN);
  168. return -; /* sync error */
  169.  
  170. start_recv:
  171. if (trychar == 'C') crc = ;
  172. trychar = ;
  173. p = xbuff;
  174. *p++ = c;
  175. for (i = ; i < (bufsz+(crc?:)+); ++i) {
  176. if ((c = _inbyte(DLY_1S)) < ) goto reject;
  177. *p++ = c;
  178. }
  179.  
  180. if (xbuff[] == (unsigned char)(~xbuff[]) &&
  181. (xbuff[] == packetno || xbuff[] == (unsigned char)packetno-) &&
  182. check(crc, &xbuff[], bufsz)) {
  183. if (xbuff[] == packetno) {
  184. register int count = destsz - len;
  185. if (count > bufsz) count = bufsz;
  186. if (count > ) {
  187. memcpy (&dest[len], &xbuff[], count);
  188. len += count;
  189. }
  190. ++packetno;
  191. retrans = MAXRETRANS+;
  192. }
  193. if (--retrans <= ) {
  194. flushinput();
  195. _outbyte(CAN);
  196. _outbyte(CAN);
  197. _outbyte(CAN);
  198. return -; /* too many retry error */
  199. }
  200. _outbyte(ACK);
  201. continue;
  202. }
  203. reject:
  204. flushinput();
  205. _outbyte(NAK);
  206. }
  207. }
  208.  
  209. int xmodemTransmit(unsigned char *src, int srcsz)
  210. {
  211. unsigned char xbuff[]; /* 1024 for XModem 1k + 3 head chars + 2 crc + nul */
  212. int bufsz, crc = -;
  213. unsigned char packetno = ;
  214. int i, c, len = ;
  215. int retry;
  216.  
  217. for(;;) {
  218. for( retry = ; retry < ; ++retry) {
  219. if ((c = _inbyte((DLY_1S)<<)) >= ) {
  220. switch (c) {
  221. case 'C':
  222. crc = ;
  223. goto start_trans;
  224. case NAK:
  225. crc = ;
  226. goto start_trans;
  227. case CAN:
  228. if ((c = _inbyte(DLY_1S)) == CAN) {
  229. _outbyte(ACK);
  230. flushinput();
  231. return -; /* canceled by remote */
  232. }
  233. break;
  234. default:
  235. break;
  236. }
  237. }
  238. }
  239. _outbyte(CAN);
  240. _outbyte(CAN);
  241. _outbyte(CAN);
  242. flushinput();
  243. return -; /* no sync */
  244.  
  245. for(;;) {
  246. start_trans:
  247. xbuff[] = SOH; bufsz = ;
  248. xbuff[] = packetno;
  249. xbuff[] = ~packetno;
  250. c = srcsz - len;
  251. if (c > bufsz) c = bufsz;
  252. if (c >= ) {
  253. memset (&xbuff[], , bufsz);
  254. if (c == ) {
  255. xbuff[] = CTRLZ;
  256. }
  257. else {
  258. memcpy (&xbuff[], &src[len], c);
  259. if (c < bufsz) xbuff[+c] = CTRLZ;
  260. }
  261. if (crc) {
  262. unsigned short ccrc = crc16_ccitt(&xbuff[], bufsz);
  263. xbuff[bufsz+] = (ccrc>>) & 0xFF;
  264. xbuff[bufsz+] = ccrc & 0xFF;
  265. }
  266. else {
  267. unsigned char ccks = ;
  268. for (i = ; i < bufsz+; ++i) {
  269. ccks += xbuff[i];
  270. }
  271. xbuff[bufsz+] = ccks;
  272. }
  273. for (retry = ; retry < MAXRETRANS; ++retry) {
  274. for (i = ; i < bufsz++(crc?:); ++i) {
  275. _outbyte(xbuff[i]);
  276. }
  277. if ((c = _inbyte(DLY_1S)) >= ) {
  278. switch (c) {
  279. case ACK:
  280. ++packetno;
  281. len += bufsz;
  282. goto start_trans;
  283. case CAN:
  284. if ((c = _inbyte(DLY_1S)) == CAN) {
  285. _outbyte(ACK);
  286. flushinput();
  287. return -; /* canceled by remote */
  288. }
  289. break;
  290. case NAK:
  291. default:
  292. break;
  293. }
  294. }
  295. }
  296. _outbyte(CAN);
  297. _outbyte(CAN);
  298. _outbyte(CAN);
  299. flushinput();
  300. return -; /* xmit error */
  301. }
  302. else {
  303. for (retry = ; retry < ; ++retry) {
  304. _outbyte(EOT);
  305. if ((c = _inbyte((DLY_1S)<<)) == ACK) break;
  306. }
  307. flushinput();
  308. return (c == ACK)?len:-;
  309. }
  310. }
  311. }
  312. }
  313.  
  314. #ifdef TEST_XMODEM_RECEIVE
  315. int main(void)
  316. {
  317. int st;
  318.  
  319. printf ("Send data using the xmodem protocol from your terminal emulator now...\n");
  320. /* the following should be changed for your environment:
  321. 0x30000 is the download address,
  322. 65536 is the maximum size to be written at this address
  323. */
  324. st = xmodemReceive((char *)0x30000, );
  325. if (st < ) {
  326. printf ("Xmodem receive error: status: %d\n", st);
  327. }
  328. else {
  329. printf ("Xmodem successfully received %d bytes\n", st);
  330. }
  331.  
  332. return ;
  333. }
  334. #endif
  335. #ifdef TEST_XMODEM_SEND
  336. int main(void)
  337. {
  338. int st;
  339.  
  340. printf ("Prepare your terminal emulator to receive data now...\n");
  341. /* the following should be changed for your environment:
  342. 0x30000 is the download address,
  343. 12000 is the maximum size to be send from this address
  344. */
  345. st = xmodemTransmit((char *)0x30000, );
  346. if (st < ) {
  347. printf ("Xmodem transmit error: status: %d\n", st);
  348. }
  349. else {
  350. printf ("Xmodem successfully transmitted %d bytes\n", st);
  351. }
  352.  
  353. return ;
  354. }
  355. #endif

crc16.c

  1. /*
  2. * Copyright 2001-2010 Georges Menie (www.menie.org)
  3. * All rights reserved.
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the University of California, Berkeley nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27.  
  28. #include "crc16.h"
  29.  
  30. /* CRC16 implementation acording to CCITT standards */
  31.  
  32. static const unsigned short crc16tab[]= {
  33. 0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7,
  34. 0x8108,0x9129,0xa14a,0xb16b,0xc18c,0xd1ad,0xe1ce,0xf1ef,
  35. 0x1231,0x0210,0x3273,0x2252,0x52b5,0x4294,0x72f7,0x62d6,
  36. 0x9339,0x8318,0xb37b,0xa35a,0xd3bd,0xc39c,0xf3ff,0xe3de,
  37. 0x2462,0x3443,0x0420,0x1401,0x64e6,0x74c7,0x44a4,0x5485,
  38. 0xa56a,0xb54b,0x8528,0x9509,0xe5ee,0xf5cf,0xc5ac,0xd58d,
  39. 0x3653,0x2672,0x1611,0x0630,0x76d7,0x66f6,0x5695,0x46b4,
  40. 0xb75b,0xa77a,0x9719,0x8738,0xf7df,0xe7fe,0xd79d,0xc7bc,
  41. 0x48c4,0x58e5,0x6886,0x78a7,0x0840,0x1861,0x2802,0x3823,
  42. 0xc9cc,0xd9ed,0xe98e,0xf9af,0x8948,0x9969,0xa90a,0xb92b,
  43. 0x5af5,0x4ad4,0x7ab7,0x6a96,0x1a71,0x0a50,0x3a33,0x2a12,
  44. 0xdbfd,0xcbdc,0xfbbf,0xeb9e,0x9b79,0x8b58,0xbb3b,0xab1a,
  45. 0x6ca6,0x7c87,0x4ce4,0x5cc5,0x2c22,0x3c03,0x0c60,0x1c41,
  46. 0xedae,0xfd8f,0xcdec,0xddcd,0xad2a,0xbd0b,0x8d68,0x9d49,
  47. 0x7e97,0x6eb6,0x5ed5,0x4ef4,0x3e13,0x2e32,0x1e51,0x0e70,
  48. 0xff9f,0xefbe,0xdfdd,0xcffc,0xbf1b,0xaf3a,0x9f59,0x8f78,
  49. 0x9188,0x81a9,0xb1ca,0xa1eb,0xd10c,0xc12d,0xf14e,0xe16f,
  50. 0x1080,0x00a1,0x30c2,0x20e3,0x5004,0x4025,0x7046,0x6067,
  51. 0x83b9,0x9398,0xa3fb,0xb3da,0xc33d,0xd31c,0xe37f,0xf35e,
  52. 0x02b1,0x1290,0x22f3,0x32d2,0x4235,0x5214,0x6277,0x7256,
  53. 0xb5ea,0xa5cb,0x95a8,0x8589,0xf56e,0xe54f,0xd52c,0xc50d,
  54. 0x34e2,0x24c3,0x14a0,0x0481,0x7466,0x6447,0x5424,0x4405,
  55. 0xa7db,0xb7fa,0x8799,0x97b8,0xe75f,0xf77e,0xc71d,0xd73c,
  56. 0x26d3,0x36f2,0x0691,0x16b0,0x6657,0x7676,0x4615,0x5634,
  57. 0xd94c,0xc96d,0xf90e,0xe92f,0x99c8,0x89e9,0xb98a,0xa9ab,
  58. 0x5844,0x4865,0x7806,0x6827,0x18c0,0x08e1,0x3882,0x28a3,
  59. 0xcb7d,0xdb5c,0xeb3f,0xfb1e,0x8bf9,0x9bd8,0xabbb,0xbb9a,
  60. 0x4a75,0x5a54,0x6a37,0x7a16,0x0af1,0x1ad0,0x2ab3,0x3a92,
  61. 0xfd2e,0xed0f,0xdd6c,0xcd4d,0xbdaa,0xad8b,0x9de8,0x8dc9,
  62. 0x7c26,0x6c07,0x5c64,0x4c45,0x3ca2,0x2c83,0x1ce0,0x0cc1,
  63. 0xef1f,0xff3e,0xcf5d,0xdf7c,0xaf9b,0xbfba,0x8fd9,0x9ff8,
  64. 0x6e17,0x7e36,0x4e55,0x5e74,0x2e93,0x3eb2,0x0ed1,0x1ef0
  65. };
  66.  
  67. unsigned short crc16_ccitt(const void *buf, int len)
  68. {
  69. register int counter;
  70. register unsigned short crc = ;
  71. for( counter = ; counter < len; counter++)
  72. crc = (crc<<) ^ crc16tab[((crc>>) ^ *(char *)buf++)&0x00FF];
  73. return crc;
  74. }

crc16.h

  1. /*
  2. * Copyright 2001-2010 Georges Menie (www.menie.org)
  3. * All rights reserved.
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the University of California, Berkeley nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27.  
  28. #ifndef _CRC16_H_
  29. #define _CRC16_H_
  30.  
  31. unsigned short crc16_ccitt(const void *buf, int len);
  32.  
  33. #endif /* _CRC16_H_ */

附件打包下载

http://files.cnblogs.com/files/dong1/xmodem.c.zip

文件传输(xmodem协议)的更多相关文章

  1. linux rz sz文件传输 ZModem协议

    比ftp和scp方便点.需要用支持ZModem协议的工具,SecureCRT是可以的 rz: 接收文件 sz: 发送文件 安装 # sudo apt-get install lrzsz 使用 协议介绍 ...

  2. TFTP服务 简单文件传输协议)是TCP/IP协议族中的一个用来在客户机与服务器之间进行简单文件传输的协议,默认端口号为69

    (1)yum安装:tftp.tftp-server   (2)启动tftp CentOS 6 service xinetd restart chkconfig tftp on CentOS 7 sys ...

  3. Linux文件传输协议2019-7-9

    FTP(file transfer Protocol)是一种在互联网中进行文件传输的协议,基于客户端/服务器模式,默认使用20.21号端口,其中端口20(数据端口)用于数据传输,端口21(命令端口)用 ...

  4. TFTP(Trivial File Transfer Protocol,简单文件传输协议)

    TFTP(Trivial File Transfer Protocol,简单文件传输协议),是 TCP/IP 协议族中用来在客户机和服务器之间进行简单文件传输的协议,开销很小.这时候有人可能会纳闷,既 ...

  5. TFTP服务[精简版]:简单文件传输协议

    简单文件传输协议(Trivial File Transfer Protocol,TFTP)是一种基于 UDP 协议在客户端 和服务器之间进行简单文件传输的协议.顾名思义,它提供不复杂.开销不大的文件传 ...

  6. 【RL-TCPnet网络教程】第38章 TFTP简单文件传输基础知识

    第38章      TFTP简单文件传输基础知识 本章节为大家讲解TFTP(Trivial File Transfer Protocol,简单文件传输协议)的基础知识,方便后面章节的实战操作. (本章 ...

  7. FTP文件传输服务器原理

    FTP服务器,全称File Transfer Protocol Server,是在互联网上提供文件存储和访问服务的计算机,它们依照FTP协议提供服务.FTP,文件传输协议(File Transfer ...

  8. 《linux就该这么学》课堂笔记15 vsftpd文件传输、Samba/NFS文件共享

    1.为了能够在如此复杂多样的设备之间(Windows.Linux.UNIX.Mac等不同的操作系统)解决问题解决文件传输问题,文件传输协议(FTP)应运而生. FTP服务器是按照FTP协议在互联网上提 ...

  9. C#实现http协议下的多线程文件传输

    用C#实现HTTP协议下的多线程文件传输转自  http://developer.51cto.com/art/201105/263066_all.htm C#(C Sharp)是微软(Microsof ...

随机推荐

  1. eclipse 灵活使用makefile来编译C/C++

    需求: 近期在看<C++ Primer Plus>, 作者在不断优化自己的类.有很多不同的版本号,有非常多的測试函数(main函数),我使用的是eclipse+CDT来编写C++,不可能为 ...

  2. C++ 类的抽象初练

    /* 某商店经销一种货物,货物的购进和卖出以箱为单位,各箱的重量不一样, 因此商店需要目前库存的总重量. 现在用c++模拟商店货物购进和卖出的情况 */ #include<iostream> ...

  3. VMware ESXi 启动时提示引导错误:不是VMware引导槽。找不到管理程序(bank6 not a vmware boot bank no hypervisor found)

    VMware ESXi 启动时提示引导错误: bank6 not a vmware boot bank no hypervisor found 大概中文意思是:不是VMware引导槽.找不到管理程序. ...

  4. 【BZOJ】1679: [Usaco2005 Jan]Moo Volume 牛的呼声(数学)

    http://www.lydsy.com/JudgeOnline/problem.php?id=1679 水题没啥好说的..自己用笔画画就懂了 将点排序,然后每一次的点到后边点的声音距离和==(n-i ...

  5. 在Chem 3D软件用什么方法可以改变背景

    化学绘图过程中常常需要绘制三维结构的图形,Chem 3D软件是ChemOffice套件中专门用于绘制三维结构的组件.用过它的用户会发现,其背景颜色通常都默认为深蓝色,但是不是每个场景都适合用深蓝色的背 ...

  6. 数据库unsigned char*类型图片存进

    loadimage1();测试: void Caccess_test_1Dlg::loadimage1()//存入unsigned char*类型的数据图片 { CFileException e; I ...

  7. Effective C++ Item 9 Never call virtual functions during constrution or destruction

    Because such calls would never go to a more derived class than that of currently executing construto ...

  8. [Domino]从嵌入另一个数据库嵌入的Embedded View无法正常显示,提示unable to lauch

    发现问题 1. 项目中需要在一个数据库中插入另一个数据库的Embedded View,使用起来十分费劲,在选择数据库的下拉菜单中经常会找不到目标数据库: 2. 在做日文版的时候,从workbench导 ...

  9. HDU_5533_Dancing Stars on Me

    Dancing Stars on Me Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Ot ...

  10. Notice: Undefined index: wjs_cookie

    w执行顺序. ok <!doctype html> <html> <head> <meta charset="UTF-8"> < ...