自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(86)
  • 资源 (28)
  • 收藏
  • 关注

原创 python 2.7.14 pip

下载官方可执行文件已经带有pipcmd提示不识别pip处理方式 python -m ensurepip

2018-03-04 09:32:50 987 1

原创 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 1925 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 1308

原创 skimage feature canny模块不存在

干货from skimage import filter as feature这和skimage版本有关

2017-09-08 09:48:59 1542 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 4211 5

原创 基于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 3410

原创 python django中显示中文

python版本2.7.11setting文件中LANGUAGE_CODE = 'zh-Hans'

2017-08-30 10:28:28 617

转载 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 19157 5

原创 windows python 与oracle 链接 python remote connect oracle

import cx_Oracledb = cx_Oracle.connect('test/[email protected]/mydb')#用户名/密码@目的地址/数据库名print db.versioncursor = db.cursor()sql = 'select * from v$database'cursor.execute(sql)rs = cursor.fetcha

2017-08-27 15:43:08 300

原创 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 4302 3

原创 C#项目图文说明 不允许所请求的注册表访问权 异常的一种解决方式

解决思路提高程序运行权限操作右击项目>添加>新建项选择应用程序清单文件添加后会在项目中多出一个manifest文件进入编辑,如下重新运行程序,将需要重启VS参考【注册表访问】

2016-04-27 22:17:52 2935

原创 针对nanopi2的hello word 驱动

nanopi2

2016-04-22 07:33:10 1264

原创 gdb使用介绍

1.

2016-04-15 22:54:11 686

原创 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 1718

原创 Qt状态机QStateMachine使用

状态机

2016-03-25 19:04:30 4457

原创 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 3047

原创 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 5958 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 6093 3

原创 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 863

原创 C# 无参属性 set与get

无参属性一开始我们的对象是这样的public sealed class Emplyee{ public string Name; public int Age;}

2016-03-09 21:37:26 636

翻译 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 26422

原创 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 18328 1

原创 VS2015快捷键设置

VS2015 自动缩进 自动对齐 快捷键

2016-03-06 15:58:34 3081

原创 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 1556

原创 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 593

原创 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 571

原创 C# 手动调用线程与线程池方式调用的开销对比

UseThreads为手工线程UseThreadPool为线程池方式 static void Main(string[] args) { const int numberOfOperations = 500; var sw = new Stopwatch(); sw.Start();

2016-03-04 21:46:35 876

原创 C# 线程池中取消线程的三种方式

三种方式都使用CancellationToken,只是使用方式不同,有类似于采用全局标志位的方式第一种 检测IsCancellationRequested方式 static void AsyncOperation1(CancellationToken token) { Console.WriteLine("starting the fi

2016-03-04 21:41:16 4538

原创 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 655

原创 C# 开放类型与封闭类型

开放类型 具有泛型类型参数的类型封闭类型 为所有类型参数都传递了实际的数据类型using System;using System.Collections.Generic;namespace TypeObjectDemo{ internal sealed class DictionaryStringKey:Dictionary{ } class Prog

2016-03-03 21:15:35 3278

原创 C#在线程池中调用委托

在线程池中调用线程,同时启用超时等待。可应场景:发送信号,等待回复;收到回复->回复处理;未收到回复->超时处理using System;using System.Threading;namespace InvokingADelegate{ class Program { static void Main(string[] args)

2016-03-02 21:11:01 1386

原创 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 1464

原创 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 1128

原创 C# 中线程资源访问互斥量

使用mutex,进行互斥访问示例中运行第一个窗口显示running此时运行第二个窗口显示 空白 处于等待。若在5秒内在第一个窗口中输入,将释放资源,此时第二个窗口将显示runningusing System;using System.Threading;namespace MutexDemo{ class Program { static voi

2016-02-29 20:44:03 1849

原创 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 1015

原创 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 1820

原创 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 3726

原创 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 4429

原创 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 1116

原创 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 1136

PHP项目开发案例全程实录.pdf

PHP项目开发案例全程实录 完整电子书 带部分目录可供参考

2018-11-24

raspberry pi tensorflow1.10.0

下载源地址 https://www.piwheels.org/simple/tensorflow/tensorflow-1.11.0-cp35-none-linux_armv7l.whl#sha256=f82577f25f1e87940d99cc6986d63089fdce1e54e95bb0d32f4dbe16f4a60a2c pip3 install tensorflow-1.11.0-cp35-none-linux_armv7l.whl安装

2018-11-23

Linux Device Driver (3rd Edition)

英文原版,中文目录;全书不掉页不乱码

2016-04-08

bacnet开发demo

来自sourceforge,基于C#实现的bacnet开源demo 可使用vts测试,不收费

2015-12-17

AD6 9 10 pcb logo 制做

用于AD altium designer 的logo转换脚本 注意导入图片为位图,可用photoshop转为灰度图再转为位图,再导入 教程如下http://blog.csdn.net/conquerwave/article/details/8450962

2014-07-23

大数计算器

功能介绍: 1.加法 a+b 2.减法 a-b 3.乘法 a*b 4.除法 a/b 5.模运算 a%b 6.模逆运算

2013-08-23

故障树JAVA源代码

故障树JAVA源代码,注释乱码了,不想处理了,相关的说明请参考我的相关博文

2013-07-06

椭圆曲线带图解释原理说明

从别人借来的资料,觉得好就上传了,若想知道SM2的更多请参考我的博文。

2013-06-24

大数计算库

文件包含如下: main.c 测试实例 convert.h convert.c 进制转换函数 smath.h smath.c 大数加减乘除及取模、移位、模逆 头文件中唯一的亮点是模逆计算,基于扩展欧几基里得原理 其它的函数,本人数学能力有限优化还在进行中 有兴趣一起做的可以联系我[email protected] 基于此可以实现国密SM2中的k倍点,不过效率比较低 官方的数据实际测试中得花去1分20秒左右

2013-06-06

国密k倍点测试中间数据

计算K倍点的中间测试数据,国密SM2算法 分别列出了K=1,2,3,4,5,6,7,8,0xFFFF,0xFF00FFFF 所对应的倍点值 基点及模P为官方文档中的数据

2013-06-06

railscoders添加用户实例ruby on rials实例

ruby on rails 实例 practical rails social networking sites ruby on rails 第三章内容代码,我自己写进去的,导入数据可以直接用,developemnt阶段,test没有做

2010-03-31

rails简单实例_rake数据导入

来自practical rails social networking sites上的第二章的实例,应用了数据导入,导入数据到mysql后就可以使用,命令: rake db:migrate(进入文件夹"railscoder")

2010-03-28

win-dkk分片断上传共230M左右part2

win-dkk分片断上传共230M左右 ddk driver development kit是winXP的 网上有链接,但不稳定,我好不容易下下来了

2010-01-18

win-dkk分片断上传共230M左右part1

win-dkk分片断上传共230M左右 ddk driver development kit 网上有链接,但不稳定,我好不容易下下来了

2010-01-18

Davis.Chapman.-.Visual.C++.6.in.21.Days

DAY 1 THE VISUAL C++ DEVELOPMENT ENVIRONMENT—BUILDING YOUR FIRST VISUAL C++ APPLICATION 7 The Visual C++ Development Environment............................................................8 The Output Pane ................................................................................................9 The Editor Area ..................................................................................................9 Menu Bars ........................................................................................................10 Rearranging the Developer Studio Environment ............................................10 Starting Your First Project ....................................................................................11 Creating the Project Workspace ......................................................................11 Using the Application Wizard to Create the Application Shell ......................12 Designing Your Application Window ....................................................................15 Adding Code to Your Application ........................................................................17 Finishing Touches ..................................................................................................20 Creating the Dialog Box Icon ..........................................................................20 Adding Maximize and Minimize Buttons........................................................21 Summary................................................................................................................22 Q&A ......................................................................................................................22 Workshop ..............................................................................................................23 Quiz ..................................................................................................................23 Exercise ............................................................................................................23 DAY2 USING CONTROLS IN YOUR APPLICATION 25 The Basic Windows Controls ................................................................................26 The Static Text Control ....................................................................................26 The Edit Box Control ......................................................................................26 The Command Button Control ........................................................................27 The Check Box Control....................................................................................27 The Radio Button Control ................................................................................27 The Drop-Down List Box Control ..................................................................27 Adding Controls to Your Window ........................................................................27 Creating the Application Shell and Dialog Layout ..........................................28 Specifying the Control Tab Order ....................................................................30 Attaching Variables to Your Controls ....................................................................32 Attaching Functionality to the Controls ................................................................33 Closing the Application ....................................................................................36 Showing the User’s Message............................................................................37 Clearing the User’s Message ............................................................................38 Disabling and Hiding the Message Controls....................................................39 Running Another Application ..........................................................................42 Summary................................................................................................................44 Q&A ......................................................................................................................44 Workshop ..............................................................................................................45 Quiz ..................................................................................................................45 Exercises ..........................................................................................................45 DAY3 ALLOWING USER INTERACTION—INTEGRATING THE MOUSE AND KEYBOARD IN YOUR APPLICATION 47 Understanding Mouse Events ................................................................................48 Drawing with the Mouse ..................................................................................49 Improving the Drawing Program ....................................................................53 Adding the Finishing Touches..........................................................................55 Capturing Keyboard Events ..................................................................................56 Changing the Drawing Cursor..........................................................................57 Making the Change Stick ................................................................................60 Summary................................................................................................................64 Q&A ......................................................................................................................64 Workshop ..............................................................................................................65 Quiz ..................................................................................................................65 Exercises ..........................................................................................................65 DAY4 WORKING WITH TIMERS 67 Understanding Windows Timers............................................................................68 Placing a Clock on Your Application ....................................................................68 Creating the Project and Application ..............................................................68 Adding the Timer IDs ......................................................................................70 Starting the Clock Timer ..................................................................................71 Handling the Clock Timer Event......................................................................72 Adding a Second Timer to Your Application ........................................................74 Adding the Application Variables ....................................................................74 Starting and Stopping the Counting Timer ......................................................75 Enabling the Stop Button ................................................................................79 Summary................................................................................................................81 vi Sams Teach Yourself Visual C++ 6 in 21 Days Q&A ......................................................................................................................81 Workshop ..............................................................................................................82 Quiz ..................................................................................................................82 Exercise ............................................................................................................82 DAY5 GETTING USER FEEDBACK—ADDING DIALOG BOXES TO YOUR APPLICATION 83 Using Pre-existing (or System) Dialog Windows..................................................84 Using Message Boxes ......................................................................................84 Using Common Dialogs ..................................................................................90 Creating Your Own Dialog Windows ....................................................................93 Creating the Dialog Window............................................................................93 Using the Dialog in Your Application ..............................................................96 Summary..............................................................................................................101 Q&A ....................................................................................................................101 Workshop ............................................................................................................103 Quiz ................................................................................................................103 Exercises ........................................................................................................104 DAY6 CREATING MENUS FOR YOUR APPLICATION 105 Menus ..................................................................................................................106 Menu Styles....................................................................................................106 Keyboard Shortcut–Enabling Menus ............................................................106 Menu Standards and Conventions ..................................................................107 Designing Menus ................................................................................................108 Creating a Menu ..................................................................................................108 Creating the Application ................................................................................108 Adding and Customizing a Menu ..................................................................109 Attaching the Menu to Your Dialog Window ................................................112 Attaching Functionality to Menu Entries ......................................................112 Creating Pop-Up Menus ......................................................................................116 Creating a Menu with Accelerators ....................................................................118 Summary..............................................................................................................119 Q&A ....................................................................................................................119 Workshop ............................................................................................................120 Quiz ................................................................................................................120 Exercises ........................................................................................................120 DAY7 WORKING WITH TEXT AND FONTS 121 Finding and Using Fonts......................................................................................122 Listing the Available Fonts ............................................................................122 Using a Font ..................................................................................................125 Contents vii Using Fonts ..........................................................................................................129 Creating the Application Shell ......................................................................129 Building a List of Fonts..................................................................................131 Setting the Font Sample Text ........................................................................135 Selecting a Font to Display ............................................................................136 Summary..............................................................................................................139 Q&A ....................................................................................................................139 Workshop ............................................................................................................140 Quiz ................................................................................................................140 Exercises ........................................................................................................140 WEEK 1 IN REVIEW 143 WEEK 2 AT A GLANCE 147 DAY8 ADDING FLASH—INCORPORATING GRAPHICS, DRAWING, AND BITMAPS 149 Understanding the Graphics Device Interface ....................................................150 Device Contexts..............................................................................................150 Mapping Modes and Coordinate Systems......................................................156 Creating a Graphics Application..........................................................................157 Generating the Application Shell ..................................................................157 Adding the Graphics Capabilities ..................................................................163 Summary..............................................................................................................177 Q&A ....................................................................................................................177 Workshop ............................................................................................................177 Quiz ................................................................................................................178 Exercises ........................................................................................................178 DAY9 ADDING ACTIVEX CONTROLS TO YOUR APPLICATION 179 What Is an ActiveX Control? ..............................................................................180 ActiveX and the IDispatch Interface..............................................................180 ActiveX Containers and Servers ....................................................................182 Adding an ActiveX Control to Your Project........................................................183 Registering the Control ..................................................................................183 Adding the Control to Your Dialog ................................................................186 Using an ActiveX Control in Your Application ..................................................187 Interacting with the Control ..........................................................................187 Responding to Control Events........................................................................193 Summary..............................................................................................................196 Q&A ....................................................................................................................196 Workshop ............................................................................................................197 Quiz ................................................................................................................197 Exercise ..........................................................................................................197 viii Sams Teach Yourself Visual C++ 6 in 21 Days DAY 10 CREATING SINGLE DOCUMENT INTERFACE APPLICATIONS 199 The Document/View Architecture ......................................................................200 Creating an SDI Application................................................................................202 Building the Application Shell ......................................................................202 Creating a Line Class ....................................................................................203 Implementing the Document Functionality....................................................205 Showing the User ..........................................................................................208 Saving and Loading the Drawing ........................................................................213 Deleting the Current Drawing ........................................................................214 Saving and Restoring the Drawing ................................................................215 Interacting with the Menu....................................................................................218 Adding Color to the CLine Class....................................................................218 Adding Color to the Document ......................................................................219 Modifying the Menu ......................................................................................222 Summary..............................................................................................................226 Q&A ....................................................................................................................227 Workshop ............................................................................................................228 Quiz ................................................................................................................228 Exercise ..........................................................................................................228 DAY 11 CREATING MULTIPLE DOCUMENT INTERFACE APPLICATIONS 229 What Is an MDI Application?..............................................................................229 Creating an MDI Drawing Program ....................................................................231 Building the Application Shell ......................................................................231 Building the Drawing Functionality ..............................................................232 Adding Menu Handling Functionality ..........................................................233 Adding a Context Menu ......................................................................................236 Summary..............................................................................................................239 Q&A ....................................................................................................................239 Workshop ............................................................................................................240 Quiz ................................................................................................................240 Exercise ..........................................................................................................241 DAY 12 ADDING TOOLBARS AND STATUS BARS 243 Toolbars, Status Bars, and Menus ......................................................................244 Designing a Toolbar ............................................................................................245 Creating a New Toolbar..................................................................................246 Attaching the Toolbar to the Application Frame............................................247 Controlling the Toolbar Visibility ..................................................................254 Adding a Combo Box to a Toolbar......................................................................257 Editing the Project Resources ........................................................................257 Creating the Toolbar Combo Box ..................................................................260 Contents ix Handling the Toolbar Combo Box Events ....................................................267 Updating the Toolbar Combo Box ................................................................268 Adding a New Status Bar Element......................................................................271 Adding a New Status Bar Pane ......................................................................271 Setting a Status Bar Pane Text ......................................................................273 Summary..............................................................................................................275 Q&A ....................................................................................................................276 Workshop ............................................................................................................277 Quiz ................................................................................................................277 Exercises ........................................................................................................277 DAY 13 SAVING AND RESTORING WORK—FILE ACCESS 279 Serialization ........................................................................................................279 The CArchive and CFile Classes ....................................................................280 The Serialize Function....................................................................................281 Making Objects Serializable ..........................................................................281 Implementing a Serializable Class ......................................................................283 Creating a Serialized Application ..................................................................284 Creating a Serializable Class..........................................................................288 Building Support in the Document Class ......................................................294 Adding Navigating and Editing Support in the View Class ..........................305 Summary..............................................................................................................311 Q&A ....................................................................................................................311 Workshop ............................................................................................................313 Quiz ................................................................................................................313 Exercise ..........................................................................................................313 DAY 14 RETRIEVING DATA FROM AN ODBC DATABASE 315 Database Access and ODBC................................................................................316 The Open Database Connector (ODBC) Interface ........................................316 The CRecordset Class....................................................................................317 Creating a Database Application Using ODBC ..................................................322 Preparing the Database ..................................................................................322 Creating the Application Shell ......................................................................324 Designing the Main Form ..............................................................................325 Adding New Records ....................................................................................331 Deleting Records ............................................................................................334 Summary..............................................................................................................335 Q&A ....................................................................................................................335 Workshop ............................................................................................................336 Quiz ................................................................................................................336 Exercise ..........................................................................................................336 x Sams Teach Yourself Visual C++ 6 in 21 Days WEEK 2 IN REVIEW 337 WEEK 3 AT A GLANCE 341 DAY 15 UPDATING AND ADDING DATABASE RECORDS THROUGH ADO 343 What Is ADO?......................................................................................................344 ADO Objects ..................................................................................................345 Using the ADO ActiveX Control ..................................................................346 Importing the ADO DLL................................................................................349 Connecting to a Database ..............................................................................350 Executing Commands and Retrieving Data ..................................................351 Navigating the Recordset ..............................................................................352 Accessing Field Values ..................................................................................353 Updating Records ..........................................................................................356 Adding and Deleting ......................................................................................356 Closing the Recordset and Connection Objects ..........................................357 Building a Database Application Using ADO ....................................................358 Creating the Application Shell ......................................................................358 Building a Custom Record Class ..................................................................361 Connecting and Retrieving Data ....................................................................365 Populating the Form ......................................................................................367 Saving Updates ..............................................................................................370 Navigating the Record Set..............................................................................371 Adding New Records ....................................................................................373 Deleting Records ............................................................................................375 Summary..............................................................................................................376 Q&A ....................................................................................................................377 Workshop ............................................................................................................377 Quiz ................................................................................................................377 Exercise ..........................................................................................................378 DAY 16 CREATING YOUR OWN CLASSES AND MODULES 379 Designing Classes ................................................................................................380 Encapsulation..................................................................................................380 Inheritance ......................................................................................................380 Visual C++ Class Types ................................................................................381 Creating Library Modules....................................................................................382 Using Library Modules........................................................................................383 Creating the Library Module..........................................................................383 Creating a Test Application ............................................................................393 Updating the Library Module ........................................................................398 Contents xi Summary..............................................................................................................401 Q&A ....................................................................................................................402 Workshop ............................................................................................................403 Quiz ................................................................................................................403 Exercise ..........................................................................................................403 DAY 17 SHARING YOUR FUNCTIONALITY WITH OTHER APPLICATIONS—CREATING DLLS 405 Why Create DLLs? ..............................................................................................406 Creating and Using DLLs ..............................................................................406 Designing DLLs ............................................................................................409 Creating and Using an MFC Extension DLL......................................................410 Creating the MFC Extension DLL ................................................................410 Adapting the Test Application........................................................................413 Changing the DLL..........................................................................................414 Creating and Using a Regular DLL ....................................................................416 Creating the Regular DLL..............................................................................417 Adapting the Test Application........................................................................423 Summary..............................................................................................................426 Q&A ....................................................................................................................427 Workshop ............................................................................................................428 Quiz ................................................................................................................428 Exercises ........................................................................................................428 DAY 18 DOING MULTIPLE TASKS AT ONE TIME—MULTITASKING 429 What Is Multitasking?..........................................................................................430 Performing Multiple Tasks at One Time........................................................430 Idle Processing Threads..................................................................................431 Spawning Independent Threads ....................................................................431 Building a Multitasking Application ..................................................................441 Creating a Framework ....................................................................................441 Designing Spinners ........................................................................................443 Supporting the Spinners ................................................................................449 Adding the OnIdle Tasks ................................................................................455 Adding Independent Threads ........................................................................460 Summary..............................................................................................................468 Q&A ....................................................................................................................468 Workshop ............................................................................................................471 Quiz ................................................................................................................471 Exercises ........................................................................................................471 xii Sams Teach Yourself Visual C++ 6 in 21 Days DAY 19 BUILDING YOUR OWN WIDGETS—CREATING ACTIVEX CONTROLS 473 What Is an ActiveX Control? ..............................................................................474 Properties ........................................................................................................474 Methods ..........................................................................................................475 Events ............................................................................................................476 Creating an ActiveX Control ..............................................................................476 Building the Control Shell..............................................................................477 Modifying the CModArt Class ......................................................................478 Adding Properties ..........................................................................................481 Designing and Building the Property Page ....................................................483 Adding Basic Control Functionality ..............................................................485 Adding Methods ............................................................................................487 Adding Events ................................................................................................489 Testing the Control ........................................................................................491 Summary..............................................................................................................493 Q&A ....................................................................................................................493 Workshop ............................................................................................................494 Quiz ................................................................................................................494 Exercises ........................................................................................................494 DAY 20 INTERNET APPLICATIONS AND NETWORK COMMUNICATIONS 495 How Do Network Communications Work? ........................................................496 Sockets, Ports, and Addresses ........................................................................497 Creating a Socket............................................................................................498 Making a Connection ....................................................................................500 Sending and Receiving Messages ..................................................................501 Closing the Connection ..................................................................................503 Socket Events ................................................................................................503 Detecting Errors..............................................................................................504 Building a Networked Application ......................................................................505 Creating the Application Shell ......................................................................505 Window Layout and Startup Functionality ....................................................505 Inheriting from the CAsyncSocket Class ......................................................509 Connecting the Application ............................................................................511 Sending and Receiving ..................................................................................515 Ending the Connection ..................................................................................517 Summary..............................................................................................................519 Q&A ....................................................................................................................519 Workshop ............................................................................................................520 Quiz ................................................................................................................520 Exercise ..........................................................................................................520 Contents xiii DAY 21 ADDING WEB BROWSING FUNCTIONALITY TO YOUR APPLICATIONS 521 The Internet Explorer ActiveX Model ................................................................522 The CHtmlView Class..........................................................................................523 Navigating the Web ........................................................................................523 Controlling the Browser ................................................................................524 Getting the Browser Status ............................................................................524 Building a Web-Browsing Application................................................................525 Creating the Application Shell ......................................................................525 Adding Navigation Functionality ..................................................................526 Summary..............................................................................................................535 Q&A ....................................................................................................................535 Workshop ............................................................................................................536 Quiz ................................................................................................................536 Exercises ........................................................................................................536 WEEK 3 IN REVIEW 537

2009-10-21

Learn the MFC C++ Classes (en)

Learn the MFC C++ Classes Introduction Learn the MFC C++ Classes Acknowledgment Chapter 1—Windows and MFC Windows Operating Systems and MFC C++ Compilers and MFC Windows User Inputs to a Window Messages MFC and Windows OS Interaction The Structure of an MFC Application Creating a Main Window Using MFC The CFrameWnd::Create() Function Registering a New Window Class Resource Files Customized Icon and Cursor Resources Summary Exercise Chapter 2—Menus and Message Maps An Example With a Simple Menu Message Maps Menus Accelerators Handler Functions Setting the Timer Displaying a Message Box Adding Message Map Entries With Compiler Tools An Example That Changes Menus and Submenus Using CMenu Objects CWnd Functions for Messages Summary Exercise Chapter 3—Graphics and Text Drawing The Graphics Device Interface (GDI) The Device Context GDI Objects Device Context Settings Stock Drawing Objects The CDC Class The Device Context Classes An Example That Draws Text and Shapes An Example That Sets the Viewport Origin How a Screen Repaints Itself Creating a Pen Creating a Brush The RGB Macro The Raster Drawing Mode and SetROP2() A Graphics Editor Example C++ Objects for the Rectangle and Ellipse The Graphics Output Process Deleting Drawing Objects Drawing the Rectangles and Ellipses The OnPaint() Function Maintaining the Update Region The Background Color The Handy Utility Classes: CRect, CPoint, and CSize Using a Private Device Context An Example With a Private Device Context Summary Exercise Chapter 4—Fast Drawing and Bitmap Graphics Using Exclusive-or and Exclusive-nor for Fast Redraws Details of the Exclusive-or (Exclusive-nor) Process Limitations of the Exclusive-or (Exclusive-nor) Process Using Backing Store for Fast Redraws Bitmaps Using a Memory Device Context The CDC::BitBlt() Function Using Bitmap Graphics for Animation The Message Handler OnCreate() The Message Handler OnTimer() Device Independent Bitmaps (DIBs) Palettes The System Palette Loading and Using the System Palette Displaying a DIB Using the System Palette Summary Exercise Chapter 5—Child Windows A Child Window The CWnd::Create()Function Message Maps for Child Windows User Messages A Popup Window A Fixed Child Window Summary Chapter 6—Dialogs, Common Dialogs, and Button Controls Dialogs Modal vs. Modeless Dialog Boxes Common Dialogs Class CFileDialog Class CPrintDialog Class CPageSetupDialog Class CFindReplaceDialog Class CFontDialog Class CColorDialog Using the ChooseColor Common Dialog Designing Dialog Boxes Overview of Common Controls Window Styles for Win3.1 Common Controls Button Controls Static Controls Placing Controls on the Mainframe Window Messages To and From Button Controls Messages From the Button Control Messages To the Button Control Example Program Programming the Buttons Example Generating the Main Window’s Code Generating the Dialog Box Code The Buttons Program Listing Discussion of the Buttons Program Summary Chapter 7—List Box, Combo Box, and Edit Controls and Data Transfer Functions Overview of List Box, Combo Box, and Edit Controls Edit Control Styles List Box Styles Combo Box Styles Operations and Messages for Win3.1 Common Controls An Example Program Programming the UsrInput Example Generating the Main Window’s Code Generating the Dialog Box Code The UsrInput Program Listing Discussion of the UsrInput Program Data Transfer Do Data Exchange Functions Dialog Data Validation (DDV) Functions CString Features String Tables and Internationalization Summary Chapter 8—Communication Between Parent and Child for Modal and Modeless Dialogs The Modal Dialog Example The MFC Class CCmdUI The ModalCom Program Listing Data Transfer Modeless Dialog Example Modeless Dialog Creation User Messages Modeless Program Listing Data Updating Special Virtual Functions Summary Exercise Chapter 9—The Document-View Architecture The Structure of the Four Classes Message Routing An Example Document-View Program The PreCreateWindow() Function Customizing the Mainframe Window Overriding the CFrameWnd::PreCreateWindow() Function Mainframe Resources Customizing the View Window The OnDraw() Function Message Maps The Custom Program Listing The Document Template The RUNTIME_CLASS Macro The CView Class Views Based on a Dialog Template Views Based on a Control Summary Chapter 10—Document-View Applications With Filing and Printing Creating an AppWizard Project Designing the Application’s Data Designing the User Interface The Application’s Menu Printing the View The Function OnPrepareDC() Mapping Modes Functions for Printing Print Preview and Print Setup Data Persistence—Filing the Document’s Data Serialization and CArchive The OnNewDocument() Function Multiple Views of the Document ElipsMin Program with Minimum Code ElipsMin Program Listing Discussion of the “ElipsMin” Program Making the Dialog Box Modeless Diagnostic Code Summary Chapter 11—More About Splitter Windows and Filing The Starter Application Multiple View Classes Static Splitter Windows Collection Classes Array Collections List Collections Map Collections Designing the Document’s Data Coding the Document Class CByteArray Member Functions Designing the View of the Rules Using Logical Fonts Text Metrics Coding the View Class Containing the Rules Designing the View of the Game Drawing The Tic Tac Toe Board Drawing the Moves Summary Chapter 12—An MDI Application An MDI Application Class Structure Characteristics Creating New Views Creating New Documents Multiple Menus Keyboard Accelerators The CFormView Class Creating the “Form” Program The “Form” Starter Application The Multiple Document Template The Trace Macro The Document Class Code Additions to the Document Class The View Class Code Additions to the View Class Running the “Form” Program in Debug Mode The “FormMin” Program With Minimum Code “FormMin” Program Listing Discussion of the “FormMin” Program Summary Chapter 13—Toolbars and Status Bars The Bars Example Creating the Bars Starter Application Designing the Document Class Designing the View Class Drawing Adding Scrolling Customizing the Status Bar Adding the Handler Functions Customizing the Toolbar Visual C++ 4 Toolbar Editing Visual C++ 1.5 Toolbar Editing Using Two Document Templates Adding a Dynamic Splitter To An MDI Adding a Document Template Resources for Document Templates Summary Exercise Chapter 14—Custom Controls, New Common Controls, and Property Sheets Custom Controls The CustCtrl Example Building the “CustCtrl” Program The New Common Controls Creating New Common Controls The NewCmnCtrls Example New Common Control Styles Building the NewCmnCtrls Program Getting the AppWizard Starter Application Add the Menu Item Create the Dialog Template Creating the Dialog Class Notification Messages Property Sheets The PropertySheet Example Creating a Modal Property Sheet Building the “PropertySheet” Program Using the Apply Button Summary Appendix A Appendix B Appendix C Appendix D Appendix E Appendix F Appendix G Index

2009-10-21

Embedded Systems Building Blocks.pdf

Embedded Systems Building Blocks.pdf

2009-09-24

uCOS-II The Real-Time Kernel.pdf

My first book, “ μC/OS, The Real-Time Kernel ” is now 6 years old and the publisher has sold well over 15,000 copies around the world. When I was asked to do a second edition, I thought it would be a fairly straightforward task; a few corrections here and there, clarify a few concepts, add a function or two to the kernel, etc. If you have a copy of the first edition, you will notice that “μC/OS-II, The Real-Time Kernel” i in fact a major revision. For some strange reason, I wasn’ s t satisfied with minor corrections. Also, when my publisher told me that this time, the book would be a ‘ hard cover’ I really wanted to give you your moneys worth. In all, I added more than 200 , new pages, and re-wrote the majority of the pages I did keep. I added a porting guide to help you port μ C/OS-II to the processor of your choice. Also, I added a chapter that will guide you through upgrading a μC/OS port to μ C/OS-II. The code for μC/OS-II is basically the same as that of μ C/OS except that it contains a number of new and useful features, is much better commented, and should be easier to port to processor architectures. μ C/OS-II offers all the features provided in μC/OS as well as the following new features: • A fixed-sized block memory manager, • A service to allow a task to suspend its execution for a certain amount of time (specified in hours, minutes, seconds and milliseconds), • User definable ‘ callout’functions that are invoked when: a task is created, a task is deleted, a context switch is performed, a clock tick occurs. • A new task create function that provides additional features, • Stack checking, • A function returning the version of μ C/OS-II, • And more.

2009-09-24

C51单片机SPI双机通信

C51 单片机 SPI 双机通信 从机可控制ISD4004(也为SPI的控制程序)和LCD12864 我调试过,可以用,不过由于从机要完成上次所下达的任务,必需等到完成任务后才能接下一个任务,主机的延时等待不够长,也就不能顺着主机的控制顺序来控制。

2009-08-19

C51单片机双机串口通信

下载直接可用,分为主机和从机,我刚调试过的。双机串口通信,主机键盘发送数据并让灯显示,从机接收数据并让灯显示。有简单的数据校验、长度测试。

2009-07-16

数据结构课程设计报告

1. 平面曲线问题 2. 最佳旅游路线 3. 推广Huffman编码 4. 单词接龙 5. 挖宝藏 6. 迷宫 7. 骑士问题 8. 分油 9. 士兵排队 10. 矩阵排列 11. 填L型 12. FBZ串 13. 3N的方格问题 14. 数串中1的个数问题 15. 数列问题 16. 求最长公共子序列 17. 关键点和桥

2009-06-30

acm程序集 算法 C程序1. 最小生成树(2)

acm 算法 C程序1. 最小生成树(2) Kruskal (GCC)(3) 最优比例生成树 (GCC(4) 最小度限制生成树 (GCC)2. 最短路:.............

2009-05-30

programming linux games

A few years ago I was browsing the computer section at a local bookstore when I bumped into another computer enthusiast. He introduced himself as a game programmer, mentioned a few of the projects he had worked on, and told me about his latest fascination: Linux. It meant little to me at the time, but I filed the conversation away for future reference, and eventually I remembered the name and installed Linux on my home computer.

2009-05-24

GNU c++ linux part2

深入学习:GNU C++ for Linux 编程技术 part2 非常好的书,自己转换的,独一无二!文件比较大,分为四份上传。

2009-05-23

c++数据结构(3)

C++数据结构,英文,不想要分的,无耐自己没分了

2009-05-22

关于ubuntu桌面的xorg.conf

我的桌面,可用来初始化。 可能选用高级图形后,显卡驱动会安装不上。

2009-02-03

空空如也

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

TA关注的人

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