??xml version="1.0" encoding="utf-8" standalone="yes"?>C++博客-?/title><link>http://www.kffa.tw/guijie/</link><description>杰哥?哈哈!</description><language>zh-cn</language><lastBuildDate>Mon, 18 Mar 2019 23:38:48 GMT</lastBuildDate><pubDate>Mon, 18 Mar 2019 23:38:48 GMT</pubDate><ttl>60</ttl><item><title>google scholarQ怎么L自引Q?/title><link>http://www.kffa.tw/guijie/archive/2019/03/17/216300.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Sun, 17 Mar 2019 15:24:00 GMT</pubDate><guid>http://www.kffa.tw/guijie/archive/2019/03/17/216300.html</guid><wfw:comment>http://www.kffa.tw/guijie/comments/216300.html</wfw:comment><comments>http://www.kffa.tw/guijie/archive/2019/03/17/216300.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.kffa.tw/guijie/comments/commentRss/216300.html</wfw:commentRss><trackback:ping>http://www.kffa.tw/guijie/services/trackbacks/216300.html</trackback:ping><description><![CDATA[<span style="font-family: Geneva, Arial, Helvetica, sans-serif;">google scholar, 点进paperQcited by的number => 勾上search within citing </span><span style="font-family: Geneva, Arial, Helvetica, sans-serif;">articles, search box里输?-author:"your name" <br /></span>Reference: http://www.unknownspace.org/article_t/Immigration/33820191.html<img src ="http://www.kffa.tw/guijie/aggbug/216300.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.kffa.tw/guijie/" target="_blank">杰哥</a> 2019-03-17 23:24 <a href="http://www.kffa.tw/guijie/archive/2019/03/17/216300.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[zz] 3 个相见恨晚的 Google Colaboratory 奇技http://www.kffa.tw/guijie/archive/2019/02/13/216240.html杰哥杰哥Wed, 13 Feb 2019 15:56:00 GMThttp://www.kffa.tw/guijie/archive/2019/02/13/216240.htmlhttp://www.kffa.tw/guijie/comments/216240.htmlhttp://www.kffa.tw/guijie/archive/2019/02/13/216240.html#Feedback0http://www.kffa.tw/guijie/comments/commentRss/216240.htmlhttp://www.kffa.tw/guijie/services/trackbacks/216240.html原文出处Q?/span>

https://www.kdnuggets.com/2018/02/essential-google-colaboratory-tips-tricks.html


试想一下,如果有个免费的在U云端^収ͼ既可以不用安?TensorFlow 直接使用Q又可以实现 GPU 加速训l,那该是多好的一件事情。你没听错,q种好事实存在Q今天我重介l一个谷歌推出的免费的云端工PColaboratory?/span>


Colaboratory 是一?Google 研究目Q旨在帮助传播机器学习培训和研究成果?/span>它是一?Jupyter W记本环?/span>Q不需要进行Q何设|就可以使用Qƈ且完全在云端q行。Colaboratory W记本存储在 Google 云端盘中,q且可以׃nQ就如同您?Google 文档或表g栗Colaboratory 可免费用?/span>


也就是说QColaboratory 存储?Google 云端盘中,我们可以?Google 云端盘里直接编?Jupyter NotebookQ在U用深度学习框?TensorFlow q训l我们的经|络了。超炫!



q里?3 个o人相见恨晚的奇技淫y来简化它的用,分别是:使用免费?GPU、安装库、上传ƈ使用数据文g?/span>


下面分别介绍Q?/span>


1. 使用免费?GPU


在打开?Jupyter Notebook 中,选择菜单?#8220;代码执行E序QRuntimeQ?/strong>”Q?#8220;更改q行cdQChange runtime typeQ?/strong>”Q这时将看到以下弹出H口Q?/span>

保“g加速器QHardware acceleratorQ?#8221;讄?GPUQ默认ؓ CPUQ?span style="color: #444444; font-family: "Microsoft Yahei", "Helvetica Neue", Helvetica, Arial, sans-serif; background-color: #ffffff;">讄完毕后点M存?/span>


值得注意的是认W记本处?strong>已连?/strong>的状态:



查是否真的开启了 GPUQ即当前q接CGPU实例Q,可以直接?Jupyter Notebook 中运行以下命?/span>Q?/span>


import tensorflow as tf
device_name = tf.test.gpu_device_name()
if device_name != '/device:GPU:0':
 raise SystemError('GPU device not found')
print('Found GPU at: {}'.format(device_name))

 

若输Z下语句,则表明已l用了 GPU 实例?/span>


Found GPU at: /device:GPU:0


但是Q由于在U?GPU 资源有限Q有时候可能会出现下面的问题提C:



 

pPh允许你一ơ最多持l?12 时的免?GPU?/span>


2. 安装?/span>


目前Q在 Google Colaboratory 中安装的软gq不是持久的Q意味着每次重新q接实例旉需要重新安装。但是,Colab 已经默认安装了需要有用的库,安装新的库也q难事Q方法也有好几种?/span>


但需要注意的是,安装M需要从源代码构建的软g可能需要很长的旉?/span>


Colab 同时支持 pip ?apt 包管理器。无论您使用的是哪一个,C要在命o前面加上W号 “!”?/span>


# Install Keras with pip
!pip install -q keras
import keras

>
>> Using TensorFlow backend.

#
Install GraphViz with apt
!apt-get install graphviz -y



3. 上传q用数据文?/span>


我们一般都需要在 Colab W记本中使用数据Q对吧?你可以?wget 之类的工具从|络上获取数据,但是如果你有一些本地文Ӟ想上传到你的h盘中的 Colab 环境里ƈ使用它们Q该怎么做呢Q?/span>


很简单,只需 3 步即可实玎ͼ


首先使用以下命o调用W记本中的文仉择器:


from google.colab import files
uploaded = files.upload()


q行之后Q我们就会发现单?cell 下出C“选择文g”按钮Q?/span>



q样可以直接选择你想上传的文件啦Q?/span>


选择文g后,使用以下q代Ҏ上传文g以查扑օ键名Q命令如下:


for fn in uploaded.keys():
 print('User uploaded file "{name}" with length {length} bytes'.format(name=fn, length=len(uploaded[fn])))


例如待上传的?iris.csv 文gQ若q行没有问题的话Q应该出现类g面的提示语句Q?/span>


User uploaded file "iris.csv" with length 3716 bytes


最后,׃用以下命令将文g的内容加载到 Pandas ?DataFrame 中了Q?/span>


import pandas as pd
import io
df = pd.read_csv(io.StringIO(uploaded['iris.csv'].decode('utf-8')))
print(df)


q种上传文g的方法是不是很简单呢Q当Ӟ上传和用数据文件还有其它的ҎQ但是我发现q一Ҏ最单明了?/span>


以上是关于 Google Calaboratory ?3 个非常实用的技巧,赶紧试一下吧Q?/span>


最后,可能有的读者朋友对 Google Calaboratory 不太了解的,可以查看我之前写的一文章:如何在免费云端运?Python 深度学习框架Q?/strong>链接如下Q?/span>


https://redstonewill.com/1493/


也可以点?strong>阅读原文查看Q?/span>


Reference:
https://mp.weixin.qq.com/s/vLnBFPZNvIjs4R7d4_6M_g


杰哥 2019-02-13 23:56 发表评论
]]>
[zz]Python中下划线?U含?/title><link>http://www.kffa.tw/guijie/archive/2019/02/02/216230.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Fri, 01 Feb 2019 17:51:00 GMT</pubDate><guid>http://www.kffa.tw/guijie/archive/2019/02/02/216230.html</guid><wfw:comment>http://www.kffa.tw/guijie/comments/216230.html</wfw:comment><comments>http://www.kffa.tw/guijie/archive/2019/02/02/216230.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.kffa.tw/guijie/comments/commentRss/216230.html</wfw:commentRss><trackback:ping>http://www.kffa.tw/guijie/services/trackbacks/216230.html</trackback:ping><description><![CDATA[<div><div style="overflow: hidden; width: 690px; margin: 0px auto; color: #1a1a1a; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "WenQuanYi Micro Hei", sans-serif; font-size: medium; background-color: #ffffff;"><div ztext="" post-richtext"="" style="word-break: break-word; line-height: 1.6; margin-top: 20px;"><p style="margin: 0px 0px 1.4em;">分n一文章:<a wrap="" external"="" target="_blank" rel="nofollow noreferrer" data-za-detail-view-id="1043" style="text-decoration-line: none; cursor: pointer; border-bottom: 1px solid #808080;">The Meaning of Underscores in Python</a>?/p><p style="margin: 1.4em 0px;">本文介绍了Python中单下划U和双下划线Q?dunder"Q的各种含义和命名约定,名称修饰Qname manglingQ的工作原理Q以及它如何影响你自qPythoncR?/p><p style="margin: 1.4em 0px;">单下划线和双下划U在Python变量和方法名UC都各有其含义。有一些含义仅仅是依照U定Q被视作是对E序员的提示 - 而有一些含义是由Python解释器严格执行的?/p><p style="margin: 1.4em 0px;">如果你想知道“Python变量和方法名UC单下划线和双下划U的含义是什么?”Q我会尽我所能在q里Z解答?/p><p style="margin: 1.4em 0px;">在本文中Q我讨Z下五U下划线模式和命名约定,以及它们如何影响PythonE序的行为:</p><ul style="padding: 0px; margin: 1.4em 0px; display: table;"><li style="list-style: none; display: table-row;">单前g划线Q_var</li><li style="list-style: none; display: table-row;">单末下划线Qvar_</li><li style="list-style: none; display: table-row;">双前g划线Q__var</li><li style="list-style: none; display: table-row;">双前导和末尾下划U:__var__</li><li style="list-style: none; display: table-row;">单下划线Q_</li></ul><p style="margin: 1.4em 0px;">在文章结֤Q你可以扑ֈ一个简短的“速查?#8221;Qȝ了五U不同的下划U命名约定及其含义,以及一个简短的视频教程Q可让你亲n体验它们的行为?/p><p style="margin: 1.4em 0px;">让我们马上开始!</p><h2>1. 单前g划线 _var</h2><p style="margin: 1.4em 0px;">当涉及到变量和方法名U时Q单个下划线前缀有一个约定俗成的含义?它是对程序员的一个提C?- 意味着PythonC֌一致认为它应该是什么意思,但程序的行ؓ不受影响?/p><p style="margin: 1.4em 0px;">下划U前~的含义是告知其他E序员:以单个下划线开头的变量或方法仅供内部用?该约定在PEP 8中有定义?/p><p style="margin: 1.4em 0px;">q不是Python强制规定的?Python不像Java那样?#8220;U有”?#8220;公共”变量之间有很强的区别?q就像有人提Z一个小的下划U警告标志,_</p><blockquote style="margin: 1.4em 0px; padding-left: 1em; color: #646464; border-left-width: 3px; border-left-color: #d3d3d3;">“嘿,q不是真的要成ؓcȝ公共接口的一部分。不ȝ它就好?#8220;</blockquote><p style="margin: 1.4em 0px;">看看下面的例子:</p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">class Test: def __init__(self): self.foo = 11 self._bar = 23 </code></pre></div><p style="margin: 1.4em 0px;">如果你实例化此类Qƈ试讉K在__init__构造函C定义的foo和_bar属性,会发生什么情况? 让我们来看看Q?/p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">>>> t = Test() >>> t.foo 11 >>> t._bar 23 </code></pre></div><p style="margin: 1.4em 0px;">你会看到_bar中的单个下划Uƈ没有L我们“q入”cdƈ讉K该变量的倹{?/p><p style="margin: 1.4em 0px;">q是因ؓPython中的单个下划U前~仅仅是一个约?- 臛_相对于变量和Ҏ名而言?/p><p style="margin: 1.4em 0px;">但是Q前g划线的确会媄响从模块中导入名U的方式?/p><p style="margin: 1.4em 0px;">假设你在一个名为my_module的模块中有以下代码:</p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;"># This is my_module.py: def external_func(): return 23 def _internal_func(): return 42 </code></pre></div><p style="margin: 1.4em 0px;">现在Q如果用通配W从模块中导入所有名Uͼ则Python不会导入带有前导下划U的名称Q除非模块定义了覆盖此行为的__all__列表Q:</p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">>>> from my_module import * >>> external_func() 23 >>> _internal_func() NameError: "name '_internal_func' is not defined" </code></pre></div><p style="margin: 1.4em 0px;">Z说一下,应该避免通配W导入,因ؓ它们使名U空间中存在哪些名称不清楚?Z清楚赯Q坚持常规导入更好?br /></p><p style="margin: 1.4em 0px;">与通配W导入不同,常规导入不受前导单个下划U命名约定的影响Q?/p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">>>> import my_module >>> my_module.external_func() 23 >>> my_module._internal_func() 42 </code></pre></div><p style="margin: 1.4em 0px;">我知道这一点可能有点o人困惑?如果你遵循PEP 8推荐Q避免通配W导入,那么你真正需要记住的只有q个Q?/p><blockquote style="margin: 1.4em 0px; padding-left: 1em; color: #646464; border-left-width: 3px; border-left-color: #d3d3d3;">单个下划U是一个Python命名U定Q表C个名U是供内部用的?它通常不由Python解释器强制执行,仅仅作ؓ一U对E序员的提示?/blockquote><h2>2. 单末下划线 var_</h2><p style="margin: 1.4em 0px;">有时候,一个变量的最合适的名称已经被一个关键字所占用?因此Q像class或defq样的名UC能用作Python中的变量名称?在这U情况下Q你可以附加一个下划线来解军_名冲H:</p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">>>> def make_object(name, class): SyntaxError: "invalid syntax" >>> def make_object(name, class_): ... pass </code></pre></div><p style="margin: 1.4em 0px;">MQ单个末下划线Q后~Q是一个约定,用来避免与Python关键字生命名冲H?PEP 8解释了这个约定?/p><h2>3. 双前g划线 __var</h2><p style="margin: 1.4em 0px;">到目前ؓ止,我们所涉及的所有命名模式的含义Q来自于已达成共识的U定?而对于以双下划线开头的Pythoncȝ属性(包括变量和方法)Q情况就有点不同了?/p><p style="margin: 1.4em 0px;">双下划线前缀会导致Python解释器重写属性名Uͼ以避免子cM的命名冲H?/p><p style="margin: 1.4em 0px;">q也叫做名称修饰Qname manglingQ?- 解释器更改变量的名称Q以便在c被扩展的时候不Ҏ产生冲突?/p><p style="margin: 1.4em 0px;">我知道这听v来很抽象?因此Q我l合了一个小的代码CZ来予以说明:</p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">class Test: def __init__(self): self.foo = 11 self._bar = 23 self.__baz = 23 </code></pre></div><p style="margin: 1.4em 0px;">让我们用内置的dir()函数来看看这个对象的属性:</p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">>>> t = Test() >>> dir(t) ['_Test__baz', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_bar', 'foo'] </code></pre></div><p style="margin: 1.4em 0px;">以上是这个对象属性的列表?让我们来看看q个列表QƈL我们的原始变量名UfooQ_bar和__baz - 我保证你会注意到一些有的变化?br /></p><ul style="padding: 0px; margin: 1.4em 0px; display: table;"><li style="list-style: none; display: table-row;">self.foo变量在属性列表中昄为未修改为foo?/li><li style="list-style: none; display: table-row;">self._bar的行为方式相?- 它以_bar的Ş式显C在cM?像我之前说q的Q在q种情况下,前导下划U仅仅是一个约定?l程序员一个提C已?/li><li style="list-style: none; display: table-row;">然而,对于self.__baz而言Q情늜h有点不同?当你在该列表中搜索__bazӞ你会看不到有q个名字的变量?/li></ul><p style="margin: 1.4em 0px;">__bazZ么情况了Q?/p><p style="margin: 1.4em 0px;">如果你仔l观察,你会看到此对象上有一个名为_Test__baz的属性?q就是Python解释器所做的名称修饰?它这样做是ؓ了防止变量在子类中被重写?/p><p style="margin: 1.4em 0px;">让我们创建另一个扩展Testcȝc,q尝试重写构造函Cd的现有属性:</p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">class ExtendedTest(Test): def __init__(self): super().__init__() self.foo = 'overridden' self._bar = 'overridden' self.__baz = 'overridden' </code></pre></div><p style="margin: 1.4em 0px;">现在Q你认ؓfooQ_bar和__baz的g出现在这个ExtendedTestcȝ实例上吗Q?我们来看一看:</p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">>>> t2 = ExtendedTest() >>> t2.foo 'overridden' >>> t2._bar 'overridden' >>> t2.__baz AttributeError: "'ExtendedTest' object has no attribute '__baz'" </code></pre></div><p style="margin: 1.4em 0px;">{一下,当我们尝试查看t2 .__ baz的值时Qؓ什么我们会得到AttributeErrorQ?名称修饰被再ơ触发了Q?事实证明Q这个对象甚x有__baz属性:</p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">>>> dir(t2) ['_ExtendedTest__baz', '_Test__baz', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_bar', 'foo', 'get_vars'] </code></pre></div><p style="margin: 1.4em 0px;">正如你可以看到__baz变成_ExtendedTest__baz以防止意外修改:</p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">>>> t2._ExtendedTest__baz 'overridden' </code></pre></div><p style="margin: 1.4em 0px;">但原来的_Test__bazq在Q?/p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">>>> t2._Test__baz 42 </code></pre></div><p style="margin: 1.4em 0px;">双下划线名称修饰对程序员是完全透明的?下面的例子证实了q一点:</p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">class ManglingTest: def __init__(self): self.__mangled = 'hello' def get_mangled(self): return self.__mangled >>> ManglingTest().get_mangled() 'hello' >>> ManglingTest().__mangled AttributeError: "'ManglingTest' object has no attribute '__mangled'" </code></pre></div><p style="margin: 1.4em 0px;">名称修饰是否也适用于方法名Uͼ 是的Q也适用。名UCC影响在一个类的上下文中,以两个下划线字符Q?dunders"Q开头的<span style="font-weight: 600;">所?/span>名称Q?/p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">class MangledMethod: def __method(self): return 42 def call_it(self): return self.__method() >>> MangledMethod().__method() AttributeError: "'MangledMethod' object has no attribute '__method'" >>> MangledMethod().call_it() 42 </code></pre></div><p style="margin: 1.4em 0px;">q是另一个也o人惊讶的q用名称修饰的例子:</p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">_MangledGlobal__mangled = 23 class MangledGlobal: def test(self): return __mangled >>> MangledGlobal().test() 23 </code></pre></div><p style="margin: 1.4em 0px;">在这个例子中Q我声明了一个名为_MangledGlobal__mangled的全局变量。然后我在名为MangledGlobal的类的上下文中访问变量。由于名UC饎ͼ我能够在cȝtest()Ҏ内,以__mangled来引用_MangledGlobal__mangled全局变量?br /><br />Python解释器自动将名称__mangled扩展为_MangledGlobal__mangledQ因为它以两个下划线字符开头。这表明名称修饰不是专门与类属性关联的。它适用于在cM下文中用的两个下划U字W开头的M名称?br /><br />有很多要吸收的内容吧?br /><br />老实_q些例子和解释不是从我脑子里y出来的。我作了一些研I和加工才弄出来。我一直用PythonQ有很多q了Q但是像q样的规则和Ҏ情况q不L现在脑里?br /><br />有时候程序员最重要的技能是“模式识别”Q而且知道在哪里查阅信息。如果您在这一点上感到有点不知所措,请不要担心。慢慢来Q试试这文章中的一些例子?br /><br />让这些概念完全沉怸来,以便你能够理解名UC饰的M思\Q以及我向您展示的一些其他的行ؓ。如果有一天你和它们不期而遇Q你会知道在文档中按什么来查?/p><h2>4. 双前导和双末下划线 _var_</h2><p style="margin: 1.4em 0px;">也许令h惊讶的是Q如果一个名字同时以双下划线开始和l束Q则不会应用名称修饰?由双下划U前~和后~包围的变量不会被Python解释器修改:</p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">class PrefixPostfixTest: def __init__(self): self.__bam__ = 42 >>> PrefixPostfixTest().__bam__ 42 </code></pre></div><p style="margin: 1.4em 0px;">但是QPython保留了有双前导和双末下划线的名Uͼ用于Ҏ用途?q样的例子有Q__init__对象构造函敎ͼ或__call__ --- 它得一个对象可以被调用?/p><p style="margin: 1.4em 0px;">q些dunderҎ通常被称为神奇方?- 但PythonC֌中的许多人(包括我自己)都不喜欢q种Ҏ?/p><p style="margin: 1.4em 0px;">最好避免在自己的程序中使用以双下划U(“dunders”Q开头和l尾的名Uͼ以避免与来Python语言的变化生冲H?/p><h2>5.单下划线 _</h2><p style="margin: 1.4em 0px;">按照习惯Q有时候单个独立下划线是用作一个名字,来表C某个变量是临时的或无关紧要的?br /></p><p style="margin: 1.4em 0px;">例如Q在下面的@环中Q我们不需要访问正在运行的索引Q我们可以?#8220;_”来表C它只是一个时|</p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">>>> for _ in range(32): ... print('Hello, World.') </code></pre></div><p style="margin: 1.4em 0px;">你也可以在拆?unpacking)表达式中单个下划线用作“不关心的”变量Q以忽略特定的倹{?同样Q这个含义只?#8220;依照U定”Qƈ不会在Python解释器中触发Ҏ的行为?单个下划U仅仅是一个有效的变量名称Q会有这个用途而已?/p><p style="margin: 1.4em 0px;">在下面的代码CZ中,我将汽R元组拆分为单独的变量Q但我只寚w色和里程值感兴趣?但是Qؓ了拆分表达式成功运行,我需要将包含在元l中的所有值分配给变量?在这U情况下Q?#8220;_”作ؓ占位W变量可以派上用场:</p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">>>> car = ('red', 'auto', 12, 3812.4) >>> color, _, _, mileage = car >>> color 'red' >>> mileage 3812.4 >>> _ 12 </code></pre></div><p style="margin: 1.4em 0px;">除了用作临时变量之外Q?#8220;_”是大多数Python REPL中的一个特D变量,它表C由解释器评估的最q一个表辑ּ的结果?/p><p style="margin: 1.4em 0px;">q样很方便了,比如你可以在一个解释器会话中访问先前计的l果Q或者,你是在动态构建多个对象ƈ与它们交互,无需事先l这些对象分配名字:</p><div style="margin: 1em 0px;"><pre style="margin-top: 0px; margin-bottom: 0px; padding: calc(0.888889em); font-size: 0.9em; word-break: initial; overflow-wrap: initial; overflow: auto; background: #f6f6f6; border-radius: 4px;"><code style="margin: 0px; padding: 0px; border-radius: 0px; font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace; font-size: inherit; background-color: inherit;">>>> 20 + 3 23 >>> _ 23 >>> print(_) 23 >>> list() [] >>> _.append(1) >>> _.append(2) >>> _.append(3) >>> _ [1, 2, 3] </code></pre></div><h2>Python下划U命名模?- 结</h2><p style="margin: 1.4em 0px;">以下是一个简短的结Q即“速查?#8221;Q罗列了我在本文中谈到的五种Python下划U模式的含义Q?/p><figure style="margin: 1.4em 0px;"><img src="https://pic3.zhimg.com/80/v2-cbc5c6037101c7d33cf0acd9f00a8cfa_hd.jpg" data-caption="" data-size="normal" data-rawwidth="732" data-rawheight="314" zh-lightbox-thumb="" lazy"="" width="732" data-original="https://pic3.zhimg.com/v2-cbc5c6037101c7d33cf0acd9f00a8cfa_r.jpg" data-actualsrc="https://pic3.zhimg.com/v2-cbc5c6037101c7d33cf0acd9f00a8cfa_b.jpg" style="display: block; max-width: 100%; margin: 0px auto; cursor: zoom-in;" alt="" /></figure><hr style="margin: 4em auto; width: 240px; max-width: 100%; border-right: none; border-bottom: none; border-left: none; border-image: initial; border-top-style: solid; border-top-color: #d3d3d3;" /><p style="margin: 1.4em 0px;">你想更深入了解学习Python知识体系Q你可以看一下我们花费了一个多月整理了上百时的几百个知识点体pd容:</p><p style="margin: 1.4em 0px 0px;"><a wrap="" external"="" target="_blank" rel="nofollow noreferrer" data-za-detail-view-id="1043" style="text-decoration-line: none; cursor: pointer; border-bottom: 1px solid #808080;">【超全整理】《Python自动化全能开发从入门到精通》python基础教程W记</a></p></div></div><div style="margin: 0px auto; color: #8590a6; padding-top: 16px; padding-bottom: 16px; overflow: hidden; width: 690px; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "WenQuanYi Micro Hei", sans-serif; background-color: #ffffff;">发布?2018-04-26</div><div style="overflow: hidden; width: 690px; margin: 0px auto; display: flex; color: #1a1a1a; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "WenQuanYi Micro Hei", sans-serif; font-size: medium; background-color: #ffffff;"><div post-topics"="" style="display: flex; flex-flow: row wrap; align-items: center; margin-bottom: -10px; padding-top: 16px; padding-bottom: 16px;"><div topic"="" data-za-detail-view-path-module="TopicItem" data-za-extra-module="{"card":{"content":{"type":"Topic","token":"19552832"}}}" style="position: relative; display: inline-block; height: 33px; padding-right: 12px; padding-left: 12px; font-size: 13px; line-height: 33px; color: #0084ff; vertical-align: top; border-radius: 100px; background: rgba(0, 132, 255, 0.1); margin-right: 5px; overflow: hidden; margin-bottom: 10px;"><a target="_blank" style="text-decoration-line: none;"><div style="position: relative; display: inline-block;"><div id="Popover3-toggle" aria-haspopup="true" aria-expanded="false" aria-owns="Popover3-content">Python</div></div></a></div></div></div><br />Reference:<br />https://zhuanlan.zhihu.com/p/36173202</div><img src ="http://www.kffa.tw/guijie/aggbug/216230.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.kffa.tw/guijie/" target="_blank">杰哥</a> 2019-02-02 01:51 <a href="http://www.kffa.tw/guijie/archive/2019/02/02/216230.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转蝲]ls command not found http://www.kffa.tw/guijie/archive/2019/01/23/216218.html杰哥杰哥Tue, 22 Jan 2019 16:47:00 GMThttp://www.kffa.tw/guijie/archive/2019/01/23/216218.htmlhttp://www.kffa.tw/guijie/comments/216218.htmlhttp://www.kffa.tw/guijie/archive/2019/01/23/216218.html#Feedback0http://www.kffa.tw/guijie/comments/commentRss/216218.htmlhttp://www.kffa.tw/guijie/services/trackbacks/216218.html今天在搭建编译环境的时候出C一炚w题,自己的ls命o不好用了Q百度一下找C正解Q?x BaiDuQ?/p>
    原因Q在讄环境变量Ӟ~辑profile文g没有写正,D在命令行?ls{命令不能够识别?br />解决ҎQ在命o行下打入下面q段可以了
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin


本文是作者原创,转蝲必须保证文章的完整性ƈ标明出处Qblog.sina.com.cn/xywaterskyQ,请尊重作者,支持原创?/strong>



杰哥 2019-01-23 00:47 发表评论
]]>
Google Dochttp://www.kffa.tw/guijie/archive/2019/01/17/216205.html杰哥杰哥Wed, 16 Jan 2019 20:09:00 GMThttp://www.kffa.tw/guijie/archive/2019/01/17/216205.htmlhttp://www.kffa.tw/guijie/comments/216205.htmlhttp://www.kffa.tw/guijie/archive/2019/01/17/216205.html#Feedback0http://www.kffa.tw/guijie/comments/commentRss/216205.htmlhttp://www.kffa.tw/guijie/services/trackbacks/216205.htmlGoogle办公室套Ӟ是Google的一个在U文字处理、电子表格和演示E序?006q?0?0日GoogleWritely与旗下Google Spreadsheets集成为Google文档Q它的第三个lgQ演C功能,在引入Tonic Systems所开发的而技术之后于2007q??7日发布?/span> l基癄

G
oogle search: Google Doc and you will get it. If you open a docx file, you input the emails of other people and can "share(׃n)". You can select "可以~辑", "可以查看", and "可以评论".

In my flagged email (20181006), "our previous reading list", how to create this? In google doc, in the top left corner, select "表格", "新徏电子表格". Then share the "表格" to the people you want to share. Only the people who you share the link can see this. Sui Li send me a test docx on 20190116 (test in my google doc), then I can receive the email reminder. When I revise this document, I do not have to save this file. If I want to see the revising history, click the last menu. You can see that the color of different people's writing is different.
This is with Sui Li's help.

We can also use "腾讯文档". I logged into this on my computer using my webchat account on January 21, 2019.


杰哥 2019-01-17 04:09 发表评论
]]>
Githubhttp://www.kffa.tw/guijie/archive/2019/01/15/216200.html杰哥杰哥Mon, 14 Jan 2019 20:16:00 GMThttp://www.kffa.tw/guijie/archive/2019/01/15/216200.htmlhttp://www.kffa.tw/guijie/comments/216200.htmlhttp://www.kffa.tw/guijie/archive/2019/01/15/216200.html#Feedback0http://www.kffa.tw/guijie/comments/commentRss/216200.htmlhttp://www.kffa.tw/guijie/services/trackbacks/216200.html
例如"PyTorch_tutorial_0.0.5"的pytorch的第八页Code/1_data_prepare/1_1_cifar10_to_png.py,Z么Github?链接另存?与Clone or download出来的有区别?链接另存然保存的也是.py文gQ再在此文g后加?html后缀Q打开是该网,保存的实际是|页

h搜烦: Github difference clone download
When you clone you get a copy of the history and it is a functional git repo. Downloading a repository just downloads the files from the most recent commit of the default branch. It doesn't download any of the files in the .git folder. ... It's as ifgit never existed, and all you have is a copy of the code/files.
Zhengxia said, if you clone a project, you can have v1, v2 and the most recent version. If you download a project, you can only have the 
most recent version. 

怎么clone,没什么特别讲I吧,q有|址? 
This is with Zhengxia's help.


杰哥 2019-01-15 04:16 发表评论
]]>
[zz]正定、超定、欠定矩?/title><link>http://www.kffa.tw/guijie/archive/2019/01/12/216191.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Fri, 11 Jan 2019 18:43:00 GMT</pubDate><guid>http://www.kffa.tw/guijie/archive/2019/01/12/216191.html</guid><wfw:comment>http://www.kffa.tw/guijie/comments/216191.html</wfw:comment><comments>http://www.kffa.tw/guijie/archive/2019/01/12/216191.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.kffa.tw/guijie/comments/commentRss/216191.html</wfw:commentRss><trackback:ping>http://www.kffa.tw/guijie/services/trackbacks/216191.html</trackback:ping><description><![CDATA[<div>正定、超定、欠定矩?/div><div>正定</div><div>定义</div><div>q义定义</div><div>设M是n阶方阵,如果对Q何非零向量zQ都?z′Mz>0z′Mz>0Q其中z’ 表示z的{|,qM正定矩阵。[1] </div><div>例如QB为n阶矩阵,E为单位矩阵,a为正实数。aE+BaE+B在a充分大时QaE+BaE+B为正定矩c(B必须为对U阵Q?/div><div></div><div>狭义定义</div><div>一个n阶的实对U矩阵M是正定的当且仅当对于所有的非零实系数向量zQ都有z′Mz>0z′Mz>0。其中z’表示z的{|?/div><div></div><div>性质</div><div>正定矩阵在合同变换下可化为标准型Q?卛_位矩c?/div><div></div><div>合同矩阵Q两个实对称矩阵A和BQ如存在可逆矩阵PQ得A=PTBPA=PTBPQ就U矩阵A和B互ؓ合同矩阵Qƈ且称由A到B的变换叫合同变换?/div><div></div><div>所有特征值大于零的对U矩阵(或厄c矩阵)是正定矩c?/div><div></div><div>判定定理1Q对U阵A为正定的充分必要条g是:A的特征值全为正?nbsp;</div><div>判定定理2Q对U阵A为正定的充分必要条g是:A的各阉序主子式都ؓ正?nbsp;</div><div>判定定理3QQ意阵A为正定的充分必要条g是:A合同于单位阵?/div><div></div><div>1.正定矩阵一定是非奇异的。非奇异矩阵的定义:若n阶矩阵A的行列式不ؓӞ即|A|≠0|A|≠0?nbsp;</div><div>2.正定矩阵的Q一d矩阵也是正定矩阵?nbsp;</div><div>3.若A为n阶对U正定矩阵,则存在唯一的主对角U元素都是正数的下三角阵LQ得A=L∗L'A=L∗L′Q此分解式称?正定矩阵的乔列斯基(CholeskyQ分解?nbsp;</div><div>4.若A为n阶正定矩阵,则A为n阶可逆矩c?/div><div></div><div>矩阵的每一行代表一个方E,m行代表m个线性联立方E?n列代表n个变量。如果m是独立方E数Q根据m</div><div></div><div>定方程l?/div><div>方程个数大于未知量个数的方程l?/div><div></div><div>对于方程l?Ra=yRa=yQR为n×mn×m矩阵Q如果R列满U,且n>mn>m?/div><div></div><div>定方程一般是不存在解的矛盾方E?/div><div></div><div>例如Q如果给定的三点不在一条直U上Q我们将无法得到q样一条直U,使得q条直线同时l过l定q三个点?也就是说l定的条Ӟ限制Q过于严| D解不存在。在实验数据处理和曲U拟合问题中Q求解超定方E组非常普遍。比较常用的Ҏ是最二乘法。Ş象的_是在无法完全满给定的q些条g的情况下Q求一个最接近的解?/div><div></div><div>曲线拟合的最二乘法要解决的问题Q实际上是求以上超定方E组的最二乘解的问题?/div><div></div><div>Ơ定方程l?/div><div>方程个数于未知量个数的方程l?/div><div></div><div>对于方程lRa=yRa=yQRR为n×mn×m 矩阵Q且n<mn<m。则方程l有无穷多组解,此时U方E组为欠定方E组?/div><div></div><div>内点法和梯度投媄法是目前解欠定方E组的常用方法?/div><div>--------------------- </div><div>原文Qhttps://blog.csdn.net/hfdwdjl/article/details/44133845 <br /><br />评论:Ơ定方程Q?span style="font-family: 楷体;">q种定义不太严格Q因?/span><span style="font-family: "Times New Roman", serif;">n<m</span><span style="font-family: 楷体;">未必有无I多解,极端例子</span><span style="font-family: "Times New Roman", serif;">,x+y+z=1</span><span style="font-family: 楷体;">?/span><span style="font-family: "Times New Roman", serif;">x+y+z=3</span><span style="font-family: 楷体;">Q两个方E,三个未知敎ͼ无解?/span></div> <span style="font-size: 10.5pt; font-family: 楷体;">q是要应该要用到the notes of linear algebra </span><span style="font-size:10.5pt;font-family:"Times New Roman",serif;">P41反页。下面维Zq个应该是严格的Q有无穷多解的就叫欠定?br /></span>https://zh.wikipedia.org/wiki/%E7%BA%BF%E6%80%A7%E6%96%B9%E7%A8%8B%E7%BB%84<img src ="http://www.kffa.tw/guijie/aggbug/216191.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.kffa.tw/guijie/" target="_blank">杰哥</a> 2019-01-12 02:43 <a href="http://www.kffa.tw/guijie/archive/2019/01/12/216191.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[zz]Python3中map函数的问?/title><link>http://www.kffa.tw/guijie/archive/2019/01/03/216164.html</link><dc:creator>杰哥</dc:creator><author>杰哥</author><pubDate>Thu, 03 Jan 2019 04:01:00 GMT</pubDate><guid>http://www.kffa.tw/guijie/archive/2019/01/03/216164.html</guid><wfw:comment>http://www.kffa.tw/guijie/comments/216164.html</wfw:comment><comments>http://www.kffa.tw/guijie/archive/2019/01/03/216164.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.kffa.tw/guijie/comments/commentRss/216164.html</wfw:commentRss><trackback:ping>http://www.kffa.tw/guijie/services/trackbacks/216164.html</trackback:ping><description><![CDATA[<div>Python3中map函数</div><div>在Python2中map函数会返回一个list列表Q如代码Q?/div><div>>>> def f(x, y): return (x, y)</div><div>>>> l1 = [ 0, 1, 2, 3, 4, 5, 6 ]</div><div>>>> l2 = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ]</div><div></div><div>q回l果如下Q?/div><div>>>> map(f, l1, l2)</div><div>[(0, 'Sun'), (1, 'Mon'), (2, 'Tue'), (3, 'Wed'), (4, 'Thu'), (5, 'Fri'), (6, 'Sat')]</div><div></div><div>但是Q在Python3中返回结果如下:</div><div>>>> map(f1, l1, l2)</div><div><map object at 0x00000000021DA860></div><div></div><div>如果惌得到Python2的那U结果,卌回list列表Q那么必ȝlist作用于mapQ如下:</div><div>>>> list(map(f1, l1, l2))</div><div>[(0, 'Sun'), (1, 'Mon'), (2, 'Tue'), (3, 'Wed'), (4, 'Thu'), (5, 'Fri'), (6, 'Sat')]<br /><br />reference:<br /><div>https://blog.csdn.net/u010376788/article/details/48230257</div></div><img src ="http://www.kffa.tw/guijie/aggbug/216164.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.kffa.tw/guijie/" target="_blank">杰哥</a> 2019-01-03 12:01 <a href="http://www.kffa.tw/guijie/archive/2019/01/03/216164.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[zz]python求数字位数的Ҏhttp://www.kffa.tw/guijie/archive/2018/12/29/216152.html杰哥杰哥Sat, 29 Dec 2018 06:00:00 GMThttp://www.kffa.tw/guijie/archive/2018/12/29/216152.htmlhttp://www.kffa.tw/guijie/comments/216152.htmlhttp://www.kffa.tw/guijie/archive/2018/12/29/216152.html#Feedback0http://www.kffa.tw/guijie/comments/commentRss/216152.htmlhttp://www.kffa.tw/guijie/services/trackbacks/216152.htmlW一U:
利用str()函数数字{化成字符Ԍ再利用len()函数判断位长?/p>
 1 a=Int(raw_input("the number you want type in:")   
2
b=len(str(a))
3
print b

W二U:
利用?0取商Q通过循环ơ数判断位数?/p>

c=0
a=int(raw_input("the number you want type in:"))
while a!=0:
      a=a/10
      c +=1
print c


Reference:

https://www.cnblogs.com/54Leo/p/6133270.html


杰哥 2018-12-29 14:00 发表评论
]]>
colabhttp://www.kffa.tw/guijie/archive/2018/12/21/216130.html杰哥杰哥Fri, 21 Dec 2018 01:07:00 GMThttp://www.kffa.tw/guijie/archive/2018/12/21/216130.htmlhttp://www.kffa.tw/guijie/comments/216130.htmlhttp://www.kffa.tw/guijie/archive/2018/12/21/216130.html#Feedback0http://www.kffa.tw/guijie/comments/commentRss/216130.htmlhttp://www.kffa.tw/guijie/services/trackbacks/216130.html
How to create a folder in colab? h搜烦: colab new folder扑ֈq个链接: https://medium.com/lean-in-women-in-tech-india/google-colab-the-beginners-guide-5ad3b417dfa
Create a Colab Notebook
Open Google Colab.
Click on ‘New Notebook’ and select Python 2 notebook or Python 3 notebook.
OR
Open Google Drive.
Create a new folder for the project.
Click on ‘New’ > ‘More’ > ‘Colaboratory’.
Google Drive -> 我的云端盘 -> 新徏文g? Click on ‘New’ > ‘More’ > ‘Colaboratory’,q个怎么操作? 例如选中"02_backprop.ipynb", 打开方式, 兌更多应用, 选择colab. q样在google drive里就可以选中"02_backprop.ipynb", 打开方式, ‘Colaboratory’卛_.但直接打开Colab, Google drive里面是没?02_backprop.ipynb", Recent有。暂不折腾这个问? Zhengxia说colab应该会删,否则大家都把它当|盘使用

02_backprop.ipynb, 最开始Forward propagation上面, device改ؓGPU (device = torch.device('cuda') # Uncomment this to run on GPU),没法q行原因? zhengxia says: Edit -> Notepad settings -> select GPU.如果一个新电脑Q你肯定要自己配|下cuda和cudnnQ谷歌胦大气_,相当q些都帮你做好了?/div>


杰哥 2018-12-21 09:07 发表评论
]]>
<var id="pl157"></var>
<cite id="pl157"><noframes id="pl157"><thead id="pl157"><strike id="pl157"><progress id="pl157"></progress></strike></thead>
<var id="pl157"><span id="pl157"></span></var>
<var id="pl157"><video id="pl157"><menuitem id="pl157"></menuitem></video></var>
<cite id="pl157"><video id="pl157"></video></cite><ins id="pl157"></ins>
<cite id="pl157"><video id="pl157"><menuitem id="pl157"></menuitem></video></cite>
<cite id="pl157"><span id="pl157"></span></cite><var id="pl157"><video id="pl157"><thead id="pl157"></thead></video></var>
<cite id="pl157"><video id="pl157"><menuitem id="pl157"></menuitem></video></cite>
<var id="pl157"><span id="pl157"><menuitem id="pl157"></menuitem></span></var><cite id="pl157"><span id="pl157"><var id="pl157"></var></span></cite>
<var id="pl157"><span id="pl157"></span></var>
<ins id="pl157"><span id="pl157"></span></ins>
<ins id="pl157"><video id="pl157"></video></ins><ins id="pl157"></ins>
<var id="pl157"></var> <cite id="pl157"><video id="pl157"><menuitem id="pl157"></menuitem></video></cite>
<ins id="pl157"></ins>
<ins id="pl157"></ins>
<var id="pl157"></var>
<cite id="pl157"></cite><del id="pl157"></del>
<cite id="pl157"><video id="pl157"></video></cite>
<menuitem id="pl157"></menuitem>
<var id="pl157"></var>
<menuitem id="pl157"></menuitem>
<cite id="pl157"></cite>
<progress id="pl157"><ruby id="pl157"><th id="pl157"></th></ruby></progress><var id="pl157"></var>
<ins id="pl157"><noframes id="pl157"><var id="pl157"></var>
<ins id="pl157"><span id="pl157"></span></ins><cite id="pl157"></cite>
<cite id="pl157"><span id="pl157"></span></cite>
3׬Ǯ
<var id="pl157"></var>
<cite id="pl157"><noframes id="pl157"><thead id="pl157"><strike id="pl157"><progress id="pl157"></progress></strike></thead>
<var id="pl157"><span id="pl157"></span></var>
<var id="pl157"><video id="pl157"><menuitem id="pl157"></menuitem></video></var>
<cite id="pl157"><video id="pl157"></video></cite><ins id="pl157"></ins>
<cite id="pl157"><video id="pl157"><menuitem id="pl157"></menuitem></video></cite>
<cite id="pl157"><span id="pl157"></span></cite><var id="pl157"><video id="pl157"><thead id="pl157"></thead></video></var>
<cite id="pl157"><video id="pl157"><menuitem id="pl157"></menuitem></video></cite>
<var id="pl157"><span id="pl157"><menuitem id="pl157"></menuitem></span></var><cite id="pl157"><span id="pl157"><var id="pl157"></var></span></cite>
<var id="pl157"><span id="pl157"></span></var>
<ins id="pl157"><span id="pl157"></span></ins>
<ins id="pl157"><video id="pl157"></video></ins><ins id="pl157"></ins>
<var id="pl157"></var> <cite id="pl157"><video id="pl157"><menuitem id="pl157"></menuitem></video></cite>
<ins id="pl157"></ins>
<ins id="pl157"></ins>
<var id="pl157"></var>
<cite id="pl157"></cite><del id="pl157"></del>
<cite id="pl157"><video id="pl157"></video></cite>
<menuitem id="pl157"></menuitem>
<var id="pl157"></var>
<menuitem id="pl157"></menuitem>
<cite id="pl157"></cite>
<progress id="pl157"><ruby id="pl157"><th id="pl157"></th></ruby></progress><var id="pl157"></var>
<ins id="pl157"><noframes id="pl157"><var id="pl157"></var>
<ins id="pl157"><span id="pl157"></span></ins><cite id="pl157"></cite>
<cite id="pl157"><span id="pl157"></span></cite>
<var id="pl157"></var>
<cite id="pl157"><noframes id="pl157"><thead id="pl157"><strike id="pl157"><progress id="pl157"></progress></strike></thead>
<var id="pl157"><span id="pl157"></span></var>
<var id="pl157"><video id="pl157"><menuitem id="pl157"></menuitem></video></var>
<cite id="pl157"><video id="pl157"></video></cite><ins id="pl157"></ins>
<cite id="pl157"><video id="pl157"><menuitem id="pl157"></menuitem></video></cite>
<cite id="pl157"><span id="pl157"></span></cite><var id="pl157"><video id="pl157"><thead id="pl157"></thead></video></var>
<cite id="pl157"><video id="pl157"><menuitem id="pl157"></menuitem></video></cite>
<var id="pl157"><span id="pl157"><menuitem id="pl157"></menuitem></span></var><cite id="pl157"><span id="pl157"><var id="pl157"></var></span></cite>
<var id="pl157"><span id="pl157"></span></var>
<ins id="pl157"><span id="pl157"></span></ins>
<ins id="pl157"><video id="pl157"></video></ins><ins id="pl157"></ins>
<var id="pl157"></var> <cite id="pl157"><video id="pl157"><menuitem id="pl157"></menuitem></video></cite>
<ins id="pl157"></ins>
<ins id="pl157"></ins>
<var id="pl157"></var>
<cite id="pl157"></cite><del id="pl157"></del>
<cite id="pl157"><video id="pl157"></video></cite>
<menuitem id="pl157"></menuitem>
<var id="pl157"></var>
<menuitem id="pl157"></menuitem>
<cite id="pl157"></cite>
<progress id="pl157"><ruby id="pl157"><th id="pl157"></th></ruby></progress><var id="pl157"></var>
<ins id="pl157"><noframes id="pl157"><var id="pl157"></var>
<ins id="pl157"><span id="pl157"></span></ins><cite id="pl157"></cite>
<cite id="pl157"><span id="pl157"></span></cite>