Skip to content

Instantly share code, notes, and snippets.

@squallcs12
squallcs12 / text.md
Last active August 29, 2015 14:17
Postgres COPY command

This command is used to load a large data set into table.

The basic usage COPY country FROM '/usr1/proj/bray/sql/country_data'; is work only for existing file on postgres server, which might caught problem with heroku web app.

To do that with django project, you can use the method cursor.copy_from https://pythonhosted.org/psycopg2/cursor.html#cursor.copy_from

With RoR, this may help http://stackoverflow.com/questions/14526489/using-copy-from-in-a-rails-app-on-heroku-with-the-postgresql-backend

====

Generally

I think all features has been implemented in rush, thus there too many coding standard has been violated

Python code style

not follow pep8 standard for python code

  • using tabs intention instead of spaces, spaces is recommended for replacing tabs long ago.
  • no space after : in dict declaration
  • import statements is not grouped and sorted
  • too many code duplication, eg: generating unique id in models
  • module level definition (class, module's method) is separated by only 1 empty line instead of 2 empty lines

Generally

I think all features has been implemented in rushed, thus there too many coding standard has been violated

Python code style

not follow pep8 standard for python code

  • using tabs intention instead of spaces, spaces is recommended for replacing tabs long ago.
  • no space after : and , in dict declaration
  • import statements is not grouped and sorted
  • too many code duplication, eg: generating unique id in models
  • module level definition (class, module's method) is separated by only 1 empty line instead of 2 empty lines
import {call, fork, takeLatest} from 'redux-saga/effects';
import axios from 'axios';
import _ from 'lodash'
import {constants as awsConstants} from '../modules/aws';
export function* uploadFilesToS3 (action) {
const {files, callback, onUploadProgress} = action.payload
try {
第七十八章 玉斧开神海,剑气吐成霞4
苍瞑身为现世神使,却闭上眼睛不敢看众生之恶。但
观衍前辈身怀他心通,却几乎从不听心声。
那些神道有成者,在信仰成神第一步,却是要过滤信徒的杂念
姜望虽修成见闻仙术,得见闻仙域,可称见闻之仙,也当以此类为鉴。