使用Heroku,需要将locale设置为zh_CN,而不是zh-CN
我想大概是因为在application.rb中,config.i18n.default_locale默认接受的值是Symbol, 而当我们用zh-CN的时候,不得不用双引号括起来,
但是实际Rails读取的时候,可能直接使用 :zh-CN这样的标志,所以会出现以下错误提示
ActionView::Template::Er...
                            
                            
                                分类:
其他好文   时间:
2014-06-29 22:46:25   
                                阅读次数:
312
                             
                         
                    
                        
                            
                            
                                前言
在做需求时,经常遇到多个目录,也就是多个维度进行join,这里分析一下,数据是怎么流动的。
1、多目录输入
使用MultipleInputs.addInputPath()  对多目录制定格式和map
2、数据流分析
map按行读入数据,需要对不同的输入目录,打上不同的标记(这个方法又叫reduce端连接),map在输出后会进行partition和sort,按照key进行排序,然后输...
                            
                            
                                分类:
其他好文   时间:
2014-06-29 23:09:07   
                                阅读次数:
348
                             
                         
                    
                        
                            
                            
                                高级报联商
1。在被上司询问之前就去汇报。
2。能预测到工作完成得时间时,就该去汇报。
3。对于较复杂的工作第一报是汇报自己的计划。
4。替对方着想,用联络让对方放心。
5。报联商的频度,应该根据对象/事态的具体情况做出判断。
6。弄清上司的意图。
7。应对上司关心的问题。
8。按上司心目中的重要度,安排汇报的顺序。
9。不做等候指示族。
10。发现问题的苗头要主动汇报。
1...
                            
                            
                                分类:
其他好文   时间:
2014-06-30 06:10:04   
                                阅读次数:
430
                             
                         
                    
                        
                            
                            
                                看源代码的时候,一般都是从整个代码的入口处开始,TI  BLE 协议栈源码也不例外。它的入口main()函数就是整个程序的入口,由系统上电时自动调用。
 
它主要做了以下几件事情:
(一)底层硬件初始化配置
(二)创建任务并初始化任务配置
(三)检测并执行有效的任务事件
 
Main() 函数源码如下:
一:底层硬件初始化设置
75行,设置系统时钟,使能内存缓冲功能。...
                            
                            
                                分类:
其他好文   时间:
2014-06-29 23:17:23   
                                阅读次数:
547
                             
                         
                    
                        
                            
                            
                                题目
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
Below is one possible representation of s1 = "great":
    great
   /...
                            
                            
                                分类:
其他好文   时间:
2014-06-29 23:16:19   
                                阅读次数:
312
                             
                         
                    
                        
                            
                            
                                Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
给定一个整数,把它转换成罗马数字。
输入可以保证在1到3999之间。
下图是转换规则。
1
2
3
4
...
                            
                            
                                分类:
其他好文   时间:
2014-06-30 09:28:05   
                                阅读次数:
308
                             
                         
                    
                        
                            
                            
                                Candy
 Total Accepted: 12392 Total
 Submissions: 68386My Submissions
There are N children standing in a line. Each child is assigned a rating value.
You are giving candies to these childre...
                            
                            
                                分类:
其他好文   时间:
2014-06-29 23:15:17   
                                阅读次数:
228
                             
                         
                    
                        
                            
                            
                                动态更新
先贴模板(吉林大学的模板)
#define INF 0x03F3F3F3F
const int N;
int path[N], vis[N];
void Dijkstra(int cost[][N], int lowcost[N], int n, int beg){
     int i, j, min;
     memset(vis, 0, sizeof(vis));...
                            
                            
                                分类:
其他好文   时间:
2014-06-30 06:09:02   
                                阅读次数:
372
                             
                         
                    
                        
                            
                            
                                http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=655
没有理解清题意就硬套模板,所以WA了好几次,
解析看我的另一篇http://blog.csdn.net/u011026968/article/details/35579035
贴代码
#include 
#include 
#include ...
                            
                            
                                分类:
其他好文   时间:
2014-06-30 09:53:40   
                                阅读次数:
276
                             
                         
                    
                        
                            
                            
                                Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
给定一个罗马数字,把它转换成一个整数。
把罗马数字字符串转换成字符数组先,如下表,每个数字仅对应一个字符,而且字符不一样。故可从头开始取值进行对应。
The R...
                            
                            
                                分类:
其他好文   时间:
2014-06-30 09:52:40   
                                阅读次数:
251
                             
                         
                    
                        
                            
                            
                                面向对象的多态,我们先用生活中的多态来理解。大学的校园四月,是社团活动最紧忙的一个月。届时,学校的相关管理部门会对各社团上交的“社团活动策划案”进行审批后下发。以我曾参加的一个话剧社作为例子,社长接到审批的文书后,会对整个社团组织内部人员进行职权分工,编剧部、后勤部、外联部、秘书部、文艺部所有部门各有分工,分头积极准备工作,大家为了完成共同一部话剧热火朝天地干了起来。
       这里审批的“...
                            
                            
                                分类:
其他好文   时间:
2014-06-30 10:59:25   
                                阅读次数:
227
                             
                         
                    
                        
                            
                            
                                字符串的排列 代码(C)本文地址: http://blog.csdn.net/caroline_wendy题目: 输入一个字符串, 打印出该字符串中字符的所有排列.方法: 使用递归依次交换位置, 打印输出.代码:/*
 * main.cpp
 *
 *  Created on: 2014.6.12
 *      Author: Spike
 */
/*eclipse cdt, gcc 4.8....
                            
                            
                                分类:
其他好文   时间:
2014-06-30 00:52:42   
                                阅读次数:
247
                             
                         
                    
                        
                            
                            
                                【题目】
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
【题意】
    给定一个整数以外,其中除了一个整数只出现一次以外...
                            
                            
                                分类:
其他好文   时间:
2014-06-29 22:52:35   
                                阅读次数:
246
                             
                         
                    
                        
                            
                            
                                【题目】
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a deep copy of the list.
【题意】
    给定一个链表,每个节点除了next指针外,还有一个random指针,指向任意的节点。
    要求,复制这样的一个链表
【思路】
    思路...
                            
                            
                                分类:
其他好文   时间:
2014-06-29 20:41:21   
                                阅读次数:
232