text
stringlengths 2
1.04M
| meta
dict |
---|---|
package org.kew.rmf.transformers;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.kew.rmf.transformers.ZeroToBlankTransformer;
public class ZeroToBlankTransformerTest {
@Test
public void testSimple() {
ZeroToBlankTransformer transformer = new ZeroToBlankTransformer();
assertEquals("", transformer.transform(""));
assertEquals("", transformer.transform("0"));
assertEquals("00", transformer.transform("00"));
}
}
| {
"content_hash": "587a9882d4d34527761da08ef8946a2a",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 68,
"avg_line_length": 24.263157894736842,
"alnum_prop": 0.7657266811279827,
"repo_name": "RBGKew/String-Transformers",
"id": "3f35a0c8da9b0b6164b15333e9661b4544fe8a7a",
"size": "1567",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/org/kew/rmf/transformers/ZeroToBlankTransformerTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "308307"
}
],
"symlink_target": ""
} |
This file is used to list changes made in each version of the ark cookbook.
## 2.2.1 (2016-12-16)
- Use Ohai root_group attribute to avoid trying to set the group to root on BSD/macOS.
- Add missing accessor for owner property
## 2.2.0 (2016-12-14)
- Add detection of .7z file extensions
- Fix 7zip extraction using strip_components >= 1 to properly extract to the path instead of the user's home_dir
- Always quote the path to the 7zip and xcopy binaries as they may have spaces
- Clarified in the readme that the install_with_make action includes the configure action
- Fix files with very long paths failing to extract on Windows
- Fix default owner of 'root' failing on Windows
- Fix 7-zip extraction with long paths when strip_components is >= 1
- Add the group attribute parameter to README
- Fix package installation failure on macOS systems
- Use x to extract with 7-zip, not e. Use e only for dump, which strips directories.
## 2.1.0 (2016-11-15)
- Move tar/7zip path logic out of attributes and into helpers to prevent failures when 7zip is not installed before the chef run starts
- Improve platform testing in Test Kitchen
- Recognize Windows as a supported platform in the readme
- Introduce a new attribute for overriding the 7-zip location: node['ark']['sevenzip_binary']
## 2.0.2 (2016-11-03)
- Fix suse support and centos < 6
## 2.1.0 (2016-11-01)
- Use multipackage installs to speed up installation
- Avoid installation package dependencies on Windows entirely
- Remove the testing bin stubs
## 2.0.0 (2016-09-15)
- Add CentOS 7.2, Fedora 23, and Suse specs
- Add centos 5, debian, and opensuse travis testing
- Add a contributing doc
- Fix cookstyle warnings
- Require Chef 12.1+
## [v1.2.0](https://github.com/chef-cookbooks/ark/tree/v1.2.0) (2016-07-03)
[Full Changelog](https://github.com/chef-cookbooks/ark/compare/v1.1.0...v1.2.0)
- Create seven_zip unpack command when strip_components is 0 [#155](https://github.com/chef-cookbooks/ark/pull/155) ([terkill](https://github.com/terkill))
- Get 7zip path from the windows registry. [#153](https://github.com/chef-cookbooks/ark/pull/153) ([buri17](https://github.com/buri17))
- Use fullpath for xcopy and icacls. [#152](https://github.com/chef-cookbooks/ark/pull/152) ([buri17](https://github.com/buri17))
- Define custom matcher helper for notification testing, fixes #139 [#144](https://github.com/chef-cookbooks/ark/pull/144) ([szymonpk](https://github.com/szymonpk))
## v1.1.0 (2016-05-19)
- Add support for RHEL 7
- Fixes to the readme to clarify actions / properties
- Expose the backup property in remote file to the ark resource
- Transfer the cookbook back to Chef
- Resolve all rubocop warnings
- Add maintainers files and Chef contributing docs
- Test on the latest platforms in .kitchen.yml and update Travis to use kitchen-dokken with additional platforms
## v1.0.1 (2016-02-16)
- Remove a large number of zero byte archives that snuck into the repository
- Remove a Chef 10 compatibility check in the custom resource
## v1.0.0 (2016-02-09)
- Added the pkg-config package to the debian platform family
- Added tar, xz-lzma-compat, and bzip2 packages to the RHEL and fedora platform families
- Updated FreeBSD to install gmake instead of make
- Added OS X, SmartOS, and FreeBSD to the tar path attributes to support those platforms
- Removed the has_binaries attribute from put action documentation in the readme file since this isn't supported there
- Moved the libraries module locations to no longer be under Opscode:: and broke out libraries into more logical units
- Fixed issues with spaces in Windows paths that could cause failures
- Fixed a bad attribute for the 7zip home on windows. Instead of using a node attribute use the value directly to avoid computed attribute overiding issues
- Switched from the 7-zip cookbook to seven_zip since the 7-zip cookbook is now deprecated
- Changed unzip commands to not use -u so that a newer archive can overwrite an existing directory
- Added support for actions py_setup, py_setup_install, py_setup_build
- Fixed setting home_dir attribute
- Added source_url and issues_url to the metadata.rb
- Expanded the supported platforms in metadata.rb
- Removed all references to Opscode
- Improved error logging when an unknown extension is encountered
- Added support for .tar files
- Improved overall testing:
- Removed the kitchen.cloud.yml file and gem dependencies
- Added integration testing in Travis with Kitchen-Docker and Travis tests now run using the nightly build of ChefDK
- Expanded platforms tested in the .kitchen.yml file
- Updated the Gemfile with the latest testing dependencies
- Added full Chefspec coverage
- Greatly expanded the ark_spec test cookbook
- Removed the original minitests
- Added standard Chef .gitignore and chefignore files
- Resolved a large number of rubocop warnings
- Removed old Opscode contributing and testing docs
- Added a cookbook version badge to the readme
- Removed the Toftfile
## v0.9.0 (2014-06-06)
- [COOK-3642] Add Windows support
## v0.8.2 (2014-04-23)
- [COOK-4514] - Support for SLES with the Ark cookbook
## v0.8.0 (2014-04-10)
- [COOK-2771] - Add support for XZ compression
## v0.7.2 (2014-03-28)
- [COOK-4477] - Fix failing test suite
- [COOK-4484] - Replace strip_leading_dir attribute with more general strip_components
## v0.7.0 (2014-03-18)
- [COOK-4437] - configure and install_with_make should chown after unpack
## v0.6.0 (2014-02-27)
[COOK-3786] - Unable to install multiple versions of archive without duplication
## v0.5.0 (2014-02-21)
### Bug
- **[COOK-4288](https://tickets.opscode.com/browse/COOK-4288)** - Cleanup the Kitchen
### Improvement
- **[COOK-4264](https://tickets.opscode.com/browse/COOK-4264)** - Add node['ark']['package_dependencies'] to allow tuning packages.
## v0.4.2
### Improvement
- **[COOK-3854](https://tickets.opscode.com/browse/COOK-3854)** - Capability with mac_os_x: '/bin/chown' - No such file or directory
- Cleaning up some style for rubucop
- Updating test harness
## v0.4.0
### Improvement
- **[COOK-3539](https://tickets.opscode.com/browse/COOK-3539)** - Allow dumping of bz2 and gzip files
## v0.3.2
### Bug
- **[COOK-3191](https://tickets.opscode.com/browse/COOK-3191)** - Propogate unzip failures
- **[COOK-3118](https://tickets.opscode.com/browse/COOK-3118)** - Set cookbook attribute in provider
- **[COOK-3055](https://tickets.opscode.com/browse/COOK-3055)** - Use proper scope in helper module
- **[COOK-3054](https://tickets.opscode.com/browse/COOK-3054)** - Fix notification resource updating
### Improvement
- **[COOK-3179](https://tickets.opscode.com/browse/COOK-3179)** - README updates and refactor
## v0.3.0
### Improvement
- [COOK-3087]: Can't use ark with chef < 11
### Bug
- [COOK-3064]: `only_if` statements in ark's `install_with_make` and configure actions are not testing for file existence correctly.
- [COOK-3067]: ark kitchen test for `cherry_pick` is expecting the binary to be in the same parent folder as in the archive.
## v0.2.4
### Bug
- [COOK-3048]: Ark provider contains a `ruby_block` resource without a block attribute
- [COOK-3063]: Ark cookbook `cherry_pick` action's unzip command does not close if statement
- [COOK-3065]: Ark install action does not symlink binaries correctly
## v0.2.2
- Update the README to reflect the requirement for Chef 11 to use the ark resource (`use_inline_resources`).
- Making this a release so it will also appear on the community site page.
## v0.2.0
### Bug
- [COOK-2772]: Ark cookbook has foodcritic failures in provides/default.rb
### Improvement
- [COOK-2520]: Refactor ark providers to use the '`use_inline_resources`' LWRP DSL feature
## v0.1.0
- [COOK-2335] - ark resource broken on Chef 11
## v0.0.1
- [COOK-2026] - Allow `cherry_pick` action to be used for directories as well as files
## v0.0.1
- [COOK-1593] - README formatting updates for better display on Community Site
## v0.0.1
### Bug
- dangling "unless"
### Improvement
- add `setup_py_*` actions
- add vagrantfile
- add foodcritic test
- travis.ci support
## v0.0.10 (May 23, 2012
### Bug
- `strip_leading_dir` not working for zip files <https://github.com/bryanwb/chef-ark/issues/19>
### Improvement
- use autogen.sh to generate configure script for configure action <https://github.com/bryanwb/chef-ark/issues/16>
- support more file extensions <https://github.com/bryanwb/chef-ark/pull/18>
- add extension attribute which allows you to download files which do not have the file extension as part of the URL
| {
"content_hash": "9cdb24fb162a97f0fd57538711674dee",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 164,
"avg_line_length": 35.91213389121339,
"alnum_prop": 0.742164744261913,
"repo_name": "chandrasekh/learning-chef",
"id": "41b3e5443e613886591e6d466d3de1a7dcbe01b5",
"size": "8609",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "cookbooks/ark/CHANGELOG.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "446"
},
{
"name": "C",
"bytes": "47932"
},
{
"name": "HTML",
"bytes": "104403"
},
{
"name": "Makefile",
"bytes": "455"
},
{
"name": "Perl",
"bytes": "83401"
},
{
"name": "Ruby",
"bytes": "1298352"
},
{
"name": "Shell",
"bytes": "17319"
}
],
"symlink_target": ""
} |
#pragma once
#include <aws/ec2/EC2_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace EC2
{
namespace Model
{
enum class OperationType
{
NOT_SET,
add,
remove
};
namespace OperationTypeMapper
{
AWS_EC2_API OperationType GetOperationTypeForName(const Aws::String& name);
AWS_EC2_API Aws::String GetNameForOperationType(OperationType value);
} // namespace OperationTypeMapper
} // namespace Model
} // namespace EC2
} // namespace Aws
| {
"content_hash": "4d3c3d9e91d6ecb253853c6eeb2fbf05",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 75,
"avg_line_length": 18.185185185185187,
"alnum_prop": 0.7393075356415478,
"repo_name": "ambasta/aws-sdk-cpp",
"id": "342798d3becf00344a75ea36eab247d2786dcbd0",
"size": "1064",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-cpp-sdk-ec2/include/aws/ec2/model/OperationType.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "2305"
},
{
"name": "C++",
"bytes": "74273816"
},
{
"name": "CMake",
"bytes": "412257"
},
{
"name": "Java",
"bytes": "229873"
},
{
"name": "Python",
"bytes": "62933"
}
],
"symlink_target": ""
} |
<!--
Copyright 2014-2016 CyberVision, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<assembly>
<id>java-android-sdk</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<unpack>true</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>
| {
"content_hash": "cb37583f4e4f17f91ab38d05556ef301",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 76,
"avg_line_length": 29.636363636363637,
"alnum_prop": 0.7280163599182005,
"repo_name": "sashadidukh/kaa",
"id": "13dc06bd07a5b942aa9eed6bbc1d4d001f1f8506",
"size": "978",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "client/client-multi/client-java-android/src/main/assembly/client-java-android-sdk.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5641"
},
{
"name": "C",
"bytes": "1333836"
},
{
"name": "C++",
"bytes": "1097116"
},
{
"name": "CMake",
"bytes": "99396"
},
{
"name": "CSS",
"bytes": "78522"
},
{
"name": "GCC Machine Description",
"bytes": "2041"
},
{
"name": "HTML",
"bytes": "20318"
},
{
"name": "Java",
"bytes": "9749624"
},
{
"name": "JavaScript",
"bytes": "14069"
},
{
"name": "Makefile",
"bytes": "5531"
},
{
"name": "Nix",
"bytes": "20497"
},
{
"name": "Objective-C",
"bytes": "1271558"
},
{
"name": "Python",
"bytes": "140178"
},
{
"name": "Ruby",
"bytes": "11176"
},
{
"name": "Shell",
"bytes": "121002"
},
{
"name": "Thrift",
"bytes": "10826"
},
{
"name": "XSLT",
"bytes": "4062"
}
],
"symlink_target": ""
} |
import {Fix} from '../read-flight';
import {Cylinder, Line, Shape} from './shapes';
export class StartPoint {
shape: Shape;
constructor(shape: Shape) {
this.shape = shape;
}
}
export class FinishPoint {
shape: Shape;
constructor(shape: Shape) {
this.shape = shape;
}
}
export class TaskPoint {
shape: Shape;
constructor(shape: Shape) {
this.shape = shape;
}
checkTransition(fix1: Fix, fix2: Fix): any | undefined {
if (this.shape instanceof Line) {
return this.shape.checkTransition(fix1.coordinate, fix2.coordinate);
} else if (this.shape instanceof Cylinder) {
return this.shape.checkEnter(fix1.coordinate, fix2.coordinate);
}
// TODO support other turn areas
}
}
| {
"content_hash": "e214e5de5615ccef8b6dc436d8cc5f38",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 74,
"avg_line_length": 21,
"alnum_prop": 0.6653061224489796,
"repo_name": "Turbo87/aeroscore",
"id": "046eb7ace5b3acfde3c53a19b453486dbe393506",
"size": "735",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/task/task-points.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "604"
},
{
"name": "TypeScript",
"bytes": "70631"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "390c1f52c81e13fb4d44599ecbd1416b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "3829faa3ae81bdea7c25d907cccec3e50a1c1d0e",
"size": "182",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Apiales/Apiaceae/Ferula/Ferula urceolata/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
How to Hold A Pencil 2.0
========================
http://howtoholdapencil.com
New Siteleaf Theme for How to Hold a Pencil Podcast
| {
"content_hash": "5a459ff7e2bfe36fef93e3d542c4219d",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 51,
"avg_line_length": 22,
"alnum_prop": 0.6287878787878788,
"repo_name": "reubeningber/How-to-Hold-A-Pencil-2.0",
"id": "3cb77cedd6efb61b1d71eff181fdac5b85c4340a",
"size": "132",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "66744"
}
],
"symlink_target": ""
} |
//========================================================================
//
// JPEG2000Stream.cc
//
// A JPX stream decoder using OpenJPEG
//
// Copyright 2008-2010, 2012 Albert Astals Cid <aacid@kde.org>
// Copyright 2011 Daniel Glöckner <daniel-gl@gmx.net>
//
// Licensed under GPLv2 or later
//
//========================================================================
#include "JPEG2000Stream.h"
#include "config.h"
JPXStream::JPXStream(Stream *strA) : FilterStream(strA)
{
inited = gFalse;
image = NULL;
dinfo = NULL;
npixels = 0;
ncomps = 0;
}
JPXStream::~JPXStream() {
delete str;
close();
}
void JPXStream::reset() {
counter = 0;
ccounter = 0;
}
void JPXStream::close() {
if (image != NULL) {
opj_image_destroy(image);
image = NULL;
npixels = 0;
}
if (dinfo != NULL) {
opj_destroy_decompress(dinfo);
dinfo = NULL;
}
}
int JPXStream::getPos() {
return counter * ncomps + ccounter;
}
int JPXStream::getChars(int nChars, Guchar *buffer) {
for (int i = 0; i < nChars; ++i) {
const int c = doGetChar();
if (likely(c != EOF)) buffer[i] = c;
else return i;
}
return nChars;
}
int JPXStream::getChar() {
return doGetChar();
}
#define BUFFER_INITIAL_SIZE 4096
void JPXStream::init()
{
Object oLen;
if (getDict()) getDict()->lookup("Length", &oLen);
int bufSize = BUFFER_INITIAL_SIZE;
if (oLen.isInt()) bufSize = oLen.getInt();
oLen.free();
int length = 0;
unsigned char *buf = str->toUnsignedChars(&length, bufSize);
init2(buf, length, CODEC_JP2);
free(buf);
if (image) {
npixels = image->comps[0].w * image->comps[0].h;
ncomps = image->numcomps;
for (int component = 0; component < ncomps; component++) {
if (image->comps[component].data == NULL) {
close();
break;
}
unsigned char *cdata = (unsigned char *)image->comps[component].data;
int adjust = 0;
if (image->comps[component].prec > 8)
adjust = image->comps[component].prec - 8;
int sgndcorr = 0;
if (image->comps[component].sgnd)
sgndcorr = 1 << (image->comps[0].prec - 1);
for (int i = 0; i < npixels; i++) {
int r = image->comps[component].data[i];
r += sgndcorr;
if (adjust) {
r = (r >> adjust)+((r >> (adjust-1))%2);
if (unlikely(r > 255))
r = 255;
}
*(cdata++) = r;
}
}
} else
npixels = 0;
counter = 0;
ccounter = 0;
inited = gTrue;
}
static void libopenjpeg_error_callback(const char *msg, void * /*client_data*/) {
error(errSyntaxError, -1, "{0:s}", msg);
}
static void libopenjpeg_warning_callback(const char *msg, void * /*client_data*/) {
error(errSyntaxWarning, -1, "{0:s}", msg);
}
void JPXStream::init2(unsigned char *buf, int bufLen, OPJ_CODEC_FORMAT format)
{
opj_cio_t *cio = NULL;
/* Use default decompression parameters */
opj_dparameters_t parameters;
opj_set_default_decoder_parameters(¶meters);
#ifdef WITH_OPENJPEG_IGNORE_PCLR_CMAP_CDEF_FLAG
parameters.flags = OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG;
#endif
/* Configure the event manager to receive errors and warnings */
opj_event_mgr_t event_mgr;
memset(&event_mgr, 0, sizeof(opj_event_mgr_t));
event_mgr.error_handler = libopenjpeg_error_callback;
event_mgr.warning_handler = libopenjpeg_warning_callback;
/* Get the decoder handle of the format */
dinfo = opj_create_decompress(format);
if (dinfo == NULL) goto error;
/* Catch events using our callbacks */
opj_set_event_mgr((opj_common_ptr)dinfo, &event_mgr, NULL);
/* Setup the decoder decoding parameters */
opj_setup_decoder(dinfo, ¶meters);
/* Open a byte stream */
cio = opj_cio_open((opj_common_ptr)dinfo, buf, bufLen);
if (cio == NULL) goto error;
/* Decode the stream and fill the image structure */
image = opj_decode(dinfo, cio);
/* Close the byte stream */
opj_cio_close(cio);
if (image == NULL) goto error;
else return;
error:
if (format == CODEC_JP2) {
error(errSyntaxWarning, -1, "Did no succeed opening JPX Stream as JP2, trying as J2K.");
init2(buf, bufLen, CODEC_J2K);
} else if (format == CODEC_J2K) {
error(errSyntaxWarning, -1, "Did no succeed opening JPX Stream as J2K, trying as JPT.");
init2(buf, bufLen, CODEC_JPT);
} else {
error(errSyntaxError, -1, "Did no succeed opening JPX Stream.");
}
}
int JPXStream::lookChar() {
return doLookChar();
}
GooString *JPXStream::getPSFilter(int psLevel, const char *indent) {
return NULL;
}
GBool JPXStream::isBinary(GBool last) {
return str->isBinary(gTrue);
}
void JPXStream::getImageParams(int *bitsPerComponent, StreamColorSpaceMode *csMode) {
if (inited == gFalse) init();
*bitsPerComponent = 8;
if (image && image->numcomps == 3) *csMode = streamCSDeviceRGB;
else *csMode = streamCSDeviceGray;
}
| {
"content_hash": "fd37758f6eca46837fc592ae07d8432b",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 92,
"avg_line_length": 24.535714285714285,
"alnum_prop": 0.6238303181534622,
"repo_name": "zhongzw/skia-sdl",
"id": "e2fd8086b533eefb289ce3faadb19c500b258460",
"size": "4810",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "third_party/externals/poppler/poppler/JPEG2000Stream.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "81892"
},
{
"name": "C",
"bytes": "6328790"
},
{
"name": "C++",
"bytes": "23135795"
},
{
"name": "CSS",
"bytes": "2700"
},
{
"name": "Java",
"bytes": "23451"
},
{
"name": "JavaScript",
"bytes": "27099"
},
{
"name": "Logos",
"bytes": "3432"
},
{
"name": "Makefile",
"bytes": "9796"
},
{
"name": "Objective-C",
"bytes": "278384"
},
{
"name": "Objective-C++",
"bytes": "111018"
},
{
"name": "Perl",
"bytes": "971"
},
{
"name": "Python",
"bytes": "352394"
},
{
"name": "R",
"bytes": "4069"
},
{
"name": "Rebol",
"bytes": "1540"
},
{
"name": "Shell",
"bytes": "323723"
}
],
"symlink_target": ""
} |
module SinatraAdmin
VERSION = "0.1.2"
end
| {
"content_hash": "eebf09d2eb01fad4a38f6138f5dccb41",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 19,
"avg_line_length": 14.666666666666666,
"alnum_prop": 0.7045454545454546,
"repo_name": "Herbalifedev/sinatra-admin",
"id": "d32a1cd5f92377e2ae42ea73bfbae1f32c03e8fa",
"size": "44",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/sinatra-admin/version.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "47296"
},
{
"name": "Cucumber",
"bytes": "18245"
},
{
"name": "HTML",
"bytes": "13707"
},
{
"name": "JavaScript",
"bytes": "520897"
},
{
"name": "Ruby",
"bytes": "49909"
}
],
"symlink_target": ""
} |
@import ObjectiveC;
@implementation JSBAccounts
+ (void)addScriptingSupportToContext:(JSContext *)context
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
class_addProtocol([ACAccount class], @protocol(JSBACAccount));
context[@"ACAccount"] = [ACAccount class];
class_addProtocol([ACAccountCredential class], @protocol(JSBACAccountCredential));
context[@"ACAccountCredential"] = [ACAccountCredential class];
class_addProtocol([ACAccountStore class], @protocol(JSBACAccountStore));
context[@"ACAccountStore"] = [ACAccountStore class];
class_addProtocol([ACAccountType class], @protocol(JSBACAccountType));
context[@"ACAccountType"] = [ACAccountType class];
#pragma clang diagnostic pop
}
@end
| {
"content_hash": "b8625d2a143da47d788f350496403517",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 86,
"avg_line_length": 32.25,
"alnum_prop": 0.7596899224806202,
"repo_name": "Sellegit/JavaScriptBridge",
"id": "40f3920906856b371923bdab27e8901b55e2d96b",
"size": "918",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "Classes/iOS/FrameworkSupport/Accounts/JSBAccounts.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "27636"
},
{
"name": "Objective-C",
"bytes": "1172495"
},
{
"name": "Ruby",
"bytes": "2990"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- Mirrored from bvs.wikidot.com/forum/t-565237/reunite-souls by HTTrack Website Copier/3.x [XR&CO'2014], Sun, 10 Jul 2022 05:44:48 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
<title>Reunite Souls! - Billy Vs. SNAKEMAN Wiki</title>
<script type="text/javascript" src="http://d3g0gp89917ko0.cloudfront.net/v--291054f06006/common--javascript/init.combined.js"></script>
<script type="text/javascript">
var URL_HOST = 'www.wikidot.com';
var URL_DOMAIN = 'wikidot.com';
var USE_SSL = true ;
var URL_STATIC = 'http://d3g0gp89917ko0.cloudfront.net/v--291054f06006';
// global request information
var WIKIREQUEST = {};
WIKIREQUEST.info = {};
WIKIREQUEST.info.domain = "bvs.wikidot.com";
WIKIREQUEST.info.siteId = 32011;
WIKIREQUEST.info.siteUnixName = "bvs";
WIKIREQUEST.info.categoryId = 182512;
WIKIREQUEST.info.themeId = 9564;
WIKIREQUEST.info.requestPageName = "forum:thread";
OZONE.request.timestamp = 1657431458;
OZONE.request.date = new Date();
WIKIREQUEST.info.lang = 'en';
WIKIREQUEST.info.pageUnixName = "forum:thread";
WIKIREQUEST.info.pageId = 2987325;
WIKIREQUEST.info.lang = "en";
OZONE.lang = "en";
var isUAMobile = !!/Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
</script>
<script type="text/javascript">
require.config({
baseUrl: URL_STATIC + '/common--javascript',
paths: {
'jquery.ui': 'jquery-ui.min',
'jquery.form': 'jquery.form'
}
});
</script>
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<link rel="canonical" href="../../mission_reunite-souls.html" />
<meta http-equiv="content-language" content="en"/>
<script type="text/javascript" src="http://d3g0gp89917ko0.cloudfront.net/v--291054f06006/common--javascript/WIKIDOT.combined.js"></script>
<style type="text/css" id="internal-style">
/* modules */
/* theme */
@import url(http://d3g0gp89917ko0.cloudfront.net/v--291054f06006/common--theme/base/css/style.css);
@import url(http://bvs.wdfiles.com/local--theme/north/style.css);
</style>
<link rel="shortcut icon" href="../../local--favicon/favicon.gif"/>
<link rel="icon" type="image/gif" href="../../local--favicon/favicon.gif"/>
<link rel="apple-touch-icon" href="../../common--images/apple-touch-icon-57x57.png" />
<link rel="apple-touch-icon" sizes="72x72" href="../../common--images/apple-touch-icon-72x72.png" />
<link rel="apple-touch-icon" sizes="114x114" href="../../common--images/apple-touch-icon-114x114.png" />
<link rel="alternate" type="application/wiki" title="Edit this page" href="javascript:WIKIDOT.page.listeners.editClick()"/>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-18234656-1']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
_gaq.push(['old._setAccount', 'UA-68540-5']);
_gaq.push(['old._setDomainName', 'none']);
_gaq.push(['old._setAllowLinker', true]);
_gaq.push(['old._trackPageview']);
_gaq.push(['userTracker._setAccount', 'UA-3581307-1']);
_gaq.push(['userTracker._trackPageview']);
</script>
<script type="text/javascript">
window.google_analytics_uacct = 'UA-18234656-1';
window.google_analytics_domain_name = 'none';
</script>
<link rel="manifest" href="../../onesignal/manifest.html" />
<script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" acync=""></script>
<script>
var OneSignal = window.OneSignal || [];
OneSignal.push(function() {
OneSignal.init({
appId: null,
});
});
</script>
<link rel="alternate" type="application/rss+xml" title="Posts in the discussion thread "Reunite Souls!"" href="../../feed/forum/t-565237.xml"/><script type="text/javascript" src="http://d3g0gp89917ko0.cloudfront.net/v--291054f06006/common--modules/js/forum/ForumViewThreadModule.js"></script>
<script type="text/javascript" src="http://d3g0gp89917ko0.cloudfront.net/v--291054f06006/common--modules/js/forum/ForumViewThreadPostsModule.js"></script>
</head>
<body id="html-body">
<div id="skrollr-body">
<a name="page-top"></a>
<div id="container-wrap-wrap">
<div id="container-wrap">
<div id="container">
<div id="header">
<h1><a href="../../index.html"><span>Billy Vs. SNAKEMAN Wiki</span></a></h1>
<h2><span>Be the Ultimate Ninja.</span></h2>
<!-- google_ad_section_start(weight=ignore) -->
<div id="search-top-box" class="form-search">
<form id="search-top-box-form" action="http://bvs.wikidot.com/forum/t-565237/dummy" class="input-append">
<input id="search-top-box-input" class="text empty search-query" type="text" size="15" name="query" value="Search this site" onfocus="if(YAHOO.util.Dom.hasClass(this, 'empty')){YAHOO.util.Dom.removeClass(this,'empty'); this.value='';}"/><input class="button btn" type="submit" name="search" value="Search"/>
</form>
</div>
<div id="top-bar">
<ul>
<li><a href="../../allies.html">Allies</a>
<ul>
<li><strong><a href="../../untabbed_allies.html">Allies Untabbed</a></strong></li>
<li><a href="../../allies.html#toc7">Burger Ninja</a></li>
<li><a href="../../allies.html#toc5">Reaper</a></li>
<li><a href="../../allies.html#toc0">Regular</a></li>
<li><a href="../../allies.html#toc8">R00t</a></li>
<li><a href="../../allies.html#toc1">Season 2+</a></li>
<li><a href="../../allies.html#toc2">Season 3+</a></li>
<li><a href="../../allies.html#toc3">Season 4+</a></li>
<li><a href="../../allies.html#toc4">The Trade</a></li>
<li><a href="../../allies.html#toc6">Wasteland</a></li>
<li><a href="../../allies.html#toc9">World Kaiju</a></li>
<li><strong><a href="../../summons.html">Summons</a></strong></li>
<li><strong><a href="../../teams.html">Teams</a></strong></li>
</ul>
</li>
<li><a href="../../missions.html">Missions</a>
<ul>
<li><strong><a href="../../untabbed_missions.html">Missions Untabbed</a></strong></li>
<li><strong><em><a href="../../missions.html#toc0">D-Rank</a></em></strong></li>
<li><strong><em><a href="../../missions.html#toc1">C-Rank</a></em></strong></li>
<li><strong><em><a href="../../missions.html#toc2">B-Rank</a></em></strong></li>
<li><strong><em><a href="../../missions.html#toc3">A-Rank</a></em></strong></li>
<li><strong><em><a href="../../missions.html#toc4">AA-Rank</a></em></strong></li>
<li><strong><em><a href="../../missions.html#toc5">S-Rank</a></em></strong></li>
<li><a href="../../missions.html#toc10">BurgerNinja</a></li>
<li><a href="../../missions.html#toc14">Cave</a></li>
<li><a href="../../missions.html#toc13">Jungle</a></li>
<li><a href="../../missions.html#toc7">Monochrome</a></li>
<li><a href="../../missions.html#toc8">Outskirts</a></li>
<li><a href="../../missions.html#toc11">PizzaWitch</a></li>
<li><a href="../../missions.html#toc6">Reaper</a></li>
<li><a href="../../missions.html#toc9">Wasteland</a></li>
<li><a href="../../missions.html#toc12">Witching Hour</a></li>
<li><strong><em><a href="../../missions.html#toc14">Quests</a></em></strong></li>
<li><a href="../../wota.html">Mission Lady Alley</a></li>
</ul>
</li>
<li><a href="../../items.html">Items</a>
<ul>
<li><strong><a href="../../untabbed_items.html">Items Untabbed</a></strong></li>
<li><a href="../../items.html#toc6">Ally Drops and Other</a></li>
<li><a href="../../items.html#toc0">Permanent Items</a></li>
<li><a href="../../items.html#toc1">Potions/Crafting Items</a>
<ul>
<li><a href="../../items.html#toc4">Crafting</a></li>
<li><a href="../../items.html#toc3">Ingredients</a></li>
<li><a href="../../items.html#toc2">Potions</a></li>
</ul>
</li>
<li><a href="../../items.html#toc5">Wasteland Items</a></li>
<li><a href="../../sponsored-items.html">Sponsored Items</a></li>
</ul>
</li>
<li><a href="../../village.html">Village</a>
<ul>
<li><a href="../../billycon.html">BillyCon</a>
<ul>
<li><a href="../../billycon_billy-idol.html">Billy Idol</a></li>
<li><a href="../../billycon_cosplay.html">Cosplay</a></li>
<li><a href="../../billycon_dealer-s-room.html">Dealer's Room</a></li>
<li><a href="../../billycon_events.html">Events</a></li>
<li><a href="../../billycon_glowslinging.html">Glowslinging</a></li>
<li><a href="../../billycon_rave.html">Rave</a></li>
<li><a href="../../billycon_squee.html">Squee</a></li>
<li><a href="../../billycon_video-game-tournament.html">Video Game Tournament</a></li>
<li><a href="../../billycon_wander.html">Wander</a></li>
</ul>
</li>
<li><a href="../../billytv.html">BillyTV</a></li>
<li><a href="../../bingo-ing.html">Bingo'ing</a></li>
<li><a href="../../candyween.html">Candyween</a></li>
<li><a href="../../festival.html">Festival Day</a>
<ul>
<li><a href="../../festival_bargltron.html">Bargltron</a></li>
<li><a href="../../festival_billymaze.html">BillyMaze</a></li>
<li><a href="../../festival_dance-party.html">Dance Party</a></li>
<li><a href="../../festival_elevensnax.html">ElevenSnax</a></li>
<li><a href="../../festival_marksman.html">Marksman</a></li>
<li><a href="../../festival_raffle.html">Raffle</a></li>
<li><a href="../../festival_rngshack.html">RNGShack</a></li>
<li><a href="../../festival_tsukiroll.html">TsukiRoll</a></li>
<li><a href="../../festival_tunnel.html">Tunnel</a></li>
</ul>
</li>
<li><a href="../../hidden-hoclaus.html">Hidden HoClaus</a></li>
<li><a href="../../kaiju.html">Kaiju</a></li>
<li><a href="../../marketplace.html">Marketplace</a></li>
<li><a href="../../pizzawitch-garage.html">PizzaWitch Garage</a></li>
<li><a href="../../robo-fighto.html">Robo Fighto</a></li>
<li>R00t
<ul>
<li><a href="../../fields.html">Fields</a></li>
<li><a href="../../keys.html">Keys</a></li>
<li><a href="../../phases.html">Phases</a></li>
</ul>
</li>
<li><a href="../../upgrade_science-facility.html#toc2">SCIENCE!</a></li>
<li><a href="../../upgrades.html">Upgrades</a></li>
<li><a href="../../zombjas.html">Zombjas</a></li>
</ul>
</li>
<li><a href="../../misc_party-house.html">Party House</a>
<ul>
<li><a href="../../partyhouse_11dbhk-s-lottery.html">11DBHK's Lottery</a></li>
<li><a href="../../partyhouse_akatsukiball.html">AkaTsukiBall</a></li>
<li><a href="../../upgrade_claw-machines.html">Crane Game!</a></li>
<li><a href="../../upgrade_darts-hall.html">Darts!</a></li>
<li><a href="../../partyhouse_flower-wars.html">Flower Wars</a></li>
<li><a href="../../upgrade_juice-bar.html">'Juice' Bar</a></li>
<li><a href="../../partyhouse_mahjong.html">Mahjong</a></li>
<li><a href="../../partyhouse_ninja-jackpot.html">Ninja Jackpot!</a></li>
<li><a href="../../partyhouse_over-11-000.html">Over 11,000</a></li>
<li><a href="../../partyhouse_pachinko.html">Pachinko</a></li>
<li><a href="../../partyhouse_party-room.html">Party Room</a></li>
<li><a href="../../partyhouse_pigeons.html">Pigeons</a></li>
<li><a href="../../partyhouse_prize-wheel.html">Prize Wheel</a></li>
<li><a href="../../partyhouse_roulette.html">Roulette</a></li>
<li><a href="../../partyhouse_scratchy-tickets.html">Scratchy Tickets</a></li>
<li><a href="../../partyhouse_snakeman.html">SNAKEMAN</a></li>
<li><a href="../../partyhouse_superfail.html">SUPERFAIL</a></li>
<li><a href="../../partyhouse_tip-line.html">Tip Line</a></li>
<li><a href="../../partyhouse_the-big-board.html">The Big Board</a></li>
<li><a href="../../partyhouse_the-first-loser.html">The First Loser</a></li>
</ul>
</li>
<li><a href="../../guides.html">Guides</a>
<ul>
<li><a href="../../guide_billycon.html">BillyCon Guide</a></li>
<li><a href="../../guide_burgerninja.html">BurgerNinja Guide</a></li>
<li><a href="../../guide_candyween.html">Candyween Guide</a></li>
<li><a href="../../guide_glossary.html">Glossary</a></li>
<li><a href="../../guide_gs.html">Glowslinging Strategy Guide</a></li>
<li><a href="../../guide_hq.html">Hero's Quest</a></li>
<li><a href="../../guide_looping.html">Looping Guide</a></li>
<li><a href="../../guide_monochrome.html">Monochrome Guide</a></li>
<li><a href="../../overnight-bonuses.html">Overnight Bonuses</a></li>
<li><a href="../../guide_pizzawitch.html">PizzaWitch Guide</a></li>
<li><a href="../../tabbed_potions-crafting.html">Potions / Crafting</a>
<ul>
<li><a href="../../tabbed_potions-crafting.html#toc3">Crafting</a>
<ul>
<li><a href="../../tabbed_potions-crafting.html#toc4">Items</a></li>
<li><a href="../../tabbed_potions-crafting.html#toc5">Materials</a></li>
</ul>
</li>
<li><a href="../../tabbed_potions-crafting.html#toc0">Potion Mixing</a>
<ul>
<li><a href="../../tabbed_potions-crafting.html#toc2">Mixed Ingredients</a></li>
<li><a href="../../tabbed_potions-crafting.html#toc1">Potions</a></li>
</ul>
</li>
<li><a href="../../tabbed_potions-crafting.html#toc6">Reduction Laboratory</a>
<ul>
<li><a href="../../tabbed_potions-crafting.html#toc8">Potions and Ingredients</a></li>
<li><a href="../../tabbed_potions-crafting.html#toc7">Wasteland Items</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="../../guide_impossible-mission.html">Impossible Mission Guide</a></li>
<li><a href="../../guide_xp.html">Ranking Guide</a></li>
<li><a href="../../guide_reaper.html">Reaper Guide</a></li>
<li><a href="../../guide_rgg.html">Reaper's Game Guide</a></li>
<li><a href="../../guide_r00t.html">R00t Guide</a></li>
<li><a href="../../guide_speed-content.html">Speed Content Guide</a></li>
<li><a href="../../guide_speedlooping.html">Speedlooping Guide</a></li>
<li><a href="../../guide_thetrade.html">The Trade Guide</a></li>
<li><a href="../../guide_wasteland.html">Wasteland Guide</a></li>
</ul>
</li>
<li>Other
<ul>
<li><a href="../../arena.html">Arena</a></li>
<li><a href="../../billy-club.html">Billy Club</a>
<ul>
<li><a href="../../boosters.html">Boosters</a></li>
<li><a href="../../karma.html">Karma</a></li>
</ul>
</li>
<li><a href="../../bloodline.html">Bloodlines</a></li>
<li><a href="../../jutsu.html">Jutsu</a>
<ul>
<li><a href="../../jutsu.html#toc2">Bloodline Jutsu</a></li>
<li><a href="../../jutsu.html#toc0">Regular Jutsu</a></li>
<li><a href="../../jutsu.html#toc1">Special Jutsu</a></li>
</ul>
</li>
<li><a href="../../mission-bonus.html">Mission Bonus</a></li>
<li><a href="../../news-archive.html">News Archive</a></li>
<li><a href="../../number-one.html">Number One</a></li>
<li><a href="../../old-news-archive.html">Old News Archive</a></li>
<li><a href="../../retail_perfect-poker.html">Perfect Poker Bosses</a></li>
<li><a href="../../pets.html">Pets</a></li>
<li><a href="../../retail.html">Retail</a></li>
<li><a href="../../ryo.html">Ryo</a></li>
<li><a href="../../spar.html">Spar With Friends</a></li>
<li><a href="../../sponsored-items.html">Sponsored Items</a></li>
<li><a href="../../store.html">Store</a></li>
<li><a href="../../themes.html">Themes</a></li>
<li><a href="../../trophies.html">Trophies</a></li>
<li><a href="../../untabbed.html">Untabbed</a>
<ul>
<li><a href="../../untabbed_allies.html">Allies</a></li>
<li><a href="../../untabbed_items.html">Items</a></li>
<li><a href="../../untabbed_jutsu.html">Jutsu</a></li>
<li><a href="../../untabbed_missions.html">Missions</a></li>
<li><a href="../../untabbed_potions-crafting.html">Potions / Crafting</a></li>
</ul>
</li>
<li><a href="../../world-kaiju.html">World Kaiju</a></li>
</ul>
</li>
<li><a href="../../utilities.html">Utilities</a>
<ul>
<li><a href="http://www.cobaltknight.clanteam.com/awesomecalc.html">Awesome Calculator</a></li>
<li><a href="http://timothydryke.byethost17.com/billy/itemchecker.php">Item Checker</a></li>
<li><a href="../../utility_calculator.html">Mission Calculator</a></li>
<li><a href="../../utility_r00t-calculator.html">R00t Calculator</a></li>
<li><a href="../../utility_success-calculator.html">Success Calculator</a></li>
<li><a href="../../templates.html">Templates</a></li>
<li><a href="../../utility_chat.html">Wiki Chat Box</a></li>
</ul>
</li>
</ul>
</div>
<div id="login-status"><a href="javascript:;" onclick="WIKIDOT.page.listeners.createAccount(event)" class="login-status-create-account btn">Create account</a> <span>or</span> <a href="javascript:;" onclick="WIKIDOT.page.listeners.loginClick(event)" class="login-status-sign-in btn btn-primary">Sign in</a> </div>
<div id="header-extra-div-1"><span></span></div><div id="header-extra-div-2"><span></span></div><div id="header-extra-div-3"><span></span></div>
</div>
<div id="content-wrap">
<div id="side-bar">
<h3 ><span><a href="http://www.animecubed.com/billy/?57639" onclick="window.open(this.href, '_blank'); return false;">Play BvS Now!</a></span></h3>
<ul>
<li><a href="../../system_members.html">Site members</a></li>
<li><a href="../../system_join.html">Wiki Membership</a></li>
</ul>
<hr />
<ul>
<li><a href="../../forum_start.html">Forum Main</a></li>
<li><a href="../../forum_recent-posts.html">Recent Posts</a></li>
</ul>
<hr />
<ul>
<li><a href="../../system_recent-changes.html">Recent changes</a></li>
<li><a href="../../system_list-all-pages.html">List all pages</a></li>
<li><a href="../../system_page-tags-list.html">Page Tags</a></li>
</ul>
<hr />
<ul>
<li><a href="../../players.html">Players</a></li>
<li><a href="../../villages.html">Villages</a></li>
<li><a href="../../other-resources.html">Other Resources</a></li>
</ul>
<hr />
<p style="text-align: center;"><span style="font-size:smaller;">Notice: Do not send bug reports based on the information on this site. If this site is not matching up with what you're experiencing in game, that is a problem with this site, not with the game.</span></p>
</div>
<!-- google_ad_section_end -->
<div id="main-content">
<div id="action-area-top"></div>
<div id="page-title"><a href="../../mission_reunite-souls.html">Reunite Souls!</a> / Discussion</h1></div>
<div id="page-content">
<div class="forum-thread-box ">
<div class="forum-breadcrumbs">
<a href="../start.html">Forum</a>
» <a href="../c-30019/per-page-discussions.html">Hidden / Per page discussions</a>
» Reunite Souls!
</div>
<div class="description-block well">
<div class="statistics">
Started by: <span class="printuser">Wikidot</span><br/>
Date: <span class="odate time_1347745206 format_%25e%20%25b%20%25Y%2C%20%25H%3A%25M%7Cagohover">15 Sep 2012 21:40</span><br/>
Number of posts: 0<br/>
<span class="rss-icon"><img src="http://www.wikidot.com/common--theme/base/images/feed/feed-icon-14x14.png" alt="rss icon"/></span>
RSS: <a href="../../feed/forum/t-565237.xml">New posts</a>
</div>
This is the discussion related to the wiki page <a href="../../mission_reunite-souls.html">Reunite Souls!</a>.
</div>
<div class="options">
<a href="javascript:;" onclick="WIKIDOT.modules.ForumViewThreadModule.listeners.unfoldAll(event)" class="btn btn-default btn-small btn-sm">Unfold All</a>
<a href="javascript:;" onclick="WIKIDOT.modules.ForumViewThreadModule.listeners.foldAll(event)" class="btn btn-default btn-small btn-sm">Fold All</a>
<a href="javascript:;" id="thread-toggle-options" onclick="WIKIDOT.modules.ForumViewThreadModule.listeners.toggleThreadOptions(event)" class="btn btn-default btn-small btn-sm"><i class="icon-plus"></i> More Options</a>
</div>
<div id="thread-options-2" class="options" style="display: none">
<a href="javascript:;" onclick="WIKIDOT.modules.ForumViewThreadModule.listeners.editThreadBlock(event)" class="btn btn-default btn-small btn-sm">Lock Thread</a>
<a href="javascript:;" onclick="WIKIDOT.modules.ForumViewThreadModule.listeners.moveThread(event)" class="btn btn-default btn-small btn-sm">Move Thread</a>
</div>
<div id="thread-action-area" class="action-area well" style="display: none"></div>
<div id="thread-container" class="thread-container">
<div id="thread-container-posts" style="display: none">
</div>
</div>
<div class="new-post">
<a href="javascript:;" id="new-post-button" onclick="WIKIDOT.modules.ForumViewThreadModule.listeners.newPost(event,null)" class="btn btn-default">New Post</a>
</div>
<div style="display:none" id="post-options-template">
<a href="javascript:;" onclick="WIKIDOT.modules.ForumViewThreadModule.listeners.showPermalink(event,'%POST_ID%')" class="btn btn-default btn-small btn-sm">Permanent Link</a>
<a href="javascript:;" onclick="WIKIDOT.modules.ForumViewThreadModule.listeners.editPost(event,'%POST_ID%')" class="btn btn-default btn-small btn-sm">Edit</a>
<a href="javascript:;" onclick="WIKIDOT.modules.ForumViewThreadModule.listeners.deletePost(event,'%POST_ID%')"class="btn btn-danger btn-small btn-sm">Delete</a>
</div>
<div style="display:none" id="post-options-permalink-template">/forum/t-565237/reunite-souls#post-</div>
</div>
<script type="text/javascript">
WIKIDOT.forumThreadId = 565237;
</script>
</div>
<div id="page-info-break"></div>
<div id="page-options-container">
</div>
<div id="action-area" style="display: none;"></div>
</div>
</div>
<div id="footer" style="display: block; visibility: visible;">
<div class="options" style="display: block; visibility: visible;">
<a href="http://www.wikidot.com/doc" id="wikidot-help-button">Help</a>
|
<a href="http://www.wikidot.com/legal:terms-of-service" id="wikidot-tos-button">Terms of Service</a>
|
<a href="http://www.wikidot.com/legal:privacy-policy" id="wikidot-privacy-button">Privacy</a>
|
<a href="javascript:;" id="bug-report-button" onclick="WIKIDOT.page.listeners.pageBugReport(event)">Report a bug</a>
|
<a href="javascript:;" id="abuse-report-button" onclick="WIKIDOT.page.listeners.flagPageObjectionable(event)">Flag as objectionable</a>
</div>
Powered by <a href="http://www.wikidot.com/">Wikidot.com</a>
</div>
<div id="license-area" class="license-area">
Unless otherwise stated, the content of this page is licensed under <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 License</a>
</div>
<div id="extrac-div-1"><span></span></div><div id="extrac-div-2"><span></span></div><div id="extrac-div-3"><span></span></div>
</div>
</div>
<!-- These extra divs/spans may be used as catch-alls to add extra imagery. -->
<div id="extra-div-1"><span></span></div><div id="extra-div-2"><span></span></div><div id="extra-div-3"><span></span></div>
<div id="extra-div-4"><span></span></div><div id="extra-div-5"><span></span></div><div id="extra-div-6"><span></span></div>
</div>
</div>
<div id="dummy-ondomready-block" style="display: none;" ></div>
<!-- Google Analytics load -->
<script type="text/javascript">
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!-- Quantcast -->
<script type="text/javascript">
_qoptions={
qacct:"p-edL3gsnUjJzw-"
};
(function() {
var qc = document.createElement('script'); qc.type = 'text/javascript'; qc.async = true;
qc.src = ('https:' == document.location.protocol ? 'https://secure' : 'http://edge') + '.quantserve.com/quant.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(qc, s);
})();
</script>
<noscript>
<img src="http://pixel.quantserve.com/pixel/p-edL3gsnUjJzw-.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/>
</noscript>
<div id="page-options-bottom-tips" style="display: none;">
<div id="edit-button-hovertip">
Click here to edit contents of this page. </div>
</div>
<div id="page-options-bottom-2-tips" style="display: none;">
<div id="edit-sections-button-hovertip">
Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available. </div>
<div id="edit-append-button-hovertip">
Append content without editing the whole page source. </div>
<div id="history-button-hovertip">
Check out how this page has evolved in the past. </div>
<div id="discuss-button-hovertip">
If you want to discuss contents of this page - this is the easiest way to do it. </div>
<div id="files-button-hovertip">
View and manage file attachments for this page. </div>
<div id="site-tools-button-hovertip">
A few useful tools to manage this Site. </div>
<div id="backlinks-button-hovertip">
See pages that link to and include this page. </div>
<div id="rename-move-button-hovertip">
Change the name (also URL address, possibly the category) of the page. </div>
<div id="view-source-button-hovertip">
View wiki source for this page without editing. </div>
<div id="parent-page-button-hovertip">
View/set parent page (used for creating breadcrumbs and structured layout). </div>
<div id="abuse-report-button-hovertip">
Notify administrators if there is objectionable content in this page. </div>
<div id="bug-report-button-hovertip">
Something does not work as expected? Find out what you can do. </div>
<div id="wikidot-help-button-hovertip">
General Wikidot.com documentation and help section. </div>
<div id="wikidot-tos-button-hovertip">
Wikidot.com Terms of Service - what you can, what you should not etc. </div>
<div id="wikidot-privacy-button-hovertip">
Wikidot.com Privacy Policy.
</div>
</div>
</body>
<!-- Mirrored from bvs.wikidot.com/forum/t-565237/reunite-souls by HTTrack Website Copier/3.x [XR&CO'2014], Sun, 10 Jul 2022 05:44:48 GMT -->
</html> | {
"content_hash": "48552b491526efd3652a020025ea536c",
"timestamp": "",
"source": "github",
"line_count": 637,
"max_line_length": 328,
"avg_line_length": 43.97802197802198,
"alnum_prop": 0.5958806311130149,
"repo_name": "tn5421/tn5421.github.io",
"id": "00306e0bcf8bb3410c48246f5a901b517a5e2142",
"size": "28014",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "bvs.wikidot.com/forum/t-565237/reunite-souls.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "400301089"
}
],
"symlink_target": ""
} |
package org.apache.directory.server.core.integ;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import java.io.IOException;
import org.apache.directory.api.ldap.model.entry.Entry;
import org.apache.directory.api.ldap.model.exception.LdapException;
import org.apache.directory.api.ldap.model.exception.LdapNoSuchObjectException;
import org.apache.directory.api.ldap.model.name.Dn;
import org.apache.directory.ldap.client.api.LdapConnection;
import org.apache.directory.ldap.client.api.LdapNetworkConnection;
import org.apache.directory.server.annotations.CreateLdapServer;
import org.apache.directory.server.annotations.CreateTransport;
import org.apache.directory.server.core.annotations.ApplyLdifs;
import org.apache.directory.server.core.annotations.ContextEntry;
import org.apache.directory.server.core.annotations.CreateDS;
import org.apache.directory.server.core.annotations.CreateIndex;
import org.apache.directory.server.core.annotations.CreatePartition;
import org.apache.directory.server.core.api.DirectoryService;
import org.apache.directory.server.ldap.LdapServer;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Tests the CreateLdapServerRule.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
@CreateDS(name = "classDS",
enableChangeLog = true,
partitions =
{
@CreatePartition(
name = "example",
suffix = "dc=example,dc=com",
contextEntry = @ContextEntry(
entryLdif =
"dn: dc=example,dc=com\n" +
"objectClass: domain\n" +
"objectClass: top\n" +
"dc: example\n\n"
),
indexes =
{
@CreateIndex(attribute = "objectClass"),
@CreateIndex(attribute = "dc"),
@CreateIndex(attribute = "ou")
}
)
})
@CreateLdapServer(
transports =
{
@CreateTransport(protocol = "LDAP")
})
@ApplyLdifs(
{
"dn: cn=class,ou=system",
"objectClass: person",
"cn: class",
"sn: sn_class"
})
public class TestCreateLdapServerRule
{
private static Logger LOG = LoggerFactory.getLogger( TestCreateLdapServerRule.class );
@ClassRule
public static CreateLdapServerRule classCreateLdapServerRule = new CreateLdapServerRule();
@Rule
public CreateLdapServerRule createLdapServerRule = new CreateLdapServerRule(
classCreateLdapServerRule );
@Test
@CreateDS(name = "methodDS",
enableChangeLog = true)
@ApplyLdifs(
{
"dn: cn=methodDs,ou=system",
"objectClass: person",
"cn: methodDs",
"sn: sn_methodDs"
})
public void testMethodDs()
{
assertEquals( createLdapServerRule.getLdapServer(), classCreateLdapServerRule.getLdapServer() );
LdapConnection ldapConnection = null;
try
{
LdapServer ldapServer = createLdapServerRule.getLdapServer();
ldapServer.getPort();
ldapConnection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
ldapConnection.connect();
ldapConnection.bind( "uid=admin,ou=system", "secret" );
Dn dn = new Dn( "cn=methodDs,ou=system" );
Entry entry = ldapConnection.lookup( dn );
assertNotNull( entry );
assertEquals( "methodDs", entry.get( "cn" ).get().getValue() );
try
{
dn = new Dn( "cn=class,ou=system" );
entry = ldapConnection.lookup( dn );
assertNull( entry );
}
catch ( LdapNoSuchObjectException e )
{
// expected
}
}
catch ( LdapException e )
{
fail( e.getMessage() );
}
finally
{
if ( ldapConnection != null )
{
try
{
ldapConnection.close();
}
catch ( IOException e )
{
// who cares!
}
}
}
}
@Test
@CreateLdapServer(
transports =
{
@CreateTransport(protocol = "LDAP")
})
public void testMethodLdapServer()
{
assertNotEquals( createLdapServerRule.getLdapServer(), classCreateLdapServerRule.getLdapServer() );
assertNotEquals( createLdapServerRule.getLdapServer().getPort(),
classCreateLdapServerRule.getLdapServer().getPort() );
LdapConnection ldapConnection = null;
try
{
LdapServer ldapServer = createLdapServerRule.getLdapServer();
ldapServer.getPort();
ldapConnection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
ldapConnection.connect();
ldapConnection.bind( "uid=admin,ou=system", "secret" );
Dn dn = new Dn( "cn=class,ou=system" );
Entry entry = ldapConnection.lookup( dn );
assertNotNull( entry );
assertEquals( "class", entry.get( "cn" ).get().getValue() );
}
catch ( LdapException e )
{
fail( e.getMessage() );
}
finally
{
if ( ldapConnection != null )
{
try
{
ldapConnection.close();
}
catch ( IOException e )
{
// who cares!
}
}
}
}
@Test
public void testNetworkConnection()
{
assertEquals( classCreateLdapServerRule.getDirectoryService(), createLdapServerRule.getDirectoryService() );
assertEquals( classCreateLdapServerRule.getLdapServer(), createLdapServerRule.getLdapServer() );
LdapServer ldapServer = createLdapServerRule.getLdapServer();
DirectoryService directoryService = ldapServer.getDirectoryService();
assertEquals( classCreateLdapServerRule.getDirectoryService(), directoryService );
LdapConnection ldapConnection = null;
try
{
Dn dn = new Dn( "cn=class,ou=system" );
Entry entry = directoryService.getAdminSession().lookup( dn );
assertNotNull( entry );
assertEquals( "class", entry.get( "cn" ).get().getValue() );
LOG.debug( "getting network connection" );
ldapServer.getPort();
ldapConnection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
ldapConnection.connect();
ldapConnection.bind( "uid=admin,ou=system", "secret" );
entry = ldapConnection.lookup( dn );
assertNotNull( entry );
assertEquals( "class", entry.get( "cn" ).get().getValue() );
}
catch ( LdapException e )
{
fail( e.getMessage() );
}
finally
{
if ( ldapConnection != null )
{
try
{
ldapConnection.close();
}
catch ( IOException e )
{
// who cares!
}
}
}
}
}
| {
"content_hash": "ce9f93b3fb090fc9c8140f2f1b894a1d",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 116,
"avg_line_length": 33.57983193277311,
"alnum_prop": 0.5462962962962963,
"repo_name": "darranl/directory-server",
"id": "c233ec13583b5f04f509a03caa5a374bfaf8dde4",
"size": "8815",
"binary": false,
"copies": "1",
"ref": "refs/heads/trunk",
"path": "test-framework/src/test/java/org/apache/directory/server/core/integ/TestCreateLdapServerRule.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "12976172"
},
{
"name": "Shell",
"bytes": "42215"
}
],
"symlink_target": ""
} |
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace TextAddin.Highlighting.Xshd
{
/// <summary>
/// An element in a XSHD rule set.
/// </summary>
[Serializable]
public abstract class XshdElement
{
/// <summary>
/// Gets the line number in the .xshd file.
/// </summary>
public int LineNumber { get; set; }
/// <summary>
/// Gets the column number in the .xshd file.
/// </summary>
public int ColumnNumber { get; set; }
/// <summary>
/// Applies the visitor to this element.
/// </summary>
public abstract object AcceptVisitor(IXshdVisitor visitor);
}
}
| {
"content_hash": "f13e84aba73c33c208ac72d4730b30c9",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 103,
"avg_line_length": 26.103448275862068,
"alnum_prop": 0.6750330250990753,
"repo_name": "FloodProject/flood",
"id": "b853dea3811b243d3f0dd925a0fd39a8cff1f3d0",
"size": "759",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Editor/Addins/TextAddin/Highlighting/Xshd/XshdElement.cs",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Batchfile",
"bytes": "966"
},
{
"name": "C",
"bytes": "18064"
},
{
"name": "C#",
"bytes": "1918184"
},
{
"name": "C++",
"bytes": "2321379"
},
{
"name": "GLSL",
"bytes": "8502"
},
{
"name": "Lua",
"bytes": "29282"
},
{
"name": "Objective-C",
"bytes": "3351"
}
],
"symlink_target": ""
} |
#ifndef TEXT_INTERPRETER_H_
#define TEXT_INTERPRETER_H_
#include <string>
#include <fstream>
#include "file_interpreter.h"
namespace vv {
using namespace std;
/**
* Interprets a file as a text file for an HTTP response.
*/
class TextInterpreter : public vv::FileInterpreter {
public:
/**
* Creates a text file interpreter with a file path and a mime type string.
* @param path the path of the file to open
* @param mime the mime type string
*/
explicit TextInterpreter(const string& path, const string& mime="text/plain");
/**
* Returns the string read from the text file.
* @return the string read from the text file
*/
string interpret();
};
}
#endif
| {
"content_hash": "e8e4b6c19d78d1817996a8af5f226e78",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 80,
"avg_line_length": 21.21212121212121,
"alnum_prop": 0.6857142857142857,
"repo_name": "ryanashcraft/vroom-vroom",
"id": "be2826198f1787312ab717e81d72ea6638088e77",
"size": "700",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "include/text_interpreter.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1630"
},
{
"name": "C++",
"bytes": "38797"
},
{
"name": "JavaScript",
"bytes": "49458"
}
],
"symlink_target": ""
} |
"""Utilities for manipulating, storing, and loading experiment data."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import enum
import io
import threading
from absl import logging
import numpy as np
import six
from six.moves import range
import tensorflow.compat.v2 as tf
gfile = tf.io.gfile
_TFR_OPTIONS = tf.io.TFRecordOptions('GZIP')
SLICE = enum.Enum('SliceKey', ['ALL'])
def write_npz(output_dir, basename, stats_dict):
"""Write a dictionary of numpy arrays as an npz file.
Args:
output_dir: Directory for the output file.
basename: Basename for output file path.
stats_dict: Dictionary of strings to np.ndarrays.
"""
bytesio = io.BytesIO()
stats_dict = {
k: np.stack(arr) if isinstance(arr, list) else arr
for k, arr in six.iteritems(stats_dict)
}
np.savez_compressed(bytesio, **stats_dict)
path = '%s/%s' % (output_dir, basename)
logging.info('Recording stats to %s', path)
with gfile.GFile(path, 'wb') as file_handle:
file_handle.write(bytesio.getvalue())
def _dict_as_namedtuple(d):
return collections.namedtuple('tup', list(d.keys()))(**d)
def load_npz(path, as_namedtuple=False):
"""Load dictionary of arrays from an npz file.
Args:
path: File path to npz file.
as_namedtuple: If true, return the dictionary as a namedtuple.
Returns:
Dictionary (or namedtuple) of npz file contents.
"""
with gfile.GFile(path) as fl:
bytesio = io.BytesIO(fl.read())
out = dict(np.load(bytesio))
return _dict_as_namedtuple(out) if as_namedtuple else out
def stats_dict_to_tfexample(stats):
"""Converts a dictionary of numpy arrays to a tf.Example proto."""
example = tf.train.Example()
fm = example.features.feature
for key, arr in six.iteritems(stats):
arr = np.array(arr)
if key.endswith('/shape'):
raise ValueError('Invalid key: %s' % key)
if arr.dtype in (np.float32, np.float64):
fm[key].float_list.value.extend(arr.reshape([-1]))
fm[key + '/shape'].int64_list.value.extend(arr.shape)
elif arr.dtype in (np.int32, np.int64):
fm[key].int64_list.value.extend(arr.reshape([-1]))
fm[key + '/shape'].int64_list.value.extend(arr.shape)
else:
raise NotImplementedError('Unsupported array type %s for key=%s'
% (type(arr), key))
return example
def tfexample_to_stats_dict(example):
"""Converts a tf.Example proto into a dictionary of numpy arrays."""
out = {}
fm = example.features.feature
for key, value in six.iteritems(fm):
if key.endswith('/shape'):
continue
arr = (value.int64_list.value or
value.float_list.value or
value.bytes_list.value)
shape = fm[key + '/shape'].int64_list.value
out[key] = np.array(arr).reshape(shape)
return out
def load_stats_from_tfrecords(path, max_records=None, as_namedtuple=False,
gzip=False):
"""Loads data from a TFRecord table into a dictionary of np arrays.
Args:
path: Path to TFRecord file.
max_records: Maximum number of records to read.
as_namedtuple: If true, return the stats-dictionary as a namedtuple.
gzip: Whether to use gzip compression.
Returns:
Dictionary (or namedtuple) of numpy arrays.
"""
out = collections.defaultdict(list)
if tf.executing_eagerly():
itr = tf.data.TFRecordDataset(
path, compression_type='GZIP' if gzip else None)
parse_record = lambda x: tf.train.Example.FromString(x.numpy())
else:
tfr_options = _TFR_OPTIONS if gzip else None
itr = tf.compat.v1.python_io.tf_record_iterator(path, tfr_options)
parse_record = tf.train.Example.FromString
for i, rec in enumerate(itr):
if max_records and i >= max_records:
break
example = parse_record(rec)
stats = tfexample_to_stats_dict(example)
for key, array in six.iteritems(stats):
out[key].append(array)
out = {k: np.stack(arr) for k, arr in six.iteritems(out)}
return _dict_as_namedtuple(out) if as_namedtuple else out
class StatsWriter(object):
"""Simple wrapper class to record stats-dictionaries in TFRecord tables."""
def __init__(self, path, gzip=False):
self._writer = tf.io.TFRecordWriter(path, _TFR_OPTIONS if gzip else None)
def write(self, stats):
tfexample = stats_dict_to_tfexample(stats)
self._writer.write(tfexample.SerializeToString())
def write_batch(self, stats_batch):
batch_size, = set(len(x) for x in six.itervalues(stats_batch))
for i in range(batch_size):
stats_i = {k: v[i] for k, v in six.iteritems(stats_batch)}
tfexample = stats_dict_to_tfexample(stats_i)
self._writer.write(tfexample.SerializeToString())
def __del__(self):
self._writer.flush()
self._writer.close()
def slice_structure(struct, keys):
"""Generalized (but limited) slice function on nested structures.
This function offers limited numpy-style array slicing on nested structures
of maps, lists, tuples, and arrays. Specifically, by assuming similar
structures along each dictionary / list / tuple value, we can support
select-all and index-list slicing (e.g. x[3, :, 1] or x[3, indices, 1]).
For example,
x = {'a': [1, 2], 'b': [3, 4], 'c': [5, 6]}
slice_structure(x, [SLICE.ALL, 0])
will yield `{'a': 1, 'b': 3, 'c': 5}`
and
slice_structure(x, [['a', 'c', 'b'], 0])
yields `[1, 5, 3]`.
Args:
struct: Nested structure of dictionaries, lists, tuples, numpy arrays.
keys: List of keys to apply at each successive depth;
SLICE.ALL gathers all items.
Returns:
Nested structure with specified slices applied.
Note: Structure elments are not necessarily copied in the process.
"""
if not keys:
return struct
if keys[0] is SLICE.ALL:
if isinstance(struct, dict):
return {k: slice_structure(v, keys[1:]) for k, v in struct.items()}
elif isinstance(struct, (list, tuple)):
return type(struct)([slice_structure(struct_i, keys[1:])
for struct_i in struct])
else:
raise NotImplementedError('Unsupported type for ALL: %s.' % type(struct))
# List-of-indices slicing.
elif isinstance(keys[0], list):
return [slice_structure(struct[k], keys[1:]) for k in keys[0]]
# Simple get-element-at-index case.
else:
return slice_structure(struct[keys[0]], keys[1:])
class _MapResult(object):
"""Simple temporary container for threaded_map_structure() results.
Note: We can't use a simple Python list (or other builtin mutable container)
for this since tf.nest.map_structure will traverse the list and operate on
its elements.
Attributes:
result: Equals None before calling the map-function;
assigned to the function output afterwards.
"""
def __init__(self):
self.result = None
def assign(self, x):
"""Assigns a value to a container attribute for later retrieval."""
self.result = x
def threaded_map_structure(fn, *args):
"""Executes tf.nest.map_structure with parallel threads for each map call.
Primarily useful for slow, non-compute functions (e.g. loading data from CNS).
See tf.nest.map_structure for details.
Args:
fn: Function to map across leaf nodes in args structure.
*args: Nested structures of arguments to map over.
Returns:
Parallel structure to the one in args with map results.
"""
fn_nooutput = lambda result, *args_: result.assign(fn(*args_))
def make_thread_fn(result, *args_):
return threading.Thread(target=fn_nooutput, args=(result,) + args_)
outputs = tf.nest.map_structure(lambda *_: _MapResult(), *args)
threads = tf.nest.map_structure(make_thread_fn, outputs, *args)
tf.nest.map_structure(lambda t: t.start(), threads)
tf.nest.map_structure(lambda t: t.join(), threads)
return tf.nest.map_structure(lambda x: x.result, outputs)
| {
"content_hash": "56e009f64792415b465b89acfcf036df",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 80,
"avg_line_length": 33.42796610169491,
"alnum_prop": 0.6760045633160097,
"repo_name": "google-research/google-research",
"id": "6d41a6f0a4918b19fdd0ba749e3801a83beea8f3",
"size": "8497",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "uq_benchmark_2019/array_utils.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "9817"
},
{
"name": "C++",
"bytes": "4166670"
},
{
"name": "CMake",
"bytes": "6412"
},
{
"name": "CSS",
"bytes": "27092"
},
{
"name": "Cuda",
"bytes": "1431"
},
{
"name": "Dockerfile",
"bytes": "7145"
},
{
"name": "Gnuplot",
"bytes": "11125"
},
{
"name": "HTML",
"bytes": "77599"
},
{
"name": "ImageJ Macro",
"bytes": "50488"
},
{
"name": "Java",
"bytes": "487585"
},
{
"name": "JavaScript",
"bytes": "896512"
},
{
"name": "Julia",
"bytes": "67986"
},
{
"name": "Jupyter Notebook",
"bytes": "71290299"
},
{
"name": "Lua",
"bytes": "29905"
},
{
"name": "MATLAB",
"bytes": "103813"
},
{
"name": "Makefile",
"bytes": "5636"
},
{
"name": "NASL",
"bytes": "63883"
},
{
"name": "Perl",
"bytes": "8590"
},
{
"name": "Python",
"bytes": "53790200"
},
{
"name": "R",
"bytes": "101058"
},
{
"name": "Roff",
"bytes": "1208"
},
{
"name": "Rust",
"bytes": "2389"
},
{
"name": "Shell",
"bytes": "730444"
},
{
"name": "Smarty",
"bytes": "5966"
},
{
"name": "Starlark",
"bytes": "245038"
}
],
"symlink_target": ""
} |
/**
*/
package br.com.levysiqueira.textualusecase.provider;
import br.com.levysiqueira.textualusecase.Condition;
import br.com.levysiqueira.textualusecase.TextualUseCasePackage;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link br.com.levysiqueira.textualusecase.Condition} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class ConditionItemProvider
extends ItemProviderAdapter
implements
IEditingDomainItemProvider,
IStructuredItemContentProvider,
ITreeItemContentProvider,
IItemLabelProvider,
IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ConditionItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addExpressionPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Expression feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addExpressionPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Condition_expression_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Condition_expression_feature", "_UI_Condition_type"),
TextualUseCasePackage.Literals.CONDITION__EXPRESSION,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This returns Condition.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/Condition"));
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
String label = ((Condition)object).getExpression();
return label == null || label.length() == 0 ?
getString("_UI_Condition_type") :
getString("_UI_Condition_type") + " " + label;
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(Condition.class)) {
case TextualUseCasePackage.CONDITION__EXPRESSION:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ResourceLocator getResourceLocator() {
return TextualUseCaseEditPlugin.INSTANCE;
}
}
| {
"content_hash": "429d3c3cd2049bcc1947772e371c75c2",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 111,
"avg_line_length": 29.531645569620252,
"alnum_prop": 0.7299614230604372,
"repo_name": "levysiqueira/textual_use_case",
"id": "f98e91c432f1acffc21fc9399b4714e18f604d92",
"size": "4666",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "br.com.levysiqueira.textualusecase.edit/src/br/com/levysiqueira/textualusecase/provider/ConditionItemProvider.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "GAP",
"bytes": "102470"
},
{
"name": "Java",
"bytes": "1467067"
},
{
"name": "Xtend",
"bytes": "7287"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>javafx-examples</artifactId>
<name>Emcee - JavaFX Examples</name>
<parent>
<groupId>de.sl.emcee</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<properties>
<versions.java>1.8</versions.java>
</properties>
<dependencies>
<dependency>
<groupId>de.sl.emcee</groupId>
<artifactId>javafx</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project> | {
"content_hash": "c6663787f26d0ddeb474ab116540c360",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 108,
"avg_line_length": 30.178571428571427,
"alnum_prop": 0.6165680473372781,
"repo_name": "GilraenBurland/Emcee",
"id": "68e94ca735f63ec5a102dff1dbf172dbd5bf6e92",
"size": "845",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "javafx-examples/pom.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "5615"
}
],
"symlink_target": ""
} |
namespace first_run {
namespace internal {
bool IsOrganicFirstRun() {
// We treat all installs as organic.
return true;
}
// TODO(port): This is just a piece of the silent import functionality from
// ImportSettings for Windows. It would be nice to get the rest of it ported.
bool ImportBookmarks(const base::FilePath& import_bookmarks_path) {
const CommandLine& cmdline = *CommandLine::ForCurrentProcess();
CommandLine import_cmd(cmdline.GetProgram());
// Propagate user data directory switch.
if (cmdline.HasSwitch(switches::kUserDataDir)) {
import_cmd.AppendSwitchPath(switches::kUserDataDir,
cmdline.GetSwitchValuePath(switches::kUserDataDir));
}
// Since ImportSettings is called before the local state is stored on disk
// we pass the language as an argument. GetApplicationLocale checks the
// current command line as fallback.
import_cmd.AppendSwitchASCII(switches::kLang,
g_browser_process->GetApplicationLocale());
import_cmd.CommandLine::AppendSwitchPath(switches::kImportFromFile,
import_bookmarks_path);
// The importer doesn't need to do any background networking tasks so disable
// them.
import_cmd.CommandLine::AppendSwitch(switches::kDisableBackgroundNetworking);
// Time to launch the process that is going to do the import. We'll wait
// for the process to return.
base::LaunchOptions options;
options.wait = true;
return base::LaunchProcess(import_cmd, options, NULL);
}
base::FilePath MasterPrefsPath() {
// The standard location of the master prefs is next to the chrome binary.
base::FilePath master_prefs;
if (!PathService::Get(base::DIR_EXE, &master_prefs))
return base::FilePath();
return master_prefs.AppendASCII(installer::kDefaultMasterPrefs);
}
} // namespace internal
} // namespace first_run
| {
"content_hash": "2cda22647e79fe997982ced4dfd6588c",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 79,
"avg_line_length": 38.244897959183675,
"alnum_prop": 0.7225186766275347,
"repo_name": "plxaye/chromium",
"id": "01ce84d14844654a8c313d520777748bcb6cdcf2",
"size": "2876",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/chrome/browser/first_run/first_run_linux.cc",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "853"
},
{
"name": "AppleScript",
"bytes": "6973"
},
{
"name": "Arduino",
"bytes": "464"
},
{
"name": "Assembly",
"bytes": "1176633"
},
{
"name": "Awk",
"bytes": "9519"
},
{
"name": "C",
"bytes": "75195981"
},
{
"name": "C#",
"bytes": "36335"
},
{
"name": "C++",
"bytes": "172360762"
},
{
"name": "CSS",
"bytes": "740648"
},
{
"name": "Dart",
"bytes": "12620"
},
{
"name": "Emacs Lisp",
"bytes": "12454"
},
{
"name": "F#",
"bytes": "381"
},
{
"name": "Java",
"bytes": "3671513"
},
{
"name": "JavaScript",
"bytes": "16204541"
},
{
"name": "Max",
"bytes": "39069"
},
{
"name": "Mercury",
"bytes": "10299"
},
{
"name": "Objective-C",
"bytes": "1133728"
},
{
"name": "Objective-C++",
"bytes": "5771619"
},
{
"name": "PHP",
"bytes": "97817"
},
{
"name": "Perl",
"bytes": "166372"
},
{
"name": "Python",
"bytes": "11650532"
},
{
"name": "Ragel in Ruby Host",
"bytes": "3641"
},
{
"name": "Rebol",
"bytes": "262"
},
{
"name": "Ruby",
"bytes": "14575"
},
{
"name": "Shell",
"bytes": "1426780"
},
{
"name": "Tcl",
"bytes": "277077"
},
{
"name": "TeX",
"bytes": "43554"
},
{
"name": "VimL",
"bytes": "4953"
},
{
"name": "XSLT",
"bytes": "13493"
},
{
"name": "nesC",
"bytes": "14650"
}
],
"symlink_target": ""
} |
"use strict";$(function(){var t=$(".output");t.scrollTop(t[0].scrollHeight-t.height())});
//# sourceMappingURL=../.map/admin/console.js.map
| {
"content_hash": "6ffce26cbbd9b60c97a2f4a5a1143d7f",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 89,
"avg_line_length": 70,
"alnum_prop": 0.6714285714285714,
"repo_name": "Hiroto-K/HkApps",
"id": "c54e1add05415ab719b697ba38ff53325f8f7e9f",
"size": "140",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/assets/js/admin/console.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1248"
},
{
"name": "CSS",
"bytes": "5049"
},
{
"name": "CoffeeScript",
"bytes": "5248"
},
{
"name": "HTML",
"bytes": "47660"
},
{
"name": "JavaScript",
"bytes": "3203"
},
{
"name": "PHP",
"bytes": "323351"
},
{
"name": "Shell",
"bytes": "170"
}
],
"symlink_target": ""
} |
package com.senseidb.gateway.kafka;
import java.text.DecimalFormat;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import kafka.consumer.Consumer;
import kafka.consumer.ConsumerConfig;
import kafka.consumer.ConsumerIterator;
import kafka.consumer.KafkaStream;
import kafka.javaapi.consumer.ConsumerConnector;
import org.apache.log4j.Logger;
import org.json.JSONObject;
import proj.zoie.api.DataConsumer.DataEvent;
import proj.zoie.impl.indexing.StreamDataProvider;
import proj.zoie.impl.indexing.ZoieConfig;
import com.senseidb.indexing.DataSourceFilter;
public class KafkaStreamDataProvider extends StreamDataProvider<JSONObject> {
private static Logger logger = Logger.getLogger(KafkaStreamDataProvider.class);
private final Set<String> _topics;
private Properties _kafkaConfig;
protected ConsumerConnector _consumerConnector;
private Iterator<byte[]> _consumerIterator;
private final ThreadLocal<DecimalFormat> formatter = new ThreadLocal<DecimalFormat>() {
@Override
protected DecimalFormat initialValue() {
return new DecimalFormat("00000000000000000000");
}
};
private ExecutorService _executorService;
private volatile boolean _started = false;
private DataSourceFilter<DataPacket> _dataConverter;
public KafkaStreamDataProvider() {
super(ZoieConfig.DEFAULT_VERSION_COMPARATOR);
_topics = new HashSet<String>();
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public KafkaStreamDataProvider(Comparator<String> versionComparator, Map<String, String> config,
DataSourceFilter<DataPacket> dataFilter) {
super(versionComparator);
int batchSize = config.get("provider.batchSize") != null ? Integer.parseInt(config
.get("provider.batchSize")) : 500;
super.setBatchSize(batchSize);
String topic = config.get("kafka.topic");
_topics = new HashSet<String>();
for (String raw : topic.split("[, ;]+")) {
String t = raw.trim();
if (t.length() != 0) {
_topics.add(t);
}
}
Properties props = new Properties();
for (String key : config.keySet()) {
if (key.equalsIgnoreCase("kafka.topic")) {
continue;
}
if (key.startsWith("kafka.")) {
props.put(key.substring("kafka.".length()), config.get(key));
}
}
_kafkaConfig = props;
if (dataFilter == null) {
String type = config.get("kafka.msg.type");
if (type == null) {
type = "json";
}
if ("json".equals(type)) {
dataFilter = new DefaultJsonDataSourceFilter();
} else if ("avro".equals(type)) {
try {
String msgClsString = config.get("kafka.msg.avro.class");
String dataMapperClassString = config.get("kafka.msg.avro.datamapper");
Class<?> cls = Class.forName(msgClsString);
Class<?> dataMapperClass = Class.forName(dataMapperClassString);
DataSourceFilter dataMapper = (DataSourceFilter) dataMapperClass.newInstance();
dataFilter = new AvroDataSourceFilter(cls, dataMapper);
} catch (Exception e) {
throw new IllegalArgumentException("Unable to construct avro data filter", e);
}
} else {
throw new IllegalArgumentException("Invalid msg type: " + type);
}
}
_dataConverter = dataFilter;
}
public void commit() {
_consumerConnector.commitOffsets();
}
@Override
public void setStartingOffset(String version) {
}
@Override
public DataEvent<JSONObject> next() {
if (!_started) {
return null;
}
try {
if (!_consumerIterator.hasNext()) {
return null;
}
} catch (Exception e) {
// Most likely timeout exception - ok to ignore
return null;
}
byte[] msg = _consumerIterator.next();
long version = getNextVersion();
JSONObject data;
try {
data = _dataConverter.filter(new DataPacket(msg, 0, msg.length));
if (logger.isDebugEnabled()) {
logger.debug("message converted: " + data);
}
return new DataEvent<JSONObject>(data, getStringVersionRepresentation(version));
} catch (Exception e) {
logger.error(e.getMessage(), e);
return null;
}
}
public long getNextVersion() {
return System.currentTimeMillis();
}
public String getStringVersionRepresentation(long version) {
return formatter.get().format(version);
}
@Override
public void reset() {
}
@Override
public void start() {
logger.info("Kafka properties: " + _kafkaConfig);
ConsumerConfig consumerConfig = new ConsumerConfig(_kafkaConfig);
_consumerConnector = Consumer.createJavaConsumerConnector(consumerConfig);
Map<String, Integer> topicCountMap = new HashMap<String, Integer>();
for (String topic : _topics) {
topicCountMap.put(topic, 1);
}
Map<String, List<KafkaStream<byte[], byte[]>>> topicMessageStreams = _consumerConnector
.createMessageStreams(topicCountMap);
final ArrayBlockingQueue<byte[]> queue = new ArrayBlockingQueue<byte[]>(8, true);
int streamCount = 0;
for (List<KafkaStream<byte[], byte[]>> streams : topicMessageStreams.values()) {
streamCount += streams.size();
}
_executorService = Executors.newFixedThreadPool(streamCount);
for (List<KafkaStream<byte[], byte[]>> streams : topicMessageStreams.values()) {
for (KafkaStream<byte[], byte[]> stream : streams) {
final KafkaStream<byte[], byte[]> messageStream = stream;
_executorService.execute(new Runnable() {
@Override
public void run() {
logger.info("Kafka consumer thread started: " + Thread.currentThread().getId());
try {
ConsumerIterator<byte[], byte[]> it = messageStream.iterator();
while (it.hasNext()) {
queue.put(it.next().message());
}
} catch (Exception e) {
// normally it should the stop interupt exception.
logger.error(e.getMessage(), e);
}
logger.info("Kafka consumer thread ended: " + Thread.currentThread().getId());
}
});
}
}
_consumerIterator = new Iterator<byte[]>() {
private byte[] message = null;
@Override
public boolean hasNext() {
if (message != null) {
return true;
}
try {
message = queue.poll(1, TimeUnit.SECONDS);
} catch (InterruptedException ie) {
return false;
}
if (message != null) {
return true;
} else {
return false;
}
}
@Override
public byte[] next() {
if (hasNext()) {
byte[] res = message;
message = null;
return res;
} else {
throw new NoSuchElementException();
}
}
@Override
public void remove() {
throw new UnsupportedOperationException("not supported");
}
};
super.start();
_started = true;
}
@Override
public void stop() {
_started = false;
try {
if (_executorService != null) {
_executorService.shutdown();
}
} finally {
try {
if (_consumerConnector != null) {
_consumerConnector.shutdown();
}
} finally {
super.stop();
}
}
}
}
| {
"content_hash": "b2808ab625ad43ef54f35e37587e46b6",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 98,
"avg_line_length": 28.973684210526315,
"alnum_prop": 0.6350071363695342,
"repo_name": "senseidb/sensei",
"id": "15d9267af3bfb951102bd6301537879104af0d30",
"size": "7707",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sensei-gateways/src/main/java/com/senseidb/gateway/kafka/KafkaStreamDataProvider.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "36434"
},
{
"name": "CSS",
"bytes": "27692"
},
{
"name": "Java",
"bytes": "1840774"
},
{
"name": "JavaScript",
"bytes": "545266"
},
{
"name": "Python",
"bytes": "218444"
},
{
"name": "Shell",
"bytes": "6666"
},
{
"name": "Tcl",
"bytes": "34306"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<!--电子产品维修商品详情页-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#DCDCDC">
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:background="#7ae3f9">
<TextView
android:layout_width="30dp"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/toolbarback"
android:background="#7ae3f9"
android:id="@+id/mainrenanceItemDetailsBack"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="详情"
android:textSize="20sp"
android:textColor="#000"/>
</android.support.v7.widget.Toolbar>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="12.3"
android:layout_marginTop="1dp"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2.5"
android:background="#FFFF"
android:src="@drawable/wechatimage20170906190125"
android:id="@+id/mainrenanceItemDetailsPhoto"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.5"
android:layout_marginTop="1dp"
android:background="#FFFF"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.5"
android:layout_marginTop="1dp"
android:background="#FFFF"
android:text="asdfghj,msdfghjkkcvbnhj"
android:textSize="18sp"
android:id="@+id/mainrenanceItemDetailsDecription" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@null"
android:layout_gravity="end|bottom"
android:background="@drawable/electronicmainrenance_itemdetailscollect"
android:id="@+id/mainrenanceItemDetailsCollect"/>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginTop="1dp"
android:background="#FFFF"
android:gravity=""
android:text="价格:xx元"
android:textSize="16sp"
android:id="@+id/mainrenanceItemDetailsPrice"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginTop="1dp"
android:background="#FFFF"
android:gravity=""
android:text="联系电话:xxxxxxxxxxxxxxx"
android:textSize="16sp"
android:id="@+id/mainrenanceItemDetailsPhone"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.7"
android:orientation="horizontal"
android:layout_marginTop="1dp">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/detailschat"
android:id="@+id/mainrenanceItemDetailsChat"/>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginLeft="1dp"
android:background="@drawable/detailsshoppingcar"
android:id="@+id/mainrenanceItemDetailsShopCar"/>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:layout_marginLeft="1dp"
android:background="#FFFF"
android:gravity="center"
android:text="加入购物车"
android:textColor="#000000"
android:textSize="16sp"
android:id="@+id/mainrenanceItemDetailsAddShopCar"/>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:layout_marginLeft="1dp"
android:background="#FF5151"
android:gravity="center"
android:text="立即购买"
android:textColor="#000000"
android:textSize="16sp"
android:id="@+id/mainrenanceItemDetailsBuy"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
| {
"content_hash": "ba4b11d0a4099c81c34fa6daa6ce5d05",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 87,
"avg_line_length": 41.53846153846154,
"alnum_prop": 0.5657407407407408,
"repo_name": "cartoonYu/J.G.P",
"id": "2f900208744537dfff65006e256eb367ebaad82b",
"size": "5462",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/layout/electronicsmainrenance_itemdetails.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "6637"
},
{
"name": "HTML",
"bytes": "1293"
},
{
"name": "Java",
"bytes": "275077"
},
{
"name": "JavaScript",
"bytes": "590"
}
],
"symlink_target": ""
} |
'use strict';
namespace BenchmarkerNinja {
function getCanvasElement(): HTMLCanvasElement {
return <HTMLCanvasElement>document.getElementById("myChart");
}
var lineChart = new Chart(getCanvasElement().getContext("2d"))
.Line({
labels: [],
datasets: [
{
label: "Mod",
fillColor: Util.colorNameToRgba('blue', .2),
strokeColor: Util.colorNameToRgba('blue', .4),
pointColor: Util.colorNameToRgba('blue', .6),
pointStrokeColor: "#fff",
pointHighlightFill: "#fff",
pointHighlightStroke: "rgba(220,220,220,1)",
data: []
},
{
label: "substring",
fillColor: Util.colorNameToRgba('green', .2),
strokeColor: Util.colorNameToRgba('green', .4),
pointColor: Util.colorNameToRgba('green', .6),
pointStrokeColor: "#fff",
pointHighlightFill: "#fff",
pointHighlightStroke: "rgba(220,220,220,1)",
data: []
},
{
label: "Bench Mod Small",
fillColor: Util.colorNameToRgba('violet', .2),
strokeColor: Util.colorNameToRgba('violet', .4),
pointColor: Util.colorNameToRgba('violet', .6),
pointStrokeColor: "#fff",
pointHighlightFill: "#fff",
pointHighlightStroke: "rgba(220,220,220,1)",
data: []
}
]
}, getChartOptions());
function getChartOptions() {
return {
legendTemplate: '<ul>'
+ '<% for (var i=0; i<datasets.length; i++) { %>'
+ '<li>'
+ '<span style=\"color:<%=datasets[i].pointColor%>\">'
+
'<% if (datasets[i].label) { %><%= datasets[i].label %><% } %></span>'
+ '</li>'
+ '<% } %>'
+ '</ul>'
}
}
var $legend = document.createElement('div');
$legend.innerHTML = lineChart.generateLegend();
document.body.appendChild($legend);
function getBreakPoints() {
return [1, 10, 100, 1000, 10000, 100000];
}
var benchmarkModSmall = function () {
return Lazy(getBreakPoints()).reduce((result, val) => {
result[val] = Benchmarking.benchmark('Mod',
function (scope) {
return scope.num % 10;
},
function (scope) {
scope.num = 61;
});
return result;
}, {});
};
var benchmarkSubstring = function () {
return Lazy(getBreakPoints()).reduce((result, val) => {
result[val] = Benchmarking.benchmark('Substring',
function (scope) {
return scope.string.substr(-1);
},
function (scope) {
scope.string = '612873612937129873129873';
});
return result;
}, {});
};
export function runBenchMarkAndUpdateChart() {
console.log(Lazy([1, 2, 3].map(() => {})));
Lazy(combine([benchmarkModSmall(), benchmarkSubstring()]))
.map((val, key) => {
lineChart.addData(val, key, getChartOptions());
})
.toArray();
}
function combine(collection) {
var res = {};
for (var i = 0; i < collection.length; i++) {
for (var k in collection[i]) {
if (collection[i].hasOwnProperty(k)) {
res[k] = res[k] || [];
res[k].push(collection[i][k]);
}
}
}
return res;
}
}
| {
"content_hash": "fee7e097f653c8899063f6c1fb019977",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 92,
"avg_line_length": 29.903225806451612,
"alnum_prop": 0.4738403451995685,
"repo_name": "GabrielCTroia/Benchmarker-Ninja",
"id": "012a64750f1f3b7ad8c15153bae6a8df74d7de26",
"size": "3747",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/scripts/main.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5532"
},
{
"name": "HTML",
"bytes": "2254"
},
{
"name": "JavaScript",
"bytes": "11497"
},
{
"name": "TypeScript",
"bytes": "12327"
}
],
"symlink_target": ""
} |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>rtree(Iterator, Iterator)</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Chapter 1. Geometry">
<link rel="up" href="../boost__geometry__index__rtree.html" title="boost::geometry::index::rtree">
<link rel="prev" href="rtree_parameters_type_const____indexable_getter_const____value_equal_const____allocator_type_const___.html" title="rtree(parameters_type const &, indexable_getter const &, value_equal const &, allocator_type const &)">
<link rel="next" href="rtree_range_const___.html" title="rtree(Range const &)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="rtree_parameters_type_const____indexable_getter_const____value_equal_const____allocator_type_const___.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost__geometry__index__rtree.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="rtree_range_const___.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_iterator__iterator_"></a><a name="classboost_1_1geometry_1_1index_1_1rtree_1a037f17d8a1dfa4a818ff471dec61c912"></a><a class="link" href="rtree_iterator__iterator_.html" title="rtree(Iterator, Iterator)">rtree(Iterator,
Iterator)</a>
</h5></div></div></div>
<p>
<a class="indexterm" name="idp133811296"></a>
The constructor.
</p>
<h6>
<a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_iterator__iterator_.h0"></a>
<span class="phrase"><a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_iterator__iterator_.description"></a></span><a class="link" href="rtree_iterator__iterator_.html#geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_iterator__iterator_.description">Description</a>
</h6>
<p>
The tree is created using packing algorithm.
</p>
<h6>
<a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_iterator__iterator_.h1"></a>
<span class="phrase"><a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_iterator__iterator_.synopsis"></a></span><a class="link" href="rtree_iterator__iterator_.html#geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_iterator__iterator_.synopsis">Synopsis</a>
</h6>
<pre class="programlisting"><code class="computeroutput"><span class="keyword">template</span><span class="special"><</span></code><code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">Iterator</span></code><code class="computeroutput"><span class="special">></span></code>
<code class="computeroutput"><span class="identifier">rtree</span></code><code class="computeroutput"><span class="special">(</span></code><code class="computeroutput"><span class="identifier">Iterator</span></code> <code class="computeroutput"><span class="identifier">first</span></code><code class="computeroutput"><span class="special">,</span></code>
<code class="computeroutput"><span class="identifier">Iterator</span></code> <code class="computeroutput"><span class="identifier">last</span></code><code class="computeroutput"><span class="special">,</span></code>
<code class="literal"><a class="link" href="../boost__geometry__index__rtree.html#classboost_1_1geometry_1_1index_1_1rtree_1a80db5532eb59f7a809bd44ded265eb17">parameters_type</a></code><code class="computeroutput"> <span class="keyword">const</span> <span class="special">&</span></code> <code class="computeroutput"><span class="identifier">parameters</span></code> = <code class="literal"><a class="link" href="../boost__geometry__index__rtree.html#classboost_1_1geometry_1_1index_1_1rtree_1a80db5532eb59f7a809bd44ded265eb17">parameters_type</a></code><code class="computeroutput"><span class="special">()</span></code><code class="computeroutput"><span class="special">,</span></code>
<code class="literal"><a class="link" href="../boost__geometry__index__rtree.html#classboost_1_1geometry_1_1index_1_1rtree_1a43a7adb311cafc08e23010ccb4e97fb5">indexable_getter</a></code><code class="computeroutput"> <span class="keyword">const</span> <span class="special">&</span></code> <code class="computeroutput"><span class="identifier">getter</span></code> = <code class="literal"><a class="link" href="../boost__geometry__index__rtree.html#classboost_1_1geometry_1_1index_1_1rtree_1a43a7adb311cafc08e23010ccb4e97fb5">indexable_getter</a></code><code class="computeroutput"><span class="special">()</span></code><code class="computeroutput"><span class="special">,</span></code>
<code class="literal"><a class="link" href="../boost__geometry__index__rtree.html#classboost_1_1geometry_1_1index_1_1rtree_1ad8fe544de514014a1bd87ea1b881ff9b">value_equal</a></code><code class="computeroutput"> <span class="keyword">const</span> <span class="special">&</span></code> <code class="computeroutput"><span class="identifier">equal</span></code> = <code class="literal"><a class="link" href="../boost__geometry__index__rtree.html#classboost_1_1geometry_1_1index_1_1rtree_1ad8fe544de514014a1bd87ea1b881ff9b">value_equal</a></code><code class="computeroutput"><span class="special">()</span></code><code class="computeroutput"><span class="special">,</span></code>
<code class="literal"><a class="link" href="../boost__geometry__index__rtree.html#classboost_1_1geometry_1_1index_1_1rtree_1ab6618b5c7e88ed70533233fbac0f5b2e">allocator_type</a></code><code class="computeroutput"> <span class="keyword">const</span> <span class="special">&</span></code> <code class="computeroutput"><span class="identifier">allocator</span></code> = <code class="literal"><a class="link" href="../boost__geometry__index__rtree.html#classboost_1_1geometry_1_1index_1_1rtree_1ab6618b5c7e88ed70533233fbac0f5b2e">allocator_type</a></code><code class="computeroutput"><span class="special">()</span></code><code class="computeroutput"><span class="special">)</span></code>
</pre>
<h6>
<a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_iterator__iterator_.h2"></a>
<span class="phrase"><a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_iterator__iterator_.parameter_s_"></a></span><a class="link" href="rtree_iterator__iterator_.html#geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_iterator__iterator_.parameter_s_">Parameter(s)</a>
</h6>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Type
</p>
</th>
<th>
<p>
Name
</p>
</th>
<th>
<p>
Description
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">Iterator</span></code>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">first</span></code>
</p>
</td>
<td>
<p>
The beginning of the range of Values.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">Iterator</span></code>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">last</span></code>
</p>
</td>
<td>
<p>
The end of the range of Values.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal"><a class="link" href="../boost__geometry__index__rtree.html#classboost_1_1geometry_1_1index_1_1rtree_1a80db5532eb59f7a809bd44ded265eb17">parameters_type</a></code><code class="computeroutput">
<span class="keyword">const</span> <span class="special">&</span></code>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">parameters</span></code>
</p>
</td>
<td>
<p>
The parameters object.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal"><a class="link" href="../boost__geometry__index__rtree.html#classboost_1_1geometry_1_1index_1_1rtree_1a43a7adb311cafc08e23010ccb4e97fb5">indexable_getter</a></code><code class="computeroutput">
<span class="keyword">const</span> <span class="special">&</span></code>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">getter</span></code>
</p>
</td>
<td>
<p>
The function object extracting Indexable from Value.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal"><a class="link" href="../boost__geometry__index__rtree.html#classboost_1_1geometry_1_1index_1_1rtree_1ad8fe544de514014a1bd87ea1b881ff9b">value_equal</a></code><code class="computeroutput">
<span class="keyword">const</span> <span class="special">&</span></code>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">equal</span></code>
</p>
</td>
<td>
<p>
The function object comparing Values.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal"><a class="link" href="../boost__geometry__index__rtree.html#classboost_1_1geometry_1_1index_1_1rtree_1ab6618b5c7e88ed70533233fbac0f5b2e">allocator_type</a></code><code class="computeroutput">
<span class="keyword">const</span> <span class="special">&</span></code>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">allocator</span></code>
</p>
</td>
<td>
<p>
The allocator object.
</p>
</td>
</tr>
</tbody>
</table></div>
<h6>
<a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_iterator__iterator_.h3"></a>
<span class="phrase"><a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_iterator__iterator_.throws"></a></span><a class="link" href="rtree_iterator__iterator_.html#geometry.reference.spatial_indexes.boost__geometry__index__rtree.rtree_iterator__iterator_.throws">Throws</a>
</h6>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
If allocator copy constructor throws.
</li>
<li class="listitem">
If Value copy constructor or copy assignment throws.
</li>
<li class="listitem">
If allocation throws or returns invalid value.
</li>
</ul></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2009-2015 Barend Gehrels, Bruno Lalande,
Mateusz Loskot, Adam Wulkiewicz, Oracle and/or its affiliates<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="rtree_parameters_type_const____indexable_getter_const____value_equal_const____allocator_type_const___.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost__geometry__index__rtree.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="rtree_range_const___.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| {
"content_hash": "af67b5b250a3375b91d617e655f034a5",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 697,
"avg_line_length": 64.86301369863014,
"alnum_prop": 0.5928194297782471,
"repo_name": "keichan100yen/ode-ext",
"id": "9747cb9328cab24743511c036daeed977ae2f3dd",
"size": "14205",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "boost/libs/geometry/doc/html/geometry/reference/spatial_indexes/boost__geometry__index__rtree/rtree_iterator__iterator_.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "309067"
},
{
"name": "Batchfile",
"bytes": "37875"
},
{
"name": "C",
"bytes": "2967570"
},
{
"name": "C#",
"bytes": "40804"
},
{
"name": "C++",
"bytes": "189322982"
},
{
"name": "CMake",
"bytes": "119251"
},
{
"name": "CSS",
"bytes": "456744"
},
{
"name": "Cuda",
"bytes": "52444"
},
{
"name": "DIGITAL Command Language",
"bytes": "6246"
},
{
"name": "Fortran",
"bytes": "1856"
},
{
"name": "Groff",
"bytes": "5189"
},
{
"name": "HTML",
"bytes": "181460055"
},
{
"name": "IDL",
"bytes": "28"
},
{
"name": "JavaScript",
"bytes": "419776"
},
{
"name": "Lex",
"bytes": "1231"
},
{
"name": "M4",
"bytes": "29689"
},
{
"name": "Makefile",
"bytes": "1088024"
},
{
"name": "Max",
"bytes": "36857"
},
{
"name": "Objective-C",
"bytes": "11406"
},
{
"name": "Objective-C++",
"bytes": "630"
},
{
"name": "PHP",
"bytes": "68641"
},
{
"name": "Perl",
"bytes": "36491"
},
{
"name": "Perl6",
"bytes": "2053"
},
{
"name": "Python",
"bytes": "1612978"
},
{
"name": "QML",
"bytes": "593"
},
{
"name": "QMake",
"bytes": "16692"
},
{
"name": "Rebol",
"bytes": "354"
},
{
"name": "Ruby",
"bytes": "5532"
},
{
"name": "Shell",
"bytes": "354720"
},
{
"name": "Tcl",
"bytes": "1172"
},
{
"name": "TeX",
"bytes": "32117"
},
{
"name": "XSLT",
"bytes": "553585"
},
{
"name": "Yacc",
"bytes": "19623"
}
],
"symlink_target": ""
} |
/* $Id: short_tag.c,v 1.6 2006/03/23 14:54:02 dron Exp $ */
/*
* Copyright (c) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
/*
* TIFF Library
*
* Module to test SHORT tags read/write functions.
*/
#include "tif_config.h"
#include <stdio.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "tiffio.h"
extern int CheckShortField(TIFF *, ttag_t, uint16);
const char *filename = "short_test.tiff";
#define SPP 3 /* Samples per pixel */
const uint16 width = 1;
const uint16 length = 1;
const uint16 bps = 8;
const uint16 photometric = PHOTOMETRIC_RGB;
const uint16 rows_per_strip = 1;
const uint16 planarconfig = PLANARCONFIG_CONTIG;
static struct SingleTags {
ttag_t tag;
uint16 value;
} short_single_tags[] = {
{ TIFFTAG_COMPRESSION, COMPRESSION_NONE },
{ TIFFTAG_FILLORDER, FILLORDER_MSB2LSB },
{ TIFFTAG_ORIENTATION, ORIENTATION_BOTRIGHT },
{ TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH },
{ TIFFTAG_INKSET, INKSET_MULTIINK },
{ TIFFTAG_MINSAMPLEVALUE, 23 },
{ TIFFTAG_MAXSAMPLEVALUE, 241 },
{ TIFFTAG_NUMBEROFINKS, SPP },
{ TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT }
/*{ TIFFTAG_IMAGEDEPTH, 1 },
{ TIFFTAG_TILEDEPTH, 1 }*/
};
#define NSINGLETAGS (sizeof(short_single_tags) / sizeof(short_single_tags[0]))
int
main(int argc, char **argv)
{
TIFF *tif;
int i;
unsigned char buf[3] = { 0, 127, 255 };
/* Test whether we can write tags. */
tif = TIFFOpen(filename, "w");
if (!tif) {
fprintf (stderr, "Can't create test TIFF file %s.\n", filename);
return 1;
}
if (!TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, width)) {
fprintf (stderr, "Can't set ImageWidth tag.\n");
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_IMAGELENGTH, length)) {
fprintf (stderr, "Can't set ImageLength tag.\n");
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bps)) {
fprintf (stderr, "Can't set BitsPerSample tag.\n");
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, SPP)) {
fprintf (stderr, "Can't set SamplesPerPixel tag.\n");
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rows_per_strip)) {
fprintf (stderr, "Can't set SamplesPerPixel tag.\n");
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_PLANARCONFIG, planarconfig)) {
fprintf (stderr, "Can't set PlanarConfiguration tag.\n");
goto failure;
}
if (!TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, photometric)) {
fprintf (stderr, "Can't set PhotometricInterpretation tag.\n");
goto failure;
}
for (i = 0; i < NSINGLETAGS; i++) {
if (!TIFFSetField(tif, short_single_tags[i].tag,
short_single_tags[i].value)) {
fprintf(stderr, "Can't set tag %d.\n",
(int)short_single_tags[i].tag);
goto failure;
}
}
/* Write dummy pixel data. */
if (!TIFFWriteScanline(tif, buf, 0, 0) < 0) {
fprintf (stderr, "Can't write image data.\n");
goto failure;
}
TIFFClose(tif);
/* Ok, now test whether we can read written values. */
tif = TIFFOpen(filename, "r");
if (!tif) {
fprintf (stderr, "Can't open test TIFF file %s.\n", filename);
return 1;
}
if (CheckLongField(tif, TIFFTAG_IMAGEWIDTH, width) < 0)
goto failure;
if (CheckLongField(tif, TIFFTAG_IMAGELENGTH, length) < 0)
goto failure;
if (CheckShortField(tif, TIFFTAG_BITSPERSAMPLE, bps) < 0)
goto failure;
if (CheckShortField(tif, TIFFTAG_PHOTOMETRIC, photometric) < 0)
goto failure;
if (CheckShortField(tif, TIFFTAG_SAMPLESPERPIXEL, SPP) < 0)
goto failure;
if (CheckLongField(tif, TIFFTAG_ROWSPERSTRIP, rows_per_strip) < 0)
goto failure;
if (CheckShortField(tif, TIFFTAG_PLANARCONFIG, planarconfig) < 0)
goto failure;
for (i = 0; i < NSINGLETAGS; i++) {
if (CheckShortField(tif, short_single_tags[i].tag,
short_single_tags[i].value) < 0)
goto failure;
}
TIFFClose(tif);
/* All tests passed; delete file and exit with success status. */
unlink(filename);
return 0;
failure:
/* Something goes wrong; close file and return unsuccessful status. */
TIFFClose(tif);
unlink(filename);
return 1;
}
/* vim: set ts=8 sts=8 sw=8 noet: */
| {
"content_hash": "fe38314f3ea96991f72140a5ec96811a",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 80,
"avg_line_length": 28.70949720670391,
"alnum_prop": 0.6964389959136019,
"repo_name": "mollstam/UnrealPy",
"id": "94ef1fddbaccd6e0ec8bfddef93806cdbe35ac93",
"size": "5139",
"binary": false,
"copies": "25",
"ref": "refs/heads/master",
"path": "UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/tiff-3.8.2/test/short_tag.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "APL",
"bytes": "587"
},
{
"name": "ASP",
"bytes": "2753"
},
{
"name": "ActionScript",
"bytes": "5686"
},
{
"name": "Ada",
"bytes": "94225"
},
{
"name": "Agda",
"bytes": "3154"
},
{
"name": "Alloy",
"bytes": "6579"
},
{
"name": "ApacheConf",
"bytes": "12482"
},
{
"name": "AppleScript",
"bytes": "421"
},
{
"name": "Assembly",
"bytes": "1093261"
},
{
"name": "AutoHotkey",
"bytes": "3733"
},
{
"name": "AutoIt",
"bytes": "667"
},
{
"name": "Awk",
"bytes": "63276"
},
{
"name": "Batchfile",
"bytes": "147828"
},
{
"name": "BlitzBasic",
"bytes": "185102"
},
{
"name": "BlitzMax",
"bytes": "2387"
},
{
"name": "Boo",
"bytes": "1111"
},
{
"name": "Bro",
"bytes": "7337"
},
{
"name": "C",
"bytes": "108397183"
},
{
"name": "C#",
"bytes": "156749"
},
{
"name": "C++",
"bytes": "13535833"
},
{
"name": "CLIPS",
"bytes": "6933"
},
{
"name": "CMake",
"bytes": "12441"
},
{
"name": "COBOL",
"bytes": "114812"
},
{
"name": "CSS",
"bytes": "430375"
},
{
"name": "Ceylon",
"bytes": "1387"
},
{
"name": "Chapel",
"bytes": "4366"
},
{
"name": "Cirru",
"bytes": "2574"
},
{
"name": "Clean",
"bytes": "9679"
},
{
"name": "Clojure",
"bytes": "23871"
},
{
"name": "CoffeeScript",
"bytes": "20149"
},
{
"name": "ColdFusion",
"bytes": "9006"
},
{
"name": "Common Lisp",
"bytes": "49017"
},
{
"name": "Coq",
"bytes": "66"
},
{
"name": "Cucumber",
"bytes": "390"
},
{
"name": "Cuda",
"bytes": "776"
},
{
"name": "D",
"bytes": "7556"
},
{
"name": "DIGITAL Command Language",
"bytes": "425938"
},
{
"name": "DTrace",
"bytes": "6706"
},
{
"name": "Dart",
"bytes": "591"
},
{
"name": "Dylan",
"bytes": "6343"
},
{
"name": "Ecl",
"bytes": "2599"
},
{
"name": "Eiffel",
"bytes": "2145"
},
{
"name": "Elixir",
"bytes": "4340"
},
{
"name": "Emacs Lisp",
"bytes": "18303"
},
{
"name": "Erlang",
"bytes": "5746"
},
{
"name": "F#",
"bytes": "19156"
},
{
"name": "FORTRAN",
"bytes": "38458"
},
{
"name": "Factor",
"bytes": "10194"
},
{
"name": "Fancy",
"bytes": "2581"
},
{
"name": "Fantom",
"bytes": "25331"
},
{
"name": "GAP",
"bytes": "29880"
},
{
"name": "GLSL",
"bytes": "450"
},
{
"name": "Gnuplot",
"bytes": "11501"
},
{
"name": "Go",
"bytes": "5444"
},
{
"name": "Golo",
"bytes": "1649"
},
{
"name": "Gosu",
"bytes": "2853"
},
{
"name": "Groff",
"bytes": "3458639"
},
{
"name": "Groovy",
"bytes": "2586"
},
{
"name": "HTML",
"bytes": "92126540"
},
{
"name": "Haskell",
"bytes": "49593"
},
{
"name": "Haxe",
"bytes": "16812"
},
{
"name": "Hy",
"bytes": "7237"
},
{
"name": "IDL",
"bytes": "2098"
},
{
"name": "Idris",
"bytes": "2771"
},
{
"name": "Inform 7",
"bytes": "1944"
},
{
"name": "Inno Setup",
"bytes": "18796"
},
{
"name": "Ioke",
"bytes": "469"
},
{
"name": "Isabelle",
"bytes": "21392"
},
{
"name": "Jasmin",
"bytes": "9428"
},
{
"name": "Java",
"bytes": "4040623"
},
{
"name": "JavaScript",
"bytes": "223927"
},
{
"name": "Julia",
"bytes": "27687"
},
{
"name": "KiCad",
"bytes": "475"
},
{
"name": "Kotlin",
"bytes": "971"
},
{
"name": "LSL",
"bytes": "160"
},
{
"name": "Lasso",
"bytes": "18650"
},
{
"name": "Lean",
"bytes": "6921"
},
{
"name": "Limbo",
"bytes": "9891"
},
{
"name": "Liquid",
"bytes": "862"
},
{
"name": "LiveScript",
"bytes": "972"
},
{
"name": "Logos",
"bytes": "19509"
},
{
"name": "Logtalk",
"bytes": "7260"
},
{
"name": "Lua",
"bytes": "8677"
},
{
"name": "Makefile",
"bytes": "2053844"
},
{
"name": "Mask",
"bytes": "815"
},
{
"name": "Mathematica",
"bytes": "191"
},
{
"name": "Max",
"bytes": "296"
},
{
"name": "Modelica",
"bytes": "6213"
},
{
"name": "Modula-2",
"bytes": "23838"
},
{
"name": "Module Management System",
"bytes": "14798"
},
{
"name": "Monkey",
"bytes": "2587"
},
{
"name": "Moocode",
"bytes": "3343"
},
{
"name": "MoonScript",
"bytes": "14862"
},
{
"name": "Myghty",
"bytes": "3939"
},
{
"name": "NSIS",
"bytes": "7663"
},
{
"name": "Nemerle",
"bytes": "1517"
},
{
"name": "NewLisp",
"bytes": "42726"
},
{
"name": "Nimrod",
"bytes": "37191"
},
{
"name": "Nit",
"bytes": "55581"
},
{
"name": "Nix",
"bytes": "2448"
},
{
"name": "OCaml",
"bytes": "42416"
},
{
"name": "Objective-C",
"bytes": "104883"
},
{
"name": "Objective-J",
"bytes": "15340"
},
{
"name": "Opa",
"bytes": "172"
},
{
"name": "OpenEdge ABL",
"bytes": "49943"
},
{
"name": "PAWN",
"bytes": "6555"
},
{
"name": "PHP",
"bytes": "68611"
},
{
"name": "PLSQL",
"bytes": "45772"
},
{
"name": "Pan",
"bytes": "1241"
},
{
"name": "Pascal",
"bytes": "349743"
},
{
"name": "Perl",
"bytes": "5931502"
},
{
"name": "Perl6",
"bytes": "113623"
},
{
"name": "PigLatin",
"bytes": "6657"
},
{
"name": "Pike",
"bytes": "8479"
},
{
"name": "PostScript",
"bytes": "18216"
},
{
"name": "PowerShell",
"bytes": "14236"
},
{
"name": "Prolog",
"bytes": "43750"
},
{
"name": "Protocol Buffer",
"bytes": "3401"
},
{
"name": "Puppet",
"bytes": "130"
},
{
"name": "Python",
"bytes": "122886305"
},
{
"name": "QML",
"bytes": "3912"
},
{
"name": "R",
"bytes": "49247"
},
{
"name": "Racket",
"bytes": "11341"
},
{
"name": "Rebol",
"bytes": "17708"
},
{
"name": "Red",
"bytes": "10536"
},
{
"name": "Redcode",
"bytes": "830"
},
{
"name": "Ruby",
"bytes": "91403"
},
{
"name": "Rust",
"bytes": "6788"
},
{
"name": "SAS",
"bytes": "15603"
},
{
"name": "SaltStack",
"bytes": "1040"
},
{
"name": "Scala",
"bytes": "730"
},
{
"name": "Scheme",
"bytes": "50346"
},
{
"name": "Scilab",
"bytes": "943"
},
{
"name": "Shell",
"bytes": "2925518"
},
{
"name": "ShellSession",
"bytes": "320"
},
{
"name": "Smali",
"bytes": "832"
},
{
"name": "Smalltalk",
"bytes": "158636"
},
{
"name": "Smarty",
"bytes": "523"
},
{
"name": "SourcePawn",
"bytes": "130"
},
{
"name": "Standard ML",
"bytes": "36869"
},
{
"name": "Swift",
"bytes": "2035"
},
{
"name": "SystemVerilog",
"bytes": "265"
},
{
"name": "Tcl",
"bytes": "6077233"
},
{
"name": "TeX",
"bytes": "487999"
},
{
"name": "Tea",
"bytes": "391"
},
{
"name": "TypeScript",
"bytes": "535"
},
{
"name": "VHDL",
"bytes": "4446"
},
{
"name": "VimL",
"bytes": "32053"
},
{
"name": "Visual Basic",
"bytes": "19441"
},
{
"name": "XQuery",
"bytes": "4289"
},
{
"name": "XS",
"bytes": "178055"
},
{
"name": "XSLT",
"bytes": "1995174"
},
{
"name": "Xtend",
"bytes": "727"
},
{
"name": "Yacc",
"bytes": "25665"
},
{
"name": "Zephir",
"bytes": "485"
},
{
"name": "eC",
"bytes": "31545"
},
{
"name": "mupad",
"bytes": "2442"
},
{
"name": "nesC",
"bytes": "23697"
},
{
"name": "xBase",
"bytes": "3349"
}
],
"symlink_target": ""
} |
namespace plugkit {
class Variant final {
public:
enum Type {
TYPE_NIL,
TYPE_BOOL,
TYPE_INT64,
TYPE_UINT64,
TYPE_DOUBLE,
TYPE_STRING,
TYPE_TIMESTAMP,
TYPE_BUFFER,
TYPE_STREAM,
TYPE_ARRAY,
TYPE_MAP
};
using Array = std::vector<Variant>;
using Map = std::unordered_map<std::string, Variant>;
using Timestamp = std::chrono::time_point<std::chrono::system_clock,
std::chrono::nanoseconds>;
public:
Variant();
Variant(bool value);
Variant(int64_t value);
Variant(uint64_t value);
Variant(double value);
Variant(const std::string &str);
Variant(std::string &&str);
Variant(const Slice &slice);
Variant(const StreamBuffer &stream);
Variant(const Array &array);
Variant(const Map &map);
Variant(Array &&array);
Variant(Map &&map);
Variant(const Timestamp &ts);
Variant(void *) = delete;
~Variant();
Variant(const Variant &value);
Variant &operator=(const Variant &value);
public:
Type type() const;
bool isNil() const;
bool isBool() const;
bool isInt64() const;
bool isUint64() const;
bool isDouble() const;
bool isString() const;
bool isTimestamp() const;
bool isBuffer() const;
bool isStream() const;
bool isArray() const;
bool isMap() const;
public:
bool boolValue() const;
int64_t int64Value() const;
uint64_t uint64Value() const;
double doubleValue() const;
Timestamp timestamp() const;
std::string string() const;
Slice slice() const;
StreamBuffer stream() const;
const Array &array() const;
const Map &map() const;
uint8_t tag() const;
Variant operator[](size_t index) const;
Variant operator[](const std::string &key) const;
size_t length() const;
public:
class Private;
private:
uint8_t type_;
int8_t tag_;
union {
bool bool_;
double double_;
int64_t int_;
uint64_t uint_;
Timestamp *ts;
Slice *slice;
Array *array;
Map *map;
} d;
};
}
#endif
| {
"content_hash": "b71afb48f6d2ed7716a15415a6aee24b",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 70,
"avg_line_length": 21.51086956521739,
"alnum_prop": 0.6432541687721072,
"repo_name": "deplug/plugkit",
"id": "7b51db92b8f6b79ab27458a511a2e5c87bde93b6",
"size": "2180",
"binary": false,
"copies": "1",
"ref": "refs/heads/early-dev",
"path": "include/plugkit/variant.hpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "204616"
},
{
"name": "JavaScript",
"bytes": "6532"
},
{
"name": "Makefile",
"bytes": "1062"
},
{
"name": "Shell",
"bytes": "1162"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jkiss.dbeaver</groupId>
<artifactId>plugins</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>org.jkiss.dbeaver.headless</artifactId>
<version>1.0.23-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
| {
"content_hash": "68871f7015b5b4a1fe3125f6d08ce9a6",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 149,
"avg_line_length": 43.142857142857146,
"alnum_prop": 0.7036423841059603,
"repo_name": "Sargul/dbeaver",
"id": "56d007730825caf30a7d49c81ea33d22bf456b01",
"size": "604",
"binary": false,
"copies": "1",
"ref": "refs/heads/devel",
"path": "plugins/org.jkiss.dbeaver.headless/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2837"
},
{
"name": "C++",
"bytes": "63113"
},
{
"name": "CSS",
"bytes": "19694"
},
{
"name": "HTML",
"bytes": "10379"
},
{
"name": "Java",
"bytes": "24457701"
},
{
"name": "JavaScript",
"bytes": "139972"
},
{
"name": "Shell",
"bytes": "202"
},
{
"name": "XSLT",
"bytes": "8047"
}
],
"symlink_target": ""
} |
:- if(current_prolog_flag(test_header,_)).
:- wdmsg(reload_of_test_header).
:- mpred_reset.
:- else.
% runtype: default = pfc
:- if(current_prolog_flag(runtime_testing_module,_)->true;
set_prolog_flag(runtime_testing_module,test_header)).
:- endif.
:- if(( \+ current_prolog_flag(test_header,_),set_prolog_flag(test_header,loaded))).
:- if((prolog_load_context(module,user), \+ current_module(pfc_lib))).
:- module(header_sane,[test_header_include/0]).
test_header_include.
:- endif.
%:- set_prolog_flag(runtime_speed,0). % 0 = dont care
:- set_prolog_flag(runtime_speed, 0). % 1 = default
:- set_prolog_flag(runtime_debug, 3). % 2 = important but dont sacrifice other features for it
:- set_prolog_flag(runtime_safety, 3). % 3 = very important
:- set_prolog_flag(unsafe_speedups, false).
:- set_prolog_flag(logicmoo_message_hook,dumpst).
:- endif.
:- if(exists_source(library(editline))).
:- use_module(library(editline)).
:- else.
:- if(exists_source(library(editline))).
:- use_module(library(readline)).
:- endif.
:- endif.
:- '$toplevel':setup_history.
%:- set_stream(user_input,tty(false)).
:- use_module(library(pfc_lib)).
%:- if(( \+ current_module(pfc_lib) )).
:- use_module(library(pfc)).
%:- endif.
:- ensure_loaded(library(pfc_test)).
%:- endif. % current_prolog_flag(test_header,_).
:- prolog_load_context(source,File),!,
ignore((((atom_contains(File,'.pfc')
-> sanity(pfc_lib:is_pfc_file) ; sanity( \+ pfc_lib:is_pfc_file))))),!.
:- mpred_trace_exec.
:- set_prolog_flag(debug, true).
:- set_prolog_flag(gc, false).
:- '$current_source_module'(W), '$set_typein_module'(W).
:- sanity(
((fileAssertMt(Mt2),
(defaultAssertMt(Mt1),
%fileAssertMt(Mt2),
source_module(Mt3))),
sanity((Mt1==Mt2,Mt1==Mt3)))).
:- fav_debug.
:- set_prolog_flag(gc, true).
% :- endif.
:-
op(1199,fx,('==>')),
op(1190,xfx,('::::')),
op(1180,xfx,('==>')),
op(1170,xfx,'<==>'),
op(1160,xfx,('<-')),
op(1150,xfx,'=>'),
op(1140,xfx,'<='),
op(1130,xfx,'<=>'),
op(600,yfx,'&'),
op(600,yfx,'v'),
op(350,xfx,'xor'),
op(300,fx,'~'),
op(300,fx,'-').
:- fixup_exports.
% :- set_prolog_IO(user_input,user_output,user_error).
:- if((prolog_load_context(source,File),(atom_contains(File,'.clif')))).
:-assert(t_l:each_file_term(must_kif_process_after_rename)).
% install_constant_renamer_until_eof:-
%call_on_eof(show_missing_renames),
% set_prolog_flag_until_eof(do_renames,term_expansion).
:- set_prolog_flag(runtime_debug, 0).
:- use_module(library(logicmoo_clif)).
:- set_prolog_flag(runtime_debug, 3).
:- set_prolog_flag(do_renames,term_expansion).
:- ((prolog_load_context(source,File), atom_contains(File,'.clif')) ->
(current_stream(File, read, Stream),with_lisp_translation(Stream,must_kif_process_after_rename)); true).
%:- call(call,((asserta(((system:goal_expansion(Here,Loc,_,_):- dmsg(s_goal_expansion(Here,Loc)),trace,fail))),
% asserta(((system:term_expansion(Here,Loc,_,_):- dmsg(s_term_expansion(Here,Loc)),trace,fail)))))).
:- else. % end clif file
:- endif.
| {
"content_hash": "fd71b08a7419f8dd886ba499b88bfad6",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 111,
"avg_line_length": 23.484615384615385,
"alnum_prop": 0.6387160170324271,
"repo_name": "TeamSPoon/logicmoo_base",
"id": "27e0a8f57f303ee39ad1cef3c0f954c2d8cbecd8",
"size": "3055",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "t/examples/fol/test_header1.pl",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Common Lisp",
"bytes": "49725"
},
{
"name": "Emacs Lisp",
"bytes": "610"
},
{
"name": "GLSL",
"bytes": "18558"
},
{
"name": "HTML",
"bytes": "25076"
},
{
"name": "Haskell",
"bytes": "20929"
},
{
"name": "Logtalk",
"bytes": "79331"
},
{
"name": "PLSQL",
"bytes": "13590"
},
{
"name": "Perl",
"bytes": "1"
},
{
"name": "Prolog",
"bytes": "5024649"
},
{
"name": "Raku",
"bytes": "46"
},
{
"name": "SMT",
"bytes": "20238"
},
{
"name": "Shell",
"bytes": "96149"
},
{
"name": "XSLT",
"bytes": "1952"
}
],
"symlink_target": ""
} |
module ValidatorExpectations
RSpec::Matchers.define :be_available do
match do |actual|
actual.available?
end
end
RSpec::Matchers.define :be_valid do
match do |actual|
actual.valid?
end
end
end
| {
"content_hash": "336b0d596abad20e83f2b5e0f833bceb",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 41,
"avg_line_length": 17.692307692307693,
"alnum_prop": 0.6695652173913044,
"repo_name": "bkerley/cert_validator",
"id": "8a78332eb2269ec829b83c5e3593510b675259e5",
"size": "230",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/support/validator_expectations.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "25226"
}
],
"symlink_target": ""
} |
package com.google.dataflow.sample.timeseriesflow.metrics;
import com.google.common.collect.ImmutableList;
import com.google.dataflow.sample.timeseriesflow.FSITechnicalDerivedAggregations.FsiTechnicalIndicators;
import com.google.dataflow.sample.timeseriesflow.TimeSeriesData.TSAccum;
import com.google.dataflow.sample.timeseriesflow.TimeSeriesData.TSDataPoint;
import com.google.dataflow.sample.timeseriesflow.TimeSeriesData.TSKey;
import com.google.dataflow.sample.timeseriesflow.graph.GenerateComputations;
import com.google.dataflow.sample.timeseriesflow.metrics.core.typeone.Max;
import com.google.dataflow.sample.timeseriesflow.metrics.core.typeone.Min;
import com.google.dataflow.sample.timeseriesflow.metrics.core.typeone.Sum;
import com.google.dataflow.sample.timeseriesflow.metrics.core.typetwo.basic.bb.BBFn;
import com.google.dataflow.sample.timeseriesflow.metrics.core.typetwo.basic.bb.BBFn.BBAvgComputeMethod;
import com.google.dataflow.sample.timeseriesflow.metrics.core.typetwo.basic.bb.BBFn.BBOptions;
import com.google.gson.stream.JsonReader;
import common.TSTestData;
import common.TSTestDataBaseline;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.TestStream;
import org.apache.beam.sdk.transforms.Filter;
import org.apache.beam.sdk.transforms.MapElements;
import org.apache.beam.sdk.values.KV;
import org.apache.beam.sdk.values.PCollection;
import org.apache.beam.sdk.values.TypeDescriptor;
import org.apache.beam.sdk.values.TypeDescriptors;
import org.joda.time.Duration;
import org.junit.Rule;
import org.junit.Test;
public class BBFnTest {
@Rule public final transient TestPipeline p = TestPipeline.create();
@Test
/* Simple test to check Exponential Moving Average Technical is created correctly */
public void testCreateBBSMA() throws IOException {
String resourceName = "TSTestDataHints.json";
ClassLoader classLoader = getClass().getClassLoader();
File file = new File(classLoader.getResource(resourceName).getFile());
String absolutePath = file.getAbsolutePath();
TSTestData tsTestData =
TSTestData.toBuilder()
.setInputTSDataFromJSON(
new JsonReader(new FileReader(absolutePath)),
Duration.standardSeconds(5),
Duration.standardSeconds(15))
.build();
BBOptions options = p.getOptions().as(BBOptions.class);
options.setBBAvgComputeMethod(BBAvgComputeMethod.SIMPLE_MOVING_AVERAGE);
options.setBBDevFactor(2);
TestStream<TSDataPoint> stream = tsTestData.inputTSData();
PCollection<KV<TSKey, TSAccum>> techAccum =
p.apply(stream)
.apply(
GenerateComputations.builder()
.setType1FixedWindow(Duration.standardSeconds(5))
.setType2SlidingWindowDuration(Duration.standardSeconds(15))
.setEnableGapFill(false)
.setBasicType1Metrics(ImmutableList.of(Sum.class, Min.class, Max.class))
.setBasicType2Metrics(ImmutableList.of(BBFn.class))
.build());
// The sliding window will create partial values, to keep testing simple we just test
// correctness of BB for the full value
PCollection<KV<TSKey, TSAccum>> fullAccum =
techAccum.apply(
Filter.by(
x ->
x.getValue()
.getDataStoreOrThrow(FsiTechnicalIndicators.SUM_MOVEMENT_COUNT.name())
.getIntVal()
== 3));
PCollection<KV<TSKey, List<Double>>> bollingerBand =
fullAccum.apply(
"BB",
MapElements.into(
TypeDescriptors.kvs(
TypeDescriptor.of(TSKey.class),
TypeDescriptors.lists(TypeDescriptors.doubles())))
.via(
x ->
KV.of(
x.getKey(),
Arrays.asList(
x.getValue()
.getDataStoreOrThrow(
FsiTechnicalIndicators.BB_MIDDLE_BAND_SMA.name())
.getDoubleVal(),
x.getValue()
.getDataStoreOrThrow(
FsiTechnicalIndicators.BB_UPPER_BAND_SMA.name())
.getDoubleVal(),
x.getValue()
.getDataStoreOrThrow(
FsiTechnicalIndicators.BB_BOTTOM_BAND_SMA.name())
.getDoubleVal()))));
/*
BB MIDDLE_BAND = SMA or EMA, UPPER_BAND = MIDDLE_BAND + dev_factor * STDDEV, BOTTOM_BAND = MIDDLE_BAND - dev_factor * STDDEV
BB SMA Key_A_A = [1, 3, 8] = [4.0, 9.8878405776, -1.8878405776]
BB SMA Key_A_B = [16, 12, 8] = [12.0, 18.5319726474, 5.4680273526]
BB SMA Key_A_C = [12, 12, 12] = [12, 12, 12]
*/
PAssert.that(bollingerBand)
.containsInAnyOrder(
KV.of(TSTestDataBaseline.KEY_A_A, Arrays.asList(4.0D, 9.8878405776, -1.8878405776D)),
KV.of(TSTestDataBaseline.KEY_A_B, Arrays.asList(12.0D, 18.5319726474D, 5.4680273526D)),
KV.of(TSTestDataBaseline.KEY_A_C, Arrays.asList(12D, 12D, 12D)));
p.run();
}
}
| {
"content_hash": "d2f45f670227380b4131dc596c11b1be",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 128,
"avg_line_length": 44.58730158730159,
"alnum_prop": 0.6333214667141331,
"repo_name": "GoogleCloudPlatform/dataflow-sample-applications",
"id": "9b19af8363680772b7939c601cad509d17cf104c",
"size": "6423",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "timeseries-streaming/timeseries-java-applications/TimeSeriesMetricsLibrary/src/test/java/com/google/dataflow/sample/timeseriesflow/metrics/BBFnTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "603"
},
{
"name": "Go",
"bytes": "3356"
},
{
"name": "HCL",
"bytes": "21115"
},
{
"name": "Java",
"bytes": "1055688"
},
{
"name": "JavaScript",
"bytes": "4210"
},
{
"name": "Jupyter Notebook",
"bytes": "199543"
},
{
"name": "Python",
"bytes": "62023"
}
],
"symlink_target": ""
} |
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>PHPXRef 0.7.1 : Unnamed Project : Variable Reference: $expected_args</title>
<link rel="stylesheet" href="../sample.css" type="text/css">
<link rel="stylesheet" href="../sample-print.css" type="text/css" media="print">
<style id="hilight" type="text/css"></style>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000" link="#801800" vlink="#300540" alink="#ffffff">
<table class="pagetitle" width="100%">
<tr>
<td valign="top" class="pagetitle">
[ <a href="../index.html">Index</a> ]
</td>
<td align="right" class="pagetitle">
<h2 style="margin-bottom: 0px">PHP Cross Reference of Unnamed Project</h2>
</td>
</tr>
</table>
<!-- Generated by PHPXref 0.7.1 at Thu Oct 23 18:57:41 2014 -->
<!-- PHPXref (c) 2000-2010 Gareth Watts - gareth@omnipotent.net -->
<!-- http://phpxref.sourceforge.net/ -->
<script src="../phpxref.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
ext='.html';
relbase='../';
subdir='_variables';
filename='index.html';
cookiekey='phpxref';
handleNavFrame(relbase, subdir, filename);
logVariable('expected_args');
// -->
</script>
<script language="JavaScript" type="text/javascript">
if (gwGetCookie('xrefnav')=='off')
document.write('<p class="navlinks">[ <a href="javascript:navOn()">Show Explorer<\/a> ]<\/p>');
else
document.write('<p class="navlinks">[ <a href="javascript:navOff()">Hide Explorer<\/a> ]<\/p>');
</script>
<noscript>
<p class="navlinks">
[ <a href="../nav.html" target="_top">Show Explorer</a> ]
[ <a href="index.html" target="_top">Hide Navbar</a> ]
</p>
</noscript>
[<a href="../index.html">Top level directory</a>]<br>
<script language="JavaScript" type="text/javascript">
<!--
document.writeln('<table align="right" class="searchbox-link"><tr><td><a class="searchbox-link" href="javascript:void(0)" onMouseOver="showSearchBox()">Search</a><br>');
document.writeln('<table border="0" cellspacing="0" cellpadding="0" class="searchbox" id="searchbox">');
document.writeln('<tr><td class="searchbox-title">');
document.writeln('<a class="searchbox-title" href="javascript:showSearchPopup()">Search History +</a>');
document.writeln('<\/td><\/tr>');
document.writeln('<tr><td class="searchbox-body" id="searchbox-body">');
document.writeln('<form name="search" style="margin:0px; padding:0px" onSubmit=\'return jump()\'>');
document.writeln('<a class="searchbox-body" href="../_classes/index.html">Class<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="classname"><br>');
document.writeln('<a id="funcsearchlink" class="searchbox-body" href="../_functions/index.html">Function<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="funcname"><br>');
document.writeln('<a class="searchbox-body" href="../_variables/index.html">Variable<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="varname"><br>');
document.writeln('<a class="searchbox-body" href="../_constants/index.html">Constant<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="constname"><br>');
document.writeln('<a class="searchbox-body" href="../_tables/index.html">Table<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="tablename"><br>');
document.writeln('<input type="submit" class="searchbox-button" value="Search">');
document.writeln('<\/form>');
document.writeln('<\/td><\/tr><\/table>');
document.writeln('<\/td><\/tr><\/table>');
// -->
</script>
<div id="search-popup" class="searchpopup"><p id="searchpopup-title" class="searchpopup-title">title</p><div id="searchpopup-body" class="searchpopup-body">Body</div><p class="searchpopup-close"><a href="javascript:gwCloseActive()">[close]</a></p></div>
<h3>Variable Cross Reference</h3>
<h2><a href="index.html#expected_args">$expected_args</a></h2>
<br><b>Referenced 6 times:</b><ul>
<li><a href="../tests/simpletest/mock_objects.php.html">/tests/simpletest/mock_objects.php</a> -> <a href="../tests/simpletest/mock_objects.php.source.html#l435"> line 435</a></li>
<li><a href="../tests/simpletest/mock_objects.php.html">/tests/simpletest/mock_objects.php</a> -> <a href="../tests/simpletest/mock_objects.php.source.html#l647"> line 647</a></li>
<li><a href="../tests/simpletest/mock_objects.php.html">/tests/simpletest/mock_objects.php</a> -> <a href="../tests/simpletest/mock_objects.php.source.html#l660"> line 660</a></li>
<li><a href="../tests/simpletest/mock_objects.php.html">/tests/simpletest/mock_objects.php</a> -> <a href="../tests/simpletest/mock_objects.php.source.html#l883"> line 883</a></li>
<li><a href="../tests/simpletest/mock_objects.php.html">/tests/simpletest/mock_objects.php</a> -> <a href="../tests/simpletest/mock_objects.php.source.html#l1157"> line 1157</a></li>
<li><a href="../tests/simpletest/mock_objects.php.html">/tests/simpletest/mock_objects.php</a> -> <a href="../tests/simpletest/mock_objects.php.source.html#l1159"> line 1159</a></li>
</ul>
<!-- A link to the phpxref site in your customized footer file is appreciated ;-) -->
<br><hr>
<table width="100%">
<tr><td>Generated: Thu Oct 23 18:57:41 2014</td>
<td align="right"><i>Cross-referenced by <a href="http://phpxref.sourceforge.net/">PHPXref 0.7.1</a></i></td>
</tr>
</table>
</body></html>
| {
"content_hash": "490b658c1f71c48c1edd8b795aa919c0",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 253,
"avg_line_length": 55.87755102040816,
"alnum_prop": 0.6736669101533966,
"repo_name": "inputx/code-ref-doc",
"id": "54ff03d55ac8b7f7cce6508ffbf055806fc04f9b",
"size": "5476",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bonfire/_variables/expected_args.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "17952"
},
{
"name": "JavaScript",
"bytes": "255489"
}
],
"symlink_target": ""
} |
package org.teamninjaneer.simulator.locationsimulator.model;
/**
* The reserved variable place holder values.
*
* @author Travis.Rennemann
*/
public enum Placeholder {
// latitude
LAT,
// longitude
LON
}
| {
"content_hash": "3f19277a59c850b1a62b4facca8bd127",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 60,
"avg_line_length": 17.142857142857142,
"alnum_prop": 0.6458333333333334,
"repo_name": "rennemannt/location-simulator",
"id": "c3d685095ef2df2b9bac9afb6a63428db361e18c",
"size": "1399",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/teamninjaneer/simulator/locationsimulator/model/Placeholder.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "64754"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="ApiGen 2.8.0" />
<title>Class BaseX\Query\QueryResults | basex-php</title>
<script type="text/javascript" src="resources/combined.js?394153670"></script>
<script type="text/javascript" src="elementlist.js?2248114710"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360" />
</head>
<body>
<div id="left">
<div id="menu">
<a href="index.html" title="Overview"><span>Overview</span></a>
<div id="groups">
<h3>Namespaces</h3>
<ul>
<li class="active"><a href="namespace-BaseX.html">BaseX<span></span></a>
<ul>
<li><a href="namespace-BaseX.Database.html">Database<span></span></a>
<ul>
<li><a href="namespace-BaseX.Database.Importer.html">Importer</a>
</li>
</ul></li>
<li><a href="namespace-BaseX.Dav.html">Dav<span></span></a>
<ul>
<li><a href="namespace-BaseX.Dav.Iterator.html">Iterator</a>
</li>
<li><a href="namespace-BaseX.Dav.Locks.html">Locks</a>
</li>
</ul></li>
<li><a href="namespace-BaseX.Error.html">Error</a>
</li>
<li><a href="namespace-BaseX.Iterator.html">Iterator</a>
</li>
<li><a href="namespace-BaseX.PHPUnit.html">PHPUnit</a>
</li>
<li class="active"><a href="namespace-BaseX.Query.html">Query</a>
</li>
<li><a href="namespace-BaseX.Resource.html">Resource<span></span></a>
<ul>
<li><a href="namespace-BaseX.Resource.Iterator.html">Iterator</a>
</li>
</ul></li>
<li><a href="namespace-BaseX.Session.html">Session</a>
</li>
<li><a href="namespace-BaseX.Silex.html">Silex</a>
</li>
<li><a href="namespace-BaseX.Symfony.html">Symfony<span></span></a>
<ul>
<li><a href="namespace-BaseX.Symfony.Security.html">Security</a>
</li>
</ul></li></ul></li>
<li><a href="namespace-PHP.html">PHP</a>
</li>
</ul>
</div>
<hr />
<div id="elements">
<h3>Classes</h3>
<ul>
<li><a href="class-BaseX.Query.QueryBuilder.html">QueryBuilder</a></li>
<li class="active"><a href="class-BaseX.Query.QueryResults.html">QueryResults</a></li>
</ul>
<h3>Interfaces</h3>
<ul>
<li><a href="class-BaseX.Query.QueryResultsInterface.html">QueryResultsInterface</a></li>
</ul>
</div>
</div>
</div>
<div id="splitter"></div>
<div id="right">
<div id="rightInner">
<form id="search">
<input type="hidden" name="cx" value="" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" class="text" />
<input type="submit" value="Search" />
</form>
<div id="navigation">
<ul>
<li>
<a href="index.html" title="Overview"><span>Overview</span></a>
</li>
<li>
<a href="namespace-BaseX.Query.html" title="Summary of BaseX\Query"><span>Namespace</span></a>
</li>
<li class="active">
<span>Class</span> </li>
</ul>
<ul>
<li>
<a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a>
</li>
<li>
<a href="todo.html" title="Todo list"><span>Todo</span></a>
</li>
</ul>
<ul>
</ul>
</div>
<div id="content" class="class">
<h1>Class QueryResults</h1>
<div class="description">
<p>Iterator for query results</p>
</div>
<dl class="tree">
<dd style="padding-left:0px">
<a href="class-BaseX.Iterator.ArrayWrapper.html"><span>BaseX\Iterator\ArrayWrapper</span></a>
implements
<a href="class-IteratorAggregate.html"><span>IteratorAggregate</span></a>,
<a href="class-ArrayAccess.html"><span>ArrayAccess</span></a>,
<a href="class-Countable.html"><span>Countable</span></a>
</dd>
<dd style="padding-left:30px">
<img src="resources/inherit.png" alt="Extended by" />
<b><span>BaseX\Query\QueryResults</span></b>
implements
<a href="class-BaseX.Query.QueryResultsInterface.html"><span>BaseX\Query\QueryResultsInterface</span></a>
</dd>
</dl>
<div class="info">
<b>Namespace:</b> <a href="namespace-BaseX.html">BaseX</a>\<a href="namespace-BaseX.Query.html">Query</a><br />
<b>Author:</b>
alxarch<br />
<b>Located at</b> <a href="source-class-BaseX.Query.QueryResults.html#27-182" title="Go to source code">src/BaseX/Query/QueryResults.php</a><br />
</div>
<table class="summary" id="methods">
<caption>Methods summary</caption>
<tr data-order="processIterator" id="_processIterator">
<td class="attributes"><code>
protected
<code><a href="class-Traversable.html">Traversable</a></code>
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_processIterator">#</a>
<code><a href="source-class-BaseX.Query.QueryResults.html#44-92" title="Go to source code">processIterator</a>( )</code>
<div class="description short">
<p>Applies all process instructions to the base array iterator/</p>
</div>
<div class="description detailed hidden">
<p>Applies all process instructions to the base array iterator/</p>
<h4>Returns</h4>
<div class="list">
<code><code><a href="class-Traversable.html">Traversable</a></code></code><br />
</div>
<h4>Overrides</h4>
<div class="list"><code><a href="class-BaseX.Iterator.ArrayWrapper.html#_processIterator">BaseX\Iterator\ArrayWrapper::processIterator()</a></code></div>
</div>
</div></td>
</tr>
<tr data-order="addResult" id="_addResult">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_addResult">#</a>
<code><a href="source-class-BaseX.Query.QueryResults.html#94-105" title="Go to source code">addResult</a>( <span>string <var>$data</var></span>, <span>integer <var>$type</var></span> )</code>
<div class="description short">
</div>
<div class="description detailed hidden">
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$data</var></dt>
<dd><code>string</code><br>$data</dd>
<dt><var>$type</var></dt>
<dd><code>integer</code><br>$type</dd>
</dl></div>
<h4>Implementation of</h4>
<div class="list"><code><a href="class-BaseX.Query.QueryResultsInterface.html#_addResult">BaseX\Query\QueryResultsInterface::addResult()</a></code></div>
</div>
</div></td>
</tr>
<tr data-order="supportsType" id="_supportsType">
<td class="attributes"><code>
public
boolean
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_supportsType">#</a>
<code><a href="source-class-BaseX.Query.QueryResults.html#107-115" title="Go to source code">supportsType</a>( <span>string <var>$type</var></span> )</code>
<div class="description short">
</div>
<div class="description detailed hidden">
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$type</var></dt>
<dd><code>string</code><br>$type</dd>
</dl></div>
<h4>Returns</h4>
<div class="list">
<code>boolean</code><br />
</div>
<h4>Implementation of</h4>
<div class="list"><code><a href="class-BaseX.Query.QueryResultsInterface.html#_supportsType">BaseX\Query\QueryResultsInterface::supportsType()</a></code></div>
</div>
</div></td>
</tr>
<tr data-order="supportsMethod" id="_supportsMethod">
<td class="attributes"><code>
public
boolean
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_supportsMethod">#</a>
<code><a href="source-class-BaseX.Query.QueryResults.html#117-125" title="Go to source code">supportsMethod</a>( <span>string <var>$method</var></span> )</code>
<div class="description short">
</div>
<div class="description detailed hidden">
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$method</var></dt>
<dd><code>string</code><br>$method</dd>
</dl></div>
<h4>Returns</h4>
<div class="list">
<code>boolean</code><br />
</div>
<h4>Implementation of</h4>
<div class="list"><code><a href="class-BaseX.Query.QueryResultsInterface.html#_supportsMethod">BaseX\Query\QueryResultsInterface::supportsMethod()</a></code></div>
</div>
</div></td>
</tr>
<tr data-order="parseJSON" id="_parseJSON">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_parseJSON">#</a>
<code><a href="source-class-BaseX.Query.QueryResults.html#127-132" title="Go to source code">parseJSON</a>( <span>mixed <var>$assoc</var> = <span class="php-keyword1">false</span></span>, <span>mixed <var>$depth</var> = <span class="php-num">512</span></span> )</code>
<div class="description short">
</div>
<div class="description detailed hidden">
</div>
</div></td>
</tr>
<tr data-order="parseDateTime" id="_parseDateTime">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_parseDateTime">#</a>
<code><a href="source-class-BaseX.Query.QueryResults.html#134-139" title="Go to source code">parseDateTime</a>( <span>mixed <var>$format</var> = <span class="php-keyword1">null</span></span> )</code>
<div class="description short">
</div>
<div class="description detailed hidden">
</div>
</div></td>
</tr>
<tr data-order="parseSimpleXML" id="_parseSimpleXML">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_parseSimpleXML">#</a>
<code><a href="source-class-BaseX.Query.QueryResults.html#141-146" title="Go to source code">parseSimpleXML</a>( )</code>
<div class="description short">
</div>
<div class="description detailed hidden">
</div>
</div></td>
</tr>
<tr data-order="parseCSV" id="_parseCSV">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_parseCSV">#</a>
<code><a href="source-class-BaseX.Query.QueryResults.html#148-159" title="Go to source code">parseCSV</a>( <span>mixed <var>$header</var> = <span class="php-keyword1">false</span></span>, <span>mixed <var>$delimiter</var> = <span class="php-quote">','</span></span>, <span>mixed <var>$enclosure</var> = <span class="php-quote">'"'</span></span>, <span>mixed <var>$escape</var> = <span class="php-quote">'\\'</span></span> )</code>
<div class="description short">
</div>
<div class="description detailed hidden">
</div>
</div></td>
</tr>
<tr data-order="parseObject" id="_parseObject">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_parseObject">#</a>
<code><a href="source-class-BaseX.Query.QueryResults.html#161-166" title="Go to source code">parseObject</a>( <span>mixed <var>$class</var></span> )</code>
<div class="description short">
</div>
<div class="description detailed hidden">
</div>
</div></td>
</tr>
<tr data-order="parseRegex" id="_parseRegex">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_parseRegex">#</a>
<code><a href="source-class-BaseX.Query.QueryResults.html#168-173" title="Go to source code">parseRegex</a>( <span>mixed <var>$pattern</var></span> )</code>
<div class="description short">
</div>
<div class="description detailed hidden">
</div>
</div></td>
</tr>
<tr data-order="parseCallback" id="_parseCallback">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_parseCallback">#</a>
<code><a href="source-class-BaseX.Query.QueryResults.html#175-180" title="Go to source code">parseCallback</a>( <span><code><a href="class-Closure.html">Closure</a></code> <var>$callback</var></span> )</code>
<div class="description short">
</div>
<div class="description detailed hidden">
</div>
</div></td>
</tr>
</table>
<table class="summary inherited">
<caption>Methods inherited from <a href="class-BaseX.Iterator.ArrayWrapper.html#methods">BaseX\Iterator\ArrayWrapper</a></caption>
<tr>
<td><code>
<a href="class-BaseX.Iterator.ArrayWrapper.html#___construct">__construct()</a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#_count">count()</a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#_filter">filter()</a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#_getFirst">getFirst()</a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#_getIterator">getIterator()</a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#_getLast">getLast()</a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#_getSingle">getSingle()</a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#_grep">grep()</a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#_map">map()</a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#_offsetExists">offsetExists()</a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#_offsetGet">offsetGet()</a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#_offsetSet">offsetSet()</a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#_offsetUnset">offsetUnset()</a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#_reverse">reverse()</a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#_sort">sort()</a>
</code></td>
</tr>
</table>
<table class="summary" id="properties">
<caption>Properties summary</caption>
<tr data-order="data" id="$data">
<td class="attributes"><code>
protected
mixed
</code></td>
<td class="name">
<a href="source-class-BaseX.Query.QueryResults.html#35" title="Go to source code"><var>$data</var></a>
</td>
<td class="value"><code></code></td>
<td class="description"><div>
<a href="#$data" class="anchor">#</a>
<div class="description short">
</div>
<div class="description detailed hidden">
</div>
</div></td>
</tr>
<tr data-order="types" id="$types">
<td class="attributes"><code>
protected
mixed
</code></td>
<td class="name">
<a href="source-class-BaseX.Query.QueryResults.html#36" title="Go to source code"><var>$types</var></a>
</td>
<td class="value"><code></code></td>
<td class="description"><div>
<a href="#$types" class="anchor">#</a>
<div class="description short">
</div>
<div class="description detailed hidden">
</div>
</div></td>
</tr>
<tr data-order="parser" id="$parser">
<td class="attributes"><code>
protected
mixed
</code></td>
<td class="name">
<a href="source-class-BaseX.Query.QueryResults.html#38" title="Go to source code"><var>$parser</var></a>
</td>
<td class="value"><code></code></td>
<td class="description"><div>
<a href="#$parser" class="anchor">#</a>
<div class="description short">
</div>
<div class="description detailed hidden">
</div>
</div></td>
</tr>
<tr data-order="class" id="$class">
<td class="attributes"><code>
protected
mixed
</code></td>
<td class="name">
<a href="source-class-BaseX.Query.QueryResults.html#39" title="Go to source code"><var>$class</var></a>
</td>
<td class="value"><code></code></td>
<td class="description"><div>
<a href="#$class" class="anchor">#</a>
<div class="description short">
</div>
<div class="description detailed hidden">
</div>
</div></td>
</tr>
<tr data-order="csv" id="$csv">
<td class="attributes"><code>
protected
mixed
</code></td>
<td class="name">
<a href="source-class-BaseX.Query.QueryResults.html#40" title="Go to source code"><var>$csv</var></a>
</td>
<td class="value"><code></code></td>
<td class="description"><div>
<a href="#$csv" class="anchor">#</a>
<div class="description short">
</div>
<div class="description detailed hidden">
</div>
</div></td>
</tr>
<tr data-order="json" id="$json">
<td class="attributes"><code>
protected
mixed
</code></td>
<td class="name">
<a href="source-class-BaseX.Query.QueryResults.html#41" title="Go to source code"><var>$json</var></a>
</td>
<td class="value"><code></code></td>
<td class="description"><div>
<a href="#$json" class="anchor">#</a>
<div class="description short">
</div>
<div class="description detailed hidden">
</div>
</div></td>
</tr>
<tr data-order="format" id="$format">
<td class="attributes"><code>
protected
mixed
</code></td>
<td class="name">
<a href="source-class-BaseX.Query.QueryResults.html#42" title="Go to source code"><var>$format</var></a>
</td>
<td class="value"><code></code></td>
<td class="description"><div>
<a href="#$format" class="anchor">#</a>
<div class="description short">
</div>
<div class="description detailed hidden">
</div>
</div></td>
</tr>
</table>
<table class="summary inherited">
<caption>Properties inherited from <a href="class-BaseX.Iterator.ArrayWrapper.html#properties">BaseX\Iterator\ArrayWrapper</a></caption>
<tr>
<td><code>
<a href="class-BaseX.Iterator.ArrayWrapper.html#$callback"><var>$callback</var></a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#$filter"><var>$filter</var></a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#$grep"><var>$grep</var></a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#$iterator"><var>$iterator</var></a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#$reverse"><var>$reverse</var></a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#$sort"><var>$sort</var></a>,
<a href="class-BaseX.Iterator.ArrayWrapper.html#$total"><var>$total</var></a>
</code></td>
</tr>
</table>
</div>
<div id="footer">
basex-php API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
</div>
</div>
</div>
</body>
</html>
| {
"content_hash": "d655a35df8336931c06fde35e11f7670",
"timestamp": "",
"source": "github",
"line_count": 763,
"max_line_length": 437,
"avg_line_length": 23.636959370904325,
"alnum_prop": 0.6176323814804546,
"repo_name": "alxarch/basex-php",
"id": "bc2fff0bf82f61c7efd6de65516caed463b17249",
"size": "18035",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/class-BaseX.Query.QueryResults.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "PHP",
"bytes": "237220"
}
],
"symlink_target": ""
} |
package com.mrtuovinen.skilldemon.web.rest;
import com.mrtuovinen.skilldemon.domain.util.JSR310DateTimeSerializer;
import com.mrtuovinen.skilldemon.domain.util.JSR310LocalDateDeserializer;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.springframework.http.MediaType;
import java.io.IOException;
import java.nio.charset.Charset;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import java.time.ZonedDateTime;
/**
* Utility class for testing REST controllers.
*/
public class TestUtil {
/** MediaType for JSON UTF8 */
public static final MediaType APPLICATION_JSON_UTF8 = new MediaType(
MediaType.APPLICATION_JSON.getType(),
MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8"));
/**
* Convert an object to JSON byte array.
*
* @param object
* the object to convert
* @return the JSON byte array
* @throws IOException
*/
public static byte[] convertObjectToJsonBytes(Object object)
throws IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
JavaTimeModule module = new JavaTimeModule();
module.addSerializer(OffsetDateTime.class, JSR310DateTimeSerializer.INSTANCE);
module.addSerializer(ZonedDateTime.class, JSR310DateTimeSerializer.INSTANCE);
module.addSerializer(LocalDateTime.class, JSR310DateTimeSerializer.INSTANCE);
module.addSerializer(Instant.class, JSR310DateTimeSerializer.INSTANCE);
module.addDeserializer(LocalDate.class, JSR310LocalDateDeserializer.INSTANCE);
mapper.registerModule(module);
return mapper.writeValueAsBytes(object);
}
/**
* Create a byte array with a specific size filled with specified data.
*
* @param size the size of the byte array
* @param data the data to put in the byte array
*/
public static byte[] createByteArray(int size, String data) {
byte[] byteArray = new byte[size];
for (int i = 0; i < size; i++) {
byteArray[i] = Byte.parseByte(data, 2);
}
return byteArray;
}
}
| {
"content_hash": "df06654c9894efa5a3b6985eb45dd942",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 86,
"avg_line_length": 36.353846153846156,
"alnum_prop": 0.7126534066864155,
"repo_name": "spedepekka/skilldemon-server",
"id": "b251824ff8b29bdefa051a229418eaed5797a649",
"size": "2363",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/com/mrtuovinen/skilldemon/web/rest/TestUtil.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "24139"
},
{
"name": "Batchfile",
"bytes": "5006"
},
{
"name": "CSS",
"bytes": "4431"
},
{
"name": "Cucumber",
"bytes": "161"
},
{
"name": "HTML",
"bytes": "89550"
},
{
"name": "Java",
"bytes": "193407"
},
{
"name": "JavaScript",
"bytes": "144195"
},
{
"name": "Shell",
"bytes": "7337"
}
],
"symlink_target": ""
} |
package com.twitter.finagle.zipkin.thrift
import com.twitter.conversions.time._
import com.twitter.finagle.builder.ClientBuilder
import com.twitter.finagle.service.TimeoutFilter
import com.twitter.finagle.stats.{NullStatsReceiver, StatsReceiver}
import com.twitter.finagle.thrift.{ThriftClientFramedCodec, thrift}
import com.twitter.finagle.tracing._
import com.twitter.finagle.util.DefaultTimer
import com.twitter.finagle.{Service, SimpleFilter, tracing}
import com.twitter.util.{Time, Await, Base64StringEncoder, Future}
import java.net.InetSocketAddress
import java.nio.ByteBuffer
import java.util.concurrent.TimeoutException
import org.apache.thrift.protocol.TBinaryProtocol
import org.apache.thrift.transport.TMemoryBuffer
import scala.collection.mutable.{ArrayBuffer, HashMap, SynchronizedMap}
object RawZipkinTracer {
// to make sure we only create one instance of the tracer per host and port
private[this] val map =
new HashMap[String, RawZipkinTracer] with SynchronizedMap[String, RawZipkinTracer]
/**
* @param scribeHost Host to send trace data to
* @param scribePort Port to send trace data to
* @param statsReceiver Where to log information about tracing success/failures
*/
def apply(scribeHost: String = "localhost",
scribePort: Int = 1463,
statsReceiver: StatsReceiver = NullStatsReceiver
): Tracer = synchronized {
val tracer = map.getOrElseUpdate(scribeHost + ":" + scribePort, {
new RawZipkinTracer(
scribeHost,
scribePort,
statsReceiver.scope("zipkin")
)
})
tracer
}
// Try to flush the tracers when we shut
// down. We give it 100ms.
Runtime.getRuntime().addShutdownHook(new Thread {
override def run() {
val tracers = RawZipkinTracer.synchronized(map.values.toSeq)
val joined = Future.join(tracers map(_.flush()))
try {
Await.result(joined, 100.milliseconds)
} catch {
case _: TimeoutException =>
System.err.println("Failed to flush all traces before quitting")
}
}
})
}
/**
* Receives the Finagle generated traces and sends them off to Zipkin via scribe.
* @param scribeHost The scribe host used to send traces to scribe
* @param scribePort The scribe port used to send traces to scribe
* @param statsReceiver We generate stats to keep track of traces sent, failures and so on
*/
private[thrift] class RawZipkinTracer(
scribeHost: String,
scribePort: Int,
statsReceiver: StatsReceiver
) extends Tracer
{
private[this] val protocolFactory = new TBinaryProtocol.Factory()
private[this] val TraceCategory = "zipkin" // scribe category
// this sends off spans after the deadline is hit, no matter if it ended naturally or not.
private[this] val spanMap: DeadlineSpanMap =
new DeadlineSpanMap(this, 120.seconds, statsReceiver, DefaultTimer.twitter)
protected[thrift] val client = {
val transport = ClientBuilder()
.hosts(new InetSocketAddress(scribeHost, scribePort))
.codec(ThriftClientFramedCodec())
.hostConnectionLimit(5)
.daemon(true)
.build()
new scribe.FinagledClient(
new TracelessFilter andThen transport,
new TBinaryProtocol.Factory())
}
protected[thrift] def flush() = spanMap.flush()
/**
* Always sample the request.
*/
def sampleTrace(traceId: TraceId): Option[Boolean] = Some(true)
/**
* Serialize the span, base64 encode and shove it all in a list.
*/
private def createLogEntries(span: Span): Future[Seq[LogEntry]] = Future {
val buffer = new TMemoryBuffer(512) // 512 bytes fits small spans, but it can grow for bigger spans
span.toThrift.write(protocolFactory.getProtocol(buffer))
val thriftBytes = buffer.getArray.take(buffer.length)
val serializedBase64Span = Base64StringEncoder.encode(thriftBytes) + '\n'
Seq(new LogEntry(category = TraceCategory, message = serializedBase64Span))
}
/**
* Log the span data via Scribe.
*/
def logSpan(span: Span): Future[Unit] = {
val logEntries = createLogEntries(span)
logEntries.flatMap(client.log) onSuccess {
case ResultCode.Ok => statsReceiver.scope("log_span").counter("ok").incr()
case ResultCode.TryLater => statsReceiver.scope("log_span").counter("try_later").incr()
case _ => () /* ignore */
} onFailure {
case e: Throwable => statsReceiver.counter("log_span", "error", e.getClass.getName).incr()
} map(_ => ())
}
/**
* Mutate the Span with whatever new info we have.
* If we see an "end" annotation we remove the span and send it off.
*/
protected def mutate(traceId: TraceId)(f: Span => Span) {
val span = spanMap.update(traceId)(f)
// if either two "end annotations" exists we send off the span
if (span.annotations.exists { a =>
a.value.equals(thrift.Constants.CLIENT_RECV) ||
a.value.equals(thrift.Constants.SERVER_SEND) ||
a.value.equals(TimeoutFilter.TimeoutAnnotation)
}) {
spanMap.remove(traceId)
logSpan(span)
}
}
def record(record: Record) {
record.annotation match {
case tracing.Annotation.ClientSend() =>
annotate(record, thrift.Constants.CLIENT_SEND)
case tracing.Annotation.ClientRecv() =>
annotate(record, thrift.Constants.CLIENT_RECV)
case tracing.Annotation.ServerSend() =>
annotate(record, thrift.Constants.SERVER_SEND)
case tracing.Annotation.ServerRecv() =>
annotate(record, thrift.Constants.SERVER_RECV)
case tracing.Annotation.Message(value) =>
annotate(record, value)
case tracing.Annotation.Rpcname(service: String, rpc: String) =>
mutate(record.traceId) { span =>
span.copy(_name = Some(rpc), _serviceName = Some(service))
}
case tracing.Annotation.BinaryAnnotation(key: String, value: Boolean) =>
binaryAnnotation(record, key, ByteBuffer.wrap(Array[Byte](if (value) 1 else 0)), thrift.AnnotationType.BOOL)
case tracing.Annotation.BinaryAnnotation(key: String, value: Array[Byte]) =>
binaryAnnotation(record, key, ByteBuffer.wrap(value), thrift.AnnotationType.BYTES)
case tracing.Annotation.BinaryAnnotation(key: String, value: ByteBuffer) =>
binaryAnnotation(record, key, value, thrift.AnnotationType.BYTES)
case tracing.Annotation.BinaryAnnotation(key: String, value: Short) =>
binaryAnnotation(record, key, ByteBuffer.allocate(2).putShort(0, value), thrift.AnnotationType.I16)
case tracing.Annotation.BinaryAnnotation(key: String, value: Int) =>
binaryAnnotation(record, key, ByteBuffer.allocate(4).putInt(0, value), thrift.AnnotationType.I32)
case tracing.Annotation.BinaryAnnotation(key: String, value: Long) =>
binaryAnnotation(record, key, ByteBuffer.allocate(8).putLong(0, value), thrift.AnnotationType.I64)
case tracing.Annotation.BinaryAnnotation(key: String, value: Double) =>
binaryAnnotation(record, key, ByteBuffer.allocate(8).putDouble(0, value), thrift.AnnotationType.DOUBLE)
case tracing.Annotation.BinaryAnnotation(key: String, value: String) =>
binaryAnnotation(record, key, ByteBuffer.wrap(value.getBytes), thrift.AnnotationType.STRING)
case tracing.Annotation.BinaryAnnotation(key: String, value) => // Throw error?
case tracing.Annotation.LocalAddr(ia: InetSocketAddress) =>
setEndpoint(record, ia)
case tracing.Annotation.ClientAddr(ia: InetSocketAddress) =>
mutate(record.traceId) { span =>
span.copy(bAnnotations = span.bAnnotations ++ Seq(
// use a binary annotation over a regular annotation to avoid a misleading timestamp
BinaryAnnotation(thrift.Constants.CLIENT_ADDR,
ByteBuffer.wrap(Array[Byte](1)),
thrift.AnnotationType.BOOL,
Endpoint.fromSocketAddress(ia))))
}
case tracing.Annotation.ServerAddr(ia: InetSocketAddress) =>
mutate(record.traceId) { span =>
span.copy(bAnnotations = span.bAnnotations ++ Seq(
BinaryAnnotation(thrift.Constants.SERVER_ADDR,
ByteBuffer.wrap(Array[Byte](1)),
thrift.AnnotationType.BOOL,
Endpoint.fromSocketAddress(ia))))
}
}
}
/**
* Sets the endpoint in the span for any future annotations. Also
* sets the endpoint in any previous annotations that lack one.
*/
protected def setEndpoint(record: Record, ia: InetSocketAddress) {
mutate(record.traceId) { span =>
val ep = Endpoint.fromSocketAddress(ia).boundEndpoint
span.copy(endpoint = ep,
annotations = span.annotations map { a =>
if (a.endpoint == Endpoint.Unknown)
ZipkinAnnotation(a.timestamp, a.value, ep, a.duration)
else
a
})
}
}
protected def binaryAnnotation(
record: Record,
key: String,
value: ByteBuffer,
annotationType: thrift.AnnotationType
) = {
mutate(record.traceId) { span =>
span.copy(bAnnotations = span.bAnnotations ++ Seq(
BinaryAnnotation(key, value, annotationType, span.endpoint)))
}
}
/**
* Add this record as a time based annotation.
*/
protected def annotate(record: Record, value: String) = {
mutate(record.traceId) { span =>
span.copy(annotations =
ZipkinAnnotation(record.timestamp, value, span.endpoint, record.duration) +: span.annotations)
}
}
}
/**
* Makes sure we don't trace the Scribe logging.
*/
private[thrift] class TracelessFilter[Req, Rep]()
extends SimpleFilter[Req, Rep]
{
def apply(request: Req, service: Service[Req, Rep]) = {
Trace.unwind {
Trace.clear()
service(request)
}
}
}
| {
"content_hash": "fb1bbfe7fd2ecc85ecc0dbbacc1df3b8",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 116,
"avg_line_length": 39.54435483870968,
"alnum_prop": 0.6833894157234628,
"repo_name": "firebase/finagle",
"id": "693db586d1bbe19ce549389eb4c1d65556fe973d",
"size": "9807",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "finagle-zipkin/src/main/scala/com/twitter/finagle/zipkin/thrift/RawZipkinTracer.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "21775"
},
{
"name": "Diff",
"bytes": "66208"
},
{
"name": "HTML",
"bytes": "3629"
},
{
"name": "Java",
"bytes": "596665"
},
{
"name": "Python",
"bytes": "27134"
},
{
"name": "Ruby",
"bytes": "22132"
},
{
"name": "Scala",
"bytes": "1979895"
},
{
"name": "Shell",
"bytes": "9996"
},
{
"name": "Thrift",
"bytes": "8624"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>standard.db.sql.ODBCColumnSet</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
</head>
<body bgcolor="#ffffff">
<table border="0" width="100%" bgcolor="#F0F0FF">
<tr>
<td>Concept Framework 2.2 documentation</td>
<td align="right"><a href="index.html">Contents</a> | <a href="index_fun.html">Index</a></td>
</tr>
</table>
<h2><a href="standard.db.sql.html">standard.db.sql</a>.ODBCColumnSet</h2>
<table border="0" cellspacing="0" cellpadding="0" width="500" style="border-style:solid;border-width:1px;border-color:#D0D0D0;">
<tr bgcolor="#f0f0f0">
<td><i>Name</i></td>
<td><i>Version</i></td>
<td><i>Deprecated</i></td>
</tr>
<tr bgcolor="#fafafa">
<td><b>ODBCColumnSet</b></td>
<td>version 1.0</td>
<td>no</td>
</tr>
</table>
<br />
<b>Prototype:</b><br />
<table bgcolor="#F0F0F0" width="100%" style="border-style:solid;border-width:1px;border-color:#D0D0D0;"><tr><td><b>boolean ODBCColumnSet(number column_index, string new_value, number statement)</b></td></tr></table>
<br />
<b>Parameters:</b><br />
<table bgcolor="#FFFFFF" style="border-style:solid;border-width:1px;border-color:#D0D0D0;">
<tr>
<td>
<i>column_index</i>
</td>
<td>
[in] the index of the needed column
</td>
</tr>
<tr>
<td>
<i>new_value</i>
</td>
<td>
[in] the new value for the column
</td>
</tr>
<tr>
<td>
<i>statement</i>
</td>
<td>
[in] the statement handle (or result set) as returned by <a href="standard.db.sql.ODBCStatement.html">ODBCStatement</a>, <a href="standard.db.sql.ODBCListTables.html">ODBCListTables</a>, <a href="standard.db.sql.ODBCListColumns.html">ODBCListColumns</a>, <a href="standard.db.sql.ODBCListTypes.html">ODBCListTypes</a> or <a href="standard.db.sql.ODBCExecuteQuery.html">ODBCExecuteQuery</a>
</td>
</tr>
</table>
<br />
<b>Description:</b><br />
<table width="100%" bgcolor="#FAFAFF" style="border-style:solid;border-width:1px;border-color:#D0D0D0;">
<tr><td>
Update data in a column. After data is update, you <a href="standard.db.sql.ODBCUpdate.html">ODBCUpdate</a> should be called.
<br/>
<br/>Note: Not all drivers support positional updates; positional updates are NOT recommended.
<br/>
</td></tr>
</table>
<br />
<b>Returns:</b><br />
Return true if succeeded, false if failed.
<br />
<br />
<!--
<p>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-html40"
alt="Valid HTML 4.0 Transitional" height="31" width="88" border="0"></a>
<a href="http://jigsaw.w3.org/css-validator/">
<img style="border:0;width:88px;height:31px"
src="http://jigsaw.w3.org/css-validator/images/vcss"
alt="Valid CSS!" border="0"/>
</a>
</p>
-->
<table bgcolor="#F0F0F0" width="100%"><tr><td>Documented by Eduard Suica, generation time: Sun Jan 27 18:15:19 2013
GMT</td><td align="right">(c)2013 <a href="http://www.devronium.com">Devronium Applications</a></td></tr></table>
</body>
</html> | {
"content_hash": "6ed75a17d78f54fb621b1b234dc71a0e",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 398,
"avg_line_length": 35.78125,
"alnum_prop": 0.6131004366812227,
"repo_name": "Devronium/ConceptApplicationServer",
"id": "a4654029d6028edf6b8167cd9a3975049f4f73aa",
"size": "3435",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/server/Samples/CIDE/Help/standard.db.sql.ODBCColumnSet.html",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Assembly",
"bytes": "156546"
},
{
"name": "Batchfile",
"bytes": "5629"
},
{
"name": "C",
"bytes": "23814868"
},
{
"name": "C++",
"bytes": "9045245"
},
{
"name": "CSS",
"bytes": "689616"
},
{
"name": "HTML",
"bytes": "27027035"
},
{
"name": "JavaScript",
"bytes": "3907862"
},
{
"name": "M4",
"bytes": "126426"
},
{
"name": "Makefile",
"bytes": "6102928"
},
{
"name": "PHP",
"bytes": "11766"
},
{
"name": "Roff",
"bytes": "10803"
},
{
"name": "SCSS",
"bytes": "2187"
},
{
"name": "Shell",
"bytes": "7230107"
},
{
"name": "Smarty",
"bytes": "83738"
},
{
"name": "XSLT",
"bytes": "16139"
}
],
"symlink_target": ""
} |
import OpenSerialPort
import ReadVIN
import MeasureDistance
import GetPostInterval
import time
def GetVINAndDistance():
interval=GetPostInterval.GetInterval()
serport = OpenSerialPort.Open()
VIN =ReadVIN.VIN(serport)
print "VIN Retrieved in Get VIN and Distance Function = ",VIN
Distance = MeasureDistance.ReadDistance(interval,serport,VIN)
def destroy():
pass
if __name__=='__main__':
try:
while True:
GetVINAndDistance()
except KeyboardInterrupt():
destroy()
| {
"content_hash": "367915999604426209d850f87c3cf1bd",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 63,
"avg_line_length": 24.227272727272727,
"alnum_prop": 0.6885553470919324,
"repo_name": "IDEO-coLAB/vehicle-rec-microservice",
"id": "a99a07cde5945f089f41b157cf782168c1fbc699",
"size": "1155",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "VINAndMileageScanner/GetVINAndDistance.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Makefile",
"bytes": "747"
},
{
"name": "Python",
"bytes": "28472"
}
],
"symlink_target": ""
} |
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
require_once($CFG->libdir.'/formslib.php');
require_once($CFG->dirroot . '/mod/assign/locallib.php');
require_once('HTML/QuickForm/input.php');
/**
* Assignment grade form
*
* @package mod_assign
* @copyright 2012 NetSpot {@link http://www.netspot.com.au}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class mod_assign_grade_form extends moodleform {
/** @var assignment $assignment */
private $assignment;
/**
* Define the form - called by parent constructor.
*/
public function definition() {
$mform = $this->_form;
list($assignment, $data, $params) = $this->_customdata;
// Visible elements.
$this->assignment = $assignment;
$assignment->add_grade_form_elements($mform, $data, $params);
if ($data) {
$this->set_data($data);
}
}
/**
* This is required so when using "Save and next", each form is not defaulted to the previous form.
* Giving each form a unique identitifer is enough to prevent this
* (include the rownum in the form name).
*
* @return string - The unique identifier for this form.
*/
protected function get_form_identifier() {
$params = $this->_customdata[2];
return get_class($this) . '_' . $params['rownum'];
}
/**
* Perform minimal validation on the grade form
* @param array $data
* @param array $files
*/
public function validation($data, $files) {
global $DB;
$errors = parent::validation($data, $files);
$instance = $this->assignment->get_instance();
if ($instance->markingworkflow && !empty($data['sendstudentnotifications']) &&
$data['workflowstate'] != ASSIGN_MARKING_WORKFLOW_STATE_RELEASED) {
$errors['sendstudentnotifications'] = get_string('studentnotificationworkflowstateerror', 'assign');
}
// Advanced grading.
if (!array_key_exists('grade', $data)) {
return $errors;
}
if ($instance->grade > 0) {
if (unformat_float($data['grade'], true) === false && (!empty($data['grade']))) {
$errors['grade'] = get_string('invalidfloatforgrade', 'assign', $data['grade']);
} else if (unformat_float($data['grade']) > $instance->grade) {
$errors['grade'] = get_string('gradeabovemaximum', 'assign', $instance->grade);
} else if (unformat_float($data['grade']) < 0) {
$errors['grade'] = get_string('gradebelowzero', 'assign');
}
} else {
// This is a scale.
if ($scale = $DB->get_record('scale', array('id'=>-($instance->grade)))) {
$scaleoptions = make_menu_from_list($scale->scale);
if ((int)$data['grade'] !== -1 && !array_key_exists((int)$data['grade'], $scaleoptions)) {
$errors['grade'] = get_string('invalidgradeforscale', 'assign');
}
}
}
return $errors;
}
}
| {
"content_hash": "2f73cd970d463549d4829871b5384f4c",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 112,
"avg_line_length": 36.84615384615385,
"alnum_prop": 0.5973382045929019,
"repo_name": "sirromas/george",
"id": "74a407b96af18cb83121af4702cf75c59b42c5c2",
"size": "4077",
"binary": false,
"copies": "48",
"ref": "refs/heads/master",
"path": "lms/mod/assign/gradeform.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "1205"
},
{
"name": "ApacheConf",
"bytes": "240"
},
{
"name": "CSS",
"bytes": "1510088"
},
{
"name": "Gherkin",
"bytes": "1801305"
},
{
"name": "HTML",
"bytes": "9090317"
},
{
"name": "Java",
"bytes": "14870"
},
{
"name": "JavaScript",
"bytes": "13189901"
},
{
"name": "PHP",
"bytes": "80552810"
},
{
"name": "PLSQL",
"bytes": "4867"
},
{
"name": "Perl",
"bytes": "20769"
},
{
"name": "XSLT",
"bytes": "33489"
}
],
"symlink_target": ""
} |
/*
* Creates non-inverted ECC code from line parity
*/
void nand_trans_result(u_char reg2, u_char reg3, u_char *ecc_code);
/*
* Calculate 3 byte ECC code for 256 byte block
*/
void nand_calculate_ecc (const u_char *dat, u_char *ecc_code);
/*
* Detect and correct a 1 bit error for 256 byte block
*/
int nand_correct_data (u_char *dat, u_char *read_ecc, u_char *calc_ecc);
| {
"content_hash": "5607bf74ab6a90f91e192cc855e4d888",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 72,
"avg_line_length": 23.875,
"alnum_prop": 0.680628272251309,
"repo_name": "grea09/wipos",
"id": "f3f1d7e0f6aa005714f628761d6958d6ddbc4072",
"size": "778",
"binary": false,
"copies": "28",
"ref": "refs/heads/master",
"path": "router/platform/include/linux/mtd/nand_ecc.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "10785072"
},
{
"name": "C++",
"bytes": "1918596"
},
{
"name": "Java",
"bytes": "23468"
},
{
"name": "Logos",
"bytes": "52685"
},
{
"name": "Objective-C",
"bytes": "33637"
},
{
"name": "OpenEdge ABL",
"bytes": "3643"
},
{
"name": "Shell",
"bytes": "12883"
},
{
"name": "XC",
"bytes": "49361"
}
],
"symlink_target": ""
} |
package org.kairosdb.core.aggregator;
import org.junit.Before;
import org.junit.Test;
import org.kairosdb.core.DataPoint;
import org.kairosdb.core.datapoints.DoubleDataPoint;
import org.kairosdb.core.datapoints.LegacyLongDataPoint;
import org.kairosdb.core.datapoints.LongDataPoint;
import org.kairosdb.core.datapoints.StringDataPoint;
import org.kairosdb.core.datastore.DataPointGroup;
import org.kairosdb.core.datastore.TimeUnit;
import org.kairosdb.testing.ListDataPointGroup;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
public class LastAggregatorTest
{
private LastAggregator aggregator;
@Before
public void setup()
{
aggregator = new LastAggregator();
aggregator.init();
}
@Test(expected = NullPointerException.class)
public void test_nullSet_invalid()
{
aggregator.aggregate(null);
}
@Test
public void test_longValues()
{
ListDataPointGroup group = new ListDataPointGroup("group");
group.addDataPoint(new LongDataPoint(1, 10));
group.addDataPoint(new LongDataPoint(1, 20));
group.addDataPoint(new LongDataPoint(1, 3));
group.addDataPoint(new LongDataPoint(2, 1));
group.addDataPoint(new LongDataPoint(2, 3));
group.addDataPoint(new LongDataPoint(2, 5));
group.addDataPoint(new LongDataPoint(3, 25));
DataPointGroup results = aggregator.aggregate(group);
DataPoint dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(1L));
assertThat(dataPoint.getLongValue(), equalTo(3L));
dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(2L));
assertThat(dataPoint.getLongValue(), equalTo(5L));
dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(3L));
assertThat(dataPoint.getLongValue(), equalTo(25L));
assertThat(results.hasNext(), equalTo(false));
}
@Test
public void test_doubleValues()
{
ListDataPointGroup group = new ListDataPointGroup("group");
group.addDataPoint(new DoubleDataPoint(1, 10.0));
group.addDataPoint(new DoubleDataPoint(1, 20.3));
group.addDataPoint(new DoubleDataPoint(1, 3.0));
group.addDataPoint(new DoubleDataPoint(2, 1.0));
group.addDataPoint(new DoubleDataPoint(2, 3.2));
group.addDataPoint(new DoubleDataPoint(2, 5.0));
group.addDataPoint(new DoubleDataPoint(3, 25.1));
DataPointGroup results = aggregator.aggregate(group);
DataPoint dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(1L));
assertThat(dataPoint.getDoubleValue(), equalTo(3.0));
dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(2L));
assertThat(dataPoint.getDoubleValue(), equalTo(5.0));
dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(3L));
assertThat(dataPoint.getDoubleValue(), equalTo(25.1));
assertThat(results.hasNext(), equalTo(false));
}
@Test
public void test_mixedTypeValues()
{
ListDataPointGroup group = new ListDataPointGroup("group");
group.addDataPoint(new DoubleDataPoint(1, 10.0));
group.addDataPoint(new DoubleDataPoint(1, 20.3));
group.addDataPoint(new LongDataPoint(1, 3));
group.addDataPoint(new LongDataPoint(2, 1));
group.addDataPoint(new DoubleDataPoint(2, 3.2));
group.addDataPoint(new DoubleDataPoint(2, 5.0));
group.addDataPoint(new DoubleDataPoint(3, 25.1));
group.addDataPoint(new StringDataPoint(3, "23.1"));
group.addDataPoint(new DoubleDataPoint(4, 25.1));
DataPointGroup results = aggregator.aggregate(group);
DataPoint dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(1L));
assertThat(dataPoint.getDoubleValue(), equalTo(3.0));
dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(2L));
assertThat(dataPoint.getDoubleValue(), equalTo(5.0));
dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(3L));
assertThat(((StringDataPoint)dataPoint).getValue(), equalTo("23.1"));
dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(4L));
assertThat(dataPoint.getDoubleValue(), equalTo(25.1));
assertThat(results.hasNext(), equalTo(false));
}
@Test
public void test_withNegativeValues()
{
ListDataPointGroup group = new ListDataPointGroup("group");
group.addDataPoint(new DoubleDataPoint(1, -10.0));
group.addDataPoint(new DoubleDataPoint(1, -20.3));
group.addDataPoint(new LongDataPoint(1, -3));
group.addDataPoint(new DoubleDataPoint(2, 1.0));
group.addDataPoint(new DoubleDataPoint(2, -3.2));
group.addDataPoint(new DoubleDataPoint(2, -5.0));
group.addDataPoint(new DoubleDataPoint(3, -25.1));
group.addDataPoint(new DoubleDataPoint(3, -10.1));
DataPointGroup results = aggregator.aggregate(group);
DataPoint dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(1L));
assertThat(dataPoint.getDoubleValue(), equalTo(-3.0));
dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(2L));
assertThat(dataPoint.getDoubleValue(), equalTo(-5.0));
dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(3L));
assertThat(dataPoint.getDoubleValue(), equalTo(-10.1));
assertThat(results.hasNext(), equalTo(false));
}
@Test
public void test_legacyLongValues()
{
ListDataPointGroup group = new ListDataPointGroup("group");
group.addDataPoint(new LegacyLongDataPoint(1, 10));
group.addDataPoint(new LegacyLongDataPoint(1, 20));
group.addDataPoint(new LegacyLongDataPoint(1, 3));
group.addDataPoint(new LegacyLongDataPoint(1, 1));
group.addDataPoint(new LegacyLongDataPoint(1, 3));
group.addDataPoint(new LegacyLongDataPoint(1, 5));
group.addDataPoint(new LegacyLongDataPoint(1, 25));
DataPointGroup results = aggregator.aggregate(group);
DataPoint dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(1L));
assertThat(dataPoint.getLongValue(), equalTo(25L));
assertThat(results.hasNext(), equalTo(false));
}
@Test
public void test_stringValues()
{
ListDataPointGroup group = new ListDataPointGroup("group");
group.addDataPoint(new StringDataPoint(1, "a"));
group.addDataPoint(new StringDataPoint(1, "b"));
group.addDataPoint(new StringDataPoint(1, "c"));
group.addDataPoint(new StringDataPoint(2, "d"));
group.addDataPoint(new StringDataPoint(2, "e"));
group.addDataPoint(new StringDataPoint(2, "f"));
group.addDataPoint(new StringDataPoint(3, "g"));
DataPointGroup results = aggregator.aggregate(group);
DataPoint dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(1L));
assertThat(((StringDataPoint)dataPoint).getValue(), equalTo("c"));
dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(2L));
assertThat(((StringDataPoint)dataPoint).getValue(), equalTo("f"));
dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(3L));
assertThat(((StringDataPoint)dataPoint).getValue(), equalTo("g"));
assertThat(results.hasNext(), equalTo(false));
}
@Test
public void test_alignStartOn()
{
ListDataPointGroup group = new ListDataPointGroup("group");
group.addDataPoint(new LongDataPoint(0, 11));
group.addDataPoint(new LongDataPoint(1, 10));
group.addDataPoint(new LongDataPoint(2, 20));
group.addDataPoint(new LongDataPoint(3, 3));
group.addDataPoint(new LongDataPoint(5, 1));
group.addDataPoint(new LongDataPoint(6, 3));
group.addDataPoint(new LongDataPoint(7, 5));
group.addDataPoint(new LongDataPoint(8, 25));
LastAggregator lastAggregator = new LastAggregator();
lastAggregator.setSampling(new Sampling(5, TimeUnit.MILLISECONDS));
lastAggregator.setAlignStartTime(true);
lastAggregator.init();
DataPointGroup results = lastAggregator.aggregate(group);
DataPoint dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(0L));
assertThat(dataPoint.getLongValue(), equalTo(3L));
dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(5L));
assertThat(dataPoint.getLongValue(), equalTo(25L));
assertThat(results.hasNext(), equalTo(false));
}
@Test
public void test_alignStartOff()
{
ListDataPointGroup group = new ListDataPointGroup("group");
group.addDataPoint(new LongDataPoint(0, 11));
group.addDataPoint(new LongDataPoint(1, 10));
group.addDataPoint(new LongDataPoint(2, 20));
group.addDataPoint(new LongDataPoint(3, 3));
group.addDataPoint(new LongDataPoint(5, 1));
group.addDataPoint(new LongDataPoint(6, 3));
group.addDataPoint(new LongDataPoint(7, 5));
group.addDataPoint(new LongDataPoint(8, 25));
LastAggregator lastAggregator = new LastAggregator();
lastAggregator.setSampling(new Sampling(5, TimeUnit.MILLISECONDS));
lastAggregator.setAlignStartTime(false);
lastAggregator.init();
DataPointGroup results = lastAggregator.aggregate(group);
DataPoint dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(3L));
assertThat(dataPoint.getLongValue(), equalTo(3L));
dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(8L));
assertThat(dataPoint.getLongValue(), equalTo(25L));
assertThat(results.hasNext(), equalTo(false));
}
@Test
public void test_alignEndOn()
{
ListDataPointGroup group = new ListDataPointGroup("group");
group.addDataPoint(new LongDataPoint(0, 11));
group.addDataPoint(new LongDataPoint(1, 10));
group.addDataPoint(new LongDataPoint(2, 20));
group.addDataPoint(new LongDataPoint(3, 3));
group.addDataPoint(new LongDataPoint(5, 1));
group.addDataPoint(new LongDataPoint(6, 3));
group.addDataPoint(new LongDataPoint(7, 5));
group.addDataPoint(new LongDataPoint(8, 25));
LastAggregator lastAggregator = new LastAggregator();
lastAggregator.setSampling(new Sampling(5, TimeUnit.MILLISECONDS));
lastAggregator.setAlignEndTime(true);
lastAggregator.init();
DataPointGroup results = lastAggregator.aggregate(group);
DataPoint dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(5L));
assertThat(dataPoint.getLongValue(), equalTo(3L));
dataPoint = results.next();
assertThat(dataPoint.getTimestamp(), equalTo(10L));
assertThat(dataPoint.getLongValue(), equalTo(25L));
assertThat(results.hasNext(), equalTo(false));
}
} | {
"content_hash": "e92e64b5b7c64902c7a575f15249a1dd",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 71,
"avg_line_length": 34.33670033670034,
"alnum_prop": 0.7499509707785841,
"repo_name": "kairosdb/kairosdb",
"id": "52561de293971fd2bf640f1ebf04b00e4aeb5131",
"size": "10824",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "src/test/java/org/kairosdb/core/aggregator/LastAggregatorTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "823"
},
{
"name": "CSS",
"bytes": "33310"
},
{
"name": "Dockerfile",
"bytes": "751"
},
{
"name": "Groovy",
"bytes": "25013"
},
{
"name": "HTML",
"bytes": "170783"
},
{
"name": "Java",
"bytes": "1864102"
},
{
"name": "JavaScript",
"bytes": "609562"
},
{
"name": "Mustache",
"bytes": "1421"
},
{
"name": "Python",
"bytes": "8846"
},
{
"name": "Ruby",
"bytes": "9486"
},
{
"name": "Shell",
"bytes": "7186"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.elasticloadbalancing;
import javax.annotation.Generated;
import com.amazonaws.services.elasticloadbalancing.model.*;
import com.amazonaws.*;
import com.amazonaws.services.elasticloadbalancing.waiters.AmazonElasticLoadBalancingWaiters;
/**
* Abstract implementation of {@code AmazonElasticLoadBalancing}. Convenient method forms pass through to the
* corresponding overload that takes a request object, which throws an {@code UnsupportedOperationException}.
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AbstractAmazonElasticLoadBalancing implements AmazonElasticLoadBalancing {
protected AbstractAmazonElasticLoadBalancing() {
}
@Override
public void setEndpoint(String endpoint) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public void setRegion(com.amazonaws.regions.Region region) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public AddTagsResult addTags(AddTagsRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public ApplySecurityGroupsToLoadBalancerResult applySecurityGroupsToLoadBalancer(ApplySecurityGroupsToLoadBalancerRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public AttachLoadBalancerToSubnetsResult attachLoadBalancerToSubnets(AttachLoadBalancerToSubnetsRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public ConfigureHealthCheckResult configureHealthCheck(ConfigureHealthCheckRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public CreateAppCookieStickinessPolicyResult createAppCookieStickinessPolicy(CreateAppCookieStickinessPolicyRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public CreateLBCookieStickinessPolicyResult createLBCookieStickinessPolicy(CreateLBCookieStickinessPolicyRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public CreateLoadBalancerResult createLoadBalancer(CreateLoadBalancerRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public CreateLoadBalancerListenersResult createLoadBalancerListeners(CreateLoadBalancerListenersRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public CreateLoadBalancerPolicyResult createLoadBalancerPolicy(CreateLoadBalancerPolicyRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public DeleteLoadBalancerResult deleteLoadBalancer(DeleteLoadBalancerRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public DeleteLoadBalancerListenersResult deleteLoadBalancerListeners(DeleteLoadBalancerListenersRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public DeleteLoadBalancerPolicyResult deleteLoadBalancerPolicy(DeleteLoadBalancerPolicyRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public DeregisterInstancesFromLoadBalancerResult deregisterInstancesFromLoadBalancer(DeregisterInstancesFromLoadBalancerRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public DescribeInstanceHealthResult describeInstanceHealth(DescribeInstanceHealthRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public DescribeLoadBalancerAttributesResult describeLoadBalancerAttributes(DescribeLoadBalancerAttributesRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public DescribeLoadBalancerPoliciesResult describeLoadBalancerPolicies(DescribeLoadBalancerPoliciesRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public DescribeLoadBalancerPoliciesResult describeLoadBalancerPolicies() {
return describeLoadBalancerPolicies(new DescribeLoadBalancerPoliciesRequest());
}
@Override
public DescribeLoadBalancerPolicyTypesResult describeLoadBalancerPolicyTypes(DescribeLoadBalancerPolicyTypesRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public DescribeLoadBalancerPolicyTypesResult describeLoadBalancerPolicyTypes() {
return describeLoadBalancerPolicyTypes(new DescribeLoadBalancerPolicyTypesRequest());
}
@Override
public DescribeLoadBalancersResult describeLoadBalancers(DescribeLoadBalancersRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public DescribeLoadBalancersResult describeLoadBalancers() {
return describeLoadBalancers(new DescribeLoadBalancersRequest());
}
@Override
public DescribeTagsResult describeTags(DescribeTagsRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public DetachLoadBalancerFromSubnetsResult detachLoadBalancerFromSubnets(DetachLoadBalancerFromSubnetsRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public DisableAvailabilityZonesForLoadBalancerResult disableAvailabilityZonesForLoadBalancer(DisableAvailabilityZonesForLoadBalancerRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public EnableAvailabilityZonesForLoadBalancerResult enableAvailabilityZonesForLoadBalancer(EnableAvailabilityZonesForLoadBalancerRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public ModifyLoadBalancerAttributesResult modifyLoadBalancerAttributes(ModifyLoadBalancerAttributesRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public RegisterInstancesWithLoadBalancerResult registerInstancesWithLoadBalancer(RegisterInstancesWithLoadBalancerRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public RemoveTagsResult removeTags(RemoveTagsRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public SetLoadBalancerListenerSSLCertificateResult setLoadBalancerListenerSSLCertificate(SetLoadBalancerListenerSSLCertificateRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public SetLoadBalancerPoliciesForBackendServerResult setLoadBalancerPoliciesForBackendServer(SetLoadBalancerPoliciesForBackendServerRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public SetLoadBalancerPoliciesOfListenerResult setLoadBalancerPoliciesOfListener(SetLoadBalancerPoliciesOfListenerRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public void shutdown() {
throw new java.lang.UnsupportedOperationException();
}
@Override
public com.amazonaws.ResponseMetadata getCachedResponseMetadata(com.amazonaws.AmazonWebServiceRequest request) {
throw new java.lang.UnsupportedOperationException();
}
@Override
public AmazonElasticLoadBalancingWaiters waiters() {
throw new java.lang.UnsupportedOperationException();
}
}
| {
"content_hash": "1fef1a8c21df26247382c21b96a3c154",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 154,
"avg_line_length": 37.955,
"alnum_prop": 0.7889606112501647,
"repo_name": "dagnir/aws-sdk-java",
"id": "f3a25b6f0f99a98e603092b2291538279746d011",
"size": "8171",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-elasticloadbalancing/src/main/java/com/amazonaws/services/elasticloadbalancing/AbstractAmazonElasticLoadBalancing.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "FreeMarker",
"bytes": "157317"
},
{
"name": "Gherkin",
"bytes": "25556"
},
{
"name": "Java",
"bytes": "165755153"
},
{
"name": "Scilab",
"bytes": "3561"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using JetBrains.Annotations;
namespace MidiStream
{
using Components.Containers.Tracks;
using Components.Header;
/// <summary>
/// Initializes a new instance of <see cref="MidiStream"></see> with given list of <see cref="MidiTrack"/>'s and <see cref="MidiFormat"/>
/// </summary>
public class MidiStream
{
#region Properties
/// <summary>
/// Name of the stream.
/// </summary>
[NotNull]
public string Name { get; }
/// <summary>
/// Gets the format of midi sequence.
/// </summary>
[NotNull]
public MidiFormat Format { get; }
/// <summary>
/// Gets a read-only list of tracks.
/// </summary>
[NotNull]
public IReadOnlyList<MidiTrack> Tracks { get; }
#endregion Properties
internal MidiStream(
[NotNull] IReadOnlyList<MidiTrack> tracks,
[NotNull] MidiFormat format,
[CanBeNull] string name = null)
{
if(tracks == null) throw new ArgumentNullException(nameof(tracks));
if(format == null) throw new ArgumentNullException(nameof(format));
Tracks = tracks;
Format = format;
Name = name ?? "";
}
}
}
| {
"content_hash": "b1c0079ce7e41f39eb3caa8cf97b457c",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 141,
"avg_line_length": 27.489795918367346,
"alnum_prop": 0.5575352635486266,
"repo_name": "MkazemAkhgary/Midi-Player",
"id": "22c84dcde7bd02108b66dcdb567b3419501f060d",
"size": "1349",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MidiStream/MidiStream.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "247130"
}
],
"symlink_target": ""
} |
require 'chefspec'
require_relative 'spec_helper'
describe 'cb-nginx::default' do
let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) }
it 'includes the nginx::source recipe' do
expect(chef_run).to include_recipe('nginx::source')
end
end
| {
"content_hash": "97ad6d364ff6fc78a242ee8bcc46d981",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 68,
"avg_line_length": 24,
"alnum_prop": 0.7234848484848485,
"repo_name": "frkline/cb-nginx",
"id": "4f8cb49a8b10cba573b8af89db0d0a1292d0867a",
"size": "264",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cookbook/spec/nginx_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "14081"
}
],
"symlink_target": ""
} |
#########################################################################################
# This Sample Code is provided for the purpose of illustration only and is not
# intended to be used in a production environment.
#
# WARNING:
# YOU SHOULD NEVER RUN A SCRIPT IN PRODUCTION IF YOU AREN’T 100% CERTAIN OF WHAT IT
# WILL DO. ALL SCRIPTS SHOULD BE THOROUGHLY UNDERSTOOD AND TESTED IN A NON-PRODUCTION
# ENVIRONMENT PRIOR TO BEING USED IN PRODUCTION. THIS HELPS ENSURE THAT PRODUCTION
# PROBLEMS DO NOT OCCUR AS A RESULT OF RUNNING SCRIPTS THAT HAVE NOT BEEN TESTED AND
# VALIDATED BEFOREHAND.
#
# THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY
# OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
#########################################################################################
# // ***************************************************************************
# // ***** Script Header *****
# //
# // Purpose: Create Virtual Machine in Hyper-V with predefined settings
# //
# // Prerequsits: Tested on Windows 10
# //
# // Source/References:
# // http://DeployWindows.com
# // @MattiasFors
# // mattias@deploywindows.com
# //
# // History:
# // 1.0 Created
# // 1.1 Updated VHD Path to .\Virtual Hard Disks to follow standard
# // 1.2 Updated with dropboxes instead of textboxes for CPU and VMSwitch
# // 1.3 Fixes CPU, NIC does not work, tested on Insider 180x
# //
# // ***** End Header *****
# // ***************************************************************************
$global:VMName = $null
$VMPath = "D:\Hyper-V"
$VMBootDVD = "F:\Deploy\Boot\LiteTouchPE_x64.iso"
$VMMemory = 2GB
$VMVHDXSize = 50GB
$VMProcessorCount = 2
$VMGeneration = 2
#$VMBootDevice = "IDE, NetworkAdapter, CD"
$VMNet1 = ""
$VMNet2 = ""
function Check-IsAdmin()
{
#reference: http://www.interact-sw.co.uk/iangblog/2007/02/09/pshdetectelevation
#reference: http://www.leastprivilege.com/AdminTitleBarForPowerShell.aspx
# Get the Current User's Security Token
$windowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$principal=new-object System.Security.Principal.WindowsPrincipal($windowsID)
# Check if it has the Administrator access enabled
return [bool]$principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)
}
function Return-Close {
$Form.Close()
}
function Return-CreateVM {
$global:VMName = $TextBox.Text.ToString().ToUpper()
$global:VMPath = $TextBox1.Text.ToString().ToUpper()
$global:VMBootDVD = $TextBox2.Text.ToString().ToUpper()
$global:VMMemory = [int64]($TextBox3.Text.ToString().ToUpper().Replace('GB','')) * ([int64](1GB))
$global:VMVHDXSize = [int64]($TextBox4.Text.ToString().ToUpper().Replace('GB','')) * ([int64](1GB))
$global:VMProcessorCount = $VMCPU.Items[$VMCPU.SelectedIndex]
$global:VMGeneration = $VMCPUGeneration.Text
$global:VMNet1 = $VMNet1Name.Items[$VMNet1Name.SelectedIndex]
$global:VMNet2 = $VMNet2Name.Items[$VMNet2Name.SelectedIndex]
$Form.Close()
Write-Host $global:VMName
}
function ShowDialogBox()
{
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
$Form = New-Object System.Windows.Forms.Form
$Form.Width = 320
$Form.Height = 400
$Form.Text = "Create a VM"
$DropDownLabel = New-Object System.Windows.Forms.Label
$DropDownLabel.Location = New-Object System.Drawing.Size(10,10)
$DropDownLabel.Size = New-Object System.Drawing.Size(140,20)
$DropDownLabel.Text = "Virtual Machine Name"
$Form.Controls.Add($DropDownLabel)
$TextBox = New-Object System.Windows.Forms.TextBox
$TextBox.Location = New-Object System.Drawing.Size(150,10)
$TextBox.Size = New-Object System.Drawing.Size(140,20)
$TextBox.Text = "LAB1-SRV-"
$Form.Controls.Add($TextBox)
$Button = New-Object System.Windows.Forms.Button
$Button.Location = New-Object System.Drawing.Size(100,40)
$Button.Size = New-Object System.Drawing.Size(100,20)
$Button.Text = "Create VM"
$Button.Add_Click({Return-CreateVM})
$Form.Controls.Add($Button)
#############################
# Extra settings
# VM Path
$DropDownLabel = New-Object System.Windows.Forms.Label
$DropDownLabel.Location = New-Object System.Drawing.Size(10,90)
$DropDownLabel.Size = New-Object System.Drawing.Size(140,20)
$DropDownLabel.Text = "VM Path"
$Form.Controls.Add($DropDownLabel)
$TextBox1 = New-Object System.Windows.Forms.TextBox
$TextBox1.Location = New-Object System.Drawing.Size(150,90)
$TextBox1.Size = New-Object System.Drawing.Size(100,20)
$TextBox1.Text = $VMPath
$Form.Controls.Add($TextBox1)
#VMBoot DVD
$DropDownLabel = New-Object System.Windows.Forms.Label
$DropDownLabel.Location = New-Object System.Drawing.Size(10,120)
$DropDownLabel.Size = New-Object System.Drawing.Size(140,20)
$DropDownLabel.Text = "VM Boot DVD"
$Form.Controls.Add($DropDownLabel)
$TextBox2 = New-Object System.Windows.Forms.TextBox
$TextBox2.Location = New-Object System.Drawing.Size(150,120)
$TextBox2.Size = New-Object System.Drawing.Size(140,20)
$TextBox2.Text = $VMBootDVD
$Form.Controls.Add($TextBox2)
#VMMemory
$DropDownLabel = New-Object System.Windows.Forms.Label
$DropDownLabel.Location = New-Object System.Drawing.Size(10,150)
$DropDownLabel.Size = New-Object System.Drawing.Size(140,20)
$DropDownLabel.Text = "VM Memory (Ex 2GB)"
$Form.Controls.Add($DropDownLabel)
$TextBox3 = New-Object System.Windows.Forms.TextBox
$TextBox3.Location = New-Object System.Drawing.Size(150,150)
$TextBox3.Size = New-Object System.Drawing.Size(100,20)
$TextBox3.Text = ($VMMemory / 1GB)
$TextBox3.Text += "GB"
$Form.Controls.Add($TextBox3)
#VMVHDXSize
$DropDownLabel = New-Object System.Windows.Forms.Label
$DropDownLabel.Location = New-Object System.Drawing.Size(10,180)
$DropDownLabel.Size = New-Object System.Drawing.Size(140,20)
$DropDownLabel.Text = "VM VHDX Size (Ex 50GB)"
$Form.Controls.Add($DropDownLabel)
$TextBox4 = New-Object System.Windows.Forms.TextBox
$TextBox4.Location = New-Object System.Drawing.Size(150,180)
$TextBox4.Size = New-Object System.Drawing.Size(100,20)
$TextBox4.Text = ($VMVHDXSize / 1GB)
$TextBox4.Text += "GB"
$Form.Controls.Add($TextBox4)
#VMProcessorCount
$DropDownLabel = New-Object System.Windows.Forms.Label
$DropDownLabel.Location = New-Object System.Drawing.Size(10,210)
$DropDownLabel.Size = New-Object System.Drawing.Size(140,20)
$DropDownLabel.Text = "VM CPU Count"
$Form.Controls.Add($DropDownLabel)
$VMCPU = New-Object System.Windows.Forms.ComboBox
$VMCPU.Location = New-Object System.Drawing.Size(150,210)
$VMCPU.Size = New-Object System.Drawing.Size(140,20)
$VMCPU.DropDownStyle = [System.Windows.Forms.ComboBoxStyle]::DropDownList
$VMCPU.FlatStyle = [System.Windows.Forms.FlatStyle]::Flat
$VMCPU.Sorted = $true
$VMCPU.AutoCompleteMode = [System.Windows.Forms.AutoCompleteMode]::None
$VMCPU.Items.AddRange(1..(Get-VMHost).LogicalProcessorCount)
$VMCPU.SelectedIndex = $i = 0
foreach ($item in $VMCPU.Items.GetEnumerator()) {
if ($item.ToString() -like $VMProcessorCount) { $VMCPU.SelectedIndex = $i }
$i++
}
$Form.Controls.Add($VMCPU)
# VMGeneration
$DropDownLabel = New-Object System.Windows.Forms.Label
$DropDownLabel.Location = New-Object System.Drawing.Size(10,240)
$DropDownLabel.Size = New-Object System.Drawing.Size(140,20)
$DropDownLabel.Text = "VM Generation"
$Form.Controls.Add($DropDownLabel)
$VMCPUGeneration = New-Object System.Windows.Forms.TextBox
$VMCPUGeneration.Location = New-Object System.Drawing.Size(150,240)
$VMCPUGeneration.Size = New-Object System.Drawing.Size(100,20)
$VMCPUGeneration.Text = $VMGeneration
$Form.Controls.Add($VMCPUGeneration)
# VMNet1 Virtual Network Switch 1
$DropDownLabel = New-Object System.Windows.Forms.Label
$DropDownLabel.Location = New-Object System.Drawing.Size(10,270)
$DropDownLabel.Size = New-Object System.Drawing.Size(140,20)
$DropDownLabel.Text = "VM Network 1"
$Form.Controls.Add($DropDownLabel)
$VMNet1Name = New-Object System.Windows.Forms.ComboBox
$VMNet1Name.Location = New-Object System.Drawing.Size(150,270)
$VMNet1Name.Size = New-Object System.Drawing.Size(140,20)
$VMNet1Name.DropDownStyle = [System.Windows.Forms.ComboBoxStyle]::DropDownList
$VMNet1Name.FlatStyle = [System.Windows.Forms.FlatStyle]::Flat
$VMNet1Name.Sorted = $true
$VMNet1Name.AutoCompleteMode = [System.Windows.Forms.AutoCompleteMode]::None
$VMNet1Name.Items.AddRange((Get-VMSwitch).Name)
$VMNet1Name.SelectedIndex = $i = 0
foreach ($item in $VMNet1Name.Items.GetEnumerator()) {
if ($item.ToString() -like $VMNet1) { $VMNet1Name.SelectedIndex = $i }
$i++
}
$Form.Controls.Add($VMNet1Name)
# VMNet2 Virtual Network Switch 2
$DropDownLabel = New-Object System.Windows.Forms.Label
$DropDownLabel.Location = New-Object System.Drawing.Size(10,300)
$DropDownLabel.Size = New-Object System.Drawing.Size(140,20)
$DropDownLabel.Text = "VM Network 2"
$Form.Controls.Add($DropDownLabel)
$VMNet2Name = New-Object System.Windows.Forms.ComboBox
$VMNet2Name.Location = New-Object System.Drawing.Size(150,300)
$VMNet2Name.Size = New-Object System.Drawing.Size(140,20)
$VMNet2Name.DropDownStyle = [System.Windows.Forms.ComboBoxStyle]::DropDownList
$VMNet2Name.FlatStyle = [System.Windows.Forms.FlatStyle]::Flat
$VMNet2Name.Sorted = $true
$VMNet2Name.AutoCompleteMode = [System.Windows.Forms.AutoCompleteMode]::None
$VMNet2Name.Items.AddRange((Get-VMSwitch).Name)
$VMNet2Name.SelectedIndex = $i = 0
foreach ($item in $VMNet2Name.Items.GetEnumerator()) {
if ($item.ToString() -like $VMNet2) { $VMNet2Name.SelectedIndex = $i }
$i++
}
$Form.Controls.Add($VMNet2Name)
$Form.Add_Shown({$Form.Activate()})
$Form.ShowDialog()
}
# Activate Elevated privilege if not already done
if ( (check-isadmin).Equals($false) )
{
Write-Host -ForegroundColor Red -BackgroundColor Black "ERROR: Script must run elevated"
Write-Host
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
$Form = New-Object System.Windows.Forms.Form
$Form.Width = 300
$Form.Height = 120
$Form.Text = "Error"
$DropDownLabel = New-Object System.Windows.Forms.Label
$DropDownLabel.Location = New-Object System.Drawing.Size(10,10)
$DropDownLabel.Size = New-Object System.Drawing.Size(280,20)
$DropDownLabel.Text = "Your need to start this as elevated"
$Form.Controls.Add($DropDownLabel)
$Button = New-Object System.Windows.Forms.Button
$Button.Location = New-Object System.Drawing.Size(100,40)
$Button.Size = New-Object System.Drawing.Size(100,20)
$Button.Text = "Close"
$Button.Add_Click({Return-Close})
$Form.Controls.Add($Button)
$Form.Add_Shown({$Form.Activate()})
$Form.ShowDialog()
#$host.SetShouldExit(0)
}
else
{
$DialogBoxReturn = ShowDialogBox
$VMName = $global:VMName
$VMPath = $global:VMPath
$VMBootDVD = $global:VMBootDVD
$VMMemory = $global:VMMemory
$VMVHDXSize = $global:VMVHDXSize
$VMProcessorCount = $global:VMProcessorCount
$VMGeneration = $global:VMGeneration
$VMNet1 = $global:VMNet1
$VMNet2 = $global:VMNet2
Write-Host "CPU Count $($VMProcessorCount)"
if (($VMName -ne $null) -and ($VMName.Length -gt 1))
{
Write-Host "Creating Hyper-V Virtual Machine with name: $VMName"
#Create VM
#$VMVHDXPath = "$VMPath\$VMName\VHD\$VMName-1.vhdx"
$VMVHDXPath = Join-Path -Path (Join-Path -Path $VMPath -ChildPath "$($VMName)\Virtual Hard Disks") -ChildPath "$($VMName)-1.vhdx"
#$VMPath = "$VMPath\$VMName" # this will set the Virtual Machine config files in a sub subfolder
# New-VM -Name $VMName -MemoryStartupBytes $VMMemory -NewVHDPath $VMVHDXPath -NewVHDSizeBytes $VMVHDXSize -Path $VMPath -BootDevice $VMBootDevice -Generation $VMGeneration
New-VM -Name $VMName -MemoryStartupBytes $VMMemory -NewVHDPath $VMVHDXPath -NewVHDSizeBytes $VMVHDXSize -Path $VMPath -Generation $VMGeneration
Set-VMMemory -VMName $VMName -DynamicMemoryEnabled $true -MinimumBytes ($VMMemory/4) -MaximumBytes $VMMemory
Rename-VMNetworkAdapter -VMName $VMName -Name (Get-VMNetworkAdapter -VMName $VMName).Name -NewName "VMNet1"
$VMBootNet0 = Get-VMNetworkAdapter -VMName $VMName -Name "VMNet1"
$VMHardDiskDrive1 = Get-VMHardDiskDrive $VMName
#Add a default Boot.iso
if ((Test-Path -Path $VMBootDVD) -eq $true) {
Add-VMDvdDrive -VMName $VMName -Path $VMBootDVD
} else {
Add-VMDvdDrive -VMName $VMName
}
$VMDvdDrive = Get-VMDvdDrive -VMName $VMName -ControllerNumber 0 -ControllerLocation 1
# Set processors
Set-VM -Name $VMName -ProcessorCount $VMProcessorCount
# Add extra NICs
if ($VMNet1.Length -gt 0) {
Add-VMNetworkAdapter -VMName $VMName -SwitchName $VMNet2 -Name "VMNet2" -IsLegacy $false
}
else {
Add-VMNetworkAdapter -VMName $VMName -Name "VMNet2" -IsLegacy $false
}
$VMBootNet1 = Get-VMNetworkAdapter -VMName $VMName -Name "VMNet1"
$VMBootNet2 = Get-VMNetworkAdapter -VMName $VMName -Name "VMNet2"
#Add Boot to DVD, Harddisk and one of the NICs
Set-VMFirmware -VMName $VMName -EnableSecureBoot On -PreferredNetworkBootProtocol IPv4 -BootOrder $VMDvdDrive, $VMHardDiskDrive1, $VMBootNet0, $VMBootNet1, $VMBootNet2
}
else
{
Write-Host "Error or you cancelled"
}
}
| {
"content_hash": "2c90ad65c45871b8e4c251d6e359f150",
"timestamp": "",
"source": "github",
"line_count": 343,
"max_line_length": 178,
"avg_line_length": 41.43731778425656,
"alnum_prop": 0.6795891085625836,
"repo_name": "DeployWindowsInfo/PowerShell",
"id": "089bb15b2aa3dd6d6c3bcfddb009a44ff738976f",
"size": "14217",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Hyper-V/CreateStandardVM.ps1",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PowerShell",
"bytes": "14210"
}
],
"symlink_target": ""
} |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.semlink.csv</groupId>
<artifactId>annotatedCSV</artifactId>
<version>0.3.3</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
| {
"content_hash": "5aa23ba1a26560cfdbcf69b78270f453",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 104,
"avg_line_length": 30.571428571428573,
"alnum_prop": 0.6838006230529595,
"repo_name": "sgnitkowitz/annotatedCSV",
"id": "c9bc3481ab73746846bb46cab4534cd46bad8779",
"size": "642",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pom.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "14983"
}
],
"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_272) on Thu Oct 21 09:13:59 PDT 2021 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class com.fasterxml.jackson.databind.util.JSONPObject (jackson-databind 2.13.0 API)</title>
<meta name="date" content="2021-10-21">
<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 Class com.fasterxml.jackson.databind.util.JSONPObject (jackson-databind 2.13.0 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../com/fasterxml/jackson/databind/util/JSONPObject.html" title="class in com.fasterxml.jackson.databind.util">Class</a></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>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/fasterxml/jackson/databind/util/class-use/JSONPObject.html" target="_top">Frames</a></li>
<li><a href="JSONPObject.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">
<h2 title="Uses of Class com.fasterxml.jackson.databind.util.JSONPObject" class="title">Uses of Class<br>com.fasterxml.jackson.databind.util.JSONPObject</h2>
</div>
<div class="classUseContainer">No usage of com.fasterxml.jackson.databind.util.JSONPObject</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><a href="../../../../../../com/fasterxml/jackson/databind/util/JSONPObject.html" title="class in com.fasterxml.jackson.databind.util">Class</a></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>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/fasterxml/jackson/databind/util/class-use/JSONPObject.html" target="_top">Frames</a></li>
<li><a href="JSONPObject.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 © 2008–2021 <a href="http://fasterxml.com/">FasterXML</a>. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "6249a985c28b7d6387da8b44c774da46",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 157,
"avg_line_length": 38.06349206349206,
"alnum_prop": 0.6163469557964971,
"repo_name": "FasterXML/jackson-databind",
"id": "7543e081911cf447c58c12d9b9c5d6fa218cc7f7",
"size": "4796",
"binary": false,
"copies": "1",
"ref": "refs/heads/2.15",
"path": "docs/javadoc/2.13/com/fasterxml/jackson/databind/util/class-use/JSONPObject.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "7940640"
},
{
"name": "Logos",
"bytes": "173041"
},
{
"name": "Shell",
"bytes": "264"
}
],
"symlink_target": ""
} |
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/minimongo.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/minimongo.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/minimongo"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/minimongo"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
make -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
| {
"content_hash": "41be2fa4607f47321c7dbd3b1c42d19a",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 133,
"avg_line_length": 35.82539682539682,
"alnum_prop": 0.7000443066016836,
"repo_name": "slacy/minimongo",
"id": "320388ae77babbf702601f9b7105d8550049dbe1",
"size": "4606",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/Makefile",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Python",
"bytes": "203525"
}
],
"symlink_target": ""
} |
package com.phloc.commons.parent;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nullable;
public final class MockChildrenProviderWithUniqueID extends MockChildrenProvider implements
IChildrenProviderWithUniqueID <String, MockHasChildren>
{
private final Map <String, MockHasChildren> m_aMap = new HashMap <String, MockHasChildren> ();
public MockChildrenProviderWithUniqueID (@Nullable final MockHasChildren... aChildren)
{
if (aChildren != null)
for (final MockHasChildren aChild : aChildren)
m_aMap.put (aChild.getID (), aChild);
}
@Nullable
public MockHasChildren getItemWithID (@Nullable final String sID)
{
return m_aMap.get (sID);
}
}
| {
"content_hash": "143891fce1ff131de1ccac843b5f91b6",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 135,
"avg_line_length": 30.423076923076923,
"alnum_prop": 0.6776232616940582,
"repo_name": "lsimons/phloc-schematron-standalone",
"id": "a5a0e8eb91bca2ecd0371000ceb23139d04260a7",
"size": "1452",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "phloc-commons/src/test/java/com/phloc/commons/parent/MockChildrenProviderWithUniqueID.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Many box plots</title>
<link rel=stylesheet type="text/css" href="manyboxplots.css">
<script type="text/javascript" src="../d3/d3.js"></script>
<script type="text/javascript" src="../d3-tip/d3.tip.js"></script>
</head>
<body>
<script type="text/javascript" src="manyboxplots.js"></script>
<p>Top panel is like 500 box plots:
lines are drawn at the 1, 5, 10, 25, 50, 75, 90, 95, 99 percentiles
for each of 500 distributions</p>
<p>Hover over a column in the top panel and the corresponding distribution
is show below; click for it to persist; click again to make it go away.</p>
</body>
</html> | {
"content_hash": "2944f5eb8d859c83c7542347799caa88",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 75,
"avg_line_length": 31.40909090909091,
"alnum_prop": 0.678726483357453,
"repo_name": "kbroman/d3examples",
"id": "fae8bbc40a9bc9b8a24744ab96e6c3e04fc50d10",
"size": "691",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "manyboxplots/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9228"
},
{
"name": "CoffeeScript",
"bytes": "268144"
},
{
"name": "HTML",
"bytes": "44547"
},
{
"name": "JavaScript",
"bytes": "19030"
},
{
"name": "Makefile",
"bytes": "6477"
},
{
"name": "Python",
"bytes": "2378"
},
{
"name": "R",
"bytes": "36372"
},
{
"name": "Shell",
"bytes": "168"
}
],
"symlink_target": ""
} |
<?php
declare(strict_types=1);
namespace Picodexter\ParameterEncryptionBundle\Encryption\Decrypter\Decorator;
use Picodexter\ParameterEncryptionBundle\Encryption\Decrypter\DecrypterInterface;
use Picodexter\ParameterEncryptionBundle\Encryption\Key\KeyNotEmptyValidatorInterface;
/**
* KeyNotEmptyDecrypterDecorator.
*/
class KeyNotEmptyDecrypterDecorator implements DecrypterInterface
{
/**
* @var DecrypterInterface
*/
private $decrypter;
/**
* @var KeyNotEmptyValidatorInterface
*/
private $keyNotEmptyValidator;
/**
* Constructor.
*
* @param DecrypterInterface $decrypter
* @param KeyNotEmptyValidatorInterface $keyNotEmptyValidator
*/
public function __construct(DecrypterInterface $decrypter, KeyNotEmptyValidatorInterface $keyNotEmptyValidator)
{
$this->decrypter = $decrypter;
$this->keyNotEmptyValidator = $keyNotEmptyValidator;
}
/**
* @inheritDoc
*/
public function decryptValue($encryptedValue, $decryptionKey)
{
$this->keyNotEmptyValidator->assertKeyNotEmpty($decryptionKey);
return $this->decrypter->decryptValue($encryptedValue, $decryptionKey);
}
}
| {
"content_hash": "f4b37d73c85ef819d55565643a27ee87",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 115,
"avg_line_length": 25.458333333333332,
"alnum_prop": 0.7144026186579379,
"repo_name": "picodexter/PcdxParameterEncryptionBundle",
"id": "083afec98546ad5aec9f937f1849c89008a80126",
"size": "1471",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Encryption/Decrypter/Decorator/KeyNotEmptyDecrypterDecorator.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "718821"
}
],
"symlink_target": ""
} |
// Simplified version of Google's logging.
#ifndef RE2_UTIL_LOGGING_H__
#define RE2_UTIL_LOGGING_H__
#include <sstream>
#ifdef WIN32
#include <io.h>
#endif
// Debug-only checking.
#define DCHECK(condition) assert(condition)
#define DCHECK_EQ(val1, val2) assert((val1) == (val2))
#define DCHECK_NE(val1, val2) assert((val1) != (val2))
#define DCHECK_LE(val1, val2) assert((val1) <= (val2))
#define DCHECK_LT(val1, val2) assert((val1) < (val2))
#define DCHECK_GE(val1, val2) assert((val1) >= (val2))
#define DCHECK_GT(val1, val2) assert((val1) > (val2))
// Always-on checking
#define CHECK(x) if(x){}else LogMessageFatal(__FILE__, __LINE__).stream() << "Check failed: " #x
#define CHECK_LT(x, y) CHECK((x) < (y))
#define CHECK_GT(x, y) CHECK((x) > (y))
#define CHECK_LE(x, y) CHECK((x) <= (y))
#define CHECK_GE(x, y) CHECK((x) >= (y))
#define CHECK_EQ(x, y) CHECK((x) == (y))
#define CHECK_NE(x, y) CHECK((x) != (y))
#define LOG_INFO LogMessage(__FILE__, __LINE__)
#define LOG_ERROR LOG_INFO
#define LOG_WARNING LOG_INFO
#define LOG_FATAL LogMessageFatal(__FILE__, __LINE__)
#define LOG_QFATAL LOG_FATAL
#define VLOG(x) if((x)>0){}else LOG_INFO.stream()
#ifdef NDEBUG
#define DEBUG_MODE 0
#define LOG_DFATAL LOG_ERROR
#else
#define DEBUG_MODE 1
#define LOG_DFATAL LOG_FATAL
#endif
#define LOG(severity) LOG_ ## severity.stream()
class LogMessage {
public:
LogMessage(const char* file, int line) {
stream() << file << ":" << line << ": ";
}
~LogMessage() {
stream() << "\n";
string s = str_.str();
if(write(2, s.data(), s.size()) < 0) {} // shut up gcc
}
ostream& stream() { return str_; }
private:
std::ostringstream str_;
DISALLOW_EVIL_CONSTRUCTORS(LogMessage);
};
class LogMessageFatal : public LogMessage {
public:
LogMessageFatal(const char* file, int line)
: LogMessage(file, line) { }
~LogMessageFatal() {
std::cerr << "\n";
abort();
}
private:
DISALLOW_EVIL_CONSTRUCTORS(LogMessageFatal);
};
#endif // RE2_UTIL_LOGGING_H__
| {
"content_hash": "4d3639c7573625d9a2f2085f9dbdd4df",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 96,
"avg_line_length": 26.948051948051948,
"alnum_prop": 0.6187951807228915,
"repo_name": "chromium/vs-chromium",
"id": "d2af440b25cd7c96cec818e2340f3f38eecad041",
"size": "2239",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "third_party/re2-2011-09-30-src-win32/re2/util/logging.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "6989"
},
{
"name": "C",
"bytes": "889"
},
{
"name": "C#",
"bytes": "1680231"
},
{
"name": "C++",
"bytes": "40185"
},
{
"name": "Python",
"bytes": "166"
}
],
"symlink_target": ""
} |
package com.smartdevicelink.transport;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.BindException;
import java.net.ServerSocket;
import java.net.Socket;
import com.smartdevicelink.util.*;
public class SiphonServer {
// Prohibit use of no-arg ctor
private SiphonServer() {}
enum SiphonDataType {
fromSdl,
fromApp,
appLog,
formattedTrace,
baselineTimeStamp,
traceSettings
}
// Boolean to enable/disable the siphon
private static Boolean m_siphonEnabled = false;
// Boolean to determine if the siphon has been initialized
private static Boolean m_siphonInitialized = false;
private static Boolean m_foundOpenSocket = false;
private static Socket m_siphonSocket = null;
private static Object m_siphonLock = new Object();
private static ServerSocket m_listeningSocket = null;
private static short m_listenPort = -1;
private static OutputStream m_siphonSocketOutputStream = null;
private static SiphonServerThread m_siphonClientThread = null;
// Initial timestamp in MS
private static long m_startTimeStamp = 0;
// SDL Trace Message Version
private static byte m_sdlTraceMsgVersionNumber = 1;
// Max number of ports to attempt a connection on
private final static Integer MAX_NUMBER_OF_PORT_ATTEMPTS = 20;
// Starting port for future port attempts
private final static short FIRST_PORT_TO_ATTEMPT_CONNECTION = 7474;
// Boolean to determine if formatted trace is being sent
private static Boolean m_sendingFormattedTrace = false;
public static short enableSiphonServer() {
m_siphonEnabled = true;
SiphonServer.init();
return m_listenPort;
}
public static Boolean getSiphonEnabledStatus() {
return m_siphonEnabled;
}
public static short disableSiphonServer() {
if (!m_siphonEnabled) {
m_listenPort = -1;
} else {
m_siphonEnabled = false;
}
m_siphonInitialized = false;
try {
SiphonServer.closeServer();
} catch (IOException e) {
e.printStackTrace();
}
return m_listenPort;
}
public static boolean init() {
// Only initialize if the siphon has not been initialized previously
// Check here to be lean. If true, no need to sdlhronize
if (m_siphonInitialized) {
return true;
}
synchronized (m_siphonLock) {
// To prevent a race condition, re-check m_siphonInitialized inside of sdlhronize block
if (!m_siphonInitialized) {
if (m_siphonClientThread == null) {
// Set current time stamp
m_startTimeStamp = System.currentTimeMillis();
// Start Siphon Thread
m_siphonClientThread = new SiphonServerThread();
m_siphonClientThread.setName("Siphon");
m_siphonClientThread.setDaemon(true);
m_foundOpenSocket = m_siphonClientThread.findOpenSocket(FIRST_PORT_TO_ATTEMPT_CONNECTION);
m_siphonClientThread.start();
m_siphonInitialized = true;
} // end-if
} // end-lock
}
return m_siphonInitialized;
} // end-method
public static void closeServer() throws IOException {
if (m_siphonClientThread != null) {
m_siphonClientThread.halt();
m_siphonClientThread = null;
}
if (m_listeningSocket != null) {
m_listeningSocket.close();
m_listeningSocket = null;
}
if (m_siphonSocket != null) {
m_siphonSocket.close();
m_siphonSocket = null;
}
if (m_siphonSocketOutputStream != null) {
m_siphonSocketOutputStream.close();
m_siphonSocketOutputStream = null;
}
}
public static Boolean sendBytesFromAPP(byte[] msgBytes, int offset, int length) {
if (m_sendingFormattedTrace) {
return false;
}
return sendSiphonData(SiphonDataType.fromApp, msgBytes, offset, length);
} // end-method
public static Boolean sendBytesFromSDL(byte[] msgBytes, int offset, int length) {
if (m_sendingFormattedTrace) {
return false;
}
return sendSiphonData(SiphonDataType.fromSdl, msgBytes, offset, length);
} // end-method
public static Boolean sendSiphonLogData(String message) {
if (m_sendingFormattedTrace) {
return false;
}
if (message == null || message.length() == 0) {
return false;
}
byte messageBytes[] = null;
int messageLength = 0;
try {
messageBytes = message.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
return false;
}
messageLength = messageBytes.length;
return sendSiphonData(SiphonDataType.appLog, messageBytes, 0, messageLength);
}
public static Boolean sendFormattedTraceMessage(String message) {
if (message == null || message.length() == 0) {
return false;
}
byte messageBytes[] = null;
int messageLength = 0;
try {
messageBytes = message.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
return false;
}
messageLength = messageBytes.length;
if (sendSiphonData(SiphonDataType.formattedTrace, messageBytes, 0, messageLength)) {
m_sendingFormattedTrace = true;
return true;
} else {
return false;
}
}
private static Boolean sendSiphonData(SiphonDataType direction, byte[] msgBytes, int offset, int length) {
byte siphonDataTypeIndicator = 0x00;
long currentDateTime = System.currentTimeMillis();
Integer deltaTimeMills = null;
deltaTimeMills = (int)(currentDateTime - m_startTimeStamp);
switch(direction) {
case fromSdl:
siphonDataTypeIndicator = 0x00;
break;
case fromApp:
siphonDataTypeIndicator = 0x01;
break;
case appLog:
siphonDataTypeIndicator = 0x02;
break;
case formattedTrace:
siphonDataTypeIndicator = 0x03;
break;
case baselineTimeStamp:
siphonDataTypeIndicator = 0x04;
break;
case traceSettings:
siphonDataTypeIndicator = 0x05;
break;
default:
siphonDataTypeIndicator = 0x00;
break;
}
// Set high bit to indicate new format
siphonDataTypeIndicator = (byte)((byte)0x80 | siphonDataTypeIndicator);
return sendDataToSiphonSocket(siphonDataTypeIndicator, deltaTimeMills, msgBytes, offset, length);
}
private synchronized static Boolean sendDataToSiphonSocket(byte directionIndicator, Integer timeStamp,
byte[] msgBytes, int offset, int length) {
if (!m_siphonEnabled) {
return false;
}
if (msgBytes == null || length == 0) {
return false;
}
OutputStream siphonOutputStream = null;
synchronized (m_siphonLock) {
siphonOutputStream = m_siphonSocketOutputStream;
} // end-lock
if (siphonOutputStream == null) {
return false;
}
try {
// blobSize = length(of message) + 1(size of direction indicator)
// + 1 (size of msgVersionNumber) + 4 (size of timeStamp)
int blobSize = length + 1 + 1 + 4;
siphonOutputStream.write(BitConverter.intToByteArray(blobSize));
siphonOutputStream.write(new byte[] {directionIndicator});
siphonOutputStream.write(new byte[] {m_sdlTraceMsgVersionNumber});
siphonOutputStream.write(intToByteArray(timeStamp));
siphonOutputStream.write(msgBytes, offset, length);
} catch (Exception ex) {
return false;
} // end-catch
return true;
} // end-method
private static class SiphonServerThread extends Thread {
private Boolean isHalted = false;
short listenPort;
public void halt() {
isHalted = true;
}
private boolean findOpenSocket(short port) {
// Accept incoming sihpon connection from trace utility.
Boolean foundOpenPort = false;
listenPort = port;
// Listen to accept incoming connection from SDL
while (!foundOpenPort) {
try {
m_listeningSocket = new ServerSocket(listenPort);
foundOpenPort = true;
m_listenPort = listenPort;
} catch (BindException ex) {
listenPort++;
if(listenPort > port + MAX_NUMBER_OF_PORT_ATTEMPTS) {
return false;
}
} catch (IOException e) {
return false;
}
}
return foundOpenPort;
}
private void startServerOnPort() throws IOException {
Socket newSocket = null;
// Wait for a connection
newSocket = m_listeningSocket.accept();
// If isHalted after accept() delay, return
if (isHalted) {
return;
}
synchronized (m_siphonLock) {
// Reset siphonSocketOutputStream
if (m_siphonSocketOutputStream != null) {
try {
m_siphonSocketOutputStream.close();
} catch (IOException e) {
// Do nothing
}
m_siphonSocketOutputStream = null;
}
// Reset siphonSocket
if (m_siphonSocket != null) {
try {
m_siphonSocket.close();
} catch (IOException e) {
// Do nothing
}
m_siphonSocket = null;
}
// Store the new socket
m_siphonSocket = newSocket;
// Set Socket Options
m_siphonSocket.setKeepAlive(true);
// Get the output stream of the connection
m_siphonSocketOutputStream = m_siphonSocket.getOutputStream();
// Output version number to the Siphon upon connection (version number prepending to logInfo)
DebugTool.logInfo("Siphon connected.");
} // end-lock
} // end-method
@Override
public void run() {
try {
if (m_foundOpenSocket){
while (!isHalted) {
startServerOnPort();
}
}
} catch (Exception ex) {
// Do nothing
} finally {
if (m_listeningSocket != null) {
try {
m_listeningSocket.close();
} catch (IOException e) {
// Do nothing
}
m_listeningSocket = null;
}
}
}
}
private static final byte[] intToByteArray(int value) {
return new byte[] {
(byte)(value >>> 24),
(byte)(value >>> 16),
(byte)(value >>> 8),
(byte)value};
}
} // end-class | {
"content_hash": "42acb4cc9889c44ec9b34f5c47fb03e2",
"timestamp": "",
"source": "github",
"line_count": 384,
"max_line_length": 107,
"avg_line_length": 26.958333333333332,
"alnum_prop": 0.6321483771251932,
"repo_name": "914802951/sdl_android",
"id": "ab8a8a7bd4716ce085df5bc5fe7316dc87db29bf",
"size": "10352",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "sdl_android/src/main/java/com/smartdevicelink/transport/SiphonServer.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "3422816"
}
],
"symlink_target": ""
} |
@class RKParent;
@interface RKChild : RKHuman {
}
@property (nonatomic, retain) NSSet* parents;
@end
| {
"content_hash": "07278a5ee19035704bce8d181ec5481b",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 45,
"avg_line_length": 13,
"alnum_prop": 0.7115384615384616,
"repo_name": "CashCycleSolutions/RestKit",
"id": "2d575c73e451c7f94aaf2173f09555fd149cbe70",
"size": "859",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Specs/Models/RKChild.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "159581"
},
{
"name": "C++",
"bytes": "7954"
},
{
"name": "JavaScript",
"bytes": "5998"
},
{
"name": "Objective-C",
"bytes": "2028783"
},
{
"name": "Perl",
"bytes": "1364"
},
{
"name": "Ruby",
"bytes": "38171"
},
{
"name": "Shell",
"bytes": "1489"
}
],
"symlink_target": ""
} |
from setuptools import setup
from setuptools import find_packages
setup(
name='base_page',
version='4.8.0',
author='Kristoffer Snabb, Pratik Hublikar',
url='https://github.com/geonition/base_page',
packages=find_packages(),
include_package_data=True,
package_data = {
"base_page": [
"templates/*.html",
"templates/*.js",
"templates/admin/*.html",
"static/css/*.css",
"static/img/*.png",
"static/img/*.gif",
"static/img/*.svg",
"static/js/*.js",
"static/js/libs/*.js",
"static/js/libs/img/*.png",
"static/js/libs/i18n/*.js",
"static/js/libs/theme/default/*.css",
"static/js/libs/theme/default/img/*",
"static/css/ui-lightness/*.css",
"static/css/ui-lightness/images/*.png",
"locale/*/LC_MESSAGES/*.mo",
"locale/*/LC_MESSAGES/*.po",
],
},
zip_safe=False,
install_requires=['django',
'django-modeltranslation'],
)
| {
"content_hash": "437258c4bbce5baf09db8a4610624d71",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 51,
"avg_line_length": 30.416666666666668,
"alnum_prop": 0.5123287671232877,
"repo_name": "geonition/base_page",
"id": "d0c4d313cd8888437b84f0a6c0c6687e39471c3c",
"size": "1095",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "setup.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "44110"
},
{
"name": "JavaScript",
"bytes": "3048336"
},
{
"name": "Python",
"bytes": "11704"
}
],
"symlink_target": ""
} |
set -e
apt-get update
apt-get install -y --no-install-recommends curl git-core ca-certificates
curl --silent https://storage.googleapis.com/golang/go1.5.1.linux-amd64.tar.gz | tar -C /usr/local -zxv
mkdir -p /gopath/src
git clone --depth=1 https://camlistore.googlesource.com/camlistore /gopath/src/camlistore.org
export GOPATH=/gopath
export GOBIN=/usr/local/bin
export GO15VENDOREXPERIMENT=1
export CGO_ENABLED=0
/usr/local/go/bin/go install -v camlistore.org/server/camlistored
rm -rf /usr/local/go
apt-get remove --yes curl git-core
apt-get clean
rm -rf /var/cache/apt/
rm -fr /var/lib/apt/lists
| {
"content_hash": "b91647bbaabe70eacb68da9bb46cc040",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 103,
"avg_line_length": 30.2,
"alnum_prop": 0.7649006622516556,
"repo_name": "raff/camlistore",
"id": "8a59bff73422a4151bee14d2afd6c8314a8fe9d5",
"size": "617",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "website/containers/demoblobserver/build.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "217"
},
{
"name": "CSS",
"bytes": "58992"
},
{
"name": "Go",
"bytes": "3455061"
},
{
"name": "HTML",
"bytes": "82323"
},
{
"name": "Java",
"bytes": "123749"
},
{
"name": "JavaScript",
"bytes": "385013"
},
{
"name": "Makefile",
"bytes": "4173"
},
{
"name": "Objective-C",
"bytes": "87307"
},
{
"name": "Perl",
"bytes": "31239"
},
{
"name": "Python",
"bytes": "258905"
},
{
"name": "Ruby",
"bytes": "216"
},
{
"name": "Shell",
"bytes": "8200"
}
],
"symlink_target": ""
} |
package org.vaadin.gwtgraphics.client;
import org.vaadin.gwtgraphics.client.animation.Animatable;
/**
* Line represents a straight line from one point to another. Line can be
* stroked.
*
* @author Henri Kerola
*
*/
public class Line extends VectorObject implements Strokeable, Animatable {
/**
* Creates a new instance of Line. This is a line from one given point to
* another. Default stroke width is 1px and stroke color is black.
*
* @param x1
* the x-coordinate of the starting point in pixels
* @param y1
* the y-coordinate of the starting point in pixels
* @param x2
* the x-coordinate of the end point in pixels
* @param y2
* the y-coordinate of the end point in pixels
*/
public Line(int x1, int y1, int x2, int y2) {
setX1(x1);
setY1(y1);
setX2(x2);
setY2(y2);
setStrokeWidth(1);
setStrokeOpacity(1);
setStrokeColor("black");
}
@Override
protected Class<? extends VectorObject> getType() {
return Line.class;
}
/**
* Returns the x-coordinate position of the starting point of Line.
*
* @return the x-coordinate in pixels
*/
public int getX1() {
return getImpl().getX(getElement());
}
/**
* Sets the x-coordinate position of the starting point of Line.
*
* @param x1
* the new x-coordinate in pixels
*/
public void setX1(int x1) {
getImpl().setX(getElement(), x1, isAttached());
}
/**
* Returns the y-coordinate position of the starting point of Line.
*
* @return the y-coordinate in pixels
*/
public int getY1() {
return getImpl().getY(getElement());
}
/**
* Sets the y-coordinate position of the starting point of Line.
*
* @param y1
* the new y-coordinate in pixels
*/
public void setY1(int y1) {
getImpl().setY(getElement(), y1, isAttached());
}
/**
* Returns the x-coordinate position of the ending point of Line.
*
* @return the x-coordinate in pixels
*/
public int getX2() {
return getImpl().getLineX2(getElement());
}
/**
* Sets the y-coordinate position of the ending point of Line.
*
* @param x2
* the new x-coordinate in pixels
*/
public void setX2(int x2) {
getImpl().setLineX2(getElement(), x2);
}
/**
* Returns the y-coordinate position of the ending point of Line.
*
* @return the y-coordinate in pixels
*/
public int getY2() {
return getImpl().getLineY2(getElement());
}
/**
* Sets the y-coordinate position of the ending point of Line.
*
* @param y2
* the new x-coordinate in pixels
*/
public void setY2(int y2) {
getImpl().setLineY2(getElement(), y2);
}
/*
* (non-Javadoc)
*
* @see org.vaadin.gwtgraphics.client.Strokeable#getStrokeColor()
*/
public String getStrokeColor() {
return getImpl().getStrokeColor(getElement());
}
/*
* (non-Javadoc)
*
* @see
* org.vaadin.gwtgraphics.client.Strokeable#setStrokeColor(java.lang.String)
*/
public void setStrokeColor(String color) {
getImpl().setStrokeColor(getElement(), color);
}
/*
* (non-Javadoc)
*
* @see org.vaadin.gwtgraphics.client.Strokeable#getStrokeWidth()
*/
public int getStrokeWidth() {
return getImpl().getStrokeWidth(getElement());
}
/*
* (non-Javadoc)
*
* @see org.vaadin.gwtgraphics.client.Strokeable#setStrokeWidth(int)
*/
public void setStrokeWidth(int width) {
getImpl().setStrokeWidth(getElement(), width, isAttached());
}
/*
* (non-Javadoc)
*
* @see org.vaadin.gwtgraphics.client.Strokeable#getStrokeOpacity()
*/
public double getStrokeOpacity() {
return getImpl().getStrokeOpacity(getElement());
}
/*
* (non-Javadoc)
*
* @see org.vaadin.gwtgraphics.client.Strokeable#setStrokeOpacity(double)
*/
public void setStrokeOpacity(double opacity) {
getImpl().setStrokeOpacity(getElement(), opacity);
}
/*
* (non-Javadoc)
*
* @see
* org.vaadin.gwtgraphics.client.animation.Animatable#setPropertyDouble(
* java.lang.String, double)
*/
public void setPropertyDouble(String property, double value) {
property = property.toLowerCase();
if ("x1".equals(property)) {
setX1((int) value);
} else if ("y1".equals(property)) {
setY1((int) value);
} else if ("x2".equals(property)) {
setX2((int) value);
} else if ("y2".equals(property)) {
setY2((int) value);
} else if ("strokeopacity".equals(property)) {
setStrokeOpacity(value);
} else if ("strokewidth".equals(property)) {
setStrokeWidth((int) value);
} else if ("rotation".equals(property)) {
setRotation((int) value);
}
}
}
| {
"content_hash": "8fe05de2e49fbcdbb6683433187a3d32",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 77,
"avg_line_length": 23.00502512562814,
"alnum_prop": 0.6535605067715159,
"repo_name": "henrikerola/gwt-graphics",
"id": "e07232c8f9baf0c4fe6963b08e0414f937066dd1",
"size": "5174",
"binary": false,
"copies": "3",
"ref": "refs/heads/gwtgraphics",
"path": "src/org/vaadin/gwtgraphics/client/Line.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "524"
},
{
"name": "Java",
"bytes": "169383"
}
],
"symlink_target": ""
} |
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.plugin.password.ldap;
import com.google.common.io.Closer;
import io.airlift.units.Duration;
import io.trino.plugin.base.ldap.JdkLdapClient;
import io.trino.plugin.base.ldap.LdapClientConfig;
import io.trino.plugin.password.ldap.TestingOpenLdapServer.DisposableSubContext;
import io.trino.spi.security.BasicPrincipal;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.ToxiproxyContainer;
import org.testcontainers.containers.ToxiproxyContainer.ContainerProxy;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import static eu.rekawek.toxiproxy.model.ToxicDirection.DOWNSTREAM;
import static io.trino.plugin.password.ldap.TestingOpenLdapServer.LDAP_PORT;
import static java.lang.String.format;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.testng.Assert.assertEquals;
public class TestLdapAuthenticatorWithTimeouts
{
private final Closer closer = Closer.create();
private TestingOpenLdapServer openLdapServer;
private String proxyLdapUrl;
@BeforeClass
public void setup()
throws Exception
{
Network network = Network.newNetwork();
closer.register(network::close);
ToxiproxyContainer proxyServer = new ToxiproxyContainer("ghcr.io/shopify/toxiproxy:2.4.0")
.withNetwork(network);
closer.register(proxyServer::close);
proxyServer.start();
openLdapServer = new TestingOpenLdapServer(network);
closer.register(openLdapServer);
openLdapServer.start();
ContainerProxy proxy = proxyServer.getProxy(openLdapServer.getNetworkAlias(), LDAP_PORT);
proxy.toxics()
.latency("latency", DOWNSTREAM, 5_000);
proxyLdapUrl = format("ldap://%s:%s", proxy.getContainerIpAddress(), proxy.getProxyPort());
}
@AfterClass(alwaysRun = true)
public void close()
throws Exception
{
closer.close();
}
@Test
public void testConnectTimeout()
throws Exception
{
try (DisposableSubContext organization = openLdapServer.createOrganization();
DisposableSubContext ignored = openLdapServer.createUser(organization, "alice", "alice-pass")) {
LdapClientConfig ldapConfig = new LdapClientConfig()
.setLdapUrl(proxyLdapUrl)
.setLdapConnectionTimeout(new Duration(1, SECONDS));
LdapAuthenticatorConfig ldapAuthenticatorConfig = new LdapAuthenticatorConfig()
.setUserBindSearchPatterns("uid=${USER}," + organization.getDistinguishedName());
LdapAuthenticator ldapAuthenticator = new LdapAuthenticator(
new LdapAuthenticatorClient(
new JdkLdapClient(ldapConfig)),
ldapAuthenticatorConfig);
assertThatThrownBy(() -> ldapAuthenticator.createAuthenticatedPrincipal("alice", "alice-pass"))
.isInstanceOf(RuntimeException.class)
.hasMessageMatching(".*Authentication error.*");
LdapClientConfig withIncreasedTimeout = ldapConfig.setLdapConnectionTimeout(new Duration(30, SECONDS));
assertEquals(
new LdapAuthenticator(new LdapAuthenticatorClient(new JdkLdapClient(withIncreasedTimeout)), ldapAuthenticatorConfig)
.createAuthenticatedPrincipal("alice", "alice-pass"),
new BasicPrincipal("alice"));
}
}
@Test
public void testReadTimeout()
throws Exception
{
try (DisposableSubContext organization = openLdapServer.createOrganization();
DisposableSubContext group = openLdapServer.createGroup(organization);
DisposableSubContext alice = openLdapServer.createUser(organization, "alice", "alice-pass")) {
openLdapServer.addUserToGroup(alice, group);
LdapClientConfig ldapConfig = new LdapClientConfig()
.setLdapUrl(proxyLdapUrl)
.setLdapReadTimeout(new Duration(1, SECONDS));
LdapAuthenticatorConfig ldapAuthenticatorConfig = new LdapAuthenticatorConfig()
.setUserBindSearchPatterns("uid=${USER}," + organization.getDistinguishedName())
.setUserBaseDistinguishedName(organization.getDistinguishedName())
.setGroupAuthorizationSearchPattern(format("(&(objectClass=groupOfNames)(cn=group_*)(member=uid=${USER},%s))", organization.getDistinguishedName()));
LdapAuthenticator ldapAuthenticator = new LdapAuthenticator(
new LdapAuthenticatorClient(
new JdkLdapClient(ldapConfig)),
ldapAuthenticatorConfig);
assertThatThrownBy(() -> ldapAuthenticator.createAuthenticatedPrincipal("alice", "alice-pass"))
.isInstanceOf(RuntimeException.class)
.hasMessageMatching(".*Authentication error.*");
LdapClientConfig withIncreasedTimeout = ldapConfig.setLdapReadTimeout(new Duration(30, SECONDS));
assertEquals(
new LdapAuthenticator(
new LdapAuthenticatorClient(
new JdkLdapClient(withIncreasedTimeout)),
ldapAuthenticatorConfig)
.createAuthenticatedPrincipal("alice", "alice-pass"),
new BasicPrincipal("alice"));
}
}
}
| {
"content_hash": "e0d0159b7ef298492584def4915f25be",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 169,
"avg_line_length": 45.845588235294116,
"alnum_prop": 0.6740978348035285,
"repo_name": "smartnews/presto",
"id": "4c9df0e33b3cb7f3a0e4d403bb82cc8f0acc5b41",
"size": "6235",
"binary": false,
"copies": "1",
"ref": "refs/heads/smartnews",
"path": "plugin/trino-password-authenticators/src/test/java/io/trino/plugin/password/ldap/TestLdapAuthenticatorWithTimeouts.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "50268"
},
{
"name": "CSS",
"bytes": "13515"
},
{
"name": "Dockerfile",
"bytes": "1967"
},
{
"name": "Groovy",
"bytes": "1702"
},
{
"name": "HTML",
"bytes": "30842"
},
{
"name": "Java",
"bytes": "61596519"
},
{
"name": "JavaScript",
"bytes": "232261"
},
{
"name": "PLSQL",
"bytes": "85"
},
{
"name": "Python",
"bytes": "5266"
},
{
"name": "Scala",
"bytes": "10145"
},
{
"name": "Shell",
"bytes": "51516"
},
{
"name": "Smarty",
"bytes": "1938"
}
],
"symlink_target": ""
} |
/*
* buildingBlock.cpp
*
* Created on: 22 mars 2013
* Author: dom
*/
#include <iostream>
#include "buildingBlock.h"
#include "world.h"
#include "simulator.h"
#include "scheduler.h"
#include "trace.h"
using namespace std;
namespace BaseSimulator {
bID BuildingBlock::nextId = 0;
bool BuildingBlock::userConfigHasBeenParsed = false;
//===========================================================================================================
//
// BuildingBlock (class)
//
//===========================================================================================================
BuildingBlock::BuildingBlock(int bId, BlockCodeBuilder bcb, int nbInterfaces) {
OUTPUT << "BuildingBlock constructor (id:" << nextId << ")" << endl;
if (bId < 0) {
blockId = nextId;
nextId++;
} else {
blockId = bId;
}
state.store(ALIVE);
clock = new PerfectClock();
ruint seed = Simulator::getSimulator()->getRandomUint();
seed *= bId;
generator = uintRNG(seed);
buildNewBlockCode = bcb;
if (utils::StatsIndividual::enable) {
stats = new StatsIndividual();
}
for (int i = 0; i < nbInterfaces; i++) {
P2PNetworkInterfaces.push_back(new P2PNetworkInterface(this));
}
wirelessNetworkInterface = new WirelessNetworkInterface(this,4.5,-82,-110);
//setDefaultHardwareParameters();
blockCode = (BaseSimulator::BlockCode*)bcb(this);
// Parse user configuration from configuration file, only performed once
if (!userConfigHasBeenParsed) {
userConfigHasBeenParsed = true;
blockCode->parseUserElements(Simulator::getSimulator()->getConfigDocument());
}
isMaster = false;
}
BuildingBlock::~BuildingBlock() {
delete blockCode;
OUTPUT << "BuildingBlock destructor" << endl;
if (clock != NULL) {
delete clock;
}
if (stats != NULL) {
delete stats;
}
for (P2PNetworkInterface *p2p : P2PNetworkInterfaces)
delete p2p;
}
bool BuildingBlock::addP2PNetworkInterfaceAndConnectTo(BuildingBlock *destBlock) {
P2PNetworkInterface *ni1, *ni2;
ni1 = NULL;
ni2 = NULL;
if (!getP2PNetworkInterfaceByBlockRef(destBlock)) {
// creation of the new network interface
OUTPUT << "adding a new interface to block " << destBlock->blockId << endl;
ni1 = new P2PNetworkInterface(this);
P2PNetworkInterfaces.push_back(ni1);
}
if (!destBlock->getP2PNetworkInterfaceByBlockRef(this)) {
// creation of the new network interface
OUTPUT << "adding a new interface to block " << this->blockId << endl;
ni2 = new P2PNetworkInterface(destBlock);
destBlock->P2PNetworkInterfaces.push_back(ni2);
}
if (ni1!=NULL && ni2!=NULL) {
ni1->connect(ni2);
return (true);
} else {
OUTPUT << "*** ERROR *** could not connect the new interfaces" << endl;
}
return false;
}
bool BuildingBlock::addP2PNetworkInterfaceAndConnectTo(int destBlockId) {
// if the link is not in the list
BuildingBlock *destBlock = BaseSimulator::getWorld()->getBlockById(destBlockId);
if (!getP2PNetworkInterfaceByBlockRef(destBlock)) {
// creation of the new network interface
P2PNetworkInterface* ni1 = new P2PNetworkInterface(this);
P2PNetworkInterfaces.push_back(ni1);
// if the corresponding interface exists in the connected block, we link the two interfaces
if (destBlock->addP2PNetworkInterfaceAndConnectTo(this)) {
P2PNetworkInterface* ni2 = destBlock->getP2PNetworkInterfaceByBlockRef(this);
ni1->connect(ni2);
}
}
return false;
}
P2PNetworkInterface *BuildingBlock::getP2PNetworkInterfaceByBlockRef(BuildingBlock *destBlock) {
for(P2PNetworkInterface *p2p : P2PNetworkInterfaces) {
if (p2p->connectedInterface) {
if (p2p->connectedInterface->hostBlock == destBlock) {
return p2p;
}
}
}
return NULL;
}
P2PNetworkInterface*BuildingBlock::getP2PNetworkInterfaceByDestBlockId(bID destBlockId) {
for(P2PNetworkInterface *p2p : P2PNetworkInterfaces) {
if (p2p->connectedInterface) {
if (p2p->connectedInterface->hostBlock->blockId == destBlockId) {
return p2p;
}
}
}
return NULL;
}
unsigned short BuildingBlock::getNbNeighbors() {
unsigned short n = 0;
P2PNetworkInterface *p;
vector<P2PNetworkInterface*>::iterator it;
for (it = P2PNetworkInterfaces.begin(); it != P2PNetworkInterfaces.end(); ++it) {
p = *it;
if (p->isConnected()) {
n++;
}
}
return n;
}
void BuildingBlock::scheduleLocalEvent(EventPtr pev) {
localEventsList.push_back(pev);
if (localEventsList.size() == 1) {
Time date;
date = max(pev->date,this->blockCode->availabilityDate); // WARNING: is blockCode->availabilityDate considered?
if (date < getScheduler()->now()) date=getScheduler()->now();
getScheduler()->schedule(new ProcessLocalEvent(date,this));
}
return;
}
void BuildingBlock::processLocalEvent() {
EventPtr pev;
if (localEventsList.size() == 0) {
cerr << "*** ERROR *** The local event list should not be empty !!" << endl;
getScheduler()->trace("*** ERROR *** The local event list should not be empty !!");
exit(EXIT_FAILURE);
}
pev = localEventsList.front();
localEventsList.pop_front();
blockCode->processLocalEvent(pev);
if (pev->eventType == EVENT_NI_RECEIVE ) {
utils::StatsIndividual::decIncommingMessageQueueSize(stats);
}
if (blockCode->availabilityDate < getScheduler()->now()) blockCode->availabilityDate = getScheduler()->now();
if (localEventsList.size() > 0) {
getScheduler()->schedule(new ProcessLocalEvent(blockCode->availabilityDate,this));
}
}
void BuildingBlock::setColor(int idColor) {
const GLfloat *col = tabColors[idColor%12];
color.set(col[0],col[1],col[2],col[3]);
getWorld()->updateGlData(this);
}
void BuildingBlock::setColor(const Color &c) {
if (state.load() >= ALIVE) {
color = c;
}
getWorld()->updateGlData(this);
}
void BuildingBlock::setPosition(const Cell3DPosition &p) {
position = p;
getWorld()->updateGlData(this);
}
void BuildingBlock::tap(Time date, int face) {
OUTPUT << "tap scheduled" << endl;
getScheduler()->schedule(new TapEvent(date, this, (uint8_t)face));
}
ruint BuildingBlock::getRandomUint() {
return generator();
}
void BuildingBlock::setClock(Clock *c) {
if (clock != NULL) {
delete clock;
}
clock = c;
}
Time BuildingBlock::getLocalTime(Time simTime) {
if (clock == NULL) {
cerr << "device has no internal clock" << endl;
return 0;
}
return clock->getTime(simTime);
}
Time BuildingBlock::getLocalTime() {
if (clock == NULL) {
cerr << "device has no internal clock" << endl;
return 0;
}
return clock->getTime();
}
Time BuildingBlock::getSimulationTime(Time localTime) {
if (clock == NULL) {
cerr << "device has no internal clock" << endl;
return localTime;
}
return clock->getSimulationTime(localTime);
}
/*************************************************
* MeldInterpreter Functions
*************************************************/
unsigned short BuildingBlock::getNeighborIDForFace(int faceNum) {
short nodeID = P2PNetworkInterfaces[faceNum]->getConnectedBlockId();
return nodeID > 0 ? (unsigned short)nodeID : 0;
}
int BuildingBlock::getFaceForNeighborID(int nId) {
for (uint face = 0; face < P2PNetworkInterfaces.size(); face++) {
if (nId == getNeighborIDForFace(face))
return face;
}
return -1;
}
} // BaseSimulator namespace
| {
"content_hash": "812a4a79602d888236eacbf173ec8a1f",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 113,
"avg_line_length": 27.44,
"alnum_prop": 0.6441823482639809,
"repo_name": "egartner/MR-maze-exploration",
"id": "3c03c401074308d5e5eb68d0a91274853383f753",
"size": "7546",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "simulatorCore/src/buildingBlock.cpp",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "BitBake",
"bytes": "6085"
},
{
"name": "C",
"bytes": "35563"
},
{
"name": "C++",
"bytes": "1046588"
},
{
"name": "Common Lisp",
"bytes": "935360"
},
{
"name": "GLSL",
"bytes": "1618"
},
{
"name": "Makefile",
"bytes": "22092"
},
{
"name": "Python",
"bytes": "3391"
},
{
"name": "Shell",
"bytes": "4973"
}
],
"symlink_target": ""
} |
package uk.nhs.ciao.cda.builder;
import org.apache.camel.CamelContext;
import org.apache.camel.RoutesBuilder;
import uk.nhs.ciao.camel.CamelApplication;
import uk.nhs.ciao.cda.builder.route.CDABuilderRoute;
import uk.nhs.ciao.configuration.CIAOConfig;
import uk.nhs.ciao.docs.parser.route.InProgressFolderManagerRoute;
/**
* Configures multiple camel CDA builder routes determined by properties specified
* in the applications registered {@link CIAOConfig}.
* <p>
* The 'bootstrap' / {@link #ROOT_PROPERTY} determines which named routes to created (via
* a comma-separated list).
* <p>
* The properties of each route are then looked up via the <code>${ROOT_PROPERTY}.${routeName}.${propertyName}</code>,
* falling back to <code>${ROOT_PROPERTY}.${propertyName}</code> if a specified property is not provided.
* This allows for shorthand specification of properties when they are shared across multiple routes.
* <p>
* The following properties are supported per named route:
* <dl>
* <dt>inputQueue<dt>
* <dd>The file path (absolute or relative to the working directory) of the input folder to monitor</dd>
*
* <dt>outputQueue<dt>
* <dd>The name of the queue output messages should be sent to</dd>
*/
public class CDABuilderRoutes implements RoutesBuilder {
/**
* Creates multiple document parser routes
*
* @throws Exception If required CIAO-config properties are missing
*/
@Override
public void addRoutesToCamelContext(final CamelContext context) throws Exception {
addCDABuilderRoute(context);
// Services
addInProgressFolderManagerRoute(context);
}
private void addCDABuilderRoute(final CamelContext context) throws Exception {
final CIAOConfig config = CamelApplication.getConfig(context);
final String[] routeNames = config.getConfigValue(CDABuilderRoute.ROOT_PROPERTY).split(",");
for (final String routeName: routeNames) {
final CDABuilderRoute route = new CDABuilderRoute(
routeName, config);
route.setInProgressFolderManagerUri("direct:in-progress-folder-manager");
context.addRoutes(route);
}
}
private void addInProgressFolderManagerRoute(final CamelContext context) throws Exception {
final InProgressFolderManagerRoute route = new InProgressFolderManagerRoute();
route.setInProgressFolderManagerUri("direct:in-progress-folder-manager");
route.setInternalRoutePrefix("in-progress-folder-manager");
route.setInProgressFolderRootUri("file:{{inProgressFolder}}");
context.addRoutes(route);
}
}
| {
"content_hash": "3486cf0d5c2da50592c723d6a6746810",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 118,
"avg_line_length": 39.41538461538462,
"alnum_prop": 0.7478532396565184,
"repo_name": "nhs-ciao/ciao-cda-builder",
"id": "d2acd0f0a54e97bd54e6866537e7eb642511864d",
"size": "2562",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/uk/nhs/ciao/cda/builder/CDABuilderRoutes.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "70437"
},
{
"name": "XSLT",
"bytes": "27614"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace imperative.summoner
{
//public class Template
//{
// public string name;
// public string[] parameters;
// public Pattern_Source source;
// public Template(string name, string[] parameters, Pattern_Source source)
// {
// this.name = name;
// this.parameters = parameters;
// this.source = source;
// }
//}
}
| {
"content_hash": "7b3de371ab96c58d83092109f15e716a",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 82,
"avg_line_length": 24.523809523809526,
"alnum_prop": 0.5631067961165048,
"repo_name": "silentorb/imp",
"id": "d7b37bb294ceb1b3e0dfd3777073365741e081de",
"size": "517",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Imp/summoner/Template.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "463969"
},
{
"name": "C++",
"bytes": "867"
},
{
"name": "F#",
"bytes": "473"
},
{
"name": "JavaScript",
"bytes": "2458"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V5.0//EN"
"http://www.docbook.org/xml/5.0/dtd/docbook.dtd" [
<!ENTITY % local SYSTEM "local-entities.ent">
<!ENTITY % custom SYSTEM "custom-entities.ent">
%local;
%custom;
]>
<chapter xml:id="chapter.development" xmlns="http://docbook.org/ns/docbook" version="5.0">
<title>&C2; Development</title>
<subtitle>Contributing to &C2;</subtitle>
<para>
This chapter contains information for &C2; developers.
</para>
<section xml:id="section.release">
<title>Stable release procedure</title>
<para>
Each &C2; release should be performed according to the following procedure:
</para>
<orderedlist>
<listitem>
<formalpara>
<title>Precondition: resolved issues</title>
<para>
All issues related to the software to be released scheduled (fix for) for
the release must be resolved.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Precondition: successful continuous integration builds</title>
<para>
The status of the all builds must be successful.
</para>
<para>
For bugfixing releases, check appropriate build on the server.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Update source code headers and line endings</title>
<para>
<programlisting><![CDATA[ant prerelease]]></programlisting>
Commit changes to trunk.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Review Maven dependencies are in sync</title>
<para>
<programlisting><![CDATA[(cd etc/maven/poms; mvn dependency:tree )]]></programlisting>
Review Maven POMs to ensure dependencies are in sync with the JAR versions
in the repository.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Run all the tests and distribution target</title>
<para>
<programlisting><![CDATA[git clean -xfd # removes any local files, including settings!
ant -Dlocal.properties=local.properties.example -Dtools.dir=... clean dist]]></programlisting>
Everything should pass. Extra tools repo will be required.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Generate and verify JavaDocs</title>
<para>
<programlisting><![CDATA[ant javadoc # (already in dist)]]></programlisting>
Review JavaDoc documentation, provide missing public and protected
members description, provide missing package descriptions.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Generate and verify &C2; Manual</title>
<para>
<programlisting><![CDATA[ant doc # (already in dist)]]></programlisting>
Review &C2; Manual, modify or add content related to the features implemented
in the new release.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Review static code analysis reports</title>
<para>
<programlisting><![CDATA[ant reports]]></programlisting>
Review and fix reasonably-looking flaws.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Update version number strings</title>
<para>
Update <filename>carrot2.version</filename>
and remove <filename>-SNAPSHOT</filename> suffix. This number will be embedded in
distribution file names, JavaDoc page title and other version-sensitive places.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Generate API XML file and API differences.</title>
<para>
Pick the previous version to compare against (typically the previous version on the branch).
Generate API XML and a comparison report:
<programlisting><![CDATA[ant clean jdiff-compare -Dversion.previous=x.y.z]]></programlisting>
</para>
<para>
Copy API XML report for future comparisons:
<programlisting><![CDATA[cp tmp/compatibility-report/*.xml etc/jdiff/]]></programlisting>
</para>
<para>
Commit changes. Push.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Trigger stable build in Bamboo.</title>
<para>
Go to Carrot2 Bamboo (requires admin privileges) and trigger a stable build.
If the build is successful, all distribution files should be available
in the download directory. This is the "candidate" release.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Verify the distribution files</title>
<para>
Download, unpack and run each distribution file to make sure there are no obvious
release blockers.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Create an annotated release tag and push changes.</title>
<para>
<programlisting><![CDATA[git tag -a release/x.y.z -m "Release x.y.z"]]></programlisting>
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Trigger stable build in Bamboo.</title>
<para>
Go to Carrot2 Bamboo (requires admin privileges) and trigger a stable build again.
This is the final release.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Publish maven artefacts.</title>
<para>
First,
<programlisting><![CDATA[ant maven.deploy]]></programlisting>
this pushes a release to SonaType's staging area (appropriate sonatype server configuration in
<filename>~/.m2/settings.xml</filename> and GPG keys in <filename>~/.gnupg/</filename> required).
Log in to SonaType, close the release
bundle and publish. This can be done later from the tagged revision.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Bump version number strings</title>
<para>
Bump version number to the next anticipated version and add
<filename>-SNAPSHOT</filename>.
Commit changes.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Update JIRA</title>
<para>
Close issues scheduled for the release being made, release the version in JIRA,
create a next version in JIRA.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Update download area server</title>
<para>
Copy the stable version from gamma's
<filename>/srv/vhosts/get.carrot2.org/head/</filename>
to
<filename>/srv/vhosts/get.carrot2.org/stable/</filename>
and update the symbolic link <filename>stable/latest/</filename> to point
to the newest stable release.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Update project website</title>
<para>
<orderedlist>
<listitem>
<formalpara>
<title>Release notes</title>
<para>
Add a page named <filename>release-[version]-notes</filename> that
lists new features, major bug fixes and improvements introduced in the
new release.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Release note history</title>
<para>
Add release date and link to the release's JIRA issues on the
<filename>release-notes</filename> page.
</para>
</formalpara>
</listitem>
</orderedlist>
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Upload distribution files to SourceForge</title>
<para>
Perform (from the build server):
<programlisting><![CDATA[rsync -e ssh *-x.y.z.zip *.war \
<sf.user>,carrot2@frs.sourceforge.net:/home/frs/project/c/ca/carrot2/carrot2/x.y.z]]></programlisting>
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Circulate release news</title>
<para>
If appropriate, circulate release news to:
<orderedlist>
<listitem><para>&C2; mailing lists</para></listitem>
<listitem>
<para><link xlink:href="https://sourceforge.net/news/submit.php?group_id=85379">SourceForge</link></para>
</listitem>
</orderedlist>
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Update Wikipedia page</title>
<para>
If appropriate, update <link xlink:href="http://en.wikipedia.org/wiki/Carrot2">&C2; page on Wikipedia</link>.
</para>
</formalpara>
</listitem>
<listitem>
<formalpara>
<title>Consider upgrading &C2; in dependent projects</title>
<para>
If reasonable, upgrade &C2; dependency in other known projects, such as
Apache Solr.
</para>
</formalpara>
</listitem>
</orderedlist>
</section>
<section xml:id="section.versioning">
<title>Versioning scheme</title>
<para>
&C2; uses version identifiers consisting of three, dot-separated numbers:
<varname>product-line</varname>.<varname>major</varname>.<varname>minor</varname>. This scheme
is modelled after Maven's POM versions and has the following interpretation:
</para>
<variablelist>
<varlistentry>
<term>product-line</term>
<listitem><para>Indicates long-term product line identifier. This number
will not change frequently as it reflects major changes in the internal
architecture or shipped software components. Reading release notes is
a must, the internal programming interfaces very likely changed significantly.</para></listitem>
</varlistentry>
<varlistentry>
<term>major</term>
<listitem><para>Major revision number changes indicate addition of significant new
features, performance optimizations or new front-end software components added to &C2;.
Reading release notes is highly recommended because programming interfaces may change
slightly from major to major revision.</para></listitem>
</varlistentry>
<varlistentry>
<term>minor</term>
<listitem><para>Minor revision numbers are reserved for shipped product updates and
bug fixes. These may include critical bug fixes as well as patches
increasing performance, but not changing the programming interfaces. Reading
release notes is recommended, but a drop-in upgrade should work without
any extra work.</para></listitem>
</varlistentry>
</variablelist>
<para>
The git repository is organized so that the <varname>master</varname> branch tracks the development
of the next <emphasis>major revision</emphasis>. Bugfix branches track minor revisions
of already shipped versions. A tag is created for each shipped version. Branch
and tag names follow the naming conventions below.
</para>
<variablelist>
<varlistentry>
<term>master</term>
<listitem><para>The master branch is equivalent to the next major software revision
being developed and is not numbered explicitly, but corresponds to
branch <varname>vX.Y.0</varname>, where <varname>Y</varname> is
the next major revision to be shipped. It is possible to create a minor release
off the trunk directly if the commit log only includes bug fixes.</para></listitem>
</varlistentry>
<varlistentry>
<term>bugfix/X.Y.Z</term>
<listitem><para>A branch named <varname>bugfix/X.Y.z</varname> tracks the product shipped as
<varname>X.Y.z</varname>, where the <varname>z</varname> component is the next
minor release to be shipped from this branch. Once shipped, a tag should
be created.
</para></listitem>
</varlistentry>
<varlistentry>
<term>release/X.Y.Z</term>
<listitem><para>A tag named <varname>release/X.Y.Z</varname> should be created for
exactly that development branch at the time of shipment.</para></listitem>
</varlistentry>
</variablelist>
</section>
<section xml:id="section.qa">
<title>QA check list</title>
<para>
This a very quick quality assurance check list to run through before stable
releases. This list also serves as some guide line for further automation
of acceptance tests.
</para>
<note>
<para>
Note that this list does not contain many checks for the &WA;, &DCS; and &JA;
as these are fairly well tested during builds (webtests, smoke-tests).
</para>
</note>
<orderedlist>
<listitem>
<para>
For each supported platform you can test, check that &DCW;:
<orderedlist spacing="compact">
<listitem>
<para>launches without errors in the error log</para>
</listitem>
<listitem>
<para>executes and cluters a remote search query without errors</para>
</listitem>
<listitem>
<para>
executes and clusters a Lucene query without errors (we've had a bug
that caused the Lucene directory attribute editor to disappear,
hence this step).
</para>
</listitem>
<listitem>
<para>can edit a clustering algorithm's attribute</para>
</listitem>
<listitem>
<para>shows both cluster visualizations</para>
</listitem>
<listitem>
<para>executes clustering algorithm benchmarks</para>
</listitem>
</orderedlist>
</para>
</listitem>
<listitem>
<para>
Check that a the &DCS; starts up correctly using command line on Windows and
Linux. More acceptance tests are performed during builds (but starting &DCS;
using the WAR file instead of command line).
</para>
</listitem>
</orderedlist>
</section>
</chapter>
| {
"content_hash": "ac793250dbd2ea4f735b631104d81d7f",
"timestamp": "",
"source": "github",
"line_count": 448,
"max_line_length": 121,
"avg_line_length": 34.875,
"alnum_prop": 0.5816692268305171,
"repo_name": "MjAbuz/carrot2",
"id": "e6f6847f0ffdb6605d97898b49d409c06911fcde",
"size": "15624",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/docbook/development.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "3709"
},
{
"name": "C#",
"bytes": "13127"
},
{
"name": "CSS",
"bytes": "57386"
},
{
"name": "Erlang",
"bytes": "1124"
},
{
"name": "Gnuplot",
"bytes": "3269"
},
{
"name": "HTML",
"bytes": "63839"
},
{
"name": "Java",
"bytes": "3003721"
},
{
"name": "JavaScript",
"bytes": "87126"
},
{
"name": "Lex",
"bytes": "2740"
},
{
"name": "NewLisp",
"bytes": "1600"
},
{
"name": "PHP",
"bytes": "23441"
},
{
"name": "Perl6",
"bytes": "903"
},
{
"name": "Ruby",
"bytes": "11231"
},
{
"name": "Shell",
"bytes": "3577"
},
{
"name": "Slash",
"bytes": "2505"
},
{
"name": "SystemVerilog",
"bytes": "560"
},
{
"name": "XSLT",
"bytes": "78425"
}
],
"symlink_target": ""
} |
Buffer switcher
**This package is under construction.**
Keep ALT pressed while choosing. Releasing ALT will confirm selection.
```cson
'atom-workspace':
'alt-s': 'buffet:toggle'
'.buffet':
'alt-o': 'core:confirm'
'alt-j': 'core:move-down'
'alt-k': 'core:move-up'
'alt-d': 'buffet:close-buffer'
'alt-s': 'buffet:previous'
'alt-escape': 'core:cancel'
```
| {
"content_hash": "a8815152c80fb60b84b1868ca307228a",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 70,
"avg_line_length": 19.35,
"alnum_prop": 0.6330749354005168,
"repo_name": "romgrk/buffet",
"id": "658557de2ecef0121228a8f16cecea2dab88c02e",
"size": "405",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2598"
},
{
"name": "CoffeeScript",
"bytes": "11844"
}
],
"symlink_target": ""
} |
namespace xrtl {
// Asynchronous platform message loop.
// Message loops are used primarily for UI work with this type mapping to the
// underlying platform primitive (such as Looper, Win32 message loops, or
// CFRunLoop, etc). They exist as a thread that can execute functions and may
// occasionally make calls out based on user events.
//
// Message loops are not designed for high performance and should not be used
// in place of a proper task queue. The underlying system primitives on which
// the loop is based may have significant per-message overhead (hundreds or more
// microseconds/message).
//
// Loops must be exited with Exit; simply dropping all references will likely
// leak. Though not required the wait handle should also be used to ensure all
// loop tasks have completed before proceeding with any teardown logic.
//
// Usage:
// auto loop = MessageLoop::Create();
// loop->MarshalSync([]() {
// // Runs synchronously on the loop thread, blocking the calling thread
// // until it returns.
// });
// TaskList task_list;
// loop->MarshalAsync(&task_list, []() {
// // Runs asynchronously at some point in the future on the loop thread.
// });
// OnButtonPressOrWhatever([]() {
// loop->Exit(); // Start shutting down the loop.
// });
// Thread::Wait(loop); // Wait until the loop exits.
class MessageLoop : public WaitHandle {
public:
class Task;
class TaskList;
// Creates a new message loop thread.
static ref_ptr<MessageLoop> Create();
virtual ~MessageLoop();
// Returns true if the currently executing code is running on the loop thread.
virtual bool is_loop_thread() = 0;
// Marshals a callback onto the message loop thread synchronously.
// The callback will be executed on the thread in FIFO order with all other
// tasks before this call returns.
//
// It's rarely a good idea to use blocking calls like this; if the loop is
// running large tasks (10-20ms/etc) the calling thread will block for that
// amount of time (or potentially longer if there's a large queue).
//
// This is safe to call from the loop thread (the callback will just be made
// inline), but that's probably not what you want.
virtual void MarshalSync(std::function<void()> callback) = 0;
// Marshals a callback onto the message loop thread asynchronously.
// The callback will be queued for execution on the thread in FIFO order with
// all other tasks and this call will return immediately.
//
// The task_list is used to safely cancel the callback and when the
// pending_task_list is destroyed all callbacks queued on it will be
// canceled. See TaskList for more information.
//
// Usage:
// TaskList task_list; // Can be kept as a class member, etc.
// loop->MarshalAsync(&task_list, []() {
// // Running on the loop thread.
// });
virtual void MarshalAsync(TaskList* pending_task_list,
std::function<void()> callback);
// Defers the function call until the next thread tick.
// This ensures that the callback will not run in the same call stack and can
// be treated as if it was asynchronous.
// The callback will not be executed if the loop exits before it is run or
// the TaskList is deallocated.
ref_ptr<Task> Defer(TaskList* pending_task_list,
std::function<void()> callback);
// Defers the function call until the given delay elapses.
// The exact timing of the callback is undefined and it may occur earlier or
// later than the requested delay time.
// The callback will not be executed if the loop exits before it is run or
// the TaskList is deallocated.
ref_ptr<Task> Defer(TaskList* pending_task_list,
std::function<void()> callback,
std::chrono::milliseconds delay_millis);
// Defers the function call and repeatedly calls it until canceled.
// The exact timing of the callback is undefined and it may occur earlier or
// later than the requested delay time.
// The callback will not be executed if the loop exits before it is run or
// the TaskList is deallocated.
ref_ptr<Task> DeferRepeating(TaskList* pending_task_list,
std::function<void()> callback,
std::chrono::milliseconds period_millis);
// Defers the function call until the given delay elapses and repeatedly calls
// it until it is canceled.
// The exact timing of the callback is undefined and it may occur earlier or
// later than the requested delay time.
// The callback will not be executed if the loop exits before it is run or
// the TaskList is deallocated.
ref_ptr<Task> DeferRepeating(TaskList* pending_task_list,
std::function<void()> callback,
std::chrono::milliseconds delay_millis,
std::chrono::milliseconds period_millis);
// Registers a function that will be called when the loop is exiting.
// Callbacks will be made in reverse order of registration.
// The callbacks will run on the loop thread.
void RegisterExitCallback(std::function<void()> callback);
// Requests the loop exit.
// This may be called from any thread.
// The message loop exit_wait_handle can be waited on à la Thread to join with
// it once it has completed shutdown.
// Returns a wait handle that can be used to wait for loop exit.
virtual ref_ptr<WaitHandle> Exit() = 0;
// An asynchronous task that can be queued for execution on a message loop.
// Tasks may be executed in the following tick (delay = 0, repeat = 0),
// delayed and one-shot (delay = N, repeat = 0), or repeating until aborted
// (delay = 0-N, repeat = M).
//
// Tasks are reference counted and kept alive while scheduled for execution.
// Tasks are descheduled after they complete and perform their callback or
// when they are canceled before they can complete. Users can retain the task
// to cancel it early if desired, but should always release their reference
// ASAP to ensure tasks are pooled effectively.
//
// Any user of tasks must retain a TaskList. This allows for
// cancellation of all pending tasks when the list is deallocated, preventing
// use-after-free by tasks that complete after the code that spawned them is
// gone.
class Task : public RefObject<Task> {
public:
virtual ~Task();
// The message loop the task is assigned to run on.
MessageLoop* message_loop() const { return message_loop_; }
// Internal. Do not use.
// TODO(benvanik): hide better.
uintptr_t platform_handle() const { return platform_handle_; }
void set_platform_handle(uintptr_t platform_handle) {
platform_handle_ = platform_handle;
}
// The delay before the task is first invoked, in milliseconds.
// If 0 the task will be executed ASAP.
std::chrono::milliseconds delay_millis() const { return delay_millis_; }
// The interval between repetitions (after the first invocation).
// If 0 the task will not be repeated.
std::chrono::milliseconds period_millis() const { return period_millis_; }
// Cancels the task, descheduling it and preventing any future callbacks.
// The callback will not be called. This may be called from any thread.
void Cancel();
// Returns the task back to the message loop pool.
static void Delete(Task* task);
private:
template <typename T, size_t kOffset>
friend class IntrusivePool;
template <typename T, size_t kOffset>
friend class IntrusivePoolBase;
friend class TaskList;
friend class MessageLoop;
friend class Win32MessageLoop;
// Created and pooled by MessageLoop's intrusive pool.
Task();
// Initializes the task for use.
void Initialize(MessageLoop* message_loop, TaskList* pending_task_list,
std::chrono::milliseconds delay_millis,
std::chrono::milliseconds period_millis,
std::function<void()> callback);
void Invoke();
// The mutex that guards the invoke/cancel behavior.
// We make it recursive so that tasks are safe to call Cancel() on
// themselves (needed for canceling repeating timers, etc).
std::recursive_mutex mutex_;
MessageLoop* message_loop_ = nullptr;
TaskList* pending_task_list_ = nullptr;
std::function<void()> callback_;
std::chrono::milliseconds delay_millis_{0};
std::chrono::milliseconds period_millis_{0};
bool is_alive_ = true;
// Varies based on platform; on web this is the browser timer handle.
uintptr_t platform_handle_ = 0;
// Presence in the TaskList.
IntrusiveListLink pending_task_list_link_;
// Allows the thread to track the task while scheduled.
IntrusiveListLink loop_list_link_;
};
// Utility that tracks all pending tasks and cancels them when it is
// deallocated. This prevents use-after-frees that happen when tasks outlive
// the code that allocated them.
//
// Any code using tasks must use a task list. The easiest way is to make the
// TaskList a member so that it is automatically deallocated with the
// containing type.
//
// NOTE: it should always be the first private member of the type. This
// ensures it is constructed first and destructed last.
//
// Usage:
// class MyType {
// public:
// void DoSomething() {
// loop->Defer(&pending_task_list_, []() {});
// }
// private:
// TaskList pending_task_list_;
// // other members here
// };
class TaskList {
public:
TaskList();
~TaskList();
private:
friend class Task;
void RegisterTask(Task* task);
void UnregisterTask(Task* task);
// Tasks may be registered/unregistered cross-thread and this guards the
// list.
std::mutex mutex_;
// Weak list of all tasks registered with this task list, unretained.
// Tasks register and unregister themselves as they are allocated/deleted.
IntrusiveList<Task, offsetof(Task, pending_task_list_link_)> list_;
};
protected:
friend class Task;
friend class CFRunLoopMessageLoop;
MessageLoop();
// Called by subclasses when the loop is started.
void OnEnter();
// Called by subclasses when the loop is exited.
void OnExit();
ref_ptr<Task> DeferTask(TaskList* pending_task_list,
std::function<void()> callback,
std::chrono::milliseconds delay_millis,
std::chrono::milliseconds period_millis);
// Schedules an async task for future execution.
// This is called once when the task is first prepared.
// Subclasses can use this to trigger platform timers, reprioritize run
// queues, etc.
virtual void ScheduleTask(ref_ptr<Task> task);
// Deschedules a previously-scheduled async task.
// This is called once when the task is canceled or after it has completed.
// Subclasses can use this to clean up platform resources.
virtual void DescheduleTask(ref_ptr<Task> task);
// Returns true if the given task is scheduled for future callback.
bool IsTaskScheduled(Task* task);
// Invokes the given task.
void InvokeTask(ref_ptr<Task> task);
// Deallocates an async task, returning it to the loop pool.
virtual void DeallocateTask(Task* task);
// A mutex that must be held when manipulating the task data structures as we
// may manipulate them from multiple threads.
std::recursive_mutex task_mutex_;
// Pool of tasks recycled across the various Defer'ed calls.
// As defers can be high frequency this keeps us from creating too much
// garbage.
IntrusivePool<Task, offsetof(Task, loop_list_link_)> task_pool_{32, 128};
// All currently scheduled tasks. Only tasks pending a callback are present in
// this list. They are retained until canceled or completed.
IntrusiveList<ref_ptr<Task>, offsetof(Task, loop_list_link_)> pending_tasks_;
// Set true when we start exiting to prevent posting more work.
std::atomic<bool> exiting_{false};
// A list of all registered exit callbacks in the order they were registered.
// They will be called in reverse order of registration.
std::vector<std::function<void()>> exit_callbacks_;
};
} // namespace xrtl
#endif // XRTL_BASE_THREADING_MESSAGE_LOOP_H_
| {
"content_hash": "9da8396376c9fd6cd2324ec01a93abdf",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 80,
"avg_line_length": 41.52861952861953,
"alnum_prop": 0.6877736338576294,
"repo_name": "google/xrtl",
"id": "7997cbbf471f0f47c6fcaa22d81e4f8e0c1bf3b4",
"size": "13243",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "xrtl/base/threading/message_loop.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "6708"
},
{
"name": "C",
"bytes": "10073"
},
{
"name": "C++",
"bytes": "1619301"
},
{
"name": "GLSL",
"bytes": "2018"
},
{
"name": "Objective-C",
"bytes": "1526"
},
{
"name": "Objective-C++",
"bytes": "9477"
},
{
"name": "Python",
"bytes": "189349"
},
{
"name": "Shell",
"bytes": "4067"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.cnd.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>perf-gear</name>
<c-extensions>c</c-extensions>
<cpp-extensions/>
<header-extensions>h</header-extensions>
<sourceEncoding>UTF-8</sourceEncoding>
<make-dep-projects/>
<sourceRootList>
<sourceRootElem>lib</sourceRootElem>
<sourceRootElem>src</sourceRootElem>
</sourceRootList>
<confList>
<confElem>
<name>Debug</name>
<type>2</type>
</confElem>
<confElem>
<name>Release</name>
<type>2</type>
</confElem>
<confElem>
<name>Cov</name>
<type>2</type>
</confElem>
</confList>
<formatting>
<project-formatting-style>false</project-formatting-style>
</formatting>
</data>
</configuration>
</project>
| {
"content_hash": "22a297b766fa1e9d52afa8831a9e00b5",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 74,
"avg_line_length": 35.74285714285714,
"alnum_prop": 0.48201438848920863,
"repo_name": "aldialimucaj/perf-gear",
"id": "93f3443f457983fed5fd29cf19af2fb264efbd56",
"size": "1251",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "nbproject/project.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "3420557"
},
{
"name": "JavaScript",
"bytes": "1496"
},
{
"name": "Makefile",
"bytes": "59998"
},
{
"name": "PHP",
"bytes": "144"
},
{
"name": "Python",
"bytes": "11557"
},
{
"name": "Shell",
"bytes": "5316"
}
],
"symlink_target": ""
} |
package org.apache.activemq.artemis.core.protocol.mqtt;
import java.util.Map;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.handler.codec.mqtt.MqttConnAckMessage;
import io.netty.handler.codec.mqtt.MqttConnAckVariableHeader;
import io.netty.handler.codec.mqtt.MqttConnectMessage;
import io.netty.handler.codec.mqtt.MqttConnectReturnCode;
import io.netty.handler.codec.mqtt.MqttFixedHeader;
import io.netty.handler.codec.mqtt.MqttMessage;
import io.netty.handler.codec.mqtt.MqttMessageIdVariableHeader;
import io.netty.handler.codec.mqtt.MqttMessageType;
import io.netty.handler.codec.mqtt.MqttPubAckMessage;
import io.netty.handler.codec.mqtt.MqttPublishMessage;
import io.netty.handler.codec.mqtt.MqttPublishVariableHeader;
import io.netty.handler.codec.mqtt.MqttQoS;
import io.netty.handler.codec.mqtt.MqttSubAckMessage;
import io.netty.handler.codec.mqtt.MqttSubAckPayload;
import io.netty.handler.codec.mqtt.MqttSubscribeMessage;
import io.netty.handler.codec.mqtt.MqttUnsubAckMessage;
import io.netty.handler.codec.mqtt.MqttUnsubscribeMessage;
import io.netty.util.ReferenceCountUtil;
import org.apache.activemq.artemis.api.core.RoutingType;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.core.server.ActiveMQServer;
import org.apache.activemq.artemis.spi.core.protocol.ConnectionEntry;
/**
* This class is responsible for receiving and sending MQTT packets, delegating behaviour to one of the
* MQTTConnectionManager, MQTTPublishMananger, MQTTSubscriptionManager classes.
*/
public class MQTTProtocolHandler extends ChannelInboundHandlerAdapter {
private ConnectionEntry connectionEntry;
private MQTTConnection connection;
private MQTTSession session;
private ActiveMQServer server;
private MQTTProtocolManager protocolManager;
// This Channel Handler is not sharable, therefore it can only ever be associated with a single ctx.
private ChannelHandlerContext ctx;
private final MQTTLogger log = MQTTLogger.LOGGER;
private boolean stopped = false;
private Map<SimpleString, RoutingType> prefixes;
public MQTTProtocolHandler(ActiveMQServer server, MQTTProtocolManager protocolManager) {
this.server = server;
this.protocolManager = protocolManager;
this.prefixes = protocolManager.getPrefixes();
}
void setConnection(MQTTConnection connection, ConnectionEntry entry) throws Exception {
this.connectionEntry = entry;
this.connection = connection;
this.session = new MQTTSession(this, connection, protocolManager, server.getConfiguration().getWildcardConfiguration());
}
void stop(boolean error) {
stopped = true;
}
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) {
try {
if (stopped) {
disconnect(true);
return;
}
MqttMessage message = (MqttMessage) msg;
// Disconnect if Netty codec failed to decode the stream.
if (message.decoderResult().isFailure()) {
log.debug("Bad Message Disconnecting Client.");
disconnect(true);
return;
}
connection.dataReceived();
MQTTUtil.logMessage(session.getState(), message, true);
switch (message.fixedHeader().messageType()) {
case CONNECT:
handleConnect((MqttConnectMessage) message, ctx);
break;
case CONNACK:
handleConnack((MqttConnAckMessage) message);
break;
case PUBLISH:
handlePublish((MqttPublishMessage) message);
break;
case PUBACK:
handlePuback((MqttPubAckMessage) message);
break;
case PUBREC:
handlePubrec(message);
break;
case PUBREL:
handlePubrel(message);
break;
case PUBCOMP:
handlePubcomp(message);
break;
case SUBSCRIBE:
handleSubscribe((MqttSubscribeMessage) message, ctx);
break;
case SUBACK:
handleSuback((MqttSubAckMessage) message);
break;
case UNSUBSCRIBE:
handleUnsubscribe((MqttUnsubscribeMessage) message);
break;
case UNSUBACK:
handleUnsuback((MqttUnsubAckMessage) message);
break;
case PINGREQ:
handlePingreq(message, ctx);
break;
case PINGRESP:
handlePingresp(message);
break;
case DISCONNECT:
handleDisconnect(message);
break;
default:
disconnect(true);
}
} catch (Exception e) {
log.debug("Error processing Control Packet, Disconnecting Client", e);
disconnect(true);
} finally {
ReferenceCountUtil.release(msg);
}
}
/**
* Called during connection.
*
* @param connect
*/
void handleConnect(MqttConnectMessage connect, ChannelHandlerContext ctx) throws Exception {
this.ctx = ctx;
connectionEntry.ttl = connect.variableHeader().keepAliveTimeSeconds() * 1500L;
String clientId = connect.payload().clientIdentifier();
session.getConnectionManager().connect(clientId, connect.payload().userName(), connect.payload().passwordInBytes(), connect.variableHeader().isWillFlag(), connect.payload().willMessageInBytes(), connect.payload().willTopic(), connect.variableHeader().isWillRetain(), connect.variableHeader().willQos(), connect.variableHeader().isCleanSession());
}
void disconnect(boolean error) {
session.getConnectionManager().disconnect(error);
}
void sendConnack(MqttConnectReturnCode returnCode) {
MqttFixedHeader fixedHeader = new MqttFixedHeader(MqttMessageType.CONNACK, false, MqttQoS.AT_MOST_ONCE, false, 0);
MqttConnAckVariableHeader varHeader = new MqttConnAckVariableHeader(returnCode, true);
MqttConnAckMessage message = new MqttConnAckMessage(fixedHeader, varHeader);
ctx.write(message);
ctx.flush();
}
/**
* The server does not instantiate connections therefore any CONNACK received over a connection is an invalid
* control message.
*
* @param message
*/
void handleConnack(MqttConnAckMessage message) {
log.debug("Received invalid CONNACK from client: " + session.getSessionState().getClientId());
log.debug("Disconnecting client: " + session.getSessionState().getClientId());
disconnect(true);
}
void handlePublish(MqttPublishMessage message) throws Exception {
this.protocolManager.invokeIncoming(message, this.connection);
session.getMqttPublishManager().handleMessage(message.variableHeader().messageId(), message.variableHeader().topicName(), message.fixedHeader().qosLevel().value(), message.payload(), message.fixedHeader().isRetain());
}
void sendPubAck(int messageId) {
sendPublishProtocolControlMessage(messageId, MqttMessageType.PUBACK);
}
void sendPubRel(int messageId) {
sendPublishProtocolControlMessage(messageId, MqttMessageType.PUBREL);
}
void sendPubRec(int messageId) {
sendPublishProtocolControlMessage(messageId, MqttMessageType.PUBREC);
}
void sendPubComp(int messageId) {
sendPublishProtocolControlMessage(messageId, MqttMessageType.PUBCOMP);
}
void sendPublishProtocolControlMessage(int messageId, MqttMessageType messageType) {
MqttQoS qos = (messageType == MqttMessageType.PUBREL) ? MqttQoS.AT_LEAST_ONCE : MqttQoS.AT_MOST_ONCE;
MqttFixedHeader fixedHeader = new MqttFixedHeader(messageType, false, qos, // Spec requires 01 in header for rel
false, 0);
MqttPubAckMessage rel = new MqttPubAckMessage(fixedHeader, MqttMessageIdVariableHeader.from(messageId));
ctx.write(rel);
ctx.flush();
}
void handlePuback(MqttPubAckMessage message) throws Exception {
session.getMqttPublishManager().handlePubAck(message.variableHeader().messageId());
}
void handlePubrec(MqttMessage message) throws Exception {
int messageId = ((MqttMessageIdVariableHeader) message.variableHeader()).messageId();
session.getMqttPublishManager().handlePubRec(messageId);
}
void handlePubrel(MqttMessage message) {
int messageId = ((MqttMessageIdVariableHeader) message.variableHeader()).messageId();
session.getMqttPublishManager().handlePubRel(messageId);
}
void handlePubcomp(MqttMessage message) throws Exception {
int messageId = ((MqttMessageIdVariableHeader) message.variableHeader()).messageId();
session.getMqttPublishManager().handlePubComp(messageId);
}
void handleSubscribe(MqttSubscribeMessage message, ChannelHandlerContext ctx) throws Exception {
MQTTSubscriptionManager subscriptionManager = session.getSubscriptionManager();
int[] qos = subscriptionManager.addSubscriptions(message.payload().topicSubscriptions());
MqttFixedHeader header = new MqttFixedHeader(MqttMessageType.SUBACK, false, MqttQoS.AT_MOST_ONCE, false, 0);
MqttSubAckMessage ack = new MqttSubAckMessage(header, message.variableHeader(), new MqttSubAckPayload(qos));
MQTTUtil.logMessage(session.getSessionState(), ack, false);
ctx.write(ack);
ctx.flush();
}
void handleSuback(MqttSubAckMessage message) {
disconnect(true);
}
void handleUnsubscribe(MqttUnsubscribeMessage message) throws Exception {
session.getSubscriptionManager().removeSubscriptions(message.payload().topics());
MqttFixedHeader header = new MqttFixedHeader(MqttMessageType.UNSUBACK, false, MqttQoS.AT_MOST_ONCE, false, 0);
MqttUnsubAckMessage m = new MqttUnsubAckMessage(header, message.variableHeader());
MQTTUtil.logMessage(session.getSessionState(), m, false);
ctx.write(m);
ctx.flush();
}
void handleUnsuback(MqttUnsubAckMessage message) {
disconnect(true);
}
void handlePingreq(MqttMessage message, ChannelHandlerContext ctx) {
MqttMessage pingResp = new MqttMessage(new MqttFixedHeader(MqttMessageType.PINGRESP, false, MqttQoS.AT_MOST_ONCE, false, 0));
MQTTUtil.logMessage(session.getSessionState(), pingResp, false);
ctx.write(pingResp);
ctx.flush();
}
void handlePingresp(MqttMessage message) {
disconnect(true);
}
void handleDisconnect(MqttMessage message) {
disconnect(false);
}
protected int send(int messageId, String topicName, int qosLevel, boolean isRetain, ByteBuf payload, int deliveryCount) {
boolean redelivery = qosLevel == 0 ? false : (deliveryCount > 0);
MqttFixedHeader header = new MqttFixedHeader(MqttMessageType.PUBLISH, redelivery, MqttQoS.valueOf(qosLevel), isRetain, 0);
MqttPublishVariableHeader varHeader = new MqttPublishVariableHeader(topicName, messageId);
MqttMessage publish = new MqttPublishMessage(header, varHeader, payload);
this.protocolManager.invokeOutgoing(publish, connection);
MQTTUtil.logMessage(session.getSessionState(), publish, false);
ctx.write(publish);
ctx.flush();
return 1;
}
ActiveMQServer getServer() {
return server;
}
}
| {
"content_hash": "716bc5cd8102fc3943634737e6a75ef5",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 352,
"avg_line_length": 38.602693602693606,
"alnum_prop": 0.7032708242477104,
"repo_name": "gtully/activemq-artemis",
"id": "7c14403b3bf61cfdb90aff0f3df89a516b048161",
"size": "12261",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolHandler.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "7535"
},
{
"name": "C",
"bytes": "27681"
},
{
"name": "CMake",
"bytes": "4260"
},
{
"name": "CSS",
"bytes": "65800"
},
{
"name": "HTML",
"bytes": "59137"
},
{
"name": "Java",
"bytes": "24622767"
},
{
"name": "JavaScript",
"bytes": "94211"
},
{
"name": "Shell",
"bytes": "31619"
}
],
"symlink_target": ""
} |
Extended markdown rendering in Scheme
=====================================
It can often be useful to embed LaTeX diagrams, graphs, and so on inside an
`lp.scm` document you are writing. One can generate these files separately and
link them manually, but then you end up with `.tex` files and the like scattered
all over the place, many of which express a single small equation! Not to
mention keeping track of which source belongs to which part of the document can
be extremely difficult.
Since we already have the REPL open to parse and run the document we're working
with, why not supply a simple render procedure to generate images from code
embedded in the markdown file itself? That is the purpose of this module.
This module is written as a literate Scheme file. It is loaded automatically as
part of `lp.scm`; to make use of it simply load `lp.scm` in the REPL.
This will give you access to the `lp_render` procedure to render extended
markup. For example, running this script on itself will generate the images
below:
(lp/render "render.scm.md")
Example images
--------------
Take a look at the source for this markdown document to see what the embedded
markup for each image kind looks like.
### Embedded LaTeX
![$ Some embedded \LaTeX{} including some maths: $e = mc^2$ $](img/latex.png?raw=true)
### Embedded Graphviz Dot
![. digraph cc { such -> WOW; render -> WOW; much -> awesome -> WOW; } .](img/dot.png?raw=true)
### Normal images work as usual
![Normal images still work](http://www.disqorse.com/uploads/monthly_02_2014/post-1-0-81204300-1393096566.jpg)
Load options and entry point definition
---------------------------------------
This module makes use of a couple of extensions specific to MIT Scheme:
\*parser language definitions and synchronous subprocesses. The former gives us
a simple parser combinator library which makes it much easier to read the input,
while the latter lets us call shell commands. These extensions need to be
enabled, which can be done using `load-option`:
```scheme
(load-option '*parser)
(load-option 'synchronous-subprocess)
```
Due to some quirks involving the way MIT Scheme compiles its `*parser` language,
I've extracted parts of this tutorial into a separate file which we load here.
The contents of this file will be included inline as well, so you can pretty
much ignore the following include.
```scheme
(with-working-directory-pathname
(directory-pathname (current-load-pathname))
(lambda () (load "parser-macros.scm")))
```
The module exports a single procedure, `lp/render`. Everything else is defined
within this procedure to avoid cluttering up the namespace with utility
functions.
```scheme
(define (lp/render filename)
```
`lp/render` will take a single parameter, the filename to parse for embedded
markup. It will go through the file, looking for supported markup, and generate
images from that markup. Currently supported markup is:
* `![$ ... $]`, containing LaTeX code
* `![. ... .]`, containing graphviz' dot format
This markup must be followed be the image filename to output in brackets (which
has to be a `png` file). The perspicacious reader will have noticed that this
syntax is a variation on standard markdown image syntax. This is no
coincidence! This keeps the file compatible with standard markdown and ensures
that markdown viewers will be able to display the resulting images.
> Tip: If the file is intended to be viewed on Github, you'll need to put
> `?raw=true` at the end of the image filename. The renderer strips anything
> after the question mark out of the filename, so the output file will still
> have the correct name, but the image source as viewed on github will include
> it. Unfortunately, this means that markdown files that look good on github
> won't display images when viewed locally, and vice versa.
TODO list
---------
There are a few issues with this module that still need to be resolved. These
are as follows:
* Add support for graphs/diagrams with Python's matplotlib
* Deal properly with the final latex block (breaks unless there is a
non-markup bang somewhere between there and the end of the file at the
moment)
Parser combinators
-------------------------
Parser combinators provide an intuitive approach to building parsers, whereby
complex parsers can be constructed by composing simple parsers together. It is
especially popular in the [Haskell][haskell] community, where parser combinator
libraries like [Parsec][parsec] really demonstrate the power of this model.
MIT Scheme's [Parser Language][parser-language] provides a similar sort of
functionality by using lisp macros. The combinators provided by the library are
fairly limited in scope, but the idea is that by combining these and abstracting
common patterns using parser-language macros, you can design quite powerful
parsers.
We begin with an overview of what it is we'd like to achieve. The
`parse-extended-markup` procedure will parse a single block of extended markup,
from the `![` opening to the close of the image filename (`)`).
```scheme
(define parse-extended-markup
(*parser
(seq (alt parse-latex-block
parse-dot-block)
skip-whitespace
parse-image-filename)))
```
The parser is fairly straightforward and provides a good summary of what is to
come. `*parser` returns a parser, which expects a single argument (the parser
buffer, which we'll talk about a bit later). `seq` is a utility function
provided by the parser-language module which sequences a set of parsers
together, concatenating their results. The rest reads like a description of
what we'd like to do: first parse the extended markup block, skip any whitespace
between that and the image, and then parse the image filename. The meat of our
parser will take place in the definition of these procedures.
Skipping text
-------------
The simplest form of parser simply skips over text, taking us to the next part
of the file we might actually be interested in. `parse-extended-markup`
contains one such parser, which skips whitespace between the embedded markup and
the image filename. We will also need another, to skip everything until we
reach the next `!` symbol, ready to start parsing the next block of extended
markdown
The parser-language provides a few tools to help us here:
* `noise` runs the provided `matcher`, moving the buffer forward and throwing
away the result.
* `*` works similarly to the regex primitive -- it matches zero or more of the
provided `matcher`.
* `char` matches a single, provided character, while `not-char` matches
anything *other* than the provided character.
* `char-set` matches any character within the supplied [character set][character-sets].
Putting that all together, we get:
```scheme
(define skip-whitespace
(*parser (noise (* (char-set char-set:whitespace)))))
(define skip-to-bang
(*parser (seq (noise (* (not-char #\!))) #\!)))
```
Notice that these definitions also begin `*parser`. This is what gives the
parser-language its composability: The macro both takes and returns a parser, as
does its utility functions such as `seq`. By making use of this mechanism,
complex parsers can be constructed from simple, modular components.
Parsing the actual content
--------------------------
There are two pieces of content we're interested in: the extended markdown and
the name of the image to output to. I'm going to begin with the image parser
since that's simple.
```scheme
(define parse-image-filename
(*parser (seq #\( (match (* (not-char #\)))) #\))))
```
Here we're not supporting a `)` character in the image path, which seems
reasonable. As you can see, we make use of `seq` to combine three parsers: two
for the parentheses on either side and one for the actual filename itself. The
filename is defined as simply "any character which isn't `)`". We'll handle
things like the `?raw=true` suffix later; for now we just pass it through as if
it's part of the string.
When using a raw character or string literal (such as `#\(` and `#\)` above) in
a parser, parser-language will implicitly wrap it in `noise`, throwing away the
result. If you need it included in the parsed output you can make use of the
`char` or `string` parsers, so `(char #\()` will match and return a `(`
character. We make use of this in the parser for LaTeX blocks.
```
(define parse-latex-block
(*parser
(seq #\[ #\$
(values 'latex)
(match
(* (alt (not-char #\$)
(seq (char #\$)
(not-char #\])) )))
#\$ #\])))
```
This parser is a little more complicated, so let's break it down slowly. We
know our latex blocks are delimited by special `[$` and `$]` brackets, so we
need to parse these (discarding the result) at the beginning and the end of our
parser. The plan is to support various kinds of embedded markup, so we'd like
to be able to include arbitrary information about what sort of markup this is in
the output of the parser; this is the role of the `values` combinator, which
performs no actual parsing but simply always succeeds, adding its parameter to
the results of the parse.
Finally, we're left with the `match` clause. The reason this is tricky is that
we need to support instances of the `$` character being used inside the LaTeX
source itself -- it is the delimiter for maths environments in LaTeX, which is
the main reason we wanted to embed LaTeX in the first place! In order to
achieve this, we want to be able to match the following:
* Any character that is *not* `$`
* Any instance of `$` that is not immediately followed by `]`
This will allow us to match `$` but not `$]`, which is what we want. In order
to express alternatives like this, we can use the parser-language's `alt`
primitive, which attempts a series of parsers in turn, backtracking to the
starting point and trying again if they fail, and returning the results of the
first fully successful parse. The first alternative is simple: if the character
is not `$`, just let it straight through. The second alternative must check two
characters, so we combine the `char` and `not-char` parsers using the `seq`
primitive. We want the parsed values to be included in the result (otherwise
all `$` signs in the embedded LaTeX would be filtered out!), so we use a `char`
parser rather than just writing the raw literal. Finally we string all these
characters together using `*`.
The bulk of the parsing work is complete. There is just one problem -- you may
have noticed that all parsers thus far have assumed they are in the right place
to begin parsing the thing they were meant to parse. We will thus need a way to
link them together, skipping over the text we aren't interested in to get to the
parts we are. We can make use of the `skip-to-bang` parser we wrote earlier to
achieve this:
```scheme
(define parse-extended-or-skip
(*parser
(seq (? parse-extended-markup)
skip-to-bang)))
```
There is a hidden subtlety here. The `?` operator, similar to the regular
expressions operator by the same name, parses 0 or 1 instances of the provided
parser. Why is it necessary here? Consider what would happen when the text
contains an exclamation character which does not form part of an extended
markdown block; for example a simple exclamation mark at the end of a sentence.
`skip-to-bang` would put us where we want to be, immediately after it, but then
`parse-extended-markup` would attempt to parse the `[$ ... $]` block following
it and fail, causing the whole parser to fail and stop processing the file.
What we actually want is simply to skip to the next `!` character in this
situation.
Generalising the `parse-latex-block` parser
-------------------------------------------
We are likely to want to support more than just embedded LaTeX. It would be
nice to embed graphs or other generated images in the file as well. We could
write a procedure for each, for example `parse-matplotlib-block`,
`parse-imagemagick-block`, and so on but we know the structure of these things
is going to be quite similar, so ideally we'd like to be able to abstract this
to a single procedure which takes a delimiter and a type (`$` and `'latex` in
the above case), and parses a block of that type. We could then alternate
between these using `alt`.
Parser-language provides a method to do this in the form of [parser-language macros][plm].
Here we define such a macro which generalises the `parse-latex-block` procedure
described above to parse any block, given the identifying delimiter and a label
representing the type of the block.
```
(define-*parser-macro (delimited-block delimiter type)
`(seq #\[ ,delimiter
(values ,type)
(match
(* (alt (not-char ,delimiter)
(seq (char ,delimiter)
(not-char #\])) )))
,delimiter #\]))
```
> Note: This macro won't work unless it is defined at the top level and compiled
> before anything that uses it. Because of this, it is common to put macro
> definitions like this in a separate file, `parser-macros.scm`, and then load
> that file at the start. In fact, that is what we have done here; the above is
> just a reproduction of the code which is contained in `parser-macros.scm`
> which we included at the start.
At first glance, this macro looks very similar to the `parse-latex-block` we
defined above, however there are subtle syntactic differences. Most obviously,
the `*parser` line is missing from the start; this is because we are not
defining a procedure which returns a `*parser` in this case but a macro which
can be used to build a `*parser`. This can then be used inside a normal
`*parser` procedure.
The other obvious change is the scattering of syntax that has appeared: a `` ` ``
mark before the `seq` expression and commas before any use of the `delimiter`
and `type` parameters. These are necessary because we are defining a *macro*
here, rather than a procedure. The macro is intended to return a list, which
will then be run as a procedure. The backtick says "return the following as a
literal list, except where expressions are unquoted". The comma is the means by
which we "unquote" an expression; we say "replace this identifier with its
evaluation".
We can use this to re-implement `parse-latex-block` as follows:
```scheme
(define parse-latex-block (*parser (delimited-block #\$ 'latex)))
```
Try expanding this in your head -- look at the definition of `delimited-block`
and replace every instance of `,delimiter` with `#\$` and `,type` with `'latex`.
You will find the result is exactly the same as the `parse-latex-block`
procedure.
The advantage of defining it this way, though, is that now when we want to
define a new kind of block we can simply re-use the same macro. Here are some
definitions of parsers for Python's "matplotlib" library and Graphviz' "dot"
renderer:
```scheme
(define parse-matplotlib-block (*parser (delimited-block #\# 'matplotlib)))
(define parse-dot-block (*parser (delimited-block #\. 'dot)))
```
Extracting the markup
---------------------
Using the above parser combinators, we can extract a list of all valid markup
from a file. We want to loop over a supplied parser buffer, calling
`parse-extended-or-skip`, and then add any returned values to a list of results.
When the parser returns false, that means we have finished processing the file.
```scheme
(define (extract-markup-from-buffer buf)
(let loop ((p (parse-extended-or-skip buf))
(acc (list)))
(if (not p)
acc
(loop (parse-extended-or-skip buf)
(if (> (vector-length p) 0)
(cons p acc)
acc)))))
```
This procedure works more or less as you might expect; the only slight surprise
is the inner `if` expression. Why is that necessary? Well, remember when we
defined `parse-extended-or-skip` we used the `?` primitive to say "Attempt to
parse an extended block, but if there isn't one that's fine, just skip to the
next `!` character". It's the "that's fine" that's key here --
`parse-extended-markup` may have failed, but `(? parse-extended-markup)`
actually parsed *successfully*, returning an empty result! We want to discard
these results, so we just check the resulting results vector to make sure it
actually has content before adding it to the list.
Now all we need to do is actually run the procedure on our file! Recall that we
are still within the scope of the `lp/render` definition, so we have access to
the `filename` variable passed as a parameter. We can thus read the markup as
follows:
```scheme
(define extracted-markup
(call-with-input-file filename
(lambda (f)
(port/set-coding f 'utf-8)
(extract-markup-from-buffer (input-port->parser-buffer f)))))
```
Parsers expect a "parser buffer", which is a buffered form of input that they
use for backtracking. The parser-language provides a number of converters to
help create these buffers, including `input-port->parser-buffer` which we use
above. If we were parsing from a string rather than a file, we could simply use
`string->parser-buffer` instead.
Generating the images
---------------------
OK, so now we have all the data we need: we know the *filenames* of the images
that need to be created, the *source* used to create them, and what type of source
it is, which will determine the *method* by which we create them. In general,
these images will not be generated by Scheme; instead, we will call other
utilities to create them from the provided source. Of course, this module will
only work if the required utilities are installed on the machine you are running
it on!
At a high level, we simply want to loop over all the blocks extracted from the
file, processing each one. Scheme provides a higher-order procedure for
performing a side effect on each element of a list, namely `for-each`:
```scheme
(define (process-all)
(for-each process extracted-markup))
```
This procedure looks very similar to the better-known `map` function, and indeed
it is basically the same, however there are a couple of differences:
* `for-each` is guaranteed to run through the list in order; `map` may process
it in any order it pleases.
* `map` is intended to be run to modify the members of the list it's passed,
and thus its return value is a modified list. `for-each` is intended to be
run for its side effects, so it's return value is unspecified.
In reality, in many implementations the procedures are exactly the same as it is
easy to implement `for-each` in terms of `map`; however, this is not guaranteed,
and it is better to use `map` when you want to modify a list and `for-each` when
you want to perform side effects. Even if the results would be equivalent,
using the appropriate functions at the right time helps to communicate your
intention to other programmers, which is at least as important as getting the
job done in the first place.
Digging down a little bit, what form does the `process` procedure take?
```scheme
(define (process block)
(let ((type (vector-first block))
(src (vector-second block))
(img (normalise-image-filename (vector-third block))))
(cond
((equal? type 'latex) (process-latex src img))
((equal? type 'dot) (process-dot src img)))))
```
This is fairly simple; we simply extract the parts we're interested in out of
the block, and then run the appropriate processor on it. We are using a `cond`
statement to switch on the block type, which is fine as there aren't going to be
many different types supported. An alternative if there are lots of types is to
construct a lookup table from block type to processor procedure, but that would
be overkill in this case.
`normalise-image-filename` is run on the images to strip of everything after
the `?` character in the case where we have added `?raw=true` or similar for
display on Github. We could have done this as part of the parser, but it is
possible we might want to do something with this data in the future so we chose
to let it through then and strip it out here. The procedure to remove it is
quite simple; we search for instances of the `?` character and take the
substring to that point:
```scheme
(define (normalise-image-filename img)
(let ((idx (string-find-next-char img #\?)))
(if idx (substring img 0 idx) img)))
```
Now all that remains is to write the procedures which do the actual processing.
Generating embedded LaTeX images
--------------------------------
All processors take two parameters, the source code from which to generate the
image, and the filename to output to:
```scheme
(define (process-latex src img)
```
The LaTeX processor in particular has two requirements:
* A LaTeX installation (including `pdflatex`)
* A program to convert `pdf` files to `png`
MIT Scheme provides a procedure, `run-synchronous-subprocess`, which will run a
shell command, outputting anything it outputs to `STDOUT`, and returning to the
REPL when the command has completed. We'll use it to write procedures we can
use to run the two programs we need.
```scheme
(define (run-pdflatex dir texfile)
(run-synchronous-subprocess
"pdflatex" (list (string "--output-directory=" dir) texfile)))
```
Which image converter to use depends on which platform we're running. On Mac OS
X, the program used for image conversion is `sips`, which comes as standard.
Otherwise, we'll try ImageMagick.
> Note: I'm switching on the operating system here, but really I should probably
> switch on availability of the executable using `which` or similar.
```scheme
(define (run-image-converter pdf img)
(if (equal? microcode-id/operating-system-variant "MacOSX")
(run-synchronous-subprocess
"sips" (list "-s" "format" "png" "--out" img pdf))
(run-synchronous-subprocess "convert" (list pdf img))))
```
We want the user to be able to embed quite concise LaTeX snippets, so we'll
create a template which will wrap whatever source they provide in some standard
LaTeX boilerplate:
```scheme
(define (write-latex-document p)
(display
(string "\\documentclass[border=1]{standalone}"
"\\usepackage{amsmath,amsthm,amssymb}"
"\\begin{document}"
src
"\\end{document}") p))
```
Finally we write the actual generation procedure which takes a filename for the
temporary LaTeX file it will use to generate the image, writes out the LaTeX
source, and converts it. Since LaTeX generates quite a lot of temporary files
as it does its work, we delete those files as well before we're done.
```scheme
(define (gen-latex f)
(call-with-output-file f write-latex-document)
(let* ((tmpdir (directory-namestring f ))
(tmptex (->namestring f))
(tmppdf (string tmptex ".pdf"))
(tmplog (string tmptex ".log"))
(tmpaux (string tmptex ".aux"))
(outdir (directory-namestring img)))
(if (not (file-exists? outdir)) (make-directory outdir))
(run-pdflatex tmpdir tmptex)
(run-image-converter tmppdf img)
(delete-file tmplog)
(delete-file tmpaux)
(delete-file tmppdf)))
```
This may look quite complicated, but look closely and you'll see that it mostly
does the same thing; generating the names of intermediate files we know LaTeX
will spit out as part of its processing, and deleting those files afterwards.
Functions like `->namestring` take a `pathname`, a platform-independent
representation of the file path, and return a string describing that path on the
platform we're running on. `call-with-output-file` opens an output port and
calls the provided procedure, passing that port as its only parameter. It also
ensures the port gets closed properly when the procedure is complete, or in case
of error.
The final step in the `process-latex` procedure is to generate a temporary file
to write the LaTeX to, and then call `gen-latex` on that file. For this we can
use `call-with-temporary-file-pathname`, which generates a temporary file and
calls the provided procedure, passing the pathname as a parameter. When the
procedure is complete, the temporary file is deleted.
```scheme
(call-with-temporary-file-pathname gen-latex))
```
Note that the extra parenthesis here closes the scope we introduced with
`(define (process-latex src img)` at the beginning of this section.
Generating embedded graphs using Graphviz' `dot`
------------------------------------------------
Embedded graphs follow a similar pattern; first we generate a temporary file,
then we run some utility on it to create the output image. In this case, that
utility is `dot`, from the Graphviz package. We begin by opening the definition
to our procedure and defining how to call the `dot` program.
```scheme
(define (process-dot src img)
(define (run-dot dotfile outpng)
(run-synchronous-subprocess
"dot" (list dotfile "-Tpng" "-o" outpng)))
```
`dot` is a simpler tool than LaTeX, so the way we call it is slightly different.
Instead of passing a temporary directory for it to do its work in so that we can
clear it up later, we simply pass the input file (a temporary file we will
generate in a moment) and the output PNG filename. `dot` supports PNG files
natively, so there is no need for any conversion after this.
Next, we define a procedure to take the dot source which has been extracted from
the file and pass it to `run-dot` to be processed. Again, this procedure turns
out to be much simpler than the LaTeX equivalent:
```scheme
(define (gen-dot-graph f)
(call-with-output-file f
(lambda (p) (display src p)))
(run-dot (->namestring f) img))
```
Told you it was simple! The concept is the same, but because we have no
temporary files to worry about (the file into which we write the `dot` source
will be cleared up automatically), the procedure turns out a lot simpler. All
that remains now is to call it in the same manner as we did with LaTeX.
```scheme
(call-with-temporary-file-pathname gen-dot-graph))
```
Wrapping up
-----------
The final step is to actually call the `process-all` procedure we defined above,
which will go through all the extended markup we've found in the file and run
the appropriate processor on it. We then close the final scope, and our
`lp/render` procedure is ready to use!
```scheme
(process-all))
```
[dpwright/sicp]: https://github.com/dpwright/sicp
[haskell]: http://www.haskell.org
[parsec]: http://hackage.haskell.org/package/parsec
[parser-language]: http://www.gnu.org/software/mit-scheme/documentation/mit-scheme-ref/Parser-Language.html#Parser-Language
[plm]: http://www.gnu.org/software/mit-scheme/documentation/mit-scheme-ref/Parser_002dlanguage-Macros.html#Parser_002dlanguage-Macros
[character-sets]: http://www.gnu.org/software/mit-scheme/documentation/mit-scheme-ref/Character-Sets.html
| {
"content_hash": "6d576d21f07fd05b479b6bcade246871",
"timestamp": "",
"source": "github",
"line_count": 620,
"max_line_length": 145,
"avg_line_length": 43.920967741935485,
"alnum_prop": 0.7242480995923763,
"repo_name": "dpwright/lp.scm",
"id": "9227acaef6816523f3fe818fdc1a19bf78d8756e",
"size": "27231",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "render.scm.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Scheme",
"bytes": "3061"
}
],
"symlink_target": ""
} |
.s-btn-downarrow{
display:inline-block;
width:16px;
line-height:14px;
*line-height:15px;
background:url('images/menu_downarrow.png') no-repeat 9px center;
}
a.s-btn-active{
background-position: bottom right;
}
a.s-btn-active span.l-btn-left{
background-position: bottom left;
}
a.s-btn-active .s-btn-downarrow{
background:url('images/menu_split_downarrow.png') no-repeat 4px -19px;
}
a:hover.l-btn .s-btn-downarrow{
background:url('images/menu_split_downarrow.png') no-repeat 4px -19px;
}
a.s-btn-plain-active{
background:transparent;
border:1px solid #7eabcd;
_padding:0px 5px 0px 0px;
-moz-border-radius:3px;
-webkit-border-radius:3px;
border-radius:3px;
}
a.s-btn-plain-active .s-btn-downarrow{
background:url('images/menu_split_downarrow.png') no-repeat 4px -19px;
} | {
"content_hash": "96aaebcf60162764c1a631a714155956",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 71,
"avg_line_length": 25.59375,
"alnum_prop": 0.7106227106227107,
"repo_name": "lazytool/mockServer",
"id": "3aa9346b22ca3da1dbac1c8f14dcd99e7e2609a5",
"size": "819",
"binary": false,
"copies": "16",
"ref": "refs/heads/master",
"path": "mocker/src/main/webapp/js/jeasyui/themes/default/splitbutton.css",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "196290"
},
{
"name": "HTML",
"bytes": "12657"
},
{
"name": "Java",
"bytes": "130584"
},
{
"name": "JavaScript",
"bytes": "325273"
}
],
"symlink_target": ""
} |
package org.apache.hadoop.yarn.server.nodemanager;
import java.io.IOException;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import static java.util.concurrent.TimeUnit.*;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileContext;
import org.apache.hadoop.fs.UnsupportedFileSystemException;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor;
import org.apache.hadoop.yarn.service.AbstractService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
public class DeletionService extends AbstractService {
static final Log LOG = LogFactory.getLog(DeletionService.class);
private int debugDelay;
private final ContainerExecutor exec;
private ScheduledThreadPoolExecutor sched;
private final FileContext lfs = getLfs();
static final FileContext getLfs() {
try {
return FileContext.getLocalFSFileContext();
} catch (UnsupportedFileSystemException e) {
throw new RuntimeException(e);
}
}
public DeletionService(ContainerExecutor exec) {
super(DeletionService.class.getName());
this.exec = exec;
this.debugDelay = 0;
}
/**
*
/**
* Delete the path(s) as this user.
* @param user The user to delete as, or the JVM user if null
* @param subDir the sub directory name
* @param baseDirs the base directories which contains the subDir's
*/
public void delete(String user, Path subDir, Path... baseDirs) {
// TODO if parent owned by NM, rename within parent inline
sched.schedule(new FileDeletion(user, subDir, baseDirs),
debugDelay, TimeUnit.SECONDS);
}
@Override
public void init(Configuration conf) {
ThreadFactory tf = new ThreadFactoryBuilder()
.setNameFormat("DeletionService #%d")
.build();
if (conf != null) {
sched = new ScheduledThreadPoolExecutor(
conf.getInt(YarnConfiguration.NM_DELETE_THREAD_COUNT, YarnConfiguration.DEFAULT_NM_DELETE_THREAD_COUNT),
tf);
debugDelay = conf.getInt(YarnConfiguration.DEBUG_NM_DELETE_DELAY_SEC, 0);
} else {
sched = new ScheduledThreadPoolExecutor(YarnConfiguration.DEFAULT_NM_DELETE_THREAD_COUNT,
tf);
}
sched.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
sched.setKeepAliveTime(60L, SECONDS);
super.init(conf);
}
@Override
public void stop() {
sched.shutdown();
boolean terminated = false;
try {
terminated = sched.awaitTermination(10, SECONDS);
} catch (InterruptedException e) {
}
if (terminated != true) {
sched.shutdownNow();
}
super.stop();
}
/**
* Determine if the service has completely stopped.
* Used only by unit tests
* @return true if service has completely stopped
*/
@Private
public boolean isTerminated() {
return getServiceState() == STATE.STOPPED && sched.isTerminated();
}
private class FileDeletion implements Runnable {
final String user;
final Path subDir;
final Path[] baseDirs;
FileDeletion(String user, Path subDir, Path[] baseDirs) {
this.user = user;
this.subDir = subDir;
this.baseDirs = baseDirs;
}
@Override
public void run() {
if (null == user) {
if (baseDirs == null || baseDirs.length == 0) {
LOG.debug("NM deleting absolute path : " + subDir);
try {
lfs.delete(subDir, true);
} catch (IOException e) {
LOG.warn("Failed to delete " + subDir);
}
return;
}
for (Path baseDir : baseDirs) {
Path del = subDir == null? baseDir : new Path(baseDir, subDir);
LOG.debug("NM deleting path : " + del);
try {
lfs.delete(del, true);
} catch (IOException e) {
LOG.warn("Failed to delete " + subDir);
}
}
} else {
try {
LOG.debug("Deleting path: [" + subDir + "] as user: [" + user + "]");
exec.deleteAsUser(user, subDir, baseDirs);
} catch (IOException e) {
LOG.warn("Failed to delete as user " + user, e);
} catch (InterruptedException e) {
LOG.warn("Failed to delete as user " + user, e);
}
}
}
}
}
| {
"content_hash": "d8c06285643f874137f69139af848c3a",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 114,
"avg_line_length": 31.625,
"alnum_prop": 0.6616161616161617,
"repo_name": "moreus/hadoop",
"id": "7d4de873e3f22f0a90ff2b69f330997ce46eb2f5",
"size": "5344",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "hadoop-0.23.10/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DeletionService.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AspectJ",
"bytes": "31146"
},
{
"name": "C",
"bytes": "1067911"
},
{
"name": "C++",
"bytes": "521803"
},
{
"name": "CSS",
"bytes": "157107"
},
{
"name": "Erlang",
"bytes": "232"
},
{
"name": "Java",
"bytes": "43984644"
},
{
"name": "JavaScript",
"bytes": "87848"
},
{
"name": "Perl",
"bytes": "18992"
},
{
"name": "Python",
"bytes": "32767"
},
{
"name": "Shell",
"bytes": "1369281"
},
{
"name": "TeX",
"bytes": "19322"
},
{
"name": "XSLT",
"bytes": "185841"
}
],
"symlink_target": ""
} |
@(username: String, token: String, role: String = "")
@meta = {
@** Setup your opengraph tage **@
<meta property="og:title" content="Play WebRTC" />
<meta property="og:image" content="http://www.pubnub.com/blog/wp-content/uploads/2014/01/google-webrtc-logo.png" />
<meta property="og:description" content="WebRTC websocket relay server" />
}
@scripts = {
<script src='@routes.Assets.at("javascripts/webrtc.js")' type="text/javascript"></script>
<script src='@routes.Assets.at("javascripts/worker.rx.js")' type="text/javascript"></script>
<script src='@routes.Assets.at("javascripts/app.js")'></script>
<script src='@routes.Assets.at("javascripts/controllers.js")'></script>
<script language="JavaScript">
_username = '@username';
_token = '@token';
_role = '@role';
</script>
}
@main(meta)(scripts) {
<div ng-controller="AppCtrl">
<nav class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container">
<!--
<form class="navbar-form navbar-left pull-right" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
</form>
-->
<ul class="nav navbar-nav pull-right">
<li class="active"><a href="#/home">Home</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" ng-show="detect.isWebRTCSupported" class="supported">WebRTC Supported <span class="glyphicon glyphicon-ok"></span></a>
<a href="#" class="dropdown-toggle" ng-show="!detect.isWebRTCSupported" class="fail">WebRTC NOT Supported <span class="glyphicon glyphicon-remove"></span></a>
<ul class="dropdown-menu detect">
<li>Has Microphone <span class="value">{{detect.hasMicrophone}}</span></li>
<li>Has Webcam <span class="value">{{detect.hasWebcam}}</span></li>
<li>Audio Context <span class="value">{{detect.isAudioContextSupported}}</span></li>
<li>Screen Capture <span class="value">{{detect.isScreenCapturingSupported}}</span></li>
<li>Data Channel (SCTP) <span class="value">{{detect.isSctpDataChannelsSupported}}</span></li>
<li>Data Channel (RTP) <span class="value">{{detect.isRtpDataChannelsSupported}}</span></li>
</ul>
</li>
<li><a target="_blank" href="https://github.com/walkaboutim/play-webrtc">Docs</a></li>
</ul>
<a id="titleLink" class="brand" href="#/home" style="margin-top: 10px; display: block;"><img class="header-logo" src="/assets/images/logo.png"> play-webrtc</a>
</div>
</nav>
<div ng-view></div>
<footer>
<nav class="navbar navbar-default navbar-static-bottom" style="margin-bottom: 0px;">
<div class="container">
<div class="copyright">© 2014 Nextwave Software Inc.</div>
</div>
</nav>
</footer>
</div>
}
| {
"content_hash": "4cd1c497ada26bc418570db547636689",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 178,
"avg_line_length": 44.80821917808219,
"alnum_prop": 0.5778049526138795,
"repo_name": "coreyauger/play-webrtc",
"id": "600e06d6ed6e9e4db821110454103bb809007d18",
"size": "3272",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/views/index.scala.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2694"
},
{
"name": "CoffeeScript",
"bytes": "25559"
},
{
"name": "JavaScript",
"bytes": "181906"
},
{
"name": "Scala",
"bytes": "20985"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "5c9d674ca34cf5513f4ed2183e371962",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "e397452083a494efe743bb48dd2dca6aadb64fe5",
"size": "187",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Malpighiales/Euphorbiaceae/Euphorbia/Euphorbia wimmeriana/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>Plotting sensor layouts of EEG systems — MNE 1.0.3 documentation</title>
<!-- Loaded before other Sphinx assets -->
<link href="../../_static/styles/theme.css?digest=1999514e3f237ded88cf" rel="stylesheet">
<link href="../../_static/styles/pydata-sphinx-theme.css?digest=1999514e3f237ded88cf" rel="stylesheet">
<link rel="stylesheet"
href="../../_static/vendor/fontawesome/5.13.0/css/all.min.css">
<link rel="preload" as="font" type="font/woff2" crossorigin
href="../../_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2">
<link rel="preload" as="font" type="font/woff2" crossorigin
href="../../_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2">
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../../_static/graphviz.css" />
<link rel="stylesheet" type="text/css" href="../../_static/bootstrap_divs.css" />
<link rel="stylesheet" type="text/css" href="../../_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="../../_static/sg_gallery.css" />
<link rel="stylesheet" type="text/css" href="../../_static/sg_gallery-binder.css" />
<link rel="stylesheet" type="text/css" href="../../_static/sg_gallery-dataframe.css" />
<link rel="stylesheet" type="text/css" href="../../_static/sg_gallery-rendered-html.css" />
<link rel="stylesheet" type="text/css" href="../../_static/style.css" />
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="../../_static/scripts/pydata-sphinx-theme.js?digest=1999514e3f237ded88cf">
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/bootstrap_divs.js"></script>
<script src="../../_static/clipboard.min.js"></script>
<script src="../../_static/copybutton.js"></script>
<link rel="shortcut icon" href="../../_static/favicon.ico"/>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="Plot a cortical parcellation" href="parcellation.html" />
<link rel="prev" title="Plot the MNE brain and helmet" href="mne_helmet.html" />
<link rel="canonical" href="https://mne.tools/stable/index.html" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="docsearch:language" content="None">
<!-- Google Analytics -->
<script async="" src="https://www.google-analytics.com/analytics.js"></script>
<script>
window.ga = window.ga || function () {
(ga.q = ga.q || []).push(arguments) };
ga.l = +new Date;
ga('create', 'UA-37225609-1', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>
</head>
<body data-spy="scroll" data-target="#bd-toc-nav" data-offset="60">
<div class="container-fluid" id="banner"></div>
<nav class="navbar navbar-light navbar-expand-lg bg-light fixed-top bd-navbar" id="navbar-main"><div class="container-xl">
<div id="navbar-start">
<a class="navbar-brand" href="../../index.html">
<img src="../../_static/mne_logo_small.svg" class="logo" alt="logo">
</a>
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-collapsible" aria-controls="navbar-collapsible" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div id="navbar-collapsible" class="col-lg-9 collapse navbar-collapse">
<div id="navbar-center" class="mr-auto">
<div class="navbar-center-item">
<ul id="navbar-main-elements" class="navbar-nav">
<li class="toctree-l1 nav-item">
<a class="reference internal nav-link" href="../../install/index.html">
Install
</a>
</li>
<li class="toctree-l1 current active nav-item">
<a class="reference internal nav-link" href="../../overview/index.html">
Documentation
</a>
</li>
<li class="toctree-l1 nav-item">
<a class="reference internal nav-link" href="../../python_reference.html">
API Reference
</a>
</li>
<li class="toctree-l1 nav-item">
<a class="reference internal nav-link" href="../../overview/get_help.html">
Get help
</a>
</li>
<li class="toctree-l1 nav-item">
<a class="reference internal nav-link" href="../../overview/development.html">
Development
</a>
</li>
</ul>
</div>
</div>
<div id="navbar-end">
<div class="navbar-end-item">
<div class="dropdown" id="version_switcher">
<button type="button" class="btn btn-primary btn-sm navbar-btn dropdown-toggle" id="version_switcher_button" data-toggle="dropdown">
1.0 <!-- this text may get changed later by javascript -->
<span class="caret"></span>
</button>
<div id="version_switcher_menu" class="dropdown-menu list-group-flush py-0" aria-labelledby="version_switcher_button">
<!-- dropdown will be populated by javascript on page load -->
</div>
</div>
<!-- NOTE: this JS must live here (not in our global JS file) because it relies
on being processed by Jinja before it is run (specifically for replacing
variables auto_examples/visualization/montage_sgskip and {'json_url': 'https://mne.tools/dev/_static/versions.json', 'url_template': 'https://mne.tools/{version}/', 'version_match': '1.0'}.
-->
<script type="text/javascript">
// Check if corresponding page path exists in other version of docs
// and, if so, go there instead of the homepage of the other docs version
function checkPageExistsAndRedirect(event) {
const currentFilePath = "auto_examples/visualization/montage_sgskip.html",
tryUrl = event.target.getAttribute("href");
let otherDocsHomepage = tryUrl.replace(currentFilePath, "");
$.ajax({
type: 'HEAD',
url: tryUrl,
// if the page exists, go there
success: function() {
location.href = tryUrl;
}
}).fail(function() {
location.href = otherDocsHomepage;
});
// this prevents the browser from following the href of the clicked node
// (which is fine because this function takes care of redirecting)
return false;
}
// Populate the version switcher from the JSON config file
(function () {
$.getJSON("https://mne.tools/dev/_static/versions.json", function(data, textStatus, jqXHR) {
const currentFilePath = "auto_examples/visualization/montage_sgskip.html";
// create links to the corresponding page in the other docs versions
$.each(data, function(index, entry) {
// if no custom name specified (e.g., "latest"), use version string
if (!("name" in entry)) {
entry.name = entry.version;
}
// create the node
const node = document.createElement("a");
node.setAttribute("class", "list-group-item list-group-item-action py-1");
node.textContent = `${entry.name}`;
node.setAttribute("href", `${entry.url}${currentFilePath}`);
// on click, AJAX calls will check if the linked page exists before
// trying to redirect, and if not, will redirect to the homepage
// for that version of the docs.
node.onclick = checkPageExistsAndRedirect;
// Add dataset values for the version and name in case people want
// to apply CSS styling based on this information.
node.dataset["versionName"] = entry.name;
node.dataset["version"] = entry.version;
$("#version_switcher_menu").append(node);
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's 1.0 variable.
// also highlight the dropdown entry for the currently-viewed
// version's entry
if (entry.version == "1.0") {
node.classList.add("active");
let btn = document.getElementById("version_switcher_button");
btn.innerText = btn.dataset["activeVersionName"] = entry.name;
btn.dataset["activeVersion"] = entry.version;
}
});
});
})();
</script>
</div>
<div class="navbar-end-item">
<ul id="navbar-icon-links" class="navbar-nav" aria-label="Quick Links">
<li class="nav-item">
<a class="nav-link" href="https://github.com/mne-tools/mne-python" rel="noopener" target="_blank" title="GitHub"><span><i class="fab fa-github-square"></i></span>
<label class="sr-only">GitHub</label></a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://twitter.com/mne_python" rel="noopener" target="_blank" title="Twitter"><span><i class="fab fa-twitter-square"></i></span>
<label class="sr-only">Twitter</label></a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://mne.discourse.group/" rel="noopener" target="_blank" title="Discourse"><span><i class="fab fa-discourse"></i></span>
<label class="sr-only">Discourse</label></a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://discord.gg/rKfvxTuATa" rel="noopener" target="_blank" title="Discord"><span><i class="fab fa-discord"></i></span>
<label class="sr-only">Discord</label></a>
</li>
</ul>
</div>
</div>
</div>
</div>
</nav>
<div class="container-xl">
<div class="row">
<!-- Only show if we have sidebars configured, else just a small margin -->
<div class="col-12 col-md-3 bd-sidebar">
<div class="sidebar-start-items"><form class="bd-search d-flex align-items-center" action="../../search.html" method="get">
<i class="icon fas fa-search"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
<div class="bd-toc-item active">
<ul class="current nav bd-sidenav">
<li class="toctree-l1 has-children">
<a class="reference internal" href="../../auto_tutorials/index.html">
Tutorials
</a>
<input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" type="checkbox"/>
<label for="toctree-checkbox-1">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../../auto_tutorials/intro/index.html">
Introductory tutorials
</a>
<input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" type="checkbox"/>
<label for="toctree-checkbox-2">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/intro/10_overview.html">
Overview of MEG/EEG analysis with MNE-Python
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/intro/15_inplace.html">
Modifying data in-place
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/intro/20_events_from_raw.html">
Parsing events from raw data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/intro/30_info.html">
The Info data structure
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/intro/40_sensor_locations.html">
Working with sensor locations
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/intro/50_configure_mne.html">
Configuring MNE-Python
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/intro/70_report.html">
Getting started with mne.Report
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../../auto_tutorials/io/index.html">
Reading data for different recording systems
</a>
<input class="toctree-checkbox" id="toctree-checkbox-3" name="toctree-checkbox-3" type="checkbox"/>
<label for="toctree-checkbox-3">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/io/10_reading_meg_data.html">
Importing data from MEG devices
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/io/20_reading_eeg_data.html">
Importing data from EEG devices
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/io/30_reading_fnirs_data.html">
Importing data from fNIRS devices
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/io/60_ctf_bst_auditory.html">
Working with CTF data: the Brainstorm auditory dataset
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../../auto_tutorials/raw/index.html">
Working with continuous data
</a>
<input class="toctree-checkbox" id="toctree-checkbox-4" name="toctree-checkbox-4" type="checkbox"/>
<label for="toctree-checkbox-4">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/raw/10_raw_overview.html">
The Raw data structure: continuous data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/raw/20_event_arrays.html">
Working with events
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/raw/30_annotate_raw.html">
Annotating continuous data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/raw/40_visualize_raw.html">
Built-in plotting methods for Raw objects
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../../auto_tutorials/preprocessing/index.html">
Preprocessing
</a>
<input class="toctree-checkbox" id="toctree-checkbox-5" name="toctree-checkbox-5" type="checkbox"/>
<label for="toctree-checkbox-5">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/preprocessing/10_preprocessing_overview.html">
Overview of artifact detection
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/preprocessing/15_handling_bad_channels.html">
Handling bad channels
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/preprocessing/20_rejecting_bad_data.html">
Rejecting bad data spans and breaks
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/preprocessing/25_background_filtering.html">
Background information on filtering
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/preprocessing/30_filtering_resampling.html">
Filtering and resampling data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/preprocessing/35_artifact_correction_regression.html">
Repairing artifacts with regression
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/preprocessing/40_artifact_correction_ica.html">
Repairing artifacts with ICA
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/preprocessing/45_projectors_background.html">
Background on projectors and projections
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/preprocessing/50_artifact_correction_ssp.html">
Repairing artifacts with SSP
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/preprocessing/55_setting_eeg_reference.html">
Setting the EEG reference
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/preprocessing/59_head_positions.html">
Extracting and visualizing subject head movement
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/preprocessing/60_maxwell_filtering_sss.html">
Signal-space separation (SSS) and Maxwell filtering
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/preprocessing/70_fnirs_processing.html">
Preprocessing functional near-infrared spectroscopy (fNIRS) data
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../../auto_tutorials/epochs/index.html">
Segmenting continuous data into epochs
</a>
<input class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" type="checkbox"/>
<label for="toctree-checkbox-6">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/epochs/10_epochs_overview.html">
The Epochs data structure: discontinuous data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/epochs/20_visualize_epochs.html">
Visualizing epoched data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/epochs/30_epochs_metadata.html">
Working with Epoch metadata
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/epochs/40_autogenerate_metadata.html">
Auto-generating Epochs metadata
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/epochs/50_epochs_to_data_frame.html">
Exporting Epochs to Pandas DataFrames
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/epochs/60_make_fixed_length_epochs.html">
Divide continuous data into equally-spaced epochs
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../../auto_tutorials/evoked/index.html">
Estimating evoked responses
</a>
<input class="toctree-checkbox" id="toctree-checkbox-7" name="toctree-checkbox-7" type="checkbox"/>
<label for="toctree-checkbox-7">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/evoked/10_evoked_overview.html">
The Evoked data structure: evoked/averaged data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/evoked/20_visualize_evoked.html">
Visualizing Evoked data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/evoked/30_eeg_erp.html">
EEG processing and Event Related Potentials (ERPs)
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/evoked/40_whitened.html">
Plotting whitened data
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../../auto_tutorials/time-freq/index.html">
Time-frequency analysis
</a>
<input class="toctree-checkbox" id="toctree-checkbox-8" name="toctree-checkbox-8" type="checkbox"/>
<label for="toctree-checkbox-8">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/time-freq/20_sensors_time_frequency.html">
Frequency and time-frequency sensor analysis
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/time-freq/50_ssvep.html">
Frequency-tagging: Basic analysis of an SSVEP/vSSR dataset
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../../auto_tutorials/forward/index.html">
Forward models and source spaces
</a>
<input class="toctree-checkbox" id="toctree-checkbox-9" name="toctree-checkbox-9" type="checkbox"/>
<label for="toctree-checkbox-9">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/forward/10_background_freesurfer.html">
FreeSurfer MRI reconstruction
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/forward/20_source_alignment.html">
Source alignment and coordinate frames
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/forward/25_automated_coreg.html">
Using an automated approach to coregistration
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/forward/30_forward.html">
Head model and forward computation
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/forward/35_eeg_no_mri.html">
EEG forward operator with a template MRI
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/forward/50_background_freesurfer_mne.html">
How MNE uses FreeSurfer’s outputs
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/forward/80_fix_bem_in_blender.html">
Editing BEM surfaces in Blender
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/forward/90_compute_covariance.html">
Computing a covariance matrix
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../../auto_tutorials/inverse/index.html">
Source localization and inverses
</a>
<input class="toctree-checkbox" id="toctree-checkbox-10" name="toctree-checkbox-10" type="checkbox"/>
<label for="toctree-checkbox-10">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/inverse/10_stc_class.html">
The SourceEstimate data structure
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/inverse/20_dipole_fit.html">
Source localization with equivalent current dipole (ECD) fit
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/inverse/30_mne_dspm_loreta.html">
Source localization with MNE, dSPM, sLORETA, and eLORETA
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/inverse/35_dipole_orientations.html">
The role of dipole orientations in distributed source localization
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/inverse/40_mne_fixed_free.html">
Computing various MNE solutions
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/inverse/50_beamformer_lcmv.html">
Source reconstruction using an LCMV beamformer
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/inverse/60_visualize_stc.html">
Visualize source time courses (stcs)
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/inverse/70_eeg_mri_coords.html">
EEG source localization given electrode locations on an MRI
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/inverse/80_brainstorm_phantom_elekta.html">
Brainstorm Elekta phantom dataset tutorial
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/inverse/85_brainstorm_phantom_ctf.html">
Brainstorm CTF phantom dataset tutorial
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/inverse/90_phantom_4DBTi.html">
4D Neuroimaging/BTi phantom dataset tutorial
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../../auto_tutorials/stats-sensor-space/index.html">
Statistical analysis of sensor data
</a>
<input class="toctree-checkbox" id="toctree-checkbox-11" name="toctree-checkbox-11" type="checkbox"/>
<label for="toctree-checkbox-11">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/stats-sensor-space/10_background_stats.html">
Statistical inference
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/stats-sensor-space/20_erp_stats.html">
Visualising statistical significance thresholds on EEG data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/stats-sensor-space/40_cluster_1samp_time_freq.html">
Non-parametric 1 sample cluster statistic on single trial power
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/stats-sensor-space/50_cluster_between_time_freq.html">
Non-parametric between conditions cluster statistic on single trial power
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/stats-sensor-space/75_cluster_ftest_spatiotemporal.html">
Spatiotemporal permutation F-test on full sensor data
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../../auto_tutorials/stats-source-space/index.html">
Statistical analysis of source estimates
</a>
<input class="toctree-checkbox" id="toctree-checkbox-12" name="toctree-checkbox-12" type="checkbox"/>
<label for="toctree-checkbox-12">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/stats-source-space/20_cluster_1samp_spatiotemporal.html">
Permutation t-test on source data with spatio-temporal clustering
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/stats-source-space/30_cluster_ftest_spatiotemporal.html">
2 samples permutation test on source data with spatio-temporal clustering
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/stats-source-space/60_cluster_rmANOVA_spatiotemporal.html">
Repeated measures ANOVA on source data with spatio-temporal clustering
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/stats-source-space/70_cluster_rmANOVA_time_freq.html">
Mass-univariate twoway repeated measures ANOVA on single trial power
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../../auto_tutorials/machine-learning/index.html">
Machine learning models of neural activity
</a>
<input class="toctree-checkbox" id="toctree-checkbox-13" name="toctree-checkbox-13" type="checkbox"/>
<label for="toctree-checkbox-13">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/machine-learning/30_strf.html">
Spectro-temporal receptive field (STRF) estimation on continuous data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/machine-learning/50_decoding.html">
Decoding (MVPA)
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../../auto_tutorials/clinical/index.html">
Clinical applications
</a>
<input class="toctree-checkbox" id="toctree-checkbox-14" name="toctree-checkbox-14" type="checkbox"/>
<label for="toctree-checkbox-14">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/clinical/10_ieeg_localize.html">
Locating intracranial electrode contacts
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/clinical/20_seeg.html">
Working with sEEG data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/clinical/30_ecog.html">
Working with ECoG data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/clinical/60_sleep.html">
Sleep stage classification from polysomnography (PSG) data
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../../auto_tutorials/simulation/index.html">
Simulation
</a>
<input class="toctree-checkbox" id="toctree-checkbox-15" name="toctree-checkbox-15" type="checkbox"/>
<label for="toctree-checkbox-15">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/simulation/10_array_objs.html">
Creating MNE-Python data structures from scratch
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/simulation/70_point_spread.html">
Corrupt known signal with point spread
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../../auto_tutorials/simulation/80_dics.html">
DICS for power mapping
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1 current active has-children">
<a class="reference internal" href="../index.html">
Examples
</a>
<input checked="" class="toctree-checkbox" id="toctree-checkbox-16" name="toctree-checkbox-16" type="checkbox"/>
<label for="toctree-checkbox-16">
<i class="fas fa-chevron-down">
</i>
</label>
<ul class="current">
<li class="toctree-l2 has-children">
<a class="reference internal" href="../io/index.html">
Input/Output
</a>
<input class="toctree-checkbox" id="toctree-checkbox-17" name="toctree-checkbox-17" type="checkbox"/>
<label for="toctree-checkbox-17">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../io/elekta_epochs.html">
Getting averaging info from .fif files
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../io/read_neo_format.html">
How to use data in neural ensemble (NEO) format
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../io/read_noise_covariance_matrix.html">
Reading/Writing a noise covariance matrix
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../io/read_xdf.html">
Reading XDF EEG data
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../simulation/index.html">
Data Simulation
</a>
<input class="toctree-checkbox" id="toctree-checkbox-18" name="toctree-checkbox-18" type="checkbox"/>
<label for="toctree-checkbox-18">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../simulation/simulate_evoked_data.html">
Generate simulated evoked data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../simulation/simulate_raw_data.html">
Generate simulated raw data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../simulation/simulated_raw_data_using_subject_anatomy.html">
Simulate raw data using subject anatomy
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../simulation/source_simulator.html">
Generate simulated source data
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../preprocessing/index.html">
Preprocessing
</a>
<input class="toctree-checkbox" id="toctree-checkbox-19" name="toctree-checkbox-19" type="checkbox"/>
<label for="toctree-checkbox-19">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../preprocessing/css.html">
Cortical Signal Suppression (CSS) for removal of cortical signals
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../preprocessing/define_target_events.html">
Define target events based on time lag, plot evoked response
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../preprocessing/eeg_csd.html">
Transform EEG data using current source density (CSD)
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../preprocessing/eog_artifact_histogram.html">
Show EOG artifact timing
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../preprocessing/find_ref_artifacts.html">
Find MEG reference channel artifacts
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../preprocessing/fnirs_artifact_removal.html">
Visualise NIRS artifact correction methods
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../preprocessing/ica_comparison.html">
Compare the different ICA algorithms in MNE
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../preprocessing/interpolate_bad_channels.html">
Interpolate bad channels for MEG/EEG channels
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../preprocessing/movement_compensation.html">
Maxwell filter data with movement compensation
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../preprocessing/movement_detection.html">
Annotate movement artifacts and reestimate dev_head_t
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../preprocessing/muscle_detection.html">
Annotate muscle artifacts
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../preprocessing/otp.html">
Plot sensor denoising using oversampled temporal projection
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../preprocessing/shift_evoked.html">
Shifting time-scale in evoked data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../preprocessing/virtual_evoked.html">
Remap MEG channel types
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../preprocessing/xdawn_denoising.html">
XDAWN Denoising
</a>
</li>
</ul>
</li>
<li class="toctree-l2 current active has-children">
<a class="reference internal" href="index.html">
Visualization
</a>
<input checked="" class="toctree-checkbox" id="toctree-checkbox-20" name="toctree-checkbox-20" type="checkbox"/>
<label for="toctree-checkbox-20">
<i class="fas fa-chevron-down">
</i>
</label>
<ul class="current">
<li class="toctree-l3">
<a class="reference internal" href="3d_to_2d.html">
How to convert 3D electrode positions to a 2D image
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="brain.html">
Plotting with
<code class="docutils literal notranslate">
<span class="pre">
mne.viz.Brain
</span>
</code>
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="channel_epochs_image.html">
Visualize channel over epochs as an image
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="eeg_on_scalp.html">
Plotting EEG sensors on the scalp
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="eeglab_head_sphere.html">
How to plot topomaps the way EEGLAB does
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="evoked_arrowmap.html">
Plotting topographic arrowmaps of evoked data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="evoked_topomap.html">
Plotting topographic maps of evoked data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="evoked_whitening.html">
Whitening evoked data with a noise covariance
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="meg_sensors.html">
Plotting sensor layouts of MEG systems
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="mne_helmet.html">
Plot the MNE brain and helmet
</a>
</li>
<li class="toctree-l3 current active">
<a class="current reference internal" href="#">
Plotting sensor layouts of EEG systems
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="parcellation.html">
Plot a cortical parcellation
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="publication_figure.html">
Make figures more publication ready
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="roi_erpimage_by_rt.html">
Plot single trial activity, grouped by ROI and sorted by RT
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="sensor_noise_level.html">
Show noise levels from empty room data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="ssp_projs_sensitivity_map.html">
Sensitivity map of SSP projections
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="topo_compare_conditions.html">
Compare evoked responses for different conditions
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="topo_customized.html">
Plot custom topographies for MEG sensors
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="xhemi.html">
Cross-hemisphere comparison
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../time_frequency/index.html">
Time-Frequency Examples
</a>
<input class="toctree-checkbox" id="toctree-checkbox-21" name="toctree-checkbox-21" type="checkbox"/>
<label for="toctree-checkbox-21">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../time_frequency/compute_csd.html">
Compute a cross-spectral density (CSD) matrix
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../time_frequency/compute_source_psd_epochs.html">
Compute Power Spectral Density of inverse solution from single epochs
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../time_frequency/source_label_time_frequency.html">
Compute power and phase lock in label of the source space
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../time_frequency/source_power_spectrum.html">
Compute source power spectral density (PSD) in a label
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../time_frequency/source_power_spectrum_opm.html">
Compute source power spectral density (PSD) of VectorView and OPM data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../time_frequency/source_space_time_frequency.html">
Compute induced power in the source space with dSPM
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../time_frequency/temporal_whitening.html">
Temporal whitening with AR model
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../time_frequency/time_frequency_erds.html">
Compute and visualize ERDS maps
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../time_frequency/time_frequency_global_field_power.html">
Explore event-related dynamics for specific frequency bands
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../time_frequency/time_frequency_simulated.html">
Time-frequency on simulated data (Multitaper vs. Morlet vs. Stockwell)
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../stats/index.html">
Statistics Examples
</a>
<input class="toctree-checkbox" id="toctree-checkbox-22" name="toctree-checkbox-22" type="checkbox"/>
<label for="toctree-checkbox-22">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../stats/cluster_stats_evoked.html">
Permutation F-test on sensor data with 1D cluster level
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../stats/fdr_stats_evoked.html">
FDR correction on T-test on sensor data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../stats/linear_regression_raw.html">
Regression on continuous data (rER[P/F])
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../stats/sensor_permutation_test.html">
Permutation T-test on sensor data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../stats/sensor_regression.html">
Analysing continuous features with binning and regression in sensor space
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../decoding/index.html">
Machine Learning (Decoding, Encoding, and MVPA)
</a>
<input class="toctree-checkbox" id="toctree-checkbox-23" name="toctree-checkbox-23" type="checkbox"/>
<label for="toctree-checkbox-23">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../decoding/decoding_csp_eeg.html">
Motor imagery decoding from EEG data using the Common Spatial Pattern (CSP)
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../decoding/decoding_csp_timefreq.html">
Decoding in time-frequency space using Common Spatial Patterns (CSP)
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../decoding/decoding_rsa_sgskip.html">
Representational Similarity Analysis
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../decoding/decoding_spatio_temporal_source.html">
Decoding source space data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../decoding/decoding_spoc_CMC.html">
Continuous Target Decoding with SPoC
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../decoding/decoding_time_generalization_conditions.html">
Decoding sensor space data with generalization across time and conditions
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../decoding/decoding_unsupervised_spatial_filter.html">
Analysis of evoked response using ICA and PCA reduction techniques
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../decoding/decoding_xdawn_eeg.html">
XDAWN Decoding From EEG data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../decoding/ems_filtering.html">
Compute effect-matched-spatial filtering (EMS)
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../decoding/linear_model_patterns.html">
Linear classifier on sensor data with plot patterns and filters
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../decoding/receptive_field_mtrf.html">
Receptive Field Estimation and Prediction
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../decoding/ssd_spatial_filters.html">
Compute Spectro-Spatial Decomposition (SSD) spatial filters
</a>
</li>
</ul>
</li>
<li class="toctree-l2">
<a class="reference internal" href="../connectivity/index.html">
Connectivity Analysis Examples
</a>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../forward/index.html">
Forward modeling
</a>
<input class="toctree-checkbox" id="toctree-checkbox-24" name="toctree-checkbox-24" type="checkbox"/>
<label for="toctree-checkbox-24">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../forward/forward_sensitivity_maps.html">
Display sensitivity maps for EEG and MEG sensors
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../forward/left_cerebellum_volume_source.html">
Generate a left cerebellum volume source space
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../forward/source_space_morphing.html">
Use source space morphing
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../inverse/index.html">
Inverse problem and source analysis
</a>
<input class="toctree-checkbox" id="toctree-checkbox-25" name="toctree-checkbox-25" type="checkbox"/>
<label for="toctree-checkbox-25">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/compute_mne_inverse_epochs_in_label.html">
Compute MNE-dSPM inverse solution on single epochs
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/compute_mne_inverse_raw_in_label.html">
Compute sLORETA inverse solution on raw data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/compute_mne_inverse_volume.html">
Compute MNE-dSPM inverse solution on evoked data in volume source space
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/custom_inverse_solver.html">
Source localization with a custom inverse solver
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/dics_source_power.html">
Compute source power using DICS beamformer
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/evoked_ers_source_power.html">
Compute evoked ERS source power using DICS, LCMV beamformer, and dSPM
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/gamma_map_inverse.html">
Compute a sparse inverse solution using the Gamma-MAP empirical Bayesian method
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/label_activation_from_stc.html">
Extracting time course from source_estimate object
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/label_from_stc.html">
Generate a functional label from source estimates
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/label_source_activations.html">
Extracting the time series of activations in a label
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/mixed_norm_inverse.html">
Compute sparse inverse solution with mixed norm: MxNE and irMxNE
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/mixed_source_space_inverse.html">
Compute MNE inverse solution on evoked data with a mixed source space
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/mne_cov_power.html">
Compute source power estimate by projecting the covariance with MNE
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/morph_surface_stc.html">
Morph surface source estimate
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/morph_volume_stc.html">
Morph volumetric source estimate
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/multidict_reweighted_tfmxne.html">
Compute iterative reweighted TF-MxNE with multiscale time-frequency dictionary
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/psf_ctf_label_leakage.html">
Visualize source leakage among labels using a circular graph
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/psf_ctf_vertices.html">
Plot point-spread functions (PSFs) and cross-talk functions (CTFs)
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/psf_ctf_vertices_lcmv.html">
Compute cross-talk functions for LCMV beamformers
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/rap_music.html">
Compute Rap-Music on evoked data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/read_inverse.html">
Reading an inverse operator
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/read_stc.html">
Reading an STC file
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/resolution_metrics.html">
Compute spatial resolution metrics in source space
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/resolution_metrics_eegmeg.html">
Compute spatial resolution metrics to compare MEG with EEG+MEG
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/snr_estimate.html">
Estimate data SNR using an inverse
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/source_space_snr.html">
Computing source space SNR
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/time_frequency_mixed_norm_inverse.html">
Compute MxNE with time-frequency sparse prior
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../inverse/vector_mne_solution.html">
Plotting the full vector-valued MNE solution
</a>
</li>
</ul>
</li>
<li class="toctree-l2 has-children">
<a class="reference internal" href="../datasets/index.html">
Examples on open datasets
</a>
<input class="toctree-checkbox" id="toctree-checkbox-26" name="toctree-checkbox-26" type="checkbox"/>
<label for="toctree-checkbox-26">
<i class="fas fa-chevron-down">
</i>
</label>
<ul>
<li class="toctree-l3">
<a class="reference internal" href="../datasets/brainstorm_data.html">
Brainstorm raw (median nerve) dataset
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../datasets/hf_sef_data.html">
HF-SEF dataset
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../datasets/limo_data.html">
Single trial linear regression analysis with the LIMO dataset
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../datasets/opm_data.html">
Optically pumped magnetometer (OPM) data
</a>
</li>
<li class="toctree-l3">
<a class="reference internal" href="../datasets/spm_faces_dataset_sgskip.html">
From raw data to dSPM on SPM Faces dataset
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1">
<a class="reference internal" href="../../glossary.html">
Glossary
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="../../overview/implementation.html">
Implementation details
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="../../overview/design_philosophy.html">
Design philosophy
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="../../overview/datasets_index.html">
Example datasets
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="../../generated/commands.html">
Command-line tools
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="../../overview/migrating.html">
Migrating from other analysis software
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="../../overview/cookbook.html">
The typical M/EEG workflow
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="../../overview/cite.html">
How to cite MNE-Python
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="../../cited.html">
Papers citing MNE-Python
</a>
</li>
</ul>
</div>
</nav>
</div>
<div class="sidebar-end-items">
</div>
</div>
<div class="d-none d-xl-block col-xl-2 bd-toc">
<div class="toc-item">
<nav id="bd-toc-nav">
</nav>
</div>
<div class="toc-item">
</div>
</div>
<main class="col-12 col-md-9 col-xl-7 py-md-5 pl-md-5 pr-md-4 bd-content" role="main">
<div>
<div class="sphx-glr-download-link-note admonition note">
<p class="admonition-title">Note</p>
<p>Click <a class="reference internal" href="#sphx-glr-download-auto-examples-visualization-montage-sgskip-py"><span class="std std-ref">here</span></a>
to download the full example code</p>
</div>
<section class="sphx-glr-example-title" id="plotting-sensor-layouts-of-eeg-systems">
<span id="plot-montage"></span><span id="sphx-glr-auto-examples-visualization-montage-sgskip-py"></span><h1>Plotting sensor layouts of EEG systems<a class="headerlink" href="#plotting-sensor-layouts-of-eeg-systems" title="Permalink to this headline">#</a></h1>
<p>This example illustrates how to load all the EEG system montages
shipped in MNE-python, and display it on the fsaverage template subject.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr></span>
<span class="c1"># Joan Massich <mailsik@gmail.com></span>
<span class="c1">#</span>
<span class="c1"># License: BSD-3-Clause</span>
</pre></div>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">os.path</span> <span class="k">as</span> <span class="nn">op</span>
<span class="kn">import</span> <span class="nn">mne</span>
<span class="kn">from</span> <span class="nn">mne.channels.montage</span> <span class="kn">import</span> <a href="../../generated/mne.channels.get_builtin_montages.html#mne.channels.get_builtin_montages" title="mne.channels.get_builtin_montages" class="sphx-glr-backref-module-mne-channels sphx-glr-backref-type-py-function"><span class="n">get_builtin_montages</span></a>
<span class="kn">from</span> <span class="nn">mne.datasets</span> <span class="kn">import</span> <a href="../../generated/mne.datasets.fetch_fsaverage.html#mne.datasets.fetch_fsaverage" title="mne.datasets.fetch_fsaverage" class="sphx-glr-backref-module-mne-datasets sphx-glr-backref-type-py-function"><span class="n">fetch_fsaverage</span></a>
<span class="kn">from</span> <span class="nn">mne.viz</span> <span class="kn">import</span> <a href="../../generated/mne.viz.set_3d_title.html#mne.viz.set_3d_title" title="mne.viz.set_3d_title" class="sphx-glr-backref-module-mne-viz sphx-glr-backref-type-py-function"><span class="n">set_3d_title</span></a><span class="p">,</span> <a href="../../generated/mne.viz.set_3d_view.html#mne.viz.set_3d_view" title="mne.viz.set_3d_view" class="sphx-glr-backref-module-mne-viz sphx-glr-backref-type-py-function"><span class="n">set_3d_view</span></a>
</pre></div>
</div>
<p>Check all montages against a sphere</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="n">current_montage</span> <span class="ow">in</span> <a href="../../generated/mne.channels.get_builtin_montages.html#mne.channels.get_builtin_montages" title="mne.channels.get_builtin_montages" class="sphx-glr-backref-module-mne-channels sphx-glr-backref-type-py-function"><span class="n">get_builtin_montages</span></a><span class="p">():</span>
<span class="n">montage</span> <span class="o">=</span> <a href="../../generated/mne.channels.make_standard_montage.html#mne.channels.make_standard_montage" title="mne.channels.make_standard_montage" class="sphx-glr-backref-module-mne-channels sphx-glr-backref-type-py-function"><span class="n">mne</span><span class="o">.</span><span class="n">channels</span><span class="o">.</span><span class="n">make_standard_montage</span></a><span class="p">(</span><span class="n">current_montage</span><span class="p">)</span>
<span class="n">info</span> <span class="o">=</span> <a href="../../generated/mne.create_info.html#mne.create_info" title="mne.create_info" class="sphx-glr-backref-module-mne sphx-glr-backref-type-py-function"><span class="n">mne</span><span class="o">.</span><span class="n">create_info</span></a><span class="p">(</span>
<span class="n">ch_names</span><span class="o">=</span><span class="n">montage</span><span class="o">.</span><span class="n">ch_names</span><span class="p">,</span> <span class="n">sfreq</span><span class="o">=</span><span class="mf">100.</span><span class="p">,</span> <span class="n">ch_types</span><span class="o">=</span><span class="s1">'eeg'</span><span class="p">)</span>
<span class="n">info</span><span class="o">.</span><span class="n">set_montage</span><span class="p">(</span><span class="n">montage</span><span class="p">)</span>
<span class="n">sphere</span> <span class="o">=</span> <a href="../../generated/mne.make_sphere_model.html#mne.make_sphere_model" title="mne.make_sphere_model" class="sphx-glr-backref-module-mne sphx-glr-backref-type-py-function"><span class="n">mne</span><span class="o">.</span><span class="n">make_sphere_model</span></a><span class="p">(</span><span class="n">r0</span><span class="o">=</span><span class="s1">'auto'</span><span class="p">,</span> <span class="n">head_radius</span><span class="o">=</span><span class="s1">'auto'</span><span class="p">,</span> <span class="n">info</span><span class="o">=</span><span class="n">info</span><span class="p">)</span>
<span class="n">fig</span> <span class="o">=</span> <a href="../../generated/mne.viz.plot_alignment.html#mne.viz.plot_alignment" title="mne.viz.plot_alignment" class="sphx-glr-backref-module-mne-viz sphx-glr-backref-type-py-function"><span class="n">mne</span><span class="o">.</span><span class="n">viz</span><span class="o">.</span><span class="n">plot_alignment</span></a><span class="p">(</span>
<span class="c1"># Plot options</span>
<span class="n">show_axes</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dig</span><span class="o">=</span><span class="s1">'fiducials'</span><span class="p">,</span> <span class="n">surfaces</span><span class="o">=</span><span class="s1">'head'</span><span class="p">,</span>
<span class="n">bem</span><span class="o">=</span><span class="n">sphere</span><span class="p">,</span> <span class="n">info</span><span class="o">=</span><span class="n">info</span><span class="p">)</span>
<a href="../../generated/mne.viz.set_3d_view.html#mne.viz.set_3d_view" title="mne.viz.set_3d_view" class="sphx-glr-backref-module-mne-viz sphx-glr-backref-type-py-function"><span class="n">set_3d_view</span></a><span class="p">(</span><span class="n">figure</span><span class="o">=</span><span class="n">fig</span><span class="p">,</span> <span class="n">azimuth</span><span class="o">=</span><span class="mi">135</span><span class="p">,</span> <span class="n">elevation</span><span class="o">=</span><span class="mi">80</span><span class="p">)</span>
<a href="../../generated/mne.viz.set_3d_title.html#mne.viz.set_3d_title" title="mne.viz.set_3d_title" class="sphx-glr-backref-module-mne-viz sphx-glr-backref-type-py-function"><span class="n">set_3d_title</span></a><span class="p">(</span><span class="n">figure</span><span class="o">=</span><span class="n">fig</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="n">current_montage</span><span class="p">)</span>
</pre></div>
</div>
<p>Check all montages against fsaverage</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">subjects_dir</span> <span class="o">=</span> <a href="https://docs.python.org/3/library/os.path.html#os.path.dirname" title="os.path.dirname" class="sphx-glr-backref-module-os-path sphx-glr-backref-type-py-function"><span class="n">op</span><span class="o">.</span><span class="n">dirname</span></a><span class="p">(</span><a href="../../generated/mne.datasets.fetch_fsaverage.html#mne.datasets.fetch_fsaverage" title="mne.datasets.fetch_fsaverage" class="sphx-glr-backref-module-mne-datasets sphx-glr-backref-type-py-function"><span class="n">fetch_fsaverage</span></a><span class="p">())</span>
<span class="k">for</span> <span class="n">current_montage</span> <span class="ow">in</span> <a href="../../generated/mne.channels.get_builtin_montages.html#mne.channels.get_builtin_montages" title="mne.channels.get_builtin_montages" class="sphx-glr-backref-module-mne-channels sphx-glr-backref-type-py-function"><span class="n">get_builtin_montages</span></a><span class="p">():</span>
<span class="n">montage</span> <span class="o">=</span> <a href="../../generated/mne.channels.make_standard_montage.html#mne.channels.make_standard_montage" title="mne.channels.make_standard_montage" class="sphx-glr-backref-module-mne-channels sphx-glr-backref-type-py-function"><span class="n">mne</span><span class="o">.</span><span class="n">channels</span><span class="o">.</span><span class="n">make_standard_montage</span></a><span class="p">(</span><span class="n">current_montage</span><span class="p">)</span>
<span class="c1"># Create dummy info</span>
<span class="n">info</span> <span class="o">=</span> <a href="../../generated/mne.create_info.html#mne.create_info" title="mne.create_info" class="sphx-glr-backref-module-mne sphx-glr-backref-type-py-function"><span class="n">mne</span><span class="o">.</span><span class="n">create_info</span></a><span class="p">(</span>
<span class="n">ch_names</span><span class="o">=</span><span class="n">montage</span><span class="o">.</span><span class="n">ch_names</span><span class="p">,</span> <span class="n">sfreq</span><span class="o">=</span><span class="mf">100.</span><span class="p">,</span> <span class="n">ch_types</span><span class="o">=</span><span class="s1">'eeg'</span><span class="p">)</span>
<span class="n">info</span><span class="o">.</span><span class="n">set_montage</span><span class="p">(</span><span class="n">montage</span><span class="p">)</span>
<span class="n">fig</span> <span class="o">=</span> <a href="../../generated/mne.viz.plot_alignment.html#mne.viz.plot_alignment" title="mne.viz.plot_alignment" class="sphx-glr-backref-module-mne-viz sphx-glr-backref-type-py-function"><span class="n">mne</span><span class="o">.</span><span class="n">viz</span><span class="o">.</span><span class="n">plot_alignment</span></a><span class="p">(</span>
<span class="c1"># Plot options</span>
<span class="n">show_axes</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dig</span><span class="o">=</span><span class="s1">'fiducials'</span><span class="p">,</span> <span class="n">surfaces</span><span class="o">=</span><span class="s1">'head'</span><span class="p">,</span> <span class="n">mri_fiducials</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">subject</span><span class="o">=</span><span class="s1">'fsaverage'</span><span class="p">,</span> <span class="n">subjects_dir</span><span class="o">=</span><span class="n">subjects_dir</span><span class="p">,</span> <span class="n">info</span><span class="o">=</span><span class="n">info</span><span class="p">,</span>
<span class="n">coord_frame</span><span class="o">=</span><span class="s1">'mri'</span><span class="p">,</span>
<span class="n">trans</span><span class="o">=</span><span class="s1">'fsaverage'</span><span class="p">,</span> <span class="c1"># transform from head coords to fsaverage's MRI</span>
<span class="p">)</span>
<a href="../../generated/mne.viz.set_3d_view.html#mne.viz.set_3d_view" title="mne.viz.set_3d_view" class="sphx-glr-backref-module-mne-viz sphx-glr-backref-type-py-function"><span class="n">set_3d_view</span></a><span class="p">(</span><span class="n">figure</span><span class="o">=</span><span class="n">fig</span><span class="p">,</span> <span class="n">azimuth</span><span class="o">=</span><span class="mi">135</span><span class="p">,</span> <span class="n">elevation</span><span class="o">=</span><span class="mi">80</span><span class="p">)</span>
<a href="../../generated/mne.viz.set_3d_title.html#mne.viz.set_3d_title" title="mne.viz.set_3d_title" class="sphx-glr-backref-module-mne-viz sphx-glr-backref-type-py-function"><span class="n">set_3d_title</span></a><span class="p">(</span><span class="n">figure</span><span class="o">=</span><span class="n">fig</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="n">current_montage</span><span class="p">)</span>
</pre></div>
</div>
<p><strong>Estimated memory usage:</strong> 0 MB</p>
<div class="sphx-glr-footer sphx-glr-footer-example docutils container" id="sphx-glr-download-auto-examples-visualization-montage-sgskip-py">
<div class="sphx-glr-download sphx-glr-download-python docutils container">
<p><a class="reference download internal" download="" href="../../_downloads/835a64029f5dcdd112d73270037ee2ee/montage_sgskip.py"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Python</span> <span class="pre">source</span> <span class="pre">code:</span> <span class="pre">montage_sgskip.py</span></code></a></p>
</div>
<div class="sphx-glr-download sphx-glr-download-jupyter docutils container">
<p><a class="reference download internal" download="" href="../../_downloads/09baca5bff98c3be2834792aebba565c/montage_sgskip.ipynb"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Jupyter</span> <span class="pre">notebook:</span> <span class="pre">montage_sgskip.ipynb</span></code></a></p>
</div>
</div>
<p class="sphx-glr-signature"><a class="reference external" href="https://sphinx-gallery.github.io">Gallery generated by Sphinx-Gallery</a></p>
</section>
</div>
<!-- Previous / next buttons -->
<div class='prev-next-area'>
<a class='left-prev' id="prev-link" href="mne_helmet.html" title="previous page">
<i class="fas fa-angle-left"></i>
<div class="prev-next-info">
<p class="prev-next-subtitle">previous</p>
<p class="prev-next-title">Plot the MNE brain and helmet</p>
</div>
</a>
<a class='right-next' id="next-link" href="parcellation.html" title="next page">
<div class="prev-next-info">
<p class="prev-next-subtitle">next</p>
<p class="prev-next-title">Plot a cortical parcellation</p>
</div>
<i class="fas fa-angle-right"></i>
</a>
</div>
</main>
</div>
</div>
<script src="https://mne.tools/versionwarning.js"></script>
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script src="../../_static/scripts/pydata-sphinx-theme.js?digest=1999514e3f237ded88cf"></script>
<footer class="footer mt-5 mt-md-0">
<div class="container">
<div class="footer-item">
<p class="text-center text-muted small">© Copyright 2012–2022, MNE Developers. Last updated <time datetime="2022-05-27T17:47:54.886015+00:00" class="localized">2022-05-27 17:47 UTC</time>
<script type="text/javascript">$(function () { $("time.localized").each(function () { var el = $(this); el.text(new Date(el.attr("datetime")).toLocaleString([], {dateStyle: "medium", timeStyle: "long"})); }); } )</script></p>
</div>
</div>
</footer>
</body>
</html> | {
"content_hash": "7b48cc0446227f79551f8cee5f838486",
"timestamp": "",
"source": "github",
"line_count": 1682,
"max_line_length": 696,
"avg_line_length": 43.43638525564804,
"alnum_prop": 0.6250205310703532,
"repo_name": "mne-tools/mne-tools.github.io",
"id": "0793dbe03641d56bb2f472a644edaf960d49aa84",
"size": "73065",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "1.0/auto_examples/visualization/montage_sgskip.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "708696"
},
{
"name": "Dockerfile",
"bytes": "1820"
},
{
"name": "HTML",
"bytes": "1526247783"
},
{
"name": "JavaScript",
"bytes": "1323087"
},
{
"name": "Jupyter Notebook",
"bytes": "24820047"
},
{
"name": "Python",
"bytes": "18575494"
}
],
"symlink_target": ""
} |
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
//
// 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.
#ifndef _ROM_AES_H_
#define _ROM_AES_H_
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
#define AES_BLOCK_SIZE 16
enum AES_TYPE {
AES_ENC,
AES_DEC,
};
enum AES_BITS {
AES128,
AES192,
AES256
};
void ets_aes_enable(void);
void ets_aes_disable(void);
void ets_aes_set_endian(bool key_word_swap, bool key_byte_swap,
bool in_word_swap, bool in_byte_swap,
bool out_word_swap, bool out_byte_swap);
int ets_aes_setkey(enum AES_TYPE type, const void *key, enum AES_BITS bits);
int ets_aes_setkey_enc(const void *key, enum AES_BITS bits);
int ets_aes_setkey_dec(const void *key, enum AES_BITS bits);
void ets_aes_block(const void *input, void *output);
#ifdef __cplusplus
}
#endif
#endif /* _ROM_AES_H_ */
| {
"content_hash": "3fe8800a14ebe8f241932bdc38faf301",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 76,
"avg_line_length": 24.551724137931036,
"alnum_prop": 0.6860955056179775,
"repo_name": "espressif/esp-idf",
"id": "d8002ef58cb2113a2259d7f209f1acafe7d25c87",
"size": "1424",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "components/esp_rom/include/esp32c3/rom/aes.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "388440"
},
{
"name": "Batchfile",
"bytes": "5451"
},
{
"name": "C",
"bytes": "69102322"
},
{
"name": "C++",
"bytes": "992772"
},
{
"name": "CMake",
"bytes": "539972"
},
{
"name": "Dockerfile",
"bytes": "3290"
},
{
"name": "Makefile",
"bytes": "23747"
},
{
"name": "Nim",
"bytes": "1005"
},
{
"name": "PowerShell",
"bytes": "4537"
},
{
"name": "Python",
"bytes": "2158180"
},
{
"name": "Roff",
"bytes": "101"
},
{
"name": "Shell",
"bytes": "126143"
}
],
"symlink_target": ""
} |
// This file is automatically generated.
package adila.db;
/*
* Prestigio Multiphone 5508 DUO
*
* DEVICE: PSP5508DUO
* MODEL: PSP5508DUO
*/
final class psp5508duo_psp5508duo {
public static final String DATA = "Prestigio|Multiphone 5508 DUO|";
}
| {
"content_hash": "07904312b5e7f2fd2a5fc0dc059bc1cb",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 71,
"avg_line_length": 19.76923076923077,
"alnum_prop": 0.7237354085603113,
"repo_name": "karim/adila",
"id": "010ed46151da5d275544e6672ad2fde922e1d4e9",
"size": "257",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "database/src/main/java/adila/db/psp5508duo_psp5508duo.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "2903103"
},
{
"name": "Prolog",
"bytes": "489"
},
{
"name": "Python",
"bytes": "3280"
}
],
"symlink_target": ""
} |
/*
* LocalizedStrings.h
*
* Declare #define constants for localized strings
*
* Use genstrings to generate a localized string
* table. First, cd to the project directory.
* Then, enter this command:
*
* genstrings -u -o English.lproj LocalizedStrings.h
*
* One other note: \\U2026 is the Unicode escape
* code for the ellipses (…).
*/
// Define “, ‘, ’, and ” (gets rid of nasty compiler warnings)
#define L_OPENING_QUOTE NSLocalizedString(@"\\U201c", @"Opening quote")
#define L_CLOSING_QUOTE NSLocalizedString(@"\\U201d", @"Closing quote")
#define L_OPENING_SINGLE_QUOTE NSLocalizedString(@"\\U2018", @"Opening single quote")
#define L_CLOSING_SINGLE_QUOTE NSLocalizedString(@"\\U2019", @"Closing single quote")
// Buttons 'n' things
#define L_LOADING_WINDOW_TITLE NSLocalizedString(@"Loading\\U2026", @"Temporary title bar when loading the document")
#define L_OK_BUTTON NSLocalizedString(@"OK", @"OK button")
#define L_CANCEL_BUTTON NSLocalizedString(@"Cancel", @"Cancel button")
#define L_RESET_BUTTON NSLocalizedString(@"Reset", @"The Reset button (for preferences)")
#define L_APPLY_TO_ALL_BUTTON NSLocalizedString(@"Apply To All", @"The Apply To All button (for preferences)")
#define L_ALT NSLocalizedString(@"About Something\\U2026", nil)
#define L_FORMATTING_STRING NSLocalizedString(@"%@, %g point", @"The formatted string used in the font display")
#define L_NAME NSLocalizedString(@"About CocoaPad", nil)
// Undo menu item titles
#define L_UNDO_UPPERCASE_ITEM_TITLE NSLocalizedString(@"Capitalization", @"Title for undo uppercasing menu item")
#define L_UNDO_LOWERCASE_ITEM_TITLE NSLocalizedString(@"Make Text Lowercase", @"Title for undo lowercasing menu item")
#define L_UNDO_CAPITALIZE_ITEM_TITLE NSLocalizedString(@"First Letter Capitalization", @"Title for undo capitalizing menu item")
// Sheet strings
#define L_WORD_COUNT_TITLE NSLocalizedString(@"Word Count", @"Title for the word count sheet.")
#define L_WORD_COUNT_TEXT NSLocalizedString(@"Characters:\t%d\nWords:\t\t%d\nParagraphs:\t%d", @"Text used in the word count sheet.")
#define L_CONVERT_RTF_SHEET_TITLE NSLocalizedString(@"Are you sure you want to convert your document to Rich Text Format?", @"Title of the RTF format conversion sheet")
#define L_CONVERT_RTF_SHEET_DESCRIPTION NSLocalizedString(@"This will strip your document of all graphics, but leave formatting intact.", @"Description of the RTF format conversion sheet")
#define L_CONVERT_WORD_SHEET_TITLE NSLocalizedString(@"Are you sure you want to convert your document to Microsoft Word format?", @"Title of the Word format conversion sheet")
#define L_CONVERT_WORD_SHEET_DESCRIPTION NSLocalizedString(@"This will strip your document of all graphics, but leave formatting intact.\n\nCocoaPad does not support all Microsoft Word document features, such as tables, macros, and graphics, so you cannot use graphics when editing Word documents in CocoaPad.", @"Title of the Word format conversion sheet")
#define L_CONVERT_TXT_SHEET_TITLE NSLocalizedString(@"Are you sure you want to convert your document to plain text?", @"Title of the plain text format conversion sheet")
#define L_CONVERT_TXT_SHEET_DESCRIPTION NSLocalizedString(@"This will strip your document of all graphics and formatting.", @"Description of the plain text format conversion sheet")
#define L_RESET_PREFS_SHEET_TITLE NSLocalizedString(@"Are you sure you want to reset your preferences to their original settings?", @"Title of the reset preferences confirmation sheet")
#define L_RESET_PREFS_SHEET_DESCRIPTION NSLocalizedString(@"Choosing Reset will restore all settings to the state they were in when CocoaPad was first installed.\n\nThis cannot be undone.", @"Description of the reset preferences confirmation sheet")
#define L_APPLY_TO_ALL_SHEET_TITLE NSLocalizedString(@"Are you sure you want to apply your preferences to all open documents?", @"Title of the apply prefs to all documents confirmation sheet")
#define L_APPLY_TO_ALL_SHEET_DESCRIPTION NSLocalizedString(@"Choosing Apply To All will apply your current settings to all of the currently open documents in CocoaPad, so if you took the ruler off of a document, for example, and you set the preference to show the ruler, then the ruler would reappear.\n\nThis cannot be undone.", @"Description of the apply prefs to all documents confirmation sheet")
#define L_OPEN_FAILED_SHEET_TITLE NSLocalizedString(@"CocoaPad can't open this file.", @"Title of the failed to open file sheet")
#define L_OPEN_FAILED_SHEET_DESCRIPTION NSLocalizedString(@"CocoaPad can only open its own documents, rich text documents, and plain text documents.", @"Description of the failed to open file sheet")
#define L_WORD_FAILED_SHEET_TITLE NSLocalizedString(@"Mac OS X 10.3 or later is required to save and open Microsoft Word files.", @"Title of the failed to open Word file sheet")
#define L_WORD_FAILED_SHEET_DESCRIPTION NSLocalizedString(@"CocoaPad can only save and open Word files if you are running Mac OS X version 10.3 or higher.", @"Description of the failed to open Word file sheet")
#define L_FIND_FAILED_SHEET_TITLE NSLocalizedString(@"Mac OS X 10.3 or later is required to use the find panel.", @"Title of the Find not available sheet")
#define L_FIND_FAILED_SHEET_DESCRIPTION NSLocalizedString(@"CocoaPad can only find and replace text if you are running Mac OS X version 10.3 or higher.", @"Description of the Find not available sheet")
#define L_BACKUPS_RECOVERED_SHEET_TITLE NSLocalizedString(@"Automatic Backup crash recovery", @"Title of the Automatic Backup recovery sheet")
#define L_BACKUPS_RECOVERED_SHEET_DESCRIPTION NSLocalizedString(@"CocoaPad was not properly quit last time, which may have resulted in unsaved work being lost. Because Automatic Backup was turned on, CocoaPad was able to recover the documents from the last automatic backup. Please re-save these files.", @"Description of the Automatic Backup recovery sheet")
#define L_STRING NSLocalizedString(@"secret about box", nil)
// Toolbar strings
#define L_SHOW_TOOLBAR NSLocalizedString(@"Show Toolbar", @"Show Toolbar menu item")
#define L_HIDE_TOOLBAR NSLocalizedString(@"Hide Toolbar", @"Hide Toolbar menu item")
#define L_NEW_DOC_TOOLBAR_ITEM NSLocalizedString(@"New", @"New toolbar item")
#define L_NEW_DOC_HELP_TAG NSLocalizedString(@"Creates a new document", @"New help tag")
#define L_SAVE_TOOLBAR_ITEM NSLocalizedString(@"Save", @"Save toolbar item")
#define L_SAVE_HELP_TAG NSLocalizedString(@"Saves changes made to the current document", @"Save help tag")
#define L_SAVE_AS_TOOLBAR_ITEM NSLocalizedString(@"Save As\\U2026", @"Save As toolbar item")
#define L_SAVE_AS_HELP_TAG NSLocalizedString(@"Saves the current document with a different name", @"Save As help tag")
#define L_OPEN_TOOLBAR_ITEM NSLocalizedString(@"Open", @"Open toolbar item")
#define L_OPEN_HELP_TAG NSLocalizedString(@"Lets you choose another document to open", @"Open help tag")
#define L_PREFS_TOOLBAR_ITEM NSLocalizedString(@"Preferences", @"Preferences toolbar item")
#define L_PREFS_HELP_TAG NSLocalizedString(@"Customize CocoaPad's settings", @"Preferences help tag")
#define L_BOLD_TOOLBAR_ITEM NSLocalizedString(@"Bold", @"Bold toolbar item")
#define L_BOLD_HELP_TAG NSLocalizedString(@"Makes the selected text bold", @"Bold help tag")
#define L_ITALIC_TOOLBAR_ITEM NSLocalizedString(@"Italic", @"Italic toolbar item")
#define L_ITALIC_HELP_TAG NSLocalizedString(@"Makes the selected text italic", @"Italic help tag")
#define L_UNDERLINE_TOOLBAR_ITEM NSLocalizedString(@"Underline", @"Underline toolbar item")
#define L_UNDERLINE_HELP_TAG NSLocalizedString(@"Underlines the selected text", @"Underline help tag")
#define L_FIND_TOOLBAR_ITEM NSLocalizedString(@"Find", @"Find toolbar item (Panther and up)")
#define L_FIND_HELP_TAG NSLocalizedString(@"Shows the find and replace panel", @"Find help tag (Panther and up)")
#define L_FIND_NEXT_TOOLBAR_ITEM NSLocalizedString(@"Find Next", @"Find Next toolbar item (Panther and up)")
#define L_FIND_NEXT_HELP_TAG NSLocalizedString(@"Highlights the next occurance of whatever text you are Finding", @"Find Next help tag (Panther and up)")
#define L_CHANGE_BG_COLOR_TOOLBAR_ITEM NSLocalizedString(@"Change Background", @"Change background color toolbar item")
#define L_CHANGE_BG_COLOR_HELP_TAG NSLocalizedString(@"Brings up a color panel, where you can change the document's background color", @"Change background color help tag")
#define L_BIGGER_TOOLBAR_ITEM NSLocalizedString(@"Bigger", @"Bigger size toolbar item")
#define L_BIGGER_HELP_TAG NSLocalizedString(@"Make the selected text one point bigger", @"Bigger size help tag")
#define L_SMALLER_TOOLBAR_ITEM NSLocalizedString(@"Smaller", @"Smaller size toolbar item")
#define L_SMALLER_HELP_TAG NSLocalizedString(@"Make the selected text one point smaller", @"Smaller size help tag")
#define L_UPPERCASE_TOOLBAR_ITEM NSLocalizedString(@"Capitalize", @"Uppercase toolbar item")
#define L_UPPERCASE_HELP_TAG NSLocalizedString(@"Make the selected text UPPERCASE", @"Uppercase help tag")
#define L_LOWERCASE_TOOLBAR_ITEM NSLocalizedString(@"Lowercase", @"Lowercase toolbar item")
#define L_LOWERCASE_HELP_TAG NSLocalizedString(@"Make the selected text lowercase", @"Lowercase help tag")
#define L_CAPITALIZE_TOOLBAR_ITEM NSLocalizedString(@"Capitalize First Words", @"Capitalize toolbar item")
#define L_CAPITALIZE_HELP_TAG NSLocalizedString(@"Capitalizes the first words of the selected text", @"Capitalize help tag")
#define L_CONVERT_TO_CPD_TOOLBAR_ITEM NSLocalizedString(@"Convert to CPD", @"Convert to CPD toolbar item")
#define L_CONVERT_TO_CPD_HELP_TAG NSLocalizedString(@"Converts the document to CocoaPad format", @"Convert to CPD help tag")
#define L_CONVERT_TO_RTF_TOOLBAR_ITEM NSLocalizedString(@"Convert to RTF", @"Convert to RTF toolbar item")
#define L_CONVERT_TO_RTF_HELP_TAG NSLocalizedString(@"Converts the document to Rich Text Format", @"Convert to RTF help tag")
#define L_CONVERT_TO_RTFD_TOOLBAR_ITEM NSLocalizedString(@"Convert to RTFD", @"Convert to RTFD toolbar item")
#define L_CONVERT_TO_RTFD_HELP_TAG NSLocalizedString(@"Converts the document to Rich Text Format with Attachments", @"Convert to RTFD help tag")
#define L_CONVERT_TO_TXT_TOOLBAR_ITEM NSLocalizedString(@"Convert to plain text", @"Convert to TXT toolbar item")
#define L_CONVERT_TO_TXT_HELP_TAG NSLocalizedString(@"Converts the document to plain text format", @"Convert to TXT help tag")
#define L_CONVERT_TO_DOC_TOOLBAR_ITEM NSLocalizedString(@"Convert to Word", @"Convert to Word toolbar item")
#define L_CONVERT_TO_DOC_HELP_TAG NSLocalizedString(@"Converts the document to Microsoft Word format", @"Convert to Word help tag") | {
"content_hash": "23313ec8b644b64e61bb3cdf6af5d716",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 400,
"avg_line_length": 97.90825688073394,
"alnum_prop": 0.7739880059970015,
"repo_name": "henrybw/CocoaPad",
"id": "dc0db9fe955a86e458bffb0af0a9f6db5f5fa53b",
"size": "10682",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "LocalizedStrings.h",
"mode": "33261",
"license": "bsd-2-clause",
"language": [
{
"name": "JavaScript",
"bytes": "373847"
},
{
"name": "Objective-C",
"bytes": "136081"
},
{
"name": "Shell",
"bytes": "8"
}
],
"symlink_target": ""
} |
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "apps/shell/browser/shell_network_controller_chromeos.h"
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
#include "chromeos/network/network_connection_handler.h"
#include "chromeos/network/network_handler.h"
#include "chromeos/network/network_handler_callbacks.h"
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
namespace apps {
namespace {
// Frequency at which networks should be scanned when not connected to a network
// or when connected to a non-preferred network.
const int kScanIntervalSec = 10;
void HandleEnableWifiError(
const std::string& error_name,
scoped_ptr<base::DictionaryValue> error_data) {
LOG(WARNING) << "Unable to enable wifi: " << error_name;
}
// Returns a human-readable name for the network described by |network|.
std::string GetNetworkName(const chromeos::NetworkState& network) {
return !network.name().empty() ? network.name() :
base::StringPrintf("[%s]", network.type().c_str());
}
// Returns true if shill is either connected or connecting to a network.
bool IsConnectedOrConnecting() {
chromeos::NetworkStateHandler* state_handler =
chromeos::NetworkHandler::Get()->network_state_handler();
return state_handler->ConnectedNetworkByType(
chromeos::NetworkTypePattern::Default()) ||
state_handler->ConnectingNetworkByType(
chromeos::NetworkTypePattern::Default());
}
} // namespace
ShellNetworkController::ShellNetworkController(
const std::string& preferred_network_name)
: state_(STATE_IDLE),
preferred_network_name_(preferred_network_name),
preferred_network_is_active_(false),
weak_ptr_factory_(this) {
chromeos::NetworkHandler::Initialize();
chromeos::NetworkStateHandler* state_handler =
chromeos::NetworkHandler::Get()->network_state_handler();
state_handler->AddObserver(this, FROM_HERE);
state_handler->SetTechnologyEnabled(
chromeos::NetworkTypePattern::Primitive(shill::kTypeWifi),
true, base::Bind(&HandleEnableWifiError));
// If we're unconnected, trigger a connection attempt and start scanning.
NetworkConnectionStateChanged(NULL);
}
ShellNetworkController::~ShellNetworkController() {
chromeos::NetworkHandler::Get()->network_state_handler()->RemoveObserver(
this, FROM_HERE);
chromeos::NetworkHandler::Shutdown();
}
void ShellNetworkController::NetworkListChanged() {
VLOG(1) << "Network list changed";
ConnectIfUnconnected();
}
void ShellNetworkController::NetworkConnectionStateChanged(
const chromeos::NetworkState* network) {
if (network) {
VLOG(1) << "Network connection state changed:"
<< " name=" << GetNetworkName(*network)
<< " type=" << network->type()
<< " path=" << network->path()
<< " state=" << network->connection_state();
} else {
VLOG(1) << "Network connection state changed: [none]";
}
const chromeos::NetworkState* wifi_network = GetActiveWiFiNetwork();
preferred_network_is_active_ =
wifi_network && wifi_network->name() == preferred_network_name_;
VLOG(2) << "Active WiFi network is "
<< (wifi_network ? wifi_network->name() : std::string("[none]"));
if (preferred_network_is_active_ ||
(preferred_network_name_.empty() && wifi_network)) {
SetScanningEnabled(false);
} else {
SetScanningEnabled(true);
ConnectIfUnconnected();
}
}
const chromeos::NetworkState*
ShellNetworkController::GetActiveWiFiNetwork() {
chromeos::NetworkStateHandler* state_handler =
chromeos::NetworkHandler::Get()->network_state_handler();
const chromeos::NetworkState* network = state_handler->FirstNetworkByType(
chromeos::NetworkTypePattern::Primitive(shill::kTypeWifi));
return network &&
(network->IsConnectedState() || network->IsConnectingState()) ?
network : NULL;
}
void ShellNetworkController::SetScanningEnabled(bool enabled) {
const bool currently_enabled = scan_timer_.IsRunning();
if (enabled == currently_enabled)
return;
VLOG(1) << (enabled ? "Starting" : "Stopping") << " scanning";
if (enabled) {
RequestScan();
scan_timer_.Start(FROM_HERE,
base::TimeDelta::FromSeconds(kScanIntervalSec),
this, &ShellNetworkController::RequestScan);
} else {
scan_timer_.Stop();
}
}
void ShellNetworkController::RequestScan() {
VLOG(1) << "Requesting scan";
chromeos::NetworkHandler::Get()->network_state_handler()->RequestScan();
}
void ShellNetworkController::ConnectIfUnconnected() {
// Don't do anything if the default network is already the preferred one or if
// we have a pending request to connect to it.
if (preferred_network_is_active_ ||
state_ == STATE_WAITING_FOR_PREFERRED_RESULT)
return;
const chromeos::NetworkState* best_network = NULL;
bool can_connect_to_preferred_network = false;
chromeos::NetworkHandler* handler = chromeos::NetworkHandler::Get();
chromeos::NetworkStateHandler::NetworkStateList network_list;
handler->network_state_handler()->GetVisibleNetworkListByType(
chromeos::NetworkTypePattern::WiFi(), &network_list);
for (chromeos::NetworkStateHandler::NetworkStateList::const_iterator it =
network_list.begin(); it != network_list.end(); ++it) {
const chromeos::NetworkState* network = *it;
if (!network->connectable())
continue;
if (!preferred_network_name_.empty() &&
network->name() == preferred_network_name_) {
best_network = network;
can_connect_to_preferred_network = true;
break;
} else if (!best_network) {
best_network = network;
}
}
// Don't switch networks if we're already connecting/connected and wouldn't be
// switching to the preferred network.
if ((IsConnectedOrConnecting() || state_ != STATE_IDLE) &&
!can_connect_to_preferred_network)
return;
if (!best_network) {
VLOG(1) << "Didn't find any connectable networks";
return;
}
VLOG(1) << "Connecting to network " << GetNetworkName(*best_network)
<< " with path " << best_network->path() << " and strength "
<< best_network->signal_strength();
state_ = can_connect_to_preferred_network ?
STATE_WAITING_FOR_PREFERRED_RESULT :
STATE_WAITING_FOR_NON_PREFERRED_RESULT;
handler->network_connection_handler()->ConnectToNetwork(
best_network->path(),
base::Bind(&ShellNetworkController::HandleConnectionSuccess,
weak_ptr_factory_.GetWeakPtr()),
base::Bind(&ShellNetworkController::HandleConnectionError,
weak_ptr_factory_.GetWeakPtr()),
false /* check_error_state */);
}
void ShellNetworkController::HandleConnectionSuccess() {
VLOG(1) << "Successfully connected to network";
state_ = STATE_IDLE;
}
void ShellNetworkController::HandleConnectionError(
const std::string& error_name,
scoped_ptr<base::DictionaryValue> error_data) {
LOG(WARNING) << "Unable to connect to network: " << error_name;
state_ = STATE_IDLE;
}
} // namespace apps
| {
"content_hash": "7c65396612a3c340f72c63cac2df86dd",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 80,
"avg_line_length": 35.671497584541065,
"alnum_prop": 0.6928494041170098,
"repo_name": "chromium2014/src",
"id": "0b66604b4f41312f9c6e6952f6dc22d365443d5e",
"size": "7384",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "apps/shell/browser/shell_network_controller_chromeos.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "853"
},
{
"name": "AppleScript",
"bytes": "6973"
},
{
"name": "Arduino",
"bytes": "464"
},
{
"name": "Assembly",
"bytes": "1889381"
},
{
"name": "Awk",
"bytes": "8660"
},
{
"name": "C",
"bytes": "39993418"
},
{
"name": "C#",
"bytes": "1132"
},
{
"name": "C++",
"bytes": "220757674"
},
{
"name": "CSS",
"bytes": "973910"
},
{
"name": "Java",
"bytes": "6583410"
},
{
"name": "JavaScript",
"bytes": "20967999"
},
{
"name": "Mercury",
"bytes": "9480"
},
{
"name": "Objective-C",
"bytes": "943237"
},
{
"name": "Objective-C++",
"bytes": "7190130"
},
{
"name": "PHP",
"bytes": "97817"
},
{
"name": "Perl",
"bytes": "674461"
},
{
"name": "Python",
"bytes": "10430892"
},
{
"name": "Rebol",
"bytes": "262"
},
{
"name": "Shell",
"bytes": "1337040"
},
{
"name": "Standard ML",
"bytes": "3705"
},
{
"name": "Tcl",
"bytes": "277091"
},
{
"name": "XSLT",
"bytes": "13493"
},
{
"name": "nesC",
"bytes": "15206"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>quickchick: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / extra-dev</a></li>
<li class="active"><a href="">8.11.dev / quickchick - 1.2.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
quickchick
<small>
1.2.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2020-08-11 05:14:42 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-08-11 05:14:42 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-m4 1 Virtual package relying on m4
coq 8.11.dev Formal proof management system
num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.08.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.08.1 Official release 4.08.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "leonidas@umd.edu"
synopsis: "Randomized Property-Based Testing Plugin for Coq"
homepage: "https://github.com/QuickChick/QuickChick"
dev-repo: "git+https://github.com/QuickChick/QuickChick.git"
bug-reports: "https://github.com/QuickChick/QuickChick/issues"
license: "MIT"
build: [ make "-j%{jobs}%" ]
install: [ make "install" ]
depends: [
"ocaml" {>= "4.05.0"}
"coq" {>= "8.10" < "8.11~"}
"coq-ext-lib"
"coq-mathcomp-ssreflect"
"ocamlbuild"
"ocamlfind"
"coq-simple-io" {>= "1.0.0"}
]
authors: [
"Leonidas Lampropoulos <>"
"Zoe Paraskevopoulou <>"
"Maxime Denes <>"
"Catalin Hritcu <>"
"Benjamin Pierce <>"
"Li-yao Xia <>"
"Arthur Azevedo de Amorim <>"
"Yishuai Li <>"
"Antal Spector-Zabusky <>"
]
tags: [
"keyword:extraction"
"category:Miscellaneous/Coq Extensions"
"logpath:QuickChick"
]
url {
src: "https://github.com/QuickChick/QuickChick/archive/v1.2.0.tar.gz"
checksum: "md5=df766e9807b8549576149c635db1c553"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-quickchick.1.2.0 coq.8.11.dev</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.11.dev).
The following dependencies couldn't be met:
- coq-quickchick -> coq < 8.11~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-quickchick.1.2.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "2dcd88943efd9a3b7add45e6f34e4a3d",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 159,
"avg_line_length": 39.687150837988824,
"alnum_prop": 0.5425112612612613,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "6a65b0a8d79628e488c18c6e24c29f58bef7a72d",
"size": "7129",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.08.1-2.0.5/extra-dev/8.11.dev/quickchick/1.2.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>Uses of Class org.apache.poi.openxml4j.opc.ZipPackage (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.poi.openxml4j.opc.ZipPackage (POI API Documentation)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><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><a href="../../../../../../org/apache/poi/openxml4j/opc/ZipPackage.html" title="class in org.apache.poi.openxml4j.opc">Class</a></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>
<div class="subNav">
<ul class="navList">
<li>PREV</li>
<li>NEXT</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/poi/openxml4j/opc//class-useZipPackage.html" target="_top">FRAMES</a></li>
<li><a href="ZipPackage.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">
<h2 title="Uses of Class org.apache.poi.openxml4j.opc.ZipPackage" class="title">Uses of Class<br>org.apache.poi.openxml4j.opc.ZipPackage</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../org/apache/poi/openxml4j/opc/ZipPackage.html" title="class in org.apache.poi.openxml4j.opc">ZipPackage</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.apache.poi.openxml4j.opc.internal">org.apache.poi.openxml4j.opc.internal</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.apache.poi.openxml4j.opc.internal">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../org/apache/poi/openxml4j/opc/ZipPackage.html" title="class in org.apache.poi.openxml4j.opc">ZipPackage</a> in <a href="../../../../../../org/apache/poi/openxml4j/opc/internal/package-summary.html">org.apache.poi.openxml4j.opc.internal</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/apache/poi/openxml4j/opc/internal/package-summary.html">org.apache.poi.openxml4j.opc.internal</a> with parameters of type <a href="../../../../../../org/apache/poi/openxml4j/opc/ZipPackage.html" title="class in org.apache.poi.openxml4j.opc">ZipPackage</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>static java.util.zip.ZipEntry</code></td>
<td class="colLast"><span class="strong">ZipHelper.</span><code><strong><a href="../../../../../../org/apache/poi/openxml4j/opc/internal/ZipHelper.html#getContentTypeZipEntry(org.apache.poi.openxml4j.opc.ZipPackage)">getContentTypeZipEntry</a></strong>(<a href="../../../../../../org/apache/poi/openxml4j/opc/ZipPackage.html" title="class in org.apache.poi.openxml4j.opc">ZipPackage</a> pkg)</code>
<div class="block">Retrieve the Zip entry of the content types part.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.util.zip.ZipEntry</code></td>
<td class="colLast"><span class="strong">ZipHelper.</span><code><strong><a href="../../../../../../org/apache/poi/openxml4j/opc/internal/ZipHelper.html#getCorePropertiesZipEntry(org.apache.poi.openxml4j.opc.ZipPackage)">getCorePropertiesZipEntry</a></strong>(<a href="../../../../../../org/apache/poi/openxml4j/opc/ZipPackage.html" title="class in org.apache.poi.openxml4j.opc">ZipPackage</a> pkg)</code>
<div class="block">Retrieve the zip entry of the core properties part.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><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><a href="../../../../../../org/apache/poi/openxml4j/opc/ZipPackage.html" title="class in org.apache.poi.openxml4j.opc">Class</a></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>
<div class="subNav">
<ul class="navList">
<li>PREV</li>
<li>NEXT</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/poi/openxml4j/opc//class-useZipPackage.html" target="_top">FRAMES</a></li>
<li><a href="ZipPackage.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>
<i>Copyright 2014 The Apache Software Foundation or
its licensors, as applicable.</i>
</small></p>
</body>
</html>
| {
"content_hash": "f678ef4a36c70d39483d3ce664a237a0",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 409,
"avg_line_length": 43.42424242424242,
"alnum_prop": 0.6389392882065597,
"repo_name": "tringuyen1401/Stock-analyzing",
"id": "745083acb45e68fb49252596a2eabc3908a12b77",
"size": "7165",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "jdbc/lib/poi-3.11/docs/apidocs/org/apache/poi/openxml4j/opc/class-use/ZipPackage.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "23219"
},
{
"name": "HTML",
"bytes": "75486542"
},
{
"name": "Java",
"bytes": "2810339"
},
{
"name": "Rust",
"bytes": "92"
}
],
"symlink_target": ""
} |
<?php
namespace Home\Controller;
use Think\Controller;
class HomeController extends Controller
{
public function index()
{
$this->display();
$a = C('TMPL_PARSE_STRING');
print_r("__PUBLIC__");
}
} | {
"content_hash": "c81ba4fa9f4d14f4e52a659bdb56d0d8",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 40,
"avg_line_length": 17,
"alnum_prop": 0.6289592760180995,
"repo_name": "Cenfee/nucleon-thinkphp",
"id": "75fc31011e671a7b11e887f8fdf91a5577755c95",
"size": "221",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "server/Application/Home/Controller/HomeController.class.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "20"
},
{
"name": "HTML",
"bytes": "312"
},
{
"name": "JavaScript",
"bytes": "3"
},
{
"name": "PHP",
"bytes": "1170978"
},
{
"name": "Smarty",
"bytes": "8297"
}
],
"symlink_target": ""
} |
/* crypto/bn/bn_mod.c */
/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
* for the OpenSSL project. */
/* ====================================================================
* Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
//#include "cryptlib.h"
#include "bn_lcl.h"
#if 0 /* now just a #define */
int BN_mod(BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) {
return BN_div(NULL, rem, m, d, ctx);
/* note that rem->neg == m->neg (unless the remainder is zero) */
}
#endif
int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) {
/* like BN_mod, but returns non-negative remainder
* (i.e., 0 <= r < |d| always holds) */
if (!(BN_mod(r, m, d, ctx)))
return 0;
if (!r->neg)
return 1;
/* now -|d| < r < 0, so we have to set r := r + |d| */
return (d->neg ? BN_sub : BN_add)(r, r, d);
}
int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx) {
if (!BN_add(r, a, b))
return 0;
return BN_nnmod(r, r, m, ctx);
}
/* BN_mod_add variant that may be used if both a and b are non-negative
* and less than m */
int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m) {
if (!BN_add(r, a, b))
return 0;
if (BN_ucmp(r, m) >= 0)
return BN_usub(r, r, m);
return 1;
}
int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx) {
if (!BN_sub(r, a, b))
return 0;
return BN_nnmod(r, r, m, ctx);
}
/* BN_mod_sub variant that may be used if both a and b are non-negative
* and less than m */
int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m) {
if (!BN_sub(r, a, b))
return 0;
if (r->neg)
return BN_add(r, r, m);
return 1;
}
/* slow but works */
int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
BN_CTX *ctx) {
BIGNUM *t;
int ret = 0;
bn_check_top(a);
bn_check_top(b);
bn_check_top(m);
BN_CTX_start(ctx);
if ((t = BN_CTX_get(ctx)) == NULL)
goto err;
if (a == b) {
if (!BN_sqr(t, a, ctx))
goto err;
} else if (!BN_mul(t, a, b, ctx))
goto err;
if (!BN_nnmod(r, t, m, ctx))
goto err;
ret = 1;
err:
BN_CTX_end(ctx);
return ret;
}
int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) {
if (!BN_sqr(r, a, ctx))
return 0;
/* r->neg == 0, thus we don't need BN_nnmod */
return BN_mod(r, r, m, ctx);
}
int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) {
if (!BN_lshift1(r, a))
return 0;
return BN_nnmod(r, r, m, ctx);
}
/* BN_mod_lshift1 variant that may be used if a is non-negative
* and less than m */
int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m) {
if (!BN_lshift1(r, a))
return 0;
if (BN_cmp(r, m) >= 0)
return BN_sub(r, r, m);
return 1;
}
int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, BN_CTX *ctx) {
BIGNUM *abs_m = NULL;
int ret;
if (!BN_nnmod(r, a, m, ctx))
return 0;
if (m->neg) {
abs_m = BN_dup(m);
if (abs_m == NULL)
return 0;
abs_m->neg = 0;
}
ret = BN_mod_lshift_quick(r, r, n, (abs_m ? abs_m : m));
if (abs_m)
BN_free(abs_m);
return ret;
}
/* BN_mod_lshift variant that may be used if a is non-negative
* and less than m */
int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m) {
if (r != a)
if (BN_copy(r, a) == NULL)
return 0;
while (n > 0) {
int max_shift;
/* 0 < r < m */
max_shift = BN_num_bits(m) - BN_num_bits(r);
/* max_shift >= 0 */
if (max_shift < 0)
//BNerr(BN_F_BN_MOD_LSHIFT_QUICK, BN_R_INPUT_NOT_REDUCED);
return 0;
if (max_shift > n)
max_shift = n;
if (max_shift) {
if (!BN_lshift(r, r, max_shift))
return 0;
n -= max_shift;
} else {
if (!BN_lshift1(r, r))
return 0;
--n;
}
/* BN_num_bits(r) <= BN_num_bits(m) */
if (BN_cmp(r, m) >= 0)
if (!BN_sub(r, r, m))
return 0;
}
return 1;
}
| {
"content_hash": "e933fce4e9748c52bad2f0ca2de9a960",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 91,
"avg_line_length": 35.72791519434629,
"alnum_prop": 0.6386114133122343,
"repo_name": "Devronium/ConceptApplicationServer",
"id": "b5afb4e3dbf50378915769e768760b872917d1dc",
"size": "10111",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "_deprecated/apache2/mod_concept_bridge/src/bn_openssl097beta1/bn_mod.c",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Assembly",
"bytes": "156546"
},
{
"name": "Batchfile",
"bytes": "5629"
},
{
"name": "C",
"bytes": "23814868"
},
{
"name": "C++",
"bytes": "9045245"
},
{
"name": "CSS",
"bytes": "689616"
},
{
"name": "HTML",
"bytes": "27027035"
},
{
"name": "JavaScript",
"bytes": "3907862"
},
{
"name": "M4",
"bytes": "126426"
},
{
"name": "Makefile",
"bytes": "6102928"
},
{
"name": "PHP",
"bytes": "11766"
},
{
"name": "Roff",
"bytes": "10803"
},
{
"name": "SCSS",
"bytes": "2187"
},
{
"name": "Shell",
"bytes": "7230107"
},
{
"name": "Smarty",
"bytes": "83738"
},
{
"name": "XSLT",
"bytes": "16139"
}
],
"symlink_target": ""
} |
import functools
from django.core.cache import caches
from .settings import api_settings
class cache(object):
""" Cache decorator that memoizes the return value of a method for some time.
Increment the cache_version everytime your method's implementation changes
in such a way that it returns values that are not backwards compatible.
For more information, see the Django cache documentation:
https://docs.djangoproject.com/en/2.2/topics/cache/#cache-versioning
"""
def __init__(self, ttl, cache_version=1):
self.ttl = ttl
self.cache_version = cache_version
def __call__(self, fn):
@functools.wraps(fn)
def wrapped(this, *args):
cache = caches[api_settings.OIDC_CACHE_NAME]
key = api_settings.OIDC_CACHE_PREFIX + '.'.join([fn.__name__] + list(map(str, args)))
cached_value = cache.get(key, version=self.cache_version)
if not cached_value:
cached_value = fn(this, *args)
cache.set(key, cached_value, timeout=self.ttl, version=self.cache_version)
return cached_value
return wrapped
| {
"content_hash": "b69c187762ee50e9348e67527f173268",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 97,
"avg_line_length": 36.03125,
"alnum_prop": 0.6487424111014745,
"repo_name": "ByteInternet/drf-oidc-auth",
"id": "7e397be5a4a5c7a973e7525ae3faec43e5e9b6ea",
"size": "1153",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "oidc_auth/util.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "26188"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>User agent detail - Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12A366</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../circle.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="section">
<h1 class="header center orange-text">User agent detail</h1>
<div class="row center">
<h5 class="header light">
Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12A366
</h5>
</div>
</div>
<div class="section">
<table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Test suite</th></tr><tr><td>Browscap<br /><small>6014</small><br /><small>vendor/browscap/browscap/tests/fixtures/issues/issue-511.php</small></td><td>Mobile Safari UIWebView 0.0</td><td>WebKit unknown</td><td>iOS 8.0</td><td style="border-left: 1px solid #555">Apple</td><td>iPhone</td><td>Mobile Phone</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-b3ace57b-0c56-4fa0-aa1d-8ee4ba0e42c7">Detail</a>
<!-- Modal Structure -->
<div id="modal-b3ace57b-0c56-4fa0-aa1d-8ee4ba0e42c7" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Browscap result detail</h4>
<p><pre><code class="php">Array
(
[Comment] => Mobile Safari UIWebView
[Browser] => Mobile Safari UIWebView
[Browser_Type] => Browser
[Browser_Bits] => 32
[Browser_Maker] => Apple Inc
[Browser_Modus] => unknown
[Version] => 0.0
[MajorVer] => 0
[MinorVer] => 0
[Platform] => iOS
[Platform_Version] => 8.0
[Platform_Description] => iPod, iPhone & iPad
[Platform_Bits] => 32
[Platform_Maker] => Apple Inc
[Alpha] =>
[Beta] =>
[Win16] =>
[Win32] =>
[Win64] =>
[Frames] => 1
[IFrames] => 1
[Tables] => 1
[Cookies] => 1
[BackgroundSounds] =>
[JavaScript] => 1
[VBScript] =>
[JavaApplets] => 1
[ActiveXControls] =>
[isMobileDevice] => 1
[isTablet] =>
[isSyndicationReader] =>
[Crawler] =>
[isFake] =>
[isAnonymized] =>
[isModified] =>
[CssVersion] => 3
[AolVersion] => 0
[Device_Name] => iPhone
[Device_Maker] => Apple Inc
[Device_Type] => Mobile Phone
[Device_Pointing_Method] => touchscreen
[Device_Code_Name] => iPhone
[Device_Brand_Name] => Apple
[RenderingEngine_Name] => WebKit
[RenderingEngine_Version] => unknown
[RenderingEngine_Maker] => Apple Inc
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapFull<br /><small>6014</small><br /></td><td>Mobile Safari UIWebView </td><td>WebKit </td><td>iOS 8.0</td><td style="border-left: 1px solid #555">Apple</td><td>iPhone</td><td>Mobile Phone</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.009</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-47a9cd06-e213-4882-bc34-db6aed664223">Detail</a>
<!-- Modal Structure -->
<div id="modal-47a9cd06-e213-4882-bc34-db6aed664223" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapFull result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^mozilla\/5\.0.*\(iphone.*cpu iphone os 8.0.* like mac os x.*\).*applewebkit\/.*\(.*khtml.* like gecko.*\).*mobile.*$/
[browser_name_pattern] => mozilla/5.0*(iphone*cpu iphone os 8?0* like mac os x*)*applewebkit/*(*khtml* like gecko*)*mobile*
[parent] => Mobile Safari UIWebView
[comment] => Mobile Safari UIWebView
[browser] => Mobile Safari UIWebView
[browser_type] => Browser
[browser_bits] => 32
[browser_maker] => Apple Inc
[browser_modus] => unknown
[version] => 0.0
[majorver] => 0
[minorver] => 0
[platform] => iOS
[platform_version] => 8.0
[platform_description] => iPod, iPhone & iPad
[platform_bits] => 32
[platform_maker] => Apple Inc
[alpha] =>
[beta] =>
[win16] =>
[win32] =>
[win64] =>
[frames] => 1
[iframes] => 1
[tables] => 1
[cookies] => 1
[backgroundsounds] =>
[javascript] => 1
[vbscript] =>
[javaapplets] => 1
[activexcontrols] =>
[ismobiledevice] => 1
[istablet] =>
[issyndicationreader] =>
[crawler] =>
[isfake] =>
[isanonymized] =>
[ismodified] =>
[cssversion] => 3
[aolversion] => 0
[device_name] => iPhone
[device_maker] => Apple Inc
[device_type] => Mobile Phone
[device_pointing_method] => touchscreen
[device_code_name] => iPhone
[device_brand_name] => Apple
[renderingengine_name] => WebKit
[renderingengine_version] => unknown
[renderingengine_description] => For Google Chrome, iOS (including both mobile Safari, WebViews within third-party apps, and web clips), Safari, Arora, Midori, OmniWeb, Shiira, iCab since version 4, Web, SRWare Iron, Rekonq, and in Maxthon 3.
[renderingengine_maker] => Apple Inc
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>BrowscapLite<br /><small>6014</small><br /></td><td>Mobile Safari UIWebView </td><td><i class="material-icons">close</i></td><td>iOS </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile Phone</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.004</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-42bb56ba-b834-47c5-bea0-c0270e9ab371">Detail</a>
<!-- Modal Structure -->
<div id="modal-42bb56ba-b834-47c5-bea0-c0270e9ab371" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapLite result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^mozilla\/5\.0.*\(iphone.*cpu.*os.* like mac os x.*\).*applewebkit\/.*\(.*khtml.* like gecko.*\).*mobile.*$/
[browser_name_pattern] => mozilla/5.0*(iphone*cpu*os* like mac os x*)*applewebkit/*(*khtml* like gecko*)*mobile*
[parent] => Mobile Safari UIWebView
[comment] => Mobile Safari UIWebView
[browser] => Mobile Safari UIWebView
[browser_type] => unknown
[browser_bits] => 0
[browser_maker] => unknown
[browser_modus] => unknown
[version] => 0.0
[majorver] => 0
[minorver] => 0
[platform] => iOS
[platform_version] => unknown
[platform_description] => unknown
[platform_bits] => 0
[platform_maker] => unknown
[alpha] => false
[beta] => false
[win16] => false
[win32] => false
[win64] => false
[frames] => false
[iframes] => false
[tables] => false
[cookies] => false
[backgroundsounds] => false
[javascript] => false
[vbscript] => false
[javaapplets] => false
[activexcontrols] => false
[ismobiledevice] => 1
[istablet] =>
[issyndicationreader] => false
[crawler] => false
[isfake] => false
[isanonymized] => false
[ismodified] => false
[cssversion] => 0
[aolversion] => 0
[device_name] => unknown
[device_maker] => unknown
[device_type] => Mobile Phone
[device_pointing_method] => unknown
[device_code_name] => unknown
[device_brand_name] => unknown
[renderingengine_name] => unknown
[renderingengine_version] => unknown
[renderingengine_description] => unknown
[renderingengine_maker] => unknown
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>BrowscapPhp<br /><small>6014</small><br /></td><td>Mobile Safari UIWebView </td><td><i class="material-icons">close</i></td><td>iOS </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile Device</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.006</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-ad0041a2-b0f4-43f6-a70d-cad1443caa68">Detail</a>
<!-- Modal Structure -->
<div id="modal-ad0041a2-b0f4-43f6-a70d-cad1443caa68" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapPhp result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^mozilla\/5\.0.*\(.*cpu iphone os 8.0.* like mac os x.*\).*applewebkit\/.*\(.*khtml.* like gecko.*\).*mobile.*$/
[browser_name_pattern] => mozilla/5.0*(*cpu iphone os 8?0* like mac os x*)*applewebkit/*(*khtml* like gecko*)*mobile*
[parent] => Mobile Safari UIWebView
[comment] => Mobile Safari UIWebView
[browser] => Mobile Safari UIWebView
[browser_type] => unknown
[browser_bits] => 0
[browser_maker] => Apple Inc
[browser_modus] => unknown
[version] => 0.0
[majorver] => 0
[minorver] => 0
[platform] => iOS
[platform_version] => unknown
[platform_description] => unknown
[platform_bits] => 0
[platform_maker] => unknown
[alpha] => false
[beta] => false
[win16] => false
[win32] => false
[win64] => false
[frames] => false
[iframes] => false
[tables] => false
[cookies] => false
[backgroundsounds] => false
[javascript] => false
[vbscript] => false
[javaapplets] => false
[activexcontrols] => false
[ismobiledevice] => 1
[istablet] =>
[issyndicationreader] => false
[crawler] =>
[isfake] => false
[isanonymized] => false
[ismodified] => false
[cssversion] => 0
[aolversion] => 0
[device_name] => unknown
[device_maker] => unknown
[device_type] => Mobile Device
[device_pointing_method] => touchscreen
[device_code_name] => unknown
[device_brand_name] => unknown
[renderingengine_name] => unknown
[renderingengine_version] => unknown
[renderingengine_description] => unknown
[renderingengine_maker] => unknown
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>DonatjUAParser<br /><small>v0.5.1</small><br /></td><td>AppleWebKit 600.1.4</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050">Detail</a>
<!-- Modal Structure -->
<div id="modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>DonatjUAParser result detail</h4>
<p><pre><code class="php">Array
(
[platform] => iPhone
[browser] => AppleWebKit
[version] => 600.1.4
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>JenssegersAgent<br /><small>v2.3.3</small><br /></td><td>Mozilla </td><td><i class="material-icons">close</i></td><td>iOS 8_0</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-b85a2b91-6a55-4436-a82c-1ea0d46e2e51">Detail</a>
<!-- Modal Structure -->
<div id="modal-b85a2b91-6a55-4436-a82c-1ea0d46e2e51" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>JenssegersAgent result detail</h4>
<p><pre><code class="php">Array
(
[browserName] => Mozilla
[browserVersion] =>
[osName] => iOS
[osVersion] => 8_0
[deviceModel] => iPhone
[isMobile] => 1
[isRobot] =>
[botName] =>
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>NeutrinoApiCom<br /><small></small><br /></td><td>Mobile Safari </td><td><i class="material-icons">close</i></td><td>iOS 8.0</td><td style="border-left: 1px solid #555">Apple</td><td>iPhone</td><td>mobile-browser</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.20301</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b">Detail</a>
<!-- Modal Structure -->
<div id="modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>NeutrinoApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[mobile_screen_height] => 960
[is_mobile] => 1
[type] => mobile-browser
[mobile_brand] => Apple
[mobile_model] => iPhone
[version] =>
[is_android] =>
[browser_name] => Mobile Safari
[operating_system_family] => iOS
[operating_system_version] => 8.0
[is_ios] => 1
[producer] => Apple Inc.
[operating_system] => iOS
[mobile_screen_width] => 640
[mobile_browser] => Safari
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>PiwikDeviceDetector<br /><small>3.6.1</small><br /></td><td>Mobile Safari </td><td>WebKit </td><td>iOS 8.0</td><td style="border-left: 1px solid #555">Apple</td><td>iPhone</td><td>smartphone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.002</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-4a941d34-a8d3-4914-9724-346f60ad7046">Detail</a>
<!-- Modal Structure -->
<div id="modal-4a941d34-a8d3-4914-9724-346f60ad7046" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>PiwikDeviceDetector result detail</h4>
<p><pre><code class="php">Array
(
[client] => Array
(
[type] => browser
[name] => Mobile Safari
[short_name] => MF
[version] =>
[engine] => WebKit
)
[operatingSystem] => Array
(
[name] => iOS
[short_name] => IOS
[version] => 8.0
[platform] =>
)
[device] => Array
(
[brand] => AP
[brandName] => Apple
[model] => iPhone
[device] => 1
[deviceName] => smartphone
)
[bot] =>
[extra] => Array
(
[isBot] =>
[isBrowser] => 1
[isFeedReader] =>
[isMobileApp] =>
[isPIM] =>
[isLibrary] =>
[isMediaPlayer] =>
[isCamera] =>
[isCarBrowser] =>
[isConsole] =>
[isFeaturePhone] =>
[isPhablet] =>
[isPortableMediaPlayer] =>
[isSmartDisplay] =>
[isSmartphone] => 1
[isTablet] =>
[isTV] =>
[isDesktop] =>
[isMobile] => 1
[isTouchEnabled] =>
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.1</small><br /></td><td>Mozilla 5.0</td><td><i class="material-icons">close</i></td><td>iOS 8.0</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td>iPhone</td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-ec1cd248-02b0-457e-8a9d-35bb99af008c">Detail</a>
<!-- Modal Structure -->
<div id="modal-ec1cd248-02b0-457e-8a9d-35bb99af008c" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>SinergiBrowserDetector result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Sinergi\BrowserDetector\Browser Object
(
[userAgent:Sinergi\BrowserDetector\Browser:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12A366
)
[name:Sinergi\BrowserDetector\Browser:private] => Mozilla
[version:Sinergi\BrowserDetector\Browser:private] => 5.0
[isRobot:Sinergi\BrowserDetector\Browser:private] =>
[isChromeFrame:Sinergi\BrowserDetector\Browser:private] =>
[isFacebookWebView:Sinergi\BrowserDetector\Browser:private] =>
[isCompatibilityMode:Sinergi\BrowserDetector\Browser:private] =>
)
[operatingSystem] => Sinergi\BrowserDetector\Os Object
(
[name:Sinergi\BrowserDetector\Os:private] => iOS
[version:Sinergi\BrowserDetector\Os:private] => 8.0
[isMobile:Sinergi\BrowserDetector\Os:private] => 1
[userAgent:Sinergi\BrowserDetector\Os:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12A366
)
)
[device] => Sinergi\BrowserDetector\Device Object
(
[name:Sinergi\BrowserDetector\Device:private] => iPhone
[userAgent:Sinergi\BrowserDetector\Device:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12A366
)
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UAParser<br /><small>v3.4.5</small><br /></td><td>Mobile Safari UIWebView 8.0</td><td><i class="material-icons">close</i></td><td>iOS 8.0</td><td style="border-left: 1px solid #555">Apple</td><td>iPhone</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-3160e405-8a8f-46dd-8f47-5115f06462d2">Detail</a>
<!-- Modal Structure -->
<div id="modal-3160e405-8a8f-46dd-8f47-5115f06462d2" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UAParser result detail</h4>
<p><pre><code class="php">UAParser\Result\Client Object
(
[ua] => UAParser\Result\UserAgent Object
(
[major] => 8
[minor] => 0
[patch] =>
[family] => Mobile Safari UIWebView
)
[os] => UAParser\Result\OperatingSystem Object
(
[major] => 8
[minor] => 0
[patch] =>
[patchMinor] =>
[family] => iOS
)
[device] => UAParser\Result\Device Object
(
[brand] => Apple
[model] => iPhone
[family] => iPhone
)
[originalUserAgent] => Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12A366
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UserAgentApiCom<br /><small></small><br /></td><td>Mozilla 5.0</td><td>WebKit 600.1.4</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.15201</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6">Detail</a>
<!-- Modal Structure -->
<div id="modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UserAgentApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[platform_name] => Apple iPhone
[platform_version] => 8
[platform_type] => Mobile
[browser_name] => Mozilla
[browser_version] => 5.0
[engine_name] => WebKit
[engine_version] => 600.1.4
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UserAgentStringCom<br /><small></small><br /></td><td>Safari </td><td><i class="material-icons">close</i></td><td>iPhone OS 8.0</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.062</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-08a9ddfb-838f-48d7-9ede-1d132306b2ee">Detail</a>
<!-- Modal Structure -->
<div id="modal-08a9ddfb-838f-48d7-9ede-1d132306b2ee" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UserAgentStringCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[agent_type] => Browser
[agent_name] => Safari
[agent_version] => --
[os_type] => Macintosh
[os_name] => iPhone OS
[os_versionName] =>
[os_versionNumber] => 8_0
[os_producer] =>
[os_producerURL] =>
[linux_distibution] => Null
[agent_language] =>
[agent_languageTag] =>
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>WhatIsMyBrowserCom<br /><small></small><br /></td><td> </td><td>WebKit 600.1.4</td><td>iOS 8.0</td><td style="border-left: 1px solid #555">Apple</td><td>iPhone</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.24901</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c">Detail</a>
<!-- Modal Structure -->
<div id="modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhatIsMyBrowserCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[operating_system_name] => iOS
[simple_sub_description_string] =>
[simple_browser_string] => Unknown Mobile Browser on iOS 8
[browser_version] =>
[extra_info] => Array
(
)
[operating_platform] => iPhone
[extra_info_table] => stdClass Object
(
[Mobile Build] => 12A366
)
[layout_engine_name] => WebKit
[detected_addons] => Array
(
)
[operating_system_flavour_code] =>
[hardware_architecture] =>
[operating_system_flavour] =>
[operating_system_frameworks] => Array
(
)
[browser_name_code] => unknown-mobile-browser
[operating_system_version] => 8
[simple_operating_platform_string] => Apple iPhone
[is_abusive] =>
[layout_engine_version] => 600.1.4
[browser_capabilities] => Array
(
)
[operating_platform_vendor_name] => Apple
[operating_system] => iOS 8
[operating_system_version_full] => 8.0
[operating_platform_code] =>
[browser_name] => Unknown Mobile Browser
[operating_system_name_code] => ios
[user_agent] => Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12A366
[browser_version_full] =>
[browser] => Unknown Mobile Browser
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>WhichBrowser<br /><small>v2.0.18</small><br /></td><td> </td><td>Webkit 600.1.4</td><td>iOS 8.0</td><td style="border-left: 1px solid #555">Apple</td><td>iPhone</td><td>mobile:smart</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-083a336f-5d73-4505-84f3-c5fc9bb78652">Detail</a>
<!-- Modal Structure -->
<div id="modal-083a336f-5d73-4505-84f3-c5fc9bb78652" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhichBrowser result detail</h4>
<p><pre><code class="php">Array
(
[engine] => Array
(
[name] => Webkit
[version] => 600.1.4
)
[os] => Array
(
[name] => iOS
[version] => 8.0
)
[device] => Array
(
[type] => mobile
[subtype] => smart
[manufacturer] => Apple
[model] => iPhone
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Woothee<br /><small>v1.2.0</small><br /></td><td>Webview </td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>smartphone</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-f00e7198-0e22-49fe-bad0-dbb3a9cde9b9">Detail</a>
<!-- Modal Structure -->
<div id="modal-f00e7198-0e22-49fe-bad0-dbb3a9cde9b9" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Woothee result detail</h4>
<p><pre><code class="php">Array
(
[name] => Webview
[vendor] => OS vendor
[version] => UNKNOWN
[category] => smartphone
[os] => iPhone
[os_version] => 8.0
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Wurfl<br /><small>1.7.1.0</small><br /></td><td>Mobile Safari 8.0</td><td><i class="material-icons">close</i></td><td>iOS 8.0</td><td style="border-left: 1px solid #555">Apple</td><td>iPhone</td><td>Smartphone</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.017</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50">Detail</a>
<!-- Modal Structure -->
<div id="modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Wurfl result detail</h4>
<p><pre><code class="php">Array
(
[virtual] => Array
(
[is_android] => false
[is_ios] => true
[is_windows_phone] => false
[is_app] => true
[is_full_desktop] => false
[is_largescreen] => true
[is_mobile] => true
[is_robot] => false
[is_smartphone] => true
[is_touchscreen] => true
[is_wml_preferred] => false
[is_xhtmlmp_preferred] => false
[is_html_preferred] => true
[advertised_device_os] => iOS
[advertised_device_os_version] => 8.0
[advertised_browser] => Mobile Safari
[advertised_browser_version] => 8.0
[complete_device_name] => Apple iPhone
[device_name] => Apple iPhone
[form_factor] => Smartphone
[is_phone] => true
[is_app_webview] => true
)
[all] => Array
(
[brand_name] => Apple
[model_name] => iPhone
[unique] => true
[ununiqueness_handler] =>
[is_wireless_device] => true
[device_claims_web_support] => true
[has_qwerty_keyboard] => true
[can_skip_aligned_link_row] => true
[uaprof] =>
[uaprof2] =>
[uaprof3] =>
[nokia_series] => 0
[nokia_edition] => 0
[device_os] => iOS
[mobile_browser] => Safari
[mobile_browser_version] => 8.0
[device_os_version] => 8.0
[pointing_method] => touchscreen
[release_date] => 2013_june
[marketing_name] =>
[model_extra_info] => 8.0
[nokia_feature_pack] => 0
[can_assign_phone_number] => true
[is_tablet] => false
[manufacturer_name] =>
[is_bot] => false
[is_google_glass] => false
[proportional_font] => false
[built_in_back_button_support] => false
[card_title_support] => false
[softkey_support] => false
[table_support] => false
[numbered_menus] => false
[menu_with_select_element_recommended] => false
[menu_with_list_of_links_recommended] => false
[icons_on_menu_items_support] => false
[break_list_of_links_with_br_element_recommended] => false
[access_key_support] => false
[wrap_mode_support] => false
[times_square_mode_support] => false
[deck_prefetch_support] => false
[elective_forms_recommended] => false
[wizards_recommended] => false
[image_as_link_support] => false
[insert_br_element_after_widget_recommended] => false
[wml_can_display_images_and_text_on_same_line] => false
[wml_displays_image_in_center] => false
[opwv_wml_extensions_support] => false
[wml_make_phone_call_string] => none
[chtml_display_accesskey] => false
[emoji] => false
[chtml_can_display_images_and_text_on_same_line] => false
[chtml_displays_image_in_center] => false
[imode_region] => none
[chtml_make_phone_call_string] => tel:
[chtml_table_support] => false
[xhtml_honors_bgcolor] => true
[xhtml_supports_forms_in_table] => false
[xhtml_support_wml2_namespace] => false
[xhtml_autoexpand_select] => false
[xhtml_select_as_dropdown] => false
[xhtml_select_as_radiobutton] => false
[xhtml_select_as_popup] => false
[xhtml_display_accesskey] => false
[xhtml_supports_invisible_text] => false
[xhtml_supports_inline_input] => false
[xhtml_supports_monospace_font] => false
[xhtml_supports_table_for_layout] => true
[xhtml_supports_css_cell_table_coloring] => true
[xhtml_format_as_css_property] => true
[xhtml_format_as_attribute] => false
[xhtml_nowrap_mode] => false
[xhtml_marquee_as_css_property] => false
[xhtml_readable_background_color1] => #D9EFFF
[xhtml_readable_background_color2] => #FFFFFF
[xhtml_allows_disabled_form_elements] => false
[xhtml_document_title_support] => true
[xhtml_preferred_charset] => utf8
[opwv_xhtml_extensions_support] => false
[xhtml_make_phone_call_string] => tel:
[xhtmlmp_preferred_mime_type] => text/html
[xhtml_table_support] => true
[xhtml_send_sms_string] => sms:
[xhtml_send_mms_string] => none
[xhtml_file_upload] => not_supported
[cookie_support] => true
[accept_third_party_cookie] => false
[xhtml_supports_iframe] => full
[xhtml_avoid_accesskeys] => false
[xhtml_can_embed_video] => none
[ajax_support_javascript] => true
[ajax_manipulate_css] => true
[ajax_support_getelementbyid] => true
[ajax_support_inner_html] => true
[ajax_xhr_type] => standard
[ajax_manipulate_dom] => true
[ajax_support_events] => true
[ajax_support_event_listener] => true
[ajax_preferred_geoloc_api] => w3c_api
[xhtml_support_level] => 4
[preferred_markup] => html_web_4_0
[wml_1_1] => false
[wml_1_2] => false
[wml_1_3] => false
[html_wi_w3_xhtmlbasic] => true
[html_wi_oma_xhtmlmp_1_0] => true
[html_wi_imode_html_1] => false
[html_wi_imode_html_2] => false
[html_wi_imode_html_3] => false
[html_wi_imode_html_4] => false
[html_wi_imode_html_5] => false
[html_wi_imode_htmlx_1] => false
[html_wi_imode_htmlx_1_1] => false
[html_wi_imode_compact_generic] => true
[html_web_3_2] => true
[html_web_4_0] => true
[voicexml] => false
[multipart_support] => false
[total_cache_disable_support] => false
[time_to_live_support] => false
[resolution_width] => 640
[resolution_height] => 960
[columns] => 20
[max_image_width] => 320
[max_image_height] => 480
[rows] => 20
[physical_screen_width] => 50
[physical_screen_height] => 74
[dual_orientation] => true
[density_class] => 1.0
[wbmp] => false
[bmp] => true
[epoc_bmp] => false
[gif_animated] => true
[jpg] => true
[png] => true
[tiff] => false
[transparent_png_alpha] => false
[transparent_png_index] => false
[svgt_1_1] => true
[svgt_1_1_plus] => false
[greyscale] => false
[gif] => true
[colors] => 65536
[webp_lossy_support] => false
[webp_lossless_support] => false
[post_method_support] => true
[basic_authentication_support] => true
[empty_option_value_support] => true
[emptyok] => false
[nokia_voice_call] => false
[wta_voice_call] => false
[wta_phonebook] => false
[wta_misc] => false
[wta_pdc] => false
[https_support] => true
[phone_id_provided] => false
[max_data_rate] => 200
[wifi] => true
[sdio] => false
[vpn] => true
[has_cellular_radio] => true
[max_deck_size] => 100000
[max_url_length_in_requests] => 512
[max_url_length_homepage] => 0
[max_url_length_bookmark] => 0
[max_url_length_cached_page] => 0
[max_no_of_connection_settings] => 0
[max_no_of_bookmarks] => 0
[max_length_of_username] => 0
[max_length_of_password] => 0
[max_object_size] => 0
[downloadfun_support] => false
[directdownload_support] => false
[inline_support] => false
[oma_support] => false
[ringtone] => true
[ringtone_3gpp] => false
[ringtone_midi_monophonic] => true
[ringtone_midi_polyphonic] => true
[ringtone_imelody] => false
[ringtone_digiplug] => false
[ringtone_compactmidi] => false
[ringtone_mmf] => false
[ringtone_rmf] => false
[ringtone_xmf] => false
[ringtone_amr] => true
[ringtone_awb] => false
[ringtone_aac] => true
[ringtone_wav] => true
[ringtone_mp3] => true
[ringtone_spmidi] => false
[ringtone_qcelp] => false
[ringtone_voices] => 12
[ringtone_df_size_limit] => 0
[ringtone_directdownload_size_limit] => 0
[ringtone_inline_size_limit] => 0
[ringtone_oma_size_limit] => 0
[wallpaper] => false
[wallpaper_max_width] => 320
[wallpaper_max_height] => 480
[wallpaper_preferred_width] => 320
[wallpaper_preferred_height] => 480
[wallpaper_resize] => none
[wallpaper_wbmp] => false
[wallpaper_bmp] => false
[wallpaper_gif] => false
[wallpaper_jpg] => false
[wallpaper_png] => false
[wallpaper_tiff] => false
[wallpaper_greyscale] => false
[wallpaper_colors] => 2
[wallpaper_df_size_limit] => 0
[wallpaper_directdownload_size_limit] => 0
[wallpaper_inline_size_limit] => 0
[wallpaper_oma_size_limit] => 0
[screensaver] => false
[screensaver_max_width] => 0
[screensaver_max_height] => 0
[screensaver_preferred_width] => 0
[screensaver_preferred_height] => 0
[screensaver_resize] => none
[screensaver_wbmp] => false
[screensaver_bmp] => false
[screensaver_gif] => false
[screensaver_jpg] => false
[screensaver_png] => false
[screensaver_greyscale] => false
[screensaver_colors] => 2
[screensaver_df_size_limit] => 0
[screensaver_directdownload_size_limit] => 0
[screensaver_inline_size_limit] => 0
[screensaver_oma_size_limit] => 0
[picture] => false
[picture_max_width] => 0
[picture_max_height] => 0
[picture_preferred_width] => 0
[picture_preferred_height] => 0
[picture_resize] => none
[picture_wbmp] => false
[picture_bmp] => false
[picture_gif] => false
[picture_jpg] => false
[picture_png] => false
[picture_greyscale] => false
[picture_colors] => 2
[picture_df_size_limit] => 0
[picture_directdownload_size_limit] => 0
[picture_inline_size_limit] => 0
[picture_oma_size_limit] => 0
[video] => true
[oma_v_1_0_forwardlock] => false
[oma_v_1_0_combined_delivery] => false
[oma_v_1_0_separate_delivery] => false
[streaming_video] => true
[streaming_3gpp] => true
[streaming_mp4] => true
[streaming_mov] => false
[streaming_video_size_limit] => 0
[streaming_real_media] => none
[streaming_flv] => false
[streaming_3g2] => false
[streaming_vcodec_h263_0] => 30
[streaming_vcodec_h263_3] => -1
[streaming_vcodec_mpeg4_sp] => 3
[streaming_vcodec_mpeg4_asp] => 3
[streaming_vcodec_h264_bp] => 3.0
[streaming_acodec_amr] => nb
[streaming_acodec_aac] => lc
[streaming_wmv] => none
[streaming_preferred_protocol] => http
[streaming_preferred_http_protocol] => apple_live_streaming
[wap_push_support] => false
[connectionless_service_indication] => false
[connectionless_service_load] => false
[connectionless_cache_operation] => false
[connectionoriented_unconfirmed_service_indication] => false
[connectionoriented_unconfirmed_service_load] => false
[connectionoriented_unconfirmed_cache_operation] => false
[connectionoriented_confirmed_service_indication] => false
[connectionoriented_confirmed_service_load] => false
[connectionoriented_confirmed_cache_operation] => false
[utf8_support] => true
[ascii_support] => false
[iso8859_support] => false
[expiration_date] => false
[j2me_cldc_1_0] => false
[j2me_cldc_1_1] => false
[j2me_midp_1_0] => false
[j2me_midp_2_0] => false
[doja_1_0] => false
[doja_1_5] => false
[doja_2_0] => false
[doja_2_1] => false
[doja_2_2] => false
[doja_3_0] => false
[doja_3_5] => false
[doja_4_0] => false
[j2me_jtwi] => false
[j2me_mmapi_1_0] => false
[j2me_mmapi_1_1] => false
[j2me_wmapi_1_0] => false
[j2me_wmapi_1_1] => false
[j2me_wmapi_2_0] => false
[j2me_btapi] => false
[j2me_3dapi] => false
[j2me_locapi] => false
[j2me_nokia_ui] => false
[j2me_motorola_lwt] => false
[j2me_siemens_color_game] => false
[j2me_siemens_extension] => false
[j2me_heap_size] => 0
[j2me_max_jar_size] => 0
[j2me_storage_size] => 0
[j2me_max_record_store_size] => 0
[j2me_screen_width] => 0
[j2me_screen_height] => 0
[j2me_canvas_width] => 0
[j2me_canvas_height] => 0
[j2me_bits_per_pixel] => 0
[j2me_audio_capture_enabled] => false
[j2me_video_capture_enabled] => false
[j2me_photo_capture_enabled] => false
[j2me_capture_image_formats] => none
[j2me_http] => false
[j2me_https] => false
[j2me_socket] => false
[j2me_udp] => false
[j2me_serial] => false
[j2me_gif] => false
[j2me_gif89a] => false
[j2me_jpg] => false
[j2me_png] => false
[j2me_bmp] => false
[j2me_bmp3] => false
[j2me_wbmp] => false
[j2me_midi] => false
[j2me_wav] => false
[j2me_amr] => false
[j2me_mp3] => false
[j2me_mp4] => false
[j2me_imelody] => false
[j2me_rmf] => false
[j2me_au] => false
[j2me_aac] => false
[j2me_realaudio] => false
[j2me_xmf] => false
[j2me_wma] => false
[j2me_3gpp] => false
[j2me_h263] => false
[j2me_svgt] => false
[j2me_mpeg4] => false
[j2me_realvideo] => false
[j2me_real8] => false
[j2me_realmedia] => false
[j2me_left_softkey_code] => 0
[j2me_right_softkey_code] => 0
[j2me_middle_softkey_code] => 0
[j2me_select_key_code] => 0
[j2me_return_key_code] => 0
[j2me_clear_key_code] => 0
[j2me_datefield_no_accepts_null_date] => false
[j2me_datefield_broken] => false
[receiver] => true
[sender] => true
[mms_max_size] => 1048576
[mms_max_height] => 1024
[mms_max_width] => 1024
[built_in_recorder] => false
[built_in_camera] => true
[mms_jpeg_baseline] => true
[mms_jpeg_progressive] => true
[mms_gif_static] => true
[mms_gif_animated] => true
[mms_png] => true
[mms_bmp] => true
[mms_wbmp] => false
[mms_amr] => true
[mms_wav] => false
[mms_midi_monophonic] => false
[mms_midi_polyphonic] => false
[mms_midi_polyphonic_voices] => 0
[mms_spmidi] => false
[mms_mmf] => false
[mms_mp3] => true
[mms_evrc] => false
[mms_qcelp] => false
[mms_ota_bitmap] => false
[mms_nokia_wallpaper] => false
[mms_nokia_operatorlogo] => false
[mms_nokia_3dscreensaver] => false
[mms_nokia_ringingtone] => false
[mms_rmf] => false
[mms_xmf] => false
[mms_symbian_install] => false
[mms_jar] => false
[mms_jad] => false
[mms_vcard] => true
[mms_vcalendar] => false
[mms_wml] => false
[mms_wbxml] => false
[mms_wmlc] => false
[mms_video] => true
[mms_mp4] => true
[mms_3gpp] => true
[mms_3gpp2] => true
[mms_max_frame_rate] => 0
[nokiaring] => false
[picturemessage] => false
[operatorlogo] => false
[largeoperatorlogo] => false
[callericon] => false
[nokiavcard] => false
[nokiavcal] => false
[sckl_ringtone] => false
[sckl_operatorlogo] => false
[sckl_groupgraphic] => false
[sckl_vcard] => false
[sckl_vcalendar] => false
[text_imelody] => false
[ems] => false
[ems_variablesizedpictures] => false
[ems_imelody] => false
[ems_odi] => false
[ems_upi] => false
[ems_version] => 0
[siemens_ota] => false
[siemens_logo_width] => 101
[siemens_logo_height] => 29
[siemens_screensaver_width] => 101
[siemens_screensaver_height] => 50
[gprtf] => false
[sagem_v1] => false
[sagem_v2] => false
[panasonic] => false
[sms_enabled] => true
[wav] => false
[mmf] => false
[smf] => false
[mld] => false
[midi_monophonic] => false
[midi_polyphonic] => false
[sp_midi] => false
[rmf] => false
[xmf] => false
[compactmidi] => false
[digiplug] => false
[nokia_ringtone] => false
[imelody] => false
[au] => false
[amr] => false
[awb] => false
[aac] => true
[mp3] => true
[voices] => 1
[qcelp] => false
[evrc] => false
[flash_lite_version] =>
[fl_wallpaper] => false
[fl_screensaver] => false
[fl_standalone] => false
[fl_browser] => false
[fl_sub_lcd] => false
[full_flash_support] => false
[css_supports_width_as_percentage] => true
[css_border_image] => webkit
[css_rounded_corners] => webkit
[css_gradient] => webkit
[css_spriting] => true
[css_gradient_linear] => webkit
[is_transcoder] => false
[transcoder_ua_header] => user-agent
[rss_support] => true
[pdf_support] => true
[progressive_download] => true
[playback_vcodec_h263_0] => 30
[playback_vcodec_h263_3] => -1
[playback_vcodec_mpeg4_sp] => 3
[playback_vcodec_mpeg4_asp] => 2
[playback_vcodec_h264_bp] => 3.0
[playback_real_media] => none
[playback_3gpp] => true
[playback_3g2] => true
[playback_mp4] => true
[playback_mov] => true
[playback_acodec_amr] => nb
[playback_acodec_aac] => lc
[playback_df_size_limit] => 0
[playback_directdownload_size_limit] => 0
[playback_inline_size_limit] => 0
[playback_oma_size_limit] => 0
[playback_acodec_qcelp] => false
[playback_wmv] => none
[hinted_progressive_download] => false
[html_preferred_dtd] => html4
[viewport_supported] => true
[viewport_width] => device_width_token
[viewport_userscalable] => no
[viewport_initial_scale] =>
[viewport_maximum_scale] =>
[viewport_minimum_scale] =>
[mobileoptimized] => false
[handheldfriendly] => false
[canvas_support] => full
[image_inlining] => true
[is_smarttv] => false
[is_console] => false
[nfc_support] => false
[ux_full_desktop] => false
[jqm_grade] => A
[is_sencha_touch_ok] => true
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Zsxsoft<br /><small>1.3</small><br /></td><td> </td><td><i class="material-icons">close</i></td><td>iOS 8.0</td><td style="border-left: 1px solid #555">Apple</td><td>iPhone</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-5d43e024-b46c-44f6-8914-529b05569bc2">Detail</a>
<!-- Modal Structure -->
<div id="modal-5d43e024-b46c-44f6-8914-529b05569bc2" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Zsxsoft result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Array
(
[link] => http://www.mozilla.org/
[title] => Mozilla Compatible
[name] => Mozilla Compatible
[version] =>
[code] => mozilla
[image] => img/16/browser/mozilla.png
)
[os] => Array
(
[link] => http://www.apple.com/
[name] => iOS
[version] => 8.0
[code] => mac-3
[x64] =>
[title] => iOS 8.0
[type] => os
[dir] => os
[image] => img/16/os/mac-3.png
)
[device] => Array
(
[link] => http://www.apple.com/iphone
[title] => Apple iPhone
[model] => iPhone
[brand] => Apple
[code] => iphone
[dir] => device
[type] => device
[image] => img/16/device/iphone.png
)
[platform] => Array
(
[link] => http://www.apple.com/iphone
[title] => Apple iPhone
[model] => iPhone
[brand] => Apple
[code] => iphone
[dir] => device
[type] => device
[image] => img/16/device/iphone.png
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr></table>
</div>
<div class="section">
<h1 class="header center orange-text">About this comparison</h1>
<div class="row center">
<h5 class="header light">
The primary goal of this project is simple<br />
I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br />
<br />
The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br />
<br />
You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br />
<br />
The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a>
</h5>
</div>
</div>
<div class="card">
<div class="card-content">
Comparison created <i>2016-05-10 08:09:37</i> | by
<a href="https://github.com/ThaDafinser">ThaDafinser</a>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.2.0/list.min.js"></script>
<script>
$(document).ready(function(){
// the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
$('.modal-trigger').leanModal();
});
</script>
</body>
</html> | {
"content_hash": "bf661ed900a365673d442b2f978ff57f",
"timestamp": "",
"source": "github",
"line_count": 1407,
"max_line_length": 819,
"avg_line_length": 40.372423596304195,
"alnum_prop": 0.5460178860643616,
"repo_name": "ThaDafinser/UserAgentParserComparison",
"id": "ac34326dd62e73cfa41e1085960dc09f8a43a3e0",
"size": "56805",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "v5/user-agent-detail/e1/4d/e14d2fff-50df-4734-813d-33b5df8c920a.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2060859160"
}
],
"symlink_target": ""
} |
class ProductPrices < ActiveRecord::Migration
def change
create_table :product_prices do |t|
t.integer :product_id
t.decimal :price
t.datetime :effective_start_date
end
end
end
| {
"content_hash": "b3e9b9de4572163316ccf333f2415d5b",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 45,
"avg_line_length": 23,
"alnum_prop": 0.6811594202898551,
"repo_name": "chugh97/eshop",
"id": "4b6fbab14d6b0861bdd0ed2efcf3516d7bfca209",
"size": "207",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "db/migrate/20131122205931_product_prices.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "38756"
},
{
"name": "CoffeeScript",
"bytes": "211"
},
{
"name": "JavaScript",
"bytes": "5847"
},
{
"name": "Ruby",
"bytes": "42973"
}
],
"symlink_target": ""
} |
class Weapon:
def __init__(self, name, damage):
self.name = name
self.damage = damage
class Spell(Weapon):
def __init__(self, *args, mana_cost, cast_range, **kwargs):
super().__init__(*args, **kwargs)
self.mana_cost = mana_cost
self.cast_range = cast_range
| {
"content_hash": "d85f0e5a9e6a89c11f718290cd00d84b",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 63,
"avg_line_length": 27.90909090909091,
"alnum_prop": 0.5700325732899023,
"repo_name": "int3l/dungeons-and-pythons",
"id": "be525ba177386bc31c2a31ea82da40334bd81d47",
"size": "307",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "equipment.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "18960"
}
],
"symlink_target": ""
} |
using System;
namespace DoFactory.GangOfFour.Template.Structural
{
/// <summary>
/// MainApp startup class for Real-World
/// Template Design Pattern.
/// </summary>
class MainApp
{
/// <summary>
/// Entry point into console application.
/// </summary>
static void Main()
{
AbstractClass aA = new ConcreteClassA();
aA.TemplateMethod();
AbstractClass aB = new ConcreteClassB();
aB.TemplateMethod();
// Wait for user
Console.ReadKey();
}
}
/// <summary>
/// The 'AbstractClass' abstract class
/// </summary>
abstract class AbstractClass
{
public abstract void PrimitiveOperation1();
public abstract void PrimitiveOperation2();
// The "Template method"
public void TemplateMethod()
{
PrimitiveOperation1();
PrimitiveOperation2();
Console.WriteLine("");
}
}
/// <summary>
/// A 'ConcreteClass' class
/// </summary>
class ConcreteClassA : AbstractClass
{
public override void PrimitiveOperation1()
{
Console.WriteLine("ConcreteClassA.PrimitiveOperation1()");
}
public override void PrimitiveOperation2()
{
Console.WriteLine("ConcreteClassA.PrimitiveOperation2()");
}
}
/// <summary>
/// A 'ConcreteClass' class
/// </summary>
class ConcreteClassB : AbstractClass
{
public override void PrimitiveOperation1()
{
Console.WriteLine("ConcreteClassB.PrimitiveOperation1()");
}
public override void PrimitiveOperation2()
{
Console.WriteLine("ConcreteClassB.PrimitiveOperation2()");
}
}
}
| {
"content_hash": "1d9c3df4f7d4b609e859950caf57d64d",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 70,
"avg_line_length": 25.095890410958905,
"alnum_prop": 0.5611353711790393,
"repo_name": "Kiandr/MS",
"id": "3cdb770269ca3ba198cace9c938fb440ba9c606a",
"size": "1832",
"binary": false,
"copies": "1",
"ref": "refs/heads/Dev",
"path": "NetPatternDesign/Gang Of Four/DoFactory.GangOfFour.Template.Structural/MainApp.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "32347"
},
{
"name": "C",
"bytes": "96814"
},
{
"name": "C#",
"bytes": "3880677"
},
{
"name": "C++",
"bytes": "60207"
},
{
"name": "CSS",
"bytes": "25903"
},
{
"name": "HTML",
"bytes": "30762"
},
{
"name": "JavaScript",
"bytes": "1119638"
},
{
"name": "Objective-C",
"bytes": "5233"
},
{
"name": "PLpgSQL",
"bytes": "78079"
},
{
"name": "Smalltalk",
"bytes": "23"
},
{
"name": "Visual Basic",
"bytes": "7403"
}
],
"symlink_target": ""
} |
fn main() {
// The array avoids a `Scalar` layout which detects uninit without even doing validation.
let _val = unsafe { std::mem::MaybeUninit::<[*const u8; 1]>::uninit().assume_init() };
//~^ ERROR: uninitialized
}
| {
"content_hash": "7ac06cd1367ee589d146ccd9425ba9b6",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 93,
"avg_line_length": 45.8,
"alnum_prop": 0.6462882096069869,
"repo_name": "rust-lang/miri",
"id": "18703152ea108660e7e21d48826c4d2a5772b01f",
"size": "255",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "tests/fail/validity/uninit_raw_ptr.rs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "513"
},
{
"name": "Python",
"bytes": "7963"
},
{
"name": "Rust",
"bytes": "1616019"
},
{
"name": "Shell",
"bytes": "16574"
}
],
"symlink_target": ""
} |
/*
* This file was automatically generated by sel-utils and
* released under the MIT License.
*
* License: https://github.com/sel-project/sel-utils/blob/master/LICENSE
* Repository: https://github.com/sel-project/sel-utils
* Generated from https://github.com/sel-project/sel-utils/blob/master/xml/protocol/java340.xml
*/
package sul.protocol.java340.serverbound;
import sul.utils.*;
public class UseEntity extends Packet {
public static final int ID = (int)10;
public static final boolean CLIENTBOUND = false;
public static final boolean SERVERBOUND = true;
@Override
public int getId() {
return ID;
}
// type
public static final int INTERACT = (int)0;
public static final int ATTACK = (int)1;
public static final int INTERACT_AT = (int)2;
// hand
public static final int MAIN_HAND = (int)0;
public static final int OFF_HAND = (int)1;
public int target;
public int type;
public Tuples.FloatXYZ targetPosition = new Tuples.FloatXYZ();
public int hand;
public UseEntity() {}
public UseEntity(int target, int type, Tuples.FloatXYZ targetPosition, int hand) {
this.target = target;
this.type = type;
this.targetPosition = targetPosition;
this.hand = hand;
}
@Override
public int length() {
return Buffer.varuintLength(target) + Buffer.varuintLength(type) + Buffer.varuintLength(hand) + 13;
}
@Override
public byte[] encode() {
this._buffer = new byte[this.length()];
this.writeVaruint(ID);
this.writeVaruint(target);
this.writeVaruint(type);
if(type==2){ this.writeBigEndianFloat(targetPosition.x); this.writeBigEndianFloat(targetPosition.y); this.writeBigEndianFloat(targetPosition.z); }
if(type==0||type==2){ this.writeVaruint(hand); }
return this.getBuffer();
}
@Override
public void decode(byte[] buffer) {
this._buffer = buffer;
this.readVaruint();
target=this.readVaruint();
type=this.readVaruint();
if(type==2){ targetPosition=new Tuples.FloatXYZ(); targetPosition.x=readBigEndianFloat(); targetPosition.y=readBigEndianFloat(); targetPosition.z=readBigEndianFloat(); }
if(type==0||type==2){ hand=this.readVaruint(); }
}
public static UseEntity fromBuffer(byte[] buffer) {
UseEntity ret = new UseEntity();
ret.decode(buffer);
return ret;
}
@Override
public String toString() {
return "UseEntity(target: " + this.target + ", type: " + this.type + ", targetPosition: " + this.targetPosition.toString() + ", hand: " + this.hand + ")";
}
} | {
"content_hash": "dd277e08c00d2bc7ab515e30961d40dc",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 171,
"avg_line_length": 28.71764705882353,
"alnum_prop": 0.7156902908643998,
"repo_name": "sel-utils/java",
"id": "577b78a27b713e87e8c507c5ee5ab228bbcefc36",
"size": "2441",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/sul/protocol/java340/serverbound/UseEntity.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "5005359"
}
],
"symlink_target": ""
} |
#ifndef OPENTISSUE_FEM_NODE_TRAITS_H
#define OPENTISSUE_FEM_NODE_TRAITS_H
#include <opentissue/configuration.h>
#include <unordered_map>
namespace opentissue {
namespace fem {
namespace detail {
template<typename math_types> class NodeTraits {
public:
typedef typename math_types::real_type real_type;
typedef typename math_types::vector_type vector_type;
typedef typename math_types::matrix_type matrix_type;
typedef typename math_types::index_type index_type;
typedef typename std::unordered_map<index_type, matrix_type> matrix_container;
typedef typename matrix_container::iterator matrix_iterator;
public:
bool m_fixed;
real_type m_mass;
vector_type m_f0;
vector_type m_f_external;
vector_type m_velocity;
vector_type m_coord;
vector_type m_world_coord;
matrix_container m_K_row;
matrix_container m_A_row;
vector_type m_b;
vector_type m_update;
vector_type m_prev;
vector_type m_residual;
matrix_iterator Kbegin() { return m_K_row.begin(); }
matrix_iterator Kend() { return m_K_row.end(); }
matrix_iterator Abegin() { return m_A_row.begin(); }
matrix_iterator Aend() { return m_A_row.end(); }
matrix_type &K(unsigned int const &column_idx) { return m_K_row[column_idx]; }
matrix_type &A(unsigned int const &column_idx) { return m_A_row[column_idx]; }
NodeTraits() : m_fixed(false) {}
};
}
}
}
#endif | {
"content_hash": "decceb9ed0cbe84aca061bdb43cda889",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 94,
"avg_line_length": 32.68421052631579,
"alnum_prop": 0.5276435856146001,
"repo_name": "danilopeixoto/fem",
"id": "46f36d8f742d0669633a133d073cb350e98156e8",
"size": "2131",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "extlib/opentissue/include/opentissue/fem/node_traits.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "2287"
},
{
"name": "C++",
"bytes": "260969"
},
{
"name": "NSIS",
"bytes": "4024"
}
],
"symlink_target": ""
} |
"use strict";
// eslint-disable-next-line @typescript-eslint/no-var-requires
var install_prerequisite = require("../dist/lib/misc/install_prerequisite").install_prerequisite;
install_prerequisite(function(err){
if (err) {
console.log("err = ",err.message);
}
});
| {
"content_hash": "8617ca8d0c599efde055ff601f2713a2",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 97,
"avg_line_length": 34.875,
"alnum_prop": 0.6989247311827957,
"repo_name": "node-opcua/node-opcua-pki",
"id": "6caf00de86c2265eed4e3964e83e7f53801ca82c",
"size": "299",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bin/install_prerequisite.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "171"
},
{
"name": "JavaScript",
"bytes": "3030"
},
{
"name": "Makefile",
"bytes": "343"
},
{
"name": "TypeScript",
"bytes": "270612"
}
],
"symlink_target": ""
} |
import { Component, Inject, OnInit } from '@angular/core';
import { NB_WINDOW, NbMenuService } from '@nebular/theme';
import { filter, map } from 'rxjs/operators';
@Component({
selector: 'nb-context-menu-click',
templateUrl: './context-menu-click.component.html',
styles: [`
:host nb-layout-header ::ng-deep nav {
justify-content: flex-end;
}
`],
})
export class ContextMenuClickComponent implements OnInit {
items = [
{ title: 'Profile' },
{ title: 'Logout' },
];
constructor(private nbMenuService: NbMenuService, @Inject(NB_WINDOW) private window) {
}
ngOnInit() {
this.nbMenuService.onItemClick()
.pipe(
filter(({ tag }) => tag === 'my-context-menu'),
map(({ item: { title } }) => title),
)
.subscribe(title => this.window.alert(`${title} was clicked!`));
}
}
| {
"content_hash": "567d06a1b52d5c8a7f93e90868e70976",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 88,
"avg_line_length": 27.29032258064516,
"alnum_prop": 0.6182033096926713,
"repo_name": "akveo/nebular",
"id": "db80b7e2f8596e3e4650b87a55271a759d8f3b7a",
"size": "846",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/playground/without-layout/context-menu/context-menu-click.component.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "175100"
},
{
"name": "JavaScript",
"bytes": "15662"
},
{
"name": "SCSS",
"bytes": "494059"
},
{
"name": "Shell",
"bytes": "241"
},
{
"name": "TypeScript",
"bytes": "2454750"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>singapore-gurkhas-050116-gcspf-gurkha-contingent-archives-CBG-28.jpg</title>
<!-- URL Structures -->
<link rel="canonical" href="http://sgpm-generator.github.io/sgpm/singapore-gurkhas-050116-gcspf-gurkha-contingent-archives-cbg-28jpg.html">
<link rel="alternate" type="application/rss+xml" title="Singapore Gurkha Photography Museum" href="http://sgpm-generator.github.io/feed.xml">
<!-- OPENGRAPH tags for Social Media linking -->
<meta content="Singapore Gurkha Photography Museum" property="og:site_name">
<meta content="singapore-gurkhas-050116-gcspf-gurkha-contingent-archives-CBG-28.jpg" property="og:title">
<meta content="article" property="og:type">
<meta name="description" content="The Singapore Gurkha Photography Museum project is an online archive of photographs and documents contributed by former members of the Singapore Gurkhas.
" property="og:description">
<meta content="http://sgpm-generator.github.io/sgpm/singapore-gurkhas-050116-gcspf-gurkha-contingent-archives-cbg-28jpg.html" property="og:url">
<meta content="/img/surfaceiv/F7F7F6AD-E2F3-438E-9853-5912CEB6D416.jpg" property="og:image">
<meta content="1950s" property="article:tag">
<meta content="1960s" property="article:tag">
<meta content="1970s" property="article:tag">
<meta content="1980s" property="article:tag">
<meta content="1990s" property="article:tag">
<meta content="bhairahawa" property="article:tag">
<meta content="dharan" property="article:tag">
<meta content="gurkhas" property="article:tag">
<meta content="kathmandu" property="article:tag">
<meta content="nepal" property="article:tag">
<meta content="pokhara" property="article:tag">
<meta content="singapore" property="article:tag">
<meta content="singapore gurkha archive" property="article:tag">
<meta content="singapore gurkha old photographs" property="article:tag">
<meta content="singapore gurkha photography museum" property="article:tag">
<meta content="singapore gurkhas" property="article:tag">
<!-- OPENGRAPH tags end -->
<!-- CSS -->
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/bootstrap-theme.min.css">
<!-- Custom CSS -->
<style>
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700italic,700,400italic);
.sgpm-title a {
color: #030303;
}
.main-gallery > ul {
margin-bottom:1.414em;
padding-left:0;
}
.no-bullets {
list-style:none;
padding-left:0;
}
.no-bullets > ul {
list-style:none;
padding-left:0;
}
body {min-width:420px;}
footer {
margin-top:2.84em;
padding-top:1.414em;
border-top:0.3px solid #aaa ;
}
header {
margin-bottom:2.84em;
}
main {
display:block;
clear:both;
}
</style>
</head>
<body class="container">
<header class="row">
<!-- masthead -->
<div class="col-xs-4" style="display:table-block;">
<h1 class="sgpm-title hidden-xs hidden-sm"><strong><a class="site-title" href="/">Singapore Gurkha Photography Museum</a></strong></h1>
<h2 class="sgpm-title visible-sm"><strong><a class="site-title" href="/">Singapore Gurkha Photography Museum</a></strong></h2>
<h3 class="sgpm-title visible-xs"><strong><a class="site-title" href="/">Singapore Gurkha Photography Museum</a></strong></h3>
<!-- searchbar-->
<div class="">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search for...">
<span class="input-group-btn">
<button class="btn btn-default" type="button"><span class="hidden-xs">Search</span><span class="visible-xs">Go</span></button>
</span>
</div>
</div>
<!-- searchbar end -->
</div>
<!-- masthead end -->
<nav class="col-xs-4 col-xs-offset-2 col-sm-offset-1">
<ul class="nav col-xs-12" style="padding-top:1.41em;border-left:solid 0.3px #aaa" >
<!-- navlinks -->
<li class="active">
<a href="/about.html">About</a>
</li>
<li class="active">
<a href="/archive.html">Archive</a>
</li>
<li class="active">
<a href="/articles.html">Articles</a>
</li>
<li class="active">
<a href="/contact.html">Contact</a>
</li>
<!-- navlinks end-->
<!-- dev links -->
<li class="small">(these are links for development)</li>
<li class="active">
<a href="/sgpm-list.html">Brute Force List</a>
</li>
<li class="active">
<a href="/basic-generator.html">Brute Generator</a>
</li>
<!-- dev links end-->
</ul>
</nav>
</header>
<main class="row">
<img class="img-responsive" src="../img/singapore-gurkhas-050116-gcspf-gurkha-contingent-archives-CBG-28.jpg" />
<h3>Photo from: Chandra Bahadur Gurung / Singapore Gurkha Photography Museum</h3>
<p>
Chandra having beer with his colleagues in MVC. Date: Unknown.
</p>
<ul style="list-style:none;margin-left:0;">
<a href="/tags/1950s" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> 1950s </li></a>
<a href="/tags/1960s" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> 1960s </li></a>
<a href="/tags/1970s" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> 1970s </li></a>
<a href="/tags/1980s" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> 1980s </li></a>
<a href="/tags/1990s" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> 1990s </li></a>
<a href="/tags/bhairahawa" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> bhairahawa </li></a>
<a href="/tags/dharan" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> dharan </li></a>
<a href="/tags/gurkhas" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> gurkhas </li></a>
<a href="/tags/kathmandu" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> kathmandu </li></a>
<a href="/tags/nepal" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> nepal </li></a>
<a href="/tags/pokhara" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> pokhara </li></a>
<a href="/tags/singapore" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> singapore </li></a>
<a href="/tags/singapore gurkha archive" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> singapore gurkha archive </li></a>
<a href="/tags/singapore gurkha old photographs" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> singapore gurkha old photographs </li></a>
<a href="/tags/singapore gurkha photography museum" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> singapore gurkha photography museum </li></a>
<a href="/tags/singapore gurkhas" style="padding:3px; display:inline-block; background:#eee; margin-bottom:2px;"><li> singapore gurkhas </li></a>
</ul>
</main>
<footer class="row">
<div class="col-sm-4">
<h5 style="margin:0;font-weight:600;">©2016 Singapore Gurkha Photography Museum</h5>
</div>
<div class="col-sm-4">
<ul class="no-bullets">
<!-- contact -->
<li><strong>email: </strong><a href="mailto:mail@zakariazainal.com">mail@zakariazainal.com</a></li>
<!-- social media -->
</ul>
</div>
<div class="col-sm-4">
<p class="small">The Singapore Gurkha Photography Museum project is an online archive of photographs and documents contributed by former members of the Singapore Gurkhas.
</p>
</div>
</footer>
<!-- jQuery -->
<script src="/js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="/js/bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "23282e5e29a2117a9125608e07d09305",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 191,
"avg_line_length": 33.068548387096776,
"alnum_prop": 0.6608950128033166,
"repo_name": "sgpm-generator/sgpm-generator",
"id": "22ec6b6f508a3f0697bd14bc7eab355ad597a0e5",
"size": "8202",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "sgpm/singapore-gurkhas-050116-gcspf-gurkha-contingent-archives-cbg-28jpg.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8828"
},
{
"name": "HTML",
"bytes": "4343189"
},
{
"name": "Ruby",
"bytes": "3995"
},
{
"name": "Shell",
"bytes": "329"
}
],
"symlink_target": ""
} |
<html>
<head>
<title>User agent detail - MQQBrowser/Mini2.2 (SAMSUNG-GT-E2652)</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="section">
<h1 class="header center orange-text">User agent detail</h1>
<div class="row center">
<h5 class="header light">
MQQBrowser/Mini2.2 (SAMSUNG-GT-E2652)
</h5>
</div>
</div>
<div class="section">
<table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Source result (test suite)</th></tr><tr><td>ua-parser/uap-core<br /><small>vendor/thadafinser/uap-core/tests/test_device.yaml</small></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555">Samsung</td><td>GT-E2652</td><td></td><td></td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td></td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-test">Detail</a>
<!-- Modal Structure -->
<div id="modal-test" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Testsuite result detail</h4>
<p><pre><code class="php">Array
(
[user_agent_string] => MQQBrowser/Mini2.2 (SAMSUNG-GT-E2652)
[family] => Samsung GT-E2652
[brand] => Samsung
[model] => GT-E2652
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapPhp<br /><small>6012</small></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>DonatjUAParser<br /><small>v0.5.0</small></td><td>MQQBrowser Mini2.2</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-f1436016-fdf1-4aea-b4be-1d7c99ab0661">Detail</a>
<!-- Modal Structure -->
<div id="modal-f1436016-fdf1-4aea-b4be-1d7c99ab0661" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>DonatjUAParser result detail</h4>
<p><pre><code class="php">Array
(
[platform] =>
[browser] => MQQBrowser
[version] => Mini2.2
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>NeutrinoApiCom<br /><small></small></td><td>QQbrowser Mini2.2</td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555"></td><td></td><td>mobile-browser</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.19002</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-9b0fa449-ec1b-40c8-8b1c-9486eb3b9cbc">Detail</a>
<!-- Modal Structure -->
<div id="modal-9b0fa449-ec1b-40c8-8b1c-9486eb3b9cbc" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>NeutrinoApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[mobile_screen_height] => 90
[is_mobile] => 1
[type] => mobile-browser
[mobile_brand] =>
[mobile_model] =>
[version] => Mini2.2
[is_android] =>
[browser_name] => QQbrowser
[operating_system_family] => unknown
[operating_system_version] =>
[is_ios] =>
[producer] => Tencent Ltd.
[operating_system] => unknown
[mobile_screen_width] => 90
[mobile_browser] =>
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>PiwikDeviceDetector<br /><small>3.5.2</small></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555">Samsung</td><td>GT-E2652</td><td>smartphone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.011</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-21638055-738d-46ba-a1b1-f5114bc26475">Detail</a>
<!-- Modal Structure -->
<div id="modal-21638055-738d-46ba-a1b1-f5114bc26475" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>PiwikDeviceDetector result detail</h4>
<p><pre><code class="php">Array
(
[client] =>
[operatingSystem] => Array
(
)
[device] => Array
(
[brand] => SA
[brandName] => Samsung
[model] => GT-E2652
[device] => 1
[deviceName] => smartphone
)
[bot] =>
[extra] => Array
(
[isBot] =>
[isBrowser] =>
[isFeedReader] =>
[isMobileApp] =>
[isPIM] =>
[isLibrary] =>
[isMediaPlayer] =>
[isCamera] =>
[isCarBrowser] =>
[isConsole] =>
[isFeaturePhone] =>
[isPhablet] =>
[isPortableMediaPlayer] =>
[isSmartDisplay] =>
[isSmartphone] => 1
[isTablet] =>
[isTV] =>
[isDesktop] =>
[isMobile] => 1
[isTouchEnabled] =>
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.0</small></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>UAParser<br /><small>v3.4.5</small></td><td>QQ Browser Mini 2.2</td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Samsung</td><td>GT-E2652</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.004</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-346c1a98-5fd3-454f-b6c8-350f2f505d8b">Detail</a>
<!-- Modal Structure -->
<div id="modal-346c1a98-5fd3-454f-b6c8-350f2f505d8b" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UAParser result detail</h4>
<p><pre><code class="php">UAParser\Result\Client Object
(
[ua] => UAParser\Result\UserAgent Object
(
[major] => 2
[minor] => 2
[patch] =>
[family] => QQ Browser Mini
)
[os] => UAParser\Result\OperatingSystem Object
(
[major] =>
[minor] =>
[patch] =>
[patchMinor] =>
[family] => Other
)
[device] => UAParser\Result\Device Object
(
[brand] => Samsung
[model] => GT-E2652
[family] => Samsung GT-E2652
)
[originalUserAgent] => MQQBrowser/Mini2.2 (SAMSUNG-GT-E2652)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UserAgentStringCom<br /><small></small></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>WhatIsMyBrowserCom<br /><small></small></td><td>QQ Browser </td><td> </td><td> </td><td style="border-left: 1px solid #555">Samsung</td><td></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.41304</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-9795f66f-7271-430e-973a-a5c0e14dc35a">Detail</a>
<!-- Modal Structure -->
<div id="modal-9795f66f-7271-430e-973a-a5c0e14dc35a" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhatIsMyBrowserCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[operating_system_name] =>
[simple_sub_description_string] =>
[simple_browser_string] => QQ Browser
[browser_version] =>
[extra_info] => Array
(
)
[operating_platform] =>
[extra_info_table] => Array
(
)
[layout_engine_name] =>
[detected_addons] => Array
(
)
[operating_system_flavour_code] =>
[hardware_architecture] =>
[operating_system_flavour] =>
[operating_system_frameworks] => Array
(
)
[browser_name_code] => qq-browser
[operating_system_version] =>
[simple_operating_platform_string] => Samsung GT-E2652
[is_abusive] =>
[layout_engine_version] =>
[browser_capabilities] => Array
(
)
[operating_platform_vendor_name] => Samsung
[operating_system] =>
[operating_system_version_full] =>
[operating_platform_code] => GT-E2652
[browser_name] => QQ Browser
[operating_system_name_code] =>
[user_agent] => MQQBrowser/Mini2.2 (SAMSUNG-GT-E2652)
[browser_version_full] =>
[browser] => QQ Browser
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>WhichBrowser<br /><small>2.0.10</small></td><td>QQ Browser Mini 2.2</td><td> </td><td>Touchwiz </td><td style="border-left: 1px solid #555">Samsung</td><td>Champ Duos</td><td>mobile:feature</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.01</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-342c8d32-4765-40a8-8a5c-af3a38d19ae4">Detail</a>
<!-- Modal Structure -->
<div id="modal-342c8d32-4765-40a8-8a5c-af3a38d19ae4" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhichBrowser result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Array
(
[name] => QQ Browser Mini
[version] => 2.2
[type] => browser
)
[os] => Array
(
[name] => Touchwiz
)
[device] => Array
(
[type] => mobile
[subtype] => feature
[manufacturer] => Samsung
[model] => Champ Duos
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Woothee<br /><small>v1.2.0</small></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>Wurfl<br /><small>1.6.4</small></td><td>Opera 11.10</td><td><i class="material-icons">close</i></td><td>Linux armv6l </td><td style="border-left: 1px solid #555"></td><td></td><td>Feature Phone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.018</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-1a1aee36-7ce7-4111-a391-8e2c501f1532">Detail</a>
<!-- Modal Structure -->
<div id="modal-1a1aee36-7ce7-4111-a391-8e2c501f1532" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Wurfl result detail</h4>
<p><pre><code class="php">Array
(
[virtual] => Array
(
[is_android] => false
[is_ios] => false
[is_windows_phone] => false
[is_app] => false
[is_full_desktop] => false
[is_largescreen] => false
[is_mobile] => true
[is_robot] => false
[is_smartphone] => false
[is_touchscreen] => false
[is_wml_preferred] => false
[is_xhtmlmp_preferred] => true
[is_html_preferred] => false
[advertised_device_os] => Linux armv6l
[advertised_device_os_version] =>
[advertised_browser] => Opera
[advertised_browser_version] => 11.10
[complete_device_name] =>
[form_factor] => Feature Phone
[is_phone] => true
[is_app_webview] => false
)
[all] => Array
(
[brand_name] =>
[model_name] =>
[unique] => true
[ununiqueness_handler] =>
[is_wireless_device] => true
[device_claims_web_support] => false
[has_qwerty_keyboard] => false
[can_skip_aligned_link_row] => false
[uaprof] =>
[uaprof2] =>
[uaprof3] =>
[nokia_series] => 0
[nokia_edition] => 0
[device_os] =>
[mobile_browser] =>
[mobile_browser_version] =>
[device_os_version] =>
[pointing_method] =>
[release_date] => 2002_january
[marketing_name] =>
[model_extra_info] =>
[nokia_feature_pack] => 0
[can_assign_phone_number] => true
[is_tablet] => false
[manufacturer_name] =>
[is_bot] => false
[is_google_glass] => false
[proportional_font] => false
[built_in_back_button_support] => false
[card_title_support] => true
[softkey_support] => false
[table_support] => true
[numbered_menus] => false
[menu_with_select_element_recommended] => false
[menu_with_list_of_links_recommended] => true
[icons_on_menu_items_support] => false
[break_list_of_links_with_br_element_recommended] => true
[access_key_support] => false
[wrap_mode_support] => false
[times_square_mode_support] => false
[deck_prefetch_support] => false
[elective_forms_recommended] => true
[wizards_recommended] => false
[image_as_link_support] => false
[insert_br_element_after_widget_recommended] => false
[wml_can_display_images_and_text_on_same_line] => false
[wml_displays_image_in_center] => false
[opwv_wml_extensions_support] => false
[wml_make_phone_call_string] => wtai://wp/mc;
[chtml_display_accesskey] => false
[emoji] => false
[chtml_can_display_images_and_text_on_same_line] => false
[chtml_displays_image_in_center] => false
[imode_region] => none
[chtml_make_phone_call_string] => tel:
[chtml_table_support] => false
[xhtml_honors_bgcolor] => false
[xhtml_supports_forms_in_table] => false
[xhtml_support_wml2_namespace] => false
[xhtml_autoexpand_select] => false
[xhtml_select_as_dropdown] => false
[xhtml_select_as_radiobutton] => false
[xhtml_select_as_popup] => false
[xhtml_display_accesskey] => false
[xhtml_supports_invisible_text] => false
[xhtml_supports_inline_input] => false
[xhtml_supports_monospace_font] => false
[xhtml_supports_table_for_layout] => false
[xhtml_supports_css_cell_table_coloring] => false
[xhtml_format_as_css_property] => false
[xhtml_format_as_attribute] => false
[xhtml_nowrap_mode] => false
[xhtml_marquee_as_css_property] => false
[xhtml_readable_background_color1] => #FFFFFF
[xhtml_readable_background_color2] => #FFFFFF
[xhtml_allows_disabled_form_elements] => false
[xhtml_document_title_support] => true
[xhtml_preferred_charset] => utf8
[opwv_xhtml_extensions_support] => false
[xhtml_make_phone_call_string] => tel:
[xhtmlmp_preferred_mime_type] => application/vnd.wap.xhtml+xml
[xhtml_table_support] => false
[xhtml_send_sms_string] => none
[xhtml_send_mms_string] => none
[xhtml_file_upload] => not_supported
[cookie_support] => true
[accept_third_party_cookie] => true
[xhtml_supports_iframe] => none
[xhtml_avoid_accesskeys] => false
[xhtml_can_embed_video] => none
[ajax_support_javascript] => false
[ajax_manipulate_css] => false
[ajax_support_getelementbyid] => false
[ajax_support_inner_html] => false
[ajax_xhr_type] => none
[ajax_manipulate_dom] => false
[ajax_support_events] => false
[ajax_support_event_listener] => false
[ajax_preferred_geoloc_api] => none
[xhtml_support_level] => 1
[preferred_markup] => html_wi_oma_xhtmlmp_1_0
[wml_1_1] => true
[wml_1_2] => false
[wml_1_3] => false
[html_wi_w3_xhtmlbasic] => true
[html_wi_oma_xhtmlmp_1_0] => true
[html_wi_imode_html_1] => false
[html_wi_imode_html_2] => false
[html_wi_imode_html_3] => false
[html_wi_imode_html_4] => false
[html_wi_imode_html_5] => false
[html_wi_imode_htmlx_1] => false
[html_wi_imode_htmlx_1_1] => false
[html_wi_imode_compact_generic] => false
[html_web_3_2] => false
[html_web_4_0] => false
[voicexml] => false
[multipart_support] => false
[total_cache_disable_support] => false
[time_to_live_support] => false
[resolution_width] => 90
[resolution_height] => 90
[columns] => 11
[max_image_width] => 90
[max_image_height] => 35
[rows] => 6
[physical_screen_width] => 27
[physical_screen_height] => 27
[dual_orientation] => false
[density_class] => 1.0
[wbmp] => true
[bmp] => false
[epoc_bmp] => false
[gif_animated] => false
[jpg] => false
[png] => false
[tiff] => false
[transparent_png_alpha] => false
[transparent_png_index] => false
[svgt_1_1] => false
[svgt_1_1_plus] => false
[greyscale] => false
[gif] => true
[colors] => 256
[webp_lossy_support] => false
[webp_lossless_support] => false
[post_method_support] => true
[basic_authentication_support] => true
[empty_option_value_support] => true
[emptyok] => false
[nokia_voice_call] => false
[wta_voice_call] => false
[wta_phonebook] => false
[wta_misc] => false
[wta_pdc] => false
[https_support] => true
[phone_id_provided] => false
[max_data_rate] => 9
[wifi] => false
[sdio] => false
[vpn] => false
[has_cellular_radio] => true
[max_deck_size] => 4000
[max_url_length_in_requests] => 128
[max_url_length_homepage] => 0
[max_url_length_bookmark] => 0
[max_url_length_cached_page] => 0
[max_no_of_connection_settings] => 0
[max_no_of_bookmarks] => 0
[max_length_of_username] => 0
[max_length_of_password] => 0
[max_object_size] => 0
[downloadfun_support] => false
[directdownload_support] => false
[inline_support] => false
[oma_support] => false
[ringtone] => false
[ringtone_3gpp] => false
[ringtone_midi_monophonic] => false
[ringtone_midi_polyphonic] => false
[ringtone_imelody] => false
[ringtone_digiplug] => false
[ringtone_compactmidi] => false
[ringtone_mmf] => false
[ringtone_rmf] => false
[ringtone_xmf] => false
[ringtone_amr] => false
[ringtone_awb] => false
[ringtone_aac] => false
[ringtone_wav] => false
[ringtone_mp3] => false
[ringtone_spmidi] => false
[ringtone_qcelp] => false
[ringtone_voices] => 1
[ringtone_df_size_limit] => 0
[ringtone_directdownload_size_limit] => 0
[ringtone_inline_size_limit] => 0
[ringtone_oma_size_limit] => 0
[wallpaper] => false
[wallpaper_max_width] => 0
[wallpaper_max_height] => 0
[wallpaper_preferred_width] => 0
[wallpaper_preferred_height] => 0
[wallpaper_resize] => none
[wallpaper_wbmp] => false
[wallpaper_bmp] => false
[wallpaper_gif] => false
[wallpaper_jpg] => false
[wallpaper_png] => false
[wallpaper_tiff] => false
[wallpaper_greyscale] => false
[wallpaper_colors] => 2
[wallpaper_df_size_limit] => 0
[wallpaper_directdownload_size_limit] => 0
[wallpaper_inline_size_limit] => 0
[wallpaper_oma_size_limit] => 0
[screensaver] => false
[screensaver_max_width] => 0
[screensaver_max_height] => 0
[screensaver_preferred_width] => 0
[screensaver_preferred_height] => 0
[screensaver_resize] => none
[screensaver_wbmp] => false
[screensaver_bmp] => false
[screensaver_gif] => false
[screensaver_jpg] => false
[screensaver_png] => false
[screensaver_greyscale] => false
[screensaver_colors] => 2
[screensaver_df_size_limit] => 0
[screensaver_directdownload_size_limit] => 0
[screensaver_inline_size_limit] => 0
[screensaver_oma_size_limit] => 0
[picture] => false
[picture_max_width] => 0
[picture_max_height] => 0
[picture_preferred_width] => 0
[picture_preferred_height] => 0
[picture_resize] => none
[picture_wbmp] => false
[picture_bmp] => false
[picture_gif] => false
[picture_jpg] => false
[picture_png] => false
[picture_greyscale] => false
[picture_colors] => 2
[picture_df_size_limit] => 0
[picture_directdownload_size_limit] => 0
[picture_inline_size_limit] => 0
[picture_oma_size_limit] => 0
[video] => false
[oma_v_1_0_forwardlock] => false
[oma_v_1_0_combined_delivery] => false
[oma_v_1_0_separate_delivery] => false
[streaming_video] => false
[streaming_3gpp] => false
[streaming_mp4] => false
[streaming_mov] => false
[streaming_video_size_limit] => 0
[streaming_real_media] => none
[streaming_flv] => false
[streaming_3g2] => false
[streaming_vcodec_h263_0] => -1
[streaming_vcodec_h263_3] => -1
[streaming_vcodec_mpeg4_sp] => -1
[streaming_vcodec_mpeg4_asp] => -1
[streaming_vcodec_h264_bp] => -1
[streaming_acodec_amr] => none
[streaming_acodec_aac] => none
[streaming_wmv] => none
[streaming_preferred_protocol] => rtsp
[streaming_preferred_http_protocol] => none
[wap_push_support] => false
[connectionless_service_indication] => false
[connectionless_service_load] => false
[connectionless_cache_operation] => false
[connectionoriented_unconfirmed_service_indication] => false
[connectionoriented_unconfirmed_service_load] => false
[connectionoriented_unconfirmed_cache_operation] => false
[connectionoriented_confirmed_service_indication] => false
[connectionoriented_confirmed_service_load] => false
[connectionoriented_confirmed_cache_operation] => false
[utf8_support] => false
[ascii_support] => false
[iso8859_support] => false
[expiration_date] => false
[j2me_cldc_1_0] => false
[j2me_cldc_1_1] => false
[j2me_midp_1_0] => false
[j2me_midp_2_0] => false
[doja_1_0] => false
[doja_1_5] => false
[doja_2_0] => false
[doja_2_1] => false
[doja_2_2] => false
[doja_3_0] => false
[doja_3_5] => false
[doja_4_0] => false
[j2me_jtwi] => false
[j2me_mmapi_1_0] => false
[j2me_mmapi_1_1] => false
[j2me_wmapi_1_0] => false
[j2me_wmapi_1_1] => false
[j2me_wmapi_2_0] => false
[j2me_btapi] => false
[j2me_3dapi] => false
[j2me_locapi] => false
[j2me_nokia_ui] => false
[j2me_motorola_lwt] => false
[j2me_siemens_color_game] => false
[j2me_siemens_extension] => false
[j2me_heap_size] => 0
[j2me_max_jar_size] => 0
[j2me_storage_size] => 0
[j2me_max_record_store_size] => 0
[j2me_screen_width] => 0
[j2me_screen_height] => 0
[j2me_canvas_width] => 0
[j2me_canvas_height] => 0
[j2me_bits_per_pixel] => 0
[j2me_audio_capture_enabled] => false
[j2me_video_capture_enabled] => false
[j2me_photo_capture_enabled] => false
[j2me_capture_image_formats] => none
[j2me_http] => false
[j2me_https] => false
[j2me_socket] => false
[j2me_udp] => false
[j2me_serial] => false
[j2me_gif] => false
[j2me_gif89a] => false
[j2me_jpg] => false
[j2me_png] => false
[j2me_bmp] => false
[j2me_bmp3] => false
[j2me_wbmp] => false
[j2me_midi] => false
[j2me_wav] => false
[j2me_amr] => false
[j2me_mp3] => false
[j2me_mp4] => false
[j2me_imelody] => false
[j2me_rmf] => false
[j2me_au] => false
[j2me_aac] => false
[j2me_realaudio] => false
[j2me_xmf] => false
[j2me_wma] => false
[j2me_3gpp] => false
[j2me_h263] => false
[j2me_svgt] => false
[j2me_mpeg4] => false
[j2me_realvideo] => false
[j2me_real8] => false
[j2me_realmedia] => false
[j2me_left_softkey_code] => 0
[j2me_right_softkey_code] => 0
[j2me_middle_softkey_code] => 0
[j2me_select_key_code] => 0
[j2me_return_key_code] => 0
[j2me_clear_key_code] => 0
[j2me_datefield_no_accepts_null_date] => false
[j2me_datefield_broken] => false
[receiver] => false
[sender] => false
[mms_max_size] => 0
[mms_max_height] => 0
[mms_max_width] => 0
[built_in_recorder] => false
[built_in_camera] => false
[mms_jpeg_baseline] => false
[mms_jpeg_progressive] => false
[mms_gif_static] => false
[mms_gif_animated] => false
[mms_png] => false
[mms_bmp] => false
[mms_wbmp] => false
[mms_amr] => false
[mms_wav] => false
[mms_midi_monophonic] => false
[mms_midi_polyphonic] => false
[mms_midi_polyphonic_voices] => 0
[mms_spmidi] => false
[mms_mmf] => false
[mms_mp3] => false
[mms_evrc] => false
[mms_qcelp] => false
[mms_ota_bitmap] => false
[mms_nokia_wallpaper] => false
[mms_nokia_operatorlogo] => false
[mms_nokia_3dscreensaver] => false
[mms_nokia_ringingtone] => false
[mms_rmf] => false
[mms_xmf] => false
[mms_symbian_install] => false
[mms_jar] => false
[mms_jad] => false
[mms_vcard] => false
[mms_vcalendar] => false
[mms_wml] => false
[mms_wbxml] => false
[mms_wmlc] => false
[mms_video] => false
[mms_mp4] => false
[mms_3gpp] => false
[mms_3gpp2] => false
[mms_max_frame_rate] => 0
[nokiaring] => false
[picturemessage] => false
[operatorlogo] => false
[largeoperatorlogo] => false
[callericon] => false
[nokiavcard] => false
[nokiavcal] => false
[sckl_ringtone] => false
[sckl_operatorlogo] => false
[sckl_groupgraphic] => false
[sckl_vcard] => false
[sckl_vcalendar] => false
[text_imelody] => false
[ems] => false
[ems_variablesizedpictures] => false
[ems_imelody] => false
[ems_odi] => false
[ems_upi] => false
[ems_version] => 0
[siemens_ota] => false
[siemens_logo_width] => 101
[siemens_logo_height] => 29
[siemens_screensaver_width] => 101
[siemens_screensaver_height] => 50
[gprtf] => false
[sagem_v1] => false
[sagem_v2] => false
[panasonic] => false
[sms_enabled] => true
[wav] => false
[mmf] => false
[smf] => false
[mld] => false
[midi_monophonic] => false
[midi_polyphonic] => false
[sp_midi] => false
[rmf] => false
[xmf] => false
[compactmidi] => false
[digiplug] => false
[nokia_ringtone] => false
[imelody] => false
[au] => false
[amr] => false
[awb] => false
[aac] => false
[mp3] => false
[voices] => 1
[qcelp] => false
[evrc] => false
[flash_lite_version] =>
[fl_wallpaper] => false
[fl_screensaver] => false
[fl_standalone] => false
[fl_browser] => false
[fl_sub_lcd] => false
[full_flash_support] => false
[css_supports_width_as_percentage] => true
[css_border_image] => none
[css_rounded_corners] => none
[css_gradient] => none
[css_spriting] => false
[css_gradient_linear] => none
[is_transcoder] => false
[transcoder_ua_header] => user-agent
[rss_support] => false
[pdf_support] => false
[progressive_download] => false
[playback_vcodec_h263_0] => -1
[playback_vcodec_h263_3] => -1
[playback_vcodec_mpeg4_sp] => -1
[playback_vcodec_mpeg4_asp] => -1
[playback_vcodec_h264_bp] => -1
[playback_real_media] => none
[playback_3gpp] => false
[playback_3g2] => false
[playback_mp4] => false
[playback_mov] => false
[playback_acodec_amr] => none
[playback_acodec_aac] => none
[playback_df_size_limit] => 0
[playback_directdownload_size_limit] => 0
[playback_inline_size_limit] => 0
[playback_oma_size_limit] => 0
[playback_acodec_qcelp] => false
[playback_wmv] => none
[hinted_progressive_download] => false
[html_preferred_dtd] => xhtml_mp1
[viewport_supported] => false
[viewport_width] =>
[viewport_userscalable] =>
[viewport_initial_scale] =>
[viewport_maximum_scale] =>
[viewport_minimum_scale] =>
[mobileoptimized] => false
[handheldfriendly] => false
[canvas_support] => none
[image_inlining] => false
[is_smarttv] => false
[is_console] => false
[nfc_support] => false
[ux_full_desktop] => false
[jqm_grade] => none
[is_sencha_touch_ok] => false
[controlcap_is_smartphone] => default
[controlcap_is_ios] => default
[controlcap_is_android] => default
[controlcap_is_robot] => default
[controlcap_is_app] => default
[controlcap_advertised_device_os] => default
[controlcap_advertised_device_os_version] => default
[controlcap_advertised_browser] => default
[controlcap_advertised_browser_version] => default
[controlcap_is_windows_phone] => default
[controlcap_is_full_desktop] => default
[controlcap_is_largescreen] => default
[controlcap_is_mobile] => default
[controlcap_is_touchscreen] => default
[controlcap_is_wml_preferred] => default
[controlcap_is_xhtmlmp_preferred] => default
[controlcap_is_html_preferred] => default
[controlcap_form_factor] => default
[controlcap_complete_device_name] => default
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr></table>
</div>
<div class="section">
<h1 class="header center orange-text">About this comparison</h1>
<div class="row center">
<h5 class="header light">
The primary goal of this project is simple<br />
I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br />
<br />
The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br />
<br />
You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br />
<br />
The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a>
</h5>
</div>
</div>
<div class="card">
<div class="card-content">
Comparison created <i>2016-02-13 13:36:10</i> | by
<a href="https://github.com/ThaDafinser">ThaDafinser</a>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.1.1/list.min.js"></script>
<script>
$(document).ready(function(){
// the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
$('.modal-trigger').leanModal();
});
</script>
</body>
</html> | {
"content_hash": "acb06837e8fe07e7ce58d308e27bc17e",
"timestamp": "",
"source": "github",
"line_count": 944,
"max_line_length": 750,
"avg_line_length": 40.11546610169491,
"alnum_prop": 0.5166759090548998,
"repo_name": "ThaDafinser/UserAgentParserComparison",
"id": "e1b74f0e93bdc44e00b0afbd66163cfe62499cc7",
"size": "37870",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "v4/user-agent-detail/9b/bc/9bbc4964-a2b2-48c6-9fb7-6e0f71a510ab.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2060859160"
}
],
"symlink_target": ""
} |
RSpec.describe YARD::Templates::Helpers::BaseHelper do
include YARD::Templates::Helpers::BaseHelper
describe "#run_verifier" do
it "runs verifier proc against list if provided" do
mock = Verifier.new
expect(mock).to receive(:call).with(1)
expect(mock).to receive(:call).with(2)
expect(mock).to receive(:call).with(3)
expect(self).to receive(:options).at_least(1).times.and_return(Options.new.update(:verifier => mock))
run_verifier [1, 2, 3]
end
it "prunes list if lambda returns false and only false" do
mock = Verifier.new
expect(self).to receive(:options).at_least(1).times.and_return(Options.new.update(:verifier => mock))
expect(mock).to receive(:call).with(1).and_return(false)
expect(mock).to receive(:call).with(2).and_return(true)
expect(mock).to receive(:call).with(3).and_return(nil)
expect(mock).to receive(:call).with(4).and_return("value")
expect(run_verifier([1, 2, 3, 4])).to eq [2, 3, 4]
end
it "returns list if no verifier exists" do
expect(self).to receive(:options).at_least(1).times.and_return(Options.new)
expect(run_verifier([1, 2, 3])).to eq [1, 2, 3]
end
end
describe "#h" do
it "returns just the text" do
expect(h("hello world")).to eq "hello world"
expect(h(nil)).to eq nil
end
end
describe "#link_object" do
it "returns the title if provided" do
expect(link_object(1, "title")).to eq "title"
expect(link_object(Registry.root, "title")).to eq "title"
end
it "returns a path if argument is a Proxy or object" do
expect(link_object(Registry.root)).to eq "Top Level Namespace"
expect(link_object(P("Array"))).to eq "Array"
end
it "returns path of Proxified object if argument is a String or Symbol" do
expect(link_object("Array")).to eq "Array"
expect(link_object(:"A::B")).to eq "A::B"
end
it "returns the argument if not an object, proxy, String or Symbol" do
expect(link_object(1)).to eq 1
end
end
describe "#link_url" do
it "returns the URL" do
expect(link_url("http://url")).to eq "http://url"
end
end
describe "#linkify" do
let(:object) { Registry.root }
# before do
# stub!(:object).and_return(Registry.root)
# end
it "calls #link_url for mailto: links" do
expect(self).to receive(:link_url)
linkify("mailto:steve@example.com")
end
it "calls #link_url for URL schemes (http://)" do
expect(self).to receive(:link_url)
linkify("http://example.com")
end
it "calls #link_file for file: links" do
expect(self).to receive(:link_file).with('Filename', nil, 'anchor')
linkify("file:Filename#anchor")
end
it "passes off to #link_object if argument is an object" do
obj = CodeObjects::NamespaceObject.new(nil, :YARD)
expect(self).to receive(:link_object).with(obj)
linkify obj
end
it "returns empty string and warn if object does not exist" do
expect(log).to receive(:warn).with(/Cannot find object .* for inclusion/)
expect(linkify('include:NotExist')).to eq ''
end
it "passes off to #link_url if argument is recognized as a URL" do
url = "http://yardoc.org/"
expect(self).to receive(:link_url).with(url, nil, {:target => '_parent'})
linkify url
end
it "calls #link_include_object for include:ObjectName" do
obj = CodeObjects::NamespaceObject.new(:root, :Foo)
expect(self).to receive(:link_include_object).with(obj)
linkify 'include:Foo'
end
it "calls #link_include_file for include:file:path/to/file" do
expect(File).to receive(:file?).with('path/to/file').and_return(true)
expect(File).to receive(:read).with('path/to/file').and_return('FOO')
expect(linkify('include:file:path/to/file')).to eq 'FOO'
end
it "does not allow include:file for path above pwd" do
expect(log).to receive(:warn).with("Cannot include file from path `a/b/../../../../file'")
expect(linkify('include:file:a/b/../../../../file')).to eq ''
end
it "warns if include:file:path does not exist" do
expect(log).to receive(:warn).with(/Cannot find file .+ for inclusion/)
expect(linkify('include:file:notexist')).to eq ''
end
end
describe "#format_types" do
it "returns the list of types separated by commas surrounded by brackets" do
expect(format_types(['a', 'b', 'c'])).to eq '(a, b, c)'
end
it "returns the list of types without brackets if brackets=false" do
expect(format_types(['a', 'b', 'c'], false)).to eq 'a, b, c'
end
it "returns an empty string if list is empty or nil" do
expect(format_types(nil)).to eq ""
expect(format_types([])).to eq ""
end
end
describe "#format_object_type" do
it "returns Exception if type is Exception" do
obj = double(:object, :is_exception? => true)
allow(obj).to receive(:is_a?) {|arg| arg == YARD::CodeObjects::ClassObject }
expect(format_object_type(obj)).to eq "Exception"
end
it "returns Class if type is Class" do
obj = double(:object, :is_exception? => false)
allow(obj).to receive(:is_a?) {|arg| arg == YARD::CodeObjects::ClassObject }
expect(format_object_type(obj)).to eq "Class"
end
it "returns object type in other cases" do
obj = double(:object, :type => "value")
expect(format_object_type(obj)).to eq "Value"
end
end
describe "#format_object_title" do
it "returns Top Level Namespace for root object" do
expect(format_object_title(Registry.root)).to eq "Top Level Namespace"
end
it "returns 'type: title' in other cases" do
obj = double(:object, :type => :class, :title => "A::B::C")
expect(format_object_title(obj)).to eq "Class: A::B::C"
end
end
end
| {
"content_hash": "3a18c2ca3667180c4fe1ed6ed46a91cc",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 107,
"avg_line_length": 34.76331360946745,
"alnum_prop": 0.6340425531914894,
"repo_name": "thomthom/yard",
"id": "fc2cd3863a41de9a39f68aa5527d09dceccb9146",
"size": "5906",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "spec/templates/helpers/base_helper_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "34869"
},
{
"name": "HTML",
"bytes": "80916"
},
{
"name": "JavaScript",
"bytes": "16458"
},
{
"name": "Ruby",
"bytes": "1444214"
}
],
"symlink_target": ""
} |
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="NullResourceLocatorProtocols.cs" company="Naos Project">
// Copyright (c) Naos Project 2019. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace Naos.Database.Domain
{
using System.Collections.Generic;
using System.Threading.Tasks;
using OBeautifulCode.Assertion.Recipes;
using OBeautifulCode.Type;
/// <summary>
/// A null object pattern implementation of <see cref="IResourceLocatorProtocols"/>.
/// </summary>
public class NullResourceLocatorProtocols : IResourceLocatorProtocols
{
/// <inheritdoc />
public IReadOnlyCollection<IResourceLocator> Execute(
GetAllResourceLocatorsOp operation)
{
operation.MustForArg(nameof(operation)).NotBeNull();
var result = new[]
{
new NullResourceLocator(),
};
return result;
}
/// <inheritdoc />
public async Task<IReadOnlyCollection<IResourceLocator>> ExecuteAsync(
GetAllResourceLocatorsOp operation)
{
operation.MustForArg(nameof(operation)).NotBeNull();
var result = await Task.FromResult(
new[]
{
new NullResourceLocator(),
});
return result;
}
/// <inheritdoc />
public IResourceLocator Execute(
GetResourceLocatorForUniqueIdentifierOp operation)
{
operation.MustForArg(nameof(operation)).NotBeNull();
var result = new NullResourceLocator();
return result;
}
/// <inheritdoc />
public async Task<IResourceLocator> ExecuteAsync(
GetResourceLocatorForUniqueIdentifierOp operation)
{
operation.MustForArg(nameof(operation)).NotBeNull();
var result = await Task.FromResult(new NullResourceLocator());
return result;
}
/// <inheritdoc />
public ISyncAndAsyncReturningProtocol<GetResourceLocatorByIdOp<TId>, IResourceLocator> GetResourceLocatorByIdProtocol<TId>()
{
var result = new LambdaReturningProtocol<GetResourceLocatorByIdOp<TId>, IResourceLocator>(_ => new NullResourceLocator());
return result;
}
}
}
| {
"content_hash": "d2cf1c03915db43ec3147e8d7fc6da9e",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 134,
"avg_line_length": 32.666666666666664,
"alnum_prop": 0.5498430141287284,
"repo_name": "NaosProject/Naos.Database",
"id": "b6ac7055940f3dc5260ea286ed92e9e964a116d1",
"size": "2550",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Naos.Database.Domain/Protocols/Classes/ResourceLocation/NullResourceLocatorProtocols.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "6941124"
}
],
"symlink_target": ""
} |
from django.utils.six import text_type as str
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.utils import timezone
from .models import Source, Article
class FoiideaTest(TestCase):
def setUp(self):
super(TestCase, self).setUp()
self.source = Source.objects.create(
name='Blog',
homepage='http://blog.example.com/',
url='http://blog.example.com/feed.rss',
crawler='rss',
last_crawled=timezone.now()
)
self.article = Article.objects.create(
title='Title',
text='text',
date=timezone.now(),
url='http://blog.example.com/article',
source=self.source
)
def test_web(self):
response = self.client.get(reverse('foiidea-index'))
self.assertEqual(response.status_code, 200)
article = Article.objects.get_ordered()[0]
response = self.client.get(article.get_absolute_url())
self.assertEqual(response.status_code, 200)
def test_model(self):
self.assertIn(self.article.title, str(self.article))
self.assertIn(self.source.name, str(self.source))
| {
"content_hash": "01b135f7751bf2e676ed2e3087169fde",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 62,
"avg_line_length": 31.81578947368421,
"alnum_prop": 0.618693134822167,
"repo_name": "stefanw/froide-foiidea",
"id": "e1db0a5cf77508cce56b7228c55c212fb2b547f5",
"size": "1209",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "foiidea/tests.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "60948"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2015 Karl Bennett
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.github.shiver-me-timbers</groupId>
<artifactId>multi-invoker-maven-plugin-test</artifactId>
<version>1.2-SNAPSHOT</version>
</parent>
<artifactId>set-profiles-parent</artifactId>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
<description>
This is the parent pom contains the multi-invoker-maven-plugin so that it can be tested from a child module.
</description>
<properties>
<test-invocations/>
<test-profiles/>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.github.shiver-me-timbers</groupId>
<artifactId>multi-invoker-maven-plugin</artifactId>
<version>1.2-SNAPSHOT</version>
<executions>
<execution>
<id>multi-invoker</id>
<goals>
<goal>invoker</goal>
</goals>
<configuration>
<logLevel>ERROR</logLevel>
<invocations>${test-invocations}</invocations>
<profiles>${test-profiles}</profiles>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>default-jar</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
<modules>
<module>set-profiles-from-parent</module>
</modules>
</project>
| {
"content_hash": "56cc032d176d6a0168a874ca253d5bb6",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 204,
"avg_line_length": 35.804597701149426,
"alnum_prop": 0.5428571428571428,
"repo_name": "shiver-me-timbers/multi-invoker-maven-plugin-parent",
"id": "49d04e3edeece89a6a6b3f0c34c3371e7af92eab",
"size": "3115",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "multi-invoker-maven-plugin-test/set-profiles-parent/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "106024"
}
],
"symlink_target": ""
} |
import { CdkStepperNext, CdkStepperPrevious } from '@angular/cdk/stepper';
import { Directive } from '@angular/core';
/** Button that moves to the next step in a stepper workflow. */
@Directive({
selector: 'button[novoStepperNext],novo-button[novoStepperNext]',
host: {
class: 'novo-stepper-next',
'[type]': 'type',
},
inputs: ['type'],
})
export class NovoStepperNext extends CdkStepperNext {}
/** Button that moves to the previous step in a stepper workflow. */
@Directive({
selector: 'button[novoStepperPrevious],novo-button[novoStepperPrevious]',
host: {
class: 'novo-stepper-previous',
'[type]': 'type',
},
inputs: ['type'],
})
export class NovoStepperPrevious extends CdkStepperPrevious {}
| {
"content_hash": "23e01f55851054b3e11795dbfca9d322",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 75,
"avg_line_length": 30.416666666666668,
"alnum_prop": 0.6972602739726027,
"repo_name": "bullhorn/novo-elements",
"id": "6882b8977988806927e80d3d806a317f38692be5",
"size": "730",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "projects/novo-elements/src/elements/stepper/stepper-buttons.component.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "99369"
},
{
"name": "HTML",
"bytes": "200072"
},
{
"name": "JavaScript",
"bytes": "29452"
},
{
"name": "SCSS",
"bytes": "349833"
},
{
"name": "Shell",
"bytes": "1364"
},
{
"name": "TypeScript",
"bytes": "3518153"
}
],
"symlink_target": ""
} |
from ../console import Console
| {
"content_hash": "ac288e041cea472d6ca4592e2e460cae",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 30,
"avg_line_length": 31,
"alnum_prop": 0.7741935483870968,
"repo_name": "hydrius/schwarzschild-radius",
"id": "a5aa35b6912c741ff8d5d2151b20f5daccf039f7",
"size": "31",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "old/SchwarzschildRadius1/testing/consoleTest.py",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "92939"
}
],
"symlink_target": ""
} |
package com.study.shiro.service;
/**
* Created on 2018-01-10
*
* @author liuzhaoyuan
*/
public interface HelloService {
void hello();
void hello1();
void hello2();
void hello3();
String session();
}
| {
"content_hash": "55de52ae5766d8c80256779cbdc8187e",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 32,
"avg_line_length": 12.052631578947368,
"alnum_prop": 0.611353711790393,
"repo_name": "liuzyw/study-hello",
"id": "dd6acb2e712bb5d1579c5803f2312cd5a28443cb",
"size": "229",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spring-shiro/src/main/java/com/study/shiro/service/HelloService.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "900124"
},
{
"name": "Groovy",
"bytes": "1140"
},
{
"name": "HTML",
"bytes": "131801"
},
{
"name": "Java",
"bytes": "1202525"
},
{
"name": "JavaScript",
"bytes": "862324"
},
{
"name": "Lua",
"bytes": "675"
}
],
"symlink_target": ""
} |
package com.example.android.sunshine.utilities;
import android.net.Uri;
import android.util.Log;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Scanner;
/**
* These utilities will be used to communicate with the weather servers.
*/
public final class NetworkUtils {
private static final String TAG = NetworkUtils.class.getSimpleName();
private static final String DYNAMIC_WEATHER_URL =
"https://andfun-weather.udacity.com/weather";
private static final String STATIC_WEATHER_URL =
"https://andfun-weather.udacity.com/staticweather";
private static final String FORECAST_BASE_URL = STATIC_WEATHER_URL;
/*
* NOTE: These values only effect responses from OpenWeatherMap, NOT from the fake weather
* server. They are simply here to allow us to teach you how to build a URL if you were to use
* a real API.If you want to connect your app to OpenWeatherMap's API, feel free to! However,
* we are not going to show you how to do so in this course.
*/
/* The format we want our API to return */
private static final String format = "json";
/* The units we want our API to return */
private static final String units = "metric";
/* The number of days we want our API to return */
private static final int numDays = 14;
final static String QUERY_PARAM = "q";
final static String LAT_PARAM = "lat";
final static String LON_PARAM = "lon";
final static String FORMAT_PARAM = "mode";
final static String UNITS_PARAM = "units";
final static String DAYS_PARAM = "cnt";
/**
* Builds the URL used to talk to the weather server using a location. This location is based
* on the query capabilities of the weather provider that we are using.
*
* @param locationQuery The location that will be queried for.
* @return The URL to use to query the weather server.
*/
public static URL buildUrl(String locationQuery) {
// TODO (1) Fix this method to return the URL used to query Open Weather Map's API
Uri builtUri = Uri.parse(FORECAST_BASE_URL).buildUpon()
.appendQueryParameter(QUERY_PARAM, locationQuery)
.appendQueryParameter(FORMAT_PARAM, format)
.appendQueryParameter(UNITS_PARAM, units)
.appendQueryParameter(DAYS_PARAM, Integer.toString(numDays))
.build();
URL url = null;
try
{
url = new URL(builtUri.toString());
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
Log.v(TAG, "Built URI " + url);
return url;
}
/**
* Builds the URL used to talk to the weather server using latitude and longitude of a
* location.
*
* @param lat The latitude of the location
* @param lon The longitude of the location
* @return The Url to use to query the weather server.
*/
public static URL buildUrl(Double lat, Double lon) {
/** This will be implemented in a future lesson **/
return null;
}
/**
* This method returns the entire result from the HTTP response.
*
* @param url The URL to fetch the HTTP response from.
* @return The contents of the HTTP response.
* @throws IOException Related to network and stream reading
*/
public static String getResponseFromHttpUrl(URL url) throws IOException {
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
try {
InputStream in = urlConnection.getInputStream();
Scanner scanner = new Scanner(in);
scanner.useDelimiter("\\A");
boolean hasInput = scanner.hasNext();
if (hasInput) {
return scanner.next();
} else {
return null;
}
} finally {
urlConnection.disconnect();
}
}
} | {
"content_hash": "5b86bf33b4dbed26dc0465ef06289b1c",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 98,
"avg_line_length": 33.67768595041322,
"alnum_prop": 0.6397546012269939,
"repo_name": "seiko149/ud851-Sunshine",
"id": "f2399520e34f2d7086b5edf314b03d2da01fb28e",
"size": "4694",
"binary": false,
"copies": "1",
"ref": "refs/heads/student",
"path": "S02.01-Exercise-Networking/app/src/main/java/com/example/android/sunshine/utilities/NetworkUtils.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "9034694"
},
{
"name": "Python",
"bytes": "5942"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../nalgebra/geometry/trait.SuperTCategoryOf.html">
</head>
<body>
<p>Redirecting to <a href="../../../nalgebra/geometry/trait.SuperTCategoryOf.html">../../../nalgebra/geometry/trait.SuperTCategoryOf.html</a>...</p>
<script>location.replace("../../../nalgebra/geometry/trait.SuperTCategoryOf.html" + location.search + location.hash);</script>
</body>
</html> | {
"content_hash": "7a6f9625843354ae5a5dd92526700c27",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 152,
"avg_line_length": 45.7,
"alnum_prop": 0.6783369803063457,
"repo_name": "nitro-devs/nitro-game-engine",
"id": "56615972bb0970f15938bb33f65aa4d3a95874ac",
"size": "457",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/nalgebra/geometry/transform/trait.SuperTCategoryOf.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CMake",
"bytes": "1032"
},
{
"name": "Rust",
"bytes": "59380"
}
],
"symlink_target": ""
} |
package com.sabre.oss.conf4j.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Specifies an additional fallback, global configuration key as a source of the property value.
* It is used when the value associated with the key defined by {@link Key} annotation is not available.
* The key specified by {@code @FallbackKey} is <i>absolute</i>. No other prefixes defined by {@link Key}
* on any level is applied.
* <p>
* {@code @FallbackKey} is used primarily to maintain backward compatibility when the original key
* cannot be changed in the underlying data source.
* <p>
* <b>Example usage:</b>
* <pre>
* public interface ConnectionConfiguration {
* // first 'url' key is checked, if the value is not available then 'global.url' key is used
* @Key("url")
* @FallbackKey("global.url")
* String getUrl();
* }
* </pre>
*/
@Retention(RUNTIME)
@Target(METHOD)
@Documented
public @interface FallbackKey {
/**
* Defines the global (absolute), callback key value used as a fallback in the instance a configuration
* does not have configuration value assigned with a key defined by {@link Key} annotation.
*
* @return global (absolute) key
*/
String value();
}
| {
"content_hash": "967c010505b03992c1127144d1e545fb",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 107,
"avg_line_length": 33.976190476190474,
"alnum_prop": 0.716187806587246,
"repo_name": "SabreOSS/conf4j",
"id": "da088c9af3dfe351e84113782bbedf11807cd054",
"size": "2565",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "conf4j-api/src/main/java/com/sabre/oss/conf4j/annotation/FallbackKey.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "1423382"
},
{
"name": "Shell",
"bytes": "6572"
}
],
"symlink_target": ""
} |