UILabel文字模糊问题解决

把UILabel放到各种view中,有可能会遇到UILabel中的文字模糊的问题。

看这个模糊的UILabel:
Blur

解决后:
Clear

解决方法如下:
1. 确认UILabel的width和height都为偶数,不是请修改。
2. 确认UILabel的容器(放置这个UILabel的View)的width和height都是偶数,不然也改一下。

重新运行工程,问题解决。

如果还不行,注意width, height, origin.x, origin.y中不要出现小数。
也有可能你多addSubview了你的UILabel也会导致文字变样。注意哈。

开源一个支持表情的UILabel,EmotionLabel

Emotionlabel_demo

这是一个可以把字定义表情字符变成表情图片放到字符串里的UILabel替代的实现,之前有项目中用到就实现了一个(非Emoji)。看到有人要,就放到google code上。
使用了NSAtributeString(基于DTCoreText),可以从demo中看到具体的使用方法。

项目URL:http://code.google.com/p/emotionlabel/

热列欢迎pull request。

Using Beyond compare3 as Git diff tool under Cygwin

在Cygwin下使用Beyond compare3(BC3)作用Git的diff工具
分两步走~


step 1.
create new .sh file as Git's diff warpper.

#!/bin/sh
/cygdrive/c/Program\ Files\ \(x86\)/Beyond\ Compare\ 3/BCompare.exe "$(cygpath -w $2)" "$5"

** please notice here, you need specially make a full path of $2, since BC3 will not find your tmp file under Cygwin path. **
** 注意这里的两个路径, 第二个是本地文件, 因为是相对路径, BC3可以找到. 但第一个是绝对路径指向/tmp/xxx 所以我们要特别指定在windows下的真实路径, 而不是cygwin的路径. 所以我加上了d:/programs/cygwin。

step 2.
Add this line to .bashrc and run it to configure your Git gloabl variable.

git config --global diff.external /home/z33/git-diff-wrapper.sh

Now you can try git diff whatever your file.

The most easy way to install geoip php extension note


1.install GEOIP C Library
http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.6.tar.gz
./configure
make
sudo make install

2.Install GEOIP PHP Extension
sudo pecl install geoip

3.Following message from step2, for example:
Build process completed successfully
Installing '/usr/local/lib/php/20060613/geoip.so'
install ok: channel://pecl.php.net/geoip-1.0.7
configuration option "php_ini" is not set to php.ini location
You should add "extension=geoip.so" to php.ini

4.Install GeoIP database
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gzip -d GeoIP.dat.gz
sudo cp GeoIP.dat /usr/local/share/GeoIP/
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
sudo cp GeoLiteCity.dat /usr/local/share/GeoIP/GeoLiteCity.dat
sudo mv /usr/local/share/GeoIP/GeoLiteCity.dat /usr/local/share/GeoIP/GeoIPCity.dat

5.test
<?php print_r(geoip_record_by_name('125.63.166.38'));