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
// TODO This probably already exists somewhere? | |
public Optional<IJavaProject> getJavaProject(IProject project) { | |
try { | |
if (project.hasNature(JavaCore.NATURE_ID)) { | |
IJavaProject javaProject = JavaCore.create(project); | |
return Optional.of(javaProject); | |
} else { | |
return Optional.absent(); | |
} | |
} catch (CoreException e) { |
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
vorburger@yoko:~/git/org.eclipse.xtext$ git push origin | |
Counting objects: 21, done. | |
Delta compression using up to 8 threads. | |
Compressing objects: 100% (8/8), done. | |
Writing objects: 100% (11/11), 1.01 KiB | 0 bytes/s, done. | |
Total 11 (delta 6), reused 0 (delta 0) | |
remote: Resolving deltas: 100% (6/6) | |
remote: Processing changes: new: 1, refs: 1, done | |
remote: ---------- | |
remote: Reviewing commit: commit 04b2c6347d0ae4b20ff3a3749120568a9f772322 1391876867 ----sp |
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 ch.vorburger.xtext.utils; | |
import java.io.File; | |
import java.util.Collection; | |
import org.apache.commons.io.FileUtils; | |
import org.eclipse.emf.common.util.URI; | |
import org.eclipse.emf.ecore.resource.Resource; | |
import org.eclipse.emf.ecore.resource.ResourceSet; | |
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; |
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
/** | |
* Copyright (c) 2014 Michael Vorburger and others. | |
* | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v1.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v10.html | |
* | |
* Contributors: Michael Vorburger - Initial API and implementation | |
*/ |
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
/** | |
* Copyright (C) 2014 Michael Vorburger | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
#!/usr/bin/python | |
# https://lists.fedoraproject.org/pipermail/test/2009-May/081959.html | |
# from http://askubuntu.com/questions/4499/how-can-i-diagnose-debug-maximum-number-of-clients-reached-x-errors/6639#6639 | |
from subprocess import Popen, PIPE | |
client_sockets = [] | |
match = 0 |
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
family.City { | |
families += family.Family Flintstones { | |
members = [ | |
family.Person Fred { | |
age = 45 | |
} | |
] | |
members += family.Person Fred { |
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
InputStream is = new ByteArrayInputStream(xmlString.getBytes(Charsets.UTF_8)); |
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
private ChromeDriver getChromeDriver() throws URISyntaxException { | |
URL url = getClass().getResource("/ch/vorburger/vaadin/designer/tests/web/chromedriver.exe"); | |
File file = new File(url.toURI()); | |
System.setProperty("webdriver.chrome.driver", file.getAbsolutePath()); | |
return new ChromeDriver(); | |
} |
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
/** | |
* Returns a free port number on localhost. | |
* | |
* Heavily inspired from org.eclipse.jdt.launching.SocketUtil (to avoid a dependency to JDT just because of this). | |
* Slightly improved with close() missing in JDT. And throws exception instead of returning -1. | |
* | |
* @return a free port number on localhost | |
* @throws IllegalStateException if unable to find a free port | |
*/ | |
private static int findFreePort() { |