
blog.tonychow.me
TonychowPython 中有好几种容器或者序列类型:list tuple dict set str,对于这些类型中的内容,往往需要一种方式去遍历获取它们来进行操作。所以 Python 提供了迭代器的类型来对这些类型的内容进行迭代遍历,迭代类型新增于 Python 2.2。 …
http://blog.tonychow.me/
Python 中有好几种容器或者序列类型:list tuple dict set str,对于这些类型中的内容,往往需要一种方式去遍历获取它们来进行操作。所以 Python 提供了迭代器的类型来对这些类型的内容进行迭代遍历,迭代类型新增于 Python 2.2。 …
http://blog.tonychow.me/
TODAY'S RATING
>1,000,000
Date Range
HIGHEST TRAFFIC ON
Saturday
LOAD TIME
1.1 seconds
PAGES IN
THIS WEBSITE
7
SSL
EXTERNAL LINKS
20
SITE IP
23.235.46.133
LOAD TIME
1.144 sec
SCORE
6.2
Tonychow | blog.tonychow.me Reviews
https://blog.tonychow.me
Python 中有好几种容器或者序列类型:list tuple dict set str,对于这些类型中的内容,往往需要一种方式去遍历获取它们来进行操作。所以 Python 提供了迭代器的类型来对这些类型的内容进行迭代遍历,迭代类型新增于 Python 2.2。 …
Python 核心编程读书笔记 Day5 - Tonychow
http://blog.tonychow.me/blog/2014/07/16/corepython-reading-notes-day5
今天的内容是 Python 中的面向对象和 Python 的执行环境。 Python 支持 OOP,虽然很多情况下 Python 直接写函数就可 可以解决大部分的问题,但是 OOP 也是 Python 中的一个重要内容。 本章的内容是 Python 的面向对象编程,具体来说,讲述了 Python 中关于类和 OOP 的具体内容,包括继承,类的方法等 内容,同时也涉及了 Python 中的特殊方法等类的内容。 1Python 中的实例方法都存在着第一个参数为 self 指示这个实例本身. 2Python 中的类方法存在着第一个参数为 cls 通常指示这个类本身. New (cls,.). Init (self,.). 是实例的析构方法,只有在真正需要对该实例进行释放内存的时候才会调用,在 Python 中也就是意味着该 实例的引用计数为 0,进行垃圾回收操作. Super(Cls, instance).method(). 13Old-style 类的 MRO 顺序是深度优先地搜索,直到找到,New-style 类的 MRO 顺序是广度优先搜索. Laquo; Python 核心编程读书笔记 Day4.
Tonychow
http://blog.tonychow.me/blog/page/2
今天阅读的章节是 8 和 9 章,前面的章节已经介绍了 Python 的基本的数据类型,这两章分别介绍了 Python 的条件 循环语句和文件类型。 这章主要就是介绍 Python 中的条件和循环语句,Python 中的条件语句有 if-else,而循环则有 while 和 for。 1if 语句有 if-else 和 if-elif-elif-else 模式. 2Python 中也存在条件表达式,和其他语言的不同,是利用 if 实现的 X if C else Y. 3Python 中的 while 和其他语言的类似,而 for 循环则不一样,for 循环可以遍历可迭代对象. 4在遍历迭代器的时候,for 循环会调用迭代器的 next 方法,并且在遇到 StopIteration 异常结束遍历. 5range(start, stop, step=1) 函数可以生成一个列表. 6sorted 和 zip 函数返回一个列表,而 reversed 和 enumerate 函数则返回一个迭代器. 7else 同样可以用在 while 和 for 循环语句中,在循环结束后执行,break 则会跳出这个 else.
Python 核心编程读书笔记 Day7 - Tonychow
http://blog.tonychow.me/blog/2014/07/18/corepython-reading-notes-day7
今天把剩下的 20-23 章的内容阅读完毕了,这几章也是与 Python 相关的高级内容,包括 Web 编程,数据库接口和 Python 扩展等内容,下面稍微总结下每章的内容。 这一章所谓的 Web 编程内容实际上讲的是利用 urllib 模块进行的 Web 相关的编程,同时也讲到了利用 cgi 模块进行的 原始的 cgi 编程。 从内容来说的话主要介绍了 urllib 和 cgi 模块的一些使用。 Cgi 是比较早期的服务器处理客户端的 请求的方式,目前的 Python Web 编程已经不使用这种技术了。 此外,鉴于 HTTP 协议的无状态性质,可以利用 cookie 的方式来在客户端和服务器端进行一定的状态判断。 Python 关于数据库这方面的内容,有一点让我觉得很牛逼的就是,它统一了一个数据库接口,也就是 PEP249 中规定的 Python 的 DB-API。 这里讲到的扩展 Python 主要讲的是针对 CPython 的扩展。 因为 CPython 的实现语言是 C ,所以我们也可以根据一定的方式,编写 C 语言程序,扩展 CPython 的功能。
Python 核心编程读书笔记 Day4 - Tonychow
http://blog.tonychow.me/blog/2014/07/15/corepython-reading-notes-day4
今天的主要阅读了 10-12 章的内容,这三章内容主要涉及异常,函数及模块,这几个模块 也是 Python 中比较重要的基本内容,也有相对于其他语言的独特之处,下面继续总结今 天的阅读笔记。 2Python 异常的检测可以通过 try 语句进行,通常有 try-excetpt,try-finally模式. 3try 语句可以带多个 except ,可以处理多种异常,也可以直接多个异常放在一个元组 中. 4except Exception[, reason]. 5try-except 同样也支持 else 子句,不发生异常则执行 else 子句的语句. 具有三个参数,exc type, exc value, exc traceback. 函数在 Python 中其实也是一个对象,保存了函数的相关内容,所以在 Python 中,函 数也和普通的对象一样,可以传给一个函数,也可以作为函数的返回值返回,因此也导 至了 Python 支持一部分函数式编程的特性。 1Python 中的函数即使没有 return 语句,也会默认返回值为 None. Laquo; Python 核心编程读书笔记 Day3.
关于 Python iterator 协议的一点思考 - Tonychow
http://blog.tonychow.me/blog/2015/04/06/something-about-python-iterator-protocol
关于 Python Iterator 协议的一点思考. 所以 Python 提供了迭代器的类型来对这些类型的内容进行迭代遍历,迭代类型新增于 Python 2.2。 迭代器类型指的是遵循迭代器协议的类型,对于 Python2.x 版本来说就是实现了. Container. iter (). Python 的迭代器协议统一了 Python 中容器对象进行迭代的方式,另一方面来说,也为用户自定义类型添加迭代的功能添加了方便的实现方式,所以无论是从语言的标准化来说还是从用户使用角度的来说都是非常有用的一个协议。 Laquo; Python 核心编程读书笔记 Day7. 关于 Python Iterator 协议的一点思考.
TOTAL PAGES IN THIS WEBSITE
7
无知的 TonySeek
https://blog.tonyseek.com/category/networking
2012 年 03 月 14 日. Read On ↵.
无知的 TonySeek
https://blog.tonyseek.com/page/2
2013 年 05 月 28 日. 原文 Neil Schemenauer nas at python dot ca 2008-06-23. 翻译 TonySeek tonyseek at gmail dot com 2013-03-17. 原文地址 http:/ python.ca/scgi/protocol.txt. Read On ↵. 2013 年 05 月 19 日. Read On ↵. 2013 年 03 月 28 日. Silent Hill (在 Hong Kong Museum of Art 香港藝術館). Read On ↵. 2013 年 03 月 24 日. 安卓 (在 西汉南越王博物馆 - The Museum of The Nanyue King Mausoleum). Read On ↵. 2013 年 03 月 24 日. 五羊 (在 五羊雕塑 Five Goats Statue). Read On ↵. 2013 年 02 月 27 日. Read On ↵. 2013 年 02 月 05 日. Read On ↵. 2012 年 11 月 28 日.
无知的 TonySeek Archive
https://blog.tonyseek.com/archives
GraphQL vs RESTful API 的一些想法. 杀死 subprocess.Popen 的子子孙孙. Flask 的 Context 机制. 为 C/C 库定制 Python Binding. Welcome to Silent Hill (深圳大学). 小疼同学的希德 (Douban Office 豆瓣). 夜 798 路灯 (D-Park). 空空的楼下 (豆瓣 Douban Inc.). 这周一搬到了一楼 (豆瓣 Douban Inc.). 深夜 - B 区 (使用Instagram 拍摄于 豆瓣). 慎用异步 WSGI Server 运行 Flask 应用. 控制反转 (IoC) 和依赖注入 (DI). 对 Python Web 框架 Flask 的一些个人评价. 转载] 外交学者 蒋学勤 胡锦涛的遗产. 在 Python 中实现 Ruby 的 Open Class 和特异方法. Python 中 print 语句的诡异用法. 总结 XSS 与 CSRF 两种跨站攻击. GraphQL vs RESTful API 的一些想法. Flask 的 Context 机制.
为 C/C++ 库定制 Python Binding
https://blog.tonyseek.com/post/make-python-binding-for-c-library
为 C/C 库定制 Python Binding. 2013 年 12 月 10 日. 可能因为性能原因需要自己编写一部分 C 代码,可能因为需要的第三方库是 C/C 编写的。 直接 port 到 Python 上. 实现例子: https:/ github.com/CNBorn/pytclip. Tclip 是使用 OpenCV 实现的,所以一个可行的途径是直接使用 OpenCV 的 Python Binding,将逻辑在 Python 中实现一遍。 所以如果目标库本身代码比较简单,但是用到了第三方 C/C 库,可以寻找有没有第三方库的 Python Binding。 如果有,可以将逻辑 port 到 Python 上实现。 编写快,只需要编写 Python 代码,不需要写 C/C. 由于将构建过程推给了第三方 Python Binding,所以直接用 setuptools 内置的依赖管理指向 PyPI 上的包即可。 而且最终质量依赖第三方 Python Binding 库的质量。 使用 CPython ABI 绑定. 实现例子: https:/ github.com/xtao/tclip.
C 语言程序设计笔记
https://blog.tonyseek.com/post/the-learning-summary-of-c-programming
2013 年 05 月 19 日. 用 C 语言读取一个文件,当然可以用 POSIX 系统调用. 不过如果想兼容其他非 POSIX 平台,比如 Windows,比如某些特定的嵌入式环境,最好的选择还是使用 ANSI C 的. Alloc read test data. Read test data */. 这段代码在 Linux 下完全工作正常,但是在 OSX 下总是会出现 乱入. Cat test data.txt. What is the answer to life? Test read data test data.txt. What is the answer to life? He answer to life? 为此我搜索了很多资料都未寻到解答,还以为是 OSX 下 libc 的 Bug。 Reads an array of count elements, each one with a size of size bytes, from the stream and stores them in the block of memory specified by ptr.
[翻译] SCGI 协议规格说明书
https://blog.tonyseek.com/post/scgi-protocol-specification
2013 年 05 月 28 日. 原文 Neil Schemenauer nas at python dot ca 2008-06-23. 翻译 TonySeek tonyseek at gmail dot com 2013-03-17. 原文地址 http:/ python.ca/scgi/protocol.txt. SCGI 协议是通用网关协议 CGI 的替代协议,它描述了一套应用程序和 HTTP 服务器之间的接口标准。 例如, 68 65 6c 6c 6f 20 77 6f 72 6c 64 21 是一个长度为 12 的字符串,它和字符串 hello world! 客户端通过一个可靠的流协议连接到 SCGI 服务器,这个流协议允许传输 8 位字节串。 Headers : = header* header : = name NUL value NUL name : = notnull value : = notnull* notnull : = 01 02 03 . ff NUL = 00. 为了促进从 CGI 到 SCGI 的过渡,应该将标准 CGI 环境变量作为 SCGI 的请求头项提供。
无知的 TonySeek
https://blog.tonyseek.com/category/life
2014 年 12 月 31 日. Read On ↵. 2013 年 12 月 31 日. Read On ↵. 2012 年 03 月 20 日. Read On ↵.
无知的 TonySeek
https://blog.tonyseek.com/category/thinking
2012 年 03 月 22 日. Read On ↵.
无知的 TonySeek
https://blog.tonyseek.com/category/photograph
2013 年 03 月 28 日. Silent Hill (在 Hong Kong Museum of Art 香港藝術館). Read On ↵. 2013 年 03 月 24 日. 安卓 (在 西汉南越王博物馆 - The Museum of The Nanyue King Mausoleum). Read On ↵. 2013 年 03 月 24 日. 五羊 (在 五羊雕塑 Five Goats Statue). Read On ↵. 2013 年 02 月 27 日. Read On ↵. Welcome to Silent Hill (深圳大学). 2012 年 11 月 28 日. Read On ↵. 2012 年 11 月 24 日. Read On ↵. 2012 年 11 月 24 日. Read On ↵. 2012 年 11 月 24 日. Read On ↵. 2012 年 11 月 16 日. Read On ↵. 2012 年 11 月 14 日. Read On ↵. Welcome to Silent Hill (深圳大学).
TOTAL LINKS TO THIS WEBSITE
20
Tony Blei Photography |
PLACES TO GO PEOPLE TO SEE. I went looking for trouble. I found it. The American Legislative Exchange Commission is in town and so are the protestors. Today, instead of being at the Westin Kierland, the ALEC demonstrators went to the Salt River Project, a Phoenix based power and water company. A group of protestors chained themselves together inside the public utility’s business office. Outside, protestors were pushed back to the sidewalk as they disrupted business. Friday, December 2nd, 2011. 8221; Some...
tonybox
A blog about things. Doctor Who-Style Wi-Fi With Sentient Captive Portal. So in this week’s episode of Doctor Who, The Bells of Saint John. The enemy is sentient and living inside of the wifi - specifically, a wifi network with a name consisting of weird symbols would appear, the target would click on it, and it would infest their computer and eventually consume their soul and consciousness into the cloud. We start with the ssid, there is a helpful reddit thread. Apt-get install hostapd dnsmasq nginx.
Tony Brett
Things I do outside work, including my record as a councillor. Sunday, August 31, 2014. Has Labour finally reached agreement with the Covered Market Traders? The Labour city councillor with special responsibility for the Covered Market has been forced to give in to pressure at a public meeting I organised on Wednesday evening. The meeting was at the Town Hall and was chaired very ably by the very Revd Bob Wilkes, City Rector and vicar of St Michael at the Northgate. Astonished traders in the room were l...
Tony Carrera
Scary to think this could really happen. Very well made and a fantastic way to get the word out. Happy 11th “dating” anniversary to my amazing wife, @kristinnicolecarrera! Couldn’t ask for a better friend, partner, or mother to Lukas! Lukas reminding me to take a break at work! Thelittlethings #blessed #balancedlife #froggy. It’s been a long time since we’ve done this dish, #saganaki! A Greek style fried cheese. So good! At Miami, Florida). A macchiato kind of morning! Came home to a surprise! Back in De...
Tonychow
关于 Python Iterator 协议的一点思考. 所以 Python 提供了迭代器的类型来对这些类型的内容进行迭代遍历,迭代类型新增于 Python 2.2。 迭代器类型指的是遵循迭代器协议的类型,对于 Python2.x 版本来说就是实现了. Read on →. 今天把剩下的 20-23 章的内容阅读完毕了,这几章也是与 Python 相关的高级内容,包括 Web 编程,数据库接口和 Python 扩展等内容,下面稍微总结下每章的内容。 这一章所谓的 Web 编程内容实际上讲的是利用 urllib 模块进行的 Web 相关的编程,同时也讲到了利用 cgi 模块进行的 原始的 cgi 编程。 从内容来说的话主要介绍了 urllib 和 cgi 模块的一些使用。 Cgi 是比较早期的服务器处理客户端的 请求的方式,目前的 Python Web 编程已经不使用这种技术了。 此外,鉴于 HTTP 协议的无状态性质,可以利用 cookie 的方式来在客户端和服务器端进行一定的状态判断。 Read on →. 正则表达式在很多语言中都被支持,而同样 Python 也提供了对正则表达式支持的模块 re。
Tony Cicero Photography - Blog of Photographer Tony Cicero
Blog of Photographer Tony Cicero. Cranes in the Winter City. As a follow up to my recent story. Cranes in the City. Junction Craft Brewery’s new home: The Destructor on Symes Road. The Junction Craft Brewery. Have expanded their production facilities by moving into The Destructor on Symes Road. Originally built in 1934 by legendary architect R.C. Harris. It is now the city’s newest event venue featuring over 9,700 square feet of combined space. The brewery is part of three large rooms which can...I will ...
I'm Tony Coconate and I have a blog.
I'm Tony Coconate and I write this blog about people, links, quotes, photos, videos and cultural learnings I have found all across the Internet. Rage Against the Machine’s live performance circa 1992… wow, I’m old. Video posted January 14th, 2015 Permalink. Mark Ronson - Uptown Funk (feat. Bruno Mars) #funkyashell. Video posted November 21st, 2014 Permalink. Be witness to a little happiness tomorrow. Video posted September 30th, 2014 Permalink. Eddie Berman and Laura Marling - Like a Rolling Stone.
Random Thoughts
Customer requested email spoofing: SPF, DKIM and the desire to please your customers. Feb 14, 2014. Published by Tony Primerano. I have worked on a handful of web applications that send mail as a core feature. In all cases, no matter how much I protest, we end up with customers that insist on mail sent on their behalf to come from their domain. Here is the scenario. (these domain names are made up but likely active so don't go there). My application runs on wonderfulapp.com. Acme's site is at acme.com.
Tony Blog
Vuejs (14) - 過場效果及動畫. Vuejs 可以在新增、更新或移除 DOM 時使用 CSS 顯示過場效果及動畫,讓元素或元件產生漸進變化。動畫效果可以自己設定,也可以使用第三方的函式庫。 Vuejs (13) - 建立 Laravel Artisan 指令產生 Vue 元件檔. Laravel 允許我們在 Artisan 中加入自己的指令,而我們每次在建立一個 Vue 元件檔時,動作及內容都差不多,這些重覆的流程就應該把它們自動化。 Vuejs (12) - 實戰 CRUD 使用 Laravel Vue. 接續前一篇 Vue.js (11) - 在 Laravel 5.4 中使用 Vue 2.1. 65292;這一篇將要實戰如何寫出一個 CRUD 的應用,也就是對資料庫做建立、讀取、更新及刪除的動作。 Vuejs (11) - 在 Laravel 5.4 中使用 Vue 2.1. Laravel 在第 5 版時已經內建支援 Vue,這篇將簡單介紹如何使用它們一起工作。 Vuejs (10) - 單一元件檔(Single-file components). Vuejs (6) - 計算屬性.
Tony Fendall
I am a AWS Architect and Technical Lead working at BulletProof. This blog is where I share the tips and tricks I pick up along the way. Welcome to my home on the web. Serverless Architectures using AWS Lambda. Animating ProgressBar Skin in Flex. Using Vector Paths with Degrafa. Facebook Iframe Resizing Solution. Serverless Architectures using AWS Lambda. As a developer, managing a Linux operating system is pretty far down the list of things I want to be doing. As Werner Vogels said:. December 6, 2015.