Skip to content

Instantly share code, notes, and snippets.

View hudsonsferreira's full-sized avatar
:octocat:
Working from home

Hudson Ferreira hudsonsferreira

:octocat:
Working from home
View GitHub Profile
rm /usr/local/var/postgres/postmaster.pid
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
1 - Download the lastest Eclipse Juno version;
2 - Open the Eclipse, go to "Help" then "Install New Software";
3 - Set the "Work with" entry field to "Juno" and select
[x] Collaboration -> Subversive SVN Team Provider and
[x] Modeling -> XText SDK.enter at the label ;
4 - Choose the newest SVN adapter;
5 - Import a "Project from SVN" set the link http://svn.codespot.com/a/eclipselabs.org/yakindu/SCT2/trunk/releng on the URL field and download the releng;
6 - Click on "Set as target platform" on the upper right;
7 - To get all required plugins, select "Import Project Set" from the context menu of projectSet.psf and select all working sets;
8 - When you have imported all projects, you may need to rebuild the
@hudsonsferreira
hudsonsferreira / gist:3842279
Created October 5, 2012 20:45
Coisas importantes Yakindu Parser
>>> questions = ['name', 'quest', 'favorite color']
>>> answers = ['lancelot', 'the holy grail', 'blue']
>>> for q, a in zip(questions, answers):
... print 'What is your {0}? It is {1}.'.format(q, a)
...
What is your name? It is lancelot.
What is your quest? It is the holy grail.
What is your favorite color? It is blue.
for tag in tags:
@hudsonsferreira
hudsonsferreira / gist:3717311
Created September 13, 2012 20:20
EIS concept tip
Considerações:
“writes a report”: o evento de escrever um relatório, se utiliza de uma operação humana e
portanto deve ser classificado como um Transformation(Movement) e não como um Operation(Resource).
@hudsonsferreira
hudsonsferreira / eisparser.py
Created September 13, 2012 19:14 — forked from waldofe/eisparser.py
A tool to parse eis pattern content from xml documents.
from os.path import join, basename, dirname
from nltk.util import clean_html
from nltk.corpus.reader import PlaintextCorpusReader
from os import system
import re
class EisParser(object):
def __init__(self, path):
self._name = basename(path)
@hudsonsferreira
hudsonsferreira / gist:3710053
Created September 12, 2012 21:26
modelo de patch para inserir no Yakindu
//deve ser inserido no metodo createStatechartModel da classe FactoryUtils
//path: org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/factories/FactoryUtils.java
public static void createStatechartModel(Resource resource,
PreferencesHint preferencesHint) {
// Create a statechart
Statechart statechart = SGraphFactory.eINSTANCE.createStatechart();
statechart.setSpecification("interface light:\nvar on:boolean\nvar off:boolean\n\ninterface thermostat:\nvar minimum:boolean\nvar maximum:boolean\n\ninterface:\nin event open\nin event close");
String lastSegment = resource.getURI().lastSegment();
String statechartName = lastSegment.substring(0,
@hudsonsferreira
hudsonsferreira / gist:3707842
Created September 12, 2012 16:22
Script para extrair o body do content.xml
import re
from elementtree import ElementTree as etree
def get_text_element(tree):
for i in tree.getiterator():
if 'text' in i.tag and 'text-' not in i.tag:
return i
def return_the_text(element):
string = etree.tostring(element)