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 pl.angulski.example.threads; | |
enum State { | |
HELLO("Hello "), | |
WORLD("world"), | |
EXCLAMATION("!\n"); | |
private final String text; | |
State(String text) { |
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
/** | |
* @author Mateusz Angulski <[email protected]>. | |
*/ | |
public class MapMatrix implements Matrix { | |
private final int size; | |
private final HashMap<String, Integer> matrix; | |
public MapMatrix(int size) { | |
this.size = size; |
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
fun getQuery() = mapOf("page" to page) | |
.filterValues { it != null } | |
.map { "${it.key}=${it.value}" } | |
.joinToString(separator = "&", prefix = "?") | |
.removeSuffix("?") |
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
val dataSource = HikariDataSource(HikariConfig(Properties().apply { | |
setProperty("jdbcUrl", "jdbc:mysql://localhost/rcs_parsing_challenge") | |
setProperty("dataSource.user", "root") | |
setProperty("dataSource.password", "password") | |
put("dataSource.cachePrepStmts", true) | |
put("dataSource.useServerPrepStmts", true) | |
put("dataSource.rewriteBatchedStatements", true) | |
put("maximumPoolSize", 21) | |
put("idleTimeout", 30000) | |
put("autoCommit", false) |
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
while (xmlReader.hasNext()) { | |
xmlReader.next() | |
if (xmlReader.eventType == XMLStreamConstants.START_ELEMENT && xmlReader.localName == "F") { | |
origin = xmlReader.getAttributeValue(null, "o") | |
destination = xmlReader.getAttributeValue(null, "d") | |
route = xmlReader.getAttributeValue(null, "r") | |
} else if (xmlReader.eventType == XMLStreamConstants.START_ELEMENT && xmlReader.localName == "T") { | |
ticketCode = xmlReader.getAttributeValue(null, "t") | |
} else if (xmlReader.eventType == XMLStreamConstants.START_ELEMENT && xmlReader.localName == "FF") { |
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
val fileStream = Thread.currentThread().contextClassLoader.getResourceAsStream("RCS.zip") | |
val zipStream = ZipInputStream(fileStream).apply { nextEntry } | |
val xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(zipStream) |
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
<F i="I" r="00000" o="0035" d="0410"> | |
<T t="0CI"> | |
<FF u="991231" f="150810" s="100000" p="150812" k="07J0" fm="00001"/> | |
</T> | |
<T t="0CK"> | |
<FF u="991231" f="150815" s="100000" p="150817" k="07J2" fm="00001"/> | |
</T> | |
... | |
</F> |
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
ls | xargs -I{} sh -c "echo {}; git -C{} pull" |
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
mysqldump -u $user -p --opt --quote-names --skip-set-charset --default-character-set=latin1 $dbname > dump.sql | |
mysql -u $user -p --default-character-set=utf8 $dbname < dump.sql |
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
Show hidden characters
{ | |
"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}", "&&", "start", "cmd", "/c", "$file_base_name & pause"], | |
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", | |
"working_dir": "${file_path}", | |
"selector": "source.c, source.c++", | |
"shell": true, | |
"variants": | |
[ | |
{ |
NewerOlder