Skip to content

Instantly share code, notes, and snippets.

View agarciadom's full-sized avatar

Antonio García-Domínguez agarciadom

View GitHub Profile
@agarciadom
agarciadom / EOLFormat.tex
Created May 9, 2021 17:43
Listings definition for the EOL language
\lstdefinelanguage{EOL}{
morekeywords={delete,import,for,while,in,and,or,self,operation,return,def,var,throw,if,new,else,transaction,abort,
break,breakAll,continue,assert,assertError,not, switch, case, default},
sensitive=true,
morecomment=[l]{//},
morecomment=[l]{--},
morecomment=[s]{/*}{*/},
morecomment=[s]{-*}{*-},
morestring=[b]",
morestring=[b]',
@agarciadom
agarciadom / gist:0977f2d3b2abb5247bbddcc92c04b7de
Last active November 8, 2020 14:27
Gist for issue 1091 in DuckDB
CREATE SEQUENCE elems_seq;
CREATE TABLE nodes ( id BIGINT PRIMARY KEY, label VARCHAR NOT NULL);
CREATE INDEX nodes_label ON nodes (label);
CREATE TABLE edges (id BIGINT PRIMARY KEY,from_node_id BIGINT NOT NULL,to_node_id BIGINT NOT NULL,label STRING NOT NULL,UNIQUE (from_node_id, to_node_id, label));
CREATE INDEX edges_outgoing ON edges (from_node_id, label);
CREATE INDEX edges_incoming ON edges (to_node_id, label);
CREATE TABLE properties ( elem_id BIGINT NOT NULL, name VARCHAR NOT NULL, value_boolean BOOLEAN, value_long BIGINT, value_int INTEGER, value_float FLOAT, value_double DOUBLE, value_string VARCHAR, value_blob BLOB, PRIMARY KEY (elem_id, name));
CREATE INDEX properties_elemid ON properties (elem_id);
INSERT INTO nodes (id, label) SELECT nextval('elems_seq'), 'test';
SELECT * FROM nodes;
@agarciadom
agarciadom / jlink-notes.txt
Created March 31, 2020 10:05
Some notes on repackaging JavaFX apps as standalone, trimmed + redistributable JREs:
@agarciadom
agarciadom / ECore2GMF.eol
Last active October 9, 2017 15:15
Eugenia polishing tx for an OCL-driven external label for a node
-- Shows an external label on A with the name of the B it's pointing to
var canvas = GmfGraph!Canvas.all.first;
var gallery = canvas.figures;
-- Create figure descriptor for external label
var fd = new GmfGraph!FigureDescriptor;
fd.name = 'AFigureBName';
gallery.descriptors.add(fd);
@agarciadom
agarciadom / Benchmark.java
Last active November 14, 2016 16:38
Simple benchmarks comparing add+sort (timsort since Java 7) vs binary search+add for insertion into a sorted list
package timsort.minibench;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
/**
* <p>
@agarciadom
agarciadom / ocl16-emcjdt-modisco.patch
Created September 1, 2016 11:13
Instrumentation of MoDisco UI for OCL16 EMC JDT paper
diff --git a/org.eclipse.modisco.infra.discovery.ui/src/org/eclipse/modisco/infra/discovery/ui/internal/actions/MoDiscoMenuSelectionListener.java b/org.eclipse.modisco.infra.discovery.ui/src/org/eclipse/modisco/infra/discovery/ui/internal/actions/MoDiscoMenuSelectionListener.java
index 16ef796..469d613 100644
--- a/org.eclipse.modisco.infra.discovery.ui/src/org/eclipse/modisco/infra/discovery/ui/internal/actions/MoDiscoMenuSelectionListener.java
+++ b/org.eclipse.modisco.infra.discovery.ui/src/org/eclipse/modisco/infra/discovery/ui/internal/actions/MoDiscoMenuSelectionListener.java
@@ -165,6 +165,9 @@ public class MoDiscoMenuSelectionListener implements SelectionListener {
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
+
+ final long startMillis = System.currentTimeMillis();
@agarciadom
agarciadom / comment.txt
Created August 18, 2016 15:56
Exception when parsing an ATL file with a certain comment
-- @path OCL=http://www.eclipse.org/ocl/1.1.0/Ecore
-- @path Gremlin=/fr.inria.atlanmod.mogwai.gremlin/model/gremlin.ecore
-- Operations computing a value (collection or not) from a collection
-- transformations from OCL to Gremlin
-- Covered features are:
-- Complex collection operations (operations that necessitate variables to store intermediate
-- results and built-in function calls to compute the operation results)
-- Global variable creation (to store intermediate results)
-- Variable filling
@agarciadom
agarciadom / blog.emf
Created January 26, 2016 11:19
Emfatic fragment for an ecore2thrift blogging service
@thrift(javans="ecore2thrift.example")
@namespace(uri="http://github.com/ecore2thrift", prefix="")
package Blog;
@doc(d="One post in the blog")
class Post {
@doc(d="Title of the post")
attr String title;
@doc(d="Date and time in ISO 8601 format")
attr String date;
@agarciadom
agarciadom / queries.js
Last active October 7, 2015 11:42
Example queries for Hawk - IncQuery integration
// Number of an instances of a type
return %s.all.size;
// Instances of a type
return %s.all;
// Get the number of instances of an EDataType (unseeded) //////////////////////////
@agarciadom
agarciadom / _.md
Last active August 29, 2015 14:06
Ejemplo Jacathon Streamgraph