﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-山寨科技</title><link>http://www.cppblog.com/Chipset/</link><description /><language>zh-cn</language><lastBuildDate>Thu, 23 Apr 2026 10:17:20 GMT</lastBuildDate><pubDate>Thu, 23 Apr 2026 10:17:20 GMT</pubDate><ttl>60</ttl><item><title>DIY一个小夜灯</title><link>http://www.cppblog.com/Chipset/archive/2021/11/06/217855.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Sat, 06 Nov 2021 14:18:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2021/11/06/217855.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217855.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2021/11/06/217855.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217855.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217855.html</trackback:ping><description><![CDATA[<p><span style="font-family: Arial; font-size: 12pt;"></span></p><p style="color: #303030; font-family: Verdana, Helvetica, Arial; font-size: 12px; text-align: justify; background-color: #ffffff; line-height: normal;"><span style="font-family: Arial; font-size: 12pt;">本文是一个DIY小夜灯的简易文档，由于笔者水平有限，无法保证没有错误和疏漏，为了避免</span><span style="font-size: 12pt; font-family: Arial;">&#8220;</span><span style="font-family: Arial; font-size: 12pt;">碰瓷</span><span style="font-size: 12pt; font-family: Arial;">&#8221;</span><span style="font-family: Arial; font-size: 12pt;">，做出如下声明。<br /><br /></span></p><p style="color: #303030; font-family: Verdana, Helvetica, Arial; font-size: 12px; text-align: justify; background-color: #ffffff; line-height: normal;"><strong><span style="font-family: Arial; color: red; font-size: 12pt;">在实际操作中，依据此文而产生的任何问题</span><span style="color: red; font-size: 12pt; font-family: Arial;">(</span></strong><strong><span style="font-family: Arial; color: red; font-size: 12pt;">包括但不局限于财产损失，人身伤亡等</span><span style="color: red; font-size: 12pt; font-family: Arial;">)</span></strong><strong><span style="font-family: Arial; color: red; font-size: 12pt;">与笔者无关，笔者既不赔偿，也不负法律责任。<br /></span></strong></p><p style="color: #303030; font-family: Verdana, Helvetica, Arial; font-size: 12px; text-align: justify; background-color: #ffffff; line-height: normal;"><span style="font-family: Arial; color: red; font-size: 12pt;"><br />如果您已经阅读了本文的一部分或全部内容，则表明您同意了上面的这个声明。</span></p><p align="center" style="text-align: left; line-height: normal; background: white;"><span style="text-align: justify; font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;"><br />-------------------------下面正文--------------------------<br /><br /></span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">微小功率的</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">LED用的最多的就是阻容降压，然后限流点亮串联的LED。由于简单的阻容降压先天低效，只好串联LED提升工作电压来尽可能的提高效率，但由于LED的分散性，质量不好的先坏，串联起来的寿命远远低于单个LED的平均寿命。元器件简单降低成本，寿命还不会太长，两点都符合厂家经营之道，因此，这种先天缺陷的设计就成了市场主流。</span></p><p style="line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="font-size:12.0pt; font-family:&quot;Microsoft YaHei&quot;,sans-serif;Times New Roman&quot;">下图是某个品牌</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;Times New Roman&quot;">3W LED灯泡的电路，该电路负载部分是一个560欧电阻和5个LED串联，供电部分是阻容降压后桥式整流，电解电容滤波后得到大约18V的直流电， 220V侧通过大约57毫安的工作电流。算下来功率220 * 57 / 1000 = 12.54VA，灯泡标称3W，好到计量插座测得只有1W，功率因数只有可怜的0.08，这种垃圾货却符合某大国一级能耗标准[习惯就好，砖家们订立的脑残标准多了去了]。<br /></span><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUcAAACbCAYAAADxwlmLAAAdOklEQVR4Ae1dC5KjOgwk12Lvwx7ncZnlMJO7jF/JIJCN/APZcRJNFYXxp9Vu4475JDMY/VMFVAFVQBU4KTCccjRDFVAFVAFVwKg56kmgCqgCqgCjgJojI4pmqQKqgCqg5qjngCqgCqgCjAJfY47LNJhh2LZxNk9GDMyK1n3OZkQc2CewEBP3DvaGMy1YqntVQBXoRYGvMEdrSLuJPc08DmYIOJJb1xj3GNpO5vCyOBY3yIA3zjFr5lppniqgCrRW4AvMcTHTMBrHj+zqj5ocyr6aneObwbpbm2Uyw8BhIaa7V3N09dAjVaBXBT7fHFnzAsMcjGOC2wg959G5VLYrR64iW5/B9eKrOfY6FZSXKuAq8B3muF9SY+cZE8MiY4w1SLyvGDFGY1ac4zKZwWXMcb/3aWN4q1rCQ5OqgCrwOgW+1ByZy+dtDPyVor+S3IfKmp5//zDPHA8z3dE0oQrUV2CZzAM/9Lf9OP94cRczPR7Hw8vpn/klNZbpcWCMs/mhhaTeJyS/wxxP9wTBxJgVG3t/8Wx41kC59ttK0llsMitHNcdPmDpv2AcwRzC0IPXVGMEwOc+zxrgb4tPMfx5m8MwzCP2GBZ9vjtbwPCNkTdDAo2nm4YprjtYYT5fpOPJuXZvrYeo9R9RK960VgKugx7SwxgdcrPkFzQ6MczQzXSo+Z/PnMZmFc9LWnasQ7/PN0Q46fXVnvaTeV2/WKPHhzGpue9l+/3F7Gs0ZrTMo/qs92zFZuao5OoLpQUMF4ubImB/lBqvOx2T+OUa4rjQnN5O2euv0V5ijMWhS20vg9LrXMUcYy9Ugj4cm5DWdre5RdrxYvkM6dUYzz+5qVM3xrefLW5OHlaFz7tJVJJy3sAr8ByaI5zVZKeIluZrjW58DSl4VUAWSCsCqb72isn5nzRGOjwcwz/mPeQzbapE1x/W+4/Sh19VfsnJMnilaQRX4PgXA8OCWD7ijNUeyUrRqkMvm4GW13+ZzZFRz/Jyx1J6oAmUK4GrQtuLuORJztA9fPCPUBzJlemttVUAV6FGBp1kW+p3+9bKavudoH9jsr+rAYpJcVp+eZq+X1KHXfnpUoJSTrhxLFdP6qsCbKmDNj7wETo0Ru+S85I33G7EQHmzCu42IQe5P7lU+KKHm+EGDqV1RBVQBOQXUHANawqdj7C9VHmurZaqAKtC/AnEH6J9/NYYp80uVVyOmwKqAKtBEATXHgMwp80uVB2A1WxVQBd5EATXHwEClzC9VHoDVbFWgqQIP+gs7+CCl8v731/kaTdP+SgZTcwyomTK/VHkAVrNVgaYKgDm2NKvW8WqKqeYYUDdlfqnyAKxmv1gBGLdvGrvWZtU6Xs3TqVtzxJP4VSdyKm6qXHLQUAtJzG/EQh1bjl2uzsgtt35uvdZm1Tperg5X6nVpjnii0P2Vzt1pk5pAqfI7sWlbqkGrmDT+p6R9HXvS0ucmqXlrs2odT1IrH6uqOfqD/m7Hvlj0+N36kuJL+3Y3nYql5fiTYG32re851hrflv2AOVDdHK9MNE7cKzh32gCH2F+qPNa2pMzXoqRtbl3pvkjj5fYjVs/XsSeOPrdYP0rLWq/kasWrhRvTM+4AsZYZZXdOQHrCZIQSr5LiniqXJIRaSGJSLOm+SONRrnfSqGOP/JDbnf5xbVubSq14tXA5zTCvW3MEgq88iVOxU+UosNS+ZjxpbGk8KQ3xnOqVXw1erU2lVrxauLFzS80xoE7qRE2VB2AvZ9eMJ40tjXdZNKbht3FrbSq14tXCZU6RPUvNcZfCTaQmUarcRbt/VDOeNLY03n31DoRv4wamAn1uudV4cKLmeJzDNvXKEzkVO1XudeX2Yc140tjSeLfFIwDKjYjxRkk1R2+wXnkip2Knyr2u3D6sGU8aWxrvtngEQLkRMd4oqeboDdYrT+RU7FS515XbhzXjSWNL490WjwAoNyLGGyXVHL3B6vlE9qhWP6yphTS2NJ6kuMpNUs12WGqOntY9n8ge1eqHNbWQxpbGkxRXuUmq2Q5LzdHTuucT2aNa/bCmFtLY0niS4io3STXbYak5elr3fCJ7VKsf1tRCGlsaT1Jc5SapZl0sMEQYL26r8bqQ3xt9z9FXpNPjmpNaGlsaT3JIlJukmnWx6GoxlK7JQM2xprqC2DUntTS2NJ6gjHYVIoknidWzbpL9jGFRE4R6eOzvYxhSZWqOUkpWxqk5caSxpfEkpVVukmrex0LTAySaRmTM8/dYXnOv5lhTXUHsmpNaGlsaT1BGXTlKiimAlWN6UAfOKdha3GvEbqk5ohKd72sajjS2NJ7k0Cg3STXvY1Hjg7HhzI/W4crvs+AR1Bx5XbrLrTmppbGl8SQHQ7lJqnkfC42Pmh7kwTGWwZj5G61/nwWPoObI69Jdbs1JLY0tjSc5GMpNUk15LDRGHzmU79eTPFZzlFSzIlbNSS2NLY0nKatyk1TzPhY1PZr2kWNlfl2pYzVHKSUr49Sc1NLY0niS0io3STXvY6Hp4T6EmCoPtfPz5+eR83cxZlqM+T2ynNRXmSNMjFdtjuoXDmpOamlsabwLcgWbKLegNC8pANODMcEtdC9Rwhwffxfzu8y2n3/mpxkfDzOPg3lM/8wv45BfZ46vOAMkJqQERqjv0tjSeCHeV/KV2xXVXt9GxBy3Bz3QG4v3858x5sm+Xwl11BwbjLvEhJTACHVVEhuwJPFCnK/mK7eryrVv568q8dyCfWiFGWMJeP/9/NpL6cE3SmbpqOYYU1OoTGJCSmCEuiOJDVi4heK9Ml+yr9APcgvrdrekud0m9GIAuloMpYsoLn/Nn8doRjDXf5OBu41w33H+8zDcdbWaY5G61ypLnPQSGCH2UtgUB9L0OBS7dX4JpwHu1kf+wBiHcb2HFamWXVTCLRv0zSuiKfr7y916zsbAhn/LX2PMDx45ezVHR446BxInvQRGqHcS2CGMUH6IS+38Ej6wwhjp401CDmwTjBHqSP2VcIOYvncHqErRa4KDJojB8NjfY3nuHj7IQB/QDLYcreRGlmFZOtg+BLSX3vwYLY6l+lCLq8Q4xbjdxY9hh8quaH7Ces5mgnNwWpzLZ5hYwzDZJ53OKuQEUJZRqhMaBkZ5PEbu6hCLu9zTPtA0JQv5OJ5X7jXCB9njD3yQjXY8YUwhPUz/zD/mKTXGrmaO2JnSAUdiNfav4vKquLka3uGX2za3Xi7nVL3SeOH6izVBWCXCJINVxzCMZplg6kjecQTcsunom4l/nNKoh3LkjHuOE5SBNrBdMcfH46/5+W/cLqdhFBebXv4+zGOYgphlo8ExZ/L8QfaPmSZNsl7F41Vxc0W9yq+0XWn9XP5cvdJY8fpPa4awWoR6z3nkQt7Oi3M4w/uG4h+fW/SXQ40P+k/Nzy+DctxovViv4H3GfxP/wAXawcOYcf5hXwRXc4wpK1RWetILhc2GucLvShsgdLVddme2iqVxuPpwv5FuUGccRycvdE+ylO8VbcA8YGIjx2FwjzH/CpdWbdAAqdlBHj0GLlxeDsd0u8bvOfonmn+c06kadV7F41VxczUs5Vda3+dxt72Pxx2XxuDqw7cncjYu/pU8jkMMZ5kedkULl/ixLfwFuRj6a8pCZhbKT7HMaReqU2XlCIRhoHFLdaBVOfJ5xb5VH6/EAT1y/0rqxjClcEIxSvH5+nBPMWcLsSjL5zmUYbxbbWpMNO33I1bm16XHOe1CdfJnBY2o6Y9SIHdS5tbLFUcaj8YtxY7Vxwcx9DUQyJP+i3FIxdoeM9iHRn461faV5WhMuA9xSZXH2o3/Hbce8FYD3dNvy1AcNUeqxpemcyZlTh2Ur1ZdxM/Zl3AAPK4+rBnhNZ5xmPZXQOAyexrgWxZT8B3IHH5cHY4DV4/LezzgYRG/Md+M4yBekgemB/3Gzb/XiKSumiM8kY7dcsAy7h0oNUdU/4v3qUmZKvelq13fj8cdS3CA13fADNd3GXE9Bpa5vgoCZalv0XDcQnmlnB2cZTLG2+z90hm+Jvf+f1fN8U7P1RzvqPchbWOTMlYW6n6rNqH4kF/Kgau/5oEZhv6exXFCSJDPcYjVT5fBk9j3ezEc++WvKkEf3EIrTGyLe/juNH3Pm7sdAq/70DrYVs0RlfjifWhShvJTUrVux/Ep5cDVh7yYNUJcrh3Hh+ZBm9It1wxoHEi/YsXlc7h6TLmH0ils2m7V42/2a0Ll5vhcv0+6D+44uydQqhwuSiZycpD2Nh/uejN/sTKmejQLXuKFbzng9yvXY8KJnLyUTog3PNGESxi4ybv/oQ4UYC/sK8FNcC4vl/Wr2lJ+pRy4+na84dL6aS+k9+fWcIbarxBO67dnaNycNBcr1s6f4FxdfFhE9+v90oH9xRkOo8c87Lu/z+WK7bC+fwz5XB7kF5ojmMBkn4itwVZTOO67pMo3Y9wN0Wu/rDeUz/a4rDfEzwXY54L9ikXNkW0MXHaeCd4nc1xjOGbJBukj05+s/nEpy1e3B76lHEL1wSDhAYx92DHO9pyANHw3F8qufIUwFCukc2jy0vrT47E/NILvDsN23C+lNftO+33FY3+f2wtsh/X9Y8jn8iC/0BwxBNkHDW2r45SDaRwrNlvDrrDQcAMm6GCQ2BeS62oAnjZ6PBwsn6d/DHMCVtDIezX51Qw9w3dw+zygk5Wmr7LtAaOUQ7z+cnrYcecHJyBW6Za+rIaVg7+RK5mrg1m5HTUmmqZhIR/1SutAW67GR1/lgdd26DHM2Wqv8thLUrLCcqmBh4zHCow1OdcQrXl5l6Jcnh8n6xgNze7D5mg5Uw5J3oc5rubr3WrIIve6SmgMuM9lgidsyT4XG+qV8qHYpW25+nAK9GwvvfOj4xFKoyHinqt3xxzhu9P2qX3i204VXuVZjS18+eiVg8mcjNQ1x3VFRo0LyukxJ19O3mpg1vNi5siVJXlvq0W7IsDVZA6nPuqguUmwQSzObK7gI15p29L4XH0be7vnWBq/RX1rGh3zy9GAGh/oTVeGfpkdj23VTevF48DHW3x7Bj4CyWU1neCHGcFKiDU/u5oKlAFbrpw1GWJatpfr8R6TbROXgyt1Vp+cAW6NnHoIxHKgvDfOI9ybGk4/QoowPe7pCQfpu3+IBzh38RAL9yXcSmNz9W3eAi+Aw2//LfsDvBIeXF3sT8meMwMwj98K/DjOtfLQAGn/bL+8N9e5PClO8FuPXjgLvc8G51LSmsd2X+S00tseTkRWc9ZguHJrmP7K6rwypJfiQXMuUcY3t6A5nrnYMEneh6Fb7lzfS/g2rOtP0DuhrZkQU8Tju5hXcErbcPWPvMXeHlp/IHU1yRqX20e8PMUOw2jDL4/VvVpHn1ycUL5b69pRCHs3x1xYa3yMYWL7aDlnSjbPM8y9XsCsMFjmHu45wInHbuTeIjVlB3rnQ3Id3oc5Qo31w8HrE2naWxJ1ucOLTuxQuhQfcXBf0r60DVf/lPec7djalST8i4T5KXqVcIqX6PBpUlfml6BzqZj2gaZ9sFiZX7f0OIRdZo6cSVAmqXI0jt2QXFM5oMhlasSIj/qFKZZniMuKbQ0vyNtvux6f768W8mxcvXRyIj2/XeoY28X2FIOmY21oWWkbrj6Xt8ZYV2rwoQuvzEj9hePxEUKTGp5awwf9zo+7ZuQhm+diH3AfIpAqD7XLyQ9hl42sNRV+BXY86IiUW6abceBKbjccrxvwPdFaf6w5wio1dr8wxts3R3zVZ2AeQNXqlAxu6QSFqH6b1HGK6d32HKfSmHkYcHEt8vKtpef3O8U5NKmPdrL8Dly5FPQB+o0bvfdIo6T7Smsf6cffxd4vhnvGwW04/7guIJSZ4xFTUx+sQMkkxZM6Z58jGReby0thlbbh6sPqq+UfxyEWvzW/GJfaZVfNUX+Vp/bIfCF+6USlEl1tG2oXyqcx/XRpm+L6oSsen0jBcSmHGPRjWtgfU4i16bnsqjne6ZOuHO+o9+Ftr07WK+1ibWJloSEobcPVh+9Phzaoj2UhDqX5HIcYBsbn9vCtj/nnV+z1oxiPWmX+JTfog1vo8luSi5qjpJofiFU6YUGC0jap+qlyTvbSNlx9+P49bPAKj79Bfczj4l/J4zjEcODnyLL4cb/HFQPupIyuFkPpmlTVHGuq+yHYpZO2pH5O3Zw6vtSlbbj6cE8PHtIN42iW57z+6O22t/Uxzw9+8ZjjEIOK8Xs8BvP7s3GOgXRWRk0QqOGxv29Bu4o5wiDTrUVHNEZdBUombm5d6XpUgVxsbBOuv9h3G+2/SiAPpsP1EbF8fw2T54dmUs6ibQvKk6aRBeb5eyyvua9mjpT0tUGnCJruQQHJcSzBKqmLOkGb0g3bsvvn+i8T4HUQeEHmCicWl2TewiT8fsiKi8B3mcwxPaiDYyl1rxE+51LfclJz7PKU6ZfUrQm8dasUo7R+TL17WM/120/wu46CL38j3/uYwO+x/eak+yMOGKO3PTU+6D9nfrQOVx7rE/cvEOy7j/DPyLZvOYVuyao5xpTVMlaBO5P4StsrbVjiUiu+ZVp/SDYU5GK+WD93fqFpf5FghWZofNT0IA+OsQx08TdaP0YLsbAOGOMEL33/W/8h2d/HYH/fkVOqijkCEdoZJKb7z1HgykS+0gbPJSnlrnKQih/D6ZlbjLdkmW9miB3Kx/LQ3m+3Hv8j1Zf9oQ/JtMlq5gjoOti+3J91XDK+JXV9le60rYnlY989luznXS6t2lPzomk/fqzMr0uPod0P+W45h8PlAYaaI1VS08UK5EzonDqxwHfbU2xJLIorke6Zm0T/OAw0JtxzdSAvVR5rN4z/Hd+rZr5HHcJWcwypqvnZCsQmdawsN4AEBsaSxEJMqX3P3KT66OOAMUG/cQvdSwwZmI93Ol7+2h/ehndCYYNf16K/bLssT/Oc/xj3v1uvKGqOJzU144oC3MTm8qSwr+BAGylOV+PH2vXMLca7Rdllc0ySC7/Qo+aYFE8r5CoAk5tuue1S9SRNQxIrxbu0vGdupX2Rrl/PHMNM1RzD2mjJBQXQHC80DTaRNA1JrCDhiwU9c7vYpeJmIRMM5RcHKGig5lggllbNU0B6kkviSWLlqZFfq2du+b0oq0lNj6YBBY5BE24L3Zssix6vreYY10dLLyggPckl8SSxLkgTbdIztyjxG4VoiLinUDQvlKb1pdNqjtKKKp74Qw9J05DEkh7qnrlJ9xXxwPSg37j5K0I0RX+P7Wvu1Rxrqvul2NKTXBJPEkt6eHvmJt1XxENzpKaIRgh1MO3vsX3NvZpjTXW/FFt6kkviSWJJD2/P3KT7GsJDE6TlkAfawEZNlNapkVZzrKHql2NKT3JJPEks6WHumZt0XxGPmiFNYzns1RypGpp+awWkJ7kkniSW9CD1zE26r4iHhoh7zIc9NUXQhm4tVpC6cqSjoWkRBaQnuSSeJJaIWASkZ26EpmjSN8CQ6XHmKUqEAVNzZETRrHsKSE9ySTxJrHsqnVv3zO3Mtm2OmmNbvTXapgBMSqkNIHGSS2EinsSASWJJ8KEYPXOjPF+RVnN8heoaczezu1Lg5Pb3d3El2yM3SUwprJ65SfXxKo6a41XltN0tBSQnJWDhdotUpcaSfZWm2DM36b6W4qk5liqm9UUUkJ6U0ngindxAlJukmu2w1Bzbaa2RiALShiGNR6jeTiq32xK+BEDN8SWya1Bpw5DGkxwh5SapZjssNcd2WmskooC0YUjjEaq3k8rttoQvAVBzfInsGlTaMKTxJEdIuUmq2Q5LzbGd1hqJKCBtGNJ4hOqtJPDC7RZQpca96lapu0Wwao5FcmllKQWkJ6U0nkQ/0RTpXgJXCqNXXlL9u4uj5nhXQW1/SQFpM5PGu9QprxE1H0x7VV52iHzo/mVkOg38keZIB1zTx2Vdb1pIzone+qZ8+j3vSsYm9KMUkucuxar6wxM0kKZVgVcrQCfiq7nQ+JQXpmm5pl+jgJrja3TXqKqAowCaIuz1rw8FdCT6GAdloQqoAp0poObY2YAoHVVAFehDATXHPsZBWagCqkBnCqg5djYgSkcVUAX6UEDNsY9xUBaqgCrQmQJqjp0NiNJRBVSBPhRQc+xjHJSFKqAKdKaAmmNnA6J0VAFVoA8F1Bz7GAdloQqoAp0poObY2YAoHVVAFehDATXHPsZBWagCqkBnCqg5djYgSkcVUAX6UEDNsY9xUBaqgCrQmQJqjp0NiNJRBVSBPhRQc+xjHFwWy2SGaXHztqNlGgxf9DTzmPhR03E2zx0V6k8GopwxFzMNo5mPynurz0+ALtj3hKaOnocyz3k0Y1Q80JeOFcbjxuLA1VRbBdQc2+odjQYmRX/XL5keZ4J3mB3JPJLP2YzOZD7q7+YIpuxMWuSzmugBdk6tPuqZCXFx2zcnvjEGOA1ns7d1SVsaLVzmxd76gTC2ndc33sAA5zArGtuYxUx+H9wK9ijLHHccEo/VfzLLLxNEs6oroOZYXeILAS6vHCMmlmmOaBhgJquxwOSN4JLuLRM1lXV1hHjGTnwPB80AHcxirSa3tyP4kEyZY6ydX7Ya5sFp5X+Y1dnkGHPcDJ7/UMEPF9h72pzMcVtNEi0g/mNajHqjdxI0OlRzbCR0URg0DW+lgxOQzB8Cu5oK1mH3+4SEZofp7UYYjHsYCAmYTALubkjMKtGWj6MZKC9bjxqJG8YaGitA2lR3LgQSDAjjr2a4bCvHwySP6gFzpPztgti/rPaxzpfV07S2oWPxGGfzcwTXVGMF1BwbC54VDkyKNYDYPanD7NgY7MrRW9nM025mxyowgcsGw0tmanKAQ8zSmvNgphkurUk96LtnNjSEtDmul/ZbfKv7vJrj4t+GABaC5gh9PI3JFsN+KOrlNB33V6TVHF+heipmcAW3mlnAN1OoXjljeguaI5ShYTH1PKTjkK6IzqtNukpbTQnqrKaJfQqb3xolXL7iuCvmgwO041aO1vDwvqc1q8lM42Rm9qFKwBwDK3yXC+p5qGU1cD4Ijktr20/LSy+qiWJNk2qOTeXODOasHGHCuJMcjWRHs5eidBU47CtPnGTHRMVJyphe0JSP+HvMVGLj5BiSxd+wSB8Pw3ONkgtx1PVL17ZOPFIF2vFlqyEdmrp6EwjZlSOM6WncfJ2hTw87lmqR7ki0OFJzbKHyrRixyboB2xUPeU3HM55j4sNko+Z4GOpRJ3bpXtYRZ6Vomx5G5JgV8MXLTPJBwEUTN0drUKjJdjtgHM3I8gisHJ3VHzyEz7nnuJnj3nY19+NDbBsbfSDDnQZN8tQcm8icF8SaSdYl2jFxLPIlczxMFwzHmuO2klmN8ijPY3+udTbH1XjHefbeo4RYo5nn+P1GiCBtjie8zahneK2KfmLY7gXMMWvMiAHDvUtcOTrmSOvYzurT6vNp1SxHzbGZ1BcC2RXgZI1jjL1Oc8UcrRGul3HWHKfQO46bEe+TONQP3zjAAJhLWWs+/spsuySGFVv05WlJc8SVGr2UXfOODwd8nQn77PcRV5pk1c4+rd7a2/G0r92rOaKkHe/VHHscHJhEsBqxsxRXcKvZDNzl3rbicy7JtlWPXRk5K5ttdbJP1NBlNMYtEAh5b/FOCy+AQq5eIa6avexT8HN/hu3pNprdcasA9ECz5dph2R4E+NMPAeBKCcExLd8buonzZfVabj+E7BefVm3hoQ+O2bTw/OEc0PuNrr6tjtQcWymdEWefwHRC4iXY3h5NEs2TWb0EjQ8m4GqOx6s6gua4c3zPxGFelL9rWidDpVUxjR8AzocSmPaxUqfGvTY7xgZh4MV5fQl8V6N5Qs2xueQaUBVQBd5BATXHdxgl5agKqALNFVBzbC65BlQFVIF3UEDN8R1GSTmqAqpAcwXUHJtLrgFVAVXgHRRQc3yHUVKOqoAq0FwBNcfmkmtAVUAVeAcF1BzfYZSUoyqgCjRXQM2xueQaUBVQBd5BATXHdxgl5agKqALNFVBzbC65BlQFVIF3UEDN8R1GSTmqAqpAcwX+B2aGxFXitma8AAAAAElFTkSuQmCC" alt="" /></p><p style="line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="font-size:12.0pt; font-family:&quot;Microsoft YaHei&quot;,sans-serif;Times New Roman&quot;">市面上几乎所有的小功率</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;Times New Roman&quot;">LED灯泡全是按照这种阻容降压整流再点亮LED的原理制作的，当然，全是绿色节能的&#8220;典范&#8221;，符合某国一级能耗标准。市面上大部分小功率5V充电头的功率因数接近0.5，远超普通的小功率LED节能灯，用来DIY小功率LED灯再好不过，借着一堆认证的优势，轻松把那些品牌小功率LED灯全部踩在脚下。<br /><br /></span></p><p align="center" style="line-height: normal; background: white;"></p><div style="text-align: left;"><span style="font-size: 12pt; line-height: 107%; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">下面以做一个小夜灯为例，论述一下利用起来手头闲置的</span><span style="font-size: 12pt; line-height: 107%; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">5V充电头。<br /><br /></span></div><span style="text-align: justify; font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;"><div style="text-align: left;"><span style="font-size: 12pt;">小夜灯固然</span>卖的<span style="font-size: 12pt;">(尤其网上)很多，而且便宜，高价的当然也有，适合高品位时间不富裕的人士。</span><span style="font-size: 12pt;">DIY一个低耗电光线柔和的小夜灯难度很小，却能解决漆黑夜晚上厕所</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">看不清路</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">[</span><span style="font-size: 12pt;">开灯太刺眼</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">]</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">的烦恼</span><span style="font-size: 12pt;">。</span><span style="font-size: 12pt;">考虑到多数年青人手头充电头一堆，太多了根本用不上，扔了不仅可惜还危害环境&nbsp;</span><span style="font-size: 12pt;">[外面的塑料或者树脂壳子很难自然降解，里面还有各种电阻、电容、电感、IC等元器件。电阻和电感上的漆皮、电容的电解液等都严重危害环境，IC封装的树脂也很难自然降解]，留着没什么用还占地方。于是打算就用</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">5V充电头供</span><span style="font-size: 12pt;">电长明</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">(</span>商业上<span style="font-size: 12pt;">一般小夜灯的方案是</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">220V</span><span style="font-size: 12pt;">阻容降压点亮</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">LED</span><span style="font-size: 12pt;">，耗电大效率低，高档一点的还有红外、声音等感应功能，耗电更大效率更低，因为感应电路需要始终通电，这部分功率远超</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">LED</span>光源自身<span style="font-size: 12pt; font-family: Arial, sans-serif;">)</span><span style="font-size: 12pt;">，光源来自一个</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">5</span><span style="font-size: 12pt;">毫米白光</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">LED(</span><span style="font-size: 12pt;">拆自坏玩具车车灯</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">)</span><span style="font-size: 12pt;">，串一个大约</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">1K&#937; 1/8W</span><span style="font-size: 12pt;">电阻防止电流过大烧毁</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">LED [请注意拆件下来的电阻阻值，尤其色环电阻比较常见，在没有表而且电阻上没有标注阻值的情况下，可以考虑人工算出色环电阻阻值，网上查查各种色环代表什么意思]</span><span style="font-size: 12pt;">。因为</span><span style="font-size: 12pt;">草帽头白光</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">LED</span><span style="font-size: 12pt;">导通电压</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">3V</span><span style="font-size: 12pt;">左右，工作电流一般不超过</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">20</span><span style="font-size: 12pt;">毫安，</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">5V</span><span style="font-size: 12pt;">电压供电时，限流电阻最好不要低于</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">100</span><span style="font-size: 12pt;">欧姆，电阻过小容易烧坏</span>LED<span style="font-size: 12pt;">。</span></div></span><p style="text-align: left; line-height: normal; background: white;"><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">考虑到长期通电，设计上需要尽可能降低损耗，测试过几个闲置的</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">5V</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">电源的损耗作为候选。这些电源每个上面都有一堆几乎相同的认证标识，但实测结果嘛就是另外一回事了</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">... 值得一提的是这里计算损耗用伏安</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">VA</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">，而非业界流行的瓦</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">W</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">。其实小功率开关电源即使满负荷，功率因数也极少超过</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">0.5</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">，空载更是惨不忍住，很多国货不足</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">0.1(</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">甚至低到</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">0.01)</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">，不用瓦</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">W</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">计算怎么去遮丑低效的电路呢？商人都懂质量好未必收益好，无底线的虚假广告</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">+</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">软文宣传是赚钱的法宝，其实何止</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">LED</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">光源，这是时代的商业文化，起码这片土上如此。<br /><br /></span></p><p style=" text-align:justify;text-justify:inter-ideograph;line-height:normal;background: white"><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;Microsoft YaHei&quot;;color:#303030">适配器实拍</span><span style="font-size:12.0pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#303030">[</span><span style="font-size: 12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;Microsoft YaHei&quot;; color:#303030">旁边是一个</span><span style="font-size:12.0pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#303030">5</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;Microsoft YaHei&quot;;color:#303030">毫米草帽</span><span style="font-size:12.0pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#303030">LED</span><span style="font-size: 12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;Microsoft YaHei&quot;; color:#303030">焊了一个</span><span style="font-size:12.0pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#303030">1K</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;Microsoft YaHei&quot;;color:#303030">欧电阻和</span><span style="font-size:12.0pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#303030">USB</span><span style="font-size: 12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;Microsoft YaHei&quot;; color:#303030">口连线</span><span style="font-size:12.0pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#303030">]</span></p><p><span style="font-family: Arial; font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/5V-adapter.JPG" alt="" width="800" height="871" /><br /></span></p><p>&nbsp;</p><p style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 12pt; font-family: Verdana, sans-serif; color: #303030; background: white;">5V</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">适配器损耗实测，容易看出基本分两档，有些电源可真不敢恭维，功率低</span><span style="font-family: &quot;Microsoft YaHei&quot;, sans-serif; font-size: 16px;">[没准还虚标]</span><span style="font-family: &quot;Microsoft YaHei&quot;, sans-serif; font-size: 12pt;">损耗还大。</span></p><p style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">理论上能耗等级越高越好，个别厂家乱标的当然也有，这里就不说是谁家了，没有标注等级的一般低于III级。</span></p><table border="0" cellspacing="0" cellpadding="0" align="left" width="576" style="width: 6in; background: white; border-collapse: collapse; margin-left: 0.1in; margin-right: 0.1in;"><tbody><tr><td width="205" valign="top" style="border-width: 1pt; border-style: solid; border-color: black; width: 153.9pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: SimSun;">候选电源</span></p></td><td width="150" valign="top" style="border-top: 1pt solid black; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: none; width: 112.5pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">220V</span><span style="font-size: 9pt; font-family: SimSun;">侧电流</span><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">(mA)</span></p></td><td width="114" valign="top" style="border-top: 1pt solid black; border-right: 1pt solid windowtext; border-bottom: 1pt solid black; border-left: none; width: 85.5pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><font face="SimSun"><span style="font-size: 12px;">能耗等级</span></font></p></td><td width="107" valign="top" style="border-top: 1pt solid black; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: none; width: 80.1pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: SimSun;">备注</span></p></td></tr><tr><td width="205" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: 1pt solid black; width: 153.9pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: SimSun;">苹果手机充电头</span><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">5V 1.0A</span></p></td><td width="150" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: none; width: 112.5pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">0.173</span></p></td><td width="114" valign="top" style="border-top: none; border-right: 1pt solid windowtext; border-bottom: 1pt solid black; border-left: none; width: 85.5pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">V</span></p></td><td width="107" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: none; width: 80.1pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: SimSun;">带载</span><span style="font-size: 9pt; font-family: SimSun;">LED</span></p></td></tr><tr><td width="205" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: 1pt solid black; width: 153.9pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: SimSun;">微软手机充电头</span><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">5V 900mA</span></p></td><td width="150" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: none; width: 112.5pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">0.254</span></p></td><td width="114" valign="top" style="border-top: none; border-right: 1pt solid windowtext; border-bottom: 1pt solid black; border-left: none; width: 85.5pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">V</span></p></td><td width="107" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: none; width: 80.1pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: SimSun;">带载</span><span style="font-size: 9pt; font-family: SimSun;">LED</span></p></td></tr><tr><td width="205" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: 1pt solid black; width: 153.9pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">Mophie&nbsp;</span><span style="font-size: 9pt; font-family: SimSun;">无线充电源</span><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">5V 3.0A</span></p></td><td width="150" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: none; width: 112.5pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">0.234</span></p></td><td width="114" valign="top" style="border-top: none; border-right: 1pt solid windowtext; border-bottom: 1pt solid black; border-left: none; width: 85.5pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">VI</span></p></td><td width="107" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: none; width: 80.1pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: SimSun;">带载</span><span style="font-size: 9pt; font-family: SimSun;">LED</span></p></td></tr><tr><td width="205" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: 1pt solid black; width: 153.9pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: SimSun;">老飞利浦手机充电头</span><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">5V 650mA</span></p></td><td width="150" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: none; width: 112.5pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">0.356</span></p></td><td width="114" valign="top" style="border-top: none; border-right: 1pt solid windowtext; border-bottom: 1pt solid black; border-left: none; width: 85.5pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">无标注</span></p></td><td width="107" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: none; width: 80.1pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="font-size: 9pt; font-family: SimSun;">带载</span><span style="font-size: 9pt; font-family: SimSun;">LED</span></p></td></tr><tr><td width="205" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: 1pt solid black; width: 153.9pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><strong><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">TPLink</span></strong><strong><span style="font-size: 9pt; font-family: SimSun;">路由器电源</span></strong><strong><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">5V 600mA</span></strong></p></td><td width="150" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: none; width: 112.5pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><strong><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">1.221</span></strong></p></td><td width="114" valign="top" style="border-top: none; border-right: 1pt solid windowtext; border-bottom: 1pt solid black; border-left: none; width: 85.5pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="color: #303030; font-family: Verdana, sans-serif; font-size: 12px;">无标注</span></p></td><td width="107" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: none; width: 80.1pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><strong><span style="font-size: 9pt; font-family: SimSun;">空载</span></strong></p></td></tr><tr><td width="205" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: 1pt solid black; width: 153.9pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><strong><span style="font-size: 9pt; font-family: SimSun;">水星路由器电源</span></strong><strong><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">5V 600mA</span></strong></p></td><td width="150" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: none; width: 112.5pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><strong><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">1.220</span></strong></p></td><td width="114" valign="top" style="border-top: none; border-right: 1pt solid windowtext; border-bottom: 1pt solid black; border-left: none; width: 85.5pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="color: #303030; font-family: Verdana, sans-serif; font-size: 12px;">无标注</span></p></td><td width="107" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: none; width: 80.1pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><strong><span style="font-size: 9pt; font-family: SimSun;">空载</span></strong></p></td></tr><tr><td width="205" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: 1pt solid black; width: 153.9pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><strong><span style="font-size: 9pt; font-family: SimSun;">杂牌台灯电源</span></strong><strong>&nbsp;</strong><strong><span style="font-size: 9pt; font-family: SimSun;">海尔</span></strong><strong><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">5V 550mA</span></strong></p></td><td width="150" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: none; width: 112.5pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><strong><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;">0.977</span></strong></p></td><td width="114" valign="top" style="border-top: none; border-right: 1pt solid windowtext; border-bottom: 1pt solid black; border-left: none; width: 85.5pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><span style="color: #303030; font-family: Verdana, sans-serif; font-size: 12px;">无标注</span></p></td><td width="107" valign="top" style="border-top: none; border-right: 1pt solid black; border-bottom: 1pt solid black; border-left: none; width: 80.1pt; padding: 0in 5.4pt;"><p style="margin-bottom: 0.0001pt; line-height: normal; word-break: break-all;"><strong><span style="font-size: 9pt; font-family: SimSun;">啸叫</span></strong></p></td></tr></tbody></table><p style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: #303030;"><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;"><br /><br />最终选用了淘汰的微软手机充电头</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">5V</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">供电[实际大于3V就行]，实测总输入功率</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">0.056VA</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">，即使功率因数</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">1.0[</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">实际远远达不到</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">]</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">，算下来</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">1</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">年消耗不足</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">0.5</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">度电。</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">LED</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">发光亮度跟月光接近，对我而言刚刚好。如果觉得光线还不够柔和，</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">LED</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">可以用保鲜膜包一下</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">(</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">或半透明热缩管封一下等措施</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">)</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">。</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">5V</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">电源负载率很低，</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">LED</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">耗电占总功率的</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">15%</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">左右，电源自身损耗占了大约</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">85%</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">。如果觉得光线太暗，可以适当减小电阻增加电流从而增加亮度，例如</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">1K</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">欧姆电阻改为</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">680或</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">470</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">或</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">330</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">或</span><span style="font-size: 12pt; font-family: Arial, sans-serif;">220</span><span style="font-size: 12pt; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">欧姆等。<br /><br />原理就这么简单，如下图。<br /></span><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASUAAACpCAYAAABtYitgAAALE0lEQVR4Ae3dDZKjIBCGYc/lgXIeT5PL5DBsEcMsmhZpI43Iu1UpIyI/D85XJpPJDo5/CCCAwIUEhguNhaEggAACjlDiIkAAgUsJEEqXWg79YIZhcD099EKc0ZoAodTaiq3G6wOpl389zbWXNZXm2c8VLc3+BmU9/aD2NNcbXJqHp0AoHaa7xok9/aD2NNdrXF11RkEo1XE/rdeeflB7mutpF0iDDRFKDS5aPGSLH9TXNApvpo9uesUjKf/cYq7lZ0EPewKE0p7QxY9b/KDOofRwz8hiLrMNJou5RlPkaSUBQqkS/FndWvygSqHk3NM9hsGNhrdLFnM9a11o57gAoXTc7hJnWvygEkqXWOpuBkEoNb7UtULp+fAf2ly+pCtNaTHX0nOg/X0BdSj5C4PHtQz2l/m3GvOd0nLOj/gNpt+azz6b6265Bq155C70oVDKbZx65QX8hVn63/rlW427JD9Hi7mWtuy1fc3aqa9oTeO9LoDlvC3WYx1K4U3uwfh2yWKulmvXU1+atSOUGr8yNIt9dKrfoeScez7edy6WuWQx16NGnJcW0KwdoZS2vPxRzWIfnYwYSu7lpnFwwzg5q89QWsz1qBHnpQU0a0copS0vf1Sz2EcnI4eSc+41udH/4sPodslirkeNOC8toFk7QiltefmjmsW+/GR2BtjTXHcomjusWTtCqbnlXQ5Ys9jLM9vb62mu7a1OesSatSOU0paXP6pZ7MtPZmeAPc11h6K5w5q1I5SaW97lgDWLvTyzvb2e5tre6qRHrFk7QiltefmjfrF7elx+QRigKEAoiSwUIoBALQFCqZY8/SKAgChAKIksFCKAQC0BQqmWPP0igIAoQCiJLBQigEAtAUKpljz9IoCAKEAoiSwUIoBALQFCqZY8/SKAgChAKIksFCKAQC0BQqmWPP0igIAoQCiJLBQigEAtAUKpljz9IoCAKEAoiSwUIoBALQFCqZY8/SKAgChAKIksFCKAQC0BQqmWPP0igIAoQCiJLBQigEAtgWKh5BsOj1qTo18EEGhPoEgorRtd77fHxIgRQMBKQJMX2d/RvW50vW81OfpBAIH2BDR5QSi1t76MGIHmBIqEklfwDYdHcyoMGAEEqgkUC6VqM6JjBBBoWoBQanr5GDwC9xMglO63pswIgaYFCKWml4/BI3A/AULpfmvKjBBoWqBgKD3dY3i4Z9M8DB4BBKwFCCVrcfpDAIGkAKGU5OEgAghYC5wbSq/JjdGHJn3j8ePBaznr9aU/BJoTODeUFtPnPaUFBzsIIJAlQChlMVEJAQSsBAglK2n6QQCBLIGCoZTVP5UQQACBhQChtOBgBwEEagsQSrVXgP4RQGAhQCgtONhBAIHaAoRS7RWgfwQQWAgQSgsOdhBAoLYAoVR7BegfAQQWAoTSgoMdBPoTeE2jGxLf6DEfX/7JmA+O8Gdj8vHRTa9jloTSMTfOQuA2AlmhNE5uK2Pe56+Ph7+DDcml0CKUFFhUReCOAkVC6Q3l//51cKPylolQuuNVxpwQUAiUCyXn9tqWhkkoSSqUIdCRwF5wvI+vX55FPsnj75dxuveXCKUIl6cI9CiQFUqr70aL3xjfD6X/b4rn+BJKOUrUQeDGAlmhxJ3Sja8ApobAxQRKhtJe2xIFd0qSCmUIdCSwFxzv44fulPjtW0eXEVNF4DyBIqH0fMzfz8/nlM5bKFpCoBeBOZS+P7E9fALl2PHj/+cjL996ufKYJwKNCBBKjSwUw0SgFwFCqZeVZp4INCJAKDWyUAwTgV4ECKVeVpp5ItCIAKHUyEIxTAR6ESCUellp5olAIwKEUiMLxTAR6EXANJSej/gDWvLXGcx1tj549XLTOLjwoa5eFol5ItCTgFko+U+Fxp84nz8lKgTT5+Ppcd2/Bfl8xaZ47K8STxBA4MoCPnR+ecRzG+Kd+bn/gzshWL4rfpdsBsz8R3zS3dAcZFt3Ud9dUIIAAjYCqrubQYiSaJipttbH5JbCH95pv4t3M5S2vkJzfumm/b7faK48RQCBAgLroMjpInXO1jGpXA6lvxF87nD8rVniaw7m6jvvDUmB9S47eFf2N0aeIIDA2QJSWOz1kTpn65hUvhNKYRifwPkKpk/55/Vk+o7nO7TeL92+2gx9skUAgRoCUlDkjmPrXKlcKvP9pEPpc3fjT96/Uwov0ba/u3f5/tEcUukgy6WgHgIInCWwFRY57W+dK5VLZb4PMZTm8JjfTdeGxvvX/1u/SotfwvHSLWeNqYOAqcBWUGgGIbWRW+b7EULph9++OeeSoRQdfwffVnhpBKiLAAKnCEjBcaRhqZ112Xo/7kcIpfhw6rkPr+Wv8sMdVjJr/G/2xod7jNsv81K9cgwBBMoIpIJC2+O6rb39uP0fQsn5N5HcuPjQ1DKk4o7+Pw+/0cup+/8sniGAQDmBdWj82tO6vXg/fi7181soSS1ShgACTQnshcTRycTtbj2X2iaUJBXKEOhIIA6MvWkfrRvOC9tUP4RSSodjCNxcICckAoGm7vqccG7YhuPSllCSVChDoBOBnJAIFJq663PCuWEbjktbQklSoQyBDgRyAiIwaOqGc8LWnxseoSy1JZRSOhxD4KYCmpDR1JW4QiDltkMoSYqUIXAzgXUgrPdT09XU3WpH0wahtKVIOQI3EohDIX6+N8Xcur7er48wFkIpSLBF4MYCIVzCNneq2vpb7WraIZS2FClH4EYCIRTibXi+Nc2941vnSeWatgglSZAyBG4m4EMhBEPYpqaYUyd1/vqYpj1Caa3HPgI3FPChEB4509OEyNntEUo5otRBoHGBmoHk6TQhRyg1frExfATOFNCEh6ZfTbuEkkaWugjcXEATHhoKTbuEkkaWugjcTCAOi/j52dPUtE0ona1Pewg0JBCHRfz87Clo2iaUztanPQQaEghhEbalhq5pn1AqtQq0i0ADAj4s4sBY7581hbiPvTYJpT0hjiNwY4EQQmFbaqqEUilZ2kXgZgKlwyhwEUpBgi0CCFxCgFC6xDIwCAQQCAKEUpBgiwAClxAglC6xDAwCAQSCAKEUJNgigMAlBAilSywDg0AAgSBQIJRebhr/fx/LMIxueoXu2CKAAAJpgQKhlO6QowgggEBKgFBK6XAMAQTMBQglc3I6RACBlAChlNLhGAIImAsQSubkdIgAAikBQimlwzEEEDAXIJTMyekQAQRSAoRSSodjCCBgLlAslHzD4WE+KzpEAIFmBYqE0rrR9X6zWgwcAQSKC2jyIvvrcNeNrveLz4oOEECgWQFNXhBKzS4zA0egHYEioeSn7xsOj3Y4GCkCCNQWKBZKfmKaxmtD0D8CCFxDQJMb2S/fwtQ0jYdz2CKAQN8CmtwglPq+Vpg9AiYChJIJM50ggECuAKGUK0U9BBAwESCUTJjpBAEEcgUIpVwp6iGAgIkAoWTCTCcIIJArQCjlSlEPAQRMBAglE2Y6QQCBXAFCKVeKegggYCJAKJkw0wkCCOQKEEq5UtRDAAETAULJhJlOEEAgV4BQypWiHgIImAgQSibMdIIAArkChFKuFPUQQMBEgFAyYaYTBBDIFSCUcqWohwACJgKEkgkznSCAQK4AoZQrRT0EEDARIJRMmOkEAQRyBQilXCnqIYCAiQChZMJMJwggkCtAKOVKUQ8BBEwEioeS74AHBlwDXAOaayA3/dT/71tuw9RDAAEEjggQSkfUOAcBBIoJEErFaGkYAQSOCBBKR9Q4BwEEigkQSsVoaRgBBI4IEEpH1DgHAQSKCRBKxWhpGAEEjgj8A1K08XUVvL0jAAAAAElFTkSuQmCC" alt="" /></p><div><span style="font-family: Arial; font-size: 12pt;"></span></div><br /><span style="font-size: 12pt;">夜间实拍</span><br /><img src="http://www.cppblog.com/images/cppblog_com/chipset/light-in-darkness.JPG" alt="" width="800" height="825" /><br /><span style="font-size: 9pt; line-height: 12.84px; font-family: Verdana, sans-serif; color: #303030;"><br /></span><span style="font-size: 12pt; line-height: 17.12px; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">容易看出，以上方案需要的部件不多[供电头，线，电阻，LED]，操作简单[接上就行，如不亮换下LED方向再接上就亮]，废物利用[用不上的充电头和线、废玩具车车灯和电阻]，成本低廉[元器件不花钱]，耗电极低[上面的是0.056VA]，光线柔和[月光相当]，更重要的是安全高效</span><span style="font-size: 12pt; line-height: 17.12px; font-family: Verdana, sans-serif; color: #303030; background: white;">[</span><span style="font-size: 12pt; line-height: 17.12px; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">手机充电头各种国际认证可有一堆，业界那些廉价低效的小功率LED灯电路能过什么级别的认证</span><span style="font-size: 12pt; line-height: 17.12px; font-family: Verdana, sans-serif; color: #303030; background: white;">]</span><span style="font-size: 12pt; line-height: 17.12px; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">，供电和发光部件可以</span><span style="font-size: 12pt; line-height: 17.12px; font-family: Verdana, sans-serif; color: #303030; background: white;">USB</span><span style="font-size: 12pt; line-height: 17.12px; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">插接分离，灯坏了换灯，电源坏了换电源，</span><span style="font-size: 12pt; line-height: 17.12px; font-family: Verdana, sans-serif; color: #303030; background: white;">LED</span><span style="font-size: 12pt; line-height: 17.12px; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">也可选喜欢的颜色，电源当然也可以非</span><span style="font-size: 12pt; line-height: 17.12px; font-family: Verdana, sans-serif; color: #303030; background: white;">5V</span><span style="font-size: 12pt; line-height: 17.12px; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">，常见的</span><span style="font-size: 12pt; line-height: 17.12px; font-family: Verdana, sans-serif; color: #303030; background: white;">9V</span><span style="font-size: 12pt; line-height: 17.12px; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">，</span><span style="font-size: 12pt; line-height: 17.12px; font-family: Verdana, sans-serif; color: #303030; background: white;">12V</span><span style="font-size: 12pt; line-height: 17.12px; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">等均可，甚至可以用古董铁芯电源，就算交流输出也行，无非并联</span><span style="font-size: 12pt; line-height: 17.12px; font-family: Verdana, sans-serif; color: #303030; background: white;">2</span><span style="font-size: 12pt; line-height: 17.12px; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">个</span><span style="font-size: 12pt; line-height: 17.12px; font-family: Verdana, sans-serif; color: #303030; background: white;">LED</span><span style="font-size: 12pt; line-height: 17.12px; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">极性相反都亮(封装在一起的双向LED也有出售)。<br /><br />如果用较大功率的灯盘替换简单的</span><span style="font-size: 12pt; line-height: 17.12px; font-family: Verdana, sans-serif; color: #303030; background: white;">&nbsp;LED+</span><span style="font-size: 12pt; line-height: 17.12px; font-family: &quot;Microsoft YaHei&quot;, sans-serif;">限流电阻方案，长明灯摇身一变就成为照明灯，用更大功率的充电头供电以及更大功率的灯盘，照明灯功率也会更大</span><span style="font-size: 12pt; line-height: 17.12px; font-family: Verdana, sans-serif; color: #303030; background: white;">。如果用成串的彩色LED代替上述普通白光LED+限流电阻，加个时序通断电路就能起到装饰作用。<br /><br />如果用两节1.5V的5号电池供电能让上述发光器件(一个白光LED和一个1K电阻)连续亮一个月不止，即使一枚3V的纽扣电池也能连续亮一个星期以上，如果用电池夹或者热缩管固定好再加个开关，就成为一个简易的手电筒。</span><img src ="http://www.cppblog.com/Chipset/aggbug/217855.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2021-11-06 22:18 <a href="http://www.cppblog.com/Chipset/archive/2021/11/06/217855.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>茴字不止4种写法 -- C++语法渣一样</title><link>http://www.cppblog.com/Chipset/archive/2021/10/29/217844.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Fri, 29 Oct 2021 10:06:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2021/10/29/217844.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217844.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2021/10/29/217844.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217844.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217844.html</trackback:ping><description><![CDATA[<span style="font-size: 12pt;">不知道标准委员会那帮家伙们干嘛把C++语法搞那么复杂，你倒是多增加一些库不行吗？语法整这么复杂除了增加编译器和Code Review</span><span style="font-size: 16px;">的成本还</span><span style="font-size: 12pt;">有个P用？<br />就拿调用说事吧，下面仅列出很少一部分写法。</span><br /><br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><span style="color: #0000FF; ">int</span>&nbsp;foo(<span style="color: #0000FF; ">int</span>&nbsp;n)<br />{<br />&nbsp;&nbsp;<span style="color: #0000FF; ">int</span>&nbsp;s&nbsp;=&nbsp;1;<br />&nbsp;&nbsp;<span style="color: #0000FF; ">for</span>(;&nbsp;0&nbsp;&lt;&nbsp;n;&nbsp;--n)<br />&nbsp;&nbsp;&nbsp;&nbsp;s&nbsp;*=&nbsp;n;<br />&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;s;<br />}<br /><br /><span style="color: #0000FF; ">class</span>&nbsp;C<br />{<br /><span style="color: #0000FF; ">public</span>:<br />&nbsp;&nbsp;C()&nbsp;=&nbsp;<span style="color: #0000FF; ">default</span>;<br />&nbsp;&nbsp;<span style="color: #0000FF; ">explicit</span>&nbsp;C(<span style="color: #0000FF; ">int</span>&nbsp;a)&nbsp;:&nbsp;y(a)&nbsp;{}<br />&nbsp;&nbsp;~C()&nbsp;=&nbsp;<span style="color: #0000FF; ">default</span>;<br />&nbsp;&nbsp;<span style="color: #0000FF; ">int</span>&nbsp;foo(<span style="color: #0000FF; ">int</span>&nbsp;x)&nbsp;<span style="color: #0000FF; ">const</span>&nbsp;{&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;x&nbsp;+&nbsp;y;&nbsp;}<br /><br /><span style="color: #0000FF; ">private</span>:<br />&nbsp;&nbsp;<span style="color: #0000FF; ">int</span>&nbsp;y;<br />};<br /><br />#include&nbsp;&lt;functional&gt;<br />#include&nbsp;&lt;<span style="color: #0000FF; ">string</span>&gt;<br />#include&nbsp;&lt;iostream&gt;<br /><br /><span style="color: #0000FF; ">int</span>&nbsp;main()<br />{<br />&nbsp;&nbsp;typedef&nbsp;<span style="color: #0000FF; ">int</span>&nbsp;(*f_int_t1)&nbsp;(<span style="color: #0000FF; ">int</span>);&nbsp;<span style="color: #008000; ">//</span><span style="color: #008000; ">&nbsp;the&nbsp;old&nbsp;style</span><span style="color: #008000; "><br /></span>&nbsp;&nbsp;f_int_t1&nbsp;foo_p1&nbsp;=&nbsp;&amp;foo;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000; ">//</span><span style="color: #008000; ">&nbsp;&amp;&nbsp;is&nbsp;redundant&nbsp;and&nbsp;optional</span><span style="color: #008000; "><br /></span>&nbsp;&nbsp;<span style="color: #0000FF; ">using</span>&nbsp;f_int_t2&nbsp;=&nbsp;<span style="color: #0000FF; ">int</span>&nbsp;(*)(<span style="color: #0000FF; ">int</span>);&nbsp;<span style="color: #008000; ">//</span><span style="color: #008000; ">&nbsp;easy&nbsp;to&nbsp;understand</span><span style="color: #008000; "><br /></span>&nbsp;&nbsp;f_int_t2&nbsp;foo_p2&nbsp;=&nbsp;foo;<br />&nbsp;&nbsp;std::function&lt;<span style="color: #0000FF; ">int</span>(<span style="color: #0000FF; ">int</span>)&gt;&nbsp;stdf_foo&nbsp;=&nbsp;&amp;foo;&nbsp;<span style="color: #008000; ">//</span><span style="color: #008000; ">&nbsp;modern</span><span style="color: #008000; "><br /></span><br />&nbsp;&nbsp;<span style="color: #0000FF; ">const</span>&nbsp;std::<span style="color: #0000FF; ">string</span>&nbsp;Sep("&nbsp;");<br />&nbsp;&nbsp;constexpr&nbsp;<span style="color: #0000FF; ">int</span>&nbsp;N&nbsp;=&nbsp;5;<br /><br />&nbsp;&nbsp;std::cout&nbsp;&lt;&lt;&nbsp;"global&nbsp;function:"&nbsp;&lt;&lt;&nbsp;foo(N)&nbsp;&lt;&lt;&nbsp;Sep&nbsp;&lt;&lt;&nbsp;foo_p1(N)&nbsp;&lt;&lt;&nbsp;Sep<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&lt;&nbsp;foo_p2(N)&nbsp;&lt;&lt;&nbsp;Sep&nbsp;&lt;&lt;&nbsp;stdf_foo(N)&nbsp;&lt;&lt;&nbsp;"\n";<br /><br />&nbsp;&nbsp;typedef&nbsp;<span style="color: #0000FF; ">int</span>&nbsp;(C::*&nbsp;f_C_int_t1)&nbsp;(<span style="color: #0000FF; ">int</span>)&nbsp;<span style="color: #0000FF; ">const</span>;<br />&nbsp;&nbsp;f_C_int_t1&nbsp;C_foo_p1&nbsp;=&nbsp;&amp;C::foo;&nbsp;&nbsp;<span style="color: #008000; ">//</span><span style="color: #008000; ">&nbsp;the&nbsp;old&nbsp;style</span><span style="color: #008000; "><br /></span>&nbsp;&nbsp;<span style="color: #0000FF; ">using</span>&nbsp;f_C_int_t2&nbsp;=&nbsp;<span style="color: #0000FF; ">int</span>&nbsp;(C::*)&nbsp;(<span style="color: #0000FF; ">int</span>)&nbsp;<span style="color: #0000FF; ">const</span>;<br />&nbsp;&nbsp;f_C_int_t2&nbsp;C_foo_p2&nbsp;=&nbsp;&amp;C::foo;<br /><br />&nbsp;&nbsp;<span style="color: #0000FF; ">const</span>&nbsp;C&nbsp;c(10);<br />&nbsp;&nbsp;constexpr&nbsp;<span style="color: #0000FF; ">int</span>&nbsp;X&nbsp;=&nbsp;20;<br /><br />&nbsp;&nbsp;std::cout&nbsp;&lt;&lt;&nbsp;"old&nbsp;member&nbsp;call:&nbsp;"&nbsp;&lt;&lt;&nbsp;(c.*C_foo_p1)(X)&nbsp;&lt;&lt;&nbsp;Sep&nbsp;&lt;&lt;&nbsp;(c.*C_foo_p2)(X)&nbsp;&lt;&lt;&nbsp;"\n";<br /><br />&nbsp;&nbsp;std::function&lt;<span style="color: #0000FF; ">int</span>(<span style="color: #0000FF; ">const</span>&nbsp;C&amp;,&nbsp;<span style="color: #0000FF; ">int</span>)&gt;&nbsp;stdf_C_foo&nbsp;=&nbsp;&amp;C::foo;<br />&nbsp;&nbsp;auto&nbsp;greet&nbsp;=&nbsp;std::mem_fn(&amp;C::foo);<br />&nbsp;&nbsp;auto&nbsp;callback&nbsp;=&nbsp;std::bind(&amp;C::foo,&nbsp;&amp;c,&nbsp;std::placeholders::_1);<br />&nbsp;&nbsp;std::cout&nbsp;&lt;&lt;&nbsp;"new&nbsp;member&nbsp;call:&nbsp;"&nbsp;&lt;&lt;&nbsp;stdf_C_foo(c,&nbsp;X)&nbsp;&lt;&lt;&nbsp;Sep&nbsp;&lt;&lt;&nbsp;greet(c,&nbsp;X)&nbsp;&lt;&lt;&nbsp;Sep<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&lt;&nbsp;callback(X)&nbsp;&lt;&lt;&nbsp;"\n";<br /><br />&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;0;<br />}</div><img src ="http://www.cppblog.com/Chipset/aggbug/217844.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2021-10-29 18:06 <a href="http://www.cppblog.com/Chipset/archive/2021/10/29/217844.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>环型铁芯变压器DIY</title><link>http://www.cppblog.com/Chipset/archive/2021/10/16/217835.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Sat, 16 Oct 2021 04:09:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2021/10/16/217835.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217835.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2021/10/16/217835.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217835.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217835.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 自己动手做变压器的根本原因是不愿意交智商税还用垃圾产品，并不是成本低。有目共睹这个时代的商业文化&#8220;一根稻草讲成金条&#8221;，说的直接点就是，"专家"是用来忽悠吃瓜群众的，"专业"是用来忽悠广大客户的。即使你花了再多的钱，买来的还是垃圾一样的货。比如某红、某力西、某泰、某达等，以及某宝上所有高价定制的变压器 一上电就原形毕露，被淘汰设备拆出的洋垃圾变压器虐成渣。做事当然有目的，我绕...&nbsp;&nbsp;<a href='http://www.cppblog.com/Chipset/archive/2021/10/16/217835.html'>阅读全文</a><img src ="http://www.cppblog.com/Chipset/aggbug/217835.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2021-10-16 12:09 <a href="http://www.cppblog.com/Chipset/archive/2021/10/16/217835.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>A Tool to Compare Two PDF Files</title><link>http://www.cppblog.com/Chipset/archive/2021/10/15/217487.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Fri, 15 Oct 2021 02:39:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2021/10/15/217487.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217487.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2021/10/15/217487.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217487.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217487.html</trackback:ping><description><![CDATA[<span style="font-size: 12pt;">杂事太多，一直忙来忙去没时间写点正经的东西。最近写了个工具，用于比较两个PDF文件的不同，把差异点标出来。</span><br /><span style="font-size: 12pt;">后端用Poppler解析PDF文件，然后比较，生成三个html，可用Chrome或Firefox(Edge和IE就悲剧了)打开。<br />查看不同点。</span><span style="font-size: 12pt;">这Poppler虽说免费开源，但Bug无数，真心难用。唉，看在不花钱的份上，忍了...<br /><br /></span><span style="font-size: 12pt;">源代码量3万行的样子，运行依赖33个dll，算法有点复杂，虽然距离我的意愿依旧遥远，但总算见到雏形了。</span><br /><br />下面的截图是简单的比较了两个PDF文件的结果，鼠标点击最右栏就能标出来且能自动对齐变更点，添加或者删除的能对应原始位置。<br /><br /><div><img src="http://www.cppblog.com/images/cppblog_com/chipset/1.png" width="800" height="420" alt="" /><br /><br />下面是个文字变更的逻辑对齐部分截图。文字属性有变更的地方鼠标放上去能弹出不同之处，黑底绿字。<br /><br /><img src="http://www.cppblog.com/images/cppblog_com/chipset/2.png" width="800" height="419" alt="" longdesc="text.html" /><br /><br />下面是单独比较光栅图片的截图，鼠标点击最右栏能自动对齐，添加或删除的则能对应到原始位置，图片变更的会标出所有变更点。<br /><br /><img src="http://www.cppblog.com/images/cppblog_com/chipset/3.png" width="800" height="422" alt="" /></div><span style="font-size: 12pt;"><br />大致就如同前面三个截图的样子(目前缺矢量图的比较)，应该能满足一般的PDF文档比较需求了。<br /></span><span style="font-size: 12pt;"><br /></span><span style="font-size: 12pt;">诸位过客可以下载一个简单用例到</span><span style="font-size: 12pt;">电</span><span style="font-size: 12pt;">脑</span><span style="font-size: 12pt;">上，解压</span><span style="font-size: 16px;">[可以考虑<a href="https://www.7-zip.org/">7z</a>]</span><span style="font-size: 16px;">后</span><span style="font-size: 16px;">，</span><span style="font-size: 12pt;">用</span><span style="font-size: 12pt;">Chrome(或者Firefox，别用Edge和IE)<br />浏览器打开看看效果。</span><span style="font-size: 12pt;">在这里下载</span><span style="font-size: 12pt;"><a href="/Files/Chipset/test.zip" style="font-weight: bold; font-size: 12pt;">/Files/Chipset/test.zip</a></span><span style="font-size: 12pt;"><br /></span><br /><span style="font-size: 12pt;">以上附件很小，麻雀虽小五脏俱全，该有的东西基本都有，可以比较的单个PDF文件1000页以上，且速度很快。<br />以上展示内容用的文字后贴背景页面格式，将来</span><span style="font-size: 16px;">[升级中]解析PDF</span><span style="font-size: 12pt;">用BSD协议的pdfium替换GPL协议的Poppler，<br /></span><span style="font-size: 16px;">页面展示</span><span style="font-size: 16px;">借助PDF.js，但</span><span style="font-size: 12pt;">不再用文字和贴背景这种办法，再接下来做个单机界面，不再用浏览器，算是升级方向吧。<br /><br /></span><span style="font-size: 12pt;">关于比较工具，下面多说几句。<br />做内容比较的工具</span><a href="https://draftable.com/compare"><span style="font-size: 12pt;">Draftable</span></a><span style="font-size: 12pt;">很成功</span><span style="font-size: 12pt;">，用C#写的，可以比较Office和PDF文件，各格式任意混比，只能比文字。<br />我的只能比PDF文件，比较内容是文字和光栅图，有个Kiwi free pdf comparer类似，只不过需要Java运行环境。<br />此外，ABBY的Fine Reader和Adobe的Acrobat也都有比较功</span><span style="font-size: 16px;">能，只不过精度和速度都明显弱一些。</span><span style="font-size: 12pt;">至于视觉<br />比较的工具，由于跟位置有关，大多数场合几乎等同于废物，这种网上一搜一大把，很多免费。纯文本内容的比较<br />工具就更多了，网上一搜一大堆，这里就不必啰嗦了。<br /></span><img src ="http://www.cppblog.com/Chipset/aggbug/217487.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2021-10-15 10:39 <a href="http://www.cppblog.com/Chipset/archive/2021/10/15/217487.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Windows下编译和安装poppler</title><link>http://www.cppblog.com/Chipset/archive/2021/10/15/217526.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Fri, 15 Oct 2021 02:36:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2021/10/15/217526.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217526.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2021/10/15/217526.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217526.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217526.html</trackback:ping><description><![CDATA[<p><span style="font-family: Arial; font-size: 12pt;">Linux上编译poppler很容易，这里懒得罗嗦。Windows上编译poppler的方法在网上一搜一大堆，实测确实遇到过一个成功的(vcpkg)，但是编译出来</span><span style="font-family: Arial; font-size: 12pt;">的Rel版</span><span style="font-family: Arial; font-size: 12pt;">二进制很大，而且不能编译成QT和GLIB版本。</span><span style="font-family: Arial; font-size: 12pt;">这里介绍另一种方法，供后来者参考，希望能节约你一些时间。</span></p><p><span style="font-family: Arial; font-size: 12pt;"><br /></span><span style="font-size: 12pt; font-family: Arial;">实测E文Windows，Edition: Windows 10 Pro, Version: 2H2 Build: 19042.572 上OK。</span><span style="font-size: 12pt; font-family: Arial;">实测虚拟机上Win7 Ultimate Sp1&nbsp;</span><span style="font-size: 16px; font-family: Arial;">64位</span><span style="font-size: 12pt; font-family: Arial;">上也OK。</span><span style="font-size: 12pt; font-family: Arial;">实测虚拟机上Windows XP Pro, Sp2 32位上编译能成功，但结果不可用。如果你仍在用Windows XP，没有必要继续浏览此文。</span><span style="font-size: 12pt;"></span></p><p><span style="font-family:DengXian;"><br /></span><span style="font-family: Arial; font-size: 12pt;">免费的</span><span style="font-size: 12pt; font-family: Arial;">SDK</span><span style="font-family: Arial; font-size: 12pt;">解析</span><span style="font-size: 12pt; font-family: Arial;">PDF</span><span style="font-family: Arial; font-size: 12pt;">文件可选的有</span><span style="font-size: 12pt; font-family: Arial;">Poppler, MuPDF, PDFium</span><span style="font-family: Arial; font-size: 12pt;">等，三者中最后一个</span><span style="font-size: 12pt; font-family: Arial;">Apache</span><span style="font-family: Arial; font-size: 12pt;">协议，最宽松，</span><span style="font-size: 12pt; font-family: Arial;">Bug</span><span style="font-family: Arial; font-size: 12pt;">也最少，是最佳之选，只可惜在土鳖国下载谷歌的东西很困难，</span><span style="font-size: 12pt; font-family: Arial;">github</span><span style="font-family: Arial; font-size: 12pt;">上有编译好的二进制，只不过内嵌签名，如果一般性质的使用，是个很好的选择[<a href="https://github.com/bblanchon/pdfium-binaries">https://github.com/bblanchon/pdfium-binaries</a>]。</span><span style="font-size: 12pt; font-family: Arial;">MuPDF</span><span style="font-family: Arial; font-size: 12pt;">要么购买要么</span><span style="font-size: 12pt; font-family: Arial;">AGPL</span><span style="font-family: Arial; font-size: 12pt;">协议，对于多数人不可用 [<a href="https://mupdf.com/downloads/index.html">https://mupdf.com/downloads/index.html</a>]。最后只剩下</span><span style="font-size: 12pt; font-family: Arial;">Poppler</span><span style="font-family: Arial; font-size: 12pt;">可选，尽管</span><span style="font-size: 12pt; font-family: Arial;">GPL</span><span style="font-family: Arial; font-size: 12pt;">协议，而且获取容易，进程间通信也可以商用。当然，如果学生练手，不用关心版权，任何一个都可用。<br /><br /></span></p>  <p><span style="font-family: Arial; font-size: 12pt;">安装</span><span style="font-size: 12pt; font-family: Arial;">poppler</span><span style="font-family: Arial; font-size: 12pt;">最简单的办法就是通过</span><span style="font-size: 12pt; font-family: Arial;">msys2(</span><span style="font-family: Arial; font-size: 12pt;">可能</span><span style="font-size: 12pt; font-family: Arial;">cygwin</span><span style="font-family: Arial; font-size: 12pt;">也行</span><span style="font-size: 12pt; font-family: Arial;">)</span><span style="font-family: Arial; font-size: 12pt;">，先把</span><span style="font-size: 12pt; font-family: Arial;">msys2 [</span><span style="font-family: Arial; font-size: 12pt;">选</span><span style="font-size: 12pt; font-family: Arial;">64</span><span style="font-family: Arial; font-size: 12pt;">位</span><span style="font-size: 12pt; font-family: Arial;">] </span><span style="font-family: Arial; font-size: 12pt;">装上，再把开发工具系列以及</span><span style="font-size: 12pt; font-family: Arial;">poppler</span><span style="font-family: Arial; font-size: 12pt;">的依赖</span><span style="font-size: 12pt; font-family: Arial;">(cairo, iconv, glib, boost, lcms2, zlib, png, tiff, jpeg</span><span style="font-family: Arial; font-size: 12pt;">等等很多</span><span style="font-size: 12pt; font-family: Arial;">)</span><span style="font-family: Arial; font-size: 12pt;">都装上，如果用</span><span style="font-size: 12pt; font-family: Arial;">QT</span><span style="font-family: Arial; font-size: 12pt;">也得装</span><span style="font-size: 12pt; font-family: Arial;">QT</span><span style="font-family: Arial; font-size: 12pt;">，用</span><span style="font-size: 12pt; font-family: Arial;">GTK</span><span style="font-family: Arial; font-size: 12pt;">就得装</span><span style="font-size: 12pt; font-family: Arial;">GTK</span><span style="font-family: Arial; font-size: 12pt;">。其实</span><span style="font-size: 12pt; font-family: Arial;">msys2</span><span style="font-family: Arial; font-size: 12pt;">里面就有</span><span style="font-size: 12pt; font-family: Arial;">poppler</span><span style="font-family: Arial; font-size: 12pt;">了</span><span style="font-size: 12pt; font-family: Arial;">(mingw</span><span style="font-family: Arial; font-size: 12pt;">编译的版本</span><span style="font-size: 12pt; font-family: Arial;">)</span><span style="font-family: Arial; font-size: 12pt;">，装上就行。但是如果需要特定环境使用，比如</span><span style="font-size: 12pt; font-family: Arial;">Visual Studio</span><span style="font-family: Arial; font-size: 12pt;">，或者觉得msys2里的poppler版本不好用[我测试觉得它不太好用]，那就得自己编译</span><span style="font-family: Arial; font-size: 12pt;">。安装</span><span style="font-size: 12pt; font-family: Arial;">msys2</span><span style="font-family: Arial; font-size: 12pt;">和开发环境的方法网上一搜一大堆，这里就不罗嗦了。<br /><br /></span><span style="font-family: Arial; font-size: 12pt;">固然不排除有人勇气可嘉，想独立编译</span><span style="font-size: 12pt; font-family: Arial;">poppler试试</span><span style="font-family: Arial; font-size: 12pt;">，我不是在此泼冷水，</span><span style="font-size: 12pt; font-family: Arial;">poppler</span><span style="font-family: Arial; font-size: 12pt;">依赖几十个</span><span style="font-size: 12pt; font-family: Arial;">dll</span><span style="font-family: Arial; font-size: 12pt;">，把这些依赖找全自己独立编译的想法根本不现实，因为编译依赖时还需要一大堆别的依赖，由于网络原因很难都顺利下载下来，即使都下载下来，编译方法各式各样，有些用常规方法根本就编译不过。我曾经编译过Poppler 0.59版就用的这个套路，最后不得不修改了很多源代码才编译成功，得到一个可用的版本。想到编译的艰辛过程，poppler 0.59版我用了一年没升级...<br /><br /></span><span style="font-family: Arial; font-size: 12pt;">装完了msys2把编译器MinGW和make(可能是mingw32-make)加到PATH路径里，一般是***/mingw64/bin<br /><br /></span></p>  <p><span style="font-family: Arial; font-size: 12pt;">接下来把</span><span style="font-size: 12pt; font-family: Arial;">CMake</span><span style="font-family: Arial; font-size: 12pt;">装上，可在这里下载</span><a href="https://cmake.org/files/"><span style="font-size: 12pt; font-family: Arial;">https://cmake.org/files/</span></a><span style="font-family: DengXian; font-size: 12pt;"><br /><br /></span></p>  <p><span style="font-family: Arial; font-size: 12pt;">把</span><span style="font-size: 12pt; font-family: Arial;">Poppler</span><span style="font-family: Arial; font-size: 12pt;">下载下来，地址</span><span style="font-size: 12pt;"><a href="https://poppler.freedesktop.org/"><span style="font-family: Arial; font-size: 12pt;">https://poppler.freedesktop.org/</span></a>&nbsp;</span><span style="font-family: Arial; font-size: 12pt;">注意别忘了字体，因此</span><span style="font-size: 12pt; font-family: Arial;">poppler-data</span><span style="font-family: Arial; font-size: 12pt;">也需要，在安装完</span><span style="font-size: 12pt; font-family: Arial;">poppler</span><span style="font-family: Arial; font-size: 12pt;">再装它<br /><br /></span></p>  <p><span style="font-family: Arial; font-size: 12pt;">编译</span><span style="font-size: 12pt; font-family: Arial;">poppler</span><span style="font-family: Arial; font-size: 12pt;">可用</span><span style="font-size: 12pt; font-family: Arial;">Visual Studio</span><span style="font-family: Arial; font-size: 12pt;">或者</span><span style="font-size: 12pt; font-family: Arial;">mingw[</span><span style="font-family: Arial; font-size: 12pt;">前面</span><span style="font-size: 12pt; font-family: Arial;">msys2</span><span style="font-family: Arial; font-size: 12pt;">里装了</span><span style="font-size: 12pt; font-family: Arial;">]</span><span style="font-family: Arial; font-size: 12pt;">，前者需要</span><span style="font-size: 12pt; font-family: Arial;">vcpkg</span><span style="font-family: Arial; font-size: 12pt;">用</span><span style="font-size: 12pt; font-family: Arial;">power shell</span><span style="font-family: Arial; font-size: 12pt;">命令编译，由于有一堆依赖的库，</span><span style="font-size: 12pt; font-family: Arial;">vcpkg</span><span style="font-family: Arial; font-size: 12pt;">编译前需要逐个下载那些依赖再编译，这个套路理论上没问题，但实际操作起来很难成功，这跟前面想独立编译</span><span style="font-size: 12pt; font-family: Arial;">poppler</span><span style="font-family: Arial; font-size: 12pt;">的想法如出一辙，因为有些依赖的库太难下载</span><span style="font-size: 12pt; font-family: Arial;">[</span><span style="font-family: Arial; font-size: 12pt;">也许因为我这里网络太糟</span><span style="font-size: 12pt; font-family: Arial;">?]。配合msys2安装依赖，用mingw编译poppler要容易的太多</span><span style="font-family: Arial; font-size: 12pt;">。<br /><br /></span></p>  <p><span style="font-family: Arial; font-size: 12pt;">较新的poppler只能编译64位版本可用，如果想编译</span><span style="font-size: 12pt; font-family: Arial;">32</span><span style="font-family: Arial; font-size: 12pt;">位</span><span style="font-size: 12pt; font-family: Arial;">poppler</span><span style="font-family: Arial; font-size: 12pt;">也能成功，但编译完没法在32位系统上用，因为依赖的库有些在</span><span style="font-size: 12pt; font-family: Arial;">32</span><span style="font-family: Arial; font-size: 12pt;">位系统下无法运行，即使在</span><span style="font-size: 12pt; font-family: Arial;">32</span><span style="font-family: Arial; font-size: 12pt;">位系统上编译出</span><span style="font-size: 12pt; font-family: Arial;">32</span><span style="font-family: Arial; font-size: 12pt;">位的</span><span style="font-size: 12pt; font-family: Arial;">poppler</span><span style="font-family: Arial; font-size: 12pt;">也用不了，我在虚拟机上测试过多次，这样看来，曾经流行但老旧的</span><span style="font-size: 12pt; font-family: Arial;">32</span><span style="font-family: Arial; font-size: 12pt;">位</span><span style="font-size: 12pt; font-family: Arial;">Windows Xp</span><span style="font-family: Arial; font-size: 12pt;"> 上没法用</span><span style="font-size: 12pt; font-family: Arial;">poppler</span><span style="font-family: Arial; font-size: 12pt;">了，好在这年头用Xp的人很少。<br /><br /></span></p>  <p><span style="font-family: Arial; font-size: 12pt;">下载</span><span style="font-size: 12pt; font-family: Arial;">poppler</span><span style="font-family: Arial; font-size: 12pt;">源码后解压</span><span style="font-size: 12pt; font-family: Arial;">(</span><span style="font-family: Arial; font-size: 12pt;">可用</span><span style="font-size: 12pt; font-family: Arial;">7-Zip)</span><span style="font-family: Arial; font-size: 12pt;">，然后打开</span><span style="font-size: 12pt; font-family: Arial;">cmake-gui</span><span style="font-family: Arial; font-size: 12pt;">选择源代码路径和存放的目标文件夹编译就行了。如果希望出现</span><span style="font-size: 12pt; font-family: Arial;">.lib</span><span style="font-family: Arial; font-size: 12pt;">别忘了勾选CMAKE_</span><span style="font-size: 12pt; font-family: Arial;">GNUtoMS</span><span style="font-family: Arial; font-size: 12pt;">选项，编译最好指定</span><span style="font-size: 12pt; font-family: Arial;">Release</span><span style="font-family: Arial; font-size: 12pt;">版，否则默认编译的</span><span style="font-size: 12pt; font-family: Arial;">Debug</span><span style="font-family: Arial; font-size: 12pt;">版体积巨大，安装路径里不能有空格，因为安装时需要</span><span style="font-size: 12pt; font-family: Arial;">ming32-make[有人见过mingw64-make吗？]</span><span style="font-family: Arial; font-size: 12pt;">，它不支持路径里有空格。如果硬件不是骨灰级，编译时可开启多任务，我用的电脑CPU是</span><span style="font-size: 12pt; font-family: Arial;">i7-8700，</span><span style="font-family: Arial; font-size: 12pt;">直接命令行</span><span style="font-size: 12pt; font-family: Arial;">mingw32-make &#8211;j12编译需要几分钟的样子</span><br /><br /><span style="font-size: 12pt; font-family: Arial;">下面不要选Visual Studio ***，应该选MinGW Makefiles</span><br /><img src="http://www.cppblog.com/images/cppblog_com/chipset/poppler1.png" alt="" width="755" height="620" /><br /><span style="font-size: 12pt;"><br />需要哪些选项勾选上，Configure失败的回到前面msys2里装上再重来，这个过程可能需要往复多次。<br />编译前最好指定Release版，如果不用手工指定，会默认编译Debug版，那样编译出的dll体积巨大！</span></p>  <p>&nbsp;<img src="http://www.cppblog.com/images/cppblog_com/chipset/poppler2.png" alt="" width="751" height="847" /><br /><img src="http://www.cppblog.com/images/cppblog_com/chipset/poppler3.png" alt="" width="758" height="848" /><br /><br /><span style="font-size: 12pt;">如果前面勾选了CMAKE_GNUtoMS，编译中还会用到Visual Studio，而且编译器版本不能太低。</span><br /><img src="http://www.cppblog.com/images/cppblog_com/chipset/poppler4.png" alt="" /><br /><br /><span style="font-size: 12pt;">编译完用命令装mingw32-make install，会装到前面指定的路径c:/poppler/vc下，接下来再安装poppler-data<br />套路一样，由于它不需要依赖，要容易很多。</span><br /></p><p><span style="font-size: 12pt;"><br />由于我不用Visual Studio，因此CMAKE_GNUtoMS勾选后编译的结果在Visual Studio下是否能用不知道，不过<br />不勾选该项时用MinGW编译的版本是没有任何问题的，我用poppler解析PDF文件做比对工具就用上述方法编译的。<br /></span></p><p><a href="http://www.cppblog.com/Chipset/archive/2020/10/23/217487.html">http://www.cppblog.com/Chipset/archive/2020/10/23/217487.html</a></p><img src ="http://www.cppblog.com/Chipset/aggbug/217526.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2021-10-15 10:36 <a href="http://www.cppblog.com/Chipset/archive/2021/10/15/217526.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>娃英语听说</title><link>http://www.cppblog.com/Chipset/archive/2021/09/05/217801.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Sun, 05 Sep 2021 03:02:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2021/09/05/217801.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217801.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2021/09/05/217801.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217801.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217801.html</trackback:ping><description><![CDATA[<span style="font-size: 12pt; font-family: Arial;">选教材：</span><span style="font-family: DengXian; font-size: 12pt;" lang="ZH-CN"><a href="http://www.cppblog.com/Chipset/archive/2021/08/11/217695.html"><span style="font-size: 12pt; font-family: Arial;">http://www.cppblog.com/Chipset/archive/2021/08/11/217695.html</span></a></span><br /><span style="font-family: DengXian; font-size: 12pt;" lang="ZH-CN"></span><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">背单词：<a href="http://www.cppblog.com/Chipset/archive/2021/08/11/217696.html"><span style="font-size: 12pt; font-family: Arial;">http://www.cppblog.com/Chipset/archive/2021/08/11/217696.html<br /><br /></span></a><span style="color: #ff0000; text-align: justify; background-color: #ffffff; font-size: 12pt;">友好提醒：别盲目跟随，请量力而行。</span></span></p><p class="MsoNormal"><span style="font-family: DengXian; font-size: 12pt;" lang="ZH-CN"><br style="font-size: 12pt; font-family: Verdana;" /></span></p><p class="MsoNormal"><span style="font-family: Verdana; font-size: 12pt;" lang="ZH-CN"></span><span style="font-family: Verdana; font-size: 12pt;" lang="ZH-CN">实用至上，可能只适合小众[适合大众的只能培育搬砖工]，相信大部分人士没必要在此浪费时间</span><span style="font-family: Verdana; font-size: 12pt;" lang="ZH-CN">，</span><span style="font-family: Verdana; font-size: 12pt;" lang="ZH-CN">实用至上比高分至上困难很多倍，打算看下去就提前做好心理准备吧。</span><span style="font-family: DengXian; font-size: 12pt;" lang="ZH-CN"><br /></span></p><p class="MsoNormal"><span style="font-family: DengXian; font-size: 12pt;" lang="ZH-CN"><br /></span></p><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">现实中很多人学了十几年英语，面对老外时还会紧张，大部分人士听不懂老外说什么，更谈不上随意交流。多数反映是，好不容易捕捉到少数几个词，还在那冥思苦想的时候，老外都说了很大一段统统错过了</span><span style="font-family: Arial; font-size: 12pt;">... 如果能听懂，就算说的慢，老外也会等你，如果压根就听不懂，根本没法交流。举个现实点的例子吧，多数跨国公司待遇福利都不错，也没有那么多的潜规则，不过招聘新人时除了笔试之外往往</span><span style="font-family: Arial; font-size: 12pt;"></span><span style="font-family: Arial; font-size: 12pt;">还要</span><span style="font-family: Arial; font-size: 12pt;">面试，看重能力，是骡子是马出来溜溜呗...</span><span style="font-family: Arial; font-size: 12pt;"><span style="font-family: Arial; font-size: 12pt;">说来也怪，很多把&#8220;女人当男人用, 男人当畜生用&#8221;的企业却往往更看重学校牌子和等级证书...</span></span></p><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;"><span style="font-family: Arial; font-size: 12pt;"><br /></span></span></p>



<p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">废话少絮，步入正题。我们布边本上完全取消了音标，词汇表就是英对汉，专家们说应该自然拼读。</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">人家英语母语的娃书上还有音标呢，却让二外的娃们玩自然拼读</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">。既然觉得自然拼读这么好，为何不把小学语文上拼音全去掉推行自然拼读呢？这个果度很多事看破不能说破...</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"></span></span></p><p class="MsoNormal"><span style="font-size: 12pt;">Reach E</span><br /><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"></span></p><p class="MsoNormal"><span style="font-family:SimSun;mso-bidi-font-family:SimSun" lang="ZH-CN"><img src="http://www.cppblog.com/images/cppblog_com/chipset/pronunciation.JPG" alt="" width="1150" height="769" /><br /></span></p><p class="MsoNormal"><span style="font-family: Verdana; font-size: 12pt;" lang="ZH-CN">Wonders G2</span><span style="font-family: Verdana;" lang="ZH-CN"><br /></span></p><p class="MsoNormal"><span style="font-family:SimSun;mso-bidi-font-family:SimSun" lang="ZH-CN"><img src="http://www.cppblog.com/images/cppblog_com/chipset/pronunciation2.JPG" alt="" width="1150" height="862" /><br /></span></p><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><br /></span></span></span></p><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">没音标就没音标，大不了去补习班学，</span></span></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">这是过去，现在</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">补习班也禁掉了。这下好，吃瓜一族们自己看着办吧...</span></span></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">有钱的破费一点</span></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"></span></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">一对一外教？地下补习班？其实认可放养和补习班</span></span><span style="font-family: Arial; font-size: 12pt;">一族</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">的人士没有必要看本文[也没必要看我写的每一篇娃学英语的文]。如果腰包紧张，可以看看下面的路数，可不保证一定适合你家娃</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">...</span></p><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><br /></span></span></p><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">上小学前，从</span><span style="font-size: 12pt; font-family: Arial;">26</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">个字母开始，然后是音标，元音变化比较大，辅音容易拼一些。下面例子的地址用浏览器里打开就能听到或者看到了，耐心点，外网可能很慢&nbsp;</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">[资源全部取自公网，如果发现侵权则删除]</span></p><p class="MsoNormal"><span style="font-family:SimSun;mso-bidi-font-family:SimSun" lang="ZH-CN"><br /></span></p>

<p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">英语字</span><span style="font-size: 12pt; font-family: Arial;">母歌 <a href="https://1drv.ms/v/s!Al6txEwD06L5gVjDDH1k7YAs1zC_?e=wEhJpY"><span style="font-family: Arial; font-size: 12pt;">https://1drv.ms/v/s!Al6txEwD06L5gVjDDH1k7YAs1zC_?e=wEhJpY</span></a></span><br />
<span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">元音音标 </span><span style="font-size: 12pt;"><a href="https://1drv.ms/v/s!Al6txEwD06L5gVAdj15-J-rXUS0E?e=zJVvbz"><span style="font-family: Arial; font-size: 12pt;">https://1drv.ms/v/s!Al6txEwD06L5gVAdj15-J-rXUS0E?e=zJVvbz</span></a></span><br />
<span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">辅</span><span style="font-size: 12pt; font-family: Arial;">音音标 <a href="https://1drv.ms/v/s!Al6txEwD06L5gVR4c4eD9yAveFK5?e=5jkqiu"><span style="font-family: Arial; font-size: 12pt;">https://1drv.ms/v/s!Al6txEwD06L5gVR4c4eD9yAveFK5?e=5jkqiu</span></a></span></p><p class="MsoNormal"><br /></p>

<p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">实际操作起来尽量灵活一些，不要长时间对着屏幕，否则可能严重影响视力，可以买张挂图什么的贴墙上，为了学某个音标，至少学2-3个相应的单词，否则不容易记忆。一旦学会了基本的音标，再训练一些词和句的拼读，学会自己查词典，对于国内的娃，小学前能达到这程度就不错了。接下来就是长句和段落，信息时代，各种资源很多，充分利用呗。如果不知道从哪里起步，可以试试</span><a href="http://www.cppblog.com/Chipset/archive/2021/08/11/217695.html"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"></span><span style="font-size: 12pt; font-family: Arial;">Backpack</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"></span></a><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">随书碟片放电脑上播放，</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">按题目要求对着电脑听说。</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">对应的</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">Workbook</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">每个单元有3个</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">听力</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">题目，可以事先把录音文件拷贝到手机里播放，让娃边听边做题目。Backback 是针对二外的，文章很短，我猜大多数娃学听录音和回答问题没啥压力，限于版权，这里不提供例子。值得一提的是，训练听说的教材有很多[视频音频也很多]，Backpack配套练习算是比较弱的。<br /><br /></span><span style="font-family: Arial; font-size: 12pt; color: red;" lang="ZH-CN"><strong>本文例子里有的字幕个别单词拼写错误，拼读也偶尔有不对的。固然，这也没啥大不了的，我们平时用汉语也存在类似情况。</strong></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"></span></p><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><br /></span></p><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">下面提供一个简单对话的例子，和一个很简单的故事&nbsp;</span><span style="font-family: Arial; font-size: 12pt;">三只小猪</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">，这个难度算基础吧</span><span style="font-family: Arial; font-size: 12pt;">。</span></p><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">日常对话&nbsp;<a href="https://1drv.ms/v/s!Al6txEwD06L5gV6yn4kaMSZFEeyH?e=zVn11i"><span style="font-size: 12pt;">https://1drv.ms/v/s!Al6txEwD06L5gV6yn4kaMSZFEeyH?e=zVn11i</span><br /></a></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">简单故事&nbsp;</span><a href="https://1drv.ms/v/s!Al6txEwD06L5gWQ_cVUIJWz1SWyk"><span style="font-size: 12pt;">https://1drv.ms/v/s!Al6txEwD06L5gWQ_cVUIJWz1SWyk</span></a></p><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><a href="https://1drv.ms/v/s!Al6txEwD06L5gV6yn4kaMSZFEeyH?e=zVn11i"><br /></a></span></p><p class="MsoNormal"><span style="font-size: 12pt;">这里提一下口音问题，曾经烂大街的广告宣传&#8220;纯正的xx英语&#8221;就是纯正的智商税。以汉语为例，都说普通话，一个人分别来自北京，上海，广州，湖南，四川，陕西，之间交流不会有太大问题，尽管互相听着别扭。英语也是一样，更何况来自不同的国家。下面的自我介绍分别有美国人，英国人，加拿大人，澳大利亚人，新西兰人，各自口音有差异，几乎不影响理解，其实受过高等教育的德国人(二外)，甚至非洲某个英国殖民地国家的人都讲英语，一般都能听懂</span><span style="font-size: 12pt;">！</span></p><p class="MsoNormal"><span style="font-size: 12pt;"><br /></span></p><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">自我介绍&nbsp;</span><a href="https://1drv.ms/v/s!Al6txEwD06L5gWHU17Hg9uYyAwDF?e=CRdH8n" style="font-size: 12pt;"><span style="font-size: 12pt; font-family: Verdana;">https://1drv.ms/v/s!Al6txEwD06L5gWHU17Hg9uYyAwDF?e=CRdH8n<br /><br /></span></a></p><p class="MsoNormal"><span style="font-size: 12pt; font-family: Arial;">听说中免不了词汇和语法，</span><span style="font-family: Arial; font-size: 12pt;">下面举例，</span><span style="font-family: Arial; font-size: 12pt;">专有词汇和习惯用语需要积累。</span></p><p class="MsoNormal"><span style="font-size: 12pt;">词汇&nbsp;</span><a href="https://1drv.ms/v/s!Al6txEwD06L5gWLJKYq4CUD18TRo?e=6E2dB3"><span style="font-size: 12pt;">https://1drv.ms/v/s!Al6txEwD06L5gWLJKYq4CUD18TRo?e=6E2dB3</span></a></p><p class="MsoNormal"></p><div><span style="font-size: 12pt;">语法&nbsp;</span><a href="https://1drv.ms/v/s!Al6txEwD06L5gWN3YjaX3GlL9_-k?e=j8KkDF"><span style="font-size: 12pt;">https://1drv.ms/v/s!Al6txEwD06L5gWN3YjaX3GlL9-k?e=sutRsR<br /></span></a></div><p class="MsoNormal"><a href="https://1drv.ms/v/s!Al6txEwD06L5gWHU17Hg9uYyAwDF?e=CRdH8n" style="font-size: 12pt;"><span style="font-size: 10pt; font-family: Verdana;"><br /></span></a></p><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">学习语法和词汇仅靠听说积累不现实，需要学短文。学完全文后还要复述(recall或retell)，也有的文章训练拼读(Read aloud)。</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">不要觉得这很低效，没有老外天天陪同的环境，这可能是训练说最好的办法[其实</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">用Reach和Wonders教材的米帝娃天天英语环境也是这么训练的]。</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">这是一个循序渐进训练听说的过程，需要一番苦练，就算娃再聪明绝顶，时间上也得用月来算。</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"></span></p><p class="MsoNormal"><span style="font-family:SimSun;mso-bidi-font-family:SimSun" lang="ZH-CN"><br /></span></p>

<p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">下面有几个(小学</span><span style="font-size: 12pt; font-family: Arial;">5</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">年级课文)录音的例子，文章相对比较长</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">。&#8221;<a href="http://www.cppblog.com/Chipset/archive/2021/08/11/217695.html"><span style="font-size: 12pt;">给娃选教材</span></a></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">&#8220;里有课文内容。</span></p>

<p class="MsoNormal"><span style="font-size: 12pt; font-family: Arial;">Wonders G5读写教程选文A Fresh Idea </span><span style="font-size: 12pt;"><a href="https://1drv.ms/u/s!Al6txEwD06L5gVOKucx3dKssp3zX?e=EEHdbh"><span style="font-family: Arial; font-size: 12pt;">https://1drv.ms/u/s!Al6txEwD06L5gVOKucx3dKssp3zX?e=EEHdbh</span></a></span><br /><span style="font-size: 12pt; font-family: Arial;">
Reach F上选文Coyote and Badger </span><span style="font-size: 12pt;"><a href="https://1drv.ms/u/s!Al6txEwD06L5gVJubdtC4dlqLVjt?e=glGj4S"><span style="font-family: Arial; font-size: 12pt;">https://1drv.ms/u/s!Al6txEwD06L5gVJubdtC4dlqLVjt?e=glGj4S</span></a></span><br /><span style="font-size: 12pt; font-family: Arial;">
Wonders G5文学欣赏选文Weslandia <a href="https://1drv.ms/u/s!Al6txEwD06L5gVJubdtC4dlqLVjt?e=glGj4S"><span style="font-family: Arial; font-size: 12pt;">https://1drv.ms/u/s!Al6txEwD06L5gVGqcl5gTFr49o7Y?e=mhyc7i<br /></span></a><br /></span></p><p class="MsoNormal"><span style="font-size: 12pt;">值得一提的是，前面既然用教材(例如Backpack，Wonders等)，就应该和其他方面(读懂课文，了解语法和词汇等)一起结合起来系统化的学习，不要仅仅训练听说。</span><br /><span style="font-size: 12pt; font-family: Arial;"></span></p><p class="MsoNormal"><br /></p>

<p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">以上课文有点长，不过语速慢，可分段分章节训练，一般娃应该压力不大。一旦轻车熟路了(也可以不必等到这个时候)，就可以试着干点别的了，例如听歌、看电影等，不过这种提升听力的方法不是很见效，除非不介意反复听，下面继续举例</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">。</span></p>

<p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">歌曲 </span><span style="font-size: 12pt; font-family: Arial;">How Far I'll Go </span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><a href="https://1drv.ms/u/s!Al6txEwD06L5gVrNTPEDZ7QVpl1d?e=y3V2We"><span style="font-family: Arial; font-size: 12pt;">https://1drv.ms/u/s!Al6txEwD06L5gVrNTPEDZ7QVpl1d?e=y3V2We</span></a><br /></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><span style="font-size: 12pt;">卡拉OK</span></span><span style="font-size: 12pt; font-family: Arial;"> <a href="https://1drv.ms/v/s!Al6txEwD06L5gWBD0XG4WwxvvKrD?e=YGiWji"><span style="font-size: 12pt;">https://1drv.ms/v/s!Al6txEwD06L5gWBD0XG4WwxvvKrD?e=YGiWji<br /></span></a></span><span style="font-size: 12pt;">为了激发学习兴趣，对于先天有点音乐细胞的娃，可以鼓励会唱1~2首歌曲[卡拉OK半轴乐网上有的是]。<br /><br />还有故事，</span><span style="font-size: 12pt;">听完看完不能嘻嘻哈哈完事，对于喜欢的故事到达能讲给别人听的程度(例如 先汉语再逐渐过渡到英语，简单故事逐渐过度到长故事)，下面举例。</span></p><p class="MsoNormal"><span style="font-size: 12pt; font-family: Arial;"></span></p>

<p class="MsoNormal"><span style="font-size: 12pt; font-family: Arial;">故事1&nbsp;<span style="font-family: Arial; font-size: 12pt;"><a href="https://1drv.ms/v/s!Al6txEwD06L5gVnr_70m6OD-h7SI?e=u5kFXg"><span style="font-size: 12pt;">https://1drv.ms/v/s!Al6txEwD06L5gVnr_70m6OD-h7SI?e=u5kFXg</span><br /></a></span><span style="font-family: Arial; font-size: 12pt;">故事2&nbsp;</span></span><a href="https://1drv.ms/v/s!Al6txEwD06L5gWWP_Yaun3j7S_GT?e=7X0isg"><span style="font-size: 12pt;">https://1drv.ms/v/s!Al6txEwD06L5gWWP_Yaun3j7S_GT?e=7X0isg</span></a></p><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;">以上例子很简单，现实中的E文电影要难一些，因为口音和俚语多且杂，例如&nbsp;</span><span style="font-family: Arial; font-size: 12pt;">Puss in Boots, Frozen,&nbsp;</span><span style="font-family: Arial; font-size: 12pt;">Big Hero 6, Zootopia, Moana, Jungle Book, Boss Baby...</span></p><p class="MsoNormal"><br /></p>

<p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">等以上感觉良好了，可以试试实际应用，估计对多数人来说还会有些难度，其实又是一个新的适应过程</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">而已。</span></p>

<p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">科普文 </span><span style="font-size: 12pt;"><a href="https://1drv.ms/v/s!Al6txEwD06L5gVvt3_AorDnQVUDA?e=MZonLC"><span style="font-family: Arial; font-size: 12pt;">https://1drv.ms/v/s!Al6txEwD06L5gVvt3_AorDnQVUDA?e=MZonLC</span></a><br /></span></p><p class="MsoNormal"><span style="font-size: 12pt; font-family: Arial;">如果实际应用这种难度(例如听广告)也毫无压力了，那</span><span style="font-size: 12pt; font-family: Arial;">就</span><span style="font-size: 12pt; font-family: Arial;">跟一般英美的娃区别不大了...<br /><br /></span><span style="font-size: 12pt;">就算平时看电影、会议、日常交流等都没任何压力了，但是还有听不懂的时候，这种场合也许有人偶尔会遇到，比如在某大学听某个口音很重的教授讲某天书一样的理论，别说留学的二外的一族，就算那些英语母语的听众，也是听得</span><span style="font-size: 16px;">云里雾里</span><span style="font-size: 12pt;">一知半解...</span></p><p class="MsoNormal"><br /></p><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;">一句话：听说就是训练熟练程度。</span><span style="font-size: 12pt; font-family: Arial;">多锻炼娃自己动手和动嘴或者说主动学习。还有，学课文也好、听歌也好、看电影也好，不能嘻嘻哈哈</span><span style="font-size: 12pt; font-family: Arial;">完事</span><span style="font-size: 12pt; font-family: Arial;">，什么东西都需要量化，该复述的复述，该拼读的拼读，该讲大意的讲大意，该背诵的背诵，除了听说还能学一些词汇和短语。一次学会一点压力很小，慢慢积累日久天长见分晓，如果执行力差，再好的方法也没用。</span></p><p class="MsoNormal"><span style="font-size: 12pt;"></span></p>

<!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:AllowPNG/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:TrackMoves/>
  <w:TrackFormatting/>
  <w:PunctuationKerning/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:Ign%2 <br id="-moz-br-" /></body></html>--><img src ="http://www.cppblog.com/Chipset/aggbug/217801.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2021-09-05 11:02 <a href="http://www.cppblog.com/Chipset/archive/2021/09/05/217801.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>朱丽安娜科普克</title><link>http://www.cppblog.com/Chipset/archive/2021/08/13/217779.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Fri, 13 Aug 2021 13:17:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2021/08/13/217779.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217779.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2021/08/13/217779.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217779.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217779.html</trackback:ping><description><![CDATA[<p class="MsoNormal"><span lang="ZH-CN" style="font-size: 10pt; font-family: " comic="" sans=""  ms";"="" ms";="" font-size:=""  10pt;"="">鉴于小学英语</span><span style="font-size: 10pt; font-family: " comic="" sans=""  ms";"="">Reach G(第6册)</span><span lang="ZH-CN" style="font-size: 10pt; font-family: " comic="" sans=""  ms";"="" ms";="" font-size:=""  10pt;"="">上的一篇文章</span><span style="font-size: 10pt; font-family: " comic="" sans=""  ms";"="">The Girl Who Fell from the Sky</span><span lang="ZH-CN" style="font-size: 10pt; font-family: " comic="" sans=""  ms";"="" ms";="" font-size:=""  10pt;"="">，<a href="http://www.cppblog.com/Chipset/archive/2021/08/11/217695.html">在这里</a>。于是打算了解一下作者(主人公)朱丽安娜科普克</span><span style="font-size: 10pt; font-family: " comic="" sans=""  ms";"="">(</span><span lang="ZH-CN" style="font-size: 10pt; font-family: " comic="" sans=""  ms";"="" ms";="" font-size:=""  10pt;"="">朱丽安娜迪拉</span><span style="font-size: 10pt; font-family: " comic="" sans=""  ms";"="">)</span><span lang="ZH-CN" style="font-size: 10pt; font-family: " comic="" sans=""  ms";"="" ms";="" font-size:=""  10pt;"="">。</span><span style="font-size: 10pt; font-family: " comic="" sans=""  ms";"="" ms";="" font-size:=""  10pt;"="" 13.3333px;"="">人物介绍</span><span style="font-size: 10pt; font-family: " comic="" sans=""  ms";"="" ms";="" font-size:=""  10pt;"="">选自E文维基，以下为译文。</span><span style="font-family: " comic="" sans=""  ms";"="" ms";="" font-size:=""  10pt;"=""><br /></span><span style="font-size: 10pt;" comic="" sans=""  ms";="" font-size:=""  10pt;"="">PS:&nbsp;</span><span style="font-size: 10pt;" comic="" sans=""  ms";="" font-size:=""  13.3333px;"="">翻译能很好的训练一个人的英语和汉语句子组织能力，时不时的让学英语的娃尝试一下翻译英语课文也算是某种锻炼吧。</span></p><p class="MsoNormal"><span lang="ZH-CN" style="font-family: " comic="" sans=""  ms";="" font-size:=""  10pt;"=""></span><span lang="ZH-CN" style="font-family: " comic="" sans=""  ms";="" font-size:=""  10pt;"=""><br /></span><o:p></o:p></p><p class="MsoNormal" style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;
margin-left:0in;line-height:normal"><span style="font-family: DengXian; font-size: 12pt;">朱丽安娜科普克</span><span style="font-size: 12pt;">(</span><span style="font-family: DengXian; font-size: 12pt;">出生于</span><span style="font-size: 12pt;">1954</span><span style="font-family: DengXian; font-size: 12pt;">年</span><span style="font-size: 12pt;">10</span><span style="font-family: DengXian; font-size: 12pt;">月</span><span style="font-size: 12pt;">10</span><span style="font-family: DengXian; font-size: 12pt;">日</span><span style="font-size: 12pt;">)</span><span style="font-family: DengXian; font-size: 12pt;">，婚后名字朱丽安娜迪拉，是一个德国</span><span style="font-size: 12pt;">-</span><span style="font-family: DengXian; font-size: 12pt;">秘鲁哺乳动物学家。她是</span><span style="font-size: 12pt;">1971</span><span style="font-family: DengXian; font-size: 12pt;">年兰萨</span><span style="font-size: 12pt;">508</span><span style="font-family: DengXian; font-size: 12pt;">航班空难的唯一幸存者，空难发生后独自一人在亚马逊热带雨林生活了</span><span style="font-size: 12pt;">11</span><span style="font-family: DengXian; font-size: 12pt;">天。他从</span><span style="font-size: 12pt;">3000</span><span style="font-family: DengXian; font-size: 12pt;">米</span><span style="font-size: 12pt;">(9843</span><span style="font-family: DengXian; font-size: 12pt;">英尺</span><span style="font-size: 12pt;">)</span><span style="font-family: DengXian; font-size: 12pt;">坠落，落地时仍然被安全带捆在座椅上。<br /><br /></span></p>  <p><strong><span style="font-family: DengXian; font-size: 12pt;">事前</span></strong></p>  <p><span style="font-family: DengXian; font-size: 12pt;">朱丽安娜于</span><span style="font-size: 12pt;">1954</span><span style="font-family: DengXian; font-size: 12pt;">年出生于秘鲁利马，父母都是在利马自然历史博物馆工作的德国人。她是生物学家汉斯威廉科普克和鸟类学家玛丽亚科普克的唯一孩子。在朱丽安娜</span><span style="font-size: 12pt;">14</span><span style="font-family: DengXian; font-size: 12pt;">岁时，其父母带她去亚马逊雨林建造研究基地</span><span style="font-size: 12pt;">--</span><span style="font-family: DengXian; font-size: 12pt;">潘古那。在这里她成了一个&#8220;丛林孩子&#8221;，学了野外生存技能。教育当局不同意这样做，要求朱莉安娜回到利马亚历山大冯洪堡德意志学校参加考试。她于</span><span style="font-size: 12pt;">1971</span><span style="font-family: DengXian; font-size: 12pt;">年</span><span style="font-size: 12pt;">12</span><span style="font-family: DengXian; font-size: 12pt;">月</span><span style="font-size: 12pt;">23</span><span style="font-family: DengXian; font-size: 12pt;">日在此校毕业。<br /><br /></span></p>  <p><strong><span style="font-family: DengXian; font-size: 12pt;">空难</span></strong></p>  <p><span style="font-family: DengXian; font-size: 12pt;">朱丽安娜科普克在经历磨难上有双重生存故事可供讲述。在</span><span style="font-size: 12pt;">1971</span><span style="font-family: DengXian; font-size: 12pt;">年圣诞节前夕，朱丽安娜搭乘了兰萨</span><span style="font-size: 12pt;">508</span><span style="font-family: DengXian; font-size: 12pt;">航班。那时她刚从高中毕业，她的母亲玛丽亚本打算在</span><span style="font-size: 12pt;">1971</span><span style="font-family: DengXian; font-size: 12pt;">年</span><span style="font-size: 12pt;">12</span><span style="font-family: DengXian; font-size: 12pt;">月</span><span style="font-size: 12pt;">19-20</span><span style="font-family: DengXian; font-size: 12pt;">日带着女儿去潘古那，但是朱丽安娜希望能在</span><span style="font-size: 12pt;">12</span><span style="font-family: DengXian; font-size: 12pt;">月</span><span style="font-size: 12pt;">23</span><span style="font-family: DengXian; font-size: 12pt;">日去利马参加毕业典礼。玛丽亚同意，打算圣诞节前夕再飞往潘古那，可是除了里尼思君特欧航空</span><span style="font-size: 12pt;">(</span><span style="font-family: DengXian; font-size: 12pt;">兰萨</span><span style="font-size: 12pt;">)</span><span style="font-family: DengXian; font-size: 12pt;">还有空余其余所有航班的席位均已售罄。尽管丈夫汉斯威廉强烈要求妻子不要乘坐那家航空公司的航班，因为该航空公司早已臭名昭著，但最终她们还是预定了机票。飞机起飞不久遭遇闪电，在空中开始解体并一头冲向地面。朱丽安娜发现自己一直被捆在座椅上，下落将近</span><span style="font-size: 12pt;">2</span><span style="font-family: DengXian; font-size: 12pt;">英里最终落入秘鲁热带雨林。</span></p>  <p><span style="font-family: DengXian; font-size: 12pt;">在朱丽安娜科普克的此次事件上，专家指出由于在下降中她被安放到座椅上才导致她活了下来，只是断了锁骨而已。她是该航班的唯一幸存者，顺着溪流在雨林里生活了</span><span style="font-size: 12pt;">11</span><span style="font-family: DengXian; font-size: 12pt;">天。</span></p>  <p><span style="font-family: DengXian; font-size: 12pt;">在她醒过来后丛林里的昆虫不再叮咬她，可是蛆已经感染了她的胳膊，</span><span style="font-size: 12pt;">9</span><span style="font-family: DengXian; font-size: 12pt;">天后，她找到了一处露营地。在此，她给自己进行了初级治疗，例如用汽油浇到蛆感染的部位。蛆害怕汽油就离开了伤口。几个小时候后，运木工人发现了她，给与基本医疗并把她带到更宜居的区域，然后她被空运到医院。</span></p>  <p><span style="font-family: DengXian; font-size: 12pt;">伤口恢复后，朱丽安娜帮助搜救队定位失事地点和搜救死难者尸体。她妈妈的尸体于</span><span style="font-size: 12pt;">1972</span><span style="font-family: DengXian; font-size: 12pt;">年</span><span style="font-size: 12pt;">1</span><span style="font-family: DengXian; font-size: 12pt;">月</span><span style="font-size: 12pt;">12</span><span style="font-family: DengXian; font-size: 12pt;">日被发现。朱丽安娜回到德国后伤口完全恢复了正常。跟父母类似，朱丽安娜获得生物学学位后返回秘鲁继续深入研究蝙蝠。她的双重生存故事成了书和电影的主体，其中包括了她的自传和他传，&#8220;当我从天而降&#8221;，以及导演沃纳赫尔佐格的纪录片&#8220;翅膀上的希望&#8221;。他</span><span style="font-size: 12pt;">(</span><span style="font-family: DengXian; font-size: 12pt;">沃纳赫尔佐格</span><span style="font-size: 12pt;">)</span><span style="font-family: DengXian; font-size: 12pt;">在</span><span style="font-size: 12pt;">1971</span><span style="font-family: DengXian; font-size: 12pt;">年也预定了她</span><span style="font-size: 12pt;">(</span><span style="font-family: DengXian; font-size: 12pt;">朱丽安娜</span><span style="font-size: 12pt;">)</span><span style="font-family: DengXian; font-size: 12pt;">的那次航班，飞机起飞前最后一分钟改变计划，从而躲过一劫。<br /><br /></span></p>  <p><strong><span style="font-family: DengXian; font-size: 12pt;">事后</span></strong></p>  <p><span style="font-family: DengXian; font-size: 12pt;">朱丽安娜的侥幸存活成了各种瞎猜推断的主题。"很明显她被安全带捆在座椅上有了某种程度的盾牌和缓冲，而且理论上外围整排的座椅，就是朱丽安娜两边的那些，起到了降落伞的作用，减缓了她下落的速度..."。&#8220;风暴漂移以及落地点厚厚的枝叶可以进一步降低里冲击力...&#8221;。</span></p>  <p><span style="font-family: DengXian; font-size: 12pt;">朱丽安娜回到德国彻底康复过来，走了父母一样的路，在基尔大学学习生物，</span><span style="font-size: 12pt;">1980</span><span style="font-family: DengXian; font-size: 12pt;">年毕业。在慕尼黑麦克西米兰大学获得博士学位后返回到秘鲁展开哺乳动物研究，专注于蝙蝠，在</span><span style="font-size: 12pt;">1987</span><span style="font-family: DengXian; font-size: 12pt;">年发表论文，&#8220;秘鲁热带雨林里一个蝙蝠生物王国的研究&#8221;。</span><span style="font-size: 12pt;">1989</span><span style="font-family: DengXian; font-size: 12pt;">年朱莉安娜科普克和一个专注于研究寄生黄蜂的昆虫学家艾力克迪拉结婚。</span><span style="font-size: 12pt;">2000</span><span style="font-family: DengXian; font-size: 12pt;">年朱丽安娜接管了潘古那当上了主任，父亲去世了。</span></p>  <p><span style="font-family: DengXian; font-size: 12pt;">现在朱丽安娜迪拉在慕尼黑巴伐利亚动物学蒐藏研究中心当管理员。她的自传和他传&#8221;当我从天而降&#8221;</span><span style="font-size: 12pt;">(</span><span style="font-family: DengXian; font-size: 12pt;">德语</span><span style="font-size: 12pt;">: Als ich vom Himmel fie)</span><span style="font-family: DengXian; font-size: 12pt;">于</span><span style="font-size: 12pt;">2011</span><span style="font-family: DengXian; font-size: 12pt;">年</span><span style="font-size: 12pt;">3</span><span style="font-family: DengXian; font-size: 12pt;">月</span><span style="font-size: 12pt;">10</span><span style="font-family: DengXian; font-size: 12pt;">日由派珀林格出版，为此她获得了</span><span style="font-size: 12pt;">2011</span><span style="font-family: DengXian; font-size: 12pt;">柯琳文学奖。</span><span style="font-size: 12pt;">2019</span><span style="font-family: DengXian; font-size: 12pt;">年秘鲁政府授予她高级军官的杰出服务奖。<br /></span></p><img src ="http://www.cppblog.com/Chipset/aggbug/217779.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2021-08-13 21:17 <a href="http://www.cppblog.com/Chipset/archive/2021/08/13/217779.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>教娃背单词</title><link>http://www.cppblog.com/Chipset/archive/2021/08/11/217696.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Wed, 11 Aug 2021 04:06:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2021/08/11/217696.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217696.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2021/08/11/217696.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217696.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217696.html</trackback:ping><description><![CDATA[<div><p><span style="font-family: Arial; font-size: 12pt;">给娃选教材：</span><a href="http://www.cppblog.com/Chipset/archive/2021/08/11/217695.html"><span style="font-size: 12pt;">http://www.cppblog.com/Chipset/archive/2021/08/11/217695.html</span><br /></a></p><div><p><span style="font-size: 12pt;">娃英语听说 <a href="http://www.cppblog.com/Chipset/archive/2021/08/31/217801.html">http://www.cppblog.com/Chipset/archive/2021/08/31/217801.html</a></span></p></div></div><div><p><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><span style="font-size: 12pt; font-family: Arial;"><a href="http://www.cppblog.com/Chipset/archive/2021/05/31/217695.html"><br /></a></span><span style="font-size: 12pt; font-family: Arial; color: red;">友好提醒：别盲目跟随，请量力而行。</span><span style="font-size: 12pt; font-family: Arial;"><a href="http://www.cppblog.com/Chipset/archive/2021/05/31/217695.html"><br /><br /></a></span><span style="font-family: Arial; font-size: 12pt;"><span style="font-size: 12pt; font-family: Arial;">只想读985不在乎996的到此打住吧，学外语一直吃力的也到此打住吧，别再浪费时间看了，因为这里路数真不适合你们，这里以实用为主，对付标准化考试找本&#8220;宝书&#8221;(红宝书或绿皮书或白皮书等)去背词外加刷题最划算，比这里的方法省时省力没准还高分。还有，那些想出去读研的也是</span></span></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">狂背&#8220;宝书&#8221;刷词<span style="font-size: 12pt; font-family: Arial;">为佳，IELTS也好，TOEFL和GRE也好，考试大敌当前就不必再想别的</span></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><span style="font-size: 12pt; font-family: Arial;">。因此以上这些&#8220;大神&#8221;，就没有必要在此文浪费时间了...<br /><br /></span></span></p></div><div><p><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">人不能生活在虚幻里，总要面对现实。从小学</span><span style="font-family: Arial; font-size: 12pt;">1</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">年级学英语开始，一直到大学过完CET</span><span style="font-family: Arial; font-size: 12pt;"></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">结束，战线长达十几年。广大莘莘学子们毕业后，各种英语证书都拿到不少，一个个的当时还考了那么高的分，对吧？能用英语清楚的表达自己想法呢，还是能轻松阅读原版文档？绝大部分甚至连辅导自己娃</span><span style="font-family: Arial; font-size: 12pt;">(Reach/Wonders, Science, Mathematics)</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">的水平都不具备吧，是不是像我这里说的这样很容易验证，去上一篇帖子里</span><span style="font-family: Arial; font-size: 16px;">自己</span><span style="font-family: Arial; font-size: 12pt;">感受一下小学英语就心中有数了。不排除有人好奇心强，想知道别人都什么样子的，现实中很多英专毕业后当中小学老师教吃瓜群众子弟英语，自己孩子却送去补Wonders，Reach等小学课</span><span style="font-family: Arial; font-size: 12pt;">[TEM8达不到别人小学毕业水平]，至于广大非英毕业生真实水平就更不必提了。这么多年考啊考，</span><span style="font-family: Arial; font-size: 12pt;">青春和金钱付出大把，真到用时就这三脚猫功夫，如果看明白了，那还让不让让自己娃再继续走这个套路呢？</span></p></div><div><p><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><br /></span></p></div>

<p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">显然英语只靠单词是不行的，但是没有单词是万万不行的。先看看我们学&#8220;会&#8221;了多少单词。义乌叫玉小学布鞭本英语</span><span style="font-family: Arial; font-size: 12pt;">1</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">年级上册大约</span><span style="font-family: Arial; font-size: 12pt;">100</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">词，下册约</span><span style="font-family: Arial; font-size: 12pt;">70</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">，以后一直在</span><span style="font-family: Arial; font-size: 12pt;">70</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">附近徘徊，直到小学毕业。如此算下来整个小学</span><span style="font-family: Arial; font-size: 12pt;">阶段满打满算总计</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">也没有</span><span style="font-family: Arial; font-size: 12pt;">1K</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">词。至于初中和高中，就不必统计了。其实大学英语教程四册全加来的词汇也不足</span><span style="font-family: Arial; font-size: 12pt;">3K(</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">约</span><span style="font-family: Arial; font-size: 12pt;">2.8K)</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">，而大缸要求，</span><span style="font-family: Arial; font-size: 12pt;">CET4</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">的词汇约</span><span style="font-family: Arial; font-size: 12pt;">4K</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">，</span><span style="font-family: Arial; font-size: 12pt;">CET6</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">约</span><span style="font-family: Arial; font-size: 12pt;">6K</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">，</span><span style="font-family: Arial; font-size: 12pt;">TEM8</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">约</span><span style="font-family: Arial; font-size: 12pt;">9K-10K</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">。过来人自然明白，根本远远不需那么多，</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">过级</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">照样</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">妥妥的</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">。</span></p><p><img src="http://www.cppblog.com/images/cppblog_com/chipset/weslandia11.jpg" alt="" width="850" height="432" /></p><p><br /></p><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">急功近利的文化被各类国人用得恰到好处，应试教育时代里学生们当然也不会例外。学霸们舍得卖力，拿本红宝书</span><span style="font-family: Arial; font-size: 12pt;">(</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">或蓝宝书或者绿皮书或白皮书</span><span style="font-family: Arial; font-size: 12pt;">)</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">的词典狂背，目的性很强，容易达到考试目标。问题是人生不能时刻准备着考试吧，</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">考试过后半年单词还剩多少？一个受过高等教育的老外词汇量25-</span><span style="font-family: Arial; font-size: 12pt;">30K</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">左右[网测]，汉语</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">常用</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">字词远远没那么多</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">，计算机算法领域有个词叫</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">哈希冲突，</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">英汉释义背词大法注定对付标准化考试刚好，也只能到此刚刚好</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">。</span></p><p class="MsoNormal"><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><br /></span></p><div><p><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><img src="http://www.cppblog.com/images/cppblog_com/chipset/weslandia10.png" alt="" width="850" height="583" /><br /></span></p></div><div><p><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><br />其实何止英语有&#8220;经典&#8221;，程序界像&#8220;21天学通C++&#8221;，&#8220;21天学通Java&#8221;也是这类脑残货销量最大，也许急功近利大概是多数人的智力和毅力缺陷吧。有点头脑的人应该能想明白，媒体上宣传的学霸背单词</span><span style="font-family: Arial; font-size: 16px;">各种</span><span style="font-family: Arial; font-size: 12pt;">大法只能作秀和对付标准化考试。不屑的，怀疑的，等等，可以去前面</span><a href="http://www.cppblog.com/Chipset/archive/2021/05/31/217695.html" style="font-family: Arial; font-size: 12pt;">帖子</a><span style="font-family: Arial; font-size: 12pt;">感受下别人小学课本就明白了。</span></p></div><div><p><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN"><br /><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">既然看穿表象了，那就看看本土娃怎么学吧，比如语文课本</span><span style="font-family: Arial; font-size: 12pt;">Reach</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">第</span><span style="font-family: Arial; font-size: 12pt;">1</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">册</span><span style="font-family: Arial; font-size: 12pt;">179</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">词，</span><span style="font-family: Arial; font-size: 12pt;">Reach</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">第</span><span style="font-family: Arial; font-size: 12pt;">6</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">册</span><span style="font-family: Arial; font-size: 12pt;">200</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">多点，</span><span style="font-family: Arial; font-size: 12pt;">Wonders</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">稍多点，但多不了太多。这样看上去并不比国人学英语词汇多到哪，但老外数学有词汇，科学有词汇，平时练习还有词汇专项，再者，平时生活和读书看报还能学一些单词。综合各种因素，小学</span><span style="font-family: Arial; font-size: 12pt;">6</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">年积累下来的词汇总数突破</span><span style="font-family: Arial; font-size: 12pt;">10K，高中毕业20K的样子，大学毕业就有30K左右了</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">。或者可以这么认为，老外主要是根据语境学单词的，学以致用，在应用中得到巩固和提高。这应该容易理解吧，问题是很多非本土老外，比如欧洲有那么多郭嘉母语非英语，人家受过高教的，英语一样贼溜啊，相信有些吃刮子弟也会意识到这点。其实路数没有本质分别，人家精英教育有良好筛选机制暂不提，关键是不用学那么多垃圾而且大多人主动去学，质量当然能得到有效保证，反观咱们呢，大部分人只是为了拿&#8220;证书&#8221;去招摇找工作...<br /><br /></span></span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">如果看到这些，再对照一下咱们</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">，单从词汇数量上就能推测[各种网测统计结果绝大部分低于4.5K]，一个普通大学毕业生辅导小学课本</span><span style="font-family: Arial; font-size: 12pt;">(</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">用老外的语文、数学、科学</span><span style="font-family: Arial; font-size: 12pt;">)</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">倍感吃力再正常不过，更别说英汉释义这种死记硬背对付</span><span style="font-family: Arial; font-size: 12pt;">应试</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">的大法在实用场合几乎等同于废物。我们学语文拿本字典背吗？如果母语都不能这么学，那二外拿本词典或者对着词汇表狂背后能多久不忘？</span><span style="font-family: Arial; font-size: 12pt;" lang="ZH-CN">这种从一开始就注定只能是标准化考试专用的东西再无其它用场...</span><span style="font-family: Arial; font-size: 12pt;"><br /><br /></span></p></div><div><p><span style="font-size: 12pt; font-family: Arial;" lang="ZH-CN">可能还有不少家长抱有幻想，觉得娃们用本土课本</span><span style="font-size: 12pt; font-family: Arial;">(Reach, Wonders, Science, mathematic</span><span style="font-size: 12pt; font-family: Arial;" lang="ZH-CN">s等</span><span style="font-size: 12pt; font-family: Arial;">)就行了，其实后期照样歇菜，</span><span style="font-size: 12pt; font-family: Arial;" lang="ZH-CN">因为没有那么多时间。小学低年级时间充裕，可以去堆时间，随着年级提高作业任务加重，堆时间大法注定行不通，补习班挂着羊头卖狗肉薅羊毛而已，到头来吃亏的还是吃刮紫弟们。靠补习班学好英语只能是自我心里安慰，</span><span style="font-size: 12pt; font-family: Arial;" lang="ZH-CN">我这里懒得讲道理，有疑问的那些家长自己很容易验证，学口语的娃讲述一下某个陌生玩具自己认为的操作细节，其余补课班[包括网课]写篇路人皆知但没用英语写过的作文(例如乌鸦喝水)。面对陌生的事物才能看出真实水平，毕竟鹦鹉学舌那一套就算傻子都能搞完美...<br /><span style="font-size: 12pt;"><br />翻一翻英英词典容易明白，大部分套路一样，用基本的词汇解释更复杂的词汇，这点跟汉语词典路数一样。如此可见，应该先掌握基本词汇，或者说高频词，然后用英语学英语，从小到大滚雪球。为了积累基础词汇和尽可能创造语境应该多阅读，在阅读中巩固和提高。</span></span></p></div><div><p><span style="font-size: 12pt; font-family: Arial;" lang="ZH-CN"><span style="font-size: 12pt;"><br /></span></span></p></div><p class="MsoNormal"><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN">既然看到了问题症结，那总得解决吧。前面提到了阅读，考虑到时间原因，应该靠精读积累词汇，好的文章在搞懂细节的基础上背下来可能是最佳方式[语境很重要]，一举消灭拼读、单词、语法，用法，还能提升写作能力。由于基础词在不同文章里经常出现，经常阅读不同题材文章就等同于自动筛选出高频词并强化了记忆。基础词汇积累起来了，就转用英英词典，跟英汉对照的红宝书</span><span style="font-size: 12pt; line-height: 107%; font-family: Arial;">(</span><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN">蓝宝书、绿皮书、白皮书等等</span><span style="font-size: 12pt; line-height: 107%; font-family: Arial;">)</span><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN">彻底拜拜，阅读中故事情节的引力会促使小朋友进入良性循环。</span></p><div><p><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN"><br /></span></p></div><div><p><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN">以上似乎太抽象，有些家长可能还迷糊，直接举例吧。像Wonders里One Hen, Where the Mountain Meets the Moon, Weslandia, One Well等获奖文在学懂细节的基础上都背下来并默写(或听写，家长能力吃紧的可考虑其他替代措施，例如MP3文件拷手机里播放，用点读笔点读等。人名地名专有名词这些极少用的暂不要求)，还有Reach里的Coyote and Badger 等获奖文，</span><span style="font-family: Arial; font-size: 12pt;">注意文章尽可能选不同题材去背</span><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN">。如果文章太长背不下来，可以背短的，例如Wonders上读写教程里的某些文章，Reach里的短文则更短，也可以选择相对适合的。固然，跟获奖的那些长文相比，效果肯定差一些。</span><span style="font-family: Arial; font-size: 16px;">对于那些不擅长背的娃而言，可以考虑听写课文[效果差一些]或英译汉[长期坚持下来效果也不错]。也可以不局限于课文，例如翻译小说</span><span style="font-family: Arial; font-size: 16px;">Where the Mountain Meets the Moon，E文53元的样子，共48章内容，难度不大，可以尝试译成中文，</span><span style="font-family: Arial; font-size: 16px;">每天翻译一点，</span><span style="font-family: Arial; font-size: 16px;">一年后可能就会翻出一个自己的中文版，那时娃会很有成就感，激励继续学下去...</span><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN">除语文(就是英语)外，科学和数学也能补点，只不过这种以应用为主而不是背。这些列举的内容在</span><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN"></span><a href="http://www.cppblog.com/Chipset/archive/2021/08/11/217695.html"><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN">前文里</span><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN">有一些举例</span></a><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN">。</span><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN">只要娃能坚持学几年下来，</span><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN"></span><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN">就能积累一般套路几倍甚至数量级的词汇量，显然不仅词汇受益，语法、句型，写作等都会不同程度的同步提升...</span><span style="font-family: Verdana; font-size: 16px;">达到某个层次后，那时自己会领悟到最适合的方法，这里没必要再继续啰嗦。</span></p></div><div><p><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN"><br /></span></p></div><div><p><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN">最后需要指出的是，上面只是针对时间很紧的娃不得已而为之的积累词汇方法，既为对付应试教育考分，也考虑了一定的实用性。这种路数至少适合大部分智力正常的二外小学生。但是，不得不说，那些体制外的娃，以及不是这个阶段的娃，都没必要走这个路数</span><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN">&#8230;<br /></span><span style="font-size: 12pt; line-height: 107%; font-family: Arial;" lang="ZH-CN"><br /></span><span style="font-size: 12pt; font-family: Arial;">下面说下什么是实用性，还是举例容易理解。比如您是某大公司技术人士，经常需要解决一些项目的技术上的难题，显然网络是个好东西，可能经常需要快速的从几千甚至上万个英语页面找出几页有价值的东西，此刻什么样的等级证书或者高分能保您有这种不起眼的水平？再如，您在某名牌大学博士，需要发论文吧，发论文前总得先了解自己研究领域吧，英语如果不好还需要阅读大量相关文献怎么办呢？ 再如，假设您管理能力出众，是某跨国公司一名高管，不用996收入也不错，某天您提出一个很好的方案，CEO很高兴，要您在会上给别的高管讲清具体操作细节，此时您可能才会发现，平时那些口语班全是废物，就算您把培训班外教找来让他讲也讲不明白。这下明白本文里&#8220;实用性&#8221;这个词什么意思了？</span></p></div><img src ="http://www.cppblog.com/Chipset/aggbug/217696.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2021-08-11 12:06 <a href="http://www.cppblog.com/Chipset/archive/2021/08/11/217696.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>给娃选教材</title><link>http://www.cppblog.com/Chipset/archive/2021/08/11/217695.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Wed, 11 Aug 2021 04:04:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2021/08/11/217695.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217695.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2021/08/11/217695.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217695.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217695.html</trackback:ping><description><![CDATA[<div><span style="color: red; font-family: Arial; font-size: 16px;">友好提醒：别盲目跟随，请量力而行。</span><span style="font-size: 16px;"><br /></span></div><div><span style="font-size: 16px;"><br /></span></div><div><span style="font-size: 16px;">想想读书时代是一件很有意思的事，各种高分考证，心里美滋滋的，</span><span style="font-size: 16px;">到底几斤几两</span><span style="font-size: 16px;">用时才会心知肚明... 这不，眼看着各种文化课补习班和网课要关闭了，初中升高中干掉50%，大学也压缩招生&#8230; 如果从小就请老师一对一，先不说效果如何，韭菜们口袋里银子紧张不？当然，如果连部蝙本都感觉吃力的，就不要在此浪费时间看此文了&#8230; 还有，下面主要针对小学英语教辅的，非小学阶段或关注其它科目的或者只在乎分数的请绕道吧...<br /><br />仅靠高分是远远不够的，如果分数真能代表学识或能力，兲朝科技早就地球无敌了，而不是还挣扎在山寨、造假、高仿的边缘。人总需要吃饭，以IT行业为例，能从正门走进某巴巴、某为的有几个不是985毕业的(边门进就不提了)，就算</span><span style="font-size: 16px;">996</span><span style="font-size: 16px;">你能忍，&#8220;自愿加班&#8221;你能忍不，怀孕</span><span style="font-size: 16px;">被</span><span style="font-size: 16px;"></span><span style="font-size: 16px;">&#8220;自愿&#8221;离职能忍不，破冰文化你能忍不，251你能忍不？每个智力正常人士，肯定明白这仅是冰山一角，本质原因是劳动者污浊的</span><span style="font-size: 16px;">大环境，</span><span style="font-size: 16px;">没有能力换个守法守德的外企，再考虑到家庭重担，太多都是忍气吞声，委曲求全... 因此，吃刮子弟最好多</span><span style="font-size: 16px;">储备点有用的才有可能有机会继续学习更高深的，从而有机会换个</span><span style="font-size: 16px;">相对干净点的环境，就算不想换，一般也不会有人找麻烦，</span><span style="font-size: 16px;">因为你有随时甩摊子走人的能力...不多废话，直接进入正题。</span></div><div><span style="font-size: 16px;"><br /></span></div><div><span style="font-size: 16px;">优秀教材很多，适合于不同的人。下面列出的教材绝对不是最好的，但我看过且给孩子用过，总体感觉还行，再不济也比布边本、某概念、牛津书虫系列等强很多...如果挑花了眼，建议看看这篇文章 <a href="https://zhuanlan.zhihu.com/p/114289934">https://zhuanlan.zhihu.com/p/114289934</a><br /></span></div><div><span style="font-family: Arial; font-size: 12pt; color: red;" lang="ZH-CN"></span></div><div></div><div><span style="font-size: 12pt;"><br />1. Backpack<br /><br /></span></div><div><span style="font-size: 12pt;">难度不大，130-140元一套，练习题是一大特色。随书碟片实在太好，尤其电脑上的单元习题20道(第一册没有)，非常吸引小孩。录音</span><span style="font-size: 16px;">[2册开始]</span><span style="font-size: 12pt;">全部童声，课本上短文都是唱出来的，理论上极容易让大部分小孩接受[想想迪士尼电影里很多儿童配音都是唱出来的就明白为什么了]。</span><span style="font-size: 12pt;">练习册Workbook的安排也是恰到好处，一年级每单元12题，到了六年级每单元24题。</span><span style="font-size: 16px;">个人感觉除了没有单词表，随书碟片打开不能全屏，这两个缺点外，其它方面简直无懈可击。</span></div><div><br /><span style="font-size: 12pt;">每套书有一本学生课本，一本练习册，随书碟片课本一张，练习册一张(一年级无碟片)，美的印刷版是这样的。不过现在都本地化了[不清楚还有没有美的印刷版]，本地化的课本有个微信扫码获得附加资源，</span><span style="font-size: 16px;">诱惑用户去扫</span><span style="font-size: 12pt;">，打开一堆广告，练习册还没有碟片，不过每套比美的印刷版便宜一点[5元左右]... 教师用书好像也有卖的，我用不上就没买。书上说的很清楚，哪些该懂哪些该练，完全按照导学走就万事大吉。</span><span style="font-size: 16px;"></span></div><div><span style="font-size: 16px;"><br /></span></div><div><span style="font-size: 16px;">每套书9个单元，安排每周的周末有一次课大约45分钟，课本内容占用这个时间，Workbook</span><span style="font-size: 16px;">练习题占用这个时间，随书碟在电脑上每个单元20题也占用这个时间，如有作文，依旧占用这个时间。由于都占用这个时间，孩子负担很小，假期间可以适当多学点，</span><span style="font-size: 16px;">一年学一套书时间上还会绰绰有余。</span><span style="font-size: 12pt;">每周只有一次课，布边本在家里从来都不看，学校习题也从来不做，但是对付学校英语考试显然还会绰绰有余...</span><span style="font-size: 16px;"></span></div><div><br /><span style="font-size: 16px;"></span></div><div><span style="font-size: 16px;"></span><span style="font-size: 16px;">我猜CET水平应该能教自己娃</span><span style="font-size: 16px;">Backpack</span><span style="font-size: 16px;">到6册结束小学毕业[不算听说和作文]。下面贴一个单元，第5册第7单元，可以看个路数。</span><div><img src="http://www.cppblog.com/images/cppblog_com/chipset/Backpack1.JPG" alt="" width="1150" height="862" /></div></div><div><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/BackPack2.JPG" alt="" width="1150" height="862" /><br /></span></div><div><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/Backpack3.JPG" alt="" width="1150" height="862" /><br /></span></div><div><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/Backpack4.JPG" alt="" width="1150" height="862" /><br /></span></div><div><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/Backpack5.JPG" alt="" width="1150" height="862" /><br /></span></div><div><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/Backpack6.JPG" alt="" width="1150" height="862" /><br /></span></div><div><span style="font-size: 12pt;"><br /></span></div><div><span style="font-size: 12pt;">其实</span><span style="font-size: 16px;">当初用Backpack只为业余替换布边本而已，学一段时间心里有点底了，就尝试下冒险...<br /><br /></span></div><div><span style="font-size: 12pt;">2. Reach</span></div><div><span style="font-size: 16px;"><br /></span><span style="font-size: 12pt;">本土Reach难度上显然远超ESL的Backpack</span><span style="font-size: 12pt;"><span style="font-size: 12pt;"></span>，</span><span style="font-size: 12pt;">内容组织形式不错，虽总体选文质量不如Wonders[后面有介绍]，感觉</span><span style="font-size: 12pt;"><span style="font-size: 12pt;">取代名师推荐的那些"床头小书"还是很好的，</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">主课本</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">六七百页</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">外加一本练习册，当时</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">100多元一套</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">[不清楚现在情况]</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">，</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">价格逆天</span></span><span style="font-size: 12pt;">。当英语教材用也不错，只是配套练习册弱了点。有了4年多的Backpack铺垫，Reach也可以一试身手了。</span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br />我买Reach看重的地方在于每篇文章当前页脚有单词注释，每个单元当前有语法总结[不像Wonders那样还要翻到最后去找]，再者就是价格低廉，印刷质量极好。</span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;">Reach有教参卖，学生课本有随书碟录音。Reach B(1年级)网上有录播课卖[其余年级没有录播课，但有网课]，</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">共8个单元</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">，1080P本来很清晰，每个单元20个文件。</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">但是这里得吐槽下，</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">每个文件前都有一段广告，不知道哪个管理者这么安排，脑袋</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">真是</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">被驴踢了</span></span><span style="font-size: 12pt;">。录播内容跟实体补习班和网课一个路数，时间拖沓，废话连篇。</span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br /></span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">分析电商销量，Reach低年级课本紧俏(1~3)，4年级以上销量极低。分析原因应该是大部分家长和娃</span></span><span style="font-size: 12pt;">后期放弃了，</span><span style="font-size: 12pt;">网课</span><span style="font-size: 12pt;">补习班也是如此，由于大部分娃坚持不下来，各种机构只好用组果版的Reach Higher[难度低价格高]，各种</span><span style="font-size: 12pt;">软文助推</span><span style="font-size: 16px;">薅羊毛</span><span style="font-size: 12pt;">，名字显得也高大上了</span><span style="font-size: 16px;">...</span></div><div><span style="font-size: 16px;"><br /></span><span style="font-size: 12pt;"></span></div><div></div><div><span style="font-size: 12pt;">Reach选文故事情节曲折，比如Reach F(第5册)里Coyote and Badger, On Hen, Reach G(第6册)里The Girl Who Fell From the Sky，插图精美，非常吸引小朋友</span><span style="font-size: 12pt;">。</span><br /><span style="font-size: 12pt;"></span></div><div><span style="font-size: 12pt;"><br /></span></div><div><span style="font-size: 12pt;">我猜CET的水平能教娃到Reach D(第3册)末，英专不清楚，下面是Reach F，5年级课本封面。</span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/weslandia13.jpg" alt="" width="1150" height="1480" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;">下面例子是第5册(F)第三单元前半部分的内容，短文和长文差距实在太大，生词在当前页脚注释实在太方便，导学内容很好。<br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/coyote00-0.JPG" alt="" width="1150" height="818" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/coyote01.JPG" alt="" width="1150" height="862" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/coyote02.JPG" alt="" width="1150" height="862" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/coyote03.JPG" alt="" width="1150" height="862" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><a href="https://1drv.ms/u/s!Al6txEwD06L5gVIegyHPoCJidQBG?e=MKltOy">Coyote and Badger有点长，上传个录音吧 https://1drv.ms/u/s!Al6txEwD06L5gVIegyHPoCJidQBG?e=MKltOy</a><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/coyote1.JPG" alt="" width="1150" height="779" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/coyote2.JPG" alt="" width="1150" height="809" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/coyote3.JPG" alt="" width="1150" height="797" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/coyote4.JPG" alt="" width="1150" height="814" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/coyote5.JPG" alt="" width="1150" height="770" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/coyote6.JPG" alt="" width="1150" height="789" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/coyote7.JPG" alt="" width="1150" height="771" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/coyote8.JPG" alt="" width="1150" height="802" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/coyote9.JPG" alt="" width="1150" height="812" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/coyote10.JPG" alt="" width="1150" height="789" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;">下面是Reach G里的一篇文章，<a href="http://www.cppblog.com/Chipset/archive/2021/08/13/217779.html">The Girl Who Fell from the Sky</a>，是我买了本土教材后，娃关注的第一篇文章[题目吸引?]。Reach的F和G我感觉不出难度差别。<br /><img src="http://www.cppblog.com/images/cppblog_com/chipset/sky1.JPG" alt="" width="1150" height="1550" /><br /><img src="http://www.cppblog.com/images/cppblog_com/chipset/sky2.JPG" alt="" width="1150" height="849" /><br /><img src="http://www.cppblog.com/images/cppblog_com/chipset/sky3.JPG" alt="" width="1150" height="836" /><br /><img src="http://www.cppblog.com/images/cppblog_com/chipset/sky4.JPG" alt="" width="1150" height="801" /><br /><br />3. Wonders<br /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;">Wonders课本有点读版[我没买]，也有补习班[网课]</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">，</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">眼下最便宜的网课貌似120元/25分钟，</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">某宝也卖录播课的。</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">Wonders主教材1K页左右，分</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">读写教程和文学欣赏，</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">练习册好几本加起来又一个1K页。对应教参也有，4K页，比书厚多了，估计没几个人能认真看下去，反正我是不行[其实也不需要]。</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">我图便宜，寒假给娃买的二手2014版[2017版作文改动了，2020版改动更</span><span style="font-size: 12pt;">大，出版社网站有1年级和4年级的试读内容</span></span><a href="https://www.mheducation.com/prek-12/program/microsites/MKTSP-BGA07M0/wonders.components.html"><span style="font-size: 12pt;">https://www.mheducation.com/prek-12/program/microsites/MKTSP-BGA07M0/wonders.components.html</span></a><span style="font-size: 12pt;">]</span><span style="font-size: 16px;">，错漏内容在更正，教学方法在更新，建议不要买老版</span><span style="font-size: 12pt;">。我没让娃没参加补习</span><span style="font-size: 12pt;">班，也没买录播课，穷啊，没办法。于是自己动手，什么效果不效果的，好坏看淡，说干就干，从5年级下学期开始正式取代Backpack的阅读和写作还有词汇，听说训练依旧用Backpack[从Backpack第2册就正常语速，这很好，电脑上练习听说和敲键盘的那些还有动画吸引小朋友]，操作起来一切符合预期...</span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br />值得一提的是，市场上Wonders和Reach路数类似，低年级很火，高年级几乎无人问津。同样基于薅羊毛的需要，出现了WonderSkills...</span></span><span style="font-size: 12pt;"></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;">Wonders读写教程的文章普遍比阅读欣赏里选文短很多，如果只教读写教程，CET6水平也许能到4年级，至于文学欣赏，3年级末大概是极限吧。英专家长优势很大，读写教程小学阶段应该能一路绿灯，文学欣赏五六年级估计不会很乐观。下面是Wonders的5年级课本封面。<br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/weslandia14.jpg" alt="" width="1150" height="740" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br />读写教程选文如下这个样子，反正我感觉没难度。</span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/AFreshIdea0.JPG" alt="" width="1150" height="862" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><a href="https://1drv.ms/u/s!Al6txEwD06L5gVOPW3BwjpDHZOg1?e=bcuqbt">A Fresh Idea 录音 https://1drv.ms/u/s!Al6txEwD06L5gVOPW3BwjpDHZOg1?e=bcuqbt</a><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/AFreshIdea1.JPG" alt="" width="1150" height="862" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/AFreshIdea2.JPG" alt="" width="1150" height="863" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/AFreshIdea4.JPG" alt="" width="1150" height="862" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/AFreshIdea5.JPG" alt="" width="1150" height="863" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/AFreshIdea6.JPG" alt="" width="1150" height="862" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;">读写教程500页，文学欣赏还有500页，不能浪费呀。文学欣赏选文有长有短，难度大于读写教程上的选文。Wonders里文学欣赏少部分文章和Reach里有重复，但略有差异，例如One Hen, One Well等，选其一就行了。Reach五六年级课本里的长文和Wonders五六年级课本文学欣赏的文章似乎都有点长，估计绝大部分家长扛不住..<br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/Blancaflor1.JPG" alt="" width="1150" height="832" /></span></span><br /><span style="font-size: 12pt;"><span style="font-size: 12pt;"></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/Blancaflor2.JPG" alt="" width="1150" height="814" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/Blancaflor3.JPG" alt="" width="1150" height="816" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/Blancaflor4.JPG" alt="" width="1150" height="862" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/Blancaflor5.JPG" alt="" width="1150" height="837" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/Blancaflor6.JPG" alt="" width="1150" height="837" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/Blancaflor7.JPG" alt="" width="1150" height="832" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/Blancaflor8.JPG" alt="" width="1150" height="863" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;">依旧第5册，再来一篇文学欣赏的文章，这个短点，<a href="https://1drv.ms/u/s!Al6txEwD06L5gVGqcl5gTFr49o7Y?e=fmRoT7">录音https://1drv.ms/u/s!Al6txEwD06L5gVGqcl5gTFr49o7Y?e=fmRoT7</a><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/weslandia1.jpg" alt="" width="1150" height="850" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/weslandia2.jpg" alt="" width="1150" height="851" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/weslandia3.jpg" alt="" width="1150" height="814" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/weslandia4.jpg" alt="" width="1150" height="814" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/weslandia5.jpg" alt="" width="1150" height="818" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/weslandia6.jpg" alt="" width="1150" height="798" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/weslandia7.jpg" alt="" width="1150" height="837" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/weslandia8.jpg" alt="" width="1150" height="829" /><br /></span></span></div><div><span style="font-size: 12pt;">只走马观花可不行，得辅助一些专项练习[例如各种Assessment练习册]调动自主思维。哪方面薄弱，加强哪方面。下面例子是阅读理解练习第一篇，整个第5册里最容易的吧，我猜难度还是会超越厉害果的高考英语阅读。</span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/pet1.JPG" alt="" width="1150" height="851" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/pet2.JPG" alt="" width="1150" height="792" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/pet3.JPG" alt="" width="1150" height="853" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/pet4.JPG" alt="" width="1150" height="883" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/pet5.JPG" alt="" width="1150" height="849" /><br /></span></span></div><div><span style="font-size: 16px;">有点出乎预料，当初只想学点外语，却能从别人课本上学到太多在兲朝课本永远学不到的东西[非郑智]，毕竟只学语言是不够的，再常识下其它科目。</span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br />4. Science<br /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;">为了替代&lt;&lt;佰科全输&gt;&gt;和&lt;&lt;屎万个为什么&gt;&gt;这种吃刮子弟们的经典毒雾，买了Science课本[某宝打印]，训练</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">娃了解常识</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">和</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">动手能力。毕竟某宝上山寨品便宜的怀疑人生，实验用完就扔呗，充分利用山寨优势嘛...</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;"> 至于难度上，我猜Science会让TEM8水平的本科生却步，CET4-6应该不用试了。</span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;">目前5年级学第5册，</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">用的2009版，当时图便宜批量买的，没有买最新[新版接近600页，美帝也是越来越竞争激烈]。美帝的小学科学每章后面都有职业生涯介绍，目的很明显，如果只为吃口饭而对所从事的工作毫无兴趣，多年下来会很沧桑而且还很难出成绩，但是，如果大环境决定了连温饱都解决不了</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">[兲朝广大韭菜]</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">，再谈别的就没意义了... <br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;">下面是第5册第1章里某节截图</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">[PDF]</span></span><span style="font-size: 12pt;"><span style="font-size: 12pt;">，不是纸质课本拍照，因为书上画的乱七八糟...</span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/cells1.jpg" alt="" width="1150" height="743" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/cells2.jpg" alt="" width="1150" height="745" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/cells3.jpg" alt="" width="1150" height="743" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/cells4.jpg" alt="" width="1150" height="694" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/cells5.jpg" alt="" width="1150" height="738" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/cells6.jpg" alt="" width="1150" height="743" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;">Science的每章后面有个复习，题目数量不多，有检验总比没有强，依旧PDF版本的截图，非拍照。<br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/cells7.jpg" alt="" width="1150" height="737" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/cells8.jpg" alt="" width="1150" height="748" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br />看到这里的，不知道是否还有家长会信5角们一贯洗脑路数：外国小孩很轻松，我们孩子负担很重...但是可能会有疑问，老外的小学课本怎么都这么厚啊？</span></span><span style="font-size: 16px;">书</span><span style="font-size: 12pt;">厚显然为了公平，因为中小学阶段该知道的就那么多，书薄讲的少就得从别的地方补习。</span><span style="font-size: 12pt;">书</span><span style="font-size: 12pt;">薄表面上减轻孩子负担，实际上最终解释权归老师，</span><span style="font-size: 12pt;">于是催生了名师、名校、学区房、补习班、网课等等，广大韭菜</span><span style="font-size: 12pt;">们只能为娃们拼财力和人脉去挤这些资源...如果书</span><span style="font-size: 12pt;">厚都讲明白了，让那些利益群体可怎么活呀...</span><span style="font-size: 12pt;"></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br />5. 数学</span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;">感觉没啥难度，除了认几个词，似乎没啥大用，有时翻一翻解解闷。<br /><br />数学对于一般受过高教的人士应该都没有多大难度。下面是第5册随便贴点吧，就这个样子的。</span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/math1.JPG" alt="" width="1150" height="862" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/math2.JPG" alt="" width="1150" height="862" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/math3.JPG" alt="" width="1150" height="862" /><br /></span></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/math4.JPG" alt="" width="1150" height="862" /><br /></span></span></div><div></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;"><br />差不多就这个样子吧，教美的小学语文和科学对于绝大多数家长还是有点难度的，感觉能力不足的，可以考虑ESL教材，例如Backpack等，其实Reach Higher,&nbsp; Wonder Skills之流也不错，经济条件好的可以不在乎这点</span></span><span style="font-size: 16px;">羊毛</span><span style="font-size: 12pt;"><span style="font-size: 12pt;">，再不济也比补习班自编的凑词</span></span><span style="font-size: 16px;">教材</span><span style="font-size: 12pt;"><span style="font-size: 12pt;">强。英美科技领先全球，在教育下一代上也有太多独到之处，他们课本当然也有不尽人意的地方，但总体上比普罗大众口中的</span></span><span style="font-size: 16px;">&#8220;经典&#8221;</span><span style="font-size: 12pt;"><span style="font-size: 12pt;">强很多</span></span><span style="font-size: 12pt;">。</span></div><div><span style="font-size: 16px;"><br /></span></div><div><span style="font-size: 12pt;"><span style="font-size: 12pt;">背单词：</span></span><a href="http://www.cppblog.com/Chipset/archive/2021/08/11/217696.html"><span style="font-size: 12pt;">http://www.cppblog.com/Chipset/archive/2021/08/11/217696.html</span></a></div><div><span style="font-size: 12pt;">听说：<a href="http://www.cppblog.com/Chipset/archive/2021/08/30/217801.html">http://www.cppblog.com/Chipset/archive/2021/08/30/217801.html</a></span></div><img src ="http://www.cppblog.com/Chipset/aggbug/217695.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2021-08-11 12:04 <a href="http://www.cppblog.com/Chipset/archive/2021/08/11/217695.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>开发一款像样的商业软件真不容易...</title><link>http://www.cppblog.com/Chipset/archive/2021/07/22/217762.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Thu, 22 Jul 2021 08:19:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2021/07/22/217762.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217762.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2021/07/22/217762.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217762.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217762.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 先讲个古老的段子吧。  几十年前(操作系统还是DOS时代)不知道哪个大人物想对抗AutoCAD，于是纠集了从清华大学...至大连理工，十几所985高校联合起来开发一款独立自主，功能和AutoCAD类似的软件。教授博士生应有尽有，资金当然也是大手笔，历时十几年。这么庞大的阵容，却远远不是Autodesk Inc.当时才几十名程序员的对手...其实现实中绝大多数高材生都写不了像样的程序，这就如同搞...&nbsp;&nbsp;<a href='http://www.cppblog.com/Chipset/archive/2021/07/22/217762.html'>阅读全文</a><img src ="http://www.cppblog.com/Chipset/aggbug/217762.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2021-07-22 16:19 <a href="http://www.cppblog.com/Chipset/archive/2021/07/22/217762.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>What does “stride” mean in image processing? [fwd]</title><link>http://www.cppblog.com/Chipset/archive/2021/07/12/217739.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Mon, 12 Jul 2021 07:00:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2021/07/12/217739.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217739.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2021/07/12/217739.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217739.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217739.html</trackback:ping><description><![CDATA[<div><a href="https://medium.com/@oleg.shipitko/what-does-stride-mean-in-image-processing-bba158a72bcd">https://medium.com/@oleg.shipitko/what-does-stride-mean-in-image-processing-bba158a72bcd</a></div><p style="margin-top:.1in;margin-right:0in;margin-bottom:0in; margin-left:0in;margin-bottom:.0001pt;line-height:42.0pt;"><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">Stride is an important concept in digital image processing. It allows performing several operations with an image in a very fast manner (in constant time) by simple modification of image metadata. If you are interested in finding out what stride is and how to use it stick with us.</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><strong><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">Pixel representation in a computer memory</span></strong></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">Before we dive into the concept of stride we first need to revise how digital images are stored in a computer memory. We will start from a pixel.</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">An image pixel is&nbsp;represented in a computer memory by a fixed number of bits. Typical pixel<strong><em>&nbsp;bit depth</em></strong>&nbsp;(amount of bits per pixel) is 32, 16, 8 or, for binary images, 1 bit. In typical RGB images, 8 bits are often used to store the color value </span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,serif;Times New Roman&quot;;color:#292929;letter-spacing:-.05pt">&#8203;&#8203;</span><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">of a single channel. Thus, the total</span>&nbsp;<strong><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;; color:#292929;letter-spacing:-.05pt">bit depth</span></em></strong><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">&nbsp;of one pixel is 24. Processing 32 and 16-bit chunks of data is simple and effective on a typical 32 and 64-bit processors. Therefore, the pixels are stored in the format of 32 bits, where the older (or younger, depending on the implementation) 8 bits remain unused. Such an approach to storing pixels requires more memory, but it allows speeding up image processing by using the standard size of the machine word. Thus, a standard RGB image occupies 32 bits in memory and has a&nbsp;<strong><em>depth</em></strong>&nbsp;of 24 bits. We will call another 8 bits necessary to supplement the size of the memory occupied by a pixel to the value of a multiple of degree 2,&nbsp;<strong><em>pixel padding</em></strong>. The total number of bytes occupied by a pixel in memory is called&nbsp;<strong><em>pixel stride</em></strong>&nbsp;(See Image 1).</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><strong><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">Image representation in a computer memory</span></strong></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">Images are stored in computer memory pixel-by-pixel, line by line. The upper left corner of the image is usually chosen as a coordinate origin (the upper left pixel of the image has the index [0, 0]). The image is stored in memory as a one-dimensional array. Pixels of the first line of the image are first written to the memory, then pixels of the second line and so on up to the last line. Each line in addition to the pixel bytes may also contain additional bytes &#8212;&nbsp;<strong><em>line padding</em></strong>. Additional bytes usually do not contain useful information and do not affect the visualization of an image when, for example, displayed on the screen. These additional bytes serve to complement a line, which is necessary for more efficient image processing and is caused by the specificity of the hardware used. For example, Cairo (a popular open source vector graphics software library) requires alignment of rows to multiple 4 bytes, which allows for more efficient image processing algorithms using vectorized processor operations and processing several image pixels simultaneously.</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">Introducing the term of&nbsp;<strong><em>line padding&nbsp;</em></strong>requires to introduce another closely coupled term &#8212;&nbsp;<strong><em>line stride</em></strong>.</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><strong><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">Line stride</span></em></strong><span style="font-size:12.0pt; font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929;letter-spacing:-.05pt">&nbsp;(<strong><em>increment</em></strong>,&nbsp;<strong><em>pitch</em></strong>&nbsp;or&nbsp;<strong><em>step size</em></strong>) is the number of bytes that one needs to add to the address in the first pixel of a row in order to go to the address of the first pixel of the next row. It is important to note that an image<strong><em>&nbsp;width</em></strong>&nbsp;is measured in pixels and describes an image itself (and doesn&#8217;t depend on how an image is stored in a computer memory). In contrast, a&nbsp;<strong><em>line stride</em></strong>&nbsp;depends on how an image is represented in memory and is measured in bytes.</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">In program source code, an image is usually represented by a data structure containing metadata (image<strong><em>&nbsp;width&nbsp;</em></strong>and&nbsp;<strong><em>height</em></strong>,&nbsp;<strong><em>line stride</em></strong><em>,&nbsp;<strong>number of channels</strong>,&nbsp;<strong>encoding type</strong></em>, etc.), as well as a pointer to the address of the first image pixel in memory (further we will refer to this address as&nbsp;<strong><em>data_begin</em></strong>). This information allows us to unambiguously read and decode an image from memory, as well as to perform a series of fast image operations by changing only a metadata associated with an image.</span></p>  <p style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"><img src="http://www.cppblog.com/images/cppblog_com/chipset/image_stride.png" width="808" height="346" alt="" /><br /></p>  <p style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,serif;Times New Roman&quot;">An image representation in a computer memory. Lines of an image are stored one by one in one-dimensional array.</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><strong><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">Image operations:<br /></span></strong><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">Let&#8217;s summarize all the terms which we introduced to this moment:<br /></span><strong><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">pixel_address</span></em></strong><em>&nbsp;</em><span style="font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">&#8212; a pixel address in memory<br /></span><strong><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">pixel depth</span></em></strong><span style="font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">&nbsp;&#8212;the number of bits per pixel (containing valuable information)<br /></span><strong><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">pixel_stride</span></em></strong><span style="font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">&nbsp;&#8212; the number of bytes occupied in memory by a pixel of an image<br /></span><strong><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">data_begin</span></em></strong><span style="font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">&nbsp;&#8212; the address of the first image pixel in memory<br /></span><strong><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">channels</span></em></strong><em>&nbsp;</em><span style="font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">&#8212; the number of image channels (3 for an RGB-image)<br /></span><strong><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">channel_address &#8212;&nbsp;</span></em></strong><span style="font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">the address of a particular pixel channel in memory<br /></span><strong><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">height</span></em></strong><span style="font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">&nbsp;&#8212; the image height in pixels<br /></span><strong><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">width</span></em></strong><span style="font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">&nbsp;&#8212; the image width in pixels<br /></span><strong><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">line_stride</span></em></strong><em>&nbsp;</em><span style="font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">&#8212; the number of bytes occupied in memory by a line of an image</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">Operations:</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:70.5pt;margin-bottom:.0001pt;text-indent:-.25in;line-height: 24.0pt;"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;color:#292929;letter-spacing:-.05pt">1.<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><strong><span style="font-size:12.0pt;font-family: &quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929;letter-spacing:-.05pt">Computing pixel address in memory</span></strong></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">The equation relating pixel memory address to its coordinates [y, x] in the image coordinate system can be represented as:</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">pixel_address = data_begin + y * line_stride + x * pixel_stride, (1)<br /></span></em><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">where&nbsp;</span><em style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">data_begin &#8212;&nbsp;</em><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">the address of the first image pixel in memory.</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">Equation (1) is used whenever you access an image in memory. In the rest of operations, presented in this post, we will only change a metadata associated with an image and assume, that the equation (1) is applied after in order to access image.</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">2.<strong>&nbsp;Pixel decoding</strong>&nbsp;(for RGB image with an equal amount of bits per channel):</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">channel_address = pixel_address + n * depth / channels, (2)<br /></span></em><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">where&nbsp;</span><em style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">n&nbsp;</em><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">is a channel index:&nbsp;</span><em style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">n = 0, 1, &#8230;, channels &#8212; 1</em><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">. Thus, for instance, for the typical RGB-image with an equal amount of bits per channel, a channel address in memory can be computed as follows:<br /></span><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">R = pixel_address,<br /></span></em><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">G = pixel_address + depth / channels,<br /></span></em><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">B = pixel_address + 2 * depth / channels.</span></em></p><p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">It is important to note that these equations depend on the type of the image stored. There are formats in which different number of bytes is used to store different channels.</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">3.<strong>&nbsp;Image flip</strong></span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">3.1&nbsp;<strong>Vertical flip<br /></strong></span><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">data_begin = data_begin + (height- 1) * line_stride ,<br /></span></em><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">line_stride = -line_stride.</span></em></p>  <p style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"><img src="http://www.cppblog.com/images/cppblog_com/chipset/vertical_flip.png" width="700" height="246" alt="" /><br /></p>  <p style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,serif;Times New Roman&quot;">Pointer to the first image pixel for the vertical flip</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">The negative&nbsp;<strong><em>line stride</em></strong>&nbsp;being inserted into equation (1) allows us to move upwards reading (or visualizing) an image from the last row to the first, thus, realizing vertical flip.</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">3.2&nbsp;<strong>Horizontal flip<br /></strong></span><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">data_begin = data_begin + (width &#8212; 1) * pixel_stride ,<br /></span></em><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">pixel_stride = -pixel_stride.</span></em></p>  <p style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;background:#F2F2F2"><span style="font-family: &quot;Times New Roman&quot;, serif; font-size: 12pt;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/horizontal_flip.png" width="700" height="310" alt="" /><br />Pointer to the first image pixel for the horizontal flip</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">In the same manner as with negative&nbsp;<strong><em>line stride</em>&nbsp;</strong>in the previous example, the negative&nbsp;<strong><em>pixel stride&nbsp;</em></strong>here allows us to move from right to left and to read (or visualize) an image flipped horizontally.</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">3.3&nbsp;<strong>Vertical and horizontal flip<br /></strong></span><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">The combination of previous two approaches allows to flip an image in both directions at once:<br /></span><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">data_begin = data_begin + (height-1) * line_stride + (width-1) * pixel_stride,<br /></span></em><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">line_stride = -line_stride,<br /></span></em><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">pixel_stride = -pixel_stride.</span></em></p>  <p style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;background:#F2F2F2">&nbsp;<img src="http://www.cppblog.com/images/cppblog_com/chipset/horizontal_flip2.png" width="700" height="276" alt="" /><br /><span style="font-family: &quot;Times New Roman&quot;, serif; font-size: 12pt;">Pointer to the first image pixel for the simultaneous vertical and horizontal flip</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">4.<strong>&nbsp;Extracting image subwindow<br /></strong></span><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">data_begin = new_data_begin,<br /></span></em><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">width = new_width,<br /></span></em><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">height = new_height.<br /></span></em><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">With this approach we set a new origin of our image (inside a boundary of the original image) and set a&nbsp;</span><em style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">width</em><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">&nbsp;and&nbsp;</span><em style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">height&nbsp;</em><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">which basically tell us how many time we should apply an equation (1) to read all pixels (</span><strong style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;"><em>width</em></strong><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">&nbsp;x&nbsp;</span><strong style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;"><em>height</em></strong><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">) and after which amount of pixels read we should increase the y coordinate (to start reading pixels of the next row). Note that such parameters as&nbsp;</span><strong style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;"><em>line stride&nbsp;</em></strong><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">remain unchanged.</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">5.&nbsp;<strong>Extracting single image channel<br /></strong></span><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">To extract a single image channel we can use a combination of equations (1) and (2):<br /></span><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">pixel_address = data_begin + y * line_stride + x * pixel_stride +</span></em><em><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">&nbsp;n * depth / channels,<br /></span></em><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">where&nbsp;</span><em style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">n &#8212;&nbsp;</em><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">channel index,&nbsp;</span><em style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">n = 0, 1, &#8230;, channels &#8212; 1</em><span style="color: #292929; font-family: Georgia, serif; font-size: 12pt; letter-spacing: -0.05pt;">.</span></p>  <p style="margin-top:24.0pt;margin-right:0in;margin-bottom: 0in;margin-left:0in;margin-bottom:.0001pt;line-height:24.0pt"><strong><span style="font-size:12.0pt;font-family:&quot;Georgia&quot;,serif;Times New Roman&quot;;Times New Roman&quot;;color:#292929; letter-spacing:-.05pt">REFERENCES<br /></span></strong><span style="text-indent: -0.25in; font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">1.<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="text-indent: -0.25in; font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">A programmer&#8217;s view on digital images: the essentials:&nbsp;<a href="https://www.collabora.com/news-and-blog/blog/2016/02/16/a-programmers-view-on-digital-images-the-essentials/"><span style="color:blue">https://www.collabora.com/news-and-blog/blog/2016/02/16/a-programmers-view-on-digital-images-the-essentials/<br /></span></a></span><span style="text-indent: -0.25in; font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">2.<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="text-indent: -0.25in; font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">Microsoft Media Foundation Programming Guide: Image Stride:<a href="https://docs.microsoft.com/en-us/windows/desktop/medfound/image-stride"><span style="color:blue">Image Stride When a video image is stored in memory, the memory buffer might contain extra padding bytes after each row of pixels&#8230;docs.microsoft.com<br /></span></a></span><span style="text-indent: -0.25in; font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">3.<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="text-indent: -0.25in; font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">Wikipedia: Stride of an array:&nbsp;<a href="https://en.wikipedia.org/wiki/Stride_of_an_array"><span style="color: blue">https://en.wikipedia.org/wiki/Stride_of_an_array<br /></span></a></span><span style="text-indent: -0.25in; font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">4.<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="text-indent: -0.25in; font-size: 12pt; font-family: Georgia, serif; color: #292929; letter-spacing: -0.05pt;">Cairo library:&nbsp;<a href="https://cairographics.org/"><span style="color:blue">https://cairographics.org/</span></a></span></p><img src ="http://www.cppblog.com/Chipset/aggbug/217739.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2021-07-12 15:00 <a href="http://www.cppblog.com/Chipset/archive/2021/07/12/217739.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>raster and vector image [fwd]</title><link>http://www.cppblog.com/Chipset/archive/2021/07/09/217733.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Fri, 09 Jul 2021 12:13:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2021/07/09/217733.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217733.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2021/07/09/217733.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217733.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217733.html</trackback:ping><description><![CDATA[<div><span style="font-size: 12pt;">转载的，出处不详。<br /><br /><strong>Raster Images</strong></span></div><div>&#160;<img src="http://www.cppblog.com/images/cppblog_com/chipset/raster.png" width="397" height="207" alt="" /></div><div>Raster (or bitmap) images are generally what you think about when thinking of images. These are the types of images that are produced when scanning or photographing an object. Raster images are compiled using pixels, or tiny dots, containing unique color and tonal information that come together to create the image.&#160;</div><div>Since raster images are pixel based, they are resolution dependent. The number of pixels that make up an image as well as how many of those pixels are displayed per inch, both determine the quality of an image. As you may have guessed, the more pixels in the image and the higher the resolution is, the higher quality the image will be.</div><div>For example, if we scale a raster image to enlarge it, without changing resolution, it will lose quality and look blurry or pixilated. This is because we are stretching the pixels over a larger area, thus making them look less sharp. This is a common problem but can be remedied by using raster image editing programs such as Photoshop to change resolution and properly scale images.</div><div>&#160;</div><div>Common Raster Image Types: JPG, TIFF, GIF, PNG, BMP</div><div>&#160;<img src="http://www.cppblog.com/images/cppblog_com/chipset/color.png" width="1150" height="121" alt="" /></div><div><br /><strong style="font-size: 12pt;">Vector Images</strong></div><div>&#160;<img src="http://www.cppblog.com/images/cppblog_com/chipset/vector.png" width="397" height="207" alt="" /></div><div>Instead of trying to keep track of the millions of tiny pixels in a raster image, vector images, or line art, keep track of points and the equations for the lines that connect them. Generally speaking, vector images are made up of paths or line art that can infinitely scalable because they work based on algorithms rather than pixels.</div><div>&#160;</div><div>One of the greatest things about vector images is that you can re-size them infinitely larger or smaller, and they will still print out just as clearly, with no increase (or decrease) in file size. If you remember back to your high school geometry, the equation for a circle of center (h,k) and radius r is (x - h)2 + (y - k)2 = r2. If you want to make the circle bigger, you just increase the value of r - instead of having to keep track of tons more pixels, the computer just has to keep track of a different number. That takes almost no file space at all.</div><div>So, what types of graphics would typically be vector? Well, almost all computer font files are based on vector images of the letters - that's why it's possible to scale them WAY up or WAY down and still have the letters be clear.&#160; All Microsoft Office clipart uses vector art and most charts and graphs produced by Office or by statistical analysis software are vector-based. Typically vector art is created in illustration applications such as Adobe Illustrator or CorelDRAW. Vector illustrations are great for logos, illustrations/artwork, animations, and text.&#160;</div><div>Common Vector File Types: EPS, SVG<br /><img src="http://www.cppblog.com/images/cppblog_com/chipset/line.png" width="473" height="82" alt="" /></div> <img src ="http://www.cppblog.com/Chipset/aggbug/217733.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2021-07-09 20:13 <a href="http://www.cppblog.com/Chipset/archive/2021/07/09/217733.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>UTF8&lt;=&gt;UTF16&lt;=&gt;UTF32</title><link>http://www.cppblog.com/Chipset/archive/2021/06/23/217579.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Wed, 23 Jun 2021 06:55:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2021/06/23/217579.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217579.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2021/06/23/217579.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217579.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217579.html</trackback:ping><description><![CDATA[<h2><span style="font-size: 14px;">https://github.com/ww898/utf-cpp别人写好了，MIT License，我直接拿过来备份一份。http://www.cppblog.com/Files/Chipset/utf-cpp.7z</span></h2><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;; font-size: 16px; background-color: #ffffff;">This is the C++11 template based header only library under Windows/Linux/MacOs to convert UFT-8/16/32 symbols and strings. The library transparently support&nbsp;<code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; background-color: var(--color-markdown-code-bg); border-radius: 6px;">wchar_t</code>&nbsp;as UTF-16 for Windows and UTF-32 for Linux and MacOs.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;; font-size: 16px; background-color: #ffffff;">UTF-8 and UTF-32 (UCS-32) both support 31 bit wide code points&nbsp;<code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; background-color: var(--color-markdown-code-bg); border-radius: 6px;">[0&#8229;0x7FFFFFFF]</code>with no restriction. UTF-16 supports only unicode code points&nbsp;<code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; background-color: var(--color-markdown-code-bg); border-radius: 6px;">[0&#8229;0x10FFFF]</code>, where high&nbsp;<code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; background-color: var(--color-markdown-code-bg); border-radius: 6px;">[0xD800&#8229;0xDBFF]</code>&nbsp;and low&nbsp;<code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; background-color: var(--color-markdown-code-bg); border-radius: 6px;">[0xDC00&#8229;0xDFFF]</code>&nbsp;surrogate regions are prohibited.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;; font-size: 16px; background-color: #ffffff;">The maximum UTF-16 symbol size is 2 words (4 bytes, both words should be in the surrogate region). UFT-32 (UCS-32) is always 1 word (4 bytes). UTF-8 has the maximum symbol size (see&nbsp;<a href="https://github.com/ww898/utf-cpp#utf-8-conversion-table" style="box-sizing: border-box; background-color: transparent; text-decoration-line: none;">conversion table</a>&nbsp;for details):</p><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;; font-size: 16px; background-color: #ffffff;"><li style="box-sizing: border-box;">4 bytes for unicode code points</li><li style="box-sizing: border-box; margin-top: 0.25em;">6 bytes for 31bit code points</li></ul><h6><a id="user-content-utf-16-surrogate-decoder" aria-hidden="true" href="https://github.com/ww898/utf-cpp#utf-16-surrogate-decoder" style="box-sizing: border-box; text-decoration-line: none; float: left; padding-right: 4px; margin-left: -20px; line-height: 1;"><svg octicon-link"="" viewbox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"></svg></a><span style="font-size: 10pt;">UTF-16 surrogate decoder:</span></h6><table style="border-spacing: 0px; border-collapse: collapse; margin-top: 0px; margin-bottom: 16px; display: block; width: max-content; max-width: 100%; overflow: auto; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;; font-size: 16px; background-color: #ffffff;"><thead style="box-sizing: border-box;"><tr style="box-sizing: border-box; background-color: var(--color-bg-primary); border-top: 1px solid var(--color-markdown-table-tr-border);"><th align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">High\Low</th><th align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">DC00</th><th align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">DC01</th><th align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">&#8230;</th><th align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">DFFF</th></tr></thead><tbody style="box-sizing: border-box;"><tr style="box-sizing: border-box; background-color: var(--color-bg-primary); border-top: 1px solid var(--color-markdown-table-tr-border);"><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);"><span style="box-sizing: border-box; font-weight: 600;">D800</span></td><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">010000</td><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">010001</td><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">&#8230;</td><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">0103FF</td></tr><tr style="box-sizing: border-box; background-color: var(--color-bg-tertiary); border-top: 1px solid var(--color-markdown-table-tr-border);"><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);"><span style="box-sizing: border-box; font-weight: 600;">D801</span></td><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">010400</td><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">010401</td><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">&#8230;</td><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">0107FF</td></tr><tr style="box-sizing: border-box; background-color: var(--color-bg-primary); border-top: 1px solid var(--color-markdown-table-tr-border);"><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);"><span style="box-sizing: border-box; font-weight: 600;">&#8942;</span></td><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">&#8942;</td><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">&#8942;</td><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">&#8945;</td><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">&#8942;</td></tr><tr style="box-sizing: border-box; background-color: var(--color-bg-tertiary); border-top: 1px solid var(--color-markdown-table-tr-border);"><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);"><span style="box-sizing: border-box; font-weight: 600;">DBFF</span></td><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">10FC00</td><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">10FC01</td><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">&#8230;</td><td align="center" style="box-sizing: border-box; padding: 6px 13px; border: 1px solid var(--color-markdown-table-border);">10FFFF<br /><br /></td></tr></tbody></table><img src="http://www.cppblog.com/images/cppblog_com/chipset/utf16.png" border="0" alt="" /><br /><br /><h2 style="box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; border-bottom: 1px solid var(--color-border-secondary); color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;; background-color: #ffffff;">UTF-8 Conversion table</h2><img src="http://www.cppblog.com/images/cppblog_com/chipset/utf8.png" alt="" /><br /><div highlight-source-c++"="" style="box-sizing: border-box; margin-bottom: 16px; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;; font-size: 16px; background-color: #ffffff;"><pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 0px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: var(--color-bg-tertiary); border-radius: 6px; word-break: normal;"><div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><span style="color: #008000; ">//</span><span style="color: #008000; ">&nbsp;यूनिकोड</span><span style="color: #008000; "><br /></span><span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">static</span><span style="color: #000000; ">&nbsp;</span><span style="color: #0000FF; ">char</span><span style="color: #000000; ">&nbsp;</span><span style="color: #0000FF; ">const</span><span style="color: #000000; ">&nbsp;u8s[]&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">"</span><span style="color: #000000; ">\xE0\xA4\xAF\xE0\xA5\x82\xE0\xA4\xA8\xE0\xA4\xBF\xE0\xA4\x95\xE0\xA5\x8B\xE0\xA4\xA1</span><span style="color: #000000; ">"</span><span style="color: #000000; ">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">using</span><span style="color: #000000; ">&nbsp;</span><span style="color: #0000FF; ">namespace</span><span style="color: #000000; ">&nbsp;ww898::utf;<br />&nbsp;&nbsp;&nbsp;&nbsp;std::u16string&nbsp;u16;<br />&nbsp;&nbsp;&nbsp;&nbsp;convz</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">utf_selector_t</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">decltype(</span><span style="color: #000000; ">*</span><span style="color: #000000; ">u8s)</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">,&nbsp;utf16</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">(u8s,&nbsp;std::back_inserter(u16));<br />&nbsp;&nbsp;&nbsp;&nbsp;std::u32string&nbsp;u32;<br />&nbsp;&nbsp;&nbsp;&nbsp;conv</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">utf16,&nbsp;utf_selector_t</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">decltype(u32)::value_type</span><span style="color: #000000; ">&gt;&gt;</span><span style="color: #000000; ">(u16.begin(),&nbsp;u16.end(),&nbsp;std::back_inserter(u32));<br />&nbsp;&nbsp;&nbsp;&nbsp;std::vector</span><span style="color: #000000; ">&lt;</span><span style="color: #0000FF; ">char</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">&nbsp;u8;<br />&nbsp;&nbsp;&nbsp;&nbsp;convz</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">utf32,&nbsp;utf8</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">(u32.data(),&nbsp;std::back_inserter(u8));<br />&nbsp;&nbsp;&nbsp;&nbsp;std::wstring&nbsp;uw;<br />&nbsp;&nbsp;&nbsp;&nbsp;conv</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">utf8,&nbsp;utfw</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">(u8s,&nbsp;u8s&nbsp;</span><span style="color: #000000; ">+</span><span style="color: #000000; ">&nbsp;</span><span style="color: #0000FF; ">sizeof</span><span style="color: #000000; ">(u8s),&nbsp;std::back_inserter(uw));<br />&nbsp;&nbsp;&nbsp;&nbsp;auto&nbsp;u8r&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;conv</span><span style="color: #000000; ">&lt;</span><span style="color: #0000FF; ">char</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">(uw);<br />&nbsp;&nbsp;&nbsp;&nbsp;auto&nbsp;u16r&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;conv</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">char16_t</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">(u16);<br />&nbsp;&nbsp;&nbsp;&nbsp;auto&nbsp;uwr&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;convz</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">wchar_t</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">(u8s);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;auto&nbsp;u32r&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;conv</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">char32_t</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">(std::string_view(u8r.data(),&nbsp;u8r.size()));&nbsp;</span><span style="color: #008000; ">//</span><span style="color: #008000; ">&nbsp;C++17&nbsp;only</span><span style="color: #008000; "><br /></span><span style="color: #000000; "><br />&nbsp;&nbsp;&nbsp;&nbsp;static_assert(std::is_same</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">utf_selector</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">decltype(</span><span style="color: #000000; ">*</span><span style="color: #000000; ">u8s)</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">,&nbsp;utf_selector</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">decltype(u8)::value_type</span><span style="color: #000000; ">&gt;&gt;</span><span style="color: #000000; ">::value,&nbsp;</span><span style="color: #000000; ">"</span><span style="color: #000000; ">Fail</span><span style="color: #000000; ">"</span><span style="color: #000000; ">);<br />&nbsp;&nbsp;&nbsp;&nbsp;static_assert(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;std::is_same</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">utf_selector_t</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">decltype(u16)::value_type</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">,&nbsp;utf_selector_t</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">decltype(uw)::value_type</span><span style="color: #000000; ">&gt;&gt;</span><span style="color: #000000; ">::value&nbsp;</span><span style="color: #000000; ">!=</span><span style="color: #000000; "><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;std::is_same</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">utf_selector_t</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">decltype(u32)::value_type</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">,&nbsp;utf_selector_t</span><span style="color: #000000; ">&lt;</span><span style="color: #000000; ">decltype(uw)::value_type</span><span style="color: #000000; ">&gt;&gt;</span><span style="color: #000000; ">::value,&nbsp;</span><span style="color: #000000; ">"</span><span style="color: #000000; ">Fail</span><span style="color: #000000; ">"</span><span style="color: #000000;">);<br /></span></div></pre></div><img src ="http://www.cppblog.com/Chipset/aggbug/217579.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2021-06-23 14:55 <a href="http://www.cppblog.com/Chipset/archive/2021/06/23/217579.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Base64</title><link>http://www.cppblog.com/Chipset/archive/2021/06/22/217717.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Tue, 22 Jun 2021 09:54:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2021/06/22/217717.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217717.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2021/06/22/217717.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217717.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217717.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 转自：https://github.com/ReneNyffenegger/cpp-base64 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/*&nbsp;&nbsp;&nbsp;base64.cpp&nbsp;and&nbsp;base64.h...&nbsp;&nbsp;<a href='http://www.cppblog.com/Chipset/archive/2021/06/22/217717.html'>阅读全文</a><img src ="http://www.cppblog.com/Chipset/aggbug/217717.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2021-06-22 17:54 <a href="http://www.cppblog.com/Chipset/archive/2021/06/22/217717.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>留学加拿大</title><link>http://www.cppblog.com/Chipset/archive/2020/07/06/217394.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Mon, 06 Jul 2020 01:49:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2020/07/06/217394.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217394.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2020/07/06/217394.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217394.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217394.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 转自知乎，不对真实性负责。基本基于现实生活，细节有加工。原先写这个答案，只是想调侃一下当年我自己和周围同学们留学以及之后移民的经历，因为想着以英文字母代替真实人名，所以只写了不到26个老同学的小故事，但写完后发现太偏颇，都是小留学生转移民的案例，不足以代表广大成年工作后再来到加拿大的技术移民，投资移民，甚至灰色一点的，难民，偷渡客，所以补充了一些故事。但这样一来字母就不够用了，我就用他们的外号或者...&nbsp;&nbsp;<a href='http://www.cppblog.com/Chipset/archive/2020/07/06/217394.html'>阅读全文</a><img src ="http://www.cppblog.com/Chipset/aggbug/217394.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2020-07-06 09:49 <a href="http://www.cppblog.com/Chipset/archive/2020/07/06/217394.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>PDF里的BOX</title><link>http://www.cppblog.com/Chipset/archive/2020/03/02/217178.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Mon, 02 Mar 2020 09:01:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2020/03/02/217178.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217178.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2020/03/02/217178.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217178.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217178.html</trackback:ping><description><![CDATA[<p style="margin-top:6.0pt;margin-right:0in;margin-bottom:0in; margin-left:0in;margin-bottom:.0001pt;line-height:normal;"><span style="font-size:24.0pt;font-family:&quot;Comic Sans MS&quot;;Times New Roman&quot;;Times New Roman&quot;;">The PDF page boxes: MediaBox, CropBox, BleedBox, TrimBox &amp; ArtBox</span></p>  <p style="margin-bottom:.1in;line-height:normal;background: white"><span style="font-size:11.5pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#404040">A PDF describes the content and appearance of one or more pages. It also contains a definition of the physical size of those pages. That page size definition is not as straightforward as you might think. There can in fact be up to 5 different definitions in a PDF that relate to the size of its pages. These are called the&nbsp;<strong>boundary boxes</strong>&nbsp;or page boxes:</span></p>  <p style="margin-left: 12pt; text-indent: -0.25in; line-height: normal; background: white;"><span style="font-size:10.0pt;font-family:Symbol;color:#404040">&#183;<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 11.5pt; font-family: Arial, sans-serif;">The&nbsp;<strong>MediaBox</strong>&nbsp;is used to specify the width and height of the page. For the average user, this probably equals the actual page size. For prepress use, this is not the case as we prefer our pages to be defined slightly oversized so that we can see the bleed (Images or other elements touching an outer edge of a printed page need to extend beyond the edge of the paper to compensate for inaccuracies in trimming the page), the crop marks and useful information such as the file name or the date and time when the file was created. This means that PDF files used in graphic arts usually have a MediaBox which is larger than the trimmed page size.</span></p>  <p style=" margin-left:12.0pt;text-indent:-.25in;line-height:normal;background:white"><span style="font-size:10.0pt;font-family:Symbol;color:#404040">&#183;<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:11.5pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#404040">The&nbsp;<strong>CropBox</strong>&nbsp;defines the region that the PDF viewer application is expected to display or print. So if a PDF contains a CropBox definition, Acrobat uses it for screen display and printing. For prepress use, the CropBox is pretty irrelevant. The GWG industry association recommends not to use it at all.</span></p>  <p style=" margin-left:12.0pt;text-indent:-.25in;line-height:normal;background:white"><span style="font-size:10.0pt;font-family:Symbol;color:#404040">&#183;<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:11.5pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#404040">The&nbsp;<strong>TrimBox</strong>&nbsp;defines the intended dimensions of the finished page. Contrary to the CropBox, the TrimBox is very important because it defines the actual page size that gets printed. The imposition programs and workflows that I know all use the TrimBox as the basis for positioning pages on a press sheet. By default the TrimBox equals the CropBox.</span></p>  <p style=" margin-left:12.0pt;text-indent:-.25in;line-height:normal;background:white"><span style="font-size:10.0pt;font-family:Symbol;color:#404040">&#183;<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:11.5pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#404040">The&nbsp;<strong>BleedBox</strong>&nbsp;determines the region to which the page contents needs to be clipped when output in a production environment. Usually the BleedBox is 3 to 5 millimeters larger than the TrimBox. It is nice to know the size of the BleedBox but it isn&#8217;t that important in graphic arts. Most prepress systems allow you to define the amount of bleed yourself and ignore the BleedBox. By default the BleedBox equals the CropBox.</span></p>  <p style=" margin-left:12.0pt;text-indent:-.25in;line-height:normal;background:white"><span style="font-size:10.0pt;font-family:Symbol;color:#404040">&#183;<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:11.5pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#404040">The&nbsp;<strong>ArtBox&nbsp;</strong>is a bit of a special case. It was originally added to indicate the area covered by the artwork of the page. It is never used for that but can be handy in a few cases:</span></p>  <p style=" margin-left:30.0pt;text-indent:-.25in;line-height:normal;background:white"><span style="font-size:10.0pt;font-family:Symbol;color:#404040">&#183;<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:11.5pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#404040">On a PDF page that contains an advertisement, the ArtBox can be used to define the location of that ad. This allows you to place that PDF on another page but only use the area covered by the advert.</span></p>  <p style=" margin-left:30.0pt;text-indent:-.25in;line-height:normal;background:white"><span style="font-size:10.0pt;font-family:Symbol;color:#404040">&#183;<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:11.5pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#404040">A more common use of the ArtBox is as a means to indicate the safety zone. When creating a poster that will be placed in a lightbox, the designer must make sure text and logo&#8217;s aren&#8217;t positioned too close to the edge. If the poster is not mounted properly, this could cause that text or logo to disappear behind the frame of the lightbox. In book design, there is also a margin where you cannot put text because the binding might make it difficult to read text that is too close to the spine. The area where it is safe to place graphic elements is called the safety zone or text safe area. The ArtBox can be used to indicate the dimensions of this part of the page.</span></p>  <p style="margin-top:8.4pt;margin-right:0in;margin-bottom:0in; margin-left:0in;margin-bottom:.0001pt;line-height:normal;background:white"><span style="font-family: &quot;Comic Sans MS&quot;; font-size: 18.5pt; text-align: center;"><img src="http://www.cppblog.com/images/cppblog_com/chipset/pdfbox.png" width="1140" height="1416" alt="" /><br />General rules regarding page boxes</span></p>  <p style=" margin-left:12.0pt;text-indent:-.25in;line-height:normal;background:white"><span style="font-size:10.0pt;font-family:Symbol;color:#404040">&#183;<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:11.5pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#404040">Each page in a PDF can have different sizes for the various page boxes.</span></p>  <p style=" margin-left:12.0pt;text-indent:-.25in;line-height:normal;background:white"><span style="font-size:10.0pt;font-family:Symbol;color:#404040">&#183;<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:11.5pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#404040">The page boxes are always rectangular. That may seem logical but artwork is not always rectangular: a PDF can represent an oval label or the foldout of a cardboard box.</span></p>  <p style=" margin-left:12.0pt;text-indent:-.25in;line-height:normal;background:white"><span style="font-size:10.0pt;font-family:Symbol;color:#404040">&#183;<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:11.5pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#404040">A PDF always has a MediaBox definition. All the other page boxes do not necessarily have to be present in regular PDF files.</span></p>  <p style=" margin-left:12.0pt;text-indent:-.25in;line-height:normal;background:white"><span style="font-size:10.0pt;font-family:Symbol;color:#404040">&#183;<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:11.5pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#404040">The above rule is not true for the PDF/X file formats:</span></p>  <p style=" margin-left:30.0pt;text-indent:-.25in;line-height:normal;background:white"><span style="font-size:10.0pt;font-family:Symbol;color:#404040">&#183;<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:11.5pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#404040">PDF/X-1a and PDF/X-3 compliant files need to include the MediaBox, TrimBox, and BleedBox.</span></p>  <p style=" margin-left:30.0pt;text-indent:-.25in;line-height:normal;background:white"><span style="font-size:10.0pt;font-family:Symbol;color:#404040">&#183;<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:11.5pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#404040"><a href="https://www.prepressure.com/pdf/basics/pdfx-4"><strong><span style="color: purple">PDF/X-4</span></strong></a>&nbsp;files need, next to the MediaBox, a TrimBox or an ArtBox, but not both. The ArtBox or TrimBox cannot be larger that the BleedBox. If a CropBox is present, the ArtBox,&nbsp; TrimBox, and BleedBox need to extend beyond its boundaries.</span></p>  <p style=" margin-left:12.0pt;text-indent:-.25in;line-height:normal;background:white"><span style="font-size:10.0pt;font-family:Symbol;color:#404040">&#183;<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size:11.5pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#404040">The MediaBox is the largest page box in a PDF. The other page boxes can equal the size of the MediaBox but they are not expected to be larger (The latter is explicitly required in the PDF/X-4 requirements). If they are larger, the PDF viewer will use the values of the MediaBox.</span></p>  <p style="margin-top:8.4pt;margin-right:0in;margin-bottom:0in; margin-left:0in;margin-bottom:.0001pt;line-height:normal;background:white"><span style="font-family: &quot;Comic Sans MS&quot;; font-size: 18.5pt;">BBox</span></p>  <p style="line-height:normal;background:white"><span style="font-size:11.5pt;font-family:&quot;Arial&quot;,sans-serif;Times New Roman&quot;;color:#404040">Within PDF files there is another box, the bounding box or BBox, that is used. The bounding box is a rectangular frame that determines the dimensions of an object (such as a graphic, font or pattern) that is placed inside a PDF document. As such, this box has nothing to do with the page boxes.</span></p><img src ="http://www.cppblog.com/Chipset/aggbug/217178.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2020-03-02 17:01 <a href="http://www.cppblog.com/Chipset/archive/2020/03/02/217178.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>零基础学编程 --- 转贴</title><link>http://www.cppblog.com/Chipset/archive/2019/12/19/217042.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Thu, 19 Dec 2019 09:22:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2019/12/19/217042.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/217042.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2019/12/19/217042.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/217042.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/217042.html</trackback:ping><description><![CDATA[<div><strong>转自：https://www.zhihu.com/question/39431192</strong></div><p align="left"><span style="font-family: 宋体;">对于所有编程学习者，尤其是零基础的同学们，在学习的初期，一定要给自己做一个思想上的转变。在我的编程学习理论中，这个思想的转变至关重要，什么时候你把这个思维转换过来了，你就是真正上道的那一天。</span></p>  <p align="left"><span style="font-family: 宋体;">这个思维转换就是：<strong>不要把自己当学生，而是要把自己当开发者。</strong></span></p>  <p align="left"><span style="font-family: 宋体;">不同的身份认同感，最后会导致不同的行为模式，而这行为模式，会对你的编程学习造成非常大的影响。</span></p>  <p align="left"><strong><span style="font-family: 宋体;">区别一：记笔记</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;"> VS </span></strong><strong><span style="font-family: 宋体;">写技术文章</span></strong><strong></strong></p>  <p align="left"><span style="font-family: 宋体;">学生有一个特点，就是他们喜欢记笔记，但是开发者不怎么记笔记，而是会把自己学会的东西写成技术文章、教程的形式发表在技术博客或者知乎等网站上。</span></p>  <p align="left"><span style="font-family: 宋体;">一个很有名的学习法叫做<strong>费曼学习法</strong>，这个学习方法简单地说，就是在学完一个东西之后，去给别人讲明白，注意，是讲给别人听，当你写成文章发表在网上的时候，你自然会去用更通俗的语言，更清晰的逻辑去讲述这个事物背后的逻辑，这个过程，是对自己学习的一个检验，也是加深映像，整理思路的重要过程。</span></p>  <p align="left"><span style="font-family: 宋体;">那么如果你是去记笔记的话，很有可能，你不会去试图讲清楚这个东西，而是倾向于去照抄，或是不完全照抄，以</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8220;</span><span style="font-family: 宋体;">提纲</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8221;</span><span style="font-family: 宋体;">或是</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8220;</span><span style="font-family: 宋体;">知识点</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8221;</span><span style="font-family: 宋体;">的形式抄在本子上，说句实话，照抄的笔记，真的没用，因为现在搜索引擎的能力已经可以让你把大多数东西快速找到，你为什么还要照抄到笔记本上呢？</span></p>  <p align="left"><span style="font-family: 宋体;">从功利的角度考虑，技术文章的写作，别人可以直接访问，也可以逐渐累积你的影响力，一个好的个人技术博客，会给你的简历加分很多，而一个厚厚的笔记本，没有人会管你记了什么。</span></p>  <p align="left"><strong><span style="font-family: 宋体;">区别二：以学会</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">XX</span></strong><strong><span style="font-family: 宋体;">为目标</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;"> VS </span></strong><strong><span style="font-family: 宋体;">以做出</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">XX</span></strong><strong><span style="font-family: 宋体;">为目标</span></strong><strong></strong></p>  <p align="left"><span style="font-family: 宋体;">你会发现，学生思维里面有一个重要的特点，就是他们总是特别关注自己</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8220;</span><span style="font-family: 宋体;">学会了什么</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8221;</span><span style="font-family: 宋体;">，不仅如此，他给自己定的目标，定的计划，永远都是</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8221;</span><span style="font-family: 宋体;">学会</span><span style="font-family: &quot;Times New Roman&quot;, serif;">XX</span><span style="font-family: 宋体;">书第</span><span style="font-family: &quot;Times New Roman&quot;, serif;">XX</span><span style="font-family: 宋体;">章内容</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8220;</span><span style="font-family: 宋体;">。</span></p>  <p align="left"><strong><span style="font-family: 宋体;">学生永远在准备</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span></strong><strong><span style="font-family: 宋体;">而开发者早已动手。</span></strong></p>  <p align="left"><span style="font-family: 宋体;">如果你还在上学，学生思维是</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8220;</span><span style="font-family: 宋体;">这个学期我要学会</span><span style="font-family: &quot;Times New Roman&quot;, serif;">XX</span><span style="font-family: 宋体;">课程</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8221;</span><span style="font-family: 宋体;">，而开发者思维是</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8220;</span><span style="font-family: 宋体;">这个学期我要做出</span><span style="font-family: &quot;Times New Roman&quot;, serif;">XX&#8221;</span><span style="font-family: 宋体;">。</span></p>  <p align="left"><span style="font-family: 宋体;">如果学</span><span style="font-family: &quot;Times New Roman&quot;, serif;">Python</span><span style="font-family: 宋体;">，学生思维会拿起一本教材，开始从头到尾看，我不知道你们发现没有，几乎所有那种编程语言教材，长得都差不多，上来先是基本的语法，基本的整型变量，浮点型变量之类的，然后伴随着几个小的教学例子。</span></p>  <p align="left"><span style="font-family: 宋体;">开发者学</span><span style="font-family: &quot;Times New Roman&quot;, serif;">Python</span><span style="font-family: 宋体;">，他第一步绝对不是去书店买教材，而是先去了解，</span><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">Python</span></strong><span style="font-family: 宋体;">适合做什么，然后他了解到，</span><span style="font-family: &quot;Times New Roman&quot;, serif;">Python</span><span style="font-family: 宋体;">适合做<strong>爬虫，数据分析，</strong></span><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">AI</span></strong><strong><span style="font-family: 宋体;">，还能很轻松地搭建</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">Web</span></strong><strong><span style="font-family: 宋体;">后端，</span></strong><span style="font-family: 宋体;">之后他逛了一下午</span><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">Github</span></strong><span style="font-family: 宋体;">，看了看那些</span><span style="font-family: &quot;Times New Roman&quot;, serif;">Python</span><span style="font-family: 宋体;">高星项目都是做啥的，于是他给自己定下了这个目标：半年时间内，我要用</span><span style="font-family: &quot;Times New Roman&quot;, serif;">Python</span><span style="font-family: 宋体;">和</span><span style="font-family: &quot;Times New Roman&quot;, serif;">Python</span><span style="font-family: 宋体;">周边的库搭建出一个网站，这个网站服务端运用爬虫技术爬取一些数据，可以提供知乎粉丝性别比例分析功能。</span></p>  <p align="left"><span style="font-family: 宋体;">学生继续看书，一个个的知识点去记忆，拿着他的小本本去总结知识点，而开发者<strong>上官网简单的看了下</strong></span><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">Reference Doc</span></strong><strong><span style="font-family: 宋体;">的简单交互式语法教程</span></strong><span style="font-family: 宋体;">后，便马上开始了<strong>边做边学</strong>的过程，有了一个<strong>实际的项目目标</strong>，朝着这个目标走，不断地发现自己不会这，不会那，然后有目的性的去补足知识，他了解到了</span><span style="font-family: &quot;Times New Roman&quot;, serif;">beautiful soup</span><span style="font-family: 宋体;">作为爬虫主库，</span><span style="font-family: &quot;Times New Roman&quot;, serif;">flask</span><span style="font-family: 宋体;">作为后端</span><span style="font-family: &quot;Times New Roman&quot;, serif;">web</span><span style="font-family: 宋体;">服务主库，然后会去看一些简单的教程，在这个过程中，基础语法得到了熟练，也训练了工程能力。</span></p>  <p align="left"><strong><span style="font-family: 宋体;">学生的成就感来源于学会了什么，开发者的成就感来源于做出来什么。</span></strong></p>  <p align="left"><span style="font-family: 宋体;">开发者很功利，他们深知他们学会的所有东西都是为了开发出伟大的产品而服务的，所以他们绝对不会出现</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8220;</span><span style="font-family: 宋体;">在学一个东西，但是也不知道学这个用来干嘛</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8221;</span><span style="font-family: 宋体;">的窘境。</span></p>  <p align="left"><strong><span style="font-family: 宋体;">区别三：厌恶不确定性</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;"> VS </span></strong><strong><span style="font-family: 宋体;">接受不确定性</span></strong><strong></strong></p>  <p align="left"><span style="font-family: 宋体;">学生们总是对</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8220;</span><span style="font-family: 宋体;">确定性</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8221;</span><span style="font-family: 宋体;">有一种几乎疯狂的追求，他们总问，</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8220;C</span><span style="font-family: 宋体;">语言学到什么程度就一定能被大厂录取？</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8221;</span><span style="font-family: 宋体;">，</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8220;</span><span style="font-family: 宋体;">掌握</span><span style="font-family: &quot;Times New Roman&quot;, serif;">XX</span><span style="font-family: 宋体;">要几个月？</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8221;</span><span style="font-family: 宋体;">，</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8220;</span><span style="font-family: 宋体;">上课认真听讲，认真做笔记，考试是否一定能上</span><span style="font-family: &quot;Times New Roman&quot;, serif;">80</span><span style="font-family: 宋体;">分？</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8221;</span></p>  <p align="left"><span style="font-family: 宋体;">这种对确定性的追求，直接导致学生有一种下意识的举动：</span></p>  <p align="left"><strong><span style="font-family: 宋体;">干什么都等准备好了再去做，但是却</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8220;</span></strong><strong><span style="font-family: 宋体;">永远在准备</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8221;</span></strong><strong><span style="font-family: 宋体;">。</span></strong></p>  <p align="left"><span style="font-family: 宋体;">因为他们害怕那种不太会还要硬上带来的各种不确定性，他们渴求一种内功的修炼，寄希望于</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8221;</span><span style="font-family: 宋体;">把基础夯实了，就能顺畅的开发，所以还是先夯实基础吧！</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8221;</span></p>  <p align="left"><span style="font-family: 宋体;">开发者选择接受这种不确定性，他们愿意</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8221;</span><span style="font-family: 宋体;">边学变做</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8220;</span><span style="font-family: 宋体;">，因为他们知道，最初学习敲键盘的时候，他们就是这么做的，边看某个按键在哪，边打字，做和学交叉进行，他们始终<strong>抱有疑问</strong>，他们又始终试图通过学习的延伸拓展去<strong>解决疑问</strong>，他们仿佛就像是拿着烛火在迷宫中行走的侠客，在游戏的一开始，对迷宫的结构一无所知，通过不断地摸索和碰壁，逐渐建立起对整个地图的认知</span><span style="font-family: &quot;Times New Roman&quot;, serif;">.</span></p>  <p align="left"><strong><span style="font-family: 宋体;">区别四</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">: </span></strong><strong><span style="font-family: 宋体;">线性学习</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;"> VS </span></strong><strong><span style="font-family: 宋体;">递归学习</span></strong><strong></strong></p>  <p align="left"><span style="font-family: 宋体;">学生喜欢<strong>线性的学习</strong>，因为线性的学习（拿本教材从头到尾慢慢看）正是符合了他们对<strong>确定性</strong>的追求，可惜这违背了学习的本来面目</span></p>  <p align="left"><span style="font-family: 宋体;">开发者知道，人脑最不擅长的就是<strong>线性枚举</strong>，即便我们认识几千个汉字，但是我们无法去<strong>线性地去将所有认识的汉字枚举出来</strong>，我们的大脑，本就不是用来进行线性思考的，而复杂度上了一定程度的知识，线性的掌握，基本不可能。</span></p>  <p align="left"><span style="font-family: 宋体;">有难度的知识，往往是这样的：为了搞懂</span><span style="font-family: &quot;Times New Roman&quot;, serif;">A</span><span style="font-family: 宋体;">，而去学</span><span style="font-family: &quot;Times New Roman&quot;, serif;">B</span><span style="font-family: 宋体;">，为了学会</span><span style="font-family: &quot;Times New Roman&quot;, serif;">B</span><span style="font-family: 宋体;">，而去学</span><span style="font-family: &quot;Times New Roman&quot;, serif;">C</span><span style="font-family: 宋体;">，这叫<strong>递归学习</strong>，递归虽深，但有回溯，它最终会回溯到我们的起点。</span></p>  <p align="left"><span style="font-family: 宋体;">所以开发者的学习更偏向于<strong>递归式的学习</strong>，而且可能会以一个知识点为起点，去完成树状知识外围的<strong>遍历。</strong>（有点像搜索引擎去爬虫）</span></p>  <p align="left"><strong><span style="font-family: 宋体;">知识是树状结构</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span></strong><strong><span style="font-family: 宋体;">或者网状结构</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">.</span></strong></p>  <p align="left"><span style="font-family: 宋体;">当我们试图遍历一个树的时候</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">最简单直接的方式就是<strong>递归</strong></span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">如果你非要去</span><span style="font-family: &quot;Times New Roman&quot;, serif;">"</span><span style="font-family: 宋体;">线性</span><span style="font-family: &quot;Times New Roman&quot;, serif;">"</span><span style="font-family: 宋体;">的学</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">那就你是把编程学习当成了链表</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">还是</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8220;</span><span style="font-family: 宋体;">单向</span><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8221;</span><span style="font-family: 宋体;">的，这种算法怎么可能用来遍历树呢？</span></p>  <p align="left"><strong><span style="font-family: 宋体;">区别五：拿会</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">XX</span></strong><strong><span style="font-family: 宋体;">定义自己</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;"> VS </span></strong><strong><span style="font-family: 宋体;">拿</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">XX</span></strong><strong><span style="font-family: 宋体;">项目作者定义自己</span></strong><strong></strong></p>  <p align="left"><span style="font-family: &quot;Times New Roman&quot;, serif;">linus </span><span style="font-family: 宋体;">从来不说自己精通</span><span style="font-family: &quot;Times New Roman&quot;, serif;"> c </span><span style="font-family: 宋体;">语言</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">与其说他不需要</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">不如说他不关心</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">因为他是</span><span style="font-family: &quot;Times New Roman&quot;, serif;"> linux </span><span style="font-family: 宋体;">和</span><span style="font-family: &quot;Times New Roman&quot;, serif;"> git </span><span style="font-family: 宋体;">的作者</span><span style="font-family: &quot;Times New Roman&quot;, serif;">.</span></p>  <p align="left"><span style="font-family: &quot;Times New Roman&quot;, serif;">linus </span><span style="font-family: 宋体;">这个程序员之神就是一个典型的<strong>开发者</strong>思维的人</span><span style="font-family: &quot;Times New Roman&quot;, serif;">.</span></p>  <p align="left"><span style="font-family: 宋体;">我希望所有计算机专业的同学们</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">等你们毕业了之后</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">你的</span><span style="font-family: &quot;Times New Roman&quot;, serif;">github</span><span style="font-family: 宋体;">应该是绿油油的</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">而不是贫瘠的一片白</span><span style="font-family: &quot;Times New Roman&quot;, serif;">.</span></p>  <p align="left"><span style="font-family: 宋体;">我希望你们用你们的简历里写的是</span><span style="font-family: &quot;Times New Roman&quot;, serif;">"</span><strong><span style="font-family: 宋体;">用</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">c</span></strong><strong><span style="font-family: 宋体;">语言实现了一个</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">XX</span></strong><strong><span style="font-family: 宋体;">引擎</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">, github</span></strong><strong><span style="font-family: 宋体;">链接</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">&#8221;</span></strong><strong><span style="font-family:&quot;Times New Roman&quot;,serif;">http://github.com/xxxxxx&#8221;</span></strong><span style="font-family: 宋体;">而不是</span><span style="font-family: &quot;Times New Roman&quot;, serif;">"</span><strong><span style="font-family: 宋体;">精通</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">c</span></strong><span style="font-family: &quot;Times New Roman&quot;, serif;">".</span></p>  <p align="left"><span style="font-family: 宋体;">我希望学生们明白</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">任何一个像样子的项目</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">制作周期至少是按月计</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">你的大学有四年时间</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">哪怕一个项目做一年</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">你也能拿出两三个好项目</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">不一定有多少</span><span style="font-family: &quot;Times New Roman&quot;, serif;">star, </span><span style="font-family: 宋体;">但是要完整</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">文档</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">测试</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">一应俱全</span><span style="font-family: &quot;Times New Roman&quot;, serif;">.</span></p>  <p align="left"><span style="font-family: 宋体;">我希望学生们知道</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">做项目和写课后习题不一样</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">课后习题一个小时</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">而项目是长期不断努力</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">不断学习突破的过程</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">需要你每天都搞</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">善始善终</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">最终拿出成果来</span><span style="font-family: &quot;Times New Roman&quot;, serif;">.</span></p>  <p align="left"><span style="font-family: 宋体;">我希望学生们明白</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">这个世界衡量一个人的成就</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">从来都是</span><span style="font-family: &quot;Times New Roman&quot;, serif;">"</span><span style="font-family: 宋体;">他做了什么</span><span style="font-family: &quot;Times New Roman&quot;, serif;">", </span><span style="font-family: 宋体;">而不是</span><span style="font-family: &quot;Times New Roman&quot;, serif;">"</span><span style="font-family: 宋体;">他学会了什么</span><span style="font-family: &quot;Times New Roman&quot;, serif;">", </span><span style="font-family: 宋体;">不要总用修炼内功去感动自己</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">必要时</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">也请你为开源世界贡献一点自己的力量</span><span style="font-family: &quot;Times New Roman&quot;, serif;">.</span></p>  <p align="left"><span style="font-family: 宋体;">我希望学生们明白</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">考上</span><span style="font-family: &quot;Times New Roman&quot;, serif;">985, </span><span style="font-family: 宋体;">拿奖学金</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">这都不叫成就</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">因为<strong>和别人没关系</strong></span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">只有真正影响到别人的东西</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">让这个世界变得更好的东西</span><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span><span style="font-family: 宋体;">才是值得去</span><span style="font-family: &quot;Times New Roman&quot;, serif;">"</span><span style="font-family: 宋体;">秀</span><span style="font-family: &quot;Times New Roman&quot;, serif;">"</span><span style="font-family: 宋体;">的</span><span style="font-family: &quot;Times New Roman&quot;, serif;">.</span></p>  <p align="left"><span style="font-family: 宋体;">最后送给学生们一句话</span><span style="font-family: &quot;Times New Roman&quot;, serif;">: </span><strong><span style="font-family: 宋体;">愿你早日忘记学生的身份</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span></strong><strong><span style="font-family: 宋体;">以开发者的姿态</span></strong><strong><span style="font-family: &quot;Times New Roman&quot;, serif;">, </span></strong><strong><span style="font-family: 宋体;">面对这个世界。</span></strong></p><img src ="http://www.cppblog.com/Chipset/aggbug/217042.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2019-12-19 17:22 <a href="http://www.cppblog.com/Chipset/archive/2019/12/19/217042.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>木卫一IO</title><link>http://www.cppblog.com/Chipset/archive/2019/10/16/216922.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Wed, 16 Oct 2019 13:40:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2019/10/16/216922.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/216922.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2019/10/16/216922.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/216922.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/216922.html</trackback:ping><description><![CDATA[<p style="margin: 0.25in 0in 6pt;" align="left"><span style="font-size: 12pt;"><span style="color:windowtext"><a href="https://solarsystem.nasa.gov/moons/jupiter-moons/io/overview/"><span style="color: #008000;">https://solarsystem.nasa.gov/moons/jupiter-moons/io/overview/</span><br /><br /><br /><img src="https://solarsystem.nasa.gov/system/feature_items/images/65_carousel_io_3.jpg" alt="" width="524" height="413" /></a></span></span></p><p style="box-sizing: border-box; margin: 1em 0px; line-height: 1.5; font-size: 16.64px; color: #3a3a3a; overflow-wrap: break-word; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><strong style="font-size: 14pt;">Introduction</strong><br style="font-size: 14pt;" /></p><p style="box-sizing: border-box; margin: 1em 0px; line-height: 1.5; font-size: 16.64px; color: #3a3a3a; overflow-wrap: break-word; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Jupiter's rocky moon Io is the most volcanically active world in the solar system, with hundreds of volcanoes, some erupting lava fountains dozens of miles (or kilometers) high. Io&#8217;s remarkable activity is the result of a tug-of-war between Jupiter's powerful gravity and smaller but precisely timed pulls from two neighboring moons that orbit farther from Jupiter &#8211; Europa and Ganymede.</p><p style="box-sizing: border-box; margin: 1em 0px; line-height: 1.5; font-size: 16.64px; color: #3a3a3a; overflow-wrap: break-word; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">In mythology, Io is a mortal woman transformed into a cow during a dispute between the Greek god Zeus &#8211; Jupiter in Roman mythology &#8211; and his wife, Hera &#8211; Juno to the Romans.</p><p style="margin: 0.25in 0in 6pt;" align="left"><strong><span style="font-size: 12pt; font-family: SimSun; letter-spacing: -0.1pt; color: #008000;"></span></strong></p><p style="margin: 0.25in 0in 6pt;" align="left"><strong><span style="font-size: 12pt; font-family: SimSun; letter-spacing: -0.1pt; color: #008000;">概要</span></strong><strong></strong></p>  <p style="margin: 12pt 0in;" align="left"><span style="font-size: 12pt; font-family: SimSun; color: #008000;">木星的卫星艾奥是太阳系里火山活动最强烈的一个世界，有几百座火山，有些火山喷发熔岩喷泉高达几打英里</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">(</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">几十千米</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">)</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">。艾奥异常的行为是木星强大的引力和两个较小卫星之间精确定时拉锯的结果，这两颗卫星轨道距离木星较远，分别是欧罗巴和伽倪墨得斯。</span></p>  <p style="margin: 12pt 0in;" align="left"><span style="font-size: 12pt; font-family: SimSun; color: #008000;">在古神话里，艾奥是个女凡人被变成了牛，原因是古希腊天神宙斯</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">--</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">罗马神话里是</span><span style="font-size:12.0pt"><a href="https://baike.baidu.com/item/%E6%9C%B1%E5%BA%87%E7%89%B9/49047" target="_blank"><span style="font-family: SimSun; color: #008000; text-decoration-line: none;">朱庇特</span></a></span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">(</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">译注</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">:</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">木星的音译</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">)--</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">和他的妻子赫拉之间产生了矛盾</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">--</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">罗马人称朱诺。</span></p>  <h3 style="box-sizing: border-box; font-size: 1.4em; margin: 1.5em 0px 0.5em; line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; color: #3a3a3a; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><strong style="box-sizing: border-box; font-weight: bold;">Size and Distance</strong></h3><p style="box-sizing: border-box; margin: 1em 0px; line-height: 1.5; font-size: 16.64px; color: #3a3a3a; overflow-wrap: break-word; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">A bit larger than Earth's Moon, Io is the third largest of Jupiter's moons, and the fifth one in distance from the planet.</p><p style="margin: 0.25in 0in 6pt;" align="left"><strong><span style="font-size: 12pt; font-family: SimSun; letter-spacing: -0.1pt; color: #008000;"></span></strong></p><p style="margin: 0.25in 0in 6pt;" align="left"><strong><span style="font-size: 12pt; font-family: SimSun; letter-spacing: -0.1pt; color: #008000;">大小和远近</span></strong><strong></strong></p>  <p style="margin: 12pt 0in;" align="left"><span style="font-size: 12pt; font-family: SimSun; color: #008000;">比地球的卫星月亮稍大，是木星的第三大卫星，距地球远近上位列第五。</span></p>  <p style="margin: 0.25in 0in 6pt;" align="left"><strong style="box-sizing: border-box; font-weight: bold; font-size: 14pt;">Orbit and Rotation</strong></p><p style="box-sizing: border-box; margin: 1em 0px; line-height: 1.5; font-size: 16.64px; color: #3a3a3a; overflow-wrap: break-word; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Although Io always points the same side toward Jupiter in its orbit around the giant planet, the large moons Europa and Ganymede perturb Io's orbit into an irregularly elliptical one. Thus, in its widely varying distances from Jupiter, Io is subjected to tremendous tidal forces.</p><p style="box-sizing: border-box; margin: 1em 0px; line-height: 1.5; font-size: 16.64px; color: #3a3a3a; overflow-wrap: break-word; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">These forces cause Io's surface to bulge up and down (or in and out) by as much as 330 feet (100 meters). Compare these tides on Io's solid surface to the tides on Earth's oceans. On Earth, in the place where tides are highest, the difference between low and high tides is only 60 feet (18 meters), and this is for water, not solid ground.</p><p style="box-sizing: border-box; margin: 1em 0px; line-height: 1.5; font-size: 16.64px; color: #3a3a3a; overflow-wrap: break-word; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Io's orbit, keeping it at more or less a cozy 262,000 miles (422,000 kilometers) from Jupiter, cuts across the planet's powerful magnetic lines of force, thus turning Io into a electric generator. Io can develop 400,000 volts across itself and create an electric current of 3 million amperes. This current takes the path of least resistance along Jupiter's magnetic field lines to the planet's surface, creating lightning in Jupiter's upper atmosphere.</p><p style="margin: 0.25in 0in 6pt;" align="left"><strong><span style="font-size: 12pt; font-family: SimSun; letter-spacing: -0.1pt; color: #008000;"></span></strong></p><p style="margin: 0.25in 0in 6pt;" align="left"><strong><span style="font-size: 12pt; font-family: SimSun; letter-spacing: -0.1pt; color: #008000;">轨道和旋转</span></strong><strong></strong></p>  <p style="margin: 12pt 0in;" align="left"><span style="font-size: 12pt; font-family: SimSun; color: #008000;">尽管艾奥始终一面对着木星围绕这个巨大的行星旋转，但是较大的卫星欧罗巴和伽倪墨得斯干扰了艾奥的轨道导致形成了不规则的椭圆形。这样以来，在和木星广远的间距变换中，艾奥受到巨大的潮汐力。</span></p>  <p style="margin: 12pt 0in;" align="left"><span style="font-size: 12pt; font-family: SimSun; color: #008000;">这些力导致艾奥表面忽起忽落</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">(</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">或者进和出</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">)</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">高达</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">330</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">英尺</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">(100</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">米</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">)</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">。对比一下艾奥固态表面的潮汐和地球上海洋的潮汐。在地球上，最高潮汐的地方，高低潮落差不过</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">60</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">英尺</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">(18</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">米</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">)</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">，而且还是水，不是固态的陆地。</span></p>  <p style="margin: 12pt 0in;" align="left"><span style="font-size: 12pt; font-family: SimSun; color: #008000;">艾奥的轨道，使之处于或多或少距离木星</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">262000</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">英里</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">(422000</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">千米</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">) </span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">一个温馨距离，切割这个行星强大的磁力线</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">[</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">译注：木星的磁场是太阳系里最强的，比地球磁场强几十倍，形成原因目前不特别清楚</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">]</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">，致使艾奥成了一个发电机。艾奥自身能产生</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">40</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">万伏的电压，产生</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">3</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">百万安的电流。这些电流沿着木星磁力线流经木星低阻抗表面，在木星高层大气产生闪电。</span></p>  <h3 style="box-sizing: border-box; font-size: 1.4em; margin: 1.5em 0px 0.5em; line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; color: #3a3a3a; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><strong style="box-sizing: border-box; font-weight: bold;">Surface</strong></h3><p style="box-sizing: border-box; margin: 1em 0px; line-height: 1.5; font-size: 16.64px; color: #3a3a3a; overflow-wrap: break-word; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">The tidal forces generate a tremendous amount of heat within Io, keeping much of its subsurface crust in liquid form seeking any available escape route to the surface to relieve the pressure. Thus, the surface of Io is constantly renewing itself, filling in any impact craters with molten lava lakes and spreading smooth new floodplains of liquid rock. The composition of this material is not yet entirely clear, but theories suggest that it is largely molten sulfur and its compounds (which would account for the varied coloring) or silicate rock (which would better account for the apparent temperatures, which may be too hot to be sulfur). Sulfur dioxide is the primary constituent of a thin atmosphere on Io. It has no water to speak of, unlike the other, colder Galilean moons. Data from the Galileo spacecraft indicates that an iron core may form Io's center, thus giving Io its own magnetic field.</p><p style="margin: 0.25in 0in 6pt;" align="left"><strong><span style="font-size: 12pt; font-family: SimSun; letter-spacing: -0.1pt; color: #008000;"></span></strong></p><p style="margin: 0.25in 0in 6pt;" align="left"><strong><span style="font-size: 12pt; font-family: SimSun; letter-spacing: -0.1pt; color: #008000;">表面</span></strong><strong></strong></p>  <p style="margin: 12pt 0in;" align="left"><span style="font-size: 12pt; font-family: SimSun; color: #008000;">潮汐力在艾奥内部产生巨大的热量，导致它表面下的地壳成为液态，寻找任何到达表面的逃离路径释放压力。这样以来，艾奥表面会得到持续的更新，用岩浆填充任何陨石坑而且会产生光滑的液态熔岩洪泛平原。地质具体成分不太清楚，但理论假说认为大部分是熔化的硫磺及其硫化物</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">(</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">较好的解释了表面不同的颜色构成</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">)</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">或硅酸盐石头</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">(</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">较好的解释了显而易见的表面温度，都硫磺就太热了</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">)</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">。艾奥稀薄的大气主要组分主要是二氧化硫。不得不说，艾奥表面没有水，不像其它较冷的伽利略卫星们</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">[</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">译注：最初古天文学家伽利略发现了一系列的木星卫星，所以后来就有了这种称呼</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">]</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">。伽利略太空船采集到的数据指出，艾奥中心可能存在铁核，于是就拥有了自己的磁场。</span></p><h3 style="box-sizing: border-box; font-size: 1.4em; margin: 1.5em 0px 0.5em; line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; color: #3a3a3a; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Potential for Life</h3><p style="box-sizing: border-box; margin: 1em 0px; line-height: 1.5; font-size: 16.64px; color: #3a3a3a; overflow-wrap: break-word; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Constant volcanism and intense radiation make Io an unlikely destination for life.</p><p style="margin: 0.25in 0in 6pt;" align="left"><strong><span style="font-size: 12pt; font-family: SimSun; letter-spacing: -0.1pt; color: #008000;"></span></strong></p><p style="margin: 0.25in 0in 6pt;" align="left"><strong><span style="font-size: 12pt; font-family: SimSun; letter-spacing: -0.1pt; color: #008000;">潜在生命</span></strong></p>  <p style="margin: 12pt 0in;" align="left"><span style="font-size: 12pt; font-family: SimSun; color: #008000;">持续的火山活动和强烈的辐射使得艾奥不太可能成为生命的落脚点。</span></p>  <p style="margin: 0.25in 0in 6pt;" align="left"><strong style="box-sizing: border-box; font-weight: bold; font-size: 14pt;">Magnetosphere</strong></p><p style="box-sizing: border-box; margin: 1em 0px; line-height: 1.5; font-size: 16.64px; color: #3a3a3a; overflow-wrap: break-word; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">As Jupiter rotates, it takes its magnetic field around with it, sweeping past Io and stripping off about 1 ton (1,000 kilograms) of Io's material every second. This material becomes ionized in the magnetic field and forms a doughnut-shaped cloud of intense radiation referred to as a plasma torus. Some of the ions are pulled into Jupiter's atmosphere along the magnetic lines of force and create auroras in the planet's upper atmosphere. It is the ions escaping from this torus that inflate Jupiter's magnetosphere to over twice the size we would expect.</p><p style="margin: 0.25in 0in 6pt;" align="left"><strong><span style="font-size: 12pt; font-family: SimSun; letter-spacing: -0.1pt; color: #008000;"></span></strong></p><p style="margin: 0.25in 0in 6pt;" align="left"><strong><span style="font-size: 12pt; font-family: SimSun; letter-spacing: -0.1pt; color: #008000;">磁圈</span></strong><strong></strong></p>  <p style="margin: 12pt 0in;" align="left"><span style="font-size: 12pt; font-family: SimSun; color: #008000;">伴随着木星自转，木星的磁场包围了艾奥，清扫艾奥，平均每秒从艾奥掠走大约</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">1</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">吨</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">(1</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">千千克</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">)</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">物质。这些物质在磁场里电离，形成面包圈状的离子云，具有强烈的辐射，称之为等离子圆环。一些离子沿着磁力线被拉入木星大气，在木星上空产生极光。这些逃离圆环的离子导致木星磁圈膨胀，比我们预期大小大了一倍不止。</span></p>  <p style="margin: 0.25in 0in 6pt;" align="left"><br /></p><h3 style="box-sizing: border-box; font-size: 1.4em; margin: 1.5em 0px 0.5em; line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; color: #3a3a3a; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><strong style="box-sizing: border-box; font-weight: bold; font-size: 14pt;">Discovery</strong></h3><p style="box-sizing: border-box; margin: 1em 0px; line-height: 1.5; font-size: 16.64px; color: #3a3a3a; overflow-wrap: break-word; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Io was discovered on Jan. 8, 1610 by Galileo Galilei. The discovery, along with three other Jovian moons, was the first time a moon was discovered orbiting a planet other than Earth. The discovery of the four Galilean satellites eventually led to the understanding that planets in our solar system orbit the Sun, instead of our solar system revolving around Earth. Galileo apparently had observed Io on Jan. 7, 1610, but had been unable to differentiate between Io and Europa until the next night.</p><h3 style="box-sizing: border-box; font-size: 1.4em; margin: 1.5em 0px 0.5em; line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; color: #3a3a3a; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><span class="mb_anchor_title" style="box-sizing: border-box; display: block; position: absolute; height: 0px; left: -99999px; visibility: hidden; margin-top: -1em;"><a class="mb_anchor" name="otp_how_io_got_its_name" style="box-sizing: border-box; text-decoration: none; color: #43aaed; text-rendering: optimizelegibility; position: absolute; display: block; visibility: hidden; margin: 0px; padding: 0px; top: -76px; overflow-wrap: break-word; width: 20px; height: 20px; text-indent: 20px; background-repeat: no-repeat; background-image: url(&quot;/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif&quot;);"></a></span></h3><p style="box-sizing: border-box; margin: 1em 0px; line-height: 1.5; font-size: 16.64px; color: #3a3a3a; overflow-wrap: break-word; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Galileo originally called Jupiter's moons the Medicean planets, after the powerful Italian Medici family and referred to the individual moons numerically as I, II, III, and IV. Galileo's naming system would be used for a couple of centuries.</p><p style="box-sizing: border-box; margin: 1em 0px; line-height: 1.5; font-size: 16.64px; color: #3a3a3a; overflow-wrap: break-word; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">It wouldn't be until the mid-1800s that the names of the Galilean moons, Io, Europa, Ganymede, and Callisto, would be officially adopted, and only after it became apparent that naming moons by number would be very confusing as new additional moons were being discovered.</p><p style="box-sizing: border-box; margin: 1em 0px; line-height: 1.5; font-size: 16.64px; color: #3a3a3a; overflow-wrap: break-word; font-family: Metropolis, Helvetica, Arial, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">In mythology, Io is a mortal woman transformed into a cow during a marital dispute between the Greek god Zeus&#8212;Jupiter in Roman mythology&#8212;and his wife, Juno. NASA&#8217;s Juno mission is named in honor of Juno who could peer through the clouds and expose her husband&#8217;s wrongdoings. The spacecraft also peers through clouds to reveal Jupiter&#8217;s secrets.</p><p style="margin: 0.25in 0in 6pt;" align="left"><strong><span style="font-size: 12pt; font-family: SimSun; letter-spacing: -0.1pt; color: #008000;"></span></strong></p><p style="margin: 0.25in 0in 6pt;" align="left"><strong><span style="font-size: 12pt; font-family: SimSun; letter-spacing: -0.1pt; color: #008000;">发现史</span></strong><strong></strong></p>  <p style="margin: 12pt 0in;" align="left"><span style="font-size: 12pt; font-family: SimSun; color: #008000;">艾奥在</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">1610</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">年元月</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">8</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">日被伽利略伽利雷发现。和其它三个木星的卫星一起被发现的，这是首次发现地球之外的行星拥有自己环绕的卫星。伽利略四卫星的发现最终导致人类认识到太阳系里的行星们围着太阳转，而不是太阳系围着地球转。伽利略显然于</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">1610</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">年元月</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">7</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">日就发现了艾奥，但是直到第二天晚上才能把它和欧罗巴区分开。<br /><br /><br /><img src="https://solarsystem.nasa.gov/system/internal_resources/details/original/390_galileo_manuscript1.png" alt="" /></span></p>  <p style="margin: 12pt 0in;" align="left"><span style="font-size: 12pt; font-family: SimSun; color: #008000;">伽利略最初称木星的卫星为美第奇家族行星，意大利美第奇家族之后，这些独立的卫星才被命名为</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">I, II, III</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">和</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">IV</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">。伽利略命名的体系会被沿用几个世纪。</span></p>  <p style="margin: 12pt 0in;" align="left"><span style="font-size: 12pt; font-family: SimSun; color: #008000;">直到</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">18</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">世纪中期伽利略卫星的艾奥，卡利斯托，欧罗巴和伽倪墨得斯几个名字才被官方采纳，因为随着更多卫星被发现，原来以数字命名卫星的做法非常令人费解。</span></p>  <p style="margin: 12pt 0in;" align="left"><span style="font-size: 12pt; font-family: SimSun; color: #008000;">在古神话里，古希腊天神宙斯</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">--</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">罗马神话里称</span><span style="font-size:12.0pt"><a href="https://baike.baidu.com/item/%E6%9C%B1%E5%BA%87%E7%89%B9/49047" target="_blank"><span style="font-family: SimSun; color: #008000; text-decoration-line: none;">朱庇特</span></a></span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">--</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">和他的妻子朱诺之间的一次婚姻矛盾导致凡人艾奥</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">[</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">译注：以汉语文化的视角来看，神仙宙斯有婚外情凡</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">人艾奥</span><span style="font-size: 12pt; font-family: Helvetica, sans-serif; color: #008000;">]</span><span style="font-size: 12pt; font-family: SimSun; color: #008000;">变成了牛。美国航空航天局的朱诺之旅为了向朱诺女神表达敬意特此命名，寓意是朱诺能看透云层揭露其丈夫的错误行为。该太空船也能透过云层去揭示木星的秘密。</span></p><img src ="http://www.cppblog.com/Chipset/aggbug/216922.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2019-10-16 21:40 <a href="http://www.cppblog.com/Chipset/archive/2019/10/16/216922.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>How Far I'll Go</title><link>http://www.cppblog.com/Chipset/archive/2018/08/27/215882.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Mon, 27 Aug 2018 13:14:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2018/08/27/215882.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/215882.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2018/08/27/215882.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/215882.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/215882.html</trackback:ping><description><![CDATA[<div><strong><span style="font-size: 12pt;">How far I'll go --</span><font face="Arial"><span style="background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: #f5f5f5; font-size: 12pt;">&nbsp;Alessia Cara</span></font></strong><span style="color: #333333; font-family: arial; font-size: 12px; background-color: #f5f5f5;">&nbsp;<br /><br /></span></div><div></div><div><span style="font-size: 12pt;">I've been standing at the edge of the water</span><br /><span style="font-size: 12pt;">Long as I can remember, never really knowing why</span><br /><span style="font-size: 12pt;">I wish I could be the perfect daughter</span><br /><span style="font-size: 12pt;">But I come back to the water, no matter how hard I try</span><br /><br /><span style="font-size: 12pt;">Every turn I take, every trail I track, every path I make, every road leads back</span><br /><span style="font-size: 12pt;">To the place I know, where I cannot go</span><br /><span style="font-size: 12pt;">Though I long to be</span><br /><br /><span style="font-size: 12pt;">See the line where the sky meets the sea? It calls me</span><br /><span style="font-size: 12pt;">And no one knows, how far it goes</span><br /><span style="font-size: 12pt;">If the wind in my sail on the sea stays behind me</span><br /><span style="font-size: 12pt;">One day I'll know, if I go there's just no telling how far I'll go</span><br /><br /><span style="font-size: 12pt;">Go-oh-oh-oh-oh-oh-oh-oh-oh-oh</span><br /><span style="font-size: 12pt;">Go-oh-oh-oh-oh-oh-oh-oh-oh-oh</span><br /><span style="font-size: 12pt;">Go-oh-oh-oh-oh-oh-oh-oh-oh-oh</span><br /><span style="font-size: 12pt;">Go-oh-oh-oh-oh-oh-oh-oh-oh-oh</span><br /><br /><span style="font-size: 12pt;">I know everybody on this island seems so happy on this island</span><br /><span style="font-size: 12pt;">Everything is by design</span><br /><span style="font-size: 12pt;">I know everybody on this island has a role on this island</span><br /><span style="font-size: 12pt;">So maybe I can roll with mine</span><br /><br /><span style="font-size: 12pt;">I can lead with pride, I can make us strong</span><br /><span style="font-size: 12pt;">I'll be satisfied if I play along</span><br /><span style="font-size: 12pt;">But the voice inside sings a different song</span><br /><span style="font-size: 12pt;">What is wrong with me?</span><br /><br /><span style="font-size: 12pt;">See the light as it shines on the sea? It's blinding</span><br /><span style="font-size: 12pt;">But no one knows, how deep it goes</span><br /><span style="font-size: 12pt;">And it seems like it's calling out to me, so come find me</span><br /><span style="font-size: 12pt;">And let me know, what's beyond that line, will I cross that line?</span><br /><br /><span style="font-size: 12pt;">See the line where the sky meets the sea? It calls me</span><br /><span style="font-size: 12pt;">And no one knows, how far it goes</span><br /><span style="font-size: 12pt;">If the wind in my sail on the sea stays behind me</span><br /><span style="font-size: 12pt;">One day I'll know, how far I'll go<br /><br /></span><div><strong><span style="font-size: 12pt;">How far I'll go --</span><font face="Arial"><span style="background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: #f5f5f5; font-size: 12pt; color: red;">&nbsp;</span></font><span>Auli'i Cravalho</span></strong><font face="Arial"><span style="background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: #f5f5f5; font-size: 12pt; color: red;"><br /></span></font><span style="color: #333333; font-family: arial; font-size: 12px; background-color: #f5f5f5;"><br /></span></div><div></div><div><span style="font-size: 12pt;">I've been staring at the edge of the water</span><br /><span style="font-size: 12pt;">Long as I can remember, never really knowing why</span><br /><span style="font-size: 12pt;">I wish I could be the perfect daughter</span><br /><span style="font-size: 12pt;">But I come back to the water, no matter how hard I try</span><br /><br /><span style="font-size: 12pt;">Every turn I take, every trail I track, every path I make, every road leads back</span><br /><span style="font-size: 12pt;">To the place I know, where I cannot go</span><br /><span style="font-size: 12pt;">Where I long to be</span><br /><br /><span style="font-size: 12pt;">See the line where the sky meets the sea? It calls me</span><br /><span style="font-size: 12pt;">And no one knows, how far it goes</span><br /><span style="font-size: 12pt;">If the wind in my sail on the sea stays behind me</span><br /><span style="font-size: 12pt;">One day I'll know, if I go there's just no telling how far I'll go</span><br /><br /><span style="font-size: 12pt;">I know everybody on this island seems so happy on this island</span><br /><span style="font-size: 12pt;">Everything is by design</span><br /><span style="font-size: 12pt;">I know everybody on this island has a role on this island</span><br /><span style="font-size: 12pt;">So maybe I can roll with mine</span><br /><br /><span style="font-size: 12pt;">I can lead with pride, I can make us strong</span><br /><span style="font-size: 12pt;">I'll be satisfied if I play along</span><br /><span style="font-size: 12pt;">But the voice inside sings a different song</span><br /><span style="font-size: 12pt;">What is wrong with me?</span><br /><br /><span style="font-size: 12pt;">See the light as it shines on the sea? It's blinding</span><br /><span style="font-size: 12pt;">But no one knows, how deep it goes</span><br /><span style="font-size: 12pt;">And it seems like it's calling out to me, so come find me</span><br /><span style="font-size: 12pt;">And let me know, what's beyond that line, will I cross that line?</span><br /><br /><span style="font-size: 12pt;">See the line where the sky meets the sea? It calls me</span><br /><span style="font-size: 12pt;">And no one knows, how far it goes</span><br /><span style="font-size: 12pt;">If the wind in my sail on the sea stays behind me</span><br /><span style="font-size: 12pt;">One day I'll know, how far I'll go</span></div></div><img src ="http://www.cppblog.com/Chipset/aggbug/215882.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2018-08-27 21:14 <a href="http://www.cppblog.com/Chipset/archive/2018/08/27/215882.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>生化危机：最后一部</title><link>http://www.cppblog.com/Chipset/archive/2017/03/22/214770.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Wed, 22 Mar 2017 09:31:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2017/03/22/214770.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/214770.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2017/03/22/214770.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/214770.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/214770.html</trackback:ping><description><![CDATA[<p style="margin-top:6.0pt;margin-right:0in;margin-bottom:6.0pt;margin-left:
0in;background:white"><span style="font-size: 12pt; font-family: Calibri, sans-serif; color: #202122;">Dr. James Marcus, the founder of the Umbrella
Corporation, had a daughter, Alicia, who was dying of&nbsp;progeria. Desperate
to save her, Marcus uses the&nbsp;T-virus&nbsp;on her and others with the
disease. After another child treated with the virus died and then reanimated as
a rabid zombie, Marcus tried to have the program shut down. His partner,&nbsp;Dr.
Alexander Isaacs, had Marcus killed by Albert Wesker, then adopted Alicia and
took over the Corporation.</span></p><p style="margin: 6pt 0in; background: white;"><span style="font-size: 12pt; font-family: SimSun; color: #202122;">安布雷拉公司</span><span style="font-size: 12pt; font-family: Calibri, sans-serif; color: #202122;">[</span><span style="font-size: 12pt; font-family: SimSun; color: #202122;">伞公司</span><span style="font-size: 12pt; font-family: Calibri, sans-serif; color: #202122;">]</span><span style="font-size: 12pt; font-family: SimSun; color: #202122;">的创始人，詹姆斯</span><span style="font-size: 12pt; font-family: Calibri, sans-serif; color: #202122;">&#183;</span><span style="font-size: 12pt; font-family: SimSun; color: #202122;">马库斯博士有个女儿艾莉西亚正在早衰死亡。马库斯几乎绝望，把</span><span style="font-size: 12pt; font-family: Calibri, sans-serif; color: #202122;">T</span><span style="font-size: 12pt; font-family: SimSun; color: #202122;">病毒用于给女儿和患有该病的别人治疗。在对另一个孩子施用该病毒治疗后，患者死掉又活过来立即成了僵尸，马库斯为此企图关闭该流程。他的商业伙伴亚历山大</span><span style="font-size: 12pt; font-family: Calibri, sans-serif; color: #202122;">&#183;</span><span style="font-size: 12pt; font-family: SimSun; color: #202122;">艾萨克斯命令阿尔伯特</span><span style="font-size: 12pt; font-family: Calibri, sans-serif; color: #202122;">&#183;</span><span style="font-size: 12pt; font-family: SimSun; color: #202122;">威斯克处死了马斯克，自己收养了艾莉西亚并接管了该公司。</span></p>  <p style="margin: 6pt 0in; background: white;"><span style="font-size: 12pt; font-family: Calibri, sans-serif; color: #202122;">After the events&nbsp;in Washington D.C., Alice awakens after being betrayed by Wesker. The Red Queen appears and tells Alice she has 48 hours to infiltrate the Hive, over 400 miles west on&nbsp;I-64&nbsp;in Raccoon City. The Umbrella Corporation has developed an airborne anti-virus, which can kill every organism infected by the T-virus, but is waiting for the last few remaining humans to be wiped out.</span></p>  <p style="margin: 3.75pt 0in;"><span style="font-size: 12pt; font-family: SimSun;">哥伦比亚特区华盛顿事件后，爱丽丝经历威斯克的背叛后苏醒过来。红后出现并告知爱丽丝，她必须在</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">48</span><span style="font-size: 12pt; font-family: SimSun;">小时内潜入浣熊市蜂巢，蜂巢位于向西</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">400</span><span style="font-size: 12pt; font-family: SimSun;">英里之外的浣熊市</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">I-64</span><span style="font-size: 12pt; font-family: SimSun;">区。安布雷拉公司已经开发出了能空气传播的抗病毒，会杀死所有感染了</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">T</span><span style="font-size: 12pt; font-family: SimSun;">病毒的生物，目前正等着最后遗留的少数人类被消灭。</span></p>  <p style="margin-top:3.75pt;margin-right:0in;margin-bottom:3.75pt;margin-left: 0in"><span style="font-size: 12pt; font-family: Calibri, sans-serif; color: #202122;">Enroute to Raccoon City, Alice is captured by Isaacs, learning the "Isaacs" she&nbsp;previously killed&nbsp;was a clone. She escapes his convoy and reaches Raccoon City, where she is ambushed by a group of survivors: Doc, Abigail, Christian, Cobalt, Razor, and&nbsp;Claire Redfield, who survived the&nbsp;attack on Arcadia. Isaacs' convoy approaches, trailed by a horde of zombies. Alice and the group defeat the convoy, retrieve Isaacs' few human captives and burn the horde, though Cobalt is killed. Alice and crew enter the Hive entrance, at the bottom of the crater from the&nbsp;nuclear bomb previously dropped&nbsp;on the city. Wesker, in control of the Hive, releases mutated guard dogs, killing Christian and a freed captive.</span></p>  <p style="margin-top:3.75pt;margin-right:0in;margin-bottom:3.75pt;margin-left: 0in"><span style="font-size: 12pt; font-family: SimSun;">在去往浣熊市的路上，爱丽丝被艾萨克斯俘虏，认识到她原来杀死的那个艾萨克斯其实是个克隆人。爱丽丝逃脱他的护卫队到达浣熊市后被一群幸存者伏击，这些幸存者有道克、艾比盖尔、克里斯托、克波特、瑞泽、克莱尔</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">&#183;</span><span style="font-size: 12pt; font-family: SimSun;">雷德菲尔德，他们是阿卡迪亚遭到攻击后的幸存者。艾萨克斯护卫队赶往这里，尾随了一大群僵尸。爱丽丝队伍击败了护卫队，收容了艾萨克斯的几个人类俘虏，焚毁了僵尸群，但克波特在战斗中丧生。爱丽丝队伍进入蜂巢入口，入口在之前浣熊市丢核弹炸的大坑底部。威斯克控制着蜂巢，释放了变异的警卫狗，杀死了克里斯托和一个自由了的俘虏。</span></p>  <p style="margin: 3.75pt 0in;"><span style="font-size: 12pt; font-family: Calibri, sans-serif; color: #202122; background: white;">The Red Queen appears to Alice and explains that her program is in conflict, as she can never hurt an Umbrella employee but also must value human life. She plays a video of Isaacs explaining to Umbrella's executives a plan to release the T-virus, cleansing the world of humanity; many of the rich and powerful, including the company executives, are stored in cryogenic capsules in the Hive, with the intention of rebuilding the world following the resulting apocalypse. The Red Queen warns Alice that someone in her group is helping Umbrella.</span></p>  <p style="margin: 3.75pt 0in;"><span style="font-size: 12pt; font-family: SimSun; color: #202122;">红后出现在爱丽丝面前，解释她的程序有冲突，因为她不能伤害安布雷拉雇员而且还要衡量人类生命。红后播放了一个影碟，艾萨克斯正给安布雷拉公司管理层解释他的计划，释放</span><span style="font-size: 12pt; font-family: Calibri, sans-serif; color: #202122;">T</span><span style="font-size: 12pt; font-family: SimSun; color: #202122;">病毒清理人类世界，很多富人和当权者包括公司管理者，用低温荚膜封藏在蜂巢里，毁灭世界后再重建。红后警告爱丽丝，她的队伍里有人正在帮助爱布雷拉公司。</span></p>  <p style="margin: 6pt 0in; background: white;"><span style="font-size: 12pt; font-family: Calibri, sans-serif; color: #202122;">The group encounters several traps, killing Abigail and Razor. Alice and Doc plant bombs throughout the Hive, from the leftover equipment&nbsp;of the original team to investigate the Hive. Alice confronts the real, tech-upgraded, Isaacs. Doc is revealed to be Umbrella's spy, and Claire is captured by Wesker. A cryogenic capsule opens, releasing Alicia Marcus, Umbrella's co-owner, and Marcus' daughter. Isaacs reveals to Alice that she is actually a clone of Alicia, before going on to explain his plan to eliminate the pair and assume control of Umbrella. Alicia fires Wesker, allowing the Red Queen to crush his legs with a security door. Doc tries to shoot Alice, but his gun is empty &#8212; as Alice had earlier deduced his treachery &#8212; and Claire executes him. After giving Wesker a&nbsp;deadman's switch&nbsp;to the primed bombs, Alice and Claire pursue Isaacs while Alicia uploads a copy of her childhood memories.<br /> </span><span style="font-size: 12pt; font-family: SimSun;">这群人遭遇了几个陷阱，艾比盖尔和瑞泽丧生。爱丽丝和道克在整个蜂巢部署了炸弹，从原队伍的遗留设备处一直到勘察蜂巢沿路</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">[</span><span style="font-size: 12pt; font-family: SimSun;">译注：原文有错误</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">]</span><span style="font-size: 12pt; font-family: SimSun;">。爱丽丝面对真实有技术装备的艾萨克斯。道克被暴出是安布雷拉安插</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">[</span><span style="font-size: 12pt; font-family: SimSun;">在幸存者中</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">]</span><span style="font-size: 12pt; font-family: SimSun;">的间谍，克莱尔也被威斯克抓住。一个低温荚膜打开，艾丽西亚</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">&#183;</span><span style="font-size: 12pt; font-family: SimSun;">马库斯</span>&nbsp;<span style="font-size: 12pt; font-family: SimSun;">出现，她是公司的合伙持有人，詹姆斯</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">&#183;</span><span style="font-size: 12pt; font-family: SimSun;">马库斯的女儿。艾萨克斯首先揭示爱丽丝是艾莉西亚的克隆人，然后解释他计划除掉合伙人艾莉西亚完全掌控爱布雷拉。艾莉西亚煽动威斯克，让红后关闭安全门夹断他的腿。道克向爱丽丝开枪，但没有子弹</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">--</span><span style="font-size: 12pt; font-family: SimSun;">爱丽丝之前推断出他是叛徒</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">--</span><span style="font-size: 12pt; font-family: SimSun;">克莱尔击毙了道克。塞给威斯克一个死人开关</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">[</span><span style="font-size: 12pt; font-family: SimSun;">译注：不按着蜂巢就炸</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">]</span><span style="font-size: 12pt; font-family: SimSun;">后，爱丽丝和克莱尔追杀艾萨克斯，此刻艾莉西亚上传她童年记忆的拷贝。</span></p>  <p style="margin: 6pt 0in 12pt; background: white;"><span style="font-size: 12pt; font-family: Calibri, sans-serif; color: #202122;">Isaacs, Alice and Claire fight; Isaacs overpowers Claire and attacks Alice in the Laser Corridor, eventually defeating her, but she uses that moment to activate a grenade in his pocket. She escapes to the surface with the anti-virus, but Isaacs reboots and catches her before she can release it. Before he can kill her, the Isaacs clone (from the convoy) arrives and kills him, believing itself to be the original Isaacs, but the clone is then devoured by the undead. Alice releases the anti-virus, killing all of the undead around her before she passes out. Wesker simultaneously drops the deadman's switch, destroying himself, Alicia, the Hive, and the hibernating Umbrella elite.</span></p>  <p style="margin-top:6.0pt;margin-right:0in;margin-bottom:12.0pt;margin-left: 0in;background:white"><span style="font-size: 12pt; font-family: DengXian; color: #202122;">艾萨克斯对抗爱丽丝和克莱尔，艾萨克斯战胜克莱尔，并在激光走廊里攻击爱丽丝最终获胜，但爱丽丝利用该时机触发了他口袋里的手雷。爱丽丝带着抗病毒逃到地面，但艾萨克斯复活并在爱丽丝投放抗病毒前抓住了她。在艾萨克斯杀死爱丽丝前，艾萨克斯的克隆人</span><span style="font-size: 12pt; font-family: Calibri, sans-serif; color: #202122;">(</span><span style="font-size: 12pt; font-family: DengXian; color: #202122;">来自护卫队</span><span style="font-size: 12pt; font-family: Calibri, sans-serif; color: #202122;">)</span><span style="font-size: 12pt; font-family: DengXian; color: #202122;">赶到，杀死了艾莎克斯，觉得自己才是真正的艾萨克斯，但克隆人又被僵尸吞没。爱丽丝释放了抗病毒，她倒下前杀死了她周围所有的僵尸。此刻，威斯克丢下了死人开关，毁掉了自己，艾莉西亚，蜂巢，休眠中的安布雷拉精英们。</span></p>  <p style="margin: 6pt 0in; background: white;"><span style="font-size: 12pt; font-family: Calibri, sans-serif; color: #202122;">Claire wakes Alice, who survived because the anti-virus killed only the T-virus within her body, not the healthy cells. The Red Queen uploads Alicia's childhood memories into Alice, granting her a childhood. Alice travels into&nbsp;Manhattan, saying that the anti-virus, carried only by the winds, will take years to reach all corners of the globe, and until it does, her mission is not finished.</span></p>  <p style="margin: 3.75pt 0in;"><span style="font-size: 12pt; font-family: SimSun;">克莱尔唤醒了爱丽丝，爱丽丝活了下来，因为抗病毒只杀死她体内的</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">T</span><span style="font-size: 12pt; font-family: SimSun;">病毒，而非健康细胞。红后给爱丽丝加载了艾莉西亚所有的童年记忆，给她赋予了童年。爱丽丝去曼哈顿旅行，</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">[</span><span style="font-size: 12pt; font-family: SimSun;">故事</span><span style="font-size: 12pt; font-family: Calibri, sans-serif;">]</span><span style="font-size: 12pt; font-family: SimSun;">声称抗病毒被风吹到世界各角落需要多年，在此结果前，爱丽丝的任务还没结束。</span></p>  <p>&nbsp;</p><p><span style="font-size: 14pt;"><span></span></span></p><img src ="http://www.cppblog.com/Chipset/aggbug/214770.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2017-03-22 17:31 <a href="http://www.cppblog.com/Chipset/archive/2017/03/22/214770.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>编译器预定义的宏</title><link>http://www.cppblog.com/Chipset/archive/2016/10/26/214357.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Wed, 26 Oct 2016 01:01:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2016/10/26/214357.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/214357.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2016/10/26/214357.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/214357.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/214357.html</trackback:ping><description><![CDATA[<h2><div><span style="font-size: 10pt;">源自：https://sourceforge.net/p/predef/wiki/Architectures/</span></div><br /></h2><h2>Architectures                                          <small>                                                                          </small>                                      </h2>                                                                                    <p>Please send updates/corrections to <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#112;&#114;&#101;&#100;&#101;&#102;&#45;&#99;&#111;&#110;&#116;&#114;&#105;&#98;&#117;&#116;&#101;&#64;&#108;&#105;&#115;&#116;&#115;&#46;&#115;&#111;&#117;&#114;&#99;&#101;&#102;&#111;&#114;&#103;&#101;&#46;&#110;&#101;&#116;">predef-contribute</a>.</p> <h2><a href="http://en.wikipedia.org/wiki/DEC_Alpha" rel="nofollow">Alpha</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__alpha__</code></td> <td>Defined by GNU C</td> </tr> <tr> <td>Version</td> <td><code>__alpha_ev'V'__</code></td> <td>V = Version</td> </tr> <tr> <td>Identification</td> <td><code>__alpha</code></td> <td>Defined by DEC C</td> </tr> <tr> <td>Identification</td> <td><code>_M_ALPHA</code></td> <td>Defined by Visual Studio</td> </tr> </tbody> </table> <h5>Example</h5> <table> <thead> <tr> <th>CPU</th> <th>Macro</th> </tr> </thead> <tbody> <tr> <td>Alpha EV4</td> <td><code>__alpha_ev4__</code></td> </tr> <tr> <td>Alpha EV5</td> <td><code>__alpha_ev5__</code></td> </tr> <tr> <td>Alpha EV6</td> <td><code>__alpha_ev6__</code></td> </tr> </tbody> </table> <h2><a href="http://en.wikipedia.org/wiki/Amd64" rel="nofollow">AMD64</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__amd64__</code><br /><code>__amd64</code><br /><code>__x86_64__</code><br /><code>__x86_64</code><br /></td> <td>Defined by GNU C and Sun Studio</td> </tr> <tr> <td>Identification</td> <td>_M_X64<br /><code>_M_AMD64</code></td> <td>Defined by Visual Studio</td> </tr> </tbody> </table> <p>Notice that <a href="http://en.wikipedia.org/wiki/X32_ABI" rel="nofollow">x32</a> can be detected by checking if the CPU uses the <a href="https://sourceforge.net/p/predef/wiki/DataModels/">ILP32 data model</a>.</p> <h2><a href="http://en.wikipedia.org/wiki/ARM_architecture" rel="nofollow">ARM</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__arm__</code></td> <td>Defined by GNU C and RealView</td> </tr> <tr> <td>Identification</td> <td><code>__thumb__</code></td> <td>Defined by GNU C and RealView in Thumb mode</td> </tr> <tr> <td>Version</td> <td><code>__ARM_ARCH_'V'__</code></td> <td>V = Version<br /><br />Defined by GNU C <a href="http://wiki.ubuntu.com/ARM/Thumb2PortingHowto" rel="nofollow">1</a></td> </tr> <tr> <td>Identification</td> <td><code>__TARGET_ARCH_ARM</code><br /><code>__TARGET_ARCH_THUMB</code></td> <td>Defined by RealView</td> </tr> <tr> <td>Version</td> <td><code>__TARGET_ARCH_ARM</code> = V<br /><code>__TARGET_ARCH_THUMB</code> = V</td> <td>V = Version</td> </tr> <tr> <td>Version</td> <td><code>__TARGET_ARCH_'VR'</code></td> <td>VR = Version and Revision</td> </tr> <tr> <td>Identification</td> <td><code>_ARM</code></td> <td>Defined by ImageCraft C</td> </tr> <tr> <td>Identification</td> <td><code>_M_ARM</code></td> <td>Defined by Visual Studio</td> </tr> <tr> <td>Identification</td> <td><code>_M_ARMT</code></td> <td>Defined by Visual Studio in Thumb mode</td> </tr> <tr> <td>Version</td> <td><code>_M_ARM</code> = V</td> <td>V = Version</td> </tr> <tr> <td>Identification</td> <td><code>__arm</code></td> <td>Defined by Diab</td> </tr> </tbody> </table> <h5>Example</h5> <table> <thead> <tr> <th>CPU</th> <th>Macro</th> <th><code>_M_ARM</code></th> </tr> </thead> <tbody> <tr> <td>ARM 2</td> <td><code>__ARM_ARCH_2__</code></td> <td><br /></td> </tr> <tr> <td>ARM 3</td> <td><code>__ARM_ARCH_3__</code><br /><code>__ARM_ARCH_3M__</code></td> <td><br /></td> </tr> <tr> <td>ARM 4T</td> <td><code>__ARM_ARCH_4T__</code><br /><code>__TARGET_ARM_4T</code></td> <td><br /></td> </tr> <tr> <td>ARM 5</td> <td><code>__ARM_ARCH_5__</code><br /><code>__ARM_ARCH_5E__</code></td> <td>5</td> </tr> <tr> <td>ARM 5T</td> <td><code>__ARM_ARCH_5T__</code><br /><code>__ARM_ARCH_5TE__</code><br /><code>__ARM_ARCH_5TEJ__</code></td> <td><br /></td> </tr> <tr> <td>ARM 6</td> <td><code>__ARM_ARCH_6__</code><br /><code>__ARM_ARCH_6J__</code><br /><code>__ARM_ARCH_6K__</code><br /><code>__ARM_ARCH_6Z__</code><br /><code>__ARM_ARCH_6ZK__</code></td> <td>6</td> </tr> <tr> <td>ARM 6T2</td> <td><code>__ARM_ARCH_6T2__</code></td> <td><br /></td> </tr> <tr> <td>ARM 7</td> <td><code>__ARM_ARCH_7__</code><br /><code>__ARM_ARCH_7A__</code><br /><code>__ARM_ARCH_7R__</code><br /><code>__ARM_ARCH_7M__</code><br /><code>__ARM_ARCH_7S__</code></td> <td>7</td> </tr> </tbody> </table> <h2><a href="http://en.wikipedia.org/wiki/ARM64" rel="nofollow">ARM64</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__aarch64__</code></td> <td>Defined by GNU C <a href="http://gcc.gnu.org/viewcvs/trunk/gcc/config/aarch64/aarch64.h?view=markup" rel="nofollow">1</a></td> </tr> </tbody> </table> <h2><a href="http://en.wikipedia.org/wiki/Blackfin" rel="nofollow">Blackfin</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__bfin</code><br /><code>__BFIN__</code></td> <td>Defined by GNU C</td> </tr> </tbody> </table> <h2><a href="http://en.wikipedia.org/wiki/Convex_Computer" rel="nofollow">Convex</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__convex__</code></td> <td>Defined by GNU C</td> </tr> <tr> <td>Version</td> <td><code>__convex_'V'__</code></td> <td>V = Version</td> </tr> </tbody> </table> <h5>Example</h5> <table> <thead> <tr> <th>CPU</th> <th>Macro</th> </tr> </thead> <tbody> <tr> <td>Convex C1</td> <td><code>__convex_c1__</code></td> </tr> <tr> <td>Convex C2</td> <td><code>__convex_c2__</code></td> </tr> <tr> <td>Convex C32xx series</td> <td><code>__convex_c32__</code></td> </tr> <tr> <td>Convex C34xx series</td> <td><code>__convex_c34__</code></td> </tr> <tr> <td>Convex C38xx series</td> <td><code>__convex_c38__</code></td> </tr> </tbody> </table> <h2><a href="http://en.wikipedia.org/wiki/Adapteva" rel="nofollow">Epiphany</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th><br /></th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__epiphany__</code></td> <td><br /></td> </tr> </tbody> </table> <h2><a href="http://en.wikipedia.org/wiki/PA-RISC_family" rel="nofollow">HP/PA RISC</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__hppa__</code></td> <td>Defined by GNU C</td> </tr> <tr> <td>Identification</td> <td><code>__HPPA__</code></td> <td>Defined by Stratus VOS C</td> </tr> <tr> <td>Identification</td> <td><code>__hppa</code></td> <td><br /></td> </tr> <tr> <td>Version</td> <td><code>_PA_RISC'V'_'R'</code></td> <td>V = Version<br />R = Revision</td> </tr> </tbody> </table> <p>See also <a href="http://www.openpa.net" rel="nofollow">OpenPA.net</a>.</p> <h5>Example</h5> <table> <thead> <tr> <th>CPU</th> <th>Macro</th> </tr> </thead> <tbody> <tr> <td>PA RISC 1.0</td> <td><code>_PA_RISC1_0</code></td> </tr> <tr> <td>PA RISC 1.1</td> <td><code>_PA_RISC1_1</code><br /><code>__HPPA11__</code><br /><code>__PA7100__</code></td> </tr> <tr> <td>PA RISC 2.0</td> <td><code>_PA_RISC2_0</code><br /><code>__RISC2_0__</code><br /><code>__HPPA20__</code><br /><code>__PA8000__</code></td> </tr> </tbody> </table> <h2><a href="http://en.wikipedia.org/wiki/X86" rel="nofollow">Intel x86</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Format</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>i386</code><br /><code>__i386</code><br /><code>__i386__</code></td> <td><br /></td> <td>Defined by GNU C</td> </tr> <tr> <td>Version</td> <td><code>__i386__</code><br /><code>__i486__</code><br /><code>__i586__</code><br /><code>__i686__</code></td> <td><br /></td> <td>Defined by GNU C</td> </tr> <tr> <td>Identification</td> <td><code>__i386</code></td> <td><br /></td> <td>Defined by Sun Studio</td> </tr> <tr> <td>Identification</td> <td><code>__i386</code><br /><code>__IA32__</code></td> <td><br /></td> <td>Defined by Stratus VOS C</td> </tr> <tr> <td>Identification</td> <td><code>_M_I86</code></td> <td><br /></td> <td>Only defined for 16-bits architectures<br /><br />Defined by Visual Studio, Digital Mars, and Watcom C/C++ (see note below)</td> </tr> <tr> <td>Identification</td> <td><code>_M_IX86</code></td> <td><br /></td> <td>Only defined for 32-bits architectures<br /><br />Defined by Visual Studio, Intel C/C++, Digital Mars, and Watcom C/C++</td> </tr> <tr> <td>Version</td> <td><code>_M_IX86</code></td> <td>V00</td> <td>V = Version</td> </tr> <tr> <td>Identification</td> <td><code>__X86__</code></td> <td><br /></td> <td>Defined by Watcom C/C++</td> </tr> <tr> <td>Identification</td> <td><code>_X86_</code></td> <td><br /></td> <td>Defined by MinGW32</td> </tr> <tr> <td>Identification</td> <td><code>__THW_INTEL__</code></td> <td><br /></td> <td>Defined by XL C/C++</td> </tr> <tr> <td>Identification</td> <td><code>__I86__</code></td> <td><br /></td> <td>Defined by Digital Mars</td> </tr> <tr> <td>Version</td> <td><code>__I86__</code></td> <td>V</td> <td>V = Version</td> </tr> <tr> <td>Identification</td> <td><code>__INTEL__</code></td> <td><br /></td> <td>Defined by CodeWarrior</td> </tr> <tr> <td>Identification</td> <td><code>__386</code></td> <td><br /></td> <td>Defined by Diab</td> </tr> </tbody> </table> <p>Notice that Watcom C/C++ defines <code>_M_IX86</code> for both 16-bits and 32-bits architectures. Use <code>__386__</code> or <code>_M_I386</code> to detect 32-bits architectures in this case.</p> <p>Notice that the Stratus VOS is big-endian on IA32, so these macros cannot be used to detect endianness if <code>__VOS__</code> is set.</p> <h5>Example</h5> <table> <thead> <tr> <th>CPU</th> <th><code>_M_IX86</code></th> <th><code>__I86__</code></th> </tr> </thead> <tbody> <tr> <td>80386</td> <td>300</td> <td>3</td> </tr> <tr> <td>80486</td> <td>400</td> <td>4</td> </tr> <tr> <td>Pentium</td> <td>500</td> <td>5</td> </tr> <tr> <td>Pentium Pro/II</td> <td>600</td> <td>6</td> </tr> </tbody> </table> <h2><a href="http://en.wikipedia.org/wiki/Itanium" rel="nofollow">Intel Itanium (IA-64)</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Format</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__ia64__</code><br /><code>_IA64</code><br /><code>__IA64__</code></td> <td><br /></td> <td>Defined by GNU C</td> </tr> <tr> <td>Identification</td> <td><code>__ia64</code></td> <td><br /></td> <td>Defined by HP aCC</td> </tr> <tr> <td>Identification</td> <td><code>_M_IA64</code></td> <td><br /></td> <td>Defined by Visual Studio</td> </tr> <tr> <td>Identification</td> <td><code>_M_IA64</code></td> <td><br /></td> <td>Defined by Intel C/C++</td> </tr> <tr> <td>Version</td> <td><code>_M_IA64</code></td> <td>?</td> <td><br /></td> </tr> <tr> <td>Identification</td> <td><code>__itanium__</code></td> <td><br /></td> <td>Defined by Intel C/C++</td> </tr> </tbody> </table> <h5>Example</h5> <table> <thead> <tr> <th>CPU</th> <th><code>_M_IA64</code> (Intel C/C++)</th> </tr> </thead> <tbody> <tr> <td><br /></td> <td>64100</td> </tr> </tbody> </table> <h2><a href="http://en.wikipedia.org/wiki/M68k" rel="nofollow">Motorola 68k</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__m68k__</code></td> <td>Defined by GNU C</td> </tr> <tr> <td>Version</td> <td><code>__mc'V'__</code><br /><code>__mc'V'</code><br /><code>mc'V'</code></td> <td>V = Version</td> </tr> <tr> <td>Identification</td> <td><code>M68000</code></td> <td>Defined by SAS/C</td> </tr> <tr> <td>Identification</td> <td><code>__MC68K__</code></td> <td>Defined by Stratus VOS C</td> </tr> <tr> <td>Version</td> <td><code>__MC'V'__</code></td> <td>V = Version</td> </tr> </tbody> </table> <h5>Example</h5> <table> <thead> <tr> <th>CPU</th> <th>Macro</th> </tr> </thead> <tbody> <tr> <td>68000</td> <td><code>__mc68000__</code><br /><code>__MC68000__</code></td> </tr> <tr> <td>68010</td> <td><code>__mc68010__</code></td> </tr> <tr> <td>68020</td> <td><code>__mc68020__</code><br /><code>__MC68020__</code></td> </tr> <tr> <td>68030</td> <td><code>__mc68030__</code><br /><code>__MC68030__</code></td> </tr> <tr> <td>68040</td> <td><code>__mc68040__</code></td> </tr> <tr> <td>68060</td> <td><code>__mc68060__</code></td> </tr> </tbody> </table> <h2><a href="http://en.wikipedia.org/wiki/MIPS_architecture" rel="nofollow">MIPS</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__mips__</code><br /><code>mips</code></td> <td>Defined by GNU C</td> </tr> <tr> <td>Version</td> <td><code>_MIPS_ISA</code> = <code>_MIPS_ISA_MIPS'V'</code></td> <td>V = MIPS ISA level</td> </tr> <tr> <td>Version</td> <td><code>_R3000</code><br /><code>_R4000</code><br /><code>_R5900</code></td> <td><br /></td> </tr> <tr> <td>Identification</td> <td><code>__mips</code></td> <td>Defined by MIPSpro and GNU C</td> </tr> <tr> <td>Version</td> <td><code>__mips</code></td> <td>The value indicates the MIPS ISA (Instruction Set Architecture) level</td> </tr> <tr> <td>Version</td> <td><code>__MIPS_ISA'V'__</code></td> <td>V = MIPS ISA level</td> </tr> <tr> <td>Identification</td> <td><code>__MIPS__</code></td> <td>Defined by Metrowerks</td> </tr> </tbody> </table> <h5>Example</h5> <table> <thead> <tr> <th>CPU</th> <th><code>_MIPS_ISA</code></th> <th>GNU C Macro</th> <th><code>__mips</code></th> <th>MIPSpro Macro</th> </tr> </thead> <tbody> <tr> <td>R2000</td> <td><code>_MIPS_ISA_MIPS1</code></td> <td><br /></td> <td>1</td> <td><br /></td> </tr> <tr> <td>R3000</td> <td><code>_MIPS_ISA_MIPS1</code></td> <td><code>_R3000</code></td> <td>1</td> <td><br /></td> </tr> <tr> <td>R6000</td> <td><code>_MIPS_ISA_MIPS2</code></td> <td><br /></td> <td>2</td> <td><code>__MIPS_ISA2__</code></td> </tr> <tr> <td>R4000</td> <td><br /></td> <td><code>_R4000</code></td> <td><br /></td> <td><br /></td> </tr> <tr> <td>R4400</td> <td><code>_MIPS_ISA_MIPS3</code></td> <td><br /></td> <td>3</td> <td><code>__MIPS_ISA3__</code></td> </tr> <tr> <td>R8000</td> <td><code>_MIPS_ISA_MIPS4</code></td> <td><br /></td> <td>4</td> <td><code>__MIPS_ISA4__</code></td> </tr> <tr> <td>R10000</td> <td><code>_MIPS_ISA_MIPS4</code></td> <td><br /></td> <td>4</td> <td><code>__MIPS_ISA4__</code></td> </tr> </tbody> </table> <h2><a href="http://en.wikipedia.org/wiki/PowerPC" rel="nofollow">PowerPC</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__powerpc</code><br /><code>__powerpc__</code><br /><code>__powerpc64__</code><br /><code>__POWERPC__</code><br /><code>__ppc__</code><br /><code>__ppc64__</code><br /><code>__PPC__</code><br /><code>__PPC64__</code><br /><code>_ARCH_PPC</code><br /><code>_ARCH_PPC64</code></td> <td>Defined by GNU C</td> </tr> <tr> <td>Version</td> <td><code>__ppc'V'__</code></td> <td>V = Version</td> </tr> <tr> <td>Identification</td> <td><code>_M_PPC</code></td> <td>Defined by Visual Studio</td> </tr> <tr> <td>Version</td> <td><code>_M_PPC</code></td> <td>?</td> </tr> <tr> <td>Identification</td> <td><code>_ARCH_PPC</code><br /><code>_ARCH_PPC64</code></td> <td>Defined by XL C/C++</td> </tr> <tr> <td>Version</td> <td><code>_ARCH_'V'</code></td> <td>V = Version</td> </tr> <tr> <td>Version</td> <td><code>__PPCGECKO__</code></td> <td><a href="javascript:void(0)" rel="nofollow">Gekko</a><br /><br />Defined by CodeWarrior</td> </tr> <tr> <td>Version</td> <td><code>__PPCBROADWAY__</code></td> <td><a href="javascript:void(0)" rel="nofollow">Broadway</a><br /><br />Defined by CodeWarrior</td> </tr> <tr> <td>Version</td> <td><code>_XENON</code></td> <td><a href="javascript:void(0)" rel="nofollow">Xenon</a></td> </tr> <tr> <td>Identification</td> <td><code>__ppc</code></td> <td>Defined by Diab</td> </tr> </tbody> </table> <h5>Example</h5> <table> <thead> <tr> <th>CPU</th> <th><code>_M_PPC</code></th> <th>Macro</th> <th>XL Macro</th> </tr> </thead> <tbody> <tr> <td>PowerPC 440</td> <td><br /></td> <td><br /></td> <td><code>_ARCH_440</code></td> </tr> <tr> <td>PowerPC 450</td> <td><br /></td> <td><br /></td> <td><code>_ARCH_450</code></td> </tr> <tr> <td>PowerPC 601</td> <td>601</td> <td><code>__ppc601__</code></td> <td><code>_ARCH_601</code></td> </tr> <tr> <td>PowerPC 603</td> <td>603</td> <td><code>__ppc603__</code></td> <td><code>_ARCH_603</code></td> </tr> <tr> <td>PowerPC 604</td> <td>604</td> <td><code>__ppc604__</code></td> <td><code>_ARCH_604</code></td> </tr> <tr> <td>PowerPC 620</td> <td>620</td> <td><br /></td> <td><br /></td> </tr> </tbody> </table> <h2>Pyramid 9810</h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>pyr</code></td> </tr> </tbody> </table> <h2><a href="http://en.wikipedia.org/wiki/RS/6000" rel="nofollow">RS/6000</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__THW_RS6000</code></td> <td>Defined by XL C/C++</td> </tr> <tr> <td>Identification</td> <td><code>_IBMR2</code></td> <td><br /></td> </tr> <tr> <td>Identification</td> <td><code>_POWER</code></td> <td><br /></td> </tr> <tr> <td>Identification</td> <td><code>_ARCH_PWR</code><br /><code>_ARCH_PWR2</code><br /><code>_ARCH_PWR3</code><br /><code>_ARCH_PWR4</code></td> <td><br /></td> </tr> </tbody> </table> <h1><a href="http://en.wikipedia.org/wiki/SPARC" rel="nofollow">SPARC</a></h1> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__sparc__</code></td> <td>Defined by GNU C</td> </tr> <tr> <td>Identification</td> <td><code>__sparc</code></td> <td>Defined by Sun Studio</td> </tr> <tr> <td>Version</td> <td><code>__sparc_v8__</code><br /><code>__sparc_v9__</code></td> <td>Defined by GNU C</td> </tr> <tr> <td>Version</td> <td><code>__sparcv8</code><br /><code>__sparcv9</code></td> <td>Defined by Sun Studio</td> </tr> </tbody> </table> <h5>Example</h5> <table> <thead> <tr> <th>CPU</th> <th>Sun Studio Macro</th> <th>GNU C Macro</th> </tr> </thead> <tbody> <tr> <td>SPARC v8 (SuperSPARC)</td> <td><code>__sparcv8</code></td> <td><code>__sparc_v8__</code></td> </tr> <tr> <td>SPARC v9 (UltraSPARC)</td> <td><code>__sparcv9</code></td> <td><code>__sparc_v9__</code></td> </tr> </tbody> </table> <h2><a href="http://en.wikipedia.org/wiki/SuperH" rel="nofollow">SuperH</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__sh__</code></td> <td>Defined by GNU C</td> </tr> <tr> <td>Version</td> <td><code>__sh1__</code><br /><code>__sh2__</code><br /><code>__sh3__</code><br /><code>__SH3__</code><br /><code>__SH4__</code><br /><code>__SH5__</code></td> <td><br /></td> </tr> </tbody> </table> <h2><a href="http://en.wikipedia.org/wiki/IBM_System_z" rel="nofollow">SystemZ</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__370__</code><br /><code>__THW_370__</code></td> <td>Identifies <a href="http://en.wikipedia.org/wiki/System/370" rel="nofollow">System/370</a><br /><br />Defined by XL C/C++</td> </tr> <tr> <td>Identification</td> <td><code>__s390__</code></td> <td>Identifies <a href="http://en.wikipedia.org/wiki/System/390" rel="nofollow">System/390</a><br /><br />Defined by GNU C</td> </tr> <tr> <td>Identification</td> <td><code>__s390x__</code></td> <td>Identifies <a href="http://en.wikipedia.org/wiki/Z/Architecture" rel="nofollow">z/Architecture</a><br /><br />Defined by GNU C</td> </tr> <tr> <td>Identification</td> <td><code>__zarch__</code></td> <td>Identifies <a href="http://en.wikipedia.org/wiki/Z/Architecture" rel="nofollow">z/Architecture</a><br /><br />Defined by clang</td> </tr> <tr> <td>Identification</td> <td><code>__SYSC_ZARCH__</code></td> <td>Identifies <a href="http://en.wikipedia.org/wiki/Z/Architecture" rel="nofollow">z/Architecture</a><br /><br />Defined by Systems/C</td> </tr> </tbody> </table> <h2><a href="http://en.wikipedia.org/wiki/Texas_Instruments_TMS320" rel="nofollow">TMS320</a></h2> <table> <thead> <tr> <th>Type</th> <th>Macro</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>_TMS320C2XX</code><br /><code>__TMS320C2000__</code></td> <td>C2000 series</td> </tr> <tr> <td>Identification</td> <td><code>_TMS320C5X</code><br /><code>__TMS320C55X__</code></td> <td>C5000 series</td> </tr> <tr> <td>Identification</td> <td><code>_TMS320C6X</code><br /><code>__TMS320C6X__</code></td> <td>C6000 series</td> </tr> </tbody> </table> <h5>Example</h5> <table> <thead> <tr> <th>DSP</th> <th>Macro</th> </tr> </thead> <tbody> <tr> <td>C28xx</td> <td><code>_TMS320C28X</code></td> </tr> <tr> <td>C54x</td> <td><code>_TMS320C5XX</code></td> </tr> <tr> <td>C55x</td> <td><code>__TMS320C55X__</code></td> </tr> <tr> <td>C6200</td> <td><code>_TMS320C6200</code></td> </tr> <tr> <td>C6400</td> <td><code>_TMS320C6400</code></td> </tr> <tr> <td>C6400+</td> <td><code>_TMS320C6400_PLUS</code></td> </tr> <tr> <td>C6600</td> <td><code>_TMS320C6600</code></td> </tr> <tr> <td>C6700</td> <td><code>_TMS320C6700</code></td> </tr> <tr> <td>C6700+</td> <td><code>_TMS320C6700_PLUS</code></td> </tr> <tr> <td>C6740</td> <td><code>_TMS320C6740</code></td> </tr> </tbody> </table> <h2>TMS470</h2>  <table><thead> <tr> <th>Type</th> <th>Macro</th> </tr> </thead> <tbody> <tr> <td>Identification</td> <td><code>__TMS470__</code></td></tr></tbody></table><img src ="http://www.cppblog.com/Chipset/aggbug/214357.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2016-10-26 09:01 <a href="http://www.cppblog.com/Chipset/archive/2016/10/26/214357.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>The Power of Ten – Rules for Developing Safety Critical Code</title><link>http://www.cppblog.com/Chipset/archive/2015/07/24/211364.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Fri, 24 Jul 2015 07:45:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2015/07/24/211364.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/211364.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2015/07/24/211364.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/211364.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/211364.html</trackback:ping><description><![CDATA[<p style="text-align: center;" align="center">The Power of Ten &#8211; Rules for Developing Safety Critical Code</p>  <p style="text-align:center" align="center">Gerard J. Holzmann</p>  <p style="text-align:center" align="center">NASA/JPL Laboratory for Reliable Software</p>  <p style="text-align:center" align="center">Pasadena, CA 91109</p>  <p>Most serious software development projects use coding guidelines. These guidelines are meant to state what the ground rules are for the software to be written: how it should be structured and which language features should and should not be used. Curiously, there is little consensus on what a good coding standard is. Among the many that have been written there are remarkable few patterns to discern, except that each new document tends to be longer than the one before it. The result is that most existing guidelines contain well over a hundred rules, sometimes with questionable justification. Some rules, especially those that try to stipulate the use of white-space in programs, may have been introduced by personal preference; others are meant to prevent very specific and unlikely types of error from earlier coding efforts within the same organization. Not surprisingly, the existing coding guidelines tend to have little effect on what developers actually do when they write code. The most dooming aspect of many of the guidelines is that they rarely allow for comprehensive tool-based compliance checks. Tool-based checks are important, since it is often infeasible to manually review the hundreds of thousands of lines of code that are written for larger applications. </p>  <p>The benefit of existing coding guidelines is therefore often small, even for critical applications. A verifiable set of well-chosen coding rules could, however, make critical software components more thoroughly analyzable, for properties that go beyond compliance with the set of rules itself. To be effective, though, the set of rules has to be small, and must be clear enough that it can easily be understood and remembered. The rules will have to be specific enough that they can be checked mechanically. To put an easy upper-bound on the number of rules for an effective guideline, I will argue that we can get significant benefit by restricting to no more than ten rules. Such a small set, of course, cannot be all-encompassing, but it can give us a foothold to achieve measurable effects on software reliability and verifiability. To support strong checking, the rules are somewhat strict &#8211; one might even say Draconian. The trade-off, though, should be clear. When it really counts, especially in the development of safety critical code, it may be worth going the extra mile and living within stricter limits than may be desirable. In return, we should be able to demonstrate more convincingly that critical software will work as intended. </p>  <p>Ten Rules for Safety Critical Coding </p>  <p>The choice of language for a safety critical code is in itself a key consideration, but we will not debate it much here. At many organizations, JPL included, critical code is written in C. With its long history, there is extensive tool support for this language, including strong source code analyzers, logic model extractors, metrics tools, debuggers, test support tools, and a choice of mature, stable compilers. For this reason, C is also the target of the majority of coding guidelines that have been developed. For fairly pragmatic reasons, then, our coding rules primarily target C and attempt to optimize our ability to more thoroughly check the reliability of critical applications written in C. </p>  <p>The following rules may provide benefit, especially if the low number means that developers will actually adhere to them. Each rule is followed with a brief rationale for its inclusion. </p>  <p>1. Rule: Restrict all code to very simple control flow constructs &#8211; do not use goto statements, setjmp or longjmp constructs, and direct or indirect recursion. </p>  <p>Rationale: Simpler control flow translates into stronger capabilities for verification and often results in improved code clarity. The banishment of recursion is perhaps the biggest surprise here. Without recursion, though, we are guaranteed to have an acyclic function call graph, which can be exploited by code analyzers, and can directly help to prove that all executions that should be bounded are in fact bounded. </p>  <p>(Note that this rule does not require that all functions have a single point of return &#8211; although this often also simplifies control flow. There are enough cases, though, where an early error return is the simpler solution.) </p>  <p>2. Rule: All loops must have a fixed upper-bound. It must be trivially possible for a checking tool to prove statically that a preset upper-bound on the number of iterations of a loop cannot be exceeded. If the loop-bound cannot be proven statically, the rule is considered violated. </p>  <p>Rationale: The absence of recursion and the presence of loop bounds prevents runaway code. This rule does not, of course, apply to iterations that are meant to be non-terminating (e.g., in a process scheduler). In those special cases, the reverse rule is applied: it should be statically provable that the iteration cannot terminate. </p>  <p>One way to support the rule is to add an explicit upper-bound to all loops that have a variable number of iterations (e.g., code that traverses a linked list). When the upper- bound is exceeded an assertion failure is triggered, and the function containing the failing iteration returns an error. (See Rule 5 about the use of assertions.) </p>  <p>3. Rule: Do not use dynamic memory allocation after initialization. </p>  <p>Rationale: This rule is common for safety critical software and appears in most coding guidelines. The reason is simple: memory allocators, such as malloc, and garbage collectors often have unpredictable behavior that can significantly impact performance. A notable class of coding errors also stems from mishandling of memory allocation and free routines: forgetting to free memory or continuing to use memory after it was freed, attempting to allocate more memory than physically available, overstepping boundaries on allocated memory, etc. Forcing all applications to live within a fixed, pre-allocated, area of memory can eliminate many of theseproblems and make it easier to verify memory use. Note that the only way to dynamically claim memory in the absence of memory allocation from the heap is to use stack memory. In the absence of recursion (Rule 1), an upper-bound on the use of stack memory can derived statically, thus making it possible to prove that an application will always live within its pre-allocated memory means. </p>  <p>4. Rule: No function should be longer than what can be printed on a single sheet of paper in a standard reference format with one line per statement and one line per declaration. Typically, this means no more than about 60 lines of code per function. </p>  <p>Rationale: Each function should be a logical unit in the code that is understandable and verifiable as a unit. It is much harder to understand a logical unit that spans multiple screens on a computer display or multiple pages when printed. Excessively long functions are often a sign of poorly structured code. </p>  <p>5. Rule: The assertion density of the code should average to a minimum of two assertions per function. Assertions are used to check for anomalous conditions that should never happen in real-life executions. Assertions must always be side-effect free and should be defined as Boolean tests. When an assertion fails, an explicit recovery action must be taken, e.g., by returning an error condition to the caller of the function that executes the failing assertion. Any assertion for which a static checking tool can prove that it can never fail or never hold violates this rule. (I.e., it is not possible to satisfy the rule by adding unhelpful &#8220;assert(true)&#8221; statements.) </p>  <p>Rationale: Statistics for industrial coding efforts indicate that unit tests often find at least one defect per 10 to 100 lines of code written. The odds of intercepting defects increase with assertion density. Use of assertions is often also recommended as part of a strong defensive coding strategy. Assertions can be used to verify pre- and post-conditions of functions, parameter values, return values of functions, and loop-invariants. Because assertions are side-effect free, they can be selectively disabled after testing in performance-critical code. </p>  <p>A typical use of an assertion would be as follows: </p>  <p>if (!c_assert(p &gt;= 0) == true) { </p>  <p>&nbsp;&nbsp;&nbsp;&nbsp; return ERROR; </p>  <p>}</p>  <p>with the assertion defined as follows: </p>  <p>#define c_assert(e)<span>&nbsp;&nbsp;&nbsp; </span>((e) ? (true) : \ </p>  <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tst_debugging(&#8221;%s,%d: assertion &#8217;%s&#8217; failed\n&#8221;, \ </p>  <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;__FILE__, __LINE__, #e), false) </p>  <p>In this definition, __FILE__ and __LINE__ are predefined by the macro preprocessor to produce the filename and line-number of the failing assertion. The syntax #e turns the assertion condition e into a string that is printed as part of the error message. In code destined for an embedded processor there is of course no place to print the error message itself &#8211; in that case, the call to tst_debugging is turned into a no-op, andthe assertion turns into a pure Boolean test that enables error recovery from anomolous behavior. </p>  <p>6. Rule: Data objects must be declared at the smallest possible level of scope. </p>  <p>Rationale: This rule supports a basic principle of data-hiding. Clearly if an object is not in scope, its value cannot be referenced or corrupted. Similarly, if an erroneous value of an object has to be diagnosed, the fewer the number of statements where the value could have been assigned; the easier it is to diagnose the problem. The rule discourages the re-use of variables for multiple, incompatible purposes, which can complicate fault diagnosis. </p>  <p>7. Rule: The return value of non-void functions must be checked by each calling function, and the validity of parameters must be checked inside each function. </p>  <p>Rationale: This is possibly the most frequently violated rule, and therefore somewhat more suspect as a general rule. In its strictest form, this rule means that even the return value ofprintf&nbsp;statements and file close statements must be checked. One can make a case, though, that if the response to an error would rightfully be no different than the response to success, there is little point in explicitly checking a return value.</p>  <p>This is often the case with calls toprintf and close. In cases like these, it can be acceptable to explicitly cast the function return value to (void) &#8211; thereby indicating that the programmer explicitly and not accidentally decides to ignore a return value. In more dubious cases, a comment should be present to explain why a return value is irrelevant. In most cases, though, the return value of a function should not be ignored, especially if error return values must be propagated up the function call chain. </p>  <p>Standard libraries famously violate this rule with potentially grave consequences. See, for instance, what happens if you accidentally execute strlen(0), or strcat(s1, s2, -1) with the standard C string library &#8211; it is not pretty. By keeping the general rule, we make sure that exceptions must be justified, with mechanical checkers flagging violations. Often, it will be easier to comply with the rule than to explain why non- compliance might be acceptable. </p>  <p>8. Rule:&nbsp;&nbsp; The use of the preprocessor must be limited to the inclusion of header files and simple macro definitions. Token pasting, variable argument lists (ellipses), and recursive macro calls are not allowed. All macros must expand into complete syntactic units. The use of conditional compilation directives is often also dubious, but cannot always be avoided. This means that there should rarely be justification for more than one or two conditional compilation directives even in large software development efforts, beyond the standard boilerplate that avoids multiple inclusion of the same header file. Each such use should be flagged by a tool-based checker and justified in the code. </p>  <p>Rationale: The C preprocessor is a powerful obfuscation tool that can destroy code clarity and befuddle many text based checkers. The effect of constructs in unrestricted preprocessor code can be extremely hard to decipher, even with a formal languagedefinition in hand. In a new implementation of the C preprocessor, developers often have to resort to using earlier implementations as the referee for interpreting complex defining language in the C standard. The rationale for the caution against conditional compilation is equally important. Note that with just ten conditional compilation directives, there could be up to 210 possible versions of the code, each of which would have to be tested&#8211; causing a huge increase in the required test effort. </p>  <p>9. Rule: The use of pointers should be restricted. Specifically, no more than one level of dereferencing is allowed. Pointer dereference operations may not be hidden in macro definitions or inside typedef declarations. Function pointers are not permitted. </p>  <p>Rationale: Pointers are easily misused, even by experienced programmers. They can make it hard to follow or analyze the flow of data in a program, especially by tool-based static analyzers. Function pointers, similarly, can seriously restrict the types of checks that can be performed by static analyzers and should only be used if there is a strong justification for their use, and ideally alternate means are provided to assist tool-based checkers determine flow of control and function call hierarchies. For instance, if function pointers are used, it can become impossible for a tool to prove absence of recursion, so alternate guarantees would have to be provided to make up for this loss in analytical capabilities. </p>  <p>10. Rule: All code must be compiled, from the first day of development, with all compiler warnings enabled at the compiler&#8217;s most pedantic setting. All code must compile with these setting without any warnings. All code must be checked daily with at least one, but preferably more than one, state-of-the-art static source code analyzer and should pass the analyses with zero warnings. </p>  <p>Rationale: There are several very effective static source code analyzers on the market today, and quite a few freeware tools as well.2 There simply is no excuse for any software development effort not to make use of this readily available technology. It should be considered routine practice, even for non-critical code development. The rule of zero warnings applies even in cases where the compiler or the static analyzer gives an erroneous warning: if the compiler or the static analyzer gets confused, the code causing the confusion should be rewritten so that it becomes more trivially valid. Many developers have been caught in the assumption that a warning was surely invalid, only to realize much later that the message was in fact valid for less obvious reasons. Static analyzers have somewhat of a bad reputation due to early predecessors, such as lint, that produced mostly invalid messages, but this is no longer the case. The best static analyzers today are fast, and they produce selective and accurate messages. Their use should not be negotiable at any serious software project. </p>  <p>The first two rules guarantee the creation of a clear and transparent control flow structure that is easier to build, test, and analyze. The absence of dynamic memory allocation, stipulated by the third rule, eliminates a class of problems related to the allocation and freeing of memory, the use of stray pointers, etc. The next few rules (4 to 7) are fairly broadly accepted as standards for good coding style. Some benefits of other coding styles that have been advanced for safety critical systems, e.g., the discipline of &#8220;design by contract&#8221; can partly be found in rules 5 to 7.</p>  <p>These ten rules are being used experimentally at JPL in the writing of mission critical software, with encouraging results. After overcoming a healthy initial reluctance to live within such strict confines, developers often find that compliance with the rules does tend to benefit code clarity, analyzability, and code safety. The rules lessen the burden on the developer and tester to establish key properties of the code (e.g., termination or boundedness, safe use of memory and stack, etc.) by other means. If the rules seem Draconian at first, bear in mind that they are meant to make it possible to check code where very literally your life may depend on its correctness: code that is used to control the airplane that you fly on, the nuclear power plant a few miles from where you live, or the spacecraft that carries astronauts into orbit. The rules act like the seat-belt in your car: initially they are perhaps a little uncomfortable, but after a while their use becomes second-nature and not using them becomes unimaginable.</p><img src ="http://www.cppblog.com/Chipset/aggbug/211364.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2015-07-24 15:45 <a href="http://www.cppblog.com/Chipset/archive/2015/07/24/211364.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>When someone gives you a bug [FWD]</title><link>http://www.cppblog.com/Chipset/archive/2015/04/01/210219.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Wed, 01 Apr 2015 06:39:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2015/04/01/210219.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/210219.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2015/04/01/210219.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/210219.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/210219.html</trackback:ping><description><![CDATA[(I'm a front-end developer, but I thought this might resonate)<br /><br />Someone gives you a bug. "The light in the conference room on the 26th floor is on. It needs to be off."<br /><br />A note on the bug says, &#8220;This will take you like 5 minutes. It's just flipping a switch."<br /><br />You go to the conference room on 26. The light is on, but there's no light switch in the room.<br /><br />So you prepare to install one. But the designer says it would ruin the room&#8217;s aesthetic. Plus, the walls are concrete. With the proper tools, you could install the switch. But no one will approve the purchase of the proper tools. Without the proper tools it will take two days. And they want it done now, because they're afraid that any minute the CEO might decide to go to the 26th floor and happen to walk by the conference room and ask why the hell that light is on.<br /><br />And now you're getting emails asking why the light isn't off yet.<br /><br />So now you have to stop and send a group email to explain the situation, and several people start up a panicked email chain.<br /><br />You know if you wait for the problem to be resolved by anyone discussing it in the email chain, it won&#8217;t get fixed. The bug has your name on it, and it's dated today, so you're the one in trouble if it isn't resolved. So you go up into the hallway ceiling on 26, find the wires leading to the light, cut and cap them. Finally. Problem solved.<br /><br />In order to quell the panic in the email thread, you report back how you solved the issue.<br /><br />You don&#8217;t hear anything for a while. When you do, everyone is concerned that now the light can&#8217;t be turned on and off. What if the CEO wants to have a meeting in there? So here&#8217;s what they ask you to do: They want you to run wires from the light down into the basement. When someone needs the light to be on or off, they&#8217;ll contact you, and have you run to the basement and either connect or disconnect the wires.<br /><br />You protest the ridiculousness of this solution. Your boss says, &#8220;Yeah, I know it&#8217;s not ideal. But it&#8217;s the only solution we have right now."<br /><br />At this point you realize you have a choice. You could do this. Or you could quit in protest, and find another job. But you realize that once you start that new job, they&#8217;re likely to ask you to do something just as idiotic, if not more so.<br /><br />So you go run the wires from floor 26 down to the basement. When you get to the basement, you see dozens of wires hanging out of the walls, from all the people who have had to do this exact same thing before. (So that&#8217;s where the idea came from.) You set up the wires and label them as best you can, with a short apology to whoever has to deal with this next.<br /><br />When you get back to your desk, you have a message. QA has reopened the bug. It says, &#8220;I see light."<br /><br />You head back up to the conference room on 26. The light is off. You go back to your desk and close the bug, reporting that you checked on it in person.<br /><br />QA reopens the bug again. &#8220;Room still lit&#8221; it says. After looking at the unlit bulb one more time, you tell your boss, who suggests you go back down to the basement and check the wires. You protest that you are looking at the light right now and it&#8217;s off. &#8220;I know, but this way you can tell QA you checked out absolutely everything."<br /><br />So you sigh and head to the basement. Sure enough, the wires are not connected. The ends are capped. They are not resting on anything that could conduct electricity.<br /><br />You report back to QA that you checked the wires, which are not connected, and that you looked at the bulb, which was unlit.<br /><br />&#8220;I didn&#8217;t mean the bulb,&#8221; says QA. &#8220;The bug is about light in the room. There&#8217;s still too much light. Shouldn&#8217;t you close the blinds?"<br /><br />You respond that the blinds don&#8217;t fall under your control, and that the bug specifies the light being turned off.<br /><br />Not believing you, QA sends out a group email asking if the blinds are covered by the bug.<br /><br />Some time passes before you hear from anyone. Finally someone from the email chain calls you.<br /><br />&#8220;Theoretically,&#8221; they ask, &#8220;could someone participating in a meeting in the conference room on 26 open or close the blinds by themselves if it was too bright or too dark?"<br /><br />Yes they could, you reply.<br /><br />&#8220;Like, an ordinary person? They wouldn&#8217;t need you to do it?"<br /><br />Yes, an ordinary person. No, they wouldn&#8217;t need you. Anyone can do it.<br /><br />&#8220;Great. Excellent. Then we&#8217;ll leave that for now. I&#8217;ll schedule a stand-up meeting about the blinds issue."<br /><br />So the bug is closed. Now, the CEO, possibly having caught wind of all the discussion and furtive activity surrounding the conference room on 26, wants to have a meeting there. You get several panicked emails that they need the light on.<br /><br />You go to the basement, connect the wires, and return to your desk, to find 32 new messages in your inbox. &#8220;Something&#8217;s wrong&#8212;the light&#8217;s not on!&#8221; &#8220;There&#8217;s a problem &#8212; no light!&#8221; &#8220;Are you getting these emails?&#8221; and so on.<br /><br />The 32nd email says, &#8220;Nevermind&#8212;the light&#8217;s on."<br /><br />This process is repeated more or less exactly when it&#8217;s time to turn the light off again.<br /><br />But if there&#8217;s any good news, it&#8217;s this: after the meeting, everyone forgets that there even is a conference room on 26, so you never have to do anything about it again.<br /><br />Wow, gold! Thanks!<img src ="http://www.cppblog.com/Chipset/aggbug/210219.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2015-04-01 14:39 <a href="http://www.cppblog.com/Chipset/archive/2015/04/01/210219.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>using gcc_x86 assembly to scan the most significant one bit and the least significant one bit</title><link>http://www.cppblog.com/Chipset/archive/2014/06/15/207298.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Sun, 15 Jun 2014 09:38:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2014/06/15/207298.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/207298.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2014/06/15/207298.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/207298.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/207298.html</trackback:ping><description><![CDATA[原来发过搜索第一位的帖子，这次算再补充一下吧。以下取自网络，作者不详。<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; ">&nbsp;1</span>&nbsp;<span style="color: #000000; ">#ifdef&nbsp;__GNUC__<br /></span><span style="color: #008080; ">&nbsp;2</span>&nbsp;<span style="color: #000000; "><br /></span><span style="color: #008080; ">&nbsp;3</span>&nbsp;<span style="color: #000000; "></span><span style="color: #0000FF; ">#if</span><span style="color: #000000; ">&nbsp;(defined&nbsp;_WIN64&nbsp;||&nbsp;defined&nbsp;__x86_64__)</span><span style="color: #000000; "><br /></span><span style="color: #008080; ">&nbsp;4</span>&nbsp;<span style="color: #000000; "><br /></span><span style="color: #008080; ">&nbsp;5</span>&nbsp;<span style="color: #000000; "></span><span style="color: #008000; ">/*</span><span style="color: #008000; ">*<br /></span><span style="color: #008080; ">&nbsp;6</span>&nbsp;<span style="color: #008000; ">&nbsp;*&nbsp;../bit_scan_forward<br /></span><span style="color: #008080; ">&nbsp;7</span>&nbsp;<span style="color: #008000; ">&nbsp;*&nbsp;@return&nbsp;index&nbsp;(0..63)&nbsp;of&nbsp;least&nbsp;significant&nbsp;one&nbsp;bit<br /></span><span style="color: #008080; ">&nbsp;8</span>&nbsp;<span style="color: #008000; ">&nbsp;</span><span style="color: #008000; ">*/</span><span style="color: #000000; "><br /></span><span style="color: #008080; ">&nbsp;9</span>&nbsp;<span style="color: #000000; ">unsigned&nbsp;bit_scan_forward(unsigned&nbsp;</span><span style="color: #0000FF; ">long</span><span style="color: #000000; ">&nbsp;</span><span style="color: #0000FF; ">long</span><span style="color: #000000; ">&nbsp;x)<br /></span><span style="color: #008080; ">10</span>&nbsp;<span style="color: #000000; ">{<br /></span><span style="color: #008080; ">11</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;asm(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">bsfq&nbsp;%0,&nbsp;%0</span><span style="color: #000000; ">"</span><span style="color: #000000; ">&nbsp;:&nbsp;</span><span style="color: #000000; ">"</span><span style="color: #000000; ">=r</span><span style="color: #000000; ">"</span><span style="color: #000000; ">&nbsp;(x)&nbsp;:&nbsp;</span><span style="color: #000000; ">"</span><span style="color: #000000; ">0</span><span style="color: #000000; ">"</span><span style="color: #000000; ">&nbsp;(x));<br /></span><span style="color: #008080; ">12</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">return</span><span style="color: #000000; ">&nbsp;unsigned(x);<br /></span><span style="color: #008080; ">13</span>&nbsp;<span style="color: #000000; ">}<br /></span><span style="color: #008080; ">14</span>&nbsp;<span style="color: #000000; "><br /></span><span style="color: #008080; ">15</span>&nbsp;<span style="color: #000000; "></span><span style="color: #008000; ">/*</span><span style="color: #008000; ">*<br /></span><span style="color: #008080; ">16</span>&nbsp;<span style="color: #008000; ">&nbsp;*&nbsp;bit_scan_reverse<br /></span><span style="color: #008080; ">17</span>&nbsp;<span style="color: #008000; ">&nbsp;*&nbsp;@return&nbsp;index&nbsp;(0..63)&nbsp;of&nbsp;most&nbsp;significant&nbsp;one&nbsp;bit<br /></span><span style="color: #008080; ">18</span>&nbsp;<span style="color: #008000; ">&nbsp;</span><span style="color: #008000; ">*/</span><span style="color: #000000; "><br /></span><span style="color: #008080; ">19</span>&nbsp;<span style="color: #000000; ">unsigned&nbsp;bit_scan_reverse(unsigned&nbsp;</span><span style="color: #0000FF; ">long</span><span style="color: #000000; ">&nbsp;</span><span style="color: #0000FF; ">long</span><span style="color: #000000; ">&nbsp;x)<br /></span><span style="color: #008080; ">20</span>&nbsp;<span style="color: #000000; ">{<br /></span><span style="color: #008080; ">21</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;asm(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">bsrq&nbsp;%0,&nbsp;%0</span><span style="color: #000000; ">"</span><span style="color: #000000; ">&nbsp;:&nbsp;</span><span style="color: #000000; ">"</span><span style="color: #000000; ">=r</span><span style="color: #000000; ">"</span><span style="color: #000000; ">&nbsp;(x)&nbsp;:&nbsp;</span><span style="color: #000000; ">"</span><span style="color: #000000; ">0</span><span style="color: #000000; ">"</span><span style="color: #000000; ">&nbsp;(x));<br /></span><span style="color: #008080; ">22</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">return</span><span style="color: #000000; ">&nbsp;unsigned(x);<br /></span><span style="color: #008080; ">23</span>&nbsp;<span style="color: #000000; ">}<br /></span><span style="color: #008080; ">24</span>&nbsp;<span style="color: #000000; "><br /></span><span style="color: #008080; ">25</span>&nbsp;<span style="color: #000000; "></span><span style="color: #0000FF; ">#elif</span><span style="color: #000000; ">&nbsp;(defined&nbsp;_WIN32)&nbsp;||&nbsp;(defined&nbsp;__linux__)</span><span style="color: #000000; "><br /></span><span style="color: #008080; ">26</span>&nbsp;<span style="color: #000000; "><br /></span><span style="color: #008080; ">27</span>&nbsp;<span style="color: #000000; "></span><span style="color: #008000; ">/*</span><span style="color: #008000; ">*<br /></span><span style="color: #008080; ">28</span>&nbsp;<span style="color: #008000; ">&nbsp;*&nbsp;../bit_scan_forward<br /></span><span style="color: #008080; ">29</span>&nbsp;<span style="color: #008000; ">&nbsp;*&nbsp;@return&nbsp;index&nbsp;(0..63)&nbsp;of&nbsp;least&nbsp;significant&nbsp;one&nbsp;bit<br /></span><span style="color: #008080; ">30</span>&nbsp;<span style="color: #008000; ">&nbsp;</span><span style="color: #008000; ">*/</span><span style="color: #000000; "><br /></span><span style="color: #008080; ">31</span>&nbsp;<span style="color: #000000; ">unsigned&nbsp;bit_scan_forward(unsigned&nbsp;</span><span style="color: #0000FF; ">long</span><span style="color: #000000; ">&nbsp;</span><span style="color: #0000FF; ">long</span><span style="color: #000000; ">&nbsp;x)<br /></span><span style="color: #008080; ">32</span>&nbsp;<span style="color: #000000; ">{<br /></span><span style="color: #008080; ">33</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;asm(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">bsf&nbsp;%0,&nbsp;%0</span><span style="color: #000000; ">"</span><span style="color: #000000; ">&nbsp;:&nbsp;</span><span style="color: #000000; ">"</span><span style="color: #000000; ">=r</span><span style="color: #000000; ">"</span><span style="color: #000000; ">&nbsp;(x)&nbsp;:&nbsp;</span><span style="color: #000000; ">"</span><span style="color: #000000; ">0</span><span style="color: #000000; ">"</span><span style="color: #000000; ">&nbsp;(x));<br /></span><span style="color: #008080; ">34</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">return</span><span style="color: #000000; ">&nbsp;unsigned(x);<br /></span><span style="color: #008080; ">35</span>&nbsp;<span style="color: #000000; ">}<br /></span><span style="color: #008080; ">36</span>&nbsp;<span style="color: #000000; "><br /></span><span style="color: #008080; ">37</span>&nbsp;<span style="color: #000000; "></span><span style="color: #008000; ">/*</span><span style="color: #008000; ">*<br /></span><span style="color: #008080; ">38</span>&nbsp;<span style="color: #008000; ">&nbsp;*&nbsp;bit_scan_reverse<br /></span><span style="color: #008080; ">39</span>&nbsp;<span style="color: #008000; ">&nbsp;*&nbsp;@return&nbsp;index&nbsp;(0..63)&nbsp;of&nbsp;most&nbsp;significant&nbsp;one&nbsp;bit<br /></span><span style="color: #008080; ">40</span>&nbsp;<span style="color: #008000; ">&nbsp;</span><span style="color: #008000; ">*/</span><span style="color: #000000; "><br /></span><span style="color: #008080; ">41</span>&nbsp;<span style="color: #000000; ">unsigned&nbsp;bit_scan_reverse(unsigned&nbsp;</span><span style="color: #0000FF; ">long</span><span style="color: #000000; ">&nbsp;</span><span style="color: #0000FF; ">long</span><span style="color: #000000; ">&nbsp;x)<br /></span><span style="color: #008080; ">42</span>&nbsp;<span style="color: #000000; ">{<br /></span><span style="color: #008080; ">43</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;asm(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">bsr&nbsp;%0,&nbsp;%0</span><span style="color: #000000; ">"</span><span style="color: #000000; ">&nbsp;:&nbsp;</span><span style="color: #000000; ">"</span><span style="color: #000000; ">=r</span><span style="color: #000000; ">"</span><span style="color: #000000; ">&nbsp;(x)&nbsp;:&nbsp;</span><span style="color: #000000; ">"</span><span style="color: #000000; ">0</span><span style="color: #000000; ">"</span><span style="color: #000000; ">&nbsp;(x));<br /></span><span style="color: #008080; ">44</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">return</span><span style="color: #000000; ">&nbsp;unsigned(x);<br /></span><span style="color: #008080; ">45</span>&nbsp;<span style="color: #000000; ">}<br /></span><span style="color: #008080; ">46</span>&nbsp;<span style="color: #000000; "><br /></span><span style="color: #008080; ">47</span>&nbsp;<span style="color: #000000; "></span><span style="color: #0000FF; ">#endif</span><span style="color: #000000; "><br /></span><span style="color: #008080; ">48</span>&nbsp;<span style="color: #000000; "><br /></span><span style="color: #008080; ">49</span>&nbsp;<span style="color: #000000; "></span><span style="color: #0000FF; ">#endif</span></div><img src ="http://www.cppblog.com/Chipset/aggbug/207298.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2014-06-15 17:38 <a href="http://www.cppblog.com/Chipset/archive/2014/06/15/207298.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>单数组哈希表unordered_map和unordered_set</title><link>http://www.cppblog.com/Chipset/archive/2012/09/09/190053.html</link><dc:creator>Chipset</dc:creator><author>Chipset</author><pubDate>Sun, 09 Sep 2012 14:53:00 GMT</pubDate><guid>http://www.cppblog.com/Chipset/archive/2012/09/09/190053.html</guid><wfw:comment>http://www.cppblog.com/Chipset/comments/190053.html</wfw:comment><comments>http://www.cppblog.com/Chipset/archive/2012/09/09/190053.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.cppblog.com/Chipset/comments/commentRss/190053.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Chipset/services/trackbacks/190053.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 以静态表为例，原理如下图，也就是多个单链表存储在同一个数组中。勉强算开地址哈希表吧，但跟一般开地址哈希表原理不太一样。存储在同一个数组的目的是节省一个表头指针，有表头指针的哈希表见本主页"双数组哈希unordered_xxx"相对于传统的拉链哈希表，这个哈希表的原理不太好理解(传统的好理解，但耗费内存多且速度慢～～)看上图。使用默认值覆盖的原因是我们原本用它计算陆地坐标，(0,0,0)这个点在海里...&nbsp;&nbsp;<a href='http://www.cppblog.com/Chipset/archive/2012/09/09/190053.html'>阅读全文</a><img src ="http://www.cppblog.com/Chipset/aggbug/190053.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Chipset/" target="_blank">Chipset</a> 2012-09-09 22:53 <a href="http://www.cppblog.com/Chipset/archive/2012/09/09/190053.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>