首页
学习
活动
专区
工具
TVP
发布

自译文章/自学记录

专栏作者
53
文章
82182
阅读量
13
订阅数
fastDFS和nginx配置
回到家目录 cd ~ 新建packages目录(用于存放 下载的包) mkdir packages
lesM10
2019-08-26
1.8K0
使用py3fdfs - 踩坑实录 __str__ return non-string (type bytes)
在执行client = Fdfs_client('/etc/fdfs/client.conf')时,会报错:TypeError: type object argument after ** must be a mapping, not str 解决方法: 1)根据报错位置,定位到PycharmProjects/dailyfresh/venv/lib/python3.6/site-packages/fdfs_client/client.py。 观察到 如下的代码:
lesM10
2019-08-26
2.2K0
Invalid url in admin of django
在Django admin页面,给 和IndexPromotionBanner相关的 数据表 添加数据时,遇到如下图的错误:
lesM10
2019-08-26
4840
re_path()
In order to perform URL reversing, you’ll need to use named URL patterns. The string used for the URL name can contain any characters you like. You are not restricted to valid Python names.
lesM10
2019-08-26
8900
Mutex VS. Semaphore
The key point is that mutexes should be used to protect shared resources, while semaphores should be used for signaling. You should generally not use semaphores to protect shared resources, nor mutexes for signaling. There are issues, for instance, with the bouncer analogy in terms of using semaphores to protect shared resources - you can use them that way, but it may cause hard to diagnose bugs.
lesM10
2019-08-26
6570
Socket Programming in Python(Guide)
Sockets 和 socket API被用于在网络上发送消息。它们提供了进程间通信(IPC)的一种形式。而网络既可以是连接到计算机的本地网络,也可以是计算机被连接到外部的真实网络(比如Internet网)
lesM10
2019-08-26
6300
The process of attribute lookup in python
如果objectname是实例: 1)Check objectname.__class__.__dict__ for attrname. If it exists and is a data-descriptor, return the descriptor result. Search all bases of objectname.__class__ for the same case. (在父类,以及父类的基类中查找data-descriptor属性,找到data-descriptor才返回) 2)Check objectname.__dict__ for attrname, and return if found. (在实例自身中 查找,只要找到就返回,不管是不是descriptor属性) 3)Check objectname.__class__.__dict__ for attrname. 似乎还要加上objectname.__class__.__basses__.__dict__ If it exists and is a non-data descriptor, return the descriptor result. If it exists, and is not a descriptor, just return it. (If it exists and is a data descriptor, we shouldn't be here because we would have returned at point 2.) (在父类中查找non-data descriptor和非descriptor属性,找到就返回)
lesM10
2019-08-26
5720
Immediately-Invoked Function Expression (IIFE)即调函数表达式
以防你没有注意到,我先声明下:我总是要求术语。所以,在听到许多次 流行的,但是让人误解的 JavaScript术语“self-executing anonymous function自我执行匿名函数(或者self-invoked anonymous function自我调用匿名函数)”之后,最终我决定把我的想法组织成一篇文章。 除了提供一些关于IIFE这个模式的非常详细的信息,我也在‘我们该如何称呼它’上 做了建议。此外,如果你想跳到前面,你可以只查看下面的Immediately-Invoked Function Expressions部分,但是我建议读完整篇文章。 这篇文章不是想表达“我是对的,你是错的”,这类的事情。我是真的对“帮助其他人理解潜在地复杂概念”感兴趣,并且觉得“使用一致和准确的术语是人们可以做的促进理解 最简单的事情”。
lesM10
2019-08-26
7260
JavaScript Scoping and Hoisting
当然,上面的代码会让浏览器弹出“1”。那么这中间究竟发生了什么?虽然这看起来似乎让人感到陌生,危险,困惑,但是这就是JavaScript语言的强大并富有表现力的特征。我不知道对这个特殊的行为是否有标准的名称,但是我喜欢用“hoisting”来标识它。这边文章将会尝试揭示为什么会这样,但是我们先要绕个路,来了解下JavaScript的作用域(scoping)。
lesM10
2019-08-26
4920
Scope chain & Closure
本文主要对 Arindam Paul - JavaScript VM internals, EventLoop, Async and ScopeChains视频做个总结。虽然英语水平很差,几乎听不懂这
lesM10
2019-08-26
5200
ModuleNotFoundError: No module named 'pyexpat'
在使用pyenv安装python 3.6.9的时候遇到了- ModuleNotFoundError: No module named 'pyexpat' 环境:mac os10.14.4
lesM10
2019-08-26
5.1K0
Differences between Semaphore and Mutex
mutex,一句话:保护共享资源。典型的例子就是买票:票是共享资源,现在有两个线程同时过来买票。如果你不用mutex在线程里把票锁住,那么就可能出现“把同一张票卖给两个不同的人(线程)”的情况(保证对票的处理是具有原子性)。我想这个不需要多解释了。
lesM10
2019-08-26
8680
理解JavaScript中的Loose Typing(弱类型)
对于大多数前端开发者来说,JavaScript是他们第一次到的既是脚本又是解释语言。对这些开发者来说,loosely typed variables的概念和暗示可能是第二天性的。然而,对Web 2.0应用的爆炸性需求导致越来越多的后端开发人员不得不涉足客户端技术的池塘。当中的绝大多数后端开发者都有着strongly typed languages背景(比如C#,Java),并且不熟悉使用loosely typed variables所带来的灵活和潜在的坑。
lesM10
2019-08-26
6340
The process of Singleton creation
Screen Shot 2019-07-01 at 12.12.08 PM.png
lesM10
2019-08-26
6000
解释JavaScript中的闭包
去年我写了一篇“closures的简介”,它的目的是帮助大家理解‘什么是闭包,闭包是如何工作的’。现在我尝试从另外一个不同的角度去阐释闭包。有了这些基本的概念,你只需要尽可能多地阅读这些解释,来更全面地理解闭包。
lesM10
2019-08-26
8940
没有更多了
社区活动
腾讯技术创作狂欢月
“码”上创作 21 天,分 10000 元奖品池!
Python精品学习库
代码在线跑,知识轻松学
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档