Skip to content

Instantly share code, notes, and snippets.

Avatar

Chun-Han, Hsiao chhsiao90

View GitHub Profile
View Workaround.java
public <T extends CustomParserConfig> T getConfig(Map<String,Object> configObject, Class<T> classType) {
ModelMapper modelMapper = new ModelMapper();
modelMapper.createTypeMap(configObject, classType).addMappings(new PropertyMap<Map<String,Object>, T>() {
@Override
protected void configure() {
map(source("fields"), destination("fields"));
}
}).map(configObject);
}
View Multiplexing IO.md
SELECT EPOLL
Maximum monitoring fd 1024 No limitation
Mechanism Iterate each fd Iterate each event
@chhsiao90
chhsiao90 / README.md
Last active Aug 20, 2017
lxml installation on Debian/Ubuntu
View README.md

On Debian/Ubuntu

sudo apt-get install g++ gcc libxslt-dev

On CentOS/RedHat

sudo yum install libxslt-devel python-devel
@chhsiao90
chhsiao90 / SimpleNestedListMapping.java
Created Jun 27, 2017
ModelMapper - SimpleNestedListMapping
View SimpleNestedListMapping.java
package org.modelmapper;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.Arrays;
import java.util.List;
import static org.testng.Assert.assertEquals;
@chhsiao90
chhsiao90 / CollectionForConverterTest.java
Created Jun 6, 2017
ModelMapper CollectionForConverterTest
View CollectionForConverterTest.java
package org.modelmapper.functional.iterable;
import static org.testng.Assert.assertEquals;
import org.modelmapper.AbstractTest;
import org.modelmapper.Converter;
import org.modelmapper.PropertyMap;
import org.modelmapper.spi.MappingContext;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@chhsiao90
chhsiao90 / GH224.java
Created May 9, 2017
ModelMapper-GH224
View GH224.java
package org.modelmapper.bugs;
import static org.testng.Assert.assertEquals;
import org.modelmapper.ModelMapper;
import org.modelmapper.PropertyMap;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@Test
View GH167.java
import org.modelmapper.Condition;
import org.modelmapper.Converter;
import org.modelmapper.ModelMapper;
import org.modelmapper.PropertyMap;
import org.modelmapper.spi.MappingContext;
import org.testng.annotations.Test;
import java.util.Arrays;
import java.util.List;
@chhsiao90
chhsiao90 / Release.md
Last active Oct 17, 2017
Release python library
View Release.md

Steps

Step 1

git tag vX.Y.Z
git push --tags

Step 2