Skip to content

Instantly share code, notes, and snippets.

@ujhelyiz
ujhelyiz / Ant Build script for EMF model building
Created December 12, 2010 22:30
A simple Ant script that can be used inside Eclipse as a builder for Ecore code generation.
<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================================================
Nov 16, 2010 10:33:34 PM
org.eclipse.viatra2.gtasm.model
A test build script to execute GTASM model generation
Zoltan Ujhelyi
====================================================================== -->
<project name="org.eclipse.viatra2.gtasm.model" default="default">
@ujhelyiz
ujhelyiz / IntLongWat.java
Created May 22, 2012 20:02 — forked from bergmanngabor/IntLongWat.java
Playing with semantic holes in Java's notions of equality
public class IntLongWat {
public static void main(String[] args) {
System.out.println(new Integer(1).equals(1));
// true
System.out.println(new Long(1).equals(1));
// false, it only equals 1L - so much for semantic equivalence
System.out.println(new Integer(1).equals(new Long(1)));
// false... Y U NO EQUAL?
@Test
def changeSchoolName(){
val sns = snapshot
val pm = queryInputEIQ
pm.assertMatchResults(sns)
// MODEL MODIFICATION HERE
// change the School "Budapest University of Technology and Economics" name to "BME"
val matcher = pm.initializeMatcherFromModel(sns.EMFRootForSnapshot, "school.schools")
val s = matcher.oneArbitraryMatch.get("Sch") as School
@ujhelyiz
ujhelyiz / new_project.xml
Created November 29, 2012 14:10
Migrating EMF-IncQuery projects to 0.7.0
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.viatra2.emf.incquery.testing.core</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databinding.observable.set.ComputedSet;
import org.eclipse.core.databinding.observable.set.IObservableSet;
import org.eclipse.core.databinding.observable.set.ISetChangeListener;
import org.eclipse.core.databinding.observable.set.SetChangeEvent;
import org.eclipse.core.databinding.observable.set.UnionSet;
import org.eclipse.core.databinding.observable.set.WritableSet;
@ujhelyiz
ujhelyiz / stacktrace.log
Created July 4, 2014 11:38
Exception trace while scrolling with Zest.FX
Exception in thread "JavaFX Application Thread" java.lang.StackOverflowError
at javafx.scene.Parent.updateCachedBounds(Parent.java:1598)
at javafx.scene.Parent.recomputeBounds(Parent.java:1537)
at javafx.scene.Parent.impl_computeGeomBounds(Parent.java:1388)
at javafx.scene.Node.updateGeomBounds(Node.java:3526)
at javafx.scene.Node.getGeomBounds(Node.java:3479)
at javafx.scene.Node.getLocalBounds(Node.java:3427)
at javafx.scene.Node.updateTxBounds(Node.java:3590)
at javafx.scene.Node.getTransformedBounds(Node.java:3373)
at javafx.scene.Parent.updateCachedBounds(Parent.java:1598)
@ujhelyiz
ujhelyiz / 1. SSLTEST.java
Last active August 29, 2015 14:20
SSL issue in Eclipse
package test;
import java.io.DataInputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@ujhelyiz
ujhelyiz / pom.xml
Last active June 22, 2016 06:44 — forked from szarnyasg/pom.xml
VIATRA Maven configuration
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>hu.bme.mit.viatra</groupId>
<artifactId>viatra-maven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.eclipse.viatra</groupId>
@ujhelyiz
ujhelyiz / GenerateDomainmodelLanguage.mwe2
Created March 18, 2016 19:17
Updated domain model generator with Reflective editor
/*******************************************************************************
* Copyright (c) 2010 itemis AG (http://www.itemis.eu) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
module org.eclipse.xtext.example.domainmodel.GenerateDomainmodelLanguage
import org.eclipse.emf.mwe.utils.*
@ujhelyiz
ujhelyiz / toolchains.xml
Last active October 3, 2016 14:54
Toolchain definition for VIATRA
<?xml version="1.0" encoding="UTF-8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<!-- The ID has to be exactly in this format -->
<id>JavaSE-1.7</id>
</provides>
<configuration>
<!-- Path to JDK; JRE will not work! -->