#git subtree 的用法
假如有一个iOS的项目,我用到了很多外部的库,如AFNetworking
,我怎么把它集成进来呢?
##通过submodule的方法
把这个项目追加到自己是项目中:
git submodule add [email protected]:AFNetworking/AFNetworking.git Vendor/AFNetworking
#git subtree 的用法
假如有一个iOS的项目,我用到了很多外部的库,如AFNetworking
,我怎么把它集成进来呢?
##通过submodule的方法
把这个项目追加到自己是项目中:
git submodule add [email protected]:AFNetworking/AFNetworking.git Vendor/AFNetworking
#rails engine
此文讲述关于 engine, 他们如何被用来提供额外的功能给他们的宿主程序,如果一个比较干净和容易使用的接口. 读完此文会收获到:
#Rails 国际化
从 rails 2.2开始就支持了 ruby 国际化的 gem. 提供了一个任意使用扩展的框架,用来翻译你的程序一个完整的自定义语言.不仅仅是英语. 给你的程序提供多语言支持.
通常国际化
的过程就是把所有的字符串抽象出来.然后放在特定的地方,而本地化
的过程就是提供对应的翻译和本地的格式.
所以,在 rails 程序里国际化的过程就是:
i18n
#[codility]MinAvgTwoSlice | |
def solution(A): | |
# write your code in Python 2.6 | |
# if one slice is the MA, then the average of its subslices | |
# can not be smaller and also it can not be bigger, or the average of the | |
# whole slice will change | |
# every slice can be divide into two kinds of subslices, e.g., two-element and three element | |
Python is a modern powerful interpreted language with objects, modules, threads, exceptions, and automatic memory managements. Python was introduced to the world in the year 1991 by Guido van Rossum Salient features of Python are
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'fileutils' | |
print 'start....' | |
base_url = 'http://sakalee.lofter.com/?page=' |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'fileutils' | |
print 'start....' | |
base_url = 'http://sakalee.lofter.com/?page=' |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
# quit unless our script gets two command line arguments | |
unless ARGV.length == 1 | |
puts "用法如下:" | |
puts "ruby download_lofter_image.rb '你想下载图片的地址,如:http://sakalee.lofter.com'\n" | |
exit |
require 'redis' | |
$redis = Redis.new({:host => "localhost", :port => "6379"}) | |
#p $redis.ping | |
$redis.flushall | |
i = 0 | |
10.downto 1 do | |
p i | |
i +=1 |