工作蛮久了,关于代码管理工具:开源代码一般都是使用github,它的使用大多都是以命令行的形式进行(有在coding上做一些demo,但对github命令还是不熟,只能说会用一点,久了还得再看);很多企业用的大多是svn,vs自带的团队资源管理(TFS)。TFS很少用,所以在这只是写SVN的使用。客...
分类:
其他好文 时间:
2015-05-10 20:14:05
阅读次数:
160
python实战-字典使用使用字典统计字符出现次数#! /usr/bin/env python
#coding:utf-8
#定义一个函数,接收字符串,统计出每个字符的出现次数
#实现思路:字典实现,看字符是否在字典中,在则+1,否则计入字典。
def histogram(str):
dic = dict()
for s in str:
if s not in dic...
分类:
编程语言 时间:
2015-05-10 18:59:36
阅读次数:
155
Problem Description
Tom has learned how to calculate the number of inversions in a permutation of n distinct objects by coding, his teacher gives him a problem:
Give you a permutation of n distinct i...
分类:
其他好文 时间:
2015-05-10 09:50:12
阅读次数:
211
在coding.net上部署一个flask应用的过程记录
fork别人的一个flask应用,本地已经跑起来了,现在把它部署到coding上。
想在coding上运行,需要多加一个Procfile文件,官方示例如下
web: gunicorn hello:app -b $VCAPAPPHOST:$VCAPAPPPORT
其中,hello即应用下的主文件,我的是123....
分类:
Web程序 时间:
2015-05-09 16:40:59
阅读次数:
262
requests是python的一个HTTP客户端库,和urllib、urllib2类似,但是urllib2的api比较复杂,比如像实现一个post或是get功能都得需要一大堆代码。
今天先简单介绍一下这个库,等我看过官方文档之后,在写一个全面一点的。
# -*- coding:utf8 -*-
import request
r = requests.get('http://www.zh...
分类:
编程语言 时间:
2015-05-09 16:37:08
阅读次数:
168
# -*- coding: utf-8 -*-
#utf-8支持中文编码
words=['cat','dog','chicken']
for w in words[:]: #words[:]复制了原本的list
words.insert(0, w)
print words
a = range(0,10,4)
print a
args=[3,10,3]
pr...
分类:
编程语言 时间:
2015-05-09 15:06:19
阅读次数:
141
CODE:#!/usr/bin/python # -*- coding: utf-8 -*-'''Created on 2014-8-12@author: guaguastd@name: friends_likes_number.py'''# impot loginfrom login import...
分类:
编程语言 时间:
2015-05-09 14:54:24
阅读次数:
132
# -*- coding: utf-8 -*- #把函数作为参数传入,这样的函数称为高阶函数,函数式编程就是指这种高度抽象的编程范式 #python内建map, reduce函数的用法 map(f, [x1, x2, x3, x4]) = [f(x1), f(x2), f(x3),...
分类:
编程语言 时间:
2015-05-09 11:29:18
阅读次数:
105
Objective-C 编码规范,内容来自苹果、谷歌的文档翻译,自己的编码经验和对其它资料的总结。概要Objective-C 是一门面向对象的动态编程语言,主要用于编写 iOS 和 Mac 应用程序。关于 Objective-C 的编码规范,苹果和谷歌都已经有很好的总结:Apple Coding G...
分类:
其他好文 时间:
2015-05-09 10:10:01
阅读次数:
187
1. net-speeder安装wget https://coding.net/u/njzhenghao/p/download/git/raw/master/net_speeder-installer.shbash net_speeder-installer.sh2. 运行net-speederno...
分类:
Web程序 时间:
2015-05-09 10:04:47
阅读次数:
777