自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 softmax 反向传播

and the model parameters θ were trained to minimize the cost functionNotice that this generalizes the logistic regression cost function, which could also have been written:

2017-11-27 10:12:24 9124 1

转载 c++ using 关键字

C++ using关键字作用总结1.在当前文件中引入命名空间这是我们最熟悉的用法,例如:using namespace std;2.在子类中使用 using 声明引入基类成员名称(参见C++ primer)在private或者protected继承时,基类成员的访问级别在派生类中更受限:class Base {public:std::size_t siz

2015-09-10 22:29:17 469

原创 c++11可变参数模板

可变参数模板#include <iostream>using namespace std;template <typename T, typename... Args>void expand(T arg1, Args... args){ cout << arg1; expand(args...);}template <typename ...

2015-09-10 22:26:56 425

转载 BST

#include #include #include #include typedef struct tree{ char data; int hight; int bf; //平衡因子:左树高度减去右树高度 struct tree *lchild; struct tree *rchild; struct tree *parent; /

2015-09-10 19:59:18 397

转载 跳跃表skiplist

参考http://www.cppblog.com/mysileng/archive/2013/04/06/199159.htmlhttp://blog.csdn.net/syzcch/article/details/8050894#include #include #define MAX_LEVEL 10 //最大层数 //节点 typedef struct no

2015-09-10 15:19:52 342

原创 面试搜集

最大最小堆计算中位数 http://gaocegege.com/Blog/algorithm/dynamicmedian/内存分布http://www.cnblogs.com/jacksu-tencent/p/3377232.html游戏服务器 http://blog.jobbole.com/64638/滑动窗口http://www.firefoxbug.com/index.p

2015-08-30 13:22:13 380

转载 UDP打洞

首先先介绍一些基本概念:            NAT(Network Address             Translators),网络地址转换:网络地址转换是在IP地址日益缺乏的情况下产生的,它的主要目的就是为了能够地址重用。NAT分为两大类,基本的NAT和NAPT(Network             Address/Port Translator)。         

2015-08-30 13:10:42 389

转载 c++实现简单反射

#include #include #include using namespace std;typedef void* (*createClass)(void) ;class ClassFactory {public: ClassFactory(){} ; virtual ~ClassFactory(){} ; void* getClassByName(str

2015-06-15 16:29:53 754

原创 wap 笔试题2015

#include #include #include //#pragma warning(disable:4996) vs2013using namespace std;const int MAX_LINE = 500;int a[MAX_LINE][MAX_LINE];int dp[MAX_LINE][MAX_LINE];//int a[4][4] =//{// -1, 4

2015-06-03 15:35:24 859

原创 spark 调优

http://itindex.net/detail/51871-spark-rdd-%E6%A8%A1%E5%9E%8B

2015-05-02 19:41:13 390

原创 函数式编程

http://www.cnblogs.com/kym/archive/2011/03/07/1976519.html

2015-05-01 15:02:40 343

转载 尾递归

http://www.cnblogs.com/Anker/archive/2013/03/04/2943498.html

2015-05-01 14:43:42 342

原创 # ##宏

void quit_command(){printf("I am quit command\n");}   void help_command(){printf("I am help command\n");}   struct command{char * name;void (*function) (void);};  #define COMMAND

2015-04-27 16:05:53 389

原创 ssh

ssh-copy-id 后依然不能免密码登陆执行命令ssh-add即可

2015-04-17 22:23:36 330

转载 手机九宫格密码总数

手机的九宫格图案解锁总共能绘出多少种图案?修改需要满足的要求有:至少经过四个点;不能重复经过同一个点;路径上的中间点不能跳过(如从1到3一定会经过2);如果中间的点是之前已经用过的,那么这个点就可以被跳过(如213,因为2已经被用过,1就可以越过2与3连接,132是不允许的)。修改举报21 条评论 分享 • 邀请回答按投票排序按时间排序18 个回答linkwun,知乎手机客

2015-04-14 20:14:06 1562

原创 微软笔试题-Shortest Proper Prefix

#include#include #include #include #include using namespace std;#define CHILD_NUM 2#define MAXNODE 2000#define MAXLINE 2000int p = 0;struct TrieNode{ TrieNode *childs[CHILD_NUM]; int coun

2015-04-13 19:34:26 433

转载 数组分割

#include#include using namespace std;//有一个没有排序,元素个数为2N的正整数数组。要求把它分割为元素个数为N的两个数组,并使两个子数组的和最接近。int arr[] = { 0,1, 5, 7, 8, 9, 6, 3, 11, 20, 17 };const int N = 5;const int SUM = 87;// 模仿动态规划解0-1

2015-04-13 14:20:19 368

原创 trie树

#define MAX26//字符集大小typedef struct TrieNode{ int nCount;//记录该字符出现次数 struct TrieNode* next[MAX];}TrieNode; TrieNode Memory[1000000];int allocp=0; /*初始化*/void InitTrieRoot(TrieNode* *pR

2015-04-09 10:43:35 358

原创 十本不同的书放在书架上。现重新摆放,使每本书都不在原来放的位置。有几种摆法?

第一步,把第n个元素放在一个位置,比如位置k,一共有n-1种方法;第二步,放编号为k的元素,这时有两种情况.1,把它放到位置n,那么,对于剩下的n-2个元素,就有M(n-2)种方法;2,不把它放到位置n,这时,对于这n-1个元素,有M(n-1)种方法;  综上得到  M(n)=(n-1)[M(n-2)+M(n-1)]  M(1)=0,M(2)=1

2015-04-01 20:25:59 4692

原创 n!末尾有多少个0以及n!末尾第一个非0数字

1.2和5相乘为0即求你n!2 和5的因子数的最小值,而n!5的因子数小于22.每次运算,将结果的0去掉

2015-04-01 20:12:15 577

转载 从一列数中筛除尽可能少的数使得从左往右看,这些数是从小到大再从大到小的(网易)。 题目描述:

#include using namespace std;int DoubleEndLIS(int *arr, int len){ int *LIS = new int[len]; int *lefToRight = new int[len]; //leftToRight[i]表示0~i最长子序列长度-1 int *rightToLeft = new

2015-04-01 20:00:16 630

原创 整数划分,输出

//整数划分问题,输出#include int mark[256];int n;void DFS(int sum,int k,int prio) { if(sum > n) return; if(sum == n) { int i; for( i = 0; i < k-1; i++) printf("%d+",mark[i]); printf("%d\n

2015-04-01 19:47:55 1657

原创 算法

http://www.cnblogs.com/Braveliu/archive/2013/01/21/2870201.html

2015-03-06 10:01:13 342

转载 gcc 内存对齐

CPU以字节为单位编址,而C语言指针以指向的数据类型长度作自增和自减。 gcc下的double的alignment-requirement 在用编译选项-malign-double的时候,double的alignment-requirement是双字(32位机器上就是8),用-mno -align-double的时候,double的alignment-requirement是单字。在我的机器上

2015-02-27 20:51:09 910

原创 c++ 试题

#include <stdio.h>class A{public : bool inited;};A a1;int main(){ A a2; bool t1 = a1.inited; //t1 => false bool t2 = a2.inited; //t2 => true char *p1 = (char

2015-02-27 19:34:30 400

原创 tinyXml

127.0.0.1 8090 127.0.0.2 88#include #include"tinyxml2.h" using namespace std; using namespace tinyxml2; void example2() { XMLDocument doc; doc.LoadFile("test.xm

2015-02-07 13:31:52 345

原创 Winsock select client

if((m_socket = socket(AF_INET, SOCK_STREAM , IPPROTO_TCP )) == INVALID_SOCKET) { printf("Could not create socket : %d\n" , WSAGetLastError()); return; } printf("create socket ok\n"); if (con

2015-01-09 14:51:39 654

原创 c++ 学习笔记

1 多态只有指针,和引用才能表现 多态#include "stdafx.h"#include using namespace std;class Base{public: virtual void print(){ }};class B1 ::public Base{};int main(){ Base b; b.print();}多态的目的:

2015-01-08 15:34:47 434

原创 windows 下 protobuf 使用

下载protobuf-2.5.0.zip,解压打开protobuf  solution编译solution会生成对应的release或debug 版本的protoc.exe libprotobuf-lite.lib ,libprotobuf.lib, libprotoc.lib编译完成-----------------------------------------

2014-12-18 14:55:30 537

原创 算法博客收集

http://www.cnblogs.com/graphics/archive/2010/08/24/1761620.html

2014-12-18 10:03:09 446

转载 数组恰好出现一半的数字

时间复杂度o(n)  扫描一次

2014-12-18 09:43:56 371

原创 wap 机试 旅行家问题

#include #include #include #include #include #include #include #include using namespace std;const int dx[] = { -1 , 0 , 0, 1};const int dy[] = { 0 ,-1 ,1 , 0 }; //4 direction

2014-10-28 22:13:16 657

原创 wap 机试(lsp) 问题 暴力法

#include #include #include #include #include #include using namespace std;const int dx[] = { -1 , 0 , 0, 1};const int dy[] = { 0 ,-1 ,1 , 0 }; //4 directionstruct Point{ Point(){}; Point(

2014-10-28 15:29:41 946

原创 windows 下dll lib

未添加testlibLINK : fatal error LNK1104: cannot open file 'CreateDll.lib'

2014-10-08 16:58:43 481

原创 boost资料

http://zh.highscore.de/cpp/boost/frontpage.html

2014-09-28 23:39:51 424

翻译 序列化 opencv :: Mat

//cvmat_serialization.h#include #include using namespace cv;BOOST_SERIALIZATION_SPLIT_FREE(::cv::Mat)namespace boost { namespace serialization { /** Serialization support for cv::Mat */

2014-09-12 19:53:16 3497

转载 RDD原理

在这些特性中,最难实现的是容错性。一般来说,分布式数据集的容错性有两种方式:即数据检查点和记录数据的更新。我们面向的是大规模数据分析,数据检查点操作成本很高:需要通过数据中心的网络连接在机器之间复制庞大的数据集,而网络带宽往往比内存带宽低得多,同时还需要消耗更多的存储资源(在内存中复制数据可以减少需要缓存的数据量,而存储到磁盘则会拖慢应用程序)。所以,我们选择记录更新的方式。但是,如果更新太多,那

2014-08-20 20:19:15 747 1

原创 ubuntu查看端口对应的进程

netstat -a | gerplsof -i:portkill -

2014-08-20 19:06:23 1590

原创 二叉树 最小公共父节点

#include #include #include #include #include using namespace std;struct TreeNode{ char value; TreeNode * lchild; TreeNode * rchild; TreeNode(char val, TreeNode *lch, TreeNode * rch) :value(v

2014-08-18 22:15:26 694

原创 c++11 版多线程 快速排序

// First.cpp : 定义控制台应用程序的入口点。#include "stdafx.h"#include #include #include #include #include #include #include #include using namespace std;/** @ return the position of x  */in

2014-08-18 16:36:23 1281

空空如也

空空如也

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

TA关注的人

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