自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Chnyac的博客

努力的小白一枚

  • 博客(13)
  • 资源 (4)
  • 收藏
  • 关注

原创 Python:vscode编写python时提示Python(unresolved-import)

在引用自定义模块时,在代码无错的情况下,vscode提示Python(unresolved-import)可在vscode的setting.json中添加"python.analysis.disabled":["unresolved-import"]以消除该warning...

2019-10-29 14:51:16 8227 2

原创 Python:map、reduce、lambda的简单使用

from functools import reducedef normalize(name): return list(map(lambda x:x.capitalize(),name))def prod(L): return reduce(lambda x,y:x*y,L)def str2float(s): digit = {'0': 0, '1': 1,...

2019-10-24 15:11:19 317

原创 Python:装饰器简介(函数装饰类,类装饰函数,类装饰类)

函数装饰类def wrapClass(cls): def inner(a): print('class name:', cls.__name__) return cls(a) return inner@wrapClassclass Foo(): def __new__(cls,a): print("__new__方...

2019-10-21 19:36:20 226

原创 Python:装饰器简介(函数装饰函数)

def decorator(func): print('out') def inner(): print('inner start') func() print('inner end') return inner return inner@decoratordef function1(): pr...

2019-10-17 15:36:42 201

原创 Python:设计模式之工厂模式

class IWeapon(object): def info(self): raise NotImplementedErrorclass Sword(IWeapon): def info(self): print("This cold weapon is Sword")class Knigfe(IWeapon): def i...

2019-10-17 11:10:03 160

原创 Python:设计模式之抽象工厂模式

class IColdWeapon(object): def info(self): raise NotImplementedError def stick(self): raise NotImplementedErrorclass Sword(IColdWeapon): def info(self): print(...

2019-10-17 11:00:25 220

原创 Python:设计模式之简单工厂模式

class IWeapon(object): def info(self): raise NotImplementedErrorclass Sword(IWeapon): def info(self): print("This cold weapon is Sword")class Knigfe(IWeapon): def i...

2019-10-17 10:21:57 172

原创 Python:设计模式之装饰模式

class Character(object): def __init__(self, name): self._name = nameclass King(Character): def show(self): print("Name:", self._name)class CharacterDecorator(Characte...

2019-10-16 22:51:28 174

原创 Python:设计模式之命令模式

class Light(object): def on(self): print('Light on') def off(self): print('Light off')class TV(object): def on(self): print('TV open') def off(self): ...

2019-10-16 22:25:34 170

原创 Python:设计模式之观察者模式

#观察者模式之西游记师徒四人#被观察者class IMaster(object): def __init__(self): self._prentice_list = [] def name(self): raise NotImplementedError #收徒 def add_prentice(self, prentic...

2019-10-16 18:05:27 151

原创 Python:设计模式之适配器模式

class IStickWeapon(object): def weapon_type(self): raise NotImplementedError def use_stick_Weapon(self): print(f'Use:\t{self.weapon_type()}')class Sword(IStickWeapon): d...

2019-10-16 15:55:36 164

原创 Python:设计模式之策略模式

class IWeaponBahavior(object): def use_weapon(self): raise NotImplementedErrorclass SwordBahavior(IWeaponBahavior): def use_weapon(self): return "Sword"class KnigfeBah...

2019-10-15 16:56:30 194

原创 Python:python函数详解

Python函数形式def function_name(parm)->str: '''function declaration''' body return value说明function_name:函数名称function declaration:函数说明parm:参数body:函数体value:返回值参数– 必需参数/位置参数说明根据参数位置分配参...

2019-10-15 14:52:26 318

简单验证C++纯虚函数的机制

命令: objdump -D test > test1.txt objdump -CS -s -j .rodata test > test.txt

2020-08-17

ReadFile.cpp

INI配置文件的读写删操作,C++编写,无论是window还是linux的环境均适用

2019-07-19

pyTorch欠缺dll

** from torch._C import *** ImportError: DLL load failed: 找不到指定的模块。 打开解压后的文件夹 intel-openmp-2018.0.0-8 中的 Library/bin,将其中的两个 .dll 文件复制并放在一个新的文件夹中。 将 .dll 文件的文件夹路径添加到系统的环境变量中。

2018-08-02

word2vec_basic.py源码下载

Tensorflow 中文社区字词的向量表示的 word2vec_basic.py 源码下载

2018-05-24

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除