前几天做一个需求用到了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继续阅读 »
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.
解说
这道题的意思是,如何反向删继续阅读 »
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:继续阅读 »
在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继续阅读 »
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.继续阅读 »
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 继续阅读 »
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继续阅读 »