Skip to content

Instantly share code, notes, and snippets.

@vhmolinar
vhmolinar / RepositorioExample.java
Created December 23, 2020 18:30
Example of a repository configured to have its connections auto closeable
@TransactionScoped
public class Repository {
@Resource(mappedName = "java:jboss/datasources/MyDS")
private DataSource dataSource;
private Connection connection;
@PostConstruct
public void open() {
@vhmolinar
vhmolinar / build-native-log
Created December 10, 2020 13:25
quartus-cxf - failure building native image
Error: Unsupported features in 5 methods
Detailed message:
Error: Class initialization of com.sun.xml.bind.v2.runtime.output.FastInfosetStreamWriterOutput failed. Use the option --initialize-at-run-time=com.sun.xml.bind.v2.runtime.output.FastInfosetStreamWriterOutput to explicitly request delayed initialization of this class.
Original exception that caused the problem: java.lang.NoClassDefFoundError: org/jvnet/fastinfoset/VocabularyApplicationData
at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1042)
at jdk.unsupported/sun.misc.Unsafe.ensureClassInitialized(Unsafe.java:698)
at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.ensureClassInitialized(ConfigurableClassInitialization.java:177)
at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.computeInitKindAndMaybeInitializeClass(ConfigurableClassInitialization.java:594)
@vhmolinar
vhmolinar / redirect.html
Created May 19, 2020 18:08
Html redirect example
<head>
<link rel="canonical" href="https://yourlink.com"/>
<noscript>
<meta http-equiv="refresh" content="0;URL=https://yourlink.com">
</noscript>
<!--[if lt IE 9]><script type="text/javascript">var IE_fix=true;</script><![endif]-->
<script type="text/javascript">
var url = "https://yourlink.com";
if(typeof IE_fix != "undefined") // IE8 and lower fix to pass the http referer
{
@vhmolinar
vhmolinar / SorteioTurma.js
Last active August 14, 2018 02:41
Sorteio de instrutores para curso na casa espírita
(() => {
'use strict';
const pessoas = [ 'Tarsila',
'Victor Hugo',
'Josue',
'Diego',
'Nicollas',
'Khal',
'Rodrigo',
namespace java com.neoex.model.mds.messages
namespace csharp com.neoex.model.mds.messages
namespace perl com.neoex.model.mds.messages
namespace rb com.neoex.model.mds.messages
namespace py Messages.Mds.PkgMDUpdateAction
enum MDUpdateAction {
New = 0
Change = 1
Delete = 2
public Object deserialize(MessageType msgType, byte[] frame) {
TBase<?, ?> thriftObj;
if (msgType == MessageType.ErrorReport) {
thriftObj = new ErrorReport();
} else {
thriftObj = ThriftMessageFactory.create(msgType);
if (thriftObj == null)
return ReportType.UNKNOWN_MESSAGE_TYPE;
}