text
stringlengths 4
5.48M
| meta
stringlengths 14
6.54k
|
---|---|
;$(document).ready(function() {
$('input.autoUpdateCrud').click(function() {
update(this);
});
$('input.autoUpdateCrud + .picker-handle').click(function() {
update($(this).prev());
});
var update = function(input) {
setTimeout(function() {
$(input).parents('div.controls').find('input[type=hidden]').val($(input).attr('checked') == 'checked' ? 1 : 0).change();
$(input).next().children('label').text($(input).attr('checked') == 'checked' ? 'On' : 'Off');
}, 0);
}
}); | {'content_hash': 'dbccc6fb3c2b5ed33b0123d5b9a09ada', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 123, 'avg_line_length': 30.6875, 'alnum_prop': 0.594704684317719, 'repo_name': 'nabble/ajde', 'id': '11a77a081b3b7c4b1f6cc371cfa3ba403a5322f1', 'size': '491', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'core/modules/_core/res/js/crud/field/boolean.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '41263'}, {'name': 'CSS', 'bytes': '404939'}, {'name': 'HTML', 'bytes': '314692'}, {'name': 'JavaScript', 'bytes': '773406'}, {'name': 'PHP', 'bytes': '2039526'}]} |
<div class="row">
<div class="col-sm-6">
<div class="card card-block" style="max-width: none;">
<h3 class="card-title">Card Title</h3>
<p class="card-text">Example paragraph text to show how it's displayed within a card.</p>
<a href="#" class="btn btn-primary">button</a>
</div>
</div>
<div class="col-sm-6">
<div class="card card-block" style="max-width: none;">
<h3 class="card-title">Card Title</h3>
<p class="card-text">Example paragraph text to show how it's displayed within a card.</p>
<a href="#" class="btn btn-primary">button</a>
</div>
</div>
</div>
| {'content_hash': '9c90ac612adde044688f2450cc404b5b', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 92, 'avg_line_length': 36.9375, 'alnum_prop': 0.6395939086294417, 'repo_name': 'cyclopsproject/cyclops-core', 'id': 'a8fe492fe61155a2cbb4608efcbd200e8b5523fb', 'size': '591', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'src/website/partials/cards/card-sizing.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '196864'}, {'name': 'CoffeeScript', 'bytes': '33787'}, {'name': 'HTML', 'bytes': '441324'}, {'name': 'JavaScript', 'bytes': '343'}]} |
This package contains Blaze configuration UI templates for Weibo OAuth.
| {'content_hash': '79affc0a22e0c68c0f5383e953166107', 'timestamp': '', 'source': 'github', 'line_count': 1, 'max_line_length': 71, 'avg_line_length': 72.0, 'alnum_prop': 0.8472222222222222, 'repo_name': 'Hansoft/meteor', 'id': 'beb282c842b91b36dea3954b7b0d68950e85c6e1', 'size': '90', 'binary': False, 'copies': '11', 'ref': 'refs/heads/fav-96944', 'path': 'packages/weibo-config-ui/README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '6635'}, {'name': 'C', 'bytes': '235849'}, {'name': 'C#', 'bytes': '21958'}, {'name': 'C++', 'bytes': '203156'}, {'name': 'CSS', 'bytes': '39463'}, {'name': 'CoffeeScript', 'bytes': '34256'}, {'name': 'HTML', 'bytes': '147018'}, {'name': 'JavaScript', 'bytes': '5528500'}, {'name': 'PowerShell', 'bytes': '7750'}, {'name': 'Python', 'bytes': '10313'}, {'name': 'Shell', 'bytes': '41497'}]} |
/** 201. Bitwise AND of Numbers Range
Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive.
For example, given the range [5, 7], you should return 4.
Credits:Special thanks to @amrsaqr for adding this problem and creating all test cases.
**/
#include <iostream>
#include "../utils.h"
using namespace std;
class Solution {
public:
int rangeBitwiseAnd(int m, int n) {
}
};
int main() {
Solution s;
return 0;
}
| {'content_hash': '2d1d727cf1dac51bce0a84610bc1a84c', 'timestamp': '', 'source': 'github', 'line_count': 23, 'max_line_length': 117, 'avg_line_length': 21.82608695652174, 'alnum_prop': 0.6673306772908366, 'repo_name': 'zlsun/leetcode', 'id': '07e51c0bb007f8b244b66cb3aea4252016c1654e', 'size': '502', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '201. Bitwise AND of Numbers Range/solution.cpp', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C++', 'bytes': '403627'}, {'name': 'Python', 'bytes': '3373'}, {'name': 'Shell', 'bytes': '177'}]} |
``` diff
+namespace System.Buffers {
+ public abstract class ArrayPool<T> {
+ protected ArrayPool();
+ public static ArrayPool<T> Shared { [MethodImpl(AggressiveInlining)]get; }
+ public static ArrayPool<T> Create();
+ public static ArrayPool<T> Create(int maxArrayLength, int maxArraysPerBucket);
+ public abstract T[] Rent(int minimumLength);
+ public abstract void Return(T[] array, bool clearArray=false);
+ }
+}
```
| {'content_hash': '4f86b743750303e5a962b15c38a83fc0', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 87, 'avg_line_length': 36.15384615384615, 'alnum_prop': 0.6595744680851063, 'repo_name': 'leecow/core', 'id': 'cf65dbc45754f40ae0fbc91a61c4f20396808a36', 'size': '488', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'release-notes/1.0/1.0.0-api/1.0.0-api_System.Buffers.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Shell', 'bytes': '5074'}]} |
package br.com.stefanini;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.*;
import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*;
@Controller
@EnableAutoConfiguration
@SpringBootApplication
public class GittestApplication {
public static void main(String[] args) {
SpringApplication.run(GittestApplication.class, args);
}
@RequestMapping("/")
@ResponseBody
public String home(){
return "Hello Gitttest!";
}
}
| {'content_hash': '1c829170300e17cf9cb066d8ca2e87f4', 'timestamp': '', 'source': 'github', 'line_count': 23, 'max_line_length': 56, 'avg_line_length': 23.0, 'alnum_prop': 0.7618147448015122, 'repo_name': 'josecmoj/gittest', 'id': 'bdc3d0d77d921b074033af738ed4bb969403488d', 'size': '529', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/br/com/stefanini/GittestApplication.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '863'}]} |
package jme3test.water;
import com.jme3.app.SimpleApplication;
import com.jme3.asset.plugins.HttpZipLocator;
import com.jme3.asset.plugins.ZipLocator;
import com.jme3.light.DirectionalLight;
import com.jme3.material.Material;
import com.jme3.math.*;
import com.jme3.renderer.queue.RenderQueue.ShadowMode;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Quad;
import com.jme3.scene.shape.Sphere;
import com.jme3.util.SkyFactory;
import com.jme3.water.SimpleWaterProcessor;
import java.io.File;
public class TestSceneWater extends SimpleApplication {
// set default for applets
private static boolean useHttp = true;
public static void main(String[] args) {
TestSceneWater app = new TestSceneWater();
app.start();
}
public void simpleInitApp() {
this.flyCam.setMoveSpeed(10);
Node mainScene=new Node();
cam.setLocation(new Vector3f(-27.0f, 1.0f, 75.0f));
cam.setRotation(new Quaternion(0.03f, 0.9f, 0f, 0.4f));
// load sky
mainScene.attachChild(SkyFactory.createSky(assetManager,
"Textures/Sky/Bright/BrightSky.dds",
SkyFactory.EnvMapType.CubeMap));
File file = new File("wildhouse.zip");
if (file.exists()) {
useHttp = false;
}
// create the geometry and attach it
// load the level from zip or http zip
if (useHttp) {
assetManager.registerLocator("https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/jmonkeyengine/wildhouse.zip", HttpZipLocator.class);
} else {
assetManager.registerLocator("wildhouse.zip", ZipLocator.class);
}
Spatial scene = assetManager.loadModel("main.scene");
DirectionalLight sun = new DirectionalLight();
Vector3f lightDir=new Vector3f(-0.37352666f, -0.50444174f, -0.7784704f);
sun.setDirection(lightDir);
sun.setColor(ColorRGBA.White.clone().multLocal(2));
scene.addLight(sun);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
//add lightPos Geometry
Sphere lite=new Sphere(8, 8, 3.0f);
Geometry lightSphere=new Geometry("lightsphere", lite);
lightSphere.setMaterial(mat);
Vector3f lightPos=lightDir.multLocal(-400);
lightSphere.setLocalTranslation(lightPos);
rootNode.attachChild(lightSphere);
SimpleWaterProcessor waterProcessor = new SimpleWaterProcessor(assetManager);
waterProcessor.setReflectionScene(mainScene);
waterProcessor.setDebug(false);
waterProcessor.setLightPosition(lightPos);
waterProcessor.setRefractionClippingOffset(1.0f);
//setting the water plane
Vector3f waterLocation=new Vector3f(0,-20,0);
waterProcessor.setPlane(new Plane(Vector3f.UNIT_Y, waterLocation.dot(Vector3f.UNIT_Y)));
WaterUI waterUi=new WaterUI(inputManager, waterProcessor);
waterProcessor.setWaterColor(ColorRGBA.Brown);
waterProcessor.setDebug(true);
//lower render size for higher performance
// waterProcessor.setRenderSize(128,128);
//raise depth to see through water
// waterProcessor.setWaterDepth(20);
//lower the distortion scale if the waves appear too strong
// waterProcessor.setDistortionScale(0.1f);
//lower the speed of the waves if they are too fast
// waterProcessor.setWaveSpeed(0.01f);
Quad quad = new Quad(400,400);
//the texture coordinates define the general size of the waves
quad.scaleTextureCoordinates(new Vector2f(6f,6f));
Geometry water=new Geometry("water", quad);
water.setShadowMode(ShadowMode.Receive);
water.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
water.setMaterial(waterProcessor.getMaterial());
water.setLocalTranslation(-200, -20, 250);
rootNode.attachChild(water);
viewPort.addProcessor(waterProcessor);
mainScene.attachChild(scene);
rootNode.attachChild(mainScene);
}
}
| {'content_hash': 'ee87e2a6c04f53fa580f1d2c451150b6', 'timestamp': '', 'source': 'github', 'line_count': 114, 'max_line_length': 174, 'avg_line_length': 37.78947368421053, 'alnum_prop': 0.6833797585886723, 'repo_name': 'atomixnmc/jmonkeyengine', 'id': '4e0d8d6fc5c8874d3f88de60483583cde1a5724e', 'size': '5885', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'jme3-examples/src/main/java/jme3test/water/TestSceneWater.java', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '36480'}, {'name': 'C++', 'bytes': '336392'}, {'name': 'GLSL', 'bytes': '215258'}, {'name': 'HTML', 'bytes': '1599217'}, {'name': 'Java', 'bytes': '15010790'}, {'name': 'Makefile', 'bytes': '6895'}, {'name': 'Python', 'bytes': '307608'}, {'name': 'Shell', 'bytes': '1442'}]} |
NS_ASSUME_NONNULL_BEGIN
@interface BMLayoutComposedSupport : NSObject
@property (nonatomic, readonly, strong) BMLayoutComposedSupport *leading;
@property (nonatomic, readonly, strong) BMLayoutComposedSupport *trailing;
@property (nonatomic, readonly, strong) BMLayoutComposedSupport *left;
@property (nonatomic, readonly, strong) BMLayoutComposedSupport *right;
@property (nonatomic, readonly, strong) BMLayoutComposedSupport *top;
@property (nonatomic, readonly, strong) BMLayoutComposedSupport *bottom;
@property (nonatomic, readonly, strong) BMLayoutComposedSupport *width;
@property (nonatomic, readonly, strong) BMLayoutComposedSupport *height;
@property (nonatomic, readonly, strong) BMLayoutComposedSupport *centerX;
@property (nonatomic, readonly, strong) BMLayoutComposedSupport *centerY;
@property (nonatomic, readonly, strong) BMLayoutComposedSupport *firstBaseline;
@property (nonatomic, readonly, strong) BMLayoutComposedSupport *lastBaseline;
- (instancetype)initWithDelegate:(id<BMLayoutProtocol>)delegate composedAttributes:(NSArray *)attributes;
- (BMLayoutComposedConstraint *)equal:(id)value;
- (BMLayoutComposedConstraint *)greaterEqual:(id)value;
- (BMLayoutComposedConstraint *)lessEqual:(id)value;
- (BMLayoutComposedConstraint *)equal:(id)value constant:(CGFloat)c;
- (BMLayoutComposedConstraint *)greaterEqual:(id)value constant:(CGFloat)c;
- (BMLayoutComposedConstraint *)lessEqual:(id)value constant:(CGFloat)c;
@end
NS_ASSUME_NONNULL_END
| {'content_hash': '9b4c903520f563395059c1adf7615488', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 105, 'avg_line_length': 50.758620689655174, 'alnum_prop': 0.8145380434782609, 'repo_name': 'ACommonChinese/ZZSelfLearns', 'id': '3ee65a30e3b0766ea60c377aaaef1e77752e85e1', 'size': '1745', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '自动布局Anchor/BMAutoLayoutForMasonry/BMAutoLayoutForMasonry/BMLayout/BMLayoutComposedSupport.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '179'}, {'name': 'HTML', 'bytes': '7521'}, {'name': 'Objective-C', 'bytes': '476548'}, {'name': 'Python', 'bytes': '333'}, {'name': 'Rich Text Format', 'bytes': '96703'}, {'name': 'Ruby', 'bytes': '210'}]} |
<?php
namespace KairosDB;
/**
* Class QueryBuilder
* @package KairosDB
*/
class QueryBuilder
{
private $query = [];
private $currentMetric = [];
private $metrics = [];
/**
* @param string $metricName
* @return $this
*/
public function addMetric($metricName)
{
if ($this->currentMetric) {
$this->metrics[] = $this->currentMetric;
$this->currentMetric = [];
}
$this->currentMetric['name'] = $metricName;
return $this;
}
/**
* @param array $tags
* @return $this
*/
public function groupByValue($value)
{
$this->currentMetric['group_by'] = [
'name' => 'value',
'range_size' => $value,
];
return $this;
}
/**
* @param array $tags
* @return $this
*/
public function groupByTags(array $tags)
{
$this->currentMetric['group_by'] = [
'name' => 'tag',
'tags' => $tags,
];
return $this;
}
/**
* @param int $limit
* @return $this
*/
public function limit($limit)
{
$this->currentMetric['limit'] = $limit;
return $this;
}
/**
* @param array $tags
* @return $this
*/
public function tags(array $tags)
{
$this->currentMetric['tags'] = $tags;
return $this;
}
/**
* Can be :
* - absolute: in miliseconds
* - relative: array ['value'=> 1, 'unit'=>'days']
*
* @param mixed $start
* @return $this
*/
public function start($start)
{
$this->setTimeLimits('start', $start);
return $this;
}
/**
* Can be :
* - absolute: in miliseconds
* - relative: array ['value'=> 1, 'unit'=>'days']
*
* @param mixed $start
* @return $this
*/
public function end($end)
{
$this->setTimeLimits('end', $end);
return $this;
}
/**
* The amount of time in seconds to cache the output of the query.
* @param int $seconds
* @return $this
*/
public function cache($seconds)
{
$this->query['cache_time'] = $seconds;
return $this;
}
/**
* @return array $query
*/
public function build()
{
$this->metrics[] = $this->currentMetric;
$this->query['metrics'] = $this->metrics;
return $this->query;
}
/**
* todo: throw exceptions if unit/value have not been specified
* @param $type
* @param $limits
*/
private function setTimeLimits($type, $limits)
{
if (is_array($limits)) {
$this->query["{$type}_relative"]= [
'unit' => $limits['unit'],
'value' => $limits['value']
];
} elseif(is_numeric($limits)) {
$this->query["{$type}_absolute"] = $limits;
}
}
} | {'content_hash': '7bef685c87c0fcd08e3daddcc08807fc', 'timestamp': '', 'source': 'github', 'line_count': 153, 'max_line_length': 70, 'avg_line_length': 19.215686274509803, 'alnum_prop': 0.4782312925170068, 'repo_name': 'danibrutal/KairosDB-Client', 'id': 'e470a075f680d668afff84b67f0c92dbee706ea8', 'size': '2940', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/QueryBuilder.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '11939'}]} |
package com.amazonaws.services.rekognition.model.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.rekognition.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* FaceSearchSettingsMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class FaceSearchSettingsMarshaller {
private static final MarshallingInfo<String> COLLECTIONID_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("CollectionId").build();
private static final MarshallingInfo<Float> FACEMATCHTHRESHOLD_BINDING = MarshallingInfo.builder(MarshallingType.FLOAT)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("FaceMatchThreshold").build();
private static final FaceSearchSettingsMarshaller instance = new FaceSearchSettingsMarshaller();
public static FaceSearchSettingsMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(FaceSearchSettings faceSearchSettings, ProtocolMarshaller protocolMarshaller) {
if (faceSearchSettings == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(faceSearchSettings.getCollectionId(), COLLECTIONID_BINDING);
protocolMarshaller.marshall(faceSearchSettings.getFaceMatchThreshold(), FACEMATCHTHRESHOLD_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
| {'content_hash': 'd8dad9c187b925ce7898e0daf7d254ae', 'timestamp': '', 'source': 'github', 'line_count': 47, 'max_line_length': 123, 'avg_line_length': 37.61702127659574, 'alnum_prop': 0.747737556561086, 'repo_name': 'aws/aws-sdk-java', 'id': '94a6ce4e7aaeb78d33e754b15a340d8d5fd69216', 'size': '2348', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'aws-java-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceSearchSettingsMarshaller.java', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
<div class="form-group row row-cols-sm-2">
@isset($title)
<label for="{{$id}}" class="col-sm-2 text-wrap mt-2 form-label">
{{$title}}
<x-orchid-popover :content="$popover ?? ''"/>
@if(isset($attributes['required']) && $attributes['required'])
<sup class="text-danger">*</sup>
@endif
</label>
@endisset
<div class="col">
{{$slot}}
@if($errors->has($oldName))
<div class="invalid-feedback d-block">
<small>{{$errors->first($oldName)}}</small>
</div>
@elseif(isset($help))
<small class="form-text text-muted">{!!$help!!}</small>
@endif
</div>
</div>
@isset($hr)
<div class="line line-dashed border-bottom my-3"></div>
@endisset
| {'content_hash': '82eac217885f1591f27afe1d23b82a5e', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 74, 'avg_line_length': 28.06896551724138, 'alnum_prop': 0.4987714987714988, 'repo_name': 'TheOrchid/Platform', 'id': '48ae460153c5f0b10d259d144b67d431d3d05403', 'size': '814', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'resources/views/partials/fields/horizontal.blade.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '561650'}, {'name': 'HTML', 'bytes': '203309'}, {'name': 'PHP', 'bytes': '7652387'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>ES6 Boilerplate</title>
<script src="dist/bundle.js"></script>
</head>
<body>
<h1>ES6 Boilerplate</h1>
</body>
</html> | {'content_hash': '2480176b0fbf43d191a8ba2b34546cb2', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 74, 'avg_line_length': 21.25, 'alnum_prop': 0.638235294117647, 'repo_name': 'verdecchia/ES6-boilerplate', 'id': '222a1ee1f2bcf84e99abccf7ddf3ba8a4a7a067f', 'size': '340', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'index.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '340'}, {'name': 'JavaScript', 'bytes': '862'}]} |
package io.gravitee.am.gateway.handler.saml2;
import io.gravitee.am.gateway.handler.api.Protocol;
import io.gravitee.am.gateway.handler.api.ProtocolConfiguration;
import io.gravitee.am.gateway.handler.api.ProtocolProvider;
import io.gravitee.am.gateway.handler.saml2.spring.SAMLConfiguration;
/**
* @author Titouan COMPIEGNE (titouan.compiegne at graviteesource.com)
* @author GraviteeSource Team
*/
public class SAML2Protocol implements Protocol {
@Override
public Class<? extends ProtocolConfiguration> configuration() {
return SAMLConfiguration.class;
}
@Override
public Class<? extends ProtocolProvider> protocolProvider() {
return SAML2Provider.class;
}
}
| {'content_hash': '0ec11dd975f4affe16d42b4bd77c17b2', 'timestamp': '', 'source': 'github', 'line_count': 24, 'max_line_length': 70, 'avg_line_length': 29.541666666666668, 'alnum_prop': 0.763046544428773, 'repo_name': 'gravitee-io/graviteeio-access-management', 'id': '16e237d7df876453fcde0ffdaea80fe4d4b236b7', 'size': '1339', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'gravitee-am-gateway/gravitee-am-gateway-handler/gravitee-am-gateway-handler-saml2/src/main/java/io/gravitee/am/gateway/handler/saml2/SAML2Protocol.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '4027'}, {'name': 'CSS', 'bytes': '68813'}, {'name': 'Dockerfile', 'bytes': '4681'}, {'name': 'HTML', 'bytes': '419979'}, {'name': 'Java', 'bytes': '5954609'}, {'name': 'JavaScript', 'bytes': '4135'}, {'name': 'Makefile', 'bytes': '18654'}, {'name': 'Shell', 'bytes': '13103'}, {'name': 'TypeScript', 'bytes': '839905'}]} |
import { ComponentType } from 'react';
declare namespace BlockEdit {
// It is extremely unclear what props this component accepts.
type Props = any;
}
declare const BlockEdit: ComponentType<BlockEdit.Props>;
export default BlockEdit;
| {'content_hash': '5f6ad80a2fdcff1220eaca027054efc0', 'timestamp': '', 'source': 'github', 'line_count': 9, 'max_line_length': 65, 'avg_line_length': 27.11111111111111, 'alnum_prop': 0.7540983606557377, 'repo_name': 'mcliment/DefinitelyTyped', 'id': '260f77a432d07bab3ce6a0ad8b346e88692897a6', 'size': '244', 'binary': False, 'copies': '36', 'ref': 'refs/heads/master', 'path': 'types/wordpress__block-editor/components/block-edit.d.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CoffeeScript', 'bytes': '15'}, {'name': 'Protocol Buffer', 'bytes': '678'}, {'name': 'TypeScript', 'bytes': '17214021'}]} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Synchytrium trichophilum Correns & Tobler
### Remarks
null | {'content_hash': '117644a5148956c0cd575249410e2c1a', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 41, 'avg_line_length': 11.23076923076923, 'alnum_prop': 0.726027397260274, 'repo_name': 'mdoering/backbone', 'id': '4e739a948ac6ba695d272ae92c923cd34ec75a52', 'size': '211', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Fungi/Chytridiomycota/Chytridiomycetes/Chytridiales/Synchytriaceae/Synchytrium/Synchytrium trichophilum/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
@class NSArray, NSMutableSet, NSSet, NSString;
@interface DVTPlatformFamily : NSObject
{
NSString *_identifier;
NSString *_name;
NSMutableSet *_platforms;
NSArray *_osVersions;
}
+ (id)registerPlatformFamilyWithIdentifier:(id)arg1 name:(id)arg2;
+ (id)platformFamilyWithName:(id)arg1;
+ (id)platformFamilyWithIdentifier:(id)arg1;
+ (id)platformFamiliesSortedByName;
+ (id)allPlatformFamilies;
+ (BOOL)automaticallyNotifiesObserversForKey:(id)arg1;
+ (void)initialize;
@property(readonly, copy) NSString *identifier; // @synthesize identifier=_identifier;
- (void).cxx_destruct;
@property(readonly, copy) NSString *name; // @synthesize name=_name;
@property(readonly, copy) NSSet *platforms; // @synthesize platforms=_platforms;
- (void)addPlatform:(id)arg1;
@property(readonly) NSArray *osVersions; // @synthesize osVersions=_osVersions;
- (id)description;
@end
| {'content_hash': '48e0d871ab8f93c0562410eb1097acb5', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 86, 'avg_line_length': 32.666666666666664, 'alnum_prop': 0.753968253968254, 'repo_name': 'hejunbinlan/FBSimulatorControl', 'id': '287df7b057ff3e2ebef1054572e62f89ea17b828', 'size': '1043', 'binary': False, 'copies': '14', 'ref': 'refs/heads/master', 'path': 'PrivateHeaders/DVTFoundation/DVTPlatformFamily.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Objective-C', 'bytes': '767441'}, {'name': 'Ruby', 'bytes': '189'}]} |
id: use-entrypoint-loader
title: useEntryPointLoader
slug: /api-reference/use-entrypoint-loader/
---
import DocsRating from '@site/src/core/DocsRating';
import {OssOnly, FbInternalOnly} from 'docusaurus-plugin-internaldocs-fb/internal';
## `useEntryPointLoader`
Hook used to make it easy to safely work with EntryPoints, while avoiding data leaking into the Relay store. It will keep an EntryPoint reference in state, and dispose of it when it is no longer accessible via state.
<FbInternalOnly>
For more information, see the [Loading EntryPoints](https://www.internalfb.com/intern/wiki/Relay/Guides/entry-points/#loading-entrypoints) guide.
</FbInternalOnly>
```js
const {useEntryPointLoader, EntryPointContainer} = require('react-relay');
const ComponentEntryPoint = require('Component.entrypoint');
function EntryPointRevealer(): React.MixedElement {
const environmentProvider = useMyEnvironmentProvider();
const [
entryPointReference,
loadEntryPoint,
disposeEntryPoint,
] = useEntryPointLoader(environmentProvider, ComponentEntryPoint);
return (
<>
{
entryPointReference == null && (
<Button onClick={() => loadEntryPoint({})}>
Click to reveal the contents of the EntryPoint
</Button>
)
}
{
entryPointReference != null && (
<>
<Button onClick={disposeEntryPoint}>
Click to hide and dispose the EntryPoint.
</Button>
<Suspense fallback="Loading...">
<EntryPointContainer
entryPointReference={entryPointReference}
props={{}}
/>
</Suspense>
</>
)
}
</>
);
}
```
### Arguments
* `environmentProvider`: an object with a `getEnvironment` method that returns a relay environment.
* `EntryPoint`: the EntryPoint, usually acquired by importing a `.entrypoint.js` file.
### Flow Type Parameters
* `TEntryPointParams`: the type of the first argument to the `getPreloadProps` method of the EntryPoint.
* `TPreloadedQueries`: the type of the `queries` prop passed to the EntryPoint component.
* `TPreloadedEntryPoints`: the type of the `entryPoints` prop passed to the EntryPoint component.
* `TRuntimeProps`: the type of the `props` prop passed to `EntryPointContainer`. This object is passed down to the EntryPoint component, also as `props`.
* `TExtraProps`: if an EntryPoint's `getPreloadProps` method returns an object with an `extraProps` property, those extra props will be passed to the EntryPoint component as `extraProps` and have type `TExtraProps`.
* `TEntryPointComponent`: the type of the EntryPoint component.
* `TEntryPoint`: the type of the EntryPoint.
### Return value
A tuple containing the following values:
* `entryPointReference`: the EntryPoint reference, or `null`.
* `loadEntryPoint`: a callback that, when executed, will load an EntryPoint, which will be accessible as `entryPointReference`. If a previous EntryPoint was loaded, it will dispose of it. It may throw an error if called during React's render phase.
* Parameters
* `params: TEntryPointParams`: the params passed to the EntryPoint's `getPreloadProps` method.
* `disposeEntryPoint`: a callback that, when executed, will set `entryPointReference` to `null` and call `.dispose()` on it. It has type `() => void`. It should not be called during React's render phase.
### Behavior
* When the `loadEntryPoint` callback is called, each of an EntryPoint's associated queries (if it has any) will load their query data and query AST. Once both the query AST and the data are available, the data will be written to the store. This differs from the behavior of `prepareEntryPoint_DEPRECATED`, which would only write the data from an associated query to the store when that query was rendered with `usePreloadedQuery`.
* The EntryPoint reference's associated query references will be retained by the Relay store, preventing it the data from being garbage collected. Once you call `.dispose()` on the EntryPoint reference, the data from the associated queries is liable to be garbage collected.
* The `loadEntryPoint` callback may throw an error if it is called during React's render phase.
<DocsRating />
| {'content_hash': 'c15ba192b280d096168bb79ef066a27a', 'timestamp': '', 'source': 'github', 'line_count': 93, 'max_line_length': 430, 'avg_line_length': 45.86021505376344, 'alnum_prop': 0.7237983587338804, 'repo_name': 'xuorig/relay', 'id': '68853a4449a46c65e933541f56e7827d6fbc8246', 'size': '4269', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'website/versioned_docs/version-v11.0.0/api-reference/entrypoint-apis/use-entrypoint-loader.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '41275'}, {'name': 'HTML', 'bytes': '103086'}, {'name': 'JavaScript', 'bytes': '3487738'}, {'name': 'Python', 'bytes': '1730'}, {'name': 'Rust', 'bytes': '3847046'}, {'name': 'Shell', 'bytes': '1535'}, {'name': 'TypeScript', 'bytes': '26834'}]} |
"""
Functions for reversing a regular expression (used in reverse URL resolving).
Used internally by Django and not intended for external use.
This is not, and is not intended to be, a complete reg-exp decompiler. It
should be good enough for a large class of URLS, however.
"""
from __future__ import unicode_literals
from django.utils import six
from django.utils.six.moves import zip
# Mapping of an escape character to a representative of that class. So, e.g.,
# "\w" is replaced by "x" in a reverse URL. A value of None means to ignore
# this sequence. Any missing key is mapped to itself.
ESCAPE_MAPPINGS = {
"A": None,
"b": None,
"B": None,
"d": "0",
"D": "x",
"s": " ",
"S": "x",
"w": "x",
"W": "!",
"Z": None,
}
class Choice(list):
"""
Used to represent multiple possibilities at this point in a pattern string.
We use a distinguished type, rather than a list, so that the usage in the
code is clear.
"""
class Group(list):
"""
Used to represent a capturing group in the pattern string.
"""
class NonCapture(list):
"""
Used to represent a non-capturing group in the pattern string.
"""
def normalize(pattern):
"""
Given a reg-exp pattern, normalizes it to an iterable of forms that
suffice for reverse matching. This does the following:
(1) For any repeating sections, keeps the minimum number of occurrences
permitted (this means zero for optional groups).
(2) If an optional group includes parameters, include one occurrence of
that group (along with the zero occurrence case from step (1)).
(3) Select the first (essentially an arbitrary) element from any character
class. Select an arbitrary character for any unordered class (e.g. '.'
or '\w') in the pattern.
(5) Ignore comments and any of the reg-exp flags that won't change
what we construct ("iLmsu"). "(?x)" is an error, however.
(6) Raise an error on all other non-capturing (?...) forms (e.g.
look-ahead and look-behind matches) and any disjunctive ('|')
constructs.
Django's URLs for forward resolving are either all positional arguments or
all keyword arguments. That is assumed here, as well. Although reverse
resolving can be done using positional args when keyword args are
specified, the two cannot be mixed in the same reverse() call.
"""
# Do a linear scan to work out the special features of this pattern. The
# idea is that we scan once here and collect all the information we need to
# make future decisions.
result = []
non_capturing_groups = []
consume_next = True
pattern_iter = next_char(iter(pattern))
num_args = 0
# A "while" loop is used here because later on we need to be able to peek
# at the next character and possibly go around without consuming another
# one at the top of the loop.
try:
ch, escaped = next(pattern_iter)
except StopIteration:
return [('', [])]
try:
while True:
if escaped:
result.append(ch)
elif ch == '.':
# Replace "any character" with an arbitrary representative.
result.append(".")
elif ch == '|':
# FIXME: One day we'll should do this, but not in 1.0.
raise NotImplementedError('Awaiting Implementation')
elif ch == "^":
pass
elif ch == '$':
break
elif ch == ')':
# This can only be the end of a non-capturing group, since all
# other unescaped parentheses are handled by the grouping
# section later (and the full group is handled there).
#
# We regroup everything inside the capturing group so that it
# can be quantified, if necessary.
start = non_capturing_groups.pop()
inner = NonCapture(result[start:])
result = result[:start] + [inner]
elif ch == '[':
# Replace ranges with the first character in the range.
ch, escaped = next(pattern_iter)
result.append(ch)
ch, escaped = next(pattern_iter)
while escaped or ch != ']':
ch, escaped = next(pattern_iter)
elif ch == '(':
# Some kind of group.
ch, escaped = next(pattern_iter)
if ch != '?' or escaped:
# A positional group
name = "_%d" % num_args
num_args += 1
result.append(Group((("%%(%s)s" % name), name)))
walk_to_end(ch, pattern_iter)
else:
ch, escaped = next(pattern_iter)
if ch in "iLmsu#":
# All of these are ignorable. Walk to the end of the
# group.
walk_to_end(ch, pattern_iter)
elif ch == ':':
# Non-capturing group
non_capturing_groups.append(len(result))
elif ch != 'P':
# Anything else, other than a named group, is something
# we cannot reverse.
raise ValueError("Non-reversible reg-exp portion: '(?%s'" % ch)
else:
ch, escaped = next(pattern_iter)
if ch not in ('<', '='):
raise ValueError("Non-reversible reg-exp portion: '(?P%s'" % ch)
# We are in a named capturing group. Extra the name and
# then skip to the end.
if ch == '<':
terminal_char = '>'
# We are in a named backreference.
else:
terminal_char = ')'
name = []
ch, escaped = next(pattern_iter)
while ch != terminal_char:
name.append(ch)
ch, escaped = next(pattern_iter)
param = ''.join(name)
# Named backreferences have already consumed the
# parenthesis.
if terminal_char != ')':
result.append(Group((("%%(%s)s" % param), param)))
walk_to_end(ch, pattern_iter)
else:
result.append(Group((("%%(%s)s" % param), None)))
elif ch in "*?+{":
# Quanitifers affect the previous item in the result list.
count, ch = get_quantifier(ch, pattern_iter)
if ch:
# We had to look ahead, but it wasn't need to compute the
# quantifier, so use this character next time around the
# main loop.
consume_next = False
if count == 0:
if contains(result[-1], Group):
# If we are quantifying a capturing group (or
# something containing such a group) and the minimum is
# zero, we must also handle the case of one occurrence
# being present. All the quantifiers (except {0,0},
# which we conveniently ignore) that have a 0 minimum
# also allow a single occurrence.
result[-1] = Choice([None, result[-1]])
else:
result.pop()
elif count > 1:
result.extend([result[-1]] * (count - 1))
else:
# Anything else is a literal.
result.append(ch)
if consume_next:
ch, escaped = next(pattern_iter)
else:
consume_next = True
except StopIteration:
pass
except NotImplementedError:
# A case of using the disjunctive form. No results for you!
return [('', [])]
return list(zip(*flatten_result(result)))
def next_char(input_iter):
"""
An iterator that yields the next character from "pattern_iter", respecting
escape sequences. An escaped character is replaced by a representative of
its class (e.g. \w -> "x"). If the escaped character is one that is
skipped, it is not returned (the next character is returned instead).
Yields the next character, along with a boolean indicating whether it is a
raw (unescaped) character or not.
"""
for ch in input_iter:
if ch != '\\':
yield ch, False
continue
ch = next(input_iter)
representative = ESCAPE_MAPPINGS.get(ch, ch)
if representative is None:
continue
yield representative, True
def walk_to_end(ch, input_iter):
"""
The iterator is currently inside a capturing group. We want to walk to the
close of this group, skipping over any nested groups and handling escaped
parentheses correctly.
"""
if ch == '(':
nesting = 1
else:
nesting = 0
for ch, escaped in input_iter:
if escaped:
continue
elif ch == '(':
nesting += 1
elif ch == ')':
if not nesting:
return
nesting -= 1
def get_quantifier(ch, input_iter):
"""
Parse a quantifier from the input, where "ch" is the first character in the
quantifier.
Returns the minimum number of occurences permitted by the quantifier and
either None or the next character from the input_iter if the next character
is not part of the quantifier.
"""
if ch in '*?+':
try:
ch2, escaped = next(input_iter)
except StopIteration:
ch2 = None
if ch2 == '?':
ch2 = None
if ch == '+':
return 1, ch2
return 0, ch2
quant = []
while ch != '}':
ch, escaped = next(input_iter)
quant.append(ch)
quant = quant[:-1]
values = ''.join(quant).split(',')
# Consume the trailing '?', if necessary.
try:
ch, escaped = next(input_iter)
except StopIteration:
ch = None
if ch == '?':
ch = None
return int(values[0]), ch
def contains(source, inst):
"""
Returns True if the "source" contains an instance of "inst". False,
otherwise.
"""
if isinstance(source, inst):
return True
if isinstance(source, NonCapture):
for elt in source:
if contains(elt, inst):
return True
return False
def flatten_result(source):
"""
Turns the given source sequence into a list of reg-exp possibilities and
their arguments. Returns a list of strings and a list of argument lists.
Each of the two lists will be of the same length.
"""
if source is None:
return [''], [[]]
if isinstance(source, Group):
if source[1] is None:
params = []
else:
params = [source[1]]
return [source[0]], [params]
result = ['']
result_args = [[]]
pos = last = 0
for pos, elt in enumerate(source):
if isinstance(elt, six.string_types):
continue
piece = ''.join(source[last:pos])
if isinstance(elt, Group):
piece += elt[0]
param = elt[1]
else:
param = None
last = pos + 1
for i in range(len(result)):
result[i] += piece
if param:
result_args[i].append(param)
if isinstance(elt, (Choice, NonCapture)):
if isinstance(elt, NonCapture):
elt = [elt]
inner_result, inner_args = [], []
for item in elt:
res, args = flatten_result(item)
inner_result.extend(res)
inner_args.extend(args)
new_result = []
new_args = []
for item, args in zip(result, result_args):
for i_item, i_args in zip(inner_result, inner_args):
new_result.append(item + i_item)
new_args.append(args[:] + i_args)
result = new_result
result_args = new_args
if pos >= last:
piece = ''.join(source[last:])
for i in range(len(result)):
result[i] += piece
return result, result_args
| {'content_hash': '19476b8819b816fef7842d52c8196727', 'timestamp': '', 'source': 'github', 'line_count': 350, 'max_line_length': 92, 'avg_line_length': 36.34285714285714, 'alnum_prop': 0.5244496855345911, 'repo_name': 'errx/django', 'id': '60a0e7acfa202d4145cb92f40d587f059694c1a9', 'size': '12720', 'binary': False, 'copies': '6', 'ref': 'refs/heads/master', 'path': 'django/utils/regex_helper.py', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'CSS', 'bytes': '52957'}, {'name': 'JavaScript', 'bytes': '102668'}, {'name': 'Python', 'bytes': '9469402'}, {'name': 'Shell', 'bytes': '12137'}]} |
from unittest import TestCase
import json
# from http://json.org/JSON_checker/test/pass2.json
JSON = r'''
[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]
'''
class TestPass2(TestCase):
def test_parse(self):
# test in/out equivalence and parsing
res = json.loads(JSON)
out = json.dumps(res)
self.assertEqual(res, json.loads(out))
| {'content_hash': 'f66e4d9b925cfd2ef7a5cb1f78580491', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 52, 'avg_line_length': 26.571428571428573, 'alnum_prop': 0.5887096774193549, 'repo_name': 'xxd3vin/spp-sdk', 'id': '379117e9055b79775f3866d9eae90df9b5394715', 'size': '372', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'opt/Python27/Lib/json/tests/test_pass2.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '759663'}, {'name': 'C#', 'bytes': '9892'}, {'name': 'C++', 'bytes': '56155'}, {'name': 'CSS', 'bytes': '6226'}, {'name': 'F#', 'bytes': '3065'}, {'name': 'FORTRAN', 'bytes': '7795'}, {'name': 'Forth', 'bytes': '506'}, {'name': 'JavaScript', 'bytes': '163687'}, {'name': 'Makefile', 'bytes': '895'}, {'name': 'Pascal', 'bytes': '8738'}, {'name': 'Python', 'bytes': '22177886'}, {'name': 'Shell', 'bytes': '15704'}, {'name': 'Tcl', 'bytes': '2065501'}, {'name': 'Visual Basic', 'bytes': '481'}]} |
function New-PesterState
{
param (
[String[]]$TagFilter,
[String[]]$ExcludeTagFilter,
[String[]]$TestNameFilter,
[System.Management.Automation.SessionState]$SessionState,
[Switch]$Strict,
[Switch]$Quiet,
[object]$PesterOption
)
if ($null -eq $SessionState) { $SessionState = $ExecutionContext.SessionState }
if ($null -eq $PesterOption)
{
$PesterOption = New-PesterOption
}
elseif ($PesterOption -is [System.Collections.IDictionary])
{
try
{
$PesterOption = New-PesterOption @PesterOption
}
catch
{
throw
}
}
& $SafeCommands['New-Module'] -Name Pester -AsCustomObject -ScriptBlock {
param (
[String[]]$_tagFilter,
[String[]]$_excludeTagFilter,
[String[]]$_testNameFilter,
[System.Management.Automation.SessionState]$_sessionState,
[Switch]$Strict,
[Switch]$Quiet,
[object]$PesterOption
)
#public read-only
$TagFilter = $_tagFilter
$ExcludeTagFilter = $_excludeTagFilter
$TestNameFilter = $_testNameFilter
$script:SessionState = $_sessionState
$script:CurrentContext = ""
$script:CurrentDescribe = ""
$script:CurrentTest = ""
$script:Stopwatch = [System.Diagnostics.Stopwatch]::StartNew()
$script:MostRecentTimestamp = 0
$script:CommandCoverage = @()
$script:BeforeEach = @()
$script:AfterEach = @()
$script:BeforeAll = @()
$script:AfterAll = @()
$script:Strict = $Strict
$script:Quiet = $Quiet
$script:TestResult = @()
$script:TotalCount = 0
$script:Time = [timespan]0
$script:PassedCount = 0
$script:FailedCount = 0
$script:SkippedCount = 0
$script:PendingCount = 0
$script:InconclusiveCount = 0
$script:IncludeVSCodeMarker = $PesterOption.IncludeVSCodeMarker
$script:SafeCommands = @{}
$script:SafeCommands['New-Object'] = & (Pester\SafeGetCommand) -Name New-Object -Module Microsoft.PowerShell.Utility -CommandType Cmdlet
$script:SafeCommands['Select-Object'] = & (Pester\SafeGetCommand) -Name Select-Object -Module Microsoft.PowerShell.Utility -CommandType Cmdlet
$script:SafeCommands['Export-ModuleMember'] = & (Pester\SafeGetCommand) -Name Export-ModuleMember -Module Microsoft.PowerShell.Core -CommandType Cmdlet
$script:SafeCommands['Add-Member'] = & (Pester\SafeGetCommand) -Name Add-Member -Module Microsoft.PowerShell.Utility -CommandType Cmdlet
function EnterDescribe([string]$Name)
{
if ($CurrentDescribe)
{
throw & $SafeCommands['New-Object'] InvalidOperationException "You already are in Describe, you cannot enter Describe twice"
}
$script:CurrentDescribe = $Name
}
function LeaveDescribe
{
if ( $CurrentContext ) {
throw & $SafeCommands['New-Object'] InvalidOperationException "Cannot leave Describe before leaving Context"
}
$script:CurrentDescribe = $null
}
function EnterContext([string]$Name)
{
if ( -not $CurrentDescribe )
{
throw & $SafeCommands['New-Object'] InvalidOperationException "Cannot enter Context before entering Describe"
}
if ( $CurrentContext )
{
throw & $SafeCommands['New-Object'] InvalidOperationException "You already are in Context, you cannot enter Context twice"
}
if ($CurrentTest)
{
throw & $SafeCommands['New-Object'] InvalidOperationException "You already are in It, you cannot enter Context inside It"
}
$script:CurrentContext = $Name
}
function LeaveContext
{
if ($CurrentTest)
{
throw & $SafeCommands['New-Object'] InvalidOperationException "Cannot leave Context before leaving It"
}
$script:CurrentContext = $null
}
function EnterTest([string]$Name)
{
if (-not $script:CurrentDescribe)
{
throw & $SafeCommands['New-Object'] InvalidOperationException "Cannot enter It before entering Describe"
}
if ( $CurrentTest )
{
throw & $SafeCommands['New-Object'] InvalidOperationException "You already are in It, you cannot enter It twice"
}
$script:CurrentTest = $Name
}
function LeaveTest
{
$script:CurrentTest = $null
}
function AddTestResult
{
param (
[string]$Name,
[ValidateSet("Failed","Passed","Skipped","Pending","Inconclusive")]
[string]$Result,
[Nullable[TimeSpan]]$Time,
[string]$FailureMessage,
[string]$StackTrace,
[string] $ParameterizedSuiteName,
[System.Collections.IDictionary] $Parameters,
[System.Management.Automation.ErrorRecord] $ErrorRecord
)
$previousTime = $script:MostRecentTimestamp
$script:MostRecentTimestamp = $script:Stopwatch.Elapsed
if ($null -eq $Time)
{
$Time = $script:MostRecentTimestamp - $previousTime
}
if (-not $script:Strict)
{
$Passed = "Passed","Skipped","Pending" -contains $Result
}
else
{
$Passed = $Result -eq "Passed"
if (($Result -eq "Skipped") -or ($Result -eq "Pending"))
{
$FailureMessage = "The test failed because the test was executed in Strict mode and the result '$result' was translated to Failed."
$Result = "Failed"
}
}
$script:TotalCount++
$script:Time += $Time
switch ($Result)
{
Passed { $script:PassedCount++; break; }
Failed { $script:FailedCount++; break; }
Skipped { $script:SkippedCount++; break; }
Pending { $script:PendingCount++; break; }
Inconclusive { $script:InconclusiveCount++; break; }
}
$Script:TestResult += & $SafeCommands['New-Object'] -TypeName PsObject -Property @{
Describe = $CurrentDescribe
Context = $CurrentContext
Name = $Name
Passed = $Passed
Result = $Result
Time = $Time
FailureMessage = $FailureMessage
StackTrace = $StackTrace
ErrorRecord = $ErrorRecord
ParameterizedSuiteName = $ParameterizedSuiteName
Parameters = $Parameters
} | & $SafeCommands['Select-Object'] Describe, Context, Name, Result, Passed, Time, FailureMessage, StackTrace, ErrorRecord, ParameterizedSuiteName, Parameters
}
$ExportedVariables = "TagFilter",
"ExcludeTagFilter",
"TestNameFilter",
"TestResult",
"CurrentContext",
"CurrentDescribe",
"CurrentTest",
"SessionState",
"CommandCoverage",
"BeforeEach",
"AfterEach",
"BeforeAll",
"AfterAll",
"Strict",
"Quiet",
"Time",
"TotalCount",
"PassedCount",
"FailedCount",
"SkippedCount",
"PendingCount",
"InconclusiveCount",
"IncludeVSCodeMarker"
$ExportedFunctions = "EnterContext",
"LeaveContext",
"EnterDescribe",
"LeaveDescribe",
"EnterTest",
"LeaveTest",
"AddTestResult"
& $SafeCommands['Export-ModuleMember'] -Variable $ExportedVariables -function $ExportedFunctions
} -ArgumentList $TagFilter, $ExcludeTagFilter, $TestNameFilter, $SessionState, $Strict, $Quiet, $PesterOption |
& $SafeCommands['Add-Member'] -MemberType ScriptProperty -Name Scope -Value {
if ($this.CurrentTest) { 'It' }
elseif ($this.CurrentContext) { 'Context' }
elseif ($this.CurrentDescribe) { 'Describe' }
else { $null }
} -Passthru |
& $SafeCommands['Add-Member'] -MemberType ScriptProperty -Name ParentScope -Value {
$parentScope = $null
$scope = $this.Scope
if ($scope -eq 'It' -and $this.CurrentContext)
{
$parentScope = 'Context'
}
if ($null -eq $parentScope -and $scope -ne 'Describe' -and $this.CurrentDescribe)
{
$parentScope = 'Describe'
}
return $parentScope
} -PassThru
}
function Write-Describe
{
param (
[Parameter(mandatory=$true, valueFromPipeline=$true)]$Name
)
process {
Write-Screen Describing $Name -OutputType Header
}
}
function Write-Context
{
param (
[Parameter(mandatory=$true, valueFromPipeline=$true)]$Name
)
process {
$margin = " " * 3
Write-Screen ${margin}Context $Name -OutputType Header
}
}
function Write-PesterResult
{
param (
[Parameter(mandatory=$true, valueFromPipeline=$true)]
$TestResult
)
process {
$testDepth = if ( $TestResult.Context ) { 4 } elseif ( $TestResult.Describe ) { 1 } else { 0 }
$margin = " " * $TestDepth
$error_margin = $margin + " "
$output = $TestResult.name
$humanTime = Get-HumanTime $TestResult.Time.TotalSeconds
switch ($TestResult.Result)
{
Passed {
"$margin[+] $output $humanTime" | Write-Screen -OutputType Passed
break
}
Failed {
"$margin[-] $output $humanTime" | Write-Screen -OutputType Failed
$failureLines = $TestResult.ErrorRecord | ConvertTo-FailureLines
if ($Pester.IncludeVSCodeMarker)
{
$marker = $failureLines |
& $script:SafeCommands['Select-Object'] -First 1 -ExpandProperty Trace |
& $script:SafeCommands['Select-Object'] -First 1
Write-Screen -OutputType Failed $($marker -replace '(?m)^',$error_margin)
}
$failureLines |
& $SafeCommands['ForEach-Object'] {$_.Message + $_.Trace} |
& $SafeCommands['ForEach-Object'] { Write-Screen -OutputType Failed $($_ -replace '(?m)^',$error_margin) }
}
Skipped {
"$margin[!] $output $humanTime" | Write-Screen -OutputType Skipped
break
}
Pending {
"$margin[?] $output $humanTime" | Write-Screen -OutputType Pending
break
}
Inconclusive {
"$margin[?] $output $humanTime" | Write-Screen -OutputType Inconclusive
if ($testresult.FailureMessage) {
Write-Screen -OutputType Inconclusive $($TestResult.failureMessage -replace '(?m)^',$error_margin)
}
Write-Screen -OutputType Inconclusive $($TestResult.stackTrace -replace '(?m)^',$error_margin)
break
}
}
}
}
function ConvertTo-FailureLines
{
param (
[Parameter(mandatory=$true, valueFromPipeline=$true)]
$ErrorRecord
)
process {
$lines = & $script:SafeCommands['New-Object'] psobject -Property @{
Message = @()
Trace = @()
}
## convert the exception messages
$exception = $ErrorRecord.Exception
$exceptionLines = @()
while ($exception)
{
$exceptionName = $exception.GetType().Name
$thisLines = $exception.Message.Split([Environment]::NewLine, [System.StringSplitOptions]::RemoveEmptyEntries)
if ($ErrorRecord.FullyQualifiedErrorId -ne 'PesterAssertionFailed')
{
$thisLines[0] = "$exceptionName`: $($thisLines[0])"
}
[array]::Reverse($thisLines)
$exceptionLines += $thisLines
$exception = $exception.InnerException
}
[array]::Reverse($exceptionLines)
$lines.Message += $exceptionLines
if ($ErrorRecord.FullyQualifiedErrorId -eq 'PesterAssertionFailed')
{
$lines.Message += "$($ErrorRecord.TargetObject.Line)`: $($ErrorRecord.TargetObject.LineText)".Split([Environment]::NewLine, [System.StringSplitOptions]::RemoveEmptyEntries)
}
if ( -not ($ErrorRecord | & $SafeCommands['Get-Member'] -Name ScriptStackTrace) )
{
if ($ErrorRecord.FullyQualifiedErrorID -eq 'PesterAssertionFailed')
{
$lines.Trace += "at line: $($ErrorRecord.TargetObject.Line) in $($ErrorRecord.TargetObject.File)"
}
else
{
$lines.Trace += "at line: $($ErrorRecord.InvocationInfo.ScriptLineNumber) in $($ErrorRecord.InvocationInfo.ScriptName)"
}
return $lines
}
## convert the stack trace
$traceLines = $ErrorRecord.ScriptStackTrace.Split([Environment]::NewLine, [System.StringSplitOptions]::RemoveEmptyEntries)
$count = 0
# omit the lines internal to Pester
foreach ( $line in $traceLines )
{
if ( $line -match '^at (Invoke-Test|Context|Describe|InModuleScope|Invoke-Pester), .*\\Functions\\.*.ps1: line [0-9]*$' )
{
break
}
$count ++
}
$lines.Trace += $traceLines |
& $SafeCommands['Select-Object'] -First $count |
& $SafeCommands['Where-Object'] {
$_ -notmatch '^at Should<End>, .*\\Functions\\Assertions\\Should.ps1: line [0-9]*$' -and
$_ -notmatch '^at Assert-MockCalled, .*\\Functions\\Mock.ps1: line [0-9]*$'
}
return $lines
}
}
function Write-PesterReport
{
param (
[Parameter(mandatory=$true, valueFromPipeline=$true)]
$PesterState
)
Write-Screen "Tests completed in $(Get-HumanTime $PesterState.Time.TotalSeconds)"
Write-Screen ("Passed: {0} Failed: {1} Skipped: {2} Pending: {3} Inconclusive: {4}" -f
$PesterState.PassedCount,
$PesterState.FailedCount,
$PesterState.SkippedCount,
$PesterState.PendingCount,
$PesterState.InconclusiveCount)
}
function Write-Screen {
#wraps the Write-Host cmdlet to control if the output is written to screen from one place
param(
#Write-Host parameters
[Parameter(Position=0, ValueFromPipeline=$true, ValueFromRemainingArguments=$true)]
[Object] $Object,
[Switch] $NoNewline,
[Object] $Separator,
#custom parameters
[Switch] $Quiet = $pester.Quiet,
[ValidateSet("Failed","Passed","Skipped","Pending","Inconclusive","Header","Standard")]
[String] $OutputType = "Standard"
)
begin
{
if ($Quiet) { return }
#make the bound parameters compatible with Write-Host
if ($PSBoundParameters.ContainsKey('Quiet')) { $PSBoundParameters.Remove('Quiet') | & $SafeCommands['Out-Null'] }
if ($PSBoundParameters.ContainsKey('OutputType')) { $PSBoundParameters.Remove('OutputType') | & $SafeCommands['Out-Null'] }
if ($OutputType -ne "Standard")
{
#create the key first to make it work in strict mode
if (-not $PSBoundParameters.ContainsKey('ForegroundColor'))
{
$PSBoundParameters.Add('ForegroundColor', $null)
}
switch ($Host.Name)
{
#light background
"PowerGUIScriptEditorHost" {
$ColorSet = @{
Failed = [ConsoleColor]::Red
Passed = [ConsoleColor]::DarkGreen
Skipped = [ConsoleColor]::DarkGray
Pending = [ConsoleColor]::DarkCyan
Inconclusive = [ConsoleColor]::DarkCyan
Header = [ConsoleColor]::Magenta
}
}
#dark background
{ "Windows PowerShell ISE Host", "ConsoleHost" -contains $_ } {
$ColorSet = @{
Failed = [ConsoleColor]::Red
Passed = [ConsoleColor]::Green
Skipped = [ConsoleColor]::Gray
Pending = [ConsoleColor]::Cyan
Inconclusive = [ConsoleColor]::Cyan
Header = [ConsoleColor]::Magenta
}
}
default {
$ColorSet = @{
Failed = [ConsoleColor]::Red
Passed = [ConsoleColor]::DarkGreen
Skipped = [ConsoleColor]::Gray
Pending = [ConsoleColor]::Gray
Inconclusive = [ConsoleColor]::Gray
Header = [ConsoleColor]::Magenta
}
}
}
$PSBoundParameters.ForegroundColor = $ColorSet.$OutputType
}
try {
$outBuffer = $null
if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer))
{
$PSBoundParameters['OutBuffer'] = 1
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('Write-Host', [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters }
$steppablePipeline = $scriptCmd.GetSteppablePipeline($myInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
throw
}
}
process
{
if ($Quiet) { return }
try {
$steppablePipeline.Process($_)
} catch {
throw
}
}
end
{
if ($Quiet) { return }
try {
$steppablePipeline.End()
} catch {
throw
}
}
}
| {'content_hash': 'fa187d6c54ba8d87a434fad2a6011fc0', 'timestamp': '', 'source': 'github', 'line_count': 545, 'max_line_length': 184, 'avg_line_length': 34.63119266055046, 'alnum_prop': 0.5311009854826746, 'repo_name': 'asipe/HashBrownZ', 'id': '560cb27a65630d1aed8e7e5f9dd456059fb5a8b4', 'size': '18874', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'thirdparty/pester_bin/Functions/PesterState.ps1', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PowerShell', 'bytes': '36573'}]} |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('advertisements', '0002_auto_20151114_1810'),
]
operations = [
migrations.AddField(
model_name='advertisement',
name='Image1',
field=models.TextField(null=True, blank=True),
),
]
| {'content_hash': '31ef209d2d1f47809a502ebd07a0b9b1', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 58, 'avg_line_length': 22.11111111111111, 'alnum_prop': 0.6055276381909548, 'repo_name': 'mdsafwan/Deal-My-Stuff', 'id': '4a9a7a4e894247c1f12ac8fb81fbf9542fcc0188', 'size': '422', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'advertisements/migrations/0003_advertisement_image1.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '898'}, {'name': 'C', 'bytes': '521537'}, {'name': 'C++', 'bytes': '125678'}, {'name': 'CSS', 'bytes': '127882'}, {'name': 'HTML', 'bytes': '172987'}, {'name': 'JavaScript', 'bytes': '256471'}, {'name': 'PowerShell', 'bytes': '8104'}, {'name': 'Python', 'bytes': '7186078'}]} |
using System;
using System.Collections.Generic;
using System.Net.Mail;
using System.Reflection;
using System.Text;
using RazorMailMessage.TemplateResolvers;
namespace RazorMailMessage.Example
{
class Program
{
// Provide your smtp settings here
// Smtp4Dev is a nice dummy smtp server for localhost to quickly view the messages without actually sending them.
// http://smtp4dev.codeplex.com/
private static readonly SmtpClient SmtpClient = new SmtpClient("localhost", 8025);
private const string FromEmailAddress = "[email protected]";
private const string ToEmailAddress = "[email protected]";
static void Main()
{
string option;
do
{
// Create menu
var menu = new StringBuilder();
menu.AppendLine("(1) Send mail message with default settings");
menu.AppendLine("(2) Send mail message with specific assembly and namespace");
menu.AppendLine("(3) Send mail message with embedded image");
menu.AppendLine("(4) Send mail message with layout and sections");
menu.AppendLine("(x) Exit");
// Display menu and wait for user input
Console.WriteLine(menu);
option = Console.ReadKey().KeyChar.ToString();
Console.WriteLine();
ExecuteOption(option);
Console.WriteLine();
} while (option.ToLower() != "x");
}
private static void ExecuteOption(string option)
{
switch (option.ToLower())
{
case "1":
SendMailMessageWithDefaultSettings();
break;
case "2":
SendMailMessageWithSpecificAssemblyAndNameSpace();
break;
case "3":
SendMailMessageWithEmbeddedImage();
break;
case "4":
SendMailMessageWithLayoutAndSections();
break;
case "x":
break;
default:
Console.WriteLine("That's not an option!");
break;
}
}
private static void SendMailMessageWithDefaultSettings()
{
var razorMailMessageFactory = new RazorMailMessageFactory();
var mailMessage = razorMailMessageFactory.Create("MailTemplates.SendMailMessageWithDefaultSettings.TestTemplate.cshtml", new { Name = "Robin" });
mailMessage.From = new MailAddress(FromEmailAddress);
mailMessage.To.Add(new MailAddress(ToEmailAddress));
mailMessage.Subject = "Test template";
SmtpClient.Send(mailMessage);
}
private static void SendMailMessageWithSpecificAssemblyAndNameSpace()
{
var razorMailMessageFactory = new RazorMailMessageFactory
(
new DefaultTemplateResolver(Assembly.GetExecutingAssembly(), "MailTemplates")
);
var mailMessage = razorMailMessageFactory.Create("SendMailMessageWithSpecificAssemblyAndNameSpace.TestTemplate.cshtml", new { Name = "Robin" });
mailMessage.From = new MailAddress(FromEmailAddress);
mailMessage.To.Add(new MailAddress(ToEmailAddress));
mailMessage.Subject = "Test template";
SmtpClient.Send(mailMessage);
}
private static void SendMailMessageWithLayoutAndSections()
{
// Use namespace: MailTemplates.SendMailMessageWithEmbeddedImage
var razorMailMessageFactory = new RazorMailMessageFactory
(
new DefaultTemplateResolver("MailTemplates")
);
var mailMessage = razorMailMessageFactory.Create
(
"SendMailMessageWithLayoutAndSections.TestTemplate.cshtml",
new { Name = "Robin" }
);
mailMessage.From = new MailAddress(FromEmailAddress);
mailMessage.To.Add(new MailAddress(ToEmailAddress));
mailMessage.Subject = "Test template";
SmtpClient.Send(mailMessage);
}
private static void SendMailMessageWithEmbeddedImage()
{
// Use namespace: MailTemplates.SendMailMessageWithEmbeddedImage
var razorMailMessageFactory = new RazorMailMessageFactory
(
new DefaultTemplateResolver("MailTemplates")
);
var mailMessage = razorMailMessageFactory.Create
(
"SendMailMessageWithEmbeddedImage.TestTemplate.cshtml",
new { Name = "Robin" },
new List<LinkedResource> { new LinkedResource("MailTemplates/SendMailMessageWithEmbeddedImage/chuck_mailheader.png") { ContentId = "chuckNorrisImage" } }
);
mailMessage.From = new MailAddress(FromEmailAddress);
mailMessage.To.Add(new MailAddress(ToEmailAddress));
mailMessage.Subject = "Test template";
SmtpClient.Send(mailMessage);
}
}
}
| {'content_hash': 'ffe394fbdf2c37a0cca9bdd7887e1812', 'timestamp': '', 'source': 'github', 'line_count': 139, 'max_line_length': 169, 'avg_line_length': 37.54676258992806, 'alnum_prop': 0.5870856485916842, 'repo_name': 'robinvanderknaap/RazorMailMessage', 'id': '464af040ce534feb56412b2428e8de0111215e90', 'size': '5221', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'src/RazorMailMessage.Example/Program.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '44500'}, {'name': 'Shell', 'bytes': '133'}]} |
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Slechte vraag</title>
<style type="text/css">
/*<![CDATA[*/
body {
font-family: "Verdana";
font-weight: normal;
color: black;
background-color: white;
}
h1 {
font-family: "Verdana";
font-weight: normal;
font-size: 18pt;
color: red
}
h2 {
font-family: "Verdana";
font-weight: normal;
font-size: 14pt;
color: maroon
}
h3 {
font-family: "Verdana";
font-weight: bold;
font-size: 11pt
}
p {
font-family: "Verdana";
font-weight: normal;
color: black;
font-size: 9pt;
margin-top: -5px
}
.version {
color: gray;
font-size: 8pt;
border-top: 1px solid #aaaaaa;
}
/*]]>*/
</style>
</head>
<body>
<h1>Ongeldige aanvraag</h1>
<h2><?php echo nl2br(CHtml::encode($data['message'])); ?></h2>
<p>Uw browser (of proxy) stuurde een aanvraag die deze server niet kon
begrijpen door een slechte syntax. Herhaal deze aanvraag niet zonder
correcties aub.</p>
<p>Als u van mening bent dat dit een server fout is, neem dan a.u.b. contact op met de <?php echo $data['admin']; ?> </p>
<div class="version"><?php echo date('Y-m-d H:i:s',$data['time']) .' '. $data['version']; ?></div>
</body>
</html> | {'content_hash': '9c98ed6585d2ec9b4cc3401dc091460d', 'timestamp': '', 'source': 'github', 'line_count': 60, 'max_line_length': 122, 'avg_line_length': 23.05, 'alnum_prop': 0.6601590744757773, 'repo_name': 'wangrunxinyes/shibingyan', 'id': '17cb302648517aa5b9ad89434f3c2f9a6fc94e3c', 'size': '1383', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'framework/views/nl/error400.php', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'ASP', 'bytes': '42523'}, {'name': 'ApacheConf', 'bytes': '3094'}, {'name': 'Batchfile', 'bytes': '1541'}, {'name': 'CSS', 'bytes': '5893896'}, {'name': 'CoffeeScript', 'bytes': '167262'}, {'name': 'Go', 'bytes': '23119'}, {'name': 'HTML', 'bytes': '5523036'}, {'name': 'Java', 'bytes': '10698'}, {'name': 'JavaScript', 'bytes': '7834228'}, {'name': 'PHP', 'bytes': '23698146'}, {'name': 'Python', 'bytes': '19947'}, {'name': 'Ruby', 'bytes': '1156'}, {'name': 'Shell', 'bytes': '940'}]} |
require 'spec_helper'
require 'component_helper'
require 'java_buildpack/framework/dyadic_ekm_security_provider'
describe JavaBuildpack::Framework::DyadicEkmSecurityProvider do
include_context 'component_helper'
it 'does not detect without dyadic-n/a service' do
expect(component.detect).to be_nil
end
context do
before do
allow(services).to receive(:one_service?)
.with(/dyadic/, 'ca', 'key', 'recv_timeout', 'retries', 'send_timeout', 'servers')
.and_return(true)
allow(services).to receive(:find_service).and_return(
'credentials' => {
'ca' => "-----BEGIN CERTIFICATE-----\ntest-client-cert\n-----END CERTIFICATE-----",
'key' => "-----BEGIN RSA PRIVATE KEY-----\ntest-client-private-key\n-----END RSA PRIVATE KEY-----",
'recv_timeout' => 1,
'retries' => 2,
'send_timeout' => 3,
'servers' => 'server-1,server-2'
}
)
end
it 'detects with dyadic-n/a service' do
expect(component.detect).to eq("dyadic-ekm-security-provider=#{version}")
end
it 'unpacks the dyadic tar',
cache_fixture: 'stub-dyadic-ekm-security-provider.tar.gz' do
component.compile
expect(sandbox + 'usr/lib/dsm/dsm-advapi-1.0.jar').to exist
expect(sandbox + 'usr/lib').to exist
end
it 'write certificate and key files',
cache_fixture: 'stub-dyadic-ekm-security-provider.tar.gz' do
component.compile
expect(sandbox + 'etc/dsm/ca.crt').to exist
expect(sandbox + 'etc/dsm/key.pem').to exist
check_file_contents(sandbox + 'etc/dsm/ca.crt',
'spec/fixtures/framework_dyadic_ekm_security_provider/ca.crt')
check_file_contents(sandbox + 'etc/dsm/key.pem',
'spec/fixtures/framework_dyadic_ekm_security_provider/key.pem')
end
it 'writes configuration',
cache_fixture: 'stub-dyadic-ekm-security-provider.tar.gz' do
component.compile
expect(sandbox + 'etc/dsm/client.conf').to exist
check_file_contents(sandbox + 'etc/dsm/client.conf',
'spec/fixtures/framework_dyadic_ekm_security_provider/client.conf')
end
it 'updates environment variables' do
component.release
expect(environment_variables).to include('LD_LIBRARY_PATH=$PWD/.java-buildpack/' \
'dyadic_ekm_security_provider/usr/lib')
end
it 'adds security provider',
cache_fixture: 'stub-dyadic-ekm-security-provider.tar.gz' do
component.compile
expect(security_providers).to include('com.dyadicsec.provider.DYCryptoProvider')
end
it 'adds extension directory' do
component.release
expect(extension_directories).to include(droplet.sandbox + 'ext')
end
def check_file_contents(actual, expected)
expect(File.read(actual)).to eq File.read(expected)
end
end
end
| {'content_hash': 'e5be358ccd9e95e4de9ed6c951824e90', 'timestamp': '', 'source': 'github', 'line_count': 93, 'max_line_length': 118, 'avg_line_length': 32.064516129032256, 'alnum_prop': 0.6237424547283702, 'repo_name': 'afalak/java-buildpack', 'id': '428a0d56e0ecfecf47ae4913e9cad563c4b24459', 'size': '3615', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'spec/java_buildpack/framework/dyadic_ekm_security_provider_spec.rb', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Ruby', 'bytes': '590477'}, {'name': 'Shell', 'bytes': '6049'}]} |
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/gpio.h>
#include <linux/slab.h>
#include <linux/of_gpio.h>
#include <linux/platform_device.h>
#include <linux/irq.h>
#include <media/rc-core.h>
#include <media/gpio-ir-recv.h>
#define GPIO_IR_DRIVER_NAME "gpio-rc-recv"
#define GPIO_IR_DEVICE_NAME "gpio_ir_recv"
struct gpio_rc_dev {
struct rc_dev *rcdev;
int gpio_nr;
bool active_low;
};
#ifdef CONFIG_OF
/*
* Translate OpenFirmware node properties into platform_data
*/
static int gpio_ir_recv_get_devtree_pdata(struct device *dev,
struct gpio_ir_recv_platform_data *pdata)
{
struct device_node *np = dev->of_node;
enum of_gpio_flags flags;
int gpio;
gpio = of_get_gpio_flags(np, 0, &flags);
if (gpio < 0) {
if (gpio != -EPROBE_DEFER)
dev_err(dev, "Failed to get gpio flags (%d)\n", gpio);
return gpio;
}
pdata->gpio_nr = gpio;
pdata->active_low = (flags & OF_GPIO_ACTIVE_LOW);
/* probe() takes care of map_name == NULL or allowed_protos == 0 */
pdata->map_name = of_get_property(np, "linux,rc-map-name", NULL);
pdata->allowed_protos = 0;
return 0;
}
static struct of_device_id gpio_ir_recv_of_match[] = {
{ .compatible = "gpio-ir-receiver", },
{ },
};
MODULE_DEVICE_TABLE(of, gpio_ir_recv_of_match);
#else /* !CONFIG_OF */
#define gpio_ir_recv_get_devtree_pdata(dev, pdata) (-ENOSYS)
#endif
static irqreturn_t gpio_ir_recv_irq(int irq, void *dev_id)
{
struct gpio_rc_dev *gpio_dev = dev_id;
int gval;
int rc = 0;
enum raw_event_type type = IR_SPACE;
gval = gpio_get_value_cansleep(gpio_dev->gpio_nr);
if (gval < 0)
goto err_get_value;
if (gpio_dev->active_low)
gval = !gval;
if (gval == 1)
type = IR_PULSE;
rc = ir_raw_event_store_edge(gpio_dev->rcdev, type);
if (rc < 0)
goto err_get_value;
ir_raw_event_handle(gpio_dev->rcdev);
err_get_value:
return IRQ_HANDLED;
}
static int gpio_ir_recv_probe(struct platform_device *pdev)
{
struct gpio_rc_dev *gpio_dev;
struct rc_dev *rcdev;
const struct gpio_ir_recv_platform_data *pdata =
pdev->dev.platform_data;
int rc;
if (pdev->dev.of_node) {
struct gpio_ir_recv_platform_data *dtpdata =
devm_kzalloc(&pdev->dev, sizeof(*dtpdata), GFP_KERNEL);
if (!dtpdata)
return -ENOMEM;
rc = gpio_ir_recv_get_devtree_pdata(&pdev->dev, dtpdata);
if (rc)
return rc;
pdata = dtpdata;
}
if (!pdata)
return -EINVAL;
if (pdata->gpio_nr < 0)
return -EINVAL;
gpio_dev = kzalloc(sizeof(struct gpio_rc_dev), GFP_KERNEL);
if (!gpio_dev)
return -ENOMEM;
rcdev = rc_allocate_device();
if (!rcdev) {
rc = -ENOMEM;
goto err_allocate_device;
}
rcdev->priv = gpio_dev;
rcdev->driver_type = RC_DRIVER_IR_RAW;
rcdev->input_name = GPIO_IR_DEVICE_NAME;
rcdev->input_phys = GPIO_IR_DEVICE_NAME "/input0";
rcdev->input_id.bustype = BUS_HOST;
rcdev->input_id.vendor = 0x0001;
rcdev->input_id.product = 0x0001;
rcdev->input_id.version = 0x0100;
rcdev->dev.parent = &pdev->dev;
rcdev->driver_name = GPIO_IR_DRIVER_NAME;
if (pdata->allowed_protos)
rcdev->allowed_protos = pdata->allowed_protos;
else
rcdev->allowed_protos = RC_BIT_ALL;
rcdev->map_name = pdata->map_name ?: RC_MAP_EMPTY;
gpio_dev->rcdev = rcdev;
gpio_dev->gpio_nr = pdata->gpio_nr;
gpio_dev->active_low = pdata->active_low;
rc = gpio_request(pdata->gpio_nr, "gpio-ir-recv");
if (rc < 0)
goto err_gpio_request;
rc = gpio_direction_input(pdata->gpio_nr);
if (rc < 0)
goto err_gpio_direction_input;
rc = rc_register_device(rcdev);
if (rc < 0) {
dev_err(&pdev->dev, "failed to register rc device\n");
goto err_register_rc_device;
}
platform_set_drvdata(pdev, gpio_dev);
rc = request_any_context_irq(gpio_to_irq(pdata->gpio_nr),
gpio_ir_recv_irq,
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
"gpio-ir-recv-irq", gpio_dev);
if (rc < 0)
goto err_request_irq;
return 0;
err_request_irq:
platform_set_drvdata(pdev, NULL);
rc_unregister_device(rcdev);
rcdev = NULL;
err_register_rc_device:
err_gpio_direction_input:
gpio_free(pdata->gpio_nr);
err_gpio_request:
rc_free_device(rcdev);
err_allocate_device:
kfree(gpio_dev);
return rc;
}
static int gpio_ir_recv_remove(struct platform_device *pdev)
{
struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev);
free_irq(gpio_to_irq(gpio_dev->gpio_nr), gpio_dev);
platform_set_drvdata(pdev, NULL);
rc_unregister_device(gpio_dev->rcdev);
gpio_free(gpio_dev->gpio_nr);
kfree(gpio_dev);
return 0;
}
#ifdef CONFIG_PM
static int gpio_ir_recv_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev);
if (device_may_wakeup(dev))
enable_irq_wake(gpio_to_irq(gpio_dev->gpio_nr));
else
disable_irq(gpio_to_irq(gpio_dev->gpio_nr));
return 0;
}
static int gpio_ir_recv_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev);
if (device_may_wakeup(dev))
disable_irq_wake(gpio_to_irq(gpio_dev->gpio_nr));
else
enable_irq(gpio_to_irq(gpio_dev->gpio_nr));
return 0;
}
static const struct dev_pm_ops gpio_ir_recv_pm_ops = {
.suspend = gpio_ir_recv_suspend,
.resume = gpio_ir_recv_resume,
};
#endif
static struct platform_driver gpio_ir_recv_driver = {
.probe = gpio_ir_recv_probe,
.remove = gpio_ir_recv_remove,
.driver = {
.name = GPIO_IR_DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(gpio_ir_recv_of_match),
#ifdef CONFIG_PM
.pm = &gpio_ir_recv_pm_ops,
#endif
},
};
module_platform_driver(gpio_ir_recv_driver);
MODULE_DESCRIPTION("GPIO IR Receiver driver");
MODULE_LICENSE("GPL v2");
| {'content_hash': '529026cc60aeac98c7f2b4bec336b4d0', 'timestamp': '', 'source': 'github', 'line_count': 244, 'max_line_length': 68, 'avg_line_length': 23.385245901639344, 'alnum_prop': 0.6771819137749737, 'repo_name': 'zhengdejin/X1_Code', 'id': '8b82ae9bd686b5ccd06de9b3a62e0d0df48f077d', 'size': '6230', 'binary': False, 'copies': '966', 'ref': 'refs/heads/master', 'path': 'kernel-3.10/drivers/media/rc/gpio-ir-recv.c', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ASP', 'bytes': '4528'}, {'name': 'Assembly', 'bytes': '10107915'}, {'name': 'Awk', 'bytes': '18681'}, {'name': 'Batchfile', 'bytes': '144'}, {'name': 'C', 'bytes': '519266172'}, {'name': 'C++', 'bytes': '11700846'}, {'name': 'GDB', 'bytes': '18113'}, {'name': 'Lex', 'bytes': '47705'}, {'name': 'M4', 'bytes': '3388'}, {'name': 'Makefile', 'bytes': '1619668'}, {'name': 'Objective-C', 'bytes': '2963724'}, {'name': 'Perl', 'bytes': '570279'}, {'name': 'Perl 6', 'bytes': '3727'}, {'name': 'Python', 'bytes': '92743'}, {'name': 'Roff', 'bytes': '55837'}, {'name': 'Scilab', 'bytes': '21433'}, {'name': 'Shell', 'bytes': '185922'}, {'name': 'SourcePawn', 'bytes': '2711'}, {'name': 'UnrealScript', 'bytes': '6113'}, {'name': 'XS', 'bytes': '1240'}, {'name': 'Yacc', 'bytes': '92226'}]} |
using System;
using Server;
using Server.Mobiles;
using Server.Engines.Quests;
namespace Server.Engines.Quests.Ninja
{
public class NoteForZoel : QuestItem
{
public override int LabelNumber{ get{ return 1063186; } } // A Note for Zoel
[Constructable]
public NoteForZoel() : base( 0x14EF )
{
Weight = 1.0;
Hue = 0x6B9;
}
public NoteForZoel( Serial serial ) : base( serial )
{
}
public override bool CanDrop( PlayerMobile player )
{
EminosUndertakingQuest qs = player.Quest as EminosUndertakingQuest;
if ( qs == null )
return true;
//return !qs.IsObjectiveInProgress( typeof( GiveZoelNoteObjective ) );
return false;
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
} | {'content_hash': '79547c51e3603b08baf3c184fb157ebd', 'timestamp': '', 'source': 'github', 'line_count': 48, 'max_line_length': 78, 'avg_line_length': 19.645833333333332, 'alnum_prop': 0.6839872746553552, 'repo_name': 'ggobbe/vivre-uo', 'id': '3df1ea3dfce49dc5f28ee67c97f3ea7e48369b80', 'size': '943', 'binary': False, 'copies': '8', 'ref': 'refs/heads/master', 'path': "Scripts/Engines/Quests/Emino's Undertaking/Items/NoteForZoel.cs", 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'C#', 'bytes': '19852349'}, {'name': 'CSS', 'bytes': '699'}, {'name': 'HTML', 'bytes': '3008'}]} |
<?php
use App;
use Auth;
use Hash;
use Log;
use Shop;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class CartTest extends TestCase
{
/**
* User set for tests.
*/
protected $user;
/**
* Setups test data.
*/
public function setUp()
{
parent::setUp();
$this->user = factory('App\User')->create(['password' => Hash::make('laravel-shop')]);
Auth::attempt(['email' => $this->user->email, 'password' => 'laravel-shop']);
}
/**
* Tests if cart is being created correctly.
*/
public function testCreationBasedOnUser()
{
$user = factory('App\User')->create();
$cart = App\Cart::findByUser($user->id);
$this->assertNotEmpty($cart);
$user->delete();
}
/**
* Tests if cart is being created correctly.
*/
public function testMultipleCurrentCalls()
{
$cart = App\Cart::current();
$this->assertNotEmpty($cart);
$cart = App\Cart::findByUser($this->user->id);
$this->assertNotEmpty($cart);
$this->assertEquals($cart->user->id, $this->user->id);
$cart = App\Cart::current();
$this->assertNotEmpty($cart);
$this->assertEquals($cart->user->id, $this->user->id);
}
/**
* Tests if cart is being created correctly.
*/
public function testCreationBasedOnNull()
{
$cart = App\Cart::findByUser(null);
$this->assertNotEmpty($cart);
}
/**
* Tests if cart is being created correctly.
*/
public function testCreationBasedOnAuthUser()
{
$cart = App\Cart::current();
$this->assertNotEmpty($cart);
}
/**
* Tests cart item addition and removal.
*/
public function testAddingRemovingItems()
{
$products = [];
while (count($products) < 3) {
$products[] = App\TestProduct::create([
'price' => count($products) + 0.99,
'sku' => str_random(15),
'name' => str_random(64),
'description' => str_random(500),
]);
}
$cart = App\Cart::current()
->add($products[0])
->add($products[1], 2)
->add($products[2], 3);
$this->assertEquals($cart->count, 6);
$cart->add($products[2], 1, true);
$this->assertEquals($cart->count, 4);
$cart->remove($products[0], 1);
$this->assertEquals($cart->count, 3);
$cart->remove($products[2], 1);
$this->assertEquals($cart->count, 2);
$cart->clear();
$this->assertEquals($cart->items->count(), 0);
foreach ($products as $product) {
$product->delete();
}
}
/**
* Tests cart additional methods, such as item find and calculations.
*/
public function testCartMethods()
{
$product = App\TestProduct::create([
'price' => 1.29,
'sku' => str_random(15),
'name' => str_random(64),
'description' => str_random(500),
]);
$cart = App\Cart::current()
->add($product)
->add(['sku' => 'TEST001', 'price' => 6.99]);
$this->assertTrue($cart->hasItem('TEST001'));
$this->assertFalse($cart->hasItem('XXX'));
$this->assertEquals($cart->totalPrice, 8.28);
$this->assertEquals($cart->totalTax, 0);
$this->assertEquals($cart->totalShipping, 0);
$this->assertEquals($cart->total, 8.28);
$product->delete();
}
/**
* Tests cart order placement.
*/
public function testOrderPlacement()
{
$cart = App\Cart::current()
->add(['sku' => str_random(15), 'price' => 1.99])
->add(['sku' => str_random(15), 'price' => 1.99]);
$order = $cart->placeOrder();
$this->assertNotEmpty($order);
$this->assertEquals($order->totalPrice, 3.98);
$this->assertEquals($cart->count, 0);
$this->assertEquals($order->count, 2);
$this->assertTrue($order->isPending);
}
/**
* Removes test data.
*/
public function tearDown()
{
$this->user->delete();
parent::tearDown();
}
} | {'content_hash': '2071ac680102e007ad21a074a0c6c33f', 'timestamp': '', 'source': 'github', 'line_count': 197, 'max_line_length': 88, 'avg_line_length': 18.98477157360406, 'alnum_prop': 0.6163101604278075, 'repo_name': 'cybercog/laravel-shop', 'id': '255244d82e24b9e87e23d1722aa65fce448b2dd6', 'size': '3740', 'binary': False, 'copies': '5', 'ref': 'refs/heads/v0.2', 'path': 'tests/cart/CartTest.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '105998'}]} |
// Copyright (c) 2015, Baidu.com, Inc. All Rights Reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef _SRC_AGENT_CPU_SCHEDULER_H
#define _SRC_AGENT_CPU_SCHEDULER_H
#include <string>
#include <map>
#include <deque>
#include <queue>
#include "agent/resource_collector.h"
#include "thread_pool.h"
namespace baidu {
namespace galaxy {
struct CpuSchedulerCell {
int32_t cpu_quota;
int32_t cpu_extra;
int32_t cpu_extra_need;
bool frozen;
int64_t frozen_time;
int32_t cpu_guarantee;
CGroupResourceCollector* resource_collector;
std::string cgroup_name;
std::deque<double> cpu_usages;
int64_t last_schedule_time;
CpuSchedulerCell() :
cpu_quota(-1),
cpu_extra(0),
cpu_extra_need(0),
frozen(false),
frozen_time(-1),
cpu_guarantee(-1),
resource_collector(NULL),
cgroup_name(),
cpu_usages(),
last_schedule_time(0) {
}
};
class CpuSchedulerCellComp {
public:
bool operator() (CpuSchedulerCell* left,
CpuSchedulerCell* right) {
return left->cpu_extra < right->cpu_extra;
}
};
class CpuScheduler {
public:
static CpuScheduler* GetInstance() {
pthread_once(&ptonce_, &CpuScheduler::OnceInit);
return instance_;
}
void Release(int cpu_cores);
int Allocate(int cpu_cores);
bool EnqueueTask(const std::string& cgroup_name,
int32_t cpu_quota);
bool DequeueTask(const std::string& cgroup_name);
void SetFrozen(const std::string& cgroup_name,
int64_t frozen_time = -1);
void UnFrozen(const std::string& cgroup_name);
~CpuScheduler();
private:
void TraceCpuSchedulerCells(
const std::map<std::string, CpuSchedulerCell*> sched_cells);
void TraceSchedule();
CpuScheduler();
CpuScheduler(const CpuScheduler& /*sched*/) {}
CpuScheduler& operator = (const CpuScheduler& /*sched*/) {return *this;}
void KeepQuota(CpuSchedulerCell* cell);
void RebuildExtraQueue();
bool AllocateCpu(int cpu_cores);
void ScheduleResourceUsage();
// 计算有资源调度需求
void CalcCpuNeed(std::map<std::string, CpuSchedulerCell*>* scheduler_cells);
// 调整资源调度结果
bool ReCalcCpuNeed(std::map<std::string, CpuSchedulerCell*>* scheduler_cells);
// 执行cpu调度结果,并更新cpu_cores_lefts
bool ExecuteCpuNeed(std::vector<CpuSchedulerCell*>* sched_vec);
bool ExecuteSchedulerCell(CpuSchedulerCell* cell);
static void OnceInit() {
instance_ = new CpuScheduler();
::atexit(CpuScheduler::OnceDestroy);
}
static void OnceDestroy() {
delete instance_;
instance_ = NULL;
}
void Shuffle(std::vector<CpuSchedulerCell*>* cells) {
if (cells == NULL) {
return;
}
for (size_t i = cells->size(); i > 1; i--) {
CpuSchedulerCell* tmp = (*cells)[i - 1];
size_t target_index = ::rand() % i;
(*cells)[i - 1] = (*cells)[target_index];
(*cells)[target_index] = tmp;
}
return;
}
private:
static pthread_once_t ptonce_;
static CpuScheduler* instance_;
int32_t sched_interval_;
int32_t collect_interval_;
int32_t cpu_idle_high_limit_;
int32_t cpu_idle_low_limit_;
int32_t cpu_cores_left_;
ThreadPool* scheduler_threads_;
Mutex lock_;
typedef std::map<std::string, CpuSchedulerCell*> SchedulerCellsMap;
SchedulerCellsMap schedule_cells_;
typedef std::priority_queue<CpuSchedulerCell*,
std::vector<CpuSchedulerCell*>,
CpuSchedulerCellComp> SchedulerPriorityQueue;
SchedulerPriorityQueue extra_queue_;
};
} // ending namespace galaxy
} // ending namespace baidu
#endif //_SRC_AGENT_CPU_SCHEDULER_H
/* vim: set ts=4 sw=4 sts=4 tw=100 */
| {'content_hash': 'b6411f645771912291203af10fa5e214', 'timestamp': '', 'source': 'github', 'line_count': 139, 'max_line_length': 82, 'avg_line_length': 28.424460431654676, 'alnum_prop': 0.6228802834725385, 'repo_name': 'WangCrystal/galaxy', 'id': '7583f7dc176a48fdc7df1252c015a79ecede7963', 'size': '4003', 'binary': False, 'copies': '1', 'ref': 'refs/heads/refactor', 'path': 'src/agent/cpu_scheduler.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C++', 'bytes': '377231'}, {'name': 'Makefile', 'bytes': '5117'}, {'name': 'Protocol Buffer', 'bytes': '12204'}, {'name': 'Python', 'bytes': '4741'}, {'name': 'Shell', 'bytes': '3342'}]} |
<!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_45) on Fri Aug 28 09:51:27 EDT 2015 -->
<title>LongSerializer (apache-cassandra API)</title>
<meta name="date" content="2015-08-28">
<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="LongSerializer (apache-cassandra API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</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/LongSerializer.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/apache/cassandra/serializers/ListSerializer.html" title="class in org.apache.cassandra.serializers"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/serializers/MapSerializer.html" title="class in org.apache.cassandra.serializers"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/serializers/LongSerializer.html" target="_top">Frames</a></li>
<li><a href="LongSerializer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All 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: </li>
<li>Nested | </li>
<li><a href="#field.summary">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></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.apache.cassandra.serializers</div>
<h2 title="Class LongSerializer" class="title">Class LongSerializer</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.cassandra.serializers.LongSerializer</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../org/apache/cassandra/serializers/TypeSerializer.html" title="interface in org.apache.cassandra.serializers">TypeSerializer</a><java.lang.Long></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../org/apache/cassandra/serializers/CounterSerializer.html" title="class in org.apache.cassandra.serializers">CounterSerializer</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">LongSerializer</span>
extends java.lang.Object
implements <a href="../../../../org/apache/cassandra/serializers/TypeSerializer.html" title="interface in org.apache.cassandra.serializers">TypeSerializer</a><java.lang.Long></pre>
</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"> </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="../../../../org/apache/cassandra/serializers/LongSerializer.html" title="class in org.apache.cassandra.serializers">LongSerializer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/serializers/LongSerializer.html#instance">instance</a></span></code> </td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/serializers/LongSerializer.html#LongSerializer--">LongSerializer</a></span>()</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>java.lang.Long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/serializers/LongSerializer.html#deserialize-java.nio.ByteBuffer-">deserialize</a></span>(java.nio.ByteBuffer bytes)</code> </td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>java.lang.Class<java.lang.Long></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/serializers/LongSerializer.html#getType--">getType</a></span>()</code> </td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.nio.ByteBuffer</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/serializers/LongSerializer.html#serialize-java.lang.Long-">serialize</a></span>(java.lang.Long value)</code> </td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/serializers/LongSerializer.html#toString-java.lang.Long-">toString</a></span>(java.lang.Long value)</code> </td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/serializers/LongSerializer.html#validate-java.nio.ByteBuffer-">validate</a></span>(java.nio.ByteBuffer bytes)</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</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="instance">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>instance</h4>
<pre>public static final <a href="../../../../org/apache/cassandra/serializers/LongSerializer.html" title="class in org.apache.cassandra.serializers">LongSerializer</a> instance</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="LongSerializer--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>LongSerializer</h4>
<pre>public LongSerializer()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="deserialize-java.nio.ByteBuffer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deserialize</h4>
<pre>public java.lang.Long deserialize(java.nio.ByteBuffer bytes)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../org/apache/cassandra/serializers/TypeSerializer.html#deserialize-java.nio.ByteBuffer-">deserialize</a></code> in interface <code><a href="../../../../org/apache/cassandra/serializers/TypeSerializer.html" title="interface in org.apache.cassandra.serializers">TypeSerializer</a><java.lang.Long></code></dd>
</dl>
</li>
</ul>
<a name="serialize-java.lang.Long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>serialize</h4>
<pre>public java.nio.ByteBuffer serialize(java.lang.Long value)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../org/apache/cassandra/serializers/TypeSerializer.html#serialize-T-">serialize</a></code> in interface <code><a href="../../../../org/apache/cassandra/serializers/TypeSerializer.html" title="interface in org.apache.cassandra.serializers">TypeSerializer</a><java.lang.Long></code></dd>
</dl>
</li>
</ul>
<a name="validate-java.nio.ByteBuffer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>validate</h4>
<pre>public void validate(java.nio.ByteBuffer bytes)
throws <a href="../../../../org/apache/cassandra/serializers/MarshalException.html" title="class in org.apache.cassandra.serializers">MarshalException</a></pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../org/apache/cassandra/serializers/TypeSerializer.html#validate-java.nio.ByteBuffer-">validate</a></code> in interface <code><a href="../../../../org/apache/cassandra/serializers/TypeSerializer.html" title="interface in org.apache.cassandra.serializers">TypeSerializer</a><java.lang.Long></code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/cassandra/serializers/MarshalException.html" title="class in org.apache.cassandra.serializers">MarshalException</a></code></dd>
</dl>
</li>
</ul>
<a name="toString-java.lang.Long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public java.lang.String toString(java.lang.Long value)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../org/apache/cassandra/serializers/TypeSerializer.html#toString-T-">toString</a></code> in interface <code><a href="../../../../org/apache/cassandra/serializers/TypeSerializer.html" title="interface in org.apache.cassandra.serializers">TypeSerializer</a><java.lang.Long></code></dd>
</dl>
</li>
</ul>
<a name="getType--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getType</h4>
<pre>public java.lang.Class<java.lang.Long> getType()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../org/apache/cassandra/serializers/TypeSerializer.html#getType--">getType</a></code> in interface <code><a href="../../../../org/apache/cassandra/serializers/TypeSerializer.html" title="interface in org.apache.cassandra.serializers">TypeSerializer</a><java.lang.Long></code></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/LongSerializer.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/apache/cassandra/serializers/ListSerializer.html" title="class in org.apache.cassandra.serializers"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/serializers/MapSerializer.html" title="class in org.apache.cassandra.serializers"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/serializers/LongSerializer.html" target="_top">Frames</a></li>
<li><a href="LongSerializer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All 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: </li>
<li>Nested | </li>
<li><a href="#field.summary">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2015 The Apache Software Foundation</small></p>
</body>
</html>
| {'content_hash': 'f6ea11e8c09a38b04a1776cebe939b21', 'timestamp': '', 'source': 'github', 'line_count': 392, 'max_line_length': 391, 'avg_line_length': 41.204081632653065, 'alnum_prop': 0.6608469539375929, 'repo_name': 'mitch-kyle/hello-compojure', 'id': 'dce1f1702b268b296d648ed3b9f9762f89250334', 'size': '16152', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'opt/apache-cassandra-2.2.1/javadoc/org/apache/cassandra/serializers/LongSerializer.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '38895'}, {'name': 'CSS', 'bytes': '436'}, {'name': 'Clojure', 'bytes': '7851'}, {'name': 'HTML', 'bytes': '2468'}, {'name': 'JavaScript', 'bytes': '1612'}, {'name': 'PowerShell', 'bytes': '39336'}, {'name': 'Python', 'bytes': '413224'}, {'name': 'Shell', 'bytes': '60549'}, {'name': 'Thrift', 'bytes': '40282'}]} |
package com.droid.application;
import android.app.Application;
import android.content.Context;
import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.assist.QueueProcessingType;
public class ClientApplication extends Application {
/**
* 请求协议
*/
public static final String HTTP = "http";
public static final boolean d = true;
public static boolean netFlag = false;
private static Context context;
/**
* 调试模式
*/
public static boolean debug =false;
@Override
public void onCreate() {
super.onCreate();
this.context = getApplicationContext();
initImageLoader(getApplicationContext());
}
public static Context getContext() {
return context;
}
/**
* init UIL ImageLoader
*/
public static void initImageLoader(Context context) {
// This configuration tuning is custom. You can tune every option, you
// may tune some of them,
// or you can create default configuration by
// ImageLoaderConfiguration.createDefault(this);
// method.
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(
context).threadPriority(Thread.NORM_PRIORITY - 2)
.denyCacheImageMultipleSizesInMemory()
.discCacheFileNameGenerator(new Md5FileNameGenerator())
.tasksProcessingOrder(QueueProcessingType.LIFO)
.writeDebugLogs() // Remove for release app
.build();
// Initialize ImageLoader with configuration.
ImageLoader.getInstance().init(config);
}
}
| {'content_hash': '4c9c6d3b9f73a244b04c9346f71816c4', 'timestamp': '', 'source': 'github', 'line_count': 55, 'max_line_length': 80, 'avg_line_length': 34.2, 'alnum_prop': 0.6602870813397129, 'repo_name': 'naroate/android-tv-launcher', 'id': 'cbe89147cfb075e4d1d336506e2b2204a4f2cfe2', 'size': '1897', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'src/com/droid/application/ClientApplication.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '337570'}]} |
namespace Google.Cloud.Video.LiveStream.V1.Snippets
{
// [START livestream_v1_generated_LivestreamService_ListInputs_async_flattened]
using Google.Api.Gax;
using Google.Cloud.Video.LiveStream.V1;
using System;
using System.Linq;
using System.Threading.Tasks;
public sealed partial class GeneratedLivestreamServiceClientSnippets
{
/// <summary>Snippet for ListInputsAsync</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public async Task ListInputsAsync()
{
// Create client
LivestreamServiceClient livestreamServiceClient = await LivestreamServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListInputsResponse, Input> response = livestreamServiceClient.ListInputsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Input item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListInputsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Input item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Input> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Input item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
}
}
// [END livestream_v1_generated_LivestreamService_ListInputs_async_flattened]
}
| {'content_hash': '7c0615b3106872c52f9f0459e5d366ae', 'timestamp': '', 'source': 'github', 'line_count': 60, 'max_line_length': 120, 'avg_line_length': 43.55, 'alnum_prop': 0.6088786835055492, 'repo_name': 'jskeet/gcloud-dotnet', 'id': 'b9a0256d1b5df7de5b2f45c9278835c3dfcab379', 'size': '3235', 'binary': False, 'copies': '2', 'ref': 'refs/heads/bq-migration', 'path': 'apis/Google.Cloud.Video.LiveStream.V1/Google.Cloud.Video.LiveStream.V1.GeneratedSnippets/LivestreamServiceClient.ListInputsAsyncSnippet.g.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '1725'}, {'name': 'C#', 'bytes': '1829733'}]} |
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved
// Copyright 2011-2012 MIT, All rights reserved
// Released under the MIT License https://raw.github.com/mit-cml/app-inventor/master/mitlicense.txt
package com.google.appinventor.components.runtime.util;
import junit.framework.TestCase;
import java.util.ArrayList;
import java.util.List;
/**
* Tests GameInstance class.
*
*
*/
public class GameInstanceTest extends TestCase {
public void testSetPlayersForNewPlayers() {
GameInstance instance = new GameInstance("test_iid");
assertEquals(instance.getPlayers().size(), 0);
PlayerListDelta returnList;
List<String> players = new ArrayList<String>();
players.add("[email protected]");
players.add("[email protected]");
returnList = instance.setPlayers(players);
assertEquals(returnList.getPlayersRemoved(), new ArrayList<String>());
assertEquals(returnList.getPlayersAdded(), instance.getPlayers());
assertEquals(returnList.getPlayersAdded(), players);
players.add("[email protected]");
players.add("[email protected]");
List<String> expectedReturnList = new ArrayList<String>();
expectedReturnList.add("[email protected]");
expectedReturnList.add("[email protected]");
assertEquals(instance.getPlayers().size(), 2);
returnList = instance.setPlayers(players);
assertEquals(returnList.getPlayersRemoved(), new ArrayList<String>());
assertEquals(returnList.getPlayersAdded(), expectedReturnList);
assertEquals(instance.getPlayers(), players);
}
public void testSetPlayersForNoNewPlayers() {
GameInstance instance = new GameInstance("test_iid");
PlayerListDelta returnList;
List<String> players = new ArrayList<String>();
players.add("[email protected]");
players.add("[email protected]");
returnList = instance.setPlayers(players);
returnList = instance.setPlayers(players);
assertEquals(returnList, PlayerListDelta.NO_CHANGE);
}
public void testSetPlayersForLeavingPlayers() {
GameInstance instance = new GameInstance("test_iid");
PlayerListDelta returnList;
List<String> players = new ArrayList<String>();
players.add("[email protected]");
players.add("[email protected]");
returnList = instance.setPlayers(players);
players.remove("[email protected]");
returnList = instance.setPlayers(players);
List<String> expectedRemoveList = new ArrayList<String>();
expectedRemoveList.add("[email protected]");
assertEquals(returnList.getPlayersRemoved(), expectedRemoveList);
assertEquals(returnList.getPlayersAdded(), new ArrayList<String>());
}
public void testSetPlayersLeaveAndAdd() {
GameInstance instance = new GameInstance("test_iid");
PlayerListDelta returnList;
List<String> players = new ArrayList<String>();
players.add("[email protected]");
players.add("[email protected]");
returnList = instance.setPlayers(players);
players.add("[email protected]");
players.remove("[email protected]");
returnList = instance.setPlayers(players);
List<String> expectedAddList = new ArrayList<String>();
List<String> expectedRemoveList = new ArrayList<String>();
expectedAddList.add("[email protected]");
expectedRemoveList.add("[email protected]");
assertEquals(returnList.getPlayersRemoved(), expectedRemoveList);
assertEquals(returnList.getPlayersAdded(), expectedAddList);
}
public void testMessageTimesUpdate() {
GameInstance instance = new GameInstance("test_iid");
assertEquals(instance.getMessageTime("test1"), "");
instance.putMessageTime("test1", "yesterday");
assertEquals(instance.getMessageTime("test1"), "yesterday");
instance.putMessageTime("test1", "tomorrow");
assertEquals(instance.getMessageTime("test1"), "tomorrow");
}
}
| {'content_hash': 'cbc84d26df9fc9806bce3a08fc009563', 'timestamp': '', 'source': 'github', 'line_count': 105, 'max_line_length': 99, 'avg_line_length': 36.17142857142857, 'alnum_prop': 0.6964191679831491, 'repo_name': 'ajhalbleib/aicg', 'id': 'a7b2bd2a791993ca0c13f22ba1ce2fdf97282306', 'size': '3798', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'appinventor/components/tests/com/google/appinventor/components/runtime/util/GameInstanceTest.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '5326205'}, {'name': 'JavaScript', 'bytes': '4563'}, {'name': 'Python', 'bytes': '1825'}, {'name': 'Scheme', 'bytes': '136243'}]} |
#include "modules/canbus/vehicle/zhongyun/protocol/error_state_e1.h"
#include "gtest/gtest.h"
namespace apollo {
namespace canbus {
namespace zhongyun {
class Errorstatee1Test : public ::testing::Test {
public:
virtual void SetUp() {}
};
TEST_F(Errorstatee1Test, reset) {
Errorstatee1 error_state_;
int32_t length = 8;
ChassisDetail cd;
uint8_t bytes[8] = {0x01, 0x01, 0x01, 0x01, 0x01, 0x12, 0x13, 0x14};
error_state_.Parse(bytes, length, &cd);
auto &error_state_info = cd.zhongyun().error_state_e1();
EXPECT_DOUBLE_EQ(error_state_info.brake_error_code(), 1);
EXPECT_DOUBLE_EQ(error_state_info.driven_error_code(), 1);
EXPECT_DOUBLE_EQ(error_state_info.steering_error_code(), 1);
EXPECT_DOUBLE_EQ(error_state_info.parking_error_code(), 1);
EXPECT_DOUBLE_EQ(error_state_info.gear_error_msg(), 1);
}
} // namespace zhongyun
} // namespace canbus
} // namespace apollo
| {'content_hash': 'e545982eae918d5d080d6c7eed971bc4', 'timestamp': '', 'source': 'github', 'line_count': 32, 'max_line_length': 70, 'avg_line_length': 28.1875, 'alnum_prop': 0.7039911308203991, 'repo_name': 'ycool/apollo', 'id': 'c5ebba50bd78e0acba0e8513273e3446c443d53b', 'size': '1674', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'modules/canbus/vehicle/zhongyun/protocol/error_state_e1_test.cc', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Assembly', 'bytes': '1922'}, {'name': 'Batchfile', 'bytes': '791'}, {'name': 'C', 'bytes': '66747'}, {'name': 'C++', 'bytes': '19613034'}, {'name': 'CMake', 'bytes': '3600'}, {'name': 'Cuda', 'bytes': '221003'}, {'name': 'Dockerfile', 'bytes': '8522'}, {'name': 'GLSL', 'bytes': '7000'}, {'name': 'HTML', 'bytes': '9768'}, {'name': 'Handlebars', 'bytes': '991'}, {'name': 'JavaScript', 'bytes': '461346'}, {'name': 'Makefile', 'bytes': '6626'}, {'name': 'Python', 'bytes': '1178333'}, {'name': 'SCSS', 'bytes': '52149'}, {'name': 'Shell', 'bytes': '783043'}, {'name': 'Smarty', 'bytes': '33183'}, {'name': 'Starlark', 'bytes': '1023973'}, {'name': 'Vim script', 'bytes': '161'}]} |
from os.path import join, dirname
from cloudify import ctx
ctx.download_resource(
join('components', 'utils.py'),
join(dirname(__file__), 'utils.py'))
import utils # NOQA
runtime_props = ctx.instance.runtime_properties
SERVICE_NAME = runtime_props['service_name']
HOME_DIR = runtime_props['home_dir']
@utils.retry(ValueError)
def check_worker_running():
"""Use `celery status` to check if the worker is running."""
work_dir = join(HOME_DIR, 'work')
celery_path = join(HOME_DIR, 'env', 'bin', 'celery')
result = utils.sudo([
'CELERY_WORK_DIR={0}'.format(work_dir),
celery_path,
'--config=cloudify.broker_config',
'status'
], ignore_failures=True)
if result.returncode != 0:
raise ValueError('celery status: worker not running')
ctx.logger.info('Starting Management Worker Service...')
utils.start_service(SERVICE_NAME)
utils.systemd.verify_alive(SERVICE_NAME)
try:
check_worker_running()
except ValueError:
ctx.abort_operation('Celery worker failed to start')
| {'content_hash': '0e9baceb64fff7a9215cd75981351e8f', 'timestamp': '', 'source': 'github', 'line_count': 38, 'max_line_length': 64, 'avg_line_length': 27.605263157894736, 'alnum_prop': 0.678741658722593, 'repo_name': 'isaac-s/cloudify-manager-blueprints', 'id': '7a36eacbc0f04b01602285b966851a833261f15f', 'size': '1072', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'components/mgmtworker/scripts/start.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Clojure', 'bytes': '274'}, {'name': 'Nginx', 'bytes': '712'}, {'name': 'Python', 'bytes': '236873'}, {'name': 'Shell', 'bytes': '7106'}]} |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Frontend Precommit Rules - Hangout</title>
<meta name="description" content="Slides para el Hangout sobre Frontend Precommit Rules">
<meta name="author" content="David Garcia">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/night.css" id="theme">
<link rel="stylesheet" href="css/custom.css">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h2>Sublime Text 3</h2>
<h4>Improve your workflow</h4>
<img src="img/sublime-logo.png" width="300" alt="">
<p>
<small>by <a href="http://davecarter.me" target="_blank">David García</a> / <a href="http://twitter.com/d4vecarter" target="_blank">@d4vecarter</a></small>
</p>
</section>
<section>
<h3>What is Sublime?</h3>
<img src="img/sublime-window.png" width="400" alt="">
<p class="fragment">Code Editor</p>
<p class="fragment"><strong>not</strong> an IDE</p>
</section>
<section>
<h3>Opening Sublime</h3>
<ul>
<li>Icon</li>
<li>Drag Folder</li>
<li>.sublime-project</li>
<li><a href="https://gist.github.com/davecarter/0a4fea4d6cbd08e4812f" target="_blank">Terminal</a></li>
</ul>
</section>
<section>
<section>
<h3>Interface</h3>
<ul>
<li>Window</li>
<li>Tabs</li>
<li>Minimap</li>
<li>Sidebar</li>
<li>Status bar</li>
</ul>
</section>
<section>
<h3>Preferences</h3>
<a href="https://gist.github.com/davecarter/35e96f053d51e139f601">Sublime Preferences Gist</a>
</section>
</section>
<section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Text Selection/Edition</h3>
<span class="marker">Multiple Word/Line Selection/Edition</span>
<pre><code>
Cmd + d -- Select word
Cmd + l -- Select line
</code></pre>
</section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Text Selection/Edition</h3>
<span class="marker">Text duplication & re-arrange line</span>
<pre><code>
Cmd + Shift + d -- Duplicate line
Ctrl + Cmd + Up/Down -- Re arrange line order
</code></pre>
</section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Text Selection/Edition</h3>
<span class="marker">Expand selection to Scope</span>
<pre><code>
Cmd + Shift + Space
</code></pre>
</section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Text Selection/Edition</h3>
<span class="marker">Selection to indentation</span>
<pre><code>
Cmd + Shift + j
</code></pre>
</section>
</section>
<section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Text Find/Replace</h3>
<span class="marker">Finding words</span>
<pre><code>
Cmd + g -- Quick Find a world / Goto Next word
Cmd + Shift + g -- Goto Previous word
Ctrl + Cmd + g -- Find all words
</code></pre>
</section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Text Find/Replace</h3>
<span class="marker">Find tool</span>
<pre><code>
Cmd + f -- Open Find a word
Alt - Cmd + f -- Open Find and replace
Cmd + Shift + f -- Find in files
</code></pre>
</section>
</section>
<section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Native Tools</h3>
<span class="marker">Instant search</span>
<pre><code>
Cmd + p
</code></pre>
</section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Native Tools</h3>
<span class="marker">Set syntax</span>
<pre><code>
Cmd + Shift + p --- ssyn
</code></pre>
</section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Native Tools</h3>
<span class="marker">Indentation</span>
<pre><code>
Cmd + Shift + p --- re
</code></pre>
</section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Native Tools</h3>
<span class="marker">Convert Upper/Lower case</span>
<pre><code>
Cmd + Shift + p --- low
</code></pre>
</section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Native Tools</h3>
<span class="marker">Value Bumping</span>
<pre><code>
Ctrl + Up/Down --- +/- 1 unit
Alt + Cmd + Up/Down --- +/- 1 unit
Alt + Up/Down --- +/- .1 unit
</code></pre>
</section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Native Tools</h3>
<span class="marker">Go to line/column</span>
<pre><code>
Ctrl + g --- 250 // Goto line 250
Ctrl + g --- 250:10 // Goto line 250 Column 10
</code></pre>
</section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Native Tools</h3>
<span class="marker">Tag wrapping</span>
<pre><code>
Ctrl + Shift + w -- adds a wrapping HTML tag
</code></pre>
</section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Native Tools</h3>
<span class="marker">Multi cursor</span>
<pre><code>
Ctrl + Shift + Up/Down arrows
Cmd + Left Click
</code></pre>
</section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Native Tools</h3>
<span class="marker">Split views</span>
<pre><code>
Columns: Alt + Cmd + 1 - 5
Rows: Alt + Cmd + Shift + 2 - 3
</code></pre>
</section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Native Tools</h3>
<span class="marker">Tab switching</span>
<pre><code>
Crtl + Tab -- Next tab
Crtl + Shift + Tab -- Prev tab
Cmd + 1 to number of opened tabs
</code></pre>
</section>
<section>
<img src="img/sublime-logo.png" width="200" alt="">
<h3>Sublime Native Tools</h3>
<span class="marker">Distraction free mode</span>
<pre><code>
Crtl + Cmd + Shift + f
Cmd + k + b -- Open/close Sidebar in DF view
Cmd + 1 - tab number to change window
</code></pre>
</section>
</section>
<section>
<h3>Plugins</h3>
<ul>
<li style="font-size: 18px; line-height: 1.8">Emmet</li>
<li style="font-size: 18px; line-height: 1.8">HTML Boilerplate</li>
<li style="font-size: 18px; line-height: 1.8">JavaScript Next</li>
<li style="font-size: 18px; line-height: 1.8">Git</li>
<li style="font-size: 18px; line-height: 1.8">SublimeLinter</li>
<li style="font-size: 18px; line-height: 1.8">SublimeLinter-contrib-eslint</li>
<li style="font-size: 18px; line-height: 1.8">SublimeLinter-contrib-scss</li>
<li style="font-size: 18px; line-height: 1.8">Color Highlighter</li>
<li style="font-size: 18px; line-height: 1.8">SideBarEnhancements</li>
</ul>
</section>
<section>
<h3>Themes</h3>
<ul>
<li><a href="http://buymeasoda.github.io/soda-theme/"></a>>Soda</a></li>
<li><a href="https://github.com/wesbos/cobalt2">Cobalt 2</a></li>
<li></li>
</ul>
</section>
<section>
<h2>¡Gracias!</h2>
<img style="margin: 5px 20px" src="https://pbs.twimg.com/profile_images/430835350114942976/7hRSb8rv_400x400.jpeg" alt="" width="100">
<ul>
<li>Frontend developer en Schibsted Spain.</li>
<li>Profesor en <a href="http://www.baued.es/es/estudios/masters-y-posgrados/master-en-diseno-web">Master de Diseño Web de Bau</a>.</li>
<li>Profesor en Escuela-IT.</li>
</ul>
<p>
<small>Twitter - <a href="http://twitter.com/d4vecarter">@d4vecarter</a></small><br />
<small>GitHub - <a href="https://github.com/davecarter">davecarter</a></small><br />
<small>LinkedIn - <a href="https://www.linkedin.com/in/davidgarciaontivero">David García</a></small>
</p>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'none', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, condition: function() { return !!document.querySelector( 'pre code' ); }, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true },
{ src: 'plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html>
| {'content_hash': '3b215697b3061b17a7d5ca6c376b777f', 'timestamp': '', 'source': 'github', 'line_count': 336, 'max_line_length': 195, 'avg_line_length': 34.31845238095238, 'alnum_prop': 0.5212037117335877, 'repo_name': 'davecarter/sublime-hangout', 'id': 'c57de3ecd4553f0808fbc3fee81a25bf9a42e9ab', 'size': '11535', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'index.html', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '189125'}, {'name': 'HTML', 'bytes': '36008'}, {'name': 'JavaScript', 'bytes': '169328'}]} |
import RenderingBuilder from 'devapt-core-common/dist/js/rendering/rendering_builder'
import runtime from 'devapt-core-common/dist/js/base/runtime'
// DEVTOOLS IMPORTS
import common_mw from '../common_mw'
const renderer = new RenderingBuilder(runtime)
// SERVICE VIEW CONFIG
export const service_cfg = {
view:'messages_view',
title:'Devapt Devtools - Messages',
label:'Devtools',
url:'devtools'
}
// SERVICE MIDDLEWARE
export default common_mw(renderer, 'messages_view', 'default_menubar', 'Devapt Devtools - Messages')
| {'content_hash': '227515e3b36d7dfdfc0f285396414d16', 'timestamp': '', 'source': 'github', 'line_count': 21, 'max_line_length': 100, 'avg_line_length': 25.285714285714285, 'alnum_prop': 0.7570621468926554, 'repo_name': 'lucbories/devapt-devtools', 'id': '41beb0116c61b32308b17f7bdc55cc733b0fd2a3', 'size': '578', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'src/js/messages/messages_mw.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '214'}, {'name': 'HTML', 'bytes': '3340'}, {'name': 'JavaScript', 'bytes': '27563'}, {'name': 'Shell', 'bytes': '147'}]} |
namespace {
gfx::Image MakeImage(SkColor color) {
SkBitmap bitmap;
bitmap.allocN32Pixels(5, 5);
bitmap.eraseColor(color);
return gfx::Image::CreateFrom1xBitmap(bitmap);
}
} // namespace
MATCHER_P(MemoryEq, other, "Eq matcher for base::RefCountedMemory contents") {
return arg->Equals(other);
}
class MockImageDecoder : public image_fetcher::ImageDecoder {
public:
MOCK_METHOD3(DecodeImage,
void(const std::string&,
const gfx::Size&,
image_fetcher::ImageDecodedCallback));
};
class SanitizedImageSourceTest : public testing::Test {
public:
void SetUp() override {
profile_ = std::make_unique<TestingProfile>();
auto image_decoder = std::make_unique<MockImageDecoder>();
mock_image_decoder_ = image_decoder.get();
sanitized_image_source_ = std::make_unique<SanitizedImageSource>(
profile_.get(),
base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>(
&test_url_loader_factory_),
std::move(image_decoder));
}
void TearDown() override {
sanitized_image_source_.reset();
profile_.reset();
test_url_loader_factory_.ClearResponses();
}
protected:
content::BrowserTaskEnvironment task_environment_;
std::unique_ptr<TestingProfile> profile_;
network::TestURLLoaderFactory test_url_loader_factory_;
raw_ptr<MockImageDecoder> mock_image_decoder_;
std::unique_ptr<SanitizedImageSource> sanitized_image_source_;
};
// Verifies that the image source can handle multiple requests in parallel.
TEST_F(SanitizedImageSourceTest, MultiRequest) {
std::vector<std::tuple<SkColor, std::string, std::string>> data(
{{SK_ColorRED, "https://foo.com/img.png", "abc"},
{SK_ColorBLUE, "https://bar.com/img.png", "def"},
{SK_ColorGREEN, "https://baz.com/img.png", "ghi"}});
// Set up expectations and mock data.
base::MockCallback<content::URLDataSource::GotDataCallback> callback;
for (const auto& datum : data) {
SkColor color;
std::string url;
std::string body;
std::tie(color, url, body) = datum;
test_url_loader_factory_.AddResponse(url, body);
EXPECT_CALL(*mock_image_decoder_,
DecodeImage(body, gfx::Size(), testing::_))
.Times(1)
.WillOnce([color](const std::string&, const gfx::Size&,
image_fetcher::ImageDecodedCallback callback) {
std::move(callback).Run(MakeImage(color));
});
EXPECT_CALL(callback, Run(MemoryEq(MakeImage(color).As1xPNGBytes())))
.Times(1);
}
// Issue requests.
for (const auto& datum : data) {
std::string url;
std::tie(std::ignore, url, std::ignore) = datum;
sanitized_image_source_->StartDataRequest(
GURL(base::StrCat({chrome::kChromeUIImageURL, "?", url})),
content::WebContents::Getter(), callback.Get());
}
task_environment_.RunUntilIdle();
}
// Verifies that the image source sends back an empty image in case the external
// image download fails.
TEST_F(SanitizedImageSourceTest, FailedLoad) {
constexpr char kImageUrl[] = "https://foo.com/img.png";
// Set up expectations and mock data.
test_url_loader_factory_.AddResponse(kImageUrl, "", net::HTTP_NOT_FOUND);
EXPECT_CALL(*mock_image_decoder_,
DecodeImage(testing::_, testing::_, testing::_))
.Times(0);
base::MockCallback<content::URLDataSource::GotDataCallback> callback;
EXPECT_CALL(callback,
Run(MemoryEq(base::MakeRefCounted<base::RefCountedString>())))
.Times(1);
// Issue request.
sanitized_image_source_->StartDataRequest(
GURL(base::StrCat({chrome::kChromeUIImageURL, "?", kImageUrl})),
content::WebContents::Getter(), callback.Get());
task_environment_.RunUntilIdle();
}
// Verifies that the image source ignores requests with a wrong URL.
TEST_F(SanitizedImageSourceTest, WrongUrl) {
// Set up expectations and mock data.
EXPECT_CALL(*mock_image_decoder_,
DecodeImage(testing::_, testing::_, testing::_))
.Times(0);
base::MockCallback<content::URLDataSource::GotDataCallback> callback;
EXPECT_CALL(callback,
Run(MemoryEq(base::MakeRefCounted<base::RefCountedString>())))
.Times(2);
// Issue request.
sanitized_image_source_->StartDataRequest(
GURL("chrome://abc?https://foo.com/img.png"),
content::WebContents::Getter(), callback.Get());
sanitized_image_source_->StartDataRequest(
GURL(base::StrCat({chrome::kChromeUIImageURL, "?abc"})),
content::WebContents::Getter(), callback.Get());
task_environment_.RunUntilIdle();
EXPECT_EQ(0, test_url_loader_factory_.NumPending());
}
| {'content_hash': '657a2f8368a5a960a25f0636f74b4745', 'timestamp': '', 'source': 'github', 'line_count': 131, 'max_line_length': 80, 'avg_line_length': 35.55725190839695, 'alnum_prop': 0.6683125805066552, 'repo_name': 'ric2b/Vivaldi-browser', 'id': '561c9026d9cdd2b99b768a4e871b8e7d542594a6', 'size': '5587', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'chromium/chrome/browser/ui/webui/sanitized_image_source_unittest.cc', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []} |
/**************************************************************************//**
* @file usbh_lib.h
* @version V1.10
* @brief USB Host library exported header file.
*
* @note
* SPDX-License-Identifier: Apache-2.0
* Copyright (C) 2019-2020 Nuvoton Technology Corp. All rights reserved.
******************************************************************************/
#ifndef _USBH_LIB_H_
#define _USBH_LIB_H_
#include "NuMicro.h"
#ifdef __cplusplus
extern "C"
{
#endif
/** @addtogroup LIBRARY Library
@{
*/
/** @addtogroup USBH_Library USB Host Library
@{
*/
/** @addtogroup USBH_EXPORTED_CONSTANTS USB Host Exported Constants
@{
*/
#define USBH_OK 0 /*!< No error. */
#define USBH_ERR_MEMORY_OUT -10 /*!< Out of memory. */
#define USBH_ERR_IF_ALT_LIMIT -11 /*!< Number of alternative interface > MAX_ALT_PER_IFACE */
#define USBH_ERR_IF_EP_LIMIT -15 /*!< Number of endpoints > MAX_EP_PER_IFACE */
#define USBH_ERR_NOT_SUPPORTED -101 /*!< Device/Class/Transfer not supported */
#define USBH_ERR_NOT_MATCHED -103 /*!< Not macthed */
#define USBH_ERR_NOT_EXPECTED -104 /*!< Unknown or unexpected */
#define USBH_ERR_INVALID_PARAM -105 /*!< Invalid parameter */
#define USBH_ERR_NOT_FOUND -106 /*!< Device or interface not found */
#define USBH_ERR_EP_NOT_FOUND -107 /*!< Endpoint not found */
#define USBH_ERR_DESCRIPTOR -137 /*!< Failed to parse USB descriptors */
#define USBH_ERR_SET_DEV_ADDR -139 /*!< Failed to set device address */
#define USBH_ERR_SET_CONFIG -151 /*!< Failed to set device configuration */
#define USBH_ERR_TRANSFER -201 /*!< USB transfer error */
#define USBH_ERR_TIMEOUT -203 /*!< USB transfer time-out */
#define USBH_ERR_ABORT -205 /*!< USB transfer aborted due to disconnect or reset */
#define USBH_ERR_PORT_RESET -255 /*!< Hub port reset failed */
#define USBH_ERR_SCH_OVERRUN -257 /*!< USB isochronous schedule overrun */
#define USBH_ERR_DISCONNECTED -259 /*!< USB device was disconnected */
#define USBH_ERR_TRANSACTION -271 /*!< USB transaction timeout, CRC, Bad PID, etc. */
#define USBH_ERR_BABBLE_DETECTED -272 /*!< A 'babble' is detected during the transaction */
#define USBH_ERR_DATA_BUFF -274 /*!< Data buffer overrun or underrun */
#define USBH_ERR_CC_NO_ERR -280 /*!< OHCI CC code - no error */
#define USBH_ERR_CRC -281 /*!< USB trasfer CRC error */
#define USBH_ERR_BIT_STUFF -282 /*!< USB transfer bit stuffing error */
#define USBH_ERR_DATA_TOGGLE -283 /*!< USB trasfer data toggle error */
#define USBH_ERR_STALL -284 /*!< USB trasfer STALL error */
#define USBH_ERR_DEV_NO_RESP -285 /*!< USB trasfer device no response error */
#define USBH_ERR_PID_CHECK -286 /*!< USB trasfer PID check failure */
#define USBH_ERR_UNEXPECT_PID -287 /*!< USB trasfer unexpected PID error */
#define USBH_ERR_DATA_OVERRUN -288 /*!< USB trasfer data overrun error */
#define USBH_ERR_DATA_UNDERRUN -289 /*!< USB trasfer data underrun error */
#define USBH_ERR_BUFF_OVERRUN -292 /*!< USB trasfer buffer overrun error */
#define USBH_ERR_BUFF_UNDERRUN -293 /*!< USB trasfer buffer underrun error */
#define USBH_ERR_NOT_ACCESS0 -294 /*!< USB trasfer not accessed error */
#define USBH_ERR_NOT_ACCESS1 -295 /*!< USB trasfer not accessed error */
#define USBH_ERR_OHCI_INIT -301 /*!< Failed to initialize OHIC controller. */
#define USBH_ERR_OHCI_EP_BUSY -303 /*!< The endpoint is under transfer. */
#define USBH_ERR_EHCI_INIT -501 /*!< Failed to initialize EHCI controller. */
#define USBH_ERR_EHCI_QH_BUSY -503 /*!< the Queue Head is busy. */
#define UMAS_OK 0 /*!< No error. */
#define UMAS_ERR_NO_DEVICE -1031 /*!< No Mass Stroage Device found. */
#define UMAS_ERR_IO -1033 /*!< Device read/write failed. */
#define UMAS_ERR_INIT_DEVICE -1035 /*!< failed to init MSC device */
#define UMAS_ERR_CMD_STATUS -1037 /*!< SCSI command status failed */
#define UMAS_ERR_IVALID_PARM -1038 /*!< Invalid parameter. */
#define UMAS_ERR_DRIVE_NOT_FOUND -1039 /*!< drive not found */
#define HID_RET_OK 0 /*!< Return with no errors. */
#define HID_RET_DEV_NOT_FOUND -1081 /*!< HID device not found or removed. */
#define HID_RET_IO_ERR -1082 /*!< USB transfer failed. */
#define HID_RET_INVALID_PARAMETER -1083 /*!< Invalid parameter. */
#define HID_RET_OUT_OF_MEMORY -1084 /*!< Out of memory. */
#define HID_RET_NOT_SUPPORTED -1085 /*!< Function not supported. */
#define HID_RET_EP_NOT_FOUND -1086 /*!< Endpoint not found. */
#define HID_RET_PARSING -1087 /*!< Failed to parse HID descriptor */
#define HID_RET_XFER_IS_RUNNING -1089 /*!< The transfer has been enabled. */
#define HID_RET_REPORT_NOT_FOUND -1090 /*!< The transfer has been enabled. */
#define UAC_RET_OK 0 /*!< Return with no errors. */
#define UAC_RET_DEV_NOT_FOUND -2001 /*!< Audio Class device not found or removed. */
#define UAC_RET_FUNC_NOT_FOUND -2002 /*!< Audio device has no this function. */
#define UAC_RET_IO_ERR -2003 /*!< USB transfer failed. */
#define UAC_RET_DATA_LEN -2004 /*!< Unexpected transfer length */
#define UAC_RET_INVALID -2005 /*!< Invalid parameter or usage. */
#define UAC_RET_OUT_OF_MEMORY -2007 /*!< Out of memory. */
#define UAC_RET_DRV_NOT_SUPPORTED -2009 /*!< Function not supported by this UAC driver. */
#define UAC_RET_DEV_NOT_SUPPORTED -2011 /*!< Function not supported by the UAC device. */
#define UAC_RET_PARSER -2013 /*!< Failed to parse UAC descriptor */
#define UAC_RET_IS_STREAMING -2015 /*!< Audio pipe is on streaming. */
/*@}*/ /* end of group USBH_EXPORTED_CONSTANTS */
/** @addtogroup USBH_EXPORTED_TYPEDEF USB Host Typedef
@{
*/
struct udev_t;
typedef void (CONN_FUNC)(struct udev_t *udev, int param);
struct line_coding_t;
struct cdc_dev_t;
typedef void (CDC_CB_FUNC)(struct cdc_dev_t *cdev, uint8_t *rdata, int data_len);
struct usbhid_dev;
typedef void (HID_IR_FUNC)(struct usbhid_dev *hdev, uint16_t ep_addr, int status, uint8_t *rdata, uint32_t data_len); /*!< interrupt in callback function \hideinitializer */
typedef void (HID_IW_FUNC)(struct usbhid_dev *hdev, uint16_t ep_addr, int status, uint8_t *wbuff, uint32_t *data_len); /*!< interrupt out callback function \hideinitializer */
struct uac_dev_t;
typedef int (UAC_CB_FUNC)(struct uac_dev_t *dev, uint8_t *data, int len); /*!< audio in callback function \hideinitializer */
/*@}*/ /* end of group USBH_EXPORTED_STRUCT */
/** @addtogroup USBH_EXPORTED_FUNCTIONS USB Host Exported Functions
@{
*/
/*------------------------------------------------------------------*/
/* */
/* USB Core Library APIs */
/* */
/*------------------------------------------------------------------*/
extern void usbh_core_init(void);
extern int usbh_polling_root_hubs(void);
extern void usbh_install_conn_callback(CONN_FUNC *conn_func, CONN_FUNC *disconn_func);
extern void usbh_suspend(void);
extern void usbh_resume(void);
extern struct udev_t *usbh_find_device(char *hub_id, int port);
/**
* @brief A function return current tick count.
* @return Current tick.
* @details User application must provide this function to return current tick.
* The tick should increase by 1 for every 10 ms.
*/
extern uint32_t usbh_get_ticks(void); /* This function must be provided by user application. */
extern uint32_t usbh_tick_from_millisecond(uint32_t msec); /* This function must be provided by user application. */
/*------------------------------------------------------------------*/
/* */
/* USB Communication Device Class Library APIs */
/* */
/*------------------------------------------------------------------*/
extern void usbh_cdc_init(void);
extern struct cdc_dev_t *usbh_cdc_get_device_list(void);
/// @cond HIDDEN_SYMBOLS
extern int32_t usbh_cdc_get_line_coding(struct cdc_dev_t *cdev, struct line_coding_t *line_code);
extern int32_t usbh_cdc_set_line_coding(struct cdc_dev_t *cdev, struct line_coding_t *line_code);
/// @endcond HIDDEN_SYMBOLS
extern int32_t usbh_cdc_set_control_line_state(struct cdc_dev_t *cdev, int active_carrier, int DTE_present);
extern int32_t usbh_cdc_start_polling_status(struct cdc_dev_t *cdev, CDC_CB_FUNC *func);
extern int32_t usbh_cdc_start_to_receive_data(struct cdc_dev_t *cdev, CDC_CB_FUNC *func);
extern int32_t usbh_cdc_send_data(struct cdc_dev_t *cdev, uint8_t *buff, int buff_len);
/*------------------------------------------------------------------*/
/* */
/* USB Human Interface Class Library APIs */
/* */
/*------------------------------------------------------------------*/
extern void usbh_hid_init(void);
extern struct usbhid_dev *usbh_hid_get_device_list(void);
extern int32_t usbh_hid_get_report_descriptor(struct usbhid_dev *hdev, uint8_t *desc_buf, int buf_max_len);
extern int32_t usbh_hid_get_report(struct usbhid_dev *hdev, int rtp_typ, int rtp_id, uint8_t *data, int len);
extern int32_t usbh_hid_set_report(struct usbhid_dev *hdev, int rtp_typ, int rtp_id, uint8_t *data, int len);
extern int32_t usbh_hid_get_idle(struct usbhid_dev *hdev, int rtp_id, uint8_t *idle_rate);
extern int32_t usbh_hid_set_idle(struct usbhid_dev *hdev, int rtp_id, uint8_t idle_rate);
extern int32_t usbh_hid_get_protocol(struct usbhid_dev *hdev, uint8_t *protocol);
extern int32_t usbh_hid_set_protocol(struct usbhid_dev *hdev, uint8_t protocol);
extern int32_t usbh_hid_start_int_read(struct usbhid_dev *hdev, uint8_t ep_addr, HID_IR_FUNC *func);
extern int32_t usbh_hid_stop_int_read(struct usbhid_dev *hdev, uint8_t ep_addr);
extern int32_t usbh_hid_start_int_write(struct usbhid_dev *hdev, uint8_t ep_addr, HID_IW_FUNC *func);
extern int32_t usbh_hid_stop_int_write(struct usbhid_dev *hdev, uint8_t ep_addr);
/*------------------------------------------------------------------*/
/* */
/* USB Mass Storage Class Library APIs */
/* */
/*------------------------------------------------------------------*/
extern int usbh_umas_init(void);
extern int usbh_umas_disk_status(int drv_no);
extern int usbh_umas_read(int drv_no, uint32_t sec_no, int sec_cnt, uint8_t *buff);
extern int usbh_umas_write(int drv_no, uint32_t sec_no, int sec_cnt, uint8_t *buff);
extern int usbh_umas_ioctl(int drv_no, int cmd, void *buff);
/// @cond HIDDEN_SYMBOLS
extern int usbh_umas_reset_disk(int drv_no);
/// @endcond HIDDEN_SYMBOLS
/*------------------------------------------------------------------*/
/* */
/* USB Audio Class Library APIs */
/* */
/*------------------------------------------------------------------*/
extern void usbh_uac_init(void);
extern int usbh_uac_open(struct uac_dev_t *audev);
extern struct uac_dev_t *usbh_uac_get_device_list(void);
extern int usbh_uac_get_channel_number(struct uac_dev_t *audev, uint8_t target);
extern int usbh_uac_get_bit_resolution(struct uac_dev_t *audev, uint8_t target, uint8_t *byte_cnt);
extern int usbh_uac_get_sampling_rate(struct uac_dev_t *audev, uint8_t target, uint32_t *srate_list, int max_cnt, uint8_t *type);
extern int usbh_uac_sampling_rate_control(struct uac_dev_t *audev, uint8_t target, uint8_t req, uint32_t *srate);
extern int usbh_uac_mute_control(struct uac_dev_t *audev, uint8_t target, uint8_t req, uint16_t chn, uint8_t *mute);
extern int usbh_uac_vol_control(struct uac_dev_t *audev, uint8_t target, uint8_t req, uint16_t chn, uint16_t *volume);
extern int usbh_uac_auto_gain_control(struct uac_dev_t *audev, uint8_t target, uint8_t req, uint16_t chn, uint8_t *bAGC);
extern int usbh_uac_start_audio_in(struct uac_dev_t *uac, UAC_CB_FUNC *func);
extern int usbh_uac_stop_audio_in(struct uac_dev_t *audev);
extern int usbh_uac_start_audio_out(struct uac_dev_t *uac, UAC_CB_FUNC *func);
extern int usbh_uac_stop_audio_out(struct uac_dev_t *audev);
/// @cond HIDDEN_SYMBOLS
extern void dump_ohci_regs(void);
extern void dump_ehci_regs(void);
extern void dump_ohci_ports(void);
extern void dump_ehci_ports(void);
extern uint32_t usbh_memory_used(void);
/// @endcond HIDDEN_SYMBOLS
/*@}*/ /* end of group USBH_EXPORTED_FUNCTIONS */
/*@}*/ /* end of group USBH_Library */
/*@}*/ /* end of group LIBRARY */
#ifdef __cplusplus
}
#endif
#endif /* _USBH_LIB_H_ */
/*** (C) COPYRIGHT 2019-2020 Nuvoton Technology Corp. ***/
| {'content_hash': '61838a4033c51c1202243aa713a1f568', 'timestamp': '', 'source': 'github', 'line_count': 254, 'max_line_length': 177, 'avg_line_length': 58.43307086614173, 'alnum_prop': 0.5294434712302925, 'repo_name': 'weety/rt-thread', 'id': '9597e14ba8f3f935c5d3e85d3819153562a4a083', 'size': '14842', 'binary': False, 'copies': '7', 'ref': 'refs/heads/master', 'path': 'bsp/nuvoton/libraries/m2354/USBHostLib/inc/usbh_lib.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Assembly', 'bytes': '10167873'}, {'name': 'Batchfile', 'bytes': '187896'}, {'name': 'C', 'bytes': '560540593'}, {'name': 'C++', 'bytes': '7528475'}, {'name': 'CMake', 'bytes': '148026'}, {'name': 'CSS', 'bytes': '9978'}, {'name': 'DIGITAL Command Language', 'bytes': '13234'}, {'name': 'GDB', 'bytes': '11796'}, {'name': 'HTML', 'bytes': '2631222'}, {'name': 'Lex', 'bytes': '7026'}, {'name': 'Logos', 'bytes': '7078'}, {'name': 'M4', 'bytes': '17515'}, {'name': 'Makefile', 'bytes': '271627'}, {'name': 'Module Management System', 'bytes': '1548'}, {'name': 'Objective-C', 'bytes': '4110192'}, {'name': 'Pawn', 'bytes': '1427'}, {'name': 'Perl', 'bytes': '9520'}, {'name': 'PowerShell', 'bytes': '1628'}, {'name': 'Python', 'bytes': '1466623'}, {'name': 'RPC', 'bytes': '14162'}, {'name': 'Rich Text Format', 'bytes': '355402'}, {'name': 'Roff', 'bytes': '4486'}, {'name': 'Ruby', 'bytes': '869'}, {'name': 'Shell', 'bytes': '407900'}, {'name': 'TeX', 'bytes': '3113'}, {'name': 'Yacc', 'bytes': '16084'}]} |
<html><body><p><!-- saved from url=(0024)http://docs.autodesk.com -->
<!DOCTYPE html>
<!-- Mirrored from help.autodesk.com/cloudhelp/2016/ENU/Maya-Tech-Docs/PyMel/generated/classes/pymel.core.nodetypes/pymel.core.nodetypes.ObjectNameFilter.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 01 Aug 2015 05:33:01 GMT -->
<!-- Added by HTTrack --><meta content="text/html;charset=utf-8" http-equiv="content-type"/><!-- /Added by HTTrack -->
</p>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<title>pymel.core.nodetypes.ObjectNameFilter — PyMEL 1.0.7 documentation</title>
<link href="../../../_static/nature.css" rel="stylesheet" type="text/css"/>
<link href="../../../_static/pygments.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../',
VERSION: '1.0.7',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script src="../../../_static/jquery.js" type="text/javascript"></script>
<script src="../../../_static/underscore.js" type="text/javascript"></script>
<script src="../../../_static/doctools.js" type="text/javascript"></script>
<link href="../../../index-2.html" rel="top" title="PyMEL 1.0.7 documentation"/>
<link href="../../pymel.core.nodetypes.html" rel="up" title="pymel.core.nodetypes"/>
<link href="pymel.core.nodetypes.ObjectRenderFilter.html" rel="next" title="pymel.core.nodetypes.ObjectRenderFilter"/>
<link href="pymel.core.nodetypes.ObjectMultiFilter.html" rel="prev" title="pymel.core.nodetypes.ObjectMultiFilter"/>
<link href="../../../../style/adsk.cpm.css" rel="stylesheet" type="text/css"/><meta content="expert" name="experiencelevel"/><meta content="programmer" name="audience"/><meta content="enable" name="user-comments"/><meta content="ENU" name="language"/><meta content="MAYAUL" name="product"/><meta content="2016" name="release"/><meta content="Customization" name="book"/><meta content="Maya-Tech-Docs" name="component"/><meta content="/view/MAYAUL/2016/ENU/" name="helpsystempath"/><meta content="04/03/2015" name="created"/><meta content="04/03/2015" name="modified"/><meta content="Navigation
index
modules |
next |
previous |
PyMEL 1.0.7 documentation »
pymel.core.nodetypes »
pymel.core.nodetypes.ObjectNameFilter ¶
class ObjectNameFilter ( *args , **kwargs ) ¶
MAttrClass = Enum( EnumValue('MAttrClass', 1, 'localDynamicAttr'), EnumValue('MAttrClass', 2, 'normalAttr'), EnumValue('MAttrClass', 3, 'extensionAttr'), EnumValue('MAttrClass', 4, 'invalidAttr')) ¶
MdgTimerMetric =..." name="description"/><meta content="__PyMel_generated_classes_pymel_core_nodetypes_pymel_core_nodetypes_ObjectNameFilter_html" name="topicid"/>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a accesskey="I" href="../../../genindex.html" title="General Index">index</a></li>
<li class="right">
<a href="../../../py-modindex.html" title="Python Module Index">modules</a> |</li>
<li class="right">
<a accesskey="N" href="pymel.core.nodetypes.ObjectRenderFilter.html" title="pymel.core.nodetypes.ObjectRenderFilter">next</a> |</li>
<li class="right">
<a accesskey="P" href="pymel.core.nodetypes.ObjectMultiFilter.html" title="pymel.core.nodetypes.ObjectMultiFilter">previous</a> |</li>
<li><a href="../../../index-2.html">PyMEL 1.0.7 documentation</a> »</li>
<li><a accesskey="U" href="../../pymel.core.nodetypes.html">pymel.core.nodetypes</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="pymel-core-nodetypes-objectnamefilter">
<h1>pymel.core.nodetypes.ObjectNameFilter<a class="headerlink" href="#pymel-core-nodetypes-objectnamefilter" title="Permalink to this headline">¶</a></h1>
<p class="graphviz">
<img alt="Inheritance diagram of ObjectNameFilter" class="inheritance" src="../../../_images/inheritance-5c88db0bebf560216b63522733d72f16e51b1877.png" usemap="#inheritance89d800f367"/>
<map id="inheritance89d800f367" name="inheritance89d800f367">
<area alt="" coords="15,83,100,107" href="pymel.core.nodetypes.DependNode.html#pymel.core.nodetypes.DependNode" id="node1" shape="rect" title="DependNode"></area>
<area alt="" coords="20,121,95,145" href="pymel.core.nodetypes.ObjectFilter.html#pymel.core.nodetypes.ObjectFilter" id="node3" shape="rect" title="ObjectFilter"></area>
<area alt="" coords="21,44,93,68" href="../pymel.core.general/pymel.core.general.PyNode.html#pymel.core.general.PyNode" id="node2" shape="rect" title="Abstract class that is base for all pymel nodes classes."></area>
<area alt="" coords="5,160,110,184" href="#pymel.core.nodetypes.ObjectNameFilter" id="node4" shape="rect" title="ObjectNameFilter"></area>
<area alt="" coords="14,5,101,29" href="../pymel.util.utilitytypes/pymel.util.utilitytypes.ProxyUnicode.html#pymel.util.utilitytypes.ProxyUnicode" id="node5" shape="rect" title="ProxyUnicode"></area>
</map>
</p>
<dl class="class">
<dt id="pymel.core.nodetypes.ObjectNameFilter"><a name="//apple_ref/cpp/Class/pymel.core.nodetypes.ObjectNameFilter"></a>
<em class="property">class </em><tt class="descname">ObjectNameFilter</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pymel.core.nodetypes.ObjectNameFilter" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="pymel.core.nodetypes.ObjectNameFilter.MAttrClass"><a name="//apple_ref/cpp/Attribute/pymel.core.nodetypes.ObjectNameFilter.MAttrClass"></a>
<tt class="descname">MAttrClass</tt><em class="property"> = Enum( EnumValue('MAttrClass', 1, 'localDynamicAttr'), EnumValue('MAttrClass', 2, 'normalAttr'), EnumValue('MAttrClass', 3, 'extensionAttr'), EnumValue('MAttrClass', 4, 'invalidAttr'))</em><a class="headerlink" href="#pymel.core.nodetypes.ObjectNameFilter.MAttrClass" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="pymel.core.nodetypes.ObjectNameFilter.MdgTimerMetric"><a name="//apple_ref/cpp/Attribute/pymel.core.nodetypes.ObjectNameFilter.MdgTimerMetric"></a>
<tt class="descname">MdgTimerMetric</tt><em class="property"> = Enum( EnumValue('MdgTimerMetric', 0, 'metric_callback'), EnumValue('MdgTimerMetric', 1, 'metric_compute'), EnumValue('MdgTimerMetric', 2, 'metric_dirty'), EnumValue('MdgTimerMetric', 3, 'metric_draw'), EnumValue('MdgTimerMetric', 4, 'metric_fetch'), EnumValue('MdgTimerMetric', 5, 'metric_callbackViaAPI'), EnumValue('MdgTimerMetric', 6, 'metric_callbackNotViaAPI'), EnumValue('MdgTimerMetric', 7, 'metric_computeDuringCallback'), EnumValue('MdgTimerMetric', 8, 'metric_computeNotDuringCallback'), EnumValue('MdgTimerMetric', 9, 'metrics'))</em><a class="headerlink" href="#pymel.core.nodetypes.ObjectNameFilter.MdgTimerMetric" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="pymel.core.nodetypes.ObjectNameFilter.MdgTimerState"><a name="//apple_ref/cpp/Attribute/pymel.core.nodetypes.ObjectNameFilter.MdgTimerState"></a>
<tt class="descname">MdgTimerState</tt><em class="property"> = Enum( EnumValue('MdgTimerState', 0, 'off'), EnumValue('MdgTimerState', 1, 'on'), EnumValue('MdgTimerState', 2, 'uninitialized'), EnumValue('MdgTimerState', 3, 'invalidState'))</em><a class="headerlink" href="#pymel.core.nodetypes.ObjectNameFilter.MdgTimerState" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="pymel.core.nodetypes.ObjectNameFilter.MdgTimerType"><a name="//apple_ref/cpp/Attribute/pymel.core.nodetypes.ObjectNameFilter.MdgTimerType"></a>
<tt class="descname">MdgTimerType</tt><em class="property"> = Enum( EnumValue('MdgTimerType', 0, 'type_self'), EnumValue('MdgTimerType', 1, 'type_inclusive'), EnumValue('MdgTimerType', 2, 'type_count'), EnumValue('MdgTimerType', 3, 'types'))</em><a class="headerlink" href="#pymel.core.nodetypes.ObjectNameFilter.MdgTimerType" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="pymel.core.nodetypes.ObjectMultiFilter.html" title="previous chapter">pymel.core.nodetypes.ObjectMultiFilter</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="pymel.core.nodetypes.ObjectRenderFilter.html" title="next chapter">pymel.core.nodetypes.ObjectRenderFilter</a></p>
<h3><a href="../../../modules.html">Core Modules</a></h3>
<ul>
<li><a class="reference external" href="../../pymel.core.animation.html#module-pymel.core.animation"><tt class="xref">animation</tt></a></li>
<li><a class="reference external" href="../../pymel.core.effects.html#module-pymel.core.effects"><tt class="xref">effects</tt></a></li>
<li><a class="reference external" href="../../pymel.core.general.html#module-pymel.core.general"><tt class="xref">general</tt></a></li>
<li><a class="reference external" href="../../pymel.core.language.html#module-pymel.core.language"><tt class="xref">language</tt></a></li>
<li><a class="reference external" href="../../pymel.core.modeling.html#module-pymel.core.modeling"><tt class="xref">modeling</tt></a></li>
<li><a class="reference external" href="../../pymel.core.rendering.html#module-pymel.core.rendering"><tt class="xref">rendering</tt></a></li>
<li><a class="reference external" href="../../pymel.core.system.html#module-pymel.core.system"><tt class="xref">system</tt></a></li>
<li><a class="reference external" href="../../pymel.core.windows.html#module-pymel.core.windows"><tt class="xref">windows</tt></a></li>
</ul>
<h3><a href="../../../modules.html">Type Modules</a></h3>
<ul>
<li><a class="reference external" href="../../pymel.core.datatypes.html#module-pymel.core.datatypes"><tt class="xref">datatypes</tt></a></li>
<li><a class="reference external" href="../../pymel.core.nodetypes.html#module-pymel.core.nodetypes"><tt class="xref">nodetypes</tt></a></li>
<li><a class="reference external" href="../../pymel.core.uitypes.html#module-pymel.core.uitypes"><tt class="xref">uitypes</tt></a></li>
</ul>
<h3><a href="../../../modules.html">Other Modules</a></h3>
<ul>
<li><a class="reference external" href="../../pymel.api.plugins.html#module-pymel.api.plugins"><tt class="xref">plugins</tt></a></li>
<li><a class="reference external" href="../../pymel.mayautils.html#module-pymel.mayautils"><tt class="xref">mayautils</tt></a></li>
<li><a class="reference external" href="../../pymel.util.html#module-pymel.util"><tt class="xref">util</tt></a></li>
<li><a class="reference external" href="../../pymel.versions.html#module-pymel.versions"><tt class="xref">versions</tt></a>
</li><li><a class="reference external" href="../../pymel.tools.html#module-pymel.tools"><tt class="xref">tools</tt></a></li>
</ul>
<!--
<ul>
<li><a class="reference external" href="../../pymel.core.animation.html.html#module-pymel.core.animation"><tt class="xref">animation</tt></a></li>
<li><a class="reference external" href="../../pymel.core.datatypes.html.html#module-pymel.core.datatypes"><tt class="xref">datatypes</tt></a></li>
<li><a class="reference external" href="../../pymel.core.effects.html.html#module-pymel.core.effects"><tt class="xref">effects</tt></a></li>
<li><a class="reference external" href="../../pymel.core.general.html.html#module-pymel.core.general"><tt class="xref">general</tt></a></li>
<li><a class="reference external" href="../../pymel.core.language.html.html#module-pymel.core.language"><tt class="xref">language</tt></a></li>
<li><a class="reference external" href="../../pymel.core.modeling.html.html#module-pymel.core.modeling"><tt class="xref">modeling</tt></a></li>
<li><a class="reference external" href="../../pymel.core.nodetypes.html.html#module-pymel.core.nodetypes"><tt class="xref">nodetypes</tt></a></li>
<li><a class="reference external" href="../../pymel.core.rendering.html.html#module-pymel.core.rendering"><tt class="xref">rendering</tt></a></li>
<li><a class="reference external" href="../../pymel.core.system.html.html#module-pymel.core.system"><tt class="xref">system</tt></a></li>
<li><a class="reference external" href="../../pymel.core.windows.html.html#module-pymel.core.windows"><tt class="xref">windows</tt></a></li>
<li><a class="reference external" href="../../pymel.util.html.html#module-pymel.util"><tt class="xref">pymel.util</tt></a></li>
</ul>
-->
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/generated/classes/pymel.core.nodetypes/pymel.core.nodetypes.ObjectNameFilter.txt" rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form action="http://help.autodesk.com/cloudhelp/2016/ENU/Maya-Tech-Docs/PyMel/search.html" class="search" method="get"></form>
<input name="q" type="text"/>
<input type="submit" value="Go"/>
<input name="check_keywords" type="hidden" value="yes"/>
<input name="area" type="hidden" value="default"/>
<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="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index">index</a></li>
<li class="right">
<a href="../../../py-modindex.html" title="Python Module Index">modules</a> |</li>
<li class="right">
<a href="pymel.core.nodetypes.ObjectRenderFilter.html" title="pymel.core.nodetypes.ObjectRenderFilter">next</a> |</li>
<li class="right">
<a href="pymel.core.nodetypes.ObjectMultiFilter.html" title="pymel.core.nodetypes.ObjectMultiFilter">previous</a> |</li>
<li><a href="../../../index-2.html">PyMEL 1.0.7 documentation</a> »</li>
<li><a href="../../pymel.core.nodetypes.html">pymel.core.nodetypes</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2009, Chad Dombrova.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
<!-- Mirrored from help.autodesk.com/cloudhelp/2016/ENU/Maya-Tech-Docs/PyMel/generated/classes/pymel.core.nodetypes/pymel.core.nodetypes.ObjectNameFilter.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 01 Aug 2015 05:33:01 GMT -->
</body></html> | {'content_hash': '620075711f6dd8d8ebabd94a4f51f60a', 'timestamp': '', 'source': 'github', 'line_count': 212, 'max_line_length': 739, 'avg_line_length': 67.88207547169812, 'alnum_prop': 0.7025918977138489, 'repo_name': 'alexwidener/PyMelDocset', 'id': '64778dc27bf1ea0b636949e8c7a934e0f0be5d12', 'size': '14411', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'PyMel.docset/Contents/Resources/Documents/generated/classes/pymel.core.nodetypes/pymel.core.nodetypes.ObjectNameFilter.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '16618'}, {'name': 'HTML', 'bytes': '97827047'}, {'name': 'JavaScript', 'bytes': '24674'}]} |
namespace gpdxl
{
using namespace gpos;
using namespace gpmd;
using namespace gpnaucrates;
XERCES_CPP_NAMESPACE_USE
//---------------------------------------------------------------------------
// @class:
// CParseHandlerStatsDerivedRelation
//
// @doc:
// Base parse handler class for derived relation statistics
//
//---------------------------------------------------------------------------
class CParseHandlerStatsDerivedRelation : public CParseHandlerBase
{
private:
// number of rows in the relation
CDouble m_rows;
// flag to express that the statistics is on an empty input
BOOL m_empty;
// relation stats
CDXLStatsDerivedRelation *m_dxl_stats_derived_relation;
// private copy ctor
CParseHandlerStatsDerivedRelation(
const CParseHandlerStatsDerivedRelation &);
// process the start of an element
void StartElement(
const XMLCh *const element_uri, // URI of element's namespace
const XMLCh *const element_local_name, // local part of element's name
const XMLCh *const element_qname, // element's qname
const Attributes &attr // element's attributes
);
// process the end of an element
void EndElement(
const XMLCh *const element_uri, // URI of element's namespace
const XMLCh *const element_local_name, // local part of element's name
const XMLCh *const element_qname // element's qname
);
public:
// ctor
CParseHandlerStatsDerivedRelation(CMemoryPool *mp,
CParseHandlerManager *parse_handler_mgr,
CParseHandlerBase *parse_handler_root);
// dtor
virtual ~CParseHandlerStatsDerivedRelation();
// the derived relation stats
CDXLStatsDerivedRelation *
GetDxlStatsDrvdRelation() const
{
return m_dxl_stats_derived_relation;
}
};
} // namespace gpdxl
#endif // !GPDXL_CParseHandlerStatsDerivedRelation_H
// EOF
| {'content_hash': '4032c927dfc98f19bd7b9b40ba8fb7bb', 'timestamp': '', 'source': 'github', 'line_count': 68, 'max_line_length': 77, 'avg_line_length': 26.514705882352942, 'alnum_prop': 0.6805324459234608, 'repo_name': 'greenplum-db/gporca', 'id': '1f8fe63d13bb3a33e16cf85f01da07af03116965', 'size': '2380', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'libnaucrates/include/naucrates/dxl/parser/CParseHandlerStatsDerivedRelation.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '44424'}, {'name': 'C++', 'bytes': '12361209'}, {'name': 'CMake', 'bytes': '43200'}, {'name': 'Python', 'bytes': '84683'}, {'name': 'Shell', 'bytes': '4879'}]} |
package org.belle.topit.visio.base ;
import com4j.*;
@IID("{000D073A-0000-0000-C000-000000000046}")
public interface IVValidation extends Com4jObject {
// Methods:
/**
* <p>
* Getter method for the COM property "Application"
* </p>
* @return Returns a value of type test.IVApplication
*/
@DISPID(1610743808) //= 0x60020000. The runtime will prefer the VTID if present
@VTID(7)
org.belle.topit.visio.base.IVApplication application();
/**
* <p>
* Getter method for the COM property "Stat"
* </p>
* @return Returns a value of type short
*/
@DISPID(1610743809) //= 0x60020001. The runtime will prefer the VTID if present
@VTID(8)
short stat();
/**
* <p>
* Getter method for the COM property "Document"
* </p>
* @return Returns a value of type test.IVDocument
*/
@DISPID(1610743810) //= 0x60020002. The runtime will prefer the VTID if present
@VTID(9)
org.belle.topit.visio.base.IVDocument document();
/**
* <p>
* Getter method for the COM property "ObjectType"
* </p>
* @return Returns a value of type short
*/
@DISPID(1610743811) //= 0x60020003. The runtime will prefer the VTID if present
@VTID(10)
short objectType();
/**
* <p>
* Getter method for the COM property "LastValidatedDate"
* </p>
* @return Returns a value of type java.util.Date
*/
@DISPID(1610743812) //= 0x60020004. The runtime will prefer the VTID if present
@VTID(11)
java.util.Date lastValidatedDate();
/**
* <p>
* Getter method for the COM property "ShowIgnoredIssues"
* </p>
* @return Returns a value of type boolean
*/
@DISPID(1610743813) //= 0x60020005. The runtime will prefer the VTID if present
@VTID(12)
boolean showIgnoredIssues();
/**
* <p>
* Setter method for the COM property "ShowIgnoredIssues"
* </p>
* @param isShown Mandatory boolean parameter.
*/
@DISPID(1610743813) //= 0x60020005. The runtime will prefer the VTID if present
@VTID(13)
void showIgnoredIssues(
boolean isShown);
/**
* <p>
* Getter method for the COM property "RuleSets"
* </p>
* @return Returns a value of type test.IVValidationRuleSets
*/
@DISPID(1610743815) //= 0x60020007. The runtime will prefer the VTID if present
@VTID(14)
org.belle.topit.visio.base.IVValidationRuleSets ruleSets();
@VTID(14)
@ReturnValue(defaultPropertyThrough={org.belle.topit.visio.base.IVValidationRuleSets.class})
org.belle.topit.visio.base.IVValidationRuleSet ruleSets(
@MarshalAs(NativeType.VARIANT) java.lang.Object nameUOrIndex);
/**
* <p>
* Getter method for the COM property "Issues"
* </p>
* @return Returns a value of type test.IVValidationIssues
*/
@DISPID(0) //= 0x0. The runtime will prefer the VTID if present
@VTID(15)
@DefaultMethod
org.belle.topit.visio.base.IVValidationIssues issues();
@VTID(15)
@ReturnValue(defaultPropertyThrough={org.belle.topit.visio.base.IVValidationIssues.class})
org.belle.topit.visio.base.IVValidationIssue issues(
int index);
/**
* @param ruleSet Optional parameter. Default value is unprintable.
* @param flags Optional parameter. Default value is 0
*/
@DISPID(1610743817) //= 0x60020009. The runtime will prefer the VTID if present
@VTID(16)
void validate(
@Optional org.belle.topit.visio.base.IVValidationRuleSet ruleSet,
@Optional org.belle.topit.visio.base.VisValidationFlags flags);
// Properties:
}
| {'content_hash': 'b2d3a049f0481d0feef91b944fa9cda8', 'timestamp': '', 'source': 'github', 'line_count': 141, 'max_line_length': 94, 'avg_line_length': 24.70212765957447, 'alnum_prop': 0.6792994544932529, 'repo_name': 'IvanZhang2013/visio-edit', 'id': '33016ab047d45567ca85a38ebd4afeda9c68f52a', 'size': '3483', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/org/belle/topit/visio/base/IVValidation.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '82'}, {'name': 'Java', 'bytes': '1452057'}]} |
require 'ads_common/savon_service'
require 'adwords_api/v201209/data_service_registry'
module AdwordsApi; module V201209; module DataService
class DataService < AdsCommon::SavonService
def initialize(config, endpoint)
namespace = 'https://adwords.google.com/api/adwords/cm/v201209'
super(config, endpoint, namespace, :v201209)
end
def get_ad_group_bid_landscape(*args, &block)
return execute_action('get_ad_group_bid_landscape', args, &block)
end
def get_criterion_bid_landscape(*args, &block)
return execute_action('get_criterion_bid_landscape', args, &block)
end
private
def get_service_registry()
return DataServiceRegistry
end
def get_module()
return AdwordsApi::V201209::DataService
end
end
end; end; end
| {'content_hash': '1f3371961d9974d9b58b5b081be80db7', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 72, 'avg_line_length': 27.586206896551722, 'alnum_prop': 0.70375, 'repo_name': 'hoblin/adwords_api', 'id': 'c88881127f46ea507ada4806062e2901e58305ab', 'size': '1076', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'lib/adwords_api/v201209/data_service.rb', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'JavaScript', 'bytes': '757'}, {'name': 'Ruby', 'bytes': '2879996'}]} |
"""
CORE data objects.
"""
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any, List, Optional, Tuple
import netaddr
from core import utils
from core.emulator.enumerations import (
EventTypes,
ExceptionLevels,
LinkTypes,
MessageFlags,
)
if TYPE_CHECKING:
from core.nodes.base import CoreNode, NodeBase
@dataclass
class ConfigData:
message_type: int = None
node: int = None
object: str = None
type: int = None
data_types: Tuple[int] = None
data_values: str = None
captions: str = None
bitmap: str = None
possible_values: str = None
groups: str = None
session: int = None
iface_id: int = None
network_id: int = None
opaque: str = None
@dataclass
class EventData:
node: int = None
event_type: EventTypes = None
name: str = None
data: str = None
time: str = None
session: int = None
@dataclass
class ExceptionData:
node: int = None
session: int = None
level: ExceptionLevels = None
source: str = None
date: str = None
text: str = None
opaque: str = None
@dataclass
class FileData:
message_type: MessageFlags = None
node: int = None
name: str = None
mode: str = None
number: int = None
type: str = None
source: str = None
session: int = None
data: str = None
compressed_data: str = None
@dataclass
class NodeOptions:
"""
Options for creating and updating nodes within core.
"""
name: str = None
model: Optional[str] = "PC"
canvas: int = None
icon: str = None
services: List[str] = field(default_factory=list)
config_services: List[str] = field(default_factory=list)
x: float = None
y: float = None
lat: float = None
lon: float = None
alt: float = None
server: str = None
image: str = None
emane: str = None
legacy: bool = False
# src, dst
binds: List[Tuple[str, str]] = field(default_factory=list)
# src, dst, unique, delete
volumes: List[Tuple[str, str, bool, bool]] = field(default_factory=list)
def set_position(self, x: float, y: float) -> None:
"""
Convenience method for setting position.
:param x: x position
:param y: y position
:return: nothing
"""
self.x = x
self.y = y
def set_location(self, lat: float, lon: float, alt: float) -> None:
"""
Convenience method for setting location.
:param lat: latitude
:param lon: longitude
:param alt: altitude
:return: nothing
"""
self.lat = lat
self.lon = lon
self.alt = alt
@dataclass
class NodeData:
"""
Node to broadcast.
"""
node: "NodeBase"
message_type: MessageFlags = None
source: str = None
@dataclass
class InterfaceData:
"""
Convenience class for storing interface data.
"""
id: int = None
name: str = None
mac: str = None
ip4: str = None
ip4_mask: int = None
ip6: str = None
ip6_mask: int = None
mtu: int = None
def get_ips(self) -> List[str]:
"""
Returns a list of ip4 and ip6 addresses when present.
:return: list of ip addresses
"""
ips = []
if self.ip4 and self.ip4_mask:
ips.append(f"{self.ip4}/{self.ip4_mask}")
if self.ip6 and self.ip6_mask:
ips.append(f"{self.ip6}/{self.ip6_mask}")
return ips
@dataclass
class LinkOptions:
"""
Options for creating and updating links within core.
"""
delay: int = None
bandwidth: int = None
loss: float = None
dup: int = None
jitter: int = None
mer: int = None
burst: int = None
mburst: int = None
unidirectional: int = None
key: int = None
buffer: int = None
def update(self, options: "LinkOptions") -> bool:
"""
Updates current options with values from other options.
:param options: options to update with
:return: True if any value has changed, False otherwise
"""
changed = False
if options.delay is not None and 0 <= options.delay != self.delay:
self.delay = options.delay
changed = True
if options.bandwidth is not None and 0 <= options.bandwidth != self.bandwidth:
self.bandwidth = options.bandwidth
changed = True
if options.loss is not None and 0 <= options.loss != self.loss:
self.loss = options.loss
changed = True
if options.dup is not None and 0 <= options.dup != self.dup:
self.dup = options.dup
changed = True
if options.jitter is not None and 0 <= options.jitter != self.jitter:
self.jitter = options.jitter
changed = True
if options.buffer is not None and 0 <= options.buffer != self.buffer:
self.buffer = options.buffer
changed = True
return changed
def is_clear(self) -> bool:
"""
Checks if the current option values represent a clear state.
:return: True if the current values should clear, False otherwise
"""
clear = self.delay is None or self.delay <= 0
clear &= self.jitter is None or self.jitter <= 0
clear &= self.loss is None or self.loss <= 0
clear &= self.dup is None or self.dup <= 0
clear &= self.bandwidth is None or self.bandwidth <= 0
clear &= self.buffer is None or self.buffer <= 0
return clear
def __eq__(self, other: Any) -> bool:
"""
Custom logic to check if this link options is equivalent to another.
:param other: other object to check
:return: True if they are both link options with the same values,
False otherwise
"""
if not isinstance(other, LinkOptions):
return False
return (
self.delay == other.delay
and self.jitter == other.jitter
and self.loss == other.loss
and self.dup == other.dup
and self.bandwidth == other.bandwidth
and self.buffer == other.buffer
)
@dataclass
class LinkData:
"""
Represents all data associated with a link.
"""
message_type: MessageFlags = None
type: LinkTypes = LinkTypes.WIRED
label: str = None
node1_id: int = None
node2_id: int = None
network_id: int = None
iface1: InterfaceData = None
iface2: InterfaceData = None
options: LinkOptions = LinkOptions()
color: str = None
source: str = None
class IpPrefixes:
"""
Convenience class to help generate IP4 and IP6 addresses for nodes within CORE.
"""
def __init__(self, ip4_prefix: str = None, ip6_prefix: str = None) -> None:
"""
Creates an IpPrefixes object.
:param ip4_prefix: ip4 prefix to use for generation
:param ip6_prefix: ip6 prefix to use for generation
:raises ValueError: when both ip4 and ip6 prefixes have not been provided
"""
if not ip4_prefix and not ip6_prefix:
raise ValueError("ip4 or ip6 must be provided")
self.ip4 = None
if ip4_prefix:
self.ip4 = netaddr.IPNetwork(ip4_prefix)
self.ip6 = None
if ip6_prefix:
self.ip6 = netaddr.IPNetwork(ip6_prefix)
def ip4_address(self, node_id: int) -> str:
"""
Convenience method to return the IP4 address for a node.
:param node_id: node id to get IP4 address for
:return: IP4 address or None
"""
if not self.ip4:
raise ValueError("ip4 prefixes have not been set")
return str(self.ip4[node_id])
def ip6_address(self, node_id: int) -> str:
"""
Convenience method to return the IP6 address for a node.
:param node_id: node id to get IP6 address for
:return: IP4 address or None
"""
if not self.ip6:
raise ValueError("ip6 prefixes have not been set")
return str(self.ip6[node_id])
def gen_iface(self, node_id: int, name: str = None, mac: str = None):
"""
Creates interface data for linking nodes, using the nodes unique id for
generation, along with a random mac address, unless provided.
:param node_id: node id to create an interface for
:param name: name to set for interface, default is eth{id}
:param mac: mac address to use for this interface, default is random
generation
:return: new interface data for the provided node
"""
# generate ip4 data
ip4 = None
ip4_mask = None
if self.ip4:
ip4 = self.ip4_address(node_id)
ip4_mask = self.ip4.prefixlen
# generate ip6 data
ip6 = None
ip6_mask = None
if self.ip6:
ip6 = self.ip6_address(node_id)
ip6_mask = self.ip6.prefixlen
# random mac
if not mac:
mac = utils.random_mac()
return InterfaceData(
name=name, ip4=ip4, ip4_mask=ip4_mask, ip6=ip6, ip6_mask=ip6_mask, mac=mac
)
def create_iface(
self, node: "CoreNode", name: str = None, mac: str = None
) -> InterfaceData:
"""
Creates interface data for linking nodes, using the nodes unique id for
generation, along with a random mac address, unless provided.
:param node: node to create interface for
:param name: name to set for interface, default is eth{id}
:param mac: mac address to use for this interface, default is random
generation
:return: new interface data for the provided node
"""
iface_data = self.gen_iface(node.id, name, mac)
iface_data.id = node.next_iface_id()
return iface_data
| {'content_hash': '003f4c609dd8a2a9a5a943d71ba545cc', 'timestamp': '', 'source': 'github', 'line_count': 357, 'max_line_length': 86, 'avg_line_length': 27.719887955182074, 'alnum_prop': 0.589733225545675, 'repo_name': 'coreemu/core', 'id': 'de5b355920957c1bca100039f371202b78aaae47', 'size': '9896', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'daemon/core/emulator/data.py', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'C', 'bytes': '92828'}, {'name': 'HTML', 'bytes': '329'}, {'name': 'M4', 'bytes': '7568'}, {'name': 'Makefile', 'bytes': '11209'}, {'name': 'Python', 'bytes': '1530671'}, {'name': 'Shell', 'bytes': '25741'}]} |
package vn.com.hiringviet.util;
import java.io.File;
import java.io.InputStream;
import java.util.List;
import java.util.Properties;
import org.apache.commons.io.FileUtils;
// TODO: Auto-generated Javadoc
/**
* The Class FileUtil.
*/
public class FileUtil {
/**
* Get properties from message properties file.
*
* @return the config properties
*/
public static Properties getConfigProperties() {
// read properites file:
Properties props = new Properties();
InputStream in = FileUtil.class.getResourceAsStream("/config.properties");
try {
props.load(in);
} catch (Exception e) {
return null;
}
return props;
}
/**
* Gets the message properties.
*
* @return the message properties
*/
public static Properties getMessageProperties() {
// read properites file:
Properties props = new Properties();
InputStream in = FileUtil.class.getResourceAsStream("/messages_en.properties");
try {
props.load(in);
} catch (Exception e) {
return null;
}
return props;
}
/**
* Copy file on server.
*
* @param des the des
* @param source the source
* @return true, if successful
* @throws Exception the exception
*/
public static boolean copyFileOnServer(String des, String source) throws Exception {
File fileDes = new File(des);
File fileSource = new File(source);
if (fileSource.exists()) {
// copy to path
FileUtils.copyFile(fileSource, fileDes);
} else {
return false;
}
return true;
}
/**
* Delete list file.
*
* @param lstFile the lst file
*/
public static void deleteListFile(List<File> lstFile) {
for (File file : lstFile) {
// check exist and delete
if (file.exists()) {
// delete file
file.delete();
}
}
}
}
| {'content_hash': '54098372be69ed3bc1ce68978c7d9bc8', 'timestamp': '', 'source': 'github', 'line_count': 90, 'max_line_length': 85, 'avg_line_length': 19.41111111111111, 'alnum_prop': 0.6685746994848312, 'repo_name': 'aholake/hiringviet', 'id': '26f785e69a0dac3a400967679e68e4fd899b4776', 'size': '1747', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/vn/com/hiringviet/util/FileUtil.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '377195'}, {'name': 'HTML', 'bytes': '204009'}, {'name': 'Java', 'bytes': '692220'}, {'name': 'JavaScript', 'bytes': '377271'}, {'name': 'PHP', 'bytes': '2157'}]} |
using System.IO;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Dispatcher;
using System.Xml;
namespace Affecto.Wcf.Behaviors
{
public class ResponseNamespaceRemover : IClientMessageInspector
{
public object BeforeSendRequest(ref Message request, IClientChannel channel)
{
return null;
}
public void AfterReceiveReply(ref Message reply, object correlationState)
{
MemoryStream stream = new MemoryStream();
ResponseDocument responseDocument = GetReplyDocument(reply, stream);
responseDocument.RemoveReturnDataNamespaces();
WriteNodeToStream(stream, responseDocument.Document);
XmlReader reader = XmlReader.Create(stream);
reply = Message.CreateMessage(reader, int.MaxValue, reply.Version);
}
private static void WriteNodeToStream(Stream stream, XmlNode node)
{
stream.SetLength(0);
using (XmlWriter writer = XmlWriter.Create(stream))
{
node.WriteTo(writer);
writer.Flush();
}
stream.Position = 0;
}
private static ResponseDocument GetReplyDocument(Message reply, Stream stream)
{
XmlDocument doc = new XmlDocument();
using (XmlWriter writer = XmlWriter.Create(stream))
{
reply.WriteMessage(writer);
writer.Flush();
}
stream.Position = 0;
doc.Load(stream);
return ResponseDocument.Load(doc);
}
}
}
| {'content_hash': '730483ffa3eb9e3c097fc1c4fd1cebd1', 'timestamp': '', 'source': 'github', 'line_count': 50, 'max_line_length': 91, 'avg_line_length': 33.1, 'alnum_prop': 0.6030211480362537, 'repo_name': 'affecto/dotnet-Wcf.Behaviors', 'id': '8dcc9f76f9543d06c6657e6c8692ab9d6c9bf97b', 'size': '1657', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'source/Wcf.Behaviors/ResponseNamespaceRemover.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '18657'}]} |
<?xml version="1.0" encoding="utf-8" ?>
<View xmlns="http://schemas.mediachase.com/ecf/view">
<ListViewUI>
<Toolbar>
<add>
<Button id="NewWarehouse" text="{SharedStrings:New_Warehouse}" imageUrl="~/Apps/Shell/styles/Images/new.png" commandName="cmdCatalogNewWarehouse" permissions="catalog:admin:warehouses:mng:create"/>
<Splitter id="ActionsSplitter"/>
<Menu id="ActionsSplitButton" text="{SharedStrings:More_Actions}" imageUrl="~/Apps/Shell/styles/Images/toolbar/newtask.gif" permissions="catalog:admin:warehouses:mng:delete">
<Button id="DeleteSelected" text="{SharedStrings:Delete_Selected}" imageUrl="~/Apps/Shell/styles/Images/toolbar/delete.gif" commandName="cmdCatalogDeleteWarehouse" permissions="catalog:admin:warehouses:mng:delete"/>
</Menu>
</add>
</Toolbar>
<Grid>
<add>
<Columns>
<Column columnType="CheckBox" />
<Column visible="false" width="30" allowSorting="false" dataField="WarehouseId" headingText="{SharedStrings:ID}"></Column>
<Column width="400" allowSorting="true" dataField="Name" headingText="{SharedStrings:Name}" id="Name" columnType="HyperLink" dataNavigateUrlFields="WarehouseId" dataNavigateUrlFormatString="javascript:CSManagementClient.ChangeView('Catalog','Warehouse-Edit', 'WarehouseId={0}');" dataTextFields="Name" dataTextFormatString="{0}" permissions="catalog:admin:warehouses:mng:edit"></Column>
<Column width="50" allowSorting="true" dataField="IsActive" headingText="{SharedStrings:IsActive}"></Column>
<Column width="125" allowSorting="true" dataField="IsFulfillmentCenter" headingText="{CatalogStrings:Warehouse_IsFulfillmentCenter}"></Column>
<Column width="125" allowSorting="true" dataField="IsPickupLocation" headingText="{CatalogStrings:Warehouse_IsPickupLocation}"></Column>
<Column width="125" allowSorting="true" dataField="IsDeliveryLocation" headingText="{CatalogStrings:Warehouse_IsDeliveryLocation}"></Column>
<Column width="150" columnType="DateTime" allowSorting="true" dataField="Created" headingText="{SharedStrings:Created}"></Column>
<Column width="150" columnType="DateTime" allowSorting="true" dataField="Modified" headingText="{SharedStrings:Modified}"></Column>
<Column width="70" allowSorting="true" dataField="SortOrder" headingText="{SharedStrings:Sort_Order}"></Column>
</Columns>
</add>
</Grid>
<Commands>
<add>
<Command id="cmdCatalogNewWarehouse">
<CommandType>ClientAction</CommandType>
<ClientScript>CSManagementClient.ChangeView('Catalog', 'Warehouse-Edit')</ClientScript>
<EnableHandler type="Mediachase.Commerce.Manager.Apps.Catalog.CommandHandlers.CatalogPermissionEnableHandler, Mediachase.ConsoleManager" />
</Command>
<Command id="cmdCatalogDeleteWarehouse">
<BeforeClientScript>Toolbar_GridHasItemsSelected</BeforeClientScript>
<ConfirmationText>{CommerceManager:DeleteSelectedWarehouseConfirmation}</ConfirmationText>
<CommandType>ServerAction</CommandType>
<Handler type="Mediachase.Commerce.Manager.Apps.Catalog.CommandHandlers.WarehouseDeleteHandler, Mediachase.ConsoleManager" />
<UpdatePanelIds>panelMainListView</UpdatePanelIds>
<EnableHandler type="Mediachase.Commerce.Manager.Apps.Catalog.CommandHandlers.CatalogPermissionEnableHandler, Mediachase.ConsoleManager" />
</Command>
</add>
</Commands>
</ListViewUI>
<ViewConfig>
<setAttributes id="Warehouse-List" controlUrl="catalog/WarehouseList.ascx" permissions="catalog:admin:warehouses:mng:view" help="Catalog+System"></setAttributes>
</ViewConfig>
</View>
| {'content_hash': 'beb432aa9f845f775cd7ae0fdd7c37d0', 'timestamp': '', 'source': 'github', 'line_count': 51, 'max_line_length': 391, 'avg_line_length': 70.47058823529412, 'alnum_prop': 0.756816917084029, 'repo_name': 'episerver/commerce-webforms-sample', 'id': '4a0f5bff4d211cfa753f60f80532234a2fee90a8', 'size': '3596', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'CommerceManager/Apps/Catalog/Config/View/Warehouse-List.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ASP', 'bytes': '1793861'}, {'name': 'C#', 'bytes': '434758'}, {'name': 'CSS', 'bytes': '428895'}, {'name': 'HTML', 'bytes': '243731'}, {'name': 'JavaScript', 'bytes': '1194594'}, {'name': 'Shell', 'bytes': '2442'}]} |
package com.magnet.tools.tests;
import org.apache.commons.exec.DefaultExecuteResultHandler;
import org.apache.commons.exec.ExecuteException;
import org.apache.commons.exec.ExecuteWatchdog;
/**
* Print Result Handler : an Execute Result Handler that process that notify us of the result, timeout or error
*/
public class PrintResultHandler extends DefaultExecuteResultHandler {
private ExecuteWatchdog watchdog;
public PrintResultHandler(ExecuteWatchdog watchdog) {
this.watchdog = watchdog;
}
public void onProcessComplete(int exitValue) {
super.onProcessComplete(exitValue);
System.out.println("[resultHandler] The process was successfully executed ...");
}
public void onProcessFailed(ExecuteException e) {
super.onProcessFailed(e);
if (watchdog != null && watchdog.killedProcess()) {
System.err.println("[resultHandler] The print process timed out");
} else {
System.err.println("[resultHandler] The print process failed to do : " + e.getMessage());
}
}
} | {'content_hash': 'f29ef6d25732f9f98a37c8d311d7daf5', 'timestamp': '', 'source': 'github', 'line_count': 33, 'max_line_length': 111, 'avg_line_length': 30.96969696969697, 'alnum_prop': 0.7446183953033269, 'repo_name': 'magnetsystems/r2m-cli', 'id': '66d5c72c427a250408d8f14917768917d13c8bf7', 'size': '1649', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'tests/src/test/java/com/magnet/tools/tests/PrintResultHandler.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '1668'}, {'name': 'Groovy', 'bytes': '413765'}, {'name': 'Java', 'bytes': '319552'}, {'name': 'Ruby', 'bytes': '1415'}, {'name': 'Shell', 'bytes': '14419'}]} |
var UI = require('ui');
var WindowMgr = require('windowmgr');
var exports = module.exports = {};
exports.now = function () {
return new Date().toLocaleString();
};
exports.arrayize = function (maybeArray) {
if ( ! (maybeArray instanceof Array)) {
maybeArray = [ maybeArray ];
}
return maybeArray;
};
exports.log = function (msg) {
console.log(exports.now() + ": " + msg);
};
exports.error = function (title, subtitle) {
var card = new UI.Card({
title: title,
subtitle: subtitle
});
// Display the Card
WindowMgr.popAll();
WindowMgr.push(card);
};
| {'content_hash': 'e61e274e2996fbf811b990d2600fc572', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 44, 'avg_line_length': 20.137931034482758, 'alnum_prop': 0.6352739726027398, 'repo_name': 'perrin7/openhab.pebble', 'id': 'be9965fcf395c9c69b563b012aefc1dd4dddf4bf', 'size': '1218', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/util.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'JavaScript', 'bytes': '24186'}, {'name': 'Shell', 'bytes': '1714'}]} |
package uk.co.bluegecko.core.service.base.common.settings.spring;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import uk.co.bluegecko.core.model.key.Defaulted;
import uk.co.bluegecko.core.model.key.Key;
import uk.co.bluegecko.core.service.common.settings.PropertyService;
import uk.co.bluegecko.core.test.harness.TestHarness;
@Configuration
@PropertySource( "classpath:test.properties" )
public class SpringPropertyServiceTest extends TestHarness
{
private enum TestSetting implements Key< TestSetting >
{
FOO, BAR
}
private enum TestDefaultedSetting implements Key< TestDefaultedSetting >, Defaulted< String >
{
FOO( "Foo" ), BAR( "Bar" );
private final String defaultValue;
private TestDefaultedSetting( final String defaultValue )
{
this.defaultValue = defaultValue;
}
@Override
public String defaultValue()
{
return defaultValue;
}
}
@Autowired
private PropertyService propertyService;
@Test
public final void testFooExists()
{
assertThat( propertyService.has( TestSetting.FOO ), is( true ) );
}
@Test
public final void testFooValue()
{
assertThat( propertyService.property( TestSetting.FOO ), is( "Hello Foo" ) );
}
@Test
public final void testBarExists()
{
assertThat( propertyService.has( TestSetting.BAR ), is( false ) );
}
@Test
public final void testBarValue()
{
assertThat( propertyService.property( TestSetting.BAR ), is( ( String ) null ) );
}
@Test
public final void testBarDefault()
{
assertThat( propertyService.property( TestSetting.BAR, "GoodBye" ), is( "GoodBye" ) );
}
@Test
public final void testFooValueDefaulted()
{
assertThat( propertyService.property( TestSetting.FOO ), is( "Hello Foo" ) );
}
@Test
public final void testBarValueDefaulted()
{
assertThat( propertyService.property( TestDefaultedSetting.BAR ), is( "Bar" ) );
}
}
| {'content_hash': '6e0512ded9fbac71b9ae665a258028c4', 'timestamp': '', 'source': 'github', 'line_count': 92, 'max_line_length': 94, 'avg_line_length': 22.804347826086957, 'alnum_prop': 0.7473784556720686, 'repo_name': 'caveman-frak/java-core', 'id': '3cb92ab703798a5d0868ed2332001145e655f35b', 'size': '2190', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'core-model/src/test/java/uk/co/bluegecko/core/service/base/common/settings/spring/SpringPropertyServiceTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ANTLR', 'bytes': '324'}, {'name': 'CSS', 'bytes': '4195'}, {'name': 'Cucumber', 'bytes': '630'}, {'name': 'HTML', 'bytes': '953'}, {'name': 'Java', 'bytes': '799905'}, {'name': 'Ruby', 'bytes': '5830'}, {'name': 'Shell', 'bytes': '421'}]} |
using OfficeDevPnP.PartnerPack.SiteProvisioning.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace OfficeDevPnP.PartnerPack.SiteProvisioning.Binders
{
public class PeoplePickerUserBinder : IModelBinder
{
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
var v = bindingContext.ValueProvider.GetValue(bindingContext.ModelName);
if (v != null && v.RawValue != null)
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<PeoplePickerUser[]>(v.AttemptedValue);
}
return null;
}
}
} | {'content_hash': '3964a1043749069b83d623677911c341', 'timestamp': '', 'source': 'github', 'line_count': 24, 'max_line_length': 107, 'avg_line_length': 29.875, 'alnum_prop': 0.6903765690376569, 'repo_name': 'erwinvanhunen/PnP-Partner-Pack', 'id': '1efe02481507bf0287d0d308b1145e6de6a09de5', 'size': '719', 'binary': False, 'copies': '2', 'ref': 'refs/heads/dev', 'path': 'OfficeDevPnP.PartnerPack.SiteProvisioning/OfficeDevPnP.PartnerPack.SiteProvisioning/Binders/PeoplePickerUserBinder.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP', 'bytes': '132'}, {'name': 'C#', 'bytes': '218426'}, {'name': 'CSS', 'bytes': '19362'}, {'name': 'Groff', 'bytes': '4023'}, {'name': 'HTML', 'bytes': '48100'}, {'name': 'JavaScript', 'bytes': '73838'}, {'name': 'PowerShell', 'bytes': '99070'}]} |
<?php
class Google_Service_Pagespeedonline_LighthouseResultV5RuntimeError extends Google_Model
{
public $code;
public $message;
public function setCode($code)
{
$this->code = $code;
}
public function getCode()
{
return $this->code;
}
public function setMessage($message)
{
$this->message = $message;
}
public function getMessage()
{
return $this->message;
}
}
| {'content_hash': 'ef7e03599e9549797776a7b7e0fa7094', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 88, 'avg_line_length': 16.28, 'alnum_prop': 0.6609336609336609, 'repo_name': 'bshaffer/google-api-php-client-services', 'id': '28bf07855e2bb3136e4a4c8d2261cab8fa052eed', 'size': '997', 'binary': False, 'copies': '14', 'ref': 'refs/heads/master', 'path': 'src/Google/Service/Pagespeedonline/LighthouseResultV5RuntimeError.php', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'PHP', 'bytes': '9540154'}]} |
namespace asio {
namespace detail {
class kqueue_reactor
: public asio::detail::service_base<kqueue_reactor>
{
public:
enum op_types { read_op = 0, write_op = 1,
connect_op = 1, except_op = 2, max_ops = 3 };
// Per-descriptor queues.
struct descriptor_state
{
friend class kqueue_reactor;
friend class object_pool_access;
mutex mutex_;
int descriptor_;
op_queue<reactor_op> op_queue_[max_ops];
bool shutdown_;
descriptor_state* next_;
descriptor_state* prev_;
};
// Per-descriptor data.
typedef descriptor_state* per_descriptor_data;
// Constructor.
ASIO_DECL kqueue_reactor(asio::io_service& io_service);
// Destructor.
ASIO_DECL ~kqueue_reactor();
// Destroy all user-defined handler objects owned by the service.
ASIO_DECL void shutdown_service();
// Recreate internal descriptors following a fork.
ASIO_DECL void fork_service(
asio::io_service::fork_event fork_ev);
// Initialise the task.
ASIO_DECL void init_task();
// Register a socket with the reactor. Returns 0 on success, system error
// code on failure.
ASIO_DECL int register_descriptor(socket_type descriptor,
per_descriptor_data& descriptor_data);
// Register a descriptor with an associated single operation. Returns 0 on
// success, system error code on failure.
ASIO_DECL int register_internal_descriptor(
int op_type, socket_type descriptor,
per_descriptor_data& descriptor_data, reactor_op* op);
// Move descriptor registration from one descriptor_data object to another.
ASIO_DECL void move_descriptor(socket_type descriptor,
per_descriptor_data& target_descriptor_data,
per_descriptor_data& source_descriptor_data);
// Post a reactor operation for immediate completion.
void post_immediate_completion(reactor_op* op)
{
io_service_.post_immediate_completion(op);
}
// Start a new operation. The reactor operation will be performed when the
// given descriptor is flagged as ready, or an error has occurred.
ASIO_DECL void start_op(int op_type, socket_type descriptor,
per_descriptor_data& descriptor_data,
reactor_op* op, bool allow_speculative);
// Cancel all operations associated with the given descriptor. The
// handlers associated with the descriptor will be invoked with the
// operation_aborted error.
ASIO_DECL void cancel_ops(socket_type descriptor,
per_descriptor_data& descriptor_data);
// Cancel any operations that are running against the descriptor and remove
// its registration from the reactor.
ASIO_DECL void deregister_descriptor(socket_type descriptor,
per_descriptor_data& descriptor_data, bool closing);
// Remote the descriptor's registration from the reactor.
ASIO_DECL void deregister_internal_descriptor(
socket_type descriptor, per_descriptor_data& descriptor_data);
// Add a new timer queue to the reactor.
template <typename Time_Traits>
void add_timer_queue(timer_queue<Time_Traits>& queue);
// Remove a timer queue from the reactor.
template <typename Time_Traits>
void remove_timer_queue(timer_queue<Time_Traits>& queue);
// Schedule a new operation in the given timer queue to expire at the
// specified absolute time.
template <typename Time_Traits>
void schedule_timer(timer_queue<Time_Traits>& queue,
const typename Time_Traits::time_type& time,
typename timer_queue<Time_Traits>::per_timer_data& timer, timer_op* op);
// Cancel the timer operations associated with the given token. Returns the
// number of operations that have been posted or dispatched.
template <typename Time_Traits>
std::size_t cancel_timer(timer_queue<Time_Traits>& queue,
typename timer_queue<Time_Traits>::per_timer_data& timer,
std::size_t max_cancelled = (std::numeric_limits<std::size_t>::max)());
// Run the kqueue loop.
ASIO_DECL void run(bool block, op_queue<operation>& ops);
// Interrupt the kqueue loop.
ASIO_DECL void interrupt();
private:
// Create the kqueue file descriptor. Throws an exception if the descriptor
// cannot be created.
ASIO_DECL static int do_kqueue_create();
// Helper function to add a new timer queue.
ASIO_DECL void do_add_timer_queue(timer_queue_base& queue);
// Helper function to remove a timer queue.
ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue);
// Get the timeout value for the kevent call.
ASIO_DECL timespec* get_timeout(timespec& ts);
// The io_service implementation used to post completions.
io_service_impl& io_service_;
// Mutex to protect access to internal data.
mutex mutex_;
// The kqueue file descriptor.
int kqueue_fd_;
// The interrupter is used to break a blocking kevent call.
select_interrupter interrupter_;
// The timer queues.
timer_queue_set timer_queues_;
// Whether the service has been shut down.
bool shutdown_;
// Mutex to protect access to the registered descriptors.
mutex registered_descriptors_mutex_;
// Keep track of all registered descriptors.
object_pool<descriptor_state> registered_descriptors_;
};
} // namespace detail
} // namespace asio
#include "asio/detail/pop_options.hpp"
#include "asio/detail/impl/kqueue_reactor.hpp"
#if defined(ASIO_HEADER_ONLY)
# include "asio/detail/impl/kqueue_reactor.ipp"
#endif // defined(ASIO_HEADER_ONLY)
#endif // defined(ASIO_HAS_KQUEUE)
#endif // ASIO_DETAIL_KQUEUE_REACTOR_HPP
| {'content_hash': '1bc9c1c25c351a11ca5a49e331b462f0', 'timestamp': '', 'source': 'github', 'line_count': 165, 'max_line_length': 78, 'avg_line_length': 32.915151515151514, 'alnum_prop': 0.7223347449825078, 'repo_name': 'goodspeed24e/2014iOT', 'id': '472a5823e888ac4a443965d937dbb1ba0b8fa620', 'size': '6845', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'import/include/asio_OIR/detail/kqueue_reactor.hpp', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '113'}, {'name': 'Arduino', 'bytes': '277531'}, {'name': 'C', 'bytes': '6936891'}, {'name': 'C++', 'bytes': '172363257'}, {'name': 'CMake', 'bytes': '164887'}, {'name': 'CSS', 'bytes': '49182'}, {'name': 'Elixir', 'bytes': '1173'}, {'name': 'HTML', 'bytes': '86811'}, {'name': 'JavaScript', 'bytes': '108448'}, {'name': 'Makefile', 'bytes': '266049'}, {'name': 'PHP', 'bytes': '19013'}, {'name': 'Perl', 'bytes': '6080'}, {'name': 'Processing', 'bytes': '272212'}, {'name': 'Python', 'bytes': '92290'}, {'name': 'QML', 'bytes': '6969'}, {'name': 'Shell', 'bytes': '18548'}, {'name': 'XSLT', 'bytes': '6126'}]} |
"""
NEEDS CLEANUP
"""
from __future__ import absolute_import, division, print_function
from os.path import join
import six
import utool as ut
from six.moves import range, zip, map # NOQA
from ibeis.algo.hots import _pipeline_helpers as plh # NOQA
from ibeis.algo.hots.neighbor_index import NeighborIndex, get_support_data
(print, rrr, profile) = ut.inject2(__name__)
USE_HOTSPOTTER_CACHE = not ut.get_argflag('--nocache-hs')
NOCACHE_UUIDS = ut.get_argflag('--nocache-uuids') and USE_HOTSPOTTER_CACHE
# LRU cache for nn_indexers. Ensures that only a few are ever in memory
#MAX_NEIGHBOR_CACHE_SIZE = ut.get_argval('--max-neighbor-cachesize', type_=int, default=2)
MAX_NEIGHBOR_CACHE_SIZE = ut.get_argval('--max-neighbor-cachesize', type_=int, default=1)
# Background process for building indexes
CURRENT_THREAD = None
# Global map to keep track of UUID lists with prebuild indexers.
UUID_MAP = ut.ddict(dict)
NEIGHBOR_CACHE = ut.get_lru_cache(MAX_NEIGHBOR_CACHE_SIZE)
class UUIDMapHyrbridCache(object):
"""
Class that lets multiple ways of writing to the uuid_map
be swapped in and out interchangably
TODO: the global read / write should periodically sync itself to disk and it
should be loaded from disk initially
"""
def __init__(self):
self.uuid_maps = ut.ddict(dict)
#self.uuid_map_fpath = uuid_map_fpath
#self.init(uuid_map_fpath, min_reindex_thresh)
def init(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs
#self.read_func = self.read_uuid_map_cpkl
#self.write_func = self.write_uuid_map_cpkl
self.read_func = self.read_uuid_map_dict
self.write_func = self.write_uuid_map_dict
def dump(self, cachedir):
# TODO: DUMP AND LOAD THIS HYBRID CACHE TO DISK
#write_uuid_map_cpkl
fname = 'uuid_maps_hybrid_cache.cPkl'
cpkl_fpath = join(cachedir, fname)
ut.lock_and_save_cPkl(cpkl_fpath, self.uuid_maps)
def load(self, cachedir):
"""
Returns a cache UUIDMap
"""
fname = 'uuid_maps_hybrid_cache.cPkl'
cpkl_fpath = join(cachedir, fname)
self.uuid_maps = ut.lock_and_load_cPkl(cpkl_fpath)
#def __call__(self):
# return self.read_func(*self.args, **self.kwargs)
#def __setitem__(self, daids_hashid, visual_uuid_list):
# uuid_map_fpath = self.uuid_map_fpath
# self.write_func(uuid_map_fpath, visual_uuid_list, daids_hashid)
#@profile
#def read_uuid_map_shelf(self, uuid_map_fpath, min_reindex_thresh):
# #with ut.EmbedOnException():
# with lockfile.LockFile(uuid_map_fpath + '.lock'):
# with ut.shelf_open(uuid_map_fpath) as uuid_map:
# candidate_uuids = {
# key: val for key, val in six.iteritems(uuid_map)
# if len(val) >= min_reindex_thresh
# }
# return candidate_uuids
#@profile
#def write_uuid_map_shelf(self, uuid_map_fpath, visual_uuid_list, daids_hashid):
# print('Writing %d visual uuids to uuid map' % (len(visual_uuid_list)))
# with lockfile.LockFile(uuid_map_fpath + '.lock'):
# with ut.shelf_open(uuid_map_fpath) as uuid_map:
# uuid_map[daids_hashid] = visual_uuid_list
#@profile
#def read_uuid_map_cpkl(self, uuid_map_fpath, min_reindex_thresh):
# with lockfile.LockFile(uuid_map_fpath + '.lock'):
# #with ut.shelf_open(uuid_map_fpath) as uuid_map:
# try:
# uuid_map = ut.load_cPkl(uuid_map_fpath)
# candidate_uuids = {
# key: val for key, val in six.iteritems(uuid_map)
# if len(val) >= min_reindex_thresh
# }
# except IOError:
# return {}
# return candidate_uuids
#@profile
#def write_uuid_map_cpkl(self, uuid_map_fpath, visual_uuid_list, daids_hashid):
# """
# let the multi-indexer know about any big caches we've made multi-indexer.
# Also lets nnindexer know about other prebuilt indexers so it can attempt to
# just add points to them as to avoid a rebuild.
# """
# print('Writing %d visual uuids to uuid map' % (len(visual_uuid_list)))
# with lockfile.LockFile(uuid_map_fpath + '.lock'):
# try:
# uuid_map = ut.load_cPkl(uuid_map_fpath)
# except IOError:
# uuid_map = {}
# uuid_map[daids_hashid] = visual_uuid_list
# ut.save_cPkl(uuid_map_fpath, uuid_map)
@profile
def read_uuid_map_dict(self, uuid_map_fpath, min_reindex_thresh):
""" uses in memory dictionary instead of disk """
uuid_map = self.uuid_maps[uuid_map_fpath]
candidate_uuids = {
key: val for key, val in six.iteritems(uuid_map)
if len(val) >= min_reindex_thresh
}
return candidate_uuids
@profile
def write_uuid_map_dict(self, uuid_map_fpath, visual_uuid_list, daids_hashid):
"""
uses in memory dictionary instead of disk
let the multi-indexer know about any big caches we've made multi-indexer.
Also lets nnindexer know about other prebuilt indexers so it can attempt to
just add points to them as to avoid a rebuild.
"""
if NOCACHE_UUIDS:
print('uuid cache is off')
return
#with ut.EmbedOnException():
uuid_map = self.uuid_maps[uuid_map_fpath]
uuid_map[daids_hashid] = visual_uuid_list
UUID_MAP_CACHE = UUIDMapHyrbridCache()
#@profile
def get_nnindexer_uuid_map_fpath(qreq_):
"""
CommandLine:
python -m ibeis.algo.hots.neighbor_index_cache get_nnindexer_uuid_map_fpath
Example:
>>> # ENABLE_DOCTEST
>>> from ibeis.algo.hots.neighbor_index_cache import * # NOQA
>>> import ibeis
>>> qreq_ = ibeis.testdata_qreq_(defaultdb='testdb1', p='default:fgw_thresh=.3')
>>> uuid_map_fpath = get_nnindexer_uuid_map_fpath(qreq_)
>>> result = str(ut.path_ndir_split(uuid_map_fpath, 3))
>>> print(result)
.../_ibeis_cache/flann/uuid_map_mzwwsbjisbkdxorl.cPkl
.../_ibeis_cache/flann/uuid_map_FLANN(8_kdtrees_fgwthrsh=0.3)_Feat(hesaff+sift)_Chip(sz700,width).cPkl
.../_ibeis_cache/flann/uuid_map_FLANN(8_kdtrees)_Feat(hesaff+sift)_Chip(sz700,width).cPkl
.../_ibeis_cache/flann/uuid_map_FLANN(8_kdtrees)_FEAT(hesaff+sift_)_CHIP(sz450).cPkl
"""
flann_cachedir = qreq_.ibs.get_flann_cachedir()
# Have uuid shelf conditioned on the baseline flann and feature parameters
flann_cfgstr = qreq_.qparams.flann_cfgstr
feat_cfgstr = qreq_.qparams.feat_cfgstr
chip_cfgstr = qreq_.qparams.chip_cfgstr
featweight_cfgstr = qreq_.qparams.featweight_cfgstr
if qreq_.qparams.fgw_thresh is None or qreq_.qparams.fgw_thresh == 0:
uuid_map_cfgstr = ''.join((flann_cfgstr, feat_cfgstr, chip_cfgstr))
else:
uuid_map_cfgstr = ''.join((flann_cfgstr, featweight_cfgstr, feat_cfgstr, chip_cfgstr))
#uuid_map_ext = '.shelf'
uuid_map_ext = '.cPkl'
uuid_map_prefix = 'uuid_map'
uuid_map_fname = ut.consensed_cfgstr(uuid_map_prefix, uuid_map_cfgstr) + uuid_map_ext
uuid_map_fpath = join(flann_cachedir, uuid_map_fname)
return uuid_map_fpath
def build_nnindex_cfgstr(qreq_, daid_list):
"""
builds a string that uniquely identified an indexer built with parameters
from the input query requested and indexing descriptor from the input
annotation ids
Args:
qreq_ (QueryRequest): query request object with hyper-parameters
daid_list (list):
Returns:
str: nnindex_cfgstr
CommandLine:
python -m ibeis.algo.hots.neighbor_index_cache --test-build_nnindex_cfgstr
Example:
>>> # ENABLE_DOCTEST
>>> from ibeis.algo.hots.neighbor_index_cache import * # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb(db='testdb1')
>>> daid_list = ibs.get_valid_aids(species=ibeis.const.TEST_SPECIES.ZEB_PLAIN)
>>> qreq_ = ibs.new_query_request(daid_list, daid_list, cfgdict=dict(fg_on=False))
>>> nnindex_cfgstr = build_nnindex_cfgstr(qreq_, daid_list)
>>> result = str(nnindex_cfgstr)
>>> print(result)
_VUUIDS((6)ylydksaqdigdecdd)_FLANN(8_kdtrees)_FeatureWeight(detector=cnn,sz256,thresh=20,ksz=20,enabled=False)_FeatureWeight(detector=cnn,sz256,thresh=20,ksz=20,enabled=False)
_VUUIDS((6)ylydksaqdigdecdd)_FLANN(8_kdtrees)_FEATWEIGHT(OFF)_FEAT(hesaff+sift_)_CHIP(sz450)
"""
flann_cfgstr = qreq_.qparams.flann_cfgstr
featweight_cfgstr = qreq_.qparams.featweight_cfgstr
feat_cfgstr = qreq_.qparams.feat_cfgstr
chip_cfgstr = qreq_.qparams.chip_cfgstr
# FIXME; need to include probchip (or better yet just use depcache)
#probchip_cfgstr = qreq_.qparams.chip_cfgstr
data_hashid = get_data_cfgstr(qreq_.ibs, daid_list)
nnindex_cfgstr = ''.join((data_hashid, flann_cfgstr, featweight_cfgstr, feat_cfgstr, chip_cfgstr))
return nnindex_cfgstr
def clear_memcache():
global NEIGHBOR_CACHE
NEIGHBOR_CACHE.clear()
def clear_uuid_cache(qreq_):
"""
CommandLine:
python -m ibeis.algo.hots.neighbor_index_cache --test-clear_uuid_cache
Example:
>>> # DISABLE_DOCTEST
>>> from ibeis.algo.hots.neighbor_index_cache import * # NOQA
>>> import ibeis
>>> qreq_ = ibeis.testdata_qreq_(defaultdb='testdb1', p='default:fg_on=True')
>>> fgws_list = clear_uuid_cache(qreq_)
>>> result = str(fgws_list)
>>> print(result)
"""
print('[nnindex] clearing uuid cache')
uuid_map_fpath = get_nnindexer_uuid_map_fpath(qreq_)
ut.delete(uuid_map_fpath)
ut.delete(uuid_map_fpath + '.lock')
print('[nnindex] finished uuid cache clear')
def print_uuid_cache(qreq_):
"""
CommandLine:
python -m ibeis.algo.hots.neighbor_index_cache --test-print_uuid_cache
Example:
>>> # DISABLE_DOCTEST
>>> from ibeis.algo.hots.neighbor_index_cache import * # NOQA
>>> import ibeis
>>> qreq_ = ibeis.testdata_qreq_(defaultdb='PZ_Master0', p='default:fg_on=False')
>>> print_uuid_cache(qreq_)
>>> result = str(nnindexer)
>>> print(result)
"""
print('[nnindex] clearing uuid cache')
uuid_map_fpath = get_nnindexer_uuid_map_fpath(qreq_)
candidate_uuids = UUID_MAP_CACHE.read_uuid_map_dict(uuid_map_fpath, 0)
print(candidate_uuids)
def request_ibeis_nnindexer(qreq_, verbose=True, **kwargs):
"""
CALLED BY QUERYREQUST::LOAD_INDEXER
IBEIS interface into neighbor_index_cache
Args:
qreq_ (QueryRequest): hyper-parameters
Returns:
NeighborIndexer: nnindexer
CommandLine:
python -m ibeis.algo.hots.neighbor_index_cache request_ibeis_nnindexer
Example:
>>> # ENABLE_DOCTEST
>>> from ibeis.algo.hots.neighbor_index_cache import * # NOQA
>>> nnindexer, qreq_, ibs = testdata_nnindexer(None)
>>> nnindexer = request_ibeis_nnindexer(qreq_)
"""
daid_list = qreq_.get_internal_daids()
if not hasattr(qreq_.qparams, 'use_augmented_indexer'):
qreq_.qparams.use_augmented_indexer = True
if False and qreq_.qparams.use_augmented_indexer:
nnindexer = request_augmented_ibeis_nnindexer(qreq_, daid_list, **kwargs)
else:
nnindexer = request_memcached_ibeis_nnindexer(qreq_, daid_list, **kwargs)
return nnindexer
def request_augmented_ibeis_nnindexer(qreq_, daid_list, verbose=True,
use_memcache=True, force_rebuild=False,
memtrack=None):
r"""
DO NOT USE. THIS FUNCTION CAN CURRENTLY CAUSE A SEGFAULT
tries to give you an indexer for the requested daids using the least amount
of computation possible. By loading and adding to a partially build nnindex
if possible and if that fails fallbs back to request_memcache.
Args:
qreq_ (QueryRequest): query request object with hyper-parameters
daid_list (list):
Returns:
str: nnindex_cfgstr
CommandLine:
python -m ibeis.algo.hots.neighbor_index_cache --test-request_augmented_ibeis_nnindexer
Example:
>>> # ENABLE_DOCTEST
>>> from ibeis.algo.hots.neighbor_index_cache import * # NOQA
>>> import ibeis
>>> # build test data
>>> ZEB_PLAIN = ibeis.const.TEST_SPECIES.ZEB_PLAIN
>>> ibs = ibeis.opendb('testdb1')
>>> use_memcache, max_covers, verbose = True, None, True
>>> daid_list = ibs.get_valid_aids(species=ZEB_PLAIN)[0:6]
>>> qreq_ = ibs.new_query_request(daid_list, daid_list)
>>> qreq_.qparams.min_reindex_thresh = 1
>>> min_reindex_thresh = qreq_.qparams.min_reindex_thresh
>>> # CLEAR CACHE for clean test
>>> clear_uuid_cache(qreq_)
>>> # LOAD 3 AIDS INTO CACHE
>>> aid_list = ibs.get_valid_aids(species=ZEB_PLAIN)[0:3]
>>> # Should fallback
>>> nnindexer = request_augmented_ibeis_nnindexer(qreq_, aid_list)
>>> # assert the fallback
>>> uncovered_aids, covered_aids_list = group_daids_by_cached_nnindexer(
... qreq_, daid_list, min_reindex_thresh, max_covers)
>>> result2 = uncovered_aids, covered_aids_list
>>> ut.assert_eq(result2, ([4, 5, 6], [[1, 2, 3]]), 'pre augment')
>>> # Should augment
>>> nnindexer = request_augmented_ibeis_nnindexer(qreq_, daid_list)
>>> uncovered_aids, covered_aids_list = group_daids_by_cached_nnindexer(
... qreq_, daid_list, min_reindex_thresh, max_covers)
>>> result3 = uncovered_aids, covered_aids_list
>>> ut.assert_eq(result3, ([], [[1, 2, 3, 4, 5, 6]]), 'post augment')
>>> # Should fallback
>>> nnindexer2 = request_augmented_ibeis_nnindexer(qreq_, daid_list)
>>> assert nnindexer is nnindexer2
"""
global NEIGHBOR_CACHE
min_reindex_thresh = qreq_.qparams.min_reindex_thresh
if not force_rebuild:
new_daid_list, covered_aids_list = group_daids_by_cached_nnindexer(
qreq_, daid_list, min_reindex_thresh, max_covers=1)
can_augment = (
len(covered_aids_list) > 0 and
not ut.list_set_equal(covered_aids_list[0], daid_list))
else:
can_augment = False
if verbose:
print('[aug] Requesting augmented nnindexer')
if can_augment:
covered_aids = covered_aids_list[0]
if verbose:
print('[aug] Augmenting index %r old daids with %d new daids' %
(len(covered_aids), len(new_daid_list)))
# Load the base covered indexer
# THIS SHOULD LOAD NOT REBUILD IF THE UUIDS ARE COVERED
base_nnindexer = request_memcached_ibeis_nnindexer(
qreq_, covered_aids, verbose=verbose, use_memcache=use_memcache)
# Remove this indexer from the memcache because we are going to change it
if NEIGHBOR_CACHE.has_key(base_nnindexer.cfgstr): # NOQA
print('Removing key from memcache')
NEIGHBOR_CACHE[base_nnindexer.cfgstr] = None
del NEIGHBOR_CACHE[base_nnindexer.cfgstr]
support_data = get_support_data(qreq_, new_daid_list)
(new_vecs_list, new_fgws_list, new_fxs_list) = support_data
base_nnindexer.add_support(new_daid_list, new_vecs_list, new_fgws_list,
new_fxs_list, verbose=True)
# FIXME: pointer issues
nnindexer = base_nnindexer
# Change to the new cfgstr
nnindex_cfgstr = build_nnindex_cfgstr(qreq_, daid_list)
nnindexer.cfgstr = nnindex_cfgstr
cachedir = qreq_.ibs.get_flann_cachedir()
nnindexer.save(cachedir)
# Write to inverse uuid
if len(daid_list) > min_reindex_thresh:
uuid_map_fpath = get_nnindexer_uuid_map_fpath(qreq_)
daids_hashid = get_data_cfgstr(qreq_.ibs, daid_list)
visual_uuid_list = qreq_.ibs.get_annot_visual_uuids(daid_list)
UUID_MAP_CACHE.write_uuid_map_dict(uuid_map_fpath,
visual_uuid_list, daids_hashid)
# Write to memcache
if ut.VERBOSE:
print('[aug] Wrote to memcache=%r' % (nnindex_cfgstr,))
NEIGHBOR_CACHE[nnindex_cfgstr] = nnindexer
return nnindexer
else:
#if ut.VERBOSE:
if verbose:
print('[aug] Nothing to augment, fallback to memcache')
# Fallback
nnindexer = request_memcached_ibeis_nnindexer(
qreq_, daid_list, verbose=verbose, use_memcache=use_memcache,
force_rebuild=force_rebuild, memtrack=memtrack
)
return nnindexer
def request_memcached_ibeis_nnindexer(qreq_, daid_list, use_memcache=True,
verbose=ut.NOT_QUIET, veryverbose=False,
force_rebuild=False, memtrack=None,
prog_hook=None):
r"""
FOR INTERNAL USE ONLY
takes custom daid list. might not be the same as what is in qreq_
CommandLine:
python -m ibeis.algo.hots.neighbor_index_cache --test-request_memcached_ibeis_nnindexer
Example:
>>> # DISABLE_DOCTEST
>>> from ibeis.algo.hots.neighbor_index_cache import * # NOQA
>>> import ibeis
>>> # build test data
>>> ibs = ibeis.opendb('testdb1')
>>> qreq_.qparams.min_reindex_thresh = 3
>>> ZEB_PLAIN = ibeis.const.TEST_SPECIES.ZEB_PLAIN
>>> daid_list = ibs.get_valid_aids(species=ZEB_PLAIN)[0:3]
>>> qreq_ = ibs.new_query_request(daid_list, daid_list)
>>> verbose = True
>>> use_memcache = True
>>> # execute function
>>> nnindexer = request_memcached_ibeis_nnindexer(qreq_, daid_list, use_memcache)
>>> # verify results
>>> result = str(nnindexer)
>>> print(result)
"""
global NEIGHBOR_CACHE
#try:
if veryverbose:
print('[nnindex.MEMCACHE] len(NEIGHBOR_CACHE) = %r' % (len(NEIGHBOR_CACHE),))
# the lru cache wont be recognized by get_object_size_str, cast to pure python objects
print('[nnindex.MEMCACHE] size(NEIGHBOR_CACHE) = %s' % (ut.get_object_size_str(NEIGHBOR_CACHE.items()),))
#if memtrack is not None:
# memtrack.report('IN REQUEST MEMCACHE')
nnindex_cfgstr = build_nnindex_cfgstr(qreq_, daid_list)
# neighbor memory cache
if not force_rebuild and use_memcache and NEIGHBOR_CACHE.has_key(nnindex_cfgstr): # NOQA (has_key is for a lru cache)
if veryverbose or ut.VERYVERBOSE or ut.VERBOSE:
print('... nnindex memcache hit: cfgstr=%s' % (nnindex_cfgstr,))
nnindexer = NEIGHBOR_CACHE[nnindex_cfgstr]
else:
if veryverbose or ut.VERYVERBOSE or ut.VERBOSE:
print('... nnindex memcache miss: cfgstr=%s' % (nnindex_cfgstr,))
# Write to inverse uuid
nnindexer = request_diskcached_ibeis_nnindexer(
qreq_, daid_list, nnindex_cfgstr, verbose,
force_rebuild=force_rebuild, memtrack=memtrack,
prog_hook=prog_hook)
NEIGHBOR_CACHE_WRITE = True
if NEIGHBOR_CACHE_WRITE:
# Write to memcache
if ut.VERBOSE or ut.VERYVERBOSE:
print('[disk] Write to memcache=%r' % (nnindex_cfgstr,))
NEIGHBOR_CACHE[nnindex_cfgstr] = nnindexer
else:
if ut.VERBOSE or ut.VERYVERBOSE:
print('[disk] Did not write to memcache=%r' % (nnindex_cfgstr,))
return nnindexer
def request_diskcached_ibeis_nnindexer(qreq_, daid_list, nnindex_cfgstr=None,
verbose=True, force_rebuild=False,
memtrack=None, prog_hook=None):
r"""
builds new NeighborIndexer which will try to use a disk cached flann if
available
Args:
qreq_ (QueryRequest): query request object with hyper-parameters
daid_list (list):
nnindex_cfgstr (?):
verbose (bool):
Returns:
NeighborIndexer: nnindexer
CommandLine:
python -m ibeis.algo.hots.neighbor_index_cache --test-request_diskcached_ibeis_nnindexer
Example:
>>> # DISABLE_DOCTEST
>>> from ibeis.algo.hots.neighbor_index_cache import * # NOQA
>>> import ibeis
>>> # build test data
>>> ibs = ibeis.opendb('testdb1')
>>> daid_list = ibs.get_valid_aids(species=ibeis.const.TEST_SPECIES.ZEB_PLAIN)
>>> qreq_ = ibs.new_query_request(daid_list, daid_list)
>>> nnindex_cfgstr = build_nnindex_cfgstr(qreq_, daid_list)
>>> verbose = True
>>> # execute function
>>> nnindexer = request_diskcached_ibeis_nnindexer(qreq_, daid_list, nnindex_cfgstr, verbose)
>>> # verify results
>>> result = str(nnindexer)
>>> print(result)
"""
if nnindex_cfgstr is None:
nnindex_cfgstr = build_nnindex_cfgstr(qreq_, daid_list)
cfgstr = nnindex_cfgstr
cachedir = qreq_.ibs.get_flann_cachedir()
flann_params = qreq_.qparams.flann_params
flann_params['checks'] = qreq_.qparams.checks
#if memtrack is not None:
# memtrack.report('[PRE SUPPORT]')
# Get annot descriptors to index
if prog_hook is not None:
prog_hook.set_progress(1, 3, 'Loading support data for indexer')
print('[nnindex] Loading support data for indexer')
vecs_list, fgws_list, fxs_list = get_support_data(qreq_, daid_list)
if memtrack is not None:
memtrack.report('[AFTER GET SUPPORT DATA]')
try:
nnindexer = new_neighbor_index(
daid_list, vecs_list, fgws_list, fxs_list, flann_params, cachedir,
cfgstr=cfgstr, verbose=verbose, force_rebuild=force_rebuild,
memtrack=memtrack, prog_hook=prog_hook)
except Exception as ex:
ut.printex(ex, True, msg_='cannot build inverted index',
key_list=['ibs.get_infostr()'])
raise
# Record these uuids in the disk based uuid map so they can be augmented if
# needed
min_reindex_thresh = qreq_.qparams.min_reindex_thresh
if len(daid_list) > min_reindex_thresh:
uuid_map_fpath = get_nnindexer_uuid_map_fpath(qreq_)
daids_hashid = get_data_cfgstr(qreq_.ibs, daid_list)
visual_uuid_list = qreq_.ibs.get_annot_visual_uuids(daid_list)
UUID_MAP_CACHE.write_uuid_map_dict(uuid_map_fpath, visual_uuid_list, daids_hashid)
if memtrack is not None:
memtrack.report('[AFTER WRITE_UUID_MAP]')
return nnindexer
def group_daids_by_cached_nnindexer(qreq_, daid_list, min_reindex_thresh,
max_covers=None):
r"""
CommandLine:
python -m ibeis.algo.hots.neighbor_index_cache --test-group_daids_by_cached_nnindexer
Example:
>>> # ENABLE_DOCTEST
>>> from ibeis.algo.hots.neighbor_index_cache import * # NOQA
>>> import ibeis
>>> ibs = ibeis.opendb('testdb1')
>>> ZEB_PLAIN = ibeis.const.TEST_SPECIES.ZEB_PLAIN
>>> daid_list = ibs.get_valid_aids(species=ZEB_PLAIN)
>>> qreq_ = ibs.new_query_request(daid_list, daid_list)
>>> # Set the params a bit lower
>>> max_covers = None
>>> qreq_.qparams.min_reindex_thresh = 1
>>> min_reindex_thresh = qreq_.qparams.min_reindex_thresh
>>> # STEP 0: CLEAR THE CACHE
>>> clear_uuid_cache(qreq_)
>>> # STEP 1: ASSERT EMPTY INDEX
>>> daid_list = ibs.get_valid_aids(species=ZEB_PLAIN)[0:3]
>>> uncovered_aids, covered_aids_list = group_daids_by_cached_nnindexer(
... qreq_, daid_list, min_reindex_thresh, max_covers)
>>> result1 = uncovered_aids, covered_aids_list
>>> #ut.assert_eq(result1, ([1, 2, 3], []), 'pre request')
>>> # TEST 2: SHOULD MAKE 123 COVERED
>>> nnindexer = request_memcached_ibeis_nnindexer(qreq_, daid_list)
>>> uncovered_aids, covered_aids_list = group_daids_by_cached_nnindexer(
... qreq_, daid_list, min_reindex_thresh, max_covers)
>>> result2 = uncovered_aids, covered_aids_list
>>> #ut.assert_eq(result2, ([], [[1, 2, 3]]), 'post request')
"""
ibs = qreq_.ibs
# read which annotations have prebuilt caches
uuid_map_fpath = get_nnindexer_uuid_map_fpath(qreq_)
candidate_uuids = UUID_MAP_CACHE.read_uuid_map_dict(uuid_map_fpath, min_reindex_thresh)
# find a maximum independent set cover of the requested annotations
annot_vuuid_list = ibs.get_annot_visual_uuids(daid_list) # 3.2 %
covertup = ut.greedy_max_inden_setcover(
candidate_uuids, annot_vuuid_list, max_covers) # 0.2 %
uncovered_vuuids, covered_vuuids_list, accepted_keys = covertup
# return the grouped covered items (so they can be loaded) and
# the remaining uuids which need to have an index computed.
#
uncovered_aids_ = ibs.get_annot_aids_from_visual_uuid(uncovered_vuuids) # 28.0%
covered_aids_list_ = ibs.unflat_map(
ibs.get_annot_aids_from_visual_uuid, covered_vuuids_list) # 68%
# FIXME:
uncovered_aids = sorted(uncovered_aids_)
#covered_aids_list = list(map(sorted, covered_aids_list_))
covered_aids_list = covered_aids_list_
return uncovered_aids, covered_aids_list
def get_data_cfgstr(ibs, daid_list):
""" part 2 data hash id """
daids_hashid = ibs.get_annot_hashid_visual_uuid(daid_list)
return daids_hashid
def new_neighbor_index(daid_list, vecs_list, fgws_list, fxs_list, flann_params, cachedir,
cfgstr, force_rebuild=False, verbose=True,
memtrack=None, prog_hook=None):
r"""
constructs neighbor index independent of ibeis
Args:
daid_list (list):
vecs_list (list):
fgws_list (list):
flann_params (dict):
flann_cachedir (None):
nnindex_cfgstr (str):
use_memcache (bool):
Returns:
nnindexer
CommandLine:
python -m ibeis.algo.hots.neighbor_index_cache --test-new_neighbor_index
Example:
>>> # ENABLE_DOCTEST
>>> from ibeis.algo.hots.neighbor_index_cache import * # NOQA
>>> import ibeis
>>> qreq_ = ibeis.testdata_qreq_(defaultdb='testdb1', a='default:species=zebra_plains', p='default:fgw_thresh=.999')
>>> daid_list = qreq_.daids
>>> nnindex_cfgstr = build_nnindex_cfgstr(qreq_, daid_list)
>>> ut.exec_funckw(new_neighbor_index, globals())
>>> cfgstr = nnindex_cfgstr
>>> cachedir = qreq_.ibs.get_flann_cachedir()
>>> flann_params = qreq_.qparams.flann_params
>>> # Get annot descriptors to index
>>> vecs_list, fgws_list, fxs_list = get_support_data(qreq_, daid_list)
>>> nnindexer = new_neighbor_index(daid_list, vecs_list, fgws_list, fxs_list, flann_params, cachedir, cfgstr, verbose=True)
>>> result = ('nnindexer.ax2_aid = %s' % (str(nnindexer.ax2_aid),))
>>> print(result)
nnindexer.ax2_aid = [1 2 3 4 5 6]
"""
nnindexer = NeighborIndex(flann_params, cfgstr)
#if memtrack is not None:
# memtrack.report('CREATEED NEIGHTOB INDEX')
# Initialize neighbor with unindexed data
nnindexer.init_support(daid_list, vecs_list, fgws_list, fxs_list, verbose=verbose)
if memtrack is not None:
memtrack.report('AFTER INIT SUPPORT')
# Load or build the indexing structure
nnindexer.ensure_indexer(cachedir, verbose=verbose,
force_rebuild=force_rebuild, memtrack=memtrack,
prog_hook=prog_hook)
if memtrack is not None:
memtrack.report('AFTER LOAD OR BUILD')
return nnindexer
def testdata_nnindexer(dbname='testdb1', with_indexer=True, use_memcache=True):
r"""
Ignore:
>>> # ENABLE_DOCTEST
>>> from ibeis.algo.hots.neighbor_index_cache import * # NOQA
>>> nnindexer, qreq_, ibs = testdata_nnindexer('PZ_Master1')
>>> S = np.cov(nnindexer.idx2_vec.T)
>>> import plottool_ibeis as pt
>>> pt.ensureqt()
>>> pt.plt.imshow(S)
Example:
>>> # ENABLE_DOCTEST
>>> from ibeis.algo.hots.neighbor_index_cache import * # NOQA
>>> nnindexer, qreq_, ibs = testdata_nnindexer()
"""
import ibeis
daid_list = [7, 8, 9, 10, 11]
ibs = ibeis.opendb(db=dbname)
# use_memcache isn't use here because we aren't lazy loading the indexer
cfgdict = dict(fg_on=False)
qreq_ = ibs.new_query_request(daid_list, daid_list,
use_memcache=use_memcache, cfgdict=cfgdict)
if with_indexer:
# we do an explicit creation of an indexer for these tests
nnindexer = request_ibeis_nnindexer(qreq_, use_memcache=use_memcache)
else:
nnindexer = None
return nnindexer, qreq_, ibs
# ------------
# NEW
def check_background_process():
r"""
checks to see if the process has finished and then
writes the uuid map to disk
"""
global CURRENT_THREAD
if CURRENT_THREAD is None or CURRENT_THREAD.is_alive():
print('[FG] background thread is not ready yet')
return False
# Get info set in background process
finishtup = CURRENT_THREAD.finishtup
(uuid_map_fpath, daids_hashid, visual_uuid_list, min_reindex_thresh) = finishtup
# Clean up background process
CURRENT_THREAD.join()
CURRENT_THREAD = None
# Write data to current uuidcache
if len(visual_uuid_list) > min_reindex_thresh:
UUID_MAP_CACHE.write_uuid_map_dict(uuid_map_fpath, visual_uuid_list, daids_hashid)
return True
def can_request_background_nnindexer():
return CURRENT_THREAD is None or not CURRENT_THREAD.is_alive()
def request_background_nnindexer(qreq_, daid_list):
r""" FIXME: Duplicate code
Args:
qreq_ (QueryRequest): query request object with hyper-parameters
daid_list (list):
CommandLine:
python -m ibeis.algo.hots.neighbor_index_cache --test-request_background_nnindexer
Example:
>>> # DISABLE_DOCTEST
>>> from ibeis.algo.hots.neighbor_index_cache import * # NOQA
>>> import ibeis
>>> # build test data
>>> ibs = ibeis.opendb('testdb1')
>>> daid_list = ibs.get_valid_aids(species=ibeis.const.TEST_SPECIES.ZEB_PLAIN)
>>> qreq_ = ibs.new_query_request(daid_list, daid_list)
>>> # execute function
>>> request_background_nnindexer(qreq_, daid_list)
>>> # verify results
>>> result = str(False)
>>> print(result)
"""
global CURRENT_THREAD
print('Requesting background reindex')
if not can_request_background_nnindexer():
# Make sure this function doesn't run if it is already running
print('REQUEST DENIED')
return False
print('REQUEST ACCPETED')
daids_hashid = qreq_.ibs.get_annot_hashid_visual_uuid(daid_list)
cfgstr = build_nnindex_cfgstr(qreq_, daid_list)
cachedir = qreq_.ibs.get_flann_cachedir()
# Save inverted cache uuid mappings for
min_reindex_thresh = qreq_.qparams.min_reindex_thresh
# Grab the keypoints names and image ids before query time?
flann_params = qreq_.qparams.flann_params
# Get annot descriptors to index
vecs_list, fgws_list, fxs_list = get_support_data(qreq_, daid_list)
# Dont hash rowids when given enough info in nnindex_cfgstr
flann_params['cores'] = 2 # Only ues a few cores in the background
# Build/Load the flann index
uuid_map_fpath = get_nnindexer_uuid_map_fpath(qreq_)
visual_uuid_list = qreq_.ibs.get_annot_visual_uuids(daid_list)
# set temporary attribute for when the thread finishes
finishtup = (uuid_map_fpath, daids_hashid, visual_uuid_list, min_reindex_thresh)
CURRENT_THREAD = ut.spawn_background_process(
background_flann_func, cachedir, daid_list, vecs_list, fgws_list, fxs_list,
flann_params, cfgstr)
CURRENT_THREAD.finishtup = finishtup
def background_flann_func(cachedir, daid_list, vecs_list, fgws_list, fxs_list, flann_params, cfgstr,
uuid_map_fpath, daids_hashid,
visual_uuid_list, min_reindex_thresh):
r""" FIXME: Duplicate code """
print('[BG] Starting Background FLANN')
# FIXME. dont use flann cache
nnindexer = NeighborIndex(flann_params, cfgstr)
# Initialize neighbor with unindexed data
nnindexer.init_support(daid_list, vecs_list, fgws_list, fxs_list, verbose=True)
# Load or build the indexing structure
nnindexer.ensure_indexer(cachedir, verbose=True)
if len(visual_uuid_list) > min_reindex_thresh:
UUID_MAP_CACHE.write_uuid_map_dict(uuid_map_fpath, visual_uuid_list, daids_hashid)
print('[BG] Finished Background FLANN')
if __name__ == '__main__':
r"""
CommandLine:
python -m ibeis.algo.hots.neighbor_index_cache
python -m ibeis.algo.hots.neighbor_index_cache --allexamples
"""
import multiprocessing
multiprocessing.freeze_support() # for win32
import utool as ut # NOQA
ut.doctest_funcs()
| {'content_hash': 'b20c2270516f111bf2cfc37a4bd43dfb', 'timestamp': '', 'source': 'github', 'line_count': 811, 'max_line_length': 183, 'avg_line_length': 41.160295930949445, 'alnum_prop': 0.6244869836134328, 'repo_name': 'Erotemic/ibeis', 'id': 'f5f43984d6ee26e39b4a114044d4abe70c73fa50', 'size': '33381', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'ibeis/algo/hots/neighbor_index_cache.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CMake', 'bytes': '331'}, {'name': 'CSS', 'bytes': '4676'}, {'name': 'Dockerfile', 'bytes': '13018'}, {'name': 'Inno Setup', 'bytes': '1585'}, {'name': 'Python', 'bytes': '6661573'}, {'name': 'Shell', 'bytes': '56171'}]} |
// This code is auto-generated, do not modify
using System;
using System.Collections.Generic;
namespace Ds3.Models
{
public class JobCreatedNotificationRegistration
{
public DateTime CreationDate { get; set; }
public HttpResponseFormatType Format { get; set; }
public Guid Id { get; set; }
public string LastFailure { get; set; }
public int? LastHttpResponseCode { get; set; }
public DateTime? LastNotification { get; set; }
public NamingConventionType NamingConvention { get; set; }
public string NotificationEndPoint { get; set; }
public RequestType NotificationHttpMethod { get; set; }
public int NumberOfFailuresSinceLastSuccess { get; set; }
public Guid? UserId { get; set; }
}
}
| {'content_hash': '6a1e907126af31807289659bebdad0dd', 'timestamp': '', 'source': 'github', 'line_count': 24, 'max_line_length': 66, 'avg_line_length': 32.875, 'alnum_prop': 0.6679340937896071, 'repo_name': 'RachelTucker/ds3_net_sdk', 'id': '9ff1b997ee0bd2b034872c1e7e4dfa54f94816cb', 'size': '1546', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'Ds3/Models/JobCreatedNotificationRegistration.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '617'}, {'name': 'C#', 'bytes': '3606193'}, {'name': 'Dockerfile', 'bytes': '162'}, {'name': 'Makefile', 'bytes': '654'}, {'name': 'Ruby', 'bytes': '2446'}, {'name': 'Shell', 'bytes': '453'}]} |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>NG42</title>
<base href="/">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
<!-- FontAwesome for md-icon demo. -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
</head>
<body>
<e2e-app>Loading...</e2e-app>
<script src="node_modules/core-js/client/core.js"></script>
<script src="node_modules/web-animations-js/web-animations.min.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/hammerjs/hammer.min.js"></script>
<script>
System.import('system-config.js').then(function () {
System.import('main');
}).catch(console.error.bind(console));
</script>
</body>
</html>
| {'content_hash': 'ddec2bec1a4b9e4ea93adae6c4be4865', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 108, 'avg_line_length': 35.96774193548387, 'alnum_prop': 0.6825112107623318, 'repo_name': 'ng-fortytwo/ng42', 'id': 'c999d9fd48ab1e7b0bf3b6131f014c14c42f2e25', 'size': '1115', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/e2e-app/index.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '3280'}, {'name': 'JavaScript', 'bytes': '20128'}, {'name': 'Shell', 'bytes': '16182'}, {'name': 'TypeScript', 'bytes': '24487'}]} |
// Copyright 2011 Google Inc.
//
// 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 com.google.enterprise.connector.servlet;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import com.google.enterprise.connector.logging.NDC;
import com.google.enterprise.connector.manager.ConnectorManagerException;
import com.google.enterprise.connector.manager.Context;
import com.google.enterprise.connector.manager.Manager;
import com.google.enterprise.connector.persist.ConnectorNotFoundException;
import com.google.enterprise.connector.pusher.FeedConnection;
import com.google.enterprise.connector.pusher.XmlFeed;
import com.google.enterprise.connector.spi.Document;
import com.google.enterprise.connector.spi.DocumentAccessException;
import com.google.enterprise.connector.spi.DocumentNotFoundException;
import com.google.enterprise.connector.spi.Property;
import com.google.enterprise.connector.spi.RepositoryException;
import com.google.enterprise.connector.spi.SkippedDocumentException;
import com.google.enterprise.connector.spi.SpiConstants;
import com.google.enterprise.connector.spi.Value;
import com.google.enterprise.connector.spiimpl.DateValue;
import com.google.enterprise.connector.spiimpl.ValueImpl;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.zip.GZIPOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class GetDocumentContent extends HttpServlet {
private static Logger LOGGER =
Logger.getLogger(GetDocumentContent.class.getName());
private static final String HDR_IF_MODIFIED = "If-Modified-Since";
/**
* Attribute name on the ServletRequest containing a cache of the parsed
* query parameters.
*/
private static final String PARAMETER_CACHE_NAME =
GetDocumentContent.class.getName() + ".parameters";
/**
* Attribute name on the ServletRequest containing a cache of the metadata
* of the requested document.
*/
private static final String METADATA_CACHE_NAME =
GetDocumentContent.class.getName() + ".document";
/**
* Distinguished attribute value denoting that the metadata is already known
* to be unavailable.
*/
private static final Object NEGATIVE_METADATA_CACHE_VALUE = new Object();
/** HTTP header that contains the Document metadata. */
private static final String EXTERNAL_METADATA_HEADER =
"X-Gsa-External-Metadata";
private static boolean useCompression = false;
private static FeedConnection feedConnection;
public static void setUseCompression(boolean doCompression) {
useCompression = doCompression;
}
/**
* Set the feed connection to use to discover if the security header is
* supported. This must be set during startup to take effect.
*/
public static void setFeedConnection(FeedConnection fc) {
feedConnection = fc;
}
/**
* GSA 7.0 introduces the ability to provide a HTTP header that specifies
* whether the document is secure. In previous GSAs we are required to use
* HTTP basic, which has to be configured correctly on the GSA.
*/
private synchronized static boolean isSecurityHeaderSupported() {
if (feedConnection == null) {
// FeedConnection is unavailable, so choose the pessimistic choice.
return false;
} else {
// The newer ACL format was added in same GSA version as security header,
// so we abuse the ACL feature detection logic.
return feedConnection.supportsInheritedAcls();
}
}
/**
* Retrieves the content of a document from a connector instance.
*
* @param req
* @param res
* @throws IOException
*/
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse res)
throws IOException {
doGet(req, res);
}
/**
* Retrieves the content of a document from a connector instance.
*
* @param req
* @param res
* @throws IOException
*/
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse res)
throws IOException {
doGet(req, res, Context.getInstance().getManager());
}
/**
* Fetches the last modified date for the document, in milliseconds since
* the epoch; or -1 if the last modified date is not known or unavailable.
*
* @param req
* @return a long integer specifying the time the document was last modified,
* in milliseconds since midnight, January 1, 1970 GMT, or -1 if the time is
* not known.
*/
@Override
protected long getLastModified(HttpServletRequest req) {
Map<String, List<String>> params = getQueryParams(req);
String connectorName = ServletUtil.getFirstParameter(
params, ServletUtil.XMLTAG_CONNECTOR_NAME);
String docid = ServletUtil.getFirstParameter(
params, ServletUtil.QUERY_PARAM_DOCID);
if (Strings.isNullOrEmpty(connectorName) || Strings.isNullOrEmpty(docid)) {
return -1L;
}
return handleGetLastModified(getDocumentMetaDataNoThrow(req,
Context.getInstance().getManager(), connectorName, docid));
}
/**
* Returns a map of query parameters extracted from the request.
*/
private static Map<String, List<String>> getQueryParams(HttpServletRequest req) {
@SuppressWarnings("unchecked") Map<String, List<String>> params =
(Map<String, List<String>>)(req.getAttribute(PARAMETER_CACHE_NAME));
if (params == null) {
params = ServletUtil.parseQueryString(req.getQueryString());
req.setAttribute(PARAMETER_CACHE_NAME, params);
}
return params;
}
/**
* Retrieves the content of a document from a connector instance.
*
* @param req
* @param res
* @param manager manager to use for retrieving document information
* @throws IOException
*/
@VisibleForTesting
static void doGet(HttpServletRequest req, HttpServletResponse res,
Manager manager) throws IOException {
// The servlet relies on proper security to be handled by a filter.
if ("SecMgr".equals(req.getHeader("User-Agent")) ||
req.getHeader("Range") != null ||
"HEAD".equals(req.getMethod())) {
// GSA does a GET with Range:0-0 to simulate head request.
// Assume that a "HEAD" request to check authz is being performed
// due to presence of Range header.
// We don't support authz by hr so we always issue deny.
// TODO(ejona): Remove checking for Range header and HEAD once
// Legacy Authz is removed from supported GSA versions.
LOGGER.finest("RETRIEVER: Head request denied");
res.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
Map<String, List<String>> params = getQueryParams(req);
String connectorName = ServletUtil.getFirstParameter(
params, ServletUtil.XMLTAG_CONNECTOR_NAME);
String docid = ServletUtil.getFirstParameter(
params, ServletUtil.QUERY_PARAM_DOCID);
if (Strings.isNullOrEmpty(connectorName) || Strings.isNullOrEmpty(docid)) {
res.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
}
NDC.pushAppend("Retrieve " + connectorName + " "
+ docid.substring(docid.lastIndexOf('/') + 1));
Document metadata;
try {
metadata = getDocumentMetaData(req, manager, connectorName, docid);
} catch (Exception e) {
res.sendError(handleException("metadata", e));
return;
}
int securityCode = handleMarkingDocumentSecurity(req, res, metadata);
if (securityCode != HttpServletResponse.SC_OK) {
res.sendError(securityCode);
return;
}
// Set the Content-Type.
String mimeType = handleGetContentType(metadata);
LOGGER.log(Level.FINEST, "Document Content-Type {0}", mimeType);
res.setContentType(mimeType);
Integer contentLength = handleGetContentLength(metadata);
if (contentLength != null) {
LOGGER.log(Level.FINEST, "Document Content-Length {0}", contentLength);
res.setContentLength(contentLength);
}
// Supply the document metadata in an X-Gsa-External-Metadata header.
if (metadata != null) {
res.setHeader(EXTERNAL_METADATA_HEADER, getMetadataHeader(metadata));
}
OutputStream out = res.getOutputStream();
if (useCompression) {
// Select Content-Encoding based on the client's Accept-Encoding header.
// Choose GZIP if the header includes "gzip", otherwise no compression.
String encodings = req.getHeader("Accept-Encoding");
if (encodings != null && encodings.matches(".*\\bgzip\\b.*")) {
res.setHeader("Content-Encoding", "gzip");
out = new GZIPOutputStream(out, 64 * 1024);
}
res.setHeader("Vary", "Accept-Encoding");
}
// TODO: Configure chunked output?
try {
int code = handleDoGet(manager, connectorName, docid, out);
if (code != HttpServletResponse.SC_OK) {
res.sendError(code);
} else {
res.setStatus(code);
}
} finally {
out.close();
NDC.pop();
}
}
/**
* Builds the GSA-specific metadata header value for crawl-time metadata,
* based upon the Document's supplied metadata.
*/
// Warning: See XmlFeed.wrapMetaData() if you make changes here.
@VisibleForTesting
static String getMetadataHeader(Document metadata) {
StringBuilder sb = new StringBuilder();
Set<String> propertyNames = null;
try {
propertyNames = metadata.getPropertyNames();
} catch (RepositoryException e) {
LOGGER.log(Level.WARNING, "Failed to retrieve property names", e);
}
if (propertyNames != null && !propertyNames.isEmpty()) {
// Sort property names so that metadata is written in a canonical form.
// The GSA's metadata change detection logic depends on the metadata to
// be in the same order each time to prevent reindexing.
propertyNames = new TreeSet<String>(propertyNames);
for (String name : propertyNames) {
if (XmlFeed.propertySkipSet.contains(name)) {
continue;
}
try {
Property property = metadata.findProperty(name);
if (property != null) {
encodeOneProperty(sb, name, property);
}
} catch (RepositoryException e) {
LOGGER.log(Level.WARNING, "Failed to retrieve property " + name, e);
}
}
}
return (sb.length() == 0) ? "" : sb.substring(0, sb.length() - 1);
}
/**
* Adds one Property's values to the metadata header under contruction.
*/
private static void encodeOneProperty(StringBuilder sb, String name,
Property property) throws RepositoryException {
ValueImpl value;
while ((value = (ValueImpl) property.nextValue()) != null) {
LOGGER.log(Level.FINEST, "PROPERTY: {0} = \"{1}\"",
new Object[] { name, value.toString() });
String valString = value.toFeedXml();
if (!Strings.isNullOrEmpty(valString)) {
ServletUtil.percentEncode(sb, name, valString);
sb.append(',');
}
}
}
/**
* Retrieves the content of a document from a connector instance.
*
* @param manager a Manager
* @param connectorName the name of the connector instance that
* can access the document
* @param docId the document identifer
* @param out OutputStream to which to write the content
* @return an HTTP Status Code
* @throws IOException
*/
@VisibleForTesting
static int handleDoGet(Manager manager, String connectorName, String docid,
OutputStream out) throws IOException {
InputStream in = null;
try {
in = manager.getDocumentContent(connectorName, docid);
if (in == null) {
// This is unlikely to happen, since Production Manager
// will return an AlternateContent InputStream.
in = new ByteArrayInputStream(new byte[0]);
}
byte[] buffer = new byte[1024 * 1024];
int bytes;
do {
bytes = in.read(buffer);
if (bytes > 0) {
out.write(buffer, 0, bytes);
}
} while (bytes != -1);
return HttpServletResponse.SC_OK;
} catch (Exception e) {
return handleException("content", e);
} finally {
if (in != null) {
in.close();
}
}
}
/**
* Retrieve and cache the metadata of the currently requested document.
* The metadata is cached for the life of the servlet request.
* No checked exceptions are thrown.
* If a problem occurs {@code null} is returned.
*
* @param req Request to use for caching return value
* @param manager a Manager
* @param connectorName the name of the connector instance that
* can access the document
* @param docId the document identifer
* @return document's metadata or {@code null} if it is unavailable
*/
private static Document getDocumentMetaDataNoThrow(HttpServletRequest req,
Manager manager, String connectorName, String docid) {
try {
return getDocumentMetaData(req, manager, connectorName, docid);
} catch (ConnectorManagerException e) {
return null;
} catch (RepositoryException e) {
return null;
}
}
/**
* Retrieve and cache the metadata of the currently requested document.
* The metadata is cached for the life of the servlet request.
*
* @param req Request to use for caching return value
* @param manager a Manager
* @param connectorName the name of the connector instance that
* can access the document
* @param docId the document identifer
* @return document's metadata or {@code null} if it is unavailable
*/
@VisibleForTesting
static Document getDocumentMetaData(HttpServletRequest req,
Manager manager, String connectorName, String docid)
throws ConnectorManagerException, RepositoryException {
Object cache = req.getAttribute(METADATA_CACHE_NAME);
if (cache != null) {
return cache == NEGATIVE_METADATA_CACHE_VALUE ? null : (Document) cache;
}
Document metadata = manager.getDocumentMetaData(connectorName, docid);
req.setAttribute(METADATA_CACHE_NAME,
(metadata == null) ? NEGATIVE_METADATA_CACHE_VALUE : metadata);
return metadata;
}
/**
* Retrieves the last modified date of a document from a connector instance.
*
* @param metadata the Document metadata
* @return a long integer specifying the time the document was last modified,
* in milliseconds since midnight, January 1, 1970 GMT, or -1L if the
* time is not known
*/
@VisibleForTesting
static long handleGetLastModified(Document metadata) {
if (metadata == null) {
return -1L;
}
try {
// TODO: Value and DateValue Calendar methods are too weak to try to get
// last modified from non-DateValues.
ValueImpl value = (ValueImpl)
Value.getSingleValue(metadata, SpiConstants.PROPNAME_LASTMODIFIED);
if (value == null) {
LOGGER.log(Level.FINEST, "Document does not contain {0}",
SpiConstants.PROPNAME_LASTMODIFIED);
} else if (value instanceof DateValue) {
// DateValues don't give direct access to their Calendar object, but
// I can get the Calendar back out by parsing the stringized version.
// This method also applies the FeedTimeZone, if needed.
// TODO: Add a DateValue.getTimeMillis() or getCalendar() method to
// directly access the wrapped value.
String lastModified = ((DateValue) value).toIso8601();
LOGGER.log(Level.FINEST, "Document last modified {0}", lastModified);
return Value.iso8601ToCalendar(lastModified).getTimeInMillis();
}
} catch (RepositoryException e) {
LOGGER.log(Level.WARNING, "Failed to retrieve last-modified date", e);
} catch (ParseException e) {
LOGGER.log(Level.WARNING, "Failed to parse last-modified date", e);
}
return -1L;
}
/**
* Retrieves the content type of a document from a connector instance.
*
* @param metadata the Document metadata
* @return the content-type of the document, as a string, or
* {@link SpiConstants.DEFAULT_MIMETYPE} if the content type
* is not supplied.
*/
@VisibleForTesting
static String handleGetContentType(Document metadata) {
// NOTE: To maintain consistency with the XmlFeed, this code returns
// SpiConstants.DEFAULT_MIMETYPE ("text/html") if the Document supplies
// no mime type property. However, the GSA would really rather receive
// MimeTypeDetector.UKNOWN_MIMETYPE ("application/octet-stream").
if (metadata != null) {
try {
String mimeType = Value.getSingleValueString(metadata,
SpiConstants.PROPNAME_MIMETYPE);
if (!Strings.isNullOrEmpty(mimeType)) {
return mimeType;
}
} catch (RepositoryException e) {
LOGGER.log(Level.WARNING, "Failed to retrieve content-type", e);
}
}
return SpiConstants.DEFAULT_MIMETYPE;
}
/**
* Retrieves the content length of a document from a connector instance.
*
* @param metadata the Document metadata
* @return the content-length of the document, as an Integer, or {@code null}
* if the content length is not known, less than or equal to zero,
* or the value does not fit in an Integer. Note that if the
* content-length returned by the connector is zero, this returns
* null, since the GSA does not support empty documents, so the
* empty content will be replaced by ProductionManager with alternate
* non-empty content.
*/
@VisibleForTesting
static Integer handleGetContentLength(Document metadata) {
if (metadata != null) {
try {
String lengthStr = Value.getSingleValueString(metadata,
SpiConstants.PROPNAME_CONTENT_LENGTH);
if (!Strings.isNullOrEmpty(lengthStr)) {
Integer length = Integer.valueOf(lengthStr);
return (length > 0) ? length : null;
}
} catch (NumberFormatException e) {
LOGGER.log(Level.WARNING, "Failed to retrieve content-length", e);
} catch (RepositoryException e) {
LOGGER.log(Level.WARNING, "Failed to retrieve content-length", e);
}
}
return null;
}
@VisibleForTesting
static int handleMarkingDocumentSecurity(HttpServletRequest req,
HttpServletResponse res, Document metadata) throws IOException {
if (req.getHeader("Authorization") != null) {
// GSA logged in; it is aware of the access restrictions on the document.
return HttpServletResponse.SC_OK;
}
if (metadata == null) {
return HttpServletResponse.SC_SERVICE_UNAVAILABLE;
}
ValueImpl isPublicVal;
try {
isPublicVal = (ValueImpl) Value.getSingleValue(metadata,
SpiConstants.PROPNAME_ISPUBLIC);
} catch (RepositoryException ex) {
LOGGER.log(Level.WARNING, "Failed retrieving isPublic property", ex);
return HttpServletResponse.SC_SERVICE_UNAVAILABLE;
}
boolean isPublic = isPublicVal == null || isPublicVal.toBoolean();
if (isSecurityHeaderSupported()) {
res.setHeader("X-Gsa-Serve-Security", isPublic ? "public" : "secure");
return HttpServletResponse.SC_OK;
} else {
if (isPublic) {
return HttpServletResponse.SC_OK;
} else {
res.setHeader("WWW-Authenticate", "Basic realm=\"Retriever\"");
return HttpServletResponse.SC_UNAUTHORIZED;
}
}
}
/** Logs an Exception and returns an appropriate HTTP status code. */
private static int handleException(String context, Exception e)
throws IOException {
if (e instanceof DocumentNotFoundException) {
LOGGER.log(Level.FINE, "Failed to retrieve document {0}: {1}",
new Object[] {context, e.toString()});
return HttpServletResponse.SC_NOT_FOUND;
} else if (e instanceof SkippedDocumentException) {
LOGGER.log(Level.FINE, "Failed to retrieve document {0}: {1}",
new Object[] {context, e.toString()});
return HttpServletResponse.SC_NOT_FOUND;
} else if (e instanceof DocumentAccessException) {
LOGGER.log(Level.FINE, "Failed to retrieve document {0}: {1}",
new Object[] {context, e.toString()});
return HttpServletResponse.SC_FORBIDDEN;
} else if (e instanceof ConnectorNotFoundException) {
LOGGER.log(Level.FINE, "Failed to retrieve document {0}: {1}",
new Object[] {context, e.toString()});
return HttpServletResponse.SC_SERVICE_UNAVAILABLE;
} else if (e instanceof RepositoryException) {
LOGGER.log(Level.WARNING, "Failed to retrieve document " + context, e);
return HttpServletResponse.SC_SERVICE_UNAVAILABLE;
} else if (e instanceof IOException) {
LOGGER.log(Level.WARNING, "Failed to retrieve document " + context, e);
throw (IOException) e;
} else if (e instanceof RuntimeException) {
LOGGER.log(Level.WARNING, "Failed to retrieve document " + context, e);
throw (RuntimeException) e;
} else { // ConnectorManagerException
LOGGER.log(Level.SEVERE, "Failed to retrieve document " + context, e);
return HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
}
}
}
| {'content_hash': '630bad6282ba9b39d33733faac84d42d', 'timestamp': '', 'source': 'github', 'line_count': 582, 'max_line_length': 83, 'avg_line_length': 37.8573883161512, 'alnum_prop': 0.683293241955249, 'repo_name': 'googlegsa/manager.v3', 'id': '0533b4061b26d858ba64cd7ef39693defa586ddf', 'size': '22033', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'projects/connector-manager/source/java/com/google/enterprise/connector/servlet/GetDocumentContent.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '4534'}, {'name': 'HTML', 'bytes': '9078'}, {'name': 'Java', 'bytes': '3291603'}, {'name': 'Shell', 'bytes': '5109'}]} |
include_recipe "perlbrew"
home = node.travis_build_environment.home
brew = "source #{home}/perl5/perlbrew/etc/bashrc && perlbrew"
env = { 'HOME' => home }
user = node.travis_build_environment.user
setup = lambda do |bash|
bash.user user
bash.environment env
end
bash "install cpanm" do
setup.call(self)
code "#{brew} install-cpanm"
not_if "ls #{home}/perl5/perlbrew/bin | grep cpanm"
end
node.perlbrew.perls.each do |pl|
args = pl[:arguments].to_s
args << " --notest"
bash "installing #{pl[:version]} as #{pl[:name]} with Perlbrew arguments: #{args}" do
setup.call(self)
code "#{brew} install #{pl[:version]} --as #{pl[:name]} #{args}"
not_if "ls #{home}/perl5/perlbrew/perls | grep #{pl[:name]}"
end
if pl[:alias]
bash "creating alias #{pl[:alias]} for #{pl[:name]}" do
setup.call(self)
code "#{brew} alias create #{pl[:name]} #{pl[:alias]}"
end
end
node.perlbrew.modules.each do |mod|
bash "preinstall #{mod} via cpanm" do
setup.call(self)
# remove the mirror for now as VMs are based in the US
# --mirror 'http://cpan.mirrors.travis-ci.org'
code "#{brew} use #{pl[:name]} && cpanm #{mod} --force --notest"
end
end
bash "cleaning cpanm metadata for #{pl[:version]}" do
setup.call(self)
code "rm -rf ~/.cpanm"
end
end
| {'content_hash': '0e28eb5c8953638298be172952a815e3', 'timestamp': '', 'source': 'github', 'line_count': 50, 'max_line_length': 87, 'avg_line_length': 26.74, 'alnum_prop': 0.6245325355272999, 'repo_name': 'bd808/travis-cookbooks', 'id': 'a7ee0c84d8625876a901f14d2f9c34b347c5e298', 'size': '1337', 'binary': False, 'copies': '5', 'ref': 'refs/heads/php-debug-vm', 'path': 'ci_environment/perlbrew/recipes/multi.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Clojure', 'bytes': '22'}, {'name': 'Perl', 'bytes': '315'}, {'name': 'Ruby', 'bytes': '490002'}, {'name': 'Scala', 'bytes': '783'}, {'name': 'Shell', 'bytes': '44441'}]} |
package au.edu.uts.eng.remotelabs.schedserver.reports.intf.types;
import java.io.Serializable;
import java.util.ArrayList;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
import org.apache.axiom.om.OMConstants;
import org.apache.axiom.om.OMDataSource;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.impl.llom.OMSourcedElementImpl;
import org.apache.axis2.databinding.ADBBean;
import org.apache.axis2.databinding.ADBDataSource;
import org.apache.axis2.databinding.ADBException;
import org.apache.axis2.databinding.utils.BeanUtil;
import org.apache.axis2.databinding.utils.ConverterUtil;
import org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl;
import org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter;
/**
* SessionReportTypeChoice bean class.
*/
public class SessionReportTypeChoice implements ADBBean
{
/*
* This type was generated from the piece of schema that had
* name = SessionReportTypeChoice_type0
* Namespace URI = http://remotelabs.eng.uts.edu.au/schedserver/reports
* Namespace Prefix = ns1
*/
private static final long serialVersionUID = 8491570126377821952L;
private static String generatePrefix(final String namespace)
{
if (namespace.equals("http://remotelabs.eng.uts.edu.au/schedserver/reports"))
{
return "ns1";
}
return BeanUtil.getUniquePrefix();
}
private void clearAllSettingTrackers()
{
this.userClassTracker = false;
this.userTracker = false;
this.rigTypeTracker = false;
this.rigNameTracker = false;
}
protected String userClass;
protected boolean userClassTracker = false;
public String getUserClass()
{
return this.userClass;
}
public void setUserClass(final String param)
{
this.clearAllSettingTrackers();
this.userClass = param;
this.userClassTracker = param != null;
}
protected RequestorType user;
protected boolean userTracker = false;
public RequestorType getUser()
{
return this.user;
}
public void setUser(final RequestorType param)
{
this.clearAllSettingTrackers();
this.user = param;
this.userTracker = param != null;
}
protected String rigType;
protected boolean rigTypeTracker = false;
public String getRigType()
{
return this.rigType;
}
public void setRigType(final String param)
{
this.clearAllSettingTrackers();
this.rigType = param;
this.rigTypeTracker = param != null;
}
protected String rigName;
protected boolean rigNameTracker = false;
public String getRigName()
{
return this.rigName;
}
public void setRigName(final String param)
{
this.clearAllSettingTrackers();
this.rigName = param;
this.rigNameTracker = param != null;
}
public static boolean isReaderMTOMAware(final XMLStreamReader reader)
{
boolean isReaderMTOMAware = false;
try
{
isReaderMTOMAware = Boolean.TRUE.equals(reader.getProperty(OMConstants.IS_DATA_HANDLERS_AWARE));
}
catch (final IllegalArgumentException e)
{
isReaderMTOMAware = false;
}
return isReaderMTOMAware;
}
public OMElement getOMElement(final QName parentQName, final OMFactory factory) throws ADBException
{
final OMDataSource dataSource = new ADBDataSource(this, parentQName)
{
@Override
public void serialize(final MTOMAwareXMLStreamWriter xmlWriter) throws XMLStreamException
{
SessionReportTypeChoice.this.serialize(this.parentQName, factory, xmlWriter);
}
};
return new OMSourcedElementImpl(parentQName, factory, dataSource);
}
@Override
public void serialize(final QName parentQName, final OMFactory factory, final MTOMAwareXMLStreamWriter xmlWriter)
throws XMLStreamException, ADBException
{
this.serialize(parentQName, factory, xmlWriter, false);
}
@Override
public void serialize(final QName parentQName, final OMFactory factory, final MTOMAwareXMLStreamWriter xmlWriter,
final boolean serializeType) throws XMLStreamException, ADBException
{
String prefix = null;
String namespace = null;
if (serializeType)
{
final String namespacePrefix = this.registerPrefix(xmlWriter,
"http://remotelabs.eng.uts.edu.au/schedserver/reports");
if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0))
{
this.writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix
+ ":SessionReportTypeChoice_type0", xmlWriter);
}
else
{
this.writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type",
"SessionReportTypeChoice_type0", xmlWriter);
}
}
if (this.userClassTracker)
{
namespace = "";
if (!namespace.equals(""))
{
prefix = xmlWriter.getPrefix(namespace);
if (prefix == null)
{
prefix = SessionReportTypeChoice.generatePrefix(namespace);
xmlWriter.writeStartElement(prefix, "userClass", namespace);
xmlWriter.writeNamespace(prefix, namespace);
xmlWriter.setPrefix(prefix, namespace);
}
else
{
xmlWriter.writeStartElement(namespace, "userClass");
}
}
else
{
xmlWriter.writeStartElement("userClass");
}
if (this.userClass == null)
{
throw new ADBException("userClass cannot be null!!");
}
else
{
xmlWriter.writeCharacters(this.userClass);
}
xmlWriter.writeEndElement();
}
if (this.userTracker)
{
if (this.user == null)
{
throw new ADBException("user cannot be null!!");
}
this.user.serialize(new QName("", "user"), factory, xmlWriter);
}
if (this.rigTypeTracker)
{
namespace = "";
if (!namespace.equals(""))
{
prefix = xmlWriter.getPrefix(namespace);
if (prefix == null)
{
prefix = SessionReportTypeChoice.generatePrefix(namespace);
xmlWriter.writeStartElement(prefix, "rigType", namespace);
xmlWriter.writeNamespace(prefix, namespace);
xmlWriter.setPrefix(prefix, namespace);
}
else
{
xmlWriter.writeStartElement(namespace, "rigType");
}
}
else
{
xmlWriter.writeStartElement("rigType");
}
if (this.rigType == null)
{
throw new ADBException("rigType cannot be null!!");
}
else
{
xmlWriter.writeCharacters(this.rigType);
}
xmlWriter.writeEndElement();
}
if (this.rigNameTracker)
{
namespace = "";
if (!namespace.equals(""))
{
prefix = xmlWriter.getPrefix(namespace);
if (prefix == null)
{
prefix = SessionReportTypeChoice.generatePrefix(namespace);
xmlWriter.writeStartElement(prefix, "rigName", namespace);
xmlWriter.writeNamespace(prefix, namespace);
xmlWriter.setPrefix(prefix, namespace);
}
else
{
xmlWriter.writeStartElement(namespace, "rigName");
}
}
else
{
xmlWriter.writeStartElement("rigName");
}
if (this.rigName == null)
{
throw new ADBException("rigName cannot be null!!");
}
else
{
xmlWriter.writeCharacters(this.rigName);
}
xmlWriter.writeEndElement();
}
}
private void writeAttribute(final String prefix, final String namespace, final String attName,
final String attValue, final XMLStreamWriter xmlWriter) throws XMLStreamException
{
if (xmlWriter.getPrefix(namespace) == null)
{
xmlWriter.writeNamespace(prefix, namespace);
xmlWriter.setPrefix(prefix, namespace);
}
xmlWriter.writeAttribute(namespace, attName, attValue);
}
private String registerPrefix(final XMLStreamWriter xmlWriter, final String namespace) throws XMLStreamException
{
String prefix = xmlWriter.getPrefix(namespace);
if (prefix == null)
{
prefix = SessionReportTypeChoice.generatePrefix(namespace);
while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null)
{
prefix = BeanUtil.getUniquePrefix();
}
xmlWriter.writeNamespace(prefix, namespace);
xmlWriter.setPrefix(prefix, namespace);
}
return prefix;
}
@Override
public XMLStreamReader getPullParser(final QName qName) throws ADBException
{
final ArrayList<Serializable> elementList = new ArrayList<Serializable>();
if (this.userClassTracker)
{
elementList.add(new QName("", "userClass"));
if (this.userClass != null)
{
elementList.add(ConverterUtil.convertToString(this.userClass));
}
else
{
throw new ADBException("userClass cannot be null!!");
}
}
if (this.userTracker)
{
elementList.add(new QName("", "user"));
if (this.user == null)
{
throw new ADBException("user cannot be null!!");
}
elementList.add(this.user);
}
if (this.rigTypeTracker)
{
elementList.add(new QName("", "rigType"));
if (this.rigType != null)
{
elementList.add(ConverterUtil.convertToString(this.rigType));
}
else
{
throw new ADBException("rigType cannot be null!!");
}
}
if (this.rigNameTracker)
{
elementList.add(new QName("", "rigName"));
if (this.rigName != null)
{
elementList.add(ConverterUtil.convertToString(this.rigName));
}
else
{
throw new ADBException("rigName cannot be null!!");
}
}
return new ADBXMLStreamReaderImpl(qName, elementList.toArray(), new Object[0]);
}
public static class Factory
{
public static SessionReportTypeChoice parse(final XMLStreamReader reader) throws Exception
{
final SessionReportTypeChoice object = new SessionReportTypeChoice();
try
{
while (!reader.isStartElement() && !reader.isEndElement())
{
reader.next();
}
if (reader.isStartElement() && new QName("", "userClass").equals(reader.getName()))
{
final String content = reader.getElementText();
object.setUserClass(ConverterUtil.convertToString(content));
reader.next();
}
else if (reader.isStartElement() && new QName("", "user").equals(reader.getName()))
{
object.setUser(RequestorType.Factory.parse(reader));
reader.next();
}
else if (reader.isStartElement() && new QName("", "rigType").equals(reader.getName()))
{
final String content = reader.getElementText();
object.setRigType(ConverterUtil.convertToString(content));
reader.next();
}
else if (reader.isStartElement() && new QName("", "rigName").equals(reader.getName()))
{
final String content = reader.getElementText();
object.setRigName(ConverterUtil.convertToString(content));
reader.next();
}
}
catch (final XMLStreamException e)
{
throw new Exception(e);
}
return object;
}
}
}
| {'content_hash': '3b1617c22e3cb9458c229a3dc0afef32', 'timestamp': '', 'source': 'github', 'line_count': 420, 'max_line_length': 117, 'avg_line_length': 32.59761904761905, 'alnum_prop': 0.5405010590899131, 'repo_name': 'jeking3/scheduling-server', 'id': 'ca8d08097095dda48cf66e4b8a1f73c327da71e0', 'size': '15580', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Reports/src/au/edu/uts/eng/remotelabs/schedserver/reports/intf/types/SessionReportTypeChoice.java', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '51816'}, {'name': 'C++', 'bytes': '67831'}, {'name': 'CSS', 'bytes': '36224'}, {'name': 'HTML', 'bytes': '11489'}, {'name': 'Java', 'bytes': '7952577'}, {'name': 'JavaScript', 'bytes': '105192'}, {'name': 'Makefile', 'bytes': '2195'}, {'name': 'NSIS', 'bytes': '59496'}, {'name': 'Shell', 'bytes': '8386'}]} |
This example shows how to run OpenShift Origin as a pod on an existing Kubernetes cluster.
OpenShift Origin runs with a rich set of role based policy rules out of the box that requires authentication from users
via certificates. When run as a pod on an existing Kubernetes cluster, it proxies access to the underlying Kubernetes services
to provide security.
As a result, this example is a complex end-to-end configuration that shows how to configure certificates for a service that runs
on Kubernetes, and requires a number of configuration files to be injected dynamically via a secret volume to the pod.
### Step 0: Prerequisites
This example assumes that you have an understanding of Kubernetes and that you have forked the repository.
OpenShift Origin creates privileged containers when running Docker builds during the source-to-image process.
If you are using a Salt based KUBERNETES_PROVIDER (**gce**, **vagrant**, **aws**), you should enable the
ability to create privileged containers via the API.
```shell
$ cd kubernetes
$ vi cluster/saltbase/pillar/privilege.sls
# If true, allow privileged containers to be created by API
allow_privileged: true
```
Now spin up a cluster using your preferred KUBERNETES_PROVIDER
```shell
$ export KUBERNETES_PROVIDER=gce
$ cluster/kube-up.sh
```
Next, let's setup some variables, and create a local folder that will hold generated configuration files.
```shell
$ export OPENSHIFT_EXAMPLE=$(pwd)/examples/openshift-origin
$ export OPENSHIFT_CONFIG=${OPENSHIFT_EXAMPLE}/config
$ mkdir ${OPENSHIFT_CONFIG}
```
### Step 1: Export your Kubernetes configuration file for use by OpenShift pod
OpenShift Origin uses a configuration file to know how to access your Kubernetes cluster with administrative authority.
```
$ cluster/kubectl.sh config view --output=yaml --flatten=true --minify=true > ${OPENSHIFT_CONFIG}/kubeconfig
```
The output from this command will contain a single file that has all the required information needed to connect to your
Kubernetes cluster that you previously provisioned. This file should be considered sensitive, so do not share this file with
untrusted parties.
We will later use this file to tell OpenShift how to bootstap its own configuration.
### Step 2: Create an External Load Balancer to Route Traffic to OpenShift
An external load balancer is needed to route traffic to our OpenShift master service that will run as a pod on your
Kubernetes cluster.
```shell
$ cluster/kubectl.sh create -f $OPENSHIFT_EXAMPLE/openshift-service.yaml
```
### Step 3: Generate configuration file for your OpenShift master pod
The OpenShift master requires a configuration file as input to know how to bootstrap the system.
In order to build this configuration file, we need to know the public IP address of our external load balancer in order to
build default certificates.
Grab the public IP address of the service we previously created.
```shell
$ export PUBLIC_IP=$(cluster/kubectl.sh get services openshift --template="{{ index .spec.publicIPs 0 }}")
$ echo $PUBLIC_IP
```
Ensure you have a valid PUBLIC_IP address before continuing in the example.
We now need to run a command on your host to generate a proper OpenShift configuration. To do this, we will volume mount the configuration directory that holds your Kubernetes kubeconfig file from the prior step.
```shell
docker run --privileged -v ${OPENSHIFT_CONFIG}:/config openshift/origin start master --write-config=/config --kubeconfig='/config/kubeconfig' --master='https://localhost:8443' --public-master='https://${PUBLIC_IP}:8443'
```
You should now see a number of certificates minted in your configuration directory, as well as a master-config.yaml file that tells the OpenShift master how to execute. In the next step, we will bundle this into a Kubernetes Secret that our OpenShift master pod will consume.
### Step 4: Bundle the configuration into a Secret
We now need to bundle the contents of our configuration into a secret for use by our OpenShift master pod.
OpenShift includes an experimental command to make this easier.
First, update the ownership for the files previously generated:
```
$ sudo -E chown -R ${USER} ${OPENSHIFT_CONFIG}
```
Then run the following command to collapse them into a Kubernetes secret.
```shell
docker run -i -t --privileged -e="OPENSHIFTCONFIG=/config/admin.kubeconfig" -v ${OPENSHIFT_CONFIG}:/config openshift/origin ex bundle-secret openshift-config -f /config &> ${OPENSHIFT_EXAMPLE}/secret.json
```
Now, lets create the secret in your Kubernetes cluster.
```shell
$ cluster/kubectl.sh create -f ${OPENSHIFT_EXAMPLE}/secret.json
```
**NOTE: This secret is secret and should not be shared with untrusted parties.**
### Step 5: Deploy OpenShift Master
We are now ready to deploy OpenShift.
We will deploy a pod that runs the OpenShift master. The OpenShift master will delegate to the underlying Kubernetes
system to manage Kubernetes specific resources. For the sake of simplicity, the OpenShift master will run with an embedded etcd to hold OpenShift specific content. This demonstration will evolve in the future to show how to run etcd in a pod so that content is not destroyed if the OpenShift master fails.
```shell
$ cluster/kubectl.sh create -f ${OPENSHIFT_EXAMPLE}/openshift-controller.yaml
```
You should now get a pod provisioned whose name begins with openshift.
```shell
$ cluster/kubectl.sh get pods | grep openshift
$ cluster/kubectl.sh log openshift-t7147 origin
Running: cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl log openshift-t7t47 origin
2015-04-30T15:26:00.454146869Z I0430 15:26:00.454005 1 start_master.go:296] Starting an OpenShift master, reachable at 0.0.0.0:8443 (etcd: [https://10.0.27.2:4001])
2015-04-30T15:26:00.454231211Z I0430 15:26:00.454223 1 start_master.go:297] OpenShift master public address is https://104.197.73.241:8443
```
Depending upon your cloud provider, you may need to open up an external firewall rule for tcp:8443. For GCE, you can run the following:
```shell
gcloud compute --project "your-project" firewall-rules create "origin" --allow tcp:8443 --network "your-network" --source-ranges "0.0.0.0/0"
```
Consult your cloud provider's documentation for more information.
Open a browser and visit the OpenShift master public address reported in your log.
You can use the CLI commands by running the following:
```shell
$ docker run --privileged --entrypoint="/usr/bin/bash" -it -e="OPENSHIFTCONFIG=/config/admin.kubeconfig" -v ${OPENSHIFT_CONFIG}:/config openshift/origin
$ osc config use-context public-default
$ osc --help
```
[]()
| {'content_hash': '67565e49ec04075ffc68199590b750d3', 'timestamp': '', 'source': 'github', 'line_count': 156, 'max_line_length': 307, 'avg_line_length': 43.455128205128204, 'alnum_prop': 0.7732703938634017, 'repo_name': 'haohonglin/kubernetes', 'id': '372710c9255f640e0811ba307c695a9928440208', 'size': '6808', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'examples/openshift-origin/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '24226'}, {'name': 'Go', 'bytes': '9724099'}, {'name': 'HTML', 'bytes': '71426'}, {'name': 'Java', 'bytes': '5390'}, {'name': 'JavaScript', 'bytes': '198083'}, {'name': 'Makefile', 'bytes': '14510'}, {'name': 'Nginx', 'bytes': '1013'}, {'name': 'PHP', 'bytes': '736'}, {'name': 'Python', 'bytes': '61698'}, {'name': 'Ruby', 'bytes': '2778'}, {'name': 'SaltStack', 'bytes': '24205'}, {'name': 'Shell', 'bytes': '670902'}]} |
using ::testing::_;
namespace content {
class MockPerSessionWebRTCAPIMetrics : public PerSessionWebRTCAPIMetrics {
public:
MockPerSessionWebRTCAPIMetrics() {}
using PerSessionWebRTCAPIMetrics::LogUsageOnlyOnce;
MOCK_METHOD1(LogUsage, void(JavaScriptAPIName));
};
TEST(PerSessionWebRTCAPIMetrics, NoCallOngoingGetUserMedia) {
MockPerSessionWebRTCAPIMetrics metrics;
EXPECT_CALL(metrics, LogUsage(_)).Times(1);
metrics.LogUsageOnlyOnce(WEBKIT_GET_USER_MEDIA);
}
TEST(PerSessionWebRTCAPIMetrics, CallOngoingGetUserMedia) {
MockPerSessionWebRTCAPIMetrics metrics;
metrics.IncrementStreamCounter();
EXPECT_CALL(metrics, LogUsage(WEBKIT_GET_USER_MEDIA)).Times(1);
metrics.LogUsageOnlyOnce(WEBKIT_GET_USER_MEDIA);
}
TEST(PerSessionWebRTCAPIMetrics, NoCallOngoingRTCPeerConnection) {
MockPerSessionWebRTCAPIMetrics metrics;
EXPECT_CALL(metrics, LogUsage(WEBKIT_RTC_PEER_CONNECTION));
metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
}
TEST(PerSessionWebRTCAPIMetrics, NoCallOngoingMultiplePC) {
MockPerSessionWebRTCAPIMetrics metrics;
EXPECT_CALL(metrics, LogUsage(WEBKIT_RTC_PEER_CONNECTION)).Times(1);
metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
}
TEST(PerSessionWebRTCAPIMetrics, BeforeAfterCallMultiplePC) {
MockPerSessionWebRTCAPIMetrics metrics;
EXPECT_CALL(metrics, LogUsage(WEBKIT_RTC_PEER_CONNECTION)).Times(1);
metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
metrics.IncrementStreamCounter();
metrics.IncrementStreamCounter();
metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
metrics.DecrementStreamCounter();
metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
metrics.DecrementStreamCounter();
EXPECT_CALL(metrics, LogUsage(WEBKIT_RTC_PEER_CONNECTION)).Times(1);
metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
}
} // namespace content
| {'content_hash': 'f2d8bb2a921de9fe42fa0ae314c0eb55', 'timestamp': '', 'source': 'github', 'line_count': 57, 'max_line_length': 74, 'avg_line_length': 36.21052631578947, 'alnum_prop': 0.810077519379845, 'repo_name': 'patrickm/chromium.src', 'id': '7d3a9199fcb2fac9b5156aefe1b284e069ef508c', 'size': '2384', 'binary': False, 'copies': '2', 'ref': 'refs/heads/nw', 'path': 'content/renderer/media/webrtc_uma_histograms_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'}]} |
/*
Coin Slider jQuery plugin CSS styles
http://workshop.rs/projects/coin-slider
*/
.coin-slider { overflow: hidden; zoom: 1; position: relative; }
.coin-slider a{ text-decoration: none; outline: none; border: none; }
.cs-buttons { font-size: 0px; padding: 10px; float: left; }
.cs-buttons a { margin-left: 5px; height: 10px; width: 10px; float: left; border: 1px solid #B8C4CF; color: #B8C4CF; text-indent: -1000px; }
.cs-active { background-color: #B8C4CF; color: #FFFFFF; }
.cs-title { width: 100%; padding: 10px; background-color: #22B8F6; color: #fff; font-weight: bold; font-size: 16px;
display: none;
}
.cs-prev,
.cs-next { background-color: #22B8F6; color: #FFFFFF; padding: 0px 10px; }
| {'content_hash': '330ff791fe64b2a42697205152f0dce3', 'timestamp': '', 'source': 'github', 'line_count': 19, 'max_line_length': 140, 'avg_line_length': 36.94736842105263, 'alnum_prop': 0.6923076923076923, 'repo_name': 'doananhtu/ShopMTP', 'id': 'd1a926e40180241b86d5f6f2188cec7e068cdf95', 'size': '702', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'asset/css/coin-slider-styles.css', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '240'}, {'name': 'CSS', 'bytes': '315578'}, {'name': 'HTML', 'bytes': '5868274'}, {'name': 'JavaScript', 'bytes': '219116'}, {'name': 'PHP', 'bytes': '1973640'}]} |
<?php
namespace Monolog\Handler;
use Monolog\Logger;
/**
* Stores logs to files that are rotated every day and a limited number of files are kept.
*
* This rotation is only intended to be used as a workaround. Using logrotate to
* handle the rotation is strongly encouraged when you can use it.
*
* @author Christophe Coevoet <[email protected]>
* @author Jordi Boggiano <[email protected]>
*/
class RotatingFileHandler extends StreamHandler {
protected $filename;
protected $maxFiles;
protected $mustRotate;
protected $nextRotation;
/**
*
* @param string $filename
* @param integer $maxFiles
* The maximal amount of files to keep (0 means unlimited)
* @param integer $level
* The minimum logging level at which this handler will be triggered
* @param Boolean $bubble
* Whether the messages that are handled can bubble up the stack or not
*/
public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true) {
$this->filename = $filename;
$this->maxFiles = ( int ) $maxFiles;
$this->nextRotation = new \DateTime ( 'tomorrow' );
parent::__construct ( $this->getTimedFilename (), $level, $bubble );
}
/**
*
* {@inheritdoc}
*
*/
public function close() {
parent::close ();
if (true === $this->mustRotate) {
$this->rotate ();
}
}
/**
*
* {@inheritdoc}
*
*/
protected function write(array $record) {
// on the first record written, if the log is new, we should rotate (once per day)
if (null === $this->mustRotate) {
$this->mustRotate = ! file_exists ( $this->url );
}
if ($this->nextRotation < $record ['datetime']) {
$this->mustRotate = true;
$this->close ();
}
parent::write ( $record );
}
/**
* Rotates the files.
*/
protected function rotate() {
// update filename
$this->url = $this->getTimedFilename ();
$this->nextRotation = new \DateTime ( 'tomorrow' );
// skip GC of old logs if files are unlimited
if (0 === $this->maxFiles) {
return;
}
$fileInfo = pathinfo ( $this->filename );
$glob = $fileInfo ['dirname'] . '/' . $fileInfo ['filename'] . '-*';
if (! empty ( $fileInfo ['extension'] )) {
$glob .= '.' . $fileInfo ['extension'];
}
$iterator = new \GlobIterator ( $glob );
$count = $iterator->count ();
if ($this->maxFiles >= $count) {
// no files to remove
return;
}
// Sorting the files by name to remove the older ones
$array = iterator_to_array ( $iterator );
usort ( $array, function ($a, $b) {
return strcmp ( $b->getFilename (), $a->getFilename () );
} );
foreach ( array_slice ( $array, $this->maxFiles ) as $file ) {
if ($file->isWritable ()) {
unlink ( $file->getRealPath () );
}
}
}
protected function getTimedFilename() {
$fileInfo = pathinfo ( $this->filename );
$timedFilename = $fileInfo ['dirname'] . '/' . $fileInfo ['filename'] . '-' . date ( 'Y-m-d' );
if (! empty ( $fileInfo ['extension'] )) {
$timedFilename .= '.' . $fileInfo ['extension'];
}
return $timedFilename;
}
}
| {'content_hash': '95b7900021c6b33fb4af7c549030358c', 'timestamp': '', 'source': 'github', 'line_count': 119, 'max_line_length': 97, 'avg_line_length': 25.857142857142858, 'alnum_prop': 0.6113097172570686, 'repo_name': 'vienbk91/fuelphp17', 'id': 'fc2787153af72c42a5b473e6c141182cfe01f306', 'size': '3304', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'fuel/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '1641'}, {'name': 'PHP', 'bytes': '2037085'}]} |
template "/tmp/foo" do
variables({
'phasers' => 'stun'
})
action :create
end
file "/tmp/foo" do
action :touch
end
package "less" do
action :install
end
package node['spec_examples']['pager'] do
action :install
end
chipmunks = %w{alvin simon theodore}
chipmunks.each do |chipmunk|
user chipmunk do
action :create
end
end
group "chipmunks" do
members chipmunks
action :create
end
%w{hard symbolic}.each do |link_type|
link "/tmp/foo-#{link_type}" do
to "/tmp/foo"
link_type link_type
action :create
end
end
package "cron" do
action :install
end
cron "noop" do
hour "5"
minute "0"
command "/bin/true"
end
mount "/mnt" do
pass 0
fstype "tmpfs"
device "/dev/null"
options "nr_inodes=999k,mode=755,size=500m"
action [:mount, :enable]
end
ifconfig "192.168.20.2" do
device "eth0"
action :add
end
| {'content_hash': '2c1202503fcda61454092cb61a10b353', 'timestamp': '', 'source': 'github', 'line_count': 61, 'max_line_length': 45, 'avg_line_length': 14.180327868852459, 'alnum_prop': 0.6624277456647398, 'repo_name': 'matschaffer/minitest-chef-handler', 'id': '3abf0ab67039a7cf6a4e46037ad0fcc7f33b23fd', 'size': '955', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'examples/spec_examples/recipes/default.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '48039'}]} |
package com.navercorp.pinpoint.profiler.context.active;
import com.navercorp.pinpoint.profiler.context.id.TraceRoot;
import java.util.Objects;
/**
* @author HyunGil Jeong
*/
public class SampledActiveTrace implements ActiveTrace {
private final TraceRoot traceRoot;
public SampledActiveTrace(TraceRoot traceRoot) {
this.traceRoot = Objects.requireNonNull(traceRoot, "trace");
}
@Override
public long getStartTime() {
return this.traceRoot.getTraceStartTime();
}
@Override
public long getId() {
return this.traceRoot.getLocalTransactionId();
}
@Override
public ActiveTraceSnapshot snapshot() {
return new SampledActiveTraceSnapshot(traceRoot);
}
@Override
public String toString() {
return "SampledActiveTrace{" +
"traceRoot=" + traceRoot +
'}';
}
}
| {'content_hash': '50f53e65b6e1f6fbeb8fb861c9687c57', 'timestamp': '', 'source': 'github', 'line_count': 43, 'max_line_length': 68, 'avg_line_length': 20.837209302325583, 'alnum_prop': 0.6618303571428571, 'repo_name': 'naver/pinpoint', 'id': '3b42356aed9510032f495365cca8a2f0b2295c72', 'size': '1486', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'profiler/src/main/java/com/navercorp/pinpoint/profiler/context/active/SampledActiveTrace.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '22629'}, {'name': 'CSS', 'bytes': '386346'}, {'name': 'Groovy', 'bytes': '1423'}, {'name': 'HTML', 'bytes': '155936'}, {'name': 'Java', 'bytes': '16572538'}, {'name': 'JavaScript', 'bytes': '5349'}, {'name': 'PLSQL', 'bytes': '4156'}, {'name': 'Shell', 'bytes': '30236'}, {'name': 'TSQL', 'bytes': '4759'}, {'name': 'Thrift', 'bytes': '15284'}, {'name': 'TypeScript', 'bytes': '1358173'}]} |
Bi(n, p) \to N(np, np(1-p)) as n\to \infty
On the other hand
Bi(n, p) \to Pois(np) as p\to 0 and n\to \infty
and Pois(\lambda) \to N(\lambda, \lambda) as \lambda\to\infty
Do not worry about np(1-p) \neq \lambda, since 1-p \approx 1
Point estimation
\brac{X_k}_{k=1}^n
sample mean \bar{X} = \frac{\sum_{k=1}^n X_k}{n}
it is good what about other parameters
We are in a parametric situation P\in \mathcal{P} where \mathcal{P} is some
parametric family of probability measures with respect to some parameter space \Theta \subseteq \Real^d.
Suppose the underlying distribution is known up to some parameter \theta_0 which is unknown.
An estimator (a sufficient statistic) is a measurable function u = u(X_1, ..., X_n)of the random sample (X_k)_{k=1}^n \sym F_{\theta_0}
Is F_{\theta_0} a multivariate distribution?
Bias how close the estimator is to the estimated parameter
b(\hat{\theta}) = E_\theta(\hat{\theta} - \theta), where the expectaion is taken over the measure with respect to the true parameter: E_\theta f = \int f dP_\theta
How small E |\hat{\theta} -\theta|? Moduli are inconvenient, so let's look at the square distance.
Minimize the mean square error: the bias-variance decomposition
E_\theta{(\hat{\theta} - \theta)}^2 = E_\theta{(\hat{\theta} - E_\theta\hat{\theta} + E_\theta\hat{\theta}- \theta)}^2 = E_\theta{(\hat{\theta} - E_\theta\hat{\theta})^2 + E_\theta{E_\theta\hat{\theta}-\theta)}^2 = Var(\hat{\theta}) + b^2(\hat{\theta})
bias-variance trade off
Consistency: a sequence of estimators \brac{\hat{\theta}_n}_{n\geq1} of \theta \in \Theta converges in probability to \theta: \hat{\theta}_n \overset{\Pr}{\to} \theta as n\to \infty
Plug in estimators: parameter of interest of a distribution is a function of the distribution function itself
mean : \mu(F) = \int x dF(x)
variance : \sigma^2(F) = \int (x - \mu(F))^2 dF(x)
median : q_\alpha(F) = \int {x| F(x)\geq \alpha}
The empirical distribution function: for all x\in \Real
\hat{F}(x) = \frac{1}{n}\sum_{k=1}^n 1_{X_k\leq x}
piecewise constant (locally constant) right-continuous map with jumps at X_k of size \frac{1}{n}
What are the asymptotic properties of the plug-in estimators?
Consistency: parameter is actually a functional on distributions function: \theta = G(F_\theta)
just plug in the ECDF and get the estimator!
If \hat{F}_n\to F is some sense then if G is ``continuous'', we have G(\hat{F}_n)\to G(F)
By by the Law of Large Numbers \hat{F}_n(x) \to F(x) in probability (and almost surely) at all points of continuity of F. Glivenko-Cantelli Theorem: \sup_{t\in \Real}\abs{\hat{F}_n\brac{t}-F\brac{t}} \to 0
Asymptotic normality: \sqrt{n}(\hat{\theta}_n-\theta)\overset{\mathcal{D}}{\to} \mathcal{N}(0, \sigma^2_\theta)
X_k \sym F
U_k \defn F(X_k), U_k\sym U\clo{0,1}
\hat{F}_n(x) = \frac{1}{n}\sum_{k=1}^n 1_{X_k\leq x} = \frac{1}{n}\sum_{k=1}^n 1_{F^{-1}(U_k)\leq x} = \frac{1}{n}\sum_{k=1}^n 1_{U_k\leq F(x)} = \hat{U}_n(F(x))
where \hat{U}_n is the empirical distribution function of a uniform random sample
Now for any t\in \clo{0,t} it is true that 1_{U_k\leq t} \synm B(t)
thus n \hat{U}_n(t) \sym Bi(t, n)
Using CLT for Bi(t,n) gives \frac{n\hat{U}_n(t) - nt}{\sqrt{ nt(1-t) }} \overset{\mathcal{D}}{\to} \mathcal{N}(0,1)
Thus \sqrt{n}\frac{\hat{U}_n(t) - t}{\sqrt{t(1-t) }} \overset{\mathcal{D}}{\to} \mathcal{N}(0,1)
whence \sqrt{n}({\hat{U}_n(t) - t}) \overset{\mathcal{D}}{\to} \mathcal{N}(0,t(1-t))
If G is highly-nonlinear but still ``continuous'', as n is bigger and bigger would become more and more linear and so using the delta-method.
Maximum Likelihood Estimation (Fisher)
Collect a random sample \brac{X_k}_{k=1}^n \sym B(p) iid
P( X_k = x_k for all k=1...n ) = \prod_{k=1}^n p^{x_k}{(1-p)}^{1-x_k}
Maximize the join probability of the collected sample of observations of some parametric family!!!
Let \brac{X_k}_{k=1}^n be random variables with joint density f\brac{x_1,\ldots,\,x_n;\,\theta} with \theta\in \Theta. The likelihood function L\brac{\theta} = f\brac{\brac{X_k}_{k=1}^n};\,\theta}
pick theta so that L is maximized!
\hat{\theta}_{ML} = \argmax_{\theta \in \Theta} L\brac{\theta} so that $L\brac{\hat{\theta}}\geq L\brac{\theta}$ for all $\theta \in\Thetas$
Usually the log-likelihood is more tractable
\brac{X_k}_{k=1}^n \sym Geom(p) : \Pr\brac{X_k = m} = \brac{1-p}^m p
The likelihood function: L(p) =\prod_{k=1}^n p\brac{1-p}^{x_k}
The log-likelihood function: l(p) =n \log{p} + \log{1-p}\sum_{k=1}^n x_k
So \hat{p} : \frac{n}{p} +\frac{-n}{1-p} \frac{\sum_{k=1}^n x_k}{n} = 0
Observe that \hat{p} = \brac{1+\bar{X}}, whereas p = \brac{1+E(X)}
Method of moment estimator compute theoretical moments and find such parameter \theta that theoretical moments match (are close to) the sample moments.
\frac{d l}{d \theta} = \frac{d}{d\theta} \sum_{k=1}^n \log f\brac{X_k;\, \theta} = \sum_{k=1}^n \frac{\frac{d}{d\theta} f\brac{X_k;\, \theta}}{f\brac{X_k;\, \theta}} \sum_{k=1}^n Y_k
using regularity conditions look up in any book on statistics:
E\brac{Y_k} = \int \frac{\frac{d}{d\theta} f\brac{X_k;\, \theta}}{f\brac{X_k;\, \theta}}f\brac{X_k;\, \theta} dX_k = \int \frac{d}{d\theta} f\brac{X_k;\, \theta} dX_k = \frac{d}{d\theta} \int f\brac{X_k;\, \theta} dX_k = 0
Therefore E\brac{\frac{d l}{d \theta} } = 0
Let's look at
\frac{d}{d \theta} E\brac{\frac{d \log f\brac{X;\,\theta}}{d \theta} } = \frac{d}{d \theta}\int \frac{d \log f\brac{X;\,\theta}}{d \theta} f\brac{X;\, \theta} dX = \int \frac{d}{d \theta}\brac{\frac{d \log f\brac{X;\,\theta}}{d \theta} f\brac{X;\, \theta}} dX = \int \frac{d f\brac{X;\,\theta}}{d \theta} \frac{d \log f\brac{X;\,\theta}}{d \theta} +
f\brac{X;\,\theta} \frac{d^2 \log f\brac{X;\,\theta}}{d \theta^2} dX = \int \brac{ \brac{\frac{d \log f\brac{X;\,\theta}}{d \theta}}^2 + \frac{d^2 \log f\brac{X;\,\theta}}{d \theta^2} }f\brac{X;\,\theta} dX = 0
Whence I\brac{\theta} = E\brac{ \frac{d^2 \log f\brac{X;\,\theta}}{d \theta^2} } = - E\brac{ \brac{\frac{d \log f\brac{X;\,\theta}}{d \theta}}^2 }
Cramer-Rao lower bound: Under some regularity conditions
Var\brac{\hat{\theta}}\geq \frac{\brac{\frac{d E\brac{\hat{\theta}}}^2}{d\theta}}{n I\brac{\theta}} = \frac{\brac{1+b'\brac{\theta}}^2}{n I\brac{\theta}}
| {'content_hash': '25a7c66f3383b75d0f9c662e6ca6b500', 'timestamp': '', 'source': 'github', 'line_count': 114, 'max_line_length': 350, 'avg_line_length': 54.58771929824562, 'alnum_prop': 0.6477583159247952, 'repo_name': 'ivannz/study_notes', 'id': '25606eec6160467474d86ccca6e197bdd4d00a1e', 'size': '6223', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'year_14_15/fall_2014/probability/notes/notes 2.tex', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '22914'}, {'name': 'HTML', 'bytes': '120779'}, {'name': 'Jupyter Notebook', 'bytes': '1634031'}, {'name': 'Matlab', 'bytes': '18814'}, {'name': 'Python', 'bytes': '487132'}, {'name': 'R', 'bytes': '85930'}, {'name': 'Scala', 'bytes': '4269'}, {'name': 'Shell', 'bytes': '1505'}, {'name': 'TeX', 'bytes': '3279630'}]} |
function varargout = subdir(varargin)
%SUBDIR Performs a recursive file search
%
% subdir
% subdir(name)
% files = subdir(...)
%
% This function performs a recursive file search. The input and output
% format is identical to the dir function.
%
% Input variables:
%
% name: pathname or filename for search, can be absolute or relative
% and wildcards (*) are allowed. If ommitted, the files in the
% current working directory and its child folders are returned
%
% Output variables:
%
% files: m x 1 structure with the following fields:
% name: full filename
% date: modification date timestamp
% bytes: number of bytes allocated to the file
% isdir: 1 if name is a directory; 0 if no
%
% Example:
%
% >> a = subdir(fullfile(matlabroot, 'toolbox', 'matlab', '*.mat'))
%
% a =
%
% 67x1 struct array with fields:
% name
% date
% bytes
% isdir
%
% >> a(2)
%
% ans =
%
% name: '/Applications/MATLAB73/toolbox/matlab/audiovideo/chirp.mat'
% date: '14-Mar-2004 07:31:48'
% bytes: 25276
% isdir: 0
%
% See also:
%
% dir
% Copyright 2006 Kelly Kearney
%---------------------------
% Get folder and filter
%---------------------------
narginchk(0,1);
nargoutchk(0,1);
if nargin == 0
folder = pwd;
filter = '*';
else
[folder, name, ext] = fileparts(varargin{1});
if isempty(folder)
folder = pwd;
end
if isempty(ext)
if isdir(fullfile(folder, name))
folder = fullfile(folder, name);
filter = '*';
else
filter = [name ext];
end
else
filter = [name ext];
end
if ~isdir(folder)
error('Folder (%s) not found', folder);
end
end
%---------------------------
% Search all folders
%---------------------------
pathstr = genpath_local(folder);
pathfolders = regexp(pathstr, pathsep, 'split'); % Same as strsplit without the error checking
pathfolders = pathfolders(~cellfun('isempty', pathfolders)); % Remove any empty cells
Files = [];
pathandfilt = fullfile(pathfolders, filter);
for ifolder = 1:length(pathandfilt)
NewFiles = dir(pathandfilt{ifolder});
if ~isempty(NewFiles)
fullnames = cellfun(@(a) fullfile(pathfolders{ifolder}, a), {NewFiles.name}, 'UniformOutput', false);
[NewFiles.name] = deal(fullnames{:});
Files = [Files; NewFiles];
end
end
%---------------------------
% Prune . and ..
%---------------------------
if ~isempty(Files)
[~, ~, tail] = cellfun(@fileparts, {Files(:).name}, 'UniformOutput', false);
dottest = cellfun(@(x) isempty(regexp(x, '\.+(\w+$)', 'once')), tail);
Files(dottest & [Files(:).isdir]) = [];
end
%---------------------------
% Output
%---------------------------
if nargout == 0
if ~isempty(Files)
fprintf('\n');
fprintf('%s\n', Files.name);
fprintf('\n');
end
elseif nargout == 1
varargout{1} = Files;
end
function [p] = genpath_local(d)
% Modified genpath that doesn't ignore:
% - Folders named 'private'
% - MATLAB class folders (folder name starts with '@')
% - MATLAB package folders (folder name starts with '+')
files = dir(d);
if isempty(files)
return
end
p = ''; % Initialize output
% Add d to the path even if it is empty.
p = [p d pathsep];
% Set logical vector for subdirectory entries in d
isdir = logical(cat(1,files.isdir));
dirs = files(isdir); % Select only directory entries from the current listing
for i=1:length(dirs)
dirname = dirs(i).name;
if ~strcmp( dirname,'.') && ~strcmp( dirname,'..')
p = [p genpath(fullfile(d,dirname))]; % Recursive calling of this function.
end
end
| {'content_hash': '06dc8f4c3ca9e3595e97de9967b39b44', 'timestamp': '', 'source': 'github', 'line_count': 151, 'max_line_length': 110, 'avg_line_length': 25.721854304635762, 'alnum_prop': 0.5525231719876416, 'repo_name': 'kakearney/subdir-pkg', 'id': '31eb06ef8c6707206b60316a10264c079672dc42', 'size': '3884', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'subdir/subdir.m', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'Matlab', 'bytes': '3884'}]} |
<?xml version="1.0" encoding="UTF-8" ?>
<Configuration shutdownHook="disable">
<Appenders>
<Console name="console" target="SYSTEM_OUT">
<PatternLayout pattern="%d %p [%c] - <%m>%n"/>
</Console>
<RollingFile name="file" fileName="build/core.log" append="true"
filePattern="core-%d{yyyy-MM-dd-HH}-%i.log.gz">
<PatternLayout pattern="%d %p [%c] - %m%n"/>
<Policies>
<OnStartupTriggeringPolicy />
<SizeBasedTriggeringPolicy size="10 MB"/>
<TimeBasedTriggeringPolicy />
</Policies>
</RollingFile>
<!-- Required by CasLoggerFactoryTests. Filename is linked to the test. -->
<RollingFile name="slf4j" fileName="build/slf4j.log" append="true"
filePattern="slf4j-%d{yyyy-MM-dd-HH}-%i.log.gz">
<PatternLayout pattern="%d %p [%c] - %m%n"/>
<Policies>
<OnStartupTriggeringPolicy />
<SizeBasedTriggeringPolicy size="10 MB"/>
<TimeBasedTriggeringPolicy />
</Policies>
</RollingFile>
</Appenders>
<Loggers>
<Logger name="org.apereo" level="warn" additivity="false">
<AppenderRef ref="console"/>
</Logger>
<Root level="warn">
<AppenderRef ref="console"/>
</Root>
</Loggers>
</Configuration>
| {'content_hash': '8082913eac8be8831a1d59559ca1ed58', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 83, 'avg_line_length': 39.77777777777778, 'alnum_prop': 0.5370111731843575, 'repo_name': 'zawn/cas', 'id': '0e822d9ca8f9f4e520e5cb46637e965ab81248df', 'size': '1432', 'binary': False, 'copies': '13', 'ref': 'refs/heads/zawn', 'path': 'cas-server-core-services/src/test/resources/log4j2.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '245984'}, {'name': 'Groovy', 'bytes': '4528'}, {'name': 'HTML', 'bytes': '170194'}, {'name': 'Java', 'bytes': '3532238'}, {'name': 'JavaScript', 'bytes': '57024'}, {'name': 'Shell', 'bytes': '4388'}]} |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['pagination_first_link'] = '‹ اولین';
$lang['pagination_next_link'] = '>';
$lang['pagination_prev_link'] = '<';
$lang['pagination_last_link'] = 'آخرین ›';
| {'content_hash': '3f131257f4b37a2a0ac5421c27f146cb', 'timestamp': '', 'source': 'github', 'line_count': 8, 'max_line_length': 63, 'avg_line_length': 31.625, 'alnum_prop': 0.6561264822134387, 'repo_name': 'RafaHNDZ/SCA', 'id': '1bd9cb1dbb098932e78c582698c54129d243dc97', 'size': '548', 'binary': False, 'copies': '30', 'ref': 'refs/heads/master', 'path': 'system/language/persian/pagination_lang.php', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '245'}, {'name': 'CSS', 'bytes': '185220'}, {'name': 'HTML', 'bytes': '11088'}, {'name': 'JavaScript', 'bytes': '361011'}, {'name': 'PHP', 'bytes': '3208793'}]} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': 'e8d4d48b790a3c4a348474765877a63f', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 10.23076923076923, 'alnum_prop': 0.6917293233082706, 'repo_name': 'mdoering/backbone', 'id': 'c360c5b26347c3fbc4a4d45f0f045224a23c74a4', 'size': '182', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Apiales/Araliaceae/Schefflera/Schefflera polybotrya/ Syn. Paratropia eurhyncha/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
@REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler.
set OUT_DIR=Debug
set OUT_EXE=example_sdl_opengl3
set INCLUDES=/I.. /I..\.. /I%SDL2_DIR%\include /I..\libs\gl3w
set SOURCES=main.cpp ..\imgui_impl_sdl.cpp ..\imgui_impl_opengl3.cpp ..\..\imgui*.cpp ..\libs\gl3w\GL\gl3w.c
set LIBS=/libpath:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib
mkdir %OUT_DIR%
cl /nologo /Zi /MD %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console
| {'content_hash': '93c922351192769cb8494a0d0bfca36e', 'timestamp': '', 'source': 'github', 'line_count': 8, 'max_line_length': 117, 'avg_line_length': 67.5, 'alnum_prop': 0.7203703703703703, 'repo_name': 'aimotive/imgui-glfw', 'id': 'ce105602f7099fd1c52309483c3fde2e02e5999e', 'size': '540', 'binary': False, 'copies': '11', 'ref': 'refs/heads/master', 'path': 'examples/example_sdl_opengl3/build_win32.bat', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '218975'}, {'name': 'C++', 'bytes': '902621'}, {'name': 'CMake', 'bytes': '1843'}]} |
Barsink is a set of sane defaults for fast static frontend development. Heavily uses the Gulp.js streaming build system.
You can also use Gulp's live reload feature to see your changes almost instantly.
### Overview
* Gulp.js
* Jade
* Stylus
* Autoprefixer
* CoffeeScript
* Imagemin
### Usage
#### Set Up
0. Node basics:
1. Install Node.js and NPM
2. If you try to install things and it asks you for admin access, try this `sudo chown -R $USER /usr/local/{share/man,bin,lib/node,include/node}`
1. `npm install`
#### Tasks
##### Development
Automatically start a static file server (default port `8080`) and livereload server (default port `35729`):
`gulp`
##### Deployment
Clean the build folder and deploy with minification and uglification (coming soon):
`gulp deploy`
or deploy raw:
`gulp deploy-raw`
#### Internals
##### Markup
`gulp markup`
1. Jade
2. HTML Minify (coming soon)
##### Styles
`gulp styles`
1. Stylus
2. Autoprefixer (`last 2, ie8, ios6, android4`)
3. CSS Minify (coming soon)
##### Scripts
`gulp scripts`
1. CoffeeLint (coming soon)
2. CoffeeScript
3. UglifyJS (coming soon)
##### Images
`gulp images`
1. Imagemin
##### Watch
`gulp watch`
1. Watch scripts, styles, images, and markup folders for changes and rerun the respective task
##### Serve
`gulp serve`
1. Start Connect static server (default port `8080`) at `build/`
##### LiveReload
`gulp livereload`
1. Start LiveReload server (default port `35729`)
##### Clean
`gulp clean`
1. Delete all the files in the `build/` folder
##### Misc
`gulp misc`
1. Copy 1 for 1 all files from `src/misc/` to `build/`
This can be useful for miscellaneous files like favicons, robots.txt, or
vendor files which can't go through the normal pipe.
***
Crafted by Ben Hohner. Source under [MIT](http://opensource.org/licenses/MIT) licence.
| {'content_hash': 'c3a606fc21d0e10d396bcc78f70d633a', 'timestamp': '', 'source': 'github', 'line_count': 108, 'max_line_length': 150, 'avg_line_length': 17.416666666666668, 'alnum_prop': 0.6905901116427432, 'repo_name': 'benhohner/barsink', 'id': 'c3a42c43a89eed1fc5edc522c6ed01ea1f263ad4', 'size': '1947', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '4015'}]} |
layout: page-fullwidth
meta_title: "Solidarity Actions - Refugees Emancipation Supporters Campaign"
title: "Join in and organise a solidarity action!"
show_meta: false
breadcrumb: true
subheadline: ""
teaser: "We are always eager to find new ways to generate attention for Refugees Emancipation and to collect more donations. Here's another way for you to contribute: solidarity actions!"
permalink: "/actions/"
---
### You could...
- collect donations for the project at your own event
- initiate a solidarity night at your favourite pub, simply with a donation box on the bar
- put on a solidarity party and donate the entry fees
- host a classic bake sale
- arrange an auction or a flea market
- organise a charity concert
... or have another idea :)
Please tell us about your action at [[email protected]](mailto:[email protected]), specifying date, headline and short description and we will publish the action on this website and help promoting it.
## What, when, and where?
### Online gains from the CD by Arbeitsgruppe Zukunft with Mark-Uwe Kling
You can now support Refugees Emancipation and buy a great album at the same time. The gains from the online sales of the new CD _"Viel Schönes dabei – live"_ from the Arbeitsgruppe Zukunft with Mark-Uwe Kling will go to the project. The CD is also a lovely present for your friends and family. You can order it here: [reimkultur-mv.de](https://www.reimkultur-mv.de/artikel_mk15005_audio-cd-arbeitsgruppe-zukunft-viel-schoenes-dabei-live.html)
<p class="subheadline subheader">10.10.2015 Astra Stube Neukölln - Berlin</p>
<h3 class="t0">Solidarity party: "Fleeing is not a crime"</h3>
A solidarity counter was established at Astra Stube Neukölln: Football memorabilia and, among other things, advertising posters (bus stop format), a jersey from Hansa from unknown origin and a homemade flag from the club St. Pauli were sold by auction. The highlight was a private living-room concert with Thees Uhlmann, singer of the band Tomte. [twitter.com/theesuhlmann](https://twitter.com/theesuhlmann).
| {'content_hash': '77b45aae424f4b1e19dabf1178003c16', 'timestamp': '', 'source': 'github', 'line_count': 32, 'max_line_length': 442, 'avg_line_length': 65.34375, 'alnum_prop': 0.7800095648015304, 'repo_name': 'ilmDitsch/crowd-funding', 'id': 'cb6f7ba8955090b54910d0e5b7ecbb22591944f0', 'size': '2100', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'pages/actions.en.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '566'}, {'name': 'CSS', 'bytes': '374631'}, {'name': 'HTML', 'bytes': '168077'}, {'name': 'JavaScript', 'bytes': '250532'}, {'name': 'Ruby', 'bytes': '4496'}]} |
package com.example.zs.floatwindowdemo;
import android.app.ActivityManager;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Handler;
import android.os.IBinder;
import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
/**
* Created by zs on 2015/9/14.
*/
public class FloatWindowService extends Service {
private Handler handler = new Handler();
private Timer timer;
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if (timer == null) {
timer = new Timer();
timer.scheduleAtFixedRate(new RefreshTask(), 0, 500);
}
return super.onStartCommand(intent, flags, startId);
}
/**
* ¶¨Ê±ÈÎÎñ
*/
class RefreshTask extends TimerTask {
@Override
public void run() {
if(isHome() && !MyWindowManager.isWindowShowing()){
handler.post(new Runnable() {
@Override
public void run() {
MyWindowManager.createSmallFloatWindow(getApplicationContext());
}
});
}else if(!isHome() && MyWindowManager.isWindowShowing()){
handler.post(new Runnable() {
@Override
public void run() {
MyWindowManager.removeSmallWindow(getApplicationContext());
MyWindowManager.removeBigWindow(getApplicationContext());
}
});
}else if(isHome() && MyWindowManager.isWindowShowing()){
handler.post(new Runnable() {
@Override
public void run() {
MyWindowManager.updateUsedMemory(getApplicationContext());
}
});
}
}
}
/**
* »ñÈ¡ËùÓеÄ×ÀÃæÓ¦ÓÃ
*/
private List<String> getHomes(){
List<String> names = new ArrayList<>();
PackageManager packageManager = getPackageManager();
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
List<ResolveInfo> resolveInfo = packageManager.queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);
for(ResolveInfo info : resolveInfo){
names.add(info.activityInfo.packageName);
}
return names;
}
/**
* ÅжÏÊÇÊÇÔÚ×ÀÃæ
*/
private boolean isHome(){
ActivityManager manager = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningTaskInfo> tasks = manager.getRunningTasks(1);
return getHomes().contains(tasks.get(0).topActivity.getPackageName());
}
@Override
public void onDestroy(){
if(timer != null){
timer.cancel();
timer = null;
}
}
}
| {'content_hash': '280912a2baf4c61b7369224e0623fb07', 'timestamp': '', 'source': 'github', 'line_count': 103, 'max_line_length': 94, 'avg_line_length': 30.553398058252426, 'alnum_prop': 0.5808706704798221, 'repo_name': 'e442373731/FloatWindow', 'id': '2ba0b38fff0e64263d0d7b39de36c1596581c244', 'size': '3147', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/java/com/example/zs/floatwindowdemo/FloatWindowService.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '15408'}]} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel</groupId>
<artifactId>platforms</artifactId>
<version>2.19.0-SNAPSHOT</version>
</parent>
<artifactId>camel-catalog-lucene</artifactId>
<packaging>jar</packaging>
<name>Camel :: Platforms :: Catalog :: Lucene</name>
<description>Camel Catalog Lucene</description>
<properties>
<camel.osgi.export.pkg>
org.apache.camel.catalog.lucene
</camel.osgi.export.pkg>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-catalog</artifactId>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-suggest</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!-- logging -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
| {'content_hash': 'c2652c1ce55f23bedf592b686844185b', 'timestamp': '', 'source': 'github', 'line_count': 91, 'max_line_length': 201, 'avg_line_length': 30.75824175824176, 'alnum_prop': 0.6780993211861379, 'repo_name': 'sirlatrom/camel', 'id': '026cba76dc6f82029b1ce3f8795be83931e3c9b9', 'size': '2799', 'binary': False, 'copies': '10', 'ref': 'refs/heads/master', 'path': 'platforms/catalog-lucene/pom.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '106'}, {'name': 'CSS', 'bytes': '30373'}, {'name': 'Elm', 'bytes': '10852'}, {'name': 'FreeMarker', 'bytes': '11410'}, {'name': 'Groovy', 'bytes': '53445'}, {'name': 'HTML', 'bytes': '178754'}, {'name': 'Java', 'bytes': '56215538'}, {'name': 'JavaScript', 'bytes': '90232'}, {'name': 'Protocol Buffer', 'bytes': '578'}, {'name': 'Python', 'bytes': '36'}, {'name': 'Ruby', 'bytes': '4802'}, {'name': 'Scala', 'bytes': '323343'}, {'name': 'Shell', 'bytes': '16236'}, {'name': 'Tcl', 'bytes': '4974'}, {'name': 'XQuery', 'bytes': '546'}, {'name': 'XSLT', 'bytes': '284394'}]} |
using System;
using System.Linq;
using System.Web.UI.WebControls;
using System.Data;
using Aspose.Words;
namespace Aspose.DotNetNuke.Modules.DNNQuoteGenerator
{
public class QuoteGenerator
{
public static void Run()
{
try
{
}
catch (Exception exc)
{
throw exc;
}
}
// Populate the VAT drop down list.
public static void PopulateVATDropdownList(ref DropDownList ddlVAT, System.Web.SessionState.HttpSessionState currentSession)
{
try
{
// If the session already contains the list items, then there is no need to execute loop and items.
if (currentSession["VATListItems"] != null)
{
// Extract items from session.
ddlVAT.Items.AddRange(((ListItemCollection)currentSession["VATListItems"]).Cast<System.Web.UI.WebControls.ListItem>().ToArray());
}
else
{
// Creating items for VAT percentage from 1 to 20 with decimal places 1 to 9.
// In this way, we will have items like (e.g 1%, 1.1%, 1.2%.........19.9%, 20%).
// This is the outer loop for items #1 to #20.
for (int i = 0; i < 20; i++)
{
// Inner loop to create decimal items 1 to 9 for each outer loop value.
for (int j = 0; j < 10; j++)
{
// NOTE: (j == 0 ? "" : "." + j.ToString()) skip and allow to add start value.
ddlVAT.Items.Add(new ListItem(i.ToString() + (j == 0 ? "" : "." + j.ToString()) + "%", i.ToString() + (j == 0 ? "" : "." + j.ToString())));
}
}
// Adding last item as loops created max 19.9% item.
ddlVAT.Items.Add(new ListItem("20%", "20"));
// Adding list items to session, caching it to re-use.
currentSession["VATListItems"] = ddlVAT.Items;
}
}
catch (Exception exc)
{
throw exc;
}
}
public static DataSet GetDataSetForGridView(System.Web.SessionState.HttpSessionState currentSession)
{
try
{
// If the session already contains the table, then we can return a DataSet straight away.
if (currentSession["ProductTable"] != null)
{
// Extract from session.
return (DataSet)currentSession["ProductTable"];
}
else
{
// Create a new DataSet and DataTable objects to be used for mail merge.
DataSet data = new DataSet();
DataTable productTable = new DataTable("Products");
// Add columns for the productTable table.
productTable.Columns.Add("ProductId");
productTable.Columns.Add("ProductDescription");
productTable.Columns.Add("Price");
productTable.Columns.Add("Quantity");
productTable.Columns.Add("TotalBeforVAT");
productTable.Columns.Add("VATPercent");
productTable.Columns.Add("VATAmount");
productTable.Columns.Add("TotalAmount");
// Include the tables in the DataSet.
data.Tables.Add(productTable);
// Adding DataSet to session, caching it to re-use.
currentSession["ProductTable"] = data;
return data;
}
}
catch (Exception exc)
{
throw exc;
}
}
public static Document GetUnmergedTemplateObject(string templatePath, System.Web.SessionState.HttpSessionState currentSession)
{
try
{
Document doc = new Document(templatePath);
return doc;
// If the session already contains the list items, then there is no need to execute loop and items.
if (currentSession["TemplateObject"] != null)
{
// Extract from session.
doc = (Document)currentSession["TemplateObject"];
// If there are multiple templates and need to cache and use then must verify what session exactly have in.
if (templatePath.Contains(doc.OriginalFileName))
{
return doc;
}
else
{
// Create a new document object with un-merged template file, caching it to re-use.
doc = new Document(templatePath);
// Add template object to session.
currentSession["TemplateObject"] = doc;
return doc;
}
}
else
{
// Create a new document object with un-merged template file, caching it to re-use.
doc = new Document(templatePath);
// Add template object to session.
currentSession["TemplateObject"] = doc;
return doc;
}
}
catch (Exception exc)
{
throw exc;
}
}
// Get file extensions for supported file save formats.
public static string GetSaveFormat(string format)
{
try
{
string saveOption = SaveFormat.Pdf.ToString();
switch (format)
{
case "Pdf":
saveOption = SaveFormat.Pdf.ToString(); break;
case "Doc":
saveOption = SaveFormat.Doc.ToString(); break;
case "Docx":
saveOption = SaveFormat.Docx.ToString(); break;
case "Odt":
saveOption = SaveFormat.Odt.ToString(); break;
case "Xps":
saveOption = SaveFormat.Xps.ToString(); break;
case "Tiff":
saveOption = SaveFormat.Tiff.ToString(); break;
case "Png":
saveOption = SaveFormat.Png.ToString(); break;
case "Jpeg":
saveOption = SaveFormat.Jpeg.ToString(); break;
// Check the "SaveFormat" property for more supported file formats.
}
return saveOption;
}
catch (Exception exc)
{
throw exc;
}
}
}
} | {'content_hash': '8cc8515a377228d4359715d3c7aa74e5', 'timestamp': '', 'source': 'github', 'line_count': 183, 'max_line_length': 167, 'avg_line_length': 39.743169398907106, 'alnum_prop': 0.45139557266602504, 'repo_name': 'aspose-words/Aspose.Words-for-.NET', 'id': '05e3cabdb31d3a14ad4c29df75b5b2c0fa8630c3', 'size': '7275', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Plugins/DotNetNuke/Aspose.DNN.QuoteGenerator.Words/Library/QuoteGenerator.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP.NET', 'bytes': '113189'}, {'name': 'C#', 'bytes': '935653'}, {'name': 'CSS', 'bytes': '20447'}, {'name': 'HTML', 'bytes': '200130'}, {'name': 'JavaScript', 'bytes': '179162'}, {'name': 'PHP', 'bytes': '4795'}, {'name': 'Rich Text Format', 'bytes': '15884'}]} |
FROM debian:buster
ARG user
ARG group
ARG EMSCRIPTEN_VERSION=1.39.15
ARG EMSDK_CHANGESET=master
ENV EMSDK /emsdk
ENV EM_DATA ${EMSDK}/.data
ENV EM_CONFIG ${EMSDK}/.emscripten
ENV EM_CACHE ${EM_DATA}/cache
ENV EM_PORTS ${EM_DATA}/ports
ENV EMCC_SKIP_SANITY_CHECK 1
# Install development tools.
RUN set -e -x ;\
apt-get update && \
apt-get install -y \
libxml2 \
wget \
git-core \
ca-certificates \
build-essential \
file \
python python-pip \
python3 python3-pip \
cmake \
libunwind-dev \
golang \
&& \
apt-get clean && \
pip2 install jinja2 && \
echo ". /etc/bash_completion" >> /root/.bashrc
# Get EMSDK.
RUN set -e -x ;\
git clone https://github.com/emscripten-core/emsdk.git ${EMSDK} && \
cd ${EMSDK} && git reset --hard ${EMSDK_CHANGESET} && \
./emsdk.py update-tags
# Install Emscripten.
RUN set -e -x ;\
cd ${EMSDK} && \
./emsdk install ${EMSCRIPTEN_VERSION}
# This generates configuration that contains all valid paths according to installed SDK
RUN set -e -x ;\
cd ${EMSDK} && \
echo "## Generate standard configuration" && \
\
./emsdk activate ${EMSCRIPTEN_VERSION} --embedded && \
./emsdk construct_env > /dev/null && \
cat ${EMSDK}/emsdk_set_env.sh && \
\
# remove wrongly created entry with EM_CACHE, variable will be picked up from ENV
sed -i -e "/EM_CACHE/d" ${EMSDK}/emsdk_set_env.sh && \
# add a link to tools like asm2wasm in a system path
# asm2wasm (and friends might be places either in ./upstream of ./fastcomp folder, hence detection is needed)
printf "export PATH=$(dirname $(find . -name asm2wasm -exec readlink -f {} +)):\$PATH\n" >> ${EMSDK}/emsdk_set_env.sh
# Create a structure and make mutable folders accessible for r/w
RUN set -e -x ;\
cd ${EMSDK} && \
echo "## Create .data structure" && \
for mutable_dir in ${EM_DATA} ${EM_PORTS} ${EM_CACHE} ${EMSDK}/zips ${EMSDK}/tmp; do \
mkdir -p ${mutable_dir}; \
chmod -R 777 ${mutable_dir}; \
done
# Create symbolic links for critical Emscripten Tools
# This is important for letting people using Emscripten in Dockerfiles without activation
# As each Emscripten release is placed to a different folder (i.e. /emsdk/emscripten/tag-1.38.31)
RUN set -e -x ;\
. ${EMSDK}/emsdk_set_env.sh && \
\
mkdir -p ${EMSDK}/llvm ${EMSDK}/emscripten ${EMSDK}/binaryen && \
\
ln -s $(dirname $(which node))/.. ${EMSDK}/node/current && \
ln -s $(dirname $(which clang))/.. ${EMSDK}/llvm/clang && \
ln -s $(dirname $(which emcc)) ${EMSDK}/emscripten/sdk && \
\
ln -s $(dirname $(which asm2wasm)) ${EMSDK}/binaryen/bin
# Expose Major tools to system PATH, so that emcc, node, asm2wasm etc can be used without activation
ENV PATH="${EMSDK}:${EMSDK}/emscripten/sdk:${EMSDK}/llvm/clang/bin:${EMSDK}/node/current/bin:${EMSDK}/binaryen/bin:${PATH}"
RUN groupadd -g $group builder \
&& useradd -u $user -g $group builder \
&& mkdir -p /home/builder \
&& chown -R builder:builder /home/builder
USER builder
WORKDIR /home/builder
# Default command to run if not specified otherwise.
CMD ["/bin/bash"]
| {'content_hash': '35acf2f8fed2e2b4a6b1ec56f66fb1de', 'timestamp': '', 'source': 'github', 'line_count': 98, 'max_line_length': 123, 'avg_line_length': 33.13265306122449, 'alnum_prop': 0.6264243917462273, 'repo_name': 'google/tpm-js', 'id': '66144d1c45406dd90e2db64283801527efa476a8', 'size': '3247', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Dockerfile', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C++', 'bytes': '136205'}, {'name': 'CMake', 'bytes': '7471'}, {'name': 'CSS', 'bytes': '1554'}, {'name': 'Dockerfile', 'bytes': '3247'}, {'name': 'HTML', 'bytes': '107398'}, {'name': 'JavaScript', 'bytes': '41625'}, {'name': 'Python', 'bytes': '1206'}, {'name': 'Shell', 'bytes': '756'}]} |
package com.lozasolutions.evernoteclient.injection.component;
import android.app.Application;
import android.content.Context;
import com.lozasolutions.evernoteclient.data.remote.EvernoteAPI;
import com.lozasolutions.evernoteclient.features.ocr.OCRManager;
import com.lozasolutions.evernoteclient.injection.ApplicationContext;
import com.lozasolutions.evernoteclient.injection.module.AppModule;
import com.snatik.storage.Storage;
import javax.inject.Singleton;
import dagger.Component;
@Singleton
@Component(modules = AppModule.class)
public interface AppComponent {
@ApplicationContext
Context context();
Application application();
EvernoteAPI evernoteAPI();
OCRManager ocrManager();
Storage storage();
}
| {'content_hash': 'd58d56ea61566cd5510654d13c3b3ac6', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 69, 'avg_line_length': 23.870967741935484, 'alnum_prop': 0.8081081081081081, 'repo_name': 'elloza/evernote-client', 'id': '676dcc034748c155bb2a25336e727875e564ea17', 'size': '740', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'evernoteclient/app/src/main/java/com/lozasolutions/evernoteclient/injection/component/AppComponent.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '139921'}]} |
<?php
/*
Safe sample
input : get the field UserData from the variable $_POST
sanitize : check if there is only letters and/or numbers
construction : use of sprintf via a %s with simple quote
*/
/*Copyright 2015 Bertrand STIVALET
Permission is hereby granted, without written agreement or royalty fee, to
use, copy, modify, and distribute this software and its documentation for
any purpose, provided that the above copyright notice and the following
three paragraphs appear in all copies of this software.
IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT
LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO
OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.*/
$tainted = $_POST['UserData'];
$re = "/^[a-zA-Z0-9]*$/";
if(preg_match($re, $tainted) == 1){
$tainted = $tainted;
}
else{
$tainted = "";
}
$query = sprintf("(&(objectCategory=person)(objectClass=user)(mail='%s'))", $tainted);
$ds=ldap_connect("localhost");
$r=ldap_bind($ds);
$sr=ldap_search($ds,"o=My Company, c=US", $query);
ldap_close($ds);
?> | {'content_hash': '398caf27da3f42677039e1abce6a7d77', 'timestamp': '', 'source': 'github', 'line_count': 62, 'max_line_length': 86, 'avg_line_length': 23.596774193548388, 'alnum_prop': 0.7382091592617909, 'repo_name': 'stivalet/PHP-Vulnerability-test-suite', 'id': 'ca563b94fdbc549ea9a66dc7dd740ca3590b677f', 'size': '1463', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Injection/CWE_90/safe/CWE_90__POST__func_preg_match-letters_numbers__userByMail-sprintf_%s_simple_quote.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '64184004'}]} |
use hyper::Response;
use hyper::header::SetCookie;
use model::entity::User;
pub struct ResponseContext
{
pub response: Response,
pub user: Option<User>,
pub clean_user: bool
}
impl ResponseContext
{
pub fn from_response(response: Response) -> Self
{
ResponseContext {
response,
user: None,
clean_user: false
}
}
pub fn set_cookie(&mut self, cookie: String)
{
let headers = self.response.headers_mut();
let need_set_cookie_opt = match headers.get_mut() {
Some(&mut SetCookie(ref mut content)) => {
content.push(cookie);
None
},
_ => Some(SetCookie(vec![cookie]))
};
if let Some(set_cookie) = need_set_cookie_opt {
headers.set(set_cookie);
}
}
} | {'content_hash': '21f3b0a3ae9a598db985a0733487e5cb', 'timestamp': '', 'source': 'github', 'line_count': 39, 'max_line_length': 59, 'avg_line_length': 21.94871794871795, 'alnum_prop': 0.5385514018691588, 'repo_name': 'flexap/flexap', 'id': 'a48bcec174caa4743cf76ae3324a4cff29d69fff', 'size': '856', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/controller/context/response.rs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '693'}, {'name': 'HTML', 'bytes': '5732'}, {'name': 'Rust', 'bytes': '36083'}]} |
class I2p < Formula
desc "Anonymous overlay network - a network within a network"
homepage "https://geti2p.net"
url "https://files.i2p-projekt.de/1.9.0/i2psource_1.9.0.tar.bz2"
sha256 "57f61815098c35593d7ede305f98b9015c4c613c72231ad084e6806a3e2aa371"
license :cannot_represent
livecheck do
url "https://geti2p.net/en/download"
regex(/href=.*?i2pinstall[._-]v?(\d+(?:\.\d+)+)\.jar/i)
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "ebb408953a0e87c23a9cb838bf833a96c3afdc2313036e2520dbbf2bbbd287dc"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "24830afa2fe1094e634033d61bb38082cd70807498b096a03a9d5fb5b71447c2"
sha256 cellar: :any_skip_relocation, monterey: "75ad64bb78affab0ec5b4fe2290be379c5f5eec646fc4131415dfacc1e9b2797"
sha256 cellar: :any_skip_relocation, big_sur: "e4605f09824480a90857b4ae2a024454a77d693143914a70df7605ed072e8029"
sha256 cellar: :any_skip_relocation, catalina: "0f1ecc018b386c097e962716ce5c9a7142b5f5d10a99c4ddde2de4b91d2235ab"
sha256 cellar: :any_skip_relocation, x86_64_linux: "5b174754721de5e5cbd0d8070764cc2b7e8f59ebe19911288c99398668f0c5b7"
end
depends_on "ant" => :build
depends_on "gettext" => :build
depends_on "java-service-wrapper"
depends_on "openjdk"
def install
ENV["JAVA_HOME"] = Formula["openjdk"].opt_prefix
os = OS.mac? ? "osx" : OS.kernel_name.downcase
system "ant", "preppkg-#{os}-only"
libexec.install (buildpath/"pkg-temp").children
# Replace vendored copy of java-service-wrapper with brewed version.
rm libexec/"lib/wrapper.jar"
rm_rf libexec/"lib/wrapper"
jsw_libexec = Formula["java-service-wrapper"].opt_libexec
ln_s jsw_libexec/"lib/wrapper.jar", libexec/"lib"
ln_s jsw_libexec/"lib/#{shared_library("libwrapper")}", libexec/"lib"
cp jsw_libexec/"bin/wrapper", libexec/"i2psvc" # Binary must be copied, not symlinked.
# Set executable permissions on scripts
scripts = ["eepget", "i2prouter", "runplain.sh"]
scripts += ["install_i2p_service_osx.command", "uninstall_i2p_service_osx.command"] if OS.mac?
scripts.each do |file|
chmod 0755, libexec/file
end
# Replace references to INSTALL_PATH with libexec
install_path_files = ["eepget", "i2prouter", "runplain.sh"]
install_path_files << "Start I2P Router.app/Contents/MacOS/i2prouter" if OS.mac?
install_path_files.each do |file|
inreplace libexec/file, "%INSTALL_PATH", libexec
end
inreplace libexec/"wrapper.config", "$INSTALL_PATH", libexec
# Wrap eepget and i2prouter in env scripts so they can find OpenJDK
(bin/"eepget").write_env_script libexec/"eepget", JAVA_HOME: Formula["openjdk"].opt_prefix
(bin/"i2prouter").write_env_script libexec/"i2prouter", JAVA_HOME: Formula["openjdk"].opt_prefix
man1.install Dir["#{libexec}/man/*"]
end
test do
assert_match "I2P Service is not running.", shell_output("#{bin}/i2prouter status", 1)
end
end
| {'content_hash': 'c8ab14324eb13ceb04df995bb783c71b', 'timestamp': '', 'source': 'github', 'line_count': 68, 'max_line_length': 123, 'avg_line_length': 43.955882352941174, 'alnum_prop': 0.7206423553027769, 'repo_name': 'sjackman/homebrew-core', 'id': '4e153351206d69b6a65681c437d15fe0856539f1', 'size': '2989', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'Formula/i2p.rb', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'Perl', 'bytes': '740'}, {'name': 'Ruby', 'bytes': '14926632'}]} |
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.Collections.Immutable
Imports System.Diagnostics
Imports System.Runtime.InteropServices
Imports Microsoft.CodeAnalysis.PooledObjects
Imports Microsoft.CodeAnalysis.Text
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Imports Microsoft.CodeAnalysis.VisualBasic.Syntax
Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Namespace Microsoft.CodeAnalysis.VisualBasic
Partial Friend NotInheritable Class LocalRewriter
Public Overrides Function VisitCall(node As BoundCall) As BoundNode
Debug.Assert(Not node.IsConstant, "Constant calls should become literals by now")
Dim receiver As BoundExpression = node.ReceiverOpt
Dim method As MethodSymbol = node.Method
Dim arguments As ImmutableArray(Of BoundExpression) = node.Arguments
' Replace a call to AscW(<non constant char>) with a conversion, this makes sure we don't have a recursion inside AscW(Char).
If method Is Compilation.GetWellKnownTypeMember(WellKnownMember.Microsoft_VisualBasic_Strings__AscWCharInt32) Then
Return New BoundConversion(node.Syntax,
VisitExpressionNode(arguments(0)),
ConversionKind.WideningNumeric,
checked:=False,
explicitCastInCode:=True,
type:=node.Type)
End If
' Code below is for remapping of versioned functions.
'
' Code compiled with VS7.1 or earlier must run on VS8.0 with no behavior changes.
' However, since VS8.0 introduces several new features which change the behavior of
' Public functions, we introduce the new behavior in a new function and map references
' to the old function onto the new function. In this way, old code continues to run and
' new code gets the new behavior, but the Public function doesn't change at all, from the
' user's point of view.
' Example:
'
' Given:
' 1. User code snippet: "If IsNumeric(something) Then ..."
' 2. Public Function IsNumeric(o), has VS7.1 behavior.
' 3. Public Function Versioned.IsNumeric(o), has VS8.0 behavior.
'
' When compiled in VS7.1, the compiler binds to IsNumeric(o).
' When compiled in VS8.0, the compiler first binds to IsNumeric(o) and then remaps
' this binding to Versioned.IsNumeric(o) in the code generator so that the VS8.0
' behavior is selected.
'
Dim remappedMethodId As WellKnownMember = WellKnownMember.Count
If method Is Compilation.GetWellKnownTypeMember(WellKnownMember.Microsoft_VisualBasic_Interaction__CallByName) Then
remappedMethodId = WellKnownMember.Microsoft_VisualBasic_CompilerServices_Versioned__CallByName
ElseIf method.ContainingSymbol Is Compilation.GetWellKnownType(WellKnownType.Microsoft_VisualBasic_Information) Then
If method Is Compilation.GetWellKnownTypeMember(WellKnownMember.Microsoft_VisualBasic_Information__IsNumeric) Then
remappedMethodId = WellKnownMember.Microsoft_VisualBasic_CompilerServices_Versioned__IsNumeric
ElseIf method Is Compilation.GetWellKnownTypeMember(WellKnownMember.Microsoft_VisualBasic_Information__SystemTypeName) Then
remappedMethodId = WellKnownMember.Microsoft_VisualBasic_CompilerServices_Versioned__SystemTypeName
ElseIf method Is Compilation.GetWellKnownTypeMember(WellKnownMember.Microsoft_VisualBasic_Information__TypeName) Then
remappedMethodId = WellKnownMember.Microsoft_VisualBasic_CompilerServices_Versioned__TypeName
ElseIf method Is Compilation.GetWellKnownTypeMember(WellKnownMember.Microsoft_VisualBasic_Information__VbTypeName) Then
remappedMethodId = WellKnownMember.Microsoft_VisualBasic_CompilerServices_Versioned__VbTypeName
End If
End If
If remappedMethodId <> WellKnownMember.Count Then
Dim remappedMethod = DirectCast(Compilation.GetWellKnownTypeMember(remappedMethodId), MethodSymbol)
If remappedMethod IsNot Nothing AndAlso Not ReportMissingOrBadRuntimeHelper(node, remappedMethodId, remappedMethod) Then
method = remappedMethod
End If
End If
UpdateMethodAndArgumentsIfReducedFromMethod(method, receiver, arguments)
Dim temporaries As ImmutableArray(Of SynthesizedLocal) = Nothing
Dim copyBack As ImmutableArray(Of BoundExpression) = Nothing
Dim suppressObjectClone As Boolean = node.SuppressObjectClone OrElse
method Is Compilation.GetWellKnownTypeMember(
WellKnownMember.System_Runtime_CompilerServices_RuntimeHelpers__GetObjectValueObject)
receiver = VisitExpressionNode(receiver)
node = node.Update(method,
Nothing,
receiver,
RewriteCallArguments(arguments, method.Parameters, temporaries, copyBack, suppressObjectClone),
node.DefaultArguments,
Nothing,
isLValue:=node.IsLValue,
suppressObjectClone:=True,
type:=node.Type)
If Not copyBack.IsDefault Then
Return GenerateSequenceValueSideEffects(_currentMethodOrLambda, node, StaticCast(Of LocalSymbol).From(temporaries), copyBack)
End If
If Not temporaries.IsDefault Then
If method.IsSub Then
Return New BoundSequence(node.Syntax,
StaticCast(Of LocalSymbol).From(temporaries),
ImmutableArray.Create(Of BoundExpression)(node),
Nothing,
node.Type)
Else
Return New BoundSequence(node.Syntax,
StaticCast(Of LocalSymbol).From(temporaries),
ImmutableArray(Of BoundExpression).Empty,
node,
node.Type)
End If
End If
Return node
End Function
Private Shared Sub UpdateMethodAndArgumentsIfReducedFromMethod(
ByRef method As MethodSymbol,
ByRef receiver As BoundExpression,
ByRef arguments As ImmutableArray(Of BoundExpression))
If receiver Is Nothing Then
Return
End If
Dim reducedFrom As MethodSymbol = method.CallsiteReducedFromMethod
If reducedFrom Is Nothing Then
Return
End If
' This is an extension method call
If arguments.IsEmpty Then
arguments = ImmutableArray.Create(Of BoundExpression)(receiver)
Else
Dim array(arguments.Length) As BoundExpression
array(0) = receiver
arguments.CopyTo(array, 1)
arguments = array.AsImmutableOrNull()
End If
receiver = Nothing
method = reducedFrom
End Sub
Public Overrides Function VisitByRefArgumentWithCopyBack(node As BoundByRefArgumentWithCopyBack) As BoundNode
Throw ExceptionUtilities.Unreachable
End Function
Private Function RewriteCallArguments(
arguments As ImmutableArray(Of BoundExpression),
parameters As ImmutableArray(Of ParameterSymbol),
<Out()> ByRef temporaries As ImmutableArray(Of SynthesizedLocal),
<Out()> ByRef copyBack As ImmutableArray(Of BoundExpression),
suppressObjectClone As Boolean
) As ImmutableArray(Of BoundExpression)
temporaries = Nothing
copyBack = Nothing
If arguments.IsEmpty Then
Return arguments
End If
Dim tempsArray As ArrayBuilder(Of SynthesizedLocal) = Nothing
Dim copyBackArray As ArrayBuilder(Of BoundExpression) = Nothing
Dim rewrittenArgs = ArrayBuilder(Of BoundExpression).GetInstance
Dim changed As Boolean = False
Dim paramIdx = 0
For Each argument In arguments
Dim rewritten As BoundExpression
If argument.Kind = BoundKind.ByRefArgumentWithCopyBack Then
rewritten = RewriteByRefArgumentWithCopyBack(DirectCast(argument, BoundByRefArgumentWithCopyBack), tempsArray, copyBackArray)
Else
rewritten = VisitExpressionNode(argument)
If parameters(paramIdx).IsByRef AndAlso Not argument.IsLValue AndAlso Not _inExpressionLambda Then
rewritten = PassArgAsTempClone(argument, rewritten, tempsArray)
End If
End If
If Not suppressObjectClone AndAlso (Not parameters(paramIdx).IsByRef OrElse Not rewritten.IsLValue) Then
rewritten = GenerateObjectCloneIfNeeded(argument, rewritten)
End If
If rewritten IsNot argument Then
changed = True
End If
rewrittenArgs.Add(rewritten)
paramIdx += 1
Next
Debug.Assert(temporaries.IsDefault OrElse changed)
If changed Then
arguments = rewrittenArgs.ToImmutable()
End If
rewrittenArgs.Free()
If tempsArray IsNot Nothing Then
temporaries = tempsArray.ToImmutableAndFree()
End If
If copyBackArray IsNot Nothing Then
' It might feel strange, but Dev11 evaluates copy-back assignments in reverse order (from last argument to the first),
' which is observable. Doing the same thing.
copyBackArray.ReverseContents()
copyBack = copyBackArray.ToImmutableAndFree()
End If
Return arguments
End Function
Private Function PassArgAsTempClone(
argument As BoundExpression,
rewrittenArgument As BoundExpression,
ByRef tempsArray As ArrayBuilder(Of SynthesizedLocal)
) As BoundExpression
' Need to allocate a temp of the target type,
' init it with argument's value,
' pass it ByRef
If tempsArray Is Nothing Then
tempsArray = ArrayBuilder(Of SynthesizedLocal).GetInstance()
End If
Dim temp = New SynthesizedLocal(Me._currentMethodOrLambda, rewrittenArgument.Type, SynthesizedLocalKind.LoweringTemp)
tempsArray.Add(temp)
Dim boundTemp = New BoundLocal(rewrittenArgument.Syntax, temp, temp.Type)
Dim storeVal As BoundExpression = New BoundAssignmentOperator(rewrittenArgument.Syntax,
boundTemp,
GenerateObjectCloneIfNeeded(argument, rewrittenArgument),
True,
rewrittenArgument.Type)
Return New BoundSequence(rewrittenArgument.Syntax, ImmutableArray(Of LocalSymbol).Empty, ImmutableArray.Create(storeVal), boundTemp, rewrittenArgument.Type)
End Function
Private Function RewriteByRefArgumentWithCopyBack(
argument As BoundByRefArgumentWithCopyBack,
ByRef tempsArray As ArrayBuilder(Of SynthesizedLocal),
ByRef copyBackArray As ArrayBuilder(Of BoundExpression)
) As BoundExpression
' Need to allocate a temp of the target type,
' init it with argument's value,
' pass it ByRef,
' copy value back after the call.
Dim originalArgument As BoundExpression = argument.OriginalArgument
If originalArgument.IsPropertyOrXmlPropertyAccess Then
Debug.Assert(originalArgument.GetAccessKind() = If(
originalArgument.IsPropertyReturnsByRef(),
PropertyAccessKind.Get,
PropertyAccessKind.Get Or PropertyAccessKind.Set))
originalArgument = originalArgument.SetAccessKind(PropertyAccessKind.Unknown)
ElseIf originalArgument.IsLateBound() Then
Debug.Assert(originalArgument.GetLateBoundAccessKind() = (LateBoundAccessKind.Get Or LateBoundAccessKind.Set))
originalArgument = originalArgument.SetLateBoundAccessKind(LateBoundAccessKind.Unknown)
End If
If _inExpressionLambda Then
If originalArgument.IsPropertyOrXmlPropertyAccess Then
Debug.Assert(originalArgument.GetAccessKind() = PropertyAccessKind.Unknown)
originalArgument = originalArgument.SetAccessKind(PropertyAccessKind.Get)
ElseIf originalArgument.IsLateBound() Then
Debug.Assert(originalArgument.GetLateBoundAccessKind() = LateBoundAccessKind.Unknown)
originalArgument = originalArgument.SetLateBoundAccessKind(LateBoundAccessKind.Get)
End If
If originalArgument.IsLValue Then
originalArgument = originalArgument.MakeRValue
End If
AddPlaceholderReplacement(argument.InPlaceholder, VisitExpressionNode(originalArgument))
Dim rewrittenArgumentInConversion As BoundExpression = VisitExpression(argument.InConversion)
RemovePlaceholderReplacement(argument.InPlaceholder)
Return rewrittenArgumentInConversion
End If
If tempsArray Is Nothing Then
tempsArray = ArrayBuilder(Of SynthesizedLocal).GetInstance()
End If
If copyBackArray Is Nothing Then
copyBackArray = ArrayBuilder(Of BoundExpression).GetInstance()
End If
Dim firstUse As BoundExpression
Dim secondUse As BoundExpression
Dim useTwice As UseTwiceRewriter.Result = UseTwiceRewriter.UseTwice(Me._currentMethodOrLambda, originalArgument, tempsArray)
If originalArgument.IsPropertyOrXmlPropertyAccess Then
firstUse = useTwice.First.SetAccessKind(PropertyAccessKind.Get).MakeRValue()
secondUse = useTwice.Second.SetAccessKind(If(originalArgument.IsPropertyReturnsByRef(), PropertyAccessKind.Get, PropertyAccessKind.Set))
ElseIf originalArgument.IsLateBound() Then
firstUse = useTwice.First.SetLateBoundAccessKind(LateBoundAccessKind.Get)
secondUse = useTwice.Second.SetLateBoundAccessKind(LateBoundAccessKind.Set)
Else
firstUse = useTwice.First.MakeRValue()
secondUse = useTwice.Second
Debug.Assert(secondUse.IsLValue)
End If
AddPlaceholderReplacement(argument.InPlaceholder, VisitExpressionNode(firstUse))
Dim inputValue As BoundExpression = VisitAndGenerateObjectCloneIfNeeded(argument.InConversion)
RemovePlaceholderReplacement(argument.InPlaceholder)
Dim temp = New SynthesizedLocal(Me._currentMethodOrLambda, argument.Type, SynthesizedLocalKind.LoweringTemp)
tempsArray.Add(temp)
Dim boundTemp = New BoundLocal(argument.Syntax, temp, temp.Type)
Dim storeVal As BoundExpression = New BoundAssignmentOperator(argument.Syntax, boundTemp, inputValue, True, argument.Type)
AddPlaceholderReplacement(argument.OutPlaceholder, boundTemp.MakeRValue())
Dim copyBack As BoundExpression
If Not originalArgument.IsLateBound() Then
copyBack = DirectCast(
VisitAssignmentOperator(New BoundAssignmentOperator(argument.Syntax, secondUse, argument.OutConversion, False)),
BoundExpression)
RemovePlaceholderReplacement(argument.OutPlaceholder)
Else
Dim copyBackValue As BoundExpression = VisitExpressionNode(argument.OutConversion)
RemovePlaceholderReplacement(argument.OutPlaceholder)
If secondUse.Kind = BoundKind.LateMemberAccess Then
' Method(ref objExpr.goo)
copyBack = LateSet(secondUse.Syntax,
DirectCast(MyBase.VisitLateMemberAccess(DirectCast(secondUse, BoundLateMemberAccess)), BoundLateMemberAccess),
copyBackValue,
Nothing,
Nothing,
isCopyBack:=True)
Else
Dim invocation = DirectCast(secondUse, BoundLateInvocation)
If invocation.Member.Kind = BoundKind.LateMemberAccess Then
' Method(ref objExpr.goo(args))
copyBack = LateSet(invocation.Syntax,
DirectCast(MyBase.VisitLateMemberAccess(DirectCast(invocation.Member, BoundLateMemberAccess)), BoundLateMemberAccess),
copyBackValue,
VisitList(invocation.ArgumentsOpt),
invocation.ArgumentNamesOpt,
isCopyBack:=True)
Else
' Method(ref objExpr(args))
invocation = invocation.Update(VisitExpressionNode(invocation.Member),
VisitList(invocation.ArgumentsOpt),
invocation.ArgumentNamesOpt,
invocation.AccessKind,
invocation.MethodOrPropertyGroupOpt,
invocation.Type)
copyBack = LateIndexSet(invocation.Syntax,
invocation,
copyBackValue,
isCopyBack:=True)
End If
End If
End If
copyBackArray.Add(copyBack)
Return New BoundSequence(argument.Syntax, ImmutableArray(Of LocalSymbol).Empty, ImmutableArray.Create(storeVal), boundTemp, argument.Type)
End Function
End Class
End Namespace
| {'content_hash': 'adc82f91ba4b9b0f98f913fdaef82783', 'timestamp': '', 'source': 'github', 'line_count': 385, 'max_line_length': 168, 'avg_line_length': 50.96623376623376, 'alnum_prop': 0.5991743960860259, 'repo_name': 'jamesqo/roslyn', 'id': 'f1681131fed54a72f5942f12bff8db32cf39c291', 'size': '19624', 'binary': False, 'copies': '15', 'ref': 'refs/heads/master', 'path': 'src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_Call.vb', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': '1C Enterprise', 'bytes': '289100'}, {'name': 'Batchfile', 'bytes': '8971'}, {'name': 'C#', 'bytes': '103668462'}, {'name': 'C++', 'bytes': '5392'}, {'name': 'F#', 'bytes': '421'}, {'name': 'Groovy', 'bytes': '9726'}, {'name': 'PowerShell', 'bytes': '107969'}, {'name': 'Shell', 'bytes': '18058'}, {'name': 'Smalltalk', 'bytes': '373'}, {'name': 'Visual Basic', 'bytes': '75022897'}]} |
package com.iluwatar.reactor.app;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.iluwatar.reactor.framework.AbstractNioChannel;
import com.iluwatar.reactor.framework.ChannelHandler;
import com.iluwatar.reactor.framework.Dispatcher;
import com.iluwatar.reactor.framework.NioDatagramChannel;
import com.iluwatar.reactor.framework.NioReactor;
import com.iluwatar.reactor.framework.NioServerSocketChannel;
import com.iluwatar.reactor.framework.ThreadPoolDispatcher;
/**
* This application demonstrates Reactor pattern. The example demonstrated is a Distributed Logging
* Service where it listens on multiple TCP or UDP sockets for incoming log requests.
*
* <p>
* <i>INTENT</i> <br/>
* The Reactor design pattern handles service requests that are delivered concurrently to an
* application by one or more clients. The application can register specific handlers for processing
* which are called by reactor on specific events.
*
* <p>
* <i>PROBLEM</i> <br/>
* Server applications in a distributed system must handle multiple clients that send them service
* requests. Following forces need to be resolved:
* <ul>
* <li>Availability</li>
* <li>Efficiency</li>
* <li>Programming Simplicity</li>
* <li>Adaptability</li>
* </ul>
*
* <p>
* <i>PARTICIPANTS</i> <br/>
* <ul>
* <li>Synchronous Event De-multiplexer</li> {@link NioReactor} plays the role of synchronous event
* de-multiplexer. It waits for events on multiple channels registered to it in an event loop.
*
* <p>
* <li>Initiation Dispatcher</li> {@link NioReactor} plays this role as the application specific
* {@link ChannelHandler}s are registered to the reactor.
*
* <p>
* <li>Handle</li> {@link AbstractNioChannel} acts as a handle that is registered to the reactor.
* When any events occur on a handle, reactor calls the appropriate handler.
*
* <p>
* <li>Event Handler</li> {@link ChannelHandler} acts as an event handler, which is bound to a
* channel and is called back when any event occurs on any of its associated handles. Application
* logic resides in event handlers.
* </ul>
*
* <p>
* The application utilizes single thread to listen for requests on all ports. It does not create a
* separate thread for each client, which provides better scalability under load (number of clients
* increase).
*
* <p>
* The example uses Java NIO framework to implement the Reactor.
*
*/
public class App {
private NioReactor reactor;
private List<AbstractNioChannel> channels = new ArrayList<>();
private Dispatcher dispatcher;
/**
* Creates an instance of App which will use provided dispatcher for dispatching events on
* reactor.
*
* @param dispatcher the dispatcher that will be used to dispatch events.
*/
public App(Dispatcher dispatcher) {
this.dispatcher = dispatcher;
}
/**
* App entry.
*
* @throws IOException
*/
public static void main(String[] args) throws IOException {
new App(new ThreadPoolDispatcher(2)).start();
}
/**
* Starts the NIO reactor.
*
* @throws IOException if any channel fails to bind.
*/
public void start() throws IOException {
/*
* The application can customize its event dispatching mechanism.
*/
reactor = new NioReactor(dispatcher);
/*
* This represents application specific business logic that dispatcher will call on appropriate
* events. These events are read events in our example.
*/
LoggingHandler loggingHandler = new LoggingHandler();
/*
* Our application binds to multiple channels and uses same logging handler to handle incoming
* log requests.
*/
reactor.registerChannel(tcpChannel(6666, loggingHandler))
.registerChannel(tcpChannel(6667, loggingHandler))
.registerChannel(udpChannel(6668, loggingHandler)).start();
}
/**
* Stops the NIO reactor. This is a blocking call.
*
* @throws InterruptedException if interrupted while stopping the reactor.
* @throws IOException if any I/O error occurs
*/
public void stop() throws InterruptedException, IOException {
reactor.stop();
dispatcher.stop();
for (AbstractNioChannel channel : channels) {
channel.getJavaChannel().close();
}
}
private AbstractNioChannel tcpChannel(int port, ChannelHandler handler) throws IOException {
NioServerSocketChannel channel = new NioServerSocketChannel(port, handler);
channel.bind();
channels.add(channel);
return channel;
}
private AbstractNioChannel udpChannel(int port, ChannelHandler handler) throws IOException {
NioDatagramChannel channel = new NioDatagramChannel(port, handler);
channel.bind();
channels.add(channel);
return channel;
}
}
| {'content_hash': '8e04038639224e4fee73b5f418263f54', 'timestamp': '', 'source': 'github', 'line_count': 143, 'max_line_length': 100, 'avg_line_length': 33.35664335664335, 'alnum_prop': 0.7234800838574423, 'repo_name': 'alreadydead/testo', 'id': '2c49d9001f2375d2260b354f48e907ba3e5a6c15', 'size': '4770', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'reactor/src/main/java/com/iluwatar/reactor/app/App.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '827'}, {'name': 'Cucumber', 'bytes': '1078'}, {'name': 'HTML', 'bytes': '6087'}, {'name': 'Java', 'bytes': '496357'}, {'name': 'JavaScript', 'bytes': '47'}, {'name': 'Shell', 'bytes': '596'}]} |
using System.Resources;
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("Chapter3Samples")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Chapter3Samples")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
// 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': '4c8cbe858ca3e86741352572c7c634c8', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 84, 'avg_line_length': 36.166666666666664, 'alnum_prop': 0.7456221198156682, 'repo_name': 'conceptdev/xamarin-forms-samples', 'id': '187b80269a16d0e9f737456dd047cf0374192a8a', 'size': '1088', 'binary': False, 'copies': '10', 'ref': 'refs/heads/main', 'path': 'TicTacForms/TicTacForms/Properties/AssemblyInfo.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '957005'}, {'name': 'HTML', 'bytes': '5430'}]} |
class Group < ActiveRecord::Base
has_many :memberships
has_many :tasks, :as => :owner
has_many :organizations, :through => :memberships
has_many :users, :through => :memberships
has_many :assignments, :as => :assignable
has_many :roles, :through => :assignments
def self.occupied
mt = Membership.arel_table
group_ids_in_memberships = Membership.where(mt[:user_id].eq(nil).not).map{|m| m.group_id}.reject{|g| g.nil?}.uniq
gt = Group.arel_table
Group.where(gt[:id].in(group_ids_in_memberships))
end
def self.empty
mt = Membership.arel_table
group_ids_in_memberships = Membership.where(mt[:user_id].eq(nil).not).map{|m| m.group_id}.reject{|g| g.nil?}.uniq
gt = Group.arel_table
Group.where(gt[:id].in(group_ids_in_memberships).not)
end
end
| {'content_hash': 'a0826fc0654e39a7b220b5ff22ffd119', 'timestamp': '', 'source': 'github', 'line_count': 23, 'max_line_length': 117, 'avg_line_length': 34.43478260869565, 'alnum_prop': 0.6767676767676768, 'repo_name': 'boberetezeke/open_org_base', 'id': '7df10bfbf3d7ed550e69ef40c5ca6764d4080b58', 'size': '792', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/models/group.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '1282'}, {'name': 'Ruby', 'bytes': '85946'}]} |
{-# LANGUAGE OverloadedStrings #-}
module Turtle.Options.Quality
( optQuality
, defQualityHelp
, quality
) where
import Turtle (ArgName, ShortName, HelpMessage, opt)
import Data.Optional (Optional)
import qualified Turtle
import qualified Data.Text as Text
import Text.Parsec
import Text.ParserCombinators.Parsec.Error (Message(..), newErrorMessage)
import Text.Parsec.Pos (initialPos)
import Turtle.Options.Parsers (Parser, percent, float)
defQualityHelp :: Optional HelpMessage
defQualityHelp = "Quality option. QUALITY can be a percentage (20%) or a keyword: verylow / low / mediumlow / medium / mediumhigh / high / best."
qualitySettings =
[ ("verylow", 0.1)
, ("low", 0.2)
, ("mediumlow", 0.35)
, ("medium", 0.5)
, ("mediumhigh", 0.65)
, ("high", 0.8)
, ("veryhigh", 0.9)
, ("best", 1)
]
keyword :: Parser Float
keyword = do
key <- many1 lower
let q = lookup key qualitySettings
case q of
Nothing -> error ("The keyword '" ++ key ++ "' is not a valid quality setting")
Just v -> return v
quality :: Parser Float
quality = try keyword <|> percent
readQuality :: String -> Maybe Float
readQuality str = case (parse quality "Quality" str) of
Left err -> error $ "Error parsing quality: " ++ (show err)
Right s -> Just s
optQuality :: ArgName -> ShortName -> Optional HelpMessage -> Turtle.Parser Float
optQuality = opt (readQuality . Text.unpack) | {'content_hash': '01f9567641921939598d916d0af66fd7', 'timestamp': '', 'source': 'github', 'line_count': 51, 'max_line_length': 145, 'avg_line_length': 27.352941176470587, 'alnum_prop': 0.6939068100358423, 'repo_name': 'elaye/turtle-options', 'id': '8d8122a5907ab3ea80d510ec7d005dad63ebde6a', 'size': '1395', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Turtle/Options/Quality.hs', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Haskell', 'bytes': '12697'}, {'name': 'Shell', 'bytes': '897'}]} |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="da" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About KaneCoin</source>
<translation>Om KaneCoin</translation>
</message>
<message>
<location line="+39"/>
<source><b>KaneCoin</b> version</source>
<translation><b>KaneCoin</b> version</translation>
</message>
<message>
<location line="+41"/>
<source>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The KaneCoin developers</source>
<translation>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The KaneCoin developers</translation>
</message>
<message>
<location line="+15"/>
<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 ([email protected]) and UPnP software written by Thomas Bernard.</source>
<translation>
Dette program er eksperimentelt.
Det er gjort tilgængeligt under MIT/X11-softwarelicensen. Se den medfølgende fil "COPYING" eller http://www.opensource.org/licenses/mit-license.php.
Produktet indeholder software, som er udviklet af OpenSSL Project til brug i OpenSSL Toolkit (http://www.openssl.org/). Kryptografisk software er skrevet af Eric Young ([email protected]), og UPnP-software er skrevet af Thomas Bernard.</translation>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Adressebog</translation>
</message>
<message>
<location line="+22"/>
<source>Double-click to edit address or label</source>
<translation>Dobbeltklik for at redigere adresse eller mærkat</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Opret en ny adresse</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Kopier den valgte adresse til udklipsholder</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation>&Ny adresse</translation>
</message>
<message>
<location line="-46"/>
<source>These are your KaneCoin 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>Dette er dine KaneCoin adresser til at modtage betalinger. Du ønsker måske at give en anden en til af hver afsender, så du kan holde styr på hvem der betaler dig.</translation>
</message>
<message>
<location line="+60"/>
<source>&Copy Address</source>
<translation>&Kopier adresse</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation>Vis &QR kode</translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a KaneCoin address</source>
<translation>Signerer en meddelelse for at bevise du ejer en KaneCoin adresse</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>Signere & Besked</translation>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation>Slet den markerede adresse fra listen</translation>
</message>
<message>
<location line="-14"/>
<source>Verify a message to ensure it was signed with a specified KaneCoin address</source>
<translation>Bekræft en meddelelse for at sikre, den blev underskrevet med en specificeret KaneCoin adresse</translation>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation>Bekræft Meddelse</translation>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&Slet</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+65"/>
<source>Copy &Label</source>
<translation>Kopier mærkat</translation>
</message>
<message>
<location line="+2"/>
<source>&Edit</source>
<translation>Rediger</translation>
</message>
<message>
<location line="+250"/>
<source>Export Address Book Data</source>
<translation>Eksporter Adresse Bog</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Kommasepareret fil (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Fejl ved eksportering</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Kunne ikke skrive til fil% 1.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Mærkat</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(ingen mærkat)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation>Adgangskodedialog</translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Indtast adgangskode</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Ny adgangskode</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Gentag ny adgangskode</translation>
</message>
<message>
<location line="+33"/>
<source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source>
<translation>Deaktivere trivielle sendmoney når OS konto er kompromitteret. Giver ingen reel sikkerhed.</translation>
</message>
<message>
<location line="+3"/>
<source>For staking only</source>
<translation>Kun til renteberegning</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+35"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Indtast den nye adgangskode til tegnebogen.<br/>Brug venligst en adgangskode på <b>10 eller flere tilfældige tegn</b> eller <b>otte eller flere ord</b>.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Krypter tegnebog</translation>
</message>
<message>
<location line="+7"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Denne funktion har brug for din tegnebogs adgangskode for at låse tegnebogen op.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Lås tegnebog op</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Denne funktion har brug for din tegnebogs adgangskode for at dekryptere tegnebogen.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Dekrypter tegnebog</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Skift adgangskode</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Indtast den gamle og den nye adgangskode til tegnebogen.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Bekræft tegnebogskryptering</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINS</b>!</source>
<translation>Advarsel: Hvis du krypterer din tegnebog og mister din adgangskode, vil du <b> miste alle dine mønter </ b>!</translation>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Er du sikker på, at du ønsker at kryptere din tegnebog?</translation>
</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>VIGTIGT: Enhver tidligere sikkerhedskopi, som du har lavet af tegnebogsfilen, bør blive erstattet af den nyligt genererede, krypterede tegnebogsfil. Af sikkerhedsmæssige årsager vil tidligere sikkerhedskopier af den ikke-krypterede tegnebogsfil blive ubrugelig i det øjeblik, du starter med at anvende den nye, krypterede tegnebog.</translation>
</message>
<message>
<location line="+103"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>Advarsel: Caps Lock-tasten er aktiveret!</translation>
</message>
<message>
<location line="-133"/>
<location line="+60"/>
<source>Wallet encrypted</source>
<translation>Tegnebog krypteret</translation>
</message>
<message>
<location line="-58"/>
<source>KaneCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source>
<translation>KaneCoin lukker nu for at afslutte krypteringen. Husk at en krypteret tegnebog ikke fuldt ud beskytter dine mønter mod at blive stjålet af malware som har inficeret din computer.</translation>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+44"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Tegnebogskryptering mislykkedes</translation>
</message>
<message>
<location line="-56"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Tegnebogskryptering mislykkedes på grund af en intern fejl. Din tegnebog blev ikke krypteret.</translation>
</message>
<message>
<location line="+7"/>
<location line="+50"/>
<source>The supplied passphrases do not match.</source>
<translation>De angivne adgangskoder stemmer ikke overens.</translation>
</message>
<message>
<location line="-38"/>
<source>Wallet unlock failed</source>
<translation>Tegnebogsoplåsning mislykkedes</translation>
</message>
<message>
<location line="+1"/>
<location line="+12"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Den angivne adgangskode for tegnebogsdekrypteringen er forkert.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Tegnebogsdekryptering mislykkedes</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Tegnebogens adgangskode blev ændret.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+280"/>
<source>Sign &message...</source>
<translation>Underskriv besked...</translation>
</message>
<message>
<location line="+242"/>
<source>Synchronizing with network...</source>
<translation>Synkroniserer med netværk...</translation>
</message>
<message>
<location line="-308"/>
<source>&Overview</source>
<translation>&Oversigt</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Vis generel oversigt over tegnebog</translation>
</message>
<message>
<location line="+17"/>
<source>&Transactions</source>
<translation>&Transaktioner</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Gennemse transaktionshistorik</translation>
</message>
<message>
<location line="+5"/>
<source>&Address Book</source>
<translation>&Adressebog</translation>
</message>
<message>
<location line="+1"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Redigere listen over gemte adresser og etiketter</translation>
</message>
<message>
<location line="-13"/>
<source>&Receive coins</source>
<translation>&Modtag mønter</translation>
</message>
<message>
<location line="+1"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Vis listen over adresser for modtagne betalinger</translation>
</message>
<message>
<location line="-7"/>
<source>&Send coins</source>
<translation>&Send mønter</translation>
</message>
<message>
<location line="+35"/>
<source>E&xit</source>
<translation>Luk</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Afslut program</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about KaneCoin</source>
<translation>Vis oplysninger om KaneCoin</translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>Om Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Vis informationer om Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Indstillinger...</translation>
</message>
<message>
<location line="+4"/>
<source>&Encrypt Wallet...</source>
<translation>Krypter tegnebog...</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>Sikkerhedskopier tegnebog...</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>Skift adgangskode...</translation>
</message>
<message numerus="yes">
<location line="+250"/>
<source>~%n block(s) remaining</source>
<translation><numerusform>~%n blok resterer</numerusform><numerusform>~%n blokke resterende</numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>
<translation>Overført %1 af %2 blokke af transaktions historie (%3% færdig).</translation>
</message>
<message>
<location line="-247"/>
<source>&Export...</source>
<translation>&Eksporter...</translation>
</message>
<message>
<location line="-62"/>
<source>Send coins to a KaneCoin address</source>
<translation>Send mønter til en KaneCoin adresse</translation>
</message>
<message>
<location line="+45"/>
<source>Modify configuration options for KaneCoin</source>
<translation>Ændre indstillingsmuligheder for KaneCoin</translation>
</message>
<message>
<location line="+18"/>
<source>Export the data in the current tab to a file</source>
<translation>Eksportere data i den aktuelle fane til en fil</translation>
</message>
<message>
<location line="-14"/>
<source>Encrypt or decrypt wallet</source>
<translation>Kryptere eller dekryptere tegnebog</translation>
</message>
<message>
<location line="+3"/>
<source>Backup wallet to another location</source>
<translation>Lav sikkerhedskopi af tegnebogen til et andet sted</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Skift adgangskode anvendt til tegnebogskryptering</translation>
</message>
<message>
<location line="+10"/>
<source>&Debug window</source>
<translation>Fejlsøgningsvindue</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>Åbn fejlsøgnings- og diagnosticeringskonsollen</translation>
</message>
<message>
<location line="-5"/>
<source>&Verify message...</source>
<translation>Verificér besked...</translation>
</message>
<message>
<location line="-200"/>
<source>KaneCoin</source>
<translation>KaneCoin</translation>
</message>
<message>
<location line="+0"/>
<source>Wallet</source>
<translation>Tegnebog</translation>
</message>
<message>
<location line="+178"/>
<source>&About KaneCoin</source>
<translation>&Om KaneCoin</translation>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation>Vis / skjul</translation>
</message>
<message>
<location line="+9"/>
<source>Unlock wallet</source>
<translation>Lås tegnebog</translation>
</message>
<message>
<location line="+1"/>
<source>&Lock Wallet</source>
<translation>&Lås tegnebog</translation>
</message>
<message>
<location line="+1"/>
<source>Lock wallet</source>
<translation>Lås tegnebog</translation>
</message>
<message>
<location line="+34"/>
<source>&File</source>
<translation>Fil</translation>
</message>
<message>
<location line="+8"/>
<source>&Settings</source>
<translation>Indstillinger</translation>
</message>
<message>
<location line="+8"/>
<source>&Help</source>
<translation>Hjælp</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>Faneværktøjslinje</translation>
</message>
<message>
<location line="+8"/>
<source>Actions toolbar</source>
<translation>Fanværktøjslinje</translation>
</message>
<message>
<location line="+13"/>
<location line="+9"/>
<source>[testnet]</source>
<translation>[testnetværk]</translation>
</message>
<message>
<location line="+0"/>
<location line="+60"/>
<source>KaneCoin client</source>
<translation>KaneCoin klient</translation>
</message>
<message numerus="yes">
<location line="+70"/>
<source>%n active connection(s) to KaneCoin network</source>
<translation><numerusform>%n aktiv forbindelse til KaneCoin netværk</numerusform><numerusform>%n aktive forbindelser til KaneCoin netværk</numerusform></translation>
</message>
<message>
<location line="+40"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation>Downloadet %1 blokke af transaktions historie.</translation>
</message>
<message>
<location line="+413"/>
<source>Staking.<br>Your weight is %1<br>Network weight is %2<br>Expected time to earn reward is %3</source>
<translation>Renter.<br> Din andel er% 1 <br> Netværkets andel er% 2 <br> Forventet tid til at modtage rente %3</translation>
</message>
<message>
<location line="+6"/>
<source>Not staking because wallet is locked</source>
<translation>Ingen rente fordi tegnebog er låst</translation>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is offline</source>
<translation>Ingen rente fordi tegnebog er offline</translation>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is syncing</source>
<translation>Ingen rente fordi tegnebog er ved at synkronisere</translation>
</message>
<message>
<location line="+2"/>
<source>Not staking because you don't have mature coins</source>
<translation>Ingen rente fordi der ingen modne mønter eksistere </translation>
</message>
<message numerus="yes">
<location line="-403"/>
<source>%n second(s) ago</source>
<translation><numerusform>%n sekund siden</numerusform><numerusform>%n sekunder siden</numerusform></translation>
</message>
<message>
<location line="-284"/>
<source>&Unlock Wallet...</source>
<translation>Lås tegnebog op</translation>
</message>
<message numerus="yes">
<location line="+288"/>
<source>%n minute(s) ago</source>
<translation><numerusform>%n minut siden</numerusform><numerusform>%n minutter siden</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s) ago</source>
<translation><numerusform>%n time siden</numerusform><numerusform>%n timer siden</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s) ago</source>
<translation><numerusform>%n dag siden</numerusform><numerusform>%n dage siden</numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Up to date</source>
<translation>Opdateret</translation>
</message>
<message>
<location line="+7"/>
<source>Catching up...</source>
<translation>Indhenter...</translation>
</message>
<message>
<location line="+10"/>
<source>Last received block was generated %1.</source>
<translation>Sidst modtagne blok blev genereret %1.</translation>
</message>
<message>
<location line="+59"/>
<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>Denne transaktion er over grænsen størrelse. Du kan stadig sende det for et gebyr på %1, der går til de noder, der behandler din transaktion og hjælper med at støtte netværket. Ønsker du at betale gebyret?</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm transaction fee</source>
<translation>Bekræft transaktionsgebyr</translation>
</message>
<message>
<location line="+27"/>
<source>Sent transaction</source>
<translation>Afsendt transaktion</translation>
</message>
<message>
<location line="+1"/>
<source>Incoming transaction</source>
<translation>Indgående transaktion</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Dato: %1
Beløb: %2
Type: %3
Adresse: %4
</translation>
</message>
<message>
<location line="+100"/>
<location line="+15"/>
<source>URI handling</source>
<translation>URI håndtering</translation>
</message>
<message>
<location line="-15"/>
<location line="+15"/>
<source>URI can not be parsed! This can be caused by an invalid KaneCoin address or malformed URI parameters.</source>
<translation>URI kan ikke tolkes! Dette kan skyldes en ugyldig KaneCoin adresse eller misdannede URI parametre.</translation>
</message>
<message>
<location line="+18"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Tegnebog er <b>krypteret</b> og i øjeblikket <b>ulåst</b></translation>
</message>
<message>
<location line="+10"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Tegnebog er <b>krypteret</b> og i øjeblikket <b>låst</b></translation>
</message>
<message>
<location line="+25"/>
<source>Backup Wallet</source>
<translation>Sikkerhedskopier Tegnebog</translation>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation>Tegnebogsdata (*.dat)</translation>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation>Sikkerhedskopiering Mislykkedes</translation>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation>Der opstod en fejl under forsøg på at gemme data i tegnebogen til den nye placering.</translation>
</message>
<message numerus="yes">
<location line="+76"/>
<source>%n second(s)</source>
<translation><numerusform>%n sekund</numerusform><numerusform>%n sekunder</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n minute(s)</source>
<translation><numerusform>%n minut</numerusform><numerusform>%n minutter</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s)</source>
<translation><numerusform>%n time(r)</numerusform><numerusform>%n time(r)</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation><numerusform>%n dag(e)</numerusform><numerusform>%n dag(e)</numerusform></translation>
</message>
<message>
<location line="+18"/>
<source>Not staking</source>
<translation>Ingen rente</translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+109"/>
<source>A fatal error occurred. KaneCoin can no longer continue safely and will quit.</source>
<translation>Der opstod en fejl under forsøg på at gemme dataene i tegnebogen til den nye placering.</translation>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+90"/>
<source>Network Alert</source>
<translation>Netværksadvarsel</translation>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<location filename="../forms/coincontroldialog.ui" line="+14"/>
<source>Coin Control</source>
<translation>Mønt Kontrol</translation>
</message>
<message>
<location line="+31"/>
<source>Quantity:</source>
<translation>Antal:</translation>
</message>
<message>
<location line="+32"/>
<source>Bytes:</source>
<translation>Bytes:</translation>
</message>
<message>
<location line="+48"/>
<source>Amount:</source>
<translation>Beløb:</translation>
</message>
<message>
<location line="+32"/>
<source>Priority:</source>
<translation>Prioritet:</translation>
</message>
<message>
<location line="+48"/>
<source>Fee:</source>
<translation>Gebyr:</translation>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation>Lav Udgangseffekt:</translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="+551"/>
<source>no</source>
<translation>nej</translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="+51"/>
<source>After Fee:</source>
<translation>Efter Gebyr:</translation>
</message>
<message>
<location line="+35"/>
<source>Change:</source>
<translation>Ændre:</translation>
</message>
<message>
<location line="+69"/>
<source>(un)select all</source>
<translation>(fra)vælg alle</translation>
</message>
<message>
<location line="+13"/>
<source>Tree mode</source>
<translation>Træ tilstand</translation>
</message>
<message>
<location line="+16"/>
<source>List mode</source>
<translation>Liste tilstand</translation>
</message>
<message>
<location line="+45"/>
<source>Amount</source>
<translation>Beløb</translation>
</message>
<message>
<location line="+5"/>
<source>Label</source>
<translation>Mærkat</translation>
</message>
<message>
<location line="+5"/>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<location line="+5"/>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<location line="+5"/>
<source>Confirmations</source>
<translation>Bekræftelser</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed</source>
<translation>Bekræftet</translation>
</message>
<message>
<location line="+5"/>
<source>Priority</source>
<translation>Prioritet</translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="-515"/>
<source>Copy address</source>
<translation>Kopier adresse</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopier mærkat</translation>
</message>
<message>
<location line="+1"/>
<location line="+26"/>
<source>Copy amount</source>
<translation>Kopier beløb</translation>
</message>
<message>
<location line="-25"/>
<source>Copy transaction ID</source>
<translation>Kopier transaktionens ID</translation>
</message>
<message>
<location line="+24"/>
<source>Copy quantity</source>
<translation>Kopier antal</translation>
</message>
<message>
<location line="+2"/>
<source>Copy fee</source>
<translation>Kopier transkationsgebyr</translation>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation>Kopier efter transkationsgebyr</translation>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation>Kopier bytes</translation>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation>Kopier prioritet</translation>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation>Lav udgangseffekt</translation>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation>Kopier ændring</translation>
</message>
<message>
<location line="+317"/>
<source>highest</source>
<translation>højeste</translation>
</message>
<message>
<location line="+1"/>
<source>high</source>
<translation>høj</translation>
</message>
<message>
<location line="+1"/>
<source>medium-high</source>
<translation>medium-høj</translation>
</message>
<message>
<location line="+1"/>
<source>medium</source>
<translation>medium</translation>
</message>
<message>
<location line="+4"/>
<source>low-medium</source>
<translation>lav-medium</translation>
</message>
<message>
<location line="+1"/>
<source>low</source>
<translation>lav</translation>
</message>
<message>
<location line="+1"/>
<source>lowest</source>
<translation>lavest</translation>
</message>
<message>
<location line="+155"/>
<source>DUST</source>
<translation>DUST</translation>
</message>
<message>
<location line="+0"/>
<source>yes</source>
<translation>ja</translation>
</message>
<message>
<location line="+10"/>
<source>This label turns red, if the transaction size is bigger than 10000 bytes.
This means a fee of at least %1 per kb is required.
Can vary +/- 1 Byte per input.</source>
<translation>Denne etiket bliver rød, hvis transaktionen størrelse er større end 10000 byte.
Det betyder, at et gebyr på mindst %1 per kb er påkrævet.
Kan variere + / - 1 byte per indgang.</translation>
</message>
<message>
<location line="+1"/>
<source>Transactions with higher priority get more likely into a block.
This label turns red, if the priority is smaller than "medium".
This means a fee of at least %1 per kb is required.</source>
<translation>Transaktioner med højere prioritet får mere sandsynligt en blok.
Denne etiket bliver rød, hvis prioritet er mindre end "medium".
Det betyder, at et gebyr på mindst %1 per kb er påkrævet.</translation>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if any recipient receives an amount smaller than %1.
This means a fee of at least %2 is required.
Amounts below 0.546 times the minimum relay fee are shown as DUST.</source>
<translation>Denne etiket bliver rød, hvis nogen modtager et beløb, der er mindre end %1.
Det betyder, at et gebyr på mindst %2 er påkrævet.
Beløb under 0,546 gange det minimale gebyr er vist som DUST.</translation>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if the change is smaller than %1.
This means a fee of at least %2 is required.</source>
<translation>Denne etiket bliver rød, hvis ændringen er mindre end %1.
Det betyder, at et gebyr på mindst %2 er påkrævet.</translation>
</message>
<message>
<location line="+37"/>
<location line="+66"/>
<source>(no label)</source>
<translation>(ingen mærkat)</translation>
</message>
<message>
<location line="-9"/>
<source>change from %1 (%2)</source>
<translation>skift fra %1 (%2)</translation>
</message>
<message>
<location line="+1"/>
<source>(change)</source>
<translation>(skift)</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Rediger adresse</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>Mærkat</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation>Etiketten er forbundet med denne post i adressekartoteket</translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>Adresse</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation>Adressen er forbundet med denne post i adressekartoteket. Dette kan kun ændres til sende adresser.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+20"/>
<source>New receiving address</source>
<translation>Ny modtagelsesadresse</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Ny afsendelsesadresse</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Rediger modtagelsesadresse</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Rediger afsendelsesadresse</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Den indtastede adresse "%1" er allerede i adressebogen.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid KaneCoin address.</source>
<translation>Den indtastede adresse "%1" er ikke en gyldig KaneCoin adresse.</translation>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Kunne ikke låse tegnebog op.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Ny nøglegenerering mislykkedes.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+420"/>
<location line="+12"/>
<source>KaneCoin-Qt</source>
<translation>KaneCoin-Qt</translation>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation>version</translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation>Anvendelse:</translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation>Kommandolinjeparametrene</translation>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation>UI opsætning</translation>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>Indstil sprog, for eksempel "de_DE" (standard: system locale)</translation>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation>Start minimeret</translation>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation>Vis splash skærm ved opstart (default: 1)</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Indstillinger</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>Generelt</translation>
</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. Fee 0.01 recommended.</source>
<translation>Valgfri transaktionsgebyr pr kB, som hjælper med at sikre dine transaktioner bliver behandlet hurtigt. De fleste transaktioner er 1 kB. Gebyr 0,01 anbefales.</translation>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>Betal transaktionsgebyr</translation>
</message>
<message>
<location line="+31"/>
<source>Reserved amount does not participate in staking and is therefore spendable at any time.</source>
<translation>Reserveret beløb deltager ikke i forrentning og er derfor tilrådighed til enhver tid.</translation>
</message>
<message>
<location line="+15"/>
<source>Reserve</source>
<translation>Reserve</translation>
</message>
<message>
<location line="+31"/>
<source>Automatically start KaneCoin after logging in to the system.</source>
<translation>Automatisk start KaneCoin efter at have logget ind på systemet.</translation>
</message>
<message>
<location line="+3"/>
<source>&Start KaneCoin on system login</source>
<translation>&Start KaneCoin ved systems login</translation>
</message>
<message>
<location line="+7"/>
<source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source>
<translation>Frigør blok og adressedatabaser ved lukning. Det betyder, at de kan flyttes til et anden data-bibliotek, men det sinker lukning. Tegnebogen er altid frigjort.</translation>
</message>
<message>
<location line="+3"/>
<source>&Detach databases at shutdown</source>
<translation>&Frigør databaser ved lukning</translation>
</message>
<message>
<location line="+21"/>
<source>&Network</source>
<translation>Netværk</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the KaneCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Automatisk åbne KaneCoin klient-port på routeren. Dette virker kun, når din router understøtter UPnP og er det er aktiveret.</translation>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Konfigurer port vha. UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the KaneCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation>Opret forbindelse til KaneCoin netværk via en SOCKS proxy (fx ved tilslutning gennem Tor).</translation>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation>&Tilslut gennem SOCKS proxy:</translation>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation>Proxy-IP:</translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>IP-adressen på proxy (f.eks 127.0.0.1)</translation>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>Port:</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Porten på proxyen (f.eks. 9050)</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation>SOCKS-version</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>SOCKS-version af proxyen (f.eks. 5)</translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>Vindue</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Vis kun et statusikon efter minimering af vinduet.</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>Minimer til statusfeltet i stedet for proceslinjen</translation>
</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>Minimer i stedet for at afslutte programmet, når vinduet lukkes. Når denne indstilling er valgt, vil programmet kun blive lukket, når du har valgt Afslut i menuen.</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>Minimer ved lukning</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>Visning</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>Brugergrænsefladesprog:</translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting KaneCoin.</source>
<translation>Sproget i brugergrænsefladen kan indstilles her. Denne indstilling vil træde i kraft efter genstart af KaneCoin tegnebog.</translation>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>Enhed at vise beløb i:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Vælg den standard underopdelingsenhed, som skal vises i brugergrænsefladen og ved afsendelse af bitcoins.</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show KaneCoin addresses in the transaction list or not.</source>
<translation>Få vist KaneCoin adresser på listen over transaktioner eller ej.</translation>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>Vis adresser i transaktionsliste</translation>
</message>
<message>
<location line="+7"/>
<source>Whether to show coin control features or not.</source>
<translation> Vis mønt kontrol funktioner eller ej.</translation>
</message>
<message>
<location line="+3"/>
<source>Display coin &control features (experts only!)</source>
<translation>Vis mønt & kontrol funktioner (kun for eksperter!)</translation>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>OK</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>Annuller</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation>&Anvend</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+55"/>
<source>default</source>
<translation>standard</translation>
</message>
<message>
<location line="+149"/>
<location line="+9"/>
<source>Warning</source>
<translation>Advarsel</translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting KaneCoin.</source>
<translation>Denne indstilling vil træde i kraft efter genstart af KaneCoin.</translation>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>Ugyldig proxy-adresse</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Formular</translation>
</message>
<message>
<location line="+33"/>
<location line="+231"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the KaneCoin network after a connection is established, but this process has not completed yet.</source>
<translation>De viste oplysninger kan være forældet. Din tegnebog synkroniserer automatisk med KaneCoin netværket efter en forbindelse er etableret, men denne proces er ikke afsluttet endnu.</translation>
</message>
<message>
<location line="-160"/>
<source>Stake:</source>
<translation>Rente:</translation>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation>Ubekræftede:</translation>
</message>
<message>
<location line="-107"/>
<source>Wallet</source>
<translation>Tegnebog</translation>
</message>
<message>
<location line="+49"/>
<source>Spendable:</source>
<translation>Brugbar:</translation>
</message>
<message>
<location line="+16"/>
<source>Your current spendable balance</source>
<translation>Din nuværende tilgængelige saldo</translation>
</message>
<message>
<location line="+71"/>
<source>Immature:</source>
<translation>Umodne:</translation>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation>Udvunden saldo, som endnu ikke er modnet</translation>
</message>
<message>
<location line="+20"/>
<source>Total:</source>
<translation>Total:</translation>
</message>
<message>
<location line="+16"/>
<source>Your current total balance</source>
<translation>Din nuværende totale saldo</translation>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Nyeste transaktioner</b></translation>
</message>
<message>
<location line="-108"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation>Summen af transaktioner, der endnu mangler at blive bekræftet, og ikke tæller mod den nuværende balance</translation>
</message>
<message>
<location line="-29"/>
<source>Total of coins that was staked, and do not yet count toward the current balance</source>
<translation>I alt mønter, der bliver berentet, og endnu ikke tæller mod den nuværende balance</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+113"/>
<location line="+1"/>
<source>out of sync</source>
<translation>ikke synkroniseret</translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation>QR Kode Dialog</translation>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation>Betalingsanmodning</translation>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation>Antal:</translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation>Label:</translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation>Besked:</translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation>&Gem Som...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation>Fejl kode URI i QR kode.</translation>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation>Det indtastede beløb er ugyldig, venligst tjek igen.</translation>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation>Resulterende URI for lang, prøv at reducere teksten til etiketten / besked.</translation>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation>Gem QR kode</translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation>PNG billede (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>Klientnavn</translation>
</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="+348"/>
<source>N/A</source>
<translation>N/A</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>Klientversion</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation>Information</translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation>Anvender OpenSSL-version</translation>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation>Opstartstid</translation>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>Netværk</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>Antal forbindelser</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation>På testnet</translation>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>Blokkæde</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>Nuværende antal blokke</translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation>Estimeret antal blokke</translation>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation>Tidsstempel for seneste blok</translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>Åbn</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation>Kommandolinjeparametrene</translation>
</message>
<message>
<location line="+7"/>
<source>Show the KaneCoin-Qt help message to get a list with possible KaneCoin command-line options.</source>
<translation>Vis KaneCoin-Qt hjælpe besked for at få en liste med mulige KaneCoin kommandolinjeparametre.</translation>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation>&Vis</translation>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>Konsol</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation>Byggedato</translation>
</message>
<message>
<location line="-104"/>
<source>KaneCoin - Debug window</source>
<translation>KaneCoin - Debug vindue</translation>
</message>
<message>
<location line="+25"/>
<source>KaneCoin Core</source>
<translation>KaneCoin Kerne</translation>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation>Fejlsøgningslogfil</translation>
</message>
<message>
<location line="+7"/>
<source>Open the KaneCoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation>Åbn KaneCoin debug logfilen fra den nuværende data mappe. Dette kan tage et par sekunder for store logfiler.</translation>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Ryd konsol</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-33"/>
<source>Welcome to the KaneCoin RPC console.</source>
<translation>Velkommen til KaneCoin RPC-konsol.</translation>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>Brug op og ned-piletasterne til at navigere historikken og <b>Ctrl-L</b> til at rydde skærmen.</translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>Tast <b>help</b> for en oversigt over de tilgængelige kommandoer.</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+182"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Send bitcoins</translation>
</message>
<message>
<location line="+76"/>
<source>Coin Control Features</source>
<translation>Mønt Kontrol Egenskaber</translation>
</message>
<message>
<location line="+20"/>
<source>Inputs...</source>
<translation>Input ...</translation>
</message>
<message>
<location line="+7"/>
<source>automatically selected</source>
<translation>Automatisk valgt</translation>
</message>
<message>
<location line="+19"/>
<source>Insufficient funds!</source>
<translation>Utilstrækkelig midler!</translation>
</message>
<message>
<location line="+77"/>
<source>Quantity:</source>
<translation>Antal:</translation>
</message>
<message>
<location line="+22"/>
<location line="+35"/>
<source>0</source>
<translation>0</translation>
</message>
<message>
<location line="-19"/>
<source>Bytes:</source>
<translation>Bytes:</translation>
</message>
<message>
<location line="+51"/>
<source>Amount:</source>
<translation>Beløb:</translation>
</message>
<message>
<location line="+22"/>
<location line="+86"/>
<location line="+86"/>
<location line="+32"/>
<source>0.00 BC</source>
<translation>123.456 BC {0.00 ?}</translation>
</message>
<message>
<location line="-191"/>
<source>Priority:</source>
<translation>Prioritet:</translation>
</message>
<message>
<location line="+19"/>
<source>medium</source>
<translation>medium</translation>
</message>
<message>
<location line="+32"/>
<source>Fee:</source>
<translation>Gebyr</translation>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation>Lav udgangseffekt</translation>
</message>
<message>
<location line="+19"/>
<source>no</source>
<translation>nej</translation>
</message>
<message>
<location line="+32"/>
<source>After Fee:</source>
<translation>Efter gebyr</translation>
</message>
<message>
<location line="+35"/>
<source>Change</source>
<translation>Skift</translation>
</message>
<message>
<location line="+50"/>
<source>custom change address</source>
<translation>Ændre adresse</translation>
</message>
<message>
<location line="+106"/>
<source>Send to multiple recipients at once</source>
<translation>Send til flere modtagere på en gang</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>Tilføj modtager</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation>Fjern alle transaktions omkostnings felter </translation>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>Ryd alle</translation>
</message>
<message>
<location line="+28"/>
<source>Balance:</source>
<translation>Saldo:</translation>
</message>
<message>
<location line="+16"/>
<source>123.456 BC</source>
<translation>123.456 BC</translation>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>Bekræft afsendelsen</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>Afsend</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-173"/>
<source>Enter a KaneCoin address (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation>Indtast en KaneCoin-adresse (f.eks B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation>
</message>
<message>
<location line="+15"/>
<source>Copy quantity</source>
<translation>Kopier antal</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Kopier beløb</translation>
</message>
<message>
<location line="+1"/>
<source>Copy fee</source>
<translation>Kopier transkationsgebyr</translation>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation>Kopier efter transkationsgebyr</translation>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation>Kopier bytes</translation>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation>Kopier prioritet</translation>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation>Kopier lav produktion</translation>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation>Kopier forandring</translation>
</message>
<message>
<location line="+86"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> til %2 (%3)</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>Bekræft afsendelse af bitcoins</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation>Er du sikker på du vil sende% 1?</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation>og</translation>
</message>
<message>
<location line="+29"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>Modtagerens adresse er ikke gyldig. Tjek venligst adressen igen.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Beløbet til betaling skal være større end 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>Beløbet overstiger din saldo.</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Totalen overstiger din saldo, når %1 transaktionsgebyr er inkluderet.</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Duplikeret adresse fundet. Du kan kun sende til hver adresse en gang pr. afsendelse.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed.</source>
<translation>Fejl: Transaktion oprettelse mislykkedes.</translation>
</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>Fejl: Transaktionen blev afvist. Dette kan ske, hvis nogle af mønterne i din tegnebog allerede er blevet brugt, som hvis du brugte en kopi af wallet.dat og mønterne blev brugt i kopien, men ikke markeret som brugt her.</translation>
</message>
<message>
<location line="+251"/>
<source>WARNING: Invalid KaneCoin address</source>
<translation>ADVARSEL: Ugyldig KaneCoin adresse</translation>
</message>
<message>
<location line="+13"/>
<source>(no label)</source>
<translation>(ingen mærkat)</translation>
</message>
<message>
<location line="+4"/>
<source>WARNING: unknown change address</source>
<translation>ADVARSEL: ukendt adresse forandring</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation>Form</translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>Beløb:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>Betal til:</translation>
</message>
<message>
<location line="+24"/>
<location filename="../sendcoinsentry.cpp" line="+25"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Indtast en mærkat for denne adresse for at føje den til din adressebog</translation>
</message>
<message>
<location line="+9"/>
<source>&Label:</source>
<translation>Mærkat:</translation>
</message>
<message>
<location line="+18"/>
<source>The address to send the payment to (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation>Adressen til at sende betalingen til (f.eks B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation>
</message>
<message>
<location line="+10"/>
<source>Choose address from address book</source>
<translation>Vælg adresse fra adressebogen</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>Indsæt adresse fra udklipsholderen</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation>Fjern denne modtager</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a KaneCoin address (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation>Indtast en KaneCoin-adresse (f.eks B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation>Signature - Underskriv/verificér en besked</translation>
</message>
<message>
<location line="+13"/>
<location line="+124"/>
<source>&Sign Message</source>
<translation>Underskriv besked</translation>
</message>
<message>
<location line="-118"/>
<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>Du kan underskrive beskeder med dine Bitcoin-adresser for at bevise, at de tilhører dig. Pas på ikke at underskrive noget vagt, da phisingangreb kan narre dig til at overdrage din identitet. Underskriv kun fuldt detaljerede udsagn, du er enig i.</translation>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation>Adresse til at underskrive meddelelsen med (f.eks B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation>
</message>
<message>
<location line="+10"/>
<location line="+203"/>
<source>Choose an address from the address book</source>
<translation>Vælg en adresse fra adressebogen</translation>
</message>
<message>
<location line="-193"/>
<location line="+203"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-193"/>
<source>Paste address from clipboard</source>
<translation>Indsæt adresse fra udklipsholderen</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation>Indtast beskeden, du ønsker at underskrive</translation>
</message>
<message>
<location line="+24"/>
<source>Copy the current signature to the system clipboard</source>
<translation>Kopier den nuværende underskrift til systemets udklipsholder</translation>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this KaneCoin address</source>
<translation>Underskriv brevet for at bevise du ejer denne KaneCoin adresse</translation>
</message>
<message>
<location line="+17"/>
<source>Reset all sign message fields</source>
<translation>Nulstil alle "underskriv besked"-felter</translation>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>Ryd alle</translation>
</message>
<message>
<location line="-87"/>
<location line="+70"/>
<source>&Verify Message</source>
<translation>Verificér besked</translation>
</message>
<message>
<location line="-64"/>
<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>Indtast den underskrevne adresse, beskeden (inkluder linjeskift, mellemrum mv. nøjagtigt, som de fremgår) og underskriften for at verificére beskeden. Vær forsigtig med ikke at lægge mere i underskriften end besked selv, så du undgår at blive narret af et man-in-the-middle-angreb.</translation>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation>Adressen meddelelse blev underskrevet med (f.eks B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified KaneCoin address</source>
<translation>Kontroller meddelelsen for at sikre, at den blev indgået med den angivne KaneCoin adresse</translation>
</message>
<message>
<location line="+17"/>
<source>Reset all verify message fields</source>
<translation>Nulstil alle "verificér besked"-felter</translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a KaneCoin address (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</source>
<translation>Indtast en KaneCoin-adresse (f.eks B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)</translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>Klik "Underskriv besked" for at generere underskriften</translation>
</message>
<message>
<location line="+3"/>
<source>Enter KaneCoin signature</source>
<translation>Indtast KaneCoin underskrift</translation>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>Den indtastede adresse er ugyldig.</translation>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation>Tjek venligst adressen, og forsøg igen.</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation>Den indtastede adresse henviser ikke til en nøgle.</translation>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation>Tegnebogsoplåsning annulleret.</translation>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation>Den private nøgle for den indtastede adresse er ikke tilgængelig.</translation>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>Underskrivning af besked mislykkedes.</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>Besked underskrevet.</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>Underskriften kunne ikke afkodes.</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>Tjek venligst underskriften, og forsøg igen.</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation>Underskriften matcher ikke beskedens indhold.</translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>Verificéring af besked mislykkedes.</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>Besked verificéret.</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+19"/>
<source>Open until %1</source>
<translation>Åben indtil %1</translation>
</message>
<message numerus="yes">
<location line="-2"/>
<source>Open for %n block(s)</source>
<translation><numerusform>Åben for %n blok</numerusform><numerusform>Åben for %n blok(ke)</numerusform></translation>
</message>
<message>
<location line="+8"/>
<source>conflicted</source>
<translation>konflikt</translation>
</message>
<message>
<location line="+2"/>
<source>%1/offline</source>
<translation>%1/offline</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/ubekræftet</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 bekræftelser</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>Status</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation><numerusform>, transmitteret igennem %n knude(r)</numerusform><numerusform>, transmitteret igennem %n knude(r)</numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation>Kilde</translation>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>Genereret</translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>Fra</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation>Til</translation>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation>egen adresse</translation>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>mærkat</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>Kredit</translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation><numerusform>modner efter yderligere %n blok(ke)</numerusform><numerusform>modner efter yderligere %n blok(ke)</numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation>ikke accepteret</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>Debet</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>Transaktionsgebyr</translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>Nettobeløb</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Besked</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>Kommentar</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>Transaktionens ID</translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 1 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 "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation>Generet mønter skal modne 1 blokke, før de kan blive brugt. Når du genererede denne blok blev det transmitteret til netværket, der tilføjes til blokkæden. Hvis det mislykkes at komme ind i kæden, vil dens tilstand ændres til "ikke godkendt", og det vil ikke være brugbar. Dette kan lejlighedsvis ske, hvis en anden node genererer en blok et par sekunder efter din.</translation>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation>Fejlsøgningsinformation</translation>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>Transaktion</translation>
</message>
<message>
<location line="+5"/>
<source>Inputs</source>
<translation>Input</translation>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Beløb</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>sand</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>falsk</translation>
</message>
<message>
<location line="-211"/>
<source>, has not been successfully broadcast yet</source>
<translation>, er ikke blevet transmitteret endnu</translation>
</message>
<message>
<location line="+35"/>
<source>unknown</source>
<translation>ukendt</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Transaktionsdetaljer</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Denne rude viser en detaljeret beskrivelse af transaktionen</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+226"/>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Type</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Beløb</translation>
</message>
<message>
<location line="+60"/>
<source>Open until %1</source>
<translation>Åben indtil %1</translation>
</message>
<message>
<location line="+12"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Bekræftet (%1 bekræftelser)</translation>
</message>
<message numerus="yes">
<location line="-15"/>
<source>Open for %n more block(s)</source>
<translation><numerusform>Åben %n blok(ke) yderligere</numerusform><numerusform>Åben %n blok(ke) yderligere</numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Offline</source>
<translation>Offline</translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed</source>
<translation>Ubekræftede</translation>
</message>
<message>
<location line="+3"/>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation>Bekræftelse (% 1 af% 2 anbefalede bekræftelser)</translation>
</message>
<message>
<location line="+6"/>
<source>Conflicted</source>
<translation>Konflikt</translation>
</message>
<message>
<location line="+3"/>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation>Umodne (% 1 bekræftelser, vil være tilgængelige efter% 2)</translation>
</message>
<message>
<location line="+3"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Denne blok blev ikke modtaget af nogen andre knuder og vil formentlig ikke blive accepteret!</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Genereret, men ikke accepteret</translation>
</message>
<message>
<location line="+42"/>
<source>Received with</source>
<translation>Modtaget med</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Modtaget fra</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Sendt til</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Betaling til dig selv</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Udvundne</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(n/a)</translation>
</message>
<message>
<location line="+190"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Transaktionsstatus. Hold musen over dette felt for at vise antallet af bekræftelser.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Dato og klokkeslæt for modtagelse af transaktionen.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Transaktionstype.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Destinationsadresse for transaktion.</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Beløb fjernet eller tilføjet balance.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+55"/>
<location line="+16"/>
<source>All</source>
<translation>Alle</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>I dag</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Denne uge</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Denne måned</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Sidste måned</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Dette år</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Interval...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Modtaget med</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Sendt til</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Til dig selv</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Udvundne</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Andet</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Indtast adresse eller mærkat for at søge</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Minimumsbeløb</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Kopier adresse</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopier mærkat</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Kopier beløb</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation>Kopier transaktionens ID</translation>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Rediger mærkat</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>Vis transaktionsdetaljer</translation>
</message>
<message>
<location line="+144"/>
<source>Export Transaction Data</source>
<translation>Exportere transaktionsdata</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Kommasepareret fil (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Bekræftet</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Dato</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Type</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Mærkat</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Adresse</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Beløb</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation>Fejl exporting</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Kunne ikke skrive til filen% 1.</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Interval:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>til</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+206"/>
<source>Sending...</source>
<translation>Sender...</translation>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+33"/>
<source>KaneCoin version</source>
<translation>KaneCoin version</translation>
</message>
<message>
<location line="+1"/>
<source>Usage:</source>
<translation>Anvendelse:</translation>
</message>
<message>
<location line="+1"/>
<source>Send command to -server or kanecoind</source>
<translation>Send kommando til-server eller kanecoind</translation>
</message>
<message>
<location line="+1"/>
<source>List commands</source>
<translation>Liste over kommandoer</translation>
</message>
<message>
<location line="+1"/>
<source>Get help for a command</source>
<translation>Få hjælp til en kommando</translation>
</message>
<message>
<location line="+2"/>
<source>Options:</source>
<translation>Indstillinger:</translation>
</message>
<message>
<location line="+2"/>
<source>Specify configuration file (default: kanecoin.conf)</source>
<translation>Angiv konfigurationsfil (default: kanecoin.conf)</translation>
</message>
<message>
<location line="+1"/>
<source>Specify pid file (default: kanecoind.pid)</source>
<translation>Angiv pid fil (standard: kanecoind.pid)</translation>
</message>
<message>
<location line="+2"/>
<source>Specify wallet file (within data directory)</source>
<translation>Angiv tegnebogs fil (indenfor data mappe)</translation>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Angiv datakatalog</translation>
</message>
<message>
<location line="+2"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>Angiv databasecachestørrelse i megabytes (standard: 25)</translation>
</message>
<message>
<location line="+1"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation>Set database disk logstørrelsen i megabyte (standard: 100)</translation>
</message>
<message>
<location line="+6"/>
<source>Listen for connections on <port> (default: 8229 or testnet: 18229)</source>
<translation>Lyt efter forbindelser på <port> (default: 8229 eller Testnet: 18229)</translation>
</message>
<message>
<location line="+1"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Oprethold højest <n> forbindelser til andre i netværket (standard: 125)</translation>
</message>
<message>
<location line="+3"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>Forbind til en knude for at modtage adresse, og afbryd</translation>
</message>
<message>
<location line="+1"/>
<source>Specify your own public address</source>
<translation>Angiv din egen offentlige adresse</translation>
</message>
<message>
<location line="+5"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation>Binder til en given adresse. Brug [host]: port notation for IPv6</translation>
</message>
<message>
<location line="+2"/>
<source>Stake your coins to support network and gain reward (default: 1)</source>
<translation>Opbevar dine mønter for at støtte netværket og få belønning (default: 1)</translation>
</message>
<message>
<location line="+5"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Grænse for afbrydelse til dårlige forbindelser (standard: 100)</translation>
</message>
<message>
<location line="+1"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Antal sekunder dårlige forbindelser skal vente før reetablering (standard: 86400)</translation>
</message>
<message>
<location line="-44"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation>Der opstod en fejl ved angivelse af RPC-porten %u til at lytte på IPv4: %s</translation>
</message>
<message>
<location line="+51"/>
<source>Detach block and address databases. Increases shutdown time (default: 0)</source>
<translation>Frigør blok og adresse databaser. Øg shutdown tid (default: 0)</translation>
</message>
<message>
<location line="+109"/>
<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>Fejl: Transaktionen blev afvist. Dette kan ske, hvis nogle af mønterne i din pung allerede er blevet brugt, som hvis du brugte en kopi af wallet.dat og mønterne blev brugt i kopien, men ikke markeret her.</translation>
</message>
<message>
<location line="-5"/>
<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>Fejl: Denne transaktion kræver et transaktionsgebyr på mindst% s på grund af dens størrelse, kompleksitet, eller anvendelse af nylig modtaget midler</translation>
</message>
<message>
<location line="-87"/>
<source>Listen for JSON-RPC connections on <port> (default: 8230 or testnet: 18230)</source>
<translation>Spor efter JSON-RPC-forbindelser på <port> (default: 8230 eller Testnet: 18230)</translation>
</message>
<message>
<location line="-11"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Accepter kommandolinje- og JSON-RPC-kommandoer</translation>
</message>
<message>
<location line="+101"/>
<source>Error: Transaction creation failed </source>
<translation>Fejl: Transaktion oprettelse mislykkedes</translation>
</message>
<message>
<location line="-5"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation>Fejl: Wallet låst, ude af stand til at skabe transaktion</translation>
</message>
<message>
<location line="-8"/>
<source>Importing blockchain data file.</source>
<translation>Importerer blockchain datafil.</translation>
</message>
<message>
<location line="+1"/>
<source>Importing bootstrap blockchain data file.</source>
<translation>Import af bootstrap blockchain datafil.</translation>
</message>
<message>
<location line="-88"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Kør i baggrunden som en service, og accepter kommandoer</translation>
</message>
<message>
<location line="+1"/>
<source>Use the test network</source>
<translation>Brug testnetværket</translation>
</message>
<message>
<location line="-24"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>Accepter forbindelser udefra (standard: 1 hvis hverken -proxy eller -connect)</translation>
</message>
<message>
<location line="-38"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation>Der opstod en fejl ved angivelse af RPC-porten %u til at lytte på IPv6, falder tilbage til IPv4: %s</translation>
</message>
<message>
<location line="+117"/>
<source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source>
<translation>Fejl initialisering database miljø% s! For at gendanne, BACKUP denne mappe, og derefter fjern alt bortset fra wallet.dat.</translation>
</message>
<message>
<location line="-20"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation>Angiv maksimal størrelse på high-priority/low-fee transaktioner i bytes (standard: 27000)</translation>
</message>
<message>
<location line="+11"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>Advarsel: -paytxfee er sat meget højt! Dette er det gebyr du vil betale, hvis du sender en transaktion.</translation>
</message>
<message>
<location line="+61"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong KaneCoin will not work properly.</source>
<translation>Advarsel: Kontroller venligst, at computerens dato og klokkeslæt er korrekt! Hvis dit ur er forkert vil KaneCoin ikke fungere korrekt.</translation>
</message>
<message>
<location line="-31"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation>Advarsel: fejl under læsning af wallet.dat! Alle nøgler blev læst korrekt, men transaktionsdata eller adressebogsposter kan mangle eller være forkerte.</translation>
</message>
<message>
<location line="-18"/>
<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>Advarsel: wallet.dat ødelagt, data reddet! Oprindelig wallet.net gemt som wallet.{timestamp}.bak i %s; hvis din saldo eller dine transaktioner er forkert, bør du genskabe fra en sikkerhedskopi.</translation>
</message>
<message>
<location line="-30"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation>Forsøg at genskabe private nøgler fra ødelagt wallet.dat</translation>
</message>
<message>
<location line="+4"/>
<source>Block creation options:</source>
<translation>Blokoprettelsestilvalg:</translation>
</message>
<message>
<location line="-62"/>
<source>Connect only to the specified node(s)</source>
<translation>Tilslut kun til de(n) angivne knude(r)</translation>
</message>
<message>
<location line="+4"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation>Find egen IP-adresse (standard: 1 når lytter og ingen -externalip)</translation>
</message>
<message>
<location line="+94"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>Lytning på enhver port mislykkedes. Brug -listen=0, hvis du ønsker dette.</translation>
</message>
<message>
<location line="-90"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation>Find peer bruges DNS-opslag (default: 1)</translation>
</message>
<message>
<location line="+5"/>
<source>Sync checkpoints policy (default: strict)</source>
<translation>Synkroniser checkpoints politik (default: streng)</translation>
</message>
<message>
<location line="+83"/>
<source>Invalid -tor address: '%s'</source>
<translation>Ugyldig-tor-adresse: '% s'</translation>
</message>
<message>
<location line="+4"/>
<source>Invalid amount for -reservebalance=<amount></source>
<translation>Ugyldigt beløb for-reservebalance = <beløb></translation>
</message>
<message>
<location line="-82"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation>Maksimum for modtagelsesbuffer pr. forbindelse, <n>*1000 bytes (standard: 5000)</translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation>Maksimum for afsendelsesbuffer pr. forbindelse, <n>*1000 bytes (standard: 1000)</translation>
</message>
<message>
<location line="-16"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation>Tilslut kun til knuder i netværk <net> (IPv4, IPv6 eller Tor)</translation>
</message>
<message>
<location line="+28"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation>Output ekstra debugging information. Indebærer alle andre-debug * muligheder</translation>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation>Output ekstra netværk debugging information</translation>
</message>
<message>
<location line="+1"/>
<source>Prepend debug output with timestamp</source>
<translation>Prepend debug output med tidsstempel</translation>
</message>
<message>
<location line="+35"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation>SSL-indstillinger: (se Bitcoin Wiki for SSL-opsætningsinstruktioner)</translation>
</message>
<message>
<location line="-74"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation>Vælg den version af socks proxy du vil bruge (4-5, standard: 5)</translation>
</message>
<message>
<location line="+41"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Send sporings-/fejlsøgningsinformation til konsollen i stedet for debug.log filen</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation>Send trace / debug info til debugger</translation>
</message>
<message>
<location line="+28"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation>Indstil maks. blok størrelse i bytes (standard: 250000)</translation>
</message>
<message>
<location line="-1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation>Angiv minimumsblokstørrelse i bytes (standard: 0)</translation>
</message>
<message>
<location line="-29"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation>Formindsk debug.log filen ved klientopstart (standard: 1 hvis ikke -debug)</translation>
</message>
<message>
<location line="-42"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>Angiv tilslutningstimeout i millisekunder (standard: 5000)</translation>
</message>
<message>
<location line="+109"/>
<source>Unable to sign checkpoint, wrong checkpointkey?
</source>
<translation>Kan ikke logge checkpoint, forkert checkpointkey?
</translation>
</message>
<message>
<location line="-80"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>Forsøg at bruge UPnP til at konfigurere den lyttende port (standard: 0)</translation>
</message>
<message>
<location line="-1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Forsøg at bruge UPnP til at konfigurere den lyttende port (standard: 1 når lytter)</translation>
</message>
<message>
<location line="-25"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation>Brug proxy til at nå tor skjulte services (Standard: samme som-proxy)</translation>
</message>
<message>
<location line="+42"/>
<source>Username for JSON-RPC connections</source>
<translation>Brugernavn til JSON-RPC-forbindelser</translation>
</message>
<message>
<location line="+47"/>
<source>Verifying database integrity...</source>
<translation>Bekræfter database integritet ...</translation>
</message>
<message>
<location line="+57"/>
<source>WARNING: syncronized checkpoint violation detected, but skipped!</source>
<translation>ADVARSEL: synkroniseret checkpoint overtrædelse opdaget, men skibbet!</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: Disk space is low!</source>
<translation>Advarsel: Diskplads lav!</translation>
</message>
<message>
<location line="-2"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation>Advarsel: Denne version er forældet, opgradering påkrævet!</translation>
</message>
<message>
<location line="-48"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation>wallet.dat ødelagt, redning af data mislykkedes</translation>
</message>
<message>
<location line="-54"/>
<source>Password for JSON-RPC connections</source>
<translation>Adgangskode til JSON-RPC-forbindelser</translation>
</message>
<message>
<location line="-84"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=kanecoinrpc
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 "KaneCoin Alert" [email protected]
</source>
<translation>% s, skal du indstille et rpcpassword i konfigurationsfilen:
% s
Det anbefales at bruge følgende tilfældig adgangskode:
rpcuser = kanecoinrpc
rpcpassword =% s
(du behøver ikke at huske denne adgangskode)
Brugernavn og adgangskode må ikke være den samme.
Hvis filen ikke findes, skal du oprette den med filtilladelser ejer-læsbar-kun.
Det kan også anbefales at sætte alertnotify så du får besked om problemer;
for eksempel: alertnotify = echo%% s | mail-s "KaneCoin Alert" [email protected]
</translation>
</message>
<message>
<location line="+51"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation>Find peers der bruger internet relay chat (default: 1) {? 0)}</translation>
</message>
<message>
<location line="+5"/>
<source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source>
<translation>Synkroniser tid med andre noder. Deaktiver, hvis tiden på dit system er præcis eksempelvis synkroniseret med NTP (default: 1)</translation>
</message>
<message>
<location line="+15"/>
<source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source>
<translation>Når du opretter transaktioner ignoreres input med værdi mindre end dette (standard: 0,01)</translation>
</message>
<message>
<location line="+16"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Tillad JSON-RPC-forbindelser fra bestemt IP-adresse</translation>
</message>
<message>
<location line="+1"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Send kommandoer til knude, der kører på <ip> (standard: 127.0.0.1)</translation>
</message>
<message>
<location line="+1"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Udfør kommando, når den bedste blok ændres (%s i kommandoen erstattes med blokhash)</translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation>Udfør kommando, når en transaktion i tegnebogen ændres (%s i kommandoen erstattes med TxID)</translation>
</message>
<message>
<location line="+3"/>
<source>Require a confirmations for change (default: 0)</source>
<translation>Kræver en bekræftelser for forandring (default: 0)</translation>
</message>
<message>
<location line="+1"/>
<source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source>
<translation>Gennemtving transaktions omkostninger scripts til at bruge canoniske PUSH operatører (default: 1)</translation>
</message>
<message>
<location line="+2"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation>Udfør kommando, når en relevant advarsel er modtaget (% s i cmd erstattes af meddelelse)</translation>
</message>
<message>
<location line="+3"/>
<source>Upgrade wallet to latest format</source>
<translation>Opgrader tegnebog til seneste format</translation>
</message>
<message>
<location line="+1"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Angiv nøglepoolstørrelse til <n> (standard: 100)</translation>
</message>
<message>
<location line="+1"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Gennemsøg blokkæden for manglende tegnebogstransaktioner</translation>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation>Hvor mange blokke til at kontrollere ved opstart (standard: 2500, 0 = alle)</translation>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation>Hvor grundig blok verifikation er (0-6, default: 1)</translation>
</message>
<message>
<location line="+1"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation>Importere blokke fra ekstern blk000?. Dat fil</translation>
</message>
<message>
<location line="+8"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Brug OpenSSL (https) for JSON-RPC-forbindelser</translation>
</message>
<message>
<location line="+1"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Servercertifikat-fil (standard: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Serverens private nøgle (standard: server.pem)</translation>
</message>
<message>
<location line="+1"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Acceptable ciphers (default: TLSv1 + HØJ:! SSLv2: aNULL: eNULL: AH: 3DES: @ styrke)</translation>
</message>
<message>
<location line="+53"/>
<source>Error: Wallet unlocked for staking only, unable to create transaction.</source>
<translation>Fejl: Pung låst for at udregne rente, ude af stand til at skabe transaktion.</translation>
</message>
<message>
<location line="+18"/>
<source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source>
<translation>ADVARSEL: Ugyldig checkpoint fundet! Viste transaktioner er måske ikke korrekte! Du kan være nødt til at opgradere, eller underrette udviklerne.</translation>
</message>
<message>
<location line="-158"/>
<source>This help message</source>
<translation>Denne hjælpebesked</translation>
</message>
<message>
<location line="+95"/>
<source>Wallet %s resides outside data directory %s.</source>
<translation>Wallet% s placeret udenfor data mappe% s.</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot obtain a lock on data directory %s. KaneCoin is probably already running.</source>
<translation>Kan ikke få en lås på data mappe% s. KaneCoin kører sikkert allerede.</translation>
</message>
<message>
<location line="-98"/>
<source>KaneCoin</source>
<translation>KaneCoin</translation>
</message>
<message>
<location line="+140"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>Kunne ikke tildele %s på denne computer (bind returnerede fejl %d, %s)</translation>
</message>
<message>
<location line="-130"/>
<source>Connect through socks proxy</source>
<translation>Tilslut gennem socks proxy</translation>
</message>
<message>
<location line="+3"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Tillad DNS-opslag for -addnode, -seednode og -connect</translation>
</message>
<message>
<location line="+122"/>
<source>Loading addresses...</source>
<translation>Indlæser adresser...</translation>
</message>
<message>
<location line="-15"/>
<source>Error loading blkindex.dat</source>
<translation>Fejl ved indlæsning af blkindex.dat</translation>
</message>
<message>
<location line="+2"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Fejl ved indlæsning af wallet.dat: Tegnebog ødelagt</translation>
</message>
<message>
<location line="+4"/>
<source>Error loading wallet.dat: Wallet requires newer version of KaneCoin</source>
<translation>Fejl ved indlæsning af wallet.dat: Wallet kræver en nyere version af KaneCoin</translation>
</message>
<message>
<location line="+1"/>
<source>Wallet needed to be rewritten: restart KaneCoin to complete</source>
<translation>Det er nødvendig for wallet at blive omskrevet: Genstart KaneCoin for fuldføre</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat</source>
<translation>Fejl ved indlæsning af wallet.dat</translation>
</message>
<message>
<location line="-16"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Ugyldig -proxy adresse: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>Ukendt netværk anført i -onlynet: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation>Ukendt -socks proxy-version: %i</translation>
</message>
<message>
<location line="+4"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation>Kan ikke finde -bind adressen: '%s'</translation>
</message>
<message>
<location line="+2"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>Kan ikke finde -externalip adressen: '%s'</translation>
</message>
<message>
<location line="-24"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Ugyldigt beløb for -paytxfee=<amount>: '%s'</translation>
</message>
<message>
<location line="+44"/>
<source>Error: could not start node</source>
<translation>Fejl: kunne ikke starte node</translation>
</message>
<message>
<location line="+11"/>
<source>Sending...</source>
<translation>Sender...</translation>
</message>
<message>
<location line="+5"/>
<source>Invalid amount</source>
<translation>Ugyldigt beløb</translation>
</message>
<message>
<location line="+1"/>
<source>Insufficient funds</source>
<translation>Manglende dækning</translation>
</message>
<message>
<location line="-34"/>
<source>Loading block index...</source>
<translation>Indlæser blokindeks...</translation>
</message>
<message>
<location line="-103"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Tilføj en knude til at forbinde til og forsøg at holde forbindelsen åben</translation>
</message>
<message>
<location line="+122"/>
<source>Unable to bind to %s on this computer. KaneCoin is probably already running.</source>
<translation>Kunne ikke binde sig til% s på denne computer. KaneCoin kører sikkert allerede.</translation>
</message>
<message>
<location line="-97"/>
<source>Fee per KB to add to transactions you send</source>
<translation>Gebyr pr KB som tilføjes til transaktioner, du sender</translation>
</message>
<message>
<location line="+55"/>
<source>Invalid amount for -mininput=<amount>: '%s'</source>
<translation>Ugyldigt beløb for-mininput = <beløb>: '% s'</translation>
</message>
<message>
<location line="+25"/>
<source>Loading wallet...</source>
<translation>Indlæser tegnebog...</translation>
</message>
<message>
<location line="+8"/>
<source>Cannot downgrade wallet</source>
<translation>Kan ikke nedgradere tegnebog</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot initialize keypool</source>
<translation>Kan ikke initialisere keypool</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot write default address</source>
<translation>Kan ikke skrive standardadresse</translation>
</message>
<message>
<location line="+1"/>
<source>Rescanning...</source>
<translation>Genindlæser...</translation>
</message>
<message>
<location line="+5"/>
<source>Done loading</source>
<translation>Indlæsning gennemført</translation>
</message>
<message>
<location line="-167"/>
<source>To use the %s option</source>
<translation>For at bruge %s mulighed</translation>
</message>
<message>
<location line="+14"/>
<source>Error</source>
<translation>Fejl</translation>
</message>
<message>
<location line="+6"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation>Du skal angive rpcpassword=<password> i konfigurationsfilen:
%s
Hvis filen ikke eksisterer, opret den og giv ingen andre end ejeren læserettighed.</translation>
</message>
</context>
</TS> | {'content_hash': '755cae92f823f691027af61cf92d2810', 'timestamp': '', 'source': 'github', 'line_count': 3313, 'max_line_length': 409, 'avg_line_length': 38.777844853607, 'alnum_prop': 0.6297452343330402, 'repo_name': 'KaneCoin/KaneCoin', 'id': '5d818ef88127749fdc3fd789d883fdca7d902c18', 'size': '128891', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/qt/locale/bitcoin_da.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '51312'}, {'name': 'C', 'bytes': '34509'}, {'name': 'C++', 'bytes': '2584428'}, {'name': 'CSS', 'bytes': '1127'}, {'name': 'Groff', 'bytes': '12684'}, {'name': 'HTML', 'bytes': '50620'}, {'name': 'Makefile', 'bytes': '121507'}, {'name': 'NSIS', 'bytes': '6077'}, {'name': 'Objective-C', 'bytes': '858'}, {'name': 'Objective-C++', 'bytes': '3537'}, {'name': 'OpenEdge ABL', 'bytes': '49874'}, {'name': 'Python', 'bytes': '41580'}, {'name': 'QMake', 'bytes': '13970'}, {'name': 'Shell', 'bytes': '9083'}, {'name': 'TypeScript', 'bytes': '1083156'}]} |
<?php
// based on code from
// http://codecaine.co.za/posts/compound-elements-with-zend-form
class App_View_Helper_FormDate extends Zend_View_Helper_FormElement
{
public function formDate ($name, $value = null, $attribs = null)
{
// separate value into day, month and year
$day = '';
$month = '';
$year = '';
if (is_array($value)) {
$day = $value['day'];
$month = $value['month'];
$year = $value['year'];
} elseif (strtotime($value)) {
list($year, $month, $day) = explode('-', date('Y-m-d', strtotime($value)));
}
// build select options
$dayAttribs = isset($attribs['dayAttribs']) ? $attribs['dayAttribs'] : array();
$monthAttribs = isset($attribs['monthAttribs']) ? $attribs['monthAttribs'] : array();
$yearAttribs = isset($attribs['yearAttribs']) ? $attribs['yearAttribs'] : array();
$dayMultiOptions = array('' => '');
for ($i = 1; $i < 32; $i ++)
{
$index = str_pad($i, 2, '0', STR_PAD_LEFT);
$dayMultiOptions[$index] = str_pad($i, 2, '0', STR_PAD_LEFT);
}
$monthMultiOptions = array('' => '');
for ($i = 1; $i < 13; $i ++)
{
$index = str_pad($i, 2, '0', STR_PAD_LEFT);
$monthMultiOptions[$index] = date('F', mktime(null, null, null, $i, 01));
}
$startYear = date('Y');
if (isset($attribs['startYear'])) {
$startYear = $attribs['startYear'];
unset($attribs['startYear']);
}
$stopYear = $startYear + 10;
if (isset($attribs['stopYear'])) {
$stopYear = $attribs['stopYear'];
unset($attribs['stopYear']);
}
$yearMultiOptions = array('' => '');
if ($stopYear < $startYear) {
for ($i = $startYear; $i >= $stopYear; $i--) {
$yearMultiOptions[$i] = $i;
}
} else {
for ($i = $startYear; $i <= $stopYear; $i++) {
$yearMultiOptions[$i] = $i;
}
}
// return the 3 selects separated by
return
$this->view->formSelect(
$name . '[day]',
$day,
$dayAttribs,
$dayMultiOptions) . ' ' .
$this->view->formSelect(
$name . '[month]',
$month,
$monthAttribs,
$monthMultiOptions) . ' ' .
$this->view->formSelect(
$name . '[year]',
$year,
$yearAttribs,
$yearMultiOptions
);
}
} | {'content_hash': 'b1482ab81c98589342cbb7e758cfb1d6', 'timestamp': '', 'source': 'github', 'line_count': 83, 'max_line_length': 85, 'avg_line_length': 23.85542168674699, 'alnum_prop': 0.6196969696969697, 'repo_name': 'aguileraz/AGLDev', 'id': '86bdfa656298402e9f2fc8f999fe59060bb5c32c', 'size': '1980', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'module/AGLBase/view/helper/formDate.php', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'ApacheConf', 'bytes': '772'}, {'name': 'CSS', 'bytes': '1073'}, {'name': 'HTML', 'bytes': '43650'}, {'name': 'PHP', 'bytes': '94989'}]} |
package com.grarak.kerneladiutor;
import android.os.Bundle;
import android.support.v4.view.ViewCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;
import android.text.Html;
import android.view.View;
import android.widget.ImageView;
import com.grarak.kerneladiutor.fragments.tools.download.ParentFragment;
import com.grarak.kerneladiutor.utils.Downloads;
import com.grarak.kerneladiutor.utils.Utils;
import com.nineoldandroids.view.ViewHelper;
/**
* Created by willi on 20.06.15.
*/
public class KernelActivity extends BaseActivity {
public static final String LOGO_ARG = "logo_view";
public static final String KERNEL_JSON_ARG = "kernel_json";
private View logoContainer;
private Toolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Downloads.KernelContent kernelContent =
new Downloads.KernelContent(getIntent().getExtras().getString(KERNEL_JSON_ARG));
ActionBar actionBar;
String name;
if ((name = kernelContent.getName()) != null && (actionBar = getSupportActionBar()) != null)
actionBar.setTitle(Html.fromHtml(name).toString());
logoContainer = findViewById(R.id.logo_container);
ImageView logoView = (ImageView) findViewById(R.id.logo);
ViewCompat.setTransitionName(logoView, LOGO_ARG);
Utils.loadImagefromUrl(kernelContent.getLogo(), logoView);
getSupportFragmentManager().beginTransaction().replace(R.id.content_frame,
ParentFragment.newInstance(kernelContent)).commitAllowingStateLoss();
}
@Override
public int getParentViewId() {
return R.layout.activity_kernel;
}
@Override
public View getParentView() {
return null;
}
@Override
public Toolbar getToolbar() {
return toolbar == null ? toolbar = (Toolbar) findViewById(R.id.toolbar) : toolbar;
}
public View getLogoContainer() {
return logoContainer;
}
@Override
public void onBackPressed() {
if (logoContainer != null && ViewHelper.getTranslationY(logoContainer) >= -logoContainer.getHeight() / 2)
super.onBackPressed();
else finish();
}
}
| {'content_hash': 'f1e244ec4070e93cfe42de1820c7652d', 'timestamp': '', 'source': 'github', 'line_count': 74, 'max_line_length': 113, 'avg_line_length': 30.905405405405407, 'alnum_prop': 0.6965456930476607, 'repo_name': 'Infinitive-OS/packages_apps_KernelAdiutor', 'id': '47b07d0f155c59046bf19b25ba2e80f282c29a40', 'size': '2883', 'binary': False, 'copies': '7', 'ref': 'refs/heads/lp5.1', 'path': 'app/src/main/java/com/grarak/kerneladiutor/KernelActivity.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '941232'}]} |
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var routes = require('./routes/index');
var users = require('./routes/users');
var app = express();
var node_soa_auth = require('../node-soa-auth/index.js')
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
// uncomment after placing your favicon in /public
//app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(node_soa_auth.authMiddleware);
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', routes);
app.use('/users', users);
// catch 404 and forward to error handler
app.use(function(req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
// error handlers
// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: err
});
});
}
// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: {}
});
});
module.exports = app;
| {'content_hash': 'd851c0f428438c6d41160ca3256159d6', 'timestamp': '', 'source': 'github', 'line_count': 63, 'max_line_length': 56, 'avg_line_length': 25.0, 'alnum_prop': 0.6368253968253968, 'repo_name': 'RaymondKlass/node-soa-auth', 'id': 'b36e115ae4bccf978121a5dcbc7646ef740a2e23', 'size': '1575', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'node-soa-auth_example_app/app.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '110'}, {'name': 'HTML', 'bytes': '274'}, {'name': 'JavaScript', 'bytes': '2516'}]} |
//Apache2, 2017, WinterDev
//Apache2, 2009, griffm, FO.NET
namespace Fonet.Fo.Flow
{
using Fonet.Layout;
internal class BidiOverride : ToBeImplementedElement
{
new internal class Maker : FObj.Maker
{
public override FObj Make(FObj parent, PropertyList propertyList)
{
return new BidiOverride(parent, propertyList);
}
}
new public static FObj.Maker GetMaker()
{
return new Maker();
}
protected BidiOverride(FObj parent, PropertyList propertyList)
: base(parent, propertyList)
{
this.name = "fo:bidi-override";
}
public override Status Layout(Area area)
{
AuralProps mAurProps = propMgr.GetAuralProps();
RelativePositionProps mProps = propMgr.GetRelativePositionProps();
return base.Layout(area);
}
}
} | {'content_hash': 'b9c99f97534fb6f2031cb9d20c914203', 'timestamp': '', 'source': 'github', 'line_count': 35, 'max_line_length': 78, 'avg_line_length': 26.885714285714286, 'alnum_prop': 0.5802337938363443, 'repo_name': 'prepare/FO.NET', 'id': 'a220175ccdc6295591afc7f844b7efbb079c072d', 'size': '943', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Core/Fo/Flow/BidiOverride.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C#', 'bytes': '1718952'}]} |
package com.mazer
case class Cell(val x: Int, val y: Int)
| {'content_hash': 'bd820c0133916d66b4f1ef8f79843ed4', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 39, 'avg_line_length': 19.666666666666668, 'alnum_prop': 0.711864406779661, 'repo_name': 'willisjtc/Mazer', 'id': '07a6a12763a92794fdae37df6ef04ed70a4756cf', 'size': '59', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/scala/com/mazer/Cell.scala', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Scala', 'bytes': '4653'}]} |
package work.hungrygnu.thefreebird.beings;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import static work.hungrygnu.thefreebird.Constants.WORLD_WIDTH;
/**
* Created by hungry on 18.02.16.
*/
public class FacingDeDyObject extends work.hungrygnu.thefreebird.beings.DestructibleDynamicObject {
protected boolean facingRight;
public FacingDeDyObject(ShapeRenderer renderer, Vector2 position, Boolean facingRight) {
super(renderer, position);
this.facingRight = facingRight;
}
public Boolean hasCollisionWith(Poop poop){
return false;
}
public Boolean hasCollisionWith(work.hungrygnu.thefreebird.beings.Bird bird){
return false;
}
public void respectBorders(float offBorderDistance){
if (position.x < -offBorderDistance) {
facingRight = true;
if (velocity.x < 0)
velocity.x *= -1;
halfChanceGoAway();
}
else if(position.x > WORLD_WIDTH+offBorderDistance) {
facingRight = false;
if (velocity.x > 0)
velocity.x *= -1;
halfChanceGoAway();
}
}
private void halfChanceGoAway(){
if (MathUtils.random(-1,1)< 0 )
active = false;
}
}
| {'content_hash': 'db42bd12bc8d0099b91893bb5ae67dd8', 'timestamp': '', 'source': 'github', 'line_count': 48, 'max_line_length': 99, 'avg_line_length': 28.1875, 'alnum_prop': 0.6452328159645233, 'repo_name': 'Hungry-Gnu/TheFreeBird', 'id': '2e707a9a0578ee03f5595e742f600f6dec5d714f', 'size': '1353', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'core/src/work/hungrygnu/thefreebird/beings/FacingDeDyObject.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '1069'}, {'name': 'HTML', 'bytes': '1524'}, {'name': 'Java', 'bytes': '80925'}, {'name': 'JavaScript', 'bytes': '24'}]} |
require "thor"
require "gominohi/generator"
require "gominohi/sources"
require "gominohi/version"
module Gominohi
class Command < Thor
map "-v" => :version
map "-g" => :generate
desc "version", "Show version number."
def version
puts Gominohi::VERSION
end
desc "generate PLACE BEGIN END [1-4]", "Generate garbage days."
def generate(place, begin_date, end_date, order=1)
case order.to_i
when 1
special_order = [:paper, :not_burn, :paper, :leaf]
when 2
special_order = [:leaf, :paper, :not_burn, :paper]
when 3
special_order = [:paper, :leaf, :paper, :not_burn]
when 4
special_order = [:not_burn, :paper, :leaf, :paper]
else
raise ArgumentError, "特殊曜日の順序が不正です。"
end
puts Generator.__send__(place, begin_date, end_date, special_order)
end
end
end
| {'content_hash': '042478f3a8114ae997c3d9b117cf2ff5', 'timestamp': '', 'source': 'github', 'line_count': 33, 'max_line_length': 73, 'avg_line_length': 26.606060606060606, 'alnum_prop': 0.6104783599088838, 'repo_name': 'myokoym/gominohi', 'id': 'bbc14527e99f1e3ff51d27c5f33bf7805999e3c5', 'size': '928', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/gominohi/command.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '45574'}, {'name': 'Shell', 'bytes': '3046'}]} |
\chapter{Event API}
\index{Event API}
\input{api/event/info}
\section{GetEvent}
\index{GetEvent}
\label{Api:GetEvent}
\begin{lstlisting}[style=nonumbers]
RaptureEvent getEvent (
String eventUri
)
\end{lstlisting}
\begin{Verbatim}[formatcom=\color{Maroon}]
Entitlement: /event/admin
\end{Verbatim}
%\begin{lstlisting}[language=reflex]
%ret = #event.getEvent(eventUri);
%\end{lstlisting}
\input{api/event/getEvent}
\rule{12cm}{2pt}
\section{PutEvent}
\index{PutEvent}
\label{Api:PutEvent}
\begin{lstlisting}[style=nonumbers]
void putEvent (
RaptureEvent event
)
\end{lstlisting}
\begin{Verbatim}[formatcom=\color{Maroon}]
Entitlement: /event/admin
\end{Verbatim}
%\begin{lstlisting}[language=reflex]
%ret = #event.putEvent(event);
%\end{lstlisting}
\input{api/event/putEvent}
\rule{12cm}{2pt}
\section{DeleteEvent}
\index{DeleteEvent}
\label{Api:DeleteEvent}
\begin{lstlisting}[style=nonumbers]
void deleteEvent (
String eventUri
)
\end{lstlisting}
\begin{Verbatim}[formatcom=\color{Maroon}]
Entitlement: /event/admin
\end{Verbatim}
%\begin{lstlisting}[language=reflex]
%ret = #event.deleteEvent(eventUri);
%\end{lstlisting}
\input{api/event/deleteEvent}
\rule{12cm}{2pt}
\section{ListEventsByUriPrefix}
\index{ListEventsByUriPrefix}
\label{Api:ListEventsByUriPrefix}
\begin{lstlisting}[style=nonumbers]
List<RaptureFolderInfo> listEventsByUriPrefix (
String eventUriPrefix
)
\end{lstlisting}
\begin{Verbatim}[formatcom=\color{Maroon}]
Entitlement: /user/get
\end{Verbatim}
%\begin{lstlisting}[language=reflex]
%ret = #event.listEventsByUriPrefix(eventUriPrefix);
%\end{lstlisting}
\input{api/event/listEventsByUriPrefix}
\rule{12cm}{2pt}
\section{AddEventScript}
\index{AddEventScript}
\label{Api:AddEventScript}
\begin{lstlisting}[style=nonumbers]
void addEventScript (
String eventUri
String scriptUri
boolean performOnce
)
\end{lstlisting}
\begin{Verbatim}[formatcom=\color{Maroon}]
Entitlement: /event/admin
\end{Verbatim}
%\begin{lstlisting}[language=reflex]
%ret = #event.addEventScript(eventUri,scriptUri,performOnce);
%\end{lstlisting}
\input{api/event/addEventScript}
\rule{12cm}{2pt}
\section{DeleteEventScript}
\index{DeleteEventScript}
\label{Api:DeleteEventScript}
\begin{lstlisting}[style=nonumbers]
void deleteEventScript (
String eventUri
String scriptUri
)
\end{lstlisting}
\begin{Verbatim}[formatcom=\color{Maroon}]
Entitlement: /event/admin
\end{Verbatim}
%\begin{lstlisting}[language=reflex]
%ret = #event.deleteEventScript(eventUri,scriptUri);
%\end{lstlisting}
\input{api/event/deleteEventScript}
\rule{12cm}{2pt}
\section{AddEventMessage}
\index{AddEventMessage}
\label{Api:AddEventMessage}
\begin{lstlisting}[style=nonumbers]
void addEventMessage (
String eventUri
String name
String pipeline
Map<String,String> params
)
\end{lstlisting}
\begin{Verbatim}[formatcom=\color{Maroon}]
Entitlement: /event/admin
\end{Verbatim}
%\begin{lstlisting}[language=reflex]
%ret = #event.addEventMessage(eventUri,name,pipeline,params);
%\end{lstlisting}
\input{api/event/addEventMessage}
\rule{12cm}{2pt}
\section{DeleteEventMessage}
\index{DeleteEventMessage}
\label{Api:DeleteEventMessage}
\begin{lstlisting}[style=nonumbers]
void deleteEventMessage (
String eventUri
String name
)
\end{lstlisting}
\begin{Verbatim}[formatcom=\color{Maroon}]
Entitlement: /event/admin
\end{Verbatim}
%\begin{lstlisting}[language=reflex]
%ret = #event.deleteEventMessage(eventUri,name);
%\end{lstlisting}
\input{api/event/deleteEventMessage}
\rule{12cm}{2pt}
\section{AddEventNotification}
\index{AddEventNotification}
\label{Api:AddEventNotification}
\begin{lstlisting}[style=nonumbers]
void addEventNotification (
String eventUri
String name
String notification
Map<String,String> params
)
\end{lstlisting}
\begin{Verbatim}[formatcom=\color{Maroon}]
Entitlement: /event/admin
\end{Verbatim}
%\begin{lstlisting}[language=reflex]
%ret = #event.addEventNotification(eventUri,name,notification,params);
%\end{lstlisting}
\input{api/event/addEventNotification}
\rule{12cm}{2pt}
\section{DeleteEventNotification}
\index{DeleteEventNotification}
\label{Api:DeleteEventNotification}
\begin{lstlisting}[style=nonumbers]
void deleteEventNotification (
String eventUri
String name
)
\end{lstlisting}
\begin{Verbatim}[formatcom=\color{Maroon}]
Entitlement: /event/admin
\end{Verbatim}
%\begin{lstlisting}[language=reflex]
%ret = #event.deleteEventNotification(eventUri,name);
%\end{lstlisting}
\input{api/event/deleteEventNotification}
\rule{12cm}{2pt}
\section{AddEventWorkflow}
\index{AddEventWorkflow}
\label{Api:AddEventWorkflow}
\begin{lstlisting}[style=nonumbers]
void addEventWorkflow (
String eventUri
String name
String workflowUri
Map<String,String> params
)
\end{lstlisting}
\begin{Verbatim}[formatcom=\color{Maroon}]
Entitlement: /event/admin
\end{Verbatim}
%\begin{lstlisting}[language=reflex]
%ret = #event.addEventWorkflow(eventUri,name,workflowUri,params);
%\end{lstlisting}
\input{api/event/addEventWorkflow}
\rule{12cm}{2pt}
\section{DeleteEventWorkflow}
\index{DeleteEventWorkflow}
\label{Api:DeleteEventWorkflow}
\begin{lstlisting}[style=nonumbers]
void deleteEventWorkflow (
String eventUri
String name
)
\end{lstlisting}
\begin{Verbatim}[formatcom=\color{Maroon}]
Entitlement: /event/admin
\end{Verbatim}
%\begin{lstlisting}[language=reflex]
%ret = #event.deleteEventWorkflow(eventUri,name);
%\end{lstlisting}
\input{api/event/deleteEventWorkflow}
\rule{12cm}{2pt}
\section{RunEvent}
\index{RunEvent}
\label{Api:RunEvent}
\begin{lstlisting}[style=nonumbers]
boolean runEvent (
String eventUri
String associatedUri
String eventContext
)
\end{lstlisting}
\begin{Verbatim}[formatcom=\color{Maroon}]
Entitlement: /event/admin
\end{Verbatim}
%\begin{lstlisting}[language=reflex]
%ret = #event.runEvent(eventUri,associatedUri,eventContext);
%\end{lstlisting}
\input{api/event/runEvent}
\rule{12cm}{2pt}
\section{RunEventWithContext}
\index{RunEventWithContext}
\label{Api:RunEventWithContext}
\begin{lstlisting}[style=nonumbers]
RunEventHandle runEventWithContext (
String eventUri
String associatedUri
Map<String,String> eventContextMap
)
\end{lstlisting}
\begin{Verbatim}[formatcom=\color{Maroon}]
Entitlement: /event/admin
\end{Verbatim}
%\begin{lstlisting}[language=reflex]
%ret = #event.runEventWithContext(eventUri,associatedUri,eventContextMap);
%\end{lstlisting}
\input{api/event/runEventWithContext}
\rule{12cm}{2pt}
\section{EventExists}
\index{EventExists}
\label{Api:EventExists}
\begin{lstlisting}[style=nonumbers]
boolean eventExists (
String eventUri
)
\end{lstlisting}
\begin{Verbatim}[formatcom=\color{Maroon}]
Entitlement: /event/admin
\end{Verbatim}
%\begin{lstlisting}[language=reflex]
%ret = #event.eventExists(eventUri);
%\end{lstlisting}
\input{api/event/eventExists}
\rule{12cm}{2pt}
\section{DeleteEventsByUriPrefix}
\index{DeleteEventsByUriPrefix}
\label{Api:DeleteEventsByUriPrefix}
\begin{lstlisting}[style=nonumbers]
List<String> deleteEventsByUriPrefix (
String uriPrefix
)
\end{lstlisting}
\begin{Verbatim}[formatcom=\color{Maroon}]
Entitlement: /data/write/$f(uriPrefix)
\end{Verbatim}
%\begin{lstlisting}[language=reflex]
%ret = #event.deleteEventsByUriPrefix(uriPrefix);
%\end{lstlisting}
\input{api/event/deleteEventsByUriPrefix}
\rule{12cm}{2pt}
| {'content_hash': '2c51cf9eda83e9a5be56ac463fe0eff9', 'timestamp': '', 'source': 'github', 'line_count': 310, 'max_line_length': 74, 'avg_line_length': 25.258064516129032, 'alnum_prop': 0.729374201787995, 'repo_name': 'jgrabenstein/Rapture', 'id': '573da7955f401ed5f3d9bcfa9cab04b5ae8558fd', 'size': '7830', 'binary': False, 'copies': '6', 'ref': 'refs/heads/master', 'path': 'Doc/Rapture/api/Event.tex', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '165'}, {'name': 'C++', 'bytes': '352203'}, {'name': 'CMake', 'bytes': '964'}, {'name': 'CSS', 'bytes': '27828'}, {'name': 'GAP', 'bytes': '230464'}, {'name': 'HTML', 'bytes': '122944'}, {'name': 'Java', 'bytes': '8031304'}, {'name': 'JavaScript', 'bytes': '149972'}, {'name': 'PLpgSQL', 'bytes': '1760'}, {'name': 'Python', 'bytes': '50042'}, {'name': 'Ruby', 'bytes': '1150'}, {'name': 'Shell', 'bytes': '14152'}, {'name': 'Smalltalk', 'bytes': '30643'}, {'name': 'TeX', 'bytes': '724064'}, {'name': 'Thrift', 'bytes': '149'}, {'name': 'VimL', 'bytes': '900'}]} |
<?xml version="1.0"?>
<doc>
<assembly>
<name>EveLib.Core</name>
</assembly>
<members>
<member name="T:eZet.EveLib.Core.Cache.CacheType">
<summary>
Enum CacheType
</summary>
</member>
<member name="F:eZet.EveLib.Core.Cache.CacheType.Default">
<summary>
The default
</summary>
</member>
<member name="F:eZet.EveLib.Core.Cache.CacheType.ForceCache">
<summary>
The force cache
</summary>
</member>
<member name="F:eZet.EveLib.Core.Cache.CacheType.ForceRefresh">
<summary>
The force refresh
</summary>
</member>
<member name="T:eZet.EveLib.Core.Config">
<summary>
Provides configuration and constants for the library.
</summary>
</member>
<member name="F:eZet.EveLib.Core.Config.Separator">
<summary>
Directory Separator
</summary>
</member>
<member name="F:eZet.EveLib.Core.Config.AppData">
<summary>
relCachePath to ApplicationData folder.
</summary>
</member>
<member name="F:eZet.EveLib.Core.Config.ImagePath">
<summary>
relCachePath to image directory
</summary>
</member>
<member name="F:eZet.EveLib.Core.Config.CacheFactory">
<summary>
The cache factory
</summary>
</member>
<member name="F:eZet.EveLib.Core.Config.UserAgent">
<summary>
UserAgent used for HTTP requests
</summary>
</member>
<member name="T:eZet.EveLib.Core.Converters.BoolConverter">
<summary>
Class BoolConverter.
</summary>
</member>
<member name="T:eZet.EveLib.Core.EveLib">
<summary>
This is a class for general EveLib utilities and methods
</summary>
</member>
<member name="T:eZet.EveLib.Core.Util.EveLibApiBase">
<summary>
A base class for Eve Lib API modules.
</summary>
</member>
<member name="M:eZet.EveLib.Core.Util.EveLibApiBase.#ctor">
<summary>
Constructor
</summary>
</member>
<member name="M:eZet.EveLib.Core.Util.EveLibApiBase.#ctor(System.String,eZet.EveLib.Core.RequestHandlers.IRequestHandler)">
<summary>
Constructor
</summary>
<param name="uri"></param>
<param name="requestHandler"></param>
</member>
<member name="M:eZet.EveLib.Core.Util.EveLibApiBase.requestAsync``1(System.String)">
<summary>
Performs a request using the request handler.
</summary>
<typeparam name="T">Response type</typeparam>
<param name="relPath">Relative path</param>
<returns></returns>
</member>
<member name="P:eZet.EveLib.Core.Util.EveLibApiBase.RequestHandler">
<summary>
Gets or sets the request handler used by this instance
</summary>
</member>
<member name="P:eZet.EveLib.Core.Util.EveLibApiBase.Host">
<summary>
Gets or sets the base URI used to access this API.
</summary>
</member>
<member name="P:eZet.EveLib.Core.Util.EveLibApiBase.ApiPath">
<summary>
Gets or sets the path to the API root relative to Host.
</summary>
</member>
<member name="M:eZet.EveLib.Core.EveLib.#ctor">
<summary>
Default constructor
</summary>
</member>
<member name="M:eZet.EveLib.Core.EveLib.RequestJsonAsync(System.String)">
<summary>
Requests and deserializes JSON content to a dynamic object
</summary>
<param name="uri">URI to request</param>
<returns></returns>
</member>
<member name="M:eZet.EveLib.Core.EveLib.RequestJson(System.String)">
<summary>
Requests and deserializes JSON content to a dynamic object
</summary>
<param name="uri">URI to request</param>
<returns></returns>
</member>
<member name="M:eZet.EveLib.Core.EveLib.RequestXmlAsync(System.String)">
<summary>
Requests and deserializes XML content to a dynamic object. Not implemented yet.
</summary>
<param name="uri">URI to request</param>
<returns></returns>
</member>
<member name="M:eZet.EveLib.Core.EveLib.RequestXml(System.String)">
<summary>
Requests and deserializes XML content to a dynamic object. Not implemented yet.
</summary>
<param name="uri">URI to request</param>
<returns></returns>
</member>
<member name="T:eZet.EveLib.Core.Exceptions.EveLibWebException">
<summary>
Base for EveLib WebExceptions
</summary>
</member>
<member name="T:eZet.EveLib.Core.Exceptions.EveLibException">
<summary>
Base for all EveLib Exceptions
</summary>
</member>
<member name="M:eZet.EveLib.Core.Exceptions.EveLibException.#ctor(System.String)">
<summary>
Constructor
</summary>
<param name="message"></param>
</member>
<member name="M:eZet.EveLib.Core.Exceptions.EveLibException.#ctor(System.String,System.Exception)">
<summary>
Constructor
</summary>
<param name="message"></param>
<param name="iException"></param>
</member>
<member name="M:eZet.EveLib.Core.Exceptions.EveLibWebException.#ctor(System.String,System.Net.WebException)">
<summary>
Constructor
</summary>
<param name="message"></param>
<param name="iException"></param>
</member>
<member name="P:eZet.EveLib.Core.Exceptions.EveLibWebException.WebException">
<summary>
The inner exception
</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.CanBeNullAttribute">
<summary>
Indicates that the value of the marked element could be <c>null</c> sometimes,
so the check for <c>null</c> is necessary before its usage
</summary>
<example>
<code>
[CanBeNull] public object Test() { return null; }
public void UseTest() {
var p = Test();
var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
}
</code>
</example>
</member>
<member name="T:eZet.EveLib.Core.Properties.NotNullAttribute">
<summary>
Indicates that the value of the marked element could never be <c>null</c>
</summary>
<example>
<code>
[NotNull] public object Foo() {
return null; // Warning: Possible 'null' assignment
}
</code>
</example>
</member>
<member name="T:eZet.EveLib.Core.Properties.StringFormatMethodAttribute">
<summary>
Indicates that the marked method builds string by format pattern and (optional) arguments.
Parameter, which contains format string, should be given in constructor. The format string
should be in <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/>-like form
</summary>
<example>
<code>
[StringFormatMethod("message")]
public void ShowError(string message, params object[] args) { /* do something */ }
public void Foo() {
ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
}
</code>
</example>
</member>
<member name="M:eZet.EveLib.Core.Properties.StringFormatMethodAttribute.#ctor(System.String)">
<param name="formatParameterName">
Specifies which parameter of an annotated method should be treated as format-string
</param>
</member>
<member name="T:eZet.EveLib.Core.Properties.InvokerParameterNameAttribute">
<summary>
Indicates that the function argument should be string literal and match one
of the parameters of the caller function. For example, ReSharper annotates
the parameter of <see cref="T:System.ArgumentNullException"/>
</summary>
<example>
<code>
public void Foo(string param) {
if (param == null)
throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol
}
</code>
</example>
</member>
<member name="T:eZet.EveLib.Core.Properties.NotifyPropertyChangedInvocatorAttribute">
<summary>
Indicates that the method is contained in a type that implements
<see cref="T:System.ComponentModel.INotifyPropertyChanged"/> interface
and this method is used to notify that some property value changed
</summary>
<remarks>
The method should be non-static and conform to one of the supported signatures:
<list>
<item>
<c>NotifyChanged(string)</c>
</item>
<item>
<c>NotifyChanged(params string[])</c>
</item>
<item>
<c>NotifyChanged{T}(Expression{Func{T}})</c>
</item>
<item>
<c>NotifyChanged{T,U}(Expression{Func{T,U}})</c>
</item>
<item>
<c>SetProperty{T}(ref T, T, string)</c>
</item>
</list>
</remarks>
<example>
<code>
public class Foo : INotifyPropertyChanged {
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void NotifyChanged(string propertyName) { ... }
private string _name;
public string CharacterName {
get { return _name; }
set { _name = value; NotifyChanged("LastName"); /* Warning */ }
}
}
</code>
Examples of generated notifications:
<list>
<item>
<c>NotifyChanged("Property")</c>
</item>
<item>
<c>NotifyChanged(() => Property)</c>
</item>
<item>
<c>NotifyChanged((VM x) => x.Property)</c>
</item>
<item>
<c>SetProperty(ref myField, value, "Property")</c>
</item>
</list>
</example>
</member>
<member name="T:eZet.EveLib.Core.Properties.ContractAnnotationAttribute">
<summary>
Describes dependency between method input and output
</summary>
<syntax>
<p>Function Definition Table syntax:</p>
<list>
<item>FDT ::= FDTRow [;FDTRow]*</item>
<item>FDTRow ::= Input => Output | Output <= Input</item>
<item>Input ::= ParameterName: Value [, Input]*</item>
<item>Output ::= [ParameterName: Value]* {halt|stop|void|nothing|Value}</item>
<item>Value ::= true | false | null | notnull | canbenull</item>
</list>
If method has single input parameter, it's name could be omitted.<br />
Using <c>halt</c> (or <c>void</c>/<c>nothing</c>, which is the same)
for method output means that the methos doesn't return normally.<br />
<c>canbenull</c> annotation is only applicable for output parameters.<br />
You can use multiple <c>[ContractAnnotation]</c> for each FDT row,
or use single attribute with rows separated by semicolon.<br />
</syntax>
<examples>
<list>
<item>
<code>
[ContractAnnotation("=> halt")]
public void TerminationMethod()
</code>
</item>
<item>
<code>
[ContractAnnotation("halt <= condition: false")]
public void Assert(bool condition, string text) // regular assertion method
</code>
</item>
<item>
<code>
[ContractAnnotation("s:null => true")]
public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty()
</code>
</item>
<item>
<code>
// A method that returns null if the parameter is null, and not null if the parameter is not null
[ContractAnnotation("null => null; notnull => notnull")]
public object Transform(object data)
</code>
</item>
<item>
<code>
[ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")]
public bool TryParse(string s, out Person result)
</code>
</item>
</list>
</examples>
</member>
<member name="T:eZet.EveLib.Core.Properties.LocalizationRequiredAttribute">
<summary>
Indicates that marked element should be localized or not
</summary>
<example>
<code>
[LocalizationRequiredAttribute(true)]
public class Foo {
private string str = "my string"; // Warning: Localizable string
}
</code>
</example>
</member>
<member name="T:eZet.EveLib.Core.Properties.CannotApplyEqualityOperatorAttribute">
<summary>
Indicates that the value of the marked type (or its derivatives)
cannot be compared using '==' or '!=' operators and <c>Equals()</c>
should be used instead. However, using '==' or '!=' for comparison
with <c>null</c> is always permitted.
</summary>
<example>
<code>
[CannotApplyEqualityOperator]
class NoEquality { }
class UsesNoEquality {
public void Test() {
var ca1 = new NoEquality();
var ca2 = new NoEquality();
if (ca1 != null) { // OK
bool condition = ca1 == ca2; // Warning
}
}
}
</code>
</example>
</member>
<member name="T:eZet.EveLib.Core.Properties.BaseTypeRequiredAttribute">
<summary>
When applied to a target attribute, specifies a requirement for any type marked
with the target attribute to implement or inherit specific type or types.
</summary>
<example>
<code>
[BaseTypeRequired(typeof(IComponent)] // Specify requirement
public class ComponentAttribute : Attribute { }
[Component] // ComponentAttribute requires implementing IComponent interface
public class MyComponent : IComponent { }
</code>
</example>
</member>
<member name="T:eZet.EveLib.Core.Properties.UsedImplicitlyAttribute">
<summary>
Indicates that the marked symbol is used implicitly
(e.g. via reflection, in external library), so this symbol
will not be marked as unused (as well as by other usage inspections)
</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.MeansImplicitUseAttribute">
<summary>
Should be used on attributes and causes ReSharper
to not mark symbols marked with such attributes as unused
(as well as by other usage inspections)
</summary>
</member>
<member name="F:eZet.EveLib.Core.Properties.ImplicitUseKindFlags.Access">
<summary>Only entity marked with attribute considered used</summary>
</member>
<member name="F:eZet.EveLib.Core.Properties.ImplicitUseKindFlags.Assign">
<summary>Indicates implicit assignment to a member</summary>
</member>
<member name="F:eZet.EveLib.Core.Properties.ImplicitUseKindFlags.InstantiatedWithFixedConstructorSignature">
<summary>
Indicates implicit instantiation of a type with fixed constructor signature.
That means any unused constructor parameters won't be reported as such.
</summary>
</member>
<member name="F:eZet.EveLib.Core.Properties.ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature">
<summary>Indicates implicit instantiation of a type</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.ImplicitUseTargetFlags">
<summary>
Specify what is considered used implicitly
when marked with <see cref="T:eZet.EveLib.Core.Properties.MeansImplicitUseAttribute"/>
or <see cref="T:eZet.EveLib.Core.Properties.UsedImplicitlyAttribute"/>
</summary>
</member>
<member name="F:eZet.EveLib.Core.Properties.ImplicitUseTargetFlags.Members">
<summary>Members of entity marked with attribute are considered used</summary>
</member>
<member name="F:eZet.EveLib.Core.Properties.ImplicitUseTargetFlags.WithMembers">
<summary>Entity marked with attribute and all its members considered used</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.PublicAPIAttribute">
<summary>
This attribute is intended to mark publicly available API
which should not be removed and so is treated as used
</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.InstantHandleAttribute">
<summary>
Tells code analysis engine if the parameter is completely handled
when the invoked method is on stack. If the parameter is a delegate,
indicates that delegate is executed while the method is executed.
If the parameter is an enumerable, indicates that it is enumerated
while the method is executed
</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.PureAttribute">
<summary>
Indicates that a method does not make any observable state changes.
The same as <c>System.Diagnostics.Contracts.PureAttribute</c>
</summary>
<example>
<code>
[Pure] private int Multiply(int x, int y) { return x * y; }
public void Foo() {
const int a = 2, b = 2;
Multiply(a, b); // Waring: Return value of pure method is not used
}
</code>
</example>
</member>
<member name="T:eZet.EveLib.Core.Properties.PathReferenceAttribute">
<summary>
Indicates that a parameter is a path to a file or a folder
within a web project. relCachePath can be relative or absolute,
starting from web root (~)
</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.AspMvcActionAttribute">
<summary>
ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter
is an MVC action. If applied to a method, the MVC action name is calculated
implicitly from the context. Use this attribute for custom wrappers similar to
<c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String)</c>
</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.AspMvcAreaAttribute">
<summary>
ASP.NET MVC attribute. Indicates that a parameter is an MVC area.
Use this attribute for custom wrappers similar to
<c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String)</c>
</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.AspMvcControllerAttribute">
<summary>
ASP.NET MVC attribute. If applied to a parameter, indicates that
the parameter is an MVC controller. If applied to a method,
the MVC controller name is calculated implicitly from the context.
Use this attribute for custom wrappers similar to
<c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String, String)</c>
</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.AspMvcMasterAttribute">
<summary>
ASP.NET MVC attribute. Indicates that a parameter is an MVC Master.
Use this attribute for custom wrappers similar to
<c>System.Web.Mvc.Controller.View(String, String)</c>
</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.AspMvcModelTypeAttribute">
<summary>
ASP.NET MVC attribute. Indicates that a parameter is an MVC model type.
Use this attribute for custom wrappers similar to
<c>System.Web.Mvc.Controller.View(String, Object)</c>
</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.AspMvcPartialViewAttribute">
<summary>
ASP.NET MVC attribute. If applied to a parameter, indicates that
the parameter is an MVC partial view. If applied to a method,
the MVC partial view name is calculated implicitly from the context.
Use this attribute for custom wrappers similar to
<c>System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String)</c>
</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.AspMvcSupressViewErrorAttribute">
<summary>
ASP.NET MVC attribute. Allows disabling all inspections
for MVC views within a class or a method.
</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.AspMvcDisplayTemplateAttribute">
<summary>
ASP.NET MVC attribute. Indicates that a parameter is an MVC display template.
Use this attribute for custom wrappers similar to
<c>System.Web.Mvc.Html.DisplayExtensions.DisplayForModel(HtmlHelper, String)</c>
</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.AspMvcEditorTemplateAttribute">
<summary>
ASP.NET MVC attribute. Indicates that a parameter is an MVC editor template.
Use this attribute for custom wrappers similar to
<c>System.Web.Mvc.Html.EditorExtensions.EditorForModel(HtmlHelper, String)</c>
</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.AspMvcTemplateAttribute">
<summary>
ASP.NET MVC attribute. Indicates that a parameter is an MVC template.
Use this attribute for custom wrappers similar to
<c>System.ComponentModel.DataAnnotations.UIHintAttribute(System.String)</c>
</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.AspMvcViewAttribute">
<summary>
ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter
is an MVC view. If applied to a method, the MVC view name is calculated implicitly
from the context. Use this attribute for custom wrappers similar to
<c>System.Web.Mvc.Controller.View(Object)</c>
</summary>
</member>
<member name="T:eZet.EveLib.Core.Properties.AspMvcActionSelectorAttribute">
<summary>
ASP.NET MVC attribute. When applied to a parameter of an attribute,
indicates that this parameter is an MVC action name
</summary>
<example>
<code>
[ActionName("Foo")]
public ActionResult Login(string returnUrl) {
ViewBag.ReturnUrl = Url.Action("Foo"); // OK
return RedirectToAction("Bar"); // Error: Cannot resolve action
}
</code>
</example>
</member>
<member name="T:eZet.EveLib.Core.Properties.RazorSectionAttribute">
<summary>
Razor attribute. Indicates that a parameter or a method is a Razor section.
Use this attribute for custom wrappers similar to
<c>System.Web.WebPages.WebPageBase.RenderSection(String)</c>
</summary>
</member>
<member name="T:eZet.EveLib.Core.RequestHandlers.CacheLevel">
<summary>
Enum CacheLevel
</summary>
</member>
<member name="F:eZet.EveLib.Core.RequestHandlers.CacheLevel.Default">
<summary>
Satisfies the request by using local cache if available, or by sending a request to the server if needed. New
requests may be stored in local cache.
</summary>
</member>
<member name="F:eZet.EveLib.Core.RequestHandlers.CacheLevel.BypassCache">
<summary>
Bypasses cache complete. A new request will be sent to the server. No entries will be added to or removed from the
cache.
</summary>
</member>
<member name="F:eZet.EveLib.Core.RequestHandlers.CacheLevel.Refresh">
<summary>
A request will be sent to the server. Outdated cache will be removed, and a new entry may be stored.
</summary>
</member>
<member name="F:eZet.EveLib.Core.RequestHandlers.CacheLevel.CacheOnly">
<summary>
Will serve the request from the local cache if any. If no cache is available, the request will return null.
</summary>
</member>
<member name="T:eZet.EveLib.Core.RequestHandlers.IImageRequestHandler">
<summary>
Interface for requesting images from URIs
</summary>
</member>
<member name="M:eZet.EveLib.Core.RequestHandlers.IImageRequestHandler.RequestImageDataAsync(System.Uri)">
<summary>
Requests and returns image data
</summary>
<param name="uri">URI to request</param>
<returns>The image data</returns>
</member>
<member name="M:eZet.EveLib.Core.RequestHandlers.IImageRequestHandler.RequestImageAsync(System.Uri,System.String)">
<summary>
Requests image and saves it to a file.
</summary>
<param name="uri">URI to request</param>
<param name="file">File to save image as.</param>
<returns>The task</returns>
</member>
<member name="T:eZet.EveLib.Core.RequestHandlers.ImageRequestHandler">
<summary>
Simple implementation for requesting images
</summary>
</member>
<member name="M:eZet.EveLib.Core.RequestHandlers.ImageRequestHandler.RequestImageDataAsync(System.Uri)">
<summary>
Requests and returns image data
</summary>
<param name="uri">URI to request</param>
<returns>The image data</returns>
</member>
<member name="M:eZet.EveLib.Core.RequestHandlers.ImageRequestHandler.RequestImageAsync(System.Uri,System.String)">
<summary>
Requests image and saves it to a file.
</summary>
<param name="uri">URI to request</param>
<param name="file">File to save image as.</param>
<returns>The task</returns>
</member>
<member name="T:eZet.EveLib.Core.Util.AsyncHelpers">
<summary>
Class AsyncHelpers.
</summary>
</member>
<member name="M:eZet.EveLib.Core.Util.AsyncHelpers.RunSync(System.Func{System.Threading.Tasks.Task})">
<summary>
Runs the synchronize.
</summary>
<param name="task">The task.</param>
</member>
<member name="M:eZet.EveLib.Core.Util.AsyncHelpers.RunSync``1(System.Func{System.Threading.Tasks.Task{``0}})">
<summary>
Runs the synchronize.
</summary>
<typeparam name="T"></typeparam>
<param name="task">The task.</param>
<returns>T.</returns>
</member>
<member name="T:eZet.EveLib.Core.Util.AsyncHelpers.ExclusiveSynchronizationContext">
<summary>
Class ExclusiveSynchronizationContext.
</summary>
</member>
<member name="M:eZet.EveLib.Core.Util.AsyncHelpers.ExclusiveSynchronizationContext.Send(System.Threading.SendOrPostCallback,System.Object)">
<summary>
When overridden in a derived class, dispatches a synchronous message to a synchronization context.
</summary>
<param name="d">The <see cref="T:System.Threading.SendOrPostCallback"/> delegate to call.</param>
<param name="state">The object passed to the delegate.</param>
<exception cref="T:System.NotSupportedException">We cannot send to our same thread</exception>
</member>
<member name="M:eZet.EveLib.Core.Util.AsyncHelpers.ExclusiveSynchronizationContext.Post(System.Threading.SendOrPostCallback,System.Object)">
<summary>
When overridden in a derived class, dispatches an asynchronous message to a synchronization context.
</summary>
<param name="d">The <see cref="T:System.Threading.SendOrPostCallback" /> delegate to call.</param>
<param name="state">The object passed to the delegate.</param>
</member>
<member name="M:eZet.EveLib.Core.Util.AsyncHelpers.ExclusiveSynchronizationContext.EndMessageLoop">
<summary>
Ends the message loop.
</summary>
</member>
<member name="M:eZet.EveLib.Core.Util.AsyncHelpers.ExclusiveSynchronizationContext.BeginMessageLoop">
<summary>
Begins the message loop.
</summary>
<exception cref="T:System.AggregateException">AsyncHelpers.Run method threw an exception.</exception>
</member>
<member name="M:eZet.EveLib.Core.Util.AsyncHelpers.ExclusiveSynchronizationContext.CreateCopy">
<summary>
When overridden in a derived class, creates a copy of the synchronization context.
</summary>
<returns>A new <see cref="T:System.Threading.SynchronizationContext" /> object.</returns>
</member>
<member name="P:eZet.EveLib.Core.Util.AsyncHelpers.ExclusiveSynchronizationContext.InnerException">
<summary>
Gets or sets the inner exception.
</summary>
<value>The inner exception.</value>
</member>
<member name="T:eZet.EveLib.Core.Util.AsyncLazy`1">
<summary>
Provides support for asynchronous lazy initialization. This type is fully threadsafe.
</summary>
<typeparam name="T">The type of object that is being asynchronously initialized.</typeparam>
</member>
<member name="F:eZet.EveLib.Core.Util.AsyncLazy`1._instance">
<summary>
The underlying lazy task.
</summary>
</member>
<member name="M:eZet.EveLib.Core.Util.AsyncLazy`1.#ctor(System.Func{`0})">
<summary>
Initializes a new instance of the <see cref="T:eZet.EveLib.Core.Util.AsyncLazy`1"/> class.
</summary>
<param name="factory">The delegate that is invoked on a background thread to produce the value when it is needed.</param>
</member>
<member name="M:eZet.EveLib.Core.Util.AsyncLazy`1.#ctor(System.Func{System.Threading.Tasks.Task{`0}})">
<summary>
Initializes a new instance of the <see cref="T:eZet.EveLib.Core.Util.AsyncLazy`1"/> class.
</summary>
<param name="factory">
The asynchronous delegate that is invoked on a background thread to produce the value when it is
needed.
</param>
</member>
<member name="M:eZet.EveLib.Core.Util.AsyncLazy`1.GetAwaiter">
<summary>
Asynchronous infrastructure support. This method permits instances of
<see cref="T:eZet.EveLib.Core.Util.AsyncLazy`1"/> to be
awaited.
</summary>
<returns>TaskAwaiter<T>.</returns>
</member>
<member name="M:eZet.EveLib.Core.Util.AsyncLazy`1.ConfigureAwait(System.Boolean)">
<summary>
Configures the await.
</summary>
<param name="val">if set to <c>true</c> [value].</param>
<returns>ConfiguredTaskAwaitable<T>.</returns>
</member>
<member name="M:eZet.EveLib.Core.Util.AsyncLazy`1.Start">
<summary>
Starts the asynchronous initialization, if it has not already started.
</summary>
</member>
<member name="T:eZet.EveLib.Core.Serializers.JsonSerializer">
<summary>
JSON serializer
</summary>
</member>
<member name="T:eZet.EveLib.Core.Serializers.ISerializer">
<summary>
Interface for deserializing objects.
</summary>
</member>
<member name="M:eZet.EveLib.Core.Serializers.ISerializer.Deserialize``1(System.String)">
<summary>
Deserializes data.
</summary>
<typeparam name="T">Type to deserialize to.</typeparam>
<param name="data">String of data to deserialize.</param>
<returns></returns>
</member>
<member name="M:eZet.EveLib.Core.Serializers.JsonSerializer.eZet#EveLib#Core#Serializers#ISerializer#Deserialize``1(System.String)">
<summary>
Deserializes JSON
</summary>
<param name="data">A JSON string</param>
<returns></returns>
</member>
<member name="T:eZet.EveLib.Core.Util.AsyncFileUtilities">
<summary>
Async file utilities
</summary>
</member>
<member name="M:eZet.EveLib.Core.Util.AsyncFileUtilities.ReadAllTextAsync(System.String)">
<summary>
Reads all test async
</summary>
<param name="filePath"></param>
<returns></returns>
</member>
<member name="M:eZet.EveLib.Core.Util.AsyncFileUtilities.ReadAllLinesAsync(System.String)">
<summary>
Reads all lines async
</summary>
<param name="filePath"></param>
<returns></returns>
</member>
<member name="M:eZet.EveLib.Core.Util.AsyncFileUtilities.WriteAllTextAsync(System.String,System.String)">
<summary>
Writes all test async
</summary>
<param name="filePath"></param>
<param name="text"></param>
<returns></returns>
</member>
<member name="M:eZet.EveLib.Core.Util.AsyncFileUtilities.WriteAllLinesAsync(System.String,System.Collections.Generic.IEnumerable{System.String})">
<summary>
Writes all lines async
</summary>
<param name="filePath"></param>
<param name="lines"></param>
<returns></returns>
</member>
<member name="T:eZet.EveLib.Core.RequestHandlers.ICachedRequestHandler">
<summary>
Interface for a cache enabled request handler
</summary>
</member>
<member name="T:eZet.EveLib.Core.RequestHandlers.IRequestHandler">
<summary>
Interface for Request Handlers
</summary>
</member>
<member name="M:eZet.EveLib.Core.RequestHandlers.IRequestHandler.RequestAsync``1(System.Uri)">
<summary>
Performs a request and returns the deserialized response content
</summary>
<typeparam name="T">Type to deserialize to</typeparam>
<param name="uri">URI to request</param>
<returns>Deserialized response</returns>
</member>
<member name="P:eZet.EveLib.Core.RequestHandlers.IRequestHandler.Serializer">
<summary>
Gets or sets the serializer used to deserialize data
</summary>
</member>
<member name="P:eZet.EveLib.Core.RequestHandlers.ICachedRequestHandler.Cache">
<summary>
Gets or sets the cache used by this request handler
</summary>
</member>
<member name="P:eZet.EveLib.Core.RequestHandlers.ICachedRequestHandler.CacheLevel">
<summary>
Gets or sets the cache level.
</summary>
<value>The cache level.</value>
</member>
<member name="T:eZet.EveLib.Core.Cache.IEveLibCache">
<summary>
Interface for CacheExpiratoinRegisters
</summary>
</member>
<member name="M:eZet.EveLib.Core.Cache.IEveLibCache.StoreAsync(System.Uri,System.DateTime,System.String)">
<summary>
Stores data to the cache
</summary>
<param name="uri">The uri this caches</param>
<param name="cacheTime">The cache expiry time</param>
<param name="data">The data to cache</param>
<returns></returns>
</member>
<member name="M:eZet.EveLib.Core.Cache.IEveLibCache.LoadAsync(System.Uri)">
<summary>
Loads data from cache
</summary>
<param name="uri">The uri to load cache for</param>
<returns>The cached data</returns>
</member>
<member name="M:eZet.EveLib.Core.Cache.IEveLibCache.TryGetExpirationDate(System.Uri,System.DateTime@)">
<summary>
Attempts to get the CachedUntil date for a uri.
</summary>
<param name="uri">The uri to look up.</param>
<param name="value">A DateTime instance to store the date in.</param>
<returns>True if an entry was retrieved, otherwise false.</returns>
</member>
<member name="T:eZet.EveLib.Core.RequestHandlers.RequestHandler">
<summary>
A basic RequestHandler with no special handling.
</summary>
</member>
<member name="M:eZet.EveLib.Core.RequestHandlers.RequestHandler.#ctor(eZet.EveLib.Core.Serializers.ISerializer)">
<summary>
Constructor
</summary>
<param name="serializer">Serializer to use for deserialization</param>
</member>
<member name="M:eZet.EveLib.Core.RequestHandlers.RequestHandler.RequestAsync``1(System.Uri)">
<summary>
Performs a request against the specified URI, and returns the deserialized data.
</summary>
<typeparam name="T">Type to deserialize to</typeparam>
<param name="uri">URI to request</param>
<returns></returns>
</member>
<member name="P:eZet.EveLib.Core.RequestHandlers.RequestHandler.Serializer">
<summary>
Gets or sets the ISerializer used to deserialize response data.
</summary>
</member>
<member name="T:eZet.EveLib.Core.Serializers.XmlSerializer">
<summary>
A simple wrapper for .NET XmlSerializer.
</summary>
</member>
<member name="M:eZet.EveLib.Core.Serializers.XmlSerializer.eZet#EveLib#Core#Serializers#ISerializer#Deserialize``1(System.String)">
<summary>
Deserializes Eve API xml using the .NET XmlSerializer.
</summary>
<typeparam name="T">An xml result type</typeparam>
<param name="data">An XML string</param>
<returns></returns>
</member>
<member name="T:eZet.EveLib.Core.Util.HttpRequestHelper">
<summary>
Helper class for performing web requests
</summary>
</member>
<member name="F:eZet.EveLib.Core.Util.HttpRequestHelper.ContentType">
<summary>
Default content type
</summary>
</member>
<member name="M:eZet.EveLib.Core.Util.HttpRequestHelper.CreateRequest(System.Uri)">
<summary>
Creates a new HttpWebRequest for the specified URI, and returns it
</summary>
<param name="uri">URI to create request for</param>
<returns>The HttpWebRequest</returns>
</member>
<member name="M:eZet.EveLib.Core.Util.HttpRequestHelper.RequestAsync(System.Uri)">
<summary>
Performs a web request against the specified URI, and returns the response content
</summary>
<param name="uri">URI to request</param>
<returns>The response content</returns>
</member>
<member name="M:eZet.EveLib.Core.Util.HttpRequestHelper.AddPostData(System.Net.HttpWebRequest,System.String)">
<summary>
Adds the post data.
</summary>
<param name="request">The request.</param>
<param name="postData">The post data.</param>
</member>
<member name="M:eZet.EveLib.Core.Util.HttpRequestHelper.GetResponseAsync(System.Net.HttpWebRequest)">
<summary>
Executes a web request using the given request, and returns the HttpWebResponse
</summary>
<param name="request">The web request</param>
<returns></returns>
</member>
<member name="M:eZet.EveLib.Core.Util.HttpRequestHelper.GetResponseContentAsync(System.Net.HttpWebResponse)">
<summary>
Extracts and returns the response content from a HttpWebResponse
</summary>
<param name="response">The HttpWebResponse</param>
<returns></returns>
</member>
<member name="M:eZet.EveLib.Core.Util.HttpRequestHelper.GetResponseContentAsync(System.Net.HttpWebRequest)">
<summary>
Executes, exctracts and returns response content for a HttpWebRequest
</summary>
<param name="request">The HttpWebRequest</param>
<returns></returns>
</member>
<member name="T:eZet.EveLib.Core.Cache.EveLibFileCache">
<summary>
Simple plain file cache implementation
</summary>
</member>
<member name="M:eZet.EveLib.Core.Cache.EveLibFileCache.#ctor(System.String,System.String)">
<summary>
Initializes a new instance of the <see cref="T:eZet.EveLib.Core.Cache.EveLibFileCache"/> class.
</summary>
<param name="cachePath">The relative cache path.</param>
<param name="cacheRegisterName">Name of the cache register.</param>
</member>
<member name="M:eZet.EveLib.Core.Cache.EveLibFileCache.StoreAsync(System.Uri,System.DateTime,System.String)">
<summary>
Stores data to the cache
</summary>
<param name="uri">The uri this caches</param>
<param name="cacheTime">The cache expiry time</param>
<param name="data">The data to cache</param>
<returns></returns>
</member>
<member name="M:eZet.EveLib.Core.Cache.EveLibFileCache.LoadAsync(System.Uri)">
<summary>
Loads data from cache
</summary>
<param name="uri">The uri to load cache for</param>
<returns>The cached data</returns>
</member>
<member name="M:eZet.EveLib.Core.Cache.EveLibFileCache.TryGetExpirationDate(System.Uri,System.DateTime@)">
<summary>
Gets the cache expiry time for specified uri
</summary>
<param name="uri"></param>
<param name="value"></param>
<returns></returns>
</member>
<member name="P:eZet.EveLib.Core.Cache.EveLibFileCache.CachePath">
<summary>
Gets the cache path.
</summary>
<value>The cache path.</value>
</member>
<member name="P:eZet.EveLib.Core.Cache.EveLibFileCache.CacheRegister">
<summary>
Gets the cache register.
</summary>
<value>The cache register.</value>
</member>
</members>
</doc>
| {'content_hash': '272438f4f2a3dbe054035cf89fe5c143', 'timestamp': '', 'source': 'github', 'line_count': 1020, 'max_line_length': 154, 'avg_line_length': 45.90392156862745, 'alnum_prop': 0.5643287343556448, 'repo_name': 'write-only/ApiProbe', 'id': '0ded7a0ec982bf87338638eeb2cf22120c356242', 'size': '46822', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'packages/eZet.EveLib.Core.3.0.2.0/lib/net45/EveLib.Core.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '20189'}]} |
<?php
return [
// Setup form fields
'setup' => [
'email' => 'E-Mail',
'username' => 'Benutzername',
'password' => 'Passwort',
'site_name' => 'Seitenname',
'site_domain' => 'Domain ihrer Seite',
'site_timezone' => 'Wählen Sie Ihre Zeitzone',
'site_locale' => 'Wählen Sie Ihre Sprache',
'enable_google2fa' => 'Google Zwei-Faktor-Authentifizierung aktivieren',
'cache_driver' => 'Cache-Treiber',
'session_driver' => 'Sitzungs-Treiber',
],
// Login form fields
'login' => [
'login' => 'Nazwa użytkownika lub e-mail',
'email' => 'E-Mail',
'password' => 'Passwort',
'2fauth' => 'Authentifizierungscode',
'invalid' => 'Nieprawidłowa nazwa użytkownika lub hasło',
'invalid-token' => 'Token ist ungültig',
'cookies' => 'Sie müssen Cookies aktivieren um sich anzumelden.',
'rate-limit' => 'Rate limit exceeded.',
],
// Incidents form fields
'incidents' => [
'name' => 'Name',
'status' => 'Status',
'component' => 'Komponente',
'message' => 'Nachricht',
'message-help' => 'Sie können auch Markdown verwenden.',
'scheduled_at' => 'Für wann ist die Wartung geplant?',
'incident_time' => 'Wann ist dieser Vorfall aufgetreten?',
'notify_subscribers' => 'Abonnenten benachrichtigen',
'visibility' => 'Widoczność zdarzenia',
'public' => 'Öffentlich sichtbar',
'logged_in_only' => 'Nur für angemeldete Benutzer sichtbar',
'templates' => [
'name' => 'Name',
'template' => 'Vorlage',
'twig' => 'Szablony wydarzeń mogą korzystać z języka szablonów <a href="http://twig.sensiolabs.org/" target="_blank">Twig</a>.',
],
],
// Components form fields
'components' => [
'name' => 'Name',
'status' => 'Status',
'group' => 'Gruppe',
'description' => 'Beschreibung',
'link' => 'Link',
'tags' => 'Schlagwörter',
'tags-help' => 'Durch Kommata trennen.',
'enabled' => 'Component enabled?',
'groups' => [
'name' => 'Name',
'collapsing' => 'Wybierz widoczność grupy',
'visible' => 'Zawsze rozwinięte',
'collapsed' => 'Domyślnie zwiń grupę',
'collapsed_incident' => 'Zwiń grupę, ale rozwiń ją w razie problemów',
],
],
// Metric form fields
'metrics' => [
'name' => 'Name',
'suffix' => 'Suffix',
'description' => 'Beschreibung',
'description-help' => 'Sie können auch Markdown verwenden.',
'display-chart' => 'Diagramm auf der Statusseite anzeigen?',
'default-value' => 'Standardwert',
'calc_type' => 'Berechnung der Metrik',
'type_sum' => 'Summe',
'type_avg' => 'Durchschnitt',
'places' => 'Miejsca dziesiętne',
'default_view' => 'Domyślny widok',
'threshold' => 'Ile minut przerwy między punktami metrycznymi?',
'points' => [
'value' => 'Wert',
],
],
// Settings
'settings' => [
/// Application setup
'app-setup' => [
'site-name' => 'Seitenname',
'site-url' => 'URL ihrer Seite',
'display-graphs' => 'Graphen auf der Statusseite anzeigen?',
'about-this-page' => 'Über diese Seite',
'days-of-incidents' => 'Wie viele Tage mit Vorfällen sollen gezeigt werden?',
'banner' => 'Banner',
'banner-help' => 'Es wird empfohlen, dass Sie keine Dateien die breiter als 930 Pixel sind hochladen .',
'subscribers' => 'Personen die Anmeldung für E-Mail-Benachrichtigung erlauben?',
'automatic_localization' => 'Automatycznie tłumaczyć twoją stronę statusu na język odwiedzającego?',
],
'analytics' => [
'analytics_google' => 'Google Analytics Code',
'analytics_gosquared' => 'GoSquared Analytics Code',
'analytics_piwik_url' => 'URL der Piwik-Instanz (ohne http(s)://)',
'analytics_piwik_siteid' => 'Piwik\'s Seiten-ID',
],
'localization' => [
'site-timezone' => 'Zeitzone ihrer Seite',
'site-locale' => 'Sprache ihrer Seite',
'date-format' => 'Datumsformat',
'incident-date-format' => 'Vorfall Zeitstempel-Format',
],
'security' => [
'allowed-domains' => 'Erlaubte Domains',
'allowed-domains-help' => 'Durch Kommata trennen. Die oben genannte Domain ist standardmäßig erlaubt.',
],
'stylesheet' => [
'custom-css' => 'Niestandardowy arkusz stylów',
],
'theme' => [
'background-color' => 'Kolor tła',
'background-fills' => 'Wypełnianie tła (komponenty, wydarzenia, stopka)',
'banner-background-color' => 'Banner Background Color',
'banner-padding' => 'Banner Padding',
'fullwidth-banner' => 'Enable fullwidth banner?',
'text-color' => 'Kolor tekstu',
'dashboard-login' => 'Pokazywać przycisk panelu głównego w stopce?',
'reds' => 'Czerwony (używany przy błędach)',
'blues' => 'Niebieski (używany przy informacjach)',
'greens' => 'Zielony (używany przy powodzeniu)',
'yellows' => 'Żółty (używany przy ostrzeżeniach)',
'oranges' => 'Pomarańczowy (używany przy ogłoszeniach)',
'metrics' => 'Wypełnienie metryki',
'links' => 'Łącza',
],
],
'user' => [
'username' => 'Benutzername',
'email' => 'E-Mail',
'password' => 'Passwort',
'api-token' => 'API Token',
'api-token-help' => 'Wenn sie ihren API-Token neu generieren, können bestehende Anwendungen nicht mehr auf Cachet zugreifen.',
'gravatar' => 'Change your profile picture at Gravatar.',
'user_level' => 'Poziom użytkownika',
'levels' => [
'admin' => 'Administrator',
'user' => 'Użytkownik',
],
'2fa' => [
'help' => 'Die Zwei-Faktor-Authentifizierung erhöht die Sicherheit Ihres Kontos. Sie benötigen <a href="https://support.google.com/accounts/answer/1066447?hl=en">Google Authenticator</a> oder eine ähnliche App auf Ihrem Mobilgerät. Beim Anmelden werden sie aufgefordert, einen Token einzugeben, der von der App generiert wird.',
],
'team' => [
'description' => 'Invite your team members by entering their email addresses here.',
'email' => 'Email #:id',
],
],
// Buttons
'add' => 'Hinzufügen',
'save' => 'Speichern',
'update' => 'Aktualisieren',
'create' => 'Erstellen',
'edit' => 'Bearbeiten',
'delete' => 'Löschen',
'submit' => 'Abschicken',
'cancel' => 'Abbrechen',
'remove' => 'Entfernen',
'invite' => 'Zaproś',
'signup' => 'Zarejestruj się',
// Other
'optional' => '* optional',
];
| {'content_hash': '0ad1bebae014c7dc4b1130c8e34cedf4', 'timestamp': '', 'source': 'github', 'line_count': 180, 'max_line_length': 340, 'avg_line_length': 43.227777777777774, 'alnum_prop': 0.4944094589384398, 'repo_name': 'h3zjp/Cachet', 'id': '9c0c1f7f7ee4ebc56e19ed0d92c85f152ca463f2', 'size': '8066', 'binary': False, 'copies': '10', 'ref': 'refs/heads/h3zjp/v2.3.11', 'path': 'resources/lang/pl/forms.php', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'ApacheConf', 'bytes': '670'}, {'name': 'HTML', 'bytes': '211487'}, {'name': 'JavaScript', 'bytes': '17198'}, {'name': 'PHP', 'bytes': '1711571'}]} |
/*
* 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 com.facebook.presto.sql.planner.plan;
import com.facebook.presto.sql.planner.Symbol;
import com.facebook.presto.sql.tree.Expression;
import com.facebook.presto.sql.tree.ExpressionRewriter;
import com.facebook.presto.sql.tree.ExpressionTreeRewriter;
import com.facebook.presto.sql.tree.SymbolReference;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.stream.Collector;
import static com.google.common.base.Preconditions.checkState;
import static java.util.Arrays.asList;
import static java.util.Objects.requireNonNull;
public class Assignments
{
public static Builder builder()
{
return new Builder();
}
public static Assignments identity(Symbol... symbols)
{
return identity(asList(symbols));
}
public static Assignments identity(Iterable<Symbol> symbols)
{
return builder().putIdentities(symbols).build();
}
public static Assignments copyOf(Map<Symbol, Expression> assignments)
{
return builder()
.putAll(assignments)
.build();
}
public static Assignments of()
{
return builder().build();
}
public static Assignments of(Symbol symbol, Expression expression)
{
return builder().put(symbol, expression).build();
}
public static Assignments of(Symbol symbol1, Expression expression1, Symbol symbol2, Expression expression2)
{
return builder().put(symbol1, expression1).put(symbol2, expression2).build();
}
private final Map<Symbol, Expression> assignments;
@JsonCreator
public Assignments(@JsonProperty("assignments") Map<Symbol, Expression> assignments)
{
this.assignments = ImmutableMap.copyOf(requireNonNull(assignments, "assignments is null"));
}
public List<Symbol> getOutputs()
{
return ImmutableList.copyOf(assignments.keySet());
}
@JsonProperty("assignments")
public Map<Symbol, Expression> getMap()
{
return assignments;
}
public <C> Assignments rewrite(ExpressionRewriter<C> rewriter)
{
return rewrite(expression -> ExpressionTreeRewriter.rewriteWith(rewriter, expression));
}
public Assignments rewrite(Function<Expression, Expression> rewrite)
{
return assignments.entrySet().stream()
.map(entry -> Maps.immutableEntry(entry.getKey(), rewrite.apply(entry.getValue())))
.collect(toAssignments());
}
public Assignments filter(Collection<Symbol> symbols)
{
return filter(symbols::contains);
}
public Assignments filter(Predicate<Symbol> predicate)
{
return assignments.entrySet().stream()
.filter(entry -> predicate.apply(entry.getKey()))
.collect(toAssignments());
}
public boolean isIdentity(Symbol output)
{
Expression expression = assignments.get(output);
return expression instanceof SymbolReference && ((SymbolReference) expression).getName().equals(output.getName());
}
private Collector<Entry<Symbol, Expression>, Builder, Assignments> toAssignments()
{
return Collector.of(
Assignments::builder,
(builder, entry) -> builder.put(entry.getKey(), entry.getValue()),
(left, right) -> {
left.putAll(right.build());
return left;
},
Assignments.Builder::build);
}
public Collection<Expression> getExpressions()
{
return assignments.values();
}
public Set<Symbol> getSymbols()
{
return assignments.keySet();
}
public Set<Entry<Symbol, Expression>> entrySet()
{
return assignments.entrySet();
}
public Expression get(Symbol symbol)
{
return assignments.get(symbol);
}
public int size()
{
return assignments.size();
}
public boolean isEmpty()
{
return size() == 0;
}
public void forEach(BiConsumer<Symbol, Expression> consumer)
{
assignments.forEach(consumer);
}
@Override
public boolean equals(Object o)
{
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Assignments that = (Assignments) o;
return assignments.equals(that.assignments);
}
@Override
public int hashCode()
{
return assignments.hashCode();
}
public static class Builder
{
private final Map<Symbol, Expression> assignments = new LinkedHashMap<>();
public Builder putAll(Assignments assignments)
{
return putAll(assignments.getMap());
}
public Builder putAll(Map<Symbol, Expression> assignments)
{
for (Entry<Symbol, Expression> assignment : assignments.entrySet()) {
put(assignment.getKey(), assignment.getValue());
}
return this;
}
public Builder put(Symbol symbol, Expression expression)
{
if (assignments.containsKey(symbol)) {
Expression assignment = assignments.get(symbol);
checkState(
assignment.equals(expression),
"Symbol %s already has assignment %s, while adding %s",
symbol,
assignment,
expression);
}
assignments.put(symbol, expression);
return this;
}
public Builder put(Entry<Symbol, Expression> assignment)
{
put(assignment.getKey(), assignment.getValue());
return this;
}
public Builder putIdentities(Iterable<Symbol> symbols)
{
for (Symbol symbol : symbols) {
putIdentity(symbol);
}
return this;
}
public Builder putIdentity(Symbol symbol)
{
put(symbol, symbol.toSymbolReference());
return this;
}
public Assignments build()
{
return new Assignments(assignments);
}
}
}
| {'content_hash': 'cf7cfce64aa436d4011c2e2d4f8cf5f9', 'timestamp': '', 'source': 'github', 'line_count': 256, 'max_line_length': 122, 'avg_line_length': 28.3828125, 'alnum_prop': 0.6256537296999725, 'repo_name': 'stewartpark/presto', 'id': '749613cd80d8cf790e738fbea172b6feb09fd7e0', 'size': '7266', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'presto-main/src/main/java/com/facebook/presto/sql/planner/plan/Assignments.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ANTLR', 'bytes': '28328'}, {'name': 'CSS', 'bytes': '13018'}, {'name': 'HTML', 'bytes': '28633'}, {'name': 'Java', 'bytes': '32309831'}, {'name': 'JavaScript', 'bytes': '214692'}, {'name': 'Makefile', 'bytes': '6830'}, {'name': 'PLSQL', 'bytes': '2797'}, {'name': 'PLpgSQL', 'bytes': '11504'}, {'name': 'Python', 'bytes': '7664'}, {'name': 'SQLPL', 'bytes': '926'}, {'name': 'Shell', 'bytes': '29871'}, {'name': 'Thrift', 'bytes': '12631'}]} |
package pt.ptcris.utils;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.MDC;
import org.um.dsi.gavea.orcid.model.work.Work;
import org.um.dsi.gavea.orcid.model.work.WorkSummary;
import pt.ptcris.ORCIDClient;
import pt.ptcris.PTCRISyncResult;
import pt.ptcris.handlers.ProgressHandler;
/**
* A worker thread that can be used to read bulk works from ORCID.
*
* @see ORCIDWorker
*/
final class ORCIDGetBulkWorkWorker extends ORCIDWorker<Work> {
private final List<WorkSummary> works;
/**
* A threaded worker that can be launched in parallel to bulk read works
* with the ORCID API. The provided {@link ORCIDClient client} defines the
* communication channel.
*
* @see ORCIDHelper#readWorker(List, Map)
*
* @param works
* the list of work summaries specifying the full works to be
* retrieved
* @param client
* the ORCID communication client
* @param cb
* the callback object to return results
* @param log
* a logger
*/
public ORCIDGetBulkWorkWorker(List<WorkSummary> works, ORCIDClient client, Map<BigInteger, PTCRISyncResult<Work>> cb, Logger log, ProgressHandler handler) {
super(client, cb, log, handler);
assert works != null && !works.isEmpty();
this.works = works;
}
/**
* Retrieves a bulk of full works from an ORCID profile.
*/
@Override
public void run() {
try {
MDC.setContextMap(mdcCtxMap);
} catch (Exception e) {} // if the context is empty
_log.debug("[getFullBulkWork] "+works.size());
final Map<BigInteger,PTCRISyncResult<Work>> fulls = client.getWorks(works);
handler.step(works.size());
for (WorkSummary w : works) {
assert w.getPutCode() != null;
PTCRISyncResult<Work> wrk = fulls.get(w.getPutCode());
callback(w.getPutCode(), wrk);
}
}
}
| {'content_hash': '707f52fb73e2295a7f30308942565bf2', 'timestamp': '', 'source': 'github', 'line_count': 72, 'max_line_length': 157, 'avg_line_length': 26.22222222222222, 'alnum_prop': 0.6880296610169492, 'repo_name': 'fccn/PTCRISync', 'id': '86de0a10544285aa699c756ee339922c934fa041', 'size': '2180', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/pt/ptcris/utils/ORCIDGetBulkWorkWorker.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '346897'}]} |
#ifndef HTMLImport_h
#define HTMLImport_h
#include "core/html/imports/HTMLImportState.h"
#include "platform/heap/Handle.h"
#include "wtf/TreeNode.h"
namespace blink {
class Document;
class LocalFrame;
class HTMLImportChild;
class HTMLImportLoader;
class HTMLImportsController;
class KURL;
//
// # Basic Data Structure and Algorithms of HTML Imports implemenation.
//
// ## The Import Tree
//
// HTML Imports form a tree:
//
// * The root of the tree is HTMLImportTreeRoot.
//
// * The HTMLImportTreeRoot is owned HTMLImportsController, which is owned by the master
// document as a DocumentSupplement.
//
// * The non-root nodes are HTMLImportChild. They are all owned by HTMLImporTreeRoot.
// LinkStyle is wired into HTMLImportChild by implementing HTMLImportChildClient interface
//
// * Both HTMLImportTreeRoot and HTMLImportChild are derived from HTMLImport superclass
// that models the tree data structure using WTF::TreeNode and provides a set of
// virtual functions.
//
// HTMLImportsController also owns all loaders in the tree and manages their lifetime through it.
// One assumption is that the tree is append-only and nodes are never inserted in the middle of the tree nor removed.
//
// Full diagram is here:
// https://docs.google.com/drawings/d/1jFQrO0IupWrlykTNzQ3Nv2SdiBiSz4UE9-V3-vDgBb0/
//
// # Import Sharing and HTMLImportLoader
//
// The HTML Imports spec calls for de-dup mechanism to share already loaded imports.
// To implement this, the actual loading machinery is split out from HTMLImportChild to
// HTMLImportLoader, and each loader shares HTMLImportLoader with other loader if the URL is same.
// Check around HTMLImportsController::findLink() for more detail.
//
// HTMLImportLoader can be shared by multiple imports.
//
// HTMLImportChild (1)-->(*) HTMLImportLoader
//
//
// # Script Blocking
//
// - An import blocks the HTML parser of its own imported document from running <script>
// until all of its children are loaded.
// Note that dynamically added import won't block the parser.
//
// - An import under loading also blocks imported documents that follow from being created.
// This is because an import can include another import that has same URLs of following ones.
// In such case, the preceding import should be loaded and following ones should be de-duped.
//
// The superclass of HTMLImportTreeRoot and HTMLImportChild
// This represents the import tree data structure.
class HTMLImport : public NoBaseWillBeGarbageCollectedFinalized<HTMLImport>, public TreeNode<HTMLImport> {
public:
enum SyncMode {
Sync = 0,
Async = 1
};
virtual ~HTMLImport() { }
// FIXME: Consider returning HTMLImportTreeRoot.
HTMLImport* root();
bool precedes(HTMLImport*);
bool isRoot() const { return !parent(); }
bool isSync() const { return SyncMode(m_sync) == Sync; }
bool formsCycle() const;
const HTMLImportState& state() const { return m_state; }
void appendImport(HTMLImport*);
virtual Document* document() const = 0;
virtual bool isDone() const = 0; // FIXME: Should be renamed to haveFinishedLoading()
virtual HTMLImportLoader* loader() const { return 0; }
virtual void stateWillChange() { }
virtual void stateDidChange();
virtual void trace(Visitor*) { }
protected:
// Stating from most conservative state.
// It will be corrected through state update flow.
explicit HTMLImport(SyncMode sync)
: m_sync(sync)
{ }
static void recalcTreeState(HTMLImport* root);
#if !defined(NDEBUG)
void show();
void showTree(HTMLImport* highlight, unsigned depth);
virtual void showThis();
#endif
private:
HTMLImportState m_state;
unsigned m_sync : 1;
};
} // namespace blink
#endif // HTMLImport_h
| {'content_hash': '843ac1aef0aeffdab79e2be5b132f4a4', 'timestamp': '', 'source': 'github', 'line_count': 118, 'max_line_length': 117, 'avg_line_length': 32.07627118644068, 'alnum_prop': 0.7302509907529723, 'repo_name': 'hgl888/blink-crosswalk-efl', 'id': '30d3022d81da854d788dda82390b574e9b3ab584', 'size': '5347', 'binary': False, 'copies': '11', 'ref': 'refs/heads/efl/crosswalk-10/39.0.2171.19', 'path': 'Source/core/html/imports/HTMLImport.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'ApacheConf', 'bytes': '1835'}, {'name': 'Assembly', 'bytes': '14584'}, {'name': 'Batchfile', 'bytes': '35'}, {'name': 'C', 'bytes': '113661'}, {'name': 'C++', 'bytes': '41933223'}, {'name': 'CSS', 'bytes': '525836'}, {'name': 'GLSL', 'bytes': '11578'}, {'name': 'Groff', 'bytes': '28067'}, {'name': 'HTML', 'bytes': '54848115'}, {'name': 'Java', 'bytes': '100403'}, {'name': 'JavaScript', 'bytes': '26269146'}, {'name': 'Makefile', 'bytes': '653'}, {'name': 'Objective-C', 'bytes': '111951'}, {'name': 'Objective-C++', 'bytes': '377325'}, {'name': 'PHP', 'bytes': '167892'}, {'name': 'Perl', 'bytes': '583834'}, {'name': 'Python', 'bytes': '3855349'}, {'name': 'Ruby', 'bytes': '141818'}, {'name': 'Shell', 'bytes': '8888'}, {'name': 'XSLT', 'bytes': '49099'}, {'name': 'Yacc', 'bytes': '64128'}]} |
import React from 'react';
import SocialAuthComponent from './containers/SocialAuthComponent.native';
interface ComponentProps {
text: string;
type: string;
}
const FacebookButton = (props: ComponentProps) => (
<SocialAuthComponent authUrl="/auth/facebook" icon="facebook-square" backgroundColor="#3769ae" {...props} />
);
const GitHubButton = (props: ComponentProps) => (
<SocialAuthComponent authUrl="/auth/github" icon="github-square" backgroundColor="#464646" {...props} />
);
const GoogleButton = (props: ComponentProps) => (
<SocialAuthComponent authUrl="/auth/google" icon="google-plus-square" backgroundColor="#c43832" {...props} />
);
const LinkedInButton = (props: ComponentProps) => (
<SocialAuthComponent authUrl="/auth/linkedin" icon="linkedin-square" backgroundColor="#0077b0" {...props} />
);
export { FacebookButton, GitHubButton, GoogleButton, LinkedInButton };
| {'content_hash': '81dcf21a064009750ac1721681a1482a', 'timestamp': '', 'source': 'github', 'line_count': 26, 'max_line_length': 111, 'avg_line_length': 34.53846153846154, 'alnum_prop': 0.7316258351893096, 'repo_name': 'sysgears/apollo-fullstack-starter-kit', 'id': '4b6b67edff9ec0b45424c8241c8ee5606acaab50', 'size': '898', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'modules/authentication/client-react/social/index.native.tsx', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '181'}, {'name': 'JavaScript', 'bytes': '91932'}]} |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.