自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(39)
  • 收藏
  • 关注

转载 26.Remove Deplicates from Sorted Array

Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for another array, you must do this in place w...

2017-07-24 23:33:00 122

转载 线性表顺序存储结构

// onlinejudge.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#define CardNumber 13#define OK 1#define ERROR 0#define TRUE 1#define FALSE 0#define MAXSIZE 20/**/typedef struct {...

2017-07-20 23:52:00 106

转载 快速判断一个数是否是4的幂次方,若是,并判断出来是多少次方!

快速判断一个数是否是4的幂次方,若是,并判断出来是多少次方!将4的幂次方写成2进制形式后,很容易发现有个特点,2进制中只有1个1(1在奇数位置),并且后面跟了偶数个0;因此问题可以转化为判断1后面是否跟了偶数个0就可以了。4的整数次幂的二进制可以写为2^(2*n),即也可以写成2的幂次方,当然就满足2的幂次方的条件,即num&(num-1)==0.思路:首先用条件nu...

2017-06-26 22:57:00 264

转载 简单易学的机器学习算法——极限学习机(ELM)

极限学习机的概念ELM是一种新型的快速学习算法,对于单隐层神经网络,ELM可以随机初始化输入权重和偏置并得到相应的输出权重。对于一个单隐层神经网络,假设有N个任意的样本,其中,。对于一个有个隐层节点的单隐层神经网络可以表示为其中,为激活函数,为输入权重,为输出权重,是第个隐层单元的偏置。单隐层神经网络的学习目标是使得输出的误差最小,可以表示为即存在...

2017-05-29 22:53:00 448

转载 AUC与ROC—衡量分类器的好坏

二元分类器是指要输出(预测)的结果只有两种类别的模型,既然是一种预测模型,则实际情况一定是有些结果猜对了,有些结果猜错了。因为二元分类器的预测结果有两种类别,对应其真实值,则会有以下四种情形:预测为阳性,真实为阴性(伪阳性)预测为阴性,真实为阳性(伪阴性)预测为阴性,真实为阴性(真阴性)预测为阳性,真实为阳性(真阳性)ROC 空间在信号检测理论中,接收者操...

2016-12-30 21:16:00 329

转载 DataFrame

DataFrameConstructorDataFrame([data,index,columns,dtype,copy])Two-dimensional size-mutable, potentially heterogeneous tabular data structure with labeled axes (rows and columns).Ax...

2016-12-27 21:42:00 87

转载 pandas: powerful Python data analysis toolkit

pandas.read_csvpandas.read_csv(filepath_or_buffer,sep=',',delimiter=None,header='infer',names=None,index_col=None,usecols=None,squeeze=False,prefix=None,mangle_dupe_cols=True,dtype=N...

2016-12-27 21:26:00 118

转载 A simple explanation of the Lasso and Least Angle Regression

http://statweb.stanford.edu/~tibs/lasso.htmlGive a set of input measurements x1, x2 ...xp and an outcome measurement y, the lasso fits a linear modelyhat=b0 + b1*x1+ b2*x2 + ... bp*xpThe crit...

2016-12-23 14:52:00 99

转载 P1433 吃奶酪

题目描述房间里放着n块奶酪。一只小老鼠要把它们都吃掉,问至少要跑多少距离?老鼠一开始在(0,0)点处。输入输出格式输入格式:第一行一个数n (n<=15)接下来每行2个实数,表示第i块奶酪的坐标。两点之间的距离公式=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))输出格式:一个数,表示要跑的最少距离,保...

2016-12-22 22:27:00 124

转载 Relative paths in Python

#For accessing the file inside a sibling folder.filename = os.path.join(fileDir, './Folder2/same.txt')filename = os.path.abspath(os.path.realpath(filename))print filenamereadFile(filena...

2016-12-20 16:04:00 101

转载 How Machine Learning Algorithms Work (they learn a mapping of input to output)

There is a common principle that underlies all supervised machine learning algorithms for predictive modeling.In this post you will discover how machine learning algorithms actually work by und...

2016-12-20 14:48:00 111

转载 Installing theano on Windows 8 with GPU enabled

Theano is a great tool for machine learning applications, yet I found that its installation on Windows is not trivial especially for beginners (like myself) in programming. In my case, I see 5-6x...

2016-12-20 11:28:00 87

转载 Building Your First Image Search Engine in Python

The source code of this demo project:https://github.com/xiaoweige/ImageSearchHere’s a quick overview:What we’re going to do:Build an image search engine, from start to finish, usingThe ...

2016-12-09 17:23:00 166

转载 Install OpenCV in Windows for Python

Here I will tell you how to installOpenCV2.4x in Windows forPython2.7.Pre-requisites ( need to be downloaded ):Python: Download latest version of Python 2.7 fromPython site.Numpy : Downlo...

2016-12-08 18:25:00 89

转载 每种特定的迭代器如何使用

你已经见到了迭代器的一些例子,现在我们将关注每种特定的迭代器如何使用。由于使用迭代器需要关于STL容器类和算法的知识,在阅读了后面的两章后你可能需要重新复习一下本章内容。输入迭代器输入迭代器是最普通的类型。输入迭代器至少能够使用==和!=测试是否相等;使用*来访问数据;使用++操作来递推迭代器到下一个元素或到达past-the-end值。为了理解迭代器和STL函数是如何使用...

2016-11-22 11:36:00 67

转载 常量迭代器

和指针一样,你可以给一个迭代器赋值。例如,首先申明一个迭代器:vector<int>::iterator first;该语句创建了一个vector<int>类的迭代器。下面的语句将该迭代器设置到intVector的第一个对象,并将它指向的对象值设置为123::first = intVector.begin();*first = 123;...

2016-11-21 22:44:00 323

转载 容器迭代器

容器迭代器尽管C++指针也是迭代器,但用的更多的是容器迭代器。容器迭代器用法和iterdemo.cpp一样,但和将迭代器申明为指针变量不同的是,你可以使用容器类方法来获取迭代器对象。两个典型的容器类方法是begin()和end()。它们在大多数容器中表示整个容器范围。其他一些容器还使用rbegin()和rend()方法提供反向迭代器,以按反向顺序指定对象范围。下面的程序创建了一个...

2016-11-21 22:22:00 81

转载 三十分钟掌握STL

STL概述STL的一个重要特点是数据结构和算法的分离。尽管这是个简单的概念,但这种分离确实使得STL变得非常通用。例如,由于STL的sort()函数是完全通用的,你可以用它来操作几乎任何数据集合,包括链表,容器和数组。要点STL算法作为模板函数提供。为了和其他组件相区别,在本书中STL算法以后接一对圆括弧的方式表示,例如sort()。STL另一个重要特性是它不是面向对象的。为了具有足够通...

2016-11-21 11:30:00 61

转载 高快省的排序算法

有没有既不浪费空间又可以快一点的排序算法呢?那就是“快速排序”啦!光听这个名字是不是就觉得很高端呢。假设我们现在对“6 1 2 7 9 3 4 5 10 8”这个10个数进行排序。首先在这个序列中随便找一个数作为基准数(不要被这个名词吓到了,就是一个用来参照的数,待会你就知道它用来做啥的了)。为了方便,就让第一个数6作为基准数吧。接下来,需要将这个序列中所...

2016-11-15 15:02:00 72

转载 FloatTest32 Example

Example Program The following example program pushes two floating-point values onthe FPU stack, displays it, inputs two values from the user, multiplies them, and displays theirproduct:TITLE ...

2016-11-02 16:45:00 124

转载 HeapTest Programs

The following example (Heaptest1.asm) uses dynamic memory allocation to create and fill a1000-byte array:Title Heap Test #1 (Heaptest1.asm)INCLUDE Irvine32.inc; This program uses dynamic ...

2016-11-02 15:43:00 86

转载 Directory Listing Program

Let’s write a short program that clears the screen, displays the current disk directory, and asksthe user to enter a filename. (You might want to extend this program so it opens and displays thes...

2016-10-27 23:51:00 142

转载 Multiplication Table Example

Let’s write a simple application that prompts the user for an integer, multiplies it by ascendingpowers of 2 (from 21 to 210) using bit shifting, and redisplays each product with leading paddedsp...

2016-10-27 23:19:00 129

转载 Checking the Performance of FindArray

FindArray ExampleLet’s create a program that shows how a sample C++ compiler generates code for a functionnamed FindArray. Later, we will write an assembly language version of the function, a...

2016-10-24 23:43:00 88

转载 Linking to C/C++ in Protected Mode

Linking to C/C++ in Protected ModePrograms written for x86 processors running in Protected mode can sometimes have bottlenecksthat must be optimized for runtime efficiency. If they are embedd...

2016-10-24 23:09:00 200

转载 Example: Writing Text Colors

To demonstrate the use of colors and attributes,the WriteColors.asm program creates an array ofcharacters and an array of attributes, one for each character. It calls WriteConsoleOutputAttribut...

2016-10-24 16:23:00 86

转载 Stable Matching Problem

The Stable Matching Problem originated, in part, in 1962, when David Gale and Lloyd Shapley, two mathematical economists, asked the question: Could one design a college admissions process, or a j...

2016-10-21 21:41:00 125

转载 Scrolling the Console Window

The following Scroll.asm program writes 50 lines of text to the screen buffer. It then resizesand repositions the console window, effectively scrolling the text backward. It uses theSetConsoleWin...

2016-10-21 20:19:00 47

转载 ReadFile Program Example

The following program opens a file for input, reads its contents into a buffer, and displays thebuffer. All procedures are called from the Irvine32 library:TITLE Reading a File (ReadFile.as...

2016-10-21 19:55:00 79

转载 Testing the File I/O Procedures

CreateFile Program ExampleThe following program creates a file in output mode, asks the user to enter some text, writes thetext to the output file, reports the number of bytes written, and closes...

2016-10-21 19:49:00 75

转载 AddVariables

; AddVariables.asm - Chapter 3 example.INCLUDE Irvine32.inc.386Comment !;model flat and Irvine32 model can't be used together, ;or multiple .MODEL directives found : .MODEL ignoredM...

2016-10-19 22:02:00 208

转载 Add and Subtract, Version 2

TITLE Add and Subtract, Version 2 (AddSub2.asm); This program adds and subtracts 32-bit integers; and stores the sum in a variable.INCLUDE Irvine32.inc.dataval1 dwor...

2016-10-19 21:51:00 90

转载 Add and Substract

TITLE Add and Subtract (AddSub.asm); This program adds and subtracts 32-bit integers.INCLUDE Irvine32.inc.codemain PROC mov eax,10000h ; EAX = 10000h ...

2016-10-19 21:47:00 302

转载 Read From Console Program

To read characters entered by the user, call GetStdHandle to get the console’sstandard input handle and call ReadConsole, using the same input handle. The following ReadConsole program demonstra...

2016-10-19 21:15:00 88

转载 Keyboard Toggle Keys

TITLE Keyboard Toggle Keys (Keybd.asm)Comment !The following example program demonstrates GetKeyState by checking the states of the Num-Lock and Left Shift keys:Last update: 05/02/2...

2016-10-19 21:05:00 144

转载 ReadKey Test Program

The following program tests ReadKey by waiting for a keypress and then reporting whether or not the CapsLock key is down. Note that, you must include a delay factor when calling ReadKey to allow ...

2016-10-19 20:18:00 86

转载 Displaying a Message Box

Demonstration ProgramWe will demonstrate a short program that demonstrates some capabilities of the MessageBoxAfunction. The first function call displays a warning message:Program ListingFoll...

2016-10-19 20:05:00 75

转载 Getting Started with MASM and Visual Studio

Installingmasm32 SDK and IrvineClick here to get masm32. After install masm32 SDK, the files are stored into C:\masm32 folder.Click this linkto get the latest copy of the book's li...

2016-10-19 17:11:00 120

转载 用Visual Studio 2008编写Win32汇编程序

本文分为以下三个部分: 1)用Visual Studio2008建立一个汇编控制台工程 2)汇编程序模板 3)汇编编写的Hello World程序用Visual Studio2008建立一个汇编控制台工程 打开Visual Studio 2008,创建一个C++空工程 在工程中添加一个.asm文件: 在solu...

2016-10-19 17:00:00 113

空空如也

空空如也

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

TA关注的人

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