Skip to content

Instantly share code, notes, and snippets.

View tandat2209's full-sized avatar
🏆

Tan Dat tandat2209

🏆
View GitHub Profile
@tandat2209
tandat2209 / mangxoacoc.cpp
Last active August 29, 2015 14:14
Mảng xoắn ốc
#include <stdio.h>
#include <conio.h>
const int max=50;
//ham nhap mang
void input(int *a, int *b, int &hang, int &cot){
int dem=0;
printf("Nhap so hang: "); scanf("%d",&hang);
printf("Nhap so cot: "); scanf("%d",&cot);
for(int i=0;i<hang;i++){
@tandat2209
tandat2209 / model.bean.NhanVien.java
Created April 7, 2016 08:37
QuanLyTrungTamMoiGIoiBatDongSan
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package model.bean;
/**
*
* @author dracu
@tandat2209
tandat2209 / Client.java
Created April 12, 2016 08:56
Chat multi client - two thread read and write
package multithreadedchat;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
package matrixTCP;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Matrix {
private int rows;
private int cols;
private double[][] data;
@tandat2209
tandat2209 / BieuThuc.java
Last active May 10, 2016 04:09
Tính gần đúng phương trình
package giaipt;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import bai1_2.KyPhapBaLan;
public class BieuThuc {
private String bieuthuc = "";
var currentClick = 0;
var num = 1;
// list of all connected users
var users = [];
io.on('connection', function(socket){
var newUser = {
name: 'user'+(num++),
numOfClicks: 0
}
// add newUser
@tandat2209
tandat2209 / ClockAngle.java
Created October 14, 2016 01:49
Count angle made of hour hand and minute hand
package com.company;
/**
* Created by tandat on 10/14/16.
*/
public class ClockAngle {
public static void main(String[] args) {
System.out.println("Angle = " + countAngle(12, 15));
}
public static double countAngle(int h, int m){
@tandat2209
tandat2209 / anagrams.js
Created November 8, 2016 09:34
Group Anagrams
function group(arr){
let result = [];
let j=0;
let tmp = arr;
while(tmp.length > 0){
let cmp = tmp[0];
result[j] = [];
for(let i=0; i<tmp.length;i++){
if(isAnagram(cmp, tmp[i])){
result[j].push(tmp[i]);
@tandat2209
tandat2209 / proxy.pac
Last active March 8, 2019 04:37
Proxy.pac
function FindProxyForURL(url, host) {
switch (true) {
case shExpMatch(host, "localdev.*"):
return "PROXY localhost:3000";
case shExpMatch(host, "jp.*.jobing.com"):
return "PROXY localhost:3000";
@tandat2209
tandat2209 / tandat.zsh-theme
Last active April 16, 2019 07:39
tandat.zsh-theme
rvm_current() {
rvm current 2>/dev/null
}
rbenv_version() {
rbenv version 2>/dev/null | awk '{print $1}'
}
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT='${ret_status} %{$fg[cyan]%}$(shrink_path -l -t)%{$reset_color%} $(git_prompt_info)'