Skip to content

Instantly share code, notes, and snippets.

Anh Le (Andy) anhldbk

Block or report user

Report or block anhldbk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
anhldbk /
Last active Nov 7, 2019
ZaloPay Challenges on Java Programming

1. Overview

  • This is an entry test for our ZaloPay candidates
  • He/she must write solutions in English to answer following problems
  • Code must be written in Java

2. Problems

2.1 Thread safety

anhldbk / pom.xml
Created Dec 14, 2017
build fat jar maven
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""
View flexbox.html
#bar {
background-color: #eee;
height: 600px;
width: 300px;
display: flex;
flex-direction: column;
anhldbk / transport.cpp
Last active Aug 3, 2017
Thrift transport
View transport.cpp
* Generic interface for a method of transporting data. A TTransport may be
* capable of either reading or writing, but not necessarily both.
class TTransport {
* Attempt to read up to the specified number of bytes into the string.
anhldbk / hook.js
Last active Jul 29, 2017
React Composed
View hook.js
import React, { PropTypes } from "react";
import { Scrollbars } from "react-custom-scrollbars";
import ResponsiveComponent from "../responsive";
export default class Card extends ResponsiveComponent {
render() {
const {
View easy_templating.cpp
#define Data_T(type) template <typename T> type Data<T>
template<typename T>
class Data {
T _data;
Data(T data);
anhldbk / lock_benchmarks.cpp
Created Jul 5, 2017
Benchmark for various locking strategies
View lock_benchmarks.cpp
#include <sys/stat.h>
#include <atomic>
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#include <map>
#include <iostream>
#include <string.h>
#include <thread>
#include "lock/RwLock.h"
View atomic_reference.cpp
#include <atomic>
#include <iostream>
#include <thread>
#include <stdint.h>
using namespace std;
void run_in_pool(std::function<void() > routine, uint8_t max_thread = 4) {
std::thread modifiers[max_thread];
uint8_t i;
anhldbk / example.cpp
Created Jul 5, 2017
C/C++ : Returning values by reference
View example.cpp
uint32_t counter = 0;
uint32_t& get_counter(){
return counter;
int main(){
uint32_t _counter = get_counter();
_counter += 1;
cout << _counter << endl; // print 1
anhldbk /
Created Mar 26, 2017
Print all combinations of balanced parentheses
def fill(array, pos, count = 0):
max_count = len(array) / 2
if pos >= len(array ):
if count == 0:
print array
label = {
1: '{',
-1: '}'
You can’t perform that action at this time.