2015年10月15日

摘要: 非常详尽的Horizon配置介绍,转自 dev.cloudwatt.com Deploy Horizon from source with Apache and SSL Some companies may deploy OpenStack clouds but without the Horizon Dashboard interface, and therefore you may wis... 阅读全文
posted @ 2015-10-15 09:08 openqt 阅读(1161) 评论(0) 推荐(0) 编辑

2015年10月12日

摘要: 以root用户进行部署,python源也可以使用 http://mirrors.aliyun.com/pypi/simple/ 修改系统 更改SElinux的配置文件 /etc/selinux/config,SELINUX=disabled ssh-keygen ~/.ssh/authorized_keys 写入 id_rsa.pub 安装Python 2.7.9 ... 阅读全文
posted @ 2015-10-12 19:04 openqt 阅读(346) 评论(0) 推荐(0) 编辑

2015年10月6日

摘要: 1. 准备工作 apt-get install gettext horizon源码下载路径 /workspace/horizon/ 2. 生成mo文件 django-admin.py makemessages -l zh_CN django-admin.py compilemessages 可以看到 locale/zh_CN/LC_MESSAG... 阅读全文
posted @ 2015-10-06 11:36 openqt 阅读(268) 评论(0) 推荐(0) 编辑

2015年2月28日

摘要: networkx虽然提供了基于树的接口,但是对于树这种特殊结构没有良好的构建、显示功能,一切还是基于图来处理的,比如一个简单的二叉树会画成这样: # -*- encoding: utf-8 -*- from matplotlib import pyplot as plt import networkx as nx T = nx.balanced_tree(2, 3) nx.draw(T... 阅读全文
posted @ 2015-02-28 18:04 openqt 阅读(1586) 评论(0) 推荐(0) 编辑
摘要: 最近在看一些算法,需要将抽象的图的数据结构用可视化的方式展现,本来以为matplotlib可能会有潜在的支持,结果发现了一个关于图的计算和展示的模块networkx。这个模块使用非常方便,支持基于dict的邻接表,用来辅助图论的学习很不错。 # -*- encoding: utf-8 -*- from matplotlib import pyplot as plt import netw... 阅读全文
posted @ 2015-02-28 15:17 openqt 阅读(497) 评论(0) 推荐(0) 编辑

2015年2月12日

摘要: # coding: utf-8 # In[95]: import sympy sympy.init_session() e, p, i, o, A = symbols('e, p, i, 0, A') Riemann = symbols('Riemann', cls=Function) # 我们有一个形如以下等式的的数学式子,由于其十分复杂,现将其简化 # 1+1=2 #... 阅读全文
posted @ 2015-02-12 18:54 openqt 阅读(721) 评论(0) 推荐(0) 编辑

2015年2月3日

摘要: 最近一个项目需要正则搜索MongoDB,400多万的数据一次查询要20s以上,需要建立一个前端索引服务。本着部署简单、开发容易的原则,找到了xapian这个索引库。 我使用的是Python的接口,xapian的服务API相当简单,基本的流程是打开库、设置查询条件、取得查询结果。 _enquire = xapian.Enquire(xapian.Database(conf.IDX_DATABASE)... 阅读全文
posted @ 2015-02-03 17:27 openqt 阅读(492) 评论(0) 推荐(0) 编辑

2014年12月6日

摘要: 学习是一种生活方式,于我而言,学习使我更加深刻的认识自我,并且感受到思考的愉悦。 数学、哲学都让我着迷,计算机算法问题虽然在寻找正确方式的道路上很痛苦但是写出优美代码的成就是巨大的。思考让我感受到存在的意义。 阅读全文
posted @ 2014-12-06 12:50 openqt 阅读(278) 评论(0) 推荐(0) 编辑

2014年11月19日

摘要: 28号开始进入项目,到今天基本结束,在这紧张的三周里我学会了很多东西。 紧张的项目周期,复杂的业务逻辑,与前端接口的联调,服务和测试的搭建配置等等很多未知问题一个一个被解决,互联网公司的业务与网站设计结构,这些隐性的知识让我受益匪浅。 这里罗列下技术上从无到有学会的一些东西,算是我踏入互联网行业的迈上的第一个台阶: Flask,Python的网站开发框架,简洁实用,功能完善 flask-sql... 阅读全文
posted @ 2014-11-19 23:16 openqt 阅读(171) 评论(0) 推荐(0) 编辑

2014年11月17日

摘要: 看了《千年难题》,第一章是黎曼猜想。里面有两个我很感兴趣的问题:一是关于函数的图形表示方式,比如z=sin(xy)的图像,二是大数的因子分解方式。 专业的数学软件应该能够很容易的生成各种函数图像,但是我要探求的是作为业余人士利用免费工具和简单的编程语言来描绘函数图形。scipy里面的工具可以做这部分工作。 from mpl_toolkits.mplot3d import Axes3D from ... 阅读全文
posted @ 2014-11-17 23:27 openqt 阅读(1364) 评论(0) 推荐(0) 编辑

2014年11月15日

摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. to... 阅读全文
posted @ 2014-11-15 22:26 openqt 阅读(239) 评论(0) 推荐(0) 编辑

2014年11月6日

摘要: 我从传统的软件公司换到了互联网公司,改变的不仅仅是工作时间。虽然都是计算机领域,但是与传统软件企业相比,其中的不同有如中西方文化差异一样巨大。虽然我工作的时间很长,但是一直从事应用软件编程,在网站开发上算是新手。技术上的不同并没有让我觉得困难,我真正觉得惊讶的是理念方面的截然不同。互联网公司重视的是... 阅读全文
posted @ 2014-11-06 23:35 openqt 阅读(445) 评论(0) 推荐(0) 编辑

2014年10月30日

摘要: 最近买了很多数学方面的书,从《天才引导的历程》,《什么是数学》到《费马大定理》,《黎曼猜想漫谈》。基本上是科普性质,但也需要一定的数学知识和耐心才能读进去。 数学跟我的工作没有太多的联系,只是为了探求智力上的极限,似乎这慢慢成为我娱乐的一种方式。在思考当中我找不到比数学问题更能考验纯粹思维能力的东西了。 在数学家的世界里,用几个月甚至数年的时光去搞明白一些问题好像是很平常的事情。即使是具... 阅读全文
posted @ 2014-10-30 20:05 openqt 阅读(252) 评论(0) 推荐(0) 编辑

2014年10月21日

摘要: Encode a string by counting the consecutive letter. (i.e., "aaaabbxxxyyz" might become "a4b2x3y2z1"). 分析: 这个问题是一个基本的数据压缩算法,将相邻的字符计数存储。解法没有什么特别需要注意的地方,按部就班的实现代码就可以了。 class Solution: # @param s,... 阅读全文
posted @ 2014-10-21 17:18 openqt 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed? Would this affect the run-time complexity? How and why? Suppose a sorted array is rotated at some pivot unknown ... 阅读全文
posted @ 2014-10-21 16:51 openqt 阅读(260) 评论(1) 推荐(0) 编辑
摘要: Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cas... 阅读全文
posted @ 2014-10-21 01:16 openqt 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactl... 阅读全文
posted @ 2014-10-21 00:29 openqt 阅读(209) 评论(0) 推荐(0) 编辑

2014年10月20日

摘要: Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: Elements in a... 阅读全文
posted @ 2014-10-20 23:32 openqt 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: Elements in a triplet (a,b,c) must... 阅读全文
posted @ 2014-10-20 21:09 openqt 阅读(234) 评论(0) 推荐(0) 编辑

2014年10月18日

摘要: Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, whe... 阅读全文
posted @ 2014-10-18 23:28 openqt 阅读(243) 评论(0) 推荐(0) 编辑
摘要: Write a function to find the longest common prefix string amongst an array of strings. 分析: 对一组字符串找到最长公共前缀。 因为只是找前缀所以可以以第一个字符串为基础,按个字符与其它字符串比较,直到有字符串已经遍历完或者碰到不一致的字符,返回到当前为止第一个字符串的前缀即可。 class Solution... 阅读全文
posted @ 2014-10-18 21:16 openqt 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find the minimum element. You may assume no duplicate exists in the arr... 阅读全文
posted @ 2014-10-18 19:52 openqt 阅读(247) 评论(0) 推荐(0) 编辑

2014年10月17日

摘要: 读《费马大定理》这本书的时候,第二章一开始引用了一段文字,出自阿瑟•波格斯(Arthur Porges)的《魔王与西蒙•弗拉格》“你听我说,”魔王吐露说,“就连其它星球上最出色的数学家——远远超出你们——也没能解开这个谜!嗨,土星上有个家伙——他看上去像是踩着高跷的蘑菇——能用心算解偏微分方程,就连... 阅读全文
posted @ 2014-10-17 23:46 openqt 阅读(764) 评论(0) 推荐(0) 编辑

导航