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
const fs = require('fs'); | |
const path = require('path'); | |
const ignored = ['.git', 'migrate.js']; | |
const encoding = 'latin1'; | |
function allFiles(rootPath, action) { | |
const files = fs.readdirSync(rootPath); | |
for (const e of files) { |
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
yarn licenses v1.12.3 | |
info [email protected]: The platform "linux" is incompatible with this module. | |
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. | |
├─ (BSD-2-Clause OR MIT OR Apache-2.0) | |
│ └─ [email protected] | |
│ ├─ URL: https://github.com/dominictarr/rc.git | |
│ ├─ VendorName: Dominic Tarr | |
│ └─ VendorUrl: dominictarr.com | |
├─ (GPL-2.0 OR MIT) | |
│ └─ [email protected] |
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
// Part 1 | |
org.xtext.homeautomation | |
// To Be Parsed | |
Device Window can be OPEN, CLOSED | |
Device Heating can be ON, OFF | |
Rule 'Close Window, when heating turned on' |
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 char character; | |
while ((character = buffer.get) != PacketConstants.STRING_TERMINATOR) { | |
// do stuff | |
} |
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
package superConstr | |
import org.eclipse.xtend.lib.macro.AbstractClassProcessor | |
import org.eclipse.xtend.lib.macro.Active | |
import org.eclipse.xtend.lib.macro.TransformationContext | |
import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration | |
import org.eclipse.xtend.lib.macro.declaration.MutableClassDeclaration | |
import org.eclipse.xtend.lib.macro.declaration.Visibility | |
@Active(SuperProcessor) |
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
@Active(ExternalizedProcessor) | |
annotation Externalized {} | |
class ExternalizedProcessor extends AbstractClassProcessor implements CodeGenerationParticipant<ClassDeclaration> { | |
override doTransform(MutableClassDeclaration annotatedClass, extension TransformationContext context) { | |
for (field : annotatedClass.declaredFields) { | |
val initializer = field.initializerAsString | |
val msgFormat = try { | |
new MessageFormat(initializer) |
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
package basepack.exmaple2 | |
import java.util.Map | |
import org.eclipse.xtend.lib.Data | |
class Eval { | |
def static void main(String...args) { new Eval().run } // run inside an instance instead of statically so we can operator overloading (and use extensions) | |
def evaluate(Map<String,Integer> it, Expression exp) { |
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 com.google.inject.Inject; | |
import com.google.inject.Provider; | |
public class MrsH { | |
@Inject | |
private DoorService door; | |
@Inject | |
private PanelService panel; | |
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
public static void main(String[] args) { | |
int iterations = 1000000; | |
List<?> items = newArrayList("foo", 23, true); | |
List<Object> absoluteResult = new ArrayList<Object>(iterations*items.size()); | |
long before = System.currentTimeMillis(); | |
for (int i=0; i < iterations; i++) { | |
for (int j=0 ; j< items.size(); j++) { | |
absoluteResult.add(foo(items.get(j))); | |
} |