February 2012
4 posts
Kaggle - site for competitions
https://www.kaggle.com/competitions
How Google and Microsoft make their sites fast
Very instersting article show how 2 giants hack the TCP connections.
This this article, i realize i forget some knowledge about network principals.
Need to check this again.
http://blog.benstrong.com/2010/11/google-and-microsoft-cheat-on-slow.html?m=1
3 tags
[BUGS] Electro Server 5 Client for iphone SDK
I started new iOS game project. In this project I must connect to a ES5 server.
To do this, i used library provide by ElectroTunk. You can download client library when download all ES5 SDK.
But today, i found a bugs in iOS SDK when handle incomming message from socket stream
In file EsSocketConnection.m, function (void) handleIncomingBytes: (uint8_t*) bytes length: (int) length
- (void)...
Remove ruby 1.8 build-in with Mac OSX
[copy from http://blog.costan.us/2009/03/removing-default-ruby-gems-on-osx.html]
Removing Default Ruby Gems on OSX Leopard
This post describes a quick way to remove the gems that come pre-installed on OSX Leopard. Method First, you should update your gems, so you have newer versions for all the gems you’re about to remove. While you’re at it, update rubygems as well. sudo gem...
January 2012
4 posts
Dia diem an uong ^^
https://www.facebook.com/media/set/?set=a.127135424002263.18775.127133337335805&type=3
Men and 30 years old
For the first thirty years of your life, you make your habits. For the last thirty years of your life, your habits make you.
How to deal with "warning: deprecated conversion...
Obviously, the correct way to fix this is to find every declaration like
char *s = "constant string";
or function call like:
void foo(char *s);
foo("constant string");
and make them to const char * pointer
Another way is we can turn off warning flags of GCC by -Wno-write-strings
Tower defense in Cocos2d
http://www.iphonegametutorials.com/2011/04/11/cocos2d-game-tutorial-how-to-build-a-tower-defense-game-for-the-iphone-part-1-creep-waves/
December 2011
17 posts
Bit functions
Source code was written in last day of 2011
Leave all the bad memories for 2011, and FUCK all the rest
/*******************************************************
* Filename: testbit.cc
* Date: 2011/12/31
* Author: kiennt (trungkien2288@gmail.com)
* Copyright 2011 Kien Nguyen Trung
*
* Purpose:
* + Implement some bit functions i used to do
...
Poem lol
Time flies, if we stop we will die
There ‘s still hope, i need to try
And on the top, i will smile
2 tags
SVN ignore
When you work on large project, you will have a lot of file dont want to share with other people in team. E.g: .o file ,.so file, execuable file. How you can ignore file with svn?
svn .ignore file
# folders
xml
test
dot
png
sysc_test
# build files
*.o
*.so
# execuable file
mergeXML
nfiles
testbool
s2n_move_one_file
s2n_inline
# special files
*.tmp
tags
Config svn:ignore
$>
$> svn...
Bookmarks
http://24ways.org
http://webdesignledger.com/
http://www-graphics.stanford.edu/~seander/bithacks.html
Text arts
Who said models are young and sexy girls
Tree hotel
Hash Function →
Will read later. It looks good
2 tags
Tam Guong
Hãy ngẫm nghĩ những điều này nhé:
Hầu hết mọi người không ý thức về số lượng những lần thực tập, về mức độ kỷ luật khắt khe, về nỗ lực… đã bỏ vào việc phấn đấu trở thành một siêu sao. Thí dụ, Thượng nghị sĩ Mỹ và cũng là cựu ngôi sao bóng rổ Mỹ Bill Bradley đã từng luyện tập không ngừng nghỉ. Trên sân bóng rổ, ông định ra năm vị trí, từ đó ông phải tập ném bóng vào rổ. Nếu sau 25 cú ném...
3 tags
New idea on Facebook
I have new idea for application on FB Do you ever forget about your friend ‘s birthday? Or you ever want to be the first person write on your friend ‘s wall on her/his special day? My app will let you do it automatically. This app let you remember your social events but in funny way and it will be integrated with Facebook
I will implemented this app in 2011 December. Hope it will be...
2 tags
Em có thể làm bất cứ việc gì
Jack bị bại não. Cậu bị liệt tứ chi và chỉ có thể cử động hạn chế một bàn tay, dùng để đẩy cái cần xe lăn của mình.
Mặc dầu không phải là học trò lớp tôi, nhưng cậu thường đến dự, lắng nghe những bài giảng của tôi và tham gia các nhóm thảo luận. Tôi mất một dạo rất khó khăn mới hiểu được lời cậu nói và phải dựa phần lớn vào những lời cắt nghĩa của các b trong lớp. Cậu chia sẻ vi tôi những nỗi lo...
Du lich Tam Dao - another plan :(
List khach san va nha nghi
http://hoidulich.com/index.php?topic=12525.0
November 2011
14 posts
How to motivate employees?
http://www.inc.com/ilya-pozin/9-things-that-motivate-employees-more-than-money.html
Really good articles show us how to make our employees work with passionate.
It show the way to solve problem not only from the manager but also correct with me - an employer.
3 tags
using-bitmaps-with-redis
Today I am reading an awesome article about how to using bitmaps with Redis to calculate realtime metrics
The author is member of [Spool] (http://getspool.com). He explain Spool approach to calculate number of users do a specified action (online, play video, …)
The link of article is [http://blog.getspool.com/2011/11/29/fast-easy-realtime-metrics-using-redis-bitmaps/]...
LINUX file monitor
http://www.ibm.com/developerworks/linux/library/l-inotify/?ca=drs-
http://www.ibm.com/developerworks/linux/library/l-ubuntu-inotify/
These links are used for LINUX only
1 tag
Vim and CTags
One of the most favorite feature of Eclipse is code traversal. When you saw and function call, if you want to know how the function was implemented you can using F3/F4 key to jump to the position which declare/implement function.
At default configuration, VIM does not have this feature. But dont worry, VIM ‘s powerful is it was supported by many programmers. You can add this awesome feature...
1 tag
Traveling, Writing and Programming? Can i do that?
This morning, i read a awesome artical about programming career.
http://alexmaccaw.co.uk/posts/traveling_writing_programming
The author introduces with us about his journey in 10 months. Where he went, what he did and how interesting the journey was? I really love it.
At this time, i also concern about my future. I can specify my true dream and what i should do for a long term instead of...
1 tag
1 tag
2 tags
Add filetype to vim
I am fan of VIM.
Sometime i also use Eclipse, XCode, Visual Studio, but most of my time, i fly with VIM. Simple is the best. IDE and tools are good for someone but not for all.
VIM is clean, fast and powerful.
Today, i want to view regex file with C syntax highlight
Here is the way i done:
I put following lines in .vimrc file
" add new filetype in VIM
filetype on " enable filetype
au...
Most of what we say and do is not essential. If you can eliminate it, you...
– Marcus Aurelius
Ke hoach du lich Sapa
Thoi gian: di tu toi thu sau 25/11, ve sang thu hai 28/11
Lich trinh:
+ Bat tau di luc 9hPM thu sau, gia ve ca 2 luot di ve (du tru tam 300K-700K chua hoi chac chan nen khong ro)
+ Nha nghi: Khach san Song Ngan, gan bo ho (cach nha tho 100m). So dien thoai: 0203871704/0982396258, gia phong 4 nguoi o (phong 2 giuong, khep kin) la 150K (ca dot di) => 50K/nguoi
+ An uong tu lo, chi phi tam...
1 tag
Apache Benchmark tool to test performance
When you build a website for many users, you will need to test the performance of the site to see how fast (or slow) your site work under many thounsands request.
To do this, we can use Apache Benchmark tool (ab) http://httpd.apache.org/docs/2.0/programs/ab.html
Here is the example of how to use ab
$> ab -r -n number_of_request -c number_of_concurent_request
October 2011
8 posts
Create user in Linux
Create user in linux, we using command below
[user]$:
[user]$: sudo useradd -m -p encrypt_password user_name
Where user_name is name of user we want to add, encrypt_password is password was get by ecrypt function
[user]$:
[user]$: perl -e "perl -e 'print crypt("password", "salt"),"\n"'
We also using shell script to make this work easier
#!/bin/bash
# Script to add a user to Linux system
if [...
How to install chrome on Centos
Google chrome is awesome web browser.
It light and fast. I love it
But the bad news is on Google doesn’t support (officially) chrome on Centos.
I try many times, but fail to got it run on my Centos machine
Today, i found this link, it works perfectly with me
http://www.cs.bham.ac.uk/~cxs548/chrome
We can lie other people everday, but we can’t do the samething with our...
MAC terminal
command updatedb for mac
$>
$> sudo /usr/libexec/locate.updatedb
command locate is similar with Linux
XCode Template
Change __MyCompanyName__ in Xcode
# using terminal
$> defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{ORGANIZATIONNAME="Kien Nguyen Trung";}'
Grand Central Dispatch - some link to read
http://www.mikeash.com/pyblog/?tag=gcd
http://www.raywenderlich.com/4295/multithreading-and-grand-central-dispatch-on-ios-for-beginners-tutorial
Background Task on IPHONE →
Execellent approach to make app running “infinite”
2 tags
VIM Tips
1. Filter files with NERDTree
NERDTree is ROCK. It made us easily to naviagate files with VIM.
But sometimes, when open a folders, we dont want to show some kinds of files (.o, .so files). To do this, we just simple set NERDTreeIgnore variable in .vimrc
let NERDTreeIgnore=['\.so$', '\.pyc$', '^a.out$', '\.d$', '\.o$', '\.sir$', '\.si$', '\.fla$', '\.flas$', '\.fls$']
2. Comment in VIM
What if...
September 2011
23 posts
2 tags
2 tags
SSH and some useful tips
1. Login without password
Assume that you from computer A@hostA and want to ssh to B@hostB. But you often do it and asking your password everytime you login B@hostB is suck. You want to do it fast.
First log in on hostA as user A and generate a pair of authentication keys. Do not enter passphase
[A@hostA]$ ssh-keygen -t rsa
Now use ssh to create a directory ~/.ssh as user b on B. (The...