2015-08-17 veryyoung
前几天做一个需求用到了sql in 子查询, 大概sql如下 SELECT * FROM table_a WHERE id IN (SELECT id FROM table_id_list) 执行时间150m,完全没法忍受 单独执行 SELECT id FROM table_id_list 秒查,只有七八行结果。 把查询结果写死在sql中 SELECT * FROM table_a WHERE id IN (1,2,3,4,5) 依然秒查 解决方案 再把ID列表select一次 SELECT * FROM table_a WHERE id IN (SELECT id from(SELECT id FROM table 继续阅读 »
2016-06-06 craneyuan
Question Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linked list becomes 1->2->3->5. Note: Given n will always be valid. Try to do this in one pass. 解说 这道题的意思是,如何反向删 继续阅读 »
2014-03-14 Kun Ren
Oftentimes, we obtain a long or a wide table from a certain data source, and it may be the only format we can get. For example, some financial databases provide daily tick data for all stocks in a financial market. The data table may be arranged in a long format like this: 继续阅读 »
2015-12-25 Golmic
在Scrapy框架下 more 蚂蜂窝 ```Python coding=utf-8 import json from urlparse import urljoin import re import logging import scrapy from scrapy.http import Request from scrapy.selector import Selector from andaman.utils.html import html2text, parse_time from andaman.items.qa import QAItem from andaman.items.jieban import Ji 继续阅读 »
2017-01-15 Lu Huang
This page is going to tell how to install tensorflow on ubuntu 16.04 from the github sources. I sugget you to use conda or miniconda as your python, then you can skip section 6: Create the pip package and install. 继续阅读 »
2014-02-20 Kun Ren
People love dealing with well-structured data. It costs much less efforts than working with disorganized raw texts. In economic and financial research, we typically download data from open-access websites or authentication-required databases. These sources may provide data in multiple formats. For example, almost all 继续阅读 »
2016-04-16 jude
声明 文中的 promisify 函数原型出自 月影 的这篇博客。 了解Promise 继续阅读 »
2014-07-25 刘太华
项目用fabric做代码更新, 大体流程是利用fabric的接口, 登录到指定服务器上, 干一些事情. 而实际fabric在执行这个过程的时候, 使用的是ssh协议. 奇怪的问题是, 当在批量操作一些更新的时候, 批量是指可能对单个服务器目标同时有多个fabric的ssh连接操作, 此时会报错ssh_exchange_identification, 已经在一次更新中导致个别项目漏了更新. 仔细google, 已经看到第2页了, 找到的说法几乎都是把 sshd:ALL加入 /etc/hosts.allow中, 但是明显不是我这个问题的答案. 继续阅读 »
2016-07-30 kk
Flask应用中通常会用工厂模式 来创建应用对象,这样方便配置和测试。 应用代码 ```python app/init.py from flask import Flask from flask_xxxext import Xxx from flask_yyyext import Yyy ... 一些flask拓展 xx = Xxx() yy = Yyy() 继续阅读 »
2017-05-30 Lu Huang
This blog is reprinted from colah's blog and some changes are added by myself. About RNN Humans don’t start their thinking from scratch every second. And traditional neural networks have a major shortcoming, and they cannot learn from the previous information. Recurrent neural networks (RNN) address this issue. RNN 继续阅读 »