Skip to content

Instantly share code, notes, and snippets.

View abelhegedus's full-sized avatar

Ábel Hegedüs abelhegedus

View GitHub Profile
@abelhegedus
abelhegedus / strace.log
Created April 12, 2015 17:05
strace ssh-agent -d
$ strace ssh-agent -d
2 2 [main] ssh-agent (5952) **********************************************
145 147 [main] ssh-agent (5952) Program name: C:\Program Files\Git\usr\bin\ssh-agent.exe (windows pid 5952)
90 237 [main] ssh-agent (5952) OS version: Windows NT-6.3
89 326 [main] ssh-agent (5952) **********************************************
173 499 [main] ssh-agent (5952) sigprocmask: 0 = sigprocmask (0, 0x0, 0x1802DF0A8)
253 752 [main] ssh-agent 5952 open_shared: name shared.5, n 5, shared 0x180030000 (wanted 0x180030000), h 0x64, *m 6
108 860 [main] ssh-agent 5952 user_heap_info::init: heap base 0x600000000, heap top 0x600000000, heap size 0x20000000 (536870912)
121 981 [main] ssh-agent 5952 open_shared: name S-1-5-21-3261782737-4049003655-1400219572-1001.1, n 1, shared 0x180020000 (wanted 0x180020000), h 0x68, *m 6
91 1072 [main] ssh-agent 5952 user_info::create: opening user shared for 'S-1-5-21-3261782737-4049003655-1400219572-1001' at 0x1800200
@abelhegedus
abelhegedus / exception
Created November 5, 2013 08:48
Exception in queryModTest
!ENTRY org.eclipse.emf.common 2 0 2013-11-05 09:34:11.905
!MESSAGE An exception was ignored during command execution
!STACK 0
org.eclipse.emf.common.util.WrappedException: An exception was ignored during command execution
at org.eclipse.emf.common.command.BasicCommandStack.handleError(BasicCommandStack.java:281)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.handleError(AbstractTransactionalCommandStack.java:125)
at org.eclipse.emf.common.command.BasicCommandStack.execute(BasicCommandStack.java:112)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.basicExecute(AbstractTransactionalCommandStack.java:241)
at org.eclipse.emf.transaction.impl.TransactionalCommandStackImpl.doExecute(TransactionalCommandStackImpl.java:63)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
@abelhegedus
abelhegedus / ObservableTest.java
Last active December 20, 2015 11:19
Buggy UnionSet of ComputedSets
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;
@abelhegedus
abelhegedus / DynamicDelegates.xtend
Last active December 18, 2015 20:48
Sample code for initializing Query-based feature setting delegates in dynamic mode
package school.tests
import org.eclipse.core.resources.IFile
import org.eclipse.emf.ecore.EStructuralFeature
import org.eclipse.incquery.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory
import org.eclipse.incquery.runtime.patternregistry.PatternRegistry
import org.eclipse.incquery.patternlanguage.patternLanguage.Pattern
import org.eclipse.emf.ecore.EPackage
import org.eclipse.emf.ecore.EcoreFactory
import org.eclipse.incquery.runtime.extensibility.QuerySpecificationRegistry
@abelhegedus
abelhegedus / StrangeDeletionTest.xtend
Created November 13, 2012 18:03
Test case to reproduce ITC issue
import org.eclipse.viatra2.patternlanguage.eMFPatternLanguage.PatternModel
import org.eclipse.viatra2.patternlanguage.core.patternLanguage.PatternLanguageFactory
import org.eclipse.viatra2.patternlanguage.eMFPatternLanguage.EMFPatternLanguageFactory
import org.eclipse.emf.ecore.EcorePackage
import org.junit.Test
import org.junit.runner.RunWith
import org.eclipse.xtext.junit4.XtextRunner
import org.eclipse.xtext.junit4.InjectWith
import org.eclipse.viatra2.emf.incquery.testing.core.injector.EMFPatternLanguageInjectorProvider
import org.eclipse.emf.common.util.URI
@abelhegedus
abelhegedus / test.java
Created June 18, 2012 15:47
EMf-IncQuery Testing Framework example
@Test
def shortTest(){
val patternModel = parseHelper.parse('
import "http://www.eclipse.org/viatra2/patternlanguage/core/PatternLanguage"
pattern resolutionTest(Name) = {
Pattern(Name);
} ') as PatternModel
patternModel.assertMatchResults("uri/to/test/expected")
}
@abelhegedus
abelhegedus / ChecklistEntryFeatures
Created June 6, 2012 14:12
Query-driven soft links examples
@QueryBasedFeature(feature = "jobs")
pattern ChecklistEntryJobCorrespondence(CLE : ChecklistEntry, Job : Job) = {
Job.name(Job,JobName);
System.name(System,SysName);
Job.runsOn(Job,System);
ChecklistEntry.jobPaths(CLE,JobPath);
check((JobPath as String).equals((SysName as String).concat('/').concat(JobName as String)));
}
@QueryBasedFeature(feature = "task")
@abelhegedus
abelhegedus / ShowLocationHelper.java
Created June 1, 2012 08:25
Infinite exception with re-executed command
IEditorPart editorPart = pm.getParent().getParent().getEditorPart();
if(editorPart.getSite().getPage().getActiveEditor() != editorPart) {
//bring editor part to top
editorPart.getSite().getPage().bringToTop(editorPart); // this should make it active as well, otherwise infinite execption
IHandlerService handlerService = (IHandlerService) editorPart.getSite().getService(IHandlerService.class);
try {
handlerService.executeCommand(CommandConstants.SHOW_LOCATION_COMMAND_ID, null);
return;
} catch (Exception e) {
IncQueryEngine.getDefaultLogger().logError("Exception when activating show location!", e);
@abelhegedus
abelhegedus / AtLeastThreeAttributes
Created May 24, 2012 15:33
Small examples for EMF-IncQuery part 3
pattern AtLeastThreeAttributes(Cls : EClass) = {
M == count find ClassAttributes(Cls,Attr);
check((M as Integer) > 2);
}
@abelhegedus
abelhegedus / ClassWithGivenNameAndHasAttribute
Created May 24, 2012 15:13
Small examples for EMF-IncQuery part 2
pattern ClassWithGivenNameAndHasAttribute(Cls : EClass) = {
find EClassWithGivenName(Cls);
find ClassAttributes(Cls,Attr);
}