This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.concurrent.ThreadPoolExecutor; | |
| public class MyMonitorThread implements Runnable | |
| { | |
| private ThreadPoolExecutor executor; | |
| private int seconds; | |
| private boolean run=true; | |
| public MyMonitorThread(ThreadPoolExecutor executor, int delay) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FacebookClient facebookClient = new DefaultFacebookClient(token, secretKey); | |
| FacebookClient.AccessToken extendedAccessToken = facebookClient.obtainExtendedAccessToken(appId, secretKey, token); | |
| String extendedToken = extendedAccessToken.getAccessToken(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; | |
| SET time_zone = "+00:00"; | |
| /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
| /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |
| /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |
| /*!40101 SET NAMES utf8 */; | |
| -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class VNCharacterUtils { | |
| // Mang cac ky tu goc co dau | |
| private static char[] SOURCE_CHARACTERS = { 'À', 'Á', 'Â', 'Ã', 'È', 'É', | |
| 'Ê', 'Ì', 'Í', 'Ò', 'Ó', 'Ô', 'Õ', 'Ù', 'Ú', 'Ý', 'à', 'á', 'â', | |
| 'ã', 'è', 'é', 'ê', 'ì', 'í', 'ò', 'ó', 'ô', 'õ', 'ù', 'ú', 'ý', | |
| 'Ă', 'ă', 'Đ', 'đ', 'Ĩ', 'ĩ', 'Ũ', 'ũ', 'Ơ', 'ơ', 'Ư', 'ư', 'Ạ', | |
| 'ạ', 'Ả', 'ả', 'Ấ', 'ấ', 'Ầ', 'ầ', 'Ẩ', 'ẩ', 'Ẫ', 'ẫ', 'Ậ', 'ậ', | |
| 'Ắ', 'ắ', 'Ằ', 'ằ', 'Ẳ', 'ẳ', 'Ẵ', 'ẵ', 'Ặ', 'ặ', 'Ẹ', 'ẹ', 'Ẻ', | |
| 'ẻ', 'Ẽ', 'ẽ', 'Ế', 'ế', 'Ề', 'ề', 'Ể', 'ể', 'Ễ', 'ễ', 'Ệ', 'ệ', | |
| 'Ỉ', 'ỉ', 'Ị', 'ị', 'Ọ', 'ọ', 'Ỏ', 'ỏ', 'Ố', 'ố', 'Ồ', 'ồ', 'Ổ', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE `country` ( | |
| `id` int(11) unsigned NOT NULL AUTO_INCREMENT, | |
| `country_code` varchar(2) NOT NULL, | |
| `country_name` varchar(100) NOT NULL, | |
| PRIMARY KEY (`id`), | |
| KEY `cc` (`country_code`) | |
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| INSERT INTO `country` (`id`, `country_code`, `country_name`) | |
| VALUES |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo touch /var/run/supervisor.sock | |
| sudo chmod 777 /var/run/supervisor.sock | |
| sudo service supervisor restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.junit.Before; | |
| import org.junit.Test; | |
| import static org.junit.Assert.*; | |
| import org.junit.experimental.runners.Enclosed; | |
| import org.junit.runner.RunWith; | |
| /** | |
| * Created by Tu Pham Phuong - phamptu@gmail.com on 1/13/16. | |
| */ | |
| @RunWith(Enclosed.class) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.google.common.cache.*; | |
| import org.junit.Test; | |
| import java.util.HashMap; | |
| import java.util.Map; | |
| import static org.fest.assertions.Assertions.assertThat; | |
| /** | |
| * Created by Tu Pham Phuong - phamptu@gmail.com on 7/2/15. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package controllers; | |
| import org.junit.*; | |
| import static org.junit.Assert.*; | |
| /** | |
| * Created by Tu Pham Phuong - phamptu@gmail.com on 1/11/16. | |
| */ | |
| public class BasicTest { | |
| @BeforeClass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static TemplateService createTemplateService() { | |
| return new TemplateService(); | |
| } |