- 博客(15)
- 收藏
- 关注
原创 python实现队列 FIFO
先进先出的队列,比较简单的数据结构,直接贴代码queue=[]def enQ(): queue.append(raw_input(' enter new string: ').strip())def deQ(): if len(queue)==0: print 'cannot pop from an empty queue' else:
2017-07-18 13:13:13
5214
原创 python实现堆栈 后进先出 LIFO
比较简单的数据结构,直接贴代码stack=[]def pushit (): stack.append(raw_input('enter new string:').strip())def popit (): if len(stack)==0: print 'Cannot pop from an empty stack' else:
2017-07-18 12:42:25
2246
原创 leetcode 2. Add Two Numbers python
题目You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and retu
2017-07-13 17:04:22
257
原创 leetcode 1. Two Sum python
闲的蛋疼,每天刷刷。可是发现自己第一题都不会啊,所以记录下来,方便自己复习。题目Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exact
2017-07-13 12:32:48
175
原创 python 中 值传递 引用传递 可更改(mutable)与不可更改(immutable)对象
部分内容参考自可更改(mutable)与不可更改(immutable)对象python中,strings, tuples, 和numbers是不可更改的对象,list,dict等则是可以修改的对象。例子nfoo = 1nfoo = 2lstFoo = [1]lstFoo[0] = 2代码第2行中,内存中原始的1对象因为不能改变,于是被“抛弃”,另nfoo指
2017-07-12 22:24:53
1064
原创 sql统计分组的组数
SELECT COUNT(*) from (SELECT * from enroll GROUP BY org_id) newtable;例子查询攻击的类别数SELECT "count"(*) from (SELECT event_type from internal_app_bsackc."event" group by event_type) as a;
2017-06-26 16:15:23
11044
原创 对于linux系统ifconfig中网卡名和网卡配置文件名称不同的解决办法
问题:linux系统用ifconfig查出来的网卡名和网卡配置文件名称不同,有时根本就没有同名的配置文件。如 ifconfig查出来的是eth1,但是配置文件只有ifcfg-eth0。解决方法:打开ifcfg-eth0 修改如下配置DEVICE=eth1UUID注释掉NAME="System eth1"HWADDR=改为和ifconfig中eth1一样的即可
2017-06-21 10:41:30
9750
转载 vSphere 主机添加磁盘时出现 “指定的参数错误。Vim.Host.DiskPartitionInfo.-spec” 报错
vSphere 主机添加磁盘时出现 “指定的参数错误 Vim.Host.DiskPartitionInfo.-spec” 报错的解决方法。
2017-06-20 10:05:27
4404
转载 Wireshark基本介绍和学习TCP三次握手
转载自http://www.cnblogs.com/TankXiao/archive/2012/10/10/2711777.html
2017-06-06 15:53:16
156
转载 粒子群算法
原文简介 上次在自话遗传算法中提到后期会写两篇关于粒子群算法和蚁群算法的博文,所以这次给大家带来的是我对粒子群的一些理解,并附带一个相当简单的实例去描述这个算法,我会尽力通俗易懂的把整个算法描述一遍,其实粒子群算法的思想也挺简单的,希望我不要反而写复杂了,下面同样引用百度百科的摘要结束简介部分。 粒子群优化算法(PSO)是一种进化计算技术(evolutionary
2016-12-10 16:24:32
450
原创 Hadoop安装配置错误搜集
1 hadoop datanode启动不起来,这个问题一般是由于两次或两次以上的格式化NameNode造成的。参考资料:http://blog.sina.com.cn/s/blog_4c248c5801014nd1.html解决方法:第一种方法是删除DataNode的所有资料(及将集群中每个datanode的/hdfs/data/current中的VERSION删掉,然后执行hadoo
2016-12-07 15:23:37
227
原创 Hadoop安装配置
配置安装hadoop参考文章http://www.open-open.com/lib/view/open1435761287778.html其中有些问题,这是修改后自己的操作流程,亲测无坑。总体思路,准备主从服务器,配置主服务器可以无密码SSH登录从服务器,解压安装JDK,解压安装Hadoop,配置hdfs、mapreduce等主从关系。1、环境,3
2016-12-06 07:28:06
258
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人