python输出重定向
摘要:0表示标准输入1表示标准输出2表示标准错误输出> 默认为标准输出重定向,与 1> 相同2>&1 意思是把 标准错误输出 重定向到 标准输出.&>file 意思是把 标准输出 和 标准错误输出 都重定向到文件file中举例(test.py)python test.py >right 2>&1 &>al...
阅读全文
posted @
2015-09-30 15:37
星空守望者--jkmiao
阅读(399)
推荐(0) 编辑
使用bs4对海投网内容信息进行提取并存入mongodb数据库
摘要:example: http://xyzp.haitou.cc/article/722427.html首先是直接下载好每个页面,可以使用 os.system( "wget "+str(url)) 或者urllib2.urlopen(url) ,很简单不赘述。然后,重头戏,进行信息抽取:#!/usr/...
阅读全文
posted @
2015-09-29 17:11
星空守望者--jkmiao
阅读(437)
推荐(0) 编辑
Word Frequency
摘要:https://leetcode.com/problems/word-frequency/Write a bash script to calculate the frequency of each word in a text filewords.txt.For simplicity sake, ...
阅读全文
posted @
2015-09-29 11:10
星空守望者--jkmiao
阅读(336)
推荐(0) 编辑
Move Zeroes
摘要:https://leetcode.com/problems/move-zeroes/Given an arraynums, write a function to move all0's to the end of it while maintaining the relative order of...
阅读全文
posted @
2015-09-29 10:51
星空守望者--jkmiao
阅读(158)
推荐(0) 编辑
scrapy 抓取拉勾网数据
摘要:其实很简单,却因为一些小问题,折腾不少时间,简要记录一下,以备后需。>> scrapy startproject lagou>> cd lagou>> scrapy gen lagou_jd www.lagou.com定义item在items.py中继续完善定义:# -*- coding: utf-...
阅读全文
posted @
2015-09-23 12:06
星空守望者--jkmiao
阅读(497)
推荐(0) 编辑
Ugly numbers
摘要:Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For examp...
阅读全文
posted @
2015-09-15 21:56
星空守望者--jkmiao
阅读(155)
推荐(0) 编辑
Missing Number @leetcode
摘要:Given an array containingndistinct numbers taken from0, 1, 2, ..., n, find the one that is missing from the array.For example,Givennums=[0, 1, 3]retur...
阅读全文
posted @
2015-09-15 20:58
星空守望者--jkmiao
阅读(183)
推荐(0) 编辑
H-Index II @python
摘要:Follow upforH-Index: What if thecitationsarray is sorted in ascending order? Could you optimize your algorithm?class Solution(object): def hIndex(s...
阅读全文
posted @
2015-09-15 20:29
星空守望者--jkmiao
阅读(375)
推荐(0) 编辑
latex 入门及使用
摘要:latex 入门及使用LaTeX新人教程,30分钟从完全陌生到基本入门>> vim test.tex\documentclass[11pt,twoside,a4paper]{article} \usepackage{CJKutf8} % 支持中文楷体 \usepackage{i...
阅读全文
posted @
2015-09-14 11:53
星空守望者--jkmiao
阅读(1426)
推荐(0) 编辑
kddcup2015
摘要:kddcup2015,二分类,课程逃课预测。写了好久了,突然想起简单整理一下,以备后需。 step1,预处理,利用numpy和pandas库,数值化特征,简单而优雅 2. 使用各种机器学习方法进行建模,预测 3, 继续特征工程,加强提取特征,AOC值接近89%
阅读全文
posted @
2015-09-14 10:08
星空守望者--jkmiao
阅读(3598)
推荐(0) 编辑
利用python,简单的词语纠错
摘要:利用python,编写一个简单的词语纠正修改器。原文:http://norvig.com/spell-correct.html#!/usr/bin/env python# coding=utf-8import re,collectionsimport string'''How to Write a ...
阅读全文
posted @
2015-09-13 16:37
星空守望者--jkmiao
阅读(1068)
推荐(0) 编辑
在Linux 系统 Latex安装 使用入门教程
摘要:来源: http://blog.chinaunix.net/u/25605/showart_2100398.html入门介绍好文:TeX、LaTeX、TeXLive 小结笔记详情:http://visayafan.com/others/o/latex-lyx.html#sec-14-3一、安装Tex...
阅读全文
posted @
2015-09-12 22:04
星空守望者--jkmiao
阅读(3676)
推荐(0) 编辑
Linux 下查看局域网内所有主机IP和MAC
摘要:Linux 下查看局域网内所有主机IP和MAC用nmap对局域网扫描一遍,然后查看arp缓存表就可以知道局域内ip对应的mac了。nmap比较强大也可以直接扫描mac地址和端口。执行扫描之后就可以cat /proc/net/arp查看arp缓存表了。进行ping扫描,打印出对扫描做出响应的主机: ...
阅读全文
posted @
2015-09-09 22:42
星空守望者--jkmiao
阅读(1068)
推荐(0) 编辑