- 博客(86)
- 资源 (28)
- 收藏
- 关注
原创 scipy 数据拟合
import numpy as npfrom scipy.optimize import curve_fit# 创建函数,直线f(x) = ax+bdef func(x, a, b):return a * x + b# 生成测试数据,f(x)=x+2x = np.linspace(0, 10, 100)y = func(x, 1, 2)# 给直线添加噪声,使之变形yn = y +
2017-09-15 13:55:45
2021
1
原创 在raspberry上安装skimage
raspberry为新烧录的系统https://www.raspberrypi.org/downloads/raspbian/sudo apt-get updatesudo apt-get upgradesudo apt-get install python-skimage
2017-09-09 10:18:38
1390
原创 skimage feature canny模块不存在
干货from skimage import filter as feature这和skimage版本有关
2017-09-08 09:48:59
1626
1
翻译 pip install scikit-image win安装错误
错误提示 tifffile.c skimage\external\tifffile\tifffile.c(75) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory error: Command "C:\Users\Administrator.PC-20
2017-09-07 13:26:56
4309
原创 基于django的简单ftp实现
目标环境 在d:/web/1. 建立工程D:\web>django-admin startproject ftpD:\web>python manage.py startapp sample2.修改sample/models.py
2017-09-01 17:28:02
3603
转载 python获取公网ip的几种方式
from urllib2 import urlopenmy_ip = urlopen('http://ip.42.pl/raw').read()print 'ip.42.pl', my_ipfrom json import loadfrom urllib2 import urlopenmy_ip = load(urlopen('http://jsonip.com'))['ip']p
2017-08-29 09:40:29
19413
5
原创 windows python 与oracle 链接 python remote connect oracle
import cx_Oracledb = cx_Oracle.connect('test/test@192.168.0.43/mydb')#用户名/密码@目的地址/数据库名print db.versioncursor = db.cursor()sql = 'select * from v$database'cursor.execute(sql)rs = cursor.fetcha
2017-08-27 15:43:08
355
原创 keil硬仿卡死在while(RCC_GetSYSCLKSource() != 0x08);
void RCC_Configuration(void){ RCC_DeInit(); RCC_HSICmd(ENABLE); while(RCC_GetFlagStatus(RCC_FLAG_HSIRDY)== RESET); RCC_HCLKConfig(RCC_SYSCLK_Div1); RCC_PCLK2Config(RCC_HCLK_Div1); RCC_PCLK1Conf
2017-07-05 13:14:25
4736
4
原创 C#项目图文说明 不允许所请求的注册表访问权 异常的一种解决方式
解决思路提高程序运行权限操作右击项目>添加>新建项选择应用程序清单文件添加后会在项目中多出一个manifest文件进入编辑,如下重新运行程序,将需要重启VS参考【注册表访问】
2016-04-27 22:17:52
3095
原创 ubuntu 14.04 64位hello world驱动
一、环境及版本主机:vmware虚拟 ubuntu 14.04 64bit内核版本:3.16.0-30-generic二、思路介绍linux下驱动以模块的方式挂载,进而让程序调用。本文也就是一步步生成这个被挂载的模块。此模块以.ko结尾。三、实现步骤a、构造内核源码树先得查看本机的内核版本号,然后下载对应版本的源代码,构造源码树,否则模块无法挂载1.查看
2016-04-11 10:37:24
1812
原创 Qt通过样式表一键换皮肤 风格
样式表文件以qss为后缀新建sample.qss文件QMainWindow{ //背景图 background-image:url(:/image/test.jpg);}QPushButton{ //背景色 background-color: rgba(100, 225, 100, 30); //边框样式 border-style:ou
2016-03-24 21:47:31
3158
原创 QPalette 设置控件颜色
添加头文件#include 在界面上添加如下控件给按钮添加单击响应槽函数 ui->setupUi(this); QPalette palette = ui->pushButton->palette(); palette.setColor(QPalette::ButtonText, Qt::red); palette.setColor(QPal
2016-03-24 19:59:28
6066
1
原创 QList 多线程操作
测试QList是否支持多线程访问建立两个线程向QList中写数据(慢速)WriteThread建立一个线程从QList中取数据(快速)ReadThread取数据线程头文件readthread.h#ifndef READTHREAD_H#define READTHREAD_H#include #include class ReadThread:public QThread
2016-03-23 13:49:25
6419
4
原创 C# 泛型约束
主要约束类型参数可指定零个或一个主要约束不可指定的引用类型System.Object System.Array System.Delegate System.MulticastDelegate System.ValueType System.Enum System.Voidclass Sample where T: Stream{}有两个特殊的主要约束class
2016-03-15 21:30:24
940
原创 C# 无参属性 set与get
无参属性一开始我们的对象是这样的public sealed class Emplyee{ public string Name; public int Age;}
2016-03-09 21:37:26
718
翻译 C# 并发队列ConcurrentQueue
测试函数static async Task RunProgram(){ var taskQueue = new ConcurrentQueue(); var cts = new CancellationTokenSource(); //生成任务添加至并发队列 var taskSource = Task.Run(() => TaskProducer(taskQu
2016-03-08 21:26:50
26880
原创 C# 并发容器之ConcurrentDictionary与普通Dictionary带锁的性能对比
结果已经写在注释中static void Main(string[] args){ var concurrentDictionary = new ConcurrentDictionary(); var dictionary = new Dictionary(); var sw = new Stopwatch(); sw.Start(); for (
2016-03-06 21:29:41
18587
原创 c# 线程池RegisterWaitForSingleObject的一个Demo
static void Main(string[] args) { Console.WriteLine("first time 5s"); RunOperations(TimeSpan.FromSeconds(5)); Console.WriteLine("second time 7s");
2016-03-06 10:22:54
1624
原创 C# 调用委托线程BeginInvoke与EndInvoke
第一步,委托的申明private delegate string RunOnThreadPool(out int threadId);第二步,将被作为线程运行的函数private static string Test(out int threadId){ Console.WriteLine("starting..."); Console.WriteLine("is
2016-03-06 10:19:36
633
原创 C# BackgroundWorker的一个Demo
BackgroundWorker作用基本就能用名字来表达了具体工作内容函数 static void Worker_DoWork(object sender, DoWorkEventArgs e) { Console.WriteLine("doworker thread pool thread id: {0}", Thread.Curre
2016-03-05 21:23:16
610
原创 C# 手动调用线程与线程池方式调用的开销对比
UseThreads为手工线程UseThreadPool为线程池方式 static void Main(string[] args) { const int numberOfOperations = 500; var sw = new Stopwatch(); sw.Start();
2016-03-04 21:46:35
925
原创 C# 线程池中取消线程的三种方式
三种方式都使用CancellationToken,只是使用方式不同,有类似于采用全局标志位的方式第一种 检测IsCancellationRequested方式 static void AsyncOperation1(CancellationToken token) { Console.WriteLine("starting the fi
2016-03-04 21:41:16
4842
原创 C# 引用类型、值类型与拆箱、装箱
引用类型 任何可被称为‘类’的类型 如:System.Exception, System.IO.FileStream,System.String值类型 被称为结构或枚举的类型 如:System.Int32, System.Boolean,System.Decimal, System.TimeSpan, System.DayOfWeek, System.IO.FileAt
2016-03-04 20:59:31
700
原创 C# 开放类型与封闭类型
开放类型 具有泛型类型参数的类型封闭类型 为所有类型参数都传递了实际的数据类型using System;using System.Collections.Generic;namespace TypeObjectDemo{ internal sealed class DictionaryStringKey:Dictionary{ } class Prog
2016-03-03 21:15:35
3373
原创 C#在线程池中调用委托
在线程池中调用线程,同时启用超时等待。可应场景:发送信号,等待回复;收到回复->回复处理;未收到回复->超时处理using System;using System.Threading;namespace InvokingADelegate{ class Program { static void Main(string[] args)
2016-03-02 21:11:01
1452
原创 C#线程间同步的几种实现方式
一、使用信号量using System;using System.Threading;namespace SemaphoreDemo{ class Program { static void Main(string[] args) { for(int i = 0; i <= 6; i++)
2016-03-01 20:30:47
1524
原创 C# 泛型之list<T>与ArrayList<object>比较
类型List中采用泛型T的方式加入内容而ArrayList中采用object的方式加入内容using System;using System.Collections.Generic;using System.Collections;using System.Diagnostics;namespace ListDemo{ class Program {
2016-03-01 20:23:12
1195
原创 C# 中线程资源访问互斥量
使用mutex,进行互斥访问示例中运行第一个窗口显示running此时运行第二个窗口显示 空白 处于等待。若在5秒内在第一个窗口中输入,将释放资源,此时第二个窗口将显示runningusing System;using System.Threading;namespace MutexDemo{ class Program { static voi
2016-02-29 20:44:03
1909
原创 C# 中线程资源访问互斥锁
一个加减数值的例子说明问题using System;using System.Threading;namespace ThreadLockingDemo{ class Program { static void Main(string[] args) { Console.WriteLine("incorrect c
2016-02-28 22:02:10
1066
原创 C# 5.0 使用任务调试表TaskScheduler来运行task
示例效果与winform中this.invoke(new delegete{})跨线程操作资源类似建立WPF项目,使用4.5框架mainwindow.xml文件如下<Window x:Class="TaskSchedulerDemo.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/prese
2016-02-25 23:11:14
1892
原创 C# 5.0 Task中实现异常抛出
using System;using System.Threading;using System.Threading.Tasks;namespace ExceptionsDemo{ class Program { static void Main(string[] args) { Task task;
2016-02-25 20:05:37
3824
原创 C#5.0 采用CancellationTokenSource方式取消Task
贴一种取消任务的方式using System;using System.Threading;using System.Threading.Tasks;namespace CancellationDemo{ class Program { static void Main(string[] args) { var
2016-02-24 22:03:59
4495
原创 C# 5.0 以Task方式实现EAP
调用BackgroundWorker相关的方法以下代码参考自《Multithreading in C# 5.0 Cookbook》using System;using System.ComponentModel;using System.Threading;using System.Threading.Tasks;namespace EAPDemo{ class Pro
2016-02-24 22:00:11
1170
原创 C#5.0 以Task方式实现APM
基于事件的异步模式 (Event-based Asynchronous Pattern, EAP) 异步编程模型 (Asynchronous Programming Model, APM) 基于任务的异步模式 (Task-based Asynchronous Pattern, TAP)换个方式也就是说,将TAP实现原来Thread中的AutoResetEvent、ManualReset
2016-02-23 21:50:24
1185
programming linux games
2009-05-24
uCOS-II The Real-Time Kernel.pdf
2009-09-24
acm程序集 算法 C程序1. 最小生成树(2)
2009-05-30
C51单片机SPI双机通信
2009-08-19
AD6 9 10 pcb logo 制做
2014-07-23
大数计算库
2013-06-06
国密k倍点测试中间数据
2013-06-06
rails简单实例_rake数据导入
2010-03-28
raspberry pi tensorflow1.10.0
2018-11-23
win-dkk分片断上传共230M左右part2
2010-01-18
数据结构课程设计报告
2009-06-30
win-dkk分片断上传共230M左右part1
2010-01-18
railscoders添加用户实例ruby on rials实例
2010-03-31
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人