JAXBContext jaxbContext = JAXBContext.newInstance(MyClass.class);
Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
jaxbMarshaller.setProperty("com.sun.xml.internal.bind.characterEscapeHandler", new CharacterEscapeHandler() {
@Override
public void escape(char[] ac, int i, int j, boolean flag, Writer writer) throws IOException {
writer.write(ac, i, j);
}
});
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
def limit(num, minimum=1, maximum=255): | |
"""Limits input 'num' between minimum and maximum values. | |
Default minimum value is 1 and maximum value is 255.""" | |
return max(min(num, maximum), minimum) |
TreeMap
, sıralamada kullanmak üzere bizden bir Comparator
nesnesi ister ve bu Comparator
nesnesini bir field üzerinde tutar. Eğer TreeMap nesnesine verilen bu Comparator nesnesi Serializable
değilse serialization esnasında (cache'e yazma gibi) NotSerializableException alınır. Özellikle anonim sınıf üzerinden oluşturulan Comparator nesnelerine dikkat etmek gerekir.
Çözüm, Comparator
sınıfını Serializable
olarak işaretlemektir. Anonim olarak oluşturulan Comparator yerine top-level (ayrı sınıf) biçiminde Comparator oluşturup Serializable interface'i ile bu sınıfı Serializable olarak işaretleyebiliriz.
From expercise project:
<td>
<input class="form-control" type="text" name="inputValue"
th:maxlength="${T(com.expercise.utils.Constants).MAX_TESTCASE_VALUE_LENGTH}" />
</td>
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
find . -cmin -20 -delete |
git branch --contains COMMIT_SHA1
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
// by Bahtiyar Akbas :) | |
document.querySelectorAll('.deleteLink').forEach(function(e) { | |
var http = new XMLHttpRequest(); | |
var url = e.href; | |
var params = 'atl_token='+getCookieValue('atl.xsrf.token'); | |
http.open('POST', url, true); | |
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | |
http.onreadystatechange = function() { | |
console.log(http.status); | |
} |
http://stackoverflow.com/a/38849483
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
find . -name '*.xm' -exec xmp {} \; |
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
<!-- source:http://stackoverflow.com/a/23217203 --> | |
<properties> | |
<start-class>com.batuhanbayrakci.acayipApp.BiAcayipApplication</start-class> | |
</properties> |