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
grammar de.bomzhi.petrinet.PetrinetDsl with org.eclipse.xtext.common.Terminals | |
generate petrinetDsl "http://www.bomzhi.de/petrinet/PetrinetDsl" | |
PetriNet: | |
(resources+=Resource)+ | |
(places+=Place)+ | |
(transactions+=Transaction)+ | |
; |
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
resource Cross | |
resource Zerro | |
place Start { | |
Cross: 1/.. | |
Zerro: 0/.. | |
} | |
place _1X1 { | |
Cross: 0/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
import java.io.File; | |
public class MakeFilesWritable { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
File root = new File("C:\\foo"); |
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
// | |
// CCAnimate+AsymetricalStart.m | |
// CocosAnimatioPrototype | |
// | |
// Created by Maxim Zaks on 17.10.12. | |
// Copyright (c) 2012 Maxim Zaks. All rights reserved. | |
// | |
#import "CCAnimate+AsymetricalStart.h" | |
#import "CCAnimation.h" |
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
enum ComponentId{ | |
case Velocity | |
case Position | |
case Size | |
func describe()->NSString{ | |
return "\(self.hashValue)" | |
} | |
} |
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
@implementation OMDeferred (FailWithResult) | |
-(void)fail:(NSError *)error withResult:(id)result{ | |
NSAssert(error, @"Error object should not be nil"); | |
NSAssert(error.domain, @"Error object should have a domain"); | |
if(result){ | |
NSMutableDictionary *newUserInfo = [NSMutableDictionary dictionaryWithDictionary:error.userInfo]; | |
newUserInfo[ERROR_RESULT_KEY] = result; | |
error = [NSError errorWithDomain:error.domain code:error.code userInfo:newUserInfo.copy]; | |
} |
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
using Entitas; | |
public class PositionComponent : IComponent { | |
public int x, y; | |
public PositionComponent(int x, int y) | |
{ | |
this.x = x; | |
this.y = y; |
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
// | |
// AVLTree.swift | |
// AVLTree | |
// | |
// Swift port of immutable AVLTree I implemented with Stephan Partzsch | |
// | |
// Original ObjC implementation: https://github.com/StephanPartzsch/AVLTree | |
// | |
// Copyright (c) 2014 Maxim Zaks. All rights reserved. | |
// |
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
using UnityEngine; | |
using UnityEditor; | |
public class RectTransformTools { | |
[MenuItem("GameObject/Adjust RectTransform Anchors %l")] | |
static void Adjust() | |
{ | |
foreach(GameObject gameObject in Selection.gameObjects){ | |
adjustRectTransform(gameObject); |
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
import Foundation | |
public typealias Action = ()->Void | |
/** | |
Bounced action takes interval and action to return another action, which limits the rate at which provided action can be fired. | |
It is like a bouncer at a discotheque. He will act on your questions only after you shut up for 'interval' of time. | |
This technique is important if you have action wich should fire on update, however the updates coming in to frequently sometimes. | |
OlderNewer