text stringlengths 2 1.04M | meta dict |
|---|---|
require('dotenv').config();
const { docClient } = require('../server/src/aws');
const queryParams = {
TableName: 'assignments',
KeyConditionExpression: 'classCode = :classCode',
ExpressionAttributeValues: {
':classCode': 'cst334',
},
};
docClient.query(queryParams, (err, { Items }) => {
if (err) {
console.log(err, err.stack);
} else {
const names = Items.map(({ name }) => name);
/*
const attempts = Items.reduce((newAttempts, { name, attempts }) => {
newAttempts[name] = attempts;
return newAttempts;
}, {});
*/
console.log(names);
const userParams = {
TableName: 'users-assignments',
KeyConditionExpression: 'username = :username',
ExpressionAttributeValues: {
':username': 'austin',
},
};
docClient.query(userParams, (error, { Items }) => {
if (error) {
console.log(error, error.stack);
// res.sendStatus(500);
} else {
/*
const studentAssignments = names.map((name) => {
const dataExists = Items.find(({ assignmentName }) => assignmentName === name);
if (dataExists) {
return dataExists;
} else {
const newAssignment =
newAssignments.push(newAssignment);
return newAssignment;
}
});
if (newAssignments.length) {
const batchParams = {
RequestItems: {
'users-assignments': newAssignments.map((assignment) => ({
PutRequest: {
Item: assignment,
},
})),
}
};
console.log(batchParams);
}
*/
}
});
}
})
| {
"content_hash": "34b0168b06473cd4e20efae75caa9373",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 89,
"avg_line_length": 24.557142857142857,
"alnum_prop": 0.518324607329843,
"repo_name": "ziel5122/autograde",
"id": "4d401d47023fd87ce578f53040048104993531d2",
"size": "1719",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "scripts/newAssignment.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "561"
},
{
"name": "JavaScript",
"bytes": "94669"
},
{
"name": "Shell",
"bytes": "1428"
}
],
"symlink_target": ""
} |
import codecs, logging, os, random
import GlobalStore
logger = logging.getLogger('DideRobot')
def isAllowedPath(path):
#This function checks whether the provided path is inside the bot's data folder
# To prevent people adding "../.." to some bot calls to have free access to the server's filesystem
if not os.path.abspath(path).startswith(GlobalStore.scriptfolder):
logger.warning("[FileUtil] Somebody is trying to leave the bot's file systems by calling filename '{}'".format(path))
return False
return True
def getLineCount(filename):
#Set a default in case the file has no lines
linecount = -1 #'-1' so with the +1 at the end it ends up a 0 for an empty file
if not filename.startswith(GlobalStore.scriptfolder):
filename = os.path.join(GlobalStore.scriptfolder, filename)
if not os.path.isfile(filename):
return -1
with codecs.open(filename, 'r', 'utf-8') as f:
for linecount, line in enumerate(f):
continue
return linecount + 1 #'enumerate()' starts at 0, so add one
def getLineFromFile(filename, wantedLineNumber):
"""Returns the specified line number from the provided file (line number starts at 0)"""
if not filename.startswith(GlobalStore.scriptfolder):
filename = os.path.join(GlobalStore.scriptfolder, filename)
#Check if it's an allowed path
if not isAllowedPath(filename):
return None
if not os.path.isfile(filename):
logger.error(u"Can't read line {} from file '{}'; file does not exist".format(wantedLineNumber, filename))
return None
with codecs.open(filename, 'r', 'utf-8') as f:
for lineNumber, line in enumerate(f):
if lineNumber == wantedLineNumber:
return line.rstrip()
return None
def getRandomLineFromFile(filename, linecount=None):
if not filename.startswith(GlobalStore.scriptfolder):
filename = os.path.join(GlobalStore.scriptfolder, filename)
if not linecount:
linecount = getLineCount(filename)
if linecount <= 0:
return None
return getLineFromFile(filename, random.randrange(0, linecount))
def getAllLinesFromFile(filename):
#Make sure it's an absolute filename
if not filename.startswith(GlobalStore.scriptfolder):
filename = os.path.join(GlobalStore.scriptfolder, filename)
if not isAllowedPath(filename):
return None
if not os.path.exists(filename):
logger.error(u"Can't read lines from file '{}'; it does not exist".format(filename))
return None
#Get all the lines!
with codecs.open(filename, 'r', 'utf-8') as linesfile:
return linesfile.readlines()
def deleteIfExists(filename):
"""
Deletes the provided file if it exists
:param filename: The filename to delete
:return: True if the file existed and was removed, False if it didn't exist
"""
#Use try-except instead of 'os.exists' to prevent race conditions between the check and the delete
try:
os.remove(filename)
return True
except OSError:
return False
| {
"content_hash": "7a8e3ea905d49ea7ef3eb33226b9a3b9",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 119,
"avg_line_length": 36.896103896103895,
"alnum_prop": 0.7504399859204506,
"repo_name": "Didero/DideRobot",
"id": "0ebfa0a20369797d933d3b201c2f1fb26d45ee43",
"size": "2841",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "util/FileUtil.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "478319"
}
],
"symlink_target": ""
} |
package com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Views.Component.Actions;
import java.awt.Window;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import com.google.security.zynamics.binnavi.Gui.MainWindow.Implementations.CViewFunctions;
import com.google.security.zynamics.binnavi.disassembly.views.INaviView;
/**
* Action class for renaming a function back to its original name.
*/
public class CRenameBackAction extends AbstractAction {
/**
* Used for serialization.
*/
private static final long serialVersionUID = -8396702921696088859L;
/**
* Parent window used for dialogs.
*/
private final Window m_parent;
/**
* The view to rename.
*/
private final INaviView m_view;
/**
* The original name of the view.
*/
private final String m_originalName;
/**
* Creates a new action object.
*
* @param parent Parent window used for dialogs.
* @param view The view to rename.
* @param originalName The original name of the view.
*/
public CRenameBackAction(final Window parent, final INaviView view, final String originalName) {
super(String.format("Rename back to '%s'", originalName));
m_parent = parent;
m_view = view;
m_originalName = originalName;
}
@Override
public void actionPerformed(final ActionEvent event) {
CViewFunctions.renameBack(m_parent, m_view, m_originalName);
}
}
| {
"content_hash": "725724fb42f39d75e66f2a7542fd9f07",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 102,
"avg_line_length": 24.75862068965517,
"alnum_prop": 0.7200557103064067,
"repo_name": "AmesianX/binnavi",
"id": "1c37154964970aa0d272c0380829f92d88f68341",
"size": "2019",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/main/java/com/google/security/zynamics/binnavi/Gui/MainWindow/ProjectTree/Nodes/Views/Component/Actions/CRenameBackAction.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1479"
},
{
"name": "C++",
"bytes": "1876"
},
{
"name": "CSS",
"bytes": "12843"
},
{
"name": "GAP",
"bytes": "3637"
},
{
"name": "HTML",
"bytes": "437420"
},
{
"name": "Java",
"bytes": "21671316"
},
{
"name": "PLSQL",
"bytes": "1866504"
},
{
"name": "PLpgSQL",
"bytes": "638893"
},
{
"name": "Python",
"bytes": "23981"
},
{
"name": "SQLPL",
"bytes": "330046"
},
{
"name": "Shell",
"bytes": "708"
}
],
"symlink_target": ""
} |
package com.google.android.vending.expansion.downloader;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
import com.google.android.vending.expansion.downloader.impl.DownloaderService;
/**
* This class is used by the client activity to proxy requests to the Downloader
* Service.
*
* Most importantly, you must call {@link #CreateProxy} during the {@link
* IDownloaderClient#onServiceConnected} callback in your activity in order to instantiate
* an {@link IDownloaderService} object that you can then use to issue commands to the {@link
* DownloaderService} (such as to pause and resume downloads).
*/
public class DownloaderServiceMarshaller {
public static final int MSG_REQUEST_ABORT_DOWNLOAD =
1;
public static final int MSG_REQUEST_PAUSE_DOWNLOAD =
2;
public static final int MSG_SET_DOWNLOAD_FLAGS =
3;
public static final int MSG_REQUEST_CONTINUE_DOWNLOAD =
4;
public static final int MSG_REQUEST_DOWNLOAD_STATE =
5;
public static final int MSG_REQUEST_CLIENT_UPDATE =
6;
public static final String PARAMS_FLAGS = "flags";
public static final String PARAM_MESSENGER = DownloaderService.EXTRA_MESSAGE_HANDLER;
private static class Proxy implements IDownloaderService {
private Messenger mMsg;
private void send(int method, Bundle params) {
Message m = Message.obtain(null, method);
m.setData(params);
try {
mMsg.send(m);
} catch (RemoteException e) {
e.printStackTrace();
}
}
public Proxy(Messenger msg) {
mMsg = msg;
}
@Override
public void requestAbortDownload() {
send(MSG_REQUEST_ABORT_DOWNLOAD, new Bundle());
}
@Override
public void requestPauseDownload() {
send(MSG_REQUEST_PAUSE_DOWNLOAD, new Bundle());
}
@Override
public void setDownloadFlags(int flags) {
Bundle params = new Bundle();
params.putInt(PARAMS_FLAGS, flags);
send(MSG_SET_DOWNLOAD_FLAGS, params);
}
@Override
public void requestContinueDownload() {
send(MSG_REQUEST_CONTINUE_DOWNLOAD, new Bundle());
}
@Override
public void requestDownloadStatus() {
send(MSG_REQUEST_DOWNLOAD_STATE, new Bundle());
}
@Override
public void onClientUpdated(Messenger clientMessenger) {
Bundle bundle = new Bundle(1);
bundle.putParcelable(PARAM_MESSENGER, clientMessenger);
send(MSG_REQUEST_CLIENT_UPDATE, bundle);
}
}
private static class Stub implements IStub {
private IDownloaderService mItf = null;
final Messenger mMessenger = new Messenger(new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MSG_REQUEST_ABORT_DOWNLOAD:
mItf.requestAbortDownload();
break;
case MSG_REQUEST_CONTINUE_DOWNLOAD:
mItf.requestContinueDownload();
break;
case MSG_REQUEST_PAUSE_DOWNLOAD:
mItf.requestPauseDownload();
break;
case MSG_SET_DOWNLOAD_FLAGS:
mItf.setDownloadFlags(msg.getData().getInt(PARAMS_FLAGS));
break;
case MSG_REQUEST_DOWNLOAD_STATE:
mItf.requestDownloadStatus();
break;
case MSG_REQUEST_CLIENT_UPDATE:
mItf.onClientUpdated((Messenger) msg.getData().getParcelable(
PARAM_MESSENGER));
break;
}
}
});
public Stub(IDownloaderService itf) {
mItf = itf;
}
@Override
public Messenger getMessenger() {
return mMessenger;
}
@Override
public void connect(Context c) {
}
@Override
public void disconnect(Context c) {
}
}
/**
* Returns a proxy that will marshall calls to IDownloaderService methods
*
* @param msg:
* @return
*/
public static IDownloaderService CreateProxy(Messenger msg) {
return new Proxy(msg);
}
/**
* Returns a stub object that, when connected, will listen for marshalled
* IDownloaderService methods and translate them into calls to the supplied
* interface.
*
* @param itf An implementation of IDownloaderService that will be called
* when remote method calls are unmarshalled.
* @return
*/
public static IStub CreateStub(IDownloaderService itf) {
return new Stub(itf);
}
}
| {
"content_hash": "5ab0f2fcdec49804839c8420160dc88b",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 93,
"avg_line_length": 30.772455089820358,
"alnum_prop": 0.5800739443471492,
"repo_name": "cclink/ObbDownloadHelper",
"id": "079d37a1c9a7a48340f52ddde2c0d93827e1bd96",
"size": "5758",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "AndroidStudio/googlePlayAPKExpansionLibrary/src/main/java/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1169509"
}
],
"symlink_target": ""
} |
package water.util;
import org.junit.Assert;
import org.junit.Test;
import static org.junit.Assert.*;
public class CountdownTest {
private static long short_sleep() {
long start = System.currentTimeMillis();
try {
Thread.sleep(100);
} catch (InterruptedException ignored) {
Thread.currentThread().interrupt();
}
return System.currentTimeMillis() - start;
}
@Test
public void testStateAfterStart() {
Countdown c = new Countdown(1000);
assertFalse(c.running());
assertFalse(c.ended());
c.start();
assertTrue(c.running());
assertFalse(c.ended());
assertFalse(c.timedOut());
}
@Test
public void testCannotBeStartedTwice() {
Countdown c = new Countdown(1000);
c.start();
try {
c.start();
fail("Starting started countdown should have thrown IllegalStateException");
} catch (IllegalStateException e) {
Assert.assertTrue(e.getMessage().contains("already running"));
}
}
@Test
public void testCanRestartAfterReset() {
Countdown c = new Countdown(1000);
c.start();
c.reset();
assertFalse(c.running());
c.start();
assertTrue(c.running());
}
@Test
public void testStateAfterStop() {
Countdown c = new Countdown(1000);
c.start();
short_sleep();
assertFalse(c.ended());
long duration = c.stop();
assertTrue(c.ended());
assertFalse(c.running());
assertFalse(c.timedOut());
assertTrue(duration > 0);
}
@Test
public void testElapsedTime() {
Countdown c = new Countdown(1000);
assertEquals(0, c.elapsedTime());
c.start();
long slept = short_sleep(); //100 millis
assertEquals("Elapsed time incorrect", slept, c.elapsedTime(), 10);
c.stop();
assertEquals("Elapsed time incorrect", slept, c.elapsedTime(), 10);
assertEquals(c.elapsedTime(), c.duration());
c.reset();
assertEquals(0, c.elapsedTime());
}
@Test
public void testRemainingTime() {
Countdown c = new Countdown(1000);
assertEquals(1000, c.remainingTime());
c.start();
long slept = short_sleep(); //100 millis
assertEquals("Remaining time incorrect", 1000 - slept, c.remainingTime(), 10);
c.stop();
assertEquals(0, c.remainingTime());
c.reset();
assertEquals(1000, c.remainingTime());
}
@Test
public void testDuration() {
Countdown c = new Countdown(1000);
try {
c.duration();
fail("should have thrown IllegalStateException");
} catch (IllegalStateException e) {
assertTrue(e.getMessage().contains("Countdown was never started"));
}
c.start();
try {
c.duration();
fail("should have thrown IllegalStateException");
} catch (IllegalStateException e) {
assertTrue(e.getMessage().contains("Countdown was never started or stopped"));
}
long slept = short_sleep(); //100 millis
c.stop();
assertEquals("Duration incorrect ", slept, c.duration(), 10);
c.reset();
try {
c.duration();
fail("should have thrown IllegalStateException");
} catch (IllegalStateException e) {
assertTrue(e.getMessage().contains("Countdown was never started"));
}
}
}
| {
"content_hash": "ccefb20504828eb850bfa9db1d4f20b8",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 84,
"avg_line_length": 26.16393442622951,
"alnum_prop": 0.6372180451127819,
"repo_name": "h2oai/h2o-3",
"id": "7f23c24c7be94e102d2b71ebdd341e9f678a858d",
"size": "3192",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "h2o-core/src/test/java/water/util/CountdownTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "12803"
},
{
"name": "CSS",
"bytes": "882321"
},
{
"name": "CoffeeScript",
"bytes": "7550"
},
{
"name": "DIGITAL Command Language",
"bytes": "106"
},
{
"name": "Dockerfile",
"bytes": "10459"
},
{
"name": "Emacs Lisp",
"bytes": "2226"
},
{
"name": "Groovy",
"bytes": "205646"
},
{
"name": "HCL",
"bytes": "36232"
},
{
"name": "HTML",
"bytes": "8018117"
},
{
"name": "HiveQL",
"bytes": "3985"
},
{
"name": "Java",
"bytes": "15981357"
},
{
"name": "JavaScript",
"bytes": "148426"
},
{
"name": "Jupyter Notebook",
"bytes": "20638329"
},
{
"name": "Makefile",
"bytes": "46043"
},
{
"name": "PHP",
"bytes": "800"
},
{
"name": "Python",
"bytes": "8188608"
},
{
"name": "R",
"bytes": "4149977"
},
{
"name": "Ruby",
"bytes": "64"
},
{
"name": "Sass",
"bytes": "23790"
},
{
"name": "Scala",
"bytes": "4845"
},
{
"name": "Shell",
"bytes": "214495"
},
{
"name": "Smarty",
"bytes": "1792"
},
{
"name": "TeX",
"bytes": "554940"
}
],
"symlink_target": ""
} |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
namespace JIT.HardwareIntrinsics.X86
{
public static partial class Program
{
private static void CompareEqualUInt16()
{
var test = new SimpleBinaryOpTest__CompareEqualUInt16();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (Avx.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
// Validates basic functionality works, using LoadAligned
test.RunBasicScenario_LoadAligned();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (Avx.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
// Validates calling via reflection works, using LoadAligned
test.RunReflectionScenario_LoadAligned();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (Avx.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (Avx.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
// Validates passing a local works, using LoadAligned
test.RunLclVarScenario_LoadAligned();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (Avx.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (Avx.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (Avx.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (Avx.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleBinaryOpTest__CompareEqualUInt16
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt16>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<UInt16>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt16>();
if ((alignment != 32 && alignment != 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt16, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<UInt16, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector256<UInt16> _fld1;
public Vector256<UInt16> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<UInt16>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<UInt16>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<UInt16>, byte>(ref testStruct._fld2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<UInt16>>());
return testStruct;
}
public void RunStructFldScenario(SimpleBinaryOpTest__CompareEqualUInt16 testClass)
{
var result = Avx2.CompareEqual(_fld1, _fld2);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleBinaryOpTest__CompareEqualUInt16 testClass)
{
fixed (Vector256<UInt16>* pFld1 = &_fld1)
fixed (Vector256<UInt16>* pFld2 = &_fld2)
{
var result = Avx2.CompareEqual(
Avx.LoadVector256((UInt16*)(pFld1)),
Avx.LoadVector256((UInt16*)(pFld2))
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 32;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector256<UInt16>>() / sizeof(UInt16);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector256<UInt16>>() / sizeof(UInt16);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector256<UInt16>>() / sizeof(UInt16);
private static UInt16[] _data1 = new UInt16[Op1ElementCount];
private static UInt16[] _data2 = new UInt16[Op2ElementCount];
private static Vector256<UInt16> _clsVar1;
private static Vector256<UInt16> _clsVar2;
private Vector256<UInt16> _fld1;
private Vector256<UInt16> _fld2;
private DataTable _dataTable;
static SimpleBinaryOpTest__CompareEqualUInt16()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<UInt16>, byte>(ref _clsVar1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<UInt16>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<UInt16>, byte>(ref _clsVar2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<UInt16>>());
}
public SimpleBinaryOpTest__CompareEqualUInt16()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<UInt16>, byte>(ref _fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<UInt16>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<UInt16>, byte>(ref _fld2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<UInt16>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
_dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize);
}
public bool IsSupported => Avx2.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Avx2.CompareEqual(
Unsafe.Read<Vector256<UInt16>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector256<UInt16>>(_dataTable.inArray2Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = Avx2.CompareEqual(
Avx.LoadVector256((UInt16*)(_dataTable.inArray1Ptr)),
Avx.LoadVector256((UInt16*)(_dataTable.inArray2Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_LoadAligned()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_LoadAligned));
var result = Avx2.CompareEqual(
Avx.LoadAlignedVector256((UInt16*)(_dataTable.inArray1Ptr)),
Avx.LoadAlignedVector256((UInt16*)(_dataTable.inArray2Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(Avx2).GetMethod(nameof(Avx2.CompareEqual), new Type[] { typeof(Vector256<UInt16>), typeof(Vector256<UInt16>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector256<UInt16>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector256<UInt16>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector256<UInt16>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(Avx2).GetMethod(nameof(Avx2.CompareEqual), new Type[] { typeof(Vector256<UInt16>), typeof(Vector256<UInt16>) })
.Invoke(null, new object[] {
Avx.LoadVector256((UInt16*)(_dataTable.inArray1Ptr)),
Avx.LoadVector256((UInt16*)(_dataTable.inArray2Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector256<UInt16>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_LoadAligned()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_LoadAligned));
var result = typeof(Avx2).GetMethod(nameof(Avx2.CompareEqual), new Type[] { typeof(Vector256<UInt16>), typeof(Vector256<UInt16>) })
.Invoke(null, new object[] {
Avx.LoadAlignedVector256((UInt16*)(_dataTable.inArray1Ptr)),
Avx.LoadAlignedVector256((UInt16*)(_dataTable.inArray2Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector256<UInt16>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Avx2.CompareEqual(
_clsVar1,
_clsVar2
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector256<UInt16>* pClsVar1 = &_clsVar1)
fixed (Vector256<UInt16>* pClsVar2 = &_clsVar2)
{
var result = Avx2.CompareEqual(
Avx.LoadVector256((UInt16*)(pClsVar1)),
Avx.LoadVector256((UInt16*)(pClsVar2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector256<UInt16>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector256<UInt16>>(_dataTable.inArray2Ptr);
var result = Avx2.CompareEqual(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = Avx.LoadVector256((UInt16*)(_dataTable.inArray1Ptr));
var op2 = Avx.LoadVector256((UInt16*)(_dataTable.inArray2Ptr));
var result = Avx2.CompareEqual(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_LoadAligned()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_LoadAligned));
var op1 = Avx.LoadAlignedVector256((UInt16*)(_dataTable.inArray1Ptr));
var op2 = Avx.LoadAlignedVector256((UInt16*)(_dataTable.inArray2Ptr));
var result = Avx2.CompareEqual(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleBinaryOpTest__CompareEqualUInt16();
var result = Avx2.CompareEqual(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleBinaryOpTest__CompareEqualUInt16();
fixed (Vector256<UInt16>* pFld1 = &test._fld1)
fixed (Vector256<UInt16>* pFld2 = &test._fld2)
{
var result = Avx2.CompareEqual(
Avx.LoadVector256((UInt16*)(pFld1)),
Avx.LoadVector256((UInt16*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Avx2.CompareEqual(_fld1, _fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector256<UInt16>* pFld1 = &_fld1)
fixed (Vector256<UInt16>* pFld2 = &_fld2)
{
var result = Avx2.CompareEqual(
Avx.LoadVector256((UInt16*)(pFld1)),
Avx.LoadVector256((UInt16*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Avx2.CompareEqual(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = Avx2.CompareEqual(
Avx.LoadVector256((UInt16*)(&test._fld1)),
Avx.LoadVector256((UInt16*)(&test._fld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector256<UInt16> op1, Vector256<UInt16> op2, void* result, [CallerMemberName] string method = "")
{
UInt16[] inArray1 = new UInt16[Op1ElementCount];
UInt16[] inArray2 = new UInt16[Op2ElementCount];
UInt16[] outArray = new UInt16[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector256<UInt16>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
UInt16[] inArray1 = new UInt16[Op1ElementCount];
UInt16[] inArray2 = new UInt16[Op2ElementCount];
UInt16[] outArray = new UInt16[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector256<UInt16>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector256<UInt16>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector256<UInt16>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != ((left[0] == right[0]) ? unchecked((ushort)(-1)) : 0))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != ((left[i] == right[i]) ? unchecked((ushort)(-1)) : 0))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Avx2)}.{nameof(Avx2.CompareEqual)}<UInt16>(Vector256<UInt16>, Vector256<UInt16>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| {
"content_hash": "9c9ce4b0974c5b8ce9048e46cffae41d",
"timestamp": "",
"source": "github",
"line_count": 585,
"max_line_length": 190,
"avg_line_length": 42.34017094017094,
"alnum_prop": 0.5745488312002907,
"repo_name": "cshung/coreclr",
"id": "6c138b8db264bf2992a1fc38645457956cfd85c7",
"size": "24769",
"binary": false,
"copies": "42",
"ref": "refs/heads/master",
"path": "tests/src/JIT/HardwareIntrinsics/X86/Avx2/CompareEqual.UInt16.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "944751"
},
{
"name": "Awk",
"bytes": "6901"
},
{
"name": "Batchfile",
"bytes": "153173"
},
{
"name": "C",
"bytes": "4817474"
},
{
"name": "C#",
"bytes": "159913317"
},
{
"name": "C++",
"bytes": "64286661"
},
{
"name": "CMake",
"bytes": "686049"
},
{
"name": "M4",
"bytes": "15214"
},
{
"name": "Makefile",
"bytes": "46110"
},
{
"name": "Objective-C",
"bytes": "14073"
},
{
"name": "Perl",
"bytes": "23577"
},
{
"name": "PowerShell",
"bytes": "144769"
},
{
"name": "Python",
"bytes": "490035"
},
{
"name": "Roff",
"bytes": "687366"
},
{
"name": "Shell",
"bytes": "492276"
},
{
"name": "Smalltalk",
"bytes": "635930"
},
{
"name": "TeX",
"bytes": "126781"
},
{
"name": "XSLT",
"bytes": "1016"
},
{
"name": "Yacc",
"bytes": "155697"
}
],
"symlink_target": ""
} |
package com.salesmanager.core.business.configuration.events.products;
import org.springframework.context.ApplicationEvent;
import com.salesmanager.core.model.catalog.product.Product;
public abstract class ProductEvent extends ApplicationEvent {
private static final long serialVersionUID = 1L;
private Product product;
public ProductEvent(Object source, Product product) {
super(source);
this.product = product;
}
public Product getProduct() {
return product;
}
}
| {
"content_hash": "f58e6544a3d1f3deac17815d0a94ae58",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 69,
"avg_line_length": 22.09090909090909,
"alnum_prop": 0.7880658436213992,
"repo_name": "shopizer-ecommerce/shopizer",
"id": "0034a7dbd3acfbd931f84495fe78d585b5a60707",
"size": "486",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sm-core/src/main/java/com/salesmanager/core/business/configuration/events/products/ProductEvent.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "203"
},
{
"name": "FreeMarker",
"bytes": "111592"
},
{
"name": "Java",
"bytes": "3600819"
}
],
"symlink_target": ""
} |
void pMR::Connection::connect(Target const &target)
{
if(target.isNull())
{
connectNull(target);
return;
}
if(target.isSelf())
{
connectSelf(target);
return;
}
connectCMA(target);
}
| {
"content_hash": "bfc94ad4d4370484df377ff313826180",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 51,
"avg_line_length": 15.25,
"alnum_prop": 0.5368852459016393,
"repo_name": "pjgeorg/pMR",
"id": "a68f16ec1b3a3c160e2278f5e236cabca81bd2dc",
"size": "904",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/clusters/shm/connect.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "10689"
},
{
"name": "C++",
"bytes": "607649"
},
{
"name": "CMake",
"bytes": "61690"
},
{
"name": "HTML",
"bytes": "477"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>node_modules\cassproject\src\com\eduworks\schema\ebac\EbacContactGrant.js - CASS Javascript Library</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
<link rel="icon" href="../assets/favicon.ico">
<script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="http://docs.cassproject.org/img/customLogo-blue.png" title="CASS Javascript Library"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 0.5.4</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="../classes/3DModel.html">3DModel</a></li>
<li><a href="../classes/AboutPage.html">AboutPage</a></li>
<li><a href="../classes/AcceptAction.html">AcceptAction</a></li>
<li><a href="../classes/Accommodation.html">Accommodation</a></li>
<li><a href="../classes/AccountingService.html">AccountingService</a></li>
<li><a href="../classes/AccreditAction.html">AccreditAction</a></li>
<li><a href="../classes/AchieveAction.html">AchieveAction</a></li>
<li><a href="../classes/Action.html">Action</a></li>
<li><a href="../classes/ActionAccessSpecification.html">ActionAccessSpecification</a></li>
<li><a href="../classes/ActionStatusType.html">ActionStatusType</a></li>
<li><a href="../classes/ActivateAction.html">ActivateAction</a></li>
<li><a href="../classes/AddAction.html">AddAction</a></li>
<li><a href="../classes/AdministrativeArea.html">AdministrativeArea</a></li>
<li><a href="../classes/AdultEntertainment.html">AdultEntertainment</a></li>
<li><a href="../classes/AdvancedStandingAction.html">AdvancedStandingAction</a></li>
<li><a href="../classes/AdvertiserContentArticle.html">AdvertiserContentArticle</a></li>
<li><a href="../classes/Agent.html">Agent</a></li>
<li><a href="../classes/AggregateDataProfile.html">AggregateDataProfile</a></li>
<li><a href="../classes/AggregateOffer.html">AggregateOffer</a></li>
<li><a href="../classes/AggregateRating.html">AggregateRating</a></li>
<li><a href="../classes/AgreeAction.html">AgreeAction</a></li>
<li><a href="../classes/Airline.html">Airline</a></li>
<li><a href="../classes/Airport.html">Airport</a></li>
<li><a href="../classes/AlignmentMap.html">AlignmentMap</a></li>
<li><a href="../classes/AlignmentObject.html">AlignmentObject</a></li>
<li><a href="../classes/AllocateAction.html">AllocateAction</a></li>
<li><a href="../classes/AmpStory.html">AmpStory</a></li>
<li><a href="../classes/AMRadioChannel.html">AMRadioChannel</a></li>
<li><a href="../classes/AmusementPark.html">AmusementPark</a></li>
<li><a href="../classes/AnalysisNewsArticle.html">AnalysisNewsArticle</a></li>
<li><a href="../classes/AnatomicalStructure.html">AnatomicalStructure</a></li>
<li><a href="../classes/AnatomicalSystem.html">AnatomicalSystem</a></li>
<li><a href="../classes/AnimalShelter.html">AnimalShelter</a></li>
<li><a href="../classes/Answer.html">Answer</a></li>
<li><a href="../classes/Apartment.html">Apartment</a></li>
<li><a href="../classes/ApartmentComplex.html">ApartmentComplex</a></li>
<li><a href="../classes/APIReference.html">APIReference</a></li>
<li><a href="../classes/AppendAction.html">AppendAction</a></li>
<li><a href="../classes/ApplyAction.html">ApplyAction</a></li>
<li><a href="../classes/ApprenticeshipCertificate.html">ApprenticeshipCertificate</a></li>
<li><a href="../classes/ApproveAction.html">ApproveAction</a></li>
<li><a href="../classes/ApprovedIndication.html">ApprovedIndication</a></li>
<li><a href="../classes/Aquarium.html">Aquarium</a></li>
<li><a href="../classes/ArchiveComponent.html">ArchiveComponent</a></li>
<li><a href="../classes/ArchiveOrganization.html">ArchiveOrganization</a></li>
<li><a href="../classes/ArriveAction.html">ArriveAction</a></li>
<li><a href="../classes/Artery.html">Artery</a></li>
<li><a href="../classes/ArtGallery.html">ArtGallery</a></li>
<li><a href="../classes/Article.html">Article</a></li>
<li><a href="../classes/AskAction.html">AskAction</a></li>
<li><a href="../classes/AskPublicNewsArticle.html">AskPublicNewsArticle</a></li>
<li><a href="../classes/ASNImport.html">ASNImport</a></li>
<li><a href="../classes/Assertion.html">Assertion</a></li>
<li><a href="../classes/AssertionEnvelope.html">AssertionEnvelope</a></li>
<li><a href="../classes/AssessAction.html">AssessAction</a></li>
<li><a href="../classes/Assessment.html">Assessment</a></li>
<li><a href="../classes/AssessmentComponent.html">AssessmentComponent</a></li>
<li><a href="../classes/AssessmentProfile.html">AssessmentProfile</a></li>
<li><a href="../classes/AssignAction.html">AssignAction</a></li>
<li><a href="../classes/AssociateDegree.html">AssociateDegree</a></li>
<li><a href="../classes/Atlas.html">Atlas</a></li>
<li><a href="../classes/Attitude.html">Attitude</a></li>
<li><a href="../classes/Attorney.html">Attorney</a></li>
<li><a href="../classes/Audience.html">Audience</a></li>
<li><a href="../classes/Audiobook.html">Audiobook</a></li>
<li><a href="../classes/AudioObject.html">AudioObject</a></li>
<li><a href="../classes/AuthorizeAction.html">AuthorizeAction</a></li>
<li><a href="../classes/AutoBodyShop.html">AutoBodyShop</a></li>
<li><a href="../classes/AutoDealer.html">AutoDealer</a></li>
<li><a href="../classes/AutomatedTeller.html">AutomatedTeller</a></li>
<li><a href="../classes/AutomotiveBusiness.html">AutomotiveBusiness</a></li>
<li><a href="../classes/AutoPartsStore.html">AutoPartsStore</a></li>
<li><a href="../classes/AutoRental.html">AutoRental</a></li>
<li><a href="../classes/AutoRepair.html">AutoRepair</a></li>
<li><a href="../classes/AutoWash.html">AutoWash</a></li>
<li><a href="../classes/BachelorDegree.html">BachelorDegree</a></li>
<li><a href="../classes/BackgroundNewsArticle.html">BackgroundNewsArticle</a></li>
<li><a href="../classes/Badge.html">Badge</a></li>
<li><a href="../classes/Bakery.html">Bakery</a></li>
<li><a href="../classes/BankAccount.html">BankAccount</a></li>
<li><a href="../classes/BankOrCreditUnion.html">BankOrCreditUnion</a></li>
<li><a href="../classes/Barcode.html">Barcode</a></li>
<li><a href="../classes/BarOrPub.html">BarOrPub</a></li>
<li><a href="../classes/BasicComponent.html">BasicComponent</a></li>
<li><a href="../classes/Beach.html">Beach</a></li>
<li><a href="../classes/BeautySalon.html">BeautySalon</a></li>
<li><a href="../classes/BedAndBreakfast.html">BedAndBreakfast</a></li>
<li><a href="../classes/BedDetails.html">BedDetails</a></li>
<li><a href="../classes/BedType.html">BedType</a></li>
<li><a href="../classes/BefriendAction.html">BefriendAction</a></li>
<li><a href="../classes/Belief.html">Belief</a></li>
<li><a href="../classes/BikeStore.html">BikeStore</a></li>
<li><a href="../classes/Blog.html">Blog</a></li>
<li><a href="../classes/BlogPosting.html">BlogPosting</a></li>
<li><a href="../classes/BloodTest.html">BloodTest</a></li>
<li><a href="../classes/BoardingPolicyType.html">BoardingPolicyType</a></li>
<li><a href="../classes/BoatReservation.html">BoatReservation</a></li>
<li><a href="../classes/BoatTerminal.html">BoatTerminal</a></li>
<li><a href="../classes/BoatTrip.html">BoatTrip</a></li>
<li><a href="../classes/BodyMeasurementTypeEnumeration.html">BodyMeasurementTypeEnumeration</a></li>
<li><a href="../classes/BodyOfWater.html">BodyOfWater</a></li>
<li><a href="../classes/Bone.html">Bone</a></li>
<li><a href="../classes/Book.html">Book</a></li>
<li><a href="../classes/BookFormatType.html">BookFormatType</a></li>
<li><a href="../classes/BookmarkAction.html">BookmarkAction</a></li>
<li><a href="../classes/BookSeries.html">BookSeries</a></li>
<li><a href="../classes/BookStore.html">BookStore</a></li>
<li><a href="../classes/BorrowAction.html">BorrowAction</a></li>
<li><a href="../classes/BowlingAlley.html">BowlingAlley</a></li>
<li><a href="../classes/BrainStructure.html">BrainStructure</a></li>
<li><a href="../classes/Brand.html">Brand</a></li>
<li><a href="../classes/BreadcrumbList.html">BreadcrumbList</a></li>
<li><a href="../classes/Brewery.html">Brewery</a></li>
<li><a href="../classes/Bridge.html">Bridge</a></li>
<li><a href="../classes/BroadcastChannel.html">BroadcastChannel</a></li>
<li><a href="../classes/BroadcastEvent.html">BroadcastEvent</a></li>
<li><a href="../classes/BroadcastFrequencySpecification.html">BroadcastFrequencySpecification</a></li>
<li><a href="../classes/BroadcastService.html">BroadcastService</a></li>
<li><a href="../classes/BrokerageAccount.html">BrokerageAccount</a></li>
<li><a href="../classes/BuddhistTemple.html">BuddhistTemple</a></li>
<li><a href="../classes/BusinessAudience.html">BusinessAudience</a></li>
<li><a href="../classes/BusinessEntityType.html">BusinessEntityType</a></li>
<li><a href="../classes/BusinessEvent.html">BusinessEvent</a></li>
<li><a href="../classes/BusinessFunction.html">BusinessFunction</a></li>
<li><a href="../classes/BusOrCoach.html">BusOrCoach</a></li>
<li><a href="../classes/BusReservation.html">BusReservation</a></li>
<li><a href="../classes/BusStation.html">BusStation</a></li>
<li><a href="../classes/BusStop.html">BusStop</a></li>
<li><a href="../classes/BusTrip.html">BusTrip</a></li>
<li><a href="../classes/BuyAction.html">BuyAction</a></li>
<li><a href="../classes/CableOrSatelliteService.html">CableOrSatelliteService</a></li>
<li><a href="../classes/CafeOrCoffeeShop.html">CafeOrCoffeeShop</a></li>
<li><a href="../classes/Campground.html">Campground</a></li>
<li><a href="../classes/CampingPitch.html">CampingPitch</a></li>
<li><a href="../classes/Canal.html">Canal</a></li>
<li><a href="../classes/CancelAction.html">CancelAction</a></li>
<li><a href="../classes/Car.html">Car</a></li>
<li><a href="../classes/CarUsageType.html">CarUsageType</a></li>
<li><a href="../classes/Casino.html">Casino</a></li>
<li><a href="../classes/Cass.html">Cass</a></li>
<li><a href="../classes/CategoryCode.html">CategoryCode</a></li>
<li><a href="../classes/CategoryCodeSet.html">CategoryCodeSet</a></li>
<li><a href="../classes/CatholicChurch.html">CatholicChurch</a></li>
<li><a href="../classes/CDCPMDRecord.html">CDCPMDRecord</a></li>
<li><a href="../classes/Cemetery.html">Cemetery</a></li>
<li><a href="../classes/Certificate.html">Certificate</a></li>
<li><a href="../classes/CertificateOfCompletion.html">CertificateOfCompletion</a></li>
<li><a href="../classes/Certification.html">Certification</a></li>
<li><a href="../classes/CfdAssessment.html">CfdAssessment</a></li>
<li><a href="../classes/CfdReference.html">CfdReference</a></li>
<li><a href="../classes/Chapter.html">Chapter</a></li>
<li><a href="../classes/CheckAction.html">CheckAction</a></li>
<li><a href="../classes/CheckInAction.html">CheckInAction</a></li>
<li><a href="../classes/CheckOutAction.html">CheckOutAction</a></li>
<li><a href="../classes/CheckoutPage.html">CheckoutPage</a></li>
<li><a href="../classes/ChildCare.html">ChildCare</a></li>
<li><a href="../classes/ChildrensEvent.html">ChildrensEvent</a></li>
<li><a href="../classes/ChooseAction.html">ChooseAction</a></li>
<li><a href="../classes/Church.html">Church</a></li>
<li><a href="../classes/City.html">City</a></li>
<li><a href="../classes/CityHall.html">CityHall</a></li>
<li><a href="../classes/CivicStructure.html">CivicStructure</a></li>
<li><a href="../classes/Claim.html">Claim</a></li>
<li><a href="../classes/ClaimReview.html">ClaimReview</a></li>
<li><a href="../classes/Class.html">Class</a></li>
<li><a href="../classes/Clip.html">Clip</a></li>
<li><a href="../classes/ClothingStore.html">ClothingStore</a></li>
<li><a href="../classes/CocurricularComponent.html">CocurricularComponent</a></li>
<li><a href="../classes/Code.html">Code</a></li>
<li><a href="../classes/Collection.html">Collection</a></li>
<li><a href="../classes/CollectionPage.html">CollectionPage</a></li>
<li><a href="../classes/CollegeOrUniversity.html">CollegeOrUniversity</a></li>
<li><a href="../classes/ComedyClub.html">ComedyClub</a></li>
<li><a href="../classes/ComedyEvent.html">ComedyEvent</a></li>
<li><a href="../classes/ComicCoverArt.html">ComicCoverArt</a></li>
<li><a href="../classes/ComicIssue.html">ComicIssue</a></li>
<li><a href="../classes/ComicSeries.html">ComicSeries</a></li>
<li><a href="../classes/ComicStory.html">ComicStory</a></li>
<li><a href="../classes/Comment.html">Comment</a></li>
<li><a href="../classes/CommentAction.html">CommentAction</a></li>
<li><a href="../classes/CommunicateAction.html">CommunicateAction</a></li>
<li><a href="../classes/Competency.html">Competency</a></li>
<li><a href="../classes/CompetencyComponent.html">CompetencyComponent</a></li>
<li><a href="../classes/CompetencyFramework.html">CompetencyFramework</a></li>
<li><a href="../classes/CompleteDataFeed.html">CompleteDataFeed</a></li>
<li><a href="../classes/ComponentCondition.html">ComponentCondition</a></li>
<li><a href="../classes/CompoundPriceSpecification.html">CompoundPriceSpecification</a></li>
<li><a href="../classes/ComputerLanguage.html">ComputerLanguage</a></li>
<li><a href="../classes/ComputerStore.html">ComputerStore</a></li>
<li><a href="../classes/Concept.html">Concept</a></li>
<li><a href="../classes/ConceptScheme.html">ConceptScheme</a></li>
<li><a href="../classes/ConditionManifest.html">ConditionManifest</a></li>
<li><a href="../classes/ConditionProfile.html">ConditionProfile</a></li>
<li><a href="../classes/ConfirmAction.html">ConfirmAction</a></li>
<li><a href="../classes/Consortium.html">Consortium</a></li>
<li><a href="../classes/ConsumeAction.html">ConsumeAction</a></li>
<li><a href="../classes/ContactPage.html">ContactPage</a></li>
<li><a href="../classes/ContactPoint.html">ContactPoint</a></li>
<li><a href="../classes/ContactPointOption.html">ContactPointOption</a></li>
<li><a href="../classes/Continent.html">Continent</a></li>
<li><a href="../classes/ControlAction.html">ControlAction</a></li>
<li><a href="../classes/ConvenienceStore.html">ConvenienceStore</a></li>
<li><a href="../classes/Conversation.html">Conversation</a></li>
<li><a href="../classes/CookAction.html">CookAction</a></li>
<li><a href="../classes/Corporation.html">Corporation</a></li>
<li><a href="../classes/CorrectionComment.html">CorrectionComment</a></li>
<li><a href="../classes/CostManifest.html">CostManifest</a></li>
<li><a href="../classes/CostProfile.html">CostProfile</a></li>
<li><a href="../classes/Country.html">Country</a></li>
<li><a href="../classes/Course.html">Course</a></li>
<li><a href="../classes/CourseComponent.html">CourseComponent</a></li>
<li><a href="../classes/CourseInstance.html">CourseInstance</a></li>
<li><a href="../classes/Courthouse.html">Courthouse</a></li>
<li><a href="../classes/CoverArt.html">CoverArt</a></li>
<li><a href="../classes/CovidTestingFacility.html">CovidTestingFacility</a></li>
<li><a href="../classes/CreateAction.html">CreateAction</a></li>
<li><a href="../classes/CreativeWork.html">CreativeWork</a></li>
<li><a href="../classes/CreativeWorkSeason.html">CreativeWorkSeason</a></li>
<li><a href="../classes/CreativeWorkSeries.html">CreativeWorkSeries</a></li>
<li><a href="../classes/Credential.html">Credential</a></li>
<li><a href="../classes/CredentialAlignmentObject.html">CredentialAlignmentObject</a></li>
<li><a href="../classes/CredentialAssertion.html">CredentialAssertion</a></li>
<li><a href="../classes/CredentialComponent.html">CredentialComponent</a></li>
<li><a href="../classes/CredentialFramework.html">CredentialFramework</a></li>
<li><a href="../classes/CredentialingAction.html">CredentialingAction</a></li>
<li><a href="../classes/CredentialOrganization.html">CredentialOrganization</a></li>
<li><a href="../classes/CredentialPerson.html">CredentialPerson</a></li>
<li><a href="../classes/CreditCard.html">CreditCard</a></li>
<li><a href="../classes/Crematorium.html">Crematorium</a></li>
<li><a href="../classes/CriticReview.html">CriticReview</a></li>
<li><a href="../classes/CssSelectorType.html">CssSelectorType</a></li>
<li><a href="../classes/CSVExport.html">CSVExport</a></li>
<li><a href="../classes/CSVImport.html">CSVImport</a></li>
<li><a href="../classes/CurrencyConversionService.html">CurrencyConversionService</a></li>
<li><a href="../classes/DanceEvent.html">DanceEvent</a></li>
<li><a href="../classes/DanceGroup.html">DanceGroup</a></li>
<li><a href="../classes/DataCatalog.html">DataCatalog</a></li>
<li><a href="../classes/DataDownload.html">DataDownload</a></li>
<li><a href="../classes/DataFeed.html">DataFeed</a></li>
<li><a href="../classes/DataFeedItem.html">DataFeedItem</a></li>
<li><a href="../classes/Dataset.html">Dataset</a></li>
<li><a href="../classes/DatedMoneySpecification.html">DatedMoneySpecification</a></li>
<li><a href="../classes/DayOfWeek.html">DayOfWeek</a></li>
<li><a href="../classes/DaySpa.html">DaySpa</a></li>
<li><a href="../classes/DDxElement.html">DDxElement</a></li>
<li><a href="../classes/DeactivateAction.html">DeactivateAction</a></li>
<li><a href="../classes/DefenceEstablishment.html">DefenceEstablishment</a></li>
<li><a href="../classes/DefinedRegion.html">DefinedRegion</a></li>
<li><a href="../classes/DefinedTerm.html">DefinedTerm</a></li>
<li><a href="../classes/DefinedTermSet.html">DefinedTermSet</a></li>
<li><a href="../classes/Degree.html">Degree</a></li>
<li><a href="../classes/DeleteAction.html">DeleteAction</a></li>
<li><a href="../classes/DeliveryChargeSpecification.html">DeliveryChargeSpecification</a></li>
<li><a href="../classes/DeliveryEvent.html">DeliveryEvent</a></li>
<li><a href="../classes/DeliveryMethod.html">DeliveryMethod</a></li>
<li><a href="../classes/DeliveryTimeSettings.html">DeliveryTimeSettings</a></li>
<li><a href="../classes/Demand.html">Demand</a></li>
<li><a href="../classes/Dentist.html">Dentist</a></li>
<li><a href="../classes/DepartAction.html">DepartAction</a></li>
<li><a href="../classes/DepartmentStore.html">DepartmentStore</a></li>
<li><a href="../classes/DepositAccount.html">DepositAccount</a></li>
<li><a href="../classes/DiagnosticLab.html">DiagnosticLab</a></li>
<li><a href="../classes/DiagnosticProcedure.html">DiagnosticProcedure</a></li>
<li><a href="../classes/Diet.html">Diet</a></li>
<li><a href="../classes/DietarySupplement.html">DietarySupplement</a></li>
<li><a href="../classes/DigitalBadge.html">DigitalBadge</a></li>
<li><a href="../classes/DigitalDocument.html">DigitalDocument</a></li>
<li><a href="../classes/DigitalDocumentPermission.html">DigitalDocumentPermission</a></li>
<li><a href="../classes/DigitalDocumentPermissionType.html">DigitalDocumentPermissionType</a></li>
<li><a href="../classes/Diploma.html">Diploma</a></li>
<li><a href="../classes/Directory.html">Directory</a></li>
<li><a href="../classes/DisagreeAction.html">DisagreeAction</a></li>
<li><a href="../classes/DiscoverAction.html">DiscoverAction</a></li>
<li><a href="../classes/DiscussionForumPosting.html">DiscussionForumPosting</a></li>
<li><a href="../classes/DislikeAction.html">DislikeAction</a></li>
<li><a href="../classes/Distance.html">Distance</a></li>
<li><a href="../classes/Distillery.html">Distillery</a></li>
<li><a href="../classes/DoctoralDegree.html">DoctoralDegree</a></li>
<li><a href="../classes/DonateAction.html">DonateAction</a></li>
<li><a href="../classes/DoseSchedule.html">DoseSchedule</a></li>
<li><a href="../classes/DownloadAction.html">DownloadAction</a></li>
<li><a href="../classes/DrawAction.html">DrawAction</a></li>
<li><a href="../classes/Drawing.html">Drawing</a></li>
<li><a href="../classes/DrinkAction.html">DrinkAction</a></li>
<li><a href="../classes/DriveWheelConfigurationValue.html">DriveWheelConfigurationValue</a></li>
<li><a href="../classes/Drug.html">Drug</a></li>
<li><a href="../classes/DrugClass.html">DrugClass</a></li>
<li><a href="../classes/DrugCost.html">DrugCost</a></li>
<li><a href="../classes/DrugCostCategory.html">DrugCostCategory</a></li>
<li><a href="../classes/DrugLegalStatus.html">DrugLegalStatus</a></li>
<li><a href="../classes/DrugPregnancyCategory.html">DrugPregnancyCategory</a></li>
<li><a href="../classes/DrugPrescriptionStatus.html">DrugPrescriptionStatus</a></li>
<li><a href="../classes/DrugStrength.html">DrugStrength</a></li>
<li><a href="../classes/DryCleaningOrLaundry.html">DryCleaningOrLaundry</a></li>
<li><a href="../classes/Duration.html">Duration</a></li>
<li><a href="../classes/DurationProfile.html">DurationProfile</a></li>
<li><a href="../classes/EarningsProfile.html">EarningsProfile</a></li>
<li><a href="../classes/EatAction.html">EatAction</a></li>
<li><a href="../classes/Ebac.html">Ebac</a></li>
<li><a href="../classes/EbacContact.html">EbacContact</a></li>
<li><a href="../classes/EbacContactGrant.html">EbacContactGrant</a></li>
<li><a href="../classes/EbacCredential.html">EbacCredential</a></li>
<li><a href="../classes/EbacCredentialCommit.html">EbacCredentialCommit</a></li>
<li><a href="../classes/EbacCredentialRequest.html">EbacCredentialRequest</a></li>
<li><a href="../classes/EbacCredentials.html">EbacCredentials</a></li>
<li><a href="../classes/EbacEncryptedSecret.html">EbacEncryptedSecret</a></li>
<li><a href="../classes/EbacEncryptedValue.html">EbacEncryptedValue</a></li>
<li><a href="../classes/EbacSignature.html">EbacSignature</a></li>
<li><a href="../classes/EcAes.html">EcAes</a></li>
<li><a href="../classes/EcAesCtr.html">EcAesCtr</a></li>
<li><a href="../classes/EcAesCtrAsync.html">EcAesCtrAsync</a></li>
<li><a href="../classes/EcAesCtrAsyncWorker.html">EcAesCtrAsyncWorker</a></li>
<li><a href="../classes/EcAlignment.html">EcAlignment</a></li>
<li><a href="../classes/EcArray.html">EcArray</a></li>
<li><a href="../classes/EcAsyncHelper.html">EcAsyncHelper</a></li>
<li><a href="../classes/EcCompetency.html">EcCompetency</a></li>
<li><a href="../classes/EcContact.html">EcContact</a></li>
<li><a href="../classes/EcCrypto.html">EcCrypto</a></li>
<li><a href="../classes/EcDirectedGraph.html">EcDirectedGraph</a></li>
<li><a href="../classes/EcDirectory.html">EcDirectory</a></li>
<li><a href="../classes/EcEncryptedValue.html">EcEncryptedValue</a></li>
<li><a href="../classes/EcFile.html">EcFile</a></li>
<li><a href="../classes/EcFramework.html">EcFramework</a></li>
<li><a href="../classes/EcFrameworkGraph.html">EcFrameworkGraph</a></li>
<li><a href="../classes/EcIdentity.html">EcIdentity</a></li>
<li><a href="../classes/EcIdentityManager.html">EcIdentityManager</a></li>
<li><a href="../classes/EcLevel.html">EcLevel</a></li>
<li><a href="../classes/EcLinkedData
/ module.exports = class EcLinkedData {
constructor(context, type) {
this.setContextAndType(context, type);
}
static atProperties = ["id", "type", "schema", "context", "graph"];
/**
JSON-LD @type field..html">EcLinkedData
/ module.exports = class EcLinkedData {
constructor(context, type) {
this.setContextAndType(context, type);
}
static atProperties = ["id", "type", "schema", "context", "graph"];
/**
JSON-LD @type field.</a></li>
<li><a href="../classes/EcObject.html">EcObject</a></li>
<li><a href="../classes/EcPk.html">EcPk</a></li>
<li><a href="../classes/EcPpk.html">EcPpk</a></li>
<li><a href="../classes/EcRemote.html">EcRemote</a></li>
<li><a href="../classes/EcRemoteIdentityManager.html">EcRemoteIdentityManager</a></li>
<li><a href="../classes/EcRemoteLinkedData.html">EcRemoteLinkedData</a></li>
<li><a href="../classes/EcRepository.html">EcRepository</a></li>
<li><a href="../classes/EcRollupRule.html">EcRollupRule</a></li>
<li><a href="../classes/EcRsaOaep.html">EcRsaOaep</a></li>
<li><a href="../classes/EcRsaOaepAsync.html">EcRsaOaepAsync</a></li>
<li><a href="../classes/EducationalAudience.html">EducationalAudience</a></li>
<li><a href="../classes/EducationalOccupationalCredential.html">EducationalOccupationalCredential</a></li>
<li><a href="../classes/EducationalOccupationalProgram.html">EducationalOccupationalProgram</a></li>
<li><a href="../classes/EducationalOrganization.html">EducationalOrganization</a></li>
<li><a href="../classes/EducationEvent.html">EducationEvent</a></li>
<li><a href="../classes/Electrician.html">Electrician</a></li>
<li><a href="../classes/ElectronicsStore.html">ElectronicsStore</a></li>
<li><a href="../classes/ElementarySchool.html">ElementarySchool</a></li>
<li><a href="../classes/EmailMessage.html">EmailMessage</a></li>
<li><a href="../classes/Embassy.html">Embassy</a></li>
<li><a href="../classes/EmergencyService.html">EmergencyService</a></li>
<li><a href="../classes/EmployeeRole.html">EmployeeRole</a></li>
<li><a href="../classes/EmployerAggregateRating.html">EmployerAggregateRating</a></li>
<li><a href="../classes/EmployerReview.html">EmployerReview</a></li>
<li><a href="../classes/EmploymentAgency.html">EmploymentAgency</a></li>
<li><a href="../classes/EmploymentOutcomeProfile.html">EmploymentOutcomeProfile</a></li>
<li><a href="../classes/EndorseAction.html">EndorseAction</a></li>
<li><a href="../classes/EndorsementRating.html">EndorsementRating</a></li>
<li><a href="../classes/Energy.html">Energy</a></li>
<li><a href="../classes/EnergyConsumptionDetails.html">EnergyConsumptionDetails</a></li>
<li><a href="../classes/EnergyEfficiencyEnumeration.html">EnergyEfficiencyEnumeration</a></li>
<li><a href="../classes/EnergyStarEnergyEfficiencyEnumeration.html">EnergyStarEnergyEfficiencyEnumeration</a></li>
<li><a href="../classes/EngineSpecification.html">EngineSpecification</a></li>
<li><a href="../classes/EntertainmentBusiness.html">EntertainmentBusiness</a></li>
<li><a href="../classes/EntryPoint.html">EntryPoint</a></li>
<li><a href="../classes/Enumeration.html">Enumeration</a></li>
<li><a href="../classes/Episode.html">Episode</a></li>
<li><a href="../classes/EUEnergyEfficiencyEnumeration.html">EUEnergyEfficiencyEnumeration</a></li>
<li><a href="../classes/Event.html">Event</a></li>
<li><a href="../classes/EventAttendanceModeEnumeration.html">EventAttendanceModeEnumeration</a></li>
<li><a href="../classes/EventReservation.html">EventReservation</a></li>
<li><a href="../classes/EventSeries.html">EventSeries</a></li>
<li><a href="../classes/EventStatusType.html">EventStatusType</a></li>
<li><a href="../classes/EventVenue.html">EventVenue</a></li>
<li><a href="../classes/ExchangeRateSpecification.html">ExchangeRateSpecification</a></li>
<li><a href="../classes/ExerciseAction.html">ExerciseAction</a></li>
<li><a href="../classes/ExerciseGym.html">ExerciseGym</a></li>
<li><a href="../classes/ExercisePlan.html">ExercisePlan</a></li>
<li><a href="../classes/ExhibitionEvent.html">ExhibitionEvent</a></li>
<li><a href="../classes/Exporter.html">Exporter</a></li>
<li><a href="../classes/ExtracurricularComponent.html">ExtracurricularComponent</a></li>
<li><a href="../classes/FAQPage.html">FAQPage</a></li>
<li><a href="../classes/FastFoodRestaurant.html">FastFoodRestaurant</a></li>
<li><a href="../classes/Festival.html">Festival</a></li>
<li><a href="../classes/FilmAction.html">FilmAction</a></li>
<li><a href="../classes/FinancialAssistanceProfile.html">FinancialAssistanceProfile</a></li>
<li><a href="../classes/FinancialProduct.html">FinancialProduct</a></li>
<li><a href="../classes/FinancialService.html">FinancialService</a></li>
<li><a href="../classes/FindAction.html">FindAction</a></li>
<li><a href="../classes/FireStation.html">FireStation</a></li>
<li><a href="../classes/Flight.html">Flight</a></li>
<li><a href="../classes/FlightReservation.html">FlightReservation</a></li>
<li><a href="../classes/FloorPlan.html">FloorPlan</a></li>
<li><a href="../classes/Florist.html">Florist</a></li>
<li><a href="../classes/FMRadioChannel.html">FMRadioChannel</a></li>
<li><a href="../classes/FollowAction.html">FollowAction</a></li>
<li><a href="../classes/FoodEstablishment.html">FoodEstablishment</a></li>
<li><a href="../classes/FoodEstablishmentReservation.html">FoodEstablishmentReservation</a></li>
<li><a href="../classes/FoodEvent.html">FoodEvent</a></li>
<li><a href="../classes/FoodService.html">FoodService</a></li>
<li><a href="../classes/Framework.html">Framework</a></li>
<li><a href="../classes/FrameworkImport.html">FrameworkImport</a></li>
<li><a href="../classes/FundingAgency.html">FundingAgency</a></li>
<li><a href="../classes/FundingScheme.html">FundingScheme</a></li>
<li><a href="../classes/FurnitureStore.html">FurnitureStore</a></li>
<li><a href="../classes/Game.html">Game</a></li>
<li><a href="../classes/GamePlayMode.html">GamePlayMode</a></li>
<li><a href="../classes/GameServer.html">GameServer</a></li>
<li><a href="../classes/GameServerStatus.html">GameServerStatus</a></li>
<li><a href="../classes/GardenStore.html">GardenStore</a></li>
<li><a href="../classes/GasStation.html">GasStation</a></li>
<li><a href="../classes/GatedResidenceCommunity.html">GatedResidenceCommunity</a></li>
<li><a href="../classes/GenderType.html">GenderType</a></li>
<li><a href="../classes/General.html">General</a></li>
<li><a href="../classes/GeneralContractor.html">GeneralContractor</a></li>
<li><a href="../classes/GeneralEducationDevelopment.html">GeneralEducationDevelopment</a></li>
<li><a href="../classes/GeneralFile.html">GeneralFile</a></li>
<li><a href="../classes/GeoCircle.html">GeoCircle</a></li>
<li><a href="../classes/GeoCoordinates.html">GeoCoordinates</a></li>
<li><a href="../classes/GeoShape.html">GeoShape</a></li>
<li><a href="../classes/GeospatialGeometry.html">GeospatialGeometry</a></li>
<li><a href="../classes/GiveAction.html">GiveAction</a></li>
<li><a href="../classes/GolfCourse.html">GolfCourse</a></li>
<li><a href="../classes/GovernmentBenefitsType.html">GovernmentBenefitsType</a></li>
<li><a href="../classes/GovernmentBuilding.html">GovernmentBuilding</a></li>
<li><a href="../classes/GovernmentOffice.html">GovernmentOffice</a></li>
<li><a href="../classes/GovernmentOrganization.html">GovernmentOrganization</a></li>
<li><a href="../classes/GovernmentPermit.html">GovernmentPermit</a></li>
<li><a href="../classes/GovernmentService.html">GovernmentService</a></li>
<li><a href="../classes/Grant.html">Grant</a></li>
<li><a href="../classes/Graph.html">Graph</a></li>
<li><a href="../classes/GroceryStore.html">GroceryStore</a></li>
<li><a href="../classes/Guide.html">Guide</a></li>
<li><a href="../classes/Hackathon.html">Hackathon</a></li>
<li><a href="../classes/HairSalon.html">HairSalon</a></li>
<li><a href="../classes/HardwareStore.html">HardwareStore</a></li>
<li><a href="../classes/HealthAndBeautyBusiness.html">HealthAndBeautyBusiness</a></li>
<li><a href="../classes/HealthAspectEnumeration.html">HealthAspectEnumeration</a></li>
<li><a href="../classes/HealthClub.html">HealthClub</a></li>
<li><a href="../classes/HealthInsurancePlan.html">HealthInsurancePlan</a></li>
<li><a href="../classes/HealthPlanCostSharingSpecification.html">HealthPlanCostSharingSpecification</a></li>
<li><a href="../classes/HealthPlanFormulary.html">HealthPlanFormulary</a></li>
<li><a href="../classes/HealthPlanNetwork.html">HealthPlanNetwork</a></li>
<li><a href="../classes/HealthTopicContent.html">HealthTopicContent</a></li>
<li><a href="../classes/HighSchool.html">HighSchool</a></li>
<li><a href="../classes/HinduTemple.html">HinduTemple</a></li>
<li><a href="../classes/HobbyShop.html">HobbyShop</a></li>
<li><a href="../classes/HoldersProfile.html">HoldersProfile</a></li>
<li><a href="../classes/HomeAndConstructionBusiness.html">HomeAndConstructionBusiness</a></li>
<li><a href="../classes/HomeGoodsStore.html">HomeGoodsStore</a></li>
<li><a href="../classes/Hospital.html">Hospital</a></li>
<li><a href="../classes/Hostel.html">Hostel</a></li>
<li><a href="../classes/Hotel.html">Hotel</a></li>
<li><a href="../classes/HotelRoom.html">HotelRoom</a></li>
<li><a href="../classes/House.html">House</a></li>
<li><a href="../classes/HousePainter.html">HousePainter</a></li>
<li><a href="../classes/HowTo.html">HowTo</a></li>
<li><a href="../classes/HowToDirection.html">HowToDirection</a></li>
<li><a href="../classes/HowToItem.html">HowToItem</a></li>
<li><a href="../classes/HowToSection.html">HowToSection</a></li>
<li><a href="../classes/HowToStep.html">HowToStep</a></li>
<li><a href="../classes/HowToSupply.html">HowToSupply</a></li>
<li><a href="../classes/HowToTip.html">HowToTip</a></li>
<li><a href="../classes/HowToTool.html">HowToTool</a></li>
<li><a href="../classes/HVACBusiness.html">HVACBusiness</a></li>
<li><a href="../classes/Hypergraph.html">Hypergraph</a></li>
<li><a href="../classes/HyperToc.html">HyperToc</a></li>
<li><a href="../classes/HyperTocEntry.html">HyperTocEntry</a></li>
<li><a href="../classes/IceCreamShop.html">IceCreamShop</a></li>
<li><a href="../classes/IdentifierValue.html">IdentifierValue</a></li>
<li><a href="../classes/IgnoreAction.html">IgnoreAction</a></li>
<li><a href="../classes/ImageGallery.html">ImageGallery</a></li>
<li><a href="../classes/ImageObject.html">ImageObject</a></li>
<li><a href="../classes/ImagingTest.html">ImagingTest</a></li>
<li><a href="../classes/Importer.html">Importer</a></li>
<li><a href="../classes/IndividualProduct.html">IndividualProduct</a></li>
<li><a href="../classes/IndustryClassification.html">IndustryClassification</a></li>
<li><a href="../classes/InfectiousAgentClass.html">InfectiousAgentClass</a></li>
<li><a href="../classes/InfectiousDisease.html">InfectiousDisease</a></li>
<li><a href="../classes/InformAction.html">InformAction</a></li>
<li><a href="../classes/InsertAction.html">InsertAction</a></li>
<li><a href="../classes/InstallAction.html">InstallAction</a></li>
<li><a href="../classes/InstructionalProgramClassification.html">InstructionalProgramClassification</a></li>
<li><a href="../classes/InsuranceAgency.html">InsuranceAgency</a></li>
<li><a href="../classes/Intangible.html">Intangible</a></li>
<li><a href="../classes/InteractAction.html">InteractAction</a></li>
<li><a href="../classes/InteractionCounter.html">InteractionCounter</a></li>
<li><a href="../classes/InternetCafe.html">InternetCafe</a></li>
<li><a href="../classes/InvestmentFund.html">InvestmentFund</a></li>
<li><a href="../classes/InvestmentOrDeposit.html">InvestmentOrDeposit</a></li>
<li><a href="../classes/InviteAction.html">InviteAction</a></li>
<li><a href="../classes/Invoice.html">Invoice</a></li>
<li><a href="../classes/ItemAvailability.html">ItemAvailability</a></li>
<li><a href="../classes/ItemList.html">ItemList</a></li>
<li><a href="../classes/ItemListOrderType.html">ItemListOrderType</a></li>
<li><a href="../classes/ItemPage.html">ItemPage</a></li>
<li><a href="../classes/JewelryStore.html">JewelryStore</a></li>
<li><a href="../classes/Job.html">Job</a></li>
<li><a href="../classes/JobComponent.html">JobComponent</a></li>
<li><a href="../classes/JobPosting.html">JobPosting</a></li>
<li><a href="../classes/JoinAction.html">JoinAction</a></li>
<li><a href="../classes/Joint.html">Joint</a></li>
<li><a href="../classes/JourneymanCertificate.html">JourneymanCertificate</a></li>
<li><a href="../classes/JurisdictionProfile.html">JurisdictionProfile</a></li>
<li><a href="../classes/Knowledge.html">Knowledge</a></li>
<li><a href="../classes/LakeBodyOfWater.html">LakeBodyOfWater</a></li>
<li><a href="../classes/Landform.html">Landform</a></li>
<li><a href="../classes/LandmarksOrHistoricalBuildings.html">LandmarksOrHistoricalBuildings</a></li>
<li><a href="../classes/Language.html">Language</a></li>
<li><a href="../classes/LearningOpportunity.html">LearningOpportunity</a></li>
<li><a href="../classes/LearningOpportunityProfile.html">LearningOpportunityProfile</a></li>
<li><a href="../classes/LearningResource.html">LearningResource</a></li>
<li><a href="../classes/LeaveAction.html">LeaveAction</a></li>
<li><a href="../classes/LegalForceStatus.html">LegalForceStatus</a></li>
<li><a href="../classes/LegalService.html">LegalService</a></li>
<li><a href="../classes/LegalValueLevel.html">LegalValueLevel</a></li>
<li><a href="../classes/Legislation.html">Legislation</a></li>
<li><a href="../classes/LegislationObject.html">LegislationObject</a></li>
<li><a href="../classes/LegislativeBuilding.html">LegislativeBuilding</a></li>
<li><a href="../classes/LendAction.html">LendAction</a></li>
<li><a href="../classes/Level.html">Level</a></li>
<li><a href="../classes/Library.html">Library</a></li>
<li><a href="../classes/LibrarySystem.html">LibrarySystem</a></li>
<li><a href="../classes/License.html">License</a></li>
<li><a href="../classes/LifestyleModification.html">LifestyleModification</a></li>
<li><a href="../classes/Ligament.html">Ligament</a></li>
<li><a href="../classes/LikeAction.html">LikeAction</a></li>
<li><a href="../classes/LinkRole.html">LinkRole</a></li>
<li><a href="../classes/LiquorStore.html">LiquorStore</a></li>
<li><a href="../classes/ListenAction.html">ListenAction</a></li>
<li><a href="../classes/ListItem.html">ListItem</a></li>
<li><a href="../classes/LiteraryEvent.html">LiteraryEvent</a></li>
<li><a href="../classes/LiveBlogPosting.html">LiveBlogPosting</a></li>
<li><a href="../classes/LoanOrCredit.html">LoanOrCredit</a></li>
<li><a href="../classes/LocalBusiness.html">LocalBusiness</a></li>
<li><a href="../classes/LocationFeatureSpecification.html">LocationFeatureSpecification</a></li>
<li><a href="../classes/Locksmith.html">Locksmith</a></li>
<li><a href="../classes/LodgingBusiness.html">LodgingBusiness</a></li>
<li><a href="../classes/LodgingReservation.html">LodgingReservation</a></li>
<li><a href="../classes/LoseAction.html">LoseAction</a></li>
<li><a href="../classes/LymphaticVessel.html">LymphaticVessel</a></li>
<li><a href="../classes/Manuscript.html">Manuscript</a></li>
<li><a href="../classes/Map.html">Map</a></li>
<li><a href="../classes/MapCategoryType.html">MapCategoryType</a></li>
<li><a href="../classes/MarryAction.html">MarryAction</a></li>
<li><a href="../classes/Mass.html">Mass</a></li>
<li><a href="../classes/MasterCertificate.html">MasterCertificate</a></li>
<li><a href="../classes/MasterDegree.html">MasterDegree</a></li>
<li><a href="../classes/MathSolver.html">MathSolver</a></li>
<li><a href="../classes/MaximumDoseSchedule.html">MaximumDoseSchedule</a></li>
<li><a href="../classes/MeasurementTypeEnumeration.html">MeasurementTypeEnumeration</a></li>
<li><a href="../classes/MedbiqImport.html">MedbiqImport</a></li>
<li><a href="../classes/MediaGallery.html">MediaGallery</a></li>
<li><a href="../classes/MediaManipulationRatingEnumeration.html">MediaManipulationRatingEnumeration</a></li>
<li><a href="../classes/MediaObject.html">MediaObject</a></li>
<li><a href="../classes/MediaReview.html">MediaReview</a></li>
<li><a href="../classes/MediaSubscription.html">MediaSubscription</a></li>
<li><a href="../classes/MedicalAudience.html">MedicalAudience</a></li>
<li><a href="../classes/MedicalAudienceType.html">MedicalAudienceType</a></li>
<li><a href="../classes/MedicalBusiness.html">MedicalBusiness</a></li>
<li><a href="../classes/MedicalCause.html">MedicalCause</a></li>
<li><a href="../classes/MedicalClinic.html">MedicalClinic</a></li>
<li><a href="../classes/MedicalCode.html">MedicalCode</a></li>
<li><a href="../classes/MedicalCondition.html">MedicalCondition</a></li>
<li><a href="../classes/MedicalConditionStage.html">MedicalConditionStage</a></li>
<li><a href="../classes/MedicalContraindication.html">MedicalContraindication</a></li>
<li><a href="../classes/MedicalDevice.html">MedicalDevice</a></li>
<li><a href="../classes/MedicalDevicePurpose.html">MedicalDevicePurpose</a></li>
<li><a href="../classes/MedicalEntity.html">MedicalEntity</a></li>
<li><a href="../classes/MedicalEnumeration.html">MedicalEnumeration</a></li>
<li><a href="../classes/MedicalEvidenceLevel.html">MedicalEvidenceLevel</a></li>
<li><a href="../classes/MedicalGuideline.html">MedicalGuideline</a></li>
<li><a href="../classes/MedicalGuidelineContraindication.html">MedicalGuidelineContraindication</a></li>
<li><a href="../classes/MedicalGuidelineRecommendation.html">MedicalGuidelineRecommendation</a></li>
<li><a href="../classes/MedicalImagingTechnique.html">MedicalImagingTechnique</a></li>
<li><a href="../classes/MedicalIndication.html">MedicalIndication</a></li>
<li><a href="../classes/MedicalIntangible.html">MedicalIntangible</a></li>
<li><a href="../classes/MedicalObservationalStudy.html">MedicalObservationalStudy</a></li>
<li><a href="../classes/MedicalObservationalStudyDesign.html">MedicalObservationalStudyDesign</a></li>
<li><a href="../classes/MedicalOrganization.html">MedicalOrganization</a></li>
<li><a href="../classes/MedicalProcedure.html">MedicalProcedure</a></li>
<li><a href="../classes/MedicalProcedureType.html">MedicalProcedureType</a></li>
<li><a href="../classes/MedicalRiskCalculator.html">MedicalRiskCalculator</a></li>
<li><a href="../classes/MedicalRiskEstimator.html">MedicalRiskEstimator</a></li>
<li><a href="../classes/MedicalRiskFactor.html">MedicalRiskFactor</a></li>
<li><a href="../classes/MedicalRiskScore.html">MedicalRiskScore</a></li>
<li><a href="../classes/MedicalScholarlyArticle.html">MedicalScholarlyArticle</a></li>
<li><a href="../classes/MedicalSign.html">MedicalSign</a></li>
<li><a href="../classes/MedicalSignOrSymptom.html">MedicalSignOrSymptom</a></li>
<li><a href="../classes/MedicalSpecialty.html">MedicalSpecialty</a></li>
<li><a href="../classes/MedicalStudy.html">MedicalStudy</a></li>
<li><a href="../classes/MedicalStudyStatus.html">MedicalStudyStatus</a></li>
<li><a href="../classes/MedicalSymptom.html">MedicalSymptom</a></li>
<li><a href="../classes/MedicalTest.html">MedicalTest</a></li>
<li><a href="../classes/MedicalTestPanel.html">MedicalTestPanel</a></li>
<li><a href="../classes/MedicalTherapy.html">MedicalTherapy</a></li>
<li><a href="../classes/MedicalTrial.html">MedicalTrial</a></li>
<li><a href="../classes/MedicalTrialDesign.html">MedicalTrialDesign</a></li>
<li><a href="../classes/MedicalWebPage.html">MedicalWebPage</a></li>
<li><a href="../classes/MedicineSystem.html">MedicineSystem</a></li>
<li><a href="../classes/MeetingRoom.html">MeetingRoom</a></li>
<li><a href="../classes/MensClothingStore.html">MensClothingStore</a></li>
<li><a href="../classes/Menu.html">Menu</a></li>
<li><a href="../classes/MenuItem.html">MenuItem</a></li>
<li><a href="../classes/MenuSection.html">MenuSection</a></li>
<li><a href="../classes/MerchantReturnEnumeration.html">MerchantReturnEnumeration</a></li>
<li><a href="../classes/MerchantReturnPolicy.html">MerchantReturnPolicy</a></li>
<li><a href="../classes/Message.html">Message</a></li>
<li><a href="../classes/MicroCredential.html">MicroCredential</a></li>
<li><a href="../classes/MiddleSchool.html">MiddleSchool</a></li>
<li><a href="../classes/MobileApplication.html">MobileApplication</a></li>
<li><a href="../classes/MobilePhoneStore.html">MobilePhoneStore</a></li>
<li><a href="../classes/MonetaryAmount.html">MonetaryAmount</a></li>
<li><a href="../classes/MonetaryAmountDistribution.html">MonetaryAmountDistribution</a></li>
<li><a href="../classes/MonetaryGrant.html">MonetaryGrant</a></li>
<li><a href="../classes/MoneyTransfer.html">MoneyTransfer</a></li>
<li><a href="../classes/MortgageLoan.html">MortgageLoan</a></li>
<li><a href="../classes/Mosque.html">Mosque</a></li>
<li><a href="../classes/Motel.html">Motel</a></li>
<li><a href="../classes/Motorcycle.html">Motorcycle</a></li>
<li><a href="../classes/MotorcycleDealer.html">MotorcycleDealer</a></li>
<li><a href="../classes/MotorcycleRepair.html">MotorcycleRepair</a></li>
<li><a href="../classes/MotorizedBicycle.html">MotorizedBicycle</a></li>
<li><a href="../classes/Mountain.html">Mountain</a></li>
<li><a href="../classes/MoveAction.html">MoveAction</a></li>
<li><a href="../classes/Movie.html">Movie</a></li>
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
<li><a href="../classes/MovieRentalStore.html">MovieRentalStore</a></li>
<li><a href="../classes/MovieSeries.html">MovieSeries</a></li>
<li><a href="../classes/MovieTheater.html">MovieTheater</a></li>
<li><a href="../classes/MovingCompany.html">MovingCompany</a></li>
<li><a href="../classes/Muscle.html">Muscle</a></li>
<li><a href="../classes/Museum.html">Museum</a></li>
<li><a href="../classes/MusicAlbum.html">MusicAlbum</a></li>
<li><a href="../classes/MusicAlbumProductionType.html">MusicAlbumProductionType</a></li>
<li><a href="../classes/MusicAlbumReleaseType.html">MusicAlbumReleaseType</a></li>
<li><a href="../classes/MusicComposition.html">MusicComposition</a></li>
<li><a href="../classes/MusicEvent.html">MusicEvent</a></li>
<li><a href="../classes/MusicGroup.html">MusicGroup</a></li>
<li><a href="../classes/MusicPlaylist.html">MusicPlaylist</a></li>
<li><a href="../classes/MusicRecording.html">MusicRecording</a></li>
<li><a href="../classes/MusicRelease.html">MusicRelease</a></li>
<li><a href="../classes/MusicReleaseFormatType.html">MusicReleaseFormatType</a></li>
<li><a href="../classes/MusicStore.html">MusicStore</a></li>
<li><a href="../classes/MusicVenue.html">MusicVenue</a></li>
<li><a href="../classes/MusicVideoObject.html">MusicVideoObject</a></li>
<li><a href="../classes/NailSalon.html">NailSalon</a></li>
<li><a href="../classes/Nerve.html">Nerve</a></li>
<li><a href="../classes/NewsArticle.html">NewsArticle</a></li>
<li><a href="../classes/NewsMediaOrganization.html">NewsMediaOrganization</a></li>
<li><a href="../classes/Newspaper.html">Newspaper</a></li>
<li><a href="../classes/NGO.html">NGO</a></li>
<li><a href="../classes/NightClub.html">NightClub</a></li>
<li><a href="../classes/NLNonprofitType.html">NLNonprofitType</a></li>
<li><a href="../classes/NonprofitType.html">NonprofitType</a></li>
<li><a href="../classes/Notary.html">Notary</a></li>
<li><a href="../classes/NoteDigitalDocument.html">NoteDigitalDocument</a></li>
<li><a href="../classes/NutritionInformation.html">NutritionInformation</a></li>
<li><a href="../classes/Observation.html">Observation</a></li>
<li><a href="../classes/Occupation.html">Occupation</a></li>
<li><a href="../classes/OccupationalExperienceRequirements.html">OccupationalExperienceRequirements</a></li>
<li><a href="../classes/OccupationalTherapy.html">OccupationalTherapy</a></li>
<li><a href="../classes/OccupationClassification.html">OccupationClassification</a></li>
<li><a href="../classes/OceanBodyOfWater.html">OceanBodyOfWater</a></li>
<li><a href="../classes/Offer.html">Offer</a></li>
<li><a href="../classes/OfferAction.html">OfferAction</a></li>
<li><a href="../classes/OfferCatalog.html">OfferCatalog</a></li>
<li><a href="../classes/OfferForLease.html">OfferForLease</a></li>
<li><a href="../classes/OfferForPurchase.html">OfferForPurchase</a></li>
<li><a href="../classes/OfferItemCondition.html">OfferItemCondition</a></li>
<li><a href="../classes/OfferShippingDetails.html">OfferShippingDetails</a></li>
<li><a href="../classes/OfficeEquipmentStore.html">OfficeEquipmentStore</a></li>
<li><a href="../classes/OnDemandEvent.html">OnDemandEvent</a></li>
<li><a href="../classes/OpenBadge.html">OpenBadge</a></li>
<li><a href="../classes/OpeningHoursSpecification.html">OpeningHoursSpecification</a></li>
<li><a href="../classes/OpinionNewsArticle.html">OpinionNewsArticle</a></li>
<li><a href="../classes/Optician.html">Optician</a></li>
<li><a href="../classes/Order.html">Order</a></li>
<li><a href="../classes/OrderAction.html">OrderAction</a></li>
<li><a href="../classes/OrderedCollection.html">OrderedCollection</a></li>
<li><a href="../classes/OrderItem.html">OrderItem</a></li>
<li><a href="../classes/OrderStatus.html">OrderStatus</a></li>
<li><a href="../classes/Organization.html">Organization</a></li>
<li><a href="../classes/OrganizationRole.html">OrganizationRole</a></li>
<li><a href="../classes/OrganizeAction.html">OrganizeAction</a></li>
<li><a href="../classes/OutletStore.html">OutletStore</a></li>
<li><a href="../classes/OwnershipInfo.html">OwnershipInfo</a></li>
<li><a href="../classes/PaintAction.html">PaintAction</a></li>
<li><a href="../classes/Painting.html">Painting</a></li>
<li><a href="../classes/PalliativeProcedure.html">PalliativeProcedure</a></li>
<li><a href="../classes/ParcelDelivery.html">ParcelDelivery</a></li>
<li><a href="../classes/ParentAudience.html">ParentAudience</a></li>
<li><a href="../classes/Park.html">Park</a></li>
<li><a href="../classes/ParkingFacility.html">ParkingFacility</a></li>
<li><a href="../classes/PathologyTest.html">PathologyTest</a></li>
<li><a href="../classes/Pathway.html">Pathway</a></li>
<li><a href="../classes/PathwayComponent.html">PathwayComponent</a></li>
<li><a href="../classes/PathwaySet.html">PathwaySet</a></li>
<li><a href="../classes/Patient.html">Patient</a></li>
<li><a href="../classes/PawnShop.html">PawnShop</a></li>
<li><a href="../classes/PayAction.html">PayAction</a></li>
<li><a href="../classes/PaymentCard.html">PaymentCard</a></li>
<li><a href="../classes/PaymentChargeSpecification.html">PaymentChargeSpecification</a></li>
<li><a href="../classes/PaymentMethod.html">PaymentMethod</a></li>
<li><a href="../classes/PaymentService.html">PaymentService</a></li>
<li><a href="../classes/PaymentStatusType.html">PaymentStatusType</a></li>
<li><a href="../classes/PeopleAudience.html">PeopleAudience</a></li>
<li><a href="../classes/PerformAction.html">PerformAction</a></li>
<li><a href="../classes/PerformanceRole.html">PerformanceRole</a></li>
<li><a href="../classes/PerformingArtsTheater.html">PerformingArtsTheater</a></li>
<li><a href="../classes/PerformingGroup.html">PerformingGroup</a></li>
<li><a href="../classes/Periodical.html">Periodical</a></li>
<li><a href="../classes/Permit.html">Permit</a></li>
<li><a href="../classes/Person.html">Person</a></li>
<li><a href="../classes/PetStore.html">PetStore</a></li>
<li><a href="../classes/Pharmacy.html">Pharmacy</a></li>
<li><a href="../classes/Photograph.html">Photograph</a></li>
<li><a href="../classes/PhotographAction.html">PhotographAction</a></li>
<li><a href="../classes/PhysicalActivity.html">PhysicalActivity</a></li>
<li><a href="../classes/PhysicalActivityCategory.html">PhysicalActivityCategory</a></li>
<li><a href="../classes/PhysicalExam.html">PhysicalExam</a></li>
<li><a href="../classes/PhysicalTherapy.html">PhysicalTherapy</a></li>
<li><a href="../classes/Physician.html">Physician</a></li>
<li><a href="../classes/Place.html">Place</a></li>
<li><a href="../classes/PlaceOfWorship.html">PlaceOfWorship</a></li>
<li><a href="../classes/PlanAction.html">PlanAction</a></li>
<li><a href="../classes/Play.html">Play</a></li>
<li><a href="../classes/PlayAction.html">PlayAction</a></li>
<li><a href="../classes/Playground.html">Playground</a></li>
<li><a href="../classes/Plumber.html">Plumber</a></li>
<li><a href="../classes/PodcastEpisode.html">PodcastEpisode</a></li>
<li><a href="../classes/PodcastSeason.html">PodcastSeason</a></li>
<li><a href="../classes/PodcastSeries.html">PodcastSeries</a></li>
<li><a href="../classes/PoliceStation.html">PoliceStation</a></li>
<li><a href="../classes/Pond.html">Pond</a></li>
<li><a href="../classes/PostalAddress.html">PostalAddress</a></li>
<li><a href="../classes/PostalCodeRangeSpecification.html">PostalCodeRangeSpecification</a></li>
<li><a href="../classes/Poster.html">Poster</a></li>
<li><a href="../classes/PostOffice.html">PostOffice</a></li>
<li><a href="../classes/PreOrderAction.html">PreOrderAction</a></li>
<li><a href="../classes/PrependAction.html">PrependAction</a></li>
<li><a href="../classes/Preschool.html">Preschool</a></li>
<li><a href="../classes/PresentationDigitalDocument.html">PresentationDigitalDocument</a></li>
<li><a href="../classes/PreventionIndication.html">PreventionIndication</a></li>
<li><a href="../classes/PriceComponentTypeEnumeration.html">PriceComponentTypeEnumeration</a></li>
<li><a href="../classes/PriceSpecification.html">PriceSpecification</a></li>
<li><a href="../classes/PriceTypeEnumeration.html">PriceTypeEnumeration</a></li>
<li><a href="../classes/ProcessProfile.html">ProcessProfile</a></li>
<li><a href="../classes/Product.html">Product</a></li>
<li><a href="../classes/ProductCollection.html">ProductCollection</a></li>
<li><a href="../classes/ProductGroup.html">ProductGroup</a></li>
<li><a href="../classes/ProductModel.html">ProductModel</a></li>
<li><a href="../classes/ProductReturnEnumeration.html">ProductReturnEnumeration</a></li>
<li><a href="../classes/ProductReturnPolicy.html">ProductReturnPolicy</a></li>
<li><a href="../classes/ProfessionalDoctorate.html">ProfessionalDoctorate</a></li>
<li><a href="../classes/ProfessionalService.html">ProfessionalService</a></li>
<li><a href="../classes/ProficiencyScale.html">ProficiencyScale</a></li>
<li><a href="../classes/ProfilePage.html">ProfilePage</a></li>
<li><a href="../classes/ProgramMembership.html">ProgramMembership</a></li>
<li><a href="../classes/ProgressionLevel.html">ProgressionLevel</a></li>
<li><a href="../classes/ProgressionModel.html">ProgressionModel</a></li>
<li><a href="../classes/Project.html">Project</a></li>
<li><a href="../classes/PronounceableText.html">PronounceableText</a></li>
<li><a href="../classes/Property.html">Property</a></li>
<li><a href="../classes/PropertyValue.html">PropertyValue</a></li>
<li><a href="../classes/PropertyValueSpecification.html">PropertyValueSpecification</a></li>
<li><a href="../classes/PsychologicalTreatment.html">PsychologicalTreatment</a></li>
<li><a href="../classes/PublicationEvent.html">PublicationEvent</a></li>
<li><a href="../classes/PublicationIssue.html">PublicationIssue</a></li>
<li><a href="../classes/PublicationVolume.html">PublicationVolume</a></li>
<li><a href="../classes/PublicSwimmingPool.html">PublicSwimmingPool</a></li>
<li><a href="../classes/PublicToilet.html">PublicToilet</a></li>
<li><a href="../classes/QACredentialOrganization.html">QACredentialOrganization</a></li>
<li><a href="../classes/QAPage.html">QAPage</a></li>
<li><a href="../classes/QualitativeValue.html">QualitativeValue</a></li>
<li><a href="../classes/QualityAssuranceCredential.html">QualityAssuranceCredential</a></li>
<li><a href="../classes/QuantitativeValue.html">QuantitativeValue</a></li>
<li><a href="../classes/QuantitativeValueDistribution.html">QuantitativeValueDistribution</a></li>
<li><a href="../classes/Quantity.html">Quantity</a></li>
<li><a href="../classes/Question.html">Question</a></li>
<li><a href="../classes/Quiz.html">Quiz</a></li>
<li><a href="../classes/Quotation.html">Quotation</a></li>
<li><a href="../classes/QuoteAction.html">QuoteAction</a></li>
<li><a href="../classes/RadiationTherapy.html">RadiationTherapy</a></li>
<li><a href="../classes/RadioBroadcastService.html">RadioBroadcastService</a></li>
<li><a href="../classes/RadioChannel.html">RadioChannel</a></li>
<li><a href="../classes/RadioClip.html">RadioClip</a></li>
<li><a href="../classes/RadioEpisode.html">RadioEpisode</a></li>
<li><a href="../classes/RadioSeason.html">RadioSeason</a></li>
<li><a href="../classes/RadioSeries.html">RadioSeries</a></li>
<li><a href="../classes/RadioStation.html">RadioStation</a></li>
<li><a href="../classes/Rating.html">Rating</a></li>
<li><a href="../classes/ReactAction.html">ReactAction</a></li>
<li><a href="../classes/ReadAction.html">ReadAction</a></li>
<li><a href="../classes/RealEstateAgent.html">RealEstateAgent</a></li>
<li><a href="../classes/RealEstateListing.html">RealEstateListing</a></li>
<li><a href="../classes/ReceiveAction.html">ReceiveAction</a></li>
<li><a href="../classes/Recipe.html">Recipe</a></li>
<li><a href="../classes/RecognizeAction.html">RecognizeAction</a></li>
<li><a href="../classes/Recommendation.html">Recommendation</a></li>
<li><a href="../classes/RecommendedDoseSchedule.html">RecommendedDoseSchedule</a></li>
<li><a href="../classes/RecyclingCenter.html">RecyclingCenter</a></li>
<li><a href="../classes/RefundTypeEnumeration.html">RefundTypeEnumeration</a></li>
<li><a href="../classes/RegisterAction.html">RegisterAction</a></li>
<li><a href="../classes/RegulateAction.html">RegulateAction</a></li>
<li><a href="../classes/RejectAction.html">RejectAction</a></li>
<li><a href="../classes/Relation.html">Relation</a></li>
<li><a href="../classes/RenewAction.html">RenewAction</a></li>
<li><a href="../classes/RentAction.html">RentAction</a></li>
<li><a href="../classes/RentalCarReservation.html">RentalCarReservation</a></li>
<li><a href="../classes/RepaymentSpecification.html">RepaymentSpecification</a></li>
<li><a href="../classes/ReplaceAction.html">ReplaceAction</a></li>
<li><a href="../classes/ReplyAction.html">ReplyAction</a></li>
<li><a href="../classes/Report.html">Report</a></li>
<li><a href="../classes/ReportageNewsArticle.html">ReportageNewsArticle</a></li>
<li><a href="../classes/ReportedDoseSchedule.html">ReportedDoseSchedule</a></li>
<li><a href="../classes/ResearchDoctorate.html">ResearchDoctorate</a></li>
<li><a href="../classes/Researcher.html">Researcher</a></li>
<li><a href="../classes/ResearchProject.html">ResearchProject</a></li>
<li><a href="../classes/Reservation.html">Reservation</a></li>
<li><a href="../classes/ReservationPackage.html">ReservationPackage</a></li>
<li><a href="../classes/ReservationStatusType.html">ReservationStatusType</a></li>
<li><a href="../classes/ReserveAction.html">ReserveAction</a></li>
<li><a href="../classes/Reservoir.html">Reservoir</a></li>
<li><a href="../classes/Residence.html">Residence</a></li>
<li><a href="../classes/Resort.html">Resort</a></li>
<li><a href="../classes/Restaurant.html">Restaurant</a></li>
<li><a href="../classes/RestrictedDiet.html">RestrictedDiet</a></li>
<li><a href="../classes/ResumeAction.html">ResumeAction</a></li>
<li><a href="../classes/ReturnAction.html">ReturnAction</a></li>
<li><a href="../classes/ReturnFeesEnumeration.html">ReturnFeesEnumeration</a></li>
<li><a href="../classes/Review.html">Review</a></li>
<li><a href="../classes/ReviewAction.html">ReviewAction</a></li>
<li><a href="../classes/ReviewNewsArticle.html">ReviewNewsArticle</a></li>
<li><a href="../classes/RevocationProfile.html">RevocationProfile</a></li>
<li><a href="../classes/RevokeAction.html">RevokeAction</a></li>
<li><a href="../classes/RightsAction.html">RightsAction</a></li>
<li><a href="../classes/RiverBodyOfWater.html">RiverBodyOfWater</a></li>
<li><a href="../classes/Role.html">Role</a></li>
<li><a href="../classes/Rollup.html">Rollup</a></li>
<li><a href="../classes/RollupRule.html">RollupRule</a></li>
<li><a href="../classes/RoofingContractor.html">RoofingContractor</a></li>
<li><a href="../classes/Room.html">Room</a></li>
<li><a href="../classes/RsvpAction.html">RsvpAction</a></li>
<li><a href="../classes/RsvpResponseType.html">RsvpResponseType</a></li>
<li><a href="../classes/RuleSet.html">RuleSet</a></li>
<li><a href="../classes/RuleSetProfile.html">RuleSetProfile</a></li>
<li><a href="../classes/RVPark.html">RVPark</a></li>
<li><a href="../classes/SaleEvent.html">SaleEvent</a></li>
<li><a href="../classes/SatiricalArticle.html">SatiricalArticle</a></li>
<li><a href="../classes/Schedule.html">Schedule</a></li>
<li><a href="../classes/ScheduleAction.html">ScheduleAction</a></li>
<li><a href="../classes/ScholarlyArticle.html">ScholarlyArticle</a></li>
<li><a href="../classes/School.html">School</a></li>
<li><a href="../classes/SchoolDistrict.html">SchoolDistrict</a></li>
<li><a href="../classes/ScreeningEvent.html">ScreeningEvent</a></li>
<li><a href="../classes/Sculpture.html">Sculpture</a></li>
<li><a href="../classes/SeaBodyOfWater.html">SeaBodyOfWater</a></li>
<li><a href="../classes/SearchAction.html">SearchAction</a></li>
<li><a href="../classes/SearchResultsPage.html">SearchResultsPage</a></li>
<li><a href="../classes/Season.html">Season</a></li>
<li><a href="../classes/Seat.html">Seat</a></li>
<li><a href="../classes/SecondarySchoolDiploma.html">SecondarySchoolDiploma</a></li>
<li><a href="../classes/SeekToAction.html">SeekToAction</a></li>
<li><a href="../classes/SelectionComponent.html">SelectionComponent</a></li>
<li><a href="../classes/SelfStorage.html">SelfStorage</a></li>
<li><a href="../classes/SellAction.html">SellAction</a></li>
<li><a href="../classes/SendAction.html">SendAction</a></li>
<li><a href="../classes/Series.html">Series</a></li>
<li><a href="../classes/Service.html">Service</a></li>
<li><a href="../classes/ServiceChannel.html">ServiceChannel</a></li>
<li><a href="../classes/ShareAction.html">ShareAction</a></li>
<li><a href="../classes/SheetMusic.html">SheetMusic</a></li>
<li><a href="../classes/ShippingDeliveryTime.html">ShippingDeliveryTime</a></li>
<li><a href="../classes/ShippingRateSettings.html">ShippingRateSettings</a></li>
<li><a href="../classes/ShoeStore.html">ShoeStore</a></li>
<li><a href="../classes/ShoppingCenter.html">ShoppingCenter</a></li>
<li><a href="../classes/ShortStory.html">ShortStory</a></li>
<li><a href="../classes/SingleFamilyResidence.html">SingleFamilyResidence</a></li>
<li><a href="../classes/SiteNavigationElement.html">SiteNavigationElement</a></li>
<li><a href="../classes/SizeGroupEnumeration.html">SizeGroupEnumeration</a></li>
<li><a href="../classes/SizeSpecification.html">SizeSpecification</a></li>
<li><a href="../classes/SizeSystemEnumeration.html">SizeSystemEnumeration</a></li>
<li><a href="../classes/Skill.html">Skill</a></li>
<li><a href="../classes/SkiResort.html">SkiResort</a></li>
<li><a href="../classes/SocialEvent.html">SocialEvent</a></li>
<li><a href="../classes/SocialMediaPosting.html">SocialMediaPosting</a></li>
<li><a href="../classes/SoftwareApplication.html">SoftwareApplication</a></li>
<li><a href="../classes/SoftwareSourceCode.html">SoftwareSourceCode</a></li>
<li><a href="../classes/SolveMathAction.html">SolveMathAction</a></li>
<li><a href="../classes/SomeProducts.html">SomeProducts</a></li>
<li><a href="../classes/SpeakableSpecification.html">SpeakableSpecification</a></li>
<li><a href="../classes/SpecialAnnouncement.html">SpecialAnnouncement</a></li>
<li><a href="../classes/Specialty.html">Specialty</a></li>
<li><a href="../classes/SportingGoodsStore.html">SportingGoodsStore</a></li>
<li><a href="../classes/SportsActivityLocation.html">SportsActivityLocation</a></li>
<li><a href="../classes/SportsClub.html">SportsClub</a></li>
<li><a href="../classes/SportsEvent.html">SportsEvent</a></li>
<li><a href="../classes/SportsOrganization.html">SportsOrganization</a></li>
<li><a href="../classes/SportsTeam.html">SportsTeam</a></li>
<li><a href="../classes/SpreadsheetDigitalDocument.html">SpreadsheetDigitalDocument</a></li>
<li><a href="../classes/StadiumOrArena.html">StadiumOrArena</a></li>
<li><a href="../classes/State.html">State</a></li>
<li><a href="../classes/StatisticalPopulation.html">StatisticalPopulation</a></li>
<li><a href="../classes/StatusEnumeration.html">StatusEnumeration</a></li>
<li><a href="../classes/SteeringPositionValue.html">SteeringPositionValue</a></li>
<li><a href="../classes/Store.html">Store</a></li>
<li><a href="../classes/StructuredValue.html">StructuredValue</a></li>
<li><a href="../classes/StupidType.html">StupidType</a></li>
<li><a href="../classes/SubscribeAction.html">SubscribeAction</a></li>
<li><a href="../classes/Substance.html">Substance</a></li>
<li><a href="../classes/SubwayStation.html">SubwayStation</a></li>
<li><a href="../classes/Suite.html">Suite</a></li>
<li><a href="../classes/SuperficialAnatomy.html">SuperficialAnatomy</a></li>
<li><a href="../classes/SurgicalProcedure.html">SurgicalProcedure</a></li>
<li><a href="../classes/SuspendAction.html">SuspendAction</a></li>
<li><a href="../classes/Synagogue.html">Synagogue</a></li>
<li><a href="../classes/Table.html">Table</a></li>
<li><a href="../classes/TakeAction.html">TakeAction</a></li>
<li><a href="../classes/Task.html">Task</a></li>
<li><a href="../classes/TattooParlor.html">TattooParlor</a></li>
<li><a href="../classes/Taxi.html">Taxi</a></li>
<li><a href="../classes/TaxiReservation.html">TaxiReservation</a></li>
<li><a href="../classes/TaxiService.html">TaxiService</a></li>
<li><a href="../classes/TaxiStand.html">TaxiStand</a></li>
<li><a href="../classes/TechArticle.html">TechArticle</a></li>
<li><a href="../classes/TelevisionChannel.html">TelevisionChannel</a></li>
<li><a href="../classes/TelevisionStation.html">TelevisionStation</a></li>
<li><a href="../classes/TennisComplex.html">TennisComplex</a></li>
<li><a href="../classes/TextDigitalDocument.html">TextDigitalDocument</a></li>
<li><a href="../classes/TheaterEvent.html">TheaterEvent</a></li>
<li><a href="../classes/TheaterGroup.html">TheaterGroup</a></li>
<li><a href="../classes/TherapeuticProcedure.html">TherapeuticProcedure</a></li>
<li><a href="../classes/Thesis.html">Thesis</a></li>
<li><a href="../classes/Thing.html">Thing</a></li>
<li><a href="../classes/this.html">this</a></li>
<li><a href="../classes/Ticket.html">Ticket</a></li>
<li><a href="../classes/TieAction.html">TieAction</a></li>
<li><a href="../classes/TipAction.html">TipAction</a></li>
<li><a href="../classes/TireShop.html">TireShop</a></li>
<li><a href="../classes/TouristAttraction.html">TouristAttraction</a></li>
<li><a href="../classes/TouristDestination.html">TouristDestination</a></li>
<li><a href="../classes/TouristInformationCenter.html">TouristInformationCenter</a></li>
<li><a href="../classes/TouristTrip.html">TouristTrip</a></li>
<li><a href="../classes/ToyStore.html">ToyStore</a></li>
<li><a href="../classes/TrackAction.html">TrackAction</a></li>
<li><a href="../classes/TradeAction.html">TradeAction</a></li>
<li><a href="../classes/TrainReservation.html">TrainReservation</a></li>
<li><a href="../classes/TrainStation.html">TrainStation</a></li>
<li><a href="../classes/TrainTrip.html">TrainTrip</a></li>
<li><a href="../classes/TransferAction.html">TransferAction</a></li>
<li><a href="../classes/TransferValueProfile.html">TransferValueProfile</a></li>
<li><a href="../classes/TravelAction.html">TravelAction</a></li>
<li><a href="../classes/TravelAgency.html">TravelAgency</a></li>
<li><a href="../classes/TreatmentIndication.html">TreatmentIndication</a></li>
<li><a href="../classes/Trip.html">Trip</a></li>
<li><a href="../classes/Triple.html">Triple</a></li>
<li><a href="../classes/TVClip.html">TVClip</a></li>
<li><a href="../classes/TVEpisode.html">TVEpisode</a></li>
<li><a href="../classes/TVSeason.html">TVSeason</a></li>
<li><a href="../classes/TVSeries.html">TVSeries</a></li>
<li><a href="../classes/TypeAndQuantityNode.html">TypeAndQuantityNode</a></li>
<li><a href="../classes/UKNonprofitType.html">UKNonprofitType</a></li>
<li><a href="../classes/UnitPriceSpecification.html">UnitPriceSpecification</a></li>
<li><a href="../classes/UnRegisterAction.html">UnRegisterAction</a></li>
<li><a href="../classes/UpdateAction.html">UpdateAction</a></li>
<li><a href="../classes/UseAction.html">UseAction</a></li>
<li><a href="../classes/UserBlocks.html">UserBlocks</a></li>
<li><a href="../classes/UserCheckins.html">UserCheckins</a></li>
<li><a href="../classes/UserComments.html">UserComments</a></li>
<li><a href="../classes/UserDownloads.html">UserDownloads</a></li>
<li><a href="../classes/UserInteraction.html">UserInteraction</a></li>
<li><a href="../classes/UserLikes.html">UserLikes</a></li>
<li><a href="../classes/UserPageVisits.html">UserPageVisits</a></li>
<li><a href="../classes/UserPlays.html">UserPlays</a></li>
<li><a href="../classes/UserPlusOnes.html">UserPlusOnes</a></li>
<li><a href="../classes/UserReview.html">UserReview</a></li>
<li><a href="../classes/UserTweets.html">UserTweets</a></li>
<li><a href="../classes/USNonprofitType.html">USNonprofitType</a></li>
<li><a href="../classes/ValueProfile.html">ValueProfile</a></li>
<li><a href="../classes/Vehicle.html">Vehicle</a></li>
<li><a href="../classes/Vein.html">Vein</a></li>
<li><a href="../classes/VerificationServiceProfile.html">VerificationServiceProfile</a></li>
<li><a href="../classes/Vessel.html">Vessel</a></li>
<li><a href="../classes/VeterinaryCare.html">VeterinaryCare</a></li>
<li><a href="../classes/VideoGallery.html">VideoGallery</a></li>
<li><a href="../classes/VideoGame.html">VideoGame</a></li>
<li><a href="../classes/VideoGameClip.html">VideoGameClip</a></li>
<li><a href="../classes/VideoGameSeries.html">VideoGameSeries</a></li>
<li><a href="../classes/VideoObject.html">VideoObject</a></li>
<li><a href="../classes/ViewAction.html">ViewAction</a></li>
<li><a href="../classes/VirtualLocation.html">VirtualLocation</a></li>
<li><a href="../classes/VisualArtsEvent.html">VisualArtsEvent</a></li>
<li><a href="../classes/VisualArtwork.html">VisualArtwork</a></li>
<li><a href="../classes/VitalSign.html">VitalSign</a></li>
<li><a href="../classes/Volcano.html">Volcano</a></li>
<li><a href="../classes/VoteAction.html">VoteAction</a></li>
<li><a href="../classes/WantAction.html">WantAction</a></li>
<li><a href="../classes/WarrantyPromise.html">WarrantyPromise</a></li>
<li><a href="../classes/WarrantyScope.html">WarrantyScope</a></li>
<li><a href="../classes/WatchAction.html">WatchAction</a></li>
<li><a href="../classes/Waterfall.html">Waterfall</a></li>
<li><a href="../classes/WearableMeasurementTypeEnumeration.html">WearableMeasurementTypeEnumeration</a></li>
<li><a href="../classes/WearableSizeGroupEnumeration.html">WearableSizeGroupEnumeration</a></li>
<li><a href="../classes/WearableSizeSystemEnumeration.html">WearableSizeSystemEnumeration</a></li>
<li><a href="../classes/WearAction.html">WearAction</a></li>
<li><a href="../classes/WebAPI.html">WebAPI</a></li>
<li><a href="../classes/WebApplication.html">WebApplication</a></li>
<li><a href="../classes/WebContent.html">WebContent</a></li>
<li><a href="../classes/WebPage.html">WebPage</a></li>
<li><a href="../classes/WebPageElement.html">WebPageElement</a></li>
<li><a href="../classes/WebSite.html">WebSite</a></li>
<li><a href="../classes/WholesaleStore.html">WholesaleStore</a></li>
<li><a href="../classes/WinAction.html">WinAction</a></li>
<li><a href="../classes/Winery.html">Winery</a></li>
<li><a href="../classes/WorkBasedProgram.html">WorkBasedProgram</a></li>
<li><a href="../classes/WorkersUnion.html">WorkersUnion</a></li>
<li><a href="../classes/WorkExperienceComponent.html">WorkExperienceComponent</a></li>
<li><a href="../classes/WorkRole.html">WorkRole</a></li>
<li><a href="../classes/WPAdBlock.html">WPAdBlock</a></li>
<li><a href="../classes/WPFooter.html">WPFooter</a></li>
<li><a href="../classes/WPHeader.html">WPHeader</a></li>
<li><a href="../classes/WPSideBar.html">WPSideBar</a></li>
<li><a href="../classes/WriteAction.html">WriteAction</a></li>
<li><a href="../classes/XPathType.html">XPathType</a></li>
<li><a href="../classes/Zoo.html">Zoo</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="../modules/com.eduworks.html">com.eduworks</a></li>
<li><a href="../modules/com.eduworks.ec.html">com.eduworks.ec</a></li>
<li><a href="../modules/org.cassproject.html">org.cassproject</a></li>
<li><a href="../modules/org.credentialengine.html">org.credentialengine</a></li>
<li><a href="../modules/org.json.ld.html">org.json.ld</a></li>
<li><a href="../modules/org.schema.html">org.schema</a></li>
<li><a href="../modules/org.w3.skos.html">org.w3.skos</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: node_modules\cassproject\src\com\eduworks\schema\ebac\EbacContactGrant.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
/**
* AES encrypted public key and display name message.
* Used to grant access to a contact.
* Contains Initialization Vectors, but not secrets.
* Used to encrypt public identities for storage on remote systems.
*
* @author fritz.ray@eduworks.com
* @class EbacContactGrant
* @module org.cassproject
*/
module.exports = class EbacContactGrant extends EcRemoteLinkedData {
constructor() {
super(Ebac.context, EbacContactGrant.TYPE_0_4);
}
static TYPE_0_1 = "http://schema.eduworks.com/ebac/0.1/contactGrant";
static TYPE_0_2 = "http://schema.eduworks.com/ebac/0.2/contactGrant";
static TYPE_0_3 = "http://schema.cassproject.org/kbac/0.2/ContactGrant";
static TYPE_0_4 = "https://schema.cassproject.org/kbac/0.4/ContactGrant";
/**
* Public key being granted to the owner of this message.
*
* @property pk
* @type string(pem)
*/
pk = null;
/**
* Display name of the contact.
*
* @property displayName
* @type string
*/
displayName = null;
/**
* Source server of the contact.
*
* @property source
* @type string
*/
source = null;
/**
* Response token used to validate that this grant is in response to a contact request you sent.
*
* @property responseToken
* @type string
*/
responseToken = null;
/**
* Signature (Base64 encoded) of the response token to verify against your own public key
* to ensure that this grant is in response to a contact request you sent.
*
* @property responseSignature
* @type string
*/
responseSignature = null;
upgrade() {
super.upgrade();
if (EbacContactGrant.TYPE_0_1 == (this.type)) {
var me = this;
if (me["@context"] == null && me["@schema"] != null)
me["@context"] = me["@schema"];
this.setContextAndType(Ebac.context_0_2, EbacContactGrant.TYPE_0_2);
}
if (EbacContactGrant.TYPE_0_2 == (this.getFullType())) {
this.setContextAndType(Ebac.context_0_3, EbacContactGrant.TYPE_0_3);
}
if (EbacContactGrant.TYPE_0_3 == (this.getFullType())) {
this.setContextAndType(Ebac.context_0_4, EbacContactGrant.TYPE_0_4);
}
}
getTypes() {
var a = [];
a.push(EbacContactGrant.TYPE_0_4);
a.push(EbacContactGrant.TYPE_0_3);
a.push(EbacContactGrant.TYPE_0_2);
a.push(EbacContactGrant.TYPE_0_1);
return a;
}
};
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
| {
"content_hash": "7be868500d5663597d67317580956fdb",
"timestamp": "",
"source": "github",
"line_count": 1223,
"max_line_length": 146,
"avg_line_length": 89.66721177432542,
"alnum_prop": 0.4819036502740213,
"repo_name": "Eduworks/CASS",
"id": "e6d46b2ca3fc441efc605a5f286668bd632e31dc",
"size": "109663",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/files/node_modules_cassproject_src_com_eduworks_schema_ebac_EbacContactGrant.js.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "52593"
},
{
"name": "HTML",
"bytes": "51035"
},
{
"name": "JavaScript",
"bytes": "6444138"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.Debugger.Interop;
using MICore;
using System.Diagnostics;
using System.Globalization;
// This file contains the various event objects that are sent to the debugger from the sample engine via IDebugEventCallback2::Event.
// These are used in EngineCallback.cs.
// The events are how the engine tells the debugger about what is happening in the debuggee process.
// There are three base classe the other events derive from: AD7AsynchronousEvent, AD7StoppingEvent, and AD7SynchronousEvent. These
// each implement the IDebugEvent2.GetAttributes method for the type of event they represent.
// Most events sent the debugger are asynchronous events.
namespace Microsoft.MIDebugEngine
{
#region Event base classes
internal class AD7AsynchronousEvent : IDebugEvent2
{
public const uint Attributes = (uint)enum_EVENTATTRIBUTES.EVENT_ASYNCHRONOUS;
int IDebugEvent2.GetAttributes(out uint eventAttributes)
{
eventAttributes = Attributes;
return Constants.S_OK;
}
}
internal class AD7StoppingEvent : IDebugEvent2
{
public const uint Attributes = (uint)enum_EVENTATTRIBUTES.EVENT_ASYNC_STOP;
int IDebugEvent2.GetAttributes(out uint eventAttributes)
{
eventAttributes = Attributes;
return Constants.S_OK;
}
}
internal class AD7SynchronousEvent : IDebugEvent2
{
public const uint Attributes = (uint)enum_EVENTATTRIBUTES.EVENT_SYNCHRONOUS;
int IDebugEvent2.GetAttributes(out uint eventAttributes)
{
eventAttributes = Attributes;
return Constants.S_OK;
}
}
internal class AD7SynchronousStoppingEvent : IDebugEvent2
{
public const uint Attributes = (uint)enum_EVENTATTRIBUTES.EVENT_STOPPING | (uint)enum_EVENTATTRIBUTES.EVENT_SYNCHRONOUS;
int IDebugEvent2.GetAttributes(out uint eventAttributes)
{
eventAttributes = Attributes;
return Constants.S_OK;
}
}
#endregion
// The debug engine (DE) sends this interface to the session debug manager (SDM) when an instance of the DE is created.
internal sealed class AD7EngineCreateEvent : AD7AsynchronousEvent, IDebugEngineCreateEvent2
{
public const string IID = "FE5B734C-759D-4E59-AB04-F103343BDD06";
private IDebugEngine2 _engine;
private AD7EngineCreateEvent(AD7Engine engine)
{
_engine = engine;
}
public static void Send(AD7Engine engine)
{
AD7EngineCreateEvent eventObject = new AD7EngineCreateEvent(engine);
engine.Callback.Send(eventObject, IID, null, null);
}
int IDebugEngineCreateEvent2.GetEngine(out IDebugEngine2 engine)
{
engine = _engine;
return Constants.S_OK;
}
}
// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a program is attached to.
internal sealed class AD7ProgramCreateEvent : AD7SynchronousEvent, IDebugProgramCreateEvent2
{
public const string IID = "96CD11EE-ECD4-4E89-957E-B5D496FC4139";
internal static void Send(AD7Engine engine)
{
AD7ProgramCreateEvent eventObject = new AD7ProgramCreateEvent();
engine.Callback.Send(eventObject, IID, engine, null);
}
}
// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a module is loaded or unloaded.
internal sealed class AD7ModuleLoadEvent : AD7AsynchronousEvent, IDebugModuleLoadEvent2
{
public const string IID = "989DB083-0D7C-40D1-A9D9-921BF611A4B2";
private readonly AD7Module _module;
private readonly bool _fLoad;
public AD7ModuleLoadEvent(AD7Module module, bool fLoad)
{
_module = module;
_fLoad = fLoad;
}
int IDebugModuleLoadEvent2.GetModule(out IDebugModule2 module, ref string debugMessage, ref int fIsLoad)
{
module = _module;
if (_fLoad)
{
string symbolLoadStatus = _module.DebuggedModule.SymbolsLoaded ?
ResourceStrings.ModuleLoadedWithSymbols :
ResourceStrings.ModuleLoadedWithoutSymbols;
debugMessage = string.Format(CultureInfo.CurrentUICulture, ResourceStrings.ModuleLoadMessage, _module.DebuggedModule.Name, symbolLoadStatus);
fIsLoad = 1;
}
else
{
debugMessage = string.Format(CultureInfo.CurrentUICulture, ResourceStrings.ModuleUnloadMessage, _module.DebuggedModule.Name);
fIsLoad = 0;
}
return Constants.S_OK;
}
}
// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a program has run to completion
// or is otherwise destroyed.
internal sealed class AD7ProgramDestroyEvent : AD7SynchronousEvent, IDebugProgramDestroyEvent2
{
public const string IID = "E147E9E3-6440-4073-A7B7-A65592C714B5";
private readonly uint _exitCode;
public AD7ProgramDestroyEvent(uint exitCode)
{
_exitCode = exitCode;
}
#region IDebugProgramDestroyEvent2 Members
int IDebugProgramDestroyEvent2.GetExitCode(out uint exitCode)
{
exitCode = _exitCode;
return Constants.S_OK;
}
#endregion
}
internal sealed class AD7MessageEvent : IDebugEvent2, IDebugMessageEvent2
{
public const string IID = "3BDB28CF-DBD2-4D24-AF03-01072B67EB9E";
private readonly OutputMessage _outputMessage;
private readonly bool _isAsync;
public AD7MessageEvent(OutputMessage outputMessage, bool isAsync)
{
_outputMessage = outputMessage;
_isAsync = isAsync;
}
int IDebugEvent2.GetAttributes(out uint eventAttributes)
{
if (_isAsync)
eventAttributes = (uint)enum_EVENTATTRIBUTES.EVENT_ASYNCHRONOUS;
else
eventAttributes = (uint)enum_EVENTATTRIBUTES.EVENT_IMMEDIATE;
return Constants.S_OK;
}
int IDebugMessageEvent2.GetMessage(enum_MESSAGETYPE[] pMessageType, out string pbstrMessage, out uint pdwType, out string pbstrHelpFileName, out uint pdwHelpId)
{
return ConvertMessageToAD7(_outputMessage, pMessageType, out pbstrMessage, out pdwType, out pbstrHelpFileName, out pdwHelpId);
}
internal static int ConvertMessageToAD7(OutputMessage outputMessage, enum_MESSAGETYPE[] pMessageType, out string pbstrMessage, out uint pdwType, out string pbstrHelpFileName, out uint pdwHelpId)
{
const uint MB_ICONERROR = 0x00000010;
const uint MB_ICONWARNING = 0x00000030;
pMessageType[0] = outputMessage.MessageType;
pbstrMessage = outputMessage.Message;
pdwType = 0;
if ((outputMessage.MessageType & enum_MESSAGETYPE.MT_TYPE_MASK) == enum_MESSAGETYPE.MT_MESSAGEBOX)
{
switch (outputMessage.SeverityValue)
{
case OutputMessage.Severity.Error:
pdwType |= MB_ICONERROR;
break;
case OutputMessage.Severity.Warning:
pdwType |= MB_ICONWARNING;
break;
}
}
pbstrHelpFileName = null;
pdwHelpId = 0;
return Constants.S_OK;
}
int IDebugMessageEvent2.SetResponse(uint dwResponse)
{
return Constants.S_OK;
}
}
internal sealed class AD7ErrorEvent : IDebugEvent2, IDebugErrorEvent2
{
public const string IID = "FDB7A36C-8C53-41DA-A337-8BD86B14D5CB";
private readonly OutputMessage _outputMessage;
private readonly bool _isAsync;
public AD7ErrorEvent(OutputMessage outputMessage, bool isAsync)
{
_outputMessage = outputMessage;
_isAsync = isAsync;
}
int IDebugEvent2.GetAttributes(out uint eventAttributes)
{
if (_isAsync)
eventAttributes = (uint)enum_EVENTATTRIBUTES.EVENT_ASYNCHRONOUS;
else
eventAttributes = (uint)enum_EVENTATTRIBUTES.EVENT_IMMEDIATE;
return Constants.S_OK;
}
int IDebugErrorEvent2.GetErrorMessage(enum_MESSAGETYPE[] pMessageType, out string errorFormat, out int hrErrorReason, out uint pdwType, out string helpFilename, out uint pdwHelpId)
{
hrErrorReason = unchecked((int)_outputMessage.ErrorCode);
return AD7MessageEvent.ConvertMessageToAD7(_outputMessage, pMessageType, out errorFormat, out pdwType, out helpFilename, out pdwHelpId);
}
}
internal sealed class AD7BreakpointErrorEvent : AD7AsynchronousEvent, IDebugBreakpointErrorEvent2
{
public const string IID = "ABB0CA42-F82B-4622-84E4-6903AE90F210";
private AD7ErrorBreakpoint _error;
public AD7BreakpointErrorEvent(AD7ErrorBreakpoint error)
{
_error = error;
}
public int GetErrorBreakpoint(out IDebugErrorBreakpoint2 ppErrorBP)
{
ppErrorBP = _error;
return Constants.S_OK;
}
}
internal sealed class AD7BreakpointUnboundEvent : AD7AsynchronousEvent, IDebugBreakpointUnboundEvent2
{
public const string IID = "78d1db4f-c557-4dc5-a2dd-5369d21b1c8c";
private readonly enum_BP_UNBOUND_REASON _reason;
private AD7BoundBreakpoint _bp;
public AD7BreakpointUnboundEvent(AD7BoundBreakpoint bp, enum_BP_UNBOUND_REASON reason)
{
_reason = reason;
_bp = bp;
}
public int GetBreakpoint(out IDebugBoundBreakpoint2 ppBP)
{
ppBP = _bp;
return Constants.S_OK;
}
public int GetReason(enum_BP_UNBOUND_REASON[] pdwUnboundReason)
{
pdwUnboundReason[0] = _reason;
return Constants.S_OK;
}
}
// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a thread is created in a program being debugged.
internal sealed class AD7ThreadCreateEvent : AD7AsynchronousEvent, IDebugThreadCreateEvent2
{
public const string IID = "2090CCFC-70C5-491D-A5E8-BAD2DD9EE3EA";
}
// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a thread has exited.
internal sealed class AD7ThreadDestroyEvent : AD7AsynchronousEvent, IDebugThreadDestroyEvent2
{
public const string IID = "2C3B7532-A36F-4A6E-9072-49BE649B8541";
private readonly uint _exitCode;
public AD7ThreadDestroyEvent(uint exitCode)
{
_exitCode = exitCode;
}
#region IDebugThreadDestroyEvent2 Members
int IDebugThreadDestroyEvent2.GetExitCode(out uint exitCode)
{
exitCode = _exitCode;
return Constants.S_OK;
}
#endregion
}
// This interface is sent by the debug engine (DE) to the session debug manager (SDM) when a program is loaded, but before any code is executed.
internal sealed class AD7LoadCompleteEvent : AD7StoppingEvent, IDebugLoadCompleteEvent2
{
public const string IID = "B1844850-1349-45D4-9F12-495212F5EB0B";
public AD7LoadCompleteEvent()
{
}
}
internal sealed class AD7EntryPointEvent : AD7StoppingEvent, IDebugEntryPointEvent2
{
public const string IID = "E8414A3E-1642-48EC-829E-5F4040E16DA9";
public AD7EntryPointEvent()
{
}
}
internal sealed class AD7ExpressionCompleteEvent : AD7AsynchronousEvent, IDebugExpressionEvaluationCompleteEvent2
{
private AD7Engine _engine;
public const string IID = "C0E13A85-238A-4800-8315-D947C960A843";
public AD7ExpressionCompleteEvent(AD7Engine engine, IVariableInformation var, IDebugProperty2 prop = null)
{
_engine = engine;
_var = var;
_prop = prop;
}
public int GetExpression(out IDebugExpression2 expr)
{
expr = new AD7Expression(_engine, _var);
return Constants.S_OK;
}
public int GetResult(out IDebugProperty2 prop)
{
prop = _prop != null ? _prop : new AD7Property(_engine, _var);
return Constants.S_OK;
}
private IVariableInformation _var;
private IDebugProperty2 _prop;
}
// This interface tells the session debug manager (SDM) that an exception has occurred in the debuggee.
internal sealed class AD7ExceptionEvent : AD7StoppingEvent, IDebugExceptionEvent2
{
public const string IID = "51A94113-8788-4A54-AE15-08B74FF922D0";
public AD7ExceptionEvent(string name, string description, uint code, Guid? exceptionCategory, ExceptionBreakpointState state)
{
_name = name;
_code = code;
_description = description ?? name;
_category = exceptionCategory ?? EngineConstants.EngineId;
switch (state)
{
case ExceptionBreakpointState.None:
_state = enum_EXCEPTION_STATE.EXCEPTION_STOP_SECOND_CHANCE;
break;
case ExceptionBreakpointState.BreakThrown:
_state = enum_EXCEPTION_STATE.EXCEPTION_STOP_FIRST_CHANCE | enum_EXCEPTION_STATE.EXCEPTION_STOP_USER_FIRST_CHANCE;
break;
case ExceptionBreakpointState.BreakUserHandled:
_state = enum_EXCEPTION_STATE.EXCEPTION_STOP_USER_UNCAUGHT;
break;
default:
Debug.Fail("Unexpected state value");
_state = enum_EXCEPTION_STATE.EXCEPTION_STOP_SECOND_CHANCE;
break;
}
}
#region IDebugExceptionEvent2 Members
public int CanPassToDebuggee()
{
// Cannot pass it on
return Constants.S_FALSE;
}
public int GetException(EXCEPTION_INFO[] pExceptionInfo)
{
EXCEPTION_INFO ex = new EXCEPTION_INFO();
ex.bstrExceptionName = _name;
ex.dwCode = _code;
ex.dwState = _state;
ex.guidType = _category;
pExceptionInfo[0] = ex;
return Constants.S_OK;
}
public int GetExceptionDescription(out string pbstrDescription)
{
pbstrDescription = _description;
return Constants.S_OK;
}
public int PassToDebuggee(int fPass)
{
return Constants.S_OK;
}
private string _name;
private uint _code;
private string _description;
private Guid _category;
private enum_EXCEPTION_STATE _state;
#endregion
}
// This interface tells the session debug manager (SDM) that a step has completed
internal sealed class AD7StepCompleteEvent : AD7StoppingEvent, IDebugStepCompleteEvent2
{
public const string IID = "0f7f24c1-74d9-4ea6-a3ea-7edb2d81441d";
}
// This interface tells the session debug manager (SDM) that an asynchronous break has been successfully completed.
internal sealed class AD7AsyncBreakCompleteEvent : AD7StoppingEvent, IDebugBreakEvent2
{
public const string IID = "c7405d1d-e24b-44e0-b707-d8a5a4e1641b";
}
// This interface is sent by the debug engine (DE) to the session debug manager (SDM) to output a string for debug tracing.
internal sealed class AD7OutputDebugStringEvent : AD7AsynchronousEvent, IDebugOutputStringEvent2
{
public const string IID = "569c4bb1-7b82-46fc-ae28-4536ddad753e";
private string _str;
public AD7OutputDebugStringEvent(string str)
{
_str = str;
}
#region IDebugOutputStringEvent2 Members
int IDebugOutputStringEvent2.GetString(out string pbstrString)
{
pbstrString = _str;
return Constants.S_OK;
}
#endregion
}
// This interface is sent by the debug engine (DE) to indicate the results of searching for symbols for a module in the debuggee
internal sealed class AD7SymbolSearchEvent : AD7AsynchronousEvent, IDebugSymbolSearchEvent2
{
public const string IID = "638F7C54-C160-4c7b-B2D0-E0337BC61F8C";
private AD7Module _module;
private string _searchInfo;
private enum_MODULE_INFO_FLAGS _symbolFlags;
public AD7SymbolSearchEvent(AD7Module module, string searchInfo, enum_MODULE_INFO_FLAGS symbolFlags)
{
_module = module;
_searchInfo = searchInfo;
_symbolFlags = symbolFlags;
}
#region IDebugSymbolSearchEvent2 Members
int IDebugSymbolSearchEvent2.GetSymbolSearchInfo(out IDebugModule3 pModule, ref string pbstrDebugMessage, enum_MODULE_INFO_FLAGS[] pdwModuleInfoFlags)
{
pModule = _module;
pbstrDebugMessage = _searchInfo;
pdwModuleInfoFlags[0] = _symbolFlags;
return Constants.S_OK;
}
#endregion
}
// This interface is sent when a pending breakpoint has been bound in the debuggee.
internal sealed class AD7BreakpointBoundEvent : AD7AsynchronousEvent, IDebugBreakpointBoundEvent2
{
public const string IID = "1dddb704-cf99-4b8a-b746-dabb01dd13a0";
private AD7PendingBreakpoint _pendingBreakpoint;
private AD7BoundBreakpoint _boundBreakpoint;
public AD7BreakpointBoundEvent(AD7PendingBreakpoint pendingBreakpoint, AD7BoundBreakpoint boundBreakpoint)
{
_pendingBreakpoint = pendingBreakpoint;
_boundBreakpoint = boundBreakpoint;
}
#region IDebugBreakpointBoundEvent2 Members
int IDebugBreakpointBoundEvent2.EnumBoundBreakpoints(out IEnumDebugBoundBreakpoints2 ppEnum)
{
IDebugBoundBreakpoint2[] boundBreakpoints = new IDebugBoundBreakpoint2[1];
boundBreakpoints[0] = _boundBreakpoint;
ppEnum = new AD7BoundBreakpointsEnum(boundBreakpoints);
return Constants.S_OK;
}
int IDebugBreakpointBoundEvent2.GetPendingBreakpoint(out IDebugPendingBreakpoint2 ppPendingBP)
{
ppPendingBP = _pendingBreakpoint;
return Constants.S_OK;
}
#endregion
}
// This Event is sent when a breakpoint is hit in the debuggee
internal sealed class AD7BreakpointEvent : AD7StoppingEvent, IDebugBreakpointEvent2
{
public const string IID = "501C1E21-C557-48B8-BA30-A1EAB0BC4A74";
private IEnumDebugBoundBreakpoints2 _boundBreakpoints;
public AD7BreakpointEvent(IEnumDebugBoundBreakpoints2 boundBreakpoints)
{
_boundBreakpoints = boundBreakpoints;
}
#region IDebugBreakpointEvent2 Members
int IDebugBreakpointEvent2.EnumBreakpoints(out IEnumDebugBoundBreakpoints2 ppEnum)
{
ppEnum = _boundBreakpoints;
return Constants.S_OK;
}
#endregion
}
internal sealed class AD7StopCompleteEvent : AD7StoppingEvent, IDebugStopCompleteEvent2
{
public const string IID = "3DCA9DCD-FB09-4AF1-A926-45F293D48B2D";
}
internal sealed class AD7CustomDebugEvent : AD7AsynchronousEvent, IDebugCustomEvent110
{
public const string IID = "2615D9BC-1948-4D21-81EE-7A963F20CF59";
private readonly Guid _guidVSService;
private readonly Guid _sourceId;
private readonly int _messageCode;
private readonly object _parameter1;
private readonly object _parameter2;
public AD7CustomDebugEvent(Guid guidVSService, Guid sourceId, int messageCode, object parameter1, object parameter2)
{
_guidVSService = guidVSService;
_sourceId = sourceId;
_messageCode = messageCode;
_parameter1 = parameter1;
_parameter2 = parameter2;
}
int IDebugCustomEvent110.GetCustomEventInfo(out Guid guidVSService, VsComponentMessage[] message)
{
guidVSService = _guidVSService;
message[0].SourceId = _sourceId;
message[0].MessageCode = (uint)_messageCode;
message[0].Parameter1 = _parameter1;
message[0].Parameter2 = _parameter2;
return Constants.S_OK;
}
}
}
| {
"content_hash": "de7a929a87665f2f03f3fc89a8b67122",
"timestamp": "",
"source": "github",
"line_count": 604,
"max_line_length": 202,
"avg_line_length": 34.609271523178805,
"alnum_prop": 0.6445656333716036,
"repo_name": "rajkumar42/MIEngine",
"id": "4970edabc51306a26c7daf78c7b9ca3042659821",
"size": "21056",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "src/MIDebugEngine/AD7.Impl/AD7Events.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "AppleScript",
"bytes": "1126"
},
{
"name": "Batchfile",
"bytes": "23607"
},
{
"name": "C",
"bytes": "486691"
},
{
"name": "C#",
"bytes": "1398142"
},
{
"name": "C++",
"bytes": "122726"
},
{
"name": "Groovy",
"bytes": "994"
},
{
"name": "Objective-C",
"bytes": "108"
},
{
"name": "PowerShell",
"bytes": "6552"
},
{
"name": "Shell",
"bytes": "15024"
}
],
"symlink_target": ""
} |
package hr.fer.zemris.vhdllab.platform.ui;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.SwingUtilities;
public class MouseClickAdapter extends MouseAdapter {
@Override
public void mouseClicked(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2) {
onDoubleClick(e);
} else if (SwingUtilities.isRightMouseButton(e)) {
onRightMouseClick(e);
}
}
/**
* Invoked when double click occurs for left mouse button.
*
* @param e
* mouse event
*/
protected void onDoubleClick(MouseEvent e) {
}
/**
* Invoked when right mouse is clicked.
*
* @param e
* mouse event
*/
protected void onRightMouseClick(MouseEvent e) {
}
}
| {
"content_hash": "a866b7854585e80c077f67c2435d6577",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 76,
"avg_line_length": 22.31578947368421,
"alnum_prop": 0.6096698113207547,
"repo_name": "mbezjak/vhdllab",
"id": "ce8f3ccaa97164325b0f4919e42d9a214e75e049",
"size": "1679",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vhdllab-client/src/main/java/hr/fer/zemris/vhdllab/platform/ui/MouseClickAdapter.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "11808"
},
{
"name": "Java",
"bytes": "2407862"
},
{
"name": "Shell",
"bytes": "1241"
}
],
"symlink_target": ""
} |
package org.elasticsearch.action.search;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.ParseFieldMatcher;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.search.Scroll;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import java.io.IOException;
import static org.elasticsearch.search.Scroll.readScroll;
/**
* A request to execute search against one or more indices (or all). Best created using
* {@link org.elasticsearch.client.Requests#searchRequest(String...)}.
* <p>
* Note, the search {@link #source(org.elasticsearch.search.builder.SearchSourceBuilder)}
* is required. The search source is the different search options, including aggregations and such.
* </p>
* @see org.elasticsearch.client.Requests#searchRequest(String...)
* @see org.elasticsearch.client.Client#search(SearchRequest)
* @see SearchResponse
*/
public class SearchRequest extends ActionRequest<SearchRequest> implements IndicesRequest.Replaceable {
private SearchType searchType = SearchType.DEFAULT;
private String[] indices;
@Nullable
private String routing;
@Nullable
private String preference;
private SearchSourceBuilder source;
private Boolean requestCache;
private Scroll scroll;
private String[] types = Strings.EMPTY_ARRAY;
public static final IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.strictExpandOpenAndForbidClosed();
private IndicesOptions indicesOptions = DEFAULT_INDICES_OPTIONS;
public SearchRequest() {
}
/**
* Constructs a new search request against the indices. No indices provided here means that search
* will run against all indices.
*/
public SearchRequest(String... indices) {
this(indices, new SearchSourceBuilder());
}
/**
* Constructs a new search request against the provided indices with the given search source.
*/
public SearchRequest(String[] indices, SearchSourceBuilder source) {
if (source == null) {
throw new IllegalArgumentException("source must not be null");
}
indices(indices);
this.source = source;
}
@Override
public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
// no need to check, we resolve to match all query
// if (source == null && extraSource == null) {
// validationException = addValidationError("search source is missing", validationException);
// }
return validationException;
}
/**
* Sets the indices the search will be executed on.
*/
@Override
public SearchRequest indices(String... indices) {
if (indices == null) {
throw new IllegalArgumentException("indices must not be null");
} else {
for (int i = 0; i < indices.length; i++) {
if (indices[i] == null) {
throw new IllegalArgumentException("indices[" + i + "] must not be null");
}
}
}
this.indices = indices;
return this;
}
@Override
public IndicesOptions indicesOptions() {
return indicesOptions;
}
public SearchRequest indicesOptions(IndicesOptions indicesOptions) {
this.indicesOptions = indicesOptions;
return this;
}
/**
* The document types to execute the search against. Defaults to be executed against
* all types.
*/
public String[] types() {
return types;
}
/**
* The document types to execute the search against. Defaults to be executed against
* all types.
*/
public SearchRequest types(String... types) {
this.types = types;
return this;
}
/**
* A comma separated list of routing values to control the shards the search will be executed on.
*/
public String routing() {
return this.routing;
}
/**
* A comma separated list of routing values to control the shards the search will be executed on.
*/
public SearchRequest routing(String routing) {
this.routing = routing;
return this;
}
/**
* The routing values to control the shards that the search will be executed on.
*/
public SearchRequest routing(String... routings) {
this.routing = Strings.arrayToCommaDelimitedString(routings);
return this;
}
/**
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
* a custom value, which guarantees that the same order will be used across different requests.
*/
public SearchRequest preference(String preference) {
this.preference = preference;
return this;
}
public String preference() {
return this.preference;
}
/**
* The search type to execute, defaults to {@link SearchType#DEFAULT}.
*/
public SearchRequest searchType(SearchType searchType) {
this.searchType = searchType;
return this;
}
/**
* The a string representation search type to execute, defaults to {@link SearchType#DEFAULT}. Can be
* one of "dfs_query_then_fetch"/"dfsQueryThenFetch", "dfs_query_and_fetch"/"dfsQueryAndFetch",
* "query_then_fetch"/"queryThenFetch", and "query_and_fetch"/"queryAndFetch".
*/
public SearchRequest searchType(String searchType) {
return searchType(SearchType.fromString(searchType, ParseFieldMatcher.EMPTY));
}
/**
* The source of the search request.
*/
public SearchRequest source(SearchSourceBuilder sourceBuilder) {
if (sourceBuilder == null) {
throw new IllegalArgumentException("source must not be null");
}
this.source = sourceBuilder;
return this;
}
/**
* The search source to execute.
*/
public SearchSourceBuilder source() {
return source;
}
/**
* The tye of search to execute.
*/
public SearchType searchType() {
return searchType;
}
/**
* The indices
*/
@Override
public String[] indices() {
return indices;
}
/**
* If set, will enable scrolling of the search request.
*/
public Scroll scroll() {
return scroll;
}
/**
* If set, will enable scrolling of the search request.
*/
public SearchRequest scroll(Scroll scroll) {
this.scroll = scroll;
return this;
}
/**
* If set, will enable scrolling of the search request for the specified timeout.
*/
public SearchRequest scroll(TimeValue keepAlive) {
return scroll(new Scroll(keepAlive));
}
/**
* If set, will enable scrolling of the search request for the specified timeout.
*/
public SearchRequest scroll(String keepAlive) {
return scroll(new Scroll(TimeValue.parseTimeValue(keepAlive, null, getClass().getSimpleName() + ".Scroll.keepAlive")));
}
/**
* Sets if this request should use the request cache or not, assuming that it can (for
* example, if "now" is used, it will never be cached). By default (not set, or null,
* will default to the index level setting if request cache is enabled or not).
*/
public SearchRequest requestCache(Boolean requestCache) {
this.requestCache = requestCache;
return this;
}
public Boolean requestCache() {
return this.requestCache;
}
/**
* @return true if the request only has suggest
*/
public boolean isSuggestOnly() {
return source != null && source.isSuggestOnly();
}
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
searchType = SearchType.fromId(in.readByte());
indices = new String[in.readVInt()];
for (int i = 0; i < indices.length; i++) {
indices[i] = in.readString();
}
routing = in.readOptionalString();
preference = in.readOptionalString();
if (in.readBoolean()) {
scroll = readScroll(in);
}
if (in.readBoolean()) {
source = new SearchSourceBuilder(in);
}
types = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
requestCache = in.readOptionalBoolean();
}
@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeByte(searchType.id());
out.writeVInt(indices.length);
for (String index : indices) {
out.writeString(index);
}
out.writeOptionalString(routing);
out.writeOptionalString(preference);
if (scroll == null) {
out.writeBoolean(false);
} else {
out.writeBoolean(true);
scroll.writeTo(out);
}
if (source == null) {
out.writeBoolean(false);
} else {
out.writeBoolean(true);
source.writeTo(out);
}
out.writeStringArray(types);
indicesOptions.writeIndicesOptions(out);
out.writeOptionalBoolean(requestCache);
}
}
| {
"content_hash": "0c2e5e7b3a99f0bc754834d1eb2d4036",
"timestamp": "",
"source": "github",
"line_count": 325,
"max_line_length": 127,
"avg_line_length": 29.96923076923077,
"alnum_prop": 0.6436344969199178,
"repo_name": "sreeramjayan/elasticsearch",
"id": "1973e4c756d85886739cedf1d5ea50febe650468",
"size": "10528",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "core/src/main/java/org/elasticsearch/action/search/SearchRequest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "8172"
},
{
"name": "Batchfile",
"bytes": "11622"
},
{
"name": "Emacs Lisp",
"bytes": "3341"
},
{
"name": "FreeMarker",
"bytes": "45"
},
{
"name": "Groovy",
"bytes": "208368"
},
{
"name": "HTML",
"bytes": "3409"
},
{
"name": "Java",
"bytes": "32566355"
},
{
"name": "Perl",
"bytes": "6923"
},
{
"name": "Python",
"bytes": "95396"
},
{
"name": "Ruby",
"bytes": "17776"
},
{
"name": "Shell",
"bytes": "90887"
}
],
"symlink_target": ""
} |
#include <aws/ec2/model/AcceleratorCount.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <utility>
using namespace Aws::Utils::Xml;
using namespace Aws::Utils;
namespace Aws
{
namespace EC2
{
namespace Model
{
AcceleratorCount::AcceleratorCount() :
m_min(0),
m_minHasBeenSet(false),
m_max(0),
m_maxHasBeenSet(false)
{
}
AcceleratorCount::AcceleratorCount(const XmlNode& xmlNode) :
m_min(0),
m_minHasBeenSet(false),
m_max(0),
m_maxHasBeenSet(false)
{
*this = xmlNode;
}
AcceleratorCount& AcceleratorCount::operator =(const XmlNode& xmlNode)
{
XmlNode resultNode = xmlNode;
if(!resultNode.IsNull())
{
XmlNode minNode = resultNode.FirstChild("min");
if(!minNode.IsNull())
{
m_min = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(minNode.GetText()).c_str()).c_str());
m_minHasBeenSet = true;
}
XmlNode maxNode = resultNode.FirstChild("max");
if(!maxNode.IsNull())
{
m_max = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(maxNode.GetText()).c_str()).c_str());
m_maxHasBeenSet = true;
}
}
return *this;
}
void AcceleratorCount::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
{
if(m_minHasBeenSet)
{
oStream << location << index << locationValue << ".Min=" << m_min << "&";
}
if(m_maxHasBeenSet)
{
oStream << location << index << locationValue << ".Max=" << m_max << "&";
}
}
void AcceleratorCount::OutputToStream(Aws::OStream& oStream, const char* location) const
{
if(m_minHasBeenSet)
{
oStream << location << ".Min=" << m_min << "&";
}
if(m_maxHasBeenSet)
{
oStream << location << ".Max=" << m_max << "&";
}
}
} // namespace Model
} // namespace EC2
} // namespace Aws
| {
"content_hash": "272cc60f08159c87f1c7f3313e4ee957",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 135,
"avg_line_length": 22.40909090909091,
"alnum_prop": 0.6526369168356998,
"repo_name": "cedral/aws-sdk-cpp",
"id": "5e119eb02d4b405d1c0bf26e03d0d27e1a2913da",
"size": "2091",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "aws-cpp-sdk-ec2/source/model/AcceleratorCount.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "294220"
},
{
"name": "C++",
"bytes": "428637022"
},
{
"name": "CMake",
"bytes": "862025"
},
{
"name": "Dockerfile",
"bytes": "11688"
},
{
"name": "HTML",
"bytes": "7904"
},
{
"name": "Java",
"bytes": "352201"
},
{
"name": "Python",
"bytes": "106761"
},
{
"name": "Shell",
"bytes": "10891"
}
],
"symlink_target": ""
} |
package org.ayo.rx.sample;
import android.util.Log;
import org.reactivestreams.Publisher;
import java.util.List;
import io.reactivex.BackpressureStrategy;
import io.reactivex.Flowable;
import io.reactivex.FlowableEmitter;
import io.reactivex.FlowableOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Action;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import io.reactivex.internal.functions.Functions;
import io.reactivex.internal.operators.flowable.FlowableInternalHelper;
import io.reactivex.schedulers.Schedulers;
/**
* Created by Administrator on 2017/2/14 0014.
*/
public class Rx_contactMap extends BaseRxDemo {
@Override
protected String getTitle() {
return "concatMap";
}
private Disposable task;
protected void runOk(){
/*
- concatMap
- Publisher<String> apply(String s)
- 好像和flatMap一样啊
- 类似于flatMap,由于内部使用concat合并,所以是按照顺序连接发射
*/
List<String> list = DataMgmr.Memory.getDataListQuick();
task = Flowable.create(new FlowableOnSubscribe<String>() {
@Override
public void subscribe(FlowableEmitter<String> e) throws Exception {
List<String> list = DataMgmr.Memory.getDataListQuick();
Log.i("repeat", "取数据");
for(String s: list){
e.onNext(s);
sleep(200);
}
e.onComplete();
}
}, BackpressureStrategy.BUFFER)
.concatMap(new Function<String, Publisher<String>>() {
@Override
public Publisher<String> apply(String s) throws Exception {
return Flowable.just(s, "-=-=-草泥马"); //s + "-=-=-草泥马";
}
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<CharSequence>() {
@Override
public void accept(CharSequence s) throws Exception {
notifyy(s + "");
}
}, Functions.ERROR_CONSUMER,
new Action() {
@Override
public void run() throws Exception {
notifyy("\nonComplete---结束了!@@");
}
},
FlowableInternalHelper.RequestMax.INSTANCE);
}
protected void runError(){
task = Flowable.create(new FlowableOnSubscribe<String>() {
@Override
public void subscribe(FlowableEmitter<String> e) throws Exception {
List<String> list = DataMgmr.server.getDataListSlow();
Log.i("repeat", "取数据");
for(String s: list){
e.onNext(s);
sleep(200);
}
e.onComplete();
}
}, BackpressureStrategy.BUFFER).repeat(3)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<String>() {
@Override
public void accept(String s) throws Exception {
notifyy(s);
}
}, Functions.ERROR_CONSUMER,
new Action() {
@Override
public void run() throws Exception {
Log.i("repeat", "on complete");
}
},
FlowableInternalHelper.RequestMax.INSTANCE);
}
@Override
protected void onDestroy2() {
super.onDestroy2();
if(task != null) task.dispose();
}
}
| {
"content_hash": "d19e560b3f88e9bb1f42abe036b4d451",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 79,
"avg_line_length": 35.46491228070175,
"alnum_prop": 0.5127380657927282,
"repo_name": "cowthan/Ayo2022",
"id": "fb387559d4b9a20895f69493e098726571c48d22",
"size": "4135",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "DemoRxJava/app/src/main/java/org/ayo/rx/sample/Rx_contactMap.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5114"
},
{
"name": "HTML",
"bytes": "2365"
},
{
"name": "Java",
"bytes": "9575777"
},
{
"name": "JavaScript",
"bytes": "27653"
},
{
"name": "Makefile",
"bytes": "891"
}
],
"symlink_target": ""
} |
#import "TiDataStream.h"
@implementation TiDataStream
@synthesize data, mode;
#pragma mark Internals
-(id)init
{
if (self = [super init]) {
data = nil;
mode = TI_READ;
position = 0;
}
return self;
}
-(void)_destroy
{
RELEASE_TO_NIL(data);
[super _destroy];
}
#pragma mark I/O Stream implementation
-(int)readToBuffer:(TiBuffer *)toBuffer offset:(int)offset length:(int)length callback:(KrollCallback *)callback
{
if (data == nil) {
[self throwException:@"TiStreamException"
subreason:@"Attempt to read off of closed/nil data stream"
location:CODELOCATION];
}
// TODO: Codify in read() and write() when we have every method calling the wrappers... like it should.
if ([[toBuffer data] length] == 0 && length != 0) {
if (callback != nil) {
NSDictionary* event = [NSDictionary dictionaryWithObjectsAndKeys:self,@"source",NUMINT(0),@"bytesProcessed", NUMINT(0),@"errorState",@"",@"errorDescription", nil];
[self _fireEventToListener:@"read" withObject:event listener:callback thisObject:nil];
}
return 0;
}
// TODO: Throw exception, or no-op? For now, assume NO-OP
if (position >= [data length]) {
if (callback != nil) {
NSDictionary* event = [NSDictionary dictionaryWithObjectsAndKeys:self,@"source",NUMINT(-1),@"bytesProcessed",NUMINT(0),@"errorState",@"",@"errorDescription", nil];
[self _fireEventToListener:@"read" withObject:event listener:callback thisObject:nil];
}
return -1;
}
// TODO: This is a dumb convention. Go back and fix it.
if (length == 0) {
length = [data length];
[toBuffer setLength:NUMINT(length)];
}
const void* bytes = [data bytes];
void* toBytes = [[toBuffer data] mutableBytes];
int bytesToWrite = MIN([data length] - position, length);
memcpy(toBytes+offset, bytes+position, bytesToWrite);
position += bytesToWrite;
if (callback != nil) {
NSDictionary* event = [NSDictionary dictionaryWithObjectsAndKeys:self,@"source",NUMINT(bytesToWrite),@"bytesProcessed",NUMINT(0),@"errorState",@"",@"errorDescription", nil];
[self _fireEventToListener:@"read" withObject:event listener:callback thisObject:nil];
}
return bytesToWrite;
}
// TODO: Need to extend the data if we're writing past its current bounds
-(int)writeFromBuffer:(TiBuffer *)fromBuffer offset:(int)offset length:(int)length callback:(KrollCallback *)callback
{
if (data == nil) {
[self throwException:@"TiStreamException"
subreason:@"Attempt to write from closed/nil data stream"
location:CODELOCATION];
}
// Sanity check for mutable data (just in case...)
if (![data isKindOfClass:[NSMutableData class]]) {
NSString* errorStr = [NSString stringWithFormat:@"[ERROR] Attempt to write to unwritable stream"];
DebugLog(errorStr);
if (callback != nil) {
NSDictionary* event = [NSDictionary dictionaryWithObjectsAndKeys:self,@"source",NUMINT(-1),@"bytesProcessed",errorStr,@"errorDescription",NUMINT(-1),@"errorState", nil];
[self _fireEventToListener:@"write" withObject:event listener:callback thisObject:nil];
}
return -1;
}
// TODO: Codify in read() and write() when we have every method calling the wrappers... like it should.
if ([[fromBuffer data] length] == 0) {
if (callback != nil) {
NSDictionary* event = [NSDictionary dictionaryWithObjectsAndKeys:self,@"source",NUMINT(0),@"bytesProcessed",NUMINT(0),@"errorState",@"",@"errorDescription", nil];
[self _fireEventToListener:@"write" withObject:event listener:callback thisObject:nil];
}
return 0;
}
// OK, even if we're working with NSData (and not NSMutableData) we have to cast away const here; we're going to assume that
// even with immutable data (i.e. blob) if the user has specified WRITE or APPEND, they're OK with digging their own grave.
NSMutableData* mutableData = (NSMutableData*)data;
if (mode & TI_WRITE) {
int overflow = length - ([data length] - position);
if (overflow > 0) {
[mutableData increaseLengthBy:overflow];
}
void* bytes = [mutableData mutableBytes];
const void* fromBytes = [[fromBuffer data] bytes];
memcpy(bytes+position, fromBytes+offset, length);
position += length;
}
else if (mode & TI_APPEND) {
[mutableData appendData:[[fromBuffer data] subdataWithRange:NSMakeRange(offset,length)]];
position = [data length];
}
if (callback != nil) {
NSDictionary* event = [NSDictionary dictionaryWithObjectsAndKeys:self,@"source",NUMINT(length),@"bytesProcessed",NUMINT(0),@"errorState",@"",@"errorDescription",nil];
[self _fireEventToListener:@"write" withObject:event listener:callback thisObject:nil];
}
return length;
}
-(int)writeToStream:(id<TiStreamInternal>)output chunkSize:(int)size callback:(KrollCallback *)callback
{
if (data == nil) {
[self throwException:@"TiStreamException"
subreason:@"Attempt to write from closed/nil data stream"
location:CODELOCATION];
}
int length = [data length];
int totalBytes = 0;
while (position < length) {
TiBuffer* tempBuffer = [[[TiBuffer alloc] _initWithPageContext:[self executionContext]] autorelease];
NSRange subdataRange = NSMakeRange(position,MIN(size,length-position));
int bytesWritten = 0;
@try {
void* bytes = malloc(subdataRange.length);
if (bytes == NULL) {
[self throwException:TiExceptionMemoryFailure subreason:@"Failed to allocate for stream" location:CODELOCATION];
}
[data getBytes:bytes range:subdataRange];
[tempBuffer setData:[NSMutableData dataWithBytesNoCopy:bytes length:subdataRange.length freeWhenDone:YES]];
bytesWritten = [output writeFromBuffer:tempBuffer offset:0 length:subdataRange.length callback:nil];
}
@catch (NSException* e) {
// TODO: We'll need some kind of information about:
// 1. Error Code
// 2. # bytes produced as part of the write
// In the exception.
if (callback != nil) {
NSDictionary* event = [NSDictionary dictionaryWithObjectsAndKeys:self,@"fromStream",output,@"toStream",NUMINT(totalBytes),@"bytesWritten",[e reason],@"errorDescription", NUMINT(-1),@"errorState",nil];
[self _fireEventToListener:@"writeToStream" withObject:event listener:callback thisObject:nil];
}
else {
@throw e;
}
}
if (bytesWritten == 0) {
break;
}
totalBytes += bytesWritten;
position += subdataRange.length;
}
if (callback != nil) {
NSDictionary* event = [NSDictionary dictionaryWithObjectsAndKeys:self,@"fromStream",output,@"toStream",NUMINT(totalBytes),@"bytesProcessed",NUMINT(0),@"errorState",@"",@"errorDescription",nil];
[self _fireEventToListener:@"writeToStream" withObject:event listener:callback thisObject:nil];
}
return totalBytes;
}
// We don't need the asynch hint
-(void)pumpToCallback:(KrollCallback *)callback chunkSize:(int)size asynch:(BOOL)asynch
{
if (data == nil) {
[self throwException:@"TiStreamException"
subreason:@"Attempt to write from closed/nil data stream"
location:CODELOCATION];
}
int totalBytes = 0;
int bytesWritten = 0;
int length = [data length];
const void* source = [data bytes];
while (position < length) {
TiBuffer* tempBuffer = [[[TiBuffer alloc] _initWithPageContext:[self executionContext]] autorelease];
int bytesToWrite = MIN(size, length-position);
void* destination = malloc(bytesToWrite);
if (destination == NULL) {
NSDictionary* event = [NSDictionary dictionaryWithObjectsAndKeys:self,@"source",[NSNull null],@"buffer",NUMINT(-1),@"bytesProcessed",NUMINT(totalBytes),@"totalBytesProcessed", NUMINT(1),@"errorState",@"Memory allocation failure",@"errorDescription", nil];
[self _fireEventToListener:@"pump" withObject:event listener:callback thisObject:nil];
break;
}
memcpy(destination, source+position, bytesToWrite);
[tempBuffer setData:[NSMutableData dataWithBytesNoCopy:destination length:bytesToWrite freeWhenDone:YES]];
totalBytes += bytesToWrite;
position += bytesToWrite;
NSDictionary* event = [NSDictionary dictionaryWithObjectsAndKeys:self,@"source",tempBuffer,@"buffer",NUMINT(bytesToWrite),@"bytesProcessed",NUMINT(totalBytes),@"totalBytesProcessed", NUMINT(0),@"errorState",@"",@"errorDescription",nil];
[self _fireEventToListener:@"pump" withObject:event listener:callback thisObject:nil];
}
// We've reached the end of the stream - so we need to pump the -1 EOF
NSDictionary* event = [NSDictionary dictionaryWithObjectsAndKeys:self,@"source",[NSNull null],@"buffer",NUMINT(-1),@"bytesProcessed",NUMINT(totalBytes),@"totalBytesProcessed", NUMINT(0),@"errorState",@"",@"errorDescription", nil];
[self _fireEventToListener:@"pump" withObject:event listener:callback thisObject:nil];
}
-(NSNumber*)isReadable:(id)_void
{
return NUMBOOL(mode & TI_READ);
}
-(NSNumber*)isWritable:(id)_void
{
return NUMBOOL(mode & (TI_WRITE | TI_APPEND));
}
-(void)close:(id)_void
{
RELEASE_TO_NIL(data);
position = 0;
}
@end
| {
"content_hash": "09addf8b1e9f4fe897afb99638167baa",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 258,
"avg_line_length": 40.218106995884774,
"alnum_prop": 0.6455540775606262,
"repo_name": "AppWerft/SunTracker",
"id": "bf1536efc3268abafd6a627f597fd05a6b5aabd3",
"size": "10093",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "build/iphone/Classes/TiDataStream.m",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "139582"
},
{
"name": "C++",
"bytes": "56872"
},
{
"name": "D",
"bytes": "1093222"
},
{
"name": "JavaScript",
"bytes": "31672"
},
{
"name": "Objective-C",
"bytes": "3310532"
},
{
"name": "Shell",
"bytes": "270"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="de">
<head>
<!-- Generated by javadoc (1.8.0_191) on Mon Oct 29 18:19:16 CET 2018 -->
<title>IntegerRangeValidator (esoco-business 1.3.0 API)</title>
<meta name="date" content="2018-10-29">
<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="IntegerRangeValidator (esoco-business 1.3.0 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="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="../../../../de/esoco/data/validate/HierarchyValidator.html" title="class in de.esoco.data.validate"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../de/esoco/data/validate/ListValidator.html" title="class in de.esoco.data.validate"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?de/esoco/data/validate/IntegerRangeValidator.html" target="_top">Frames</a></li>
<li><a href="IntegerRangeValidator.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>Field | </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>Field | </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">de.esoco.data.validate</div>
<h2 title="Class IntegerRangeValidator" class="title">Class IntegerRangeValidator</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>de.esoco.data.validate.IntegerRangeValidator</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../de/esoco/data/validate/Validator.html" title="interface in de.esoco.data.validate">Validator</a><java.lang.Integer>, java.io.Serializable</dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">IntegerRangeValidator</span>
extends java.lang.Object
implements <a href="../../../../de/esoco/data/validate/Validator.html" title="interface in de.esoco.data.validate">Validator</a><java.lang.Integer></pre>
<div class="block">A validator for integer values that constrains them in a range between a
minimal and a maximal value.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../serialized-form.html#de.esoco.data.validate.IntegerRangeValidator">Serialized Form</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== 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="../../../../de/esoco/data/validate/IntegerRangeValidator.html#IntegerRangeValidator-int-int-">IntegerRangeValidator</a></span>(int nMin,
int nMax)</code>
<div class="block">Creates a new instance that tests against a certain integer range.</div>
</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>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/esoco/data/validate/IntegerRangeValidator.html#equals-java.lang.Object-">equals</a></span>(java.lang.Object rObj)</code> </td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/esoco/data/validate/IntegerRangeValidator.html#getMaximum--">getMaximum</a></span>()</code>
<div class="block">Returns the maximum value.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/esoco/data/validate/IntegerRangeValidator.html#getMinimum--">getMinimum</a></span>()</code>
<div class="block">Returns the minimum value.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/esoco/data/validate/IntegerRangeValidator.html#hashCode--">hashCode</a></span>()</code> </td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../de/esoco/data/validate/IntegerRangeValidator.html#isValid-java.lang.Integer-">isValid</a></span>(java.lang.Integer rValue)</code>
<div class="block">Must be implemented to validate data element values.</div>
</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, finalize, getClass, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="IntegerRangeValidator-int-int-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>IntegerRangeValidator</h4>
<pre>public IntegerRangeValidator(int nMin,
int nMax)</pre>
<div class="block">Creates a new instance that tests against a certain integer range.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>nMin</code> - The minimal value (inclusive)</dd>
<dd><code>nMax</code> - The maximal value (inclusive)</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="equals-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals</h4>
<pre>public boolean equals(java.lang.Object rObj)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>equals</code> in class <code>java.lang.Object</code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><code>Object.equals(Object)</code></dd>
</dl>
</li>
</ul>
<a name="getMaximum--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaximum</h4>
<pre>public final int getMaximum()</pre>
<div class="block">Returns the maximum value.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The maximum value</dd>
</dl>
</li>
</ul>
<a name="getMinimum--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMinimum</h4>
<pre>public final int getMinimum()</pre>
<div class="block">Returns the minimum value.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The minimum value</dd>
</dl>
</li>
</ul>
<a name="hashCode--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hashCode</h4>
<pre>public int hashCode()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>hashCode</code> in class <code>java.lang.Object</code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><code>Object.hashCode()</code></dd>
</dl>
</li>
</ul>
<a name="isValid-java.lang.Integer-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>isValid</h4>
<pre>public boolean isValid(java.lang.Integer rValue)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../de/esoco/data/validate/Validator.html#isValid-T-">Validator</a></code></span></div>
<div class="block">Must be implemented to validate data element values.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../de/esoco/data/validate/Validator.html#isValid-T-">isValid</a></code> in interface <code><a href="../../../../de/esoco/data/validate/Validator.html" title="interface in de.esoco.data.validate">Validator</a><java.lang.Integer></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>rValue</code> - The value to validate</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>TRUE if the value is valid according to this validator's rules</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../de/esoco/data/validate/Validator.html#isValid-T-"><code>Validator.isValid(Object)</code></a></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="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="../../../../de/esoco/data/validate/HierarchyValidator.html" title="class in de.esoco.data.validate"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../de/esoco/data/validate/ListValidator.html" title="class in de.esoco.data.validate"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?de/esoco/data/validate/IntegerRangeValidator.html" target="_top">Frames</a></li>
<li><a href="IntegerRangeValidator.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>Field | </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>Field | </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 ======= -->
</body>
</html>
| {
"content_hash": "bc6d140401edbc077bbb01d3210104a4",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 391,
"avg_line_length": 38.1282722513089,
"alnum_prop": 0.6332303467215928,
"repo_name": "esoco/esoco-business",
"id": "8c868a2dc29ba99d2bd653239d1b4ca0e8bdf103",
"size": "14565",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/javadoc/de/esoco/data/validate/IntegerRangeValidator.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2101988"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2012 The Android Open Source Project
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.
-->
<resources>
<!-- Like in themes_base.xml, the namespace "Base.AppCompat.*" is used to
define base styles for the platform version. The "*.AppCompat"
variants are for direct use or use as parent styles by the app. -->
<eat-comment/>
<style name="Base.Widget.AppCompat.ActionBar" parent="">
<item name="displayOptions">showTitle</item>
<item name="divider">?attr/dividerVertical</item>
<item name="height">?attr/actionBarSize</item>
<item name="titleTextStyle">@style/TextAppearance.AppCompat.Widget.ActionBar.Title</item>
<item name="subtitleTextStyle">@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle</item>
<item name="background">@null</item>
<item name="backgroundStacked">@null</item>
<item name="backgroundSplit">@null</item>
<item name="actionButtonStyle">@style/Widget.AppCompat.ActionButton</item>
<item name="actionOverflowButtonStyle">@style/Widget.AppCompat.ActionButton.Overflow</item>
<item name="android:gravity">center_vertical</item>
<item name="contentInsetStart">@dimen/abc_action_bar_content_inset_material</item>
<item name="contentInsetEnd">@dimen/abc_action_bar_content_inset_material</item>
<item name="elevation">8dp</item>
<item name="popupTheme">?attr/actionBarPopupTheme</item>
</style>
<style name="Base.Widget.AppCompat.Light.ActionBar" parent="Base.Widget.AppCompat.ActionBar">
<item name="actionButtonStyle">@style/Widget.AppCompat.Light.ActionButton</item>
<item name="actionOverflowButtonStyle">@style/Widget.AppCompat.Light.ActionButton.Overflow</item>
</style>
<style name="Base.Widget.AppCompat.ActionBar.Solid">
<item name="background">?attr/colorPrimary</item>
<item name="backgroundStacked">?attr/colorPrimary</item>
<item name="backgroundSplit">?attr/colorPrimary</item>
</style>
<style name="Base.Widget.AppCompat.Light.ActionBar.Solid">
<item name="background">?attr/colorPrimary</item>
<item name="backgroundStacked">?attr/colorPrimary</item>
<item name="backgroundSplit">?attr/colorPrimary</item>
</style>
<style name="Base.Widget.AppCompat.ActionButton" parent="RtlUnderlay.Widget.AppCompat.ActionButton">
<item name="android:background">?attr/actionBarItemBackground</item>
<item name="android:minWidth">@dimen/abc_action_button_min_width_material</item>
<item name="android:minHeight">@dimen/abc_action_button_min_height_material</item>
<item name="android:scaleType">center</item>
<item name="android:gravity">center</item>
<item name="android:maxLines">2</item>
<item name="textAllCaps">@bool/abc_config_actionMenuItemAllCaps</item>
</style>
<style name="Base.Widget.AppCompat.ActionButton.CloseMode">
<item name="android:background">?attr/controlBackground</item>
</style>
<style name="Base.Widget.AppCompat.ActionButton.Overflow" parent="RtlUnderlay.Widget.AppCompat.ActionButton.Overflow">
<item name="srcCompat">@drawable/abc_ic_menu_overflow_material</item>
<item name="android:background">?attr/actionBarItemBackground</item>
<item name="android:contentDescription">@string/abc_action_menu_overflow_description</item>
<item name="android:minWidth">@dimen/abc_action_button_min_width_overflow_material</item>
<item name="android:minHeight">@dimen/abc_action_button_min_height_material</item>
</style>
<style name="Base.Widget.AppCompat.ActionBar.TabBar" parent="">
<item name="divider">?attr/actionBarDivider</item>
<item name="showDividers">middle</item>
<item name="dividerPadding">8dip</item>
</style>
<style name="Base.Widget.AppCompat.Light.ActionBar.TabBar"
parent="Base.Widget.AppCompat.ActionBar.TabBar">
</style>
<style name="Base.Widget.AppCompat.ActionBar.TabView" parent="">
<item name="android:background">@drawable/abc_tab_indicator_material</item>
<item name="android:gravity">center_horizontal</item>
<item name="android:paddingLeft">16dip</item>
<item name="android:paddingRight">16dip</item>
<item name="android:layout_width">0dip</item>
<item name="android:layout_weight">1</item>
<item name="android:minWidth">80dip</item>
</style>
<style name="Base.Widget.AppCompat.Light.ActionBar.TabView" parent="Base.Widget.AppCompat.ActionBar.TabView">
<item name="android:background">@drawable/abc_tab_indicator_material</item>
</style>
<style name="Base.Widget.AppCompat.ActionBar.TabText" parent="">
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Medium</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textSize">12sp</item>
<item name="android:textStyle">bold</item>
<item name="android:ellipsize">marquee</item>
<item name="android:maxLines">2</item>
<item name="android:maxWidth">180dp</item>
<item name="textAllCaps">true</item>
</style>
<style name="Base.Widget.AppCompat.Light.ActionBar.TabText"
parent="Base.Widget.AppCompat.ActionBar.TabText">
</style>
<style name="Base.Widget.AppCompat.Light.ActionBar.TabText.Inverse"
parent="Base.Widget.AppCompat.Light.ActionBar.TabText">
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Medium.Inverse</item>
</style>
<style name="Base.Widget.AppCompat.ActionMode" parent="">
<item name="background">?attr/actionModeBackground</item>
<item name="backgroundSplit">?attr/actionModeSplitBackground</item>
<item name="height">?attr/actionBarSize</item>
<item name="titleTextStyle">@style/TextAppearance.AppCompat.Widget.ActionMode.Title</item>
<item name="subtitleTextStyle">@style/TextAppearance.AppCompat.Widget.ActionMode.Subtitle</item>
<item name="closeItemLayout">@layout/abc_action_mode_close_item_material</item>
</style>
<style name="Base.TextAppearance.AppCompat.Widget.ActionMode.Title" parent="TextAppearance.AppCompat.Widget.ActionBar.Title"/>
<style name="Base.TextAppearance.AppCompat.Widget.ActionMode.Subtitle" parent="TextAppearance.AppCompat.Widget.ActionBar.Subtitle"/>
<style name="Base.TextAppearance.AppCompat.Widget.ActionBar.Menu" parent="TextAppearance.AppCompat.Button">
<item name="android:textColor">?attr/actionMenuTextColor</item>
<item name="textAllCaps">@bool/abc_config_actionMenuItemAllCaps</item>
</style>
<style name="Base.TextAppearance.AppCompat.Widget.ActionBar.Title" parent="TextAppearance.AppCompat.Title">
<item name="android:textSize">@dimen/abc_text_size_title_material_toolbar</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
<style name="Base.TextAppearance.AppCompat.Widget.ActionBar.Subtitle" parent="TextAppearance.AppCompat.Subhead">
<item name="android:textSize">@dimen/abc_text_size_subtitle_material_toolbar</item>
<item name="android:textColor">?android:attr/textColorSecondary</item>
</style>
<style name="Base.TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse" parent="TextAppearance.AppCompat.Title.Inverse">
<item name="android:textSize">@dimen/abc_text_size_title_material_toolbar</item>
<item name="android:textColor">?android:attr/textColorPrimaryInverse</item>
</style>
<style name="Base.TextAppearance.AppCompat.Widget.ActionBar.Subtitle.Inverse" parent="TextAppearance.AppCompat.Subhead.Inverse">
<item name="android:textSize">@dimen/abc_text_size_subtitle_material_toolbar</item>
<item name="android:textColor">?android:attr/textColorSecondaryInverse</item>
</style>
<style name="Base.Widget.AppCompat.ProgressBar.Horizontal" parent="android:Widget.ProgressBar.Horizontal">
</style>
<style name="Base.Widget.AppCompat.ProgressBar" parent="android:Widget.ProgressBar">
<item name="android:minWidth">@dimen/abc_action_bar_progress_bar_size</item>
<item name="android:maxWidth">@dimen/abc_action_bar_progress_bar_size</item>
<item name="android:minHeight">@dimen/abc_action_bar_progress_bar_size</item>
<item name="android:maxHeight">@dimen/abc_action_bar_progress_bar_size</item>
</style>
<!-- Spinner Widgets -->
<style name="Platform.Widget.AppCompat.Spinner" parent="android:Widget.Spinner" />
<style name="Base.Widget.AppCompat.Spinner" parent="Platform.Widget.AppCompat.Spinner">
<item name="android:background">@drawable/abc_spinner_mtrl_am_alpha</item>
<item name="android:popupBackground">@drawable/abc_popup_background_mtrl_mult</item>
<item name="android:dropDownSelector">?attr/listChoiceBackgroundIndicator</item>
<item name="android:dropDownVerticalOffset">0dip</item>
<item name="android:dropDownHorizontalOffset">0dip</item>
<item name="android:dropDownWidth">wrap_content</item>
<item name="android:clickable">true</item>
<item name="android:gravity">left|start|center_vertical</item>
<item name="overlapAnchor">true</item>
</style>
<style name="Base.Widget.AppCompat.Spinner.Underlined">
<item name="android:background">@drawable/abc_spinner_textfield_background_material</item>
</style>
<style name="Base.Widget.AppCompat.DropDownItem.Spinner" parent="">
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Widget.DropDownItem</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:paddingRight">8dp</item>
<item name="android:gravity">center_vertical</item>
</style>
<style name="Base.Widget.AppCompat.ListView" parent="android:Widget.ListView">
<item name="android:listSelector">?attr/listChoiceBackgroundIndicator</item>
</style>
<style name="Base.Widget.AppCompat.ListView.DropDown">
<item name="android:divider">@null</item>
</style>
<style name="Base.TextAppearance.AppCompat.Widget.DropDownItem"
parent="android:TextAppearance.Small">
<item name="android:textColor">?android:attr/textColorPrimaryDisableOnly</item>
</style>
<style name="Base.TextAppearance.Widget.AppCompat.ExpandedMenu.Item"
parent="android:TextAppearance.Medium">
<item name="android:textColor">?android:attr/textColorPrimaryDisableOnly</item>
</style>
<style name="Base.Widget.AppCompat.ListView.Menu" parent="android:Widget.ListView.Menu">
<item name="android:listSelector">?attr/listChoiceBackgroundIndicator</item>
<item name="android:divider">?attr/dividerHorizontal</item>
</style>
<style name="Base.Widget.AppCompat.ListPopupWindow" parent="">
<item name="android:dropDownSelector">?attr/listChoiceBackgroundIndicator</item>
<item name="android:popupBackground">@drawable/abc_popup_background_mtrl_mult</item>
<item name="android:dropDownVerticalOffset">0dip</item>
<item name="android:dropDownHorizontalOffset">0dip</item>
<item name="android:dropDownWidth">wrap_content</item>
</style>
<style name="Base.Widget.AppCompat.PopupMenu.Overflow">
<item name="overlapAnchor">true</item>
<item name="android:dropDownHorizontalOffset">-4dip</item>
</style>
<style name="Base.Widget.AppCompat.Light.PopupMenu.Overflow">
<item name="overlapAnchor">true</item>
<item name="android:dropDownHorizontalOffset">-4dip</item>
</style>
<style name="Base.Widget.AppCompat.PopupMenu" parent="@style/Widget.AppCompat.ListPopupWindow">
</style>
<style name="Base.Widget.AppCompat.Light.PopupMenu" parent="@style/Widget.AppCompat.ListPopupWindow">
</style>
<style name="Base.TextAppearance.AppCompat.Widget.PopupMenu.Large" parent="TextAppearance.AppCompat.Menu">
</style>
<style name="Base.TextAppearance.AppCompat.Widget.PopupMenu.Small" parent="TextAppearance.AppCompat.Menu">
</style>
<style name="Base.TextAppearance.AppCompat.Light.Widget.PopupMenu.Large" parent="TextAppearance.AppCompat.Menu">
</style>
<style name="Base.TextAppearance.AppCompat.Light.Widget.PopupMenu.Small" parent="TextAppearance.AppCompat.Menu">
</style>
<style name="Base.TextAppearance.AppCompat.SearchResult" parent="">
<item name="android:textStyle">normal</item>
<item name="android:textColor">?android:textColorPrimary</item>
<item name="android:textColorHint">?android:textColorHint</item>
</style>
<style name="Base.TextAppearance.AppCompat.SearchResult.Title">
<item name="android:textSize">18sp</item>
</style>
<style name="Base.TextAppearance.AppCompat.SearchResult.Subtitle">
<item name="android:textSize">14sp</item>
<item name="android:textColor">?android:textColorSecondary</item>
</style>
<style name="Base.Widget.AppCompat.AutoCompleteTextView" parent="Base.V7.Widget.AppCompat.AutoCompleteTextView" />
<style name="Base.V7.Widget.AppCompat.AutoCompleteTextView" parent="android:Widget.AutoCompleteTextView">
<item name="android:dropDownSelector">?attr/listChoiceBackgroundIndicator</item>
<item name="android:popupBackground">@drawable/abc_popup_background_mtrl_mult</item>
<item name="android:background">?attr/editTextBackground</item>
<item name="android:textColor">?attr/editTextColor</item>
<item name="android:textAppearance">?android:attr/textAppearanceMediumInverse</item>
</style>
<style name="Base.Widget.AppCompat.ActivityChooserView" parent="">
<item name="android:gravity">center</item>
<item name="android:background">@drawable/abc_ab_share_pack_mtrl_alpha</item>
<item name="divider">?attr/dividerVertical</item>
<item name="showDividers">middle</item>
<item name="dividerPadding">6dip</item>
</style>
<style name="Base.Widget.AppCompat.PopupWindow" parent="android:Widget.PopupWindow">
</style>
<style name="Base.Widget.AppCompat.Toolbar" parent="android:Widget">
<item name="titleTextAppearance">@style/TextAppearance.Widget.AppCompat.Toolbar.Title</item>
<item name="subtitleTextAppearance">@style/TextAppearance.Widget.AppCompat.Toolbar.Subtitle</item>
<item name="android:minHeight">?attr/actionBarSize</item>
<item name="titleMargins">4dp</item>
<item name="maxButtonHeight">@dimen/abc_action_bar_default_height_material</item>
<item name="collapseIcon">?attr/homeAsUpIndicator</item>
<item name="collapseContentDescription">@string/abc_toolbar_collapse_description</item>
<item name="contentInsetStart">16dp</item>
<item name="android:paddingLeft">@dimen/abc_action_bar_default_padding_start_material</item>
<item name="android:paddingRight">@dimen/abc_action_bar_default_padding_end_material</item>
</style>
<style name="Base.Widget.AppCompat.Toolbar.Button.Navigation" parent="android:Widget">
<item name="android:background">?attr/controlBackground</item>
<item name="android:minWidth">56dp</item>
<item name="android:scaleType">center</item>
</style>
<style name="Base.TextAppearance.Widget.AppCompat.Toolbar.Title"
parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
</style>
<style name="Base.TextAppearance.Widget.AppCompat.Toolbar.Subtitle"
parent="TextAppearance.AppCompat.Widget.ActionBar.Subtitle">
</style>
<style name="Base.Widget.AppCompat.SearchView" parent="android:Widget">
<item name="layout">@layout/abc_search_view</item>
<item name="queryBackground">@drawable/abc_textfield_search_material</item>
<item name="submitBackground">@drawable/abc_textfield_search_material</item>
<item name="closeIcon">@drawable/abc_ic_clear_material</item>
<item name="searchIcon">@drawable/abc_ic_search_api_mtrl_alpha</item>
<item name="searchHintIcon">@drawable/abc_ic_search_api_mtrl_alpha</item>
<item name="goIcon">@drawable/abc_ic_go_search_api_material</item>
<item name="voiceIcon">@drawable/abc_ic_voice_search_api_material</item>
<item name="commitIcon">@drawable/abc_ic_commit_search_api_mtrl_alpha</item>
<item name="suggestionRowLayout">@layout/abc_search_dropdown_item_icons_2line</item>
</style>
<style name="Base.Widget.AppCompat.SearchView.ActionBar">
<item name="queryBackground">@null</item>
<item name="submitBackground">@null</item>
<item name="searchHintIcon">@null</item>
<item name="defaultQueryHint">@string/abc_search_hint</item>
</style>
<style name="Base.Widget.AppCompat.EditText" parent="Base.V7.Widget.AppCompat.EditText" />
<style name="Base.V7.Widget.AppCompat.EditText" parent="android:Widget.EditText">
<item name="android:background">?attr/editTextBackground</item>
<item name="android:textColor">?attr/editTextColor</item>
<item name="android:textAppearance">?android:attr/textAppearanceMediumInverse</item>
</style>
<!-- contains values used in all dpis -->
<style name="Base.Widget.AppCompat.DrawerArrowToggle.Common" parent="">
<item name="color">?android:attr/textColorSecondary</item>
<item name="spinBars">true</item>
<item name="thickness">2dp</item>
<item name="arrowShaftLength">16dp</item>
<item name="arrowHeadLength">8dp</item>
</style>
<!-- contains values used in all dpis except hdpi and xxhdpi -->
<style name="Base.Widget.AppCompat.DrawerArrowToggle" parent="Base.Widget.AppCompat.DrawerArrowToggle.Common">
<item name="barLength">18dp</item>
<item name="gapBetweenBars">3dp</item>
<item name="drawableSize">24dp</item>
</style>
<style name="Base.Widget.AppCompat.CompoundButton.CheckBox" parent="android:Widget.CompoundButton.CheckBox">
<item name="android:button">?android:attr/listChoiceIndicatorMultiple</item>
<item name="android:background">?attr/controlBackground</item>
</style>
<style name="Base.Widget.AppCompat.CompoundButton.RadioButton" parent="android:Widget.CompoundButton.RadioButton">
<item name="android:button">?android:attr/listChoiceIndicatorSingle</item>
<item name="android:background">?attr/controlBackground</item>
</style>
<style name="Base.Widget.AppCompat.CompoundButton.Switch" parent="android:Widget.CompoundButton">
<item name="track">@drawable/abc_switch_track_mtrl_alpha</item>
<item name="android:thumb">@drawable/abc_switch_thumb_material</item>
<item name="switchTextAppearance">@style/TextAppearance.AppCompat.Widget.Switch</item>
<item name="android:background">?attr/controlBackground</item>
<item name="showText">false</item>
<item name="switchPadding">@dimen/abc_switch_padding</item>
<item name="android:textOn">@string/abc_capital_on</item>
<item name="android:textOff">@string/abc_capital_off</item>
</style>
<style name="Base.TextAppearance.AppCompat.Widget.Switch" parent="TextAppearance.AppCompat.Button" />
<style name="Base.Widget.AppCompat.RatingBar" parent="android:Widget.RatingBar">
<item name="android:progressDrawable">@drawable/abc_ratingbar_full_material</item>
<item name="android:indeterminateDrawable">@drawable/abc_ratingbar_full_material</item>
</style>
<style name="Base.Widget.AppCompat.RatingBar.Indicator" parent="android:Widget.RatingBar">
<item name="android:progressDrawable">@drawable/abc_ratingbar_indicator_material</item>
<item name="android:indeterminateDrawable">@drawable/abc_ratingbar_indicator_material</item>
<item name="android:minHeight">36dp</item>
<item name="android:maxHeight">36dp</item>
<item name="android:isIndicator">true</item>
<item name="android:thumb">@null</item>
</style>
<style name="Base.Widget.AppCompat.RatingBar.Small" parent="android:Widget.RatingBar">
<item name="android:progressDrawable">@drawable/abc_ratingbar_small_material</item>
<item name="android:indeterminateDrawable">@drawable/abc_ratingbar_small_material</item>
<item name="android:minHeight">16dp</item>
<item name="android:maxHeight">16dp</item>
<item name="android:isIndicator">true</item>
<item name="android:thumb">@null</item>
</style>
<style name="Base.Widget.AppCompat.SeekBar" parent="android:Widget">
<item name="android:indeterminateOnly">false</item>
<item name="android:progressDrawable">@drawable/abc_seekbar_track_material</item>
<item name="android:indeterminateDrawable">@drawable/abc_seekbar_track_material</item>
<item name="android:thumb">@drawable/abc_seekbar_thumb_material</item>
<item name="android:focusable">true</item>
<item name="android:paddingLeft">16dip</item>
<item name="android:paddingRight">16dip</item>
</style>
<!-- Bordered ink button -->
<style name="Base.Widget.AppCompat.Button" parent="android:Widget">
<item name="android:background">@drawable/abc_btn_default_mtrl_shape</item>
<item name="android:textAppearance">?android:attr/textAppearanceButton</item>
<item name="android:minHeight">48dip</item>
<item name="android:minWidth">88dip</item>
<item name="android:focusable">true</item>
<item name="android:clickable">true</item>
<item name="android:gravity">center_vertical|center_horizontal</item>
</style>
<!-- Small bordered ink button -->
<style name="Base.Widget.AppCompat.Button.Small">
<item name="android:minHeight">48dip</item>
<item name="android:minWidth">48dip</item>
</style>
<!-- Colored bordered ink button -->
<style name="Base.Widget.AppCompat.Button.Colored">
<item name="android:background">@drawable/abc_btn_colored_material</item>
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Widget.Button.Inverse</item>
</style>
<!-- Borderless ink button -->
<style name="Base.Widget.AppCompat.Button.Borderless">
<item name="android:background">@drawable/abc_btn_borderless_material</item>
</style>
<!-- Colored borderless ink button -->
<style name="Base.Widget.AppCompat.Button.Borderless.Colored">
<item name="android:textColor">?attr/colorAccent</item>
</style>
<style name="Base.Widget.AppCompat.Button.ButtonBar.AlertDialog" parent="Widget.AppCompat.Button.Borderless.Colored">
<item name="android:minWidth">64dp</item>
<item name="android:maxLines">2</item>
<item name="android:minHeight">@dimen/abc_alert_dialog_button_bar_height</item>
</style>
<style name="Base.Widget.AppCompat.ImageButton" parent="android:Widget.ImageButton">
<item name="android:background">@drawable/abc_btn_default_mtrl_shape</item>
</style>
<style name="Base.Widget.AppCompat.TextView.SpinnerItem" parent="android:Widget.TextView.SpinnerItem">
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Widget.TextView.SpinnerItem</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:paddingRight">8dp</item>
</style>
<style name="Base.TextAppearance.AppCompat.Widget.TextView.SpinnerItem" parent="TextAppearance.AppCompat.Menu" />
<style name="Base.DialogWindowTitleBackground.AppCompat" parent="android:Widget">
<item name="android:background">@null</item>
<item name="android:paddingLeft">?attr/dialogPreferredPadding</item>
<item name="android:paddingRight">?attr/dialogPreferredPadding</item>
<item name="android:paddingTop">@dimen/abc_dialog_padding_top_material</item>
</style>
<style name="Base.DialogWindowTitle.AppCompat" parent="android:Widget">
<item name="android:maxLines">1</item>
<item name="android:scrollHorizontally">true</item>
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Title</item>
</style>
<style name="Base.Animation.AppCompat.Dialog" parent="android:Animation">
<item name="android:windowEnterAnimation">@anim/abc_popup_enter</item>
<item name="android:windowExitAnimation">@anim/abc_popup_exit</item>
</style>
<style name="Base.Widget.AppCompat.ButtonBar" parent="android:Widget">
<item name="android:background">@null</item>
</style>
<style name="Base.Widget.AppCompat.ButtonBar.AlertDialog" />
<style name="Base.Animation.AppCompat.DropDownUp" parent="android:Animation">
<item name="android:windowEnterAnimation">@anim/abc_grow_fade_in_from_bottom</item>
<item name="android:windowExitAnimation">@anim/abc_shrink_fade_out_from_bottom</item>
</style>
<style name="Base.AlertDialog.AppCompat" parent="android:Widget">
<item name="android:layout">@layout/abc_alert_dialog_material</item>
<item name="listLayout">@layout/abc_select_dialog_material</item>
<item name="listItemLayout">@layout/select_dialog_item_material</item>
<item name="multiChoiceItemLayout">@layout/select_dialog_multichoice_material</item>
<item name="singleChoiceItemLayout">@layout/select_dialog_singlechoice_material</item>
</style>
<style name="Base.AlertDialog.AppCompat.Light" parent="Base.AlertDialog.AppCompat" />
</resources>
| {
"content_hash": "e38cb7f5a5b6ae89cfd2efcb4c5f175f",
"timestamp": "",
"source": "github",
"line_count": 516,
"max_line_length": 136,
"avg_line_length": 51.1124031007752,
"alnum_prop": 0.7037233639190111,
"repo_name": "ltxms/Practice",
"id": "90a748691d819210eb4e3c71f0793396df0d4297",
"size": "26374",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "summarycompat/res/values/styles_base.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "51230"
}
],
"symlink_target": ""
} |
module.exports = function(app, passport) {
var entities = app.get('entities');
// normal routes ===============================================================
// show the home page (will also have our login links)
app.get('/', function(req, res) {
res.render('index.ejs', {
auth: req.isAuthenticated(),
user: req.user
});
});
// PROFILE SECTION =========================
app.get('/profile', isLoggedIn, function(req, res) {
res.render('profile.ejs', {
user : req.user,
auth : true
});
});
app.get('/profile/:id', function(req, res) {
var auth = req.session &&
req.session.passport &&
req.session.passport.user == req.params.id &&
req.isAuthenticated();
entities.model.user.findOne({ '_id': req.params.id }, function(err, user) {
res.render('profile.ejs', {
user : user,
auth : auth
});
});
});
// LOGOUT ==============================
app.get('/logout', function(req, res) {
req.logout();
res.redirect('/');
});
// Handle goto queries for redirecting after a process completes.
function handleGoto(req, res, next) {
if (req.query.goto) {
var goto = req.query.goto;
if (goto.length > 0) {
if (goto[0] !== '/') {
goto = '/' + goto;
}
req.flash('redirectTo', goto);
}
}
next();
}
// show the login form
app.get('/login', handleGoto, function(req, res) {
res.render('login.ejs', { message: req.flash('loginMessage') });
});
// All the arguments.
function processPassport(req, res, next, err, user, success, fail) {
if (err) {
return next(err);
}
if (!user) {
return res.redirect(fail);
}
req.logIn(user, function(err) {
if (err) {
return next(err);
}
var gotoRedirect = req.flash('redirectTo');
if (gotoRedirect.length > 0) {
return res.redirect(gotoRedirect[0]);
}
return res.redirect(success);
});
}
// process the login form
app.post('/login', function(req, res, next) {
passport.authenticate('local-login', function(err, user, info) {
return processPassport(req, res, next, err, user, '/profile', '/login');
})(req, res, next);
});
// show the signup form
app.get('/signup', handleGoto, function(req, res) {
res.render('signup.ejs', {
message: req.flash('signupMessage')
});
});
// process the signup form
app.post('/signup', function(req, res, next) {
passport.authenticate('local-signup', function(err, user, info) {
return processPassport(req, res, next, err, user, '/profile', '/signup');
})(req, res, next);
});
// login locally --------------------------------
app.get('/connect/local', function(req, res) {
res.render('connect-local.ejs', { message: req.flash('loginMessage') });
});
app.post('/connect/local', passport.authenticate('local-signup', {
successRedirect : '/profile', // redirect to the secure profile section
failureRedirect : '/connect/local', // redirect back to the signup page if there is an error
failureFlash : true // allow flash messages
}));
// unlink local -----------------------------------
app.get('/unlink/local', isLoggedIn, function(req, res) {
var user = req.user;
user.local.email = undefined;
user.local.password = undefined;
user.save(function(err) {
res.redirect('/profile');
});
});
entities.routes.upload(app, '/upload');
entities.routes.item(app, '/item');
};
// route middleware to ensure user is logged in
function isLoggedIn(req, res, next) {
if (req.isAuthenticated()) {
return next();
}
res.redirect('/');
}
| {
"content_hash": "5140cb36bd6b69620346844c3f562a62",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 100,
"avg_line_length": 29.503649635036496,
"alnum_prop": 0.5145967342899554,
"repo_name": "astrellon/hart",
"id": "3652512151c9b174d3126fbf7e28215ef9b91c2c",
"size": "4042",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/routes.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "22078"
},
{
"name": "JavaScript",
"bytes": "20123"
}
],
"symlink_target": ""
} |
dev:
pkill -f http-server &
echo "Make sure to install http-server with npm i -g http-server"
elm-make Main.elm --output=example/elm.js --debug
(http-server ./example/ -p 8081 -c-1 &) && open "http://127.0.0.1:8081"
release:
elm-make Main.elm --output=example/elm.js
mkdir -p docs/stable
cp -r example/ docs/stable/
compile:
elm-make Main.elm --yes --output compiled.js
sed 's/var Elm = {}/&; \
require(".\/elchemy_node.js").execute(_user$$project$$Elchemy_Compiler$$tree, _user$$project$$Elchemy_Compiler$$fullTree, _user$$project$$Elchemy_Compiler$$treeAndCommons)/' compiled.js > elchemy.js
rm compiled.js
compile-watch:
find . -name "*.elm" | grep -v "elm-stuff" | grep -v .# | entr make compile
test:
./node_modules/.bin/elm-test
test-all:
make test
make test-std
make compile-elixir # Change to compile-elixir-and-test when let..in fixed completely
make test-project
test-project:
rm -rf test_project
mix new test_project
cd test_project ; \
(yes | ../elchemy init) ;\
../elchemy compile elm lib ;\
cp -r ../elchemy-core/lib lib/elm-deps ;\
cp -r ../elchemy-core/elm lib/elm-deps-elixir-files ;\
mix test
test-std:
cd elchemy-core/ && mix test
compile-std:
cd elchemy-core && rm -rf .elchemy
make compile-std-incremental
compile-std-incremental:
make compile
cd elchemy-core && ../elchemy compile elm lib
compile-std-watch:
find elchemy-core -name "*.elm" | grep -v ".#" | grep -v "elm-stuff" | entr make compile-std
compile-std-tests-watch:
find elchemy-core \( -name "*.elm" -or -name '*.ex*' \) | grep -v "elchemy.ex" | grep -v ".#" | grep -v "elm-stuff" | entr bash -c "make compile && make compile-std && make test-std"
compile-incremental-std-tests-watch:
find elchemy-core \( -name "*.elm" -or -name '*.ex*' \) | grep -v "elchemy.ex" | grep -v ".#" | grep -v "elm-stuff" | entr bash -c "make compile && make compile-std-incremental && make test-std"
tests-watch:
find . -name "*.elm" | grep -v ".#" | grep -v "elm-stuff" | entr ./node_modules/.bin/elm-test
install-sysconf:
git clone "https://github.com/obmarg/libsysconfcpus.git"
cd libsysconfcpus && ./configure && make && make install
cd .. && rm -rf libsysconfcpus
compile-elixir:
make compile
rm -rf elchemy_ex/elm-deps
rm -rf elchemy_ex/.elchemy
cd elchemy_ex && ../elchemy compile ../src lib
compile-elixir-and-run:
make compile-elixir
cd elchemy_ex && mix compile
compile-elixir-and-test:
make compile-elixir
cd elchemy_ex && mix test
build-docs:
cd ../elchemy-page && git checkout master && git pull && elm install && yarn && yarn build
rm -rf docs/*
cp -r ../elchemy-page/dist/* docs/
| {
"content_hash": "c4416e25fa7e9a2983754db78cb93f42",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 199,
"avg_line_length": 30.941176470588236,
"alnum_prop": 0.6756653992395437,
"repo_name": "wende/elchemy",
"id": "a0c14c7cda137695c002d593606b912dc24141f1",
"size": "2630",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Makefile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Elixir",
"bytes": "8637"
},
{
"name": "Elm",
"bytes": "152478"
},
{
"name": "JavaScript",
"bytes": "1430"
},
{
"name": "Makefile",
"bytes": "2630"
},
{
"name": "Shell",
"bytes": "8429"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "695bcf2f61ab5cb861448dbadd4c394b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "6c119895c625b8a3d5cba804d0cfb810d2cf0073",
"size": "210",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Lamiaceae/Teucrium/Teucrium heterophyllum/Teucrium heterophyllum brevipilosum/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2022 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<resources>
<dimen name="visit_item_remove_button_lateral_padding">18dp</dimen>
<dimen name="related_search_chip_list_chip_spacing">4dp</dimen>
<dimen name="related_search_chip_list_side_padding">16dp</dimen>
<dimen name="thick_divider_height">4dp</dimen>
<dimen name="divider_margin">8dp</dimen>
</resources>
| {
"content_hash": "cbafc7576b038145c5f70a51366c709b",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 71,
"avg_line_length": 36.642857142857146,
"alnum_prop": 0.7153996101364523,
"repo_name": "nwjs/chromium.src",
"id": "6a2fdee2933974b0996747e141ec3805533d9f0e",
"size": "513",
"binary": false,
"copies": "6",
"ref": "refs/heads/nw70",
"path": "chrome/browser/history_clusters/java/res/values/dimens.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
/**
* Gets URI that identifies the test.
* @return uri identifier of test
*/
function getTargetURI() {
return "http://www.w3.org/2001/DOM-Test-Suite/level3/core/documentadoptnode10";
}
var docsLoaded = -1000000;
var builder = null;
//
// This function is called by the testing framework before
// running the test suite.
//
// If there are no configuration exceptions, asynchronous
// document loading is started. Otherwise, the status
// is set to complete and the exception is immediately
// raised when entering the body of the test.
//
function setUpPage() {
setUpPageStatus = 'running';
try {
//
// creates test document builder, may throw exception
//
builder = createConfiguredBuilder();
docsLoaded = 0;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
docsLoaded += preload(docRef, "doc", "hc_staff");
if (docsLoaded == 1) {
setUpPageStatus = 'complete';
}
} catch(ex) {
catchInitializationError(builder, ex);
setUpPageStatus = 'complete';
}
}
//
// This method is called on the completion of
// each asychronous load started in setUpTests.
//
// When every synchronous loaded document has completed,
// the page status is changed which allows the
// body of the test to be executed.
function loadComplete() {
if (++docsLoaded == 1) {
setUpPageStatus = 'complete';
}
}
/**
*
Invoke the adoptNode method on this document with the value of the source parameter as this
documents doctype node. Verify if a NOT_SUPPORTED_ERR is thrown.
* @author IBM
* @author Neil Delima
* @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Document3-adoptNode
*/
function documentadoptnode10() {
var success;
if(checkInitialization(builder, "documentadoptnode10") != null) return;
var doc;
var docType;
var adoptedDocType;
var docRef = null;
if (typeof(this.doc) != 'undefined') {
docRef = this.doc;
}
doc = load(docRef, "doc", "hc_staff");
docType = doc.doctype;
{
success = false;
try {
adoptedDocType = doc.adoptNode(docType);
}
catch(ex) {
success = (typeof(ex.code) != 'undefined' && ex.code == 9);
}
assertTrue("throw_NOT_SUPPORTED_ERR",success);
}
}
function runTest() {
documentadoptnode10();
}
| {
"content_hash": "7c012c715c6d279246667f46eb51d55f",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 93,
"avg_line_length": 22.91743119266055,
"alnum_prop": 0.6180944755804644,
"repo_name": "lordmos/blink",
"id": "e36daec40461045b02f00ab669f94bc6720f8175",
"size": "2991",
"binary": false,
"copies": "21",
"ref": "refs/heads/master",
"path": "LayoutTests/dom/xhtml/level3/core/documentadoptnode10.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "6433"
},
{
"name": "C",
"bytes": "753714"
},
{
"name": "C++",
"bytes": "40028043"
},
{
"name": "CSS",
"bytes": "539440"
},
{
"name": "F#",
"bytes": "8755"
},
{
"name": "Java",
"bytes": "18650"
},
{
"name": "JavaScript",
"bytes": "25700387"
},
{
"name": "Objective-C",
"bytes": "426711"
},
{
"name": "PHP",
"bytes": "141755"
},
{
"name": "Perl",
"bytes": "901523"
},
{
"name": "Python",
"bytes": "3748305"
},
{
"name": "Ruby",
"bytes": "141818"
},
{
"name": "Shell",
"bytes": "9635"
},
{
"name": "XSLT",
"bytes": "49328"
}
],
"symlink_target": ""
} |
package org.apache.logging.log4j.core.appender.rolling;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.File;
import java.util.Arrays;
import java.util.List;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.test.junit.LoggerContextRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
/**
* Tests that zero-padding in rolled files works correctly.
*/
public class RolloverWithPaddingTest {
private static final String CONFIG = "log4j-rolling-with-padding.xml";
private static final String DIR = "target/rolling-with-padding";
private final LoggerContextRule loggerContextRule = LoggerContextRule.createShutdownTimeoutLoggerContextRule(CONFIG);
@Rule
public RuleChain chain = loggerContextRule.withCleanFoldersRule(DIR);
@Test
public void testAppender() throws Exception {
final Logger logger = loggerContextRule.getLogger();
for (int i = 0; i < 10; ++i) {
// 30 chars per message: each message triggers a rollover
logger.fatal("This is a test message number " + i); // 30 chars:
}
Thread.sleep(100); // Allow time for rollover to complete
final File dir = new File(DIR);
assertTrue("Dir " + DIR + " should exist", dir.exists());
assertTrue("Dir " + DIR + " should contain files", dir.listFiles().length == 6);
final File[] files = dir.listFiles();
final List<String> expected = Arrays.asList("rollingtest.log", "test-001.log", "test-002.log", "test-003.log", "test-004.log", "test-005.log");
assertEquals("Unexpected number of files", expected.size(), files.length);
for (final File file : files) {
if (!expected.contains(file.getName())) {
fail("unexpected file" + file);
}
}
}
}
| {
"content_hash": "49081c02752ecf1bf8f569c4e5a2e056",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 147,
"avg_line_length": 35.40384615384615,
"alnum_prop": 0.7126561651276481,
"repo_name": "apache/logging-log4j2",
"id": "6d3b299f89e0de98b2d5cc930d26956865fb68c0",
"size": "2641",
"binary": false,
"copies": "2",
"ref": "refs/heads/release-2.x",
"path": "log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/rolling/RolloverWithPaddingTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2499"
},
{
"name": "Dockerfile",
"bytes": "1193"
},
{
"name": "Groovy",
"bytes": "91"
},
{
"name": "Java",
"bytes": "12755588"
},
{
"name": "JavaScript",
"bytes": "211"
},
{
"name": "Shell",
"bytes": "22853"
},
{
"name": "XSLT",
"bytes": "9297"
}
],
"symlink_target": ""
} |
#include <iostream>
using namespace std;
int option_filter_main(istream &input, ostream &output);
| {
"content_hash": "112d3b5a7a3793607133febd82e500bf",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 56,
"avg_line_length": 20,
"alnum_prop": 0.76,
"repo_name": "kit-transue/software-emancipation-discover",
"id": "af00056d1a8ea763e73ede31962f532f45b8e2e8",
"size": "2124",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "options_filter/option_filter.h",
"mode": "33261",
"license": "bsd-2-clause",
"language": [
{
"name": "Batchfile",
"bytes": "178658"
},
{
"name": "C",
"bytes": "2730024"
},
{
"name": "C#",
"bytes": "308"
},
{
"name": "C++",
"bytes": "23349265"
},
{
"name": "CSS",
"bytes": "1861130"
},
{
"name": "Crystal",
"bytes": "105"
},
{
"name": "Emacs Lisp",
"bytes": "50226"
},
{
"name": "GLSL",
"bytes": "2698016"
},
{
"name": "Gnuplot",
"bytes": "1219"
},
{
"name": "Groff",
"bytes": "10934"
},
{
"name": "HTML",
"bytes": "10534201"
},
{
"name": "Java",
"bytes": "272548"
},
{
"name": "Lex",
"bytes": "269984"
},
{
"name": "Makefile",
"bytes": "487619"
},
{
"name": "Objective-C",
"bytes": "10093"
},
{
"name": "Perl",
"bytes": "719227"
},
{
"name": "Perl6",
"bytes": "15568"
},
{
"name": "PostScript",
"bytes": "25588"
},
{
"name": "Ruby",
"bytes": "77891"
},
{
"name": "Scilab",
"bytes": "11247"
},
{
"name": "Shell",
"bytes": "320920"
},
{
"name": "Smalltalk",
"bytes": "83"
},
{
"name": "SuperCollider",
"bytes": "23447"
},
{
"name": "Tcl",
"bytes": "1047438"
},
{
"name": "XSLT",
"bytes": "5277"
},
{
"name": "Yacc",
"bytes": "514644"
}
],
"symlink_target": ""
} |
package org.apache.cloudstack.framework.sampleserver;
import java.util.Timer;
import java.util.TimerTask;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import org.apache.cloudstack.framework.messagebus.MessageBus;
import org.apache.cloudstack.framework.messagebus.MessageDispatcher;
import org.apache.cloudstack.framework.messagebus.MessageHandler;
import org.apache.cloudstack.framework.rpc.RpcCallbackListener;
import org.apache.cloudstack.framework.rpc.RpcException;
import org.apache.cloudstack.framework.rpc.RpcProvider;
import org.apache.cloudstack.framework.rpc.RpcServerCall;
import org.apache.cloudstack.framework.rpc.RpcServiceDispatcher;
import org.apache.cloudstack.framework.rpc.RpcServiceHandler;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
@Component
public class SampleManagerComponent {
private static final Logger s_logger = Logger.getLogger(SampleManagerComponent.class);
@Inject
private MessageBus _eventBus;
@Inject
private RpcProvider _rpcProvider;
private Timer _timer = new Timer();
public SampleManagerComponent() {
}
@PostConstruct
public void init() {
_rpcProvider.registerRpcServiceEndpoint(
RpcServiceDispatcher.getDispatcher(this));
// subscribe to all network events (for example)
_eventBus.subscribe("network",
MessageDispatcher.getDispatcher(this));
_timer.schedule(new TimerTask() {
public void run() {
testRpc();
}
}, 3000);
}
@RpcServiceHandler(command="NetworkPrepare")
void onStartCommand(RpcServerCall call) {
call.completeCall("NetworkPrepare completed");
}
@MessageHandler(topic="network.prepare")
void onPrepareNetwork(String sender, String topic, Object args) {
}
void testRpc() {
SampleStoragePrepareCommand cmd = new SampleStoragePrepareCommand();
cmd.setStoragePool("Pool1");
cmd.setVolumeId("vol1");
_rpcProvider.newCall()
.setCommand("StoragePrepare").setCommandArg(cmd).setTimeout(10000)
.addCallbackListener(new RpcCallbackListener<SampleStoragePrepareAnswer>() {
@Override
public void onSuccess(SampleStoragePrepareAnswer result) {
s_logger.info("StoragePrepare return result: " + result.getResult());
}
@Override
public void onFailure(RpcException e) {
s_logger.info("StoragePrepare failed");
}
}).apply();
}
}
| {
"content_hash": "d4629524c8819c8a53e57a0690c4e86c",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 90,
"avg_line_length": 29.135802469135804,
"alnum_prop": 0.7699152542372881,
"repo_name": "mufaddalq/cloudstack-datera-driver",
"id": "d59fe42d5ea28d7a85ac07dafa5e8c2b85bc21f0",
"size": "3167",
"binary": false,
"copies": "1",
"ref": "refs/heads/4.2",
"path": "framework/ipc/test/org/apache/cloudstack/framework/sampleserver/SampleManagerComponent.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "250"
},
{
"name": "Batchfile",
"bytes": "6317"
},
{
"name": "CSS",
"bytes": "302008"
},
{
"name": "FreeMarker",
"bytes": "4917"
},
{
"name": "HTML",
"bytes": "38671"
},
{
"name": "Java",
"bytes": "79758943"
},
{
"name": "JavaScript",
"bytes": "4237188"
},
{
"name": "Perl",
"bytes": "1879"
},
{
"name": "Python",
"bytes": "5187499"
},
{
"name": "Shell",
"bytes": "803262"
}
],
"symlink_target": ""
} |
<!DOCTYPE html >
<html>
<head>
<title>ResultOfInOrderOnlyApplication - ScalaTest 3.0.2 - org.scalatest.words.ResultOfInOrderOnlyApplication</title>
<meta name="description" content="ResultOfInOrderOnlyApplication - ScalaTest 3.0.2 - org.scalatest.words.ResultOfInOrderOnlyApplication" />
<meta name="keywords" content="ResultOfInOrderOnlyApplication ScalaTest 3.0.2 org.scalatest.words.ResultOfInOrderOnlyApplication" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
<link href="../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />
<script type="text/javascript" src="../../../lib/jquery.js" id="jquery-js"></script>
<script type="text/javascript" src="../../../lib/jquery-ui.js"></script>
<script type="text/javascript" src="../../../lib/template.js"></script>
<script type="text/javascript" src="../../../lib/tools.tooltip.js"></script>
<script type="text/javascript">
if(top === self) {
var url = '../../../index.html';
var hash = 'org.scalatest.words.ResultOfInOrderOnlyApplication';
var anchor = window.location.hash;
var anchor_opt = '';
if (anchor.length >= 1)
anchor_opt = '@' + anchor.substring(1);
window.location.href = url + '#' + hash + anchor_opt;
}
</script>
<!-- gtag [javascript] -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-71294502-1"></script>
<script defer>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-71294502-1');
</script>
</head>
<body class="type">
<!-- Top of doc.scalatest.org [javascript] -->
<script type="text/javascript">
var rnd = window.rnd || Math.floor(Math.random()*10e6);
var pid204546 = window.pid204546 || rnd;
var plc204546 = window.plc204546 || 0;
var abkw = window.abkw || '';
var absrc = 'http://ab167933.adbutler-ikon.com/adserve/;ID=167933;size=468x60;setID=204546;type=js;sw='+screen.width+';sh='+screen.height+';spr='+window.devicePixelRatio+';kw='+abkw+';pid='+pid204546+';place='+(plc204546++)+';rnd='+rnd+';click=CLICK_MACRO_PLACEHOLDER';
document.write('<scr'+'ipt src="'+absrc+'" type="text/javascript"></scr'+'ipt>');
</script>
<div id="definition">
<img alt="Class" src="../../../lib/class_big.png" />
<p id="owner"><a href="../../package.html" class="extype" name="org">org</a>.<a href="../package.html" class="extype" name="org.scalatest">scalatest</a>.<a href="package.html" class="extype" name="org.scalatest.words">words</a></p>
<h1>ResultOfInOrderOnlyApplication</h1><h3><span class="morelinks"><div>Related Doc:
<a href="package.html" class="extype" name="org.scalatest.words">package words</a>
</div></span></h3><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
</div>
<h4 id="signature" class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">class</span>
</span>
<span class="symbol">
<span class="name">ResultOfInOrderOnlyApplication</span><span class="result"> extends <span class="extype" name="scala.AnyRef">AnyRef</span></span>
</span>
</h4>
<div id="comment" class="fullcommenttop"><div class="comment cmt"><p>This class is part of the ScalaTest matchers DSL. Please see the documentation for <a href="../Matchers.html"><code>Matchers</code></a> for an overview of
the matchers DSL.
</p></div><dl class="attributes block"> <dt>Source</dt><dd><a href="https://github.com/scalatest/scalatest/tree/release-3.0.2/scalatest//src/main/scala/org/scalatest/words/ResultOfInOrderOnlyApplication.scala" target="_blank">ResultOfInOrderOnlyApplication.scala</a></dd></dl><div class="toggleContainer block">
<span class="toggle">Linear Supertypes</span>
<div class="superTypes hiddenContent"><span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div>
</div></div>
<div id="mbrsel">
<div id="textfilter"><span class="pre"></span><span class="input"><input id="mbrsel-input" type="text" accesskey="/" /></span><span class="post"></span></div>
<div id="order">
<span class="filtertype">Ordering</span>
<ol>
<li class="alpha in"><span>Alphabetic</span></li>
<li class="inherit out"><span>By Inheritance</span></li>
</ol>
</div>
<div id="ancestors">
<span class="filtertype">Inherited<br />
</span>
<ol id="linearization">
<li class="in" name="org.scalatest.words.ResultOfInOrderOnlyApplication"><span>ResultOfInOrderOnlyApplication</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li>
</ol>
</div><div id="ancestors">
<span class="filtertype"></span>
<ol>
<li class="hideall out"><span>Hide All</span></li>
<li class="showall in"><span>Show All</span></li>
</ol>
</div>
<div id="visbl">
<span class="filtertype">Visibility</span>
<ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol>
</div>
</div>
<div id="template">
<div id="allMembers">
<div id="constructors" class="members">
<h3>Instance Constructors</h3>
<ol><li name="org.scalatest.words.ResultOfInOrderOnlyApplication#<init>" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped">
<a id="<init>(right:Seq[Any]):org.scalatest.words.ResultOfInOrderOnlyApplication"></a>
<a id="<init>:ResultOfInOrderOnlyApplication"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">new</span>
</span>
<span class="symbol">
<span class="name">ResultOfInOrderOnlyApplication</span><span class="params">(<span name="right">right: <span class="extype" name="scala.collection.Seq">Seq</span>[<span class="extype" name="scala.Any">Any</span>]</span>)</span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@<init>(right:Seq[Any]):org.scalatest.words.ResultOfInOrderOnlyApplication" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
</li></ol>
</div>
<div id="values" class="values members">
<h3>Value Members</h3>
<ol><li name="scala.AnyRef#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="!=(x$1:Any):Boolean"></a>
<a id="!=(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@!=(x$1:Any):Boolean" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef###" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="##():Int"></a>
<a id="##():Int"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@##():Int" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="==(x$1:Any):Boolean"></a>
<a id="==(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@==(x$1:Any):Boolean" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.Any#asInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="asInstanceOf[T0]:T0"></a>
<a id="asInstanceOf[T0]:T0"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@asInstanceOf[T0]:T0" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.AnyRef#clone" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="clone():Object"></a>
<a id="clone():AnyRef"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@clone():Object" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.CloneNotSupportedException]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#eq" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="eq(x$1:AnyRef):Boolean"></a>
<a id="eq(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@eq(x$1:AnyRef):Boolean" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#equals" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="equals(x$1:Any):Boolean"></a>
<a id="equals(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">equals</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@equals(x$1:Any):Boolean" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#finalize" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="finalize():Unit"></a>
<a id="finalize():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@finalize():Unit" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="symbol">classOf[java.lang.Throwable]</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#getClass" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="getClass():Class[_]"></a>
<a id="getClass():Class[_]"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@getClass():Class[_]" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#hashCode" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="hashCode():Int"></a>
<a id="hashCode():Int"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">hashCode</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@hashCode():Int" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.Any#isInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="isInstanceOf[T0]:Boolean"></a>
<a id="isInstanceOf[T0]:Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@isInstanceOf[T0]:Boolean" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.AnyRef#ne" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ne(x$1:AnyRef):Boolean"></a>
<a id="ne(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@ne(x$1:AnyRef):Boolean" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#notify" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notify():Unit"></a>
<a id="notify():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@notify():Unit" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#notifyAll" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notifyAll():Unit"></a>
<a id="notifyAll():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@notifyAll():Unit" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="org.scalatest.words.ResultOfInOrderOnlyApplication#right" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped">
<a id="right:Seq[Any]"></a>
<a id="right:Seq[Any]"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">val</span>
</span>
<span class="symbol">
<span class="name">right</span><span class="result">: <span class="extype" name="scala.collection.Seq">Seq</span>[<span class="extype" name="scala.Any">Any</span>]</span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@right:Seq[Any]" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
</li><li name="scala.AnyRef#synchronized" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="synchronized[T0](x$1:=>T0):T0"></a>
<a id="synchronized[T0](⇒T0):T0"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@synchronized[T0](x$1:=>T0):T0" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="org.scalatest.words.ResultOfInOrderOnlyApplication#toString" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="toString():String"></a>
<a id="toString():String"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">toString</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@toString():String" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="" class="extype" name="org.scalatest.words.ResultOfInOrderOnlyApplication">ResultOfInOrderOnlyApplication</a> → AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait():Unit"></a>
<a id="wait():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@wait():Unit" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.InterruptedException]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long,x$2:Int):Unit"></a>
<a id="wait(Long,Int):Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@wait(x$1:Long,x$2:Int):Unit" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.InterruptedException]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long):Unit"></a>
<a id="wait(Long):Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4><span class="permalink">
<a href="../../../index.html#org.scalatest.words.ResultOfInOrderOnlyApplication@wait(x$1:Long):Unit" title="Permalink" target="_top">
<img src="../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.InterruptedException]">...</span>
</span>)</span>
</dd></dl></div>
</li></ol>
</div>
</div>
<div id="inheritedMembers">
<div class="parent" name="scala.AnyRef">
<h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3>
</div><div class="parent" name="scala.Any">
<h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3>
</div>
</div>
<div id="groupedMembers">
<div class="group" name="Ungrouped">
<h3>Ungrouped</h3>
</div>
</div>
</div>
<div id="tooltip"></div>
<div id="footer"> </div>
</body>
</html>
| {
"content_hash": "ce1e111f4f9df2e5e18fa14a02b5b6d4",
"timestamp": "",
"source": "github",
"line_count": 557,
"max_line_length": 335,
"avg_line_length": 51.78456014362657,
"alnum_prop": 0.5947510747469145,
"repo_name": "scalatest/scalatest-website",
"id": "5b4f0564039fae71424f6d597add82a41537d62c",
"size": "28864",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/scaladoc/3.0.2/org/scalatest/words/ResultOfInOrderOnlyApplication.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "8401192"
},
{
"name": "HTML",
"bytes": "4508833233"
},
{
"name": "JavaScript",
"bytes": "12256885"
},
{
"name": "Procfile",
"bytes": "62"
},
{
"name": "Scala",
"bytes": "136544"
}
],
"symlink_target": ""
} |
package com.juanan.pocs.companies.web.controller;
import javax.servlet.http.HttpSession;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.juanan.pocs.companies.core.services.companies.CompaniesProcesses;
import com.juanan.pocs.companies.web.connection.MongoDBConnection;
@Controller
@RequestMapping("AppAsynchronousProcesses")
public class ProcesosAsincronosController {
final static Logger logger = LogManager.getLogger(ProcesosAsincronosController.class);
@Value("${num.threads}")
private Integer numThreads = null;
@Value("${folder.load.companies}")
private String folderCompaniesData = null;
@Value("${folder.download.infocif}")
private String folderInfocif = null;
@Value("${folder.download.einforma}")
private String folderEInforma = null;
@Value("${folder.download.axesor}")
private String folderAxesor = null;
@RequestMapping(value = "LoadCompanies", method = RequestMethod.GET)
public @ResponseBody String cargaDatosEmpresasWatson(
@RequestParam(value = "anyo", required = true) String anyo,
HttpSession session) {
CompaniesProcesses.execLoadWatsonDataWithThreads(folderCompaniesData, folderInfocif, folderEInforma, MongoDBConnection.getConnection(anyo), numThreads);
return "OK";
}
@RequestMapping(value = "UpdateCompanies", method = RequestMethod.GET)
public @ResponseBody String actualizaDatosEmpresasWatson(
@RequestParam(value = "anyo", required = true) String anyo,
HttpSession session) {
CompaniesProcesses.execUpdateCompaniesFromWatson(folderCompaniesData, MongoDBConnection.getConnection(anyo));
return "OK";
}
/*@RequestMapping(value = "DownloadCompaniesAxesor", method = RequestMethod.GET)
public @ResponseBody String descargaDatosEmpresasAxesor(
@RequestParam(value = "anyo", required = true) String anyo,
@RequestParam(value = "idEmpresaIni", required = true) Integer idEmpresaIni,
@RequestParam(value = "idEmpresaFin", required = true) Integer idEmpresaFin,
@RequestParam(value = "etapa", required = true) String etapa,
HttpSession session) {
EmpresasProcesses.execLoadAxesorDataWithThreads(folderAxesor, idEmpresaIni, idEmpresaFin, etapa, MongoDBConnection.getConnection(anyo), numThreads);
return "OK";
}*/
}
| {
"content_hash": "ed3372374394421856c068e20022eab5",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 160,
"avg_line_length": 36.26027397260274,
"alnum_prop": 0.7850396675481678,
"repo_name": "JuananIBM/WebCompanies",
"id": "562ef59055304ae75e5de440f63363d31be155d8",
"size": "2647",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/juanan/pocs/companies/web/controller/ProcesosAsincronosController.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "256116"
},
{
"name": "HTML",
"bytes": "781"
},
{
"name": "Java",
"bytes": "122820"
},
{
"name": "JavaScript",
"bytes": "164808"
}
],
"symlink_target": ""
} |
<?php
namespace Acme\DemoBundle\Doctrine;
use Doctrine\Common\Persistence\ManagerRegistry;
class SmartManagerRegistry implements ManagerRegistry
{
protected $registries = [];
/**
* {@inheritdoc}
*/
public function getDefaultManagerName()
{
throw new \LogicException('Not smart enough');
}
/**
* {@inheritdoc}
*/
public function getManager($name = null)
{
throw new \LogicException('Not smart enough');
}
/**
* {@inheritdoc}
*/
public function getManagers()
{
$managers = [];
foreach ($this->registries as $registry) {
$managers = array_merge(array_values($registry->getManagers()), $managers);
}
return $managers;
}
/**
* {@inheritdoc}
*/
public function resetManager($name = null)
{
throw new \LogicException('Not smart enough');
}
/**
* {@inheritdoc}
*/
public function getAliasNamespace($alias)
{
throw new \LogicException('Not smart enough');
}
/**
* Gets all connection names.
*
* @return array An array of connection names.
*/
public function getManagerNames()
{
throw new \LogicException('Not smart enough');
}
/**
* {@inheritdoc}
*/
public function getRepository($persistentObject, $persistentManagerName = null)
{
return $this->getManagerForClass($persistentObject)->getRepository($persistentObject);
}
/**
* {@inheritdoc}
*/
public function getManagerForClass($class)
{
foreach ($this->registries as $registry) {
if ($manager = $registry->getManagerForClass($class)) {
return $manager;
}
}
throw new \Exception('No manager was found for '. $class);
}
/**
* @param ManagerRegistry $registry
*/
public function addRegistry(ManagerRegistry $registry)
{
$this->registries[] = $registry;
}
/**
* {@inheritdoc}
*/
public function getDefaultConnectionName()
{
throw new \LogicException('Not smart enough');
}
/**
* {@inheritdoc}
*/
public function getConnection($name = null)
{
throw new \LogicException('Not smart enough');
}
/**
* {@inheritdoc}
*/
public function getConnections()
{
$connections = [];
foreach ($this->getManagers() as $manager) {
$connections[] = $manager->getConnection();
}
return $connections;
}
/**
* {@inheritdoc}
*/
public function getConnectionNames()
{
throw new \LogicException('Not smart enough');
}
}
| {
"content_hash": "df6d1c2d31b7ec0d9604a2e7f9db695a",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 94,
"avg_line_length": 20.586466165413533,
"alnum_prop": 0.5573411249086925,
"repo_name": "juliensnz/batch-bundle-experimentation",
"id": "138759ac4fc2aac6422fc0b04a2c65ada8391eb3",
"size": "3189",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Acme/DemoBundle/Doctrine/SmartManagerRegistry.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "64065"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.elvea.platform.core.oauth.mapper.AuthorizationMapper">
</mapper>
| {
"content_hash": "7f079a04deda32593fab0c199a464ecf",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 111,
"avg_line_length": 59.75,
"alnum_prop": 0.7238493723849372,
"repo_name": "elveahuang/platform",
"id": "b587d7f0523c983f9625013d837d5547efd6ebd5",
"size": "239",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "platform-modules/platform-core-biz/src/main/resources/cn/elvea/platform/core/system/mapper/AuthorizationMapper.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "9329"
},
{
"name": "Java",
"bytes": "966828"
},
{
"name": "JavaScript",
"bytes": "2235"
},
{
"name": "SCSS",
"bytes": "629"
},
{
"name": "TypeScript",
"bytes": "2821"
}
],
"symlink_target": ""
} |
{-# LANGUAGE FlexibleContexts #-}
module Persistent where
import Control.Monad.State (MonadState)
import Control.Monad.State (StateT)
import Control.Monad.State (execStateT)
import Control.Monad.State (get)
import Control.Monad.State (gets)
import Control.Monad.State (modify)
import Control.Monad.Trans (liftIO)
data Doc =
Doc
{ items :: [Item]
, nextItemID :: ItemID }
deriving (Show, Read, Eq, Ord)
data Item =
Item
{ itemID :: ItemID
, itemTitle :: Title
, itemBody :: Body
} deriving (Show, Read, Eq, Ord)
type ItemID = Int
type Title = String
type Body = String
main :: IO ()
main = do
putStrLn "Started."
doc <- execStateT cmdLoop newDoc
putStrLn "Doc:"
print doc
putStrLn "Terminated."
return ()
cmdLoop :: StateT Doc IO ()
cmdLoop = do
liftIO $ putStr "cmd> "
cmd <- liftIO getLine
case cmd of
"quit" -> return ()
"show" -> do doc <- get
liftIO $ print doc
cmdLoop
"add" -> do liftIO $ putStr "Title: "
title <- liftIO $ getLine
liftIO $ putStr "Body: "
body <- liftIO $ getLine
addItem title body
cmdLoop
'@' : _ -> do liftIO $ putStrLn cmd
cmdLoop
"help" -> do { liftIO putHelp; cmdLoop }
_ -> do liftIO $ putStrLn "Invalid command."
cmdLoop
cmds :: [String]
cmds = ["quit", "show", "add", "help"]
putHelp :: IO ()
putHelp = do
putStrLn "Available commands:"
flip mapM_ cmds $ \cmd -> putStrLn (" " ++ cmd)
-- TBD: connect to persitent store
newDoc :: Doc
newDoc = Doc { items = [], nextItemID = 0 }
addItem :: MonadState Doc m => Title -> Body -> m ()
addItem title body = do
iid <- gets nextItemID
modify $ \doc -> Doc { items = Item iid title body : items doc,
nextItemID = iid + 1 }
-- TBD: showItem
-- TBD: updateItem
-- TBD: deleteItem
| {
"content_hash": "99f5f06b077a0269cbf3aadf3f88c82a",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 65,
"avg_line_length": 24.0126582278481,
"alnum_prop": 0.5940959409594095,
"repo_name": "notae/haskell-exercise",
"id": "01e263bd5c450efbcb2c4000b0079c120dd37267",
"size": "1897",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "io/Persistent.hs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Emacs Lisp",
"bytes": "191"
},
{
"name": "Haskell",
"bytes": "331499"
},
{
"name": "Shell",
"bytes": "4685"
}
],
"symlink_target": ""
} |
package com.thoughtworks.xstream.io;
import com.thoughtworks.xstream.io.xml.CompactWriter;
import junit.framework.TestCase;
import java.io.IOException;
import java.io.StringWriter;
/**
* @author Jörg Schaible
*/
public class StatefulWriterTest extends TestCase {
private StatefulWriter writer;
private StringWriter stringWriter;
protected void setUp() throws Exception {
super.setUp();
stringWriter = new StringWriter();
writer = new StatefulWriter(new CompactWriter(stringWriter));
}
public void testDelegatesAllCalls() {
writer.startNode("junit");
writer.addAttribute("test", "true");
writer.setValue("foo");
writer.endNode();
writer.close();
assertEquals("<junit test=\"true\">foo</junit>", stringWriter.toString());
}
public void testKeepsBlance() {
writer.startNode("junit");
writer.endNode();
try {
writer.endNode();
fail("Thrown " + StreamException.class.getName() + " expected");
} catch (final StreamException e) {
assertTrue(e.getCause() instanceof IllegalStateException);
}
}
public void testCanOnlyWriteAttributesToOpenNode() {
try {
writer.addAttribute("test", "true");
fail("Thrown " + StreamException.class.getName() + " expected");
} catch (final StreamException e) {
assertTrue(e.getCause() instanceof IllegalStateException);
}
writer.startNode("junit");
writer.setValue("text");
try {
writer.addAttribute("test", "true");
fail("Thrown " + StreamException.class.getName() + " expected");
} catch (final StreamException e) {
assertTrue(e.getCause() instanceof IllegalStateException);
}
writer.endNode();
try {
writer.addAttribute("test", "true");
fail("Thrown " + StreamException.class.getName() + " expected");
} catch (final StreamException e) {
assertTrue(e.getCause() instanceof IllegalStateException);
}
}
public void testCanWriteAttributesOnlyOnce() {
writer.startNode("junit");
writer.addAttribute("test", "true");
try {
writer.addAttribute("test", "true");
fail("Thrown " + StreamException.class.getName() + " expected");
} catch (final StreamException e) {
assertTrue(e.getCause() instanceof IllegalStateException);
}
writer.endNode();
}
public void testCanWriteValueOnlyToOpenNode() {
try {
writer.setValue("test");
fail("Thrown " + StreamException.class.getName() + " expected");
} catch (final StreamException e) {
assertTrue(e.getCause() instanceof IllegalStateException);
}
writer.startNode("junit");
writer.endNode();
try {
writer.setValue("test");
fail("Thrown " + StreamException.class.getName() + " expected");
} catch (final StreamException e) {
assertTrue(e.getCause() instanceof IllegalStateException);
}
}
public void testCannotOpenNodeInValue() {
writer.startNode("junit");
writer.setValue("test");
try {
writer.startNode("junit");
fail("Thrown " + StreamException.class.getName() + " expected");
} catch (final StreamException e) {
assertTrue(e.getCause() instanceof IllegalStateException);
}
}
public void testCanCloseInFinally() {
try {
writer.endNode();
fail("Thrown " + StreamException.class.getName() + " expected");
} catch (final StreamException e) {
writer.close();
}
}
public void testCannotWriteAfterClose() {
writer.close();
try {
writer.startNode("junit");
fail("Thrown " + StreamException.class.getName() + " expected");
} catch (final StreamException e) {
assertTrue(e.getCause() instanceof IOException);
}
try {
writer.addAttribute("junit", "test");
fail("Thrown " + StreamException.class.getName() + " expected");
} catch (final StreamException e) {
assertTrue(e.getCause() instanceof IOException);
}
try {
writer.setValue("test");
fail("Thrown " + StreamException.class.getName() + " expected");
} catch (final StreamException e) {
assertTrue(e.getCause() instanceof IOException);
}
try {
writer.endNode();
fail("Thrown " + StreamException.class.getName() + " expected");
} catch (final StreamException e) {
assertTrue(e.getCause() instanceof IOException);
}
try {
writer.flush();
fail("Thrown " + StreamException.class.getName() + " expected");
} catch (final StreamException e) {
assertTrue(e.getCause() instanceof IOException);
}
}
public void testCanCloseTwice() {
writer.close();
writer.close();
}
public void testCaresAboutNestingLevelWritingAttributes() {
writer.startNode("junit");
writer.addAttribute("test", "true");
writer.startNode("junit");
writer.addAttribute("test", "true");
writer.endNode();
writer.endNode();
}
}
| {
"content_hash": "966d0cc62362290b4d687950774a1ce2",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 82,
"avg_line_length": 33.234939759036145,
"alnum_prop": 0.5776690230197571,
"repo_name": "jenkinsci/xstream",
"id": "716765f1f1c47563f69a066acda77acfb1721bf5",
"size": "5823",
"binary": false,
"copies": "13",
"ref": "refs/heads/master",
"path": "xstream/src/test/com/thoughtworks/xstream/io/StatefulWriterTest.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "6974"
},
{
"name": "HTML",
"bytes": "406503"
},
{
"name": "Java",
"bytes": "2336570"
},
{
"name": "XSLT",
"bytes": "1101"
}
],
"symlink_target": ""
} |
package mesos
import (
"crypto/tls"
"errors"
"fmt"
"io"
"sort"
"sync"
"time"
log "github.com/Sirupsen/logrus"
"github.com/docker/swarm/cluster"
"github.com/docker/swarm/cluster/mesos/queue"
"github.com/docker/swarm/scheduler"
"github.com/docker/swarm/scheduler/node"
"github.com/docker/swarm/scheduler/strategy"
"github.com/docker/swarm/state"
"github.com/gogo/protobuf/proto"
"github.com/mesos/mesos-go/mesosproto"
mesosscheduler "github.com/mesos/mesos-go/scheduler"
"github.com/samalba/dockerclient"
)
// Cluster struct for mesos
type Cluster struct {
sync.RWMutex
driver *mesosscheduler.MesosSchedulerDriver
dockerEnginePort string
eventHandler cluster.EventHandler
master string
slaves map[string]*slave
scheduler *scheduler.Scheduler
store *state.Store
TLSConfig *tls.Config
options *cluster.DriverOpts
offerTimeout time.Duration
pendingTasks *queue.Queue
}
const (
frameworkName = "swarm"
defaultDockerEnginePort = "2375"
defaultDockerEngineTLSPort = "2376"
defaultOfferTimeout = 10 * time.Minute
taskCreationTimeout = 5 * time.Second
)
var (
errNotSupported = errors.New("not supported with mesos")
)
// NewCluster for mesos Cluster creation
func NewCluster(scheduler *scheduler.Scheduler, store *state.Store, TLSConfig *tls.Config, master string, options cluster.DriverOpts) (cluster.Cluster, error) {
log.WithFields(log.Fields{"name": "mesos"}).Debug("Initializing cluster")
cluster := &Cluster{
dockerEnginePort: defaultDockerEnginePort,
master: master,
slaves: make(map[string]*slave),
scheduler: scheduler,
store: store,
TLSConfig: TLSConfig,
options: &options,
offerTimeout: defaultOfferTimeout,
}
cluster.pendingTasks = queue.NewQueue()
// Empty string is accepted by the scheduler.
user, _ := options.String("mesos.user", "SWARM_MESOS_USER")
driverConfig := mesosscheduler.DriverConfig{
Scheduler: cluster,
Framework: &mesosproto.FrameworkInfo{Name: proto.String(frameworkName), User: &user},
Master: cluster.master,
}
// Changing port for https
if cluster.TLSConfig != nil {
cluster.dockerEnginePort = defaultDockerEngineTLSPort
}
if bindingPort, ok := options.Uint("mesos.port", "SWARM_MESOS_PORT"); ok {
driverConfig.BindingPort = uint16(bindingPort)
}
if bindingAddress, ok := options.IP("mesos.address", "SWARM_MESOS_ADDRESS"); ok {
if bindingAddress == nil {
return nil, fmt.Errorf("invalid address %s", bindingAddress)
}
driverConfig.BindingAddress = bindingAddress
}
if offerTimeout, ok := options.String("mesos.offertimeout", "SWARM_MESOS_OFFER_TIMEOUT"); ok {
d, err := time.ParseDuration(offerTimeout)
if err != nil {
return nil, err
}
cluster.offerTimeout = d
}
driver, err := mesosscheduler.NewMesosSchedulerDriver(driverConfig)
if err != nil {
return nil, err
}
cluster.driver = driver
status, err := driver.Start()
if err != nil {
log.Debugf("Mesos driver started, status/err %v: %v", status, err)
return nil, err
}
log.Debugf("Mesos driver started, status %v", status)
return cluster, nil
}
// RegisterEventHandler registers an event handler.
func (c *Cluster) RegisterEventHandler(h cluster.EventHandler) error {
if c.eventHandler != nil {
return errors.New("event handler already set")
}
c.eventHandler = h
return nil
}
// CreateContainer for container creation in Mesos task
func (c *Cluster) CreateContainer(config *cluster.ContainerConfig, name string) (*cluster.Container, error) {
task, err := newTask(c, config, name)
if err != nil {
return nil, err
}
go c.pendingTasks.Add(task)
select {
case container := <-task.container:
return formatContainer(container), nil
case err := <-task.error:
return nil, err
case <-time.After(taskCreationTimeout):
c.pendingTasks.Remove(task)
return nil, strategy.ErrNoResourcesAvailable
}
}
// RemoveContainer to remove containers on mesos cluster
func (c *Cluster) RemoveContainer(container *cluster.Container, force bool) error {
c.scheduler.Lock()
defer c.scheduler.Unlock()
return container.Engine.RemoveContainer(container, force)
}
// Images returns all the images in the cluster.
func (c *Cluster) Images() []*cluster.Image {
c.RLock()
defer c.RUnlock()
out := []*cluster.Image{}
for _, s := range c.slaves {
out = append(out, s.engine.Images()...)
}
return out
}
// Image returns an image with IdOrName in the cluster
func (c *Cluster) Image(IDOrName string) *cluster.Image {
// Abort immediately if the name is empty.
if len(IDOrName) == 0 {
return nil
}
c.RLock()
defer c.RUnlock()
for _, s := range c.slaves {
if image := s.engine.Image(IDOrName); image != nil {
return image
}
}
return nil
}
// RemoveImages removes images from the cluster
func (c *Cluster) RemoveImages(name string) ([]*dockerclient.ImageDelete, error) {
return nil, errNotSupported
}
func formatContainer(container *cluster.Container) *cluster.Container {
if container == nil {
return nil
}
if name := container.Config.Labels[cluster.SwarmLabelNamespace+".mesos.name"]; name != "" && container.Names[0] != "/"+name {
container.Names = append([]string{"/" + name}, container.Names...)
}
return container
}
// Containers returns all the containers in the cluster.
func (c *Cluster) Containers() cluster.Containers {
c.RLock()
defer c.RUnlock()
out := cluster.Containers{}
for _, s := range c.slaves {
for _, container := range s.engine.Containers() {
out = append(out, formatContainer(container))
}
}
return out
}
// Container returns the container with IdOrName in the cluster
func (c *Cluster) Container(IDOrName string) *cluster.Container {
// Abort immediately if the name is empty.
if len(IDOrName) == 0 {
return nil
}
c.RLock()
defer c.RUnlock()
return formatContainer(cluster.Containers(c.Containers()).Get(IDOrName))
}
// RemoveImage removes an image from the cluster
func (c *Cluster) RemoveImage(image *cluster.Image) ([]*dockerclient.ImageDelete, error) {
return nil, errNotSupported
}
// Pull will pull images on the cluster nodes
func (c *Cluster) Pull(name string, authConfig *dockerclient.AuthConfig, callback func(what, status string)) {
}
// Load images
func (c *Cluster) Load(imageReader io.Reader, callback func(what, status string)) {
}
// Import image
func (c *Cluster) Import(source string, repository string, tag string, imageReader io.Reader, callback func(what, status string)) {
}
// RenameContainer Rename a container
func (c *Cluster) RenameContainer(container *cluster.Container, newName string) error {
//FIXME this doesn't work as the next refreshcontainer will erase this change (this change is in-memory only)
container.Config.Labels[cluster.SwarmLabelNamespace+".mesos.name"] = newName
return nil
}
func scalarResourceValue(offers map[string]*mesosproto.Offer, name string) float64 {
var value float64
for _, offer := range offers {
for _, resource := range offer.Resources {
if *resource.Name == name {
value += *resource.Scalar.Value
}
}
}
return value
}
// listNodes returns all the nodess in the cluster.
func (c *Cluster) listNodes() []*node.Node {
c.RLock()
defer c.RUnlock()
out := []*node.Node{}
for _, s := range c.slaves {
n := node.NewNode(s.engine)
n.ID = s.id
n.TotalCpus = int64(scalarResourceValue(s.offers, "cpus"))
n.UsedCpus = 0
n.TotalMemory = int64(scalarResourceValue(s.offers, "mem")) * 1024 * 1024
n.UsedMemory = 0
out = append(out, n)
}
return out
}
func (c *Cluster) listOffers() []*mesosproto.Offer {
c.RLock()
defer c.RUnlock()
list := []*mesosproto.Offer{}
for _, s := range c.slaves {
for _, offer := range s.offers {
list = append(list, offer)
}
}
return list
}
// Info gives minimal information about containers and resources on the mesos cluster
func (c *Cluster) Info() [][2]string {
offers := c.listOffers()
info := [][2]string{
{"\bStrategy", c.scheduler.Strategy()},
{"\bFilters", c.scheduler.Filters()},
{"\bOffers", fmt.Sprintf("%d", len(offers))},
}
sort.Sort(offerSorter(offers))
for _, offer := range offers {
info = append(info, [2]string{" Offer", offer.Id.GetValue()})
for _, resource := range offer.Resources {
info = append(info, [2]string{" └ " + *resource.Name, fmt.Sprintf("%v", resource)})
}
}
return info
}
func (c *Cluster) addOffer(offer *mesosproto.Offer) {
s, ok := c.slaves[offer.SlaveId.GetValue()]
if !ok {
return
}
s.addOffer(offer)
go func(offer *mesosproto.Offer) {
time.Sleep(c.offerTimeout)
// declining Mesos offers to make them available to other Mesos services
if c.removeOffer(offer) {
if _, err := c.driver.DeclineOffer(offer.Id, &mesosproto.Filters{}); err != nil {
log.WithFields(log.Fields{"name": "mesos"}).Errorf("Error while declining offer %q: %v", offer.Id.GetValue(), err)
} else {
log.WithFields(log.Fields{"name": "mesos"}).Debugf("Offer %q declined successfully", offer.Id.GetValue())
}
}
}(offer)
}
func (c *Cluster) removeOffer(offer *mesosproto.Offer) bool {
log.WithFields(log.Fields{"name": "mesos", "offerID": offer.Id.String()}).Debug("Removing offer")
s, ok := c.slaves[offer.SlaveId.GetValue()]
if !ok {
return false
}
found := s.removeOffer(offer.Id.GetValue())
if s.empty() {
// Disconnect from engine
delete(c.slaves, offer.SlaveId.GetValue())
}
return found
}
func (c *Cluster) scheduleTask(t *task) bool {
c.scheduler.Lock()
defer c.scheduler.Unlock()
n, err := c.scheduler.SelectNodeForContainer(c.listNodes(), t.config)
if err != nil {
return false
}
s, ok := c.slaves[n.ID]
if !ok {
t.error <- fmt.Errorf("Unable to create on slave %q", n.ID)
return true
}
// build the offer from it's internal config and set the slaveID
t.build(n.ID)
c.Lock()
// TODO: Only use the offer we need
offerIDs := []*mesosproto.OfferID{}
for _, offer := range c.slaves[n.ID].offers {
offerIDs = append(offerIDs, offer.Id)
}
if _, err := c.driver.LaunchTasks(offerIDs, []*mesosproto.TaskInfo{&t.TaskInfo}, &mesosproto.Filters{}); err != nil {
// TODO: Do not erase all the offers, only the one used
for _, offer := range s.offers {
c.removeOffer(offer)
}
s.Unlock()
t.error <- err
return true
}
s.addTask(t)
// TODO: Do not erase all the offers, only the one used
for _, offer := range s.offers {
c.removeOffer(offer)
}
c.Unlock()
// block until we get the container
finished, err := t.monitor()
taskID := t.TaskInfo.TaskId.GetValue()
if err != nil {
//remove task
s.removeTask(taskID)
t.error <- err
return true
}
if !finished {
go func() {
for {
finished, err := t.monitor()
if err != nil {
// TODO do a better log by sending proper error message
log.Error(err)
break
}
if finished {
break
}
}
//remove the task once it's finished
}()
}
// Register the container immediately while waiting for a state refresh.
// Force a state refresh to pick up the newly created container.
// FIXME: unexport this method, see FIXME in engine.go
s.engine.RefreshContainers(true)
// TODO: We have to return the right container that was just created.
// Once we receive the ContainerID from the executor.
for _, container := range s.engine.Containers() {
if container.Config.Labels[cluster.SwarmLabelNamespace+".mesos.task"] == taskID {
t.container <- container
return true
}
// TODO save in store
}
t.error <- fmt.Errorf("Container failed to create")
return true
}
// RANDOMENGINE returns a random engine.
func (c *Cluster) RANDOMENGINE() (*cluster.Engine, error) {
c.RLock()
defer c.RUnlock()
n, err := c.scheduler.SelectNodeForContainer(c.listNodes(), &cluster.ContainerConfig{})
if err != nil {
return nil, err
}
if n != nil {
return c.slaves[n.ID].engine, nil
}
return nil, nil
}
| {
"content_hash": "919958930c6d21403e92ee1e490cd431",
"timestamp": "",
"source": "github",
"line_count": 457,
"max_line_length": 160,
"avg_line_length": 26.12691466083151,
"alnum_prop": 0.6887772194304858,
"repo_name": "abronan/swarm",
"id": "2a0a9d0da52bfeee9c000c693101f4196dae8d20",
"size": "11942",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "cluster/mesos/cluster.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "299694"
},
{
"name": "Makefile",
"bytes": "589"
},
{
"name": "Shell",
"bytes": "69700"
}
],
"symlink_target": ""
} |
(function() {
var app = angular.module('weather', []);
app.controller('WeatherController', ['$http', function($http) {
var weather = this;
weather.forecast = 'Looking out the window...';
$http.get('/weather').then(function(res) {
weather.morning = res.data.morning;
weather.low = res.data.low;
weather.high = res.data.high;
weather.description = res.data.description;
});
}]);
})();
| {
"content_hash": "c2c7a66b81f7af4e21ffe45e6a42c3b6",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 65,
"avg_line_length": 28.733333333333334,
"alnum_prop": 0.6102088167053364,
"repo_name": "nhashmi/top-of-the-morning",
"id": "7a8f45f5eb9ee2855a68d8f9593cb2b670652f58",
"size": "431",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/app/components/weather/weather.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1740"
},
{
"name": "HTML",
"bytes": "4312"
},
{
"name": "JavaScript",
"bytes": "9530"
}
],
"symlink_target": ""
} |
/* eslint-env jest */
const { query } = require('../lib');
const {
seedDatabase,
dropDatabase,
generateDatabaseName,
ConnectionFactory,
} = require('./setup-database');
describe('queryExplain()', () => {
const database = generateDatabaseName();
let conn;
beforeAll(seedDatabase(database));
afterAll(dropDatabase(database));
beforeEach(() => {
conn = ConnectionFactory();
});
it('A response with the query plan should not be empty', () =>
query
.explain(conn, database, 'select ?s where { ?s ?p ?o } limit 10')
.then(({ body }) => {
expect(body).toContain('Slice(offset=0, limit=10)');
expect(body).toContain('Projection(?s)');
expect(body).toContain('Scan');
}));
});
| {
"content_hash": "c6ceece7a095ea461cc90b34ca428356",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 71,
"avg_line_length": 24.833333333333332,
"alnum_prop": 0.610738255033557,
"repo_name": "Complexible/stardog.js",
"id": "82b740e51d8258ba919b41b7c6d9c29f7e35e1b3",
"size": "745",
"binary": false,
"copies": "1",
"ref": "refs/heads/v2",
"path": "test/explain.spec.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "480"
},
{
"name": "HTML",
"bytes": "3868"
},
{
"name": "JavaScript",
"bytes": "210953"
},
{
"name": "Shell",
"bytes": "424"
}
],
"symlink_target": ""
} |
module DateTimeHelper
# Format the time by time ago
def timeago time, options = {}
options[:title] = options[:title] == false ? nil : l(time)
options[:datetime] = time.to_s
content_tag(:abbr, "#{time_ago_in_words(time).capitalize} ago", options) if time
end
# Facny date
def fancy_date date
date.strftime('%m/%d/%Y at %I:%M %p') if date.present?
end
# Full and fancy date
def full_date date
date.strftime('%b %-d, %Y at %I:%M %p') if date.present?
end
end
| {
"content_hash": "6fd6af60241af341989d4021bf7e7140",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 84,
"avg_line_length": 24.9,
"alnum_prop": 0.6305220883534136,
"repo_name": "johnkoht/frontie",
"id": "4b6dc4efed642694c82f405dd7851812107acb5c",
"size": "498",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/helpers/date_time_helper.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "8164"
}
],
"symlink_target": ""
} |
package io.requery.proxy;
import io.requery.meta.Attribute;
import io.requery.meta.Type;
import io.requery.util.function.Supplier;
/**
* Proxies a builder class that has attributes that can be set yielding a final constructed entity
* using {@link #build()}.
*
* @param <B> type of the builder
* @param <E> type of entity being constructed
*
* @author Nikhil Purushe
*/
@SuppressWarnings("unchecked") // builder class is purposefully not stored in Type
public class EntityBuilderProxy<B, E> implements Settable<E> {
private final Type<E> type;
private final B builder;
public EntityBuilderProxy(Type<E> type) {
Supplier<B> supplier = type.getBuilderFactory();
this.builder = supplier.get();
this.type = type;
}
@Override
public <V> void set(Attribute<E, V> attribute, V value) {
set(attribute, value, PropertyState.LOADED);
}
@Override
public <V> void set(Attribute<E, V> attribute, V value, PropertyState state) {
setObject(attribute, value, state);
}
@Override
public void setObject(Attribute<E, ?> attribute, Object value, PropertyState state) {
Property<B, Object> property = (Property<B, Object>) attribute.getBuilderProperty();
property.set(builder, value);
}
@Override
public void setBoolean(Attribute<E, Boolean> attribute, boolean value, PropertyState state) {
BooleanProperty<B> property = (BooleanProperty<B>) attribute.getBuilderProperty();
property.setBoolean(builder, value);
}
@Override
public void setDouble(Attribute<E, Double> attribute, double value, PropertyState state) {
DoubleProperty<B> property = (DoubleProperty<B>) attribute.getBuilderProperty();
property.setDouble(builder, value);
}
@Override
public void setFloat(Attribute<E, Float> attribute, float value, PropertyState state) {
FloatProperty<B> property = (FloatProperty<B>) attribute.getBuilderProperty();
property.setFloat(builder, value);
}
@Override
public void setByte(Attribute<E, Byte> attribute, byte value, PropertyState state) {
ByteProperty<B> property = (ByteProperty<B>) attribute.getBuilderProperty();
property.setByte(builder, value);
}
@Override
public void setShort(Attribute<E, Short> attribute, short value, PropertyState state) {
ShortProperty<B> property = (ShortProperty<B>) attribute.getBuilderProperty();
property.setShort(builder, value);
}
@Override
public void setInt(Attribute<E, Integer> attribute, int value, PropertyState state) {
IntProperty<B> property = (IntProperty<B>) attribute.getBuilderProperty();
property.setInt(builder, value);
}
@Override
public void setLong(Attribute<E, Long> attribute, long value, PropertyState state) {
LongProperty<B> property = (LongProperty<B>) attribute.getBuilderProperty();
property.setLong(builder, value);
}
public E build() {
return type.getBuildFunction().apply(builder);
}
}
| {
"content_hash": "94318e97369a18eef37b3e4f32ac4678",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 98,
"avg_line_length": 33.81318681318681,
"alnum_prop": 0.6857328566785831,
"repo_name": "sakuna63/requery",
"id": "2223fc59d0f66a24d11adf54230bd8360e7e5fb8",
"size": "3670",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "requery/src/main/java/io/requery/proxy/EntityBuilderProxy.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1519898"
},
{
"name": "Kotlin",
"bytes": "63662"
}
],
"symlink_target": ""
} |
#include "gtest/gtest.h"
#include <fcntl.h>
#include "native_client/src/include/nacl_compiler_annotations.h"
#include "native_client/src/shared/platform/nacl_host_desc.h"
#include "native_client/src/shared/platform/nacl_log.h"
#include "native_client/src/shared/utils/types.h"
#include "native_client/src/trusted/desc/nacl_desc_io.h"
#include "native_client/src/trusted/validator/ncvalidate.h"
#include "native_client/src/trusted/validator/validation_cache.h"
#include "native_client/src/trusted/validator/validation_cache_internal.h"
#include "native_client/src/trusted/cpu_features/arch/x86/cpu_x86.h"
#include "native_client/src/trusted/service_runtime/include/sys/fcntl.h"
#include "native_client/src/trusted/validator/rich_file_info.h"
#include "native_client/src/trusted/validator/validation_metadata.h"
#define CONTEXT_MARKER 31
#define QUERY_MARKER 37
#define CODE_SIZE 32
// ret
const char ret[CODE_SIZE + 1] =
"\xc3\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90";
// pblendw $0xc0,%xmm0,%xmm2
const char sse41[CODE_SIZE + 1] =
"\x66\x0f\x3a\x0e\xd0\xc0\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90";
struct MockContext {
int marker; /* Sanity check that we're getting the right object. */
int query_result;
int add_count_expected;
bool set_validates_expected;
bool query_destroyed;
};
enum MockQueryState {
QUERY_CREATED,
QUERY_GET_CALLED,
QUERY_SET_CALLED,
QUERY_DESTROYED
};
struct MockQuery {
/* Sanity check that we're getting the right object. */
int marker;
MockQueryState state;
int add_count;
MockContext *context;
};
void *MockCreateQuery(void *handle) {
MockContext *mcontext = (MockContext *) handle;
MockQuery *mquery = (MockQuery *) malloc(sizeof(MockQuery));
EXPECT_EQ(CONTEXT_MARKER, mcontext->marker);
mquery->marker = QUERY_MARKER;
mquery->state = QUERY_CREATED;
mquery->add_count = 0;
mquery->context = mcontext;
return mquery;
}
void MockAddData(void *query, const unsigned char *data, size_t length) {
UNREFERENCED_PARAMETER(data);
MockQuery *mquery = (MockQuery *) query;
ASSERT_EQ(QUERY_MARKER, mquery->marker);
EXPECT_EQ(QUERY_CREATED, mquery->state);
/* Small data is suspicious. */
EXPECT_LE((size_t) 2, length);
mquery->add_count += 1;
}
int MockQueryCodeValidates(void *query) {
MockQuery *mquery = (MockQuery *) query;
EXPECT_EQ(QUERY_MARKER, mquery->marker);
EXPECT_EQ(QUERY_CREATED, mquery->state);
EXPECT_EQ(mquery->context->add_count_expected, mquery->add_count);
mquery->state = QUERY_GET_CALLED;
return mquery->context->query_result;
}
void MockSetCodeValidates(void *query) {
MockQuery *mquery = (MockQuery *) query;
ASSERT_EQ(QUERY_MARKER, mquery->marker);
EXPECT_EQ(QUERY_GET_CALLED, mquery->state);
EXPECT_EQ(true, mquery->context->set_validates_expected);
mquery->state = QUERY_SET_CALLED;
}
void MockDestroyQuery(void *query) {
MockQuery *mquery = (MockQuery *) query;
ASSERT_EQ(QUERY_MARKER, mquery->marker);
if (mquery->context->set_validates_expected) {
EXPECT_EQ(QUERY_SET_CALLED, mquery->state);
} else {
EXPECT_EQ(QUERY_GET_CALLED, mquery->state);
}
mquery->state = QUERY_DESTROYED;
mquery->context->query_destroyed = true;
free(mquery);
}
/* Hint that the validation should use the (fake) cache. */
int MockCachingIsInexpensive(const struct NaClValidationMetadata *metadata) {
UNREFERENCED_PARAMETER(metadata);
return 1;
}
class ValidationCachingInterfaceTests : public ::testing::Test {
protected:
MockContext context;
NaClValidationMetadata *metadata_ptr;
NaClValidationCache cache;
const struct NaClValidatorInterface *validator;
NaClCPUFeatures *cpu_features;
unsigned char code_buffer[CODE_SIZE];
void SetUp() {
context.marker = CONTEXT_MARKER;
context.query_result = 1;
context.add_count_expected = 4;
context.set_validates_expected = false;
context.query_destroyed = false;
metadata_ptr = NULL;
cache.handle = &context;
cache.CreateQuery = MockCreateQuery;
cache.AddData = MockAddData;
cache.QueryKnownToValidate = MockQueryCodeValidates;
cache.SetKnownToValidate = MockSetCodeValidates;
cache.DestroyQuery = MockDestroyQuery;
cache.CachingIsInexpensive = MockCachingIsInexpensive;
validator = NaClCreateValidator();
cpu_features = (NaClCPUFeatures *) malloc(validator->CPUFeatureSize);
EXPECT_NE(cpu_features, (NaClCPUFeatures *) NULL);
validator->SetAllCPUFeatures(cpu_features);
memset(code_buffer, 0x90, sizeof(code_buffer));
}
NaClValidationStatus Validate() {
return validator->Validate(0, code_buffer, 32,
FALSE, /* stubout_mode */
FALSE, /* readonly_test */
cpu_features,
metadata_ptr,
&cache);
}
void TearDown() {
free(cpu_features);
}
};
TEST_F(ValidationCachingInterfaceTests, Sanity) {
void *query = cache.CreateQuery(cache.handle);
context.add_count_expected = 2;
cache.AddData(query, NULL, 6);
cache.AddData(query, NULL, 128);
EXPECT_EQ(1, cache.QueryKnownToValidate(query));
cache.DestroyQuery(query);
EXPECT_EQ(true, context.query_destroyed);
}
TEST_F(ValidationCachingInterfaceTests, NoCache) {
const struct NaClValidatorInterface *validator = NaClCreateValidator();
NaClValidationStatus status = validator->Validate(
0, code_buffer, CODE_SIZE,
FALSE, /* stubout_mode */
FALSE, /* readonly_test */
cpu_features,
NULL, /* metadata */
NULL);
EXPECT_EQ(NaClValidationSucceeded, status);
}
TEST_F(ValidationCachingInterfaceTests, CacheHit) {
NaClValidationStatus status = Validate();
EXPECT_EQ(NaClValidationSucceeded, status);
EXPECT_EQ(true, context.query_destroyed);
}
TEST_F(ValidationCachingInterfaceTests, CacheMiss) {
context.query_result = 0;
context.set_validates_expected = true;
NaClValidationStatus status = Validate();
EXPECT_EQ(NaClValidationSucceeded, status);
EXPECT_EQ(true, context.query_destroyed);
}
TEST_F(ValidationCachingInterfaceTests, SSE4Allowed) {
memcpy(code_buffer, sse41, CODE_SIZE);
context.query_result = 0;
context.set_validates_expected = true;
NaClValidationStatus status = Validate();
EXPECT_EQ(NaClValidationSucceeded, status);
EXPECT_EQ(true, context.query_destroyed);
}
TEST_F(ValidationCachingInterfaceTests, SSE4Stubout) {
memcpy(code_buffer, sse41, CODE_SIZE);
context.query_result = 0;
/* TODO(jfb) Use a safe cast here, this test should only run for x86. */
NaClSetCPUFeatureX86((NaClCPUFeaturesX86 *) cpu_features,
NaClCPUFeatureX86_SSE41, 0);
NaClValidationStatus status = Validate();
EXPECT_EQ(NaClValidationSucceeded, status);
EXPECT_EQ(true, context.query_destroyed);
}
TEST_F(ValidationCachingInterfaceTests, IllegalInst) {
memcpy(code_buffer, ret, CODE_SIZE);
context.query_result = 0;
NaClValidationStatus status = Validate();
EXPECT_EQ(NaClValidationFailed, status);
EXPECT_EQ(true, context.query_destroyed);
}
TEST_F(ValidationCachingInterfaceTests, IllegalCacheHit) {
memcpy(code_buffer, ret, CODE_SIZE);
NaClValidationStatus status = Validate();
// Success proves the cache shortcircuted validation.
EXPECT_EQ(NaClValidationSucceeded, status);
EXPECT_EQ(true, context.query_destroyed);
}
TEST_F(ValidationCachingInterfaceTests, Metadata) {
NaClValidationMetadata metadata;
memset(&metadata, 0, sizeof(metadata));
metadata.identity_type = NaClCodeIdentityFile;
metadata.file_name = (char *) "foobar";
metadata.file_name_length = strlen(metadata.file_name);
metadata.file_size = CODE_SIZE;
metadata.mtime = 100;
metadata_ptr = &metadata;
context.add_count_expected = 12;
NaClValidationStatus status = Validate();
EXPECT_EQ(NaClValidationSucceeded, status);
EXPECT_EQ(true, context.query_destroyed);
}
class ValidationCachingSerializationTests : public ::testing::Test {
protected:
struct NaClRichFileInfo info;
uint8_t *buffer;
uint32_t buffer_length;
struct NaClRichFileInfo inp;
struct NaClRichFileInfo outp;
void SetUp() {
buffer = 0;
buffer_length = 0;
NaClRichFileInfoCtor(&inp);
NaClRichFileInfoCtor(&outp);
}
void TearDown() {
free(buffer);
// Don't free the inp structure, it does not contain malloced memory.
NaClRichFileInfoDtor(&outp);
}
};
TEST_F(ValidationCachingSerializationTests, NormalOperationSimple) {
inp.known_file = 0;
inp.file_path = "foo";
inp.file_path_length = 3;
EXPECT_EQ(0, NaClSerializeNaClDescMetadata(&inp, &buffer, &buffer_length));
EXPECT_EQ(0, NaClDeserializeNaClDescMetadata(buffer, buffer_length, &outp));
EXPECT_EQ((uint8_t) 0, outp.known_file);
EXPECT_EQ((uint32_t) 0, outp.file_path_length);
EXPECT_EQ(NULL, outp.file_path);
}
TEST_F(ValidationCachingSerializationTests, NormalOperationFull) {
inp.known_file = 1;
inp.file_path = "foo";
inp.file_path_length = 3;
EXPECT_EQ(0, NaClSerializeNaClDescMetadata(&inp, &buffer, &buffer_length));
EXPECT_EQ(0, NaClDeserializeNaClDescMetadata(buffer, buffer_length, &outp));
EXPECT_EQ((uint8_t) 1, outp.known_file);
EXPECT_EQ((uint32_t) 3, outp.file_path_length);
EXPECT_EQ(0, memcmp("foo", outp.file_path, outp.file_path_length));
}
TEST_F(ValidationCachingSerializationTests, BadSizeSimple) {
inp.known_file = 0;
EXPECT_EQ(0, NaClSerializeNaClDescMetadata(&inp, &buffer, &buffer_length));
for (uint32_t i = -1; i <= buffer_length + 4; i++) {
/* The only case that is OK. */
if (i == buffer_length)
continue;
/* Wrong number of bytes, fail. */
EXPECT_EQ(1, NaClDeserializeNaClDescMetadata(buffer, i, &outp));
}
}
TEST_F(ValidationCachingSerializationTests, BadSizeFull) {
inp.known_file = 1;
inp.file_path = "foo";
inp.file_path_length = 3;
EXPECT_EQ(0, NaClSerializeNaClDescMetadata(&inp, &buffer, &buffer_length));
for (uint32_t i = -1; i <= buffer_length + 4; i++) {
/* The only case that is OK. */
if (i == buffer_length)
continue;
/* Wrong number of bytes, fail. */
EXPECT_EQ(1, NaClDeserializeNaClDescMetadata(buffer, i, &outp));
/* Paranoia. */
EXPECT_EQ(0, outp.known_file);
/* Make sure we don't leak on failure. */
EXPECT_EQ(NULL, outp.file_path);
}
}
static char *AN_ARBITRARY_FILE_PATH = NULL;
class ValidationCachingFileOriginTests : public ::testing::Test {
protected:
struct NaClDesc *desc;
struct NaClRichFileInfo inp;
struct NaClRichFileInfo outp;
void SetUp() {
struct NaClHostDesc *host_desc = NULL;
int fd = open(AN_ARBITRARY_FILE_PATH, O_RDONLY);
desc = NULL;
NaClRichFileInfoCtor(&inp);
NaClRichFileInfoCtor(&outp);
ASSERT_NE(-1, fd);
host_desc = NaClHostDescPosixMake(fd, NACL_ABI_O_RDONLY);
desc = (struct NaClDesc *) NaClDescIoDescMake(host_desc);
ASSERT_NE((struct NaClDesc *) NULL, desc);
}
void TearDown() {
// Don't free the inp structure, it does not contain malloced memory.
NaClRichFileInfoDtor(&outp);
NaClDescSafeUnref(desc);
}
};
TEST_F(ValidationCachingFileOriginTests, None) {
EXPECT_EQ(1, NaClGetFileOriginInfo(desc, &outp));
}
TEST_F(ValidationCachingFileOriginTests, Simple) {
inp.known_file = 0;
inp.file_path = "foobar";
inp.file_path_length = 6;
EXPECT_EQ(0, NaClSetFileOriginInfo(desc, &inp));
EXPECT_EQ(0, NaClGetFileOriginInfo(desc, &outp));
EXPECT_EQ(0, outp.known_file);
EXPECT_EQ((uint32_t) 0, outp.file_path_length);
EXPECT_EQ(NULL, outp.file_path);
}
TEST_F(ValidationCachingFileOriginTests, Full) {
inp.known_file = 1;
inp.file_path = "foobar";
inp.file_path_length = 6;
EXPECT_EQ(0, NaClSetFileOriginInfo(desc, &inp));
EXPECT_EQ(0, NaClGetFileOriginInfo(desc, &outp));
EXPECT_EQ(1, outp.known_file);
EXPECT_EQ((uint32_t) 6, outp.file_path_length);
EXPECT_EQ(0, memcmp("foobar", outp.file_path, outp.file_path_length));
}
// Test driver function.
int main(int argc, char *argv[]) {
// One file we know must exist is this executable.
AN_ARBITRARY_FILE_PATH = argv[0];
// The IllegalInst test touches the log mutex deep inside the validator.
// This causes an SEH exception to be thrown on Windows if the mutex is not
// initialized.
// http://code.google.com/p/nativeclient/issues/detail?id=1696
NaClLogModuleInit();
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
| {
"content_hash": "cc12715bca645e53906c87697d29e9ba",
"timestamp": "",
"source": "github",
"line_count": 400,
"max_line_length": 78,
"avg_line_length": 31.435,
"alnum_prop": 0.7074916494353428,
"repo_name": "wilsonianb/nacl_contracts",
"id": "106fa7a6d6323e7a21b61ec03dc3b858ac3b2b1e",
"size": "12754",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/trusted/validator/validation_cache_test.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "185904"
},
{
"name": "C",
"bytes": "11294883"
},
{
"name": "C++",
"bytes": "7471565"
},
{
"name": "JavaScript",
"bytes": "5925"
},
{
"name": "Objective-C",
"bytes": "51655"
},
{
"name": "Objective-C++",
"bytes": "2658"
},
{
"name": "Python",
"bytes": "2134563"
},
{
"name": "Ragel in Ruby Host",
"bytes": "104506"
},
{
"name": "Shell",
"bytes": "277298"
}
],
"symlink_target": ""
} |
module CdmMigrator
class Engine < ::Rails::Engine
initializer :append_migrations do |app|
unless app.root.to_s.match root.to_s
config.paths["db/migrate"].expanded.each do |expanded_path|
app.config.paths["db/migrate"] << expanded_path
end
end
end
#isolate_namespace CdmMigrator
class << self
def config
file = File.open(File.join(::Rails.root, "/config/cdm_migrator.yml"))
@config ||= YAML.safe_load(file)
end
# loads a yml file with the configuration options
#
# @param file [String] path to the yml file
#
def load_config(file)
@config = YAML.load_file(file)
end
end
end
end
| {
"content_hash": "0a59e9d224f0d208126f9bdedd926cb3",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 80,
"avg_line_length": 24.75862068965517,
"alnum_prop": 0.5988857938718662,
"repo_name": "UVicLibrary/cdm_migrator",
"id": "7082f20835320b25f00ea5197e0700e6de77f4f4",
"size": "718",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/cdm_migrator/engine.rb",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1371"
},
{
"name": "HTML",
"bytes": "11329"
},
{
"name": "JavaScript",
"bytes": "780"
},
{
"name": "Ruby",
"bytes": "53697"
}
],
"symlink_target": ""
} |
"use strict";
ace.define("ace/snippets/vhdl", ["require", "exports", "module"], function (require, exports, module) {
"use strict";
exports.snippetText = undefined;
exports.scope = "vhdl";
}); | {
"content_hash": "63324adfa21e6824c291dc8b195f80d6",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 103,
"avg_line_length": 25,
"alnum_prop": 0.665,
"repo_name": "IonicaBizau/arc-assembler",
"id": "87e0298801816a04850df8d97948a6795f366f84",
"size": "200",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clients/ace-builds/src-noconflict/snippets/vhdl.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "346"
},
{
"name": "CSS",
"bytes": "459098"
},
{
"name": "HTML",
"bytes": "236653"
},
{
"name": "JavaScript",
"bytes": "865404"
},
{
"name": "Shell",
"bytes": "1142"
}
],
"symlink_target": ""
} |
require 'rack/protection'
require 'securerandom'
require 'openssl'
require 'base64'
module Rack
module Protection
##
# Prevented attack:: CSRF
# Supported browsers:: all
# More infos:: http://en.wikipedia.org/wiki/Cross-site_request_forgery
#
# This middleware only accepts requests other than <tt>GET</tt>,
# <tt>HEAD</tt>, <tt>OPTIONS</tt>, <tt>TRACE</tt> if their given access
# token matches the token included in the session.
#
# It checks the <tt>X-CSRF-Token</tt> header and the <tt>POST</tt> form
# data.
#
# Compatible with the {rack-csrf}[https://rubygems.org/gems/rack_csrf] gem.
#
# == Options
#
# [<tt>:authenticity_param</tt>] the name of the param that should contain
# the token on a request. Default value:
# <tt>"authenticity_token"</tt>
#
# [<tt>:key</tt>] the name of the param that should contain
# the token in the session. Default value:
# <tt>:csrf</tt>
#
# [<tt>:allow_if</tt>] a proc for custom allow/deny logic. Default value:
# <tt>nil</tt>
#
# == Example: Forms application
#
# To show what the AuthenticityToken does, this section includes a sample
# program which shows two forms. One with, and one without a CSRF token
# The one without CSRF token field will get a 403 Forbidden response.
#
# Install the gem, then run the program:
#
# gem install 'rack-protection'
# ruby server.rb
#
# Here is <tt>server.rb</tt>:
#
# require 'rack/protection'
#
# app = Rack::Builder.app do
# use Rack::Session::Cookie, secret: 'secret'
# use Rack::Protection::AuthenticityToken
#
# run -> (env) do
# [200, {}, [
# <<~EOS
# <!DOCTYPE html>
# <html lang="en">
# <head>
# <meta charset="UTF-8" />
# <title>rack-protection minimal example</title>
# </head>
# <body>
# <h1>Without Authenticity Token</h1>
# <p>This takes you to <tt>Forbidden</tt></p>
# <form action="" method="post">
# <input type="text" name="foo" />
# <input type="submit" />
# </form>
#
# <h1>With Authenticity Token</h1>
# <p>This successfully takes you to back to this form.</p>
# <form action="" method="post">
# <input type="hidden" name="authenticity_token" value="#{Rack::Protection::AuthenticityToken.token(env['rack.session'])}" />
# <input type="text" name="foo" />
# <input type="submit" />
# </form>
# </body>
# </html>
# EOS
# ]]
# end
# end
#
# Rack::Handler::WEBrick.run app
#
# == Example: Customize which POST parameter holds the token
#
# To customize the authenticity parameter for form data, use the
# <tt>:authenticity_param</tt> option:
# use Rack::Protection::AuthenticityToken, authenticity_param: 'your_token_param_name'
class AuthenticityToken < Base
TOKEN_LENGTH = 32
default_options :authenticity_param => 'authenticity_token',
:key => :csrf,
:allow_if => nil
def self.token(session, path: nil, method: :post)
self.new(nil).mask_authenticity_token(session, path: path, method: method)
end
def self.random_token
SecureRandom.urlsafe_base64(TOKEN_LENGTH, padding: false)
end
def accepts?(env)
session = session(env)
set_token(session)
safe?(env) ||
valid_token?(env, env['HTTP_X_CSRF_TOKEN']) ||
valid_token?(env, Request.new(env).params[options[:authenticity_param]]) ||
( options[:allow_if] && options[:allow_if].call(env) )
end
def mask_authenticity_token(session, path: nil, method: :post)
set_token(session)
token = if path && method
per_form_token(session, path, method)
else
global_token(session)
end
mask_token(token)
end
GLOBAL_TOKEN_IDENTIFIER = '!real_csrf_token'
private_constant :GLOBAL_TOKEN_IDENTIFIER
private
def set_token(session)
session[options[:key]] ||= self.class.random_token
end
# Checks the client's masked token to see if it matches the
# session token.
def valid_token?(env, token)
return false if token.nil? || token.empty?
session = session(env)
begin
token = decode_token(token)
rescue ArgumentError # encoded_masked_token is invalid Base64
return false
end
# See if it's actually a masked token or not. We should be able
# to handle any unmasked tokens that we've issued without error.
if unmasked_token?(token)
compare_with_real_token(token, session)
elsif masked_token?(token)
token = unmask_token(token)
compare_with_global_token(token, session) ||
compare_with_real_token(token, session) ||
compare_with_per_form_token(token, session, Request.new(env))
else
false # Token is malformed
end
end
# Creates a masked version of the authenticity token that varies
# on each request. The masking is used to mitigate SSL attacks
# like BREACH.
def mask_token(token)
one_time_pad = SecureRandom.random_bytes(token.length)
encrypted_token = xor_byte_strings(one_time_pad, token)
masked_token = one_time_pad + encrypted_token
encode_token(masked_token)
end
# Essentially the inverse of +mask_token+.
def unmask_token(masked_token)
# Split the token into the one-time pad and the encrypted
# value and decrypt it
token_length = masked_token.length / 2
one_time_pad = masked_token[0...token_length]
encrypted_token = masked_token[token_length..-1]
xor_byte_strings(one_time_pad, encrypted_token)
end
def unmasked_token?(token)
token.length == TOKEN_LENGTH
end
def masked_token?(token)
token.length == TOKEN_LENGTH * 2
end
def compare_with_real_token(token, session)
secure_compare(token, real_token(session))
end
def compare_with_global_token(token, session)
secure_compare(token, global_token(session))
end
def compare_with_per_form_token(token, session, request)
secure_compare(token,
per_form_token(session, request.path.chomp('/'), request.request_method)
)
end
def real_token(session)
decode_token(session[options[:key]])
end
def global_token(session)
token_hmac(session, GLOBAL_TOKEN_IDENTIFIER)
end
def per_form_token(session, path, method)
token_hmac(session, "#{path}##{method.downcase}")
end
def encode_token(token)
Base64.urlsafe_encode64(token)
end
def decode_token(token)
Base64.urlsafe_decode64(token)
end
def token_hmac(session, identifier)
OpenSSL::HMAC.digest(
OpenSSL::Digest::SHA256.new,
real_token(session),
identifier
)
end
def xor_byte_strings(s1, s2)
s2 = s2.dup
size = s1.bytesize
i = 0
while i < size
s2.setbyte(i, s1.getbyte(i) ^ s2.getbyte(i))
i += 1
end
s2
end
end
end
end
| {
"content_hash": "2ce966436d3a0e6af7ebffc3e0eb0b99",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 143,
"avg_line_length": 31.51004016064257,
"alnum_prop": 0.5599031353555952,
"repo_name": "jkowens/sinatra",
"id": "2f5634e051d273479a3fb4f2ea5182b3f5fa9a1a",
"size": "7846",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "rack-protection/lib/rack/protection/authenticity_token.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CoffeeScript",
"bytes": "13"
},
{
"name": "HTML",
"bytes": "1685"
},
{
"name": "Haml",
"bytes": "604"
},
{
"name": "Less",
"bytes": "65"
},
{
"name": "Liquid",
"bytes": "70"
},
{
"name": "Ruby",
"bytes": "654583"
},
{
"name": "SCSS",
"bytes": "35"
},
{
"name": "Sass",
"bytes": "72"
},
{
"name": "Shell",
"bytes": "454"
},
{
"name": "Slim",
"bytes": "498"
},
{
"name": "Stylus",
"bytes": "16"
}
],
"symlink_target": ""
} |
set -eou pipefail
# If the variable `$DEBUG` is set, then print the shell commands as we execute.
if [ -n "${DEBUG:-}" ]; then set -x; fi
readonly pcio_root="https://packages.chef.io/files"
export HAB_LICENSE="accept-no-persist"
main() {
# Use stable Bintray channel by default
channel="stable"
# Set an empty version variable, signaling we want the latest release
version=""
# Parse command line flags and options.
while getopts "c:hv:t:" opt; do
case "${opt}" in
c)
channel="${OPTARG}"
;;
h)
print_help
exit 0
;;
v)
version="${OPTARG}"
;;
t)
target="${OPTARG}"
;;
\?)
echo "" >&2
print_help >&2
exit_with "Invalid option" 1
;;
esac
done
info "Installing Habitat 'hab' program"
create_workdir
get_platform
validate_target
download_archive "$version" "$channel" "$target"
verify_archive
extract_archive
install_hab
print_hab_version
info "Installation of Habitat 'hab' program complete."
}
print_help() {
need_cmd cat
need_cmd basename
local _cmd
_cmd="$(basename "${0}")"
cat <<USAGE
${_cmd}
Authors: The Habitat Maintainers <humans@habitat.sh>
Installs the Habitat 'hab' program.
USAGE:
${_cmd} [FLAGS]
FLAGS:
-c Specifies a channel [values: stable, unstable] [default: stable]
-h Prints help information
-v Specifies a version (ex: 0.15.0, 0.15.0/20161222215311)
-t Specifies the ActiveTarget of the 'hab' program to download.
[values: x86_64-linux, x86_64-linux-kernel2] [default: x86_64-linux]
This option is only valid on Linux platforms
ENVIRONMENT VARIABLES:
SSL_CERT_FILE allows you to verify against a custom cert such as one
generated from a corporate firewall
USAGE
}
create_workdir() {
need_cmd mktemp
need_cmd rm
need_cmd mkdir
if [ -n "${TMPDIR:-}" ]; then
local _tmp="${TMPDIR}"
elif [ -d /var/tmp ]; then
local _tmp=/var/tmp
else
local _tmp=/tmp
fi
workdir="$(mktemp -d -p "$_tmp" 2> /dev/null || mktemp -d "${_tmp}/hab.XXXX")"
# Add a trap to clean up any interrupted file downloads
# shellcheck disable=SC2154
trap 'code=$?; rm -rf $workdir; exit $code' INT TERM EXIT
cd "${workdir}"
}
get_platform() {
need_cmd uname
need_cmd tr
local _ostype
_ostype="$(uname -s)"
case "${_ostype}" in
Darwin|Linux)
sys="$(uname -s | tr '[:upper:]' '[:lower:]')"
arch="$(uname -m | tr '[:upper:]' '[:lower:]')"
;;
*)
exit_with "Unrecognized OS type when determining platform: ${_ostype}" 2
;;
esac
case "${sys}" in
darwin)
need_cmd shasum
ext=zip
shasum_cmd="shasum -a 256"
;;
linux)
need_cmd sha256sum
ext=tar.gz
shasum_cmd="sha256sum"
;;
*)
exit_with "Unrecognized sys type when determining platform: ${sys}" 3
;;
esac
if [ -z "${target:-}" ]; then
target="${arch}-${sys}"
fi
}
# Validate the CLI Target requested. In most cases ${arch}-${sys}
# for the current system is the only valid Target. In the case of
# x86_64-linux systems we also need to support the x86_64-linux-kernel2
# Target. Creates an array of valid Targets for the current system,
# adding any valid alternate Targets, and checks if the requested
# Target is present in the array.
validate_target() {
local valid_targets=("${arch}-${sys}")
case "${sys}" in
linux)
valid_targets+=("x86_64-linux-kernel2")
;;
esac
if ! (_array_contains "${target}" "${valid_targets[@]}") ; then
local _vts
printf -v _vts "%s, " "${valid_targets[@]}"
_e="${target} is not a valid target for this system. Please specify one of: [${_vts%, }]"
exit_with "$_e" 7
fi
}
download_archive() {
need_cmd mv
local _version="${1:-latest}"
local -r _channel="${2:?}"
local -r _target="${3:?}"
local url
if [ "$_version" == "latest" ]; then
url="${pcio_root}/${_channel}/habitat/latest/hab-${_target}.${ext}"
else
local -r _release="$(echo "${_version}" |cut -d'/' -f2)"
if [ "${_release:+release}" == "release" ]; then
_version="$(echo "${_version}" |cut -d'/' -f1)"
info "packages.chef.io does not support 'version/release' format. Using $_version for the version"
fi
url="${pcio_root}/habitat/${_version}/hab-${_target}.${ext}"
fi
dl_file "${url}" "${workdir}/hab-${_version}.${ext}"
dl_file "${url}.sha256sum" "${workdir}/hab-${_version}.${ext}.sha256sum"
archive="hab-${_target}.${ext}"
sha_file="hab-${_target}.${ext}.sha256sum"
mv -v "${workdir}/hab-${_version}.${ext}" "${archive}"
mv -v "${workdir}/hab-${_version}.${ext}.sha256sum" "${sha_file}"
if command -v gpg >/dev/null; then
info "GnuPG tooling found, downloading signatures"
sha_sig_file="${archive}.sha256sum.asc"
key_file="${workdir}/chef.asc"
local _key_url="https://packages.chef.io/chef.asc"
dl_file "${url}.sha256sum.asc" "${sha_sig_file}"
dl_file "${_key_url}" "${key_file}"
fi
}
verify_archive() {
if command -v gpg >/dev/null; then
info "GnuPG tooling found, verifying the shasum digest is properly signed"
gpg --no-permission-warning --dearmor "${key_file}"
gpg --no-permission-warning \
--keyring "${key_file}.gpg" --verify "${sha_sig_file}"
fi
info "Verifying the shasum digest matches the downloaded archive"
${shasum_cmd} -c "${sha_file}"
}
extract_archive() {
need_cmd sed
info "Extracting ${archive}"
case "${ext}" in
tar.gz)
need_cmd zcat
need_cmd tar
archive_dir="${archive%.tar.gz}"
mkdir "${archive_dir}"
zcat "${archive}" | tar --extract --directory "${archive_dir}" --strip-components=1
;;
zip)
need_cmd unzip
archive_dir="${archive%.zip}"
# -j "junk paths" Strips leading paths from files,
unzip -j "${archive}" -d "${archive_dir}"
;;
*)
exit_with "Unrecognized file extension when extracting: ${ext}" 4
;;
esac
}
install_hab() {
case "${sys}" in
darwin)
need_cmd mkdir
need_cmd install
info "Installing hab into /usr/local/bin"
mkdir -pv /usr/local/bin
install -v "${archive_dir}"/hab /usr/local/bin/hab
;;
linux)
local _ident="core/hab"
if [ -n "${version-}" ] && [ "${version}" != "latest" ]; then
_ident+="/$version";
fi
info "Installing Habitat package using temporarily downloaded hab"
# NOTE: For people (rightly) wondering why we download hab only to use it
# to install hab from Builder, the main reason is because it allows /bin/hab
# to be a binlink, meaning that future upgrades can be easily done via
# hab pkg install core/hab -bf and everything will Just Work. If we put
# the hab we downloaded into /bin, then future hab upgrades done via hab
# itself won't work - you'd need to run this script every time you wanted
# to upgrade hab, which is not intuitive. Putting it into a place other than
# /bin means now you have multiple copies of hab on your system and pathing
# shenanigans might ensue. Rather than deal with that mess, we do it this
# way.
"${archive_dir}/hab" pkg install --binlink --force --channel "$channel" "$_ident"
;;
*)
exit_with "Unrecognized sys when installing: ${sys}" 5
;;
esac
}
print_hab_version() {
need_cmd hab
info "Checking installed hab version"
hab --version
}
need_cmd() {
if ! command -v "$1" > /dev/null 2>&1; then
exit_with "Required command '$1' not found on PATH" 127
fi
}
info() {
echo "--> hab-install: $1"
}
warn() {
echo "xxx hab-install: $1" >&2
}
exit_with() {
warn "$1"
exit "${2:-10}"
}
_array_contains() {
local e
for e in "${@:2}"; do
if [[ "$e" == "$1" ]]; then
return 0
fi
done
return 1
}
dl_file() {
local _url="${1}"
local _dst="${2}"
local _code
local _wget_extra_args=""
local _curl_extra_args=""
# Attempt to download with wget, if found. If successful, quick return
if command -v wget > /dev/null; then
info "Downloading via wget: ${_url}"
if [ -n "${SSL_CERT_FILE:-}" ]; then
wget ${_wget_extra_args:+"--ca-certificate=${SSL_CERT_FILE}"} -q -O "${_dst}" "${_url}"
else
wget -q -O "${_dst}" "${_url}"
fi
_code="$?"
if [ $_code -eq 0 ]; then
return 0
else
local _e="wget failed to download file, perhaps wget doesn't have"
_e="$_e SSL support and/or no CA certificates are present?"
warn "$_e"
fi
fi
# Attempt to download with curl, if found. If successful, quick return
if command -v curl > /dev/null; then
info "Downloading via curl: ${_url}"
if [ -n "${SSL_CERT_FILE:-}" ]; then
curl ${_curl_extra_args:+"--cacert ${SSL_CERT_FILE}"} -sSfL "${_url}" -o "${_dst}"
else
curl -sSfL "${_url}" -o "${_dst}"
fi
_code="$?"
if [ $_code -eq 0 ]; then
return 0
else
local _e="curl failed to download file, perhaps curl doesn't have"
_e="$_e SSL support and/or no CA certificates are present?"
warn "$_e"
fi
fi
# If we reach this point, wget and curl have failed and we're out of options
exit_with "Required: SSL-enabled 'curl' or 'wget' on PATH with" 6
}
main "$@" || exit 99
| {
"content_hash": "1dc0f591e50e15aea557f8b92c418ddc",
"timestamp": "",
"source": "github",
"line_count": 368,
"max_line_length": 104,
"avg_line_length": 25.559782608695652,
"alnum_prop": 0.5933446736125877,
"repo_name": "rsertelon/habitat",
"id": "22b511bb00af0c7598ffe7ba38fb4b5e9ca2c71c",
"size": "9420",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "components/hab/install.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "566"
},
{
"name": "C#",
"bytes": "8421"
},
{
"name": "CSS",
"bytes": "114163"
},
{
"name": "Dockerfile",
"bytes": "2648"
},
{
"name": "HTML",
"bytes": "698090"
},
{
"name": "JavaScript",
"bytes": "21970"
},
{
"name": "Makefile",
"bytes": "9091"
},
{
"name": "PowerShell",
"bytes": "180851"
},
{
"name": "Python",
"bytes": "1910"
},
{
"name": "RAML",
"bytes": "8621"
},
{
"name": "Ruby",
"bytes": "37436"
},
{
"name": "Rust",
"bytes": "2316448"
},
{
"name": "Shell",
"bytes": "438795"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Wed Jan 16 10:54:26 MST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Package org.wildfly.swarm.mongodb (BOM: * : All 2.3.0.Final-SNAPSHOT API)</title>
<meta name="date" content="2019-01-16">
<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="Uses of Package org.wildfly.swarm.mongodb (BOM: * : All 2.3.0.Final-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li class="navBarCell1Rev">Use</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 class="aboutLanguage">Thorntail API, 2.3.0.Final-SNAPSHOT</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/wildfly/swarm/mongodb/package-use.html" target="_top">Frames</a></li>
<li><a href="package-use.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>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Uses of Package org.wildfly.swarm.mongodb" class="title">Uses of Package<br>org.wildfly.swarm.mongodb</h1>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../org/wildfly/swarm/mongodb/package-summary.html">org.wildfly.swarm.mongodb</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.wildfly.swarm.mongodb">org.wildfly.swarm.mongodb</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.wildfly.swarm.mongodb">
<!-- -->
</a>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../org/wildfly/swarm/mongodb/package-summary.html">org.wildfly.swarm.mongodb</a> used by <a href="../../../../org/wildfly/swarm/mongodb/package-summary.html">org.wildfly.swarm.mongodb</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colOne"><a href="../../../../org/wildfly/swarm/mongodb/class-use/MongoDBFraction.html#org.wildfly.swarm.mongodb">MongoDBFraction</a> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= 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</li>
<li class="navBarCell1Rev">Use</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 class="aboutLanguage">Thorntail API, 2.3.0.Final-SNAPSHOT</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/wildfly/swarm/mongodb/package-use.html" target="_top">Frames</a></li>
<li><a href="package-use.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>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "97a9580ef5f8209d990342649cd5e5f1",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 282,
"avg_line_length": 36.161490683229815,
"alnum_prop": 0.6331157677773961,
"repo_name": "wildfly-swarm/wildfly-swarm-javadocs",
"id": "4d8e3fa10093518d02e2123229420d8bceb8715f",
"size": "5822",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "2.3.0.Final-SNAPSHOT/apidocs/org/wildfly/swarm/mongodb/package-use.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
#import <Foundation/Foundation.h>
#import "RCTDefines.h"
typedef NS_ENUM(NSUInteger, RCTPLTag) {
RCTPLScriptDownload = 0,
RCTPLScriptExecution,
RCTPLNativeModuleInit,
RCTPLNativeModuleInjectConfig,
RCTPLTTI,
RCTPLSize
};
void RCTPerformanceLoggerStart(RCTPLTag tag);
void RCTPerformanceLoggerEnd(RCTPLTag tag);
NSArray *RCTPerformanceLoggerOutput(void);
| {
"content_hash": "f90a4402ea2c77bc6a4b8cc9db5583e2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 45,
"avg_line_length": 20.61111111111111,
"alnum_prop": 0.8005390835579514,
"repo_name": "marlonandrade/react-native",
"id": "8285f061571ac89b69144d644b2b379d6b142888",
"size": "679",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "React/Base/RCTPerformanceLogger.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AppleScript",
"bytes": "1171"
},
{
"name": "Awk",
"bytes": "121"
},
{
"name": "C",
"bytes": "61256"
},
{
"name": "C++",
"bytes": "290598"
},
{
"name": "CSS",
"bytes": "16530"
},
{
"name": "HTML",
"bytes": "28846"
},
{
"name": "IDL",
"bytes": "617"
},
{
"name": "Java",
"bytes": "955599"
},
{
"name": "JavaScript",
"bytes": "1236928"
},
{
"name": "Makefile",
"bytes": "6060"
},
{
"name": "Objective-C",
"bytes": "1001453"
},
{
"name": "Objective-C++",
"bytes": "7940"
},
{
"name": "Prolog",
"bytes": "311"
},
{
"name": "Python",
"bytes": "32195"
},
{
"name": "Ruby",
"bytes": "4156"
},
{
"name": "Shell",
"bytes": "11188"
}
],
"symlink_target": ""
} |
echoerr() { echo "$@" 1>&2; }
[[ -z $VARIABLES_FILE ]] && VARIABLES_FILE="$HOME/.nlp_install_rc"
[[ ! -f $VARIABLES_FILE ]] && touch $VARIABLES_FILE
source $VARIABLES_FILE
STARTING_DIR=`pwd`
echoerr "*** STARTING installation of MALT parser"
######################################################
NAME="maltparser-1.7.2"
LINK='http://maltparser.org/dist/maltparser-1.7.2.tar.gz'
INSTALL_DIR="$STARTING_DIR/$NAME"
echoerr "downloading $NAME"
wget $LINK
tar xfz $NAME.tar.gz
rm $NAME.tar.gz
cd $NAME
echoerr "downloading grammars"
mkdir grammars
cd grammars
wget http://www.maltparser.org/mco/english_parser/engmalt.poly-1.7.mco
wget http://www.maltparser.org/mco/english_parser/engmalt.linear-1.7.mco
wget http://www.maltparser.org/mco/french_parser/fremalt-1.7.mco
cd ..
echoerr 'adding $MALT_PARSER to the \$VARIABLES_FILE'
export MALT_PARSER=`pwd`
echo "export MALT_PARSER=$MALT_PARSER" >> $VARIABLES_FILE
######################################################
echoerr "*** DONE"
cd $STARTING_DIR
| {
"content_hash": "068b7cf2435ab7bd23ce40d05a30d5d2",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 72,
"avg_line_length": 25.897435897435898,
"alnum_prop": 0.6435643564356436,
"repo_name": "stanojevic/NLP-installation-scripts",
"id": "c51b4de749463ebbf924f788dd43d56fdeee8c5f",
"size": "1022",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "installation_scripts/parsing_tools/install_malt_parser.sh",
"mode": "33261",
"license": "bsd-2-clause",
"language": [
{
"name": "C++",
"bytes": "50026"
},
{
"name": "Perl",
"bytes": "117625"
},
{
"name": "Python",
"bytes": "1631"
},
{
"name": "Shell",
"bytes": "92002"
}
],
"symlink_target": ""
} |
<!--
Copyright Louis Dionne 2013-2017
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
-->
<!-- boost-no-inspect -->
<!-- HTML header for doxygen 1.8.9.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<title>Boost.Hana: boost::hana::basic_tuple_tag Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function() { init_search(); });
/* @license-end */
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
// Copyright Louis Dionne 2013-2017
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
MathJax.Hub.Config({
"HTML-CSS": {
linebreaks: {
automatic: true,
width: "75% container"
}
}
});
</script>
<script type="text/javascript" async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<!-- Additional javascript for drawing charts. -->
<script type="text/javascript" src="highcharts.js"></script>
<script type="text/javascript" src="highcharts-data.js"></script>
<script type="text/javascript" src="highcharts-exporting.js"></script>
<script type="text/javascript" src="chart.js"></script>
<script type="text/javascript" src="hana.js"></script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="Boost.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">Boost.Hana
 <span id="projectnumber">1.7.1</span>
</div>
<div id="projectbrief">Your standard library for metaprogramming</div>
</td>
<td> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.svg"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('structboost_1_1hana_1_1basic__tuple__tag.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">boost::hana::basic_tuple_tag Struct Reference</div> </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
<div class="textblock"><p>Tag representing <code><a class="el" href="structboost_1_1hana_1_1basic__tuple.html" title="Stripped down version of hana::tuple.">hana::basic_tuple</a></code>. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!--
Copyright Louis Dionne 2013-2017
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
-->
<!-- boost-no-inspect -->
<!-- HTML footer for doxygen 1.8.9.1-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><b>boost</b></li><li class="navelem"><a class="el" href="namespaceboost_1_1hana.html">hana</a></li><li class="navelem"><a class="el" href="structboost_1_1hana_1_1basic__tuple__tag.html">basic_tuple_tag</a></li>
</ul>
</div>
</body>
</html>
| {
"content_hash": "f340825493ec153372c747e8df7dd464",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 234,
"avg_line_length": 42.16778523489933,
"alnum_prop": 0.6700620722584752,
"repo_name": "arangodb/arangodb",
"id": "563beb0c06f0f66edd06ac3cc011b2bc7debbdc6",
"size": "6283",
"binary": false,
"copies": "4",
"ref": "refs/heads/devel",
"path": "3rdParty/boost/1.78.0/libs/hana/doc/html/structboost_1_1hana_1_1basic__tuple__tag.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "61827"
},
{
"name": "C",
"bytes": "311036"
},
{
"name": "C++",
"bytes": "35149373"
},
{
"name": "CMake",
"bytes": "387268"
},
{
"name": "CSS",
"bytes": "210549"
},
{
"name": "EJS",
"bytes": "232160"
},
{
"name": "HTML",
"bytes": "23114"
},
{
"name": "JavaScript",
"bytes": "33841256"
},
{
"name": "LLVM",
"bytes": "15003"
},
{
"name": "NASL",
"bytes": "381737"
},
{
"name": "NSIS",
"bytes": "47138"
},
{
"name": "Pascal",
"bytes": "75391"
},
{
"name": "Perl",
"bytes": "9811"
},
{
"name": "PowerShell",
"bytes": "6806"
},
{
"name": "Python",
"bytes": "190515"
},
{
"name": "SCSS",
"bytes": "255542"
},
{
"name": "Shell",
"bytes": "133576"
},
{
"name": "TypeScript",
"bytes": "179074"
},
{
"name": "Yacc",
"bytes": "79620"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CloudsdaleWin7.lib.Models
{
public enum Status
{
Online = 0,
Away = 1,
Busy = 2,
Offline = 3
}
}
| {
"content_hash": "44d3e5e5cb1f0aca5d760166a855e669",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 35,
"avg_line_length": 16.8125,
"alnum_prop": 0.6245353159851301,
"repo_name": "cloudsdaleapp/cloudsdale-win7",
"id": "1b1bb9f1d9ee85a0fd6e94fdfffb2c5d63a7f800",
"size": "271",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/Models/Status.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "308455"
}
],
"symlink_target": ""
} |
package org.pointstone.cugappplat.base.cusotomview.swipeview;
/**
* Created by Yan Zhenjie on 2016/7/26.
*/
public interface OnSwipeMenuItemClickListener {
/**
* Invoke when the menu item is clicked.
*
* @param closeable closeable.
* @param adapterPosition adapterPosition.
* @param menuPosition menuPosition.
* @param direction can be {@link com.yanzhenjie.recyclerview.swipe.SwipeMenuRecyclerView#LEFT_DIRECTION}, {@link com.yanzhenjie.recyclerview.swipe.SwipeMenuRecyclerView#RIGHT_DIRECTION}.
*/
void onItemClick(Closeable closeable, int adapterPosition, int menuPosition, @SwipeMenuRecyclerView.DirectionMode int direction);
} | {
"content_hash": "841c4908cc095eac0297a030c0d842a4",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 197,
"avg_line_length": 34.8,
"alnum_prop": 0.7327586206896551,
"repo_name": "HelloChenJinJun/TestChat",
"id": "1300256079d3c35df562962a5f09a1f034543710",
"size": "1291",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "common/src/main/java/org/pointstone/cugappplat/base/cusotomview/swipeview/OnSwipeMenuItemClickListener.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2013271"
}
],
"symlink_target": ""
} |
[](https://travis-ci.org/salmonhabitat/calculator)
calculator
==========
Project the costs of installing an open-bottom arch culvert in Downeast Maine.
| {
"content_hash": "509b210bb1d2e4e3878f612410f0c625",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 131,
"avg_line_length": 39.166666666666664,
"alnum_prop": 0.7617021276595745,
"repo_name": "salmonhabitat/calculator",
"id": "59cc98c20b34d24c8c164909753fe0fcf4f5df6c",
"size": "235",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "569"
}
],
"symlink_target": ""
} |
package org.drools.compiler.test;
import org.kie.api.definition.type.Position;
public abstract class Person {
@Position(0)
private String name;
public Person() {
super(); //To change body of overridden methods use File | Settings | File Templates.
}
public Person(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| {
"content_hash": "4975dd356aa641bd6297e98e526f38e5",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 96,
"avg_line_length": 19.28,
"alnum_prop": 0.6099585062240664,
"repo_name": "bxf12315/drools",
"id": "5b536ef3633bb0e47a16543785f93424760dc373",
"size": "482",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "drools-compiler/src/test/java/org/drools/compiler/test/Person.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
/**
* DO NOT EDIT
*
* This file was automatically generated by
* https://github.com/Polymer/gen-typescript-declarations
*
* To modify these typings, edit the source file(s):
* iron-flex-layout-classes.html
*/
/// <reference path="../polymer/types/polymer.d.ts" />
| {
"content_hash": "4047be1a9b52948d413ebd2046d6efcf",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 59,
"avg_line_length": 23.166666666666668,
"alnum_prop": 0.6762589928057554,
"repo_name": "endlessm/chromium-browser",
"id": "139911b8f40bb187a0e506a90beeaf3271939b2a",
"size": "278",
"binary": false,
"copies": "18",
"ref": "refs/heads/master",
"path": "third_party/catapult/third_party/polymer2/bower_components/iron-flex-layout/iron-flex-layout-classes.d.ts",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
<?php
declare(strict_types=1);
namespace spec\Sylius\Component\Order\Factory;
use PhpSpec\ObjectBehavior;
use Sylius\Component\Order\Factory\AdjustmentFactoryInterface;
use Sylius\Component\Order\Model\AdjustmentInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
final class AdjustmentFactorySpec extends ObjectBehavior
{
function let(FactoryInterface $adjustmentFactory): void
{
$this->beConstructedWith($adjustmentFactory);
}
function it_implements_an_adjustment_factory_interface(): void
{
$this->shouldImplement(AdjustmentFactoryInterface::class);
}
function it_creates_new_adjustment(
FactoryInterface $adjustmentFactory,
AdjustmentInterface $adjustment
): void {
$adjustmentFactory->createNew()->willReturn($adjustment);
$this->createNew()->shouldReturn($adjustment);
}
function it_creates_new_adjustment_with_provided_data(
FactoryInterface $adjustmentFactory,
AdjustmentInterface $adjustment
): void {
$adjustmentFactory->createNew()->willReturn($adjustment);
$adjustment->setType('tax')->shouldBeCalled();
$adjustment->setLabel('Tax description')->shouldBeCalled();
$adjustment->setAmount(1000)->shouldBeCalled();
$adjustment->setNeutral(false)->shouldBeCalled();
$adjustment->setDetails(['taxRateAmount' => 0.1])->shouldBeCalled();
$this
->createWithData('tax', 'Tax description', 1000, false, ['taxRateAmount' => 0.1])
->shouldReturn($adjustment)
;
}
}
| {
"content_hash": "bfd81f3595d7d552edeb415fc8a41682",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 93,
"avg_line_length": 31.19607843137255,
"alnum_prop": 0.6907605279698303,
"repo_name": "loic425/Sylius",
"id": "487271870600b6fb3673871562bf014acc6392a5",
"size": "1802",
"binary": false,
"copies": "11",
"ref": "refs/heads/master",
"path": "src/Sylius/Component/Order/spec/Factory/AdjustmentFactorySpec.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "674"
},
{
"name": "Gherkin",
"bytes": "1206742"
},
{
"name": "JavaScript",
"bytes": "101992"
},
{
"name": "Makefile",
"bytes": "1059"
},
{
"name": "PHP",
"bytes": "7844715"
},
{
"name": "SCSS",
"bytes": "50783"
},
{
"name": "Shell",
"bytes": "11384"
},
{
"name": "Twig",
"bytes": "427226"
}
],
"symlink_target": ""
} |
local docs = {}
local lfs = require "lfs"
local current_version = '0.5'
local sailor = require 'sailor'
local function render_doc_md(page,file_name,last_update)
local version = page.GET.v or current_version
local path = 'docs/'..version..'/'..file_name..'.md'
local f=io.open(sailor.path.."/"..path,"r")
if f~=nil then
io.close(f)
page.layout = "inside/index"
page:render('md_container',{path=path,show_brand=true,last_update=last_update, version = version})
else
page:redirect('docs/notfound')
end
end
function docs.index(page)
page.layout = "inside/index"
page:render('index',{show_brand=true})
end
function docs.create(page)
render_doc_md(page,'create_app')
end
function docs.models(page)
render_doc_md(page,'tutorial_models')
end
function docs.views(page)
render_doc_md(page,'tutorial_views')
end
function docs.controllers(page)
render_doc_md(page,'tutorial_controllers')
end
function docs.form(page)
render_doc_md(page,'manual_form_module')
end
function docs.configure(page)
render_doc_md(page,'CONFIG')
end
function docs.install(page)
page.layout = "inside/index"
page:render('install',{show_brand=true})
end
function docs.install_win(page)
render_doc_md(page,'INSTALL_WIN')
end
function docs.install_linux(page)
render_doc_md(page,'INSTALL_LINUX')
end
function docs.install_mac(page)
render_doc_md(page,'INSTALL_MAC')
end
function docs.install_linux_arch(page)
render_doc_md(page,'INSTALL_LINUX_ARCH')
end
function docs.tutorial(page)
page.layout = "inside/index"
version = page.GET.v or version
page:render('tutorial',{show_brand=true})
end
function docs.page(page)
render_doc_md(page,'manual_page_object')
end
function docs.sailor(page)
render_doc_md(page,'manual_sailor_functions')
end
function docs.model(page)
render_doc_md(page,'manual_model_module')
end
function docs.validation(page)
render_doc_md(page,'manual_validation_module')
end
function docs.access(page)
render_doc_md(page,'manual_access_module')
end
function docs.testing(page)
render_doc_md(page,'tutorial_testing')
end
function docs.autogen(page)
page.layout = "inside/index"
version = page.GET.v or version
page:render('autogen',{show_brand=true})
end
return docs | {
"content_hash": "3048f225f27a43eabe4d5fc6f09c6741",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 100,
"avg_line_length": 21.42718446601942,
"alnum_prop": 0.7381060262800181,
"repo_name": "Etiene/sailor_website",
"id": "3f34f3be299cb531cadc02da29e461d4292a48c9",
"size": "2207",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "controllers/docs.lua",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "608"
},
{
"name": "CSS",
"bytes": "42853"
},
{
"name": "JavaScript",
"bytes": "34925"
},
{
"name": "Lua",
"bytes": "21521"
}
],
"symlink_target": ""
} |
require 'stringio'
require 'rubygems'
require 'optparse'
require "ostruct"
TOP_SRC_DIR = File.join(File.dirname(__FILE__), "..") unless
defined?(TOP_SRC_DIR)
$:.unshift File.join(TOP_SRC_DIR, "ext")
$:.unshift File.join(TOP_SRC_DIR, "lib")
$:.unshift File.join(TOP_SRC_DIR, "cli")
def debug_program(options)
# Make sure Ruby script syntax checks okay.
# Otherwise we get a load message that looks like rdebug has
# a problem.
output = `ruby -c #{Debugger::PROG_SCRIPT.inspect} 2>&1`
if $?.exitstatus != 0 and RUBY_PLATFORM !~ /mswin/
puts output
exit $?.exitstatus
end
print "\032\032starting\n" if Debugger.annotate and Debugger.annotate > 2
unless options.no_rewrite_program
# Set $0 so things like __FILE == $0 work.
# A more reliable way to do this is to put $0 = __FILE__ *after*
# loading the script to be debugged. For this, adding a debug hook
# for the first time and then switching to the debug hook that's
# normally used would be helpful. Doing this would also help other
# first-time initializations such as reloading debugger state
# after a restart.
# However This is just a little more than I want to take on right
# now, so I think I'll stick with the slightly hacky approach.
$RDEBUG_0 = $0
# cygwin does some sort of funky truncation on $0 ./abcdef => ./ab
# probably something to do with 3-letter extension truncation.
# The hacky workaround is to do slice assignment. Ugh.
d0 = if '.' == File.dirname(Debugger::PROG_SCRIPT) and
Debugger::PROG_SCRIPT[0..0] != '.'
File.join('.', Debugger::PROG_SCRIPT)
else
Debugger::PROG_SCRIPT
end
if $0.frozen?
$0 = d0
else
$0[0..-1] = d0
end
end
# Record where we are we can know if the call stack has been
# truncated or not.
Debugger.start_sentinal=caller(0)[1]
bt = Debugger.debug_load(Debugger::PROG_SCRIPT, !options.nostop, false)
if bt
if options.post_mortem
Debugger.handle_post_mortem(bt)
else
print bt.backtrace.map{|l| "\t#{l}"}.join("\n"), "\n"
print "Uncaught exception: #{bt}\n"
end
end
end
options = OpenStruct.new(
'annotate' => false,
'emacs' => false,
'frame_bind' => false,
'no-quit' => false,
'no-stop' => false,
'nx' => false,
'post_mortem' => false,
'script' => nil,
'tracing' => false,
'verbose_long'=> false,
'wait' => false
)
require "ruby-debug"
program = File.basename($0)
opts = OptionParser.new do |opts|
opts.banner = <<EOB
#{program} #{Debugger::VERSION}
Usage: #{program} [options] <script.rb> -- <script.rb parameters>
EOB
opts.separator ""
opts.separator "Options:"
opts.on("-A", "--annotate LEVEL", Integer, "Set annotation level") do |annotate|
Debugger.annotate = annotate
end
opts.on("-d", "--debug", "Set $DEBUG=true") {$DEBUG = true}
opts.on("--emacs-basic", "Activates basic Emacs mode") do
ENV['EMACS'] = '1'
options.emacs = true
end
opts.on("--keep-frame-binding", "Keep frame bindings") do
options.frame_bind = true
end
opts.on("-m", "--post-mortem", "Activate post-mortem mode") do
options.post_mortem = true
end
opts.on("--no-control", "Do not automatically start control thread") do
options.control = false
end
opts.on("--no-quit", "Do not quit when script finishes") do
options.noquit = true
end
opts.on("--no-stop", "Do not stop when script is loaded") do
options.nostop = true
end
opts.on("-nx", "Not run debugger initialization files (e.g. .rdebugrc") do
options.nx = true
end
opts.on("-I", "--include PATH", String, "Add PATH to $LOAD_PATH") do |path|
$LOAD_PATH.unshift(path)
end
opts.on("-r", "--require SCRIPT", String,
"Require the library, before executing your script") do |name|
if name == 'debug'
puts "ruby-debug is not compatible with Ruby's 'debug' library. This option is ignored."
else
require name
end
end
opts.on("--script FILE", String, "Name of the script file to run") do |script|
options.script = script
unless File.exists?(options.script)
puts "Script file '#{options.script}' is not found"
exit
end
end
opts.on("-x", "--trace", "Turn on line tracing") {options.tracing = true}
ENV['EMACS'] = nil unless options.emacs
opts.separator ""
opts.separator "Common options:"
opts.on_tail("--help", "Show this message") do
puts opts
exit
end
opts.on_tail("--version",
"Print the version") do
puts "ruby-debug #{Debugger::VERSION}"
exit
end
opts.on("--verbose", "Turn on verbose mode") do
$VERBOSE = true
options.verbose_long = true
end
opts.on_tail("-v",
"Print version number, then turn on verbose mode") do
puts "ruby-debug #{Debugger::VERSION}"
$VERBOSE = true
end
end
begin
if not defined? Debugger::ARGV
Debugger::ARGV = ARGV.clone
end
rdebug_path = File.expand_path($0)
if RUBY_PLATFORM =~ /mswin/
rdebug_path += '.cmd' unless rdebug_path =~ /\.cmd$/i
end
Debugger::RDEBUG_SCRIPT = rdebug_path
Debugger::RDEBUG_FILE = __FILE__
Debugger::INITIAL_DIR = Dir.pwd
opts.parse! ARGV
rescue StandardError => e
puts opts
puts
puts e.message
exit(-1)
end
if ARGV.empty?
exit if $VERBOSE and not options.verbose_long
puts opts
puts
puts 'Must specify a script to run'
exit(-1)
end
# save script name
Debugger::PROG_SCRIPT = ARGV.shift
# install interruption handler
trap('INT') { Debugger.interrupt_last }
# set options
Debugger.wait_connection = false
Debugger.keep_frame_binding = options.frame_bind
# Add Debugger trace hook.
Debugger.start
# start control thread
Debugger.start_control(options.host, options.cport) if options.control
# activate post-mortem
Debugger.post_mortem if options.post_mortem
# Set up an interface to read commands from a debugger script file.
if options.script
Debugger.interface = Debugger::ScriptInterface.new(options.script,
STDOUT, true)
end
options.nostop = true if options.tracing
Debugger.tracing = options.tracing
# Make sure Ruby script syntax checks okay.
# Otherwise we get a load message that looks like rdebug has
# a problem.
output = `ruby -c #{Debugger::PROG_SCRIPT.inspect} 2>&1`
if $?.exitstatus != 0 and RUBY_PLATFORM !~ /mswin/
puts output
exit $?.exitstatus
end
# load initrc script (e.g. .rdebugrc)
Debugger.run_init_script(StringIO.new) unless options.nx
# run startup script if specified
if options.script
Debugger.run_script(options.script)
end
# activate post-mortem
Debugger.post_mortem if options.post_mortem
options.stop = false if options.tracing
Debugger.tracing = options.tracing
if options.noquit
if Debugger.started?
until Debugger.stop do end
end
debug_program(options)
print "The program finished.\n" unless
Debugger.annotate.to_i > 1 # annotate has its own way
interface = Debugger::LocalInterface.new
# Not sure if ControlCommandProcessor is really the right
# thing to use. CommandProcessor requires a state.
processor = Debugger::ControlCommandProcessor.new(interface)
processor.process_commands
else
debug_program(options)
end
| {
"content_hash": "7e00f0d852c7937e8fad7e33554da677",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 94,
"avg_line_length": 29.411290322580644,
"alnum_prop": 0.6621880998080614,
"repo_name": "gfowley/ruby-debug",
"id": "2eb97a2885793c8ecb537a89ef7e476ca1227ea5",
"size": "7442",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "test/tdebug.rb",
"mode": "33261",
"license": "bsd-2-clause",
"language": [
{
"name": "Batchfile",
"bytes": "12827"
},
{
"name": "C",
"bytes": "81609"
},
{
"name": "Groff",
"bytes": "147"
},
{
"name": "Java",
"bytes": "101541"
},
{
"name": "Ruby",
"bytes": "217654"
}
],
"symlink_target": ""
} |
Originally published: 2012-04-12 07:38:27
Last updated: 2012-04-18 06:13:25
Author: Thomas Lehmann
**Why?**
* There are many recipes but nearly all cover the global singleton only.
* I need a singleton which can handle things in a specific context (environment).
**The final singleton is a combination of following two recipes**:
* http://www.python.org/dev/peps/pep-0318/#examples
* http://stackoverflow.com/a/9489387
**The basic advantages**:
* Hiding the singleton code by a simple decorator
* Flexible, because you can define fully global singletons or parameter based singletons.
**Latest changes**:
* Although a function/method does not have parameters you can call it with parameters **args** and **kwargs** as you now see in the **getInstance** function.
* ... | {
"content_hash": "879eaa301ba9537e0cd50e646b323169",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 158,
"avg_line_length": 42.21052631578947,
"alnum_prop": 0.726932668329177,
"repo_name": "ActiveState/code",
"id": "62281c604940bf7f1237f1c76afa12f1b356ade8",
"size": "835",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "recipes/Python/578103_Singleton_parameter_based/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "35894"
},
{
"name": "C",
"bytes": "56048"
},
{
"name": "C++",
"bytes": "90880"
},
{
"name": "HTML",
"bytes": "11656"
},
{
"name": "Java",
"bytes": "57468"
},
{
"name": "JavaScript",
"bytes": "181218"
},
{
"name": "PHP",
"bytes": "250144"
},
{
"name": "Perl",
"bytes": "37296"
},
{
"name": "Perl 6",
"bytes": "9914"
},
{
"name": "Python",
"bytes": "17387779"
},
{
"name": "Ruby",
"bytes": "40233"
},
{
"name": "Shell",
"bytes": "190732"
},
{
"name": "Tcl",
"bytes": "674650"
}
],
"symlink_target": ""
} |
<head>
{% if page.summary %}
{% assign desc = page.summary | xml_escape %}
{% else %}
{% assign desc = site.description | xml_escape %}
{% endif %}
{% if page.title %}
{% assign title = page.title | xml_escape %}
{% else %}
{% assign title = site.title | xml_escape %}
{% endif %}
{% if page.image %}
{% assign image = page.image %}
{% else %}
{% assign image = "/assets/logo.png" | prepend: site.url %}
{% endif %}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<meta name="description" content="{{ desc }}">
<meta name="author" content="{{ site.author }}">
{% if page.categories %}<meta name="keywords" content="{{ page.categories | join: ', ' }}">{% endif %}
<!-- Open Graph: https://davidwalsh.name/facebook-meta-tags -->
<meta property="og:locale" content="en_US">
<meta property="og:type" content="article">
<meta property="og:title" content="{{ title }}">
<meta property="og:description" content="{{ desc }}">
<meta property="og:url" content="{{ site.url }}{{ page.url }}">
<meta property="og:site_name" content="{{ site.title }}">
<meta property="og:image" content="{{ image }}"/>
<!-- Twitter card -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="{{ site.twitter_username }}" />
<meta name="twitter:title" content="{{ title }}" />
<meta name="twitter:description" content="{{ desc }}" />
<meta name="twitter:image" content="{{ image }}" />
<link rel="shortcut icon" type="image/x-icon" href="{{ '/favicon.ico' | prepend: stie.baseurl }}">
<title>{{ site.title | strip_html }}{% if page.title %} // {{ page.title | strip_html }}{% endif %}</title>
<!-- MDL CSS / JS -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.1.3/material.indigo-pink.min.css">
<script defer src="https://code.getmdl.io/1.1.3/material.min.js"></script>
<link rel="stylesheet" href="{{ '/css/styles.css' | prepend: site.baseurl }}" type="text/css">
<!-- Fonts -->
<link href='//fonts.googleapis.com/css?family=Merriweather:900,900italic,300,300italic' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Libre+Baskerville:400,400italic' rel='stylesheet' type='text/css'>
{% if site.show_social_icons or site.show_sharing_icons %}
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
{% endif %}
{% include analytics.html %}
<style>
body {
background-image: url('{{ '/assets/bg.jpg' | prepend: site.url }}')
}
</style>
</head>
| {
"content_hash": "5c127b97b720511c9a70db5b73111af3",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 125,
"avg_line_length": 44.96875,
"alnum_prop": 0.6028492008339125,
"repo_name": "yan-foto/oddball",
"id": "bf999d579b14fdc664e983690942e8b418b8a13e",
"size": "2878",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_includes/head.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "16501"
},
{
"name": "HTML",
"bytes": "14119"
},
{
"name": "JavaScript",
"bytes": "1"
}
],
"symlink_target": ""
} |
export * from './CanvasSpriteRenderer';
import './Sprite';
| {
"content_hash": "ba7a5eceb018a6f163822b27eecc20c0",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 39,
"avg_line_length": 20,
"alnum_prop": 0.7,
"repo_name": "GoodBoyDigital/pixi.js",
"id": "ce41400ce4c0138f9f544f852caf441975fcd32d",
"size": "60",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "packages/canvas/canvas-sprite/src/index.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "GLSL",
"bytes": "23238"
},
{
"name": "JavaScript",
"bytes": "1461989"
}
],
"symlink_target": ""
} |
<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Getting started with the OSX terminal - AshleyNolan.co.uk - Blog and Portfolio for Ashley Watson-Nolan</title>
<meta name="description"
content="Getting started with the OSX terminal - AshleyNolan.co.uk - Blog and Portfolio for Ashley Watson-Nolan">
<link href="https://ashleynolan.co.uk/feed.xml" rel="alternate" type="application/rss+xml"
title="Front-end development Blog and Portfolio for Ashley Watson-Nolan" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="/assets/img/icons/favicon.ico">
<link rel="apple-touch-icon" href="/assets/img/icons/apple_touch_icon.png">
<!-- <meta property="og:url" content="getting-started-with-terminal" /> -->
<meta property="og:type" content="article" />
<meta property="og:title" content="Getting started with the OSX terminal" />
<meta property="og:description"
content="An intro guide to the terminal, going over my most commonly used shortcuts and commands." />
<meta property="og:image"
content="https://www.ashleynolan.co.uk/assets/img/icons/logo-tcard.png" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@WelshAsh_" />
<meta name="twitter:title" content="Getting started with the OSX terminal" />
<meta name="twitter:description"
content="An intro guide to the terminal, going over my most commonly used shortcuts and commands." />
<meta name="twitter:image" content="https://www.ashleynolan.co.uk/assets/img/icons/logo-tcard.png" />
<!-- CSS -->
<link rel="stylesheet" href="/assets/css/kickoff.min.css">
<!-- Fonts – non blocking -->
<link href='https://fonts.googleapis.com/css?family=Muli:300,400&display=swap' rel='stylesheet' type='text/css'>
<script>
(function (d) {
var config = {
kitId: 'xxf1gwm',
scriptTimeout: 3000
},
h = d.documentElement, t = setTimeout(function () { h.className = h.className.replace(/\bwf-loading\b/g, "") + " wf-inactive"; }, config.scriptTimeout), tk = d.createElement("script"), f = false, s = d.getElementsByTagName("script")[0], a; h.className += " wf-loading"; tk.src = '//use.typekit.net/' + config.kitId + '.js'; tk.async = true; tk.onload = tk.onreadystatechange = function () { a = this.readyState; if (f || a && a != "complete" && a != "loaded") return; f = true; clearTimeout(t); try { Typekit.load(config) } catch (e) { } }; s.parentNode.insertBefore(tk, s)
})(document);
</script>
<!-- Require include for JS -->
<script src="/assets/js/components/requirejs/require.js" data-main="/assets/js/dist/app.min" async></script>
</head>
<body>
<div class="container">
<header class="page-header">
<div id="page-logo" class="logo">
<span>Front-end development Blog and Portfolio for Ashley Watson-Nolan – Senior UI Engineer at Just
Eat</span>
<a href="/" class="logo-link">
<svg class="logo-dg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1" id="Layer_1" x="0px" y="0px" width="234px" height="244.082px"
viewBox="0 0 234 244.082" enable-background="new 0 0 234 244.082" xml:space="preserve">
<g>
<g>
<path clip-rule="evenodd"
d="M131.012 68.469c-20.294 5.482-35.874 16.834-38.992 43.7 C68.354 94.6 98.1 47 131 68.469z" />
<path clip-rule="evenodd"
d="M161.475 59.629c12.752-4.078 0 17.3 8.7 17.3 c-9.173 6.152-19.891-10.842-34.687-8.67C140.716 62 158 67.7 161.5 59.629z" />
<path clip-rule="evenodd"
d="M76.527 92.79c1.633 4.2 3.7 8.7 6.2 12.5 c2.608 3.9 6.1 7.4 11.2 7.159c-12.189 3.479-23.696 8.262-32.159 18.087c-8.423 9.783-13.461 22.025-16.949 34.3 c-9.061-6.983-14.794 8.593-17.451 14.883c-2.349 5.562-4.978 21.5 6.6 13.891c4.448-2.942 6.602-8.919 12.695-9.151 c-2.969 8.274-6.594 15.987-16.213 17.148c-6.54 0.793-13.054-1.491-18.517-4.962c-2.951-1.873-12.159-8.419-11.935-12.306 c0.512-8.898 10.552-1.189 11.557-8.245c0.624-4.385 0.271-8.806 1.136-13.17c0.908-4.596 2.435-9 2.911-13.689 c3.605 0.3 1.2 6.6 3.9 7.8c10.032-3.507 16.879-11.737 21.362-21.088c2.364-4.937 4.222-10.091 5.968-15.275 c1.456-4.331 1.404-9.623 4.134-13.46c2.841-3.982 7.878-4.951 12.226-6.405C68.082 99.2 72.8 96.4 76.5 92.79z" />
<path clip-rule="evenodd"
d="M99.255 119.897c9.81 1.9 10.7 5.8 14.9 10.4 c-6.827 6.479-9.902 22.673-5.977 28.901C95.175 156.3 96.8 135.4 99.3 119.897z" />
<path clip-rule="evenodd"
d="M121.206 137.488c4.894 3 4.4 9.1 6.3 13.9 c-4.936 6.197-10.997 10.411-12.33 22.914C112.079 163.8 115.3 148.9 121.2 137.488z" />
<path clip-rule="evenodd"
d="M121.605 0c-8.263 15.3 13.1 46.006-1.949 62.4 c-4.596 0.042-5.744-3.36-11.703-1.95C127.689 49.1 102.9 13.8 121.6 0z" />
<path clip-rule="evenodd"
d="M61.149 5.85c0.1 1.5 1.8 3.1 1.8 5.2 c0.022 2.82-1.059 5.84-1.923 8.48c-2.215 6.783-5.087 13.333-7.233 20.14c-2.608 8.272-5.14 16.396-3.13 25.2 c1.524 6.7 5.9 11.6 11.8 5.692c10.53-10.562 13.605-29.733 18.273-43.378c2.764-8.071 6.217-16.493 11.633-23.199 c-2.654 3.288-2.392 9.859-3.548 13.882c-1.621 5.636-4.147 11.421-3.27 17.417c1.068 7.3 7 7.1 12.4 4.2 c-2.96 1.573-4.405 7.437-6.289 9.995c-2.853 3.876-5.893 7.625-8.38 11.76c-5.954 9.899-8.374 20.95-6.517 32.4 c-7.399 4.952-11.64 13.063-25.353 11.702c-13.303 10.749-23.374 24.729-27.301 44.855c-8.519-20.394 8.5-46.808 19.502-60.457 c-2.158-18.473-6.726-26.699-3.901-40.953C43.038 31.9 62.5 25.6 61.1 5.85z" />
<path clip-rule="evenodd"
d="M174.777 89.915c4.768-4.601 12.5 8.9 24.8 5 c-3.096 9.324-6.504 18.33-7.452 29.802C186.195 113.3 185.1 96.9 174.8 89.915z" />
<path clip-rule="evenodd"
d="M96.251 171.615c-2.344 13.276-7.652 40.438-19.501 50.7 c-12.253 1.199-12.991-9.11-23.404-9.753c1.273-5.876 7.661-6.643 9.752-11.697c2.327-15.337-1.888-48.907-13.054-56.462 c6.053-10.196 13.143-22.067 26.409-25.055c-1.406 8.7 9.6 20.2 10 26.911c1.374 19.759-16.337 38.35-11.705 64.4 C85.648 209.1 89.4 183.7 96.3 171.615z" />
<path clip-rule="evenodd"
d="M192.558 129.948c5.485 9.1 6.5 22.7 14.6 29.3 c-5.582 5.123-22.907 35.464-17.555 23.41C189.939 164.4 194.5 150.4 192.6 129.948z" />
</g>
<path clip-rule="evenodd"
d="M99.087 116.263c0 0 10.719-54.502 47.354-40.207 c0 0 54.2 11.5 32.2 97.39C162.524 236 234 236 234 235.987s-109.006 42.894-101.854-68.795 C132.147 167.2 133.9 122.5 99.1 116.263z" />
</g>
</svg>
<img src="/assets/img/dg_logo.png" class="logo-dg" alt="Ashley Watson-Nolan">
</a>
</div>
<!-- main navigation links -->
<section id="nav-strip" class="nav-strip">
<!-- Global Navigation links -->
<nav id="page-nav" class="nav-global">
<ul>
<li class="nav-global-item"><a href="/blog/" data-hover="Blog">Blog</a><span class="navArrow"></span></li><!--
--><li class="nav-global-item"><a href="/work" data-hover="Work">Work</a><span class="navArrow"></span></li><!--
--><li class="nav-global-item last "><a href="/about" data-hover="About">About</a><span class="navArrow"></span></li>
</ul>
</nav> </section>
</header>
<section class="content post">
<h1>Getting started with the OSX terminal</h1>
<p>For around 18 months now I’ve been using the terminal more and more. Perhaps the most suprising part of this has been just how enjoyable it is to use once you move past the very basics and become more proficient with what can at first seem on a level with black magic.</p>
<p>Whereas historically it was unusual for a front-end dev to stare too deeply into the command line abyss, it has now become a tool that can aid many front-end tasks. Whether using git, grunt or jekyll, there are many tools that require a small amount of terminal knowledge.</p>
<p>So I wanted to jot down the basics when starting out with the terminal and share some of the most common and useful commands that I tend to use most often.</p>
<p>Note. The commands and shortcuts will refer directly to the OSX terminal, but many of the basics cross over to Windows command line as well.</p>
<h2 id="the-very-basics">The very basics</h2>
<p>The most basic terms you'll need to survive on the command line:</p>
<dl>
<dt><dfn><strong>cd</strong></dfn></dt>
<dd>
<p>Short for change directory and will navigate to the directory specified after the command.</p>
<p>For example, <code>cd Users/Sites/</code> will move you into the Users/Sites folder.</p>
<p>To navigate back one directory (to the current locations parent directory) use <code>cd ../</code>. To return to your home directory type <code>cd</code>. To return to the previous directory you were located in type <code>cd -</code>.</p>
<p>Using the <code>~</code> character means to use the $HOME internal variable, which is usually the root directory of the current user. So for example typing <code>cd ~/</code> means to traverse from the users home directory.</p>
<p>To navigate to a folder which has spaces in its folder name, use <code>cd /Users/Ash/My\ Folder\ Name/</code> where the <code>\</code> escapes each space or <code>cd “/Users/Ash/My Folder Name/"</code>.</p>
</dd>
<dt><dfn><strong>mkdir</strong></dfn></dt>
<dd>Short for make directory and, as you might have guessed, this command creates a directory. Usage is like so <code>mkdir my-directory-name</code>.</dd>
<dt><dfn><strong>pwd</strong></dfn></dt>
<dd>Displays the path of the current directory. Useful for finding your current terminal location in the filesystem.</dd>
<dt><dfn><strong>touch</strong></dfn></dt>
<dd>Creates a file. Used like so: <code>touch index.html</code> or can be used to create multiple files by writing <code>touch index.html default.css</code>.</dd>
<dt><dfn><strong>cp</strong></dfn></dt>
<dd>Short for copy. Used like so: <code>cp /Users/Ash/originalfile.txt tmp/copiedfile.txt</code>.</dd>
<dt><dfn><strong>ls</strong></dfn></dt>
<dd>
<p>Short for list. Lists all files in a directory.</p>
<p>To view files as a vertical list use <code>ls -l</code>.</p>
<p>To view all files including hidden ones use <code>ls -a</code>.</p>
<p>To view only directories, type <code>ls -l | grep '^d'</code></p>
</dd>
<dt><dfn><strong>mv</strong></dfn></dt>
<dd>Short for move. Used in the same way as copy (cp).</dd>
<dt><dfn><strong>rm</strong></dfn></dt>
<dd>Short for remove (more commonly known as deleting). To remove a folder use <code>rm -rf folder-name</code>.</dd>
<dt><dfn><strong>open</strong></dfn></dt>
<dd><p>Opens a file.</p>
<p><code>open .</code> opens the current directory in a Finder window.</p>
</dd>
<dt><dfn><strong>man</strong></dfn></dt>
<dd>Short for manual. For example, <code>man rm</code> will display information about the <code>rm</code> command.</dd>
</dl>
<p>A useful reference if you'd like to see more detail about what specific characters mean when using them on the command line is <a href="http://tldp.org/LDP/abs/html/special-chars.html">Chapter 3 of The Bash Reference Manual</a>.</p>
<h2 id="useful-keyboard-shortcuts">Useful Keyboard Shortcuts</h2>
<dl>
<dt><dfn><strong>Tab</strong></dfn></dt>
<dd>Autocomplete a path. When entering a long path name it can be tedious to type out, hitting tab will autocomplete as much of the filename as it can match from what you have already typed. Hitting tab twice will show all options available that match what you have written. This enables quicker traversing of folders and files.</dd>
<dt><dfn><strong>↑ (Up Arrow)</strong></dfn></dt>
<dd>Toggles trough previously entered commands. Useful for repeating long commands that are still in the terminal history.</dd>
<dt><dfn><strong>Alt + ← or → (Left or Right Arrow)</strong></dfn></dt>
<dd>Skips word. Useful when navigating through long commands you have typed.</dd>
<dt><dfn><strong>Alt + Mouse click</strong></dfn></dt>
<dd>Holding down the Alt key and then using your mouse enables you to move your cursor to a specific part of the typed command. Useful when needing to edit commands that are quite long.</dd>
<dt><dfn><strong>Ctrl + A</strong></dfn></dt>
<dd>Move the terminal cursor position to the start of the line.</dd>
<dt><dfn><strong>Ctrl + E</strong></dfn></dt>
<dd>Move the terminal cursor position to the end of the line.</dd>
<dt><dfn><strong>Ctrl + XX (X pressed twice)</strong></dfn></dt>
<dd>Toggle the cursor position between the start of the line and its current position.</dd>
<dt><dfn><strong>Ctrl + U</strong></dfn></dt>
<dd>Clear all text behind the terminal cursor. So pressing this when at the end of a line will clear the whole line.</dd>
<dt><dfn><strong>Ctrl + W</strong></dfn></dt>
<dd>Cut the word before the cursor to the terminal clipboard.</dd>
<dt><dfn><strong>Ctrl + Y</strong></dfn></dt>
<dd>Paste the last thing to be cut to the clipboard.</dd>
<dt><dfn><strong>Cmd + T</strong></dfn></dt>
<dd>Opens up a new terminal window in a separate tab.</dd>
<dt><dfn><strong>Cmd + Shift + ← or → (Left or Right Arrow)</strong></dfn></dt>
<dd>Navigate between open terminal tabs.</dd>
<dt><dfn><strong>Ctrl + C</strong></dfn></dt>
<dd>Stop Process from running. Useful when running grunt or git commands for example if you realise you don't want them to run after executing them.</dd>
<dt><dfn><strong>Ctrl + Z</strong></dfn></dt>
<dd>Suspend process. Different to <code>Ctrl + C</code> as it doesn’t completely stop the process – you can return to it later by entering <code>fg 'process name'</code> where <code>fg</code> stands for foreground.</dd>
<dt><dfn><strong>Ctrl + R</strong></dfn></dt>
<dd>Search through your terminal history. Let’s you start typing to find a command you have previously written. Hugely useful for recalling longer commands you have previously written.</dd>
</dl>
<h2 id="building-on-the-basics">Building on the basics</h2>
<dl>
<dt><dfn><strong>clear</strong></dfn></dt>
<dd>
<p>Clears the current window, although you will still be able to scroll back up to see your history. You can also use <code>Ctrl + L</code> as a shortcut.</p>
<p>If you use iTerm (see later in article), you can also clear the screen with <code>Cmd + K</code></p>
</dd>
<dt><dfn><strong>!!</strong></dfn></dt>
<dd>Repeat the previous command executed. For example, if you needed to repeat the previous command with admin privileges, you could type <code>sudo !!</code>.</dd>
<dt><dfn><strong>&&</strong></dfn></dt>
<dd>Lets you chain commands. So <code>cd Sites/AshsFolder && mkdir css</code> will change the directory to the Folder “Sites/AshsFolder” and create a new folder called "css".</dd>
<dt><dfn><strong>killall</strong></dfn></dt>
<dd>Kills an Application dead. So for example, typing <code>killall Finder</code> will restart all Finder windows.</dd>
<dt><dfn><strong>-v</strong></dfn></dt>
<dd>
<p>Requests the version of the operator being called. So <code>ruby -v</code> will display the version of ruby installed.</p>
<p>Sometimes, packages can use a slightly different terminology such as Git which uses <code>git —version</code>.</p>
</dd>
<dt><dfn><strong>caffeinate</strong></dfn></dt>
<dd>Prevents Mac from sleeping.</dd>
<dt><dfn><strong>ping</strong></dfn></dt>
<dd>Will attempt to ping a web server and give a response. Ping sends very small bits of information over a network to a remote computer, timing how long it takes for a response to be received. So typing <code>ping www.bbc.co.uk</code> attempts to get a response from www.bbc.co.uk and will tell you the response time. Useful for checking if a server is responding or to find the external IP of a web address.</dd>
<dt><dfn><strong>top</strong></dfn></dt>
<dd>View all active processes.</dd>
<dt><dfn><strong>grep</strong></dfn></dt>
<dd>Find text inside files.</dd>
<dt><dfn><strong>Find local IP Address</strong></dfn></dt>
<dd><code>ipconfig getifaddr en1</code></dd>
<dt><dfn><strong>Find external IP Address</strong></dfn></dt>
<dd><code>curl ipecho.net/plain; echo</code></dd>
<dt><dfn><strong>View file system usage in realtime</strong></dfn></dt>
<dd><code>sudo fs_usage</code></dd>
<dt><dfn><strong>Changing system preferences</strong></dfn></dt>
<dd>
<p>You can change all sorts of OSX preferences straight from your command line. If you know about <a href="http://dotfiles.github.io/">dotfiles</a>, then an OSX dotfile simply runs a set of bash commands on your command line to make a set of preference changes.
<p>For example, to show hidden files and folders in Finder windows, you can run this command in your terminal – <code>defaults write com.apple.finder AppleShowAllFiles -bool TRUE; killall Finder</code>.</p>
<p>To see more examples of preference command line, <a href="https://github.com/ashleynolan/dotfiles/blob/master/.osx">checkout my OSX dotfile</a>.</p>
</dd>
</dl>
<h2 id="aliases">Aliases</h2>
<p>Aliases are a godsend for making short work of commonly used commands. They are basically a way of creating a shorthand of a longer command, so that you can then type the shorter command in order to execute it.</p>
<p> I have written a separate article about <a href="/blog/beginners-guide-to-terminal-aliases-and-functions">how to create terminal aliases and functions</a>, so if you're interested in finding out more, go take a look.</p>
<h2 id="iterm">iTerm</h2>
<p>An emulator for the default terminal provided by Mac OSX, iTerm provides extra features that the default terminal doesn't.</p>
<p>Especially useful for creating profiles – shortcuts for common directories and commands – and providing split pane views, a number of its features are <a href="http://www.iterm2.com/#/section/features">detailed on its site</a>.</p>
<p>If you want to know more about iTerm, <a href="http://www.iterm2.com/">checkout its website</a>.</p>
<h2 id="-and-finally-for-shits-and-giggles">…and finally, for shits and giggles</h2>
<dl>
<dt><dfn><strong>See your most used terminal commands</strong></dfn></dt>
<dd><code>history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -nr | head</code></dd>
<dt><dfn><strong>Shutdown your Mac with a delay</strong></dfn></dt>
<dd>Useful for when you have a grudge that needs satisfying; <code>sudo shutdown -r +60</code>.</dd>
</dl>
<h2 id="got-any-more-">Got any more?</h2>
<p>I’m always interested in seeing what terminal commands people find most useful, so if you haveof a command that you can’t live without, I’d love to hear about it in the comments!</p>
<div class="promotion promotion--ad separator-both">
<script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?serve=CE7D5KQI&placement=ashleynolancouk"
id="_carbonads_js"></script>
</div>
<p class="post-info separator-top">Article posted on the 24th June 2014</p>
<p>Last updated on the <date>21st January 2015</date></p>
<div id="disqus_thread" class="comments separator-top"></div>
</section>
<footer class="page-footer border-grey-white-top">
<!-- Social links -->
<nav class="links-social">
<ul>
<li class="links-social-item links-social-email"><a href="mailto:hello@ashleynolan.co.uk" title="Email Me"
rel="external" target="_blank"><span class="links-social-icon icon-email-shaded"></span><span
class="screen-reader-text">Email</span></a></li>
<li class="links-social-item links-social-twitter"><a href="http://twitter.com/WelshAsh_"
title="Find me on Twitter" rel="external" target="_blank"><span
class="links-social-icon icon-twitter"></span><span class="screen-reader-text">Twitter</span></a>
</li>
<li class="links-social-item links-social-linkedin"><a href="http://uk.linkedin.com/pub/ashley-nolan/16/980/684"
title="My LinkedIn Profile" rel="external" target="_blank"><span
class="links-social-icon icon-linkedin"></span><span class="screen-reader-text">LinkedIn</span></a>
</li>
</ul>
</nav>
<div class="footer-content">
<p>I'm Ashley Watson-Nolan, a Principal UI Engineer at Just Eat. Do take a look around, or contact me in any of
the usual ways – it'd be great to hear from you.</p>
</div>
</footer>
</div>
<script type="text/javascript">
window.disqusConfig = {
url: 'https://ashleynolan.co.uk/blog/getting-started-with-terminal', // Replace PAGE_URL with your page's canonical URL variable
identifier: 'Getting started with the OSX terminal' // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-20668207-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>
| {
"content_hash": "d7c86c7698f780633b6dfc93d839c423",
"timestamp": "",
"source": "github",
"line_count": 359,
"max_line_length": 721,
"avg_line_length": 61.00278551532033,
"alnum_prop": 0.6694520547945205,
"repo_name": "ashleynolan/dg-blog",
"id": "f6463dbb9feff9914c2c63bebf3fa62017422556",
"size": "21946",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dist/blog/getting-started-with-terminal.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "134464"
},
{
"name": "HTML",
"bytes": "280037"
},
{
"name": "JavaScript",
"bytes": "382610"
},
{
"name": "PHP",
"bytes": "588"
}
],
"symlink_target": ""
} |
package com.example.android.miwok;
import android.content.Context;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import java.util.ArrayList;
public class NumbersActivity extends AppCompatActivity {
/**
* Handles playback of all the sound files
*/
private MediaPlayer mMediaPlayer;
/**
* Handles audio focus when playing a sound file
*/
private AudioManager mAudioManager;
/**
* This listener gets triggered whenever the audio focus changes
* (i.e., we gain or lose audio focus because of another app or device).
*/
private final AudioManager.OnAudioFocusChangeListener mOnAudioFocusChangeListener = new AudioManager.OnAudioFocusChangeListener() {
/**
* Called on the listener to notify it the audio focus for this listener has been changed.
* The focusChange value indicates whether the focus was gained,
* whether the focus was lost, and whether that loss is transient, or whether the new focus
* holder will hold it for an unknown amount of time.
* When losing focus, listeners can use the focus change information to decide what
* behavior to adopt when losing focus. A music player could for instance elect to lower
* the volume of its music stream (duck) for transient focus losses, and pause otherwise.
*
* @param focusChange the type of focus change, one of {@link AudioManager#AUDIOFOCUS_GAIN},
* {@link AudioManager#AUDIOFOCUS_LOSS}, {@link AudioManager#AUDIOFOCUS_LOSS_TRANSIENT}
* and {@link AudioManager#AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK}.
*/
@Override
public void onAudioFocusChange(int focusChange) {
switch (focusChange) {
case AudioManager.AUDIOFOCUS_GAIN:
// The AUDIOFOCUS_GAIN case means we have regained focus and can resume playback.
if (mMediaPlayer != null) {
mMediaPlayer.start();
}
break;
case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT:
case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK:
// The AUDIOFOCUS_LOSS_TRANSIENT case means that we've lost audio focus for a
// short amount of time. The AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK case means that
// our app is allowed to continue playing sound but at a lower volume. We'll treat
// both cases the same way because our app is playing short sound files.
// Pause playback and reset player to the start of the file. That way, we can
// play the word from the beginning when we resume playback.
if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
mMediaPlayer.pause();
mMediaPlayer.seekTo(0);
}
break;
case AudioManager.AUDIOFOCUS_LOSS:
// The AUDIOFOCUS_LOSS case means we've lost audio focus and
// Stop playback and clean up resources
if (mMediaPlayer != null) {
releaseMediaPlayer();
}
break;
default:
break;
}
}
};
/**
* This listener gets triggered when the {@link MediaPlayer} has completed
* playing the audio file.
*/
private final MediaPlayer.OnCompletionListener mOnCompletionListener = new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
// Now that the sound file has finished playing, release the media player resources.
releaseMediaPlayer();
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.word_list);
// Create and setup the {@link AudioManager} to request audio focus
mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
// Initialize words ArrayList
final ArrayList<Word> words = new ArrayList<>();
// Create a list of words
words.add(new Word("one", "lutti", R.drawable.number_one, R.raw.number_one));
words.add(new Word("two", "otiiko", R.drawable.number_two, R.raw.number_two));
words.add(new Word("three", "tolookosu", R.drawable.number_three, R.raw.number_three));
words.add(new Word("four", "oyyisa", R.drawable.number_four, R.raw.number_four));
words.add(new Word("five", "massokka", R.drawable.number_five, R.raw.number_five));
words.add(new Word("six", "temmokka", R.drawable.number_six, R.raw.number_six));
words.add(new Word("seven", "kenekaku", R.drawable.number_seven, R.raw.number_seven));
words.add(new Word("eight", "kawinta", R.drawable.number_eight, R.raw.number_eight));
words.add(new Word("nine", "wo’e", R.drawable.number_nine, R.raw.number_nine));
words.add(new Word("ten", "na’aacha", R.drawable.number_ten, R.raw.number_ten));
// Create an {@link ArrayAdapter}, whose data source is a list of Strings. The
// adapter knows how to create layouts for each item in the list, using the
// simple_list_item_1.xml layout resource defined in the Android framework.
// This list item layout contains a single {@link TextView}, which the adapter will set to
// display a single word.
WordAdapter itemsAdapter =
new WordAdapter(this, words, R.color.category_numbers);
// Find the {@link ListView} object in the view hierarchy of the {@link Activity}.
// There should be a {@link ListView} with the view ID called list, which is declared in the
// word_list.xml file.
ListView listView = (ListView) findViewById(R.id.list);
// Make the {@link ListView} use the {@link ArrayAdapter} we created above, so that the
// {@link ListView} will display list items for each word in the list of words.
// Do this by calling the setAdapter method on the {@link ListView} object and pass in
// 1 argument, which is the {@link ArrayAdapter} with the variable name itemsAdapter.
listView.setAdapter(itemsAdapter);
// Make an OnItemClickListener
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
/**
* Callback method to be invoked when an item in this AdapterView has
* been clicked.
* <p>
* Implementers can call getItemAtPosition(position) if they need
* to access the data associated with the selected item.
*
* @param parent The AdapterView where the click happened.
* @param view The view within the AdapterView that was clicked (this
* will be a view provided by the adapter)
* @param position The position of the view in the adapter.
* @param id The row id of the item that was clicked.
*/
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Word word = words.get(position);
// Call before MediaPlayer is initialized
releaseMediaPlayer();
// Request audio focus so in order to play the audio file. The app needs to play a
// short audio file, so we will request audio focus with a short amount of time
// with AUDIOFOCUS_GAIN_TRANSIENT.
int result = mAudioManager.requestAudioFocus(mOnAudioFocusChangeListener,
AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
if (result == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
// We have audio focus now
// Create and setup the {@link MediaPlayer} for the audio resource associated
// with the current word
mMediaPlayer = MediaPlayer.create(NumbersActivity.this, word.getSoundResourceId());
// Start the audio file
mMediaPlayer.start();
// To prevent getting MediaPlayer error (-19,0), I added this
// @see https://stackoverflow.com/a/9888612/1469260
// Updated and refactored with the Udacity code snippet
mMediaPlayer.setOnCompletionListener(mOnCompletionListener);
}
}
});
}
@Override
protected void onStop() {
super.onStop();
// Whe the activity is stopped, release the media player resources because we don't
// be playing any more sounds.
releaseMediaPlayer();
}
/**
* Clean up the media player by releasing its resources.
*/
private void releaseMediaPlayer() {
// If the media player is not null, then it may be currently playing a sound.
if (mMediaPlayer != null) {
// Regardless of the current state of the media player, release its resources
// because we no longer need it.
mMediaPlayer.release();
// Set the media player back to null. For our code, we've decided that
// setting the media player to null is an easy way to tell that the media player
// is not configured to play an audio file at the moment.
mMediaPlayer = null;
// Regardless of whether or not we were granted audio focus, abandon it. This also
// unregisters the AudioFocusChangeListener so we don't get anymore callbacks.
mAudioManager.abandonAudioFocus(mOnAudioFocusChangeListener);
}
}
}
| {
"content_hash": "948568481974851e91e5c7aff4b8e421",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 135,
"avg_line_length": 49.091787439613526,
"alnum_prop": 0.6156268451092305,
"repo_name": "jensgreiner/Miwok",
"id": "6f549466861532bf3eb5ab495a0a00cf5f7b6a23",
"size": "10166",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/com/example/android/miwok/NumbersActivity.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "51492"
}
],
"symlink_target": ""
} |
<?php
namespace Q\PvBundle\Resources\Lib;
/**
* Description of Query
*
* @author Isaac
*/
class QueryInsert
{
private $conn;
function __construct($conn)
{
$this->conn = $conn;
}
public function insertProducto($data,$userId)
{
// Hacemos dos querys en la misma sentencia.
$sql = "START TRANSACTION;
INSERT INTO producto (
nombre ,
descripcion ,
fecha_creacion ,
fecha_modificacion ,
codigo_de_barras
)
VALUES (
:nombre ,
:descripcion ,
CURRENT_TIMESTAMP ,
CURRENT_TIMESTAMP ,
:codigo_de_barras
);
INSERT INTO almacen_has_producto (
almacen_id ,
producto_id ,
impuesto_id ,
precio_compra ,
precio_venta ,
precio_mayoreo ,
cantidad_para_mayoreo ,
cantidad_minima ,
cantidad_actual ,
agotado ,
disponible ,
activo ,
codigo_proveedor ,
sku ,
codigo_de_venta ,
codigo_de_compra
)
VALUES (
:almacen_id ,
LAST_INSERT_ID() ,
:impuesto_id ,
:precio_compra ,
:precio_venta ,
:precio_mayoreo ,
:cantidad_para_mayoreo ,
:cantidad_minima ,
:cantidad_actual ,
FALSE ,
:disponible ,
TRUE ,
:codigo_proveedor,
:sku ,
:codigo_de_venta ,
:codigo_de_compra
);
INSERT INTO user_has_producto(
user_id ,
producto_id
)
VALUES (
:user_id ,
LAST_INSERT_ID()
);
COMMIT;";
$st = $this->conn->prepare($sql);
// Tabla de producto
$st->bindValue("nombre", $data['nombre'], \PDO::PARAM_STR);
$st->bindValue("descripcion", $data['descripcion'], \PDO::PARAM_STR);
$st->bindValue("codigo_de_barras", $data['codigoDeBarras'], \PDO::PARAM_STR);
//Tabla de almacen_has_prodcuto
$st->bindValue("almacen_id", $data['almacen'], \PDO::PARAM_INT);
$st->bindValue("impuesto_id", $data['impuesto'], \PDO::PARAM_INT);
$st->bindValue("precio_compra", $data['precioCompra'], \PDO::PARAM_STR);
$st->bindValue("precio_venta", $data['precioVenta'], \PDO::PARAM_STR);
$st->bindValue("precio_mayoreo", $data['precioMayoreo'], \PDO::PARAM_STR);
$st->bindValue("cantidad_para_mayoreo", $data['cantidadParaMayoreo'], \PDO::PARAM_STR);
$st->bindValue("cantidad_minima", $data['cantidadMinima'], \PDO::PARAM_STR);
$st->bindValue("cantidad_actual", $data['cantidadActual'], \PDO::PARAM_STR);
$st->bindValue("disponible", $data['disponible'], \PDO::PARAM_BOOL);
$st->bindValue("codigo_proveedor", $data['codigoProveedor'], \PDO::PARAM_STR);
$st->bindValue("sku", $data['sku'], \PDO::PARAM_STR);
$st->bindValue("codigo_de_venta", $data['codigoDeVenta'], \PDO::PARAM_STR);
$st->bindValue("codigo_de_compra", $data['codigoDeCompra'], \PDO::PARAM_STR);
// tabla de usuario tiene productos
$st->bindValue("user_id", $userId, \PDO::PARAM_STR);
$st->execute();
}
} | {
"content_hash": "9c70824ee7a238bc6a2925161090f975",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 95,
"avg_line_length": 32.97435897435897,
"alnum_prop": 0.45204769310523585,
"repo_name": "limonazzo/wpv",
"id": "93d268c1ebaf968882832d1ecc8f72c60a152939",
"size": "3858",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Q/PvBundle/Resources/Lib/QueryInsert.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "122805"
},
{
"name": "JavaScript",
"bytes": "178894"
},
{
"name": "PHP",
"bytes": "229143"
},
{
"name": "Shell",
"bytes": "192"
}
],
"symlink_target": ""
} |
.alignCenter {
text-align: center;
}
.alignRight {
text-align: right;
}
.alignLeft {
text-align: left;
}
.alignTop {
vertical-align: top;
}
.alignMiddle {
vertical-align: middle;
}
.alignLeftTop {
text-align: left;
vertical-align: top;
}
.alignBottom {
vertical-align: bottom;
}
.alignRightTop {
vertical-align: top;
text-align: right;
float: right;
}
.bolded {
font-weight: bold;
}
.nowrap {
white-space: nowrap;
}
.width100 {
width: 100%;
}
.name {
vertical-align: top;
font-weight: bold;
min-width: 135px;
float: left;
padding-left: 0px;
clear: left;
}
.nameText {
vertical-align: top;
font-weight: bold;
min-width: 135px;
float: left;
padding-top: 5px;
padding-bottom: 5px;
padding-left: 0px;
clear: left;
}
.striked {
text-decoration: line-through;
}
.value {
float: left;
padding: 5px;
}
#loginForm{
margin:0 auto;
width:320px;
}
#loginForm .dr-pnl{
background-color: transparent;
border: none;
}
#loginForm .dr-pnl-b {
background-image: url("#{resource['images/loginbox_bg.jpg']}") !important;
border: 1px solid #819ea0 !important;
}
#loginForm .dr-pnl-h {
background-color: transparent;
background-image: none;
border: none;
color: #3b3b3b;
font-size: 24px;
margin-bottom:5px;
}
#trustRelationshipForm,
#personForm{
width: 770px !important;
margin: 0 auto;
}
#personForm{
margin-top:15px;
}
#trustRelationshipForm .attributeColumn,
#personForm .attributeColumn{
width:300px !important;
}
#formArea {
border:1px solid #C0C0C0;
margin:0 auto;
padding:15px;
width:800px;
}
#updateOrganization {
border:1px solid #C0C0C0;
margin:0 auto;
padding:15px;
width:650px;
}
#modifyScopeDescription {
background-image:url("#{resource['images/seam2_bg.jpg']}");
border:1px solid #C0C0C0;
margin:0 auto;
padding:15px;
width:650px;
}
#updateCacheRefresh {
background-image:url("/gluu/img/seam2_bg.jpg");
border:1px solid #C0C0C0;
margin:0 auto;
padding:15px;
width:650px;
}
#personImport {
background-image:url("#{resource['images/seam2_bg.jpg']}");
border:1px solid #C0C0C0;
margin:0 auto;
padding:15px;
width:650px;
}
#addGroup {
background-image:url("#{resource['images/seam2_bg.jpg']}");
border:1px solid #C0C0C0;
margin:0 auto;
padding:15px;
width:650px;
}
#addClient {
background-image:url("#{resource['images/seam2_bg.jpg']}");
border:1px solid #C0C0C0;
margin:0 auto;
padding:15px;
width:650px;
}
#addScope {
background-image:url("#{resource['images/seam2_bg.jpg']}");
border:1px solid #C0C0C0;
margin:0 auto;
padding:15px;
width:650px;
}
#updateScope {
background-image:url("#{resource['images/seam2_bg.jpg']}");
border:1px solid #C0C0C0;
margin:0 auto;
padding:15px;
width:650px;
}
#updateClient {
background-image:url("#{resource['images/seam2_bg.jpg']}");
border:1px solid #C0C0C0;
margin:0 auto;
padding:15px;
width:650px;
}
#updateGroup {
background-image:url("#{resource['images/seam2_bg.jpg']}");
border:1px solid #C0C0C0;
margin:0 auto;
padding:15px;
width:650px;
}
#updatePerson {
background-image:url("#{resource['images/seam2_bg.jpg']}");
border:1px solid #C0C0C0;
margin:0 auto;
padding:15px;
width:650px;
}
#selectScopeModelPanelHeader{
background-image: url("#{resource['images/personinventorytable_bg.jpg']}");
height:20px;
padding:5px 0 0 10px;
border: 0;
}
#selectScopeModelPanelContainer #scopeFormId input[type="text"] {
margin-right:5px;
padding:3px;
}
#selectGroupModelPanelHeader{
background-image: url("#{resource['images/personinventorytable_bg.jpg']}");
height:20px;
padding:5px 0 0 10px;
border: 0;
}
#selectGroupModelPanelContainer #groupFormId input[type="text"] {
margin-right:5px;
padding:3px;
}
#selectURIModelPanelHeader{
background-image: url("#{resource['images/personinventorytable_bg.jpg']}");
height:20px;
padding:5px 0 0 10px;
border: 0;
}
#selectURIModelPanelContainer #URIFormId input[type="text"] {
margin-right:5px;
padding:3px;
}
#selectClaimModelPanelHeader{
background-image: url("#{resource['images/personinventorytable_bg.jpg']}");
height:20px;
padding:5px 0 0 10px;
border: 0;
}
#selectClaimModelPanelContainer #claimFormId input[type="text"] {
margin-right:5px;
padding:3px;
}
/* Add Group Panel Styling */
#passwordPanelHeader,
#selectMemberModelPanelHeader{
background-image: url("#{resource['images/personinventorytable_bg.jpg']}");
height:20px;
padding:5px 0 0 10px;
border: 0;
}
#selectMemberModelPanelContainer #memberFormId input[type="text"] {
margin-right:5px;
padding:3px;
}
.rich-mpnl-controls {
right:7px !important;
top:7px !important;
}
#detectPoken{
float:left;
margin:5px 5px 0 0;
}
#ContactsFormId{
text-align:right;
margin: 15px 0 0 0;
}
#ContactsFormId input{
margin-right:0 !important;
padding:3px !important;
}
#ContactsFormId table{
text-align:left;
}
.personCheckbox {
margin-left: 0px;
}
.personAddBtn {
margin-left: 5px !important;
}
#register{
margin:0 auto;
width:600px;
}
#personRegistrationForm {
width: 650px !important;
margin: 0 auto;
margin-top:15px;
}
#personRegistrationForm .attributeColumn{
width:300px !important;
}
#register .info{
height:285px;
padding: 10px;
}
#register h1{
color: #105259;
font-size: 24px;
}
/*#registrationFormHolder {*/
/*float: left;*/
/*}*/
#captchaHolder {
margin-left: 118px;
margin-top: 10px;
float: left;
}
/* Logo */
#logo {
margin: 10px
}
/* Toolbar */
.rf-tb,.rf-tb-itm {
/* background-color: green;
background-image: url("#{resource['images/menu_bg.png']}") !important; */
height: 33px;
font-weight: bold;
font-size: 12px;
font-family: Verdana, Arial, sans-serif;
}
.half{
width: 50%;
} | {
"content_hash": "1f1712851e09dff26d95dffcaa3cc911",
"timestamp": "",
"source": "github",
"line_count": 361,
"max_line_length": 79,
"avg_line_length": 17.87534626038781,
"alnum_prop": 0.6135130946846428,
"repo_name": "diedertimmers/oxTrust",
"id": "c3d2644607abf1cf6f60e5f4bb1df103fea4215a",
"size": "6453",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "static/src/main/resources/META-INF/resources/stylesheet/site.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "827261"
},
{
"name": "HTML",
"bytes": "634925"
},
{
"name": "Java",
"bytes": "1894959"
},
{
"name": "JavaScript",
"bytes": "709648"
},
{
"name": "Python",
"bytes": "3161"
},
{
"name": "Ruby",
"bytes": "1105"
}
],
"symlink_target": ""
} |
<link rel="stylesheet" href="apps/about/etc/about.css" type="text/css" />
<div id="about">
<div id="logo_tile">
<img src="apps/about/etc/logo.png" width="335" height="85" alt="oxygen webos" class="logo">
</div>
<p><strong>Copyright (c) 2008 Ionuț Colceriu</strong></p>
<p>
MIT license.
</p>
</div>
| {
"content_hash": "9087c59a2fa0ee7f13b4caa6164ea69d",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 95,
"avg_line_length": 21.4,
"alnum_prop": 0.616822429906542,
"repo_name": "ghinda/oxygenos",
"id": "201c95ff65a6496f8e1122485eca248bb32705de",
"size": "322",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "apps/about/about.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "29410"
},
{
"name": "JavaScript",
"bytes": "194453"
},
{
"name": "PHP",
"bytes": "4377"
}
],
"symlink_target": ""
} |
import Pipe from "./pipe.js";
import ActiveFilter from "./activeFilter.js";
import OutputPipe from "./pipe2.js;"
import PipeActive from "./pipeActive.js"
import FilterPassive from "./filterPassive.js"
export default class ExampleRun2 {
constructor() {
this.dataSource = "https://lively-kernel.org/lively4/swd21-pipes-and-filters/demos/swd21/pipes-and-filters/datasource.json";
this.pipe = new Pipe();
this.opipe = new OutputPipe();
this.opipePassive = new OutputPipe();
this.filterPassive = new FilterPassive((elements) => {
var parsedElements = JSON.parse(elements)
return parsedElements.filter(elem => elem.name != "Apfel")
}, this.opipePassive)
this.pipeActive = new PipeActive(this.filterPassive)
this.activeFilter = new ActiveFilter(this.pipe, this.opipe)
}
// pushes Data into pipe as it is a active filter that checks the pipe in an interval
pushDataIntoPipe(newData) {
this.pipe.pushElement(newData)
}
// runs the active filter
async startActiveFilter() {
this.activeFilter.activeFilterData()
}
async createExampleRun(){
var dataFromSource = await this.getDataFromSource();
var parsedData = JSON.parse(dataFromSource)
var view = <div></div>
var inputField = <textarea rows="15" cols="50">{JSON.stringify(parsedData)}</textarea>
var startBtn = <button click={async () => {
this.startActiveFilter();
}}>start Active Filter</button>
var btn =
<button click={async () => {
this.pushDataIntoPipe(parsedData.shift());
inputField.value = JSON.stringify(parsedData)
}}>push Data into Pipe</button>
var stopBtn =
<button click={ () => {
this.activeFilter.stop();
}}>stop Active Filter</button>
var outputField = <textarea rows="15" cols="50" id="outputTextField"></textarea>
var outputFieldPassive = <textarea rows="15" cols="50" id="outputTextFieldPassive"></textarea>
var resetBtn =
<button click={ () => {
outputField.value = "";
outputFieldPassive.value = "";
parsedData = JSON.parse(dataFromSource)
inputField.value = JSON.stringify(parsedData)
}}>reset all</button>
var startActivePipeBtn =
<button click={ () => {
// TODO call active pipe
this.pipeActive.addElement(outputField.value)
}}>start active pipe</button>
//pass outputField to oPipe
this.opipe.setOutputElement(outputField);
//pass outputField to oPipe
this.opipePassive.setOutputElement(outputFieldPassive)
var divDataSource = <div></div>
divDataSource.append(inputField)
var divButtons1 = <div></div>
divButtons1.append(startBtn, btn, stopBtn)
var divBuffer = <div></div>
divBuffer.append(outputField)
var divButtons2 = <div></div>
divButtons2.append(startActivePipeBtn)
var divBuffer2 = <div></div>
divBuffer2.append(outputFieldPassive)
var divResetAll = <div></div>
divResetAll.append(resetBtn)
view.append(divDataSource, divButtons1, divBuffer, divButtons2, divBuffer2, divResetAll)
return view
}
async getDataFromSource() {
var data = await fetch(this.dataSource).then(r => r.text())
return data;
}
}
| {
"content_hash": "17335854e4a5a386f67953a9d2089764",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 128,
"avg_line_length": 29.57758620689655,
"alnum_prop": 0.6356747303993004,
"repo_name": "LivelyKernel/lively4-core",
"id": "bcdba169b4375685a81c2d34def5f75e751da41d",
"size": "3431",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "demos/swd21/pipes-and-filters/old/exampleRun2.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "144422"
},
{
"name": "HTML",
"bytes": "589346"
},
{
"name": "JavaScript",
"bytes": "4554338"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2012, The Android Open Source Project
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.
-->
<com.android.camera.ui.FaceView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"/>
| {
"content_hash": "9b9445edc6459a6fd5c31e4d94b3a452",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 90,
"avg_line_length": 46.68421052631579,
"alnum_prop": 0.713641488162345,
"repo_name": "jameliu/Camera2",
"id": "63e78860b01b9172776630dc4fa48ff28f3a8ab1",
"size": "887",
"binary": false,
"copies": "13",
"ref": "refs/heads/master",
"path": "app/src/main/res/layout/face_view.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2191271"
}
],
"symlink_target": ""
} |
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
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
$Id$
]]--
local require = require
local pairs = pairs
local print = print
local pcall = pcall
local table = table
module "luci.controller.rpc"
function index()
local function authenticator(validator, accs)
local auth = luci.http.formvalue("auth", true)
if auth then
local sdat = luci.sauth.read(auth)
user = loadstring(sdat)().user
if user and luci.util.contains(accs, user) then
return user, auth
end
end
luci.http.status(403, "Forbidden")
end
local rpc = node("rpc")
rpc.sysauth = "root"
rpc.sysauth_authenticator = authenticator
rpc.notemplate = true
entry({"rpc", "uci"}, call("rpc_uci"))
entry({"rpc", "uvl"}, call("rpc_uvl"))
entry({"rpc", "fs"}, call("rpc_fs"))
entry({"rpc", "sys"}, call("rpc_sys"))
entry({"rpc", "ipkg"}, call("rpc_ipkg"))
entry({"rpc", "auth"}, call("rpc_auth")).sysauth = false
end
function rpc_auth()
local jsonrpc = require "luci.jsonrpc"
local sauth = require "luci.sauth"
local http = require "luci.http"
local sys = require "luci.sys"
local ltn12 = require "luci.ltn12"
local util = require "luci.util"
local loginstat
local server = {}
server.challenge = function(user, pass)
local sid, token, secret
if sys.user.checkpasswd(user, pass) then
sid = sys.uniqueid(16)
token = sys.uniqueid(16)
secret = sys.uniqueid(16)
http.header("Set-Cookie", "sysauth=" .. sid.."; path=/")
sauth.write(sid, util.get_bytecode({
user=user,
token=token,
secret=secret
}))
end
return sid and {sid=sid, token=token, secret=secret}
end
server.login = function(...)
local challenge = server.challenge(...)
return challenge and challenge.sid
end
http.prepare_content("application/json")
ltn12.pump.all(jsonrpc.handle(server, http.source()), http.write)
end
function rpc_uci()
if not pcall(require, "luci.model.uci") then
luci.http.status(404, "Not Found")
return nil
end
local uci = require "luci.jsonrpcbind.uci"
local jsonrpc = require "luci.jsonrpc"
local http = require "luci.http"
local ltn12 = require "luci.ltn12"
http.prepare_content("application/json")
ltn12.pump.all(jsonrpc.handle(uci, http.source()), http.write)
end
function rpc_uvl()
if not pcall(require, "luci.uvl") then
luci.http.status(404, "Not Found")
return nil
end
local uvl = require "luci.jsonrpcbind.uvl"
local jsonrpc = require "luci.jsonrpc"
local http = require "luci.http"
local ltn12 = require "luci.ltn12"
http.prepare_content("application/json")
ltn12.pump.all(jsonrpc.handle(uvl, http.source()), http.write)
end
function rpc_fs()
local util = require "luci.util"
local io = require "io"
local fs2 = util.clone(require "nixio.fs")
local jsonrpc = require "luci.jsonrpc"
local http = require "luci.http"
local ltn12 = require "luci.ltn12"
function fs2.readfile(filename)
local stat, mime = pcall(require, "mime")
if not stat then
error("Base64 support not available. Please install LuaSocket.")
end
local fp = io.open(filename)
if not fp then
return nil
end
local output = {}
local sink = ltn12.sink.table(output)
local source = ltn12.source.chain(ltn12.source.file(fp), mime.encode("base64"))
return ltn12.pump.all(source, sink) and table.concat(output)
end
function fs2.writefile(filename, data)
local stat, mime = pcall(require, "mime")
if not stat then
error("Base64 support not available. Please install LuaSocket.")
end
local file = io.open(filename, "w")
local sink = file and ltn12.sink.chain(mime.decode("base64"), ltn12.sink.file(file))
return sink and ltn12.pump.all(ltn12.source.string(data), sink) or false
end
http.prepare_content("application/json")
ltn12.pump.all(jsonrpc.handle(fs2, http.source()), http.write)
end
function rpc_sys()
local sys = require "luci.sys"
local jsonrpc = require "luci.jsonrpc"
local http = require "luci.http"
local ltn12 = require "luci.ltn12"
http.prepare_content("application/json")
ltn12.pump.all(jsonrpc.handle(sys, http.source()), http.write)
end
function rpc_ipkg()
if not pcall(require, "luci.model.ipkg") then
luci.http.status(404, "Not Found")
return nil
end
local ipkg = require "luci.model.ipkg"
local jsonrpc = require "luci.jsonrpc"
local http = require "luci.http"
local ltn12 = require "luci.ltn12"
http.prepare_content("application/json")
ltn12.pump.all(jsonrpc.handle(ipkg, http.source()), http.write)
end
| {
"content_hash": "7a9e3fced1ed24f41bf498042f4fdf38",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 87,
"avg_line_length": 27.02247191011236,
"alnum_prop": 0.6952182952182953,
"repo_name": "alxhh/piratenluci",
"id": "510a025d5ba8f3b1a0a01aac3aa8eeec206e1f39",
"size": "4815",
"binary": false,
"copies": "2",
"ref": "refs/heads/luci-0.9",
"path": "modules/rpc/luasrc/controller/rpc.lua",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1044466"
},
{
"name": "C#",
"bytes": "42820"
},
{
"name": "C++",
"bytes": "279269"
},
{
"name": "Java",
"bytes": "49574"
},
{
"name": "JavaScript",
"bytes": "231270"
},
{
"name": "Lua",
"bytes": "1020220"
},
{
"name": "Perl",
"bytes": "52334"
},
{
"name": "Shell",
"bytes": "21195"
},
{
"name": "Visual Basic",
"bytes": "33030"
}
],
"symlink_target": ""
} |
/***
* A Resizer plugin that can be used to auto-resize a grid and/or resize with fixed dimensions.
* When fixed height is defined, it will auto-resize only the width and vice versa with the width defined.
* You can also choose to use the flag "enableAutoSizeColumns" if you want to the plugin to
* automatically call the grid "autosizeColumns()" method after each resize.
*
* USAGE:
*
* Add the "slick.resizer.js" file and register it with the grid.
*
* You can specify certain options as arguments when instantiating the plugin like so:
* var resizer = new Slick.Plugins.Resizer({
* container: '#gridContainer',
* rightPadding: 15,
* bottomPadding: 20,
* minHeight: 180,
* minWidth: 300,
* });
* grid.registerPlugin(resizer);
*
*
* The plugin exposes the following events:
*
* onGridAfterResize: Fired after the grid got resized. You can customize the menu or dismiss it by returning false.
* Event args:
* grid: Reference to the grid.
* dimensions: Resized grid dimensions used
*
* onGridBeforeResize: Fired before the grid gets resized. You can customize the menu or dismiss it by returning false.
* Event args:
* grid: Reference to the grid.
*
*
* @param {Object} options available plugin options that can be passed in the constructor:
* container: DOM element container selector (REQUIRED)
* rightPadding: Defaults to 0, right side padding to remove from the total dimension
* bottomPadding: Defaults to 20, bottom padding to remove from the total dimension
* minHeight: Defaults to 180, minimum height of the grid
* minWidth: Defaults to 300, minimum width of the grid
* maxHeight: Maximum height of the grid
* maxWidth: Maximum width of the grid
* calculateAvailableSizeBy: Defaults to "window", which DOM element ("container" or "window") are we using to calculate the available size for the grid?
*
* @class Slick.Plugins.Resizer
* @constructor
*/
'use strict';
(function ($) {
// register namespace
$.extend(true, window, {
"Slick": {
"Plugins": {
"Resizer": Resizer
}
}
});
function Resizer(options, fixedDimensions) {
// global variables, height/width are in pixels
var DATAGRID_MIN_HEIGHT = 180;
var DATAGRID_MIN_WIDTH = 300;
var DATAGRID_BOTTOM_PADDING = 20;
var _self = this;
var _fixedHeight;
var _fixedWidth;
var _grid;
var _gridOptions;
var _gridUid;
var _lastDimensions;
var _timer;
var _resizePaused = false;
var _gridDomElm;
var _gridContainerElm;
var _defaults = {
bottomPadding: 20,
minHeight: 180,
minWidth: 300,
rightPadding: 0
};
function init(grid) {
options = $.extend(true, {}, _defaults, options);
_grid = grid;
_gridOptions = _grid.getOptions();
_gridUid = _grid.getUID();
_gridDomElm = $(_grid.getContainerNode());
_gridContainerElm = $(options.container);
if (fixedDimensions) {
_fixedHeight = fixedDimensions.height;
_fixedWidth = fixedDimensions.width;
}
if (_gridOptions) {
bindAutoResizeDataGrid();
}
}
/** Bind an auto resize trigger on the datagrid, if that is enable then it will resize itself to the available space
* Options: we could also provide a % factor to resize on each height/width independently
*/
function bindAutoResizeDataGrid(newSizes) {
// if we can't find the grid to resize, return without binding anything
if (_gridDomElm !== undefined || _gridDomElm.offset() !== undefined) {
// -- 1st resize the datagrid size at first load (we need this because the .on event is not triggered on first load)
// -- also we add a slight delay (in ms) so that we resize after the grid render is done
resizeGrid(0, newSizes, null);
// -- 2nd bind a trigger on the Window DOM element, so that it happens also when resizing after first load
// -- bind auto-resize to Window object only if it exist
$(window).on('resize.grid.' + _gridUid, function (event) {
_self.onGridBeforeResize.notify({ grid: _grid }, event, _self);
// unless the resizer is paused, let's go and resize the grid
if (!_resizePaused) {
// for some yet unknown reason, calling the resize twice removes any stuttering/flickering
// when changing the height and makes it much smoother experience
resizeGrid(0, newSizes, event);
resizeGrid(0, newSizes, event);
}
});
}
}
/**
* Calculate the datagrid new height/width from the available space, also consider that a % factor might be applied to calculation
*/
function calculateGridNewDimensions() {
if (!window || _gridContainerElm === undefined || _gridDomElm === undefined || _gridDomElm.offset() === undefined) {
return null;
}
// calculate bottom padding
var bottomPadding = (options && options.bottomPadding !== undefined) ? options.bottomPadding : DATAGRID_BOTTOM_PADDING;
var gridHeight = 0;
var gridOffsetTop = 0;
// which DOM element are we using to calculate the available size for the grid?
// defaults to "window"
if (options.calculateAvailableSizeBy === 'container') {
// uses the container's height to calculate grid height without any top offset
gridHeight = _gridContainerElm.height() || 0;
} else {
// uses the browser's window height with its top offset to calculate grid height
gridHeight = window.innerHeight || 0;
var coordOffsetTop = _gridDomElm.offset();
gridOffsetTop = (coordOffsetTop !== undefined) ? coordOffsetTop.top : 0;
}
var availableHeight = gridHeight - gridOffsetTop - bottomPadding;
var availableWidth = _gridContainerElm.width() || window.innerWidth || 0;
var maxHeight = options && options.maxHeight || undefined;
var minHeight = (options && options.minHeight !== undefined) ? options.minHeight : DATAGRID_MIN_HEIGHT;
var maxWidth = options && options.maxWidth || undefined;
var minWidth = (options && options.minWidth !== undefined) ? options.minWidth : DATAGRID_MIN_WIDTH;
var newHeight = availableHeight;
var newWidth = (options && options.rightPadding) ? availableWidth - options.rightPadding : availableWidth;
// optionally (when defined), make sure that grid height & width are within their thresholds
if (newHeight < minHeight) {
newHeight = minHeight;
}
if (maxHeight && newHeight > maxHeight) {
newHeight = maxHeight;
}
if (newWidth < minWidth) {
newWidth = minWidth;
}
if (maxWidth && newWidth > maxWidth) {
newWidth = maxWidth;
}
// return the new dimensions unless a fixed height/width was defined
return {
height: _fixedHeight || newHeight,
width: _fixedWidth || newWidth
};
}
/** Destroy function when element is destroyed */
function destroy() {
_self.onGridBeforeResize.unsubscribe();
_self.onGridAfterResize.unsubscribe();
$(window).off('resize.grid.' + _gridUid);
}
/**
* Return the last resize dimensions used by the service
* @return {object} last dimensions (height: number, width: number)
*/
function getLastResizeDimensions() {
return _lastDimensions;
}
/**
* Provide the possibility to pause the resizer for some time, until user decides to re-enabled it later if he wish to.
* @param {boolean} isResizePaused are we pausing the resizer?
*/
function pauseResizer(isResizePaused) {
_resizePaused = isResizePaused;
}
/**
* Resize the datagrid to fit the browser height & width.
* @param {number} delay to wait before resizing, defaults to 0 (in milliseconds)
* @param {object} newSizes can optionally be passed (height: number, width: number)
* @param {object} event that triggered the resize, defaults to null
* @return If the browser supports it, we can return a Promise that would resolve with the new dimensions
*/
function resizeGrid(delay, newSizes, event) {
// because of the javascript async nature, we might want to delay the resize a little bit
delay = delay || 0;
// return a Promise when supported by the browser
if (typeof Promise === 'function') {
return new Promise(function (resolve) {
if (delay > 0) {
clearTimeout(_timer);
_timer = setTimeout(function () {
resolve(resizeGridCallback(newSizes, event));
}, delay);
} else {
resolve(resizeGridCallback(newSizes, event));
}
});
} else {
// OR no return when Promise isn't supported
if (delay > 0) {
clearTimeout(_timer);
_timer = setTimeout(function () {
resizeGridCallback(newSizes, event);
}, delay);
} else {
resizeGridCallback(newSizes, event);
}
}
}
function resizeGridCallback(newSizes, event) {
var lastDimensions = resizeGridWithDimensions(newSizes);
_self.onGridAfterResize.notify({ grid: _grid, dimensions: lastDimensions }, event, _self);
return lastDimensions;
}
function resizeGridWithDimensions(newSizes) {
// calculate the available sizes with minimum height defined as a varant
var availableDimensions = calculateGridNewDimensions();
if ((newSizes || availableDimensions) && _gridDomElm.length > 0) {
// get the new sizes, if new sizes are passed (not 0), we will use them else use available space
// basically if user passes 1 of the dimension, let say he passes just the height,
// we will use the height as a fixed height but the width will be resized by it's available space
var newHeight = (newSizes && newSizes.height) ? newSizes.height : availableDimensions.height;
var newWidth = (newSizes && newSizes.width) ? newSizes.width : availableDimensions.width;
// apply these new height/width to the datagrid
if (!_gridOptions.autoHeight) {
_gridDomElm.height(newHeight);
}
_gridDomElm.width(newWidth);
// resize the slickgrid canvas on all browser except some IE versions
// exclude all IE below IE11
// IE11 wants to be a better standard (W3C) follower (finally) they even changed their appName output to also have 'Netscape'
if (new RegExp('MSIE [6-8]').exec(navigator.userAgent) === null && _grid && _grid.resizeCanvas) {
_grid.resizeCanvas();
}
// also call the grid auto-size columns so that it takes available when going bigger
if (_gridOptions && _gridOptions.enableAutoSizeColumns && _grid.autosizeColumns) {
// make sure that the grid still exist (by looking if the Grid UID is found in the DOM tree) to avoid SlickGrid error "missing stylesheet"
if (_gridUid && ($('.' + _gridUid).length > 0 || $(_gridDomElm).length > 0)) {
_grid.autosizeColumns();
}
}
// keep last resized dimensions & resolve them to the Promise
_lastDimensions = {
height: newHeight,
width: newWidth
};
}
return _lastDimensions;
}
$.extend(this, {
"init": init,
"destroy": destroy,
"pluginName": "Resizer",
"bindAutoResizeDataGrid": bindAutoResizeDataGrid,
"getLastResizeDimensions": getLastResizeDimensions,
"pauseResizer": pauseResizer,
"resizeGrid": resizeGrid,
"onGridAfterResize": new Slick.Event(),
"onGridBeforeResize": new Slick.Event()
});
}
})(jQuery); | {
"content_hash": "2031890f73c6c9d6f0ab7ddda12c7213",
"timestamp": "",
"source": "github",
"line_count": 305,
"max_line_length": 156,
"avg_line_length": 39.21311475409836,
"alnum_prop": 0.6377090301003344,
"repo_name": "cdnjs/cdnjs",
"id": "53c0bedcaa8694dbe062e72bfb6413248f5ac2c5",
"size": "11960",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "ajax/libs/6pac-slickgrid/2.4.25/plugins/slick.resizer.js",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<?php
namespace JMS\SerializerBundle\Annotation;
/**
* @Annotation
* @Target("PROPERTY")
*/
final class Since extends Version
{
} | {
"content_hash": "8b715adcab08508694974ef64961e0b4",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 42,
"avg_line_length": 10.461538461538462,
"alnum_prop": 0.6911764705882353,
"repo_name": "tribal-mlearning/omlet-web",
"id": "10dc05a9691512989e700e1690db305749c48cc1",
"size": "757",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "vendor/bundles/JMS/SerializerBundle/Annotation/Since.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "667091"
},
{
"name": "PHP",
"bytes": "614510"
},
{
"name": "Perl",
"bytes": "6163"
},
{
"name": "Shell",
"bytes": "1825"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.connectcampaign.model.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.Request;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.connectcampaign.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.protocol.*;
import com.amazonaws.protocol.Protocol;
import com.amazonaws.annotation.SdkInternalApi;
/**
* ResumeCampaignRequest Marshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class ResumeCampaignRequestProtocolMarshaller implements Marshaller<Request<ResumeCampaignRequest>, ResumeCampaignRequest> {
private static final OperationInfo SDK_OPERATION_BINDING = OperationInfo.builder().protocol(Protocol.REST_JSON).requestUri("/campaigns/{id}/resume")
.httpMethodName(HttpMethodName.POST).hasExplicitPayloadMember(false).hasPayloadMembers(false).serviceName("AmazonConnectCampaign").build();
private final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory;
public ResumeCampaignRequestProtocolMarshaller(com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory) {
this.protocolFactory = protocolFactory;
}
public Request<ResumeCampaignRequest> marshall(ResumeCampaignRequest resumeCampaignRequest) {
if (resumeCampaignRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<ResumeCampaignRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
resumeCampaignRequest);
protocolMarshaller.startMarshalling();
ResumeCampaignRequestMarshaller.getInstance().marshall(resumeCampaignRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
| {
"content_hash": "f57a864b58eb7125828633a75dda3674",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 152,
"avg_line_length": 40.80392156862745,
"alnum_prop": 0.7664584334454589,
"repo_name": "aws/aws-sdk-java",
"id": "262908a340ab44ea60987acf9601db7dba0f8f20",
"size": "2661",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-connectcampaign/src/main/java/com/amazonaws/services/connectcampaign/model/transform/ResumeCampaignRequestProtocolMarshaller.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
/*=========================================================================
*
* Portions of this file are subject to the VTK Toolkit Version 3 copyright.
*
* Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
*
* For complete copyright, license and disclaimer of warranty information
* please refer to the NOTICE file at the top of the ITK source tree.
*
*=========================================================================*/
#ifndef itkBioRadImageIO_h
#define itkBioRadImageIO_h
#include "ITKIOBioRadExport.h"
#include "itkImageIOBase.h"
#include <fstream>
namespace itk
{
/** \class BioRadImageIO
*
* \brief ImageIO class for reading Bio-Rad images.
* Bio-Rad file format are used by confocal micropscopes like MRC 1024, MRC 600
* http://www.bio-rad.com/
*
* The reader/writer was based on a scanned copy of the MRC-600 documentation
* http://forums.ni.com/attachments/ni/200/7567/1/file%20format.pdf
*
* \ingroup IOFilters
*
* \ingroup ITKIOBioRad
*/
class ITKIOBioRad_EXPORT BioRadImageIO:public ImageIOBase
{
public:
/** Standard class typedefs. */
typedef BioRadImageIO Self;
typedef ImageIOBase Superclass;
typedef SmartPointer< Self > Pointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(BioRadImageIO, Superclass);
/*-------- This part of the interface deals with reading data. ------ */
/** Determine the file type. Returns true if this ImageIO can read the
* file specified. */
virtual bool CanReadFile(const char *) ITK_OVERRIDE;
/** Set the spacing and dimesion information for the current filename. */
virtual void ReadImageInformation() ITK_OVERRIDE;
/** Reads the data from disk into the memory buffer provided. */
virtual void Read(void *buffer) ITK_OVERRIDE;
/*-------- This part of the interfaces deals with writing data. ----- */
/** Determine the file type. Returns true if this ImageIO can read the
* file specified. */
virtual bool CanWriteFile(const char *) ITK_OVERRIDE;
/** Writes the spacing and dimensions of the image.
* Assumes SetFileName has been called with a valid file name. */
virtual void WriteImageInformation() ITK_OVERRIDE {}
/** Writes the data to disk from the memory buffer provided. Make sure
* that the IORegion has been set properly. */
virtual void Write(const void *buffer) ITK_OVERRIDE;
protected:
BioRadImageIO();
~BioRadImageIO();
virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
void InternalReadImageInformation(std::ifstream & file);
private:
ITK_DISALLOW_COPY_AND_ASSIGN(BioRadImageIO);
};
} // end namespace itk
#endif // itkBioRadImageIO_h
| {
"content_hash": "8de05400dc8974ae5ee4df516520d5bd",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 80,
"avg_line_length": 32.116279069767444,
"alnum_prop": 0.6788559015206372,
"repo_name": "PlutoniumHeart/ITK",
"id": "1e28669849eabd31398d6f67f29affa7911ab56c",
"size": "3537",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Modules/IO/BioRad/include/itkBioRadImageIO.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "306"
},
{
"name": "C",
"bytes": "30635310"
},
{
"name": "C++",
"bytes": "47011599"
},
{
"name": "CMake",
"bytes": "2183114"
},
{
"name": "CSS",
"bytes": "24960"
},
{
"name": "DIGITAL Command Language",
"bytes": "709"
},
{
"name": "Fortran",
"bytes": "2260380"
},
{
"name": "HTML",
"bytes": "208777"
},
{
"name": "Io",
"bytes": "1833"
},
{
"name": "Java",
"bytes": "28598"
},
{
"name": "Lex",
"bytes": "6948"
},
{
"name": "Makefile",
"bytes": "267990"
},
{
"name": "Objective-C",
"bytes": "43946"
},
{
"name": "Objective-C++",
"bytes": "6591"
},
{
"name": "OpenEdge ABL",
"bytes": "85244"
},
{
"name": "Perl",
"bytes": "18085"
},
{
"name": "Python",
"bytes": "939926"
},
{
"name": "Ruby",
"bytes": "296"
},
{
"name": "Shell",
"bytes": "131549"
},
{
"name": "Tcl",
"bytes": "74786"
},
{
"name": "XSLT",
"bytes": "195448"
},
{
"name": "Yacc",
"bytes": "20591"
}
],
"symlink_target": ""
} |
import logging
import unittest
from nose.plugins.attrib import attr
from tests.cook import cli, util
@attr(cli=True)
@unittest.skipUnless(util.multi_cluster_tests_enabled(),
'Requires setting the COOK_MULTI_CLUSTER environment variable')
class MultiCookCliTest(unittest.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
self.cook_url_1 = util.retrieve_cook_url()
self.cook_url_2 = util.retrieve_cook_url('COOK_SCHEDULER_URL_2', 'http://localhost:22321')
self.logger = logging.getLogger(__name__)
util.wait_for_cook(self.cook_url_1)
util.wait_for_cook(self.cook_url_2)
def test_federated_query(self):
# Submit to cluster #1
cp, uuids = cli.submit('ls', self.cook_url_1)
self.assertEqual(0, cp.returncode, cp.stderr)
uuid_1 = uuids[0]
# Submit to cluster #2
cp, uuids = cli.submit('ls', self.cook_url_2)
self.assertEqual(0, cp.returncode, cp.stderr)
uuid_2 = uuids[0]
# Single query for both jobs, federated across clusters
config = {'clusters': [{'name': 'cook1', 'url': self.cook_url_1},
{'name': 'cook2', 'url': self.cook_url_2}]}
with cli.temp_config_file(config) as path:
cp = cli.wait([uuid_1, uuid_2], flags='--config %s' % path)
self.assertEqual(0, cp.returncode, cp.stderr)
cp, jobs = cli.show_json([uuid_1, uuid_2], flags='--config %s' % path)
uuids = [job['uuid'] for job in jobs]
self.assertEqual(0, cp.returncode, cp.stderr)
self.assertEqual(2, len(jobs), jobs)
self.assertIn(str(uuid_1), uuids)
self.assertIn(str(uuid_2), uuids)
self.assertEqual('completed', jobs[0]['status'])
self.assertEqual('completed', jobs[1]['status'])
| {
"content_hash": "ad3e5ef246e63db99ff9cbe002ae979c",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 98,
"avg_line_length": 40.630434782608695,
"alnum_prop": 0.599250936329588,
"repo_name": "m4ce/Cook",
"id": "d389c95c8036836394a5b243b68a0f4e7eb561af",
"size": "1869",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "integration/tests/cook/test_cli_multi_cook.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Clojure",
"bytes": "1092671"
},
{
"name": "Java",
"bytes": "159333"
},
{
"name": "Python",
"bytes": "205274"
},
{
"name": "Shell",
"bytes": "15716"
}
],
"symlink_target": ""
} |
<?php
namespace Admingenerator\DoctrineOrmDemoBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
/**
* This is the class that loads and manages your bundle configuration
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*/
class AdmingeneratorDoctrineOrmDemoExtension extends Extension
{
/**
* {@inheritDoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
}
}
| {
"content_hash": "d52a9ee7a7998880e35d70df8be9b59c",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 91,
"avg_line_length": 30.84,
"alnum_prop": 0.7600518806744487,
"repo_name": "symfony2admingenerator/symfony2-admingenerator-demo-edition",
"id": "ec1b6653f1c561d3dc7b0de099bb5fb7af538aac",
"size": "771",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Admingenerator/DoctrineOrmDemoBundle/DependencyInjection/AdmingeneratorDoctrineOrmDemoExtension.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "2907"
},
{
"name": "HTML",
"bytes": "4379"
},
{
"name": "PHP",
"bytes": "82502"
}
],
"symlink_target": ""
} |
<?php
namespace Oro\Bundle\NoteBundle\Migration;
use Doctrine\DBAL\Schema\Schema;
use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
class RemoveNoteConfigurationScopeMigration implements Migration
{
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
$queries->addPostQuery(new RemoveNoteConfigurationScopeQuery());
}
}
| {
"content_hash": "edc25dca44d2e93acebf08d5975938d3",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 72,
"avg_line_length": 23.05263157894737,
"alnum_prop": 0.7420091324200914,
"repo_name": "Djamy/platform",
"id": "fa83b3ec6fbbc47e1a8ebde2492308acb6d19e1f",
"size": "438",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Oro/Bundle/NoteBundle/Migration/RemoveNoteConfigurationScopeMigration.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "542736"
},
{
"name": "Gherkin",
"bytes": "73480"
},
{
"name": "HTML",
"bytes": "1633049"
},
{
"name": "JavaScript",
"bytes": "3284434"
},
{
"name": "PHP",
"bytes": "35536269"
}
],
"symlink_target": ""
} |
package crypto
import (
"bytes"
"crypto"
"crypto/ecdsa"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"errors"
"fmt"
"io/ioutil"
"math/big"
mathrand "math/rand"
"net"
"os"
"path/filepath"
"strconv"
"sync"
"time"
"github.com/golang/glog"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apiserver/pkg/authentication/user"
"sort"
cmdutil "github.com/openshift/origin/pkg/cmd/util"
)
var versions = map[string]uint16{
"VersionTLS10": tls.VersionTLS10,
"VersionTLS11": tls.VersionTLS11,
"VersionTLS12": tls.VersionTLS12,
}
func TLSVersion(versionName string) (uint16, error) {
if len(versionName) == 0 {
return DefaultTLSVersion(), nil
}
if version, ok := versions[versionName]; ok {
return version, nil
}
return 0, fmt.Errorf("unknown tls version %q", versionName)
}
func TLSVersionOrDie(versionName string) uint16 {
version, err := TLSVersion(versionName)
if err != nil {
panic(err)
}
return version
}
func ValidTLSVersions() []string {
validVersions := []string{}
for k := range versions {
validVersions = append(validVersions, k)
}
sort.Strings(validVersions)
return validVersions
}
func DefaultTLSVersion() uint16 {
// Can't use SSLv3 because of POODLE and BEAST
// Can't use TLSv1.0 because of POODLE and BEAST using CBC cipher
// Can't use TLSv1.1 because of RC4 cipher usage
return tls.VersionTLS12
}
var ciphers = map[string]uint16{
"TLS_RSA_WITH_RC4_128_SHA": tls.TLS_RSA_WITH_RC4_128_SHA,
"TLS_RSA_WITH_3DES_EDE_CBC_SHA": tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
"TLS_RSA_WITH_AES_128_CBC_SHA": tls.TLS_RSA_WITH_AES_128_CBC_SHA,
"TLS_RSA_WITH_AES_256_CBC_SHA": tls.TLS_RSA_WITH_AES_256_CBC_SHA,
"TLS_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
"TLS_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
"TLS_ECDHE_ECDSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA": tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA": tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
"TLS_ECDHE_RSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA,
"TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
}
func CipherSuite(cipherName string) (uint16, error) {
if cipher, ok := ciphers[cipherName]; ok {
return cipher, nil
}
return 0, fmt.Errorf("unknown cipher name %q", cipherName)
}
func CipherSuitesOrDie(cipherNames []string) []uint16 {
if len(cipherNames) == 0 {
return DefaultCiphers()
}
cipherValues := []uint16{}
for _, cipherName := range cipherNames {
cipher, err := CipherSuite(cipherName)
if err != nil {
panic(err)
}
cipherValues = append(cipherValues, cipher)
}
return cipherValues
}
func ValidCipherSuites() []string {
validCipherSuites := []string{}
for k := range ciphers {
validCipherSuites = append(validCipherSuites, k)
}
sort.Strings(validCipherSuites)
return validCipherSuites
}
func DefaultCiphers() []uint16 {
return []uint16{
// Ciphers below are selected and ordered based on the recommended "Intermediate compatibility" suite
// Compare with available ciphers when bumping Go versions
//
// Available ciphers from last comparison (go 1.6):
// TLS_RSA_WITH_RC4_128_SHA - no
// TLS_RSA_WITH_3DES_EDE_CBC_SHA
// TLS_RSA_WITH_AES_128_CBC_SHA
// TLS_RSA_WITH_AES_256_CBC_SHA
// TLS_RSA_WITH_AES_128_GCM_SHA256
// TLS_RSA_WITH_AES_256_GCM_SHA384
// TLS_ECDHE_ECDSA_WITH_RC4_128_SHA - no
// TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
// TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
// TLS_ECDHE_RSA_WITH_RC4_128_SHA - no
// TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
// TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
// TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
// TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
// TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
// TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
// TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
// the next two are in the intermediate suite, but go1.6 http2 complains when they are included at the recommended index
// fixed in https://github.com/golang/go/commit/b5aae1a2845f157a2565b856fb2d7773a0f7af25 in go1.7
// tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
// tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_RSA_WITH_AES_128_CBC_SHA,
tls.TLS_RSA_WITH_AES_256_CBC_SHA,
tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
}
}
// SecureTLSConfig enforces the default minimum security settings for the cluster.
func SecureTLSConfig(config *tls.Config) *tls.Config {
if config.MinVersion == 0 {
config.MinVersion = DefaultTLSVersion()
}
config.PreferServerCipherSuites = true
if len(config.CipherSuites) == 0 {
config.CipherSuites = DefaultCiphers()
}
return config
}
type TLSCertificateConfig struct {
Certs []*x509.Certificate
Key crypto.PrivateKey
}
type TLSCARoots struct {
Roots []*x509.Certificate
}
func (c *TLSCertificateConfig) writeCertConfig(certFile, keyFile string) error {
if err := writeCertificates(certFile, c.Certs...); err != nil {
return err
}
if err := writeKeyFile(keyFile, c.Key); err != nil {
return err
}
return nil
}
func (c *TLSCertificateConfig) GetPEMBytes() ([]byte, []byte, error) {
certBytes, err := encodeCertificates(c.Certs...)
if err != nil {
return nil, nil, err
}
keyBytes, err := encodeKey(c.Key)
if err != nil {
return nil, nil, err
}
return certBytes, keyBytes, nil
}
func (c *TLSCARoots) writeCARoots(rootFile string) error {
if err := writeCertificates(rootFile, c.Roots...); err != nil {
return err
}
return nil
}
func GetTLSCARoots(caFile string) (*TLSCARoots, error) {
if len(caFile) == 0 {
return nil, errors.New("caFile missing")
}
caPEMBlock, err := ioutil.ReadFile(caFile)
if err != nil {
return nil, err
}
roots, err := cmdutil.CertificatesFromPEM(caPEMBlock)
if err != nil {
return nil, fmt.Errorf("Error reading %s: %s", caFile, err)
}
return &TLSCARoots{roots}, nil
}
func GetTLSCertificateConfig(certFile, keyFile string) (*TLSCertificateConfig, error) {
if len(certFile) == 0 {
return nil, errors.New("certFile missing")
}
if len(keyFile) == 0 {
return nil, errors.New("keyFile missing")
}
certPEMBlock, err := ioutil.ReadFile(certFile)
if err != nil {
return nil, err
}
certs, err := cmdutil.CertificatesFromPEM(certPEMBlock)
if err != nil {
return nil, fmt.Errorf("Error reading %s: %s", certFile, err)
}
keyPEMBlock, err := ioutil.ReadFile(keyFile)
if err != nil {
return nil, err
}
keyPairCert, err := tls.X509KeyPair(certPEMBlock, keyPEMBlock)
if err != nil {
return nil, err
}
key := keyPairCert.PrivateKey
return &TLSCertificateConfig{certs, key}, nil
}
const (
DefaultCertificateLifetimeInDays = 365 * 2 // 2 years
DefaultCACertificateLifetimeInDays = 365 * 5 // 5 years
// Default keys are 2048 bits
keyBits = 2048
)
type CA struct {
Config *TLSCertificateConfig
SerialGenerator SerialGenerator
}
// SerialGenerator is an interface for getting a serial number for the cert. It MUST be thread-safe.
type SerialGenerator interface {
Next(template *x509.Certificate) (int64, error)
}
// SerialFileGenerator returns a unique, monotonically increasing serial number and ensures the CA on disk records that value.
type SerialFileGenerator struct {
SerialFile string
// lock guards access to the Serial field
lock sync.Mutex
Serial int64
}
func NewSerialFileGenerator(serialFile string, createIfNeeded bool) (*SerialFileGenerator, error) {
// read serial file
var serial int64
serialData, err := ioutil.ReadFile(serialFile)
if err == nil {
serial, _ = strconv.ParseInt(string(serialData), 16, 64)
}
if os.IsNotExist(err) && createIfNeeded {
if err := ioutil.WriteFile(serialFile, []byte("00"), 0644); err != nil {
return nil, err
}
serial = 1
} else if err != nil {
return nil, err
}
if serial < 1 {
serial = 1
}
return &SerialFileGenerator{
Serial: serial,
SerialFile: serialFile,
}, nil
}
// Next returns a unique, monotonically increasing serial number and ensures the CA on disk records that value.
func (s *SerialFileGenerator) Next(template *x509.Certificate) (int64, error) {
s.lock.Lock()
defer s.lock.Unlock()
next := s.Serial + 1
s.Serial = next
// Output in hex, padded to multiples of two characters for OpenSSL's sake
serialText := fmt.Sprintf("%X", next)
if len(serialText)%2 == 1 {
serialText = "0" + serialText
}
if err := ioutil.WriteFile(s.SerialFile, []byte(serialText), os.FileMode(0640)); err != nil {
return 0, err
}
return next, nil
}
// RandomSerialGenerator returns a serial based on time.Now and the subject
type RandomSerialGenerator struct {
}
func (s *RandomSerialGenerator) Next(template *x509.Certificate) (int64, error) {
r := mathrand.New(mathrand.NewSource(time.Now().UTC().UnixNano()))
return r.Int63(), nil
}
// EnsureCA returns a CA, whether it was created (as opposed to pre-existing), and any error
// if serialFile is empty, a RandomSerialGenerator will be used
func EnsureCA(certFile, keyFile, serialFile, name string, expireDays int) (*CA, bool, error) {
if ca, err := GetCA(certFile, keyFile, serialFile); err == nil {
return ca, false, err
}
ca, err := MakeCA(certFile, keyFile, serialFile, name, expireDays)
return ca, true, err
}
// if serialFile is empty, a RandomSerialGenerator will be used
func GetCA(certFile, keyFile, serialFile string) (*CA, error) {
caConfig, err := GetTLSCertificateConfig(certFile, keyFile)
if err != nil {
return nil, err
}
var serialGenerator SerialGenerator
if len(serialFile) > 0 {
serialGenerator, err = NewSerialFileGenerator(serialFile, false)
if err != nil {
return nil, err
}
} else {
serialGenerator = &RandomSerialGenerator{}
}
return &CA{
SerialGenerator: serialGenerator,
Config: caConfig,
}, nil
}
// if serialFile is empty, a RandomSerialGenerator will be used
func MakeCA(certFile, keyFile, serialFile, name string, expireDays int) (*CA, error) {
glog.V(2).Infof("Generating new CA for %s cert, and key in %s, %s", name, certFile, keyFile)
// Create CA cert
rootcaPublicKey, rootcaPrivateKey, err := NewKeyPair()
if err != nil {
return nil, err
}
rootcaTemplate := newSigningCertificateTemplate(pkix.Name{CommonName: name}, expireDays, time.Now)
rootcaCert, err := signCertificate(rootcaTemplate, rootcaPublicKey, rootcaTemplate, rootcaPrivateKey)
if err != nil {
return nil, err
}
caConfig := &TLSCertificateConfig{
Certs: []*x509.Certificate{rootcaCert},
Key: rootcaPrivateKey,
}
if err := caConfig.writeCertConfig(certFile, keyFile); err != nil {
return nil, err
}
var serialGenerator SerialGenerator
if len(serialFile) > 0 {
if err := ioutil.WriteFile(serialFile, []byte("00"), 0644); err != nil {
return nil, err
}
serialGenerator, err = NewSerialFileGenerator(serialFile, false)
if err != nil {
return nil, err
}
} else {
serialGenerator = &RandomSerialGenerator{}
}
return &CA{
SerialGenerator: serialGenerator,
Config: caConfig,
}, nil
}
func (ca *CA) EnsureServerCert(certFile, keyFile string, hostnames sets.String, expireDays int) (*TLSCertificateConfig, bool, error) {
certConfig, err := GetServerCert(certFile, keyFile, hostnames)
if err != nil {
certConfig, err = ca.MakeAndWriteServerCert(certFile, keyFile, hostnames, expireDays)
return certConfig, true, err
}
return certConfig, false, nil
}
func GetServerCert(certFile, keyFile string, hostnames sets.String) (*TLSCertificateConfig, error) {
server, err := GetTLSCertificateConfig(certFile, keyFile)
if err != nil {
return nil, err
}
cert := server.Certs[0]
ips, dns := IPAddressesDNSNames(hostnames.List())
missingIps := ipsNotInSlice(ips, cert.IPAddresses)
missingDns := stringsNotInSlice(dns, cert.DNSNames)
if len(missingIps) == 0 && len(missingDns) == 0 {
glog.V(4).Infof("Found existing server certificate in %s", certFile)
return server, nil
}
return nil, fmt.Errorf("Existing server certificate in %s was missing some hostnames (%v) or IP addresses (%v).", certFile, missingDns, missingIps)
}
func (ca *CA) MakeAndWriteServerCert(certFile, keyFile string, hostnames sets.String, expireDays int) (*TLSCertificateConfig, error) {
glog.V(4).Infof("Generating server certificate in %s, key in %s", certFile, keyFile)
server, err := ca.MakeServerCert(hostnames, expireDays)
if err != nil {
return nil, err
}
if err := server.writeCertConfig(certFile, keyFile); err != nil {
return server, err
}
return server, nil
}
// CertificateExtensionFunc is passed a certificate that it may extend, or return an error
// if the extension attempt failed.
type CertificateExtensionFunc func(*x509.Certificate) error
func (ca *CA) MakeServerCert(hostnames sets.String, expireDays int, fns ...CertificateExtensionFunc) (*TLSCertificateConfig, error) {
serverPublicKey, serverPrivateKey, _ := NewKeyPair()
serverTemplate := newServerCertificateTemplate(pkix.Name{CommonName: hostnames.List()[0]}, hostnames.List(), expireDays, time.Now)
for _, fn := range fns {
if err := fn(serverTemplate); err != nil {
return nil, err
}
}
serverCrt, err := ca.signCertificate(serverTemplate, serverPublicKey)
if err != nil {
return nil, err
}
server := &TLSCertificateConfig{
Certs: append([]*x509.Certificate{serverCrt}, ca.Config.Certs...),
Key: serverPrivateKey,
}
return server, nil
}
func (ca *CA) EnsureClientCertificate(certFile, keyFile string, u user.Info, expireDays int) (*TLSCertificateConfig, bool, error) {
certConfig, err := GetTLSCertificateConfig(certFile, keyFile)
if err != nil {
certConfig, err = ca.MakeClientCertificate(certFile, keyFile, u, expireDays)
return certConfig, true, err // true indicates we wrote the files.
}
return certConfig, false, nil
}
func (ca *CA) MakeClientCertificate(certFile, keyFile string, u user.Info, expireDays int) (*TLSCertificateConfig, error) {
glog.V(4).Infof("Generating client cert in %s and key in %s", certFile, keyFile)
// ensure parent dirs
if err := os.MkdirAll(filepath.Dir(certFile), os.FileMode(0755)); err != nil {
return nil, err
}
if err := os.MkdirAll(filepath.Dir(keyFile), os.FileMode(0755)); err != nil {
return nil, err
}
clientPublicKey, clientPrivateKey, _ := NewKeyPair()
clientTemplate := newClientCertificateTemplate(userToSubject(u), expireDays, time.Now)
clientCrt, err := ca.signCertificate(clientTemplate, clientPublicKey)
if err != nil {
return nil, err
}
certData, err := encodeCertificates(clientCrt)
if err != nil {
return nil, err
}
keyData, err := encodeKey(clientPrivateKey)
if err != nil {
return nil, err
}
if err = ioutil.WriteFile(certFile, certData, os.FileMode(0644)); err != nil {
return nil, err
}
if err = ioutil.WriteFile(keyFile, keyData, os.FileMode(0600)); err != nil {
return nil, err
}
return GetTLSCertificateConfig(certFile, keyFile)
}
func userToSubject(u user.Info) pkix.Name {
return pkix.Name{
CommonName: u.GetName(),
SerialNumber: u.GetUID(),
Organization: u.GetGroups(),
}
}
func (ca *CA) signCertificate(template *x509.Certificate, requestKey crypto.PublicKey) (*x509.Certificate, error) {
// Increment and persist serial
serial, err := ca.SerialGenerator.Next(template)
if err != nil {
return nil, err
}
template.SerialNumber = big.NewInt(serial)
return signCertificate(template, requestKey, ca.Config.Certs[0], ca.Config.Key)
}
func NewKeyPair() (crypto.PublicKey, crypto.PrivateKey, error) {
privateKey, err := rsa.GenerateKey(rand.Reader, keyBits)
if err != nil {
return nil, nil, err
}
return &privateKey.PublicKey, privateKey, nil
}
// Can be used for CA or intermediate signing certs
func newSigningCertificateTemplate(subject pkix.Name, expireDays int, currentTime func() time.Time) *x509.Certificate {
var caLifetimeInDays = DefaultCACertificateLifetimeInDays
if expireDays > 0 {
caLifetimeInDays = expireDays
}
if caLifetimeInDays > DefaultCACertificateLifetimeInDays {
warnAboutCertificateLifeTime(subject.CommonName, DefaultCACertificateLifetimeInDays)
}
caLifetime := time.Duration(caLifetimeInDays) * 24 * time.Hour
return &x509.Certificate{
Subject: subject,
SignatureAlgorithm: x509.SHA256WithRSA,
NotBefore: currentTime().Add(-1 * time.Second),
NotAfter: currentTime().Add(caLifetime),
SerialNumber: big.NewInt(1),
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,
BasicConstraintsValid: true,
IsCA: true,
}
}
// Can be used for ListenAndServeTLS
func newServerCertificateTemplate(subject pkix.Name, hosts []string, expireDays int, currentTime func() time.Time) *x509.Certificate {
var lifetimeInDays = DefaultCertificateLifetimeInDays
if expireDays > 0 {
lifetimeInDays = expireDays
}
if lifetimeInDays > DefaultCertificateLifetimeInDays {
warnAboutCertificateLifeTime(subject.CommonName, DefaultCertificateLifetimeInDays)
}
lifetime := time.Duration(lifetimeInDays) * 24 * time.Hour
template := &x509.Certificate{
Subject: subject,
SignatureAlgorithm: x509.SHA256WithRSA,
NotBefore: currentTime().Add(-1 * time.Second),
NotAfter: currentTime().Add(lifetime),
SerialNumber: big.NewInt(1),
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
BasicConstraintsValid: true,
}
template.IPAddresses, template.DNSNames = IPAddressesDNSNames(hosts)
return template
}
func IPAddressesDNSNames(hosts []string) ([]net.IP, []string) {
ips := []net.IP{}
dns := []string{}
for _, host := range hosts {
if ip := net.ParseIP(host); ip != nil {
ips = append(ips, ip)
} else {
dns = append(dns, host)
}
}
// Include IP addresses as DNS subjectAltNames in the cert as well, for the sake of Python, Windows (< 10), and unnamed other libraries
// Ensure these technically invalid DNS subjectAltNames occur after the valid ones, to avoid triggering cert errors in Firefox
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1148766
for _, ip := range ips {
dns = append(dns, ip.String())
}
return ips, dns
}
func CertsFromPEM(pemCerts []byte) ([]*x509.Certificate, error) {
ok := false
certs := []*x509.Certificate{}
for len(pemCerts) > 0 {
var block *pem.Block
block, pemCerts = pem.Decode(pemCerts)
if block == nil {
break
}
if block.Type != "CERTIFICATE" || len(block.Headers) != 0 {
continue
}
cert, err := x509.ParseCertificate(block.Bytes)
if err != nil {
return certs, err
}
certs = append(certs, cert)
ok = true
}
if !ok {
return certs, errors.New("Could not read any certificates")
}
return certs, nil
}
// Can be used as a certificate in http.Transport TLSClientConfig
func newClientCertificateTemplate(subject pkix.Name, expireDays int, currentTime func() time.Time) *x509.Certificate {
var lifetimeInDays = DefaultCertificateLifetimeInDays
if expireDays > 0 {
lifetimeInDays = expireDays
}
if lifetimeInDays > DefaultCertificateLifetimeInDays {
warnAboutCertificateLifeTime(subject.CommonName, DefaultCertificateLifetimeInDays)
}
lifetime := time.Duration(lifetimeInDays) * 24 * time.Hour
return &x509.Certificate{
Subject: subject,
SignatureAlgorithm: x509.SHA256WithRSA,
NotBefore: currentTime().Add(-1 * time.Second),
NotAfter: currentTime().Add(lifetime),
SerialNumber: big.NewInt(1),
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth},
BasicConstraintsValid: true,
}
}
func warnAboutCertificateLifeTime(name string, defaultLifetimeInDays int) {
defaultLifetimeInYears := defaultLifetimeInDays / 365
fmt.Fprintf(os.Stderr, "WARNING: Validity period of the certificate for %q is greater than %d years!\n", name, defaultLifetimeInYears)
fmt.Fprintln(os.Stderr, "WARNING: By security reasons it is strongly recommended to change this period and make it smaller!")
}
func signCertificate(template *x509.Certificate, requestKey crypto.PublicKey, issuer *x509.Certificate, issuerKey crypto.PrivateKey) (*x509.Certificate, error) {
derBytes, err := x509.CreateCertificate(rand.Reader, template, issuer, requestKey, issuerKey)
if err != nil {
return nil, err
}
certs, err := x509.ParseCertificates(derBytes)
if err != nil {
return nil, err
}
if len(certs) != 1 {
return nil, errors.New("Expected a single certificate")
}
return certs[0], nil
}
func encodeCertificates(certs ...*x509.Certificate) ([]byte, error) {
b := bytes.Buffer{}
for _, cert := range certs {
if err := pem.Encode(&b, &pem.Block{Type: "CERTIFICATE", Bytes: cert.Raw}); err != nil {
return []byte{}, err
}
}
return b.Bytes(), nil
}
func encodeKey(key crypto.PrivateKey) ([]byte, error) {
b := bytes.Buffer{}
switch key := key.(type) {
case *ecdsa.PrivateKey:
keyBytes, err := x509.MarshalECPrivateKey(key)
if err != nil {
return []byte{}, err
}
if err := pem.Encode(&b, &pem.Block{Type: "EC PRIVATE KEY", Bytes: keyBytes}); err != nil {
return b.Bytes(), err
}
case *rsa.PrivateKey:
if err := pem.Encode(&b, &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(key)}); err != nil {
return []byte{}, err
}
default:
return []byte{}, errors.New("Unrecognized key type")
}
return b.Bytes(), nil
}
func writeCertificates(path string, certs ...*x509.Certificate) error {
// ensure parent dir
if err := os.MkdirAll(filepath.Dir(path), os.FileMode(0755)); err != nil {
return err
}
bytes, err := encodeCertificates(certs...)
if err != nil {
return err
}
return ioutil.WriteFile(path, bytes, os.FileMode(0644))
}
func writeKeyFile(path string, key crypto.PrivateKey) error {
// ensure parent dir
if err := os.MkdirAll(filepath.Dir(path), os.FileMode(0755)); err != nil {
return err
}
b, err := encodeKey(key)
if err != nil {
return err
}
return ioutil.WriteFile(path, b, os.FileMode(0600))
}
func stringsNotInSlice(needles []string, haystack []string) []string {
missing := []string{}
for _, needle := range needles {
if !stringInSlice(needle, haystack) {
missing = append(missing, needle)
}
}
return missing
}
func stringInSlice(needle string, haystack []string) bool {
for _, straw := range haystack {
if needle == straw {
return true
}
}
return false
}
func ipsNotInSlice(needles []net.IP, haystack []net.IP) []net.IP {
missing := []net.IP{}
for _, needle := range needles {
if !ipInSlice(needle, haystack) {
missing = append(missing, needle)
}
}
return missing
}
func ipInSlice(needle net.IP, haystack []net.IP) bool {
for _, straw := range haystack {
if needle.Equal(straw) {
return true
}
}
return false
}
| {
"content_hash": "ac5deee127a3bb7f30980f0574a1fa38",
"timestamp": "",
"source": "github",
"line_count": 804,
"max_line_length": 161,
"avg_line_length": 29.55597014925373,
"alnum_prop": 0.7109371712325885,
"repo_name": "smarterclayton/origin",
"id": "635d2e526d327e147e9f900a8a096d05281fc52b",
"size": "23763",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "pkg/cmd/server/crypto/crypto.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "1842"
},
{
"name": "DIGITAL Command Language",
"bytes": "117"
},
{
"name": "Go",
"bytes": "18846196"
},
{
"name": "Groovy",
"bytes": "5288"
},
{
"name": "HTML",
"bytes": "74732"
},
{
"name": "Makefile",
"bytes": "21696"
},
{
"name": "Protocol Buffer",
"bytes": "635483"
},
{
"name": "Python",
"bytes": "33408"
},
{
"name": "Roff",
"bytes": "2049"
},
{
"name": "Ruby",
"bytes": "484"
},
{
"name": "Shell",
"bytes": "2152560"
},
{
"name": "Smarty",
"bytes": "626"
}
],
"symlink_target": ""
} |
package types
import (
"encoding/json"
"errors"
"unicode"
)
const (
LinuxCapabilitiesRetainSetName = "os/linux/capabilities-retain-set"
LinuxCapabilitiesRevokeSetName = "os/linux/capabilities-remove-set"
LinuxNoNewPrivilegesName = "os/linux/no-new-privileges"
LinuxSeccompRemoveSetName = "os/linux/seccomp-remove-set"
LinuxSeccompRetainSetName = "os/linux/seccomp-retain-set"
)
var LinuxIsolatorNames = make(map[ACIdentifier]struct{})
func init() {
for name, con := range map[ACIdentifier]IsolatorValueConstructor{
LinuxCapabilitiesRevokeSetName: func() IsolatorValue { return &LinuxCapabilitiesRevokeSet{} },
LinuxCapabilitiesRetainSetName: func() IsolatorValue { return &LinuxCapabilitiesRetainSet{} },
LinuxNoNewPrivilegesName: func() IsolatorValue { v := LinuxNoNewPrivileges(false); return &v },
LinuxSeccompRemoveSetName: func() IsolatorValue { return &LinuxSeccompRemoveSet{} },
LinuxSeccompRetainSetName: func() IsolatorValue { return &LinuxSeccompRetainSet{} },
} {
AddIsolatorName(name, LinuxIsolatorNames)
AddIsolatorValueConstructor(name, con)
}
}
type LinuxNoNewPrivileges bool
func (l LinuxNoNewPrivileges) AssertValid() error {
return nil
}
// TODO(lucab): both need to be clarified in spec,
// see https://github.com/appc/spec/issues/625
func (l LinuxNoNewPrivileges) multipleAllowed() bool {
return true
}
func (l LinuxNoNewPrivileges) Conflicts() []ACIdentifier {
return nil
}
func (l *LinuxNoNewPrivileges) UnmarshalJSON(b []byte) error {
var v bool
err := json.Unmarshal(b, &v)
if err != nil {
return err
}
*l = LinuxNoNewPrivileges(v)
return nil
}
type AsIsolator interface {
AsIsolator() (*Isolator, error)
}
type LinuxCapabilitiesSet interface {
Set() []LinuxCapability
AssertValid() error
}
type LinuxCapability string
type linuxCapabilitiesSetValue struct {
Set []LinuxCapability `json:"set"`
}
type linuxCapabilitiesSetBase struct {
val linuxCapabilitiesSetValue
}
func (l linuxCapabilitiesSetBase) AssertValid() error {
if len(l.val.Set) == 0 {
return errors.New("set must be non-empty")
}
return nil
}
// TODO(lucab): both need to be clarified in spec,
// see https://github.com/appc/spec/issues/625
func (l linuxCapabilitiesSetBase) multipleAllowed() bool {
return true
}
func (l linuxCapabilitiesSetBase) Conflicts() []ACIdentifier {
return nil
}
func (l *linuxCapabilitiesSetBase) UnmarshalJSON(b []byte) error {
var v linuxCapabilitiesSetValue
err := json.Unmarshal(b, &v)
if err != nil {
return err
}
l.val = v
return err
}
func (l linuxCapabilitiesSetBase) Set() []LinuxCapability {
return l.val.Set
}
type LinuxCapabilitiesRetainSet struct {
linuxCapabilitiesSetBase
}
func NewLinuxCapabilitiesRetainSet(caps ...string) (*LinuxCapabilitiesRetainSet, error) {
l := LinuxCapabilitiesRetainSet{
linuxCapabilitiesSetBase{
linuxCapabilitiesSetValue{
make([]LinuxCapability, len(caps)),
},
},
}
for i, c := range caps {
l.linuxCapabilitiesSetBase.val.Set[i] = LinuxCapability(c)
}
if err := l.AssertValid(); err != nil {
return nil, err
}
return &l, nil
}
func (l LinuxCapabilitiesRetainSet) AsIsolator() (*Isolator, error) {
b, err := json.Marshal(l.linuxCapabilitiesSetBase.val)
if err != nil {
return nil, err
}
rm := json.RawMessage(b)
return &Isolator{
Name: LinuxCapabilitiesRetainSetName,
ValueRaw: &rm,
value: &l,
}, nil
}
type LinuxCapabilitiesRevokeSet struct {
linuxCapabilitiesSetBase
}
func NewLinuxCapabilitiesRevokeSet(caps ...string) (*LinuxCapabilitiesRevokeSet, error) {
l := LinuxCapabilitiesRevokeSet{
linuxCapabilitiesSetBase{
linuxCapabilitiesSetValue{
make([]LinuxCapability, len(caps)),
},
},
}
for i, c := range caps {
l.linuxCapabilitiesSetBase.val.Set[i] = LinuxCapability(c)
}
if err := l.AssertValid(); err != nil {
return nil, err
}
return &l, nil
}
func (l LinuxCapabilitiesRevokeSet) AsIsolator() (*Isolator, error) {
b, err := json.Marshal(l.linuxCapabilitiesSetBase.val)
if err != nil {
return nil, err
}
rm := json.RawMessage(b)
return &Isolator{
Name: LinuxCapabilitiesRevokeSetName,
ValueRaw: &rm,
value: &l,
}, nil
}
type LinuxSeccompSet interface {
Set() []LinuxSeccompEntry
Errno() LinuxSeccompErrno
AssertValid() error
}
type LinuxSeccompEntry string
type LinuxSeccompErrno string
type linuxSeccompValue struct {
Set []LinuxSeccompEntry `json:"set"`
Errno LinuxSeccompErrno `json:"errno"`
}
type linuxSeccompBase struct {
val linuxSeccompValue
}
func (l linuxSeccompBase) multipleAllowed() bool {
return false
}
func (l linuxSeccompBase) AssertValid() error {
if len(l.val.Set) == 0 {
return errors.New("set must be non-empty")
}
if l.val.Errno == "" {
return nil
}
for _, c := range l.val.Errno {
if !unicode.IsUpper(c) {
return errors.New("errno must be an upper case string")
}
}
return nil
}
func (l *linuxSeccompBase) UnmarshalJSON(b []byte) error {
var v linuxSeccompValue
err := json.Unmarshal(b, &v)
if err != nil {
return err
}
l.val = v
return nil
}
func (l linuxSeccompBase) Set() []LinuxSeccompEntry {
return l.val.Set
}
func (l linuxSeccompBase) Errno() LinuxSeccompErrno {
return l.val.Errno
}
type LinuxSeccompRetainSet struct {
linuxSeccompBase
}
func (l LinuxSeccompRetainSet) Conflicts() []ACIdentifier {
return []ACIdentifier{LinuxSeccompRemoveSetName}
}
func NewLinuxSeccompRetainSet(errno string, syscall ...string) (*LinuxSeccompRetainSet, error) {
l := LinuxSeccompRetainSet{
linuxSeccompBase{
linuxSeccompValue{
make([]LinuxSeccompEntry, len(syscall)),
LinuxSeccompErrno(errno),
},
},
}
for i, c := range syscall {
l.linuxSeccompBase.val.Set[i] = LinuxSeccompEntry(c)
}
if err := l.AssertValid(); err != nil {
return nil, err
}
return &l, nil
}
func (l LinuxSeccompRetainSet) AsIsolator() (*Isolator, error) {
b, err := json.Marshal(l.linuxSeccompBase.val)
if err != nil {
return nil, err
}
rm := json.RawMessage(b)
return &Isolator{
Name: LinuxSeccompRetainSetName,
ValueRaw: &rm,
value: &l,
}, nil
}
type LinuxSeccompRemoveSet struct {
linuxSeccompBase
}
func (l LinuxSeccompRemoveSet) Conflicts() []ACIdentifier {
return []ACIdentifier{LinuxSeccompRetainSetName}
}
func NewLinuxSeccompRemoveSet(errno string, syscall ...string) (*LinuxSeccompRemoveSet, error) {
l := LinuxSeccompRemoveSet{
linuxSeccompBase{
linuxSeccompValue{
make([]LinuxSeccompEntry, len(syscall)),
LinuxSeccompErrno(errno),
},
},
}
for i, c := range syscall {
l.linuxSeccompBase.val.Set[i] = LinuxSeccompEntry(c)
}
if err := l.AssertValid(); err != nil {
return nil, err
}
return &l, nil
}
func (l LinuxSeccompRemoveSet) AsIsolator() (*Isolator, error) {
b, err := json.Marshal(l.linuxSeccompBase.val)
if err != nil {
return nil, err
}
rm := json.RawMessage(b)
return &Isolator{
Name: LinuxSeccompRemoveSetName,
ValueRaw: &rm,
value: &l,
}, nil
}
| {
"content_hash": "423c3a3317e6c70e6bba34d1eee9931a",
"timestamp": "",
"source": "github",
"line_count": 309,
"max_line_length": 103,
"avg_line_length": 22.601941747572816,
"alnum_prop": 0.718069873997709,
"repo_name": "squeed/rkt",
"id": "6cb9a86730edc3b4290d362de1e06ca555d98fad",
"size": "7578",
"binary": false,
"copies": "16",
"ref": "refs/heads/master",
"path": "vendor/github.com/appc/spec/schema/types/isolator_linux_specific.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "33266"
},
{
"name": "Go",
"bytes": "1595242"
},
{
"name": "M4",
"bytes": "43923"
},
{
"name": "Makefile",
"bytes": "149709"
},
{
"name": "Protocol Buffer",
"bytes": "17940"
},
{
"name": "Shell",
"bytes": "82242"
}
],
"symlink_target": ""
} |
var Spasm = Spasm || {};
Spasm.RenderMeshStagePart = function (stagePart)
{
Spasm.assertValid(stagePart);
this.stagePart = stagePart;
var shader = stagePart.shader;
var staticTextures = shader ? shader.static_textures : null;
var staticTextureCount = staticTextures && staticTextures.length ? staticTextures.length : 0;
this.shader = shader;
this.staticTextures = staticTextures;
this.staticTextureCount = staticTextureCount;
this.startIndex = stagePart.start_index;
this.indexCount = stagePart.index_count;
this.indexMin = stagePart.index_min;
this.indexMax = stagePart.index_max;
this.flags = stagePart.flags;
this.gearDyeChangeColorIndex = stagePart.gear_dye_change_color_index;
this.externalIdentifier = stagePart.external_identifier;
this.primitiveType = stagePart.primitive_type;
this.lodCategory = stagePart.lod_category;
this.lodRun = stagePart.lod_run;
};
Spasm.RenderMeshStagePart.prototype = {};
| {
"content_hash": "8ee6edb77aa99c6ab8ab16735d47cba9",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 94,
"avg_line_length": 29.424242424242426,
"alnum_prop": 0.7445932028836252,
"repo_name": "DestinyDevs/BungieNetPlatform",
"id": "e23c0fe515e594e1032f2be90de226f8f30549d1",
"size": "1007",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "three-tgx-loader/bnet-src/spasm/spasm_render_mesh_stage_part.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "GLSL",
"bytes": "7007"
},
{
"name": "HTML",
"bytes": "4966"
},
{
"name": "JavaScript",
"bytes": "2424226"
},
{
"name": "PHP",
"bytes": "380417"
}
],
"symlink_target": ""
} |
package java.util.zip;
/**
* The Adler32 class is used to compute the Adler32 Checksum from a set of data.
*/
public class Adler32 implements java.util.zip.Checksum {
private long adler = 1;
/**
* Returns the Adler32 checksum for all input received
*
* @return The checksum for this instance
*/
public long getValue() {
return adler;
}
/**
* Reset this instance to its initial checksum
*/
public void reset() {
adler = 1;
}
/**
* Update this Adler32 checksum using val.
*
* @param i
* byte to update checksum with
*/
public void update(int i) {
adler = updateByteImpl(i, adler);
}
/**
* Update this Adler32 checksum using the contents of buf.
*
* @param buf
* bytes to update checksum with
*/
public void update(byte[] buf) {
update(buf, 0, buf.length);
}
/**
* Update this Adler32 checksum with the contents of buf, starting from
* offset and using nbytes of data.
*
* @param buf
* buffer to obtain dat from
* @param off
* offset i buf to copy from
* @param nbytes
* number of bytes from buf to use
*/
public void update(byte[] buf, int off, int nbytes) {
// avoid int overflow, check null buf
if (off <= buf.length && nbytes >= 0 && off >= 0
&& buf.length - off >= nbytes) {
adler = updateImpl(buf, off, nbytes, adler);
} else {
throw new ArrayIndexOutOfBoundsException();
}
}
private native long updateImpl(byte[] buf, int off, int nbytes, long adler1);
private native long updateByteImpl(int val, long adler1);
}
| {
"content_hash": "f020373dfbef7cfe47cd9a3b48ca98cc",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 80,
"avg_line_length": 22.136986301369863,
"alnum_prop": 0.619430693069307,
"repo_name": "freeVM/freeVM",
"id": "2e4e2addc0981f5c170b544034d1da217d4aadcc",
"size": "2420",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "enhanced/archive/classlib/java6/modules/archive/src/main/java/java/util/zip/Adler32.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "116828"
},
{
"name": "C",
"bytes": "17860389"
},
{
"name": "C++",
"bytes": "19007206"
},
{
"name": "CSS",
"bytes": "217777"
},
{
"name": "Java",
"bytes": "152108632"
},
{
"name": "Objective-C",
"bytes": "106412"
},
{
"name": "Objective-J",
"bytes": "11029421"
},
{
"name": "Perl",
"bytes": "305690"
},
{
"name": "Scilab",
"bytes": "34"
},
{
"name": "Shell",
"bytes": "153821"
},
{
"name": "XSLT",
"bytes": "152859"
}
],
"symlink_target": ""
} |
import React from 'react';
import personalInfo from '../../../src/info';
import {Col, Row} from 'react-bootstrap';
import ScrollToTopOnMount from '../commons/ScrollToTopOnMount';
const HomePage = () => {
return (
<div>
<ScrollToTopOnMount/>
<div id="homePageTitle">
<h1 style={{fontSize: "42px"}}>Hey, I'm Liutong.</h1>
<p>A Software Engineer</p>
</div>
<Row id="overview">
<img id="homePageSelfie" src={personalInfo.basicInfo.selfie} alt="Liutong's Pic" className="img-circle"/>
<Col xs={8} xsOffset={2} mdOffset={4} md={4}>
<h2>Hi.</h2>
<p>{personalInfo.overview}</p>
</Col>
</Row>
</div>
);
};
export default HomePage; | {
"content_hash": "468d379fd45e2d0329bdde9bbc88404b",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 121,
"avg_line_length": 33.12,
"alnum_prop": 0.5120772946859904,
"repo_name": "liutongchen/liutong-chen-website",
"id": "fea7375647730b6079fa2be1f16e7904713b8b77",
"size": "828",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/components/Home/HomePage.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4514"
},
{
"name": "HTML",
"bytes": "1597"
},
{
"name": "JavaScript",
"bytes": "25174"
}
],
"symlink_target": ""
} |
<!--
Copyright SemanticBits, Northwestern University and Akaza Research
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/caaers/LICENSE.txt for details.
-->
<?xml version="1.0" encoding="UTF-8"?><project>
<parent>
<artifactId>parent</artifactId>
<groupId>ctmscaaers</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>ctmscaaers</groupId>
<artifactId>ctms-caaers-jms-su</artifactId>
<packaging>jbi-service-unit</packaging>
<name>CTMS-CAAERS :: jms SU</name>
<version>1.0-SNAPSHOT</version>
<url>http://www.myorganization.org</url>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.servicemix.tooling</groupId>
<artifactId>jbi-maven-plugin</artifactId>
<version>${servicemix-version}</version>
<extensions>true</extensions>
<configuration>
<type>service-unit</type>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<releases />
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>apache</id>
<name>Apache Repository</name>
<url>http://people.apache.org/repo/m2-ibiblio-rsync-repository</url>
</repository>
<repository>
<releases>
<enabled>false</enabled>
</releases>
<snapshots />
<id>apache.snapshots</id>
<name>Apache Snapshots Repository</name>
<url>http://people.apache.org/repo/m2-snapshot-repository</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases />
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>apache</id>
<name>Apache Repository</name>
<url>http://people.apache.org/repo/m2-ibiblio-rsync-repository</url>
</pluginRepository>
<pluginRepository>
<releases>
<enabled>false</enabled>
</releases>
<snapshots />
<id>apache.snapshots</id>
<name>Apache Snapshots Repository</name>
<url>http://people.apache.org/repo/m2-snapshot-repository</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.apache.servicemix</groupId>
<artifactId>servicemix-jms</artifactId>
<version>${servicemix-version}</version>
</dependency>
</dependencies>
<properties>
<servicemix-version>3.1.2</servicemix-version>
</properties>
</project>
| {
"content_hash": "06317d2f4dc6ad25772298eac7e3922b",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 74,
"avg_line_length": 29.32967032967033,
"alnum_prop": 0.6350693143499438,
"repo_name": "NCIP/caaers",
"id": "6995c13ae01b818cefb995eccf2e238d74034920",
"size": "2669",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "caAERS/software/jbi/ctms-caaers-service-assembly/ctms-caaers-jms-su/pom.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AspectJ",
"bytes": "2052"
},
{
"name": "CSS",
"bytes": "150269"
},
{
"name": "Groovy",
"bytes": "19195107"
},
{
"name": "Java",
"bytes": "13042355"
},
{
"name": "JavaScript",
"bytes": "438475"
},
{
"name": "Ruby",
"bytes": "29724"
},
{
"name": "Shell",
"bytes": "1436"
},
{
"name": "XSLT",
"bytes": "1330533"
}
],
"symlink_target": ""
} |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.Enums
(KeyType(..), PToJSVal, ToJSVal, PFromJSVal, FromJSVal,
js_KeyTypeSecret, js_KeyTypePublic, js_KeyTypePrivate,
KeyUsage(..), js_KeyUsageEncrypt, js_KeyUsageDecrypt,
js_KeyUsageSign, js_KeyUsageVerify, js_KeyUsageDeriveKey,
js_KeyUsageDeriveBits, js_KeyUsageWrapKey, js_KeyUsageUnwrapKey,
CanvasWindingRule(..), js_CanvasWindingRuleNonzero,
js_CanvasWindingRuleEvenodd, VideoPresentationMode(..),
js_VideoPresentationModeFullscreen,
js_VideoPresentationModeOptimized, js_VideoPresentationModeInline,
TextTrackMode(..), js_TextTrackModeDisabled,
js_TextTrackModeHidden, js_TextTrackModeShowing, TextTrackKind(..),
js_TextTrackKindSubtitles, js_TextTrackKindCaptions,
js_TextTrackKindDescriptions, js_TextTrackKindChapters,
js_TextTrackKindMetadata, DeviceType(..), js_DeviceTypeNone,
js_DeviceTypeAirplay, js_DeviceTypeTvout, MediaUIPartID(..),
js_MediaUIPartIDOptimizedFullscreenButton,
js_MediaUIPartIDOptimizedFullscreenPlaceholder,
EndOfStreamError(..), js_EndOfStreamErrorNetwork,
js_EndOfStreamErrorDecode, AppendMode(..), js_AppendModeSegments,
js_AppendModeSequence, SourceTypeEnum(..), js_SourceTypeEnumNone,
js_SourceTypeEnumCamera, js_SourceTypeEnumMicrophone,
VideoFacingModeEnum(..), js_VideoFacingModeEnumUser,
js_VideoFacingModeEnumEnvironment, js_VideoFacingModeEnumLeft,
js_VideoFacingModeEnumRight, MediaStreamTrackState(..),
js_MediaStreamTrackStateNew, js_MediaStreamTrackStateLive,
js_MediaStreamTrackStateEnded, RTCIceTransportsEnum(..),
js_RTCIceTransportsEnumNone, js_RTCIceTransportsEnumRelay,
js_RTCIceTransportsEnumAll, RTCIdentityOptionEnum(..),
js_RTCIdentityOptionEnumYes, js_RTCIdentityOptionEnumNo,
js_RTCIdentityOptionEnumIfconfigured, ReadableStreamStateType(..),
js_ReadableStreamStateTypeReadable,
js_ReadableStreamStateTypeWaiting,
js_ReadableStreamStateTypeClosed,
js_ReadableStreamStateTypeErrored, OverSampleType(..),
js_OverSampleTypeNone, js_OverSampleType2x, js_OverSampleType4x,
PageOverlayType(..), js_PageOverlayTypeView,
js_PageOverlayTypeDocument, XMLHttpRequestResponseType(..),
js_XMLHttpRequestResponseType,
js_XMLHttpRequestResponseTypeArraybuffer,
js_XMLHttpRequestResponseTypeBlob,
js_XMLHttpRequestResponseTypeDocument,
js_XMLHttpRequestResponseTypeJson,
js_XMLHttpRequestResponseTypeText)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, fmap, Show, Read, Eq, Ord)
import Data.Typeable (Typeable)
import GHCJS.Types (JSVal(..), JSString)
import GHCJS.Foreign (jsNull)
import GHCJS.Foreign.Callback (syncCallback, asyncCallback, syncCallback1, asyncCallback1, syncCallback2, asyncCallback2, OnBlocked(..))
import GHCJS.Marshal (ToJSVal(..), FromJSVal(..))
import GHCJS.Marshal.Pure (PToJSVal(..), PFromJSVal(..))
import Control.Monad.IO.Class (MonadIO(..))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import GHCJS.DOM.Types
import Control.Applicative ((<$>))
data KeyType = KeyTypeSecret
| KeyTypePublic
| KeyTypePrivate
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal KeyType where
pToJSVal KeyTypeSecret = js_KeyTypeSecret
pToJSVal KeyTypePublic = js_KeyTypePublic
pToJSVal KeyTypePrivate = js_KeyTypePrivate
instance ToJSVal KeyType where
toJSVal = return . pToJSVal
instance PFromJSVal KeyType where
pFromJSVal x | x `js_eq` js_KeyTypeSecret = KeyTypeSecret
pFromJSVal x | x `js_eq` js_KeyTypePublic = KeyTypePublic
pFromJSVal x | x `js_eq` js_KeyTypePrivate = KeyTypePrivate
instance FromJSVal KeyType where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"secret\"" js_KeyTypeSecret ::
JSVal
foreign import javascript unsafe "\"public\"" js_KeyTypePublic ::
JSVal
foreign import javascript unsafe "\"private\"" js_KeyTypePrivate ::
JSVal
data KeyUsage = KeyUsageEncrypt
| KeyUsageDecrypt
| KeyUsageSign
| KeyUsageVerify
| KeyUsageDeriveKey
| KeyUsageDeriveBits
| KeyUsageWrapKey
| KeyUsageUnwrapKey
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal KeyUsage where
pToJSVal KeyUsageEncrypt = js_KeyUsageEncrypt
pToJSVal KeyUsageDecrypt = js_KeyUsageDecrypt
pToJSVal KeyUsageSign = js_KeyUsageSign
pToJSVal KeyUsageVerify = js_KeyUsageVerify
pToJSVal KeyUsageDeriveKey = js_KeyUsageDeriveKey
pToJSVal KeyUsageDeriveBits = js_KeyUsageDeriveBits
pToJSVal KeyUsageWrapKey = js_KeyUsageWrapKey
pToJSVal KeyUsageUnwrapKey = js_KeyUsageUnwrapKey
instance ToJSVal KeyUsage where
toJSVal = return . pToJSVal
instance PFromJSVal KeyUsage where
pFromJSVal x | x `js_eq` js_KeyUsageEncrypt = KeyUsageEncrypt
pFromJSVal x | x `js_eq` js_KeyUsageDecrypt = KeyUsageDecrypt
pFromJSVal x | x `js_eq` js_KeyUsageSign = KeyUsageSign
pFromJSVal x | x `js_eq` js_KeyUsageVerify = KeyUsageVerify
pFromJSVal x | x `js_eq` js_KeyUsageDeriveKey = KeyUsageDeriveKey
pFromJSVal x | x `js_eq` js_KeyUsageDeriveBits = KeyUsageDeriveBits
pFromJSVal x | x `js_eq` js_KeyUsageWrapKey = KeyUsageWrapKey
pFromJSVal x | x `js_eq` js_KeyUsageUnwrapKey = KeyUsageUnwrapKey
instance FromJSVal KeyUsage where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"encrypt\"" js_KeyUsageEncrypt
:: JSVal
foreign import javascript unsafe "\"decrypt\"" js_KeyUsageDecrypt
:: JSVal
foreign import javascript unsafe "\"sign\"" js_KeyUsageSign ::
JSVal
foreign import javascript unsafe "\"verify\"" js_KeyUsageVerify ::
JSVal
foreign import javascript unsafe "\"deriveKey\""
js_KeyUsageDeriveKey :: JSVal
foreign import javascript unsafe "\"deriveBits\""
js_KeyUsageDeriveBits :: JSVal
foreign import javascript unsafe "\"wrapKey\"" js_KeyUsageWrapKey
:: JSVal
foreign import javascript unsafe "\"unwrapKey\""
js_KeyUsageUnwrapKey :: JSVal
data CanvasWindingRule = CanvasWindingRuleNonzero
| CanvasWindingRuleEvenodd
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal CanvasWindingRule where
pToJSVal CanvasWindingRuleNonzero = js_CanvasWindingRuleNonzero
pToJSVal CanvasWindingRuleEvenodd = js_CanvasWindingRuleEvenodd
instance ToJSVal CanvasWindingRule where
toJSVal = return . pToJSVal
instance PFromJSVal CanvasWindingRule where
pFromJSVal x
| x `js_eq` js_CanvasWindingRuleNonzero = CanvasWindingRuleNonzero
pFromJSVal x
| x `js_eq` js_CanvasWindingRuleEvenodd = CanvasWindingRuleEvenodd
instance FromJSVal CanvasWindingRule where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"nonzero\""
js_CanvasWindingRuleNonzero :: JSVal
foreign import javascript unsafe "\"evenodd\""
js_CanvasWindingRuleEvenodd :: JSVal
data VideoPresentationMode = VideoPresentationModeFullscreen
| VideoPresentationModeOptimized
| VideoPresentationModeInline
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal VideoPresentationMode where
pToJSVal VideoPresentationModeFullscreen
= js_VideoPresentationModeFullscreen
pToJSVal VideoPresentationModeOptimized
= js_VideoPresentationModeOptimized
pToJSVal VideoPresentationModeInline
= js_VideoPresentationModeInline
instance ToJSVal VideoPresentationMode where
toJSVal = return . pToJSVal
instance PFromJSVal VideoPresentationMode where
pFromJSVal x
| x `js_eq` js_VideoPresentationModeFullscreen =
VideoPresentationModeFullscreen
pFromJSVal x
| x `js_eq` js_VideoPresentationModeOptimized =
VideoPresentationModeOptimized
pFromJSVal x
| x `js_eq` js_VideoPresentationModeInline =
VideoPresentationModeInline
instance FromJSVal VideoPresentationMode where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"fullscreen\""
js_VideoPresentationModeFullscreen :: JSVal
foreign import javascript unsafe "\"optimized\""
js_VideoPresentationModeOptimized :: JSVal
foreign import javascript unsafe "\"inline\""
js_VideoPresentationModeInline :: JSVal
data TextTrackMode = TextTrackModeDisabled
| TextTrackModeHidden
| TextTrackModeShowing
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal TextTrackMode where
pToJSVal TextTrackModeDisabled = js_TextTrackModeDisabled
pToJSVal TextTrackModeHidden = js_TextTrackModeHidden
pToJSVal TextTrackModeShowing = js_TextTrackModeShowing
instance ToJSVal TextTrackMode where
toJSVal = return . pToJSVal
instance PFromJSVal TextTrackMode where
pFromJSVal x
| x `js_eq` js_TextTrackModeDisabled = TextTrackModeDisabled
pFromJSVal x
| x `js_eq` js_TextTrackModeHidden = TextTrackModeHidden
pFromJSVal x
| x `js_eq` js_TextTrackModeShowing = TextTrackModeShowing
instance FromJSVal TextTrackMode where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"disabled\""
js_TextTrackModeDisabled :: JSVal
foreign import javascript unsafe "\"hidden\""
js_TextTrackModeHidden :: JSVal
foreign import javascript unsafe "\"showing\""
js_TextTrackModeShowing :: JSVal
data TextTrackKind = TextTrackKindSubtitles
| TextTrackKindCaptions
| TextTrackKindDescriptions
| TextTrackKindChapters
| TextTrackKindMetadata
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal TextTrackKind where
pToJSVal TextTrackKindSubtitles = js_TextTrackKindSubtitles
pToJSVal TextTrackKindCaptions = js_TextTrackKindCaptions
pToJSVal TextTrackKindDescriptions = js_TextTrackKindDescriptions
pToJSVal TextTrackKindChapters = js_TextTrackKindChapters
pToJSVal TextTrackKindMetadata = js_TextTrackKindMetadata
instance ToJSVal TextTrackKind where
toJSVal = return . pToJSVal
instance PFromJSVal TextTrackKind where
pFromJSVal x
| x `js_eq` js_TextTrackKindSubtitles = TextTrackKindSubtitles
pFromJSVal x
| x `js_eq` js_TextTrackKindCaptions = TextTrackKindCaptions
pFromJSVal x
| x `js_eq` js_TextTrackKindDescriptions =
TextTrackKindDescriptions
pFromJSVal x
| x `js_eq` js_TextTrackKindChapters = TextTrackKindChapters
pFromJSVal x
| x `js_eq` js_TextTrackKindMetadata = TextTrackKindMetadata
instance FromJSVal TextTrackKind where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"subtitles\""
js_TextTrackKindSubtitles :: JSVal
foreign import javascript unsafe "\"captions\""
js_TextTrackKindCaptions :: JSVal
foreign import javascript unsafe "\"descriptions\""
js_TextTrackKindDescriptions :: JSVal
foreign import javascript unsafe "\"chapters\""
js_TextTrackKindChapters :: JSVal
foreign import javascript unsafe "\"metadata\""
js_TextTrackKindMetadata :: JSVal
data DeviceType = DeviceTypeNone
| DeviceTypeAirplay
| DeviceTypeTvout
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal DeviceType where
pToJSVal DeviceTypeNone = js_DeviceTypeNone
pToJSVal DeviceTypeAirplay = js_DeviceTypeAirplay
pToJSVal DeviceTypeTvout = js_DeviceTypeTvout
instance ToJSVal DeviceType where
toJSVal = return . pToJSVal
instance PFromJSVal DeviceType where
pFromJSVal x | x `js_eq` js_DeviceTypeNone = DeviceTypeNone
pFromJSVal x | x `js_eq` js_DeviceTypeAirplay = DeviceTypeAirplay
pFromJSVal x | x `js_eq` js_DeviceTypeTvout = DeviceTypeTvout
instance FromJSVal DeviceType where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"none\"" js_DeviceTypeNone ::
JSVal
foreign import javascript unsafe "\"airplay\"" js_DeviceTypeAirplay
:: JSVal
foreign import javascript unsafe "\"tvout\"" js_DeviceTypeTvout ::
JSVal
data MediaUIPartID = MediaUIPartIDOptimizedFullscreenButton
| MediaUIPartIDOptimizedFullscreenPlaceholder
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal MediaUIPartID where
pToJSVal MediaUIPartIDOptimizedFullscreenButton
= js_MediaUIPartIDOptimizedFullscreenButton
pToJSVal MediaUIPartIDOptimizedFullscreenPlaceholder
= js_MediaUIPartIDOptimizedFullscreenPlaceholder
instance ToJSVal MediaUIPartID where
toJSVal = return . pToJSVal
instance PFromJSVal MediaUIPartID where
pFromJSVal x
| x `js_eq` js_MediaUIPartIDOptimizedFullscreenButton =
MediaUIPartIDOptimizedFullscreenButton
pFromJSVal x
| x `js_eq` js_MediaUIPartIDOptimizedFullscreenPlaceholder =
MediaUIPartIDOptimizedFullscreenPlaceholder
instance FromJSVal MediaUIPartID where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"optimized-fullscreen-button\""
js_MediaUIPartIDOptimizedFullscreenButton :: JSVal
foreign import javascript unsafe
"\"optimized-fullscreen-placeholder\""
js_MediaUIPartIDOptimizedFullscreenPlaceholder :: JSVal
data EndOfStreamError = EndOfStreamErrorNetwork
| EndOfStreamErrorDecode
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal EndOfStreamError where
pToJSVal EndOfStreamErrorNetwork = js_EndOfStreamErrorNetwork
pToJSVal EndOfStreamErrorDecode = js_EndOfStreamErrorDecode
instance ToJSVal EndOfStreamError where
toJSVal = return . pToJSVal
instance PFromJSVal EndOfStreamError where
pFromJSVal x
| x `js_eq` js_EndOfStreamErrorNetwork = EndOfStreamErrorNetwork
pFromJSVal x
| x `js_eq` js_EndOfStreamErrorDecode = EndOfStreamErrorDecode
instance FromJSVal EndOfStreamError where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"network\""
js_EndOfStreamErrorNetwork :: JSVal
foreign import javascript unsafe "\"decode\""
js_EndOfStreamErrorDecode :: JSVal
data AppendMode = AppendModeSegments
| AppendModeSequence
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal AppendMode where
pToJSVal AppendModeSegments = js_AppendModeSegments
pToJSVal AppendModeSequence = js_AppendModeSequence
instance ToJSVal AppendMode where
toJSVal = return . pToJSVal
instance PFromJSVal AppendMode where
pFromJSVal x | x `js_eq` js_AppendModeSegments = AppendModeSegments
pFromJSVal x | x `js_eq` js_AppendModeSequence = AppendModeSequence
instance FromJSVal AppendMode where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"segments\""
js_AppendModeSegments :: JSVal
foreign import javascript unsafe "\"sequence\""
js_AppendModeSequence :: JSVal
data SourceTypeEnum = SourceTypeEnumNone
| SourceTypeEnumCamera
| SourceTypeEnumMicrophone
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal SourceTypeEnum where
pToJSVal SourceTypeEnumNone = js_SourceTypeEnumNone
pToJSVal SourceTypeEnumCamera = js_SourceTypeEnumCamera
pToJSVal SourceTypeEnumMicrophone = js_SourceTypeEnumMicrophone
instance ToJSVal SourceTypeEnum where
toJSVal = return . pToJSVal
instance PFromJSVal SourceTypeEnum where
pFromJSVal x | x `js_eq` js_SourceTypeEnumNone = SourceTypeEnumNone
pFromJSVal x
| x `js_eq` js_SourceTypeEnumCamera = SourceTypeEnumCamera
pFromJSVal x
| x `js_eq` js_SourceTypeEnumMicrophone = SourceTypeEnumMicrophone
instance FromJSVal SourceTypeEnum where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"none\"" js_SourceTypeEnumNone
:: JSVal
foreign import javascript unsafe "\"camera\""
js_SourceTypeEnumCamera :: JSVal
foreign import javascript unsafe "\"microphone\""
js_SourceTypeEnumMicrophone :: JSVal
data VideoFacingModeEnum = VideoFacingModeEnumUser
| VideoFacingModeEnumEnvironment
| VideoFacingModeEnumLeft
| VideoFacingModeEnumRight
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal VideoFacingModeEnum where
pToJSVal VideoFacingModeEnumUser = js_VideoFacingModeEnumUser
pToJSVal VideoFacingModeEnumEnvironment
= js_VideoFacingModeEnumEnvironment
pToJSVal VideoFacingModeEnumLeft = js_VideoFacingModeEnumLeft
pToJSVal VideoFacingModeEnumRight = js_VideoFacingModeEnumRight
instance ToJSVal VideoFacingModeEnum where
toJSVal = return . pToJSVal
instance PFromJSVal VideoFacingModeEnum where
pFromJSVal x
| x `js_eq` js_VideoFacingModeEnumUser = VideoFacingModeEnumUser
pFromJSVal x
| x `js_eq` js_VideoFacingModeEnumEnvironment =
VideoFacingModeEnumEnvironment
pFromJSVal x
| x `js_eq` js_VideoFacingModeEnumLeft = VideoFacingModeEnumLeft
pFromJSVal x
| x `js_eq` js_VideoFacingModeEnumRight = VideoFacingModeEnumRight
instance FromJSVal VideoFacingModeEnum where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"user\""
js_VideoFacingModeEnumUser :: JSVal
foreign import javascript unsafe "\"environment\""
js_VideoFacingModeEnumEnvironment :: JSVal
foreign import javascript unsafe "\"left\""
js_VideoFacingModeEnumLeft :: JSVal
foreign import javascript unsafe "\"right\""
js_VideoFacingModeEnumRight :: JSVal
data MediaStreamTrackState = MediaStreamTrackStateNew
| MediaStreamTrackStateLive
| MediaStreamTrackStateEnded
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal MediaStreamTrackState where
pToJSVal MediaStreamTrackStateNew = js_MediaStreamTrackStateNew
pToJSVal MediaStreamTrackStateLive = js_MediaStreamTrackStateLive
pToJSVal MediaStreamTrackStateEnded = js_MediaStreamTrackStateEnded
instance ToJSVal MediaStreamTrackState where
toJSVal = return . pToJSVal
instance PFromJSVal MediaStreamTrackState where
pFromJSVal x
| x `js_eq` js_MediaStreamTrackStateNew = MediaStreamTrackStateNew
pFromJSVal x
| x `js_eq` js_MediaStreamTrackStateLive =
MediaStreamTrackStateLive
pFromJSVal x
| x `js_eq` js_MediaStreamTrackStateEnded =
MediaStreamTrackStateEnded
instance FromJSVal MediaStreamTrackState where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"new\""
js_MediaStreamTrackStateNew :: JSVal
foreign import javascript unsafe "\"live\""
js_MediaStreamTrackStateLive :: JSVal
foreign import javascript unsafe "\"ended\""
js_MediaStreamTrackStateEnded :: JSVal
data RTCIceTransportsEnum = RTCIceTransportsEnumNone
| RTCIceTransportsEnumRelay
| RTCIceTransportsEnumAll
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal RTCIceTransportsEnum where
pToJSVal RTCIceTransportsEnumNone = js_RTCIceTransportsEnumNone
pToJSVal RTCIceTransportsEnumRelay = js_RTCIceTransportsEnumRelay
pToJSVal RTCIceTransportsEnumAll = js_RTCIceTransportsEnumAll
instance ToJSVal RTCIceTransportsEnum where
toJSVal = return . pToJSVal
instance PFromJSVal RTCIceTransportsEnum where
pFromJSVal x
| x `js_eq` js_RTCIceTransportsEnumNone = RTCIceTransportsEnumNone
pFromJSVal x
| x `js_eq` js_RTCIceTransportsEnumRelay =
RTCIceTransportsEnumRelay
pFromJSVal x
| x `js_eq` js_RTCIceTransportsEnumAll = RTCIceTransportsEnumAll
instance FromJSVal RTCIceTransportsEnum where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"none\""
js_RTCIceTransportsEnumNone :: JSVal
foreign import javascript unsafe "\"relay\""
js_RTCIceTransportsEnumRelay :: JSVal
foreign import javascript unsafe "\"all\""
js_RTCIceTransportsEnumAll :: JSVal
data RTCIdentityOptionEnum = RTCIdentityOptionEnumYes
| RTCIdentityOptionEnumNo
| RTCIdentityOptionEnumIfconfigured
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal RTCIdentityOptionEnum where
pToJSVal RTCIdentityOptionEnumYes = js_RTCIdentityOptionEnumYes
pToJSVal RTCIdentityOptionEnumNo = js_RTCIdentityOptionEnumNo
pToJSVal RTCIdentityOptionEnumIfconfigured
= js_RTCIdentityOptionEnumIfconfigured
instance ToJSVal RTCIdentityOptionEnum where
toJSVal = return . pToJSVal
instance PFromJSVal RTCIdentityOptionEnum where
pFromJSVal x
| x `js_eq` js_RTCIdentityOptionEnumYes = RTCIdentityOptionEnumYes
pFromJSVal x
| x `js_eq` js_RTCIdentityOptionEnumNo = RTCIdentityOptionEnumNo
pFromJSVal x
| x `js_eq` js_RTCIdentityOptionEnumIfconfigured =
RTCIdentityOptionEnumIfconfigured
instance FromJSVal RTCIdentityOptionEnum where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"yes\""
js_RTCIdentityOptionEnumYes :: JSVal
foreign import javascript unsafe "\"no\""
js_RTCIdentityOptionEnumNo :: JSVal
foreign import javascript unsafe "\"ifconfigured\""
js_RTCIdentityOptionEnumIfconfigured :: JSVal
data ReadableStreamStateType = ReadableStreamStateTypeReadable
| ReadableStreamStateTypeWaiting
| ReadableStreamStateTypeClosed
| ReadableStreamStateTypeErrored
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal ReadableStreamStateType where
pToJSVal ReadableStreamStateTypeReadable
= js_ReadableStreamStateTypeReadable
pToJSVal ReadableStreamStateTypeWaiting
= js_ReadableStreamStateTypeWaiting
pToJSVal ReadableStreamStateTypeClosed
= js_ReadableStreamStateTypeClosed
pToJSVal ReadableStreamStateTypeErrored
= js_ReadableStreamStateTypeErrored
instance ToJSVal ReadableStreamStateType where
toJSVal = return . pToJSVal
instance PFromJSVal ReadableStreamStateType where
pFromJSVal x
| x `js_eq` js_ReadableStreamStateTypeReadable =
ReadableStreamStateTypeReadable
pFromJSVal x
| x `js_eq` js_ReadableStreamStateTypeWaiting =
ReadableStreamStateTypeWaiting
pFromJSVal x
| x `js_eq` js_ReadableStreamStateTypeClosed =
ReadableStreamStateTypeClosed
pFromJSVal x
| x `js_eq` js_ReadableStreamStateTypeErrored =
ReadableStreamStateTypeErrored
instance FromJSVal ReadableStreamStateType where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"readable\""
js_ReadableStreamStateTypeReadable :: JSVal
foreign import javascript unsafe "\"waiting\""
js_ReadableStreamStateTypeWaiting :: JSVal
foreign import javascript unsafe "\"closed\""
js_ReadableStreamStateTypeClosed :: JSVal
foreign import javascript unsafe "\"errored\""
js_ReadableStreamStateTypeErrored :: JSVal
data OverSampleType = OverSampleTypeNone
| OverSampleType2x
| OverSampleType4x
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal OverSampleType where
pToJSVal OverSampleTypeNone = js_OverSampleTypeNone
pToJSVal OverSampleType2x = js_OverSampleType2x
pToJSVal OverSampleType4x = js_OverSampleType4x
instance ToJSVal OverSampleType where
toJSVal = return . pToJSVal
instance PFromJSVal OverSampleType where
pFromJSVal x | x `js_eq` js_OverSampleTypeNone = OverSampleTypeNone
pFromJSVal x | x `js_eq` js_OverSampleType2x = OverSampleType2x
pFromJSVal x | x `js_eq` js_OverSampleType4x = OverSampleType4x
instance FromJSVal OverSampleType where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"none\"" js_OverSampleTypeNone
:: JSVal
foreign import javascript unsafe "\"2x\"" js_OverSampleType2x ::
JSVal
foreign import javascript unsafe "\"4x\"" js_OverSampleType4x ::
JSVal
data PageOverlayType = PageOverlayTypeView
| PageOverlayTypeDocument
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal PageOverlayType where
pToJSVal PageOverlayTypeView = js_PageOverlayTypeView
pToJSVal PageOverlayTypeDocument = js_PageOverlayTypeDocument
instance ToJSVal PageOverlayType where
toJSVal = return . pToJSVal
instance PFromJSVal PageOverlayType where
pFromJSVal x
| x `js_eq` js_PageOverlayTypeView = PageOverlayTypeView
pFromJSVal x
| x `js_eq` js_PageOverlayTypeDocument = PageOverlayTypeDocument
instance FromJSVal PageOverlayType where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"view\"" js_PageOverlayTypeView
:: JSVal
foreign import javascript unsafe "\"document\""
js_PageOverlayTypeDocument :: JSVal
data XMLHttpRequestResponseType = XMLHttpRequestResponseType
| XMLHttpRequestResponseTypeArraybuffer
| XMLHttpRequestResponseTypeBlob
| XMLHttpRequestResponseTypeDocument
| XMLHttpRequestResponseTypeJson
| XMLHttpRequestResponseTypeText
deriving (Show, Read, Eq, Ord, Typeable)
instance PToJSVal XMLHttpRequestResponseType where
pToJSVal XMLHttpRequestResponseType = js_XMLHttpRequestResponseType
pToJSVal XMLHttpRequestResponseTypeArraybuffer
= js_XMLHttpRequestResponseTypeArraybuffer
pToJSVal XMLHttpRequestResponseTypeBlob
= js_XMLHttpRequestResponseTypeBlob
pToJSVal XMLHttpRequestResponseTypeDocument
= js_XMLHttpRequestResponseTypeDocument
pToJSVal XMLHttpRequestResponseTypeJson
= js_XMLHttpRequestResponseTypeJson
pToJSVal XMLHttpRequestResponseTypeText
= js_XMLHttpRequestResponseTypeText
instance ToJSVal XMLHttpRequestResponseType where
toJSVal = return . pToJSVal
instance PFromJSVal XMLHttpRequestResponseType where
pFromJSVal x
| x `js_eq` js_XMLHttpRequestResponseType =
XMLHttpRequestResponseType
pFromJSVal x
| x `js_eq` js_XMLHttpRequestResponseTypeArraybuffer =
XMLHttpRequestResponseTypeArraybuffer
pFromJSVal x
| x `js_eq` js_XMLHttpRequestResponseTypeBlob =
XMLHttpRequestResponseTypeBlob
pFromJSVal x
| x `js_eq` js_XMLHttpRequestResponseTypeDocument =
XMLHttpRequestResponseTypeDocument
pFromJSVal x
| x `js_eq` js_XMLHttpRequestResponseTypeJson =
XMLHttpRequestResponseTypeJson
pFromJSVal x
| x `js_eq` js_XMLHttpRequestResponseTypeText =
XMLHttpRequestResponseTypeText
instance FromJSVal XMLHttpRequestResponseType where
fromJSValUnchecked = return . pFromJSVal
fromJSVal = return . pFromJSVal
foreign import javascript unsafe "\"\""
js_XMLHttpRequestResponseType :: JSVal
foreign import javascript unsafe "\"arraybuffer\""
js_XMLHttpRequestResponseTypeArraybuffer :: JSVal
foreign import javascript unsafe "\"blob\""
js_XMLHttpRequestResponseTypeBlob :: JSVal
foreign import javascript unsafe "\"document\""
js_XMLHttpRequestResponseTypeDocument :: JSVal
foreign import javascript unsafe "\"json\""
js_XMLHttpRequestResponseTypeJson :: JSVal
foreign import javascript unsafe "\"text\""
js_XMLHttpRequestResponseTypeText :: JSVal | {
"content_hash": "d42b014f61b4cd07264c7b8da5d0382f",
"timestamp": "",
"source": "github",
"line_count": 771,
"max_line_length": 137,
"avg_line_length": 39.011673151750976,
"alnum_prop": 0.7019083715672585,
"repo_name": "manyoo/ghcjs-dom",
"id": "c1612af099dc8a55c9d1bb930cd3027207d70010",
"size": "30078",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/Enums.hs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "90"
},
{
"name": "Haskell",
"bytes": "3948159"
},
{
"name": "JavaScript",
"bytes": "603"
}
],
"symlink_target": ""
} |
<?php
namespace Omnipay\PayZen\Message;
use Omnipay\Common\Message\AbstractResponse;
/**
* PayZen Complete Purchase Response
*/
class CompletePurchaseResponse extends AbstractResponse implements CardCreationResponseInterface
{
use GetCardInformationTrait;
use GetMetadataTrait;
public function isSuccessful()
{
return in_array($this->getTransactionStatus(), ['AUTHORISED', 'CAPTURED']);
}
public function getTransactionReference()
{
return isset($this->data['vads_trans_id']) ? $this->data['vads_trans_id'] : null;
}
public function getOrderId()
{
return isset($this->data['vads_order_id']) ? $this->data['vads_order_id'] : null;
}
public function getAmount()
{
return isset($this->data['vads_amount']) ? $this->data['vads_amount'] / 100 : null;
}
public function getTransactionDate()
{
return isset($this->data['vads_trans_date']) ? $this->data['vads_trans_date'] : null;
}
public function getTransactionStatus()
{
return isset($this->data['vads_trans_status']) ? $this->data['vads_trans_status'] : null;
}
public function getCode()
{
return isset($this->data['vads_result']) ? $this->data['vads_result'] : null;
}
public function getUuid()
{
return isset($this->data['vads_trans_uuid']) ? $this->data['vads_trans_uuid'] : null;
}
}
| {
"content_hash": "77ecb17ad8ff4d8aa459c56191497ad5",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 97,
"avg_line_length": 25.745454545454546,
"alnum_prop": 0.632768361581921,
"repo_name": "ubitransports/omnipay-payzen",
"id": "103de2eadf3c77d54f726c269efd25233292544f",
"size": "1416",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Message/CompletePurchaseResponse.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "63812"
}
],
"symlink_target": ""
} |
from __future__ import absolute_import
from sentry.api.bases.avatar import AvatarMixin
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.models import OrganizationAvatar
class OrganizationAvatarEndpoint(AvatarMixin, OrganizationEndpoint):
object_type = "organization"
model = OrganizationAvatar
def get_avatar_filename(self, obj):
# for consistency with organization details endpoint
return u"{}.png".format(obj.slug)
| {
"content_hash": "ee2097682b4dd47f5240d9b04bccde58",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 68,
"avg_line_length": 33.92857142857143,
"alnum_prop": 0.7768421052631579,
"repo_name": "mvaled/sentry",
"id": "2114eb459d196bdd07fc1d4438babc58668fb9c6",
"size": "475",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/sentry/api/endpoints/organization_avatar.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "226439"
},
{
"name": "Dockerfile",
"bytes": "6431"
},
{
"name": "HTML",
"bytes": "173429"
},
{
"name": "JavaScript",
"bytes": "9314175"
},
{
"name": "Lua",
"bytes": "65885"
},
{
"name": "Makefile",
"bytes": "9225"
},
{
"name": "Python",
"bytes": "50385401"
},
{
"name": "Ruby",
"bytes": "168"
},
{
"name": "Shell",
"bytes": "5685"
},
{
"name": "TypeScript",
"bytes": "773664"
}
],
"symlink_target": ""
} |
package cn.liuyb.app.common.utils.json;
/**
* Convert a web browser cookie specification to a JSONObject and back.
* JSON and Cookies are both notations for name/value pairs.
* @author JSON.org
* @version 2
*/
public class Cookie {
/**
* Produce a copy of a string in which the characters '+', '%', '=', ';'
* and control characters are replaced with "%hh". This is a gentle form
* of URL encoding, attempting to cause as little distortion to the
* string as possible. The characters '=' and ';' are meta characters in
* cookies. By convention, they are escaped using the URL-encoding. This is
* only a convention, not a standard. Often, cookies are expected to have
* encoded values. We encode '=' and ';' because we must. We encode '%' and
* '+' because they are meta characters in URL encoding.
* @param string The source string.
* @return The escaped result.
*/
public static String escape(String string) {
char c;
String s = string.trim();
StringBuffer sb = new StringBuffer();
int len = s.length();
for (int i = 0; i < len; i += 1) {
c = s.charAt(i);
if (c < ' ' || c == '+' || c == '%' || c == '=' || c == ';') {
sb.append('%');
sb.append(Character.forDigit((char)((c >>> 4) & 0x0f), 16));
sb.append(Character.forDigit((char)(c & 0x0f), 16));
} else {
sb.append(c);
}
}
return sb.toString();
}
/**
* Convert a cookie specification string into a JSONObject. The string
* will contain a name value pair separated by '='. The name and the value
* will be unescaped, possibly converting '+' and '%' sequences. The
* cookie properties may follow, separated by ';', also represented as
* name=value (except the secure property, which does not have a value).
* The name will be stored under the key "name", and the value will be
* stored under the key "value". This method does not do checking or
* validation of the parameters. It only converts the cookie string into
* a JSONObject.
* @param string The cookie specification string.
* @return A JSONObject containing "name", "value", and possibly other
* members.
* @throws JSONException
*/
public static JSONObject toJSONObject(String string) throws JSONException {
String n;
JSONObject o = new JSONObject();
Object v;
JSONTokener x = new JSONTokener(string);
o.put("name", x.nextTo('='));
x.next('=');
o.put("value", x.nextTo(';'));
x.next();
while (x.more()) {
n = unescape(x.nextTo("=;"));
if (x.next() != '=') {
if (n.equals("secure")) {
v = Boolean.TRUE;
} else {
throw x.syntaxError("Missing '=' in cookie parameter.");
}
} else {
v = unescape(x.nextTo(';'));
x.next();
}
o.put(n, v);
}
return o;
}
/**
* Convert a JSONObject into a cookie specification string. The JSONObject
* must contain "name" and "value" members.
* If the JSONObject contains "expires", "domain", "path", or "secure"
* members, they will be appended to the cookie specification string.
* All other members are ignored.
* @param o A JSONObject
* @return A cookie specification string
* @throws JSONException
*/
public static String toString(JSONObject o) throws JSONException {
StringBuffer sb = new StringBuffer();
sb.append(escape(o.getString("name")));
sb.append("=");
sb.append(escape(o.getString("value")));
if (o.has("expires")) {
sb.append(";expires=");
sb.append(o.getString("expires"));
}
if (o.has("domain")) {
sb.append(";domain=");
sb.append(escape(o.getString("domain")));
}
if (o.has("path")) {
sb.append(";path=");
sb.append(escape(o.getString("path")));
}
if (o.optBoolean("secure")) {
sb.append(";secure");
}
return sb.toString();
}
/**
* Convert <code>%</code><i>hh</i> sequences to single characters, and
* convert plus to space.
* @param s A string that may contain
* <code>+</code> <small>(plus)</small> and
* <code>%</code><i>hh</i> sequences.
* @return The unescaped string.
*/
public static String unescape(String s) {
int len = s.length();
StringBuffer b = new StringBuffer();
for (int i = 0; i < len; ++i) {
char c = s.charAt(i);
if (c == '+') {
c = ' ';
} else if (c == '%' && i + 2 < len) {
int d = JSONTokener.dehexchar(s.charAt(i + 1));
int e = JSONTokener.dehexchar(s.charAt(i + 2));
if (d >= 0 && e >= 0) {
c = (char)(d * 16 + e);
i += 2;
}
}
b.append(c);
}
return b.toString();
}
}
| {
"content_hash": "a809b514d00aa6e67f4f0bd4f05b0595",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 79,
"avg_line_length": 37.204081632653065,
"alnum_prop": 0.5068568294020844,
"repo_name": "liuyb4016/model_project",
"id": "7f0a12d7e52f0d3bae44cc6e74921b41daebb845",
"size": "6596",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "model_springmvc/src/main/java/cn/liuyb/app/common/utils/json/Cookie.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "94720"
},
{
"name": "Java",
"bytes": "651696"
},
{
"name": "JavaScript",
"bytes": "192395"
}
],
"symlink_target": ""
} |
package ru.job4j.foodstorage.storage;
/**
* Class Warehouse | Implement FoodStorage [#852]
* @author Aleksey Sidorenko (mailto:sidorenko.aleksey@gmail.com)
* @since 26.09.2019
*/
public class Warehouse extends Storage {
private static Storage storage;
private Warehouse() {
}
/**
* Get singleton object.
* @return storage Access to singleton.
*/
public static synchronized Storage getInstance() {
if (storage == null) {
storage = new Warehouse();
}
return storage;
}
} | {
"content_hash": "88a8a91e653c148fe7bbf58c5858a251",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 65,
"avg_line_length": 22.04,
"alnum_prop": 0.6279491833030852,
"repo_name": "AlekseySidorenko/aleksey_sidorenko",
"id": "3545226185d3a696238430556784a02b5e93fab4",
"size": "551",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "chapter_008/src/main/java/ru/job4j/foodstorage/storage/Warehouse.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "308816"
},
{
"name": "Shell",
"bytes": "14"
},
{
"name": "TSQL",
"bytes": "2241"
}
],
"symlink_target": ""
} |
from __future__ import unicode_literals
import os.path
import sys
import tempfile
import types
import unittest
from contextlib import contextmanager
from django.template import Context, TemplateDoesNotExist
from django.template.engine import Engine
from django.test import SimpleTestCase, ignore_warnings, override_settings
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from .utils import TEMPLATE_DIR
try:
import pkg_resources
except ImportError:
pkg_resources = None
class CachedLoaderTests(SimpleTestCase):
def setUp(self):
self.engine = Engine(
dirs=[TEMPLATE_DIR],
loaders=[
('django.template.loaders.cached.Loader', [
'django.template.loaders.filesystem.Loader',
]),
],
)
def test_get_template(self):
template = self.engine.get_template('index.html')
self.assertEqual(template.origin.name, os.path.join(TEMPLATE_DIR, 'index.html'))
self.assertEqual(template.origin.template_name, 'index.html')
self.assertEqual(template.origin.loader, self.engine.template_loaders[0].loaders[0])
cache = self.engine.template_loaders[0].get_template_cache
self.assertEqual(cache['index.html'], template)
# Run a second time from cache
template = self.engine.get_template('index.html')
self.assertEqual(template.origin.name, os.path.join(TEMPLATE_DIR, 'index.html'))
self.assertEqual(template.origin.template_name, 'index.html')
self.assertEqual(template.origin.loader, self.engine.template_loaders[0].loaders[0])
def test_get_template_missing(self):
with self.assertRaises(TemplateDoesNotExist):
self.engine.get_template('doesnotexist.html')
e = self.engine.template_loaders[0].get_template_cache['doesnotexist.html']
self.assertEqual(e.args[0], 'doesnotexist.html')
@ignore_warnings(category=RemovedInDjango20Warning)
def test_load_template(self):
loader = self.engine.template_loaders[0]
template, origin = loader.load_template('index.html')
self.assertEqual(template.origin.template_name, 'index.html')
cache = self.engine.template_loaders[0].template_cache
self.assertEqual(cache['index.html'][0], template)
# Run a second time from cache
loader = self.engine.template_loaders[0]
source, name = loader.load_template('index.html')
self.assertEqual(template.origin.template_name, 'index.html')
@ignore_warnings(category=RemovedInDjango20Warning)
def test_load_template_missing(self):
"""
#19949 -- TemplateDoesNotExist exceptions should be cached.
"""
loader = self.engine.template_loaders[0]
self.assertFalse('missing.html' in loader.template_cache)
with self.assertRaises(TemplateDoesNotExist):
loader.load_template("missing.html")
self.assertEqual(
loader.template_cache["missing.html"],
TemplateDoesNotExist,
"Cached loader failed to cache the TemplateDoesNotExist exception",
)
@ignore_warnings(category=RemovedInDjango20Warning)
def test_load_nonexistent_cached_template(self):
loader = self.engine.template_loaders[0]
template_name = 'nonexistent.html'
# fill the template cache
with self.assertRaises(TemplateDoesNotExist):
loader.find_template(template_name)
with self.assertRaisesMessage(TemplateDoesNotExist, template_name):
loader.get_template(template_name)
def test_templatedir_caching(self):
"""
#13573 -- Template directories should be part of the cache key.
"""
# Retrieve a template specifying a template directory to check
t1, name = self.engine.find_template('test.html', (os.path.join(TEMPLATE_DIR, 'first'),))
# Now retrieve the same template name, but from a different directory
t2, name = self.engine.find_template('test.html', (os.path.join(TEMPLATE_DIR, 'second'),))
# The two templates should not have the same content
self.assertNotEqual(t1.render(Context({})), t2.render(Context({})))
@unittest.skipUnless(pkg_resources, 'setuptools is not installed')
class EggLoaderTests(SimpleTestCase):
@contextmanager
def create_egg(self, name, resources):
"""
Creates a mock egg with a list of resources.
name: The name of the module.
resources: A dictionary of template names mapped to file-like objects.
"""
if six.PY2:
name = name.encode('utf-8')
class MockLoader(object):
pass
class MockProvider(pkg_resources.NullProvider):
def __init__(self, module):
pkg_resources.NullProvider.__init__(self, module)
self.module = module
def _has(self, path):
return path in self.module._resources
def _isdir(self, path):
return False
def get_resource_stream(self, manager, resource_name):
return self.module._resources[resource_name]
def _get(self, path):
return self.module._resources[path].read()
def _fn(self, base, resource_name):
return os.path.normcase(resource_name)
egg = types.ModuleType(name)
egg.__loader__ = MockLoader()
egg.__path__ = ['/some/bogus/path/']
egg.__file__ = '/some/bogus/path/__init__.pyc'
egg._resources = resources
sys.modules[name] = egg
pkg_resources._provider_factories[MockLoader] = MockProvider
try:
yield
finally:
del sys.modules[name]
del pkg_resources._provider_factories[MockLoader]
@classmethod
@ignore_warnings(category=RemovedInDjango20Warning)
def setUpClass(cls):
cls.engine = Engine(loaders=[
'django.template.loaders.eggs.Loader',
])
cls.loader = cls.engine.template_loaders[0]
super(EggLoaderTests, cls).setUpClass()
def test_get_template(self):
templates = {
os.path.normcase('templates/y.html'): six.StringIO("y"),
}
with self.create_egg('egg', templates):
with override_settings(INSTALLED_APPS=['egg']):
template = self.engine.get_template("y.html")
self.assertEqual(template.origin.name, 'egg:egg:templates/y.html')
self.assertEqual(template.origin.template_name, 'y.html')
self.assertEqual(template.origin.loader, self.engine.template_loaders[0])
output = template.render(Context({}))
self.assertEqual(output, "y")
@ignore_warnings(category=RemovedInDjango20Warning)
def test_load_template_source(self):
loader = self.engine.template_loaders[0]
templates = {
os.path.normcase('templates/y.html'): six.StringIO("y"),
}
with self.create_egg('egg', templates):
with override_settings(INSTALLED_APPS=['egg']):
source, name = loader.load_template_source('y.html')
self.assertEqual(source.strip(), 'y')
self.assertEqual(name, 'egg:egg:templates/y.html')
def test_non_existing(self):
"""
Template loading fails if the template is not in the egg.
"""
with self.create_egg('egg', {}):
with override_settings(INSTALLED_APPS=['egg']):
with self.assertRaises(TemplateDoesNotExist):
self.engine.get_template('not-existing.html')
def test_not_installed(self):
"""
Template loading fails if the egg is not in INSTALLED_APPS.
"""
templates = {
os.path.normcase('templates/y.html'): six.StringIO("y"),
}
with self.create_egg('egg', templates):
with self.assertRaises(TemplateDoesNotExist):
self.engine.get_template('y.html')
class FileSystemLoaderTests(SimpleTestCase):
@classmethod
def setUpClass(cls):
cls.engine = Engine(dirs=[TEMPLATE_DIR])
super(FileSystemLoaderTests, cls).setUpClass()
@contextmanager
def set_dirs(self, dirs):
original_dirs = self.engine.dirs
self.engine.dirs = dirs
try:
yield
finally:
self.engine.dirs = original_dirs
@contextmanager
def source_checker(self, dirs):
loader = self.engine.template_loaders[0]
def check_sources(path, expected_sources):
expected_sources = [os.path.abspath(s) for s in expected_sources]
self.assertEqual(
[origin.name for origin in loader.get_template_sources(path)],
expected_sources,
)
with self.set_dirs(dirs):
yield check_sources
def test_get_template(self):
template = self.engine.get_template('index.html')
self.assertEqual(template.origin.name, os.path.join(TEMPLATE_DIR, 'index.html'))
self.assertEqual(template.origin.template_name, 'index.html')
self.assertEqual(template.origin.loader, self.engine.template_loaders[0])
self.assertEqual(template.origin.loader_name, 'django.template.loaders.filesystem.Loader')
@ignore_warnings(category=RemovedInDjango20Warning)
def test_load_template_source(self):
loader = self.engine.template_loaders[0]
source, name = loader.load_template_source('index.html')
self.assertEqual(source.strip(), 'index')
self.assertEqual(name, os.path.join(TEMPLATE_DIR, 'index.html'))
def test_directory_security(self):
with self.source_checker(['/dir1', '/dir2']) as check_sources:
check_sources('index.html', ['/dir1/index.html', '/dir2/index.html'])
check_sources('/etc/passwd', [])
check_sources('etc/passwd', ['/dir1/etc/passwd', '/dir2/etc/passwd'])
check_sources('../etc/passwd', [])
check_sources('../../../etc/passwd', [])
check_sources('/dir1/index.html', ['/dir1/index.html'])
check_sources('../dir2/index.html', ['/dir2/index.html'])
check_sources('/dir1blah', [])
check_sources('../dir1blah', [])
def test_unicode_template_name(self):
with self.source_checker(['/dir1', '/dir2']) as check_sources:
# UTF-8 bytestrings are permitted.
check_sources(b'\xc3\x85ngstr\xc3\xb6m', ['/dir1/Ångström', '/dir2/Ångström'])
# Unicode strings are permitted.
check_sources('Ångström', ['/dir1/Ångström', '/dir2/Ångström'])
def test_utf8_bytestring(self):
"""
Invalid UTF-8 encoding in bytestrings should raise a useful error
"""
engine = Engine()
loader = engine.template_loaders[0]
with self.assertRaises(UnicodeDecodeError):
list(loader.get_template_sources(b'\xc3\xc3', ['/dir1']))
def test_unicode_dir_name(self):
with self.source_checker([b'/Stra\xc3\x9fe']) as check_sources:
check_sources('Ångström', ['/Straße/Ångström'])
check_sources(b'\xc3\x85ngstr\xc3\xb6m', ['/Straße/Ångström'])
@unittest.skipUnless(
os.path.normcase('/TEST') == os.path.normpath('/test'),
"This test only runs on case-sensitive file systems.",
)
def test_case_sensitivity(self):
with self.source_checker(['/dir1', '/DIR2']) as check_sources:
check_sources('index.html', ['/dir1/index.html', '/DIR2/index.html'])
check_sources('/DIR1/index.HTML', ['/DIR1/index.HTML'])
def test_file_does_not_exist(self):
with self.assertRaises(TemplateDoesNotExist):
self.engine.get_template('doesnotexist.html')
@unittest.skipIf(
sys.platform == 'win32',
"Python on Windows doesn't have working os.chmod().",
)
def test_permissions_error(self):
with tempfile.NamedTemporaryFile() as tmpfile:
tmpdir = os.path.dirname(tmpfile.name)
tmppath = os.path.join(tmpdir, tmpfile.name)
os.chmod(tmppath, 0o0222)
with self.set_dirs([tmpdir]):
with self.assertRaisesMessage(IOError, 'Permission denied'):
self.engine.get_template(tmpfile.name)
def test_notafile_error(self):
with self.assertRaises(IOError):
self.engine.get_template('first')
class AppDirectoriesLoaderTests(SimpleTestCase):
@classmethod
def setUpClass(cls):
cls.engine = Engine(
loaders=['django.template.loaders.app_directories.Loader'],
)
super(AppDirectoriesLoaderTests, cls).setUpClass()
@override_settings(INSTALLED_APPS=['template_tests'])
def test_get_template(self):
template = self.engine.get_template('index.html')
self.assertEqual(template.origin.name, os.path.join(TEMPLATE_DIR, 'index.html'))
self.assertEqual(template.origin.template_name, 'index.html')
self.assertEqual(template.origin.loader, self.engine.template_loaders[0])
@ignore_warnings(category=RemovedInDjango20Warning)
@override_settings(INSTALLED_APPS=['template_tests'])
def test_load_template_source(self):
loader = self.engine.template_loaders[0]
source, name = loader.load_template_source('index.html')
self.assertEqual(source.strip(), 'index')
self.assertEqual(name, os.path.join(TEMPLATE_DIR, 'index.html'))
@override_settings(INSTALLED_APPS=[])
def test_not_installed(self):
with self.assertRaises(TemplateDoesNotExist):
self.engine.get_template('index.html')
class LocmemLoaderTests(SimpleTestCase):
@classmethod
def setUpClass(cls):
cls.engine = Engine(
loaders=[('django.template.loaders.locmem.Loader', {
'index.html': 'index',
})],
)
super(LocmemLoaderTests, cls).setUpClass()
def test_get_template(self):
template = self.engine.get_template('index.html')
self.assertEqual(template.origin.name, 'index.html')
self.assertEqual(template.origin.template_name, 'index.html')
self.assertEqual(template.origin.loader, self.engine.template_loaders[0])
@ignore_warnings(category=RemovedInDjango20Warning)
def test_load_template_source(self):
loader = self.engine.template_loaders[0]
source, name = loader.load_template_source('index.html')
self.assertEqual(source.strip(), 'index')
self.assertEqual(name, 'index.html')
| {
"content_hash": "179063ea53a9448a197053d73c8c3924",
"timestamp": "",
"source": "github",
"line_count": 387,
"max_line_length": 98,
"avg_line_length": 37.917312661498705,
"alnum_prop": 0.6332969878697016,
"repo_name": "rynomster/django",
"id": "11f20c6debffd098311ecefe18885fff1ef04d3f",
"size": "14716",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/template_tests/test_loaders.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "52372"
},
{
"name": "HTML",
"bytes": "170531"
},
{
"name": "JavaScript",
"bytes": "256023"
},
{
"name": "Makefile",
"bytes": "125"
},
{
"name": "Python",
"bytes": "11518250"
},
{
"name": "Shell",
"bytes": "809"
},
{
"name": "Smarty",
"bytes": "130"
}
],
"symlink_target": ""
} |
// .NAME vtkPolyData - concrete dataset represents vertices, lines, polygons, and triangle strips
// .SECTION Description
// vtkPolyData is a data object that is a concrete implementation of
// vtkDataSet. vtkPolyData represents a geometric structure consisting of
// vertices, lines, polygons, and/or triangle strips. Point and cell
// attribute values (e.g., scalars, vectors, etc.) also are represented.
//
// The actual cell types (vtkCellType.h) supported by vtkPolyData are:
// vtkVertex, vtkPolyVertex, vtkLine, vtkPolyLine, vtkTriangle, vtkQuad,
// vtkPolygon, and vtkTriangleStrip.
//
// One important feature of vtkPolyData objects is that special traversal and
// data manipulation methods are available to process data. These methods are
// generally more efficient than vtkDataSet methods and should be used
// whenever possible. For example, traversing the cells in a dataset we would
// use GetCell(). To traverse cells with vtkPolyData we would retrieve the
// cell array object representing polygons (for example using GetPolys()) and
// then use vtkCellArray's InitTraversal() and GetNextCell() methods.
//
// .SECTION Caveats
// Because vtkPolyData is implemented with four separate instances of
// vtkCellArray to represent 0D vertices, 1D lines, 2D polygons, and 2D
// triangle strips, it is possible to create vtkPolyData instances that
// consist of a mixture of cell types. Because of the design of the class,
// there are certain limitations on how mixed cell types are inserted into
// the vtkPolyData, and in turn the order in which they are processed and
// rendered. To preserve the consistency of cell ids, and to insure that
// cells with cell data are rendered properly, users must insert mixed cells
// in the order of vertices (vtkVertex and vtkPolyVertex), lines (vtkLine and
// vtkPolyLine), polygons (vtkTriangle, vtkQuad, vtkPolygon), and triangle
// strips (vtkTriangleStrip).
//
// Some filters when processing vtkPolyData with mixed cell types may process
// the cells in differing ways. Some will convert one type into another
// (e.g., vtkTriangleStrip into vtkTriangles) or expect a certain type
// (vtkDecimatePro expects triangles or triangle strips; vtkTubeFilter
// expects lines). Read the documentation for each filter carefully to
// understand how each part of vtkPolyData is processed.
#ifndef __vtkPolyData_h
#define __vtkPolyData_h
#include "vtkCommonDataModelExport.h" // For export macro
#include "vtkPointSet.h"
#include "vtkCellTypes.h" // Needed for inline methods
#include "vtkCellLinks.h" // Needed for inline methods
class vtkVertex;
class vtkPolyVertex;
class vtkLine;
class vtkPolyLine;
class vtkTriangle;
class vtkQuad;
class vtkPolygon;
class vtkTriangleStrip;
class vtkEmptyCell;
class VTKCOMMONDATAMODEL_EXPORT vtkPolyData : public vtkPointSet
{
public:
static vtkPolyData *New();
vtkTypeMacro(vtkPolyData,vtkPointSet);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Return what type of dataset this is.
int GetDataObjectType() {return VTK_POLY_DATA;}
// Description:
// Copy the geometric and topological structure of an input poly data object.
void CopyStructure(vtkDataSet *ds);
// Description:
// Standard vtkDataSet interface.
vtkIdType GetNumberOfCells();
vtkCell *GetCell(vtkIdType cellId);
void GetCell(vtkIdType cellId, vtkGenericCell *cell);
int GetCellType(vtkIdType cellId);
void GetCellBounds(vtkIdType cellId, double bounds[6]);
void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
vtkIdList *cellIds);
// Description:
// Copy cells listed in idList from pd, including points, point data,
// and cell data. This method assumes that point and cell data have
// been allocated. If you pass in a point locator, then the points
// won't be duplicated in the output.
void CopyCells(vtkPolyData *pd, vtkIdList *idList,
vtkPointLocator *locator = NULL);
// Description:
// Copy a cells point ids into list provided. (Less efficient.)
void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds);
// Description:
// Efficient method to obtain cells using a particular point. Make sure that
// routine BuildLinks() has been called.
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds);
// Description:
// Compute the (X, Y, Z) bounds of the data.
void ComputeBounds();
// Description:
// Recover extra allocated memory when creating data whose initial size
// is unknown. Examples include using the InsertNextCell() method, or
// when using the CellArray::EstimateSize() method to create vertices,
// lines, polygons, or triangle strips.
void Squeeze();
// Description:
// Return the maximum cell size in this poly data.
int GetMaxCellSize();
// Description:
// Set the cell array defining vertices.
void SetVerts (vtkCellArray* v);
// Description:
// Get the cell array defining vertices. If there are no vertices, an
// empty array will be returned (convenience to simplify traversal).
vtkCellArray *GetVerts();
// Description:
// Set the cell array defining lines.
void SetLines (vtkCellArray* l);
// Description:
// Get the cell array defining lines. If there are no lines, an
// empty array will be returned (convenience to simplify traversal).
vtkCellArray *GetLines();
// Description:
// Set the cell array defining polygons.
void SetPolys (vtkCellArray* p);
// Description:
// Get the cell array defining polygons. If there are no polygons, an
// empty array will be returned (convenience to simplify traversal).
vtkCellArray *GetPolys();
// Description:
// Set the cell array defining triangle strips.
void SetStrips (vtkCellArray* s);
// Description:
// Get the cell array defining triangle strips. If there are no
// triangle strips, an empty array will be returned (convenience to
// simplify traversal).
vtkCellArray *GetStrips();
// Description:
// Return the number of primitives of a particular type held..
vtkIdType GetNumberOfVerts();
vtkIdType GetNumberOfLines();
vtkIdType GetNumberOfPolys();
vtkIdType GetNumberOfStrips();
// Description:
// Method allocates initial storage for vertex, line, polygon, and
// triangle strip arrays. Use this method before the method
// PolyData::InsertNextCell(). (Or, provide vertex, line, polygon, and
// triangle strip cell arrays.)
void Allocate(vtkIdType numCells=1000, int extSize=1000);
// Description:
// Similar to the method above, this method allocates initial storage for
// vertex, line, polygon, and triangle strip arrays. It does this more
// intelligently, examining the supplied inPolyData to determine whether to
// allocate the verts, lines, polys, and strips arrays. (These arrays are
// allocated only if there is data in the corresponding arrays in the
// inPolyData.) Caution: if the inPolyData has no verts, and after
// allocating with this method an PolyData::InsertNextCell() is invoked
// where a vertex is inserted, bad things will happen.
void Allocate(vtkPolyData *inPolyData, vtkIdType numCells=1000,
int extSize=1000);
// Description:
// Insert a cell of type VTK_VERTEX, VTK_POLY_VERTEX, VTK_LINE, VTK_POLY_LINE,
// VTK_TRIANGLE, VTK_QUAD, VTK_POLYGON, or VTK_TRIANGLE_STRIP. Make sure that
// the PolyData::Allocate() function has been called first or that vertex,
// line, polygon, and triangle strip arrays have been supplied.
// Note: will also insert VTK_PIXEL, but converts it to VTK_QUAD.
int InsertNextCell(int type, int npts, vtkIdType *pts);
// Description:
// Insert a cell of type VTK_VERTEX, VTK_POLY_VERTEX, VTK_LINE, VTK_POLY_LINE,
// VTK_TRIANGLE, VTK_QUAD, VTK_POLYGON, or VTK_TRIANGLE_STRIP. Make sure that
// the PolyData::Allocate() function has been called first or that vertex,
// line, polygon, and triangle strip arrays have been supplied.
// Note: will also insert VTK_PIXEL, but converts it to VTK_QUAD.
int InsertNextCell(int type, vtkIdList *pts);
// Description:
// Begin inserting data all over again. Memory is not freed but otherwise
// objects are returned to their initial state.
void Reset();
// Description:
// Create data structure that allows random access of cells.
void BuildCells();
// Description:
// Create upward links from points to cells that use each point. Enables
// topologically complex queries. Normally the links array is allocated
// based on the number of points in the vtkPolyData. The optional
// initialSize parameter can be used to allocate a larger size initially.
void BuildLinks(int initialSize=0);
// Description:
// Release data structure that allows random access of the cells. This must
// be done before a 2nd call to BuildLinks(). DeleteCells implicitly deletes
// the links as well since they are no longer valid.
void DeleteCells();
// Description:
// Release the upward links from point to cells that use each point.
void DeleteLinks();
// Description:
// Special (efficient) operations on poly data. Use carefully.
void GetPointCells(vtkIdType ptId, unsigned short& ncells,
vtkIdType* &cells);
// Description:
// Get the neighbors at an edge. More efficient than the general
// GetCellNeighbors(). Assumes links have been built (with BuildLinks()),
// and looks specifically for edge neighbors.
void GetCellEdgeNeighbors(vtkIdType cellId, vtkIdType p1, vtkIdType p2,
vtkIdList *cellIds);
// Description:
// Return a pointer to a list of point ids defining cell. (More efficient.)
// Assumes that cells have been built (with BuildCells()).
void GetCellPoints(vtkIdType cellId, vtkIdType& npts, vtkIdType* &pts);
// Description:
// Given three vertices, determine whether it's a triangle. Make sure
// BuildLinks() has been called first.
int IsTriangle(int v1, int v2, int v3);
// Description:
// Determine whether two points form an edge. If they do, return non-zero.
// By definition PolyVertex and PolyLine have no edges since 1-dimensional
// edges are only found on cells 2D and higher.
// Edges are defined as 1-D boundary entities to cells.
// Make sure BuildLinks() has been called first.
int IsEdge(vtkIdType p1, vtkIdType p2);
// Description:
// Determine whether a point is used by a particular cell. If it is, return
// non-zero. Make sure BuildCells() has been called first.
int IsPointUsedByCell(vtkIdType ptId, vtkIdType cellId);
// Description:
// Replace the points defining cell "cellId" with a new set of points. This
// operator is (typically) used when links from points to cells have not been
// built (i.e., BuildLinks() has not been executed). Use the operator
// ReplaceLinkedCell() to replace a cell when cell structure has been built.
void ReplaceCell(vtkIdType cellId, int npts, vtkIdType *pts);
// Description:
// Replace a point in the cell connectivity list with a different point.
void ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId,
vtkIdType newPtId);
// Description:
// Reverse the order of point ids defining the cell.
void ReverseCell(vtkIdType cellId);
// Description:
// Mark a point/cell as deleted from this vtkPolyData.
void DeletePoint(vtkIdType ptId);
void DeleteCell(vtkIdType cellId);
// Description:
// The cells marked by calls to DeleteCell are stored in the Cell Array
// VTK_EMPTY_CELL, but they still exist in the polys array.
// Calling RemoveDeletedCells will travers the poly array and remove/compact
// the cell array as well as any cell data thus truly removing the cells
// from the polydata object. WARNING. This only handles the polys
// at the moment
void RemoveDeletedCells();
// Description:
// Add a point to the cell data structure (after cell pointers have been
// built). This method adds the point and then allocates memory for the
// links to the cells. (To use this method, make sure points are available
// and BuildLinks() has been invoked.) Of the two methods below, one inserts
// a point coordinate and the other just makes room for cell links.
int InsertNextLinkedPoint(int numLinks);
int InsertNextLinkedPoint(double x[3], int numLinks);
// Description:
// Add a new cell to the cell data structure (after cell pointers have been
// built). This method adds the cell and then updates the links from the
// points to the cells. (Memory is allocated as necessary.)
int InsertNextLinkedCell(int type, int npts, vtkIdType *pts);
// Description:
// Replace one cell with another in cell structure. This operator updates the
// connectivity list and the point's link list. It does not delete references
// to the old cell in the point's link list. Use the operator
// RemoveCellReference() to delete all references from points to (old) cell.
// You may also want to consider using the operator ResizeCellList() if the
// link list is changing size.
void ReplaceLinkedCell(vtkIdType cellId, int npts, vtkIdType *pts);
// Description:
// Remove all references to cell in cell structure. This means the links from
// the cell's points to the cell are deleted. Memory is not reclaimed. Use the
// method ResizeCellList() to resize the link list from a point to its using
// cells. (This operator assumes BuildLinks() has been called.)
void RemoveCellReference(vtkIdType cellId);
// Description:
// Add references to cell in cell structure. This means the links from
// the cell's points to the cell are modified. Memory is not extended. Use the
// method ResizeCellList() to resize the link list from a point to its using
// cells. (This operator assumes BuildLinks() has been called.)
void AddCellReference(vtkIdType cellId);
// Description:
// Remove a reference to a cell in a particular point's link list. You may
// also consider using RemoveCellReference() to remove the references from
// all the cell's points to the cell. This operator does not reallocate
// memory; use the operator ResizeCellList() to do this if necessary.
void RemoveReferenceToCell(vtkIdType ptId, vtkIdType cellId);
// Description:
// Add a reference to a cell in a particular point's link list. (You may also
// consider using AddCellReference() to add the references from all the
// cell's points to the cell.) This operator does not realloc memory; use the
// operator ResizeCellList() to do this if necessary.
void AddReferenceToCell(vtkIdType ptId, vtkIdType cellId);
// Description:
// Resize the list of cells using a particular point. (This operator assumes
// that BuildLinks() has been called.)
void ResizeCellList(vtkIdType ptId, int size);
// Description:
// Restore object to initial state. Release memory back to system.
virtual void Initialize();
// Description:
// Get the piece and the number of pieces. Similar to extent in 3D.
virtual int GetPiece();
virtual int GetNumberOfPieces();
// Description:
// Get the ghost level.
virtual int GetGhostLevel();
// Description:
// Return the actual size of the data in kilobytes. This number
// is valid only after the pipeline has updated. The memory size
// returned is guaranteed to be greater than or equal to the
// memory required to represent the data (e.g., extra space in
// arrays, etc. are not included in the return value). THIS METHOD
// IS THREAD SAFE.
unsigned long GetActualMemorySize();
// Description:
// Shallow and Deep copy.
void ShallowCopy(vtkDataObject *src);
void DeepCopy(vtkDataObject *src);
// Description:
// This method will remove any cell that has a ghost level array value
// greater or equal to level. It does not remove unused points (yet).
void RemoveGhostCells(int level);
//BTX
// Description:
// Retrieve an instance of this class from an information object.
static vtkPolyData* GetData(vtkInformation* info);
static vtkPolyData* GetData(vtkInformationVector* v, int i=0);
//ETX
//BTX
// Description:
// Scalar field critical point classification (for manifold 2D meshes).
// Reference: J. Milnor "Morse Theory", Princeton University Press, 1963.
//
// Given a pointId and an attribute representing a scalar field, this member
// returns the index of the critical point:
// vtkPolyData::MINIMUM (index 0): local minimum;
// vtkPolyData::SADDLE (index 1): local saddle;
// vtkPolyData::MAXIMUM (index 2): local maximum.
//
// Other returned values are:
// vtkPolyData::REGULAR_POINT: regular point (the gradient does not vanish);
// vtkPolyData::ERR_NON_MANIFOLD_STAR: the star of the considered vertex is
// not manifold (could not evaluate the index)
// vtkPolyData::ERR_INCORRECT_FIELD: the number of entries in the scalar field
// array is different form the number of vertices in the mesh.
// vtkPolyData::ERR_NO_SUCH_FIELD: the specified scalar field does not exist.
enum
{
ERR_NO_SUCH_FIELD = -4,
ERR_INCORRECT_FIELD = -3,
ERR_NON_MANIFOLD_STAR = -2,
REGULAR_POINT = -1,
MINIMUM = 0,
SADDLE = 1,
MAXIMUM = 2
};
//ETX
int GetScalarFieldCriticalIndex (vtkIdType pointId,
vtkDataArray *scalarField);
int GetScalarFieldCriticalIndex (vtkIdType pointId, int fieldId);
int GetScalarFieldCriticalIndex (vtkIdType pointId, const char* fieldName);
protected:
vtkPolyData();
~vtkPolyData();
// constant cell objects returned by GetCell called.
vtkVertex *Vertex;
vtkPolyVertex *PolyVertex;
vtkLine *Line;
vtkPolyLine *PolyLine;
vtkTriangle *Triangle;
vtkQuad *Quad;
vtkPolygon *Polygon;
vtkTriangleStrip *TriangleStrip;
vtkEmptyCell *EmptyCell;
// points inherited
// point data (i.e., scalars, vectors, normals, tcoords) inherited
vtkCellArray *Verts;
vtkCellArray *Lines;
vtkCellArray *Polys;
vtkCellArray *Strips;
// dummy static member below used as a trick to simplify traversal
static vtkCellArray *Dummy;
// supporting structures for more complex topological operations
// built only when necessary
vtkCellTypes *Cells;
vtkCellLinks *Links;
// This method is called during an update.
// If the CropFilter is set, the user reqquested a piece which the
// source cannot generate, then it will break up the
// data set in order to satisfy the request.
virtual void Crop();
private:
// Hide these from the user and the compiler.
// Description:
// For legacy compatibility. Do not use.
void GetCellNeighbors(vtkIdType cellId, vtkIdList& ptIds, vtkIdList& cellIds)
{this->GetCellNeighbors(cellId, &ptIds, &cellIds);}
void Cleanup();
private:
vtkPolyData(const vtkPolyData&); // Not implemented.
void operator=(const vtkPolyData&); // Not implemented.
};
inline void vtkPolyData::GetPointCells(vtkIdType ptId, unsigned short& ncells,
vtkIdType* &cells)
{
ncells = this->Links->GetNcells(ptId);
cells = this->Links->GetCells(ptId);
}
inline int vtkPolyData::IsTriangle(int v1, int v2, int v3)
{
unsigned short int n1;
int i, j, tVerts[3];
vtkIdType *cells, *tVerts2, n2;
tVerts[0] = v1;
tVerts[1] = v2;
tVerts[2] = v3;
for (i=0; i<3; i++)
{
this->GetPointCells(tVerts[i], n1, cells);
for (j=0; j<n1; j++)
{
this->GetCellPoints(cells[j], n2, tVerts2);
if ( (tVerts[0] == tVerts2[0] || tVerts[0] == tVerts2[1] ||
tVerts[0] == tVerts2[2]) &&
(tVerts[1] == tVerts2[0] || tVerts[1] == tVerts2[1] ||
tVerts[1] == tVerts2[2]) &&
(tVerts[2] == tVerts2[0] || tVerts[2] == tVerts2[1] ||
tVerts[2] == tVerts2[2]) )
{
return 1;
}
}
}
return 0;
}
inline int vtkPolyData::IsPointUsedByCell(vtkIdType ptId, vtkIdType cellId)
{
vtkIdType *pts, npts;
this->GetCellPoints(cellId, npts, pts);
for (vtkIdType i=0; i < npts; i++)
{
if ( pts[i] == ptId )
{
return 1;
}
}
return 0;
}
inline void vtkPolyData::DeletePoint(vtkIdType ptId)
{
this->Links->DeletePoint(ptId);
}
inline void vtkPolyData::DeleteCell(vtkIdType cellId)
{
this->Cells->DeleteCell(cellId);
}
inline void vtkPolyData::RemoveCellReference(vtkIdType cellId)
{
vtkIdType *pts, npts;
this->GetCellPoints(cellId, npts, pts);
for (vtkIdType i=0; i<npts; i++)
{
this->Links->RemoveCellReference(cellId, pts[i]);
}
}
inline void vtkPolyData::AddCellReference(vtkIdType cellId)
{
vtkIdType *pts, npts;
this->GetCellPoints(cellId, npts, pts);
for (vtkIdType i=0; i<npts; i++)
{
this->Links->AddCellReference(cellId, pts[i]);
}
}
inline void vtkPolyData::ResizeCellList(vtkIdType ptId, int size)
{
this->Links->ResizeCellList(ptId,size);
}
inline void vtkPolyData::ReplaceCellPoint(vtkIdType cellId, vtkIdType oldPtId,
vtkIdType newPtId)
{
int i;
vtkIdType *verts, nverts;
this->GetCellPoints(cellId,nverts,verts);
for ( i=0; i < nverts; i++ )
{
if ( verts[i] == oldPtId )
{
verts[i] = newPtId; // this is very nasty! direct write!
return;
}
}
}
#endif
| {
"content_hash": "53b20197191530a040b74071fc13a5d7",
"timestamp": "",
"source": "github",
"line_count": 579,
"max_line_length": 97,
"avg_line_length": 36.870466321243526,
"alnum_prop": 0.7119636499906314,
"repo_name": "cjh1/vtkmodular",
"id": "a8c056dc0026e35a1e6494c7db179488cd5addce",
"size": "21929",
"binary": false,
"copies": "1",
"ref": "refs/heads/modular-no-vtk4-compat",
"path": "Common/DataModel/vtkPolyData.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "37780"
},
{
"name": "C",
"bytes": "43497387"
},
{
"name": "C++",
"bytes": "45441884"
},
{
"name": "Objective-C",
"bytes": "96778"
},
{
"name": "Perl",
"bytes": "174808"
},
{
"name": "Prolog",
"bytes": "4746"
},
{
"name": "Python",
"bytes": "406375"
},
{
"name": "Shell",
"bytes": "11229"
},
{
"name": "Tcl",
"bytes": "2383"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
namespace Cheer.JsonVisualizer.CoreServices.Helpers
{
public static class StringHelper
{
public static string MakeSafe(this string s, bool trim = false) =>
string.IsNullOrEmpty(s) ? string.Empty : trim ? s.Trim() : s;
public static bool IsNullOrEmpty(this string s) => string.IsNullOrEmpty(s);
public static bool IsHighSurrogate(this char ch) => char.IsHighSurrogate(ch);
public static bool IsLowSurrogate(this char ch) => char.IsLowSurrogate(ch);
public static bool IsWhiteSpace(this char ch) => char.IsWhiteSpace(ch);
}
}
| {
"content_hash": "a2a801ba59d207e8202cabb80e118554",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 85,
"avg_line_length": 37.1578947368421,
"alnum_prop": 0.7067988668555241,
"repo_name": "cheer-cheer/json-visualizer",
"id": "08818acea8c2af883a36b3caa25d7bc4e3dea9e9",
"size": "708",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Cheer.JsonVisualizer.CoreServices/Helpers/StringHelper.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "68378"
},
{
"name": "HTML",
"bytes": "374998"
}
],
"symlink_target": ""
} |
module NRSER
module Described
# Definitions
# =======================================================================
# Interface for description hierarchies, which manage the collection of
# {Described::Base} instances available.
#
# ### Semantics
#
# {Hierarchy} presents an {::Enumerable} collection interface, with methods to
# {#add} new descriptions and whose {#each} iteration order will be the search
# order for description references (see {#find_by_human_name}, etc.) and
# resolutions (see {Described::Base#resolve!}).
#
# In addition,
#
# ### Current Status
#
# Incredibly basic at the moment, since I'm only supporting {::Cucumber}, which
# creates a new scenario instance - and hence a new {Hierarchy} - for step path,
# and therefore doesn't require any support for branching, which will likely
# lead to more complex re-ordering logic.
#
# This immediate use case seems satisfied by a simple array-mutating
# implementation ({Hierarchy::Array}).
#
# ### Future Plans
#
# The {Hierarchy} interface intends to be implementable in classes supporting
# branching, with {::RSpec} being the main consideration, though it seems likely
# it will want to some expansion to do so.
#
module Hierarchy
# Singleton Methods
# ========================================================================
# Hook in on include to stick {::Enumerable} in there too.
#
def self.included base
base.send( :include, ::Enumerable ) unless base.include?( ::Enumerable )
end
# Instance Methods
# ========================================================================
# @!group Abstract Instance Methods
# --------------------------------------------------------------------------
#
# Implementing classes **MUST** define these.
#
# Add a new {Described::Base} instance to the {Hierarchy}.
#
# Immediately after a description is added, it should probably be returned
# for {#current}.
#
# @param [Described::Base] described
# New description to add.
#
# @abstract
# @raises [NRSER::AbstractMethodError]
#
def add described
raise NRSER::AbstractMethodError.new( self, __method__ )
end
# Iterate the descriptions in search / resolution order.
#
# @overload each
#
# @return [::Enumerator<Described::Base>]
# That iterates over the descriptions.
#
# @overload each &block
#
# @param [::Proc<(Described::Base)=>void>] block
# Calls `&block` once for each description, in order.
#
# @return [Hierarchy] self
#
# @abstract
# @raises [NRSER::AbstractMethodError]
#
def each &block
raise NRSER::AbstractMethodError.new( self, __method__ )
end
# Used to indicate that the description has been "touched", in the UNIX-sense.
#
# This is very loosely defined, on purpose.
#
# It can be used to affect the iteration ordering as necessary given the
# desired behavior of subsequent operations on the hierarchy. In the
# {Hierarchy::Array} implementation used in Cucumber it causes the
# description to become {#current}, targeting it for subsequent "it"
# references.
#
# @see #find_by_human_name
#
# @param [Described::Base] described
# The description that was touched.
#
# @return [Described::Base]
# `described` parameter.
#
# @abstract
# @raises [NRSER::AbstractMethodError]
#
def touch described
raise NRSER::AbstractMethodError.new( self, __method__ )
end
# @!endgroup Abstract Instance Methods # ***********************************
# Are the any descriptions in the {Hierarchy}?
#
# As {::Enumerable} does not implement `#empty?`, presumably because it
# supports infinite iterables and streams (where {::Enumerable#count}
# presumably hangs, returns {::Float::INFINITY}, raises, etc.), but it
# seemed nice to have since it's easy for us.
#
# @note
# Though it's hard for me to imagine it making any material difference
# in a testing environment, implementations are likely to have a more
# direct/efficient method to test if the collection is empty.
#
# @return [Boolean]
#
def empty?
current.nil?
end
# Get the *current* descriptions, which defaults to the first one in the
# iteration order, though implementations could override this behavior if it
# desired.
#
# @note
# Though it's hard for me to imagine it making any material difference
# in a testing environment, implementations are likely to have a more
# direct/efficient method to get the *current* description.
#
# @return [nil]
# If the {Hierarchy} is {#empty?}.
#
# @return [Described::Base]
# If the {Hierarchy} is not {#empty?}.
#
def current
each.first
end
# Essentially, find the first description that's an instance of a
# {Described::Base} subclass by matching one of it's {Base.human_names}.
#
# @param [::String] human_name
# Something like "instance method" to find the first
# {Described::InstanceMethod} instance (if any).
#
# Check out {Described::Base.human_names}.
#
# @return [nil]
# No instance was of a class with the human name.
#
# @return [Described::Base]
# The first matching description.
#
def find_by_human_name human_name, touch: true
find do |described|
if described.class.human_names.include? human_name
touch( described ) if touch
true
end
end
end
# Same as {#find_by_human_name}, except it raises if nothing is found.
#
# @param (see #find_by_human_name)
#
# @return [Described::Base]
# The first matching description.
#
# @raise [NotFoundError]
# If no matching description is found.
#
def find_by_human_name! human_name, touch: true
find_by_human_name( human_name, touch: touch ).tap do |described|
if described.nil?
raise NRSER::NotFoundError.new \
"Could not find described instance in parent tree with human name",
human_name.inspect,
descriptions: map( &:to_s )
end
end
end
end # module Hierarchy
# /Namespace
# =======================================================================
end # module Described
end # module NRSER
| {
"content_hash": "a2c8b2c9d2c3857f3672e0761e8d453f",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 80,
"avg_line_length": 28.97685185185185,
"alnum_prop": 0.623422271928423,
"repo_name": "nrser/nrser-ruby",
"id": "ca2d5653c70d05d06a4a332bfdfe5d77df320452",
"size": "6396",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/nrser/described/hierarchy.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "310450"
},
{
"name": "Shell",
"bytes": "87"
}
],
"symlink_target": ""
} |
#include "internal/_deprecated_header_message_guard.h"
#if !defined(__TBB_show_deprecation_message_recursive_mutex_H) && defined(__TBB_show_deprecated_header_message)
#define __TBB_show_deprecation_message_recursive_mutex_H
#pragma message("TBB Warning: tbb/recursive_mutex.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.")
#endif
#if defined(__TBB_show_deprecated_header_message)
#undef __TBB_show_deprecated_header_message
#endif
#ifndef __TBB_recursive_mutex_H
#define __TBB_recursive_mutex_H
#define __TBB_recursive_mutex_H_include_area
#include "internal/_warning_suppress_enable_notice.h"
#if _WIN32||_WIN64
#include "machine/windows_api.h"
#else
#include <pthread.h>
#endif /* _WIN32||_WIN64 */
#include <new>
#include "aligned_space.h"
#include "tbb_stddef.h"
#include "tbb_profiling.h"
namespace tbb {
//! Mutex that allows recursive mutex acquisition.
/** Mutex that allows recursive mutex acquisition.
@ingroup synchronization */
class __TBB_DEPRECATED_VERBOSE_MSG("tbb::recursive_mutex is deprecated, use std::recursive_mutex")
recursive_mutex : internal::mutex_copy_deprecated_and_disabled {
public:
//! Construct unacquired recursive_mutex.
recursive_mutex() {
#if TBB_USE_ASSERT || TBB_USE_THREADING_TOOLS
internal_construct();
#else
#if _WIN32||_WIN64
InitializeCriticalSectionEx(&impl, 4000, 0);
#else
pthread_mutexattr_t mtx_attr;
int error_code = pthread_mutexattr_init( &mtx_attr );
if( error_code )
tbb::internal::handle_perror(error_code,"recursive_mutex: pthread_mutexattr_init failed");
pthread_mutexattr_settype( &mtx_attr, PTHREAD_MUTEX_RECURSIVE );
error_code = pthread_mutex_init( &impl, &mtx_attr );
if( error_code )
tbb::internal::handle_perror(error_code,"recursive_mutex: pthread_mutex_init failed");
pthread_mutexattr_destroy( &mtx_attr );
#endif /* _WIN32||_WIN64*/
#endif /* TBB_USE_ASSERT */
};
~recursive_mutex() {
#if TBB_USE_ASSERT
internal_destroy();
#else
#if _WIN32||_WIN64
DeleteCriticalSection(&impl);
#else
pthread_mutex_destroy(&impl);
#endif /* _WIN32||_WIN64 */
#endif /* TBB_USE_ASSERT */
};
class scoped_lock;
friend class scoped_lock;
//! The scoped locking pattern
/** It helps to avoid the common problem of forgetting to release lock.
It also nicely provides the "node" for queuing locks. */
class scoped_lock: internal::no_copy {
public:
//! Construct lock that has not acquired a recursive_mutex.
scoped_lock() : my_mutex(NULL) {};
//! Acquire lock on given mutex.
scoped_lock( recursive_mutex& mutex ) {
#if TBB_USE_ASSERT
my_mutex = &mutex;
#endif /* TBB_USE_ASSERT */
acquire( mutex );
}
//! Release lock (if lock is held).
~scoped_lock() {
if( my_mutex )
release();
}
//! Acquire lock on given mutex.
void acquire( recursive_mutex& mutex ) {
#if TBB_USE_ASSERT
internal_acquire( mutex );
#else
my_mutex = &mutex;
mutex.lock();
#endif /* TBB_USE_ASSERT */
}
//! Try acquire lock on given recursive_mutex.
bool try_acquire( recursive_mutex& mutex ) {
#if TBB_USE_ASSERT
return internal_try_acquire( mutex );
#else
bool result = mutex.try_lock();
if( result )
my_mutex = &mutex;
return result;
#endif /* TBB_USE_ASSERT */
}
//! Release lock
void release() {
#if TBB_USE_ASSERT
internal_release();
#else
my_mutex->unlock();
my_mutex = NULL;
#endif /* TBB_USE_ASSERT */
}
private:
//! The pointer to the current recursive_mutex to work
recursive_mutex* my_mutex;
//! All checks from acquire using mutex.state were moved here
void __TBB_EXPORTED_METHOD internal_acquire( recursive_mutex& m );
//! All checks from try_acquire using mutex.state were moved here
bool __TBB_EXPORTED_METHOD internal_try_acquire( recursive_mutex& m );
//! All checks from release using mutex.state were moved here
void __TBB_EXPORTED_METHOD internal_release();
friend class recursive_mutex;
};
// Mutex traits
static const bool is_rw_mutex = false;
static const bool is_recursive_mutex = true;
static const bool is_fair_mutex = false;
// C++0x compatibility interface
//! Acquire lock
void lock() {
#if TBB_USE_ASSERT
aligned_space<scoped_lock> tmp;
new(tmp.begin()) scoped_lock(*this);
#else
#if _WIN32||_WIN64
EnterCriticalSection(&impl);
#else
int error_code = pthread_mutex_lock(&impl);
if( error_code )
tbb::internal::handle_perror(error_code,"recursive_mutex: pthread_mutex_lock failed");
#endif /* _WIN32||_WIN64 */
#endif /* TBB_USE_ASSERT */
}
//! Try acquiring lock (non-blocking)
/** Return true if lock acquired; false otherwise. */
bool try_lock() {
#if TBB_USE_ASSERT
aligned_space<scoped_lock> tmp;
return (new(tmp.begin()) scoped_lock)->internal_try_acquire(*this);
#else
#if _WIN32||_WIN64
return TryEnterCriticalSection(&impl)!=0;
#else
return pthread_mutex_trylock(&impl)==0;
#endif /* _WIN32||_WIN64 */
#endif /* TBB_USE_ASSERT */
}
//! Release lock
void unlock() {
#if TBB_USE_ASSERT
aligned_space<scoped_lock> tmp;
scoped_lock& s = *tmp.begin();
s.my_mutex = this;
s.internal_release();
#else
#if _WIN32||_WIN64
LeaveCriticalSection(&impl);
#else
pthread_mutex_unlock(&impl);
#endif /* _WIN32||_WIN64 */
#endif /* TBB_USE_ASSERT */
}
//! Return native_handle
#if _WIN32||_WIN64
typedef LPCRITICAL_SECTION native_handle_type;
#else
typedef pthread_mutex_t* native_handle_type;
#endif
native_handle_type native_handle() { return (native_handle_type) &impl; }
private:
#if _WIN32||_WIN64
CRITICAL_SECTION impl;
enum state_t {
INITIALIZED=0x1234,
DESTROYED=0x789A,
} state;
#else
pthread_mutex_t impl;
#endif /* _WIN32||_WIN64 */
//! All checks from mutex constructor using mutex.state were moved here
void __TBB_EXPORTED_METHOD internal_construct();
//! All checks from mutex destructor using mutex.state were moved here
void __TBB_EXPORTED_METHOD internal_destroy();
};
__TBB_DEFINE_PROFILING_SET_NAME(recursive_mutex)
} // namespace tbb
#include "internal/_warning_suppress_disable_notice.h"
#undef __TBB_recursive_mutex_H_include_area
#endif /* __TBB_recursive_mutex_H */
| {
"content_hash": "ee32cc65027f65fee0d59baaca9a1518",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 150,
"avg_line_length": 29.00854700854701,
"alnum_prop": 0.6317030053034767,
"repo_name": "01org/tbb",
"id": "3a3f9794262ba6f70fd3c475424f80720d799ff0",
"size": "7400",
"binary": false,
"copies": "1",
"ref": "refs/heads/tbb_2019",
"path": "include/tbb/recursive_mutex.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "111802"
},
{
"name": "Batchfile",
"bytes": "4744"
},
{
"name": "C",
"bytes": "387287"
},
{
"name": "C++",
"bytes": "5715782"
},
{
"name": "CMake",
"bytes": "35050"
},
{
"name": "HTML",
"bytes": "50905"
},
{
"name": "JavaScript",
"bytes": "10788"
},
{
"name": "Makefile",
"bytes": "25590"
},
{
"name": "PHP",
"bytes": "6430"
},
{
"name": "Python",
"bytes": "59167"
},
{
"name": "Shell",
"bytes": "26811"
},
{
"name": "SourcePawn",
"bytes": "8917"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
J. Proc. Linn. Soc. , Bot. 3:136. 1859
#### Original name
null
### Remarks
null | {
"content_hash": "d8ed8a2676d6f0ed5a13ae71264b4d1e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 12.923076923076923,
"alnum_prop": 0.6666666666666666,
"repo_name": "mdoering/backbone",
"id": "4cb87525410039e27aa92c8cc3592d9f4654fc38",
"size": "218",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Acacia/Acacia orthocarpa/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
const Stream = require('mithril/stream');
const _ = require('lodash');
const s = require('helpers/string-plus');
const sparkRoutes = require('helpers/spark_routes');
const AjaxHelper = require('helpers/ajax_helper');
const EnvironmentVariables = require('models/dashboard/environment_variables');
const TriggerWithOptionsInfo = function (materials, plainTextVariables, secureVariables) {
const self = this;
this.materials = materials;
this.plainTextVariables = plainTextVariables;
this.secureVariables = secureVariables;
this.getTriggerOptionsJSON = () => {
const json = {};
json['update_materials_before_scheduling'] = false;
json['materials'] = _.reduce(self.materials, (selections, material) => {
if (material.selection()) {
selections.push({
fingerprint: material.fingerprint,
revision: material.selection()
});
}
return selections;
}, []);
json['environment_variables'] = _.reduce(self.plainTextVariables.concat(self.secureVariables), (allEnvs, envVar) => {
if (envVar.isDirtyValue()) {
allEnvs.push({
name: envVar.name,
value: envVar.value(),
secure: envVar.isSecureValue()
});
}
return allEnvs;
}, []);
return json;
};
};
const isSecure = (v) => v.secure;
const isPlainText = (v) => !v.secure;
TriggerWithOptionsInfo.fromJSON = (json) => {
const materials = JSON.parse(JSON.stringify(json.materials, s.camelCaser));
_.each(materials, (material) => {
material.selection = Stream();
});
const plainTextVariables = EnvironmentVariables.fromJSON(_.filter(json.variables, isPlainText));
const secureVariables = EnvironmentVariables.fromJSON(_.filter(json.variables, isSecure));
return new TriggerWithOptionsInfo(materials, plainTextVariables, secureVariables);
};
TriggerWithOptionsInfo.all = function (pipelineName) {
return AjaxHelper.GET({
url: sparkRoutes.pipelineTriggerWithOptionsViewPath(pipelineName),
type: TriggerWithOptionsInfo,
apiVersion: 'v1',
});
};
module.exports = TriggerWithOptionsInfo;
| {
"content_hash": "b8382ac7a4f86a3082c8fae61c84d4a6",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 121,
"avg_line_length": 30.465753424657535,
"alnum_prop": 0.6510791366906474,
"repo_name": "stevem999/gocd",
"id": "e99111ea8d4ad7fbad7a84c0780cc7b38d0668df",
"size": "2825",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "server/webapp/WEB-INF/rails.new/webpack/models/dashboard/trigger_with_options_info.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "8637"
},
{
"name": "CSS",
"bytes": "524172"
},
{
"name": "FreeMarker",
"bytes": "182"
},
{
"name": "Groovy",
"bytes": "18840"
},
{
"name": "HTML",
"bytes": "661683"
},
{
"name": "Java",
"bytes": "16697275"
},
{
"name": "JavaScript",
"bytes": "2983309"
},
{
"name": "NSIS",
"bytes": "19211"
},
{
"name": "PowerShell",
"bytes": "743"
},
{
"name": "Ruby",
"bytes": "3301148"
},
{
"name": "SQLPL",
"bytes": "9050"
},
{
"name": "Shell",
"bytes": "197638"
},
{
"name": "XSLT",
"bytes": "156205"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Umbraco.Cms.Core.Models.Validation;
namespace Umbraco.Cms.Core.Models.ContentEditing
{
[DataContract(Name = "entity", Namespace = "")]
public class EntityBasic
{
public EntityBasic()
{
AdditionalData = new Dictionary<string, object?>();
Alias = string.Empty;
Path = string.Empty;
}
[DataMember(Name = "name", IsRequired = true)]
[RequiredForPersistence(AllowEmptyStrings = false, ErrorMessage = "Required")]
public string? Name { get; set; }
[DataMember(Name = "id", IsRequired = true)]
[Required]
public object? Id { get; set; }
[DataMember(Name = "udi")]
[ReadOnly(true)]
public Udi? Udi { get; set; }
[DataMember(Name = "icon")]
public string? Icon { get; set; }
[DataMember(Name = "trashed")]
[ReadOnly(true)]
public bool Trashed { get; set; }
/// <summary>
/// This is the unique Id stored in the database - but could also be the unique id for a custom membership provider
/// </summary>
[DataMember(Name = "key")]
public Guid Key { get; set; }
[DataMember(Name = "parentId", IsRequired = true)]
[Required]
public int ParentId { get; set; }
/// <summary>
/// This will only be populated for some entities like macros
/// </summary>
/// <remarks>
/// It is possible to override this to specify different validation attributes if required
/// </remarks>
[DataMember(Name = "alias")]
public virtual string Alias { get; set; }
/// <summary>
/// The path of the entity
/// </summary>
[DataMember(Name = "path")]
public string Path { get; set; }
/// <summary>
/// A collection of extra data that is available for this specific entity/entity type
/// </summary>
[DataMember(Name = "metaData")]
[ReadOnly(true)]
public IDictionary<string, object?> AdditionalData { get; private set; }
}
}
| {
"content_hash": "d53d542c47bdac19a6d83ada70ae8005",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 123,
"avg_line_length": 32.357142857142854,
"alnum_prop": 0.583664459161148,
"repo_name": "KevinJump/Umbraco-CMS",
"id": "772da930e9d3c3867126565af39bc19b499887bb",
"size": "2267",
"binary": false,
"copies": "2",
"ref": "refs/heads/v10/contrib",
"path": "src/Umbraco.Core/Models/ContentEditing/EntityBasic.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "16567573"
},
{
"name": "CSS",
"bytes": "17972"
},
{
"name": "Dockerfile",
"bytes": "2352"
},
{
"name": "HTML",
"bytes": "1275234"
},
{
"name": "JavaScript",
"bytes": "4590300"
},
{
"name": "Less",
"bytes": "688558"
},
{
"name": "PowerShell",
"bytes": "20112"
},
{
"name": "Shell",
"bytes": "3572"
},
{
"name": "TSQL",
"bytes": "371"
},
{
"name": "TypeScript",
"bytes": "123694"
}
],
"symlink_target": ""
} |
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.9.0.77
// SpecFlow Generator Version:1.9.0.0
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
#region Designer generated code
#pragma warning disable
namespace Orchard.Specs
{
using TechTalk.SpecFlow;
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[NUnit.Framework.TestFixtureAttribute()]
[NUnit.Framework.DescriptionAttribute("Link Field")]
public partial class LinkFieldFeature
{
private static TechTalk.SpecFlow.ITestRunner testRunner;
#line 1 "Link.feature"
#line hidden
[NUnit.Framework.TestFixtureSetUpAttribute()]
public virtual void FeatureSetup()
{
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Link Field", " In order to add Link content to my types\r\n As an administrator\r\n I want to cr" +
"eate, edit and publish Link fields", ProgrammingLanguage.CSharp, ((string[])(null)));
testRunner.OnFeatureStart(featureInfo);
}
[NUnit.Framework.TestFixtureTearDownAttribute()]
public virtual void FeatureTearDown()
{
testRunner.OnFeatureEnd();
testRunner = null;
}
[NUnit.Framework.SetUpAttribute()]
public virtual void TestInitialize()
{
}
[NUnit.Framework.TearDownAttribute()]
public virtual void ScenarioTearDown()
{
testRunner.OnScenarioEnd();
}
public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
{
testRunner.OnScenarioStart(scenarioInfo);
}
public virtual void ScenarioCleanup()
{
testRunner.CollectScenarioErrors();
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("Creating and using Link fields")]
public virtual void CreatingAndUsingLinkFields()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Creating and using Link fields", ((string[])(null)));
#line 6
this.ScenarioSetup(scenarioInfo);
#line 9
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 10
testRunner.And("I have installed \"Orchard.Fields\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 11
testRunner.When("I go to \"Admin/ContentTypes\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 12
testRunner.Then("I should see \"<a[^>]*>.*?Create new type</a>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 13
testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table1.AddRow(new string[] {
"DisplayName",
"Event"});
table1.AddRow(new string[] {
"Name",
"Event"});
#line 14
testRunner.And("I fill in", ((string)(null)), table1, "And ");
#line 18
testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 19
testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 20
testRunner.Then("I should see \"Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 23
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 24
testRunner.And("I follow \"Add Field\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table2.AddRow(new string[] {
"DisplayName",
"Site Url"});
table2.AddRow(new string[] {
"Name",
"SiteUrl"});
table2.AddRow(new string[] {
"FieldTypeName",
"LinkField"});
#line 25
testRunner.And("I fill in", ((string)(null)), table2, "And ");
#line 30
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 31
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 32
testRunner.Then("I should see \"The \\\"Site Url\\\" field has been added.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 35
testRunner.When("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 36
testRunner.Then("I should see \"Site Url\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table3.AddRow(new string[] {
"Event.SiteUrl.Value",
"http://www.orchardproject.net"});
table3.AddRow(new string[] {
"Event.SiteUrl.Text",
"Orchard"});
#line 37
testRunner.When("I fill in", ((string)(null)), table3, "When ");
#line 41
testRunner.And("I hit \"Save Draft\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 42
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 43
testRunner.Then("I should see \"The Event has been created as a draft.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 44
testRunner.When("I go to \"Admin/Contents/List\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 45
testRunner.Then("I should see \"Site Url:\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 46
testRunner.And("I should see \"<a href=\\\"http://www.orchardproject.net\\\">Orchard</a>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 49
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table4.AddRow(new string[] {
"Fields[SiteUrl].LinkFieldSettings.Hint",
"Enter the url of the web site"});
#line 50
testRunner.And("I fill in", ((string)(null)), table4, "And ");
#line 53
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 54
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 55
testRunner.Then("I should see \"Enter the url of the web site\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 58
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table5.AddRow(new string[] {
"Fields[SiteUrl].LinkFieldSettings.Required",
"true"});
#line 59
testRunner.And("I fill in", ((string)(null)), table5, "And ");
#line 62
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 63
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table6.AddRow(new string[] {
"Event.SiteUrl.Value",
""});
#line 64
testRunner.And("I fill in", ((string)(null)), table6, "And ");
#line 67
testRunner.And("I hit \"Save Draft\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 70
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table7.AddRow(new string[] {
"Fields[SiteUrl].LinkFieldSettings.DefaultValue",
"http://www.orchardproject.net"});
#line 71
testRunner.And("I fill in", ((string)(null)), table7, "And ");
#line 74
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 75
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 76
testRunner.Then("I should see \"value=\\\"http://www.orchardproject.net\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 79
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table8.AddRow(new string[] {
"Fields[SiteUrl].LinkFieldSettings.Required",
"true"});
#line 80
testRunner.And("I fill in", ((string)(null)), table8, "And ");
#line 83
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 84
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 85
testRunner.Then("I should see \"required=\\\"required\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 88
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table9.AddRow(new string[] {
"Fields[SiteUrl].LinkFieldSettings.Required",
"false"});
#line 89
testRunner.And("I fill in", ((string)(null)), table9, "And ");
#line 92
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 93
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 94
testRunner.Then("I should not see \"required=\\\"required\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
this.ScenarioCleanup();
}
}
}
#pragma warning restore
#endregion
| {
"content_hash": "360bf98975683043ee33329cc12cf2ca",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 240,
"avg_line_length": 47.7734375,
"alnum_prop": 0.56443172526574,
"repo_name": "hbulzy/Orchard",
"id": "bb3a5ec7483f1b687def2fde60237e43ee040f72",
"size": "12232",
"binary": false,
"copies": "5",
"ref": "refs/heads/dev",
"path": "src/Orchard.Specs/Link.feature.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP.NET",
"bytes": "1293"
},
{
"name": "Batchfile",
"bytes": "4891"
},
{
"name": "C",
"bytes": "4755"
},
{
"name": "C#",
"bytes": "9448727"
},
{
"name": "CSS",
"bytes": "359711"
},
{
"name": "Gherkin",
"bytes": "100786"
},
{
"name": "HTML",
"bytes": "1213225"
},
{
"name": "JavaScript",
"bytes": "9276225"
},
{
"name": "Less",
"bytes": "320352"
},
{
"name": "PowerShell",
"bytes": "11350"
},
{
"name": "Rich Text Format",
"bytes": "171908"
},
{
"name": "SCSS",
"bytes": "205972"
},
{
"name": "TSQL",
"bytes": "595"
},
{
"name": "TypeScript",
"bytes": "51522"
},
{
"name": "XSLT",
"bytes": "119918"
}
],
"symlink_target": ""
} |
package builder::MyBuilder;
use strict;
use warnings;
use utf8;
use 5.008_001;
use parent qw(Module::Build);
# Module:::Build's share_dir handling is not good for me.
# We need to install 'tmpl' directories to '$DIST_DIR/tmpl'. But M::B doesn't support it.
sub ACTION_code {
my $self = shift;
my $share_prefix = File::Spec->catdir($self->blib, qw/lib auto share dist/, 'SanrioCharacterRanking');
for my $dir (qw(tmpl static)) {
next unless -d $dir;
for my $src (@{$self->rscan_dir($dir)}) {
next if -d $src;
$self->copy_if_modified(
from => $src,
to_dir => File::Spec->catfile( $share_prefix )
);
}
}
$self->SUPER::ACTION_code();
}
1;
| {
"content_hash": "b92f302e1171c92f9d290ad90220418d",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 106,
"avg_line_length": 28.807692307692307,
"alnum_prop": 0.5727636849132176,
"repo_name": "mono0x/ranking.sucretown.net",
"id": "8171c508dcfaeaaa26143e64fdbef84bf5269ae2",
"size": "749",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "builder/MyBuilder.pm",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "974"
},
{
"name": "HTML",
"bytes": "3370"
},
{
"name": "JavaScript",
"bytes": "18676"
},
{
"name": "Perl",
"bytes": "20835"
},
{
"name": "Ruby",
"bytes": "2247"
},
{
"name": "Shell",
"bytes": "106"
}
],
"symlink_target": ""
} |
import os
def _get_cache_dir_path():
return os.path.join(os.path.expanduser('~/.local/share'), 'atcoder-tools')
def get_cache_file_path(filename: str):
return os.path.join(_get_cache_dir_path(), filename)
| {
"content_hash": "31529f4de921e0bb536da085185d76b6",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 78,
"avg_line_length": 24.11111111111111,
"alnum_prop": 0.6866359447004609,
"repo_name": "kyuridenamida/atcoder-tools",
"id": "5222f6e99f08b87739e3450139424954dbca207f",
"size": "217",
"binary": false,
"copies": "2",
"ref": "refs/heads/stable",
"path": "atcodertools/fileutils/artifacts_cache.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "16188"
},
{
"name": "C++",
"bytes": "21899"
},
{
"name": "CSS",
"bytes": "719"
},
{
"name": "D",
"bytes": "6304"
},
{
"name": "Go",
"bytes": "6875"
},
{
"name": "HTML",
"bytes": "341695"
},
{
"name": "Java",
"bytes": "7287"
},
{
"name": "JavaScript",
"bytes": "64422"
},
{
"name": "Julia",
"bytes": "10348"
},
{
"name": "Nim",
"bytes": "7595"
},
{
"name": "Python",
"bytes": "262284"
},
{
"name": "Roff",
"bytes": "3669"
},
{
"name": "Rust",
"bytes": "12241"
},
{
"name": "SCSS",
"bytes": "45"
},
{
"name": "Shell",
"bytes": "1320"
},
{
"name": "Swift",
"bytes": "7732"
},
{
"name": "TypeScript",
"bytes": "48032"
}
],
"symlink_target": ""
} |
(function($) {
$(document).ready(function() {
function optionsframework_add_file(event, selector) {
var upload = $(".uploaded-file"), frame;
var $el = $(this);
event.preventDefault();
// If the media frame already exists, reopen it.
if ( frame ) {
frame.open();
return;
}
// Create the media frame.
frame = wp.media({
// Set the title of the modal.
title: $el.data('choose'),
// Customize the submit button.
button: {
// Set the text of the button.
text: $el.data('update'),
// Tell the button not to close the modal, since we're
// going to refresh the page when the image is selected.
close: false
}
});
// When an image is selected, run a callback.
frame.on( 'select', function() {
// Grab the selected attachment.
var attachment = frame.state().get('selection').first();
frame.close();
selector.find('.upload').val(attachment.attributes.url);
if ( attachment.attributes.type == 'image' ) {
selector.find('.screenshot').empty().hide().append('<img src="' + attachment.attributes.url + '"><a class="remove-image">Remove</a>').slideDown('fast');
}
selector.find('.upload-button').unbind().addClass('remove-file').removeClass('upload-button').val(optionsframework_l10n.remove);
selector.find('.of-background-properties').slideDown();
selector.find('.remove-image, .remove-file').on('click', function() {
optionsframework_remove_file( $(this).parents('.section') );
});
});
// Finally, open the modal.
frame.open();
}
function optionsframework_remove_file(selector) {
selector.find('.remove-image').hide();
selector.find('.upload').val('');
selector.find('.of-background-properties').hide();
selector.find('.screenshot').slideUp();
selector.find('.remove-file').unbind().addClass('upload-button').removeClass('remove-file').val(optionsframework_l10n.upload);
// We don't display the upload button if .upload-notice is present
// This means the user doesn't have the WordPress 3.5 Media Library Support
if ( $('.section-upload .upload-notice').length > 0 ) {
$('.upload-button').remove();
}
selector.find('.upload-button').on('click', function() {
optionsframework_add_file(event, $(this).parents('.section'));
});
}
$('.remove-image, .remove-file').on('click', function() {
optionsframework_remove_file( $(this).parents('.section') );
});
$('.upload-button').click( function( event ) {
optionsframework_add_file(event, $(this).parents('.section'));
});
});
})(jQuery); | {
"content_hash": "0a2a11efb5a44a77b70c86c1a720c0b0",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 157,
"avg_line_length": 33.92307692307692,
"alnum_prop": 0.6228269085411943,
"repo_name": "chenp-fjnu/ygyjws",
"id": "d949b7ae2313b5fab8a5e33a4c0d855181efa80e",
"size": "2646",
"binary": false,
"copies": "98",
"ref": "refs/heads/master",
"path": "htdocs/wp-content/themes/inkness/inc/js/media-uploader.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "298"
},
{
"name": "CSS",
"bytes": "1789690"
},
{
"name": "HTML",
"bytes": "6472"
},
{
"name": "JavaScript",
"bytes": "2138497"
},
{
"name": "PHP",
"bytes": "10921855"
},
{
"name": "Shell",
"bytes": "318"
}
],
"symlink_target": ""
} |
<?php
namespace Chamilo\Libraries\Test\Unit\Translation;
use Chamilo\Libraries\Architecture\Test\TestCases\ChamiloTestCase;
use Chamilo\Libraries\File\Filesystem;
use Chamilo\Libraries\Translation\PackagesTranslationResourcesFinder;
use Chamilo\Libraries\Translation\TranslationResourcesFinderInterface;
use Chamilo\Libraries\Translation\TranslationResourcesOptimizer;
use Symfony\Component\Translation\MessageCatalogue;
/**
* Tests the TranslationResourcesOptimizer class
*
* @package Chamilo\Libraries\test
* @author Sven Vanpoucke - Hogeschool Gent
*/
class TranslationResourcesOptimizerTest extends ChamiloTestCase
{
/**
* The mocks of the translation loaders
*
* @var LoaderInterface[] | \PHPUnit_Framework_MockObject_MockObject[]
*/
private $translationLoadersMocks;
/**
* The mock for the translation resources finder
*
* @var TranslationResourcesFinderInterface | \PHPUnit_Framework_MockObject_MockObject
*/
private $translationResourcesFinderMock;
/**
* The cache directory
*
* @var string
*/
private $cache_path;
/**
* Setup before each test
*/
public function setUp()
{
$this->translationLoadersMocks = array(
'ini' => $this->createMock('Symfony\Component\Translation\Loader\IniFileLoader'));
$this->translationResourcesFinderMock = $this->createMock(PackagesTranslationResourcesFinder::class);
$this->cache_path = __DIR__ . '/cache';
mkdir($this->cache_path);
}
/**
* Tear down after each test
*/
public function tearDown()
{
unset($this->translationLoadersMocks);
unset($this->translationResourcesFinderMock);
Filesystem::remove($this->cache_path);
unset($this->cache_path);
}
/**
* Tests to create the class
*/
public function test_create_class()
{
new TranslationResourcesOptimizer(
$this->translationLoadersMocks,
$this->translationResourcesFinderMock,
$this->cache_path);
$this->assertTrue(true);
}
/**
* Tests to create the class without translation loaders
* @expectedException \InvalidArgumentException
*/
public function test_create_class_without_translation_loaders()
{
new TranslationResourcesOptimizer(array(), $this->translationResourcesFinderMock, $this->cache_path);
}
/**
* Tests to create the class with invalid translation loaders
* @expectedException \InvalidArgumentException
*/
public function test_create_class_with_invalid_translation_loaders()
{
new TranslationResourcesOptimizer(
array(new \stdClass()),
$this->translationResourcesFinderMock,
$this->cache_path);
}
/**
* Tests to create the class with an invalid cache path
* @expectedException \InvalidArgumentException
*/
public function test_create_class_with_invalid_cache_path()
{
new TranslationResourcesOptimizer($this->translationLoadersMocks, $this->translationResourcesFinderMock, null);
}
/**
* Test the get_optimized_translation_resources function
*/
public function test_get_optimized_translation_resources()
{
$return_value['en']['ini']['Chamilo\Libraries'] = 'en.php';
$this->translationResourcesFinderMock->expects($this->once())->method('findTranslationResources')->will(
$this->returnValue($return_value));
$messages = array('Hello' => 'Welkom', 'HowAreYou' => 'Hoe gaat het met je');
$message_catalogue = new MessageCatalogue('en');
$message_catalogue->add($messages, 'Chamilo\Libraries');
$this->translationLoadersMocks['ini']->expects($this->once())->method('load')->will(
$this->returnValue($message_catalogue));
$translation_resources_optimizer = new TranslationResourcesOptimizer(
$this->translationLoadersMocks,
$this->translationResourcesFinderMock,
$this->cache_path);
$resources = $translation_resources_optimizer->getOptimizedTranslationResources();
$this->assertEquals($resources['en'], $this->cache_path . '/en.php');
$cached_messages = require ($this->cache_path . '/en.php');
$this->assertEquals($messages, $cached_messages['Chamilo\Libraries']);
}
/**
* Test the get_optimized_translation_resources function with cached resources
*/
public function test_get_optimized_translation_resources_with_cached_resources()
{
$cache_file = $this->cache_path . '/locale.php';
$resources = array('en', 'nl', 'de');
file_put_contents($cache_file, "<?php\n\nreturn " . var_export($resources, true) . ";\n");
$translation_resources_optimizer = new TranslationResourcesOptimizer(
$this->translationLoadersMocks,
$this->translationResourcesFinderMock,
$this->cache_path);
$resources = $translation_resources_optimizer->getOptimizedTranslationResources();
$this->assertEquals($resources['de'], $this->cache_path . '/de.php');
}
/**
* Tests the get_optimized_translation_resources function with invalid resources that can not be loaded by
* the given loaders
* @expectedException \InvalidArgumentException
*/
public function test_get_optimized_translation_resources_with_invalid_resources()
{
$return_value['en']['xml']['Chamilo\Libraries'] = 'en.xml';
$this->translationResourcesFinderMock->expects($this->once())->method('findTranslationResources')->will(
$this->returnValue($return_value));
$translation_resources_optimizer = new TranslationResourcesOptimizer(
$this->translationLoadersMocks,
$this->translationResourcesFinderMock,
$this->cache_path);
$translation_resources_optimizer->getOptimizedTranslationResources();
}
}
| {
"content_hash": "32f8a652f2cd314bcaffa2e04113f4a0",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 119,
"avg_line_length": 33.4,
"alnum_prop": 0.6635063206919495,
"repo_name": "forelo/cosnics",
"id": "b6b43d7aa38f84521fcc9ce1a75ab2afa3e014ae",
"size": "6012",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Chamilo/Libraries/Test/Unit/Translation/TranslationResourcesOptimizerTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "262730"
},
{
"name": "C",
"bytes": "12354"
},
{
"name": "CSS",
"bytes": "1334431"
},
{
"name": "CoffeeScript",
"bytes": "41023"
},
{
"name": "Gherkin",
"bytes": "24033"
},
{
"name": "HTML",
"bytes": "1016812"
},
{
"name": "Hack",
"bytes": "424"
},
{
"name": "JavaScript",
"bytes": "10768095"
},
{
"name": "Less",
"bytes": "331253"
},
{
"name": "Makefile",
"bytes": "3221"
},
{
"name": "PHP",
"bytes": "23623996"
},
{
"name": "Python",
"bytes": "2408"
},
{
"name": "Ruby",
"bytes": "618"
},
{
"name": "SCSS",
"bytes": "163532"
},
{
"name": "Shell",
"bytes": "7965"
},
{
"name": "Smarty",
"bytes": "15750"
},
{
"name": "Twig",
"bytes": "388197"
},
{
"name": "TypeScript",
"bytes": "123212"
},
{
"name": "Vue",
"bytes": "454138"
},
{
"name": "XSLT",
"bytes": "43009"
}
],
"symlink_target": ""
} |
<?php
namespace Native5\Core\Ftp;
class FtpConfig {
private $_host;
private $_port;
private $_user;
private $_privateKey;
private $_publicKey;
public function getHost() {
return $this->_host;
}
public function setHost($host) {
$this->_host = $host;
}
public function getPort() {
return $this->_port;
}
public function setPort($port) {
$this->_port = $port;
}
public function getUser() {
return $this->_user;
}
public function setUser($user) {
$this->_user = $user;
}
public function getPrivateKey() {
return $this->_privateKey;
}
public function setPrivateKey($privateKey) {
$this->_privateKey = $privateKey;
}
public function getPublicKey() {
return $this->_publicKey;
}
public function setPublicKey($publicKey) {
$this->_publicKey = $publicKey;
}
}
| {
"content_hash": "d26d5184e09d022b0107fc9d106467a5",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 48,
"avg_line_length": 17.51851851851852,
"alnum_prop": 0.5623678646934461,
"repo_name": "native5/native5-sdk-common-php",
"id": "a519cd3d2bf8c8451020096ce152a6b00ca53bdf",
"size": "1778",
"binary": false,
"copies": "1",
"ref": "refs/heads/development",
"path": "src/Native5/Core/Ftp/FtpConfig.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "PHP",
"bytes": "128982"
}
],
"symlink_target": ""
} |
package org.semanticweb.elk.reasoner.saturation.rules.subsumers;
import org.semanticweb.elk.reasoner.indexing.model.IndexedClassExpression;
import org.semanticweb.elk.reasoner.saturation.conclusions.model.ClassConclusion;
import org.semanticweb.elk.reasoner.saturation.conclusions.model.SubClassInclusion;
import org.semanticweb.elk.reasoner.saturation.context.Context;
import org.semanticweb.elk.reasoner.saturation.context.ContextPremises;
import org.semanticweb.elk.reasoner.saturation.rules.ClassInferenceProducer;
/**
* A decomposition rules for {@link SubClassInclusion}s. The rule typically does not
* depend on the other {@link ClassConclusion}s stored in the {@link Context}
*
* @author "Yevgeny Kazakov"
*
* @param <P>
*/
public interface SubsumerDecompositionRule<P extends IndexedClassExpression>
extends SubsumerRule<P> {
public void accept(SubsumerDecompositionRuleVisitor<?> visitor, P premise,
ContextPremises premises, ClassInferenceProducer producer);
}
| {
"content_hash": "35531055cfaebcc764835aeec516eb66",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 84,
"avg_line_length": 38.19230769230769,
"alnum_prop": 0.8167170191339376,
"repo_name": "liveontologies/elk-reasoner",
"id": "4f9992cb63bbbb7e6585c2416b106ad16dcec7f8",
"size": "1704",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/rules/subsumers/SubsumerDecompositionRule.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "GAP",
"bytes": "42367"
},
{
"name": "Java",
"bytes": "7069460"
}
],
"symlink_target": ""
} |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE121_Stack_Based_Buffer_Overflow__CWE193_wchar_t_declare_memcpy_82_goodG2B.cpp
Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE193.label.xml
Template File: sources-sink-82_goodG2B.tmpl.cpp
*/
/*
* @description
* CWE: 121 Stack Based Buffer Overflow
* BadSource: Point data to a buffer that does not have space for a NULL terminator
* GoodSource: Point data to a buffer that includes space for a NULL terminator
* Sinks: memcpy
* BadSink : Copy string to data using memcpy()
* Flow Variant: 82 Data flow: data passed in a parameter to an virtual method called via a pointer
*
* */
#ifndef OMITGOOD
#include "std_testcase.h"
#include "CWE121_Stack_Based_Buffer_Overflow__CWE193_wchar_t_declare_memcpy_82.h"
namespace CWE121_Stack_Based_Buffer_Overflow__CWE193_wchar_t_declare_memcpy_82
{
void CWE121_Stack_Based_Buffer_Overflow__CWE193_wchar_t_declare_memcpy_82_goodG2B::action(wchar_t * data)
{
{
wchar_t source[10+1] = SRC_STRING;
/* Copy length + 1 to include NUL terminator from source */
/* POTENTIAL FLAW: data may not have enough space to hold source */
memcpy(data, source, (wcslen(source) + 1) * sizeof(wchar_t));
printWLine(data);
}
}
}
#endif /* OMITGOOD */
| {
"content_hash": "76d3fc959a8534b43faa940852cac337",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 105,
"avg_line_length": 36.94444444444444,
"alnum_prop": 0.6992481203007519,
"repo_name": "maurer/tiamat",
"id": "4284f5c7d77074239cdf70c8436f08fca36963ff",
"size": "1330",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "samples/Juliet/testcases/CWE121_Stack_Based_Buffer_Overflow/s03/CWE121_Stack_Based_Buffer_Overflow__CWE193_wchar_t_declare_memcpy_82_goodG2B.cpp",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
#include <argz.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lib/util_base.h"
#include "lib/util_libc.h"
#include "lib/util_list.h"
#include "lib/util_panic.h"
#include "lib/util_prg.h"
#include "lib/util_rec.h"
/*
* Field structure containing the string value and secondary information
*/
struct util_rec_fld {
char *key; /* Name of the filed */
char *hdr; /* Content of the header */
size_t len; /* Length of string argz array */
char *val; /* The value of the field */
enum util_rec_align align; /* Alignment of the field */
int width; /* Field width */
struct util_list_node node; /* Pointers to previous and next field */
};
/*
* Print formats
*/
struct rec_fmt {
enum {
REC_FMT_WIDE,
REC_FMT_LONG,
REC_FMT_CSV,
} type;
union {
struct wide_p {
char *hdr_sep;
char *col_sep;
int argz_sep;
} wide_p;
struct long_p {
char *hdr_sep;
char *col_sep;
int argz_sep;
char *key;
int key_size;
int val_size;
} long_p;
struct csv_p {
char *col_sep;
int argz_sep;
} csv_p;
} d;
int indent;
};
/*
* Record structure (internal representation)
*/
/// @cond
struct util_rec {
struct util_list *list; /* List of the fields */
struct rec_fmt fmt; /* Output format */
};
/// @endcond
struct util_list *__util_rec_get_list(struct util_rec *rec)
{
return rec->list;
}
/*
* Get the field according to a distinct key
*/
static struct util_rec_fld *rec_get_fld(struct util_rec *rec, const char *key)
{
struct util_rec_fld *fld;
util_list_iterate(rec->list, fld) {
if (!strcmp(fld->key, key))
return fld;
}
return NULL;
}
/**
* Return the key name of a field
*
* @param[in] fld Field for query
*
* @returns Pointer to key string
*/
const char *util_rec_fld_get_key(struct util_rec_fld *fld)
{
return fld->key;
}
/**
* Create a new record with "wide" output format
*
* @param[in] hdr_sep Header separator
*
* @returns Pointer to the created record
*/
struct util_rec *util_rec_new_wide(const char *hdr_sep)
{
struct util_rec *rec = util_malloc(sizeof(struct util_rec));
rec->list = util_list_new(struct util_rec_fld, node);
rec->fmt.type = REC_FMT_WIDE;
rec->fmt.d.wide_p.hdr_sep = util_strdup(hdr_sep);
rec->fmt.d.wide_p.argz_sep = ',';
rec->fmt.indent = 0;
return rec;
}
/*
* Print the indentation characters
*/
static inline void rec_print_indention(int indent)
{
if (indent <= 0)
return;
printf("%*s", indent, "");
}
/*
* Print record separator in "wide" output format
*/
static void rec_print_wide_separator(struct util_rec *rec)
{
const char *hdr_sep = rec->fmt.d.wide_p.hdr_sep;
int size = 0, field_count = 0;
struct util_rec_fld *fld;
char *buf;
if (!hdr_sep)
return;
util_list_iterate(rec->list, fld) {
if (fld->hdr) {
size += fld->width;
field_count++;
}
}
size += field_count - 1;
buf = util_malloc(size + 1);
memset(buf, (int)hdr_sep[0], size);
buf[size] = 0;
rec_print_indention(rec->fmt.indent);
printf("%s\n", buf);
free(buf);
}
/*
* Print record header in "wide" output format
*/
static void rec_print_wide_hdr(struct util_rec *rec)
{
const char *hdr_sep = rec->fmt.d.wide_p.hdr_sep;
int col_nr = 0, size = 0, field_count = 0;
struct util_rec_fld *fld;
char *buf;
rec_print_indention(rec->fmt.indent);
util_list_iterate(rec->list, fld) {
if (col_nr)
printf(" ");
if (fld->hdr) {
if (fld->align == UTIL_REC_ALIGN_LEFT)
printf("%-*s", fld->width, fld->hdr);
else
printf("%*s", fld->width, fld->hdr);
size += fld->width;
field_count++;
}
col_nr++;
}
printf("\n");
if (!hdr_sep)
return;
size += field_count - 1;
if (hdr_sep) {
buf = util_malloc(size + 1);
memset(buf, (int)hdr_sep[0], size);
buf[size] = 0;
rec_print_indention(rec->fmt.indent);
printf("%s\n", buf);
free(buf);
}
}
/*
* Print record field values in "wide" output format
*/
void rec_print_wide(struct util_rec *rec)
{
const char argz_sep = rec->fmt.d.wide_p.argz_sep;
struct util_rec_fld *fld;
char argz_str[PAGE_SIZE];
int fld_count = 0;
char *entry;
rec_print_indention(rec->fmt.indent);
util_list_iterate(rec->list, fld) {
if (!fld->hdr)
continue;
if (fld_count)
printf(" ");
entry = fld->val;
if (argz_count(fld->val, fld->len) > 1) {
strcpy(argz_str, entry);
while ((entry = argz_next(fld->val, fld->len, entry)))
strcat(strncat(argz_str, &argz_sep, 1), entry);
entry = argz_str;
}
if (fld->align == UTIL_REC_ALIGN_LEFT)
printf("%-*s", fld->width, entry);
else
printf("%*s", fld->width, entry);
fld_count++;
}
printf("\n");
}
/*
* Free private memory of record
*/
static void rec_free_wide(struct util_rec *rec)
{
free(rec->fmt.d.wide_p.hdr_sep);
}
/**
* Create a new record with "long" output format
*
* @param[in] hdr_sep Header separator
* @param[in] col_sep Column separator
* @param[in] key Primary key of record
* @param[in] key_size Width of left column i.e. keys
* @param[in] val_size Width of right column i.e. values
*
* @returns Pointer to the created record
*/
struct util_rec *util_rec_new_long(const char *hdr_sep, const char *col_sep,
const char *key, int key_size, int val_size)
{
struct util_rec *rec = util_malloc(sizeof(struct util_rec));
rec->list = util_list_new(struct util_rec_fld, node);
rec->fmt.type = REC_FMT_LONG;
rec->fmt.d.long_p.hdr_sep = util_strdup(hdr_sep);
rec->fmt.d.long_p.col_sep = util_strdup(col_sep);
rec->fmt.d.long_p.key = util_strdup(key);
rec->fmt.d.long_p.key_size = key_size;
rec->fmt.d.long_p.val_size = val_size;
rec->fmt.d.long_p.argz_sep = ' ';
rec->fmt.indent = 0;
return rec;
}
/*
* Print field header in "long" output format
*/
static void rec_print_long_hdr(struct util_rec *rec)
{
struct long_p *p = &rec->fmt.d.long_p;
struct util_rec_fld *fld;
int len = 0;
char *buf;
fld = rec_get_fld(rec, p->key);
util_assert(fld != NULL, "Record not found\n");
util_assert(fld->hdr != NULL, "Header for field not found\n");
rec_print_indention(rec->fmt.indent);
if (p->col_sep) {
printf("%-*s %s %-*s\n", p->key_size, fld->hdr,
p->col_sep, fld->width, fld->val);
len = p->key_size + p->val_size + 3;
} else {
printf("%-*s %-*s\n", p->key_size, fld->hdr, fld->width,
fld->val);
len = p->key_size + p->val_size + 1;
}
if (!p->hdr_sep)
return;
buf = util_malloc(len + 1);
memset(buf, p->hdr_sep[0], len);
buf[len] = 0;
rec_print_indention(rec->fmt.indent);
printf("%s\n", buf);
free(buf);
}
/*
* Print record field values in "long" output format
*/
static void rec_print_long(struct util_rec *rec)
{
struct long_p *p = &rec->fmt.d.long_p;
struct util_rec_fld *fld;
char *item = NULL;
rec_print_long_hdr(rec);
util_list_iterate(rec->list, fld) {
if (!fld->hdr)
continue;
if (!strcmp(p->key, fld->key))
continue;
if (!fld->val)
continue;
rec_print_indention(rec->fmt.indent);
item = argz_next(fld->val, fld->len, item);
if (p->col_sep) {
printf(" %-*s %s %s\n",
p->key_size - 8, fld->hdr, p->col_sep, item);
while ((item = argz_next(fld->val, fld->len, item))) {
rec_print_indention(rec->fmt.indent);
printf(" %-*s %c %s\n",
p->key_size - 8, "", p->argz_sep, item);
}
} else {
printf(" %-*s %s\n",
p->key_size - 8, fld->hdr, fld->val);
while ((item = argz_next(fld->val, fld->len, item))) {
rec_print_indention(rec->fmt.indent);
printf(" %-*s %s\n",
p->key_size - 8, "", item);
}
}
}
printf("\n");
}
/*
* Free private memory of record
*/
static void rec_free_long(struct util_rec *rec)
{
free(rec->fmt.d.long_p.hdr_sep);
free(rec->fmt.d.long_p.col_sep);
free(rec->fmt.d.long_p.key);
}
/**
* Create a new record with "csv" output format
*
* @param[in] col_sep Column separator
*
* @returns Pointer to the created record
*/
struct util_rec *util_rec_new_csv(const char *col_sep)
{
struct util_rec *rec = util_malloc(sizeof(struct util_rec));
rec->list = util_list_new(struct util_rec_fld, node);
rec->fmt.type = REC_FMT_CSV;
rec->fmt.d.csv_p.col_sep = util_strdup(col_sep);
rec->fmt.d.csv_p.argz_sep = ' ';
rec->fmt.indent = 0;
return rec;
}
/*
* Print record header in "csv" output format
*/
void rec_print_csv_hdr(struct util_rec *rec)
{
const char *col_sep = rec->fmt.d.csv_p.col_sep;
struct util_rec_fld *fld;
int fld_count = 0;
rec_print_indention(rec->fmt.indent);
util_list_iterate(rec->list, fld) {
if (fld_count)
printf("%c", *col_sep);
if (fld->hdr) {
printf("%s", fld->hdr);
fld_count++;
}
}
printf("\n");
}
/*
* Print record field values in "csv" output format
*/
void rec_print_csv(struct util_rec *rec)
{
const char argz_sep = rec->fmt.d.csv_p.argz_sep;
const char *col_sep = rec->fmt.d.csv_p.col_sep;
struct util_rec_fld *fld;
int fld_count = 0;
char *item = NULL;
rec_print_indention(rec->fmt.indent);
util_list_iterate(rec->list, fld) {
item = argz_next(fld->val, fld->len, item);
if (fld_count)
printf("%c", *col_sep);
if (fld->hdr) {
printf("%s", item);
while ((item = argz_next(fld->val, fld->len, item)))
printf("%c%s", argz_sep, item);
fld_count++;
}
}
printf("\n");
}
/*
* Free private memory of record
*/
static void rec_free_csv(struct util_rec *rec)
{
free(rec->fmt.d.csv_p.col_sep);
}
/**
* Define a new field for the record
*
* @param[in] rec Pointer of the record
* @param[in] key Key of the filed is to be created. It should be unique
* within the record.
* @param[in] align Alignment of field
* @param[in] width Width of field
* @param[in] hdr This information is printed in record headers. If it is
* NULL, the field is prohibited form printing completely.
*/
void util_rec_def(struct util_rec *rec, const char *key,
enum util_rec_align align, int width, const char *hdr)
{
struct util_rec_fld *fld = util_malloc(sizeof(struct util_rec_fld));
fld->key = util_strdup(key);
fld->hdr = util_strdup(hdr);
fld->val = NULL;
fld->align = align;
fld->width = width;
util_list_add_tail(rec->list, fld);
}
/**
* Free record and associated fields
*
* @param[in] rec Record pointer
*/
void util_rec_free(struct util_rec *rec)
{
struct util_rec_fld *fld, *tmp;
util_list_iterate_safe(rec->list, fld, tmp) {
util_list_remove(rec->list, fld);
free(fld->key);
free(fld->hdr);
free(fld->val);
free(fld);
}
util_list_free(rec->list);
switch (rec->fmt.type) {
case REC_FMT_WIDE:
rec_free_wide(rec);
break;
case REC_FMT_LONG:
rec_free_long(rec);
break;
case REC_FMT_CSV:
rec_free_csv(rec);
break;
}
free(rec);
}
/**
* Print record field values according to output format
*
* @param[in] rec Record pointer
*/
void util_rec_print(struct util_rec *rec)
{
switch (rec->fmt.type) {
case REC_FMT_WIDE:
rec_print_wide(rec);
break;
case REC_FMT_LONG:
rec_print_long(rec);
break;
case REC_FMT_CSV:
rec_print_csv(rec);
break;
}
}
/**
* Print record header according to output format
*
* @param[in] rec Record pointer
*/
void util_rec_print_hdr(struct util_rec *rec)
{
switch (rec->fmt.type) {
case REC_FMT_WIDE:
rec_print_wide_hdr(rec);
break;
case REC_FMT_LONG:
break;
case REC_FMT_CSV:
rec_print_csv_hdr(rec);
break;
}
}
/**
* Print record separator according to output format
*
* @param[in] rec Record pointer
*/
void util_rec_print_separator(struct util_rec *rec)
{
switch (rec->fmt.type) {
case REC_FMT_WIDE:
rec_print_wide_separator(rec);
break;
case REC_FMT_LONG:
break;
case REC_FMT_CSV:
break;
}
}
/**
* Set a field value to an argz vector
*
* @param[in] rec Record pointer
* @param[in] key Key of the desired field
* @param[in] argz Pointer to the series of strings
* @param[in] len Length of the argz buffer
*/
void util_rec_set_argz(struct util_rec *rec, const char *key, const char *argz,
size_t len)
{
struct util_rec_fld *fld;
char *val;
fld = rec_get_fld(rec, key);
if (!fld)
return;
val = util_malloc(len);
val = memcpy(val, argz, len);
free(fld->val);
fld->val = val;
fld->len = len;
}
/**
* Set a field value to a formatted string
*
* @param[in] rec Record pointer
* @param[in] key Key of the desired field
* @param[in] fmt Format string for generation of value string
* @param[in] ... Parameters for format string
*
* @returns Pointer to the field which was modified or NULL in the case of
* any error.
*/
void util_rec_set(struct util_rec *rec, const char *key, const char *fmt, ...)
{
struct util_rec_fld *fld;
va_list ap;
char *str;
util_assert(fmt != NULL, "Parameter 'fmt' pointer must not be NULL\n");
fld = rec_get_fld(rec, key);
if (!fld)
return;
UTIL_VASPRINTF(&str, fmt, ap);
free(fld->val);
fld->val = str;
fld->len = strlen(str) + 1;
}
/**
* Return the string value of a desired field. If the field value stored in argz
* format, pointer to the first argz element is returned.
*
* @param[in] rec Record pointer
* @param[in] key Key of the field
*
* @returns If the desired field was found, the pointer to its value.
* NULL in the case of any error or if the field is empty.
*/
const char *util_rec_get(struct util_rec *rec, const char *key)
{
struct util_rec_fld *fld = rec_get_fld(rec, key);
return (fld != NULL) ? fld->val : NULL;
}
/**
* Sets the indentation of the record
*
* @param[in] rec Record pointer
* @param[in] indent Number of characters to indent
*/
void util_rec_set_indent(struct util_rec *rec, int indent)
{
rec->fmt.indent = indent;
}
| {
"content_hash": "77474c91ad97276290f90fe8900de4bd",
"timestamp": "",
"source": "github",
"line_count": 615,
"max_line_length": 80,
"avg_line_length": 22.320325203252033,
"alnum_prop": 0.6214759233627158,
"repo_name": "ibm-s390-tools/s390-tools",
"id": "c216cf95606a6982af8a4f9c8cb68a1efb61a9ae",
"size": "13994",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "libutil/util_rec.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "32963"
},
{
"name": "C",
"bytes": "3772541"
},
{
"name": "C++",
"bytes": "283211"
},
{
"name": "Dockerfile",
"bytes": "375"
},
{
"name": "Makefile",
"bytes": "74744"
},
{
"name": "Perl",
"bytes": "121363"
},
{
"name": "Roff",
"bytes": "447343"
},
{
"name": "Shell",
"bytes": "292424"
}
],
"symlink_target": ""
} |
<html dir="LTR">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
<title>Lewis.SST.SQLMethods</title>
<xml>
</xml>
<link rel="stylesheet" type="text/css" href="MSDN.css" />
</head>
<body id="bodyID" class="dtBODY">
<div id="nsbanner">
<div id="bannerrow1">
<table class="bannerparthead" cellspacing="0">
<tr id="hdr">
<td class="runninghead">SQL Schema Tool Help</td>
<td class="product">
</td>
</tr>
</table>
</div>
<div id="TitleRow">
<h1 class="dtH1">Lewis.SST.SQLMethods Namespace</h1>
</div>
</div>
<div id="nstext">
<p>
<a href="Lewis.SST.SQLMethodsHierarchy.html">Namespace hierarchy</a>
</p>
<h3 class="dtH3">Classes</h3>
<div class="tablediv">
<table class="dtTABLE" cellspacing="0">
<tr valign="top">
<th width="50%">Class</th>
<th width="50%">Description</th>
</tr>
<tr valign="top">
<td width="50%">
<a href="Lewis.SST.SQLMethods.SQLConnection.html">SQLConnection</a>
</td>
<td width="50%"> SQLConnection class wraps SqlConnection class to add additional data elements </td>
</tr>
<tr valign="top">
<td width="50%">
<a href="Lewis.SST.SQLMethods.SQLConnections.html">SQLConnections</a>
</td>
<td width="50%"> SQLConnections Collection class. A class to create and contain multiple SqlConnection objects. </td>
</tr>
<tr valign="top">
<td width="50%">
<a href="Lewis.SST.SQLMethods.SQLData.html">SQLData</a>
</td>
<td width="50%"> Methods to get SQL data for copy and serialization </td>
</tr>
<tr valign="top">
<td width="50%">
<a href="Lewis.SST.SQLMethods.SQLServers.html">SQLServers</a>
</td>
<td width="50%"> Class to enumerate SQL servers using the ODBC driver. </td>
</tr>
</table>
</div>
<h3 class="dtH3">Enumerations</h3>
<div class="tablediv">
<table class="dtTABLE" cellspacing="0">
<tr valign="top">
<th width="50%">Enumeration</th>
<th width="50%">Description</th>
</tr>
<tr valign="top">
<td width="50%">
<a href="Lewis.SST.SQLMethods.SecurityType.html">SecurityType</a>
</td>
<td width="50%"> SQL server login security types </td>
</tr>
</table>
</div>
</div>
</body>
</html> | {
"content_hash": "61fcb84b0504dc013c8278726f558eed",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 129,
"avg_line_length": 36.45569620253165,
"alnum_prop": 0.50625,
"repo_name": "lslewis901/SqlSchemaTool",
"id": "516ccd6fcd91fa6c3a75b77b42b75f472b16251f",
"size": "2880",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/Lewis.SST.SQLMethods.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "2491181"
},
{
"name": "CSS",
"bytes": "2319"
},
{
"name": "HTML",
"bytes": "611656"
},
{
"name": "JavaScript",
"bytes": "5371"
},
{
"name": "PLSQL",
"bytes": "24772"
},
{
"name": "SQLPL",
"bytes": "5669"
},
{
"name": "XSLT",
"bytes": "295607"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.