This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat task_list.txt | gawk '{ print "[" $1 "](https://modelscript.readthedocs.io/en/latest/methods/concepts/"$1")" }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print reduce((lambda x,y:y+x+y),[('%04i %s\n'%(sum(range(1,i+1)),' .'*i)).rjust((63+1)*2+9) for i in range(0,(63+1))]+[(str(sum(range(0,63+1)))*((63+5)/2)+'\n')*2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%load_ext autoreload | |
%autoreload 2 | |
print "reload enabled" | |
import sys; print('Python %s on %s' % (sys.version, sys.platform)) | |
sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This code show how to translates SWI Widgets snippets into a simple | |
# script that can be run directly in the Script window of Modelio. | |
# The code has been translated from java to jython and the first | |
# lines have been accomodated to fit within Modelio (indeed the | |
# eclipse part of modelio). | |
# | |
# This example take a particular exemple "Paint a cirle in a canvas". | |
# You should read th | |
# http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet245.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This code creates two classes in the package MyPackage | |
# The library modelioscriptor is used | |
# The code assume that "MyPackage" is in the model | |
trans = theSession().createTransaction("Class creation") | |
try: | |
fact= theUMLFactory() | |
myp = instanceNamed(Package,"MyPackage") | |
c1 = fact.createClass() | |
c1.setOwner(myp) | |
c1.setName("Class1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///////////////////////////////////////////////// | |
// createFile : | |
// | |
function createFile(path) { | |
notify('Creating file '+ path + '...'); | |
return fileObject.CreateTextFile(path, true, false); | |
} | |
///////////////////////////////////////////////// | |
// deleteFile : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var staruml = new ActiveXObject("StarUML.StarUMLApplication"); | |
var project = staruml.GetProject(); | |
VisitOwnedElement(project,""); | |
function VisitOwnedElement(owner,indent){ | |
for (var i = 0; i < owner.GetOwnedElementCount(); i++){ | |
var element = owner.GetOwnedElementAt(i); | |
// Process the current element | |
staruml.AddMessageItem(1,indent+element.Name+" : "+element.getClassName(),element) ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Const kOpenTermChar = "{" | |
Const kCloseTermChar = "}" | |
Const kExternalTermChar = "^" | |
Const kQuotingChar = """" | |
Const kNewTermIdPrefix = "-" | |
Const kTermIdDelimiter = "#" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// These functions allow to get a list of elements according to the | |
// REPEAT feature of staruml templates | |
// This piece of code comes from the StarUML translators | |
//////////////////////////////////////////////// | |
// getAllRecursiveElements : | |
// | |
function getAllRecursiveElements(isDeep, rootElem, filterType) { | |
// 1.get elem's type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Here comes some code that initialize some global variables | |
// This code is an excerpt of StarUML translators | |
//////////////////////////////////////////////// | |
// createFile : | |
// | |
function createFile(path) { | |
notify('Creating file '+ path + '...'); | |
return fileObject.CreateTextFile(path, true, false); |
NewerOlder