samedi 19 mai 2012

la monnaie



1 ¥ (Yuan) - formel
一元
yuán
1 ¥ (Yuan) - oral 一块kuài
10 centimes - formel 一角jiǎo
10 centimes - oral 一毛 máo
1 centime 一分 fēn
On utilisera la forme plus formelle dans les documents officiels principalement.

Utilisation de 每 (chaque)




En général on utilise 每 (měi) + classificateur + nom

Mais pour le temps il y a des exceptions, on doit (ou on peut) omettre le classificateur.




Chaque année
每年
měinián
Chaque mois 每(个)月
měi( ) yuè
Chaque jour 每天
měitiān
Chaque heure 每(个)小时 měi (gè) xiǎoshí
Chaque minute 每分钟 měi fēnzhōng
Chaque seconde 美秒 měi miǎo




Pareil pour chaque personne : 每(个)人 měi( ) rén

Par ex one peut dire 天1 欧元 (měirén měitiān 1 Ōuyuán) signifie 1 € par jour et par personne (synopsis de Pékin Express).

lundi 7 mai 2012

How to spend IP and RP

We only get so many Influence Points per game, and we have to buy our Riot Points with real money, so I took some time to figure out the best way to spend them.

You can vote for this guide on mobafire if you like it.

Summary

For the adepts of the tl;dr ...

I would use IP mostly for :

  • runes
  • Heroic and Epic champions
  • Legendary Champions when I have all my runes


and RP for :

  • 3 rune pages
  • Legendary Champions
  • per day IP boosts (if I plan to win more than 6 normal games in a single day, or 10 games in 3 days)


Champions

Champions cost range from 450 IP to 6300 IP or from 260 RP to 975 RP.
But the ratio for a Heroic champion is 1.73 RP/IP and for a Legendary champion at 6300 IP the ratio is 6.46 ! (source)








So I will buy Heroic and Epic champions with IP, and Legendary champions with RP.
I will assume next that a reasonnable conversion ratio is 3 IP for 1 RP.

Rune pages

1 rune page costs 6300 IP or 590 RP (ratio 10.7)
7 rune pages cost 7*6300 IP or 2600 RP (ratio 17)
(source)

So I will definitively buy rune pages with RP.

The 7 rune pages bundle is prices as 4.4 single rune pages (in RP). Since I think 5 total pages is enough (1 for each major role (AP mid, carry AD, support, top bruiser, tank jungler) I will only buy 3 additional rune pages for 1770 RP.

IP boosts

Per win IP boost

When playing normal games, an IP boosts gives about 144 additional IP per game. (source)
A 4 wins IP boosts, costing 290 RP thus brings about 576 IP for a ratio of 2.
A 10 wins IP boosts, costing 670 RP thus brings about 1440 IP for a ratio of 2.15.
Since this is much lower than 3, I prefer to spend my RP buying rune pages or Legendary champions than IP boosts. 
The only situation I would buy these IP boosts is if I would really need to buy runes, since they can only be paid in IP.

Per day IP boost

They cost 290 RP for 1 day, 520 RP for 3 days, 1846 RP for 14 days.
In order to get a IP per RP ratio of 3, you need to get :
  • 6 wins in 1 day
  • 11 wins in 3 days (3.6 wins/day)
  • 39 wins in 14 days (2.75 wins/day)

Buying RP with €uros







Since there is not much difference (about 3%), I will only buy what I need instead of committing 50€ to this game.

mardi 17 avril 2012

Décrire une maison ou une chambre d'hôtel

Généralités

Une pièce (de la maison)

fángjiān
房间

Chez moi il y a 2 chambres

jiā
yǒu
liǎng
wòshì
卧室

Dans la chambre il y a ...


zài
wòshì
卧室
(
)
yǒu

Maison ou appartement

(les chinois ont rarement une maison individuelle)
fángzi
房子

Rez-de-chaussée 

(en Chine on commence au 1e étage comme en Amérique)

yīcéng
一层
 ou 
lóu


Au 1e étage il y a 2 chambres


èr
céng
yǒu
liǎng
wòshì
卧室

Meubles, mobilier 


jiājù

家具

Dans un hôtel, une collectivité

Chambre simple


dānrén
单人
fáng
 ou 
dānrénjiān
单人间

Chambre double

shuāngrénfáng
双人房
 ou 
shuāngrénjiān
双人间

Toilettes 


wèishēngjiān
卫生间

On peut aussi employer 厕所 mais c'est plus direct sans être vraiment impoli.

cèsuǒ 

厕所

Salle de bain 


yùshì
浴室


Public / indépendant


(pour une pièce de l'hôtel/de l'appartement)

Public

gōnggòng 
公共  

Indépendant   

dúlì
独立

Ex : salle de bains indépendante
dúlì
独立
wèishēngjiān
卫生间

Suite 

(dans un hôtel)

tàojiān

套间


Climatiseur


kōngtiáo
空调



Télévision


diànshì
电视

Dans la maison

Chambre à coucher


wòshì
卧室

Laverie


xǐyī
洗衣
jiān



Réfrigérateur / congélateur

(c'est le même mot)

bīngxiāng
冰箱



Ordinateur

diànnǎo
电脑


Cuisine 


chúfáng
厨房

Machine à laver 


xǐyījī
洗衣机

vendredi 13 avril 2012

Using Git client with a Subversion server

I aggregated this info from several sources, notably http://www.viget.com/extend/effectively-using-git-with-subversion


Open-source work is stored in git repositories, but our client work is still stored in Subversion repositories, and probably will be for some time. While git is amazing, Subversion still has its good qualities, and makes an excellent centralized repository, especially with its ecosystem of user-friendly tools.

The integration between git and Subversion (git-svn) is so well done that several of us have been using git as our interface to all our Subversion repositories. Doing this is fairly simple, but there are some interesting tricks.

GETTING YOUR REPOSITORY SET UP

Checking out a Subversion repository is as simple as can be:
git svn clone -s http://example.com/my_subversion_repo local_dir

The -s is there to signify that my Subversion repository has a standard layout (trunk/, branches/, and tags/.) If your repository doesn’t have a standard layout, you can leave that off.

As you would expect, this leaves you with a git repository under local_dir. It should map to the trunk of your Subversion repository, with a few exceptions. First, any empty directories under Subversion won’t show up here: git doesn’t track empty directories, as it tracks file contents, not files themselves. Also, files you were ignoring via svn:ignore are not ignored in this git repository. To ignore them again, run the following command in the root of your repository: git svn show-ignore > .gitignore

MAKING BRANCHES


One of the best reasons to use git is its lightweight local branches. These are not the same as Subversion branches: they reside locally and can be created, destroyed, and merged easily. When working on a project, you’ll probably want to create a branch every time you work on a new feature. It’s very simple to do so: run the command git branch new_branch_name master. “master” is the branch you are forking off a new branch from. If you want to fork from the current branch, you don’t have to say so. You can just as easily type git branch new_branch_name. To move to this new branch, you run git checkout new_branch_name. To make things easier, all of these steps can be combined, like so: git checkout -b new_branch_name [old_branch_name]


Again, you do not have to include the old branch name if you do not want to.

To see all the branches in your repository, you can execute git branch. You might wonder why your Subversion branches do not show up. They exist as remote branches, not local branches, but you can still get to them. Execute git branch -a to see local and remote branches, which should show you your Subversion branches and tags.

UPDATING FROM AND COMMITTING BACK TO SUBVERSION

Before committing back to Subversion, you will want to update to apply any new changes in the repository to your local Git repo : git svn rebase

This will download all new changesets from Subversion, apply them to the last checkout from Subversion, and then re-apply your local changes on top of that.

When you’re ready to commit back to Subversion, execute: git svn dcommit

There are a lot more commands and options in git to learn, but these should be sufficient for most day-to-day usage of git as a front-end to your Subversion repository. After using it for the last month, I cannot imagine going back.

USING REMOTE BRANCHES

(From StackOverflow)

Muchas gracias to Bart's Blog for this handy reference for svn branches in git. Apparently all I needed was to specify a remote branch when creating the git branch, e.g. git checkout -b git-topic-branch-foo foo where foo is the name of the remote branch.

This allows to track SVN branches as Git remote branches.

Experience and advanced usage of Git

Why I moved from SVN to Git

I Dislike about Subversion :

  • pollution of deep directories (.svn)
  • slow (most operations access the network)
  • cannot check history or diffs offline
  • does not track mergeinfo (old SVN version currently installed in my company) so repeated merges from the same branch are painful
the Confluence team experienceThe moral of this story is that until Subversion improves, be very careful about merging copies and renames from one branch to another.

I like in Git :

Randal Schwartz introduction
  • Distributed development (works for Linux !)
  • Large file counts
  • Handles complex merges
  • Making trial branches
  • Very fast
  • Robust
  • Pure java library
  • native Eclipse plugin
  • Lets you choose between merge and rebase to publish/hide intermediate commits
But with Git :
  • no history of individual files (does not track explicitely renames)
  • does not handle permissions or ownership

Moving from SVN to Git 

See this other post for the details.

Basic Git usage

My Favorite Git tools

  • Gitblit  is an open-source, pure Java stack for managing, viewing, and serving Git repositories.
    It's designed primarily as a tool for small workgroups who want to host centralized repositories.
    Really simple to configure and use (it took me 30 minutes to setup, and I created 20 repositories since, with users, groups ...)
  • Gource : a fun way to get a graphical view of the history. Almost useful to show to a non technical guy who worked on what

Some advanced usage I really like

Interactive rebase 

rebase -i allows you to rewrite your local history, switch or delete commits ... do this before you push !

Stash 

And never lose your local changes before you checkout or pull.

Find the faulty commit with bisect

  1. write a shell/batch file to test your project / reproduce the issue, for instance
    mvn clean install -DskipTests -o
    mvn test -Dtest=SpringMockTest -o
  2. Clean up your workspace (git stash for instance)
  3. Identify the first and last commits you want to test (either by their sha or tag name) using gitk or git log
  4. Tell git bisect about these boundaries :
    git bisect start HEAD v1.2 -- # HEAD is bad, v1.2 is good
  5. Start git bisect (and go take a coffee if you have a lot of commits to test) :
    git bisect run myShellTest

Filter-branch and modify the past

This allows to modify the history of a repository, for instance to delete files which should not be there.

2 use cases at least :
  • remove sensitive data (passwords) from the history
  • reclaim space by removing zip files, libraries which clutter the repository

Scenario to remove files :

git filter-branch --index-filter 'git rm --cached --ignore-unmatch MyFileName' --prune-empty -- --all

To remove folders :

git filter-branch --index-filter 'git rm -rf --cached --ignore-unmatch MyFolder' --prune-empty -- --all

Note : use simple quotes ' on Linux/Mac but double quotes " on Windows ! (See this post)
Ex on Windows :
git filter-branch --index-filter "git rm -r -f --ignore-unmatch */lib/*.jar" --prune-empty -- --all

You can then push it and force the update with
git push origin master --force


To clean up the space locally :
git reflog expire --expire=now --all
git gc --aggressive --prune=now


The complete documentation I used is on GitHub

mardi 3 avril 2012

Adjectifs et contraires

 bon   
hǎo
   
chà
   
 mauvais
 beau
hǎokàn
好看
   
nánkàn
难看
   
 laid
 savoureux
hàochī
好吃
   
nánchī
难吃
   
 difficile à manger, désagréable au gout
 froid
lěng
   
 chaud
 glacé
bīng
   
 cher
guì
    
piányi
便宜



 bon marché
 joli
měilì
美丽
chǒu
    
 laid
petit (court)
   
gāo
  grand (haut)  
petit
xiǎo
   
   
 grand
jeune 
xiǎo

ou bien :
niánqīng
年轻
     
lǎo

 vieux
sage (qui écoute bien)
tīnghuà
听话
 gentil, harmonieux
héqi
和气
 content
gāoxìng
高兴

nánguò
难过
 triste
 facile
róngyì
容易
nán
   
 difficile
 faux
cuò
duì

 juste, correct
 occupé
máng
   
xián
 libre, loisir
relaxé        
qīngsōng
轻松
lèi
   
 fatigué

jeudi 29 mars 2012

Quelques chansons chinoises

泥娃娃 -  wáwa (chanson chinoise "poupée de terre cuite")






Une version plus classique de la vidéo (avec lse paroles en chinois)

Et le son en mp3

wáwa
娃娃

wáwa
娃娃

wáwa
娃娃

yǒu
méimao
眉毛

yǎnjing
眼睛
miè

wáwa
娃娃

wáwa
娃娃

wáwa
娃娃

yǒu
bízi
鼻子

yǒu
zuǐba
嘴巴

zuǐba
嘴巴
shuōhuà
說話

shì
jiǎ
wáwa
娃娃

bùshì
不是
zhēn
wáwa
娃娃

méiyǒu
沒有
qīn'ài
親愛
de
māma
媽媽

méiyǒu
沒有
bàba
爸爸

wáwa
娃娃

wáwa
娃娃

wáwa
娃娃

zuò
māma
媽媽

zuò
bàba
爸爸

yǒngyuǎn
永遠
ài
zhe
 

小星星 - xiǎo xīng xing (Chinese Version of Twinkle Twinkle Little Star)






shǎn
shǎn liàng
闪亮
jīng jīng
晶晶
un flash, un clignement, la pleine lune


mǎn tiān
满天
dōu
shì
xiǎo
xīng xing
星星
le ciel entier toutes les petites étoiles


guà
zài
tiān shàng
天上
fàng
guāng míng
光明
suspendues dans le ciel, libérées, brillent

hǎo xiàng
好像
tiān shàng
天上
xiǎo
yǎn jing
眼睛
on dirait sur le ciel des petits yeux

shǎn
shǎn liàng
闪亮
jīng jīng
晶晶


mǎn tiān
满天
dōu
shì
xiǎo
xīng xing
星星




Autres



月亮代表我的心(yue liang daibiao wo de xin, la lune représente mon coeur) de la fameuse chanteuse tawainaise Deng Lijun, 邓丽君

茉莉花 Mòlìhuā (fleur de jasmin). La mélodie a été reprise dans l'opéra de Puccini "Turandot".
Les paroles sur Wikipedia.