text
stringlengths
2
1.04M
meta
dict
@interface RGAdManager : UIView +(instancetype)launchViewManger; // -(void)showView:(UIView *)view; @end
{ "content_hash": "41811dec245c63dc38a5d93defdb8f9d", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 32, "avg_line_length": 15.285714285714286, "alnum_prop": 0.7383177570093458, "repo_name": "ShuailongWang/MyCustom", "id": "96b42d826f30363e74a6d795a17bae60f9ef22ae", "size": "287", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Custom/Custom/Demo/AD/RGAdManager.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "1602240" }, { "name": "Ruby", "bytes": "420" }, { "name": "Shell", "bytes": "8861" } ], "symlink_target": "" }
<?xml version='1.0' encoding='utf-8'?> <widget id="com.phonegap.helloworld" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0"> <name>Jeepney Routes</name> <description> Jeepney Routes and Fare Assistance </description> <author email="support@phonegap.com" href="http://phonegap.com"> PhoneGap Team </author> <content src="index.html" /> <preference name="permissions" value="none" /> <preference name="orientation" value="default" /> <preference name="target-device" value="universal" /> <preference name="fullscreen" value="true" /> <preference name="webviewbounce" value="true" /> <preference name="prerendered-icon" value="true" /> <preference name="stay-in-webview" value="false" /> <preference name="ios-statusbarstyle" value="black-opaque" /> <preference name="detect-data-types" value="true" /> <preference name="exit-on-suspend" value="false" /> <preference name="show-splash-screen-spinner" value="true" /> <preference name="auto-hide-splash-screen" value="true" /> <preference name="disable-cursor" value="false" /> <preference name="android-minSdkVersion" value="7" /> <preference name="android-installLocation" value="auto" /> <gap:plugin name="org.apache.cordova.battery-status" /> <gap:plugin name="org.apache.cordova.media-capture" /> <gap:plugin name="org.apache.cordova.console" /> <gap:plugin name="org.apache.cordova.contacts" /> <gap:plugin name="org.apache.cordova.device" /> <gap:plugin name="org.apache.cordova.device-motion" /> <gap:plugin name="org.apache.cordova.device-orientation" /> <gap:plugin name="org.apache.cordova.dialogs" /> <gap:plugin name="org.apache.cordova.file" /> <gap:plugin name="org.apache.cordova.file-transfer" /> <gap:plugin name="org.apache.cordova.geolocation" /> <gap:plugin name="org.apache.cordova.globalization" /> <gap:plugin name="org.apache.cordova.inappbrowser" /> <gap:plugin name="org.apache.cordova.media" /> <gap:plugin name="org.apache.cordova.network-information" /> <icon src="icon.png" /> <icon gap:platform="android" gap:qualifier="ldpi" src="www/res/icon/android/icon-36-ldpi.png" /> <icon gap:platform="android" gap:qualifier="mdpi" src="www/res/icon/android/icon-48-mdpi.png" /> <icon gap:platform="android" gap:qualifier="hdpi" src="www/res/icon/android/icon-72-hdpi.png" /> <icon gap:platform="android" gap:qualifier="xhdpi" src="www/res/icon/android/icon-96-xhdpi.png" /> <icon gap:platform="blackberry" src="www/res/icon/blackberry/icon-80.png" /> <icon gap:platform="blackberry" gap:state="hover" src="www/res/icon/blackberry/icon-80.png" /> <icon gap:platform="ios" height="57" src="www/res/icon/ios/icon-57.png" width="57" /> <icon gap:platform="ios" height="72" src="www/res/icon/ios/icon-72.png" width="72" /> <icon gap:platform="ios" height="114" src="www/res/icon/ios/icon-57-2x.png" width="114" /> <icon gap:platform="ios" height="144" src="www/res/icon/ios/icon-72-2x.png" width="144" /> <icon gap:platform="webos" src="www/res/icon/webos/icon-64.png" /> <icon gap:platform="winphone" src="www/res/icon/windows-phone/icon-48.png" /> <icon gap:platform="winphone" gap:role="background" src="www/res/icon/windows-phone/icon-173-tile.png" /> <gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="www/res/screen/android/screen-ldpi-portrait.png" /> <gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="www/res/screen/android/screen-mdpi-portrait.png" /> <gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="www/res/screen/android/screen-hdpi-portrait.png" /> <gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="www/res/screen/android/screen-xhdpi-portrait.png" /> <gap:splash gap:platform="blackberry" src="www/res/screen/blackberry/screen-225.png" /> <gap:splash gap:platform="ios" height="480" src="www/res/screen/ios/screen-iphone-portrait.png" width="320" /> <gap:splash gap:platform="ios" height="960" src="www/res/screen/ios/screen-iphone-portrait-2x.png" width="640" /> <gap:splash gap:platform="ios" height="1136" src="www/res/screen/ios/screen-iphone-portrait-568h-2x.png" width="640" /> <gap:splash gap:platform="ios" height="1024" src="www/res/screen/ios/screen-ipad-portrait.png" width="768" /> <gap:splash gap:platform="ios" height="768" src="www/res/screen/ios/screen-ipad-landscape.png" width="1024" /> <gap:splash gap:platform="winphone" src="www/res/screen/windows-phone/screen-portrait.jpg" /> <feature name="Geolocation"> <param name="android-package" value="org.apache.cordova.geolocation.GeoBroker" /> </feature> <feature name="FileTransfer"> <param name="android-package" value="org.apache.cordova.filetransfer.FileTransfer" /> </feature> <access origin="*" /> <access origin="https://jeepney.herokuapp.com/admin/routes" /> </widget>
{ "content_hash": "07f79c8fb90f490d8f2c0fdc793da4fa", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 129, "avg_line_length": 67.95945945945945, "alnum_prop": 0.6907933982899185, "repo_name": "ctaw/jeep", "id": "753aea6b908f81999723a8bc83fd71faa7c0839d", "size": "5029", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config.xml", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C#", "bytes": "123220" }, { "name": "C++", "bytes": "55681" }, { "name": "CSS", "bytes": "266902" }, { "name": "HTML", "bytes": "101104" }, { "name": "Java", "bytes": "1146610" }, { "name": "JavaScript", "bytes": "1020036" }, { "name": "Makefile", "bytes": "25749" }, { "name": "Objective-C", "bytes": "167905" }, { "name": "Shell", "bytes": "11293" } ], "symlink_target": "" }
var StateEventEmitter = require('./state-eventemitter'); // // Optimized event with memory for Deferreds // var DeferredEvent = function() { this.callbacks = []; this.args = undefined; this.disabled = false; }; DeferredEvent.prototype.addListener = function(listener, scope) { if (this.fired()) { listener.apply(scope, this.args); } else { this.callbacks.push({ listener : listener, scope : scope }); } }; DeferredEvent.prototype.removeListener = function(listener) { var i = this.callbacks.length - 1; for (; i >= 0; i--) { if (this.callbacks[i].listener === listener) { this.callbacks.splice(i, 1); } } }; DeferredEvent.prototype.removeAllListeners = function() { this.callbacks = []; }; DeferredEvent.prototype.disable = function() { this.addListener = this.removeListener = this.fire = function() {}; this.callbacks = undefined; this.disabled = true; }; DeferredEvent.prototype.fired = function() { return (typeof this.args !== 'undefined'); }; DeferredEvent.prototype.fire = function(args) { this.fire = function() {}; this.args = args; var i = 0, l = this.callbacks.length; for (; i < l; i++) { var callback = this.callbacks[i]; callback.listener.apply(callback.scope, args); } this.callbacks = undefined; }; var Deferred = module.exports = StateEventEmitter.extend({ initialize: function() { this.supr(); this.addEvent('rejected', DeferredEvent); this.addEvent('resolved', DeferredEvent); this.addEvent('progress'); this.setStateSilently('progress'); if (arguments.length > 0) { this.then.apply(this, arguments); } }, // // Callbacks functions // then: function(callback, errback, progress) { var context = arguments[arguments.length - 1]; if (typeof context === 'function') context = this; this.addCallback(callback, context) .addErrback(errback, context) .addProgress(progress, context); return this; }, pipe: function() { var deferred = new Deferred(), callbacks = arguments, context = arguments[arguments.length - 1]; if (typeof context === 'function') context = this; var pipes = ['resolve', 'reject', 'progress'].map(function(action, index) { return (typeof callbacks[index] === 'function') ? function() { var returned = callbacks[index].apply(context, arguments); if (typeof returned === 'undefined') { deferred[action](); } else if (Deferred.isPromise(returned)) { returned.then(deferred.resolve, deferred.reject, deferred.progress, deferred); } else if (action !== 'progress') { if (returned instanceof Error) { deferred.reject(returned); } else { deferred.resolve(returned); } } else { deferred[action](returned); } } : function() { deferred[action].apply(deferred, arguments); } ; }); this.then.apply(this, pipes); return deferred; }, always: function() { this.addCallback.apply(this, arguments) .addErrback.apply(this, arguments); return this; }, addCallback: function(callback, context) { if (typeof callback === 'function') this.on('resolved', callback, context || this); return this; }, addErrback: function(errback, context) { if (typeof errback === 'function') this.on('rejected', errback, context || this); return this; }, addProgress: function(progress, context) { if (typeof progress === 'function') this.on('progress', progress, context || this); return this; }, // // Firing functions // resolve: function() { this.disable('rejected'); this._complete('resolved', arguments); return this; }, reject: function() { this.disable('resolved'); this._complete('rejected', arguments); return this; }, _complete: function(state, args) { // Deactivate firing functions var self = this; this.resolve = this.reject = this.progress = function() { return self; }; // Free the progress event this.disable('progress'); // Fire the event chain args = Array.prototype.slice.call(args); args.unshift(state); this.setState.apply(this, args); }, progress: function() { var args = Array.prototype.slice.call(arguments); args.unshift('progress'); this.emit.apply(this, args); return this; }, // // Helpers // getResolvePassedArgs: function() { if (!this.isResolved()) { throw new Error('not resolved'); } else { return this._events.resolved.args; } }, getRejectPassedArgs: function() { if (!this.isRejected()) { throw new Error('not rejected'); } else { return this._events.rejected.args; } }, isCompleted: function() { return ( this.fired('resolved') || this.fired('rejected') ); }, isResolved: function() { return this.stateIs('resolved'); }, isRejected: function() { return this.stateIs('rejected'); }, inProgress: function() { return this.stateIs('progress'); }, cancel: function() { this.disable('resolved'); this.disable('rejected'); } }).statics({ /** * Static function which accepts a promise object * or any kind of object and returns a promise. * If the given object is a promise, it simply returns * the same object, if it's a value it returns a * new resolved deferred object * * @param {Object} promise Promise or value * @return {Deferred} */ when: function(promise) { if (this.isPromise(promise)) return promise; return new Deferred().resolve(promise); }, // // Inspired by when.js from Brian Cavalier // whenAtLeast: function(promises, toResolve) { toResolve = Math.max(1, Math.min(toResolve || 1, promises.length)); var deferred = new Deferred(), promisesLeft = promises.length, resolved = [], rejected = []; function finish() { if (--promisesLeft === 0) { if (resolved.length >= toResolve) { deferred.resolve(resolved, rejected); } else { deferred.reject(resolved, rejected); } } } function failure(promise) { return function() { rejected.push(promise); finish(); }; } function success(promise) { return function() { resolved.push(promise); finish(); }; } for (var i = 0; i < promises.length; i++) { Deferred.when(promises[i]) .then(success(promises[i]), failure(promises[i]), deferred.progress); } return deferred; }, whenAll: function(promises) { return Deferred.whenSome(promises, promises.length); }, whenSome: function(promises, toResolve) { var resolved = [], rejected = [], deferred = new Deferred(), slice = Array.prototype.slice, notToReject; toResolve = Math.max(0, Math.min(toResolve, promises.length)); notToReject = promises.length - toResolve; function success(promise) { return function() { resolved.push(promise); if (--toResolve === 0) { deferred.resolve(resolved, rejected); } }; } function failure(promise) { return function() { rejected.push(promise); if (notToReject-- === 0) { deferred.reject(resolved, rejected); } }; } if (toResolve === 0) { deferred.resolve(resolved, rejected); } else { for (var i = 0; i < promises.length; i++) { Deferred.when(promises[i]) .then(success(promises[i]), failure(promises[i]), deferred.progress); } } return deferred; }, whenMap: function(promises, map) { var results = [], deferred = new Deferred(), total = promises.length; function success(promise) { return function() { var index = promises.indexOf(promise); results[index] = map.apply(promise, arguments); if (--total === 0) { deferred.resolve(results); } }; } for (var i = 0, l = promises.length; i < l; i++) { Deferred.when(promises[i]) .then(success(promises[i]), deferred.reject, deferred.progress); } return deferred; }, isPromise: function(promise) { return promise && typeof promise.then === 'function'; } });
{ "content_hash": "612de46b793c1b9dad9d7a4f64b15f8a", "timestamp": "", "source": "github", "line_count": 362, "max_line_length": 88, "avg_line_length": 23.640883977900554, "alnum_prop": 0.5911427903715821, "repo_name": "tino123/kadohProject", "id": "fb657d49cbd1bf0fc203c738d50283b882179a7c", "size": "8558", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/util/deferred.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "670106" }, { "name": "Ruby", "bytes": "2104" } ], "symlink_target": "" }
package org.apache.camel.itest.springboot; import org.apache.camel.itest.springboot.util.ArquillianPackager; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.Archive; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(Arquillian.class) public class CamelCassandraqlTest extends AbstractSpringBootTestSupport { @Deployment public static Archive<?> createSpringBootPackage() throws Exception { return ArquillianPackager.springBootPackage(createTestConfig()); } public static ITestConfig createTestConfig() { return new ITestConfigBuilder() .module(inferModuleName(CamelCassandraqlTest.class)) .build(); } @Test public void componentTests() throws Exception { this.runComponentTest(config, "cql"); this.runModuleUnitTestsIfEnabled(config); } }
{ "content_hash": "aa5aa42a6e1ce5fd21780dc4988f2504", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 73, "avg_line_length": 28.727272727272727, "alnum_prop": 0.7383966244725738, "repo_name": "jmandawg/camel", "id": "10324e885e156768b0b7db14cf4d76cdb63b6292", "size": "1751", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelCassandraqlTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "106" }, { "name": "CSS", "bytes": "30373" }, { "name": "Eagle", "bytes": "2898" }, { "name": "Elm", "bytes": "5970" }, { "name": "FreeMarker", "bytes": "11410" }, { "name": "Groovy", "bytes": "53008" }, { "name": "HTML", "bytes": "177803" }, { "name": "Java", "bytes": "53296685" }, { "name": "JavaScript", "bytes": "90232" }, { "name": "Protocol Buffer", "bytes": "578" }, { "name": "Python", "bytes": "36" }, { "name": "Ruby", "bytes": "4802" }, { "name": "Scala", "bytes": "322615" }, { "name": "Shell", "bytes": "18818" }, { "name": "Tcl", "bytes": "4974" }, { "name": "XQuery", "bytes": "546" }, { "name": "XSLT", "bytes": "284394" } ], "symlink_target": "" }
package junit.org.rapidpm.microservice.filestore.rest; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import junit.org.rapidpm.microservice.filestore.BaseMicroserviceTest; import org.jboss.resteasy.test.TestPortProvider; import org.junit.Assert; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; import org.rapidpm.microservice.filestore.api.FileStoreAction; import org.rapidpm.microservice.filestore.api.FileStoreResponse; import org.rapidpm.microservice.filestore.api.FileStoreServiceMessage; import org.rapidpm.microservice.filestore.api.StorageStatus; import org.rapidpm.microservice.filestore.impl.RequestEncodingHelper; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class RestTest extends BaseMicroserviceTest{ private final String FILE_CONTENT = "Test Hallo"; @Test public void testRest001() throws Exception { String jsonBase64 = RequestEncodingHelper.encodeIntoBase64(getRestoreJson()); String response = testJsonRequest(jsonBase64); final FileStoreResponse fileStoreResponse = RequestEncodingHelper.parseJsonToMessage(response, FileStoreResponse.class); Assert.assertEquals(StorageStatus.NOT_ARCHIVED, fileStoreResponse.status); } private String getRestoreJson() throws JsonProcessingException { FileStoreServiceMessage message = new FileStoreServiceMessage(); message.action = FileStoreAction.RESTORE; message.fileName = "TEST.XML"; ObjectMapper mapper = new ObjectMapper(); return mapper.writeValueAsString(message); } private String testJsonRequest(String jsonBase64) { Client client = ClientBuilder.newClient(); final String restAppPath = "/rest"; final String ressourcePath = "/filestore"; final String generateURL = TestPortProvider.generateURL(restAppPath + ressourcePath); System.out.println("generateURL = " + generateURL); String val = client .target(generateURL) .queryParam("json", jsonBase64) .request() .get(String.class); Assert.assertNotNull(val); client.close(); return val; } @Test public void testRest002() throws Exception { final String jsonBase64 = RequestEncodingHelper.encodeIntoBase64(getInsertJson()); String response = testJsonRequest(jsonBase64); final FileStoreResponse fileStoreResponse = RequestEncodingHelper.parseJsonToMessage(response, FileStoreResponse.class); Assert.assertEquals(StorageStatus.ARCHIVED, fileStoreResponse.status); } private String getInsertJson() throws JsonProcessingException { FileStoreServiceMessage message = new FileStoreServiceMessage(); message.action = FileStoreAction.ARCHIVE; message.fileName = "TEST.XML"; message.fileContend = RequestEncodingHelper.encodeIntoBase64(FILE_CONTENT).getBytes(); ObjectMapper mapper = new ObjectMapper(); return mapper.writeValueAsString(message); } @Test public void testRest003() throws JsonProcessingException { String jsonBase64 = RequestEncodingHelper.encodeIntoBase64(getRestoreJson()); String response = testJsonRequest(jsonBase64); final FileStoreResponse fileStoreResponse = RequestEncodingHelper.parseJsonToMessage(response, FileStoreResponse.class); Assert.assertEquals(StorageStatus.RESTORED, fileStoreResponse.status); Assert.assertEquals(FILE_CONTENT, RequestEncodingHelper.decodeFromBase64(fileStoreResponse.base64File)); } @Test public void testRest004() throws Exception { String jsonBase64 = RequestEncodingHelper.encodeIntoBase64(getCheckJson()); String response = testJsonRequest(jsonBase64); final FileStoreResponse fileStoreResponse = RequestEncodingHelper.parseJsonToMessage(response, FileStoreResponse.class); Assert.assertEquals(StorageStatus.ALREADY_ARCHIVED, fileStoreResponse.status); } private String getCheckJson() throws JsonProcessingException { FileStoreServiceMessage message = new FileStoreServiceMessage(); message.action = FileStoreAction.CHECK; message.fileName = "TEST.XML"; ObjectMapper mapper = new ObjectMapper(); return mapper.writeValueAsString(message); } }
{ "content_hash": "7809129c950d135682b926170b715fb4", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 128, "avg_line_length": 38.91379310344828, "alnum_prop": 0.7441293752769162, "repo_name": "RapidPM/rapidpm-microservice-examples", "id": "106ed2d54a21bc4de53f97f33fc9aa075ddff6f8", "size": "5319", "binary": false, "copies": "2", "ref": "refs/heads/develop", "path": "modules/example009/src/test/java/junit/org/rapidpm/microservice/filestore/rest/RestTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "110330" }, { "name": "Kotlin", "bytes": "189" } ], "symlink_target": "" }
package org.jetbrains.plugins.groovy.codeInspection.bugs; import com.intellij.codeInsight.intention.FileModifier; import com.intellij.codeInspection.ProblemDescriptor; import com.intellij.ide.fileTemplates.FileTemplate; import com.intellij.ide.fileTemplates.FileTemplateManager; import com.intellij.ide.fileTemplates.JavaTemplateUtil; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.JavaPsiFacade; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiTypeParameter; import com.intellij.psi.SmartPsiElementPointer; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.psi.util.PsiTypesUtil; import com.intellij.util.ArrayUtilRt; import com.intellij.util.IncorrectOperationException; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.GroovyBundle; import org.jetbrains.plugins.groovy.codeInspection.GroovyFix; import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory; import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrCodeBlock; import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinition; import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMethod; import java.io.IOException; import java.util.Properties; import static com.intellij.psi.util.PointersKt.createSmartPointer; public class AddMethodFix extends GroovyFix { private static final Logger LOG = Logger.getInstance(AddMethodFix.class); private final String myMethodName; private final String myClassName; private final SmartPsiElementPointer<GrTypeDefinition> myPsiClassPointer; public AddMethodFix(@NotNull String methodName, @NotNull GrTypeDefinition aClass) { myMethodName = methodName; myClassName = aClass.getName(); myPsiClassPointer = createSmartPointer(aClass); } @Override public @Nullable FileModifier getFileModifierForPreview(@NotNull PsiFile target) { GrTypeDefinition definition = myPsiClassPointer.getElement(); if (definition == null) { return null; } GrTypeDefinition copy = PsiTreeUtil.findSameElementInCopy(definition, target); return new AddMethodFix(myMethodName, copy); } @Override protected void doFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) throws IncorrectOperationException { GrTypeDefinition psiClass = myPsiClassPointer.getElement(); if (psiClass == null) return; if (psiClass.isInterface()) { final GrMethod method = GroovyPsiElementFactory.getInstance(project).createMethodFromText( "def " + psiClass.getName() + " " + myMethodName + "();" ); psiClass.add(method); } else { String templName = JavaTemplateUtil.TEMPLATE_IMPLEMENTED_METHOD_BODY; final FileTemplate template = FileTemplateManager.getInstance(project).getCodeTemplate(templName); Properties properties = FileTemplateManager.getInstance(project).getDefaultProperties(); String returnType = generateTypeText(psiClass); properties.setProperty(FileTemplate.ATTRIBUTE_RETURN_TYPE, returnType); properties.setProperty(FileTemplate.ATTRIBUTE_DEFAULT_RETURN_VALUE, PsiTypesUtil.getDefaultValueOfType(JavaPsiFacade.getElementFactory(project).createType(psiClass))); properties.setProperty(FileTemplate.ATTRIBUTE_CALL_SUPER, ""); properties.setProperty(FileTemplate.ATTRIBUTE_CLASS_NAME, psiClass.getQualifiedName()); properties.setProperty(FileTemplate.ATTRIBUTE_SIMPLE_CLASS_NAME, psiClass.getName()); properties.setProperty(FileTemplate.ATTRIBUTE_METHOD_NAME, myMethodName); try { String bodyText = StringUtil.replace(template.getText(properties), ";", ""); final GrCodeBlock newBody = GroovyPsiElementFactory.getInstance(project).createMethodBodyFromText("\n" + bodyText + "\n"); final GrMethod method = GroovyPsiElementFactory.getInstance(project).createMethodFromText( "", myMethodName, returnType, ArrayUtilRt.EMPTY_STRING_ARRAY, psiClass ); method.setBlock(newBody); psiClass.add(method); } catch (IOException e) { LOG.error(e); } } } @NotNull @Override public String getName() { return GroovyBundle.message("add.method", myMethodName, myClassName); } @NotNull @Override public String getFamilyName() { return GroovyBundle.message("add.method.family"); } static String generateTypeText(GrTypeDefinition aClass) { String className = aClass.getName(); LOG.assertTrue(className != null, aClass); StringBuilder returnType = new StringBuilder(className); final PsiTypeParameter[] typeParameters = aClass.getTypeParameters(); if (typeParameters.length > 0) { returnType.append('<'); for (PsiTypeParameter typeParameter : typeParameters) { returnType.append(typeParameter.getName()).append(", "); } returnType.replace(returnType.length() - 2, returnType.length(), ">"); } return returnType.toString(); } }
{ "content_hash": "91b5adbedc04654c98519b37418dc8db", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 130, "avg_line_length": 41.556451612903224, "alnum_prop": 0.7601397244323695, "repo_name": "mdaniel/intellij-community", "id": "7f5f7dc716a38280d144ffe4ad46d7047a04572b", "size": "5274", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/bugs/AddMethodFix.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
fw_depends erlang RETCODE=$(fw_exists ${IROOT}/elixir.installed) [ ! "$RETCODE" == 0 ] || { \ source $IROOT/elixir.installed return 0; } ELIXIR_HOME=$IROOT/elixir VERSION="1.3.3-1" RELEASE="trusty" ARCH="all" fw_get -O http://packages.erlang-solutions.com/debian/pool/elixir_${VERSION}~ubuntu~${RELEASE}_${ARCH}.deb dpkg -x elixir_${VERSION}~ubuntu~${RELEASE}_${ARCH}.deb $IROOT/elixir $IROOT/erlang/usr/lib/erlang/Install -minimal $IROOT/erlang/usr/lib/erlang echo "export ELIXIR_HOME=${ELIXIR_HOME}" > $IROOT/elixir.installed echo -e "export PATH=\$ELIXIR_HOME/usr/local/bin:\$PATH" >> $IROOT/elixir.installed source $IROOT/elixir.installed
{ "content_hash": "64d7037ff830f31a0dc01dc5d5a74975", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 106, "avg_line_length": 32.6, "alnum_prop": 0.7162576687116564, "repo_name": "ashawnbandy-te-tfb/FrameworkBenchmarks", "id": "ce86a22d4d5e679f68d7571dfabcfb57e8808678", "size": "665", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "toolset/setup/linux/languages/elixir.sh", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "838" }, { "name": "ApacheConf", "bytes": "19994" }, { "name": "Batchfile", "bytes": "1479" }, { "name": "C", "bytes": "151724" }, { "name": "C#", "bytes": "243803" }, { "name": "C++", "bytes": "69752" }, { "name": "CMake", "bytes": "2862" }, { "name": "CSS", "bytes": "186916" }, { "name": "Clojure", "bytes": "44405" }, { "name": "Crystal", "bytes": "5417" }, { "name": "D", "bytes": "3939" }, { "name": "Dart", "bytes": "36881" }, { "name": "Elixir", "bytes": "12270" }, { "name": "Erlang", "bytes": "38290" }, { "name": "Go", "bytes": "72605" }, { "name": "Groovy", "bytes": "18156" }, { "name": "HTML", "bytes": "153780" }, { "name": "Haskell", "bytes": "35546" }, { "name": "Java", "bytes": "446408" }, { "name": "JavaScript", "bytes": "435562" }, { "name": "Kotlin", "bytes": "8201" }, { "name": "Lua", "bytes": "14309" }, { "name": "Makefile", "bytes": "1519" }, { "name": "MoonScript", "bytes": "2398" }, { "name": "Nginx", "bytes": "133310" }, { "name": "Nimrod", "bytes": "5106" }, { "name": "PHP", "bytes": "1011758" }, { "name": "Perl", "bytes": "11179" }, { "name": "PowerShell", "bytes": "38057" }, { "name": "Python", "bytes": "295373" }, { "name": "QMake", "bytes": "2301" }, { "name": "Racket", "bytes": "5298" }, { "name": "Ruby", "bytes": "82247" }, { "name": "Rust", "bytes": "2525" }, { "name": "Scala", "bytes": "98281" }, { "name": "Shell", "bytes": "268099" }, { "name": "Smarty", "bytes": "1338" }, { "name": "UrWeb", "bytes": "65535" }, { "name": "Volt", "bytes": "769" } ], "symlink_target": "" }
''' author @ esilgard ''' # # Copyright (c) 2014-2016 Fred Hutchinson Cancer Research Center # # 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 # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # import re import sys import make_datetime import global_strings as gb __version__ = 'cyto_parser1.0' ## header names exptected to be coming from the Amalga Import ## REQUIRED_HEADER_SET = set([gb.SET_ID, gb.OBSERVATION_VALUE, gb.FILLER_ORDER_NO, gb.MRN_CAPS]) def parse(obx_file): ''' this is a basic parser and sectioner for Amalga pathology reports input = "obx_file" = a tab delimited text version of an Amalga obx table output = "cytogenetics_dictionary" = a dictionary of \ {unique MRN_CAPSs:{unique FILLER_ORDER_NOs:{(section order, section heading, \ character onset of section):{row num/SET_ID:texts}}}} **to work correctly first line must contain the expected headers** --returns a tuple of output, return_type ''' cytogenetics_dictionary = {} section = 'NULL' section_order = 0 specimen = None try: obx = open(obx_file, 'rU').readlines() obx = [re.sub(r'[\r\n]', '', a).split('\t') for a in obx] header_set = set(obx[0]) if set(header_set) >= (REQUIRED_HEADER_SET): headers = dict((k, v) for v, k in enumerate(obx[0])) try: # sort records by MRN, acc, and then setid, ignore null lines obx = sorted([y for y in obx[1:] if (y[headers.get(gb.MRN_CAPS)] != 'NULL' \ and y[headers.get(gb.MRN_CAPS)] != gb.MRN_CAPS and \ y[headers.get(gb.FILLER_ORDER_NO)] != 'NULL' and \ y[headers.get(gb.SET_ID)] != 'NULL')], key=lambda x: \ (x[headers.get(gb.MRN_CAPS)], x[headers.get(gb.FILLER_ORDER_NO)], \ int(x[headers.get(gb.SET_ID)]))) chars_onset=0 for line in obx: mrn = line[headers.get(gb.MRN_CAPS)] acc = line[headers.get(gb.FILLER_ORDER_NO)] index = line[headers.get(gb.SET_ID)] if index == '1': section_order = 0 chars_onset = 0 text = line[headers.get(gb.OBSERVATION_VALUE)] if gb.FILLER_ORDER_NO in line: pass # ignore duplicate header lines elif text == 'NULL' or text == 'None': # maintain readability of fully constituted text by keeping empty 'NULL' lines cytogenetics_dictionary[mrn] = cytogenetics_dictionary.get(mrn, {}) cytogenetics_dictionary[mrn][acc] = cytogenetics_dictionary[mrn].get(acc, {}) cytogenetics_dictionary[mrn][acc][(-1, 'FullText', 0, None)] = \ cytogenetics_dictionary[mrn][acc].get\ ((-1, 'FullText', 0, None), '') + '\n' chars_onset += 1 else: ## grab acc dictionary cytogenetics_dictionary[mrn] = cytogenetics_dictionary.get(mrn, {}) cytogenetics_dictionary[mrn][acc] = cytogenetics_dictionary[mrn].get(acc, {}) if index == '1': chars_onset = 0 # create a specimen source dictionary for each labeled specimen #(in the same format as the regular pathology section dictionary # catch NULL or empty string specimenSources if not line[headers.get(gb.SPECIMEN_SOURCE)] or \ line[headers.get(gb.SPECIMEN_SOURCE)] == 'NULL': specimen_dictionary = {} else: try: specimen_dictionary = dict((x.split(')')[0], x.split(')')[1].replace('(',' ')) \ for x in line[headers.get(gb.SPECIMEN_SOURCE)].strip('"').split('~')) except: specimen_dictionary = {'NULL': 'NULL'} cytogenetics_dictionary[mrn][acc][(0, gb.SPECIMEN_SOURCE, 0, None)] = {} cytogenetics_dictionary[mrn][acc][(0, gb.SPECIMEN_SOURCE, 0, None)][0] = specimen_dictionary # match general section header patterns # (this section header matching is purposely broader than the pathology parser section_header = re.match(r'[\*\" ]*([A-Za-z ]+)[\*:]+', text) # reassign the section variable if you find a section pattern match # reset specimen and increment section order if section_header: section = section_header.group(1).strip() section_order += 1 specimen = '' specimen_header = re.match(r'[\s\"]{,4}([,A-Z\- and&]+?)[\s]*(FS)?((-[A-Z])[\s]*FS)?[\s]*[)].*', text) if specimen_header: specimen = '' ## reset specimen if there is a new specimen header match specimen_match = specimen_header.group(1).replace(' ', '') ## catch specimens listed in interop consults eg 'AFS-EFS: negative..' if specimen_header.group(4) and '-' in specimen_header.group(4): specimen_match = specimen_match + specimen_header.group(4) for each in specimen_dictionary.keys(): if each and re.search(r'[' + specimen_match + ']', each): specimen += each cytogenetics_dictionary[mrn][acc][(section_order, section, chars_onset, specimen)] = \ cytogenetics_dictionary[mrn][acc].get((section_order,section,chars_onset,specimen), {}) cytogenetics_dictionary[mrn][acc]\ [(section_order, section, chars_onset, specimen)][index] = text cytogenetics_dictionary[mrn][acc][(-1, 'FullText', 0, None)] = \ cytogenetics_dictionary[mrn][acc].get((-1, 'FullText', 0, None), '') + text + '\n' # do we want received date? or collected? if 'RECEIVED' in text and 'CASE' in text: received_date = re.match(r'.*RECEIVED:[ ]+([A-Z][a-z]+)[ ]+([\d]+)[ ]+([\d]{4}).*', text) if received_date: cytogenetics_dictionary[mrn][acc][(-1, 'Date', 0, None)] = \ (make_datetime.get((received_date.group(3), received_date.group(1), \ received_date.group(2)), '%Y,%b,%d'), received_date.start(1)+chars_onset, received_date.end(3)+chars_onset) else: cytogenetics_dictionary[mrn][acc][(-1, 'Date', 0, None)] = (None, 0, 0) chars_onset += len(text) + 1 return cytogenetics_dictionary, dict except RuntimeError: return ({gb.ERR_TYPE: 'Exception', gb.ERR_STR: "FATAL ERROR: " + \ str(sys.exc_info()[0]) + "," + str(sys.exc_info()[1]) + \ " trouble parsing " + str(obx_file) + " -- program aborted"}, Exception) else: return ({gb.ERR_TYPE: 'Exception', gb.ERR_STR: "FATAL ERROR: " + str(sys.exc_info()[0]) \ + "," + str(sys.exc_info()[1]) + " required headers not found in inital \ line of " + str(obx_file) + " -- must include " + ','.join\ (REQUIRED_HEADER_SET - header_set) + " -- program aborted"}, Exception) except EnvironmentError: return ({gb.ERR_TYPE: 'Exception', gb.ERR_STR: "FATAL ERROR: " + str(sys.exc_info()[0]) + \ "," + str(sys.exc_info()[1]) + " -- could not find input file " + str(obx_file) + \ " -- program aborted"}, Exception)
{ "content_hash": "183aa19f989f06bb9ab9e677b0874e42", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 139, "avg_line_length": 58.73856209150327, "alnum_prop": 0.49371314120396126, "repo_name": "esilgard/argos_nlp", "id": "9f39bcbe7f51b69a0d0b91bfce11abe29c548c9a", "size": "8987", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "fhcrc_cytogenetics/parser.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "519" }, { "name": "Python", "bytes": "158922" } ], "symlink_target": "" }
<?php namespace php\gui\event; use php\gui\UXNode; /** * Class UXWebEvent * @package php\gui\event */ class UXWebEvent extends UXEvent { /** * @readonly * @var mixed */ public $data; }
{ "content_hash": "4c9826920b929bb5fb4d7af5d53809b1", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 32, "avg_line_length": 12.470588235294118, "alnum_prop": 0.5943396226415094, "repo_name": "fxdyx/develnext", "id": "c0b9f29c65c7893bc1013611c2e639892484eb5e", "size": "212", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jphp-gui-ext/src/main/resources/JPHP-INF/sdk/php/gui/event/UXWebEvent.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2820" }, { "name": "C", "bytes": "51066" }, { "name": "CSS", "bytes": "4706" }, { "name": "HTML", "bytes": "1084308" }, { "name": "Inno Setup", "bytes": "11168" }, { "name": "Java", "bytes": "616253" }, { "name": "PHP", "bytes": "426134" }, { "name": "Shell", "bytes": "5070" } ], "symlink_target": "" }
package com.audacious_software.pennyworth; import android.app.job.JobParameters; import android.app.job.JobService; import android.content.Intent; import android.os.Build; import androidx.annotation.RequiresApi; @RequiresApi(Build.VERSION_CODES.O) public class KeepAliveJobService extends JobService { public static final int JOB_ID = 12345; @Override public boolean onStartJob(JobParameters jobParameters) { Intent fireIntent = new Intent(KeepAliveService.ACTION_KEEP_ALIVE, null, this, KeepAliveService.class); KeepAliveService.enqueueWork(this, KeepAliveService.class, KeepAliveService.JOB_ID, fireIntent); return true; } @Override public boolean onStopJob(JobParameters jobParameters) { return true; } }
{ "content_hash": "6dd1ec8eb93d3e98e2424938b4c2cb41", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 111, "avg_line_length": 29.703703703703702, "alnum_prop": 0.7306733167082294, "repo_name": "audaciouscode/Pennyworth-Android", "id": "eb2c8afc6e1a33e7490e7b13e1973f94dbf3ab90", "size": "802", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/audacious_software/pennyworth/KeepAliveJobService.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "33187" } ], "symlink_target": "" }
package org.mycontroller.standalone.backup.mixins; import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.mycontroller.standalone.api.jaxrs.utils.RestUtils; import org.mycontroller.standalone.db.tables.User; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; /** * @author Jeeva Kandasamy (jkandasa) * @since 1.5.0 */ public class SerializerSimpleUser extends JsonSerializer<User> { @Override public void serialize(User item, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { if (item != null) { Map<String, Object> data = new HashMap<String, Object>(); data.put("id", item.getId()); RestUtils.getObjectMapper().writeValue(jgen, data); } else { jgen.writeNull(); } } }
{ "content_hash": "f5d05daf1ed8cf2ef42b834c317aadf8", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 105, "avg_line_length": 29.2, "alnum_prop": 0.7152641878669276, "repo_name": "mycontroller-org/mycontroller", "id": "abb4d88937600d47a8bb626957359ffbb1d5d4da", "size": "1705", "binary": false, "copies": "1", "ref": "refs/heads/development", "path": "modules/core/src/main/java/org/mycontroller/standalone/backup/mixins/SerializerSimpleUser.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "2544030" } ], "symlink_target": "" }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="ca" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Bitcoin</source> <translation>A prop de CryptoLOOT</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Bitcoin&lt;/b&gt; version</source> <translation type="unfinished"/> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The Bitcoin developers</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Llibreta d&apos;adreçes</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Copia la selecció actual al porta-retalls del sistema</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your Bitcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation>These are your CryptoLOOT addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Bitcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified Bitcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation type="unfinished"/> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>These are your CryptoLOOT addresses for sending payments. Always check the amount and the receiving address before sending coins.</translation> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation type="unfinished"/> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>(no label)</source> <translation type="unfinished"/> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation type="unfinished"/> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation type="unfinished"/> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation type="unfinished"/> </message> <message> <location line="-56"/> <source>Bitcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation type="unfinished"/> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation type="unfinished"/> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation type="unfinished"/> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation type="unfinished"/> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation type="unfinished"/> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Quit application</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Show information about Bitcoin</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation type="unfinished"/> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation type="unfinished"/> </message> <message> <location line="-347"/> <source>Send coins to a Bitcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Modify configuration options for Bitcoin</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation type="unfinished"/> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation type="unfinished"/> </message> <message> <location line="-165"/> <location line="+530"/> <source>Bitcoin</source> <translation type="unfinished"/> </message> <message> <location line="-530"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>&amp;About Bitcoin</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Sign messages with your Bitcoin addresses to prove you own them</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Bitcoin client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to Bitcoin network</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="-140"/> <source>Up to date</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation type="unfinished"/> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation type="unfinished"/> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>New sending address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Bitcoin address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation type="unfinished"/> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>Bitcoin-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start Bitcoin after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start Bitcoin on system login</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Connect to the Bitcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Bitcoin.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Whether to show Bitcoin addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation type="unfinished"/> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Bitcoin.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation type="unfinished"/> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-124"/> <source>Balance:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-78"/> <source>Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+107"/> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation type="unfinished"/> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start bitcoin: click-to-pay handler</source> <translation>Cannot start CryptoLOOT: click-to-pay handler</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation type="unfinished"/> </message> <message> <location line="-217"/> <source>Client version</source> <translation type="unfinished"/> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation type="unfinished"/> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Startup time</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Network</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Last block time</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the Bitcoin-Qt help message to get a list with possible Bitcoin command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation type="unfinished"/> </message> <message> <location line="-260"/> <source>Build date</source> <translation type="unfinished"/> </message> <message> <location line="-104"/> <source>Bitcoin - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Bitcoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation type="unfinished"/> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Bitcoin RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Balance:</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>123.456 LOOT</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation type="unfinished"/> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation type="unfinished"/> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Signature</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Bitcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Bitcoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation type="unfinished"/> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Enter Bitcoin signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The Bitcoin developers</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Status</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Source</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Generated</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation type="unfinished"/> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>label</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation type="unfinished"/> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Net amount</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Message</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Comment</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Transaction</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Inputs</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"/> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Amount</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+43"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Received from</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation type="unfinished"/> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <source>Today</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This week</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This month</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Last month</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This year</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Range...</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Received with</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Sent to</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>To yourself</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Mined</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Other</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Min amount</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>Copy address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Date</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Address</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Amount</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>ID</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <source>Range:</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>to</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation type="unfinished"/> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>Bitcoin version</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Send command to -server or bitcoind</source> <translation type="unfinished"/> </message> <message> <location line="-23"/> <source>List commands</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Options:</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Specify configuration file (default: bitcoin.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Specify pid file (default: bitcoind.pid)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation type="unfinished"/> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 11080 or testnet: 5744)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation type="unfinished"/> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 21080 or testnet: 5745)</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation type="unfinished"/> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=bitcoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Bitcoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Bitcoin will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation type="unfinished"/> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation type="unfinished"/> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation type="unfinished"/> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Information</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>System error: </source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation type="unfinished"/> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation type="unfinished"/> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation type="unfinished"/> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation type="unfinished"/> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation type="unfinished"/> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+165"/> <source>This help message</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation type="unfinished"/> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation type="unfinished"/> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Bitcoin</source> <translation type="unfinished"/> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart Bitcoin to complete</source> <translation type="unfinished"/> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation type="unfinished"/> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation type="unfinished"/> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation type="unfinished"/> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation type="unfinished"/> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. Bitcoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation type="unfinished"/> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation type="unfinished"/> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation type="unfinished"/> </message> <message> <location line="-57"/> <source>Done loading</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation type="unfinished"/> </message> <message> <location line="-74"/> <source>Error</source> <translation type="unfinished"/> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation type="unfinished"/> </message> </context> </TS>
{ "content_hash": "dd64dbd11a4e4857052a213e299ec062", "timestamp": "", "source": "github", "line_count": 2917, "max_line_length": 395, "avg_line_length": 33.183407610558795, "alnum_prop": 0.5859333030290508, "repo_name": "CryptoLOOT/loot-master", "id": "b64cf3dbfa526f7c098f105943f4722994ae8270", "size": "96798", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_ca.ts", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "101891" }, { "name": "C++", "bytes": "2424361" }, { "name": "CSS", "bytes": "1127" }, { "name": "IDL", "bytes": "28316" }, { "name": "Objective-C", "bytes": "2734" }, { "name": "Python", "bytes": "3779" }, { "name": "Shell", "bytes": "808" }, { "name": "TypeScript", "bytes": "5242502" } ], "symlink_target": "" }
package com.link_intersystems.jdbc.test.db.h2; import com.link_intersystems.jdbc.test.db.setup.DBSetup; import java.sql.Connection; import java.sql.SQLException; import static java.util.Objects.requireNonNull; /** * @author René Link {@literal <rene.link@link-intersystems.com>} */ public class H2DatabaseCache { private H2ConfigPropertiesSource configPropertiesSource; public H2DatabaseCache(H2ConfigPropertiesSource configPropertiesSource) { this.configPropertiesSource = requireNonNull(configPropertiesSource); } public H2Database getDatabase(H2DatabaseStore h2DatabaseStore) throws Exception { H2Database h2Database = h2DatabaseStore.get(); if (h2Database == null) { H2ConfigProperties configProperties = configPropertiesSource.getConfigProperties(); h2Database = createDatabase(configProperties); h2DatabaseStore.put(h2Database); } return h2Database; } protected H2Database createDatabase(H2ConfigProperties configProperties) throws SQLException { H2Factory h2DatabaseFactory = configProperties.getH2Factory(); String databaseName = configProperties.getDatabaseName(); H2Database h2Database = h2DatabaseFactory.create(databaseName); DBSetup dbSetup = configProperties.getDBSetup(); try (Connection connection = h2Database.getConnection()) { dbSetup.setupSchema(connection); dbSetup.setupDdl(connection); dbSetup.setupData(connection); } return h2Database; } public void removeDatabase(H2DatabaseStore h2DatabaseStore) throws Exception { clearDatabase(h2DatabaseStore); H2Database h2Database = h2DatabaseStore.get(); if (h2Database != null) { h2Database.close(); } h2DatabaseStore.remove(); } public void clearDatabase(H2DatabaseStore h2DatabaseStore) throws Exception { H2Database h2Database = h2DatabaseStore.get(); if (h2Database != null) { h2Database.clear(); } } }
{ "content_hash": "3c8bc45813a1de1029647700aed0ffe5", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 98, "avg_line_length": 30.3768115942029, "alnum_prop": 0.6979961832061069, "repo_name": "link-intersystems/lis-commons", "id": "8bb0d4684b66f0c73e080273214db3b47656d908", "size": "2097", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lis-commons-jdbc-test/src/main/java/com/link_intersystems/jdbc/test/db/h2/H2DatabaseCache.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1641136" } ], "symlink_target": "" }
void DeviceDataManager::method_decl { \ for (InputDeviceEventObserver& observer : observers_) \ observer.observer_call; \ } namespace ui { namespace { bool InputDeviceEquals(const ui::InputDevice& a, const ui::InputDevice& b) { return a.id == b.id && a.enabled == b.enabled; } } // namespace // static DeviceDataManager* DeviceDataManager::instance_ = nullptr; DeviceDataManager::DeviceDataManager() { DCHECK(!instance_); instance_ = this; } DeviceDataManager::~DeviceDataManager() { instance_ = nullptr; } // static void DeviceDataManager::CreateInstance() { if (instance_) return; new DeviceDataManager(); // TODO(bruthig): Replace the DeleteInstance callbacks with explicit calls. base::AtExitManager::RegisterTask(base::BindOnce(DeleteInstance)); } // static void DeviceDataManager::DeleteInstance() { delete instance_; } // static DeviceDataManager* DeviceDataManager::GetInstance() { CHECK(instance_) << "DeviceDataManager was not created."; return instance_; } // static bool DeviceDataManager::HasInstance() { return instance_ != nullptr; } void DeviceDataManager::ConfigureTouchDevices( const std::vector<ui::TouchDeviceTransform>& transforms) { ClearTouchDeviceAssociations(); for (const TouchDeviceTransform& transform : transforms) UpdateTouchInfoFromTransform(transform); are_touchscreen_target_displays_valid_ = true; for (InputDeviceEventObserver& observer : observers_) observer.OnTouchDeviceAssociationChanged(); } void DeviceDataManager::ClearTouchDeviceAssociations() { touch_map_.clear(); for (TouchscreenDevice& touchscreen_device : touchscreen_devices_) touchscreen_device.target_display_id = display::kInvalidDisplayId; } void DeviceDataManager::UpdateTouchInfoFromTransform( const ui::TouchDeviceTransform& touch_device_transform) { DCHECK_GE(touch_device_transform.device_id, 0); touch_map_[touch_device_transform.device_id] = touch_device_transform; for (TouchscreenDevice& touchscreen_device : touchscreen_devices_) { if (touchscreen_device.id == touch_device_transform.device_id) { touchscreen_device.target_display_id = touch_device_transform.display_id; return; } } } void DeviceDataManager::UpdateTouchMap() { // Remove all entries for devices from the |touch_map_| that are not currently // connected. auto last_iter = std::remove_if( touch_map_.begin(), touch_map_.end(), [this](const std::pair<int, TouchDeviceTransform>& map_entry) { // Check if the given |map_entry| is present in the current list of // connected devices. auto iter = std::find_if( touchscreen_devices_.begin(), touchscreen_devices_.end(), [&map_entry](const TouchscreenDevice& touch_device) { return touch_device.id == map_entry.second.device_id; }); // Remove the device identified by |map_entry| from |touch_map_| if it // is not present in the list of currently connected devices. return iter != touchscreen_devices_.end(); }); touch_map_.erase(last_iter, touch_map_.end()); } void DeviceDataManager::ApplyTouchRadiusScale(int touch_device_id, double* radius) { auto iter = touch_map_.find(touch_device_id); if (iter != touch_map_.end()) *radius = (*radius) * iter->second.radius_scale; } void DeviceDataManager::ApplyTouchTransformer(int touch_device_id, float* x, float* y) { auto iter = touch_map_.find(touch_device_id); if (iter != touch_map_.end()) { gfx::Point3F point(*x, *y, 0.0); const gfx::Transform& trans = iter->second.transform; trans.TransformPoint(&point); *x = point.x(); *y = point.y(); } } const std::vector<TouchscreenDevice>& DeviceDataManager::GetTouchscreenDevices() const { return touchscreen_devices_; } const std::vector<InputDevice>& DeviceDataManager::GetKeyboardDevices() const { return keyboard_devices_; } const std::vector<InputDevice>& DeviceDataManager::GetMouseDevices() const { return mouse_devices_; } const std::vector<InputDevice>& DeviceDataManager::GetTouchpadDevices() const { return touchpad_devices_; } const std::vector<InputDevice>& DeviceDataManager::GetUncategorizedDevices() const { return uncategorized_devices_; } bool DeviceDataManager::AreDeviceListsComplete() const { return device_lists_complete_; } int64_t DeviceDataManager::GetTargetDisplayForTouchDevice( int touch_device_id) const { auto iter = touch_map_.find(touch_device_id); if (iter != touch_map_.end()) return iter->second.display_id; return display::kInvalidDisplayId; } void DeviceDataManager::OnTouchscreenDevicesUpdated( const std::vector<TouchscreenDevice>& devices) { if (devices.size() == touchscreen_devices_.size() && std::equal(devices.begin(), devices.end(), touchscreen_devices_.begin(), InputDeviceEquals)) { return; } are_touchscreen_target_displays_valid_ = false; touchscreen_devices_ = devices; for (TouchscreenDevice& touchscreen_device : touchscreen_devices_) { touchscreen_device.target_display_id = GetTargetDisplayForTouchDevice(touchscreen_device.id); } UpdateTouchMap(); NotifyObserversTouchscreenDeviceConfigurationChanged(); } void DeviceDataManager::OnKeyboardDevicesUpdated( const std::vector<InputDevice>& devices) { if (devices.size() == keyboard_devices_.size() && std::equal(devices.begin(), devices.end(), keyboard_devices_.begin(), InputDeviceEquals)) { return; } keyboard_devices_ = devices; NotifyObserversKeyboardDeviceConfigurationChanged(); } void DeviceDataManager::OnMouseDevicesUpdated( const std::vector<InputDevice>& devices) { if (devices.size() == mouse_devices_.size() && std::equal(devices.begin(), devices.end(), mouse_devices_.begin(), InputDeviceEquals)) { return; } mouse_devices_ = devices; NotifyObserversMouseDeviceConfigurationChanged(); } void DeviceDataManager::OnTouchpadDevicesUpdated( const std::vector<InputDevice>& devices) { if (devices.size() == touchpad_devices_.size() && std::equal(devices.begin(), devices.end(), touchpad_devices_.begin(), InputDeviceEquals)) { return; } touchpad_devices_ = devices; NotifyObserversTouchpadDeviceConfigurationChanged(); } void DeviceDataManager::OnUncategorizedDevicesUpdated( const std::vector<InputDevice>& devices) { if (devices.size() == uncategorized_devices_.size() && std::equal(devices.begin(), devices.end(), uncategorized_devices_.begin(), InputDeviceEquals)) { return; } uncategorized_devices_ = devices; NotifyObserversUncategorizedDeviceConfigurationChanged(); } void DeviceDataManager::OnDeviceListsComplete() { if (!device_lists_complete_) { device_lists_complete_ = true; NotifyObserversDeviceListsComplete(); } } void DeviceDataManager::OnStylusStateChanged(StylusState state) { NotifyObserversStylusStateChanged(state); } NOTIFY_OBSERVERS( NotifyObserversKeyboardDeviceConfigurationChanged(), OnInputDeviceConfigurationChanged(InputDeviceEventObserver::kKeyboard)) NOTIFY_OBSERVERS( NotifyObserversMouseDeviceConfigurationChanged(), OnInputDeviceConfigurationChanged(InputDeviceEventObserver::kMouse)) NOTIFY_OBSERVERS( NotifyObserversTouchpadDeviceConfigurationChanged(), OnInputDeviceConfigurationChanged(InputDeviceEventObserver::kTouchpad)) NOTIFY_OBSERVERS( NotifyObserversUncategorizedDeviceConfigurationChanged(), OnInputDeviceConfigurationChanged(InputDeviceEventObserver::kUncategorized)) NOTIFY_OBSERVERS( NotifyObserversTouchscreenDeviceConfigurationChanged(), OnInputDeviceConfigurationChanged(InputDeviceEventObserver::kTouchscreen)) NOTIFY_OBSERVERS(NotifyObserversDeviceListsComplete(), OnDeviceListsComplete()) NOTIFY_OBSERVERS(NotifyObserversStylusStateChanged(StylusState state), OnStylusStateChanged(state)) void DeviceDataManager::AddObserver(InputDeviceEventObserver* observer) { observers_.AddObserver(observer); } void DeviceDataManager::RemoveObserver(InputDeviceEventObserver* observer) { observers_.RemoveObserver(observer); } void DeviceDataManager::ResetDeviceListsForTest() { touchscreen_devices_.clear(); keyboard_devices_.clear(); mouse_devices_.clear(); touchpad_devices_.clear(); uncategorized_devices_.clear(); device_lists_complete_ = false; } void DeviceDataManager::SetTouchscreensEnabled(bool enabled) { touch_screens_enabled_ = enabled; } bool DeviceDataManager::AreTouchscreensEnabled() const { return touch_screens_enabled_; } bool DeviceDataManager::AreTouchscreenTargetDisplaysValid() const { return are_touchscreen_target_displays_valid_; } } // namespace ui
{ "content_hash": "d7e7895992e81c7b59bfdf2b7c3069c2", "timestamp": "", "source": "github", "line_count": 293, "max_line_length": 80, "avg_line_length": 31.12627986348123, "alnum_prop": 0.7043859649122807, "repo_name": "ric2b/Vivaldi-browser", "id": "f2b02e8a9f6b6908343d544fa2384ab85c7dea11", "size": "9827", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "chromium/ui/events/devices/device_data_manager.cc", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
// *********************************************************************** // Copyright (c) 2012 Charlie Poole // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** using NUnit.Framework.Interfaces; namespace NUnit.Framework.Internal.Commands { /// <summary> /// TheoryResultCommand adjusts the result of a Theory so that /// it fails if all the results were inconclusive. /// </summary> public class TheoryResultCommand : AfterTestCommand { /// <summary> /// Constructs a TheoryResultCommand /// </summary> /// <param name="command">The command to be wrapped by this one</param> public TheoryResultCommand(TestCommand command) : base(command) { AfterTest = (context) => { TestResult theoryResult = context.CurrentResult; if (theoryResult.ResultState == ResultState.Inconclusive) { if (!theoryResult.HasChildren) theoryResult.SetResult(ResultState.Failure, "No test cases were provided"); else theoryResult.SetResult(ResultState.Failure, "All test cases were inconclusive"); } }; } } }
{ "content_hash": "c5b8f84ebe9d4e6f30e51a1a85f619cc", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 104, "avg_line_length": 43.77777777777778, "alnum_prop": 0.6264805414551607, "repo_name": "jnm2/nunit", "id": "7798af366702e0b4ba16bd674205569923ee4ae4", "size": "2366", "binary": false, "copies": "5", "ref": "refs/heads/use_getawaiter", "path": "src/NUnitFramework/framework/Internal/Commands/TheoryResultCommand.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "48" }, { "name": "C#", "bytes": "3887133" }, { "name": "PowerShell", "bytes": "6317" }, { "name": "Shell", "bytes": "1766" }, { "name": "Visual Basic", "bytes": "1677" } ], "symlink_target": "" }
#include <CQGnuPlotDataModel.h> CQGnuPlotDataModel:: CQGnuPlotDataModel(const CGnuPlotFile &file) : file_(file) { init(); } CQGnuPlotDataModel:: ~CQGnuPlotDataModel() { } void CQGnuPlotDataModel:: setFile(const CGnuPlotFile &file) { file_ = file; init(); } void CQGnuPlotDataModel:: init() { rows1_.clear(); rows2_.clear(); if (isHierarchical1()) { int ns = file_.numSubSets(0); for (int subSet = 0; subSet < ns; ++subSet) rows1_.push_back(Row(-1, subSet)); } else if (isHierarchical2()) { int ns = file_.numSets(); for (int set = 0; set < ns; ++set) { rows1_.push_back(Row(set, -1)); rows2_.push_back(Rows()); int ns1 = file_.numSubSets(set); for (int subSet = 0; subSet < ns1; ++subSet) rows2_[set].push_back(Row(set, subSet)); } } } void CQGnuPlotDataModel:: reload() { #if QT_VERSION < 0x050000 QAbstractItemModel::reset(); #else QAbstractItemModel::beginResetModel(); QAbstractItemModel::endResetModel(); #endif } int CQGnuPlotDataModel:: columnCount(const QModelIndex &) const { return file_.numFields(0, 0, 0); } QVariant CQGnuPlotDataModel:: headerData(int section, Qt::Orientation /*orientation*/, int role) const { if (section < 0 || section >= file_.numColumnHeaders()) return QVariant(); if (role == Qt::DisplayRole) { if (! isWidgetHeaders()) return QVariant(file_.columnHeader(section).c_str()); else return QVariant(); } else if (role == Qt::EditRole) { if (isWidgetHeaders()) return QVariant(file_.columnHeader(section).c_str()); else return QVariant(); } else return QVariant(); } QVariant CQGnuPlotDataModel:: data(const QModelIndex &index, int role) const { if (! index.isValid()) return QVariant(); if (! isHierarchical1() && ! isHierarchical2()) { if (role == Qt::DisplayRole) return QString(file_.field(0, 0, index.row(), index.column()).str().c_str()); else return QVariant(); } else if (isHierarchical1()) { int set = 0; QModelIndex parent = index.parent(); if (parent.isValid()) { int subSet = parent.row(); if (role == Qt::DisplayRole) { Row *row = static_cast<Row *>(index.internalPointer()); assert(row->subSet == subSet); return QString(file_.field(0, subSet, index.row(), index.column()).str().c_str()); } else return QVariant(); } else { if (role == Qt::DisplayRole) { if (index.column() == 0) { int nl = file_.numLines(set, index.row()); return QString("SubSet %1 (%2 Lines)").arg(index.row()).arg(nl); } else return QVariant(); } else return QVariant(); } } else { QModelIndex parent = index.parent(); if (parent.isValid()) { int set = parent.row(); QModelIndex parent1 = parent.parent(); if (parent1.isValid()) { int subSet = set; set = parent1.row(); if (role == Qt::DisplayRole) return QString(file_.field(set, subSet, index.row(), index.column()).str().c_str()); else return QVariant(); } else { if (role == Qt::DisplayRole) { if (index.column() == 0) { int nl = file_.numLines(set, index.row()); return QString("SubSet %1 (%2 Lines)").arg(index.row()).arg(nl); } else return QVariant(); } else return QVariant(); } } else { if (role == Qt::DisplayRole) { if (index.column() == 0) { int ns = file_.numSubSets(index.row()); return QString("Set %1 (%2 SubSets)").arg(index.row()).arg(ns); } else return QVariant(); } else return QVariant(); } } } QModelIndex CQGnuPlotDataModel:: index(int row, int column, const QModelIndex &parent) const { auto *th = const_cast<CQGnuPlotDataModel *>(this); if (! isHierarchical1() && ! isHierarchical2()) { return createIndex(row, column, nullptr); } else if (isHierarchical1()) { if (parent.isValid()) { int subSet = parent.row(); assert(subSet >= 0 && subSet < int(rows1_.size())); return createIndex(row, column, reinterpret_cast<void *>(&th->rows1_[subSet])); } else return createIndex(row, column, nullptr); } else { if (parent.isValid()) { int set = parent.row(); QModelIndex parent1 = parent.parent(); if (parent1.isValid()) { int subSet = set; set = parent1.row(); assert(set >= 0 && set < int(rows2_.size())); assert(subSet >= 0 && subSet < int(rows2_[set].size())); return createIndex(row, column, reinterpret_cast<void *>(&th->rows2_[set][subSet])); } else { assert(set >= 0 && set < int(rows1_.size())); return createIndex(row, column, reinterpret_cast<void *>(&th->rows1_[set])); } } else return createIndex(row, column, nullptr); } } QModelIndex CQGnuPlotDataModel:: parent(const QModelIndex &index) const { auto *th = const_cast<CQGnuPlotDataModel *>(this); if (! index.isValid()) return QModelIndex(); if (! isHierarchical1() && ! isHierarchical2()) { return QModelIndex(); } else if (isHierarchical1()) { Row *row = static_cast<Row *>(index.internalPointer()); if (row) { return createIndex(row->subSet, 0, nullptr); } else return QModelIndex(); } else { Row *row = static_cast<Row *>(index.internalPointer()); if (row) { if (row->subSet < 0) return createIndex(row->set, 0, nullptr); else { assert(row->set >= 0 && row->set < int(rows1_.size())); return createIndex(row->subSet, 0, reinterpret_cast<void *>(&th->rows1_[row->set])); } } else return QModelIndex(); } } int CQGnuPlotDataModel:: rowCount(const QModelIndex &parent) const { if (! isHierarchical1() && ! isHierarchical2()) { if (parent.isValid()) return 0; return file_.numLines(0, 0); } else if (isHierarchical1()) { if (parent.isValid()) { QModelIndex parent1 = parent.parent(); if (parent1.isValid()) return 0; int subSet = parent.row(); return file_.numLines(0, subSet); } return file_.numSubSets(0); } else { if (parent.isValid()) { int set = parent.row(); QModelIndex parent1 = parent.parent(); if (parent1.isValid()) { int subSet = set; set = parent1.row(); QModelIndex parent2 = parent1.parent(); if (parent2.isValid()) return 0; return file_.numLines(set, subSet); } return file_.numSubSets(set); } return file_.numSets(); } } bool CQGnuPlotDataModel:: isHierarchical1() const { if (isHierarchical2()) return false; return (file_.numSubSets(0) > 1); } bool CQGnuPlotDataModel:: isHierarchical2() const { return (file_.numSets() > 1); }
{ "content_hash": "d28777c3b0f7599925b5108d4139f235", "timestamp": "", "source": "github", "line_count": 336, "max_line_length": 94, "avg_line_length": 21.014880952380953, "alnum_prop": 0.5708823112873531, "repo_name": "colinw7/CQGnuPlot", "id": "bf2f4397e259d1a8fb1a258a1a70115884bfbd08", "size": "7061", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/CQGnuPlotDataModel.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "3524" }, { "name": "C++", "bytes": "3154262" }, { "name": "Gnuplot", "bytes": "161224" }, { "name": "Makefile", "bytes": "102" }, { "name": "QMake", "bytes": "12154" }, { "name": "Shell", "bytes": "87" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Minim : : Waves : : randomNHarms</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="stylesheet.css" rel="stylesheet" type="text/css"> </head> <body> <center> <table class="mainTable"> <tr> <td class="header"> <span class="indexheader">Minim</span><br/> <span class="indexnavigation"> <a href="index.html">core</a> | <a href="index_ugens.html">ugens</a> | <a href="index_analysis.html">analysis</a> </span> </td> <td class="border-left">&nbsp;</td> </tr> <tr> <td class="classNavigation"> <p class="mainTextName"><A href="waves_class_waves.html">Waves</A></p> <p class="methodName">randomNHarms</p> </td> <td class="mainText border-left"> <p class="memberSectionHeader">Description</p> Constructs a waveform by summing together the first numberOfHarmonics in the harmonic series with randomly chosen amplitudes. This often sounds like an organ. <p class="memberSectionHeader">Signature</p> <pre>Wavetable randomNHarms(int numberOfHarmonics) </pre> <p class="memberSectionHeader">Parameters</p> <span class="parameterName">numberOfHarmonics</span>&nbsp;&mdash;&nbsp;<span class="parameterDescription">int: the number of harmonics to use when generating the wave</span><br/> <p class="memberSectionHeader">Returns</p> <p>a Wavetable</p> <p class="memberSectionHeader">Related</p> <A href="waves_class_waves.html">Waves</A><BR> <A href="wavetable_class_wavetable.html">Wavetable</A><BR> <A href="waveform_waveform.html">Waveform</A><BR> <p class="memberSectionHeader">Example</p> <pre>None available</pre> <p class="memberSectionHeader">Usage</p> Web & Application </td> </tr> </table> </center> </body> </html>
{ "content_hash": "b91bde57990863826211b33d8ecbeaa2", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 186, "avg_line_length": 29.73134328358209, "alnum_prop": 0.6460843373493976, "repo_name": "jooray/OpenBCI_Processing_NFB", "id": "c171051c191fe139cb7a6677fdd33a688bdaad60", "size": "1992", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "libraries/minim/documentation/waves_method_randomnharms.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "15681" }, { "name": "HTML", "bytes": "5875528" }, { "name": "Java", "bytes": "2014333" }, { "name": "JavaScript", "bytes": "827" }, { "name": "Processing", "bytes": "1101419" } ], "symlink_target": "" }
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon")); var _jsxRuntime = require("react/jsx-runtime"); var _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", { d: "M17 10h-4l3-8H7v11h3v9z" }), 'FlashOnTwoTone'); exports.default = _default;
{ "content_hash": "3715901f9a2ecf28d45f65d4648ef03f", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 87, "avg_line_length": 27.38888888888889, "alnum_prop": 0.7079107505070994, "repo_name": "oliviertassinari/material-ui", "id": "15afb9ec7aefe36656ca7393933f4c209e25bd33", "size": "493", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "packages/mui-icons-material/lib/FlashOnTwoTone.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "2126" }, { "name": "JavaScript", "bytes": "3779365" }, { "name": "TypeScript", "bytes": "2514535" } ], "symlink_target": "" }
#region Licence #endregion using System; using System.Collections.Generic; using System.Diagnostics; using System.Threading; namespace WmcSoft.Diagnostics { /// <summary> /// Represents a Named counter. /// </summary> [DebuggerDisplay("{ToString(),nq}")] public sealed class Counter : IComparable<Counter> { static readonly Comparer<int> comparer = Comparer<int>.Default; int count; /// <summary> /// Construct a new counter. /// </summary> /// <param name="name">The name of the counter.</param> public Counter(string name) { if (name == null) throw new ArgumentNullException(nameof(name)); if (string.IsNullOrWhiteSpace(name)) throw new ArgumentException(nameof(name)); Name = name; } /// <summary> /// Name of the counter. /// </summary> public string Name { get; } /// <summary> /// Increment the counter. /// </summary> public void Increment() { Interlocked.Increment(ref count); } /// <summary> /// Number of increments since creation. /// </summary> public int Tally => count; /// <summary> /// Resets the counter. /// </summary> /// <returns>Returns the tally before the reset.</returns> public int Reset() { return Interlocked.Exchange(ref count, 0); } /// <summary> /// Returns a string that represents the current counter. /// </summary> /// <returns>A string that represents the current counter.</returns> public override string ToString() { return count + " (" + Name + ')'; } /// <summary> /// Compares the current instance with another object of the same type and returns /// an integer that indicates whether the current instance precedes, follows, or /// occurs in the same position in the sort order as the other object. /// </summary> /// <param name="other">An object to compare with this instance.</param> /// <returns> /// A signed integer that indicates the relative values of counters being compared, as shown in the /// following table. /// <list type="table"> /// <listheader> /// <description>Value</description> /// <description>Meaning</description> /// </listheader> /// <item> /// <description>Less than zero</description> /// <description> This instance's value is less than <paramref name="other"/>'s value.</description> /// </item> /// <item> /// <description>Zero</description> /// <description>This instance's value equals <paramref name="other"/>'s value.</description> /// </item> /// <item> /// <description>Greater than zero</description> /// <description>This instance's value is greater than <paramref name="other"/>'s value.</description> /// </item> /// </list> /// </returns> public int CompareTo(Counter other) { if (other == null) return 1; var result = comparer.Compare(count, other.count); if (result == 0) return StringComparer.InvariantCulture.Compare(Name, other.Name); return result; } public override bool Equals(object obj) { return CompareTo(obj as Counter) == 0; } public override int GetHashCode() { return Name.GetHashCode(); } public static bool operator ==(Counter left, Counter right) { if (left is null) { return right is null; } return left.Equals(right); } public static bool operator !=(Counter left, Counter right) { return !(left == right); } public static bool operator <(Counter left, Counter right) { return left is null ? !(right is null) : left.CompareTo(right) < 0; } public static bool operator <=(Counter left, Counter right) { return left is null || left.CompareTo(right) <= 0; } public static bool operator >(Counter left, Counter right) { return !(left is null) && left.CompareTo(right) > 0; } public static bool operator >=(Counter left, Counter right) { return left is null ? right is null : left.CompareTo(right) >= 0; } } }
{ "content_hash": "5cf27f8fe2375aa787610943f33d3d90", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 112, "avg_line_length": 30.329032258064515, "alnum_prop": 0.5422250584981919, "repo_name": "vjacquet/WmcSoft", "id": "e7c6e30a53ede226b02125886db6e5a7f80d62bc", "size": "5723", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "WmcSoft.Core/Diagnostics/Counter.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "6123726" }, { "name": "Smalltalk", "bytes": "11132" } ], "symlink_target": "" }
package org.apache.ignite.ml.math.impls.storage.matrix; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import org.apache.ignite.ml.math.MatrixStorage; import org.apache.ignite.ml.math.exceptions.UnsupportedOperationException; import org.apache.ignite.ml.math.functions.IntIntDoubleToVoidFunction; import org.apache.ignite.ml.math.functions.IntIntToDoubleFunction; /** * Read-only or read-write function-based matrix storage. */ public class FunctionMatrixStorage implements MatrixStorage { /** */ private int rows; /** */ private int cols; /** */ private IntIntToDoubleFunction getFunc; /** */ private IntIntDoubleToVoidFunction setFunc; /** * */ public FunctionMatrixStorage() { // No-op. } /** * @param rows Amount of rows in the matrix. * @param cols Amount of columns in the matrix. * @param getFunc Function that returns value corresponding to given row and column index. * @param setFunc Set function. If {@code null} - this will be a read-only matrix. */ public FunctionMatrixStorage(int rows, int cols, IntIntToDoubleFunction getFunc, IntIntDoubleToVoidFunction setFunc) { assert rows > 0; assert cols > 0; assert getFunc != null; this.rows = rows; this.cols = cols; this.getFunc = getFunc; this.setFunc = setFunc; } /** * @param rows Amount of rows in the matrix. * @param cols Amount of columns in the matrix. * @param getFunc Function that returns value corresponding to given row and column index. */ public FunctionMatrixStorage(int rows, int cols, IntIntToDoubleFunction getFunc) { this(rows, cols, getFunc, null); } /** {@inheritDoc} */ @Override public double get(int x, int y) { return getFunc.apply(x, y); } /** {@inheritDoc} */ @Override public void set(int x, int y, double v) { if (setFunc != null) setFunc.apply(x, y, v); else throw new UnsupportedOperationException("Cannot set into read-only matrix."); } /** * */ public IntIntToDoubleFunction getFunction() { return getFunc; } /** * */ public IntIntDoubleToVoidFunction setFunction() { return setFunc; } /** {@inheritDoc} */ @Override public int columnSize() { return cols; } /** {@inheritDoc} */ @Override public int rowSize() { return rows; } /** {@inheritDoc} */ @Override public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(setFunc); out.writeObject(getFunc); out.writeInt(rows); out.writeInt(cols); } /** {@inheritDoc} */ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { setFunc = (IntIntDoubleToVoidFunction)in.readObject(); getFunc = (IntIntToDoubleFunction)in.readObject(); rows = in.readInt(); cols = in.readInt(); } /** {@inheritDoc} */ @Override public boolean isSequentialAccess() { return false; } /** {@inheritDoc} */ @Override public boolean isDense() { return false; } /** {@inheritDoc} */ @Override public boolean isRandomAccess() { return false; } /** {@inheritDoc} */ @Override public boolean isDistributed() { return false; } /** {@inheritDoc} */ @Override public boolean isArrayBased() { return false; } /** {@inheritDoc} */ @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FunctionMatrixStorage that = (FunctionMatrixStorage)o; return rows == that.rows && cols == that.cols && (getFunc != null ? getFunc.equals(that.getFunc) : that.getFunc == null) && (setFunc != null ? setFunc.equals(that.setFunc) : that.setFunc == null); } /** {@inheritDoc} */ @Override public int hashCode() { int res = rows; res = 31 * res + cols; res = 31 * res + (getFunc != null ? getFunc.hashCode() : 0); res = 31 * res + (setFunc != null ? setFunc.hashCode() : 0); return res; } }
{ "content_hash": "1bb53a4ecab1b4c5b932ee1f2853d5df", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 99, "avg_line_length": 27.3375, "alnum_prop": 0.6044810242341107, "repo_name": "rfqu/ignite", "id": "acd7c29dd8e7b25543764e9f00de24deb57868fa", "size": "5176", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "modules/ml/src/main/java/org/apache/ignite/ml/math/impls/storage/matrix/FunctionMatrixStorage.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "44754" }, { "name": "C", "bytes": "5286" }, { "name": "C#", "bytes": "4699687" }, { "name": "C++", "bytes": "2495144" }, { "name": "CSS", "bytes": "134600" }, { "name": "Groovy", "bytes": "15092" }, { "name": "HTML", "bytes": "513770" }, { "name": "Java", "bytes": "27984919" }, { "name": "JavaScript", "bytes": "1104762" }, { "name": "M4", "bytes": "12424" }, { "name": "Makefile", "bytes": "103829" }, { "name": "Nginx", "bytes": "3468" }, { "name": "PHP", "bytes": "11079" }, { "name": "PowerShell", "bytes": "13480" }, { "name": "Scala", "bytes": "681532" }, { "name": "Shell", "bytes": "593265" }, { "name": "Smalltalk", "bytes": "1911" } ], "symlink_target": "" }
/* 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 * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.activiti5.engine.impl.cmd; import java.io.Serializable; import java.util.HashMap; import java.util.List; import java.util.Map; import org.activiti5.engine.ActivitiException; import org.activiti5.engine.ActivitiObjectNotFoundException; import org.activiti5.engine.impl.interceptor.Command; import org.activiti5.engine.impl.interceptor.CommandContext; import org.activiti5.engine.impl.persistence.entity.ExecutionEntity; import org.activiti5.engine.impl.persistence.entity.SignalEventSubscriptionEntity; import org.activiti5.engine.runtime.Execution; /** * @author Daniel Meyer * @author Joram Barrez */ public class SignalEventReceivedCmd implements Command<Void> { protected final String eventName; protected final String executionId; protected final Serializable payload; protected final boolean async; protected String tenantId; public SignalEventReceivedCmd(String eventName, String executionId, Map<String, Object> processVariables, String tenantId) { this.eventName = eventName; this.executionId = executionId; if (processVariables != null) { if (processVariables instanceof Serializable){ this.payload = (Serializable) processVariables; } else{ this.payload = new HashMap<String, Object>(processVariables); } } else{ this.payload = null; } this.async = false; this.tenantId = tenantId; } public SignalEventReceivedCmd(String eventName, String executionId, boolean async, String tenantId) { this.eventName = eventName; this.executionId = executionId; this.async = async; this.payload = null; this.tenantId = tenantId; } public Void execute(CommandContext commandContext) { List<SignalEventSubscriptionEntity> signalEvents = null; if (executionId == null) { signalEvents = commandContext.getEventSubscriptionEntityManager().findSignalEventSubscriptionsByEventName(eventName, tenantId); } else { ExecutionEntity execution = commandContext.getExecutionEntityManager().findExecutionById(executionId); if (execution == null) { throw new ActivitiObjectNotFoundException("Cannot find execution with id '" + executionId + "'", Execution.class); } if (execution.isSuspended()) { throw new ActivitiException("Cannot throw signal event '" + eventName + "' because execution '" + executionId + "' is suspended"); } signalEvents = commandContext.getEventSubscriptionEntityManager().findSignalEventSubscriptionsByNameAndExecution(eventName, executionId); if (signalEvents.isEmpty()) { throw new ActivitiException("Execution '"+executionId+"' has not subscribed to a signal event with name '"+eventName+"'."); } } for (SignalEventSubscriptionEntity signalEventSubscriptionEntity : signalEvents) { // We only throw the event to globally scoped signals. // Process instance scoped signals must be thrown within the process itself if (signalEventSubscriptionEntity.isGlobalScoped()) { signalEventSubscriptionEntity.eventReceived(payload, async); } } return null; } }
{ "content_hash": "844cffc6e9df13ce0faa8121f2667e52", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 148, "avg_line_length": 36.504672897196265, "alnum_prop": 0.700204813108039, "repo_name": "stefan-ziel/Activiti", "id": "e6eb6fcd296b9afdd1c9e0d476f76b50b9d195e0", "size": "3906", "binary": false, "copies": "3", "ref": "refs/heads/6.x-c", "path": "modules/activiti5-engine/src/main/java/org/activiti5/engine/impl/cmd/SignalEventReceivedCmd.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "166" }, { "name": "CSS", "bytes": "292473" }, { "name": "HTML", "bytes": "774326" }, { "name": "Java", "bytes": "20888915" }, { "name": "JavaScript", "bytes": "8873337" }, { "name": "PLSQL", "bytes": "1426" }, { "name": "PLpgSQL", "bytes": "4868" }, { "name": "Shell", "bytes": "8194" } ], "symlink_target": "" }
package org.batfish.representation; import java.util.Set; public class PolicyMapMatchAsPathAccessListLine extends PolicyMapMatchLine { private static final long serialVersionUID = 1L; private Set<AsPathAccessList> _lists; public PolicyMapMatchAsPathAccessListLine(Set<AsPathAccessList> lists) { _lists = lists; } public Set<AsPathAccessList> getLists() { return _lists; } @Override public PolicyMapMatchType getType() { return PolicyMapMatchType.AS_PATH_ACCESS_LIST; } }
{ "content_hash": "cc1f1dd6d63e41d28fd0b46e789c2e33", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 76, "avg_line_length": 21.833333333333332, "alnum_prop": 0.7366412213740458, "repo_name": "Alexia23/batfish", "id": "8588db7c77ce19a1142b97b57d094d7a17115e0d", "size": "524", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "projects/batfish/src/org/batfish/representation/PolicyMapMatchAsPathAccessListLine.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "235942" }, { "name": "CSS", "bytes": "3221" }, { "name": "HTML", "bytes": "28079" }, { "name": "Java", "bytes": "1739351" }, { "name": "JavaScript", "bytes": "23680" }, { "name": "Shell", "bytes": "2403" } ], "symlink_target": "" }
{% extends "_layout.html" %} {% from "security/_macros.html" import render_field_with_errors, render_field %} {% block title %} - Login{% endblock %} {% block customcss %} <link href="/static/css/forms.css" rel="stylesheet"> {% endblock %} {% block custombodytags %} id="login" {% endblock %} {% block content %} <!-- Main component for a primary marketing message or call to action --> <div class="container"> {% if error %} <p class=error> <strong>Error: </strong>{{ error }} </p> {% endif %} <form class="form-signin" action="{{ url_for_security('login') }}" method="POST" name='login_user_form'> <h2 class="form-signin-heading">Please sign in</h2> {{ login_user_form.hidden_tag() }} {{ render_field_with_errors(login_user_form.email, class='form-control', placeholder="Email", required=true, autofocus=True) }} {{ render_field_with_errors(login_user_form.password, class='form-control', placeholder='Password', required=True) }} <label class="checkbox"> {{ render_field_with_errors(login_user_form.remember, class='checkbox') }} Remember me </label> {{ render_field(login_user_form.next) }} {{ render_field(login_user_form.submit,class='btn btn-lg btn-primary btn-block') }} <a href="{{ url_for_security('forgot_password') }}">Forgot password</a> </form> </div> {% endblock %}
{ "content_hash": "fc7b7632145b0b0b6e1ddf4eac71adc7", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 131, "avg_line_length": 41.84375, "alnum_prop": 0.6564600448095593, "repo_name": "ebeckm/Flask_bootstrap_starterkit", "id": "d19cdb99994e5a738efe15ae6c222f1c81b0ab27", "size": "1339", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "templates/security/login_user.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Common.Converters { public static class StringConverter { public static T ConvertString<T>(this string input) { var converter = TypeDescriptor.GetConverter(typeof(T)); if (converter != null) { return (T)converter.ConvertFromString(input); } throw new Exception("Converter not found!"); } } }
{ "content_hash": "3dd7dd8c2fc7ebbc3f66310cb8dfe698", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 67, "avg_line_length": 25.5, "alnum_prop": 0.6256684491978609, "repo_name": "shoter/C-Common", "id": "b41f0806ea23fdaf2edaa3115a91eb75df8d6a7d", "size": "563", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Common/Converters/StringConverter.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "121402" }, { "name": "PowerShell", "bytes": "43" } ], "symlink_target": "" }
package com.intellij.util.containers; import com.intellij.util.DeprecatedMethodException; import org.jetbrains.annotations.NotNull; import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.util.Map; /** * @deprecated use {@link ContainerUtil#createWeakKeyWeakValueMap()} instead */ @Deprecated public final class WeakKeyWeakValueHashMap<K,V> extends RefKeyRefValueHashMap<K,V> implements Map<K,V>{ public WeakKeyWeakValueHashMap() { this(false); DeprecatedMethodException.report("Use ContainerUtil#createWeakKeyWeakValueMap() instead"); } WeakKeyWeakValueHashMap(boolean good) { super((RefHashMap<K, ValueReference<K, V>>)ContainerUtil.<K, ValueReference<K, V>>createWeakMap()); } private static class WeakValueReference<K,V> extends WeakReference<V> implements ValueReference<K,V> { @NotNull private final RefHashMap.Key<K> key; private WeakValueReference(@NotNull RefHashMap.Key<K> key, V referent, ReferenceQueue<? super V> q) { super(referent, q); this.key = key; } @NotNull @Override public RefHashMap.Key<K> getKey() { return key; } } @NotNull @Override protected ValueReference<K, V> createValueReference(@NotNull RefHashMap.Key<K> key, V referent, ReferenceQueue<? super V> q) { return new WeakValueReference<K, V>(key, referent, q); } }
{ "content_hash": "76b1d334ba43b737fb5f532ca6a2051c", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 105, "avg_line_length": 31.382978723404257, "alnum_prop": 0.6813559322033899, "repo_name": "sabi0/intellij-community", "id": "338dd5a6198b08304de20197f1ef970b60e7ad76", "size": "2075", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "platform/util/src/com/intellij/util/containers/WeakKeyWeakValueHashMap.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package org.hoteia.qalingo.core.pojo.cart; import java.math.BigDecimal; import org.hoteia.qalingo.core.pojo.CurrencyReferentialPojo; public class CartItemPricePojo { private BigDecimal catalogPrice; private CurrencyReferentialPojo currency; protected BigDecimal salePrice; protected BigDecimal moneySaving; protected String priceWithStandardCurrencySign; public CartItemPricePojo() { } public BigDecimal getCatalogPrice() { return catalogPrice; } public void setCatalogPrice(BigDecimal catalogPrice) { this.catalogPrice = catalogPrice; } public CurrencyReferentialPojo getCurrency() { return currency; } public void setCurrency(CurrencyReferentialPojo currency) { this.currency = currency; } public BigDecimal getSalePrice() { return salePrice; } public void setSalePrice(BigDecimal salePrice) { this.salePrice = salePrice; } public BigDecimal getMoneySaving() { return moneySaving; } public void setMoneySaving(BigDecimal moneySaving) { this.moneySaving = moneySaving; } public String getPriceWithStandardCurrencySign() { return priceWithStandardCurrencySign; } public void setPriceWithStandardCurrencySign(String priceWithStandardCurrencySign) { this.priceWithStandardCurrencySign = priceWithStandardCurrencySign; } }
{ "content_hash": "be3d51c6f9c0752c827db6c7c4f24a0c", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 88, "avg_line_length": 23.949152542372882, "alnum_prop": 0.7246992215145082, "repo_name": "eric-stanley/qalingo-engine", "id": "bc8b255a4cb72f9d16a957cbe6a27bf9a21a0290", "size": "1749", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "apis/api-core/api-core-common/src/main/java/org/hoteia/qalingo/core/pojo/cart/CartItemPricePojo.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "3964308" } ], "symlink_target": "" }
module Tr8n class BaseController < ApplicationController layout Tr8n::Config.site_info[:tr8n_layout] if Tr8n::Config.tr8n_helpers.any? helper *Tr8n::Config.tr8n_helpers end if Tr8n::Config.skip_before_filters.any? skip_before_filter *Tr8n::Config.skip_before_filters end if Tr8n::Config.before_filters.any? before_filter *Tr8n::Config.before_filters end if Tr8n::Config.after_filters.any? after_filter *Tr8n::Config.after_filters end before_filter :validate_tr8n_enabled, :except => [:translate] before_filter :validate_guest_user, :except => [:select, :switch, :translate, :table, :registration] before_filter :validate_current_translator, :except => [:select, :switch, :translate, :table, :registration] before_filter :validate_remote_application layout Tr8n::Config.site_info[:tr8n_layout] private def validate_remote_application return if params[:origin].blank? domain = Tr8n::TranslationDomain.find_or_create(params[:origin]) Tr8n::Config.set_remote_application(domain.application) end def render_lightbox render(:layout => false) end def dismiss_lightbox redirect_to(:controller => "/tr8n/help", :action => "lb_done", :origin => params[:origin]) end def tr8n_features_tabs @tabs ||= begin tabs = Tr8n::Config.features.clone unless Tr8n::Config.multiple_base_languages? tabs = tabs.select{|tab| tab[:default_language]} if tr8n_current_language.default? end unless tr8n_current_user_is_translator? and tr8n_current_translator.manager? tabs = tabs.select{|tab| !tab[:manager_only]} end if tr8n_current_language.dir == 'rtl' tabs = tabs.reverse end tabs end end helper_method :tr8n_features_tabs def redirect_to_source # Do not allow redirects to external websites escaped_origin_host = Regexp.escape("#{request.protocol}#{request.host}") if(!params[:source_url].blank? && params[:source_url] =~ /^#{escaped_origin_host}/) return redirect_to(params[:source_url]) end return redirect_to(request.env['HTTP_REFERER']) unless request.env['HTTP_REFERER'].blank? redirect_to_site_default_url end def redirect_to_site_default_url redirect_to(Tr8n::Config.default_url) end def page params[:page] || 1 end def per_page params[:per_page] || 30 end def sanitize_label(label) # do not double escape # CGI::escapeHTML(label.strip) ERB::Util.html_escape(label.strip) end # handle disabled state for tr8n def validate_tr8n_enabled if Tr8n::Config.disabled? trfe("You don't have rights to access that section.") return redirect_to(Tr8n::Config.default_url) end end # guest users can still switch between languages outside of the site def validate_guest_user if tr8n_current_user_is_guest? trfe("You must be a registered user in order to access this section of the site.") return redirect_to(Tr8n::Config.default_url) end end # make sure that the current user is a translator def validate_current_translator if tr8n_current_user_is_translator? and tr8n_current_translator.blocked? trfe("Your translation privileges have been revoked. Please contact the site administrator for more details.") return redirect_to(Tr8n::Config.default_url) end return if Tr8n::Config.current_user_is_translator? redirect_to("/tr8n/translator/registration") end # make sure that the current user is a language manager def validate_language_management # admins can do everything return if tr8n_current_user_is_admin? if tr8n_current_language.default? trfe("Only administrators can modify this language") return redirect_to(tr8n_features_tabs.first[:link]) end unless tr8n_current_user_is_translator? and tr8n_current_translator.manager? trfe("In order to manage a language you first must request to become a manager of that language.") return redirect_to(tr8n_features_tabs.first[:link]) end end def validate_default_language return if Tr8n::Config.multiple_base_languages? redirect_to(tr8n_features_tabs.first[:link]) if tr8n_current_language.default? end def validate_language return unless params[:language] return if params[:language][:fallback_language_id].blank? # default fallback_language = Tr8n::Language.find(params[:language][:fallback_language_id]) while fallback_language do if fallback_language == tr8n_current_language return "You are creating an infinite loop with fallback languages. Please ensure that languages do not fall back onto each other." end fallback_language = fallback_language.fallback_language end end def validate_admin unless tr8n_current_user_is_admin? trfe("You must be an admin in order to view this section of the site") redirect_to_site_default_url end end end end
{ "content_hash": "cc9a50e71f9bc932a15e4958f6d90409", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 140, "avg_line_length": 32.11585365853659, "alnum_prop": 0.6637554585152838, "repo_name": "geni/tr8n", "id": "e3e8f233fa1e974c085314090a390cbb08d842f9", "size": "6392", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "app/controllers/tr8n/base_controller.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "92967" }, { "name": "JavaScript", "bytes": "940777" }, { "name": "Ruby", "bytes": "851421" } ], "symlink_target": "" }
namespace metrics { TEST(MachineIdProviderTest, GetId) { content::TestBrowserThreadBundle thread_bundle; scoped_refptr<MachineIdProvider> provider( MachineIdProvider::CreateInstance()); std::string id1 = provider->GetMachineId(); EXPECT_NE(std::string(), id1); std::string id2 = provider->GetMachineId(); EXPECT_EQ(id1, id2); } } // namespace metrics
{ "content_hash": "a2c64afbf03212521496d9f65b87e83f", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 49, "avg_line_length": 23.4375, "alnum_prop": 0.72, "repo_name": "patrickm/chromium.src", "id": "93a091db19ef35969888032f441f1abe9ac522d1", "size": "743", "binary": false, "copies": "2", "ref": "refs/heads/nw", "path": "chrome/browser/metrics/machine_id_provider_win_unittest.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "853" }, { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "52960" }, { "name": "Awk", "bytes": "8660" }, { "name": "C", "bytes": "40737238" }, { "name": "C#", "bytes": "1132" }, { "name": "C++", "bytes": "207930633" }, { "name": "CSS", "bytes": "939170" }, { "name": "Java", "bytes": "5844934" }, { "name": "JavaScript", "bytes": "17837835" }, { "name": "Mercury", "bytes": "10533" }, { "name": "Objective-C", "bytes": "886228" }, { "name": "Objective-C++", "bytes": "6667789" }, { "name": "PHP", "bytes": "97817" }, { "name": "Perl", "bytes": "672770" }, { "name": "Python", "bytes": "10857933" }, { "name": "Rebol", "bytes": "262" }, { "name": "Shell", "bytes": "1326032" }, { "name": "Tcl", "bytes": "277091" }, { "name": "XSLT", "bytes": "13493" }, { "name": "nesC", "bytes": "15206" } ], "symlink_target": "" }
namespace YAML { typedef std::recursive_mutex NodeMutex; typedef std::lock_guard<NodeMutex> NodeLock; class Node { public: friend class NodeBuilder; friend class NodeEvents; friend struct detail::iterator_value; friend class detail::node_data; template<typename> friend class detail::iterator_base; template<typename T, typename S> friend struct as_if; typedef YAML::iterator iterator; typedef YAML::const_iterator const_iterator; Node(); explicit Node(NodeType::value type); template<typename T> explicit Node(const T& rhs); explicit Node(const detail::iterator_value& rhs); Node(const Node& rhs); ~Node(); NodeType::value Type() const; bool IsDefined() const; bool IsNull() const { return Type() == NodeType::Null; } bool IsScalar() const { return Type() == NodeType::Scalar; } bool IsSequence() const { return Type() == NodeType::Sequence; } bool IsMap() const { return Type() == NodeType::Map; } // bool conversions YAML_CPP_OPERATOR_BOOL(); bool operator!() const { return !IsDefined(); } // access template<typename T> const T as() const; template<typename T, typename S> const T as(const S& fallback) const; const std::string& Scalar() const; const std::string& Tag() const; void SetTag(const std::string& tag); // assignment bool is(const Node& rhs) const; template<typename T> Node& operator=(const T& rhs); Node& operator=(const Node& rhs); void reset(const Node& rhs = Node()); // size/iterator std::size_t size() const; const_iterator begin() const; iterator begin(); const_iterator end() const; iterator end(); // sequence template<typename T> void push_back(const T& rhs); void push_back(const Node& rhs); // indexing template<typename Key> const Node operator[](const Key& key) const; template<typename Key> Node operator[](const Key& key); template<typename Key> bool remove(const Key& key); const Node operator[](const Node& key) const; Node operator[](const Node& key); bool remove(const Node& key); // map template<typename Key, typename Value> void force_insert(const Key& key, const Value& value); private: enum Zombie { ZombieNode }; explicit Node(Zombie); explicit Node(detail::node& node, detail::shared_memory_holder pMemory); void EnsureNodeExists() const; template<typename T> void Assign(const T& rhs); void Assign(const char *rhs); void Assign(char *rhs); void AssignData(const Node& rhs); void AssignNode(const Node& rhs); private: bool m_isValid; mutable detail::shared_memory_holder m_pMemory; mutable detail::node *m_pNode; //NOTE - read operations cause writes! So, even in const methods, we //need mutex access. mutable NodeMutex m_mutex; }; bool operator==(const Node& lhs, const Node& rhs); Node Clone(const Node& node); template<typename T> struct convert; } #endif // NODE_NODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
{ "content_hash": "4d51a07c17e7a2a7309b0b5db1ff46dc", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 74, "avg_line_length": 28.065420560747665, "alnum_prop": 0.6813186813186813, "repo_name": "wwoods/job_stream", "id": "9d24aae184f4a93669c8f45c165b18f028d3bf8f", "size": "3516", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "yaml-cpp-0.5.1/include/yaml-cpp/node/node.h", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "7740" }, { "name": "C", "bytes": "20827" }, { "name": "C++", "bytes": "2253317" }, { "name": "CMake", "bytes": "69986" }, { "name": "CSS", "bytes": "15349" }, { "name": "HTML", "bytes": "508837" }, { "name": "JavaScript", "bytes": "95472" }, { "name": "Makefile", "bytes": "413444" }, { "name": "Python", "bytes": "163187" }, { "name": "Shell", "bytes": "85" } ], "symlink_target": "" }
Numly ===== A Node.js package for assisting geek numerologists like me.
{ "content_hash": "1f7dd2a76e5403c38e135e1a4d72c8ef", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 59, "avg_line_length": 18.25, "alnum_prop": 0.7397260273972602, "repo_name": "joelalejandro/Numly", "id": "013f76a43eb494f543cf0b2b7033f23b0394e349", "size": "73", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">AMBI Lactation Consultant</string> <string name="button_register">Registration</string> <string name="button_submit">Submit</string> <string name="firstName">First Name</string> <string name="lastName">Last Name</string> <string name="username">Username</string> <string name="password">Password</string> <string name="Email">Email</string> <string name="submit">Submit</string> <string name="acct_reg">Account Registration</string> <string name="title_activity_fullscreen">FullscreenActivity</string> <string name="change_layout_manager">Change Layout</string> <string-array name="organization"> <item>Choose one</item> <item>Organization</item> <item>Hospital Administrator</item> <item>Patient</item> <item>Test User</item> </string-array> <string-array name="action"> <item>Choose one</item> <item>Request consent form agreement</item> <item>Request Graceland University consent form agreement</item> <item>Request system feedback</item> <item>Send breastfeeding followup</item> <item>Send self-efficiency survey</item> <item>Send breastfeeding evaluation</item> <item>Send postnatal depression survey</item> <item>Issue Mother Information</item> <item>Reset Password</item> <item>Disable User</item> <item>Enable User</item> <item>Delete User</item> </string-array> <string-array name="addUser"> <item>Choose one</item> <item>Mother</item> <item>Other</item> </string-array> <string-array name="motherInfo"> <item>Choose one</item> <item>Mother1</item> <item>Mother2</item> </string-array> <string-array name="age"> <item>Choose one</item> <item> less than 20</item> <item> 20-29</item> <item> 30-39</item> <item> 40 or more</item> </string-array> <string-array name="ethnicity"> <item>Choose one</item> <item>Hispanic or Latino</item> <item>NON Hispanic or Latino</item> </string-array> <string-array name="race"> <item>Choose one</item> <item>Native Hawaiian or Pacific Islander</item> <item>Asian</item> <item>Black or African American</item> <item>American Indian/Alaskan Native</item> <item>White</item> <item>More than one Race</item> </string-array> <string-array name="educationalLevel"> <item>Choose one</item> <item>Less than Highschool</item> <item>High School/GED</item> <item>Some College</item> <item>Associate College</item> <item>BA or BS degree</item> <item>Masters Degree</item> <item>Doctoral Degree</item> <item>Professional Degree</item> </string-array> <string-array name="householdIncome"> <item>Choose one</item> <item>Less than $10,000</item> <item>$10,000 to less than $24,999</item> <item>$25,000 to $49,999</item> <item>$50,000 or more</item> </string-array> <string-array name="occupation"> <item>Choose one</item> <item>Homemaker</item> <item>Professional</item> <item>Cashier, Secretary, Laborer, Technician</item> <item>Other</item> </string-array> <string-array name="residence"> <item>Choose one</item> <item>Rural</item> <item>Urban</item> <item>Apartment/Rental</item> <item>Owned</item> </string-array> <string-array name="ThisBabyIsYour"> <item>Choose one</item> <item>First</item> <item>Second</item> <item>Third</item> <item>Fourth/more</item> </string-array> <string-array name="MethodOfDelivery"> <item>Choose one</item> <item>Vagina</item> <item>Vaginal with Assistance</item> <item>Breech</item> <item>Section</item> </string-array> <string-array name="PastBreastfeedingExperience"> <item>Choose one</item> <item> less than 3 months</item> <item> 3-6 months</item> <item> 7-12 months</item> <item> less than a year</item> <item> No past breastfeeding experience</item> </string-array> <string-array name="GestationalAge"> <item>Choose one</item> <item>less than 34 weeks</item> <item>34 to 35 weeks</item> <item>35 to 36 weeks</item> <item>36 to 37 weeks</item> <item>Greater than 37 weeks</item> </string-array> <string-array name="AppropriatenessForAge"> <item>Choose one</item> <item>AGA</item> <item>SGA</item> <item>LGA</item> </string-array> <string-array name="InfantWeight1"> <item>Choose one</item> <item>&lt; 2 pounds</item> <item>2 pounds</item> <item>3 pounds</item> <item>4 pounds</item> <item>5 pounds</item> <item>6 pounds</item> <item>7 pounds</item> <item>8 pounds</item> <item>9 pounds</item> <item>10 pounds</item> <item>&gt; 10 pounds</item> </string-array> <string-array name="InfantWeight2"> <item>Choose one</item> <item>1 ounces</item> <item>2 ounces</item> <item>3 ounces</item> <item>4 ounces</item> <item>5 ounces</item> <item>6 ounces</item> <item>7 ounces</item> <item>8 ounces</item> <item>9 ounces</item> <item>10 ounces</item> <item>11 ounces</item> <item>12 ounces</item> <item>13 ounces</item> <item>14 ounces</item> <item>15 ounces</item> <item>16 ounces</item> </string-array> <string-array name="firstfeeding"> <item>Choose one</item> <item>Mother's own milk</item> <item>Breast milk (banked)</item> <item>Formula</item> </string-array> <string-array name="agefeeding"> <item>Choose one</item> <item>Immediately after birth</item> <item>2-4 hours after birth</item> <item>6 hours after birth</item> <item>Greater than 6 hours after birth</item> </string-array> <string-array name="timeOffeeding"> <item>Choose one</item> <item>Within 1 hour after delivery</item> <item>Within first 6 hours after delivery</item> <item>6-12 hours after delivery</item> <item>After the first day</item> </string-array> <string-array name="frequencybreast"> <item>Choose one</item> <item>Every 2-3 hours</item> <item>Every 4-5 hours</item> <item>Greater than 5 hours</item> </string-array> <string-array name="firstcareprovider"> <item>Choose one</item> <item>Within 48-72 hours</item> <item>By the first week of discharge</item> <item>After the first week of discharge</item> </string-array> <string-array name="needforprovider"> <item>Choose one</item> <item>Yes</item> <item>No</item> </string-array> <string-array name="timeOfExtraCare"> <item>Choose one</item> <item>1-2 times</item> <item>3-4 items</item> <item>5-6 times</item> </string-array> <string-array name="questionnaire"> <item>Choose one</item> <item>System Feedback</item> <item>Breastfeeding Followup</item> <item>Self Efficacy Survey</item> <item>Breastfeeding Evaluation</item> <item>Postnatal Depression</item> </string-array> <string-array name="notificationsquery"> <item>All</item> <item>Latching</item> <item>Jaundice</item> <item>Engorgement</item> <item>Sore Nipple</item> <item>Insufficient Breastfeeding Entries</item> <item>Nipple Shield</item> <item>Sufficient Breastfeeding Entries</item> <item>Sufficient Output Entries</item> <item>Sufficient Notification Reading</item> </string-array> <string name="action_prompt">Action</string> <string name="close">Close</string> <string name="open">Open</string> <string name="name">Name</string> <string name="action_settings">Settings</string> <string name="action_search">Search</string> <string name="action_delete">Delete</string> <!-- TODO: Remove or change this placeholder text --> <string name="hello_blank_fragment">Hello blank fragment</string> <string name="drawer_open">Drawer Open</string> <string name="drawer_close">Drawer Close</string> <string name="welcome_to_the_lactation_consultant_portal">Welcome to the Lactation Consultant Portal</string> <string name="created_at_purdue_university">Created at Purdue University.</string> <string name="app_design_by_icon8">App Design by <a href="https://icons8.com/">Icon8</a></string> <string name="age">Age:</string> <string name="ethnicity">Ethnicity:</string> <string name="race">Race:</string> <string name="education_level">Education Level:</string> <string name="residence">Residence:</string> <string name="occupation">Occupation:</string> <string name="household_income">Household Income:</string> <string name="this_baby_is_your">This Baby Is Your:</string> <string name="method_of_delivery">Method of Delivery:</string> <string name="past_breastfeeding_experience">Past Breastfeeding Experience:</string> <string name="longtext">LACTOR is an innovative, interactive web-based breastfeeding monitoring system. LACTOR was created to help breastfeeding mothers monitor their breastfeeding patterns and detect early breastfeeding problems. The lactation consultant can also monitor mothers data and intervene immediately in case of a breastfeeding problem. Mothers also receive notifications if they have any breastfeeding problem with suggestions to help solve the problem</string> <string name="mother">Mother</string> <string name="questionnaire">Questionnaire</string> <string name="name_tag">Name:</string> <string name="address_tag">Address:</string> <string name="age_tag">Age:</string> <string name="ethnicity_tag">Ethnicity:</string> <string name="race_tag">Race:</string> <string name="education_tag">Education:</string> <string name="income_tag">House Income:</string> <string name="occupation_tag">Occupation:</string> <string name="residence_tag">Residence:</string> <string name="mhdp">Maternal History During Pregnancy:</string> <string name="delivery_tag">Method of delivery:</string> <string name="pbe_tag">Past Breastfeeding Experience:</string> <string name="phone_tag">Phone:</string> </resources>
{ "content_hash": "9bae4f8511c6e67f7b940fc16f4317cd", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 477, "avg_line_length": 35.54071661237785, "alnum_prop": 0.6241407753643112, "repo_name": "ambi-disc/lactation-android", "id": "36c8d8f27e166011bbae9a7734e4a8843f1dedb3", "size": "10911", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/values/strings.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "154116" } ], "symlink_target": "" }
using NLog.Internal; namespace NLog { #if NET4_0 || NET4_5 using Config; using System; using System.Collections.Generic; using System.Runtime.Remoting.Messaging; /// <summary> /// Async version of Mapped Diagnostics Context - a logical context structure that keeps a dictionary /// of strings and provides methods to output them in layouts. Allows for maintaining state across /// asynchronous tasks and call contexts. /// </summary> /// <remarks> /// Ideally, these changes should be incorporated as a new version of the MappedDiagnosticsContext class in the original /// NLog library so that state can be maintained for multiple threads in asynchronous situations. /// </remarks> public static class MappedDiagnosticsLogicalContext { private const string LogicalThreadDictionaryKey = "NLog.AsyncableMappedDiagnosticsContext"; /// <summary> /// Simulate ImmutableDictionary behavior (which is not yet part of all .NET frameworks). /// In future the real ImmutableDictionary could be used here to minimize memory usage and copying time. /// </summary> /// <param name="clone">Must be true for any subsequent dictionary modification operation</param> /// <returns></returns> private static IDictionary<string, object> GetLogicalThreadDictionary(bool clone = false) { var dictionary = CallContext.LogicalGetData(LogicalThreadDictionaryKey) as Dictionary<string, object>; if (dictionary == null) { dictionary = new Dictionary<string, object>(); CallContext.LogicalSetData(LogicalThreadDictionaryKey, dictionary); } else if (clone) { dictionary = new Dictionary<string, object>(dictionary); CallContext.LogicalSetData(LogicalThreadDictionaryKey, dictionary); } return dictionary; } /// <summary> /// Gets the current logical context named item, as <see cref="string"/>. /// </summary> /// <param name="item">Item name.</param> /// <returns>The value of <paramref name="item"/>, if defined; otherwise <see cref="String.Empty"/>.</returns> /// <remarks>If the value isn't a <see cref="string"/> already, this call locks the <see cref="LogFactory"/> for reading the <see cref="LoggingConfiguration.DefaultCultureInfo"/> needed for converting to <see cref="string"/>. </remarks> public static string Get(string item) { return Get(item, null); } /// <summary> /// Gets the current logical context named item, as <see cref="string"/>. /// </summary> /// <param name="item">Item name.</param> /// <param name="formatProvider">The <see cref="IFormatProvider"/> to use when converting a value to a string.</param> /// <returns>The value of <paramref name="item"/>, if defined; otherwise <see cref="String.Empty"/>.</returns> /// <remarks>If <paramref name="formatProvider"/> is <c>null</c> and the value isn't a <see cref="string"/> already, this call locks the <see cref="LogFactory"/> for reading the <see cref="LoggingConfiguration.DefaultCultureInfo"/> needed for converting to <see cref="string"/>. </remarks> public static string Get(string item, IFormatProvider formatProvider) { return FormatHelper.ConvertToString(GetObject(item), formatProvider); } /// <summary> /// Gets the current logical context named item, as <see cref="object"/>. /// </summary> /// <param name="item">Item name.</param> /// <returns>The value of <paramref name="item"/>, if defined; otherwise <c>null</c>.</returns> public static object GetObject(string item) { object value; GetLogicalThreadDictionary().TryGetValue(item, out value); return value; } /// <summary> /// Sets the current logical context item to the specified value. /// </summary> /// <param name="item">Item name.</param> /// <param name="value">Item value.</param> public static void Set(string item, string value) { GetLogicalThreadDictionary(true)[item] = value; } /// <summary> /// Sets the current logical context item to the specified value. /// </summary> /// <param name="item">Item name.</param> /// <param name="value">Item value.</param> public static void Set(string item, object value) { GetLogicalThreadDictionary(true)[item] = value; } /// <summary> /// Returns all item names /// </summary> /// <returns>A collection of the names of all items in current logical context.</returns> public static ICollection<string> GetNames() { return GetLogicalThreadDictionary().Keys; } /// <summary> /// Checks whether the specified <paramref name="item"/> exists in current logical context. /// </summary> /// <param name="item">Item name.</param> /// <returns>A boolean indicating whether the specified <paramref name="item"/> exists in current logical context.</returns> public static bool Contains(string item) { return GetLogicalThreadDictionary().ContainsKey(item); } /// <summary> /// Removes the specified <paramref name="item"/> from current logical context. /// </summary> /// <param name="item">Item name.</param> public static void Remove(string item) { GetLogicalThreadDictionary(true).Remove(item); } /// <summary> /// Clears the content of current logical context. /// </summary> public static void Clear() { Clear(false); } /// <summary> /// Clears the content of current logical context. /// </summary> /// <param name="free">Free the full slot.</param> public static void Clear(bool free) { if (free) { CallContext.FreeNamedDataSlot(LogicalThreadDictionaryKey); } else { GetLogicalThreadDictionary(true).Clear(); } } } #endif }
{ "content_hash": "1e82392a13beef3cbd7c4e0fca6b5eb8", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 297, "avg_line_length": 41.96103896103896, "alnum_prop": 0.6027545651501083, "repo_name": "tetrodoxin/NLog", "id": "4a8ae572057dbbbcd1abd4cd391fccb191cd0849", "size": "8128", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/NLog/MappedDiagnosticsLogicalContext.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "2613" }, { "name": "Batchfile", "bytes": "521" }, { "name": "C#", "bytes": "4215295" }, { "name": "Makefile", "bytes": "3639" }, { "name": "Perl", "bytes": "1590" }, { "name": "PowerShell", "bytes": "1596" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>statsmodels.sandbox.distributions.transformed.TransfTwo_gen.logsf &mdash; statsmodels 0.6.1 documentation</title> <link rel="stylesheet" href="../_static/nature.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '0.6.1', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <link rel="shortcut icon" href="../_static/statsmodels_hybi_favico.ico"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="top" title="statsmodels 0.6.1 documentation" href="../index.html" /> <link rel="stylesheet" href="../../_static/facebox.css" type="text/css" /> <link rel="stylesheet" href="../_static/examples.css" type="text/css" /> <script type="text/javascript" src="../_static/scripts.js"> </script> <script type="text/javascript" src="../_static/facebox.js"> </script> </head> <body role="document"> <div class="headerwrap"> <div class = "header"> <a href = "../index.html"> <img src="../_static/statsmodels_hybi_banner.png" alt="Logo" style="padding-left: 15px"/></a> </div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li><a href ="../install.html">Install</a></li> &nbsp;|&nbsp; <li><a href="https://groups.google.com/group/pystatsmodels?hl=en">Support</a></li> &nbsp;|&nbsp; <li><a href="https://github.com/statsmodels/statsmodels/issues">Bugs</a></li> &nbsp;|&nbsp; <li><a href="../dev/index.html">Develop</a></li> &nbsp;|&nbsp; <li><a href="../examples/index.html">Examples</a></li> &nbsp;|&nbsp; <li><a href="../faq.html">FAQ</a></li> &nbsp;|&nbsp; </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="statsmodels-sandbox-distributions-transformed-transftwo-gen-logsf"> <h1>statsmodels.sandbox.distributions.transformed.TransfTwo_gen.logsf<a class="headerlink" href="#statsmodels-sandbox-distributions-transformed-transftwo-gen-logsf" title="Permalink to this headline">¶</a></h1> <dl class="method"> <dt id="statsmodels.sandbox.distributions.transformed.TransfTwo_gen.logsf"> <code class="descclassname">TransfTwo_gen.</code><code class="descname">logsf</code><span class="sig-paren">(</span><em>x</em>, <em>*args</em>, <em>**kwds</em><span class="sig-paren">)</span><a class="headerlink" href="#statsmodels.sandbox.distributions.transformed.TransfTwo_gen.logsf" title="Permalink to this definition">¶</a></dt> <dd><p>Log of the survival function of the given RV.</p> <p>Returns the log of the &#8220;survival function,&#8221; defined as (1 - <cite>cdf</cite>), evaluated at <cite>x</cite>.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>x</strong> : array_like</p> <blockquote> <div><p>quantiles</p> </div></blockquote> <p><strong>arg1, arg2, arg3,...</strong> : array_like</p> <blockquote> <div><p>The shape parameter(s) for the distribution (see docstring of the instance object for more information)</p> </div></blockquote> <p><strong>loc</strong> : array_like, optional</p> <blockquote> <div><p>location parameter (default=0)</p> </div></blockquote> <p><strong>scale</strong> : array_like, optional</p> <blockquote> <div><p>scale parameter (default=1)</p> </div></blockquote> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>logsf</strong> : ndarray</p> <blockquote class="last"> <div><p>Log of the survival function evaluated at <cite>x</cite>.</p> </div></blockquote> </td> </tr> </tbody> </table> </dd></dl> </div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/generated/statsmodels.sandbox.distributions.transformed.TransfTwo_gen.logsf.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="footer" role="contentinfo"> &copy; Copyright 2009-2013, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1. </div> </body> </html>
{ "content_hash": "e4242fe85b804819b779e55ba651c985", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 334, "avg_line_length": 39.22077922077922, "alnum_prop": 0.640728476821192, "repo_name": "statsmodels/statsmodels.github.io", "id": "d1f4e14a9ed7cacd2437f2fc8c5699de6683fc72", "size": "6043", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "0.6.1/generated/statsmodels.sandbox.distributions.transformed.TransfTwo_gen.logsf.html", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>pi-calc: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.13.1 / pi-calc - 8.9.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> pi-calc <small> 8.9.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-09-15 02:05:39 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-09-15 02:05:39 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 4 Virtual package relying on a GMP lib system installation coq 8.13.1 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.11.2 The OCaml compiler (virtual package) ocaml-base-compiler 4.11.2 Official release 4.11.2 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.5 A library manager for OCaml zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;http://www.dimi.uniud.it/~scagnett/pi-calculus.html&quot; license: &quot;Unknown&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/PiCalc&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.9&quot; &amp; &lt; &quot;8.10~&quot;} ] tags: [ &quot;keyword: process algebras&quot; &quot;keyword: pi-calculus&quot; &quot;keyword: concurrency&quot; &quot;keyword: higher-order syntax&quot; &quot;category: Computer Science/Concurrent Systems and Protocols/Theory of concurrent systems&quot; &quot;date: 1998-07&quot; ] authors: [ &quot;Ivan Scagnetto &lt;scagnett@dimi.uniud.it&gt;&quot; ] bug-reports: &quot;https://github.com/coq-contribs/pi-calc/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/pi-calc.git&quot; synopsis: &quot;Pi-calculus in Coq&quot; description: &quot;&quot;&quot; This is a HOAS-based encoding of the pi-calculus (as originally conceived by Milner, Parrow and Walker in &quot;A Calculus of Mobile Processes&quot; Parts I-II, Information and Computation n. 100) together with the formal verification of a large part of the metatheory of Strong Late Bisimilarity.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/pi-calc/archive/v8.9.0.tar.gz&quot; checksum: &quot;md5=d0882753de8b62ef0fe18fb05acc9f66&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-pi-calc.8.9.0 coq.8.13.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.13.1). The following dependencies couldn&#39;t be met: - coq-pi-calc -&gt; coq &lt; 8.10~ -&gt; ocaml &lt; 4.10 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-pi-calc.8.9.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "cba01beedeaf2728a51cdf5c8fc3ac22", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 159, "avg_line_length": 41.10795454545455, "alnum_prop": 0.5503800967519005, "repo_name": "coq-bench/coq-bench.github.io", "id": "6736cfa622df7430e407f139da1e2348484a652d", "size": "7260", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.11.2-2.0.7/released/8.13.1/pi-calc/8.9.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <div id="message"></div> <div><a href="index.html">Go Back To Home Page</a></div> <script src="jquery-2.1.0.min.js"></script> <script src="oidc-token-manager.js"></script> <script> var config = { client_id: "js.tokenmanager", authority: "https://localhost:44333/core", //load_user_profile : false, //filter_protocol_claims: false, }; var mgr = new OidcTokenManager(config); mgr.processTokenCallbackAsync().then(function () { console.log("Successfully Obtained Token", mgr.access_token); $("#message").text("Successfully Obtained Token", mgr.access_token); window.location.replace("/index.html"); }, function (error) { $("#message").text("Problem Getting Token : " + (error.message || error)); }); </script> </body> </html>
{ "content_hash": "1eae99b0cb3bacbd0a0a0ffc35f165ae", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 86, "avg_line_length": 33.2, "alnum_prop": 0.5672690763052208, "repo_name": "IdentityModel/oidc-token-manager", "id": "a2cd8946e55dbeb2494a0dbb07a3d197d76e3cff", "size": "998", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sample/vs/Sample/callback.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "1348" }, { "name": "HTML", "bytes": "4783" }, { "name": "JavaScript", "bytes": "581784" } ], "symlink_target": "" }
package org.kuali.rice.rest.api.kim; import org.kuali.rice.kim.api.group.Group; import org.kuali.rice.kim.api.group.GroupMember; import org.springframework.hateoas.Link; import org.springframework.hateoas.mvc.ControllerLinkBuilder; import org.springframework.hateoas.mvc.ResourceAssemblerSupport; /** * Assembler for building GroupResource from Group * * @author Kuali Rice Team (rice.collab@kuali.org) */ public class GroupMemberResourceAssembler extends ResourceAssemblerSupport<GroupMember, GroupMemberResource> { public GroupMemberResourceAssembler() { super(KimGroupRestController.class, GroupMemberResource.class); } /** * Creates the HAL links for the Group resource and creates the resource. * * @param groupMember the original group * @return the created resource with links */ public GroupMemberResource toResource(GroupMember groupMember) { // adds a link with rel self pointing to itself GroupMemberResource resource = createResourceWithId(groupMember.getMemberId(), groupMember); Link link = ControllerLinkBuilder.linkTo(KimGroupRestController.class).slash(groupMember.getGroupId()).slash("members").slash(groupMember.getMemberId()).withSelfRel(); resource.removeLinks(); resource.add(link); return resource; } @Override protected GroupMemberResource instantiateResource(GroupMember groupMember) { return GroupMemberResource.fromGroupMember(groupMember); } }
{ "content_hash": "e81e8503cbd65e576cb0cf169f38e9e4", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 175, "avg_line_length": 38.51282051282051, "alnum_prop": 0.7523302263648469, "repo_name": "kuali/rice-rest", "id": "4536f471f7e171083b4416a30c3269e94f7e00e2", "size": "1502", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "rest-services/src/main/java/org/kuali/rice/rest/api/kim/GroupMemberResourceAssembler.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "43136" }, { "name": "HTML", "bytes": "3730" }, { "name": "Java", "bytes": "146942" }, { "name": "JavaScript", "bytes": "314364" } ], "symlink_target": "" }
using System; using System.IO; using System.Runtime.Serialization.Formatters; using System.Text; using System.Xml; using System.Xml.Serialization; using Mictlanix.CFDv32; namespace Mictlanix.Diverza.Client.Internals { [Serializable] [XmlType(Namespace="http://schemas.xmlsoap.org/soap/envelope/")] [XmlRoot("Envelope", Namespace="http://schemas.xmlsoap.org/soap/envelope/", IsNullable=false)] public partial class SoapEnvelope { private object[] bodyField; [XmlArray("Body")] [XmlArrayItem(typeof(RequestTimbradoCFD), Namespace="http://www.buzonfiscal.com/ns/xsd/bf/TimbradoCFD")] [XmlArrayItem(typeof(TimbreFiscalDigital), Namespace="http://www.sat.gob.mx/TimbreFiscalDigital")] [XmlArrayItem(typeof(SoapFault), Namespace="http://schemas.xmlsoap.org/soap/envelope/")] public object[] Body { get { return this.bodyField; } set { this.bodyField = value; } } XmlSerializerNamespaces xmlns; [XmlNamespaceDeclarations] public XmlSerializerNamespaces Xmlns { get { if (xmlns == null) { xmlns = new XmlSerializerNamespaces (new XmlQualifiedName[] { new XmlQualifiedName("s", "http://schemas.xmlsoap.org/soap/envelope/"), new XmlQualifiedName("r", "http://www.buzonfiscal.com/ns/xsd/bf/RequestTimbraCFDI"), new XmlQualifiedName("t", "http://www.buzonfiscal.com/ns/xsd/bf/TimbradoCFD") }); } return xmlns; } set { xmlns = value; } } public MemoryStream ToXmlStream () { return CFDLib.Utils.SerializeToXmlStream (this, Xmlns); } public byte[] ToXmlBytes () { using (var ms = ToXmlStream()) { return ms.ToArray (); } } public string ToXmlString () { using (var ms = ToXmlStream()) { return Encoding.UTF8.GetString (ms.ToArray ()); } } public static SoapEnvelope FromXml (string xml) { using (var ms = new MemoryStream (Encoding.UTF8.GetBytes(xml))) { return FromXml (ms); } } public static SoapEnvelope FromXml (Stream xml) { var xs = new XmlSerializer (typeof(SoapEnvelope)); object obj = xs.Deserialize (xml); return obj as SoapEnvelope; } } }
{ "content_hash": "c9566aa699142a7123d57d6ffceceed4", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 106, "avg_line_length": 25.542168674698797, "alnum_prop": 0.689622641509434, "repo_name": "mictlanix/diverza-client", "id": "f488413273fc3587426c271e5b0ade2d558dcdfc", "size": "3344", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Mictlanix.DiverzaClient/Internals/SoapEnvelope.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "42519" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.9"/> <title>Simple HTML: Файлы</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Simple HTML &#160;<span id="projectnumber">1.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Создано системой Doxygen 1.8.9 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Поиск'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Титульная&#160;страница</span></a></li> <li><a href="annotated.html"><span>Классы</span></a></li> <li class="current"><a href="files.html"><span>Файлы</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Поиск" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li class="current"><a href="files.html"><span>Файлы</span></a></li> </ul> </div> </div><!-- top --> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="headertitle"> <div class="title">Файлы</div> </div> </div><!--header--> <div class="contents"> <div class="textblock">Полный список документированных файлов.</div><div class="directory"> <table class="directory"> <tr id="row_0_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a href="codeeditor_8h_source.html"><span class="icondoc"></span></a><b>codeeditor.h</b></td><td class="desc"></td></tr> <tr id="row_1_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a href="html__template_8h_source.html"><span class="icondoc"></span></a><b>html_template.h</b></td><td class="desc"></td></tr> <tr id="row_2_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a href="htmlhighlighter_8h_source.html"><span class="icondoc"></span></a><b>htmlhighlighter.h</b></td><td class="desc"></td></tr> <tr id="row_3_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a href="htmlproject_8h_source.html"><span class="icondoc"></span></a><b>htmlproject.h</b></td><td class="desc"></td></tr> <tr id="row_4_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a href="htmlprojectwidget_8h_source.html"><span class="icondoc"></span></a><b>htmlprojectwidget.h</b></td><td class="desc"></td></tr> <tr id="row_5_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a href="newprojectdialog_8h_source.html"><span class="icondoc"></span></a><b>newprojectdialog.h</b></td><td class="desc"></td></tr> <tr id="row_6_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a href="simplehtml_8h_source.html"><span class="icondoc"></span></a><b>simplehtml.h</b></td><td class="desc"></td></tr> </table> </div><!-- directory --> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Документация по Simple HTML. Последние изменения: Пн 29 Дек 2014 04:19:37. Создано системой &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.9 </small></address> </body> </html>
{ "content_hash": "5402db49648fd66b7088fcf90c77f058", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 241, "avg_line_length": 51.056603773584904, "alnum_prop": 0.6518847006651884, "repo_name": "semyon2105/simpleHTML", "id": "71c26a2d71a93907bc4f2f208b94d9b5ca0974a4", "size": "5567", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/html/files.html", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C++", "bytes": "30889" }, { "name": "CSS", "bytes": "31117" }, { "name": "JavaScript", "bytes": "36771" } ], "symlink_target": "" }
require('should'); var utils = require(process.cwd()+'/test/utils/test-commons'); var Subject = require('../../index.js'); var db = Subject(utils.testDirectory, utils.options); describe('PUT', function() { before(function(){ return db.open(); }); after(function(done){ utils.clear(done); }); describe('save one value', function() { it('should save one value without error', function(){ return db.put("123", "hello"); }); it('should save two values without error', function(){ return db.put("123", "name") .then(function(){ return db.put('1234', 'value'); }); }); }); });
{ "content_hash": "924c1f9df137922e50b04c5a31464110", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 62, "avg_line_length": 24.2, "alnum_prop": 0.5206611570247934, "repo_name": "gutobortolozzo/node-lsm", "id": "32a819dcfafd7bc9062a81dda560c4fb723886a4", "size": "726", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/interface-operations/put.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "34383" } ], "symlink_target": "" }
A Sketch Plugin to align Text Layers by their baselines. ## Installation [Download](https://github.com/abynim/BaseAlign/archive/master.zip) and extract the contents of this repository. Then double-click the BaseAlign.sketchplugin bundle to install the plugin. This will only work if you are using Sketch 3.3 or later. ## Usage 1. Select two or more Text Layers and run the plugin. 2. In the configuration window, select the edge you want to anchor the layers to, and hit __Apply__. ![Configuration Window](config_dialog.png) ## Shortcut Once you've installed the plugin and run it at least once, you can trigger it again using `Command` + `Shift` + `b`. --- Send your love and feedback via [Twitter](http://twitter.com/abynim). MIT License © Aby Nimbalkar.
{ "content_hash": "3bd1b89a6bba1c7e4a7a3e8ec1aee72a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 244, "avg_line_length": 42.888888888888886, "alnum_prop": 0.7474093264248705, "repo_name": "abynim/BaseAlign", "id": "66282100881c639862876f1b250b7fdcf7cdbaf1", "size": "785", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package mineserver.command; import java.util.Arrays; import java.util.List; import mineserver.Client; import mineserver.PlayerClient; import mineserver.Server; public class WhoCommand extends AbstractCommand { public WhoCommand(Server server) { super(server); } @Override public String getName() { return "Who"; } public String getHelp() { return "Find out player information."; } public String getUsage() { return "who [playername]"; } public List<String> getAliases() { return Arrays.asList(new String[] {"who"}); } @Override public void execute(Client client, String line) { String[] args = line.split("\\s+"); if (args.length >= 2) { PlayerClient target = server.getTarget(client, args[1]); if (target != null) { client.info("Group: "); client.info("Time online: "); client.info("IP: " + target.getIPAddress()); return; } return; } client.usage(getUsage()); } }
{ "content_hash": "f41454480567e74017010354fcde4e7e", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 68, "avg_line_length": 23.395833333333332, "alnum_prop": 0.5592163846838825, "repo_name": "allenliu/MineServer", "id": "12c6acf13210c2d243abc15c2f839c6bbf6e26b0", "size": "1123", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/mineserver/command/WhoCommand.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "150978" }, { "name": "Shell", "bytes": "132" } ], "symlink_target": "" }
<?php namespace backend\models; use Yii; use yii\base\Model; use yii\data\ActiveDataProvider; use backend\models\RegionKharkivAdmin; /** * RegionKharkivAdminSearch represents the model behind the search form about `backend\models\RegionKharkivAdmin`. */ class RegionKharkivAdminSearch extends RegionKharkivAdmin { /** * @inheritdoc */ public function rules() { return [ [['region_kharkiv_admin_id'], 'integer'], [['name'], 'safe'], ]; } /** * @inheritdoc */ public function scenarios() { // bypass scenarios() implementation in the parent class return Model::scenarios(); } /** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = RegionKharkivAdmin::find(); // add conditions that should always apply here $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } // grid filtering conditions $query->andFilterWhere([ 'region_kharkiv_admin_id' => $this->region_kharkiv_admin_id, ]); $query->andFilterWhere(['like', 'name', $this->name]); return $dataProvider; } }
{ "content_hash": "0b759e5404ee143cc6dd50d53ef21935", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 114, "avg_line_length": 23.115942028985508, "alnum_prop": 0.5786833855799373, "repo_name": "sksergey/metragYiiBackend", "id": "391a0703b02b47e0d6e0e7600503568c206beb6e", "size": "1595", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "backend/models/RegionKharkivAdminSearch.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "1393" }, { "name": "Batchfile", "bytes": "1546" }, { "name": "CSS", "bytes": "437137" }, { "name": "HTML", "bytes": "4784" }, { "name": "JavaScript", "bytes": "11320" }, { "name": "PHP", "bytes": "1690085" }, { "name": "Shell", "bytes": "3256" } ], "symlink_target": "" }
<Configuration> <Appenders> <File name="FILE" fileName="ode.log" append="false"> <PatternLayout pattern="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/> </File> <Console name="STDOUT" target="SYSTEM_OUT"> <PatternLayout pattern="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/> </Console> <Async name="Async"> <!--<AppenderRef ref="FILE"/> --> <AppenderRef ref="STDOUT"/> </Async> </Appenders> <Loggers> <Logger name="org.apache.ode" level="info" additivity="false"> <AppenderRef ref="FILE"/> </Logger> <Logger name="org.apache.axis2" level="info" additivity="false"> <AppenderRef ref="FILE"/> </Logger> <Logger name="org.hibernate" level="info" additivity="false"> <AppenderRef ref="FILE"/> </Logger> <Logger name="org.apache.openjpa" level="info" additivity="false"> <AppenderRef ref="FILE"/> </Logger> <Logger name="org.springframework" level="error" additivity="false"> <AppenderRef ref="FILE"/> </Logger> <Root level="error"> <AppenderRef ref="Async"/> </Root> </Loggers> </Configuration>
{ "content_hash": "928b0bac67f9247570fe6c1ccc260493", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 76, "avg_line_length": 33.729729729729726, "alnum_prop": 0.5328525641025641, "repo_name": "apache/ode", "id": "0ebc603d25f610854a6c3a339e9dd2b03f8ddce5", "size": "1248", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "dao-jpa-ojpa-derby/src/test/resources/log4j2.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "6359" }, { "name": "CSS", "bytes": "35867" }, { "name": "Groovy", "bytes": "4205" }, { "name": "HTML", "bytes": "41741" }, { "name": "Java", "bytes": "5649254" }, { "name": "JavaScript", "bytes": "248611" }, { "name": "Ruby", "bytes": "107187" }, { "name": "Shell", "bytes": "11659" }, { "name": "TSQL", "bytes": "10000" }, { "name": "XSLT", "bytes": "6703" } ], "symlink_target": "" }
# Server with live-reloading and CSS injection With [BrowserSync](http://browsersync.io) and gulp, you can easily create a development server that is accessible to any device on the same WiFi network. BrowserSync also has live-reload built in, so there's nothing else to configure. First install the module: ```sh $ npm install --save-dev browser-sync ``` Then, considering the following file structure... ``` gulpfile.js app/ styles/ main.css scripts/ main.js index.html ``` ... you can easily serve files from the `app` directory and have all browsers reload when any of them change with the following: ```js var browserSync = require('browser-sync'); var reload = browserSync.reload; // watch files for changes and reload gulp.task('serve', function() { browserSync({ server: { baseDir: 'app' } }); gulp.watch(['*.html', 'styles/**/*.css', 'scripts/**/*.js'], {cwd: 'app'}, reload); }); ``` ## + CSS pre-processors A common use-case is to reload CSS files after they've been pre-processed. Using Sass as an example, this is how you can instruct browsers to reload the CSS without doing a full-page refresh. ```js var sass = require('gulp-ruby-sass'); var browserSync = require('browser-sync'); var reload = browserSync.reload; gulp.task('sass', function() { return sass('scss/styles.scss') .pipe(gulp.dest('css')) .pipe(reload({ stream:true })); }); // watch files for changes and reload gulp.task('serve', function() { browserSync({ server: { baseDir: 'app' } }); gulp.watch('scss/*.scss', ['sass']); }); ``` ## Extras - Live reload, CSS injection and scroll/form syncing works seamlessly inside of [BrowserStack](http://www.browserstack.com/) virtual machines. - Set `tunnel: true` to view your local site at a public URL (complete with all BrowserSync features).
{ "content_hash": "e79adfd647661ebb5bd70b8a75737c54", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 234, "avg_line_length": 25.04054054054054, "alnum_prop": 0.6869940636805181, "repo_name": "SimenB/gulp", "id": "ca805bdae18df61013a3c702d7a34b66ec1cb693", "size": "1853", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "docs/recipes/server-with-livereload-and-css-injection.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "26962" }, { "name": "Shell", "bytes": "1327" } ], "symlink_target": "" }
'use strict'; var path = require('path'), escape = require('escape-regexp'); module.exports = function(grunt) { // Please see the Grunt documentation for more information regarding task // creation: http://gruntjs.com/creating-tasks grunt.registerMultiTask('marking_merge', 'Grunt task to merge files by marking', function() { var options = this.options({ startSymbol : '/*<', endSymbol : '>*/', banner : '', footer : '' }); options.startSymbol = escape(options.startSymbol); options.endSymbol = escape(options.endSymbol); this.files.forEach(function (fileObj) { var src = fileObj.src.filter(function (src) { if (!grunt.file.exists(src)) { grunt.log.warn('Source file "' + src + '" not found.'); return false; } return true; }).map(function (src) { return [src, grunt.file.read(src)]; }).forEach(function (src) { var regAll = new RegExp(options.startSymbol + '(.*)' + options.endSymbol, 'g'), reg = new RegExp(options.startSymbol + '(.*)' + options.endSymbol), fileContent = src[1], match = fileContent.match(regAll), filePath = path.dirname(src[0]); if (match) { match.map(function (marking) { var m = marking.match(reg); return [m[1], path.resolve(filePath, m[1].trim())]; }).filter(function (file) { if (!grunt.file.exists(file[1])) { grunt.log.warn('File "' + file[1] + '" not found.'); return false; } return true; }).forEach(function (file) { fileContent = fileContent.replace( new RegExp(options.startSymbol + file[0] + options.endSymbol, 'g'), grunt.file.read(file[1]) ); }); } grunt.file.write(fileObj.dest, options.banner + fileContent + options.footer); }); }); // Merge task-specific and/or target-specific options with these defaults. /*var options = this.options({ punctuation: '.', separator: ', ' });*/ /*this.files.forEach(function (f) { console.log(f); });*/ /*// Iterate over all specified file groups. this.files.forEach(function(f) { // Concat specified files. var src = f.src.filter(function(filepath) { // Warn on and remove invalid source files (if nonull was set). if (!grunt.file.exists(filepath)) { grunt.log.warn('Source file "' + filepath + '" not found.'); return false; } else { return true; } }).map(function(filepath) { // Read file source. return grunt.file.read(filepath); }).join(grunt.util.normalizelf(options.separator)); // Handle options. src += options.punctuation; // Write the destination file. grunt.file.write(f.dest, src); // Print a success message. grunt.log.writeln('File "' + f.dest + '" created.'); });*/ }); };
{ "content_hash": "b4791516b8dbb9b1d6e2fe8567f56448", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 95, "avg_line_length": 35.2, "alnum_prop": 0.5080741626794258, "repo_name": "stuarqi/grunt-marking-merge", "id": "96a10cbd000eb7983c7db155d1dce88e3a3ebbbf", "size": "3491", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tasks/marking_merge.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "6580" } ], "symlink_target": "" }
import Phaser from 'phaser'; import WebFont from 'webfontloader'; import { BG_COLOR } from '../config'; class Boot extends Phaser.State { init () { this.stage.backgroundColor = BG_COLOR; this.fontsReady = false; } preload () { this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.windowConstraints.bottom = 'visual'; // TODO: Read what is it WebFont.load({ google: { families: ['Bangers'] }, active: () => { this.fontsReady = true; } }); const styles = { font: '16px Arial', fill: '#dddddd', align: 'center' }; const text = this.add.text(this.world.centerX, this.world.centerY, 'Loading fonts...', styles); text.anchor.setTo(0.5, 0.5); this.game.load.image('loadingBarBg', 'assets/images/loading-bar-bg.png'); this.game.load.image('loadingBar', 'assets/images/loading-bar.png'); } render () { if (this.fontsReady) { this.state.start('Preload'); } } } export default Boot;
{ "content_hash": "d98e9f5425e4d1bf7dbbc7102205a713", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 99, "avg_line_length": 25.641025641025642, "alnum_prop": 0.618, "repo_name": "p0lax/phaser", "id": "1412d4f314840ef107fffe0b191dae4131f605c5", "size": "1000", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/states/Boot.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "707" }, { "name": "JavaScript", "bytes": "15955" } ], "symlink_target": "" }
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'UserKey.last_used' db.add_column('sshkey_userkey', 'last_used', self.gf('django.db.models.fields.DateTimeField')(null=True), keep_default=False) def backwards(self, orm): # Deleting field 'UserKey.last_used' db.delete_column('sshkey_userkey', 'last_used') models = { 'auth.group': { 'Meta': {'object_name': 'Group'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) }, 'auth.permission': { 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) }, 'auth.user': { 'Meta': {'object_name': 'User'}, 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) }, 'contenttypes.contenttype': { 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) }, 'django_sshkey.userkey': { 'Meta': {'unique_together': "[('user', 'name')]", 'object_name': 'UserKey', 'db_table': "'sshkey_userkey'"}, 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), 'fingerprint': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '47', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'key': ('django.db.models.fields.TextField', [], {'max_length': '2000'}), 'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}), 'last_used': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) } } complete_apps = ['django_sshkey']
{ "content_hash": "67e77cd43d4c79813dc294296cf5326e", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 182, "avg_line_length": 66.7, "alnum_prop": 0.5564360676804455, "repo_name": "ClemsonSoCUnix/django-sshkey", "id": "68903ce03b8cba91b56da051af5b845b82528643", "size": "4687", "binary": false, "copies": "2", "ref": "refs/heads/develop", "path": "django_sshkey/south_migrations/0002_auto__add_field_userkey_last_used.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "HTML", "bytes": "1936" }, { "name": "Python", "bytes": "85419" }, { "name": "Shell", "bytes": "8229" } ], "symlink_target": "" }
from __future__ import absolute_import import unittest from unittest import skipIf import numpy as np try: import pandas as pd is_pandas = True except ImportError as e: is_pandas = False class TestBokehJSONEncoder(unittest.TestCase): def setUp(self): from bokeh._json_encoder import BokehJSONEncoder self.encoder = BokehJSONEncoder() def test_fail(self): self.assertRaises(TypeError, self.encoder.default, {'testing': 1}) @skipIf(not is_pandas, "pandas does not work in PyPy.") def test_panda_series(self): s = pd.Series([1, 3, 5, 6, 8]) self.assertEqual(self.encoder.default(s), [1, 3, 5, 6, 8]) def test_numpyarray(self): a = np.arange(5) self.assertEqual(self.encoder.default(a), [0, 1, 2, 3, 4]) def test_numpyint(self): npint = np.asscalar(np.int64(1)) self.assertEqual(self.encoder.default(npint), 1) self.assertIsInstance(self.encoder.default(npint), int) def test_numpyfloat(self): npfloat = np.float64(1.33) self.assertEqual(self.encoder.default(npfloat), 1.33) self.assertIsInstance(self.encoder.default(npfloat), float) def test_numpybool_(self): nptrue = np.bool_(True) self.assertEqual(self.encoder.default(nptrue), True) self.assertIsInstance(self.encoder.default(nptrue), bool) @skipIf(not is_pandas, "pandas does not work in PyPy.") def test_pd_timestamp(self): ts = pd.tslib.Timestamp('April 28, 1948') self.assertEqual(self.encoder.default(ts), -684115200000) class TestSerializeJson(unittest.TestCase): def setUp(self): from bokeh._json_encoder import serialize_json from json import loads self.serialize = serialize_json self.deserialize = loads def test_with_basic(self): self.assertEqual(self.serialize({'test': [1, 2, 3]}), '{"test": [1, 2, 3]}') def test_with_np_array(self): a = np.arange(5) self.assertEqual(self.serialize(a), '[0, 1, 2, 3, 4]') @skipIf(not is_pandas, "pandas does not work in PyPy.") def test_with_pd_series(self): s = pd.Series([0, 1, 2, 3, 4]) self.assertEqual(self.serialize(s), '[0, 1, 2, 3, 4]') def test_nans_and_infs(self): arr = np.array([np.nan, np.inf, -np.inf, 0]) serialized = self.serialize(arr) deserialized = self.deserialize(serialized) assert deserialized[0] == 'NaN' assert deserialized[1] == 'Infinity' assert deserialized[2] == '-Infinity' assert deserialized[3] == 0 @skipIf(not is_pandas, "pandas does not work in PyPy.") def test_nans_and_infs_pandas(self): arr = pd.Series(np.array([np.nan, np.inf, -np.inf, 0])) serialized = self.serialize(arr) deserialized = self.deserialize(serialized) assert deserialized[0] == 'NaN' assert deserialized[1] == 'Infinity' assert deserialized[2] == '-Infinity' assert deserialized[3] == 0 @skipIf(not is_pandas, "pandas does not work in PyPy.") def test_datetime_types(self): """should convert to millis """ idx = pd.date_range('2001-1-1', '2001-1-5') df = pd.DataFrame({'vals' :idx}, index=idx) serialized = self.serialize({'vals' : df.vals, 'idx' : df.index}) deserialized = self.deserialize(serialized) baseline = {u'vals': [978307200000, 978393600000, 978480000000, 978566400000, 978652800000], u'idx': [978307200000, 978393600000, 978480000000, 978566400000, 978652800000] } assert deserialized == baseline if __name__ == "__main__": unittest.main()
{ "content_hash": "a9bad01f8cd391a7b36fd7fa37953016", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 84, "avg_line_length": 34.23275862068966, "alnum_prop": 0.5817174515235457, "repo_name": "gpfreitas/bokeh", "id": "a351bb8baa8ce60d634978fe4c3b2b23076cfe48", "size": "3971", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "bokeh/tests/test_json_encoder.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "5455" }, { "name": "CSS", "bytes": "413470" }, { "name": "CoffeeScript", "bytes": "2117773" }, { "name": "HTML", "bytes": "72852" }, { "name": "JavaScript", "bytes": "7337" }, { "name": "Makefile", "bytes": "5785" }, { "name": "Python", "bytes": "1560447" }, { "name": "Shell", "bytes": "18109" } ], "symlink_target": "" }
package main import ( "fmt" ) // p is a shortcut for a call to fmt.Printf that implicitly starts // and ends its message with a newline. func p(format string, stuff ...interface{}) { fmt.Printf("\n "+format+"\n", stuff...) } // q calls are quietly ignored. They allow conversion from p() // calls to be swapped quickly and easily. func q(quietly_ignored ...interface{}) {} // quiet
{ "content_hash": "025b67677fc483753fd9fd9077b571e7", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 66, "avg_line_length": 25.8, "alnum_prop": 0.6847545219638242, "repo_name": "glycerine/gnatsd", "id": "daf8aa818071c2a8183c98eabeda2441a61940d8", "size": "387", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "swp/test/vprint.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "597848" }, { "name": "Shell", "bytes": "1551" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "dbaf2041b25a15732d9ed7f41d0ba8e7", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "456ec618528cb7edce88fd4a9acd4a0218eddf5f", "size": "192", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Eriocaulaceae/Comanthera/Comanthera centauroides/ Syn. Dupatya centauroides/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
@interface ViewController : UIViewController @end
{ "content_hash": "bade67f6734aa64089974d18268662bb", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 44, "avg_line_length": 10.6, "alnum_prop": 0.7924528301886793, "repo_name": "OnePiece-D/ScrollerAndBtnSelectedView", "id": "c2f1ddde2d7c2b5ab3b21940eb227b5685a38313", "size": "227", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ScrollerAndBtnSelectedViewDemo/ScrollerAndBtnSelectedViewDemo/ViewController.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "28872" } ], "symlink_target": "" }
module I18nActionMailer def self.included(base) base.send :include, I18nActionMailer::InstanceMethods base.send :alias_method_chain, :render_message, :i18n base.helper_method :locale, :l, :localize base.helper do def translate(key, options = {}) I18n.translate(scope_key_by_partial(key), options.merge!(:raise => true, :locale => self.locale)) end alias_method :t, :translate private def scope_key_by_partial(key) if key.to_s.first == "." if @_virtual_path @_virtual_path.gsub(%r{/_?}, ".") + key.to_s else raise "Cannot use t(#{key.inspect}) shortcut because path is not available" end else key end end end end module InstanceMethods def translate(key, options = {}) I18n.translate(scope_key_by_partial(key), options.merge(:raise => true, :locale => self.locale)) end alias_method :t, :translate def localize(key, options = {}) I18n.localize(key, options.merge(:locale => self.locale)) end alias_method :l, :localize def locale @locale end def set_locale(locale) @locale = locale end def render_message_with_i18n(method_name, body) method_name = "#{method_name}_#{locale}" if locale and !Dir["#{template_path}/#{method_name}_#{locale}*"].empty? render_message_without_i18n(method_name, body) end private def scope_key_by_partial(key) if key.to_s.first == "." mailer_scope = self.class.mailer_name.gsub('/', '.') mailer_scope + "." + action_name + key.to_s else key end end end end ActionMailer::Base.send(:include, I18nActionMailer)
{ "content_hash": "52ac519edc24353964743035bef50e9b", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 118, "avg_line_length": 27.584615384615386, "alnum_prop": 0.581148912437256, "repo_name": "mataki/i18n_action_mailer", "id": "2020a052dc2ecbf7e6edb1104dbe9aa8ad56a4dc", "size": "1793", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "lib/i18n_action_mailer.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "5477" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>paco: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.15.1 / paco - 4.0.2</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> paco <small> 4.0.2 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-05-04 02:00:26 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-04 02:00:26 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 4 Virtual package relying on a GMP lib system installation coq 8.15.1 Formal proof management system dune 3.1.1 Fast, portable, and opinionated build system ocaml 4.13.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.13.1 Official release 4.13.1 ocaml-config 2 OCaml Switch Configuration ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled ocamlfind 1.9.3 A library manager for OCaml zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;paco@sf.snu.ac.kr&quot; synopsis: &quot;Coq library implementing parameterized coinduction&quot; homepage: &quot;https://github.com/snu-sf/paco/&quot; dev-repo: &quot;git+https://github.com/snu-sf/paco.git&quot; bug-reports: &quot;https://github.com/snu-sf/paco/issues/&quot; authors: [ &quot;Chung-Kil Hur &lt;gil.hur@sf.snu.ac.kr&gt;&quot; &quot;Georg Neis &lt;neis@mpi-sws.org&gt;&quot; &quot;Derek Dreyer &lt;dreyer@mpi-sws.org&gt;&quot; &quot;Viktor Vafeiadis &lt;viktor@mpi-sws.org&gt;&quot; &quot;Minki Cho &lt;minki.cho@sf.snu.ac.kr&gt;&quot; ] license: &quot;BSD-3-Clause&quot; build: [make &quot;-C&quot; &quot;src&quot; &quot;all&quot; &quot;-j%{jobs}%&quot;] install: [make &quot;-C&quot; &quot;src&quot; &quot;-f&quot; &quot;Makefile.coq&quot; &quot;install&quot;] depends: [ &quot;coq&quot; {&gt;= &quot;8.6&quot; &amp; &lt; &quot;8.13~&quot;} ] tags: [ &quot;date:2020-10-04&quot; &quot;category:Computer Science/Programming Languages/Formal Definitions and Theory&quot; &quot;category:Mathematics/Logic&quot; &quot;keyword:co-induction&quot; &quot;keyword:simulation&quot; &quot;keyword:parameterized greatest fixed point&quot; ] url { http: &quot;https://github.com/snu-sf/paco/archive/v4.0.2.tar.gz&quot; checksum: &quot;ef4b70b2053a37ce5d68ba0428818a5b&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-paco.4.0.2 coq.8.15.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.15.1). The following dependencies couldn&#39;t be met: - coq-paco -&gt; coq &lt; 8.13~ -&gt; ocaml &lt; 4.12 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-paco.4.0.2</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "a15c9d02fe3284df86e84d3ac2f07ca0", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 159, "avg_line_length": 41.56395348837209, "alnum_prop": 0.5411945726675059, "repo_name": "coq-bench/coq-bench.github.io", "id": "55c5aa604dd5547b3059692bf45b6ef425e9bbab", "size": "7174", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.13.1-2.0.10/released/8.15.1/paco/4.0.2.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<?xml version="1.0" encoding="ascii"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>qgis._core.QgsLinearlyInterpolatedDiagramRenderer</title> <link rel="stylesheet" href="epydoc.css" type="text/css" /> <script type="text/javascript" src="epydoc.js"></script> </head> <body bgcolor="white" text="black" link="blue" vlink="#204080" alink="#204080"> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Home link --> <th>&nbsp;&nbsp;&nbsp;<a href="QGIS-AIMS-Plugin-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th> <!-- Tree link --> <th>&nbsp;&nbsp;&nbsp;<a href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th> <!-- Index link --> <th>&nbsp;&nbsp;&nbsp;<a href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th> <!-- Help link --> <th>&nbsp;&nbsp;&nbsp;<a href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th> <th class="navbar" width="100%"></th> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="100%"> <span class="breadcrumbs"> qgis :: _core :: QgsLinearlyInterpolatedDiagramRenderer :: Class&nbsp;QgsLinearlyInterpolatedDiagramRenderer </span> </td> <td> <table cellpadding="0" cellspacing="0"> <!-- hide/show private --> <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr> <tr><td align="right"><span class="options" >[<a href="frames.html" target="_top">frames</a >]&nbsp;|&nbsp;<a href="qgis._core.QgsLinearlyInterpolatedDiagramRenderer-class.html" target="_top">no&nbsp;frames</a>]</span></td></tr> </table> </td> </tr> </table> <!-- ==================== CLASS DESCRIPTION ==================== --> <h1 class="epydoc">Class QgsLinearlyInterpolatedDiagramRenderer</h1><p class="nomargin-top"></p> <pre class="base-tree"> object --+ | sip.simplewrapper --+ | sip.wrapper --+ | <a href="qgis._core.QgsDiagramRendererV2-class.html">QgsDiagramRendererV2</a> --+ | <strong class="uidshort">QgsLinearlyInterpolatedDiagramRenderer</strong> </pre> <hr /> <p>QgsLinearlyInterpolatedDiagramRenderer() QgsLinearlyInterpolatedDiagramRenderer(QgsLinearlyInterpolatedDiagramRenderer)</p> <!-- ==================== INSTANCE METHODS ==================== --> <a name="section-InstanceMethods"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Instance Methods</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-InstanceMethods" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> <tr class="private"> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="qgis._core.QgsLinearlyInterpolatedDiagramRenderer-class.html#_readXML" class="summary-sig-name" onclick="show_private();">_readXML</a>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr class="private"> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="qgis._core.QgsLinearlyInterpolatedDiagramRenderer-class.html#_writeXML" class="summary-sig-name" onclick="show_private();">_writeXML</a>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="classificationAttribute"></a><span class="summary-sig-name">classificationAttribute</span>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="classificationAttributeExpression"></a><span class="summary-sig-name">classificationAttributeExpression</span>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="classificationAttributeIsExpression"></a><span class="summary-sig-name">classificationAttributeIsExpression</span>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="qgis._core.QgsLinearlyInterpolatedDiagramRenderer-class.html#clone" class="summary-sig-name">clone</a>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="qgis._core.QgsLinearlyInterpolatedDiagramRenderer-class.html#convertSizeToMapUnits" class="summary-sig-name">convertSizeToMapUnits</a>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="qgis._core.QgsLinearlyInterpolatedDiagramRenderer-class.html#diagramAttributes" class="summary-sig-name">diagramAttributes</a>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="qgis._core.QgsLinearlyInterpolatedDiagramRenderer-class.html#diagramSettings" class="summary-sig-name">diagramSettings</a>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="qgis._core.QgsLinearlyInterpolatedDiagramRenderer-class.html#diagramSize" class="summary-sig-name">diagramSize</a>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="qgis._core.QgsLinearlyInterpolatedDiagramRenderer-class.html#dpiPaintDevice" class="summary-sig-name">dpiPaintDevice</a>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="lowerSize"></a><span class="summary-sig-name">lowerSize</span>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="lowerValue"></a><span class="summary-sig-name">lowerValue</span>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="qgis._core.QgsLinearlyInterpolatedDiagramRenderer-class.html#readXML" class="summary-sig-name">readXML</a>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="qgis._core.QgsLinearlyInterpolatedDiagramRenderer-class.html#rendererName" class="summary-sig-name">rendererName</a>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="setClassificationAttribute"></a><span class="summary-sig-name">setClassificationAttribute</span>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="setClassificationAttributeExpression"></a><span class="summary-sig-name">setClassificationAttributeExpression</span>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="setClassificationAttributeIsExpression"></a><span class="summary-sig-name">setClassificationAttributeIsExpression</span>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="setDiagramSettings"></a><span class="summary-sig-name">setDiagramSettings</span>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="setLowerSize"></a><span class="summary-sig-name">setLowerSize</span>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="setLowerValue"></a><span class="summary-sig-name">setLowerValue</span>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="setUpperSize"></a><span class="summary-sig-name">setUpperSize</span>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="setUpperValue"></a><span class="summary-sig-name">setUpperValue</span>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="upperSize"></a><span class="summary-sig-name">upperSize</span>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="upperValue"></a><span class="summary-sig-name">upperValue</span>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="qgis._core.QgsLinearlyInterpolatedDiagramRenderer-class.html#writeXML" class="summary-sig-name">writeXML</a>(<span class="summary-sig-arg">...</span>)</span></td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td colspan="2" class="summary"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="qgis._core.QgsDiagramRendererV2-class.html">QgsDiagramRendererV2</a></code></b>: <code><a href="qgis._core.QgsDiagramRendererV2-class.html#diagram">diagram</a></code>, <code><a href="qgis._core.QgsDiagramRendererV2-class.html#renderDiagram">renderDiagram</a></code>, <code><a href="qgis._core.QgsDiagramRendererV2-class.html#setDiagram">setDiagram</a></code>, <code><a href="qgis._core.QgsDiagramRendererV2-class.html#sizeMapUnits">sizeMapUnits</a></code> </p> <p class="indent-wrapped-lines"><b>Inherited from <code>sip.simplewrapper</code></b>: <code>__init__</code>, <code>__new__</code> </p> <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: <code>__delattr__</code>, <code>__format__</code>, <code>__getattribute__</code>, <code>__hash__</code>, <code>__reduce__</code>, <code>__reduce_ex__</code>, <code>__repr__</code>, <code>__setattr__</code>, <code>__sizeof__</code>, <code>__str__</code>, <code>__subclasshook__</code> </p> </td> </tr> </table> <!-- ==================== PROPERTIES ==================== --> <a name="section-Properties"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Properties</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-Properties" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> <tr> <td colspan="2" class="summary"> <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: <code>__class__</code> </p> </td> </tr> </table> <!-- ==================== METHOD DETAILS ==================== --> <a name="section-MethodDetails"></a> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Method Details</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-MethodDetails" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> </table> <a name="_readXML"></a> <div class="private"> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">_readXML</span>(<span class="sig-arg">...</span>)</span> </h3> </td><td align="right" valign="top" >&nbsp; </td> </tr></table> <dl class="fields"> <dt>Overrides: QgsDiagramRendererV2._readXML </dt> </dl> </td></tr></table> </div> <a name="_writeXML"></a> <div class="private"> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">_writeXML</span>(<span class="sig-arg">...</span>)</span> </h3> </td><td align="right" valign="top" >&nbsp; </td> </tr></table> <dl class="fields"> <dt>Overrides: QgsDiagramRendererV2._writeXML </dt> </dl> </td></tr></table> </div> <a name="clone"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">clone</span>(<span class="sig-arg">...</span>)</span> </h3> </td><td align="right" valign="top" >&nbsp; </td> </tr></table> <dl class="fields"> <dt>Overrides: QgsDiagramRendererV2.clone </dt> </dl> </td></tr></table> </div> <a name="convertSizeToMapUnits"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">convertSizeToMapUnits</span>(<span class="sig-arg">...</span>)</span> </h3> </td><td align="right" valign="top" >&nbsp; </td> </tr></table> <dl class="fields"> <dt>Overrides: QgsDiagramRendererV2.convertSizeToMapUnits </dt> </dl> </td></tr></table> </div> <a name="diagramAttributes"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">diagramAttributes</span>(<span class="sig-arg">...</span>)</span> </h3> </td><td align="right" valign="top" >&nbsp; </td> </tr></table> <dl class="fields"> <dt>Overrides: QgsDiagramRendererV2.diagramAttributes </dt> </dl> </td></tr></table> </div> <a name="diagramSettings"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">diagramSettings</span>(<span class="sig-arg">...</span>)</span> </h3> </td><td align="right" valign="top" >&nbsp; </td> </tr></table> <dl class="fields"> <dt>Overrides: QgsDiagramRendererV2.diagramSettings </dt> </dl> </td></tr></table> </div> <a name="diagramSize"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">diagramSize</span>(<span class="sig-arg">...</span>)</span> </h3> </td><td align="right" valign="top" >&nbsp; </td> </tr></table> <dl class="fields"> <dt>Overrides: QgsDiagramRendererV2.diagramSize </dt> </dl> </td></tr></table> </div> <a name="dpiPaintDevice"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">dpiPaintDevice</span>(<span class="sig-arg">...</span>)</span> </h3> </td><td align="right" valign="top" >&nbsp; </td> </tr></table> <dl class="fields"> <dt>Overrides: QgsDiagramRendererV2.dpiPaintDevice </dt> </dl> </td></tr></table> </div> <a name="readXML"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">readXML</span>(<span class="sig-arg">...</span>)</span> </h3> </td><td align="right" valign="top" >&nbsp; </td> </tr></table> <dl class="fields"> <dt>Overrides: QgsDiagramRendererV2.readXML </dt> </dl> </td></tr></table> </div> <a name="rendererName"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">rendererName</span>(<span class="sig-arg">...</span>)</span> </h3> </td><td align="right" valign="top" >&nbsp; </td> </tr></table> <dl class="fields"> <dt>Overrides: QgsDiagramRendererV2.rendererName </dt> </dl> </td></tr></table> </div> <a name="writeXML"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">writeXML</span>(<span class="sig-arg">...</span>)</span> </h3> </td><td align="right" valign="top" >&nbsp; </td> </tr></table> <dl class="fields"> <dt>Overrides: QgsDiagramRendererV2.writeXML </dt> </dl> </td></tr></table> </div> <br /> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Home link --> <th>&nbsp;&nbsp;&nbsp;<a href="QGIS-AIMS-Plugin-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th> <!-- Tree link --> <th>&nbsp;&nbsp;&nbsp;<a href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th> <!-- Index link --> <th>&nbsp;&nbsp;&nbsp;<a href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th> <!-- Help link --> <th>&nbsp;&nbsp;&nbsp;<a href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th> <th class="navbar" width="100%"></th> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%%"> <tr> <td align="left" class="footer"> Generated by Epydoc 3.0.1 on Tue Jun 14 13:29:20 2016 </td> <td align="right" class="footer"> <a target="mainFrame" href="http://epydoc.sourceforge.net" >http://epydoc.sourceforge.net</a> </td> </tr> </table> <script type="text/javascript"> <!-- // Private objects are initially displayed (because if // javascript is turned off then we want them to be // visible); but by default, we want to hide them. So hide // them unless we have a cookie that says to show them. checkCookie(); // --> </script> </body> </html>
{ "content_hash": "5922d2d39ac1edcf702ee2a517f4d2d2", "timestamp": "", "source": "github", "line_count": 869, "max_line_length": 239, "avg_line_length": 33.361334867663984, "alnum_prop": 0.557345383049912, "repo_name": "SPlanzer/QGIS-AIMS-Plugin", "id": "13cfca05e49b9aabfe70c68267c2ef956317ad75", "size": "28991", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "doc/Aims-Plugin_Doc/qgis._core.QgsLinearlyInterpolatedDiagramRenderer-class.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Makefile", "bytes": "1572" }, { "name": "Python", "bytes": "634796" }, { "name": "QML", "bytes": "111310" } ], "symlink_target": "" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Exer_17_PrintPartOfASCII")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Exer_17_PrintPartOfASCII")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("7666720c-4bdd-44f2-b29d-5188808be5de")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "content_hash": "5bf988dd28f45564dfec2bc20eda00a1", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 39.333333333333336, "alnum_prop": 0.7492937853107344, "repo_name": "quakeN/ProgrammingFundamentals_Sept2017", "id": "a79b9608ff01b4665bf8035718a4e75976d36770", "size": "1419", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "06. Data types and variables/Exer_17_PrintPartOfASCII/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "516338" } ], "symlink_target": "" }
package main import ( "bufio" "encoding/json" "flag" "fmt" "io" "log" "os" "os/exec" "runtime" "strconv" "syscall" ) var STARTING_UID = "1000" var STARTING_GID = "1000" var MAX_UID = "1004" //The path the next binary should be invoked from var RUNNER_PATH = "/usr/bin/" //The types of binaries allowed to be selected by the user var RUNNER0 = "strace" var RUNNER1 = "strace+" var RUNNERS = []string{RUNNER0, RUNNER1} //The flag configuring the binary var RUNNER_CONFIG_FLAG = "-e" var RUNNER_ENVIRONMENT_FLAG = "-E" var RUNNER_MEMORY_FLAG = "-O" //the prefix to valid configuration flag var RUNNER_CONFIG_PREFIX = "trace=" //a flag that will be passed into the runner every time var RUNNER_ADDITIONAL_FLAG = "-f" var VERSION = "unknown" var ABORT_PIPE = "/pipes/abort" var SHUTDOWN_PIPE = "/pipes/shutdown" var FALLBACK_ABORT_PIPE = "/pipes/abort" var FALLBACK_SHUTDOWN_PIPE = "/pipes/shutdown" func concatenate_string_arrays(s0, s1 []string) []string { retval := make([]string, len(s0)+len(s1)) copy(retval, s0) copy(retval[len(s0):], s1) return retval } func within(needle string, haystack []string) bool { for _, item := range haystack { if item == needle { return true } } return false } func isalphanumdashunder(s string) bool { for _, item := range s { item_is_alpha := (item >= 'A' && item <= 'Z') || (item >= 'a' && item <= 'z') item_is_numeric := (item >= '0' && item <= '9') item_is_underdash := (item == '_' || item == '-') if (!item_is_alpha) && (!item_is_numeric) && !item_is_underdash { return false } } return true } type Instruction struct { // The arguments to pass to exec Command []string // Whether, instead of running a new command, a new user should be switched to CreateNewUser bool // an alphanumeric (with dashes and underbars) config file that will be passed to the runner RunnerConfig string // sets environment variables to be set in the runner RunnerEnvironment map[string]string // sets a resource limit on the runner RunnerMemory int64 // Runner to use to launch this command: must be in the array of allowed RUNNERS Runner string // The location of the stdin, stdout, and stderr pipes, used to communicate with the caller StdinPipePath string StdoutPipePath string StderrPipePath string // group such that the above 3 pipes are openable: Stdout, Stderr for WRONLY, Stdin for RDONLYs Gid int } func read_shutdown(pipe_name string, pipe_name2 string, shutdown_channel chan<- int) { f, err := os.Open(pipe_name) if err != nil { f, err = os.Open(pipe_name2) } if err == nil { f.Close() shutdown_channel <- 0 } } func read_instructions(instruction_channel chan<- []byte, shutdown_channel chan<- int) { instruction_buffer := bufio.NewReader(os.Stdin) for { instruction_json, err := instruction_buffer.ReadBytes('\n') if err != nil { if err == io.EOF { shutdown_channel <- 0 return } log.Fatalf("Error on instruction stream %v\n", err) } instruction_channel <- instruction_json } } func wait_proc(proc *exec.Cmd, waited_channel chan<- error) { waited_channel <- proc.Wait() } func accept_commands() { uid, err := strconv.Atoi(STARTING_UID) if err != nil { log.Fatalf("Could not convert user id %s: %v", STARTING_UID, err) } gid, err := strconv.Atoi(STARTING_GID) if err != nil { log.Fatalf("Could not convert group id %s: %v", STARTING_GID, err) } max_uid, err := strconv.Atoi(MAX_UID) if err != nil { log.Fatalf("Could not convert user id %s: %v", MAX_UID, err) } proc_channel := make(chan error) instruction_channel := make(chan []byte) abort_channel := make(chan int) go read_shutdown(ABORT_PIPE, FALLBACK_ABORT_PIPE, abort_channel) shutdown_channel := make(chan int) go read_shutdown(SHUTDOWN_PIPE, FALLBACK_SHUTDOWN_PIPE, shutdown_channel) go read_instructions(instruction_channel, shutdown_channel) var instruction_json []byte for { select { case exit_code := <-shutdown_channel: os.Exit(exit_code) return case exit_code := <-abort_channel: os.Exit(exit_code) return case instruction_json = <-instruction_channel: } if err != nil { if err == io.EOF { return } log.Fatalf("Error on instruction stream %v\n", err) } var instruction Instruction json_err := json.Unmarshal(instruction_json, &instruction) if json_err == nil && (instruction.CreateNewUser || len(instruction.Command) > 0) { // this guarantees that the Setgid call applies to the same OSThread that will then // run os.Open on the stdin, stdout and stderr pipes. runtime.LockOSThread() syscall.Setgid(instruction.Gid) stdin_stream, err := os.Open(instruction.StdinPipePath) if err != nil { log.Fatal(err) } stdout_stream, err := os.OpenFile(instruction.StdoutPipePath, os.O_WRONLY, 0) if err != nil { stdin_stream.Close() log.Fatal(err) } stderr_stream, err := os.OpenFile(instruction.StderrPipePath, os.O_WRONLY, 0) if err != nil { stdin_stream.Close() stdout_stream.Close() log.Fatal(err) } runtime.UnlockOSThread() command := instruction.Command var exit_code [1]byte if instruction.CreateNewUser { if len(command) > 0 { log.Print("Command %v ignored because we are creating a new user\n", command) } uid += 1 gid += 1 if uid > max_uid { io.WriteString(stdout_stream, "-1\n") stderr_stream.Close() stdout_stream.Close() stdin_stream.Close() log.Fatalf("uid %d is higher than the maximum (%d): restart...", uid, max_uid) } io.WriteString(stdout_stream, strconv.Itoa(uid)+"\n") } else { if !within(instruction.Runner, RUNNERS) { log.Fatalf("Using a disallowed runner %s, not within %v\n", instruction.Runner, RUNNERS) } else if !isalphanumdashunder(instruction.RunnerConfig) { log.Fatalf("Using a disallowed configuration command: %s", instruction.RunnerConfig) } else if len(instruction.RunnerConfig) == 0 { log.Fatalf("Did not specify configuration to use with runner") } else { command_prefix := []string{RUNNER_PATH + instruction.Runner, RUNNER_CONFIG_FLAG, RUNNER_CONFIG_PREFIX + instruction.RunnerConfig, RUNNER_ADDITIONAL_FLAG} if instruction.RunnerMemory > 0 { command_prefix = concatenate_string_arrays(command_prefix, []string{RUNNER_MEMORY_FLAG, strconv.FormatInt(instruction.RunnerMemory, 10)}) } for k,v := range instruction.RunnerEnvironment { command_prefix = concatenate_string_arrays(command_prefix, []string{RUNNER_ENVIRONMENT_FLAG, k + "=" + v}) } concatenate_string_arrays(command_prefix, []string{"--"}) concatenated_command := concatenate_string_arrays(command_prefix, command) log.Printf("PREFIX %v\n",concatenated_command) proc := exec.Command(concatenated_command[0]) proc.Args = concatenated_command proc.Stdin = stdin_stream proc.Stdout = stdout_stream proc.Stderr = stderr_stream var sys_proc_attr syscall.SysProcAttr var cred syscall.Credential cred.Uid = uint32(uid) cred.Gid = uint32(gid) cred.Groups = make([]uint32, 0) sys_proc_attr.Credential = &cred proc.SysProcAttr = &sys_proc_attr proc.Start() go wait_proc(proc, proc_channel) select { case err = <-proc_channel: if err != nil { exit_code[0] = 1 } else { exit_code[0] = 0 } case exit_code := <-abort_channel: os.Exit(exit_code) return } } } stderr_stream.Close() stdout_stream.Close() stdin_stream.Close() select { case bad_message := <-instruction_channel: log.Fatalf("%v bytes in command buffer before exit code has been sent\n", bad_message) default: break } os.Stdout.Write(exit_code[:]) } else { log.Printf("Error with instruction stream %s: %v", instruction_json, json_err) } } } func main() { runtime.GOMAXPROCS(1) version := flag.Bool("version", false, "Print out version information") flag.Parse() if *version { fmt.Printf("%s\nCONFIGURED WITH\n", VERSION) var configuration_params = []string{ "min uid", STARTING_UID, "min gid", STARTING_UID, "max uid", MAX_UID, "runner config flag", RUNNER_CONFIG_FLAG, "runner config prefix", RUNNER_CONFIG_PREFIX, "runner additional flag", RUNNER_ADDITIONAL_FLAG} for i, item := range configuration_params { fmt.Printf("%s", item) if i%2 == 0 { fmt.Printf(": ") } else { fmt.Printf("\n") } } fmt.Printf("Configured Runners:\n") for _, runner := range RUNNERS { fmt.Printf("%s%s\n", RUNNER_PATH, runner) } os.Exit(0) } accept_commands() }
{ "content_hash": "db0bc2842c07a4d92d4684d8eba2c38e", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 99, "avg_line_length": 35.51815181518152, "alnum_prop": 0.5347519048503996, "repo_name": "danielrh/repeatexec", "id": "37a5d9e71d1173048648995f3a8524b576b844a2", "size": "12327", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "repeatexec.go", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Go", "bytes": "9285" }, { "name": "Shell", "bytes": "236" } ], "symlink_target": "" }
<?php namespace Symfony\Component\Notifier\Transport; use Symfony\Component\Notifier\Exception\TransportExceptionInterface; use Symfony\Component\Notifier\Message\MessageInterface; use Symfony\Component\Notifier\Message\SentMessage; /** * @author Fabien Potencier <fabien@symfony.com> * * @experimental in 5.1 */ interface TransportInterface { /** * @throws TransportExceptionInterface */ public function send(MessageInterface $message): ?SentMessage; public function supports(MessageInterface $message): bool; public function __toString(): string; }
{ "content_hash": "3de26bf4eed0a0c379bc57ad0dcd3340", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 69, "avg_line_length": 22.615384615384617, "alnum_prop": 0.7568027210884354, "repo_name": "jvasseur/symfony", "id": "71cf62169746e5dff7d1946dcbffa8a47273a458", "size": "817", "binary": false, "copies": "9", "ref": "refs/heads/master", "path": "src/Symfony/Component/Notifier/Transport/TransportInterface.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "49607" }, { "name": "HTML", "bytes": "367195" }, { "name": "Hack", "bytes": "26" }, { "name": "JavaScript", "bytes": "27651" }, { "name": "Lua", "bytes": "1846" }, { "name": "PHP", "bytes": "20818621" }, { "name": "Shell", "bytes": "3136" } ], "symlink_target": "" }
<?php namespace Album\Controller; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; class AlbumController extends AbstractActionController { protected $albumTable; public function getAlbumTable() { if (!$this->albumTable) { $sm = $this->getServiceLocator(); $this->albumTable = $sm->get('Album\Model\AlbumTable'); } return $this->albumTable; } public function indexAction() { return new ViewModel(array( 'albums' => $this->getAlbumTable()->fetchAll(), )); } }
{ "content_hash": "6f8724906602d4cb8dece48b69c80ebd", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 71, "avg_line_length": 23.555555555555557, "alnum_prop": 0.5817610062893082, "repo_name": "naveennimbal/zf2tuts", "id": "5b5ad77ed5520abb4fcd6ef5f9109cb9aaa28105", "size": "958", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "module/Album/src/Album/Controller/AlbumController.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "266392" }, { "name": "JavaScript", "bytes": "106451" }, { "name": "PHP", "bytes": "35151" } ], "symlink_target": "" }
// Filename: BBTimer.h // Author: Gael Huber #ifndef __BBTIMER_H__ #define __BBTIMER_H__ #include "BBPlatform.h" #include <sys/time.h> #include <iostream> namespace BlockBlock { /** \addtogroup Core * @{ */ /** * Defines the number of microseconds per second */ #define MICROSECONDS_PER_SECOND 1000000 /** * A timer keeps track of the passage of time, both cumulative time since last reset and the delta * since the last poll interval */ class Timer { public: /** * Default constructor */ Timer(); /** * Copy constructor * @param other The timer to copy */ Timer(const Timer& other); /** * Destructor */ ~Timer(); /** * Assignment operator * @param other The timer to copy * @return The resultant timer */ Timer& operator=(const Timer& other); /** * Start the clock * @return Returns true if the clock was started successfully */ bool Start(); /** * Stop the clock */ void Stop(); /** * Reset the clock */ void Reset(); /** * Zero the clock */ void Zero(); /** * Update the timer for this polling interval */ void Update(); /** * Get the delta for this timer in milliseconds * @return The delta for the timer */ long GetDeltaTimeMs() const; /** * Get the current elapsed time since starting the clock * @return The elapsed time in milliseconds */ long GetElapsedTimeMs() const; private: /** * The time when the timer was started */ timeval _start; /** * The time time when the timer was stopped */ timeval _stop; /** * The time at the previous update call */ timeval _previous; /** * The time from the most recent update call */ timeval _current; }; /** @} */ } // Namespace #endif // __BBTIMER_H__
{ "content_hash": "0ed8087d492fd5bcc9dc9ea282a7ab0d", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 102, "avg_line_length": 21.689655172413794, "alnum_prop": 0.435214626391097, "repo_name": "leag37/BlockBlock", "id": "dc733e1caf57554cb3a758f87651b92fff9558bc", "size": "2516", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Shared/Include/BBTimer.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1525435" }, { "name": "C++", "bytes": "2346254" }, { "name": "CSS", "bytes": "40521" }, { "name": "JavaScript", "bytes": "3265" }, { "name": "Objective-C", "bytes": "76161" } ], "symlink_target": "" }
<?php /** * DO NOT EDIT THIS FILE! * * This file was automatically generated from external sources. * * Any manual change here will be lost the next time the SDK * is updated. You've been warned! */ namespace DTS\eBaySDK\Test\MerchantData\Enums; use DTS\eBaySDK\MerchantData\Enums\PaymentTransactionStatusCodeType; class PaymentTransactionStatusCodeTypeTest extends \PHPUnit_Framework_TestCase { private $obj; protected function setUp() { $this->obj = new PaymentTransactionStatusCodeType(); } public function testCanBeCreated() { $this->assertInstanceOf('\DTS\eBaySDK\MerchantData\Enums\PaymentTransactionStatusCodeType', $this->obj); } }
{ "content_hash": "18db0d5212b37d772990a074de61986b", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 112, "avg_line_length": 24.857142857142858, "alnum_prop": 0.7270114942528736, "repo_name": "davidtsadler/ebay-sdk-php", "id": "1679c152debf02ca5b3d30edef129c8722bf5d85", "size": "696", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/MerchantData/Enums/PaymentTransactionStatusCodeTypeTest.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Makefile", "bytes": "10944" }, { "name": "PHP", "bytes": "9958599" } ], "symlink_target": "" }
import Object3D from './Object3D'; import * as Three from 'three'; class Tile extends Object3D { constructor(width, height, plan, ratio, texture, meta) { super(width, height, plan, ratio); this.texture = texture; this.meta = meta; } mount(thick) { thick = thick || 0; let boxGeometry = null; switch (this.plan) { case 'x': boxGeometry = new Three.BoxGeometry(thick, this.height, this.width); break; case 'y': boxGeometry = new Three.BoxGeometry(this.width, thick, this.height); break; case 'z': boxGeometry = new Three.BoxGeometry(this.width, this.height, thick); break; } if (typeof this.texture === 'number') { this.material = new Three.MeshBasicMaterial( {color: this.texture} ); } else { this.material = new Three.MeshBasicMaterial( {map: this.texture, transparent: false, opacity: 1} ); } const tile = new Three.Mesh(boxGeometry, this.material); tile.position.set(this.position.x, this.position.y, this.position.z); tile.objectType = 'Tile'; tile.originObject = this; tile.renderOrder = 1; this.material.depthTest = false; return tile; } } export default Tile;
{ "content_hash": "75721b1886a43f61a8b10bbf3c8f7e6f", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 105, "avg_line_length": 28.511627906976745, "alnum_prop": 0.632952691680261, "repo_name": "huytbt/react-3d-room-scence", "id": "9afa7f796bd4a56bf0541f061b15e374f00e3ed5", "size": "1226", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "components/Tile.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "198" }, { "name": "JavaScript", "bytes": "88801" } ], "symlink_target": "" }
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE78_OS_Command_Injection__char_listen_socket_execl_81a.cpp Label Definition File: CWE78_OS_Command_Injection.strings.label.xml Template File: sources-sink-81a.tmpl.cpp */ /* * @description * CWE: 78 OS Command Injection * BadSource: listen_socket Read data using a listen socket (server side) * GoodSource: Fixed string * Sinks: execl * BadSink : execute command with execl * Flow Variant: 81 Data flow: data passed in a parameter to an virtual method called via a reference * * */ #include "std_testcase.h" #include "CWE78_OS_Command_Injection__char_listen_socket_execl_81.h" #ifdef _WIN32 #include <winsock2.h> #include <windows.h> #include <direct.h> #pragma comment(lib, "ws2_32") /* include ws2_32.lib when linking */ #define CLOSE_SOCKET closesocket #else #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <unistd.h> #define INVALID_SOCKET -1 #define SOCKET_ERROR -1 #define CLOSE_SOCKET close #define SOCKET int #endif #define TCP_PORT 27015 #define LISTEN_BACKLOG 5 namespace CWE78_OS_Command_Injection__char_listen_socket_execl_81 { #ifndef OMITBAD void bad() { char * data; char dataBuffer[100] = COMMAND_ARG2; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } const CWE78_OS_Command_Injection__char_listen_socket_execl_81_base& baseObject = CWE78_OS_Command_Injection__char_listen_socket_execl_81_bad(); baseObject.action(data); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ static void goodG2B() { char * data; char dataBuffer[100] = COMMAND_ARG2; data = dataBuffer; /* FIX: Append a fixed string to data (not user / external input) */ strcat(data, "*.*"); const CWE78_OS_Command_Injection__char_listen_socket_execl_81_base& baseObject = CWE78_OS_Command_Injection__char_listen_socket_execl_81_goodG2B(); baseObject.action(data); } void good() { goodG2B(); } #endif /* OMITGOOD */ } /* close namespace */ /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN using namespace CWE78_OS_Command_Injection__char_listen_socket_execl_81; /* so that we can use good and bad easily */ int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
{ "content_hash": "e08f8d155f21ecaa14a361b21b41940e", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 151, "avg_line_length": 28.655913978494624, "alnum_prop": 0.5697936210131332, "repo_name": "JianpingZeng/xcc", "id": "c701d808d060f988ecdd425866b03c4cb51c1659", "size": "5330", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "xcc/test/juliet/testcases/CWE78_OS_Command_Injection/s04/CWE78_OS_Command_Injection__char_listen_socket_execl_81a.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
package com.braintreepayments.api; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.test.AndroidTestCase; import com.braintreepayments.api.exceptions.BraintreeException; import com.braintreepayments.api.exceptions.ConfigurationException; import com.braintreepayments.api.exceptions.ErrorWithResponse; import com.braintreepayments.api.internal.HttpRequest; import com.braintreepayments.api.internal.HttpResponse; import com.braintreepayments.api.models.AnalyticsConfiguration; import com.braintreepayments.api.models.AndroidPayConfiguration; import com.braintreepayments.api.models.Card; import com.braintreepayments.api.models.CardBuilder; import com.braintreepayments.api.models.ClientToken; import com.braintreepayments.api.models.Configuration; import com.braintreepayments.testutils.TestClientTokenBuilder; import com.google.gson.Gson; import com.paypal.android.sdk.payments.PayPalFuturePaymentActivity; import org.json.JSONException; import java.util.concurrent.atomic.AtomicInteger; import static com.braintreepayments.testutils.CardNumber.VISA; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.contains; import static org.mockito.Matchers.matches; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; public class BraintreeApiTest extends AndroidTestCase { private Context mContext; @Override public void setUp() { mContext = getContext(); TestUtils.setUp(mContext); } public void testThrowsConfigurationExceptionOnBadPayPalConfiguration() throws ErrorWithResponse, BraintreeException { Configuration configuration = mock(Configuration.class); BraintreeApi braintreeApi = new BraintreeApi(mContext, mock(ClientToken.class), configuration, mock(HttpRequest.class)); boolean exceptionHappened = false; try { braintreeApi.finishPayWithPayPal(null, PayPalFuturePaymentActivity.RESULT_EXTRAS_INVALID, new Intent()); fail("Configuration exception not thrown"); } catch (ConfigurationException e) { exceptionHappened = true; } assertTrue("Expected ConfigurationException was not thrown", exceptionHappened); } public void testFinishPayWithVenmoReturnsANonce() { BraintreeApi braintreeApi = new BraintreeApi(mContext, new TestClientTokenBuilder().build()); Intent intent = new Intent().putExtra(AppSwitch.EXTRA_PAYMENT_METHOD_NONCE, "payment method nonce"); assertEquals("payment method nonce", braintreeApi.finishPayWithVenmo(Activity.RESULT_OK, intent)); } public void testPayWithVenmoReturnsNullIfResultCodeNotOK() { BraintreeApi braintreeApi = new BraintreeApi(mContext, new TestClientTokenBuilder().build()); assertNull(braintreeApi.finishPayWithVenmo(Activity.RESULT_CANCELED, new Intent())); } public void testGetPaymentMethodReturnsPaymentMethodFromNonce() throws ErrorWithResponse, BraintreeException, JSONException { BraintreeApi braintreeApi = new BraintreeApi(mContext, new TestClientTokenBuilder().build()); Card card = braintreeApi.create( new CardBuilder().cardNumber(VISA).expirationDate("06/20")); Card cardFromShowNonce = (Card) braintreeApi.getPaymentMethod(card.getNonce()); assertEquals(card.getLastTwo(), cardFromShowNonce.getLastTwo()); assertEquals(card.getTypeLabel(), cardFromShowNonce.getTypeLabel()); } public void testSendAnalyticsEventSendsAnalyticsIfEnabled() throws BraintreeException, ErrorWithResponse { HttpRequest httpRequest = mock(HttpRequest.class); AnalyticsConfiguration analyticsConfiguration = mock(AnalyticsConfiguration.class); when(analyticsConfiguration.getUrl()).thenReturn("analytics_url"); Configuration configuration = mock(Configuration.class); when(configuration.isAnalyticsEnabled()).thenReturn(true); when(configuration.getAnalytics()).thenReturn(analyticsConfiguration); BraintreeApi braintreeApi = new BraintreeApi(mContext, mock(ClientToken.class), configuration, httpRequest); braintreeApi.sendAnalyticsEvent("very.important.analytics-payload", "TEST"); verify(httpRequest, times(1)).post(matches("analytics_url"), contains("very.important.analytics-payload")); } public void testSendAnalyticsEventNoopsIfDisabled() throws BraintreeException, ErrorWithResponse { HttpRequest httpRequest = mock(HttpRequest.class); Configuration configuration = mock(Configuration.class); when(configuration.isAnalyticsEnabled()).thenReturn(false); BraintreeApi braintreeApi = new BraintreeApi(mContext, mock(ClientToken.class), configuration, httpRequest); braintreeApi.sendAnalyticsEvent("event", "TEST"); verify(httpRequest, never()).post(anyString(), anyString()); } public void testAnalyticsEventsAreSentToServer() throws ErrorWithResponse, BraintreeException { final AtomicInteger requestCount = new AtomicInteger(0); final AtomicInteger responseCode = new AtomicInteger(0); String clientTokenString = new TestClientTokenBuilder().build(); ClientToken clientToken = ClientToken.fromString(clientTokenString); Configuration configuration = Configuration.fromJson(clientTokenString); HttpRequest request = new HttpRequest(clientToken.getAuthorizationFingerprint()) { @Override public HttpResponse post (String url, String params) throws BraintreeException, ErrorWithResponse { requestCount.incrementAndGet(); HttpResponse response = super.post(url, params); responseCode.set(response.getResponseCode()); return response; } }; request.setBaseUrl(configuration.getClientApiUrl()); BraintreeApi braintreeApi = new BraintreeApi(mContext, clientToken, configuration, request); braintreeApi.setup(); braintreeApi.sendAnalyticsEvent("event", "TEST"); assertEquals(1, requestCount.get()); assertEquals(200, responseCode.get()); braintreeApi.sendAnalyticsEvent("another-event", "TEST"); assertEquals(2, requestCount.get()); assertEquals(200, responseCode.get()); } public void testGetAndroidPayPaymentMethodTokenizationParametersReturnsParameters() { AndroidPayConfiguration androidPayConfiguration = mock(AndroidPayConfiguration.class); when(androidPayConfiguration.getGoogleAuthorizationFingerprint()) .thenReturn("google-auth-fingerprint"); Configuration configuration = mock(Configuration.class); when(configuration.getMerchantId()).thenReturn("android-pay-merchant-id"); when(configuration.getAndroidPay()).thenReturn(androidPayConfiguration); BraintreeApi braintreeApi = new BraintreeApi(mContext, mock(ClientToken.class), configuration, mock(HttpRequest.class)); Bundle tokenizationParameters = braintreeApi.getAndroidPayTokenizationParameters().getParameters(); assertEquals("braintree", tokenizationParameters.getString("gateway")); assertEquals(configuration.getMerchantId(), tokenizationParameters.getString( "braintree:merchantId")); assertEquals(androidPayConfiguration.getGoogleAuthorizationFingerprint(), tokenizationParameters.getString("braintree:authorizationFingerprint")); assertEquals("v1", tokenizationParameters.getString("braintree:apiVersion")); assertEquals(BuildConfig.VERSION_NAME, tokenizationParameters.getString( "braintree:sdkVersion")); } public void testGetConfigurationReturnsConfigurationAsAString() { Configuration configuration = Configuration.fromJson(new TestClientTokenBuilder().build()); BraintreeApi braintreeApi = new BraintreeApi(mContext, mock(ClientToken.class), configuration, mock(HttpRequest.class)); String configurationString = braintreeApi.getConfigurationString(); assertEquals(new Gson().toJson(configuration), configurationString); } public void testGetConfigurationReturnsNullIfConfigurationIsNull() { BraintreeApi braintreeApi = new BraintreeApi(mContext, mock(ClientToken.class), null, mock(HttpRequest.class)); String configurationString = braintreeApi.getConfigurationString(); assertNull(configurationString); } }
{ "content_hash": "29150c439a527df59818d92fde03eea0", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 108, "avg_line_length": 46.01546391752577, "alnum_prop": 0.7309286434412456, "repo_name": "marviktintor/braintree_android", "id": "01e7451ae9590948237e320e3756fb366a85d332", "size": "8927", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "BraintreeApi/src/androidTest/java/com/braintreepayments/api/BraintreeApiTest.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "623404" }, { "name": "Ruby", "bytes": "7608" }, { "name": "Shell", "bytes": "3124" } ], "symlink_target": "" }
// // AppDelegate.m // JoinShow // // Created by Heaven on 13-6-26. // Copyright (c) 2013年 Heaven. All rights reserved. // #import "AppDelegate.h" #import "ConfigManager.h" #import "XYApplicationWorkspace.h" @implementation AppDelegate - (void)dealloc { } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { /* self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization after application launch. self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease]; self.window.rootViewController = self.viewController; [self.window makeKeyAndVisible]; */ #pragma mark - some test return YES; } - (void)applicationWillResignActive:(UIApplication *)application { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } - (void)applicationDidEnterBackground:(UIApplication *)application { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - (void)applicationWillEnterForeground:(UIApplication *)application { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } - (void)applicationDidBecomeActive:(UIApplication *)application { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } - (void)applicationWillTerminate:(UIApplication *)application { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } @end
{ "content_hash": "ef55c49224a944ebfb3d01061e204563", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 281, "avg_line_length": 40.35, "alnum_prop": 0.7662123089632383, "repo_name": "HelloZhu/XYQuick", "id": "aec6558bc49eb4aff52188b32f236137e3829de7", "size": "2423", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "JoinShow/AppDelegate.m", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "31868" }, { "name": "C++", "bytes": "6055" }, { "name": "Objective-C", "bytes": "801327" }, { "name": "Ruby", "bytes": "1469" } ], "symlink_target": "" }
package com.google.android.apps.forscience.whistlepunk.devicemanager; import static org.junit.Assert.assertTrue; /** Little utility class for when you want to be sure a callback was called. */ public class TestFlag { private boolean set = false; private String title; public TestFlag(String title) { this.title = title; } public void set() { set = true; } public void assertSet() { assertTrue(title, set); } }
{ "content_hash": "0e528951b05f41e5134dd3218b63557f", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 79, "avg_line_length": 20.181818181818183, "alnum_prop": 0.6981981981981982, "repo_name": "googlearchive/science-journal", "id": "37c5461be2900f0817d91dd515edb06b6c16e80a", "size": "1069", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "OpenScienceJournal/whistlepunk_library/src/robolectricTest/java/com/google/android/apps/forscience/whistlepunk/devicemanager/TestFlag.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "30945" }, { "name": "Java", "bytes": "3424733" }, { "name": "Shell", "bytes": "897" }, { "name": "Starlark", "bytes": "493" } ], "symlink_target": "" }
package koala.dynamicjava.tree; import java.util.List; import koala.dynamicjava.tree.visitor.Visitor; /** * This class represents the array allocation nodes of the syntax tree * * @author Stephane Hillion * @version 1.0 - 1999/04/25 */ public class ArrayAllocation extends Allocation { /** * The type descriptor */ private TypeDescriptor typeDescriptor; /** * Initializes the expression * @param tp the type prefix * @param td the type descriptor * @exception IllegalArgumentException if tp is null or td is null */ public ArrayAllocation(Type tp, TypeDescriptor td) { this(tp, td, null, 0, 0, 0, 0); } /** * Initializes the expression * @param tp the type prefix * @param td the type descriptor * @param fn the filename * @param bl the begin line * @param bc the begin column * @param el the end line * @param ec the end column * @exception IllegalArgumentException if tp is null or td is null */ public ArrayAllocation(Type tp, TypeDescriptor td, String fn, int bl, int bc, int el, int ec) { super(tp, fn, bl, bc, el, ec); if (td == null) throw new IllegalArgumentException("td == null"); typeDescriptor = td; td.initialize(tp); } /** * Returns the dimension of the array */ public int getDimension() { return typeDescriptor.dimension; } /** * Returns the size expressions */ public List getSizes() { return typeDescriptor.sizes; } /** * Returns the initialization expression */ public ArrayInitializer getInitialization() { return typeDescriptor.initialization; } /** * Allows a visitor to traverse the tree * @param visitor the visitor to accept */ public Object acceptVisitor(Visitor visitor) { return visitor.visit(this); } /** * This class contains informations about the array to create */ public static class TypeDescriptor { /** * The array dimension sizes */ List sizes; /** * The array dimension */ int dimension; /** * The initialization expression */ ArrayInitializer initialization; /** * The end line */ public int endLine; /** * The end column */ public int endColumn; /** * Creates a new type descriptor */ public TypeDescriptor(List sizes, int dim, ArrayInitializer init, int el, int ec) { this.sizes = sizes; dimension = dim; initialization = init; endLine = el; endColumn = ec; } /** * Initializes the type descriptor */ void initialize(Type t) { if (initialization != null) { Type et = (dimension > 1) ? new ArrayType(t, dimension - 1, /* Jeliot 3: added - 1 because otherwise dimension of component types is too large. */ t.getFilename(), t.getBeginLine(), t.getBeginColumn(), endLine, endColumn) : t; initialization.setElementType(et); } } } }
{ "content_hash": "7b65a8ed9c1c2c11e54287fa625a82c5", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 162, "avg_line_length": 25.88235294117647, "alnum_prop": 0.5326704545454546, "repo_name": "moegyver/mJeliot", "id": "8c82f12ffb96239f0f35741ce509e2d5d503c55d", "size": "4867", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Jeliot/src/koala/dynamicjava/tree/ArrayAllocation.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1377" }, { "name": "HTML", "bytes": "32900" }, { "name": "Java", "bytes": "4367108" }, { "name": "Makefile", "bytes": "445" }, { "name": "PostScript", "bytes": "3218210" }, { "name": "Shell", "bytes": "929" }, { "name": "TeX", "bytes": "7367140" } ], "symlink_target": "" }
//--------------------------------------------------------------------------- // E L E N A P r o j e c t: ELENA Compiler // // This header contains ELENA Source Reader class declaration. // // (C)2021-2022, by Aleksey Rakov //--------------------------------------------------------------------------- #ifndef SOURCE_H #define SOURCE_H #include "textparser.h" namespace elena_lang { struct SourceInfo { LineInfo lineInfo; char state; ustr_t symbol; SourceInfo() { state = 0; } }; // --- SourceReader --- class SourceReader : protected TextParser<char, LINE_LEN> { bool _operatorMode; void copyToken(char* token, size_t length); //inline void resolveDotAmbiguity(SourceInfo& info) //{ // char state = info.state; // size_t rollback = _position; // nextColumn(); // char endState = TextParser::read(dfaDotStart, info.state, info.lineInfo); // // rollback if lookahead fails // if (endState == dfaBack) { // _position = rollback; // info.state = state; // } //} bool IsOperator(char state) { return (state == dfaOperator || state == dfaDblOperator/* || state == dfaAltOperator*/); } void resolveSignAmbiguity(SourceInfo& info) { // if it is not preceeded by an operator if (!_operatorMode) { info.state = dfaOperator; } // otherwise check if it could be part of numeric constant else { pos_t rollback = _position; pos_t rollbackStart = _startPosition; char terminalState = TextParser::read(dfaSignStart, info.state, info.lineInfo); // rollback if lookahead fails if (terminalState == dfaBack) { _position = rollback; info.state = dfaOperator; } //// resolve dot ambiguity //else if (terminalState == dfaDotLookahead) { // resolveDotAmbiguity(info); //} _startPosition = rollbackStart; } } public: SourceInfo read(char* line, size_t length); SourceReader(int tabSize, UStrReader* source); }; } #endif
{ "content_hash": "5c91d1b9174bf3b5fd0f902c22baf339", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 97, "avg_line_length": 26.5, "alnum_prop": 0.5030017152658662, "repo_name": "ELENA-LANG/elena-lang", "id": "059aae71607867032de01162cc8ce23bf437e98f", "size": "2332", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "elenasrc3/elc/source.h", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "427595" }, { "name": "Batchfile", "bytes": "17411" }, { "name": "C", "bytes": "240219" }, { "name": "C++", "bytes": "5507075" }, { "name": "CMake", "bytes": "74552" }, { "name": "Common Lisp", "bytes": "4874" }, { "name": "Erlang", "bytes": "92" }, { "name": "HLSL", "bytes": "1472" }, { "name": "Inno Setup", "bytes": "4732" }, { "name": "JavaScript", "bytes": "26566" }, { "name": "Lex", "bytes": "776945" }, { "name": "Makefile", "bytes": "210487" }, { "name": "Roff", "bytes": "24643" }, { "name": "Shell", "bytes": "8949" } ], "symlink_target": "" }
<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>Info Center &ndash; License</title> <style type="text/css"> @import "main.css"; </style> <style type="text/css"> @import "tabs.css"; </style> <script type="text/javascript" src="niftycube.js"></script> <script type="text/javascript"> window.onload=function(){ Nifty("div#box","small"); } </script> </head> <body> <div id="tabsH"> <ul> <li><a href="home.html"><span> Home</span></a></li> <li><a href="help.html"><span>Help</span></a></li> <li><a href="tips.html"><span>Tips &amp; Tricks</span></a></li> <li><a href="faqs.html"><span>FAQs</span></a></li> <li><a href="issues.html"><span>Known Issues</span></a></li> <li><a href="credits.html"><span>Credits</span></a> </li> <li id="current"><a href="#"><span>License</span></a></li> </ul> </div> <div id="box"> <p> <b>License</b><br/><br/> Copyright (c) 2007 Danny Espinoza<br/><br/> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:<br/><br/> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.<br/><br/> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. </p> </div> </body> </html>
{ "content_hash": "498be1c6b4d4eae937e5a0952f078e41", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 461, "avg_line_length": 41.3469387755102, "alnum_prop": 0.7058242843040474, "repo_name": "mesadynamics/hypercube-all", "id": "3fb215a81147fa27ded7f0181611e6b815c66f25", "size": "2026", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web/hypercube/info/license.html", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "8335" }, { "name": "C#", "bytes": "939812" }, { "name": "C++", "bytes": "1292" }, { "name": "JavaScript", "bytes": "157507" }, { "name": "Objective-C", "bytes": "762522" }, { "name": "PHP", "bytes": "1010970" }, { "name": "Perl", "bytes": "5009" } ], "symlink_target": "" }
/*! \file CommonSMC.hpp \brief General interface to define a sliding mode actuator */ #ifndef CommonSMC_H #define CommonSMC_H #include "Actuator.hpp" #include "SiconosAlgebraTypeDef.hpp" #include "SiconosFwd.hpp" #include <relay_cst.h> class CommonSMC : public Actuator { private: /** serialization hooks */ ACCEPT_SERIALIZATION(CommonSMC); protected: /** default constructor */ CommonSMC() {}; /** index for saving data */ unsigned int _indx; /** name of the plugin to add a term to the sliding variable; useful when doing trajectory tracking */ std::string _plugineName; /** name of the plugin to compute \f$y = h(x, ...)\f$ for the nonlinear case*/ std::string _pluginhName; /** name of the plugin to compute \f$\nabla_x h\f$ for the nonlinear case*/ std::string _pluginJachxName; /** name of the plugin to compute \f$\nabla_\lambda h\f$ for the nonlinear case*/ std::string _pluginJachlambdaName; /** name of the plugin to compute \f$\nabla_\lambda g\f$ for the nonlinear case*/ std::string _pluginJacglambdaName; /** the vector defining the linear contribution of the state to the sliding variable (\f$ \sigma = Cx \f$) */ SP::SimpleMatrix _Csurface; /** matrix describing the influence of \f$lambda\f$ on \f$\sigma\f$ */ SP::SimpleMatrix _D; /** scalar multiplying Sign; \f$ u^s = - \alpha Sign \f$ */ double _alpha; /** the Relation for the Controller */ SP::FirstOrderR _relationSMC; /** Interaction for the control */ SP::Interaction _interactionSMC; /** easy access to lambda */ SP::SiconosVector _lambda; /** Relay solver type */ int _numericsSolverId; /** Numerical precision expected for the Relay solver */ double _precision; /** the nsds for the controller */ SP::NonSmoothDynamicalSystem _nsdsSMC; /** the DynamicalSystem for the controller */ SP::FirstOrderNonLinearDS _DS_SMC; // XXX replace this by FirstOrderDS /** the TimeDiscretisation for the controller */ SP::TimeDiscretisation _td; /** Simulation for the controller */ SP::TimeStepping _simulationSMC; /** Integrator for the controller */ SP::OneStepIntegrator _integratorSMC; /** Theta for the controller */ double _thetaSMC; /** OneStepNsProblem for the controller */ SP::LinearOSNS _OSNSPB_SMC; /** SP::EventsManager of the SMC Simulation */ SP::EventsManager _eventsManager; /** SP::NonSmoothLaw for computing the control law */ SP::NonSmoothLaw _nsLawSMC; /** inverse of CB */ SP::SimpleMatrix _invCB; /** Store \f$u^{eq}\f$ */ SP::SiconosVector _ueq; /** Store \f$u^s\f$ */ SP::SiconosVector _us; /** Do not use the state-continuous equivaluent control \f$u^{eq}\f$ */ bool _noUeq; /** If true perform the computation of the residus in the Newton loop if needed */ bool _computeResidus; /** Compute the equivalent part of the control \f$u^{eq}\f$. * The method used here is to discretize the continuous-time * formula using a theta method */ void computeUeq(); public: /**General constructor * \param type the type of the SMC Actuator * \param sensor the ControlSensor feeding the Actuator */ CommonSMC(unsigned int type, SP::ControlSensor sensor): Actuator(type, sensor), _indx(0), _alpha(1.0), _numericsSolverId(SICONOS_RELAY_AVI_CAOFERRIS), _precision(1e-8), _thetaSMC(0.5), _noUeq(false), _computeResidus(true) {} /** Constructor for dynamics affine in control * \param type the type of the SMC Actuator * \param sensor the ControlSensor feeding the Actuator * \param B the matrix multiplying the control input * \param D the saturation matrix (optional) */ CommonSMC(unsigned int type, SP::ControlSensor sensor, SP::SimpleMatrix B, SP::SimpleMatrix D = std11::shared_ptr<SimpleMatrix>()): Actuator(type, sensor, B), _indx(0), _D(D), _alpha(1.0), _numericsSolverId(SICONOS_RELAY_AVI_CAOFERRIS), _precision(1e-8), _thetaSMC(0.5), _noUeq(false), _computeResidus(true) {} /** Compute the new control law at each event */ virtual void actuate() = 0; /** Initialization * \param nsds current nonsmooth dynamical system * \param s current simulation setup */ virtual void initialize(const NonSmoothDynamicalSystem& nsds, const Simulation& s); void sete(const std::string& plugin); void seth(const std::string& plugin); void setJachx(const std::string& plugin); void setJachlambda(const std::string& plugin); void setg(const std::string& plugin); void setJacgx(const std::string& plugin); void setJacglambda(const std::string& plugin); /** Set Csurface * \param Csurface a SP::SimpleMatrix containing the new value for _Csurface */ void setCsurface(SP::SimpleMatrix Csurface); /** Set _D to pointer newPtr * \param newSat a SP::SimpleMatrix containing the new value for _D */ void setSaturationMatrix(SP::SimpleMatrix newSat); /** Set _alpha * \param alpha the new value for _alpha */ inline void setAlpha(double alpha) { _alpha = alpha; }; /** get _lambda * \return a pointer to _lambda */ inline SP::SiconosVector lambda() const { return _lambda; }; /** Set the solver * \param numericsSolverId the solver for the relay */ inline void setSolver(const int numericsSolverId) { _numericsSolverId = numericsSolverId; }; /** Set the precision * \param newPrecision a double */ inline void setPrecision(double newPrecision) { _precision = newPrecision; }; /** Get the OneStepNSProblem problem associated with the controller. This is useful to * gain access to the data given to the solver in Numerics * \return a reference to the LinearOSNS problem */ inline const LinearOSNS& relay() { return * _OSNSPB_SMC; }; /** get \f$u^{eq}\f$ * \return a reference to _ueq */ inline SiconosVector& ueq() { return *_ueq; }; /** get \f$u^{s}\f$ * \return a reference to _us */ inline SiconosVector& us() { return *_us; }; /** Set _theta, used in some discretization method for \f$u^{eq}\f$ * \param newTheta the new value for _thetaSMC */ inline void setTheta(double newTheta) { _thetaSMC = newTheta; }; /** Disable (or enable) the use of the state-continuous control \f$u^{eq}\f$ * \param b disable the use of Ueq if true */ inline void noUeq(bool b) { _noUeq = b; }; /** Disable (or enable) the computation of the residus on the Newton loop. * This has an incidence only if the Relation is nonlinear * \param b disable the computation of the residus */ inline void setComputeResidus(bool b) { _computeResidus = b; }; /** This is derived in child classes if they need to copy the TimeDiscretisation * associated with this Sensor * \param td the TimeDiscretisation for this Sensor */ virtual void setTimeDiscretisation(const TimeDiscretisation& td); /** Set the DynamicalSystem used to compute the control law. * This is useful when we have a Nonlinear problem and we need to compute * the control law with an approximate model, or when the dynamics are * quite different. * \param ds the DynamicalSystem to be used in the Controller */ void setDS(SP::FirstOrderNonLinearDS ds) // XXX replace this by FirstOrderDS { _DS_SMC = ds; }; /** get the NSDS used in the SMC * \return the NSDS used in the SMC */ virtual SP::NonSmoothDynamicalSystem getInternalNSDS() const { return _nsdsSMC; }; /** get the Integrator used in the SMC * \return the Integrator used in the SMC */ OneStepIntegrator& getInternalOSI() const { return *_integratorSMC; }; }; #endif
{ "content_hash": "9ce08eb905cc16aa6cbe1410b5ecdfe5", "timestamp": "", "source": "github", "line_count": 275, "max_line_length": 133, "avg_line_length": 27.829090909090908, "alnum_prop": 0.6806481118515615, "repo_name": "fperignon/siconos", "id": "4fb805655c7d6974a15096b3bed1059fe5e1a9e4", "size": "8343", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "control/src/Controller/CommonSMC.hpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2725" }, { "name": "C", "bytes": "4861202" }, { "name": "C++", "bytes": "9363519" }, { "name": "CMake", "bytes": "514834" }, { "name": "CSS", "bytes": "12791" }, { "name": "Dockerfile", "bytes": "233" }, { "name": "Fortran", "bytes": "2539066" }, { "name": "GAMS", "bytes": "5614" }, { "name": "HTML", "bytes": "4331842" }, { "name": "Makefile", "bytes": "12197" }, { "name": "Nix", "bytes": "3086" }, { "name": "Python", "bytes": "1479527" }, { "name": "Shell", "bytes": "50594" } ], "symlink_target": "" }
import numpy as np from jax.util import safe_map, safe_zip from jax.core import Primitive from jax.interpreters import ad, xla, batching, numpy_eval from jax.lax import dynamic_update_slice_p map = safe_map zip = safe_zip inplace_dynamic_update_slice_p = Primitive('inplace_dynamic_update_slice') inplace_dynamic_update_slice_p.def_impl(dynamic_update_slice_p.impl) inplace_dynamic_update_slice_p.def_abstract_eval(dynamic_update_slice_p.abstract_eval) for rules in [xla.translations, ad.primitive_jvps, ad.primitive_transposes, batching.primitive_batchers]: rules[inplace_dynamic_update_slice_p] = rules[dynamic_update_slice_p] def _numpy_inplace_dynamic_update_slice(operand, update, *start_indices): slices = tuple(map(slice, start_indices, np.add(start_indices, update.shape))) operand[slices] = update return operand numpy_eval.np_impl[inplace_dynamic_update_slice_p] = \ _numpy_inplace_dynamic_update_slice def inplace_dynamic_update_slice(operand, update, start_indices): return inplace_dynamic_update_slice_p.bind(operand, update, *start_indices)
{ "content_hash": "bd303d698db87f71c350bb313e61d1b6", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 86, "avg_line_length": 41.76923076923077, "alnum_prop": 0.7707182320441989, "repo_name": "j-towns/fastar", "id": "f10ebf7713d70345c61827454dab1e807016ca19", "size": "1086", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "fastar/numpy_eval_util.py", "mode": "33188", "license": "mit", "language": [ { "name": "Haskell", "bytes": "3069" }, { "name": "Python", "bytes": "64620" } ], "symlink_target": "" }
package com.ksa.shiro.freemarker; /** * <p>Equivalent to {@link org.apache.shiro.web.tags.LacksRoleTag}</p> */ public class LacksRoleTag extends RoleTag { protected boolean showTagBody(String roleName) { boolean hasRole = getSubject() != null && getSubject().hasRole(roleName); return !hasRole; } }
{ "content_hash": "271ca1af87d65b545606c7f7ba7e48ae", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 81, "avg_line_length": 29.636363636363637, "alnum_prop": 0.6840490797546013, "repo_name": "xsocket/ksa", "id": "990b17021e20055ad0c93bda8017a2afcbd378ab", "size": "326", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "ksa-web-core/src/main/java/com/ksa/shiro/freemarker/LacksRoleTag.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "86030" }, { "name": "FreeMarker", "bytes": "2053573" }, { "name": "Java", "bytes": "1062168" }, { "name": "JavaScript", "bytes": "891324" }, { "name": "Shell", "bytes": "217" } ], "symlink_target": "" }
package com.bladecoder.ink.runtime; class DivertTargetValue extends Value<Path> { public DivertTargetValue() { super(null); } public DivertTargetValue(Path targetPath) { super(targetPath); } @Override public AbstractValue cast(ValueType newType) throws Exception { if (newType == getValueType()) return this; throw BadCastException (newType); } @Override public boolean isTruthy() throws Exception { throw new Exception("Shouldn't be checking the truthiness of a divert target"); } public Path getTargetPath() { return this.getValue(); } @Override public ValueType getValueType() { return ValueType.DivertTarget; } public void setTargetPath(Path value) { this.setValue(value); } @Override public String toString() { return "DivertTargetValue(" + getTargetPath() + ")"; } }
{ "content_hash": "53b31f8af442f7f101b51b35c512c648", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 81, "avg_line_length": 20.186046511627907, "alnum_prop": 0.6866359447004609, "repo_name": "bladecoder/blade-ink", "id": "4cdedd43def4c3a36bfa34cd9dbda093a7e9add9", "size": "868", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/bladecoder/ink/runtime/DivertTargetValue.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "447563" } ], "symlink_target": "" }
<x-meta id="paper-input" label="Quantum Paper Input" group="Paper"> <template> <paper-input label="Type something..."></paper-input> </template> <template id="imports"> <link rel="import" href="paper-input.html"> </template> </x-meta>
{ "content_hash": "fdb14c7a5660da741df523e75f025b3a", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 67, "avg_line_length": 23.454545454545453, "alnum_prop": 0.6356589147286822, "repo_name": "stevelacy/polymer-pen", "id": "e299962d3eb24e61c6d25fb09e0ebcf53b14190e", "size": "258", "binary": false, "copies": "16", "ref": "refs/heads/master", "path": "public/components/paper-dialog/metadata.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "332457" }, { "name": "CoffeeScript", "bytes": "1638" }, { "name": "JavaScript", "bytes": "1415350" }, { "name": "Python", "bytes": "31040" }, { "name": "Shell", "bytes": "13208" } ], "symlink_target": "" }
package org.apache.flink.client.cli; import org.apache.flink.api.common.ExecutionConfig; import org.apache.flink.api.common.InvalidProgramException; import org.apache.flink.api.common.JobExecutionResult; import org.apache.flink.api.common.JobID; import org.apache.flink.api.common.JobSubmissionResult; import org.apache.flink.api.common.accumulators.AccumulatorHelper; import org.apache.flink.api.dag.Pipeline; import org.apache.flink.client.ClientUtils; import org.apache.flink.client.FlinkPipelineTranslationUtil; import org.apache.flink.client.deployment.ClusterDescriptor; import org.apache.flink.client.deployment.ClusterSpecification; import org.apache.flink.client.program.ClusterClient; import org.apache.flink.client.program.PackagedProgram; import org.apache.flink.client.program.PackagedProgramUtils; import org.apache.flink.client.program.ProgramInvocationException; import org.apache.flink.client.program.ProgramMissingJobException; import org.apache.flink.client.program.ProgramParametrizationException; import org.apache.flink.configuration.ConfigConstants; import org.apache.flink.configuration.Configuration; import org.apache.flink.configuration.CoreOptions; import org.apache.flink.configuration.GlobalConfiguration; import org.apache.flink.configuration.JobManagerOptions; import org.apache.flink.configuration.RestOptions; import org.apache.flink.core.fs.FileSystem; import org.apache.flink.core.plugin.PluginUtils; import org.apache.flink.runtime.akka.AkkaUtils; import org.apache.flink.runtime.client.JobStatusMessage; import org.apache.flink.runtime.jobgraph.JobGraph; import org.apache.flink.runtime.jobgraph.JobStatus; import org.apache.flink.runtime.messages.Acknowledge; import org.apache.flink.runtime.security.SecurityConfiguration; import org.apache.flink.runtime.security.SecurityUtils; import org.apache.flink.runtime.util.EnvironmentInformation; import org.apache.flink.util.ExceptionUtils; import org.apache.flink.util.FlinkException; import org.apache.flink.util.Preconditions; import org.apache.flink.util.ShutdownHookUtil; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.Options; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.FileNotFoundException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.UndeclaredThrowableException; import java.net.InetSocketAddress; import java.net.URL; import java.text.SimpleDateFormat; import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Comparator; import java.util.Date; import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; /** * Implementation of a simple command line frontend for executing programs. */ public class CliFrontend { private static final Logger LOG = LoggerFactory.getLogger(CliFrontend.class); // actions private static final String ACTION_RUN = "run"; private static final String ACTION_INFO = "info"; private static final String ACTION_LIST = "list"; private static final String ACTION_CANCEL = "cancel"; private static final String ACTION_STOP = "stop"; private static final String ACTION_SAVEPOINT = "savepoint"; // configuration dir parameters private static final String CONFIG_DIRECTORY_FALLBACK_1 = "../conf"; private static final String CONFIG_DIRECTORY_FALLBACK_2 = "conf"; // -------------------------------------------------------------------------------------------- private final Configuration configuration; private final List<CustomCommandLine<?>> customCommandLines; private final Options customCommandLineOptions; private final Duration clientTimeout; private final int defaultParallelism; public CliFrontend( Configuration configuration, List<CustomCommandLine<?>> customCommandLines) { this.configuration = Preconditions.checkNotNull(configuration); this.customCommandLines = Preconditions.checkNotNull(customCommandLines); FileSystem.initialize(configuration, PluginUtils.createPluginManagerFromRootFolder(configuration)); this.customCommandLineOptions = new Options(); for (CustomCommandLine<?> customCommandLine : customCommandLines) { customCommandLine.addGeneralOptions(customCommandLineOptions); customCommandLine.addRunOptions(customCommandLineOptions); } this.clientTimeout = AkkaUtils.getClientTimeout(this.configuration); this.defaultParallelism = configuration.getInteger(CoreOptions.DEFAULT_PARALLELISM); } // -------------------------------------------------------------------------------------------- // Getter & Setter // -------------------------------------------------------------------------------------------- /** * Getter which returns a copy of the associated configuration. * * @return Copy of the associated configuration */ public Configuration getConfiguration() { Configuration copiedConfiguration = new Configuration(); copiedConfiguration.addAll(configuration); return copiedConfiguration; } public Options getCustomCommandLineOptions() { return customCommandLineOptions; } // -------------------------------------------------------------------------------------------- // Execute Actions // -------------------------------------------------------------------------------------------- /** * Executions the run action. * * @param args Command line arguments for the run action. */ protected void run(String[] args) throws Exception { LOG.info("Running 'run' command."); final Options commandOptions = CliFrontendParser.getRunCommandOptions(); final Options commandLineOptions = CliFrontendParser.mergeOptions(commandOptions, customCommandLineOptions); final CommandLine commandLine = CliFrontendParser.parse(commandLineOptions, args, true); final RunOptions runOptions = new RunOptions(commandLine); // evaluate help flag if (runOptions.isPrintHelp()) { CliFrontendParser.printHelpForRun(customCommandLines); return; } if (!runOptions.isPython()) { // Java program should be specified a JAR file if (runOptions.getJarFilePath() == null) { throw new CliArgsException("Java program should be specified a JAR file."); } } final PackagedProgram program; try { LOG.info("Building program from JAR file"); program = buildProgram(runOptions); } catch (FileNotFoundException e) { throw new CliArgsException("Could not build the program from JAR file.", e); } final CustomCommandLine<?> customCommandLine = getActiveCustomCommandLine(commandLine); try { runProgram(customCommandLine, commandLine, runOptions, program); } finally { program.deleteExtractedLibraries(); } } private <T> void runProgram( CustomCommandLine<T> customCommandLine, CommandLine commandLine, RunOptions runOptions, PackagedProgram program) throws ProgramInvocationException, FlinkException { final ClusterDescriptor<T> clusterDescriptor = customCommandLine.createClusterDescriptor(commandLine); try { final T clusterId = customCommandLine.getClusterId(commandLine); final ClusterClient<T> client; // directly deploy the job if the cluster is started in job mode and detached if (clusterId == null && runOptions.getDetachedMode()) { int parallelism = runOptions.getParallelism() == -1 ? defaultParallelism : runOptions.getParallelism(); final JobGraph jobGraph = PackagedProgramUtils.createJobGraph(program, configuration, parallelism); final ClusterSpecification clusterSpecification = customCommandLine.getClusterSpecification(commandLine); client = clusterDescriptor.deployJobCluster( clusterSpecification, jobGraph, runOptions.getDetachedMode()); logAndSysout("Job has been submitted with JobID " + jobGraph.getJobID()); try { client.close(); } catch (Exception e) { LOG.info("Could not properly shut down the client.", e); } } else { final Thread shutdownHook; if (clusterId != null) { client = clusterDescriptor.retrieve(clusterId); shutdownHook = null; } else { // also in job mode we have to deploy a session cluster because the job // might consist of multiple parts (e.g. when using collect) final ClusterSpecification clusterSpecification = customCommandLine.getClusterSpecification(commandLine); client = clusterDescriptor.deploySessionCluster(clusterSpecification); // if not running in detached mode, add a shutdown hook to shut down cluster if client exits // there's a race-condition here if cli is killed before shutdown hook is installed if (!runOptions.getDetachedMode() && runOptions.isShutdownOnAttachedExit()) { shutdownHook = ShutdownHookUtil.addShutdownHook(client::shutDownCluster, client.getClass().getSimpleName(), LOG); } else { shutdownHook = null; } } try { client.setDetached(runOptions.getDetachedMode()); LOG.debug("{}", runOptions.getSavepointRestoreSettings()); int userParallelism = runOptions.getParallelism(); LOG.debug("User parallelism is set to {}", userParallelism); if (ExecutionConfig.PARALLELISM_DEFAULT == userParallelism) { userParallelism = defaultParallelism; } executeProgram(program, client, userParallelism); } finally { if (clusterId == null && !client.isDetached()) { // terminate the cluster only if we have started it before and if it's not detached try { client.shutDownCluster(); } catch (final Exception e) { LOG.info("Could not properly terminate the Flink cluster.", e); } if (shutdownHook != null) { // we do not need the hook anymore as we have just tried to shutdown the cluster. ShutdownHookUtil.removeShutdownHook(shutdownHook, client.getClass().getSimpleName(), LOG); } } try { client.close(); } catch (Exception e) { LOG.info("Could not properly shut down the client.", e); } } } } finally { try { clusterDescriptor.close(); } catch (Exception e) { LOG.info("Could not properly close the cluster descriptor.", e); } } } /** * Executes the info action. * * @param args Command line arguments for the info action. */ protected void info(String[] args) throws CliArgsException, FileNotFoundException, ProgramInvocationException { LOG.info("Running 'info' command."); final Options commandOptions = CliFrontendParser.getInfoCommandOptions(); final CommandLine commandLine = CliFrontendParser.parse(commandOptions, args, true); InfoOptions infoOptions = new InfoOptions(commandLine); // evaluate help flag if (infoOptions.isPrintHelp()) { CliFrontendParser.printHelpForInfo(); return; } if (infoOptions.getJarFilePath() == null) { throw new CliArgsException("The program JAR file was not specified."); } // -------- build the packaged program ------------- LOG.info("Building program from JAR file"); final PackagedProgram program = buildProgram(infoOptions); try { int parallelism = infoOptions.getParallelism(); if (ExecutionConfig.PARALLELISM_DEFAULT == parallelism) { parallelism = defaultParallelism; } LOG.info("Creating program plan dump"); Pipeline pipeline = PackagedProgramUtils.getPipelineFromProgram(program, parallelism); String jsonPlan = FlinkPipelineTranslationUtil.translateToJSONExecutionPlan(pipeline); if (jsonPlan != null) { System.out.println("----------------------- Execution Plan -----------------------"); System.out.println(jsonPlan); System.out.println("--------------------------------------------------------------"); } else { System.out.println("JSON plan could not be generated."); } String description = program.getDescription(); if (description != null) { System.out.println(); System.out.println(description); } else { System.out.println(); System.out.println("No description provided."); } } finally { program.deleteExtractedLibraries(); } } /** * Executes the list action. * * @param args Command line arguments for the list action. */ protected void list(String[] args) throws Exception { LOG.info("Running 'list' command."); final Options commandOptions = CliFrontendParser.getListCommandOptions(); final Options commandLineOptions = CliFrontendParser.mergeOptions(commandOptions, customCommandLineOptions); final CommandLine commandLine = CliFrontendParser.parse(commandLineOptions, args, false); ListOptions listOptions = new ListOptions(commandLine); // evaluate help flag if (listOptions.isPrintHelp()) { CliFrontendParser.printHelpForList(customCommandLines); return; } final boolean showRunning; final boolean showScheduled; final boolean showAll; // print running and scheduled jobs if not option supplied if (!listOptions.showRunning() && !listOptions.showScheduled() && !listOptions.showAll()) { showRunning = true; showScheduled = true; showAll = false; } else { showRunning = listOptions.showRunning(); showScheduled = listOptions.showScheduled(); showAll = listOptions.showAll(); } final CustomCommandLine<?> activeCommandLine = getActiveCustomCommandLine(commandLine); runClusterAction( activeCommandLine, commandLine, clusterClient -> listJobs(clusterClient, showRunning, showScheduled, showAll)); } private <T> void listJobs( ClusterClient<T> clusterClient, boolean showRunning, boolean showScheduled, boolean showAll) throws FlinkException { Collection<JobStatusMessage> jobDetails; try { CompletableFuture<Collection<JobStatusMessage>> jobDetailsFuture = clusterClient.listJobs(); logAndSysout("Waiting for response..."); jobDetails = jobDetailsFuture.get(); } catch (Exception e) { Throwable cause = ExceptionUtils.stripExecutionException(e); throw new FlinkException("Failed to retrieve job list.", cause); } LOG.info("Successfully retrieved list of jobs"); final List<JobStatusMessage> runningJobs = new ArrayList<>(); final List<JobStatusMessage> scheduledJobs = new ArrayList<>(); final List<JobStatusMessage> terminatedJobs = new ArrayList<>(); jobDetails.forEach(details -> { if (details.getJobState() == JobStatus.CREATED) { scheduledJobs.add(details); } else if (!details.getJobState().isGloballyTerminalState()) { runningJobs.add(details); } else { terminatedJobs.add(details); } }); if (showRunning || showAll) { if (runningJobs.size() == 0) { System.out.println("No running jobs."); } else { System.out.println("------------------ Running/Restarting Jobs -------------------"); printJobStatusMessages(runningJobs); System.out.println("--------------------------------------------------------------"); } } if (showScheduled || showAll) { if (scheduledJobs.size() == 0) { System.out.println("No scheduled jobs."); } else { System.out.println("----------------------- Scheduled Jobs -----------------------"); printJobStatusMessages(scheduledJobs); System.out.println("--------------------------------------------------------------"); } } if (showAll) { if (terminatedJobs.size() != 0) { System.out.println("---------------------- Terminated Jobs -----------------------"); printJobStatusMessages(terminatedJobs); System.out.println("--------------------------------------------------------------"); } } } private static void printJobStatusMessages(List<JobStatusMessage> jobs) { SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); Comparator<JobStatusMessage> startTimeComparator = (o1, o2) -> (int) (o1.getStartTime() - o2.getStartTime()); Comparator<Map.Entry<JobStatus, List<JobStatusMessage>>> statusComparator = (o1, o2) -> String.CASE_INSENSITIVE_ORDER.compare(o1.getKey().toString(), o2.getKey().toString()); Map<JobStatus, List<JobStatusMessage>> jobsByState = jobs.stream().collect(Collectors.groupingBy(JobStatusMessage::getJobState)); jobsByState.entrySet().stream() .sorted(statusComparator) .map(Map.Entry::getValue).flatMap(List::stream).sorted(startTimeComparator) .forEachOrdered(job -> System.out.println(dateFormat.format(new Date(job.getStartTime())) + " : " + job.getJobId() + " : " + job.getJobName() + " (" + job.getJobState() + ")")); } /** * Executes the STOP action. * * @param args Command line arguments for the stop action. */ protected void stop(String[] args) throws Exception { LOG.info("Running 'stop-with-savepoint' command."); final Options commandOptions = CliFrontendParser.getStopCommandOptions(); final Options commandLineOptions = CliFrontendParser.mergeOptions(commandOptions, customCommandLineOptions); final CommandLine commandLine = CliFrontendParser.parse(commandLineOptions, args, false); final StopOptions stopOptions = new StopOptions(commandLine); if (stopOptions.isPrintHelp()) { CliFrontendParser.printHelpForStop(customCommandLines); return; } final String[] cleanedArgs = stopOptions.getArgs(); final String targetDirectory = stopOptions.hasSavepointFlag() && cleanedArgs.length > 0 ? stopOptions.getTargetDirectory() : null; // the default savepoint location is going to be used in this case. final JobID jobId = cleanedArgs.length != 0 ? parseJobId(cleanedArgs[0]) : parseJobId(stopOptions.getTargetDirectory()); final boolean advanceToEndOfEventTime = stopOptions.shouldAdvanceToEndOfEventTime(); logAndSysout((advanceToEndOfEventTime ? "Draining job " : "Suspending job ") + "\"" + jobId + "\" with a savepoint."); final CustomCommandLine<?> activeCommandLine = getActiveCustomCommandLine(commandLine); runClusterAction( activeCommandLine, commandLine, clusterClient -> { final String savepointPath; try { savepointPath = clusterClient.stopWithSavepoint(jobId, advanceToEndOfEventTime, targetDirectory); } catch (Exception e) { throw new FlinkException("Could not stop with a savepoint job \"" + jobId + "\".", e); } logAndSysout("Savepoint completed. Path: " + savepointPath); }); } /** * Executes the CANCEL action. * * @param args Command line arguments for the cancel action. */ protected void cancel(String[] args) throws Exception { LOG.info("Running 'cancel' command."); final Options commandOptions = CliFrontendParser.getCancelCommandOptions(); final Options commandLineOptions = CliFrontendParser.mergeOptions(commandOptions, customCommandLineOptions); final CommandLine commandLine = CliFrontendParser.parse(commandLineOptions, args, false); CancelOptions cancelOptions = new CancelOptions(commandLine); // evaluate help flag if (cancelOptions.isPrintHelp()) { CliFrontendParser.printHelpForCancel(customCommandLines); return; } final CustomCommandLine<?> activeCommandLine = getActiveCustomCommandLine(commandLine); final String[] cleanedArgs = cancelOptions.getArgs(); if (cancelOptions.isWithSavepoint()) { logAndSysout("DEPRECATION WARNING: Cancelling a job with savepoint is deprecated. Use \"stop\" instead."); final JobID jobId; final String targetDirectory; if (cleanedArgs.length > 0) { jobId = parseJobId(cleanedArgs[0]); targetDirectory = cancelOptions.getSavepointTargetDirectory(); } else { jobId = parseJobId(cancelOptions.getSavepointTargetDirectory()); targetDirectory = null; } if (targetDirectory == null) { logAndSysout("Cancelling job " + jobId + " with savepoint to default savepoint directory."); } else { logAndSysout("Cancelling job " + jobId + " with savepoint to " + targetDirectory + '.'); } runClusterAction( activeCommandLine, commandLine, clusterClient -> { final String savepointPath; try { savepointPath = clusterClient.cancelWithSavepoint(jobId, targetDirectory); } catch (Exception e) { throw new FlinkException("Could not cancel job " + jobId + '.', e); } logAndSysout("Cancelled job " + jobId + ". Savepoint stored in " + savepointPath + '.'); }); } else { final JobID jobId; if (cleanedArgs.length > 0) { jobId = parseJobId(cleanedArgs[0]); } else { throw new CliArgsException("Missing JobID. Specify a JobID to cancel a job."); } logAndSysout("Cancelling job " + jobId + '.'); runClusterAction( activeCommandLine, commandLine, clusterClient -> { try { clusterClient.cancel(jobId); } catch (Exception e) { throw new FlinkException("Could not cancel job " + jobId + '.', e); } }); logAndSysout("Cancelled job " + jobId + '.'); } } /** * Executes the SAVEPOINT action. * * @param args Command line arguments for the savepoint action. */ protected void savepoint(String[] args) throws Exception { LOG.info("Running 'savepoint' command."); final Options commandOptions = CliFrontendParser.getSavepointCommandOptions(); final Options commandLineOptions = CliFrontendParser.mergeOptions(commandOptions, customCommandLineOptions); final CommandLine commandLine = CliFrontendParser.parse(commandLineOptions, args, false); final SavepointOptions savepointOptions = new SavepointOptions(commandLine); // evaluate help flag if (savepointOptions.isPrintHelp()) { CliFrontendParser.printHelpForSavepoint(customCommandLines); return; } final CustomCommandLine<?> activeCommandLine = getActiveCustomCommandLine(commandLine); if (savepointOptions.isDispose()) { runClusterAction( activeCommandLine, commandLine, clusterClient -> disposeSavepoint(clusterClient, savepointOptions.getSavepointPath())); } else { String[] cleanedArgs = savepointOptions.getArgs(); final JobID jobId; if (cleanedArgs.length >= 1) { String jobIdString = cleanedArgs[0]; jobId = parseJobId(jobIdString); } else { throw new CliArgsException("Missing JobID. " + "Specify a Job ID to trigger a savepoint."); } final String savepointDirectory; if (cleanedArgs.length >= 2) { savepointDirectory = cleanedArgs[1]; } else { savepointDirectory = null; } // Print superfluous arguments if (cleanedArgs.length >= 3) { logAndSysout("Provided more arguments than required. Ignoring not needed arguments."); } runClusterAction( activeCommandLine, commandLine, clusterClient -> triggerSavepoint(clusterClient, jobId, savepointDirectory)); } } /** * Sends a SavepointTriggerMessage to the job manager. */ private String triggerSavepoint(ClusterClient<?> clusterClient, JobID jobId, String savepointDirectory) throws FlinkException { logAndSysout("Triggering savepoint for job " + jobId + '.'); CompletableFuture<String> savepointPathFuture = clusterClient.triggerSavepoint(jobId, savepointDirectory); logAndSysout("Waiting for response..."); final String savepointPath; try { savepointPath = savepointPathFuture.get(); } catch (Exception e) { Throwable cause = ExceptionUtils.stripExecutionException(e); throw new FlinkException("Triggering a savepoint for the job " + jobId + " failed.", cause); } logAndSysout("Savepoint completed. Path: " + savepointPath); logAndSysout("You can resume your program from this savepoint with the run command."); return savepointPath; } /** * Sends a SavepointDisposalRequest to the job manager. */ private void disposeSavepoint(ClusterClient<?> clusterClient, String savepointPath) throws FlinkException { Preconditions.checkNotNull(savepointPath, "Missing required argument: savepoint path. " + "Usage: bin/flink savepoint -d <savepoint-path>"); logAndSysout("Disposing savepoint '" + savepointPath + "'."); final CompletableFuture<Acknowledge> disposeFuture = clusterClient.disposeSavepoint(savepointPath); logAndSysout("Waiting for response..."); try { disposeFuture.get(clientTimeout.toMillis(), TimeUnit.MILLISECONDS); } catch (Exception e) { throw new FlinkException("Disposing the savepoint '" + savepointPath + "' failed.", e); } logAndSysout("Savepoint '" + savepointPath + "' disposed."); } // -------------------------------------------------------------------------------------------- // Interaction with programs and JobManager // -------------------------------------------------------------------------------------------- protected void executeProgram(PackagedProgram program, ClusterClient<?> client, int parallelism) throws ProgramMissingJobException, ProgramInvocationException { logAndSysout("Starting execution of program"); JobSubmissionResult result = ClientUtils.executeProgram(client, program, parallelism); if (result.isJobExecutionResult()) { logAndSysout("Program execution finished"); JobExecutionResult execResult = result.getJobExecutionResult(); System.out.println("Job with JobID " + execResult.getJobID() + " has finished."); System.out.println("Job Runtime: " + execResult.getNetRuntime() + " ms"); Map<String, Object> accumulatorsResult = execResult.getAllAccumulatorResults(); if (accumulatorsResult.size() > 0) { System.out.println("Accumulator Results: "); System.out.println(AccumulatorHelper.getResultsFormatted(accumulatorsResult)); } } else { logAndSysout("Job has been submitted with JobID " + result.getJobID()); } } /** * Creates a Packaged program from the given command line options. * * @return A PackagedProgram (upon success) */ PackagedProgram buildProgram(ProgramOptions options) throws FileNotFoundException, ProgramInvocationException { String[] programArgs = options.getProgramArgs(); String jarFilePath = options.getJarFilePath(); List<URL> classpaths = options.getClasspaths(); // Get assembler class String entryPointClass = options.getEntryPointClassName(); File jarFile = null; if (options.isPython()) { // If the job is specified a jar file if (jarFilePath != null) { jarFile = getJarFile(jarFilePath); } // If the job is Python Shell job, the entry point class name is PythonGateWayServer. // Otherwise, the entry point class of python job is PythonDriver if (entryPointClass == null) { entryPointClass = "org.apache.flink.client.python.PythonDriver"; } } else { if (jarFilePath == null) { throw new IllegalArgumentException("Java program should be specified a JAR file."); } jarFile = getJarFile(jarFilePath); } PackagedProgram program = entryPointClass == null ? new PackagedProgram(jarFile, classpaths, programArgs) : new PackagedProgram(jarFile, classpaths, entryPointClass, programArgs); program.setSavepointRestoreSettings(options.getSavepointRestoreSettings()); return program; } /** * Gets the JAR file from the path. * * @param jarFilePath The path of JAR file * @return The JAR file * @throws FileNotFoundException The JAR file does not exist. */ private File getJarFile(String jarFilePath) throws FileNotFoundException { File jarFile = new File(jarFilePath); // Check if JAR file exists if (!jarFile.exists()) { throw new FileNotFoundException("JAR file does not exist: " + jarFile); } else if (!jarFile.isFile()) { throw new FileNotFoundException("JAR file is not a file: " + jarFile); } return jarFile; } // -------------------------------------------------------------------------------------------- // Logging and Exception Handling // -------------------------------------------------------------------------------------------- /** * Displays an exception message for incorrect command line arguments. * * @param e The exception to display. * @return The return code for the process. */ private static int handleArgException(CliArgsException e) { LOG.error("Invalid command line arguments.", e); System.out.println(e.getMessage()); System.out.println(); System.out.println("Use the help option (-h or --help) to get help on the command."); return 1; } /** * Displays an optional exception message for incorrect program parametrization. * * @param e The exception to display. * @return The return code for the process. */ private static int handleParametrizationException(ProgramParametrizationException e) { LOG.error("Program has not been parametrized properly.", e); System.err.println(e.getMessage()); return 1; } /** * Displays a message for a program without a job to execute. * * @return The return code for the process. */ private static int handleMissingJobException() { System.err.println(); System.err.println("The program didn't contain a Flink job. " + "Perhaps you forgot to call execute() on the execution environment."); return 1; } /** * Displays an exception message. * * @param t The exception to display. * @return The return code for the process. */ private static int handleError(Throwable t) { LOG.error("Error while running the command.", t); System.err.println(); System.err.println("------------------------------------------------------------"); System.err.println(" The program finished with the following exception:"); System.err.println(); if (t.getCause() instanceof InvalidProgramException) { System.err.println(t.getCause().getMessage()); StackTraceElement[] trace = t.getCause().getStackTrace(); for (StackTraceElement ele: trace) { System.err.println("\t" + ele); if (ele.getMethodName().equals("main")) { break; } } } else { t.printStackTrace(); } return 1; } private static void logAndSysout(String message) { LOG.info(message); System.out.println(message); } // -------------------------------------------------------------------------------------------- // Internal methods // -------------------------------------------------------------------------------------------- private JobID parseJobId(String jobIdString) throws CliArgsException { if (jobIdString == null) { throw new CliArgsException("Missing JobId"); } final JobID jobId; try { jobId = JobID.fromHexString(jobIdString); } catch (IllegalArgumentException e) { throw new CliArgsException(e.getMessage()); } return jobId; } /** * Retrieves the {@link ClusterClient} from the given {@link CustomCommandLine} and runs the given * {@link ClusterAction} against it. * * @param activeCommandLine to create the {@link ClusterDescriptor} from * @param commandLine containing the parsed command line options * @param clusterAction the cluster action to run against the retrieved {@link ClusterClient}. * @param <T> type of the cluster id * @throws FlinkException if something goes wrong */ private <T> void runClusterAction(CustomCommandLine<T> activeCommandLine, CommandLine commandLine, ClusterAction<T> clusterAction) throws FlinkException { final ClusterDescriptor<T> clusterDescriptor = activeCommandLine.createClusterDescriptor(commandLine); final T clusterId = activeCommandLine.getClusterId(commandLine); if (clusterId == null) { throw new FlinkException("No cluster id was specified. Please specify a cluster to which " + "you would like to connect."); } else { try { final ClusterClient<T> clusterClient = clusterDescriptor.retrieve(clusterId); try { clusterAction.runAction(clusterClient); } finally { try { clusterClient.close(); } catch (Exception e) { LOG.info("Could not properly shut down the cluster client.", e); } } } finally { try { clusterDescriptor.close(); } catch (Exception e) { LOG.info("Could not properly close the cluster descriptor.", e); } } } } /** * Internal interface to encapsulate cluster actions which are executed via * the {@link ClusterClient}. * * @param <T> type of the cluster id */ @FunctionalInterface private interface ClusterAction<T> { /** * Run the cluster action with the given {@link ClusterClient}. * * @param clusterClient to run the cluster action against * @throws FlinkException if something goes wrong */ void runAction(ClusterClient<T> clusterClient) throws FlinkException; } // -------------------------------------------------------------------------------------------- // Entry point for executable // -------------------------------------------------------------------------------------------- /** * Parses the command line arguments and starts the requested action. * * @param args command line arguments of the client. * @return The return code of the program */ public int parseParameters(String[] args) { // check for action if (args.length < 1) { CliFrontendParser.printHelp(customCommandLines); System.out.println("Please specify an action."); return 1; } // get action String action = args[0]; // remove action from parameters final String[] params = Arrays.copyOfRange(args, 1, args.length); try { // do action switch (action) { case ACTION_RUN: run(params); return 0; case ACTION_LIST: list(params); return 0; case ACTION_INFO: info(params); return 0; case ACTION_CANCEL: cancel(params); return 0; case ACTION_STOP: stop(params); return 0; case ACTION_SAVEPOINT: savepoint(params); return 0; case "-h": case "--help": CliFrontendParser.printHelp(customCommandLines); return 0; case "-v": case "--version": String version = EnvironmentInformation.getVersion(); String commitID = EnvironmentInformation.getRevisionInformation().commitId; System.out.print("Version: " + version); System.out.println(commitID.equals(EnvironmentInformation.UNKNOWN) ? "" : ", Commit ID: " + commitID); return 0; default: System.out.printf("\"%s\" is not a valid action.\n", action); System.out.println(); System.out.println("Valid actions are \"run\", \"list\", \"info\", \"savepoint\", \"stop\", or \"cancel\"."); System.out.println(); System.out.println("Specify the version option (-v or --version) to print Flink version."); System.out.println(); System.out.println("Specify the help option (-h or --help) to get help on the command."); return 1; } } catch (CliArgsException ce) { return handleArgException(ce); } catch (ProgramParametrizationException ppe) { return handleParametrizationException(ppe); } catch (ProgramMissingJobException pmje) { return handleMissingJobException(); } catch (Exception e) { return handleError(e); } } /** * Submits the job based on the arguments. */ public static void main(final String[] args) { EnvironmentInformation.logEnvironmentInfo(LOG, "Command Line Client", args); // 1. find the configuration directory final String configurationDirectory = getConfigurationDirectoryFromEnv(); // 2. load the global configuration final Configuration configuration = GlobalConfiguration.loadConfiguration(configurationDirectory); // 3. load the custom command lines final List<CustomCommandLine<?>> customCommandLines = loadCustomCommandLines( configuration, configurationDirectory); try { final CliFrontend cli = new CliFrontend( configuration, customCommandLines); SecurityUtils.install(new SecurityConfiguration(cli.configuration)); int retCode = SecurityUtils.getInstalledContext() .runSecured(() -> cli.parseParameters(args)); System.exit(retCode); } catch (Throwable t) { final Throwable strippedThrowable = ExceptionUtils.stripException(t, UndeclaredThrowableException.class); LOG.error("Fatal error while running command line interface.", strippedThrowable); strippedThrowable.printStackTrace(); System.exit(31); } } // -------------------------------------------------------------------------------------------- // Miscellaneous Utilities // -------------------------------------------------------------------------------------------- public static String getConfigurationDirectoryFromEnv() { String location = System.getenv(ConfigConstants.ENV_FLINK_CONF_DIR); if (location != null) { if (new File(location).exists()) { return location; } else { throw new RuntimeException("The configuration directory '" + location + "', specified in the '" + ConfigConstants.ENV_FLINK_CONF_DIR + "' environment variable, does not exist."); } } else if (new File(CONFIG_DIRECTORY_FALLBACK_1).exists()) { location = CONFIG_DIRECTORY_FALLBACK_1; } else if (new File(CONFIG_DIRECTORY_FALLBACK_2).exists()) { location = CONFIG_DIRECTORY_FALLBACK_2; } else { throw new RuntimeException("The configuration directory was not specified. " + "Please specify the directory containing the configuration file through the '" + ConfigConstants.ENV_FLINK_CONF_DIR + "' environment variable."); } return location; } /** * Writes the given job manager address to the associated configuration object. * * @param address Address to write to the configuration * @param config The configuration to write to */ static void setJobManagerAddressInConfig(Configuration config, InetSocketAddress address) { config.setString(JobManagerOptions.ADDRESS, address.getHostString()); config.setInteger(JobManagerOptions.PORT, address.getPort()); config.setString(RestOptions.ADDRESS, address.getHostString()); config.setInteger(RestOptions.PORT, address.getPort()); } public static List<CustomCommandLine<?>> loadCustomCommandLines(Configuration configuration, String configurationDirectory) { List<CustomCommandLine<?>> customCommandLines = new ArrayList<>(2); // Command line interface of the YARN session, with a special initialization here // to prefix all options with y/yarn. // Tips: DefaultCLI must be added at last, because getActiveCustomCommandLine(..) will get the // active CustomCommandLine in order and DefaultCLI isActive always return true. final String flinkYarnSessionCLI = "org.apache.flink.yarn.cli.FlinkYarnSessionCli"; try { customCommandLines.add( loadCustomCommandLine(flinkYarnSessionCLI, configuration, configurationDirectory, "y", "yarn")); } catch (NoClassDefFoundError | Exception e) { LOG.warn("Could not load CLI class {}.", flinkYarnSessionCLI, e); } customCommandLines.add(new DefaultCLI(configuration)); return customCommandLines; } // -------------------------------------------------------------------------------------------- // Custom command-line // -------------------------------------------------------------------------------------------- /** * Gets the custom command-line for the arguments. * @param commandLine The input to the command-line. * @return custom command-line which is active (may only be one at a time) */ public CustomCommandLine<?> getActiveCustomCommandLine(CommandLine commandLine) { for (CustomCommandLine<?> cli : customCommandLines) { if (cli.isActive(commandLine)) { return cli; } } throw new IllegalStateException("No command-line ran."); } /** * Loads a class from the classpath that implements the CustomCommandLine interface. * @param className The fully-qualified class name to load. * @param params The constructor parameters */ private static CustomCommandLine<?> loadCustomCommandLine(String className, Object... params) throws IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, NoSuchMethodException { Class<? extends CustomCommandLine> customCliClass = Class.forName(className).asSubclass(CustomCommandLine.class); // construct class types from the parameters Class<?>[] types = new Class<?>[params.length]; for (int i = 0; i < params.length; i++) { Preconditions.checkNotNull(params[i], "Parameters for custom command-lines may not be null."); types[i] = params[i].getClass(); } Constructor<? extends CustomCommandLine> constructor = customCliClass.getConstructor(types); return constructor.newInstance(params); } }
{ "content_hash": "72f6a865eeaa73cacd62b214533b4f92", "timestamp": "", "source": "github", "line_count": 1167, "max_line_length": 224, "avg_line_length": 34.51413881748072, "alnum_prop": 0.6902775708823675, "repo_name": "mbode/flink", "id": "85892279c3fe1955c98089708a2180e7f632581e", "size": "41083", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5666" }, { "name": "CSS", "bytes": "18100" }, { "name": "Clojure", "bytes": "80170" }, { "name": "CoffeeScript", "bytes": "91220" }, { "name": "Dockerfile", "bytes": "9756" }, { "name": "HTML", "bytes": "86821" }, { "name": "Java", "bytes": "40396270" }, { "name": "JavaScript", "bytes": "8267" }, { "name": "Python", "bytes": "249644" }, { "name": "Scala", "bytes": "7495458" }, { "name": "Shell", "bytes": "388738" } ], "symlink_target": "" }
namespace Microsoft.DotNet.Cli.Build { public class Version { public virtual int Major { get; set; } public virtual int Minor { get; set; } public virtual int Patch { get; set; } public virtual int CommitCount { get; set; } public virtual string CommitCountString => CommitCount.ToString("000000"); public virtual string ReleaseSuffix { get; set; } public string GenerateMsiVersion() { // MSI versioning // Encode the CLI version to fit into the MSI versioning scheme - https://msdn.microsoft.com/en-us/library/windows/desktop/aa370859(v=vs.85).aspx // MSI versions are 3 part // major.minor.build // Size(bits) of each part 8 8 16 // So we have 32 bits to encode the CLI version // Starting with most significant bit this how the CLI version is going to be encoded as MSI Version // CLI major -> 6 bits // CLI minor -> 6 bits // CLI patch -> 6 bits // CLI commitcount -> 14 bits var major = Major << 26; var minor = Minor << 20; var patch = Patch << 14; var msiVersionNumber = major | minor | patch | CommitCount; var msiMajor = (msiVersionNumber >> 24) & 0xFF; var msiMinor = (msiVersionNumber >> 16) & 0xFF; var msiBuild = msiVersionNumber & 0xFFFF; return $"{msiMajor}.{msiMinor}.{msiBuild}"; } } }
{ "content_hash": "05720a331e7a8749d1bed3a53f2ff09c", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 157, "avg_line_length": 42.108108108108105, "alnum_prop": 0.5571245186136072, "repo_name": "blackdwarf/cli", "id": "cc2ec209b9265c61b608a3a98d522477dc2e401e", "size": "1733", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "build_projects/shared-build-targets-utils/Utils/Version.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1852" }, { "name": "C#", "bytes": "2800378" }, { "name": "CSS", "bytes": "1654" }, { "name": "F#", "bytes": "2697" }, { "name": "Groovy", "bytes": "2945" }, { "name": "HTML", "bytes": "14024" }, { "name": "JavaScript", "bytes": "2358" }, { "name": "PowerShell", "bytes": "46085" }, { "name": "Shell", "bytes": "59290" }, { "name": "Smalltalk", "bytes": "108" }, { "name": "Visual Basic", "bytes": "7232" } ], "symlink_target": "" }
module Stupidedi module Versions module ThirtyFifty s = Schema r = ElementReqs FunctionalGroupDef = Class.new(Schema::FunctionalGroupDef) do # @return [FunctionalGroupVal] def empty Values::FunctionalGroupVal.new(self, []) end # @return [Module] def segment_dict SegmentDefs end end.new "003050", [ SegmentDefs::GS.use(1, r::Mandatory, s::RepeatCount.bounded(1)) ], [ SegmentDefs::GE.use(2, r::Mandatory, s::RepeatCount.bounded(1)) ] end end end
{ "content_hash": "964501c4b0fac6c52fc36da0b4342f3e", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 76, "avg_line_length": 24.73913043478261, "alnum_prop": 0.5940246045694201, "repo_name": "irobayna/stupidedi", "id": "2ec999ef7f3bcf47ded8bcb5bea719b9221d78cb", "size": "599", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/stupidedi/versions/003050/functional_group_def.rb", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "HTML", "bytes": "1322" }, { "name": "Ruby", "bytes": "5576439" } ], "symlink_target": "" }
/* $NetBSD: pmap.h,v 1.26 1999/02/25 21:54:53 is Exp $ */ /* * Copyright (c) 1987 Carnegie-Mellon University * Copyright (c) 1991 Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * the Systems Programming Group of the University of Utah Computer * Science Department. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)pmap.h 7.6 (Berkeley) 5/10/91 */ #ifndef _MACHINE_PMAP_H_ #define _MACHINE_PMAP_H_ /* * Pmap stuff */ struct pmap { pt_entry_t *pm_ptab; /* KVA of page table */ st_entry_t *pm_stab; /* KVA of segment table */ int pm_stfree; /* 040: free lev2 blocks */ u_int *pm_stpa; /* 040: ST phys addr */ short pm_sref; /* segment table ref count */ short pm_count; /* pmap reference count */ long pm_ptpages; /* more stats: PT pages */ simple_lock_data_t pm_lock; /* lock on pmap */ struct pmap_statistics pm_stats; /* pmap statistics */ }; typedef struct pmap *pmap_t; /* * On the 040 we keep track of which level 2 blocks are already in use * with the pm_stfree mask. Bits are arranged from LSB (block 0) to MSB * (block 31). For convenience, the level 1 table is considered to be * block 0. * * MAX[KU]L2SIZE control how many pages of level 2 descriptors are allowed. * for the kernel and users. 16 implies only the initial "segment table" * page is used. WARNING: don't change MAXUL2SIZE unless you can allocate * physically contiguous pages for the ST in pmap.c! */ #define MAXKL2SIZE 32 #define MAXUL2SIZE 16 #define l2tobm(n) (1 << (n)) #define bmtol2(n) (ffs(n) - 1) /* * Macros for speed */ #define PMAP_ACTIVATE(pmap, loadhw) \ { \ if ((loadhw)) \ loadustp(m68k_btop((vm_offset_t)(pmap)->pm_stpa)); \ } /* * For each vm_page_t, there is a list of all currently valid virtual * mappings of that page. An entry is a pv_entry_t, the list is pv_table. */ typedef struct pv_entry { struct pv_entry *pv_next; /* next pv_entry */ struct pmap *pv_pmap; /* pmap where mapping lies */ vm_offset_t pv_va; /* virtual address for mapping */ u_int *pv_ptste; /* non-zero if VA maps a PT page */ struct pmap *pv_ptpmap; /* if pv_ptste, pmap for PT page */ int pv_flags; /* flags */ } *pv_entry_t; #define PV_CI 0x01 /* all entries must be cache inhibited */ #define PV_PTPAGE 0x02 /* entry maps a page table page */ struct pv_page; struct pv_page_info { TAILQ_ENTRY(pv_page) pgi_list; struct pv_entry *pgi_freelist; int pgi_nfree; }; /* * This is basically: * ((NBPG - sizeof(struct pv_page_info)) / sizeof(struct pv_entry)) */ #define NPVPPG 340 struct pv_page { struct pv_page_info pvp_pgi; struct pv_entry pvp_pv[NPVPPG]; }; #ifdef _KERNEL pv_entry_t pv_table; /* array of entries, one per page */ u_int *Sysmap; char *vmmap; /* map for mem, dumps, etc. */ struct pmap kernel_pmap_store; #define pmap_kernel() (&kernel_pmap_store) #define active_pmap(pm) \ ((pm) == pmap_kernel() || (pm) == curproc->p_vmspace->vm_map.pmap) #define active_user_pmap(pm) \ (curproc && \ (pm) != pmap_kernel() && (pm) == curproc->p_vmspace->vm_map.pmap) #define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count) #define pmap_wired_count(pmap) ((pmap)->pm_stats.wired_count) vm_offset_t pmap_map __P((vm_offset_t, vm_offset_t, vm_offset_t, int)); void pmap_procwr __P((struct proc *, vm_offset_t, u_long)); #define PMAP_NEED_PROCWR #endif /* _KERNEL */ #endif /* !_MACHINE_PMAP_H_ */
{ "content_hash": "4b458998d0ec930a463fa1fa7a23ecae", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 77, "avg_line_length": 35.62068965517241, "alnum_prop": 0.6999031945788964, "repo_name": "MarginC/kame", "id": "5552cf8f6d4a0e13c0c406d5e8c5d45f45c0a39a", "size": "5165", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "netbsd/sys/arch/amiga/include/pmap.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Arc", "bytes": "7491" }, { "name": "Assembly", "bytes": "14375563" }, { "name": "Awk", "bytes": "313712" }, { "name": "Batchfile", "bytes": "6819" }, { "name": "C", "bytes": "356715789" }, { "name": "C++", "bytes": "4231647" }, { "name": "DIGITAL Command Language", "bytes": "11155" }, { "name": "Emacs Lisp", "bytes": "790" }, { "name": "Forth", "bytes": "253695" }, { "name": "GAP", "bytes": "9964" }, { "name": "Groff", "bytes": "2220485" }, { "name": "Lex", "bytes": "168376" }, { "name": "Logos", "bytes": "570213" }, { "name": "Makefile", "bytes": "1778847" }, { "name": "Mathematica", "bytes": "16549" }, { "name": "Objective-C", "bytes": "529629" }, { "name": "PHP", "bytes": "11283" }, { "name": "Perl", "bytes": "151251" }, { "name": "Perl6", "bytes": "2572" }, { "name": "Ruby", "bytes": "7283" }, { "name": "Scheme", "bytes": "76872" }, { "name": "Shell", "bytes": "583253" }, { "name": "Stata", "bytes": "408" }, { "name": "Yacc", "bytes": "606054" } ], "symlink_target": "" }
using UnityEngine; namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody { [TaskCategory("Basic/Rigidbody")] [TaskDescription("Returns Success if the Rigidbody is using gravity, otherwise Failure.")] public class UseGravity : Conditional { [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] public SharedGameObject targetGameObject; // cache the rigidbody component private Rigidbody rigidbody; private GameObject prevGameObject; public override void OnStart() { var currentGameObject = GetDefaultGameObject(targetGameObject.Value); if (currentGameObject != prevGameObject) { rigidbody = currentGameObject.GetComponent<Rigidbody>(); prevGameObject = currentGameObject; } } public override TaskStatus OnUpdate() { if (rigidbody == null) { Debug.LogWarning("Rigidbody is null"); return TaskStatus.Failure; } return rigidbody.useGravity ? TaskStatus.Success : TaskStatus.Failure; } public override void OnReset() { targetGameObject = null; } } }
{ "content_hash": "fa7a7c89d3fe32ad97c94dcc38acd67f", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 99, "avg_line_length": 31.925, "alnum_prop": 0.6217697729052467, "repo_name": "yantian001/3DHunter", "id": "bb16778a4a77c3b6957fa449aebee80ba74bb438", "size": "1277", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/UseGravity.cs", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C#", "bytes": "1112193" }, { "name": "GLSL", "bytes": "3414" }, { "name": "JavaScript", "bytes": "27331" } ], "symlink_target": "" }
/* Colors */ /* Font Sizes */ /* Spacers */ /* Element Sizes */ /* Custom Fonts */ @font-face { font-family: "Helvetica"; src: font-url("helvetica.woff") format("woff"), font-url("helvetica.ttf") format("truetype"); font-weight: normal; font-style: normal; } @font-face { font-family: "Helvetica Neue"; src: font-url("helvetica_neue.woff") format("woff"), font-url("helvetica_neue.ttf") format("truetype"); font-weight: normal; font-style: normal; } /* fonts */ /* Colors */ html { background: #2e2e2e; color: whitesmoke; } html body { background: #2e2e2e; color: whitesmoke; } html body h1, html body h2, html body h3, html body h4, html body h5, html body h6 { color: #0099FF; } html body * { background: rgba(0, 0, 0, 0.01); color: whitesmoke; } html body #feature a { color: #4EC9B0; } html body #guides { background: #2e2e2e; border: #0099FF 2px solid; } html body #container { background: #2e2e2e; color: whitesmoke; } html body #container h1, html body #container h2, html body #container h3, html body #container h4, html body #container h5, html body #container h6 { color: #0099FF; } html body #container * { background: rgba(0, 0, 0, 0.01); color: whitesmoke; } html body #container #feature a { color: #4EC9B0; } html body #container #guides { background: #2e2e2e; border: #0099FF 2px solid; } html body #container a { color: #4EC9B0; } html body #container .note { background: #2e2e2e; border: #fff9d8 3px solid; } html body #container .info { background: #2e2e2e; border: #0088ff 3px solid; } html body #container .warning { background: #2e2e2e; border: #aa0000 3px solid; } html body #container .code_container { background: #2e2e2e; border: #4EC9B0 3px solid; } html body #container .code_container .code { background: #2e2e2e; } html body #container .code_container .code .container { background: #2e2e2e !important; } html body #container .code_container .code .container .line.alt2, html body #container .code_container .code .container .line.alt1 { background: #2e2e2e !important; } html body #container .code_container .code .container .ruby.keyword { color: #0099FF !important; } html body #container .code_container .code .container .ruby.plain { color: whitesmoke !important; } html body #container .code_container .code .container .ruby.string { color: #D69D85 !important; } html body #container .code_container .code .container .ruby.comments { color: #57A64A !important; } html body #container .code_container .code .container .ruby.color2 { color: #4EC9B0 !important; } html body #container .code_container .code .container .ruby.variable { color: whitesmoke !important; } html body #container .code_container .code .container .ruby.script { color: #9EFFFF !important; } html body #container .code_container .code .container .plain.plain { color: whitesmoke !important; } html body #container .code_container .code .container .sql.keyword { color: #0099FF !important; } html body #container .code_container .code .container .sql.plain { color: whitesmoke !important; } html body #feature { background: #4f4f4f; } html body #header { background: #1e1e1e; } html body #subCol { background: #1e1e1e; } html body #subCol .chapters { background: rgba(0, 0, 0, 0.01); } html body #subCol ul > li > a > code { color: #4EC9B0; } /*# sourceMappingURL=outside.css.map */
{ "content_hash": "03dce9fc3e137f9aa5dda7e55f41f94f", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 156, "avg_line_length": 40.265306122448976, "alnum_prop": 0.5978205778003041, "repo_name": "mon0051/Mirrawe", "id": "32ee5631a7aea98434add9c0a97b0eb08a14a259", "size": "3946", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/assets/stylesheets/outside.css", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "489290" }, { "name": "CoffeeScript", "bytes": "633" }, { "name": "HTML", "bytes": "19200" }, { "name": "JavaScript", "bytes": "461932" }, { "name": "Ruby", "bytes": "51958" } ], "symlink_target": "" }
'use strict'; import chai = require('chai'); import assert = chai.assert; import helper = require('../../test/helper'); import objectUtils = require('../../xm/objectUtils'); class ObjectUtilTestClass { private _propA: string = 'a'; private _propB: string = 'b'; propC: string = 'c'; propD: string = 'd'; } describe('object', () => { // TODO add tests for more methods describe('hideProps()', () => { it('should return formatted string', () => { var keys; var inst = new ObjectUtilTestClass(); keys = Object.keys(inst); assert.sameMembers(keys, ['_propA', '_propB', 'propC', 'propD'], 'before hide'); objectUtils.hideProps(inst, null, false, true); keys = Object.keys(inst); assert.sameMembers(keys, ['propC', 'propD'], 'after hide'); }); }); describe('lockProps()', () => { it('should throw when accessing frozen property', () => { var fixed = {aa: 1, bb: 2}; fixed.aa = 10; fixed.bb = 20; assert.strictEqual(fixed.aa, 10, 'before fixed.aa'); assert.strictEqual(fixed.bb, 20, 'before fixed.bb'); objectUtils.lockProps(fixed, ['aa']); assert.throws(() => { fixed.aa = 100; }, /^Cannot assign to read only property 'aa' of /); fixed.bb = 200; assert.strictEqual(fixed.aa, 10, 'after fixed.aa'); assert.strictEqual(fixed.bb, 200, 'after fixed.bb'); }); }); });
{ "content_hash": "c1c18f76bba694c249eef21dbd6c7faf", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 83, "avg_line_length": 26.333333333333332, "alnum_prop": 0.6157855547282204, "repo_name": "AbraaoAlves/tsd", "id": "55590da306ff129b80e22e26b00250ad5f58db4b", "size": "1385", "binary": false, "copies": "1", "ref": "refs/heads/dev/next", "path": "src/spec/xm/object.ts", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_121) on Mon Mar 27 10:01:25 CEST 2017 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>PropertiesParserConstants (Flowable - Engine 5.23.0 API)</title> <meta name="date" content="2017-03-27"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="PropertiesParserConstants (Flowable - Engine 5.23.0 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/PropertiesParserConstants.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/activiti/engine/dynamic/PropertiesParser.html" title="interface in org.activiti.engine.dynamic"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../org/activiti/engine/dynamic/ScriptTaskPropertiesParser.html" title="class in org.activiti.engine.dynamic"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/activiti/engine/dynamic/PropertiesParserConstants.html" target="_top">Frames</a></li> <li><a href="PropertiesParserConstants.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li>Method</li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.activiti.engine.dynamic</div> <h2 title="Interface PropertiesParserConstants" class="title">Interface PropertiesParserConstants</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Known Implementing Classes:</dt> <dd><a href="../../../../org/activiti/engine/dynamic/BasePropertiesParser.html" title="class in org.activiti.engine.dynamic">BasePropertiesParser</a>, <a href="../../../../org/activiti/engine/dynamic/DefaultPropertiesParser.html" title="class in org.activiti.engine.dynamic">DefaultPropertiesParser</a>, <a href="../../../../org/activiti/engine/dynamic/ScriptTaskPropertiesParser.html" title="class in org.activiti.engine.dynamic">ScriptTaskPropertiesParser</a>, <a href="../../../../org/activiti/engine/dynamic/UserTaskPropertiesParser.html" title="class in org.activiti.engine.dynamic">UserTaskPropertiesParser</a></dd> </dl> <hr> <br> <pre>public interface <span class="typeNameLabel">PropertiesParserConstants</span></pre> <div class="block">Created by Pardo David on 5/12/2016.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field.summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/activiti/engine/dynamic/PropertiesParserConstants.html#BPMN_MODEL_VALUE">BPMN_MODEL_VALUE</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/activiti/engine/dynamic/PropertiesParserConstants.html#DYNAMIC_VALUE">DYNAMIC_VALUE</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/activiti/engine/dynamic/PropertiesParserConstants.html#ELEMENT_ID">ELEMENT_ID</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/activiti/engine/dynamic/PropertiesParserConstants.html#ELEMENT_PROPERTIES">ELEMENT_PROPERTIES</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/activiti/engine/dynamic/PropertiesParserConstants.html#ELEMENT_TYPE">ELEMENT_TYPE</a></span></code>&nbsp;</td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field.detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="ELEMENT_ID"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ELEMENT_ID</h4> <pre>static final&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> ELEMENT_ID</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../constant-values.html#org.activiti.engine.dynamic.PropertiesParserConstants.ELEMENT_ID">Constant Field Values</a></dd> </dl> </li> </ul> <a name="ELEMENT_TYPE"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ELEMENT_TYPE</h4> <pre>static final&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> ELEMENT_TYPE</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../constant-values.html#org.activiti.engine.dynamic.PropertiesParserConstants.ELEMENT_TYPE">Constant Field Values</a></dd> </dl> </li> </ul> <a name="ELEMENT_PROPERTIES"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ELEMENT_PROPERTIES</h4> <pre>static final&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> ELEMENT_PROPERTIES</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../constant-values.html#org.activiti.engine.dynamic.PropertiesParserConstants.ELEMENT_PROPERTIES">Constant Field Values</a></dd> </dl> </li> </ul> <a name="BPMN_MODEL_VALUE"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>BPMN_MODEL_VALUE</h4> <pre>static final&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> BPMN_MODEL_VALUE</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../constant-values.html#org.activiti.engine.dynamic.PropertiesParserConstants.BPMN_MODEL_VALUE">Constant Field Values</a></dd> </dl> </li> </ul> <a name="DYNAMIC_VALUE"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>DYNAMIC_VALUE</h4> <pre>static final&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> DYNAMIC_VALUE</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../constant-values.html#org.activiti.engine.dynamic.PropertiesParserConstants.DYNAMIC_VALUE">Constant Field Values</a></dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/PropertiesParserConstants.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/activiti/engine/dynamic/PropertiesParser.html" title="interface in org.activiti.engine.dynamic"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../org/activiti/engine/dynamic/ScriptTaskPropertiesParser.html" title="class in org.activiti.engine.dynamic"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/activiti/engine/dynamic/PropertiesParserConstants.html" target="_top">Frames</a></li> <li><a href="PropertiesParserConstants.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li>Method</li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2017 <a href="http://flowable.org">Flowable</a>. All rights reserved.</small></p> </body> </html>
{ "content_hash": "2363f0d8bec932ab20c633d2540f58ed", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 621, "avg_line_length": 41.874149659863946, "alnum_prop": 0.6644464300219316, "repo_name": "dbmalkovsky/flowable-engine", "id": "fde6d3cef711d74c3fcabbd027b0efe23008a351", "size": "12311", "binary": false, "copies": "3", "ref": "refs/heads/main", "path": "docs/docusaurus/docs/assets/static/javadocs-5/org/activiti/engine/dynamic/PropertiesParserConstants.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "166" }, { "name": "CSS", "bytes": "673786" }, { "name": "Dockerfile", "bytes": "477" }, { "name": "Groovy", "bytes": "482" }, { "name": "HTML", "bytes": "1201811" }, { "name": "Handlebars", "bytes": "6004" }, { "name": "Java", "bytes": "46660725" }, { "name": "JavaScript", "bytes": "12668702" }, { "name": "Mustache", "bytes": "2383" }, { "name": "PLSQL", "bytes": "268970" }, { "name": "SQLPL", "bytes": "238673" }, { "name": "Shell", "bytes": "12773" }, { "name": "TSQL", "bytes": "19452" } ], "symlink_target": "" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("AutoFixture.NUnit2.Addins.UnitTest")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Ploeh")] [assembly: AssemblyProduct("AutoFixture.NUnit2.Addins.UnitTest")] [assembly: AssemblyCopyright("Copyright © Ploeh 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("31f6a031-86c3-412f-a267-4974b1babcba")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("3.16.5.0")] [assembly: AssemblyFileVersion("3.16.5.0")]
{ "content_hash": "3e9be6171aa56d39f3ed914ed3e2e2b1", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 40.361111111111114, "alnum_prop": 0.7508602890571232, "repo_name": "amarant/AutoFixture", "id": "1c5e8f86e695d070a877c51f94ea37163ffaf2f5", "size": "1456", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Src/AutoFixture.NUnit2.Addins.UnitTest/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "2954264" }, { "name": "F#", "bytes": "16631" }, { "name": "PowerShell", "bytes": "861" }, { "name": "Puppet", "bytes": "170" }, { "name": "Shell", "bytes": "230" }, { "name": "Smalltalk", "bytes": "2018" } ], "symlink_target": "" }
package org.onosproject.store.service; import java.util.Iterator; import java.util.Objects; import java.util.TreeMap; import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableList; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import static com.google.common.base.Preconditions.checkNotNull; /** * A {@code DocumentTree} node. */ public class TestDocumentTreeNode<V> implements DocumentTreeNode<V> { private final DocumentPath key; private Versioned<V> value; private final TreeMap<String, DocumentTreeNode<V>> children = Maps.newTreeMap(); private final DocumentTreeNode<V> parent; public TestDocumentTreeNode(DocumentPath key, V value, long version, DocumentTreeNode<V> parent) { this.key = checkNotNull(key); this.value = new Versioned<>(value, version); this.parent = parent; } @Override public DocumentPath path() { return key; } @Override public Versioned<V> value() { return value; } @Override public Iterator<DocumentTreeNode<V>> children() { return ImmutableList.copyOf(children.values()).iterator(); } @Override public DocumentTreeNode<V> child(String name) { return children.get(name); } public DocumentTreeNode<V> parent() { return parent; } /** * Adds a new child only if one does not exist with the name. * @param name relative path name of the child node * @param newValue new value to set * @param newVersion new version to set * @return previous value; can be {@code null} if no child currently exists with that relative path name. * a non null return value indicates child already exists and no modification occurred. */ public Versioned<V> addChild(String name, V newValue, long newVersion) { TestDocumentTreeNode<V> child = (TestDocumentTreeNode<V>) children.get(name); if (child != null) { return child.value(); } children.put(name, new TestDocumentTreeNode<>(new DocumentPath(name, path()), newValue, newVersion, this)); return null; } /** * Updates the node value. * * @param newValue new value to set * @param newVersion new version to set * @return previous value */ public Versioned<V> update(V newValue, long newVersion) { Versioned<V> previousValue = value; value = new Versioned<>(newValue, newVersion); return previousValue; } /** * Removes a child node. * * @param name the name of child node to be removed * @return {@code true} if the child set was modified as a result of this call, {@code false} otherwise */ public boolean removeChild(String name) { return children.remove(name) != null; } @Override public int hashCode() { return Objects.hash(this.key); } @Override public boolean equals(Object obj) { if (obj instanceof TestDocumentTreeNode) { TestDocumentTreeNode<V> that = (TestDocumentTreeNode<V>) obj; if (this.parent.equals(that.parent)) { if (this.children.size() == that.children.size()) { return Sets.symmetricDifference(this.children.keySet(), that.children.keySet()).isEmpty(); } } } return false; } @Override public String toString() { MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(getClass()) .add("parent", this.parent) .add("key", this.key) .add("value", this.value); for (DocumentTreeNode<V> child : children.values()) { helper = helper.add("child", "\n" + child.path().pathElements() .get(child.path().pathElements().size() - 1) + " : " + child.value()); } return helper.toString(); } }
{ "content_hash": "c1686d248a53d3cf5dc8f1b32c7645e9", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 115, "avg_line_length": 30.734848484848484, "alnum_prop": 0.6144934680798619, "repo_name": "oplinkoms/onos", "id": "665355fbbbba52d963e72ef851efdc4f4cb9c2b6", "size": "4674", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "core/api/src/test/java/org/onosproject/store/service/TestDocumentTreeNode.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "364443" }, { "name": "Dockerfile", "bytes": "2443" }, { "name": "HTML", "bytes": "319812" }, { "name": "Java", "bytes": "46767333" }, { "name": "JavaScript", "bytes": "4022973" }, { "name": "Makefile", "bytes": "1658" }, { "name": "P4", "bytes": "171319" }, { "name": "Python", "bytes": "977954" }, { "name": "Ruby", "bytes": "8615" }, { "name": "Shell", "bytes": "336303" }, { "name": "TypeScript", "bytes": "894995" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <shape> <solid android:color="#ffffffff" /> <corners android:topLeftRadius="2dp" android:topRightRadius="2dp" android:bottomLeftRadius="2dp" android:bottomRightRadius="2dp"/> </shape> </item> </layer-list>
{ "content_hash": "5d1718cc99a3ef87ecf6055ae2fb7f72", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 72, "avg_line_length": 27.5, "alnum_prop": 0.5409090909090909, "repo_name": "BTPJ/Operation", "id": "145692feb1d28978a3cfbee774a3f671fd08ffdb", "size": "440", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "res/drawable-hdpi/fillet_shape_background_with_white_corner_size_2.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "640793" } ], "symlink_target": "" }
'use strict'; /** * @license Angular v14.0.0-next.5 * (c) 2010-2022 Google LLC. https://angular.io/ * License: MIT */ (function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ Zone.__load_patch('bluebird', function (global, Zone, api) { // TODO: @JiaLiPassion, we can automatically patch bluebird // if global.Promise = Bluebird, but sometimes in nodejs, // global.Promise is not Bluebird, and Bluebird is just be // used by other libraries such as sequelize, so I think it is // safe to just expose a method to patch Bluebird explicitly var BLUEBIRD = 'bluebird'; Zone[Zone.__symbol__(BLUEBIRD)] = function patchBluebird(Bluebird) { // patch method of Bluebird.prototype which not using `then` internally var bluebirdApis = ['then', 'spread', 'finally']; bluebirdApis.forEach(function (bapi) { api.patchMethod(Bluebird.prototype, bapi, function (delegate) { return function (self, args) { var zone = Zone.current; var _loop_1 = function (i) { var func = args[i]; if (typeof func === 'function') { args[i] = function () { var argSelf = this; var argArgs = arguments; return new Bluebird(function (res, rej) { zone.scheduleMicroTask('Promise.then', function () { try { res(func.apply(argSelf, argArgs)); } catch (error) { rej(error); } }); }); }; } }; for (var i = 0; i < args.length; i++) { _loop_1(i); } return delegate.apply(self, args); }; }); }); if (typeof window !== 'undefined') { window.addEventListener('unhandledrejection', function (event) { var error = event.detail && event.detail.reason; if (error && error.isHandledByZone) { event.preventDefault(); if (typeof event.stopImmediatePropagation === 'function') { event.stopImmediatePropagation(); } } }); } else if (typeof process !== 'undefined') { process.on('unhandledRejection', function (reason, p) { if (reason && reason.isHandledByZone) { var listeners_1 = process.listeners('unhandledRejection'); if (listeners_1) { // remove unhandledRejection listeners so the callback // will not be triggered. process.removeAllListeners('unhandledRejection'); process.nextTick(function () { listeners_1.forEach(function (listener) { return process.on('unhandledRejection', listener); }); }); } } }); } Bluebird.onPossiblyUnhandledRejection(function (e, promise) { try { Zone.current.runGuarded(function () { e.isHandledByZone = true; throw e; }); } catch (err) { err.isHandledByZone = false; api.onUnhandledError(err); } }); // override global promise global.Promise = Bluebird; }; }); }));
{ "content_hash": "f0295617ba550efd35f98f3661ee8bd7", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 128, "avg_line_length": 44.7979797979798, "alnum_prop": 0.4322435174746336, "repo_name": "cdnjs/cdnjs", "id": "4039416bd047c7e1384b3b5675cd405775d6e845", "size": "4435", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ajax/libs/zone.js/0.11.5/zone-bluebird.js", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
/* -*- buffer-read-only: t -*- vi: set ro: */ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Locking in multithreaded situations. Copyright (C) 2005-2011 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Bruno Haible <bruno@clisp.org>, 2005. Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h, gthr-win32.h. */ #include <config.h> #include "glthread/lock.h" /* ========================================================================= */ #if USE_POSIX_THREADS /* -------------------------- gl_lock_t datatype -------------------------- */ /* ------------------------- gl_rwlock_t datatype ------------------------- */ # if HAVE_PTHREAD_RWLOCK # if !defined PTHREAD_RWLOCK_INITIALIZER int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock) { int err; err = pthread_rwlock_init (&lock->rwlock, NULL); if (err != 0) return err; lock->initialized = 1; return 0; } int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock) { if (!lock->initialized) { int err; err = pthread_mutex_lock (&lock->guard); if (err != 0) return err; if (!lock->initialized) { err = glthread_rwlock_init_multithreaded (lock); if (err != 0) { pthread_mutex_unlock (&lock->guard); return err; } } err = pthread_mutex_unlock (&lock->guard); if (err != 0) return err; } return pthread_rwlock_rdlock (&lock->rwlock); } int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock) { if (!lock->initialized) { int err; err = pthread_mutex_lock (&lock->guard); if (err != 0) return err; if (!lock->initialized) { err = glthread_rwlock_init_multithreaded (lock); if (err != 0) { pthread_mutex_unlock (&lock->guard); return err; } } err = pthread_mutex_unlock (&lock->guard); if (err != 0) return err; } return pthread_rwlock_wrlock (&lock->rwlock); } int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock) { if (!lock->initialized) return EINVAL; return pthread_rwlock_unlock (&lock->rwlock); } int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock) { int err; if (!lock->initialized) return EINVAL; err = pthread_rwlock_destroy (&lock->rwlock); if (err != 0) return err; lock->initialized = 0; return 0; } # endif # else int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock) { int err; err = pthread_mutex_init (&lock->lock, NULL); if (err != 0) return err; err = pthread_cond_init (&lock->waiting_readers, NULL); if (err != 0) return err; err = pthread_cond_init (&lock->waiting_writers, NULL); if (err != 0) return err; lock->waiting_writers_count = 0; lock->runcount = 0; return 0; } int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock) { int err; err = pthread_mutex_lock (&lock->lock); if (err != 0) return err; /* Test whether only readers are currently running, and whether the runcount field will not overflow. */ /* POSIX says: "It is implementation-defined whether the calling thread acquires the lock when a writer does not hold the lock and there are writers blocked on the lock." Let's say, no: give the writers a higher priority. */ while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0)) { /* This thread has to wait for a while. Enqueue it among the waiting_readers. */ err = pthread_cond_wait (&lock->waiting_readers, &lock->lock); if (err != 0) { pthread_mutex_unlock (&lock->lock); return err; } } lock->runcount++; return pthread_mutex_unlock (&lock->lock); } int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock) { int err; err = pthread_mutex_lock (&lock->lock); if (err != 0) return err; /* Test whether no readers or writers are currently running. */ while (!(lock->runcount == 0)) { /* This thread has to wait for a while. Enqueue it among the waiting_writers. */ lock->waiting_writers_count++; err = pthread_cond_wait (&lock->waiting_writers, &lock->lock); if (err != 0) { lock->waiting_writers_count--; pthread_mutex_unlock (&lock->lock); return err; } lock->waiting_writers_count--; } lock->runcount--; /* runcount becomes -1 */ return pthread_mutex_unlock (&lock->lock); } int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock) { int err; err = pthread_mutex_lock (&lock->lock); if (err != 0) return err; if (lock->runcount < 0) { /* Drop a writer lock. */ if (!(lock->runcount == -1)) { pthread_mutex_unlock (&lock->lock); return EINVAL; } lock->runcount = 0; } else { /* Drop a reader lock. */ if (!(lock->runcount > 0)) { pthread_mutex_unlock (&lock->lock); return EINVAL; } lock->runcount--; } if (lock->runcount == 0) { /* POSIX recommends that "write locks shall take precedence over read locks", to avoid "writer starvation". */ if (lock->waiting_writers_count > 0) { /* Wake up one of the waiting writers. */ err = pthread_cond_signal (&lock->waiting_writers); if (err != 0) { pthread_mutex_unlock (&lock->lock); return err; } } else { /* Wake up all waiting readers. */ err = pthread_cond_broadcast (&lock->waiting_readers); if (err != 0) { pthread_mutex_unlock (&lock->lock); return err; } } } return pthread_mutex_unlock (&lock->lock); } int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock) { int err; err = pthread_mutex_destroy (&lock->lock); if (err != 0) return err; err = pthread_cond_destroy (&lock->waiting_readers); if (err != 0) return err; err = pthread_cond_destroy (&lock->waiting_writers); if (err != 0) return err; return 0; } # endif /* --------------------- gl_recursive_lock_t datatype --------------------- */ # if HAVE_PTHREAD_MUTEX_RECURSIVE # if defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) { pthread_mutexattr_t attributes; int err; err = pthread_mutexattr_init (&attributes); if (err != 0) return err; err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE); if (err != 0) { pthread_mutexattr_destroy (&attributes); return err; } err = pthread_mutex_init (lock, &attributes); if (err != 0) { pthread_mutexattr_destroy (&attributes); return err; } err = pthread_mutexattr_destroy (&attributes); if (err != 0) return err; return 0; } # else int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) { pthread_mutexattr_t attributes; int err; err = pthread_mutexattr_init (&attributes); if (err != 0) return err; err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE); if (err != 0) { pthread_mutexattr_destroy (&attributes); return err; } err = pthread_mutex_init (&lock->recmutex, &attributes); if (err != 0) { pthread_mutexattr_destroy (&attributes); return err; } err = pthread_mutexattr_destroy (&attributes); if (err != 0) return err; lock->initialized = 1; return 0; } int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock) { if (!lock->initialized) { int err; err = pthread_mutex_lock (&lock->guard); if (err != 0) return err; if (!lock->initialized) { err = glthread_recursive_lock_init_multithreaded (lock); if (err != 0) { pthread_mutex_unlock (&lock->guard); return err; } } err = pthread_mutex_unlock (&lock->guard); if (err != 0) return err; } return pthread_mutex_lock (&lock->recmutex); } int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock) { if (!lock->initialized) return EINVAL; return pthread_mutex_unlock (&lock->recmutex); } int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock) { int err; if (!lock->initialized) return EINVAL; err = pthread_mutex_destroy (&lock->recmutex); if (err != 0) return err; lock->initialized = 0; return 0; } # endif # else int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) { int err; err = pthread_mutex_init (&lock->mutex, NULL); if (err != 0) return err; lock->owner = (pthread_t) 0; lock->depth = 0; return 0; } int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock) { pthread_t self = pthread_self (); if (lock->owner != self) { int err; err = pthread_mutex_lock (&lock->mutex); if (err != 0) return err; lock->owner = self; } if (++(lock->depth) == 0) /* wraparound? */ { lock->depth--; return EAGAIN; } return 0; } int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock) { if (lock->owner != pthread_self ()) return EPERM; if (lock->depth == 0) return EINVAL; if (--(lock->depth) == 0) { lock->owner = (pthread_t) 0; return pthread_mutex_unlock (&lock->mutex); } else return 0; } int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock) { if (lock->owner != (pthread_t) 0) return EBUSY; return pthread_mutex_destroy (&lock->mutex); } # endif /* -------------------------- gl_once_t datatype -------------------------- */ static const pthread_once_t fresh_once = PTHREAD_ONCE_INIT; int glthread_once_singlethreaded (pthread_once_t *once_control) { /* We don't know whether pthread_once_t is an integer type, a floating-point type, a pointer type, or a structure type. */ char *firstbyte = (char *)once_control; if (*firstbyte == *(const char *)&fresh_once) { /* First time use of once_control. Invert the first byte. */ *firstbyte = ~ *(const char *)&fresh_once; return 1; } else return 0; } #endif /* ========================================================================= */ #if USE_PTH_THREADS /* Use the GNU Pth threads library. */ /* -------------------------- gl_lock_t datatype -------------------------- */ /* ------------------------- gl_rwlock_t datatype ------------------------- */ /* --------------------- gl_recursive_lock_t datatype --------------------- */ /* -------------------------- gl_once_t datatype -------------------------- */ static void glthread_once_call (void *arg) { void (**gl_once_temp_addr) (void) = (void (**) (void)) arg; void (*initfunction) (void) = *gl_once_temp_addr; initfunction (); } int glthread_once_multithreaded (pth_once_t *once_control, void (*initfunction) (void)) { void (*temp) (void) = initfunction; return (!pth_once (once_control, glthread_once_call, &temp) ? errno : 0); } int glthread_once_singlethreaded (pth_once_t *once_control) { /* We know that pth_once_t is an integer type. */ if (*once_control == PTH_ONCE_INIT) { /* First time use of once_control. Invert the marker. */ *once_control = ~ PTH_ONCE_INIT; return 1; } else return 0; } #endif /* ========================================================================= */ #if USE_SOLARIS_THREADS /* Use the old Solaris threads library. */ /* -------------------------- gl_lock_t datatype -------------------------- */ /* ------------------------- gl_rwlock_t datatype ------------------------- */ /* --------------------- gl_recursive_lock_t datatype --------------------- */ int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) { int err; err = mutex_init (&lock->mutex, USYNC_THREAD, NULL); if (err != 0) return err; lock->owner = (thread_t) 0; lock->depth = 0; return 0; } int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock) { thread_t self = thr_self (); if (lock->owner != self) { int err; err = mutex_lock (&lock->mutex); if (err != 0) return err; lock->owner = self; } if (++(lock->depth) == 0) /* wraparound? */ { lock->depth--; return EAGAIN; } return 0; } int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock) { if (lock->owner != thr_self ()) return EPERM; if (lock->depth == 0) return EINVAL; if (--(lock->depth) == 0) { lock->owner = (thread_t) 0; return mutex_unlock (&lock->mutex); } else return 0; } int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock) { if (lock->owner != (thread_t) 0) return EBUSY; return mutex_destroy (&lock->mutex); } /* -------------------------- gl_once_t datatype -------------------------- */ int glthread_once_multithreaded (gl_once_t *once_control, void (*initfunction) (void)) { if (!once_control->inited) { int err; /* Use the mutex to guarantee that if another thread is already calling the initfunction, this thread waits until it's finished. */ err = mutex_lock (&once_control->mutex); if (err != 0) return err; if (!once_control->inited) { once_control->inited = 1; initfunction (); } return mutex_unlock (&once_control->mutex); } else return 0; } int glthread_once_singlethreaded (gl_once_t *once_control) { /* We know that gl_once_t contains an integer type. */ if (!once_control->inited) { /* First time use of once_control. Invert the marker. */ once_control->inited = ~ 0; return 1; } else return 0; } #endif /* ========================================================================= */ #if USE_WIN32_THREADS /* -------------------------- gl_lock_t datatype -------------------------- */ void glthread_lock_init_func (gl_lock_t *lock) { InitializeCriticalSection (&lock->lock); lock->guard.done = 1; } int glthread_lock_lock_func (gl_lock_t *lock) { if (!lock->guard.done) { if (InterlockedIncrement (&lock->guard.started) == 0) /* This thread is the first one to need this lock. Initialize it. */ glthread_lock_init (lock); else /* Yield the CPU while waiting for another thread to finish initializing this lock. */ while (!lock->guard.done) Sleep (0); } EnterCriticalSection (&lock->lock); return 0; } int glthread_lock_unlock_func (gl_lock_t *lock) { if (!lock->guard.done) return EINVAL; LeaveCriticalSection (&lock->lock); return 0; } int glthread_lock_destroy_func (gl_lock_t *lock) { if (!lock->guard.done) return EINVAL; DeleteCriticalSection (&lock->lock); lock->guard.done = 0; return 0; } /* ------------------------- gl_rwlock_t datatype ------------------------- */ /* In this file, the waitqueues are implemented as circular arrays. */ #define gl_waitqueue_t gl_carray_waitqueue_t static inline void gl_waitqueue_init (gl_waitqueue_t *wq) { wq->array = NULL; wq->count = 0; wq->alloc = 0; wq->offset = 0; } /* Enqueues the current thread, represented by an event, in a wait queue. Returns INVALID_HANDLE_VALUE if an allocation failure occurs. */ static HANDLE gl_waitqueue_add (gl_waitqueue_t *wq) { HANDLE event; unsigned int index; if (wq->count == wq->alloc) { unsigned int new_alloc = 2 * wq->alloc + 1; HANDLE *new_array = (HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE)); if (new_array == NULL) /* No more memory. */ return INVALID_HANDLE_VALUE; /* Now is a good opportunity to rotate the array so that its contents starts at offset 0. */ if (wq->offset > 0) { unsigned int old_count = wq->count; unsigned int old_alloc = wq->alloc; unsigned int old_offset = wq->offset; unsigned int i; if (old_offset + old_count > old_alloc) { unsigned int limit = old_offset + old_count - old_alloc; for (i = 0; i < limit; i++) new_array[old_alloc + i] = new_array[i]; } for (i = 0; i < old_count; i++) new_array[i] = new_array[old_offset + i]; wq->offset = 0; } wq->array = new_array; wq->alloc = new_alloc; } /* Whether the created event is a manual-reset one or an auto-reset one, does not matter, since we will wait on it only once. */ event = CreateEvent (NULL, TRUE, FALSE, NULL); if (event == INVALID_HANDLE_VALUE) /* No way to allocate an event. */ return INVALID_HANDLE_VALUE; index = wq->offset + wq->count; if (index >= wq->alloc) index -= wq->alloc; wq->array[index] = event; wq->count++; return event; } /* Notifies the first thread from a wait queue and dequeues it. */ static inline void gl_waitqueue_notify_first (gl_waitqueue_t *wq) { SetEvent (wq->array[wq->offset + 0]); wq->offset++; wq->count--; if (wq->count == 0 || wq->offset == wq->alloc) wq->offset = 0; } /* Notifies all threads from a wait queue and dequeues them all. */ static inline void gl_waitqueue_notify_all (gl_waitqueue_t *wq) { unsigned int i; for (i = 0; i < wq->count; i++) { unsigned int index = wq->offset + i; if (index >= wq->alloc) index -= wq->alloc; SetEvent (wq->array[index]); } wq->count = 0; wq->offset = 0; } void glthread_rwlock_init_func (gl_rwlock_t *lock) { InitializeCriticalSection (&lock->lock); gl_waitqueue_init (&lock->waiting_readers); gl_waitqueue_init (&lock->waiting_writers); lock->runcount = 0; lock->guard.done = 1; } int glthread_rwlock_rdlock_func (gl_rwlock_t *lock) { if (!lock->guard.done) { if (InterlockedIncrement (&lock->guard.started) == 0) /* This thread is the first one to need this lock. Initialize it. */ glthread_rwlock_init (lock); else /* Yield the CPU while waiting for another thread to finish initializing this lock. */ while (!lock->guard.done) Sleep (0); } EnterCriticalSection (&lock->lock); /* Test whether only readers are currently running, and whether the runcount field will not overflow. */ if (!(lock->runcount + 1 > 0)) { /* This thread has to wait for a while. Enqueue it among the waiting_readers. */ HANDLE event = gl_waitqueue_add (&lock->waiting_readers); if (event != INVALID_HANDLE_VALUE) { DWORD result; LeaveCriticalSection (&lock->lock); /* Wait until another thread signals this event. */ result = WaitForSingleObject (event, INFINITE); if (result == WAIT_FAILED || result == WAIT_TIMEOUT) abort (); CloseHandle (event); /* The thread which signalled the event already did the bookkeeping: removed us from the waiting_readers, incremented lock->runcount. */ if (!(lock->runcount > 0)) abort (); return 0; } else { /* Allocation failure. Weird. */ do { LeaveCriticalSection (&lock->lock); Sleep (1); EnterCriticalSection (&lock->lock); } while (!(lock->runcount + 1 > 0)); } } lock->runcount++; LeaveCriticalSection (&lock->lock); return 0; } int glthread_rwlock_wrlock_func (gl_rwlock_t *lock) { if (!lock->guard.done) { if (InterlockedIncrement (&lock->guard.started) == 0) /* This thread is the first one to need this lock. Initialize it. */ glthread_rwlock_init (lock); else /* Yield the CPU while waiting for another thread to finish initializing this lock. */ while (!lock->guard.done) Sleep (0); } EnterCriticalSection (&lock->lock); /* Test whether no readers or writers are currently running. */ if (!(lock->runcount == 0)) { /* This thread has to wait for a while. Enqueue it among the waiting_writers. */ HANDLE event = gl_waitqueue_add (&lock->waiting_writers); if (event != INVALID_HANDLE_VALUE) { DWORD result; LeaveCriticalSection (&lock->lock); /* Wait until another thread signals this event. */ result = WaitForSingleObject (event, INFINITE); if (result == WAIT_FAILED || result == WAIT_TIMEOUT) abort (); CloseHandle (event); /* The thread which signalled the event already did the bookkeeping: removed us from the waiting_writers, set lock->runcount = -1. */ if (!(lock->runcount == -1)) abort (); return 0; } else { /* Allocation failure. Weird. */ do { LeaveCriticalSection (&lock->lock); Sleep (1); EnterCriticalSection (&lock->lock); } while (!(lock->runcount == 0)); } } lock->runcount--; /* runcount becomes -1 */ LeaveCriticalSection (&lock->lock); return 0; } int glthread_rwlock_unlock_func (gl_rwlock_t *lock) { if (!lock->guard.done) return EINVAL; EnterCriticalSection (&lock->lock); if (lock->runcount < 0) { /* Drop a writer lock. */ if (!(lock->runcount == -1)) abort (); lock->runcount = 0; } else { /* Drop a reader lock. */ if (!(lock->runcount > 0)) { LeaveCriticalSection (&lock->lock); return EPERM; } lock->runcount--; } if (lock->runcount == 0) { /* POSIX recommends that "write locks shall take precedence over read locks", to avoid "writer starvation". */ if (lock->waiting_writers.count > 0) { /* Wake up one of the waiting writers. */ lock->runcount--; gl_waitqueue_notify_first (&lock->waiting_writers); } else { /* Wake up all waiting readers. */ lock->runcount += lock->waiting_readers.count; gl_waitqueue_notify_all (&lock->waiting_readers); } } LeaveCriticalSection (&lock->lock); return 0; } int glthread_rwlock_destroy_func (gl_rwlock_t *lock) { if (!lock->guard.done) return EINVAL; if (lock->runcount != 0) return EBUSY; DeleteCriticalSection (&lock->lock); if (lock->waiting_readers.array != NULL) free (lock->waiting_readers.array); if (lock->waiting_writers.array != NULL) free (lock->waiting_writers.array); lock->guard.done = 0; return 0; } /* --------------------- gl_recursive_lock_t datatype --------------------- */ void glthread_recursive_lock_init_func (gl_recursive_lock_t *lock) { lock->owner = 0; lock->depth = 0; InitializeCriticalSection (&lock->lock); lock->guard.done = 1; } int glthread_recursive_lock_lock_func (gl_recursive_lock_t *lock) { if (!lock->guard.done) { if (InterlockedIncrement (&lock->guard.started) == 0) /* This thread is the first one to need this lock. Initialize it. */ glthread_recursive_lock_init (lock); else /* Yield the CPU while waiting for another thread to finish initializing this lock. */ while (!lock->guard.done) Sleep (0); } { DWORD self = GetCurrentThreadId (); if (lock->owner != self) { EnterCriticalSection (&lock->lock); lock->owner = self; } if (++(lock->depth) == 0) /* wraparound? */ { lock->depth--; return EAGAIN; } } return 0; } int glthread_recursive_lock_unlock_func (gl_recursive_lock_t *lock) { if (lock->owner != GetCurrentThreadId ()) return EPERM; if (lock->depth == 0) return EINVAL; if (--(lock->depth) == 0) { lock->owner = 0; LeaveCriticalSection (&lock->lock); } return 0; } int glthread_recursive_lock_destroy_func (gl_recursive_lock_t *lock) { if (lock->owner != 0) return EBUSY; DeleteCriticalSection (&lock->lock); lock->guard.done = 0; return 0; } /* -------------------------- gl_once_t datatype -------------------------- */ void glthread_once_func (gl_once_t *once_control, void (*initfunction) (void)) { if (once_control->inited <= 0) { if (InterlockedIncrement (&once_control->started) == 0) { /* This thread is the first one to come to this once_control. */ InitializeCriticalSection (&once_control->lock); EnterCriticalSection (&once_control->lock); once_control->inited = 0; initfunction (); once_control->inited = 1; LeaveCriticalSection (&once_control->lock); } else { /* Undo last operation. */ InterlockedDecrement (&once_control->started); /* Some other thread has already started the initialization. Yield the CPU while waiting for the other thread to finish initializing and taking the lock. */ while (once_control->inited < 0) Sleep (0); if (once_control->inited <= 0) { /* Take the lock. This blocks until the other thread has finished calling the initfunction. */ EnterCriticalSection (&once_control->lock); LeaveCriticalSection (&once_control->lock); if (!(once_control->inited > 0)) abort (); } } } } #endif /* ========================================================================= */
{ "content_hash": "d742784f3d2d5b2f87fd19197fd00f35", "timestamp": "", "source": "github", "line_count": 1060, "max_line_length": 99, "avg_line_length": 25.40188679245283, "alnum_prop": 0.5620218376290574, "repo_name": "ucsd-progsys/csolve-bak", "id": "27543ae2c0e5424b2b151aacc35eb66da267a1e7", "size": "26926", "binary": false, "copies": "23", "ref": "refs/heads/master", "path": "external/gnu-coreutils/lib/glthread/lock.c", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "18015830" }, { "name": "C++", "bytes": "248734" }, { "name": "Common Lisp", "bytes": "29486" }, { "name": "Go", "bytes": "3361" }, { "name": "Java", "bytes": "330824" }, { "name": "JavaScript", "bytes": "1016635" }, { "name": "OCaml", "bytes": "3737617" }, { "name": "Objective-C", "bytes": "56874" }, { "name": "PHP", "bytes": "5108" }, { "name": "Perl", "bytes": "899168" }, { "name": "Prolog", "bytes": "17049" }, { "name": "Python", "bytes": "30924" }, { "name": "Racket", "bytes": "38583" }, { "name": "Ruby", "bytes": "3638" }, { "name": "Scala", "bytes": "272" }, { "name": "Scheme", "bytes": "471" }, { "name": "Shell", "bytes": "1194181" } ], "symlink_target": "" }
const yargs = require("yargs"); const { bddy } = require("bddy-core"); const PrettyError = require("pretty-error"); const pe = new PrettyError(); pe.appendStyle({ "pretty-error > header > title > kind": { display: "none" }, "pretty-error > header > colon": { display: "none" }, "pretty-error > header > message": { color: "bright-white", background: "cyan", padding: "0 0" }, "pretty-error > trace > item": { marginLeft: 2, bullet: '"<grey>-</grey>"' }, "pretty-error > trace > item > header > pointer > file": { color: "bright-cyan" }, "pretty-error > trace > item > header > pointer > colon": { color: "cyan" }, "pretty-error > trace > item > header > pointer > line": { color: "bright-cyan" }, "pretty-error > trace > item > header > what": { color: "bright-white" }, "pretty-error > trace > item > footer > addr": { display: "none" } }); async function build(defs, argv, _options) { const defaultOptions = { parallelJobs: argv.j, quiet: argv.q, verbose: argv.v }; const options = Object.assign(defaultOptions, _options); const bddyInst = bddy(defs, argv, options); const targets = argv.targets || argv._; if (argv._.length) { for (let wish of argv._) { await bddyInst.wish(wish); } } else if (bddyInst.wanted && bddyInst.wanted.length) { for (let wish of bddyInst.wanted) { await bddyInst.wish(wish); } } else { await bddyInst.wish("start"); } } function parseARGV(yargs, _argopt) { const argopt = Object.assign( { j: { alias: "jobs", number: true, default: 0, requiresArg: true, describe: "Allow N jobs at once (incluences <run>); 0 for CPU cores of your system" }, q: { boolean: true, alias: "quiet", default: false, describe: "Quiet Mode" }, v: { boolean: true, alias: "verbose", default: false, describe: "Verbose Mode" } }, _argopt ); return yargs.options(argopt).argv; } module.exports = function(defs, argopt, options) { build(defs, parseARGV(yargs, argopt), options).catch(function(e) { const renderedError = pe.render(e); console.log(renderedError); if (!e.bddyIgnorable) process.exit(1); }); };
{ "content_hash": "59fe7ac9cc80b323ca486c32ad92bc84", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 87, "avg_line_length": 28.525641025641026, "alnum_prop": 0.6058426966292135, "repo_name": "caryll/bddy", "id": "195baa104624e1e72e25e7b8ee3aa706c19fbfa1", "size": "2225", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cli.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "3932" } ], "symlink_target": "" }
'use strict'; describe('Controller: GoogleMapCtrl', function () { // load the controller's module beforeEach(module('nashaLeptaApp')); var GoogleMapCtrl, scope; // Initialize the controller and a mock scope beforeEach(inject(function ($controller, $rootScope) { scope = $rootScope.$new(); GoogleMapCtrl = $controller('GoogleMapCtrl', { $scope: scope }); })); it('should attach a list of awesomeThings to the scope', function () { expect(scope.map).toBeDefined(); expect(scope.gMapMarkers).toBeDefined(); }); });
{ "content_hash": "025a3d975089471d10f73fa1520783cc", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 72, "avg_line_length": 24.47826086956522, "alnum_prop": 0.6642984014209592, "repo_name": "NashaLeptaChallenge/nasha_lepta", "id": "bdd760022e8f3eaf5d645ee53e86d282f5e1d0f4", "size": "563", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "test/spec/controllers/googleMap.js", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "24139" }, { "name": "CSS", "bytes": "17998" }, { "name": "HTML", "bytes": "79913" }, { "name": "JavaScript", "bytes": "453894" } ], "symlink_target": "" }
osvers=$(sw_vers -productVersion | awk -F. '{print $2}') # Get today's date TODAY=$(date "+%FT%TZ") # Server1's address SERVER1=server1.name.here # Server2's address SERVER2=server2.name.here # Get Java plug-in info JAVA_PLUGIN=`/usr/bin/defaults read "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Info" CFBundleIdentifier` # Checks first to see if the Mac is running 10.6 or higher. # If so, the script checks the system default user template # for the presence of the Library/Preferences directory. # # If the directory is not found, it is created and then the # Java whitelist settings are created. if [[ ${osvers} -ge 6 ]]; then for USER_TEMPLATE in "/System/Library/User Template"/* do if [ ! -d "${USER_TEMPLATE}"/Library/Preferences ] then /bin/mkdir -p "${USER_TEMPLATE}"/Library/Preferences fi if [ -d "${USER_TEMPLATE}"/Library/Preferences ] then # Add Server1 to Java whitelist /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.Safari "WhitelistedBlockedPlugins" -array-add '{"PluginHostname" = "'$SERVER1'"; "PluginIdentifier" = "'$JAVA_PLUGIN'"; "PluginLastVisitedDate" = "'$TODAY'"; "PluginName" = "Java Applet Plug-in"; "PluginPageURL" = "https://'$SERVER1'"; "PluginPolicy" = "PluginPolicyNeverBlock";}' # Add Server2 to Java whitelist /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.Safari "WhitelistedBlockedPlugins" -array-add '{"PluginHostname" = "'$SERVER2'"; "PluginIdentifier" = "'$JAVA_PLUGIN'"; "PluginLastVisitedDate" = "'$TODAY'"; "PluginName" = "Java Applet Plug-in"; "PluginPageURL" = "https://'$SERVER2'"; "PluginPolicy" = "PluginPolicyNeverBlock";}' fi done fi # Checks first to see if the Mac is running 10.6 or higher. # If so, the script checks the existing user folders in /Users # for the presence of the Library/Preferences directory. # # If the directory is not found, it is created and then the # Java whitelist settings are created. if [[ ${osvers} -ge 6 ]]; then for USER_HOME in /Users/* do USER_UID=`basename "${USER_HOME}"` if [ ! "${USER_UID}" = "Shared" ] then if [ ! -f "${USER_HOME}"/Library/Preferences ] then /bin/mkdir -p "${USER_HOME}"/Library/Preferences chown "${USER_UID}" "${USER_HOME}"/Library chown "${USER_UID}" "${USER_HOME}"/Library/Preferences fi if [ -d "${USER_HOME}"/Library/Preferences ] then # Add Server1 to Java whitelist /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.Safari "WhitelistedBlockedPlugins" -array-add '{"PluginHostname" = "'$SERVER1'"; "PluginIdentifier" = "'$JAVA_PLUGIN'"; "PluginLastVisitedDate" = "'$TODAY'"; "PluginName" = "Java Applet Plug-in"; "PluginPageURL" = "https://'$SERVER1'"; "PluginPolicy" = "PluginPolicyNeverBlock";}' # Add Server2 to Java whitelist /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.Safari "WhitelistedBlockedPlugins" -array-add '{"PluginHostname" = "'$SERVER2'"; "PluginIdentifier" = "'$JAVA_PLUGIN'"; "PluginLastVisitedDate" = "'$TODAY'"; "PluginName" = "Java Applet Plug-in"; "PluginPageURL" = "https://'$SERVER2'"; "PluginPolicy" = "PluginPolicyNeverBlock";}' # Fix permissions on com.apple.Safari.plist /usr/sbin/chown "${USER_UID}" "${USER_HOME}"/Library/Preferences/com.apple.Safari.* fi fi done fi # Remove setup LaunchDaemon item srm /Library/LaunchDaemons/com.company.safari_java_whitelist_firstboot.plist # Make script self-destruct srm $0
{ "content_hash": "aef3007beacaf462736b039ef37d0c8a", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 362, "avg_line_length": 39, "alnum_prop": 0.6727322856355115, "repo_name": "chrisrolson/rtrouton_scripts", "id": "d60242b8918fbda45640047bcd814f661b23139d", "size": "3915", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "rtrouton_scripts/safari_java_whitelist/safari_java_whitelist_firstboot/safari_java_whitelist_firstboot.sh", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "8809" }, { "name": "Shell", "bytes": "398287" } ], "symlink_target": "" }
/** * Created by lukas on 22/04/17. */ /// <reference path="../node_modules/definitely-typed-angular/angular.d.ts" /> /// <reference path="../node_modules/definitely-typed-angular/angular-route.d.ts" />
{ "content_hash": "633d1ed74515e8b66007956eecc32faa", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 85, "avg_line_length": 41.2, "alnum_prop": 0.6747572815533981, "repo_name": "LukaszK88/AngularJsApp", "id": "f64ece24081aaa84918ab3b8e6bec3a0a551004d", "size": "206", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dist/_all.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "20744" }, { "name": "HTML", "bytes": "158157" }, { "name": "JavaScript", "bytes": "23157" }, { "name": "TypeScript", "bytes": "69645" } ], "symlink_target": "" }
package org.apache.isis.core.metamodel.facets.param.autocomplete; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import org.apache.isis.applib.annotation.MinLength; import org.apache.isis.applib.annotation.Parameter; public final class MinLengthUtil { private MinLengthUtil(){} /** * Finds the value of the minimum length, from either the {@link MinLength} annotation or the * {@link org.apache.isis.applib.annotation.Parameter#minLength()} annotation, on the first parameter of the * supplied method. */ public static int determineMinLength(final Method method) { if(method == null) { return MIN_LENGTH_DEFAULT; } final Annotation[][] parameterAnnotations = method.getParameterAnnotations(); if(parameterAnnotations.length == 1) { final Annotation[] searchArgAnnotations = parameterAnnotations[0]; for(Annotation annotation: searchArgAnnotations) { if(annotation instanceof MinLength) { MinLength minLength = (MinLength) annotation; return minLength.value(); } if(annotation instanceof Parameter) { Parameter parameter = (Parameter) annotation; return parameter.minLength(); } } } return MinLengthUtil.MIN_LENGTH_DEFAULT; } public static final int MIN_LENGTH_DEFAULT = 1; }
{ "content_hash": "11fb7ebc587fa944bda0e809432efb11", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 112, "avg_line_length": 33.15555555555556, "alnum_prop": 0.6387399463806971, "repo_name": "estatio/isis", "id": "7a3cc27fd9e112506d80948f394440dd4b496e5e", "size": "2305", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/autocomplete/MinLengthUtil.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "167796" }, { "name": "Cucumber", "bytes": "8162" }, { "name": "Groovy", "bytes": "28126" }, { "name": "HTML", "bytes": "624941" }, { "name": "Java", "bytes": "18708104" }, { "name": "JavaScript", "bytes": "118703" }, { "name": "Shell", "bytes": "12873" }, { "name": "XSLT", "bytes": "72290" } ], "symlink_target": "" }
================= Ganeti 2.1 design ================= This document describes the major changes in Ganeti 2.1 compared to the 2.0 version. The 2.1 version will be a relatively small release. Its main aim is to avoid changing too much of the core code, while addressing issues and adding new features and improvements over 2.0, in a timely fashion. .. contents:: :depth: 4 Objective ========= Ganeti 2.1 will add features to help further automatization of cluster operations, further improve scalability to even bigger clusters, and make it easier to debug the Ganeti core. Detailed design =============== As for 2.0 we divide the 2.1 design into three areas: - core changes, which affect the master daemon/job queue/locking or all/most logical units - logical unit/feature changes - external interface changes (eg. command line, os api, hooks, ...) Core changes ------------ Storage units modelling ~~~~~~~~~~~~~~~~~~~~~~~ Currently, Ganeti has a good model of the block devices for instances (e.g. LVM logical volumes, files, DRBD devices, etc.) but none of the storage pools that are providing the space for these front-end devices. For example, there are hardcoded inter-node RPC calls for volume group listing, file storage creation/deletion, etc. The storage units framework will implement a generic handling for all kinds of storage backends: - LVM physical volumes - LVM volume groups - File-based storage directories - any other future storage method There will be a generic list of methods that each storage unit type will provide, like: - list of storage units of this type - check status of the storage unit Additionally, there will be specific methods for each method, for example: - enable/disable allocations on a specific PV - file storage directory creation/deletion - VG consistency fixing This will allow a much better modeling and unification of the various RPC calls related to backend storage pool in the future. Ganeti 2.1 is intended to add the basics of the framework, and not necessarilly move all the curent VG/FileBased operations to it. Note that while we model both LVM PVs and LVM VGs, the framework will **not** model any relationship between the different types. In other words, we don't model neither inheritances nor stacking, since this is too complex for our needs. While a ``vgreduce`` operation on a LVM VG could actually remove a PV from it, this will not be handled at the framework level, but at individual operation level. The goal is that this is a lightweight framework, for abstracting the different storage operation, and not for modelling the storage hierarchy. Locking improvements ~~~~~~~~~~~~~~~~~~~~ Current State and shortcomings ++++++++++++++++++++++++++++++ The class ``LockSet`` (see ``lib/locking.py``) is a container for one or many ``SharedLock`` instances. It provides an interface to add/remove locks and to acquire and subsequently release any number of those locks contained in it. Locks in a ``LockSet`` are always acquired in alphabetic order. Due to the way we're using locks for nodes and instances (the single cluster lock isn't affected by this issue) this can lead to long delays when acquiring locks if another operation tries to acquire multiple locks but has to wait for yet another operation. In the following demonstration we assume to have the instance locks ``inst1``, ``inst2``, ``inst3`` and ``inst4``. #. Operation A grabs lock for instance ``inst4``. #. Operation B wants to acquire all instance locks in alphabetic order, but it has to wait for ``inst4``. #. Operation C tries to lock ``inst1``, but it has to wait until Operation B (which is trying to acquire all locks) releases the lock again. #. Operation A finishes and releases lock on ``inst4``. Operation B can continue and eventually releases all locks. #. Operation C can get ``inst1`` lock and finishes. Technically there's no need for Operation C to wait for Operation A, and subsequently Operation B, to finish. Operation B can't continue until Operation A is done (it has to wait for ``inst4``), anyway. Proposed changes ++++++++++++++++ Non-blocking lock acquiring ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Acquiring locks for OpCode execution is always done in blocking mode. They won't return until the lock has successfully been acquired (or an error occurred, although we won't cover that case here). ``SharedLock`` and ``LockSet`` must be able to be acquired in a non-blocking way. They must support a timeout and abort trying to acquire the lock(s) after the specified amount of time. Retry acquiring locks ^^^^^^^^^^^^^^^^^^^^^ To prevent other operations from waiting for a long time, such as described in the demonstration before, ``LockSet`` must not keep locks for a prolonged period of time when trying to acquire two or more locks. Instead it should, with an increasing timeout for acquiring all locks, release all locks again and sleep some time if it fails to acquire all requested locks. A good timeout value needs to be determined. In any case should ``LockSet`` proceed to acquire locks in blocking mode after a few (unsuccessful) attempts to acquire all requested locks. One proposal for the timeout is to use ``2**tries`` seconds, where ``tries`` is the number of unsuccessful tries. In the demonstration before this would allow Operation C to continue after Operation B unsuccessfully tried to acquire all locks and released all acquired locks (``inst1``, ``inst2`` and ``inst3``) again. Other solutions discussed +++++++++++++++++++++++++ There was also some discussion on going one step further and extend the job queue (see ``lib/jqueue.py``) to select the next task for a worker depending on whether it can acquire the necessary locks. While this may reduce the number of necessary worker threads and/or increase throughput on large clusters with many jobs, it also brings many potential problems, such as contention and increased memory usage, with it. As this would be an extension of the changes proposed before it could be implemented at a later point in time, but we decided to stay with the simpler solution for now. Implementation details ++++++++++++++++++++++ ``SharedLock`` redesign ^^^^^^^^^^^^^^^^^^^^^^^ The current design of ``SharedLock`` is not good for supporting timeouts when acquiring a lock and there are also minor fairness issues in it. We plan to address both with a redesign. A proof of concept implementation was written and resulted in significantly simpler code. Currently ``SharedLock`` uses two separate queues for shared and exclusive acquires and waiters get to run in turns. This means if an exclusive acquire is released, the lock will allow shared waiters to run and vice versa. Although it's still fair in the end there is a slight bias towards shared waiters in the current implementation. The same implementation with two shared queues can not support timeouts without adding a lot of complexity. Our proposed redesign changes ``SharedLock`` to have only one single queue. There will be one condition (see Condition_ for a note about performance) in the queue per exclusive acquire and two for all shared acquires (see below for an explanation). The maximum queue length will always be ``2 + (number of exclusive acquires waiting)``. The number of queue entries for shared acquires can vary from 0 to 2. The two conditions for shared acquires are a bit special. They will be used in turn. When the lock is instantiated, no conditions are in the queue. As soon as the first shared acquire arrives (and there are holder(s) or waiting acquires; see Acquire_), the active condition is added to the queue. Until it becomes the topmost condition in the queue and has been notified, any shared acquire is added to this active condition. When the active condition is notified, the conditions are swapped and further shared acquires are added to the previously inactive condition (which has now become the active condition). After all waiters on the previously active (now inactive) and now notified condition received the notification, it is removed from the queue of pending acquires. This means shared acquires will skip any exclusive acquire in the queue. We believe it's better to improve parallelization on operations only asking for shared (or read-only) locks. Exclusive operations holding the same lock can not be parallelized. Acquire ******* For exclusive acquires a new condition is created and appended to the queue. Shared acquires are added to the active condition for shared acquires and if the condition is not yet on the queue, it's appended. The next step is to wait for our condition to be on the top of the queue (to guarantee fairness). If the timeout expired, we return to the caller without acquiring the lock. On every notification we check whether the lock has been deleted, in which case an error is returned to the caller. The lock can be acquired if we're on top of the queue (there is no one else ahead of us). For an exclusive acquire, there must not be other exclusive or shared holders. For a shared acquire, there must not be an exclusive holder. If these conditions are all true, the lock is acquired and we return to the caller. In any other case we wait again on the condition. If it was the last waiter on a condition, the condition is removed from the queue. Optimization: There's no need to touch the queue if there are no pending acquires and no current holders. The caller can have the lock immediately. .. digraph:: "design-2.1-lock-acquire" graph[fontsize=8, fontname="Helvetica"] node[fontsize=8, fontname="Helvetica", width="0", height="0"] edge[fontsize=8, fontname="Helvetica"] /* Actions */ abort[label="Abort\n(couldn't acquire)"] acquire[label="Acquire lock"] add_to_queue[label="Add condition to queue"] wait[label="Wait for notification"] remove_from_queue[label="Remove from queue"] /* Conditions */ alone[label="Empty queue\nand can acquire?", shape=diamond] have_timeout[label="Do I have\ntimeout?", shape=diamond] top_of_queue_and_can_acquire[ label="On top of queue and\ncan acquire lock?", shape=diamond, ] /* Lines */ alone->acquire[label="Yes"] alone->add_to_queue[label="No"] have_timeout->abort[label="Yes"] have_timeout->wait[label="No"] top_of_queue_and_can_acquire->acquire[label="Yes"] top_of_queue_and_can_acquire->have_timeout[label="No"] add_to_queue->wait wait->top_of_queue_and_can_acquire acquire->remove_from_queue Release ******* First the lock removes the caller from the internal owner list. If there are pending acquires in the queue, the first (the oldest) condition is notified. If the first condition was the active condition for shared acquires, the inactive condition will be made active. This ensures fairness with exclusive locks by forcing consecutive shared acquires to wait in the queue. .. digraph:: "design-2.1-lock-release" graph[fontsize=8, fontname="Helvetica"] node[fontsize=8, fontname="Helvetica", width="0", height="0"] edge[fontsize=8, fontname="Helvetica"] /* Actions */ remove_from_owners[label="Remove from owner list"] notify[label="Notify topmost"] swap_shared[label="Swap shared conditions"] success[label="Success"] /* Conditions */ have_pending[label="Any pending\nacquires?", shape=diamond] was_active_queue[ label="Was active condition\nfor shared acquires?", shape=diamond, ] /* Lines */ remove_from_owners->have_pending have_pending->notify[label="Yes"] have_pending->success[label="No"] notify->was_active_queue was_active_queue->swap_shared[label="Yes"] was_active_queue->success[label="No"] swap_shared->success Delete ****** The caller must either hold the lock in exclusive mode already or the lock must be acquired in exclusive mode. Trying to delete a lock while it's held in shared mode must fail. After ensuring the lock is held in exclusive mode, the lock will mark itself as deleted and continue to notify all pending acquires. They will wake up, notice the deleted lock and return an error to the caller. Condition ^^^^^^^^^ Note: This is not necessary for the locking changes above, but it may be a good optimization (pending performance tests). The existing locking code in Ganeti 2.0 uses Python's built-in ``threading.Condition`` class. Unfortunately ``Condition`` implements timeouts by sleeping 1ms to 20ms between tries to acquire the condition lock in non-blocking mode. This requires unnecessary context switches and contention on the CPython GIL (Global Interpreter Lock). By using POSIX pipes (see ``pipe(2)``) we can use the operating system's support for timeouts on file descriptors (see ``select(2)``). A custom condition class will have to be written for this. On instantiation the class creates a pipe. After each notification the previous pipe is abandoned and re-created (technically the old pipe needs to stay around until all notifications have been delivered). All waiting clients of the condition use ``select(2)`` or ``poll(2)`` to wait for notifications, optionally with a timeout. A notification will be signalled to the waiting clients by closing the pipe. If the pipe wasn't closed during the timeout, the waiting function returns to its caller nonetheless. Node daemon availability ~~~~~~~~~~~~~~~~~~~~~~~~ Current State and shortcomings ++++++++++++++++++++++++++++++ Currently, when a Ganeti node suffers serious system disk damage, the migration/failover of an instance may not correctly shutdown the virtual machine on the broken node causing instances duplication. The ``gnt-node powercycle`` command can be used to force a node reboot and thus to avoid duplicated instances. This command relies on node daemon availability, though, and thus can fail if the node daemon has some pages swapped out of ram, for example. Proposed changes ++++++++++++++++ The proposed solution forces node daemon to run exclusively in RAM. It uses python ctypes to to call ``mlockall(MCL_CURRENT | MCL_FUTURE)`` on the node daemon process and all its children. In addition another log handler has been implemented for node daemon to redirect to ``/dev/console`` messages that cannot be written on the logfile. With these changes node daemon can successfully run basic tasks such as a powercycle request even when the system disk is heavily damaged and reading/writing to disk fails constantly. New Features ------------ Automated Ganeti Cluster Merger ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Current situation +++++++++++++++++ Currently there's no easy way to merge two or more clusters together. But in order to optimize resources this is a needed missing piece. The goal of this design doc is to come up with a easy to use solution which allows you to merge two or more cluster together. Initial contact +++++++++++++++ As the design of Ganeti is based on an autonomous system, Ganeti by itself has no way to reach nodes outside of its cluster. To overcome this situation we're required to prepare the cluster before we can go ahead with the actual merge: We've to replace at least the ssh keys on the affected nodes before we can do any operation within ``gnt-`` commands. To make this a automated process we'll ask the user to provide us with the root password of every cluster we've to merge. We use the password to grab the current ``id_dsa`` key and then rely on that ssh key for any further communication to be made until the cluster is fully merged. Cluster merge +++++++++++++ After initial contact we do the cluster merge: 1. Grab the list of nodes 2. On all nodes add our own ``id_dsa.pub`` key to ``authorized_keys`` 3. Stop all instances running on the merging cluster 4. Disable ``ganeti-watcher`` as it tries to restart Ganeti daemons 5. Stop all Ganeti daemons on all merging nodes 6. Grab the ``config.data`` from the master of the merging cluster 7. Stop local ``ganeti-masterd`` 8. Merge the config: 1. Open our own cluster ``config.data`` 2. Open cluster ``config.data`` of the merging cluster 3. Grab all nodes of the merging cluster 4. Set ``master_candidate`` to false on all merging nodes 5. Add the nodes to our own cluster ``config.data`` 6. Grab all the instances on the merging cluster 7. Adjust the port if the instance has drbd layout: 1. In ``logical_id`` (index 2) 2. In ``physical_id`` (index 1 and 3) 8. Add the instances to our own cluster ``config.data`` 9. Start ``ganeti-masterd`` with ``--no-voting`` ``--yes-do-it`` 10. ``gnt-node add --readd`` on all merging nodes 11. ``gnt-cluster redist-conf`` 12. Restart ``ganeti-masterd`` normally 13. Enable ``ganeti-watcher`` again 14. Start all merging instances again Rollback ++++++++ Until we actually (re)add any nodes we can abort and rollback the merge at any point. After merging the config, though, we've to get the backup copy of ``config.data`` (from another master candidate node). And for security reasons it's a good idea to undo ``id_dsa.pub`` distribution by going on every affected node and remove the ``id_dsa.pub`` key again. Also we've to keep in mind, that we've to start the Ganeti daemons and starting up the instances again. Verification ++++++++++++ Last but not least we should verify that the merge was successful. Therefore we run ``gnt-cluster verify``, which ensures that the cluster overall is in a healthy state. Additional it's also possible to compare the list of instances/nodes with a list made prior to the upgrade to make sure we didn't lose any data/instance/node. Appendix ++++++++ cluster-merge.py ^^^^^^^^^^^^^^^^ Used to merge the cluster config. This is a POC and might differ from actual production code. :: #!/usr/bin/python import sys from ganeti import config from ganeti import constants c_mine = config.ConfigWriter(offline=True) c_other = config.ConfigWriter(sys.argv[1]) fake_id = 0 for node in c_other.GetNodeList(): node_info = c_other.GetNodeInfo(node) node_info.master_candidate = False c_mine.AddNode(node_info, str(fake_id)) fake_id += 1 for instance in c_other.GetInstanceList(): instance_info = c_other.GetInstanceInfo(instance) for dsk in instance_info.disks: if dsk.dev_type in constants.LDS_DRBD: port = c_mine.AllocatePort() logical_id = list(dsk.logical_id) logical_id[2] = port dsk.logical_id = tuple(logical_id) physical_id = list(dsk.physical_id) physical_id[1] = physical_id[3] = port dsk.physical_id = tuple(physical_id) c_mine.AddInstance(instance_info, str(fake_id)) fake_id += 1 Feature changes --------------- Ganeti Confd ~~~~~~~~~~~~ Current State and shortcomings ++++++++++++++++++++++++++++++ In Ganeti 2.0 all nodes are equal, but some are more equal than others. In particular they are divided between "master", "master candidates" and "normal". (Moreover they can be offline or drained, but this is not important for the current discussion). In general the whole configuration is only replicated to master candidates, and some partial information is spread to all nodes via ssconf. This change was done so that the most frequent Ganeti operations didn't need to contact all nodes, and so clusters could become bigger. If we want more information to be available on all nodes, we need to add more ssconf values, which is counter-balancing the change, or to talk with the master node, which is not designed to happen now, and requires its availability. Information such as the instance->primary_node mapping will be needed on all nodes, and we also want to make sure services external to the cluster can query this information as well. This information must be available at all times, so we can't query it through RAPI, which would be a single point of failure, as it's only available on the master. Proposed changes ++++++++++++++++ In order to allow fast and highly available access read-only to some configuration values, we'll create a new ganeti-confd daemon, which will run on master candidates. This daemon will talk via UDP, and authenticate messages using HMAC with a cluster-wide shared key. This key will be generated at cluster init time, and stored on the clusters alongside the ganeti SSL keys, and readable only by root. An interested client can query a value by making a request to a subset of the cluster master candidates. It will then wait to get a few responses, and use the one with the highest configuration serial number. Since the configuration serial number is increased each time the ganeti config is updated, and the serial number is included in all answers, this can be used to make sure to use the most recent answer, in case some master candidates are stale or in the middle of a configuration update. In order to prevent replay attacks queries will contain the current unix timestamp according to the client, and the server will verify that its timestamp is in the same 5 minutes range (this requires synchronized clocks, which is a good idea anyway). Queries will also contain a "salt" which they expect the answers to be sent with, and clients are supposed to accept only answers which contain salt generated by them. The configuration daemon will be able to answer simple queries such as: - master candidates list - master node - offline nodes - instance list - instance primary nodes Wire protocol ^^^^^^^^^^^^^ A confd query will look like this, on the wire:: plj0{ "msg": "{\"type\": 1, \"rsalt\": \"9aa6ce92-8336-11de-af38-001d093e835f\", \"protocol\": 1, \"query\": \"node1.example.com\"}\n", "salt": "1249637704", "hmac": "4a4139b2c3c5921f7e439469a0a45ad200aead0f" } ``plj0`` is a fourcc that details the message content. It stands for plain json 0, and can be changed as we move on to different type of protocols (for example protocol buffers, or encrypted json). What follows is a json encoded string, with the following fields: - ``msg`` contains a JSON-encoded query, its fields are: - ``protocol``, integer, is the confd protocol version (initially just ``constants.CONFD_PROTOCOL_VERSION``, with a value of 1) - ``type``, integer, is the query type. For example "node role by name" or "node primary ip by instance ip". Constants will be provided for the actual available query types - ``query`` is a multi-type field (depending on the ``type`` field): - it can be missing, when the request is fully determined by the ``type`` field - it can contain a string which denotes the search key: for example an IP, or a node name - it can contain a dictionary, in which case the actual details vary further per request type - ``rsalt``, string, is the required response salt; the client must use it to recognize which answer it's getting. - ``salt`` must be the current unix timestamp, according to the client; servers should refuse messages which have a wrong timing, according to their configuration and clock - ``hmac`` is an hmac signature of salt+msg, with the cluster hmac key If an answer comes back (which is optional, since confd works over UDP) it will be in this format:: plj0{ "msg": "{\"status\": 0, \"answer\": 0, \"serial\": 42, \"protocol\": 1}\n", "salt": "9aa6ce92-8336-11de-af38-001d093e835f", "hmac": "aaeccc0dff9328fdf7967cb600b6a80a6a9332af" } Where: - ``plj0`` the message type magic fourcc, as discussed above - ``msg`` contains a JSON-encoded answer, its fields are: - ``protocol``, integer, is the confd protocol version (initially just constants.CONFD_PROTOCOL_VERSION, with a value of 1) - ``status``, integer, is the error code; initially just ``0`` for 'ok' or ``1`` for 'error' (in which case answer contains an error detail, rather than an answer), but in the future it may be expanded to have more meanings (e.g. ``2`` if the answer is compressed) - ``answer``, is the actual answer; its type and meaning is query specific: for example for "node primary ip by instance ip" queries it will be a string containing an IP address, for "node role by name" queries it will be an integer which encodes the role (master, candidate, drained, offline) according to constants - ``salt`` is the requested salt from the query; a client can use it to recognize what query the answer is answering. - ``hmac`` is an hmac signature of salt+msg, with the cluster hmac key Redistribute Config ~~~~~~~~~~~~~~~~~~~ Current State and shortcomings ++++++++++++++++++++++++++++++ Currently LUClusterRedistConf triggers a copy of the updated configuration file to all master candidates and of the ssconf files to all nodes. There are other files which are maintained manually but which are important to keep in sync. These are: - rapi SSL key certificate file (rapi.pem) (on master candidates) - rapi user/password file rapi_users (on master candidates) Furthermore there are some files which are hypervisor specific but we may want to keep in sync: - the xen-hvm hypervisor uses one shared file for all vnc passwords, and copies the file once, during node add. This design is subject to revision to be able to have different passwords for different groups of instances via the use of hypervisor parameters, and to allow xen-hvm and kvm to use an equal system to provide password-protected vnc sessions. In general, though, it would be useful if the vnc password files were copied as well, to avoid unwanted vnc password changes on instance failover/migrate. Optionally the admin may want to also ship files such as the global xend.conf file, and the network scripts to all nodes. Proposed changes ++++++++++++++++ RedistributeConfig will be changed to copy also the rapi files, and to call every enabled hypervisor asking for a list of additional files to copy. Users will have the possibility to populate a file containing a list of files to be distributed; this file will be propagated as well. Such solution is really simple to implement and it's easily usable by scripts. This code will be also shared (via tasklets or by other means, if tasklets are not ready for 2.1) with the AddNode and SetNodeParams LUs (so that the relevant files will be automatically shipped to new master candidates as they are set). VNC Console Password ~~~~~~~~~~~~~~~~~~~~ Current State and shortcomings ++++++++++++++++++++++++++++++ Currently just the xen-hvm hypervisor supports setting a password to connect the the instances' VNC console, and has one common password stored in a file. This doesn't allow different passwords for different instances/groups of instances, and makes it necessary to remember to copy the file around the cluster when the password changes. Proposed changes ++++++++++++++++ We'll change the VNC password file to a vnc_password_file hypervisor parameter. This way it can have a cluster default, but also a different value for each instance. The VNC enabled hypervisors (xen and kvm) will publish all the password files in use through the cluster so that a redistribute-config will ship them to all nodes (see the Redistribute Config proposed changes above). The current VNC_PASSWORD_FILE constant will be removed, but its value will be used as the default HV_VNC_PASSWORD_FILE value, thus retaining backwards compatibility with 2.0. The code to export the list of VNC password files from the hypervisors to RedistributeConfig will be shared between the KVM and xen-hvm hypervisors. Disk/Net parameters ~~~~~~~~~~~~~~~~~~~ Current State and shortcomings ++++++++++++++++++++++++++++++ Currently disks and network interfaces have a few tweakable options and all the rest is left to a default we chose. We're finding that we need more and more to tweak some of these parameters, for example to disable barriers for DRBD devices, or allow striping for the LVM volumes. Moreover for many of these parameters it will be nice to have cluster-wide defaults, and then be able to change them per disk/interface. Proposed changes ++++++++++++++++ We will add new cluster level diskparams and netparams, which will contain all the tweakable parameters. All values which have a sensible cluster-wide default will go into this new structure while parameters which have unique values will not. Example of network parameters: - mode: bridge/route - link: for mode "bridge" the bridge to connect to, for mode route it can contain the routing table, or the destination interface Example of disk parameters: - stripe: lvm stripes - stripe_size: lvm stripe size - meta_flushes: drbd, enable/disable metadata "barriers" - data_flushes: drbd, enable/disable data "barriers" Some parameters are bound to be disk-type specific (drbd, vs lvm, vs files) or hypervisor specific (nic models for example), but for now they will all live in the same structure. Each component is supposed to validate only the parameters it knows about, and ganeti itself will make sure that no "globally unknown" parameters are added, and that no parameters have overridden meanings for different components. The parameters will be kept, as for the BEPARAMS into a "default" category, which will allow us to expand on by creating instance "classes" in the future. Instance classes is not a feature we plan implementing in 2.1, though. Global hypervisor parameters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Current State and shortcomings ++++++++++++++++++++++++++++++ Currently all hypervisor parameters are modifiable both globally (cluster level) and at instance level. However, there is no other framework to held hypervisor-specific parameters, so if we want to add a new class of hypervisor parameters that only makes sense on a global level, we have to change the hvparams framework. Proposed changes ++++++++++++++++ We add a new (global, not per-hypervisor) list of parameters which are not changeable on a per-instance level. The create, modify and query instance operations are changed to not allow/show these parameters. Furthermore, to allow transition of parameters to the global list, and to allow cleanup of inadverdently-customised parameters, the ``UpgradeConfig()`` method of instances will drop any such parameters from their list of hvparams, such that a restart of the master daemon is all that is needed for cleaning these up. Also, the framework is simple enough that if we need to replicate it at beparams level we can do so easily. Non bridged instances support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Current State and shortcomings ++++++++++++++++++++++++++++++ Currently each instance NIC must be connected to a bridge, and if the bridge is not specified the default cluster one is used. This makes it impossible to use the vif-route xen network scripts, or other alternative mechanisms that don't need a bridge to work. Proposed changes ++++++++++++++++ The new "mode" network parameter will distinguish between bridged interfaces and routed ones. When mode is "bridge" the "link" parameter will contain the bridge the instance should be connected to, effectively making things as today. The value has been migrated from a nic field to a parameter to allow for an easier manipulation of the cluster default. When mode is "route" the ip field of the interface will become mandatory, to allow for a route to be set. In the future we may want also to accept multiple IPs or IP/mask values for this purpose. We will evaluate possible meanings of the link parameter to signify a routing table to be used, which would allow for insulation between instance groups (as today happens for different bridges). For now we won't add a parameter to specify which network script gets called for which instance, so in a mixed cluster the network script must be able to handle both cases. The default kvm vif script will be changed to do so. (Xen doesn't have a ganeti provided script, so nothing will be done for that hypervisor) Introducing persistent UUIDs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Current state and shortcomings ++++++++++++++++++++++++++++++ Some objects in the Ganeti configurations are tracked by their name while also supporting renames. This creates an extra difficulty, because neither Ganeti nor external management tools can then track the actual entity, and due to the name change it behaves like a new one. Proposed changes part 1 +++++++++++++++++++++++ We will change Ganeti to use UUIDs for entity tracking, but in a staggered way. In 2.1, we will simply add an “uuid” attribute to each of the instances, nodes and cluster itself. This will be reported on instance creation for nodes, and on node adds for the nodes. It will be of course avaiblable for querying via the OpNodeQuery/Instance and cluster information, and via RAPI as well. Note that Ganeti will not provide any way to change this attribute. Upgrading from Ganeti 2.0 will automatically add an ‘uuid’ attribute to all entities missing it. Proposed changes part 2 +++++++++++++++++++++++ In the next release (e.g. 2.2), the tracking of objects will change from the name to the UUID internally, and externally Ganeti will accept both forms of identification; e.g. an RAPI call would be made either against ``/2/instances/foo.bar`` or against ``/2/instances/bb3b2e42…``. Since an FQDN must have at least a dot, and dots are not valid characters in UUIDs, we will not have namespace issues. Another change here is that node identification (during cluster operations/queries like master startup, “am I the master?” and similar) could be done via UUIDs which is more stable than the current hostname-based scheme. Internal tracking refers to the way the configuration is stored; a DRBD disk of an instance refers to the node name (so that IPs can be changed easily), but this is still a problem for name changes; thus these will be changed to point to the node UUID to ease renames. The advantages of this change (after the second round of changes), is that node rename becomes trivial, whereas today node rename would require a complete lock of all instances. Automated disk repairs infrastructure ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Replacing defective disks in an automated fashion is quite difficult with the current version of Ganeti. These changes will introduce additional functionality and interfaces to simplify automating disk replacements on a Ganeti node. Fix node volume group +++++++++++++++++++++ This is the most difficult addition, as it can lead to dataloss if it's not properly safeguarded. The operation must be done only when all the other nodes that have instances in common with the target node are fine, i.e. this is the only node with problems, and also we have to double-check that all instances on this node have at least a good copy of the data. This might mean that we have to enhance the GetMirrorStatus calls, and introduce and a smarter version that can tell us more about the status of an instance. Stop allocation on a given PV +++++++++++++++++++++++++++++ This is somewhat simple. First we need a "list PVs" opcode (and its associated logical unit) and then a set PV status opcode/LU. These in combination should allow both checking and changing the disk/PV status. Instance disk status ++++++++++++++++++++ This new opcode or opcode change must list the instance-disk-index and node combinations of the instance together with their status. This will allow determining what part of the instance is broken (if any). Repair instance +++++++++++++++ This new opcode/LU/RAPI call will run ``replace-disks -p`` as needed, in order to fix the instance status. It only affects primary instances; secondaries can just be moved away. Migrate node ++++++++++++ This new opcode/LU/RAPI call will take over the current ``gnt-node migrate`` code and run migrate for all instances on the node. Evacuate node ++++++++++++++ This new opcode/LU/RAPI call will take over the current ``gnt-node evacuate`` code and run replace-secondary with an iallocator script for all instances on the node. User-id pool ~~~~~~~~~~~~ In order to allow running different processes under unique user-ids on a node, we introduce the user-id pool concept. The user-id pool is a cluster-wide configuration parameter. It is a list of user-ids and/or user-id ranges that are reserved for running Ganeti processes (including KVM instances). The code guarantees that on a given node a given user-id is only handed out if there is no other process running with that user-id. Please note, that this can only be guaranteed if all processes in the system - that run under a user-id belonging to the pool - are started by reserving a user-id first. That can be accomplished either by using the RequestUnusedUid() function to get an unused user-id or by implementing the same locking mechanism. Implementation ++++++++++++++ The functions that are specific to the user-id pool feature are located in a separate module: ``lib/uidpool.py``. Storage ^^^^^^^ The user-id pool is a single cluster parameter. It is stored in the *Cluster* object under the ``uid_pool`` name as a list of integer tuples. These tuples represent the boundaries of user-id ranges. For single user-ids, the boundaries are equal. The internal user-id pool representation is converted into a string: a newline separated list of user-ids or user-id ranges. This string representation is distributed to all the nodes via the *ssconf* mechanism. This means that the user-id pool can be accessed in a read-only way on any node without consulting the master node or master candidate nodes. Initial value ^^^^^^^^^^^^^ The value of the user-id pool cluster parameter can be initialized at cluster initialization time using the ``gnt-cluster init --uid-pool <uid-pool definition> ...`` command. As there is no sensible default value for the user-id pool parameter, it is initialized to an empty list if no ``--uid-pool`` option is supplied at cluster init time. If the user-id pool is empty, the user-id pool feature is considered to be disabled. Manipulation ^^^^^^^^^^^^ The user-id pool cluster parameter can be modified from the command-line with the following commands: - ``gnt-cluster modify --uid-pool <uid-pool definition>`` - ``gnt-cluster modify --add-uids <uid-pool definition>`` - ``gnt-cluster modify --remove-uids <uid-pool definition>`` The ``--uid-pool`` option overwrites the current setting with the supplied ``<uid-pool definition>``, while ``--add-uids``/``--remove-uids`` adds/removes the listed uids or uid-ranges from the pool. The ``<uid-pool definition>`` should be a comma-separated list of user-ids or user-id ranges. A range should be defined by a lower and a higher boundary. The boundaries should be separated with a dash. The boundaries are inclusive. The ``<uid-pool definition>`` is parsed into the internal representation, sanity-checked and stored in the ``uid_pool`` attribute of the *Cluster* object. It is also immediately converted into a string (formatted in the input format) and distributed to all nodes via the *ssconf* mechanism. Inspection ^^^^^^^^^^ The current value of the user-id pool cluster parameter is printed by the ``gnt-cluster info`` command. The output format is accepted by the ``gnt-cluster modify --uid-pool`` command. Locking ^^^^^^^ The ``uidpool.py`` module provides a function (``RequestUnusedUid``) for requesting an unused user-id from the pool. This will try to find a random user-id that is not currently in use. The algorithm is the following: 1) Randomize the list of user-ids in the user-id pool 2) Iterate over this randomized UID list 3) Create a lock file (it doesn't matter if it already exists) 4) Acquire an exclusive POSIX lock on the file, to provide mutual exclusion for the following non-atomic operations 5) Check if there is a process in the system with the given UID 6) If there isn't, return the UID, otherwise unlock the file and continue the iteration over the user-ids The user can than start a new process with this user-id. Once a process is successfully started, the exclusive POSIX lock can be released, but the lock file will remain in the filesystem. The presence of such a lock file means that the given user-id is most probably in use. The lack of a uid lock file does not guarantee that there are no processes with that user-id. After acquiring the exclusive POSIX lock, ``RequestUnusedUid`` always performs a check to see if there is a process running with the given uid. A user-id can be returned to the pool, by calling the ``ReleaseUid`` function. This will remove the corresponding lock file. Note, that it doesn't check if there is any process still running with that user-id. The removal of the lock file only means that there are most probably no processes with the given user-id. This helps in speeding up the process of finding a user-id that is guaranteed to be unused. There is a convenience function, called ``ExecWithUnusedUid`` that wraps the execution of a function (or any callable) that requires a unique user-id. ``ExecWithUnusedUid`` takes care of requesting an unused user-id and unlocking the lock file. It also automatically returns the user-id to the pool if the callable raises an exception. Code examples +++++++++++++ Requesting a user-id from the pool: :: from ganeti import ssconf from ganeti import uidpool # Get list of all user-ids in the uid-pool from ssconf ss = ssconf.SimpleStore() uid_pool = uidpool.ParseUidPool(ss.GetUidPool(), separator="\n") all_uids = set(uidpool.ExpandUidPool(uid_pool)) uid = uidpool.RequestUnusedUid(all_uids) try: <start a process with the UID> # Once the process is started, we can release the file lock uid.Unlock() except ..., err: # Return the UID to the pool uidpool.ReleaseUid(uid) Releasing a user-id: :: from ganeti import uidpool uid = <get the UID the process is running under> <stop the process> uidpool.ReleaseUid(uid) External interface changes -------------------------- OS API ~~~~~~ The OS API of Ganeti 2.0 has been built with extensibility in mind. Since we pass everything as environment variables it's a lot easier to send new information to the OSes without breaking retrocompatibility. This section of the design outlines the proposed extensions to the API and their implementation. API Version Compatibility Handling ++++++++++++++++++++++++++++++++++ In 2.1 there will be a new OS API version (eg. 15), which should be mostly compatible with api 10, except for some new added variables. Since it's easy not to pass some variables we'll be able to handle Ganeti 2.0 OSes by just filtering out the newly added piece of information. We will still encourage OSes to declare support for the new API after checking that the new variables don't provide any conflict for them, and we will drop api 10 support after ganeti 2.1 has released. New Environment variables +++++++++++++++++++++++++ Some variables have never been added to the OS api but would definitely be useful for the OSes. We plan to add an INSTANCE_HYPERVISOR variable to allow the OS to make changes relevant to the virtualization the instance is going to use. Since this field is immutable for each instance, the os can tight the install without caring of making sure the instance can run under any virtualization technology. We also want the OS to know the particular hypervisor parameters, to be able to customize the install even more. Since the parameters can change, though, we will pass them only as an "FYI": if an OS ties some instance functionality to the value of a particular hypervisor parameter manual changes or a reinstall may be needed to adapt the instance to the new environment. This is not a regression as of today, because even if the OSes are left blind about this information, sometimes they still need to make compromises and cannot satisfy all possible parameter values. OS Variants +++++++++++ Currently we are assisting to some degree of "os proliferation" just to change a simple installation behavior. This means that the same OS gets installed on the cluster multiple times, with different names, to customize just one installation behavior. Usually such OSes try to share as much as possible through symlinks, but this still causes complications on the user side, especially when multiple parameters must be cross-matched. For example today if you want to install debian etch, lenny or squeeze you probably need to install the debootstrap OS multiple times, changing its configuration file, and calling it debootstrap-etch, debootstrap-lenny or debootstrap-squeeze. Furthermore if you have for example a "server" and a "development" environment which installs different packages/configuration files and must be available for all installs you'll probably end up with deboostrap-etch-server, debootstrap-etch-dev, debootrap-lenny-server, debootstrap-lenny-dev, etc. Crossing more than two parameters quickly becomes not manageable. In order to avoid this we plan to make OSes more customizable, by allowing each OS to declare a list of variants which can be used to customize it. The variants list is mandatory and must be written, one variant per line, in the new "variants.list" file inside the main os dir. At least one supported variant must be supported. When choosing the OS exactly one variant will have to be specified, and will be encoded in the os name as <OS-name>+<variant>. As for today it will be possible to change an instance's OS at creation or install time. The 2.1 OS list will be the combination of each OS, plus its supported variants. This will cause the name name proliferation to remain, but at least the internal OS code will be simplified to just parsing the passed variant, without the need for symlinks or code duplication. Also we expect the OSes to declare only "interesting" variants, but to accept some non-declared ones which a user will be able to pass in by overriding the checks ganeti does. This will be useful for allowing some variations to be used without polluting the OS list (per-OS documentation should list all supported variants). If a variant which is not internally supported is forced through, the OS scripts should abort. In the future (post 2.1) we may want to move to full fledged parameters all orthogonal to each other (for example "architecture" (i386, amd64), "suite" (lenny, squeeze, ...), etc). (As opposed to the variant, which is a single parameter, and you need a different variant for all the set of combinations you want to support). In this case we envision the variants to be moved inside of Ganeti and be associated with lists parameter->values associations, which will then be passed to the OS. IAllocator changes ~~~~~~~~~~~~~~~~~~ Current State and shortcomings ++++++++++++++++++++++++++++++ The iallocator interface allows creation of instances without manually specifying nodes, but instead by specifying plugins which will do the required computations and produce a valid node list. However, the interface is quite akward to use: - one cannot set a 'default' iallocator script - one cannot use it to easily test if allocation would succeed - some new functionality, such as rebalancing clusters and calculating capacity estimates is needed Proposed changes ++++++++++++++++ There are two area of improvements proposed: - improving the use of the current interface - extending the IAllocator API to cover more automation Default iallocator names ^^^^^^^^^^^^^^^^^^^^^^^^ The cluster will hold, for each type of iallocator, a (possibly empty) list of modules that will be used automatically. If the list is empty, the behaviour will remain the same. If the list has one entry, then ganeti will behave as if '--iallocator' was specifyed on the command line. I.e. use this allocator by default. If the user however passed nodes, those will be used in preference. If the list has multiple entries, they will be tried in order until one gives a successful answer. Dry-run allocation ^^^^^^^^^^^^^^^^^^ The create instance LU will get a new 'dry-run' option that will just simulate the placement, and return the chosen node-lists after running all the usual checks. Cluster balancing ^^^^^^^^^^^^^^^^^ Instance add/removals/moves can create a situation where load on the nodes is not spread equally. For this, a new iallocator mode will be implemented called ``balance`` in which the plugin, given the current cluster state, and a maximum number of operations, will need to compute the instance relocations needed in order to achieve a "better" (for whatever the script believes it's better) cluster. Cluster capacity calculation ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ In this mode, called ``capacity``, given an instance specification and the current cluster state (similar to the ``allocate`` mode), the plugin needs to return: - how many instances can be allocated on the cluster with that specification - on which nodes these will be allocated (in order) .. vim: set textwidth=72 :
{ "content_hash": "6ff4d09466f91649cd7749f2ef801bd5", "timestamp": "", "source": "github", "line_count": 1281, "max_line_length": 74, "avg_line_length": 38.34738485558157, "alnum_prop": 0.7490788429045457, "repo_name": "bitemyapp/ganeti", "id": "0251fefb0c42847afe3ae7c733847d4ad5c38e9d", "size": "49137", "binary": false, "copies": "36", "ref": "refs/heads/master", "path": "doc/design-2.1.rst", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Haskell", "bytes": "2583387" }, { "name": "Python", "bytes": "5892379" }, { "name": "Shell", "bytes": "117944" } ], "symlink_target": "" }
package model.solvers.mutation; import java.util.List; import java.util.Random; import model.population.Individual; import model.population.tree.Node; import model.population.tree.TreeGenome; public class TreeOperationMutationAlgorithm extends MutationAlgorithm { private static final boolean DEBUG = false; @Override void mutateIndividual(Individual ind, double mutationPercent) { Random rand = new Random(); double mutates = rand.nextDouble(); if (mutates > mutationPercent) return; TreeGenome genome = (TreeGenome) ind.getGenome(); List<Node> operations = genome.listNodes().left; if (DEBUG) { System.out.println("Indiv to mutate:"); System.out.println(genome); } if (genome.root.arity() == 0) { if (DEBUG) { System.out.println("Indiviual is terminal only. Aborting mutation."); } return; } Node selected = operations.get(rand.nextInt(operations.size())); Node mutated = selected.mutate(rand); if (selected.parent != null) { selected.parent.changeChild(selected, mutated); } else { genome.root = mutated; } if (DEBUG) { System.out.println("Indiv mutated:"); System.out.println(genome); } } @Override boolean isValid(Individual ind) { return ((TreeGenome)ind.getGenome()).isValidProgramTree(); } }
{ "content_hash": "efe2b6f26e027b8ef6978891f9521ad4", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 73, "avg_line_length": 23.339285714285715, "alnum_prop": 0.7000765110941086, "repo_name": "blorente/pevolinator-3000", "id": "8c7d1b143e49cddc251a74e4f34e453a52326282", "size": "1307", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/model/solvers/mutation/TreeOperationMutationAlgorithm.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "88651" }, { "name": "Java", "bytes": "144111" }, { "name": "Makefile", "bytes": "115" }, { "name": "TeX", "bytes": "8653" } ], "symlink_target": "" }
<div class='user_model_html'> {{ user.email }} </div>
{ "content_hash": "b1ed1a55ee3e60816ab50c1bcf6f19d0", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 29, "avg_line_length": 19, "alnum_prop": 0.5789473684210527, "repo_name": "sunlightlabs/the-phantom-mask", "id": "6589fb789fef776d07e4043a5fb307ad5aee1e53", "size": "57", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/templates/snippets/user.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "23100" }, { "name": "HTML", "bytes": "188341" }, { "name": "JavaScript", "bytes": "10838" }, { "name": "Python", "bytes": "125688" }, { "name": "Shell", "bytes": "4578" } ], "symlink_target": "" }
require 'openssl' require 'fileutils' require 'aws-sdk-core' require 'zlib' require 'zip' require 'instance_metadata' require 'open-uri' require 'uri' module InstanceAgent module Plugins module CodeDeployPlugin ARCHIVES_TO_RETAIN = 5 class CommandExecutor class << self attr_reader :command_methods end attr_reader :deployment_system InvalidCommandNameFailure = Class.new(Exception) def initialize(options = {}) @deployment_system = "CodeDeploy" @hook_mapping = options[:hook_mapping] if(!@hook_mapping.nil?) map end end def self.command(name, &blk) @command_methods ||= Hash.new method = Seahorse::Util.underscore(name).to_sym @command_methods[name] = method define_method(method, &blk) end def execute_command(command, deployment_specification) method_name = command_method(command.command_name) log(:debug, "Command #{command.command_name} maps to method #{method_name}") deployment_specification = DeploymentSpecification.parse(deployment_specification) log(:debug, "Successfully parsed the deployment spec") log(:debug, "Creating deployment root directory #{deployment_root_dir(deployment_specification)}") FileUtils.mkdir_p(deployment_root_dir(deployment_specification)) raise "Error creating deployment root directory #{deployment_root_dir(deployment_specification)}" if !File.directory?(deployment_root_dir(deployment_specification)) send(method_name, command, deployment_specification) end def command_method(command_name) raise InvalidCommandNameFailure.new("Unsupported command type: #{command_name}.") unless self.class.command_methods.has_key?(command_name) self.class.command_methods[command_name] end command "DownloadBundle" do |cmd, deployment_spec| cleanup_old_archives(deployment_spec.deployment_group_id) log(:debug, "Executing DownloadBundle command for execution #{cmd.deployment_execution_id}") case deployment_spec.revision_source when 'S3' download_from_s3( deployment_spec, deployment_spec.bucket, deployment_spec.key, deployment_spec.version, deployment_spec.etag) when 'GitHub' download_from_github( deployment_spec, deployment_spec.external_account, deployment_spec.repository, deployment_spec.commit_id, deployment_spec.anonymous, deployment_spec.external_auth_token) else # This should never happen since this is checked during creation of the deployment_spec object. raise "Unknown revision type '#{deployment_spec.revision_source}'" end FileUtils.rm_rf(File.join(deployment_root_dir(deployment_spec), 'deployment-archive')) bundle_file = artifact_bundle(deployment_spec) unpack_bundle(cmd, bundle_file, deployment_spec) nil end command "Install" do |cmd, deployment_spec| log(:debug, "Executing Install command for execution #{cmd.deployment_execution_id}") FileUtils.mkdir_p(deployment_instructions_dir) log(:debug, "Instructions directory created at #{deployment_instructions_dir}") installer = Installer.new(:deployment_instructions_dir => deployment_instructions_dir, :deployment_archive_dir => archive_root_dir(deployment_spec)) log(:debug, "Installing revision #{deployment_spec.revision} in "+ "instance group #{deployment_spec.deployment_group_id}") installer.install(deployment_spec.deployment_group_id, default_app_spec(deployment_spec)) update_last_successful_install(deployment_spec) nil end def map @hook_mapping.each_pair do |command, lifecycle_events| InstanceAgent::Plugins::CodeDeployPlugin::CommandExecutor.command command do |cmd, deployment_spec| #run the scripts script_log = ScriptLog.new lifecycle_events.each do |lifecycle_event| hook_command = HookExecutor.new(:lifecycle_event => lifecycle_event, :application_name => deployment_spec.application_name, :deployment_id => deployment_spec.deployment_id, :deployment_group_name => deployment_spec.deployment_group_name, :deployment_root_dir => deployment_root_dir(deployment_spec), :last_successful_deployment_dir => last_successful_deployment_dir(deployment_spec.deployment_group_id), :app_spec_path => app_spec_path) script_log.concat_log(hook_command.execute) end script_log.log end end end private def deployment_root_dir(deployment_spec) File.join(ProcessManager::Config.config[:root_dir], deployment_spec.deployment_group_id, deployment_spec.deployment_id) end private def deployment_instructions_dir() File.join(ProcessManager::Config.config[:root_dir], 'deployment-instructions') end private def archive_root_dir(deployment_spec) File.join(deployment_root_dir(deployment_spec), 'deployment-archive') end private def last_successful_deployment_dir(deployment_group) last_install_file_location = last_install_file_path(deployment_group) return unless File.exist? last_install_file_location File.open last_install_file_location do |f| return f.read.chomp end end private def default_app_spec(deployment_spec) default_app_spec_location = File.join(archive_root_dir(deployment_spec), app_spec_path) log(:debug, "Checking for app spec in #{default_app_spec_location}") app_spec = ApplicationSpecification::ApplicationSpecification.parse(File.read(default_app_spec_location)) end private def last_install_file_path(deployment_group) File.join(deployment_instructions_dir, "#{deployment_group}_last_successful_install") end private def download_from_s3(deployment_spec, bucket, key, version, etag) log(:debug, "Downloading artifact bundle from bucket '#{bucket}' and key '#{key}', version '#{version}', etag '#{etag}'") region = ENV['AWS_REGION'] || InstanceMetadata.region if InstanceAgent::Config.config[:log_aws_wire] s3 = Aws::S3::Client.new( :region => region, :ssl_ca_directory => ENV['AWS_SSL_CA_DIRECTORY'], # wire logs might be huge; customers should be careful about turning them on # allow 1GB of old wire logs in 64MB chunks :logger => Logger.new( File.join(InstanceAgent::Config.config[:log_dir], "#{InstanceAgent::Config.config[:program_name]}.aws_wire.log"), 16, 64 * 1024 * 1024), :http_wire_trace => true, :signature_version => 'v4') else s3 = Aws::S3::Client.new( :region => region, :ssl_ca_directory => ENV['AWS_SSL_CA_DIRECTORY'], :signature_version => 'v4') end File.open(artifact_bundle(deployment_spec), 'wb') do |file| if !version.nil? object = s3.get_object({:bucket => bucket, :key => key, :version_id => version}, :target => file) else object = s3.get_object({:bucket => bucket, :key => key}, :target => file) end if(!etag.nil? && !(etag.gsub(/"/,'').eql? object.etag.gsub(/"/,''))) msg = "Expected deployment artifact bundle etag #{etag} but was actually #{object.etag}" log(:error, msg) raise RuntimeError, msg end end log(:debug, "Download complete from bucket #{bucket} and key #{key}") end private def download_from_github(deployment_spec, account, repo, commit, anonymous, token) retries = 0 errors = [] if InstanceAgent::Platform.util.supported_oses.include? 'windows' deployment_spec.bundle_type = 'zip' format = 'zipball' else deployment_spec.bundle_type = 'tar' format = 'tarball' end uri = URI.parse("https://api.github.com/repos/#{account}/#{repo}/#{format}/#{commit}") options = {:ssl_verify_mode => OpenSSL::SSL::VERIFY_PEER, :redirect => true, :ssl_ca_cert => ENV['AWS_SSL_CA_DIRECTORY']} if anonymous log(:debug, "Anonymous GitHub repository download requested.") else log(:debug, "Authenticated GitHub repository download requested.") options.update({'Authorization' => "token #{token}"}) end begin # stream bundle file to disk log(:info, "Requesting URL: '#{uri.to_s}'") File.open(artifact_bundle(deployment_spec), 'w+b') do |file| uri.open(options) do |github| log(:debug, "GitHub response: '#{github.meta.to_s}'") while (buffer = github.read(8 * 1024 * 1024)) file.write buffer end end end rescue OpenURI::HTTPError => e log(:error, "Could not download bundle at '#{uri.to_s}'. Server returned code #{e.io.status[0]} '#{e.io.status[1]}'") log(:debug, "Server returned error response body #{e.io.string}") errors << "#{e.io.status[0]} '#{e.io.status[1]}'" if retries < 3 time_to_sleep = (10 * (3 ** retries)) # 10 sec, 30 sec, 90 sec log(:debug, "Retrying download in #{time_to_sleep} seconds.") sleep(time_to_sleep) retries += 1 retry else raise "Could not download bundle at '#{uri.to_s}' after #{retries} retries. Server returned codes: #{errors.join("; ")}." end end end private def unpack_bundle(cmd, bundle_file, deployment_spec) strip_leading_directory = deployment_spec.revision_source == 'GitHub' if strip_leading_directory # Extract to a temporary directory first so we can move the files around dst = File.join(deployment_root_dir(deployment_spec), 'deployment-archive-temp') actual_dst = File.join(deployment_root_dir(deployment_spec), 'deployment-archive') FileUtils.rm_rf(dst) else dst = File.join(deployment_root_dir(deployment_spec), 'deployment-archive') end if "tar".eql? deployment_spec.bundle_type InstanceAgent::Platform.util.extract_tar(bundle_file, dst) elsif "tgz".eql? deployment_spec.bundle_type InstanceAgent::Platform.util.extract_tgz(bundle_file, dst) elsif "zip".eql? deployment_spec.bundle_type Zip::File.open(bundle_file) do |zipfile| zipfile.each do |f| file_dst = File.join(dst, f.name) FileUtils.mkdir_p(File.dirname(file_dst)) zipfile.extract(f, file_dst) end end else # If the bundle was a generated through a Sabini Repository # it will be in tar format, and it won't have a bundle type InstanceAgent::Platform.util.extract_tar(bundle_file, dst) end if strip_leading_directory log(:info, "Stripping leading directory from archive bundle contents.") # Find leading directory to remove archive_root_files = Dir.entries(dst) archive_root_files.delete_if { |name| name == '.' || name == '..' } if (archive_root_files.size != 1) log(:warn, "Expected archive to have a single root directory containing the actual bundle root, but it had #{archive_root_files.size} entries instead. Skipping leading directory removal and using archive as is.") FileUtils.mv(dst, actual_dst) return end nested_archive_root = File.join(dst, archive_root_files[0]) log(:debug, "Actual archive root at #{nested_archive_root}. Moving to #{actual_dst}") FileUtils.mv(nested_archive_root, actual_dst) FileUtils.rmdir(dst) log(:debug, Dir.entries(actual_dst).join("; ")) end end private def update_last_successful_install(deployment_spec) File.open(last_install_file_path(deployment_spec.deployment_group_id), 'w+') do |f| f.write deployment_root_dir(deployment_spec) end end private def cleanup_old_archives(deployment_group) deployment_archives = Dir.entries(File.join(ProcessManager::Config.config[:root_dir], deployment_group)) # remove . and .. deployment_archives.delete(".") deployment_archives.delete("..") full_path_deployment_archives = deployment_archives.map{ |f| File.join(ProcessManager::Config.config[:root_dir], deployment_group, f)} extra = full_path_deployment_archives.size - ARCHIVES_TO_RETAIN return unless extra > 0 # Never remove the last successful deployment last_success = last_successful_deployment_dir(deployment_group) full_path_deployment_archives.delete(last_success) # Sort oldest -> newest, take first `extra` elements oldest_extra = full_path_deployment_archives.sort_by{ |f| File.mtime(f) }.take(extra) # Absolute path takes care of relative root directories directories = oldest_extra.map{ |f| File.absolute_path(f) } FileUtils.rm_rf(directories) end private def artifact_bundle(deployment_spec) File.join(deployment_root_dir(deployment_spec), 'bundle.tar') end private def app_spec_path 'appspec.yml' end private def description self.class.to_s end private def log(severity, message) raise ArgumentError, "Unknown severity #{severity.inspect}" unless InstanceAgent::Log::SEVERITIES.include?(severity.to_s) InstanceAgent::Log.send(severity.to_sym, "#{description}: #{message}") end end end end end
{ "content_hash": "a848258f34883cc4baf2ab9faf0e9b2e", "timestamp": "", "source": "github", "line_count": 367, "max_line_length": 226, "avg_line_length": 40.305177111716624, "alnum_prop": 0.5998512709572742, "repo_name": "skohar/aws-codedeploy-agent", "id": "7718c6be4d9a8f57f40716e8fb3a9e101bc318c1", "size": "14792", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "lib/instance_agent/plugins/codedeploy/command_executor.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Cucumber", "bytes": "530" }, { "name": "Ruby", "bytes": "321111" }, { "name": "Shell", "bytes": "2017" } ], "symlink_target": "" }
package com.myhitchhikingspots.model; import com.mapbox.geojson.Point; import java.util.List; /** * A part of a route where the user has traveled only hitchhiking or only non-hitchhiking. * E.g. If user starts traveling from A to D; * he hitchhikes from A to B, and from B to C; * but he goes non-hitchhiking (by bus, flight, walk, whatever) from C to D; * then his route from A to D consists in 2 sub routes: a hitchhiking SubRoute from A to C, and a non-hitchhiking SubRoute from C to D. * Notice that on this example, the SubRoute from A to C consisted of 2 hitchhiking spots, * but the number of 'points' on this SubRoute is 3, being the 2 first points the hitchhiking spots and the third point corresponds to (C) where the user has arrived. **/ public class SubRoute { /** * True if the user has traveled this sub route by hitchhiking; * False if he did it by another matter of transportation (by bus, walk, flight, etc). **/ public boolean isHitchhikingRoute; /** * All spots of the sub route as points. * If the last spot of the sub route was not the route's destination, then the last point on this list corresponds to the next spot on the route. * For more information, see {@link SubRoute} class summary. **/ public List<Point> points; }
{ "content_hash": "eb4517688b93b63a2c46b905c4ad81b7", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 166, "avg_line_length": 45.206896551724135, "alnum_prop": 0.7124332570556827, "repo_name": "Hitchwiki/MyHitchhikingSpots-for-Android", "id": "6b61f39656f151d067cd50e4d4c4bc3bba0a033a", "size": "1311", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/src/main/java/com/myhitchhikingspots/model/SubRoute.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "840721" } ], "symlink_target": "" }
[![Build Status](https://travis-ci.org/simon-whitehead/chemboy.svg?branch=master)](https://travis-ci.org/simon-whitehead/chemboy) ### chemboy ------------- A GameBoy (and hopefully in future, GameBoy Colour) emulator written in Rust. **This is very much a work in progress** and can only render non-Gameboy Colour games. It can only render Tetris up to the main menu and slightly beyond before crashing. If you're looking for a proper working emulator, you've come to the wrong place :) ### Progress GIF Here is the latest progress GIF. We can play Tetris! The entire instruction set is now supported! As such, we can now play Tetris without it crashing at all. The progress GIF below shows a 2 game session of Tetris. ![chemboy-progress-22-08-2017](https://user-images.githubusercontent.com/2499070/29525895-74f411e8-86d7-11e7-9c31-1ef7d3c27c24.gif) ### Project goals First and foremost this is a learning project for myself. Ideally, this emulator will be able to run Tetris in both the DMG and GBC versions. After that, I will move on to other games. ### Compiling If you want decent performance, you should compile and run this emulator with the `--release` flag: ``` cargo run --release -- --rom /path/to/rom.gb ``` ### Contributing If you want to contribute, please open an issue and discuss your planned contribution. I don't actually have a solid roadmap other than "support DMG Tetris" at the moment, so discussion around features is a good idea.
{ "content_hash": "40cc3c986e597ca18c1b58f5d6f98d4a", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 252, "avg_line_length": 43.23529411764706, "alnum_prop": 0.7564625850340136, "repo_name": "simon-whitehead/chemboy", "id": "731ce856790f1ed9024ca65e1660024da3625f8d", "size": "1470", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Rust", "bytes": "392569" } ], "symlink_target": "" }
<com.tle.beans.mime.MimeEntry> <id>39263</id> <institution> <id>39169</id> <uniqueId>0</uniqueId> <enabled>true</enabled> </institution> <extensions class="list"> <string>sv4cpio</string> </extensions> <type>application/x-sv4cpio</type> <attributes> <entry> <string>PluginIconPath</string> <string>icons/binary.png</string> </entry> </attributes> </com.tle.beans.mime.MimeEntry>
{ "content_hash": "117cf248bd8bd0a1d37fda5afa76255f", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 39, "avg_line_length": 23.88888888888889, "alnum_prop": 0.6511627906976745, "repo_name": "equella/Equella", "id": "c5b1c51d4b05ef19fb279da789789be8a0713141", "size": "430", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "autotest/Tests/tests/dinuk/institution/mimetypes/application_x-sv4cpio.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "402" }, { "name": "Batchfile", "bytes": "38432" }, { "name": "CSS", "bytes": "648823" }, { "name": "Dockerfile", "bytes": "2055" }, { "name": "FreeMarker", "bytes": "370046" }, { "name": "HTML", "bytes": "865667" }, { "name": "Java", "bytes": "27081020" }, { "name": "JavaScript", "bytes": "1673995" }, { "name": "PHP", "bytes": "821" }, { "name": "PLpgSQL", "bytes": "1363" }, { "name": "PureScript", "bytes": "307610" }, { "name": "Python", "bytes": "79871" }, { "name": "Scala", "bytes": "765981" }, { "name": "Shell", "bytes": "64170" }, { "name": "TypeScript", "bytes": "146564" }, { "name": "XSLT", "bytes": "510113" } ], "symlink_target": "" }
require 'contestify/judges/local/configuration' module Contestify module Judge class Local attr_accessor :problems_path, :working_root_path, :problems_paths def initialize(problems_path) @problems_path = problems_path @working_root_path = File.join(Dir.pwd, "contestify") FileUtils.mkdir_p @working_root_path copy_problems @problems_paths = Contestify::Local::Configuration.configure!(@working_root_path) end private ################################################ PRIVATE def copy_problems puts green "=> Copying problems from #{@problems_path}" if not File.directory?(@problems_path) raise Exception.new(red "#{@problems_path} is not a valid directory. Did you mistype something?") end Dir.chdir @problems_path FileUtils.cp_r Dir.glob("*"), @working_root_path end end end end
{ "content_hash": "400fb48c5c907b5fd8d5b2d08d8f35b0", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 107, "avg_line_length": 31.96551724137931, "alnum_prop": 0.6148867313915858, "repo_name": "nhocki/contestify", "id": "3d90ac46ca6d3a4c81d856d0ad0eb28381711c6d", "size": "927", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/contestify/judges/local/local.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "16030" } ], "symlink_target": "" }
function Out-HtmlImage { <# .SYNOPSIS Output embedded Html image. #> [CmdletBinding()] param ( ## PScribo Image object [Parameter(Mandatory, ValueFromPipeline)] [ValidateNotNull()] [System.Management.Automation.PSObject] $Image ) process { [System.Text.StringBuilder] $imageBuilder = New-Object -TypeName 'System.Text.StringBuilder' [ref] $null = $imageBuilder.AppendFormat('<div align="{0}">', $Image.Align).AppendLine() $imageBase64 = [System.Convert]::ToBase64String($Image.Bytes) [ref] $null = $imageBuilder.AppendFormat('<img src="data:{0};base64, {1}" alt="{2}" height="{3}" width="{4}" />', $Image.MimeType, $imageBase64, $Image.Text, $Image.Height, $Image.Width).AppendLine() [ref] $null = $imageBuilder.AppendLine('</div>') return $imageBuilder.ToString() } }
{ "content_hash": "3fef424b4fbed2470df338b6d92f436a", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 207, "avg_line_length": 37.041666666666664, "alnum_prop": 0.6231721034870641, "repo_name": "iainbrighton/PScribo", "id": "5c29a38c118197af684df7d67a064569d36d55e5", "size": "889", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "Src/Plugins/Html/Out-HtmlImage.ps1", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "43685" }, { "name": "PowerShell", "bytes": "564068" } ], "symlink_target": "" }