自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

stone的博客

分享的大白

  • 博客(39)
  • 资源 (3)
  • 问答 (1)
  • 收藏
  • 关注

原创 xcode9,brew,opencv的安装配置过程

1. brew install opencv(我用的是3.4)2. 创建一个使用Xcode创建一个Command Line Tools,这里和创建普通的Xcode C++程序是一样的。3. 在项目的buildsettings 设置Header Search Paths 和  Library Search Paths , 主要是找到需要的资源4. 在项目中建立一个group file, 把openc...

2018-03-25 19:02:42 510

翻译 在xcode9下项目遇到的问题

Failed to create provisioning profile.There are no devices registered in your account on the developer website. Plug in and select a device to have Xcode register it.No profiles for 'com.ope

2017-09-23 09:13:02 17356

原创 如何在python的定时任务框架apscheduler中寻找丢失的定时任务

http://apscheduler.readthedocs.io/en/latest/modules/schedulers/base.html?highlight=add_jobstoreadd_jobstore(jobstore, alias='default', **jobstore_opts)Adds a job store to this scheduler.

2017-05-14 18:22:22 1001

原创 决策树学习

#!/usr/bin/python# -*- coding:utf-8 -*-# Author:Tom# Date:2017/05/14# Email:[email protected]# Test:decisiontree# datasetdataset = [ ['slashdot', 'USA', 'yes', 18, 'None'], ['google'

2017-05-14 18:20:23 259

原创 spark-2.1.1编译到python的site-package

1. pip install py4jpip install paste2.cd spark-2.1.13.3.1 ./dev/change-scala-version.sh 2.113.2./build/mvn -Pyarn -Phadoop-2.7 -Dhadoop.version=2.7.0 -DskipTests clean package4.cd pysp

2017-05-13 08:50:27 371

原创 numpy的基础知识

基础在numpy中dimensions(纬度)被称为axes(轴),轴的个数又被称为rank,轴又被称为shapendarray.ndimthe number of axes (dimensions) of the array. In the Python world, the number of dimensions is referred to asrank.数组的维度的个数。ndarray.

2017-04-30 01:09:11 420

原创 django如何实现文件的上传,修改,删除,展示(04)

#!/usr/bin/env python#-*- coding: utf-8 -*-## Moudel providing the method oe the Ads# __author__ = Tom# __date__ = 2017/03/09# __email__ = [email protected]# __version__ = v0.1.dev

2017-04-28 09:24:33 4145

翻译 scala学习(01)

基础语法http://docs.scala-lang.org/tutorials/tour/basics.html基础工具https://scalafiddle.io/

2017-04-27 15:20:00 221

原创 django如何实现文件的上传,修改,删除,展示(03)

def add_img_video(request): if request.method == 'POST': adsUserForm = AdsUserForm(request.POST) adsImgForm = AdsImgForm(request.POST, request.FILES) if adsUserForm.is_vali

2017-04-27 14:34:36 2476

原创 django如何实现文件的上传,修改,删除,展示(02)

class AdsUserForm(forms.ModelForm): class Meta: model = AdsUserModel exclude = ['adsNo', 'type'] widgets = {'adsUser':forms.TextInput(attrs={'class':'form-control'}),}

2017-04-27 14:32:05 1396

原创 django如何实现文件的上传,修改,删除,展示(01)

class AdsUserModel(models.Model): """ define the ads user model """ adsUser = models.CharField(max_length=100, error_messages={'required': u'填写用户名'}) adsNo = models.CharField(

2017-04-27 14:29:32 4070

原创 机器学习01

吴恩迪课程https://www.coursera.org/learn/machine-learning/lecture/zcAuT/welcome-to-machine-learning 解决国内无法打开视频如果你是Mac系统,那么你就按照以下步骤来Find前往->前往文件夹 ,在弹出的对话框里面输入 /private/etc/,然后找到hosts文件。直接打开你不能修改,为了能够修改,

2017-04-25 21:25:27 451 1

原创 staticmethod,classmethod

#/usr/bin/python## Author:Tom# Date:2017/04/22# Email:[email protected]#class A: """ this class is test api for python """ def __init__(self, name, age): self.n

2017-04-22 09:59:13 182

原创 python的本地变量,全局变量,函数的作用域,嵌套函数引用包装函数

#!/usr/bin/python## Author:Tom# Date:2017/04/13# Email:[email protected]# Test:function scopedef test_func_scope(m): a = 1 def b(): print"a:%s" % str(a) print(locals()

2017-04-13 10:07:35 517

原创 numpy-索引

1.numpy中的多维数组和普通的python数组都是从0开始索引。2.numpy中多维数组第一个值是该数组的列3.多维数组是一个n列m行的矩阵(shape)>>> import numpy as np>>> x = np.array([[1,2,3], [4,5,6]])>>> x[1,2]6>>> x[1]array([4, 5, 6])>>> x[2,2]

2017-01-24 10:44:06 308

原创 K-近邻算法

"""   Author:Tom   Date:2017-1-22"""import operatorimport numpy as np# class operatordef create_construct():    group = np.array([[1.0, 1.1], [1.0, 1.0], [0, 0], [0, 0.1]])    #   

2017-01-23 09:32:19 251

原创 ml-day02

k-近邻算法(KNN)存在一个样本数据集合K,并且数据集合中的每一个特征值都有标签N,输入没有标签的新数据后,将新数据的特征值与已经存在的数据的特征值比较,选取距离最近的M个已经存在的数据,然后把M个已经存在的数据的标签与新数据关联。man   woman180     160178     156180     173 新的数据:170公式

2017-01-21 09:37:46 164

原创 ml-day01

监督型学习一般使用两种类型的变量:称型和数值型。标称型一般是会在有限集合中取值,例如真假数值型可以在无限的数值集合中取值

2017-01-21 09:15:33 158

原创 ml-day03

An ndarray is a (usually fixed-size) multidimensional container of items of the same type and size. The numberof dimensions and items in an array is defined by its shape, which is a tuple of N posit

2017-01-20 10:16:18 170

原创 numpyday02

numpy.zeros(shape, dtype=float, order=’C’)Return a new array of given shape and type, filled with zeros.返回一个新的numpy的数组,并且值为0>>>import numpy as np>>> np.zeros(10)array([ 0.,  0.,  0.,

2017-01-19 10:58:40 188

原创 Numpy-day01

numpy.tile(A, reps)该函数返回一个ndarray数组通过参数A的长度和reps的长度决定输出什么类型的数组>>> from numpy import *>>> list_v = [1,2,3,4,5]>>> tile(list_v,1)array([1, 2, 3, 4, 5])>>> tile(list_v,10)array([1, 2, 3

2017-01-18 11:22:43 222

原创 社区版本idea如何使用tomcat插件调试程序

2016-09-25 12:01:12 3373

原创 python的supervisor进程管理使用

1.pstree   查看下运行的进程关系树形图看到一个supervisord进程就是你目前运行2.修改supervisord.conf文件后,使用supervisorctl命令的reload命令重载配置文件,用status可以查看目前运行的进程的状态,start all可以执行所有的进程3.whereis  supervisord.conf可以看下配置文件的位置4.web 一般是

2016-09-06 14:14:12 201

原创 raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) ImproperlyConfigured: Error loadi

这个是问题是你安装的mysql缺少依赖包(centos环境下)1.安装源vi        /etc/yum.repos.d/mysql-community.repo[mysql57-community]name=MySQL 5.7 Community Serverbaseurl=http://repo.mysql.com/yum/mysql-5.7-community/e

2016-09-06 11:12:39 5431

原创 python虚拟环境的使用

1.在类Unix系统下的的安装和使用1.pip install virtualenv2.virtualenv ENV            #ENV是你创建的项目名称(可以随便写)3.source bin/activate     #激活虚拟环境(-----ENV\Scripts\activate  ------window内激活虚拟环境命令,,ENV是上一步创建的文件

2016-06-12 21:39:55 349

原创 django restful api

def storeInfo(request):    if request.method == 'POST':        questionText = request.POST.get('questionText','')        telephone = request.POST.get('telephone','')        params = {'question

2016-06-02 15:49:04 579

转载 The view didn't return an HttpResponse object. It returned None instead. Request Method: POST

http://stackoverflow.com/questions/29322580/the-view-didnt-return-an-httpresponse-object-it-returned-none-instead-request

2016-05-30 11:13:16 5555

原创 queryset object has no attribute meta

filter() returns a QuerySet also if only one object if found. If you want to return just a model instance, use get()

2016-05-30 11:11:46 9850 2

原创 Caught TypeError while rendering: coercing to Unicode: need string or buffer, NoneType found

如果有field存在blank=Ture,属性就删除就好

2016-05-27 14:16:57 572

原创 django中的模型为什么返回的是对象

今天遇到了一个问题,是显示这个PerissionList对象的时候,发现返回的是这个对象本身,而不是这个对象内的属性根据别人的提示,我看了源码,发现只要填加__unicode__或者__str__函数就ok了,这个内置函数的意思是把属性都转换为人可以识别的对象..................................................................

2016-05-27 10:24:27 822

原创 django中在数据中删除了关系表后怎么处理

1.首先查看你的models.py中是否存在这个数据库中不存在表的类,有的话就删除2.参考这个http://stackoverflow.com/questions/27583744/django-table-doesnt-exist重复执行这个步骤,删除model中的逻辑关系以后删除在这个models.py之间注释这个关系类,让django帮你删除逻辑关系和数据库中表。

2016-05-26 11:05:57 783 1

原创 python的内置函数

__str__是返回对象的字符窜表达式fromdjango.dbimport modelsclassReporter(models.Model):full_name= models.CharField(max_length=70)def__str__(self):# __unicode__ on Python 2returnself.fu

2016-05-10 22:30:43 303

原创 python

python中的defdef语句将在执行的时候创建一个函数对象并且把函数对象赋值给变量(函数名)def语句是实时运行的,没有编译过程

2016-05-09 21:16:53 234

原创 Django

polls/views.pyfrom django.http import HttpResponsedef index(request): return HttpResponse("Hello, world. You're at the polls index.")This is the simplest view possible in Djang

2016-04-23 13:42:09 288

原创 openstack中的tox.ini文件

1.tox是openstack中的测试工具(另一个是run_test.sh脚本)2.用途是检查软件包能否在不同的python版本中或解释器中正常安装3.这个工具是在一个虚拟环境中测试的4.使用方法tox -e pep8 #对代码进行检查tox -e py27 #测试环境[tox]minversion = 2.0

2016-04-22 16:47:35 3358

原创 openstack中的setup.py和setup.cfg的理解

import setuptools# In python < 2.7.4, a lazy loading of package `pbr` will break# setuptools if some other modules registered functions in `atexit`.# solution from: http://bugs.python.org/issue158

2016-04-22 16:23:15 3430

原创 openstack中的消息总线

1.远程过程调用(RPC Remote Procedure Call)一个服务进程调用其他远程服务进程的方法,包含Call和Cast方法call主要是通过同步执行,调用者会被阻塞,直到结果返回cast主要是异步执行,不会立即返回结果,页不阻塞调用者2.事件通知(Event Notification)某个服务进程可以把通知发送到消息总线上,消息总线上的进程可以获得该事件并处理,处

2016-04-21 09:23:14 638

原创 openstack-nova学习

1.nova是什么?nova组件是openstack中最基础的模块,主要是管理虚拟机的资源和生命周期。2.nova的工作原理?从客户端发送一个restful请求,通过nova-api把请求转换成HTTP请求,这个请求被放入了一个消息队列中,刚开始nova-conductor获得请求,然后根据请求做资源准备,然后通过消息队列把请求的消息发送给nova-scheduler对象,这个对象可以

2016-04-20 14:39:00 324

翻译 webkit开发前的准备工作

1.源码下载的地址:http://nightly.webkit.org/。这里有关于webkit众多的资料可以查询。2.准备开发IDE,根据文章介绍,Installing the Developer ToolsOS X or iOS SimulatorInstall XcodeGet Xcode from https://developer.apple.co

2015-05-22 22:20:55 507

资源权限控制

2016-10-10

基础系统搭建

基础环境的配置

2016-09-07

安卓安全技术

安卓安全分析及其思路,帮助小伙伴们拿高工资

2014-09-06

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

TA关注的人

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