手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表Tag:post

情人节快乐

情人节快乐


google的图标居然也随之变化,很吃惊
gXOgle? 你没看错. 酒红色的G__gle字母形状没有变化, 中间两个O消失了, 取而代之的是用口红画上去的"xo"两个字母. 以上就是Google 2009情人节的logo图案. 由于时差关系, 谷歌换用logo的时候, google.com还没有换. 其他同在亚洲时区的国家也相继换用了此logo. 第一眼看到X和O, 肯定会想到一个网络名词: "OOXX". 不过, 这可是纯正的中国特色词语, 难道老外也有这种用法吗? 还是, 另有所指? 下面还是请大家欣赏一下这个logo, 然后跟随我们的文章猜想一下为什么logo会是这个样子.
无论如何, 祝所有情侣和所有去死团团员们, 情人节快乐!

XE的说法1: 网络语言"OOXX"

“OOXX online”本来是一款极限单车游戏的名字。“OOXX”即“圈圈叉叉”,就是指单车的车圈和车叉。这款游戏惊险刺激深受年轻人喜爱,因而逐渐引申为“ 惊险刺激的PK”之义。 而后,由于“圈圈叉叉”会被误读或误写作其同音字(和谐),从而“OOXX”就开始具备一些(和谐)的含义了,也就是(和谐)的意思。同时,因为(和谐) 在国人的传统观念中是见不得人的,所以“OOXX”在一些论坛中也指,因作坏事或说错话而被管理员封贴或封号。 有了(和谐)的意思之后,网路上众多具有高度语言天赋和智慧的达人,就真正开始YY和BT这个词了。用象形解释的话, “OO”和“XX”在(和谐)中就拥有了性别上的区分。从而,最终极最强的解释和引申就出现了:“OOXX”指“女上男下”,“XXOO”指 “男上女下”.

摘自百度知道(关键部分请脑内补完).

字面意思的说法2: "XO"

xo是指白兰地中的专用术语. 所有白兰地酒厂, 都用字母来分别品质, 例举如下:
E代表ESPECIAL (特别的)
F代表FINE (好)
V代表VERY (很好)
O代表OLD (老的)
S代表SUPERIOR (上好的)
P代表PALE (淡色而苍老)
X代表EXTRA (格外的)

对于干邑的级别, 法国政府有着极为严格的规则,酒商是不能随意自称的。总括而言,有下列之类别:

3-STAR三星干邑:蕴藏期不少于两年
V.S.O.P干邑:蕴藏期不少于四年
NAPOLEON干邑:蕴藏期不少于六年
X.O.干邑:蕴藏期多在八年以上

XO是白兰地的分级法中,算储存较久的一级。不过在法国的白兰地,除了法国政府所规定的事项外,各厂家为了凸显自己酒款的优势,常常做出比规定更严格条件,使的各家酒款都有自己的特色。而HENNESSY(轩尼诗)也是其中的一家。

摘自百度百科

有点儿靠谱的说法3: Hugs & Kisses

Inmedieval times, most people were unable to read or write. When it came time to sign a document, people who could not write usually made an "X" mark. Of course,an "X" is not much of a signature.To add a sense of commitment, it became customary to kiss the "X" after writing it.

在中世纪, 大多数人的文化水平都比较低. 在签署文件的时候, 中国人一般按手印, 西方人如果不知名字怎么写, 通常写一个"X"作为代替. 当然"X"本身不能作为签名, 为了添加个人信息, 通常会在那个"X"上亲吻一下.

Kissing the "X" was "performance law," a ritual act that bound thepartiesthe way legal documents bind us today. This act, witnessed by the person who wrote the text, represented asolemn guaranteeof the truthfulness of what was written, and an oath to carry out whatever obligations were stated in the document.

亲吻"X"是一项不成文的法则, 就象现在法律文档对我们的约束力一般. 这表明签字人对所写的东西保证其真实有效, 勇于对所写内容承担责任.

Over the years, the "X" and the kiss became interchangeable. Today, people who can read and write might still add one or more "X" marks to their letters, maybe with a couple of "O"s thrown in for hugs.

许多年过去了, "X"变成了和亲吻等价的符号. 人们在写信时加上"X"代表亲吻, 同时加上"O"则表示一个拥抱.

The Oxford English Dictionary states that X is "used to represent a kiss, esp. in the subscription to a letter.". There is no general consensus on the origins of the O as a hug. The O could relate to the shape formed when two hands are crossed in a hug, forming a type of O. The 'X' may also refer to the pursing of the lips when kissing.

牛津英语字典叙述 X 为“用于表达吻,尤其在书信的署名处”。但对于作为拥抱含义的 O 的起源并没有普遍共识。字母 O 可能与拥抱时两手交叠而成 O 的形状有关系。字母 X 可能也与接吻时噘起嘴唇而成的形状有关。

Google往年情人节logo

日期:2008-02-14
日期:2007-02-14
日期:2005-02-14

日期:2004-02-14

日期:2003-02-14

日期:2001-02-14

日期:2001-02-14

日期:2000-02-14

日期:2000-02-14

 

Tags: 情人节

语言包?

本文也是转摘,不过看到它的时候,我想起了discuz的URL解析,discuz在做rewrite的时候,并没有主动都对模版中的链接进行更换,而是在输出前,对于符合规则的那些链接使用rewrite的规范进行了一次批量替换。

这次我转摘的文章也是用了类似的方法,只是他又是.NET处理的,我也不翻译了。知道了原理就行了(和discuz一样,不过这种方法应该只适合做语言包)

原文:

一直以来多语言问题都是个让人头疼的问题,不是这个问题有多难,而是很繁琐,而我们目前的这个项目有点特殊,我希望最大限度的化繁为简,以下是我解决这个问题的方案。
我们的项目有这样两个前提:
1、要支持多语言但最多三种语言,一般情况下就两种语言,所以并没有随时切换语言的要求。
2、我们希望有一种可以初期不用管语言问题,之后统一翻译的方案
基于这么两点,我们提出了这样的方案:
1、初期写程序时不用关心多语言的翻译工作,只要将所有使用到中文的地方都用{}扩上
2、在数据库中Chinese会设置为唯一约束
3、所有的翻译工作会在BasePage中的Render方法中作
4、所有的页面会继承BasePage
5、翻译时会根据当前的语言设置构建以language表中Chinese做key,相应的语言为value的字典,然后查找需要翻译的字符串是不是在字典中,如果不在就生成这一行。

 
数据库设计四个字段

ID,Chinese,English,Other

BasePage源码:

C#代码
  1. using System;  
  2. using System.Data;  
  3. using System.Configuration;  
  4. using System.Linq;  
  5. using System.Web;  
  6. using System.Web.Security;  
  7. using System.Web.UI;  
  8. using System.Web.UI.HtmlControls;  
  9. using System.Web.UI.WebControls;  
  10. using System.Web.UI.WebControls.WebParts;  
  11. using System.Xml.Linq;  
  12. using System.Text.RegularExpressions;  
  13. using System.Text;  
  14. using System.Collections;  
  15. using System.Collections.Generic;  
  16. using System.IO;  
  17. using System.Diagnostics;  
  18.   
  19. /// <summary>  
  20. ///BasePage 的摘要说明  
  21. /// </summary>  
  22. public class BasePage : System.Web.UI.Page  
  23. {  
  24.     //利用Dictionary来筛选所有的多语言标签,然后做替换,可以缓存  
  25.     Dictionary<stringstring> dic;  
  26.     public BasePage()  
  27.     {  
  28.   
  29.     }  
  30.     //需要替换的标签,标签头为数字字母下划线汉字  
  31.   
  32.     static readonly Regex re = new Regex  
  33.         (@"((\{)|(\%7B))[\w\-\+\|u4e00-\u9fa5]+?((\})|(\%7D))",  
  34.         RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace);  
  35.   
  36.     //不需要替换的标签  
  37.     static readonly Regex re_nr = new  
  38.         Regex(@"<NOREPLACE>[\w\W]*?</NOREPLACE>", RegexOptions.Multiline | RegexOptions.IgnoreCase);  
  39.   
  40.     private string RenderTag(ref string content)  
  41.     {  
  42.         if (re_nr.IsMatch(content))//不需要替换标签  
  43.         {  
  44.             StringBuilder sb = new StringBuilder();  
  45.   
  46.             MatchCollection grouplist = re_nr.Matches(content);  
  47.             string[] reList = re_nr.Split(content);  
  48.   
  49.             for (int i = 0; i < grouplist.Count; i++)  
  50.             {  
  51.                 sb.Append(ReplaceTag(ref reList[i]));  
  52.                 sb.Append(grouplist[i].Value);  
  53.                 sb.Append(ReplaceTag(ref reList[i + 1]));  
  54.             }  
  55.   
  56.             content = sb.ToString();  
  57.         }  
  58.         else  
  59.         {  
  60.             content = ReplaceTag(ref content);  
  61.         }  
  62.         return content;  
  63.     }  
  64.   
  65.     private string ReplaceTag(ref string content)  
  66.     {  
  67.         //模板标签{yes},{no},{search}  
  68.         MatchCollection mc = re.Matches(content);  
  69.   
  70.         if (dic == null)  
  71.         {  
  72.             dic = LanguageManager.GetResource();  
  73.         }  
  74.   
  75.         for (int i = 0; i < mc.Count; i++)  
  76.         {  
  77.             //如果数据库中还没有此字符串  
  78.             if (!dic.ContainsKey(mc[i].Value.TrimStart('{').TrimEnd('}')))  
  79.             {  
  80.                  content = content.Replace(mc[i].Value, mc[i].Value.TrimStart('{').TrimEnd('}'));  
  81.   
  82.                 if (!dic.ContainsKey(mc[i].Value.TrimStart('{').TrimEnd('}')))  
  83.                 {  
  84.                     LanguageManager.AddLanguageString(mc[i].Value.TrimStart('{').TrimEnd('}'));  
  85.                 }  
  86.             }  
  87.             else if (dic[mc[i].Value.TrimStart('{').TrimEnd('}')] == null)  
  88.             {  
  89.                 content = content.Replace(mc[i].Value, "$$$$");  
  90.             }  
  91.             else  
  92.             {  
  93.   
  94.                 content = content.Replace(mc[i].Value, dic[mc[i].Value.TrimStart('{').TrimEnd('}')].ToString());  
  95.   
  96.   
  97.             }  
  98.         }  
  99.           
  100.         return content;  
  101.     }  
  102.     protected override void Render(HtmlTextWriter writer)  
  103.     {  
  104.   
  105.         Stopwatch stopwatch = new Stopwatch();  
  106.         stopwatch.Reset();  
  107.         stopwatch.Start();  
  108.         try  
  109.         {  
  110.             //会把页面的输出结果存储在这个StringBuilder中  
  111.             StringBuilder sb = new StringBuilder();  
  112.             StringWriter sw = new StringWriter(sb);  
  113.             HtmlTextWriter htw = new HtmlTextWriter(sw);  
  114.             base.Render(htw);  
  115.             string content = sb.ToString();  
  116.   
  117.             content = RenderTag(ref content);  
  118.   
  119.             //重新写入页面  
  120.             writer.Write(content);  
  121.   
  122.         }  
  123.         catch (Exception ex)  
  124.         {  
  125.             Response.Write(ex.ToString());  
  126.             Response.End();  
  127.         }  
  128.         finally  
  129.         {  
  130.             stopwatch.Stop();  
  131.             Response.Write("runtime:" + stopwatch.ElapsedMilliseconds.ToString() + "ms");  
  132.         }  
  133.   
  134.     }  
  135. }  
这样设计的
优点
1、初期写程序时不用关心多语言的翻译工作,只要将所有使用到中文的地方都用{}扩上
2、省去了大量命名相应文字的工作
3、直接用中文标示要显示到页面的文字,容易理解

缺点
1、如果中文是一样的翻译,而其他语言翻译却不一样时不好解决,但这种情况似乎不常见

————————END————————

缺点就是我说的,只能用来做语言包,呵呵。

Tags: web, 语言包, 数据库