This file contains 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
Using a Consumer pattern vs. a constructor to populate an Enum instance. Handy if you | |
have a good number of fields and don't want long argument lists. Or if you need to do | |
some processing/method calling. | |
final fields would cause issues and would need to be done via a constructor without a callback. | |
public enum SomeEnum { | |
A((c)->{c.someField="A";}), | |
B((c)->{c.lotsMoreFields="B";}), | |
/*Syntax error |
This file contains 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
[ | |
{ | |
"name": "Huawei Y9s / P Smart Pro", | |
"series": "Y Series", | |
"userAgentFingerprint": "STK-L21", | |
"screenSize": 6.59, | |
"wRes": 1080, | |
"hRes": 2340 | |
}, | |
{ |
This file contains 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
wget 'http://www-eu.apache.org/dist/tomcat/tomcat-connectors/native/1.2.14/source/tomcat-native-1.2.14-src.tar.gz' | |
tar xzf tomcat-native-1.2.14-src.tar.gz | |
cd tomcat-native-1.2.14-src/native | |
apt install libapr1-dev libssl-dev gcc make | |
./configure && make && make install | |
Add to /usr/local/tomcat/bin/setenv.sh: | |
export CATALINA_OPTS="$CATALINA_OPTS -Djava.library.path=$PATH:/usr/local/apr/lib/" | |
On a mac: brew install libtcnative. Then add to $tomcat/bin/setenv.sh CATALINA_OPTS="$CATALINA_OPTS -Djava.library.path=/usr/local/opt/tomcat-native/lib" |